Completed
Branch develop (0dad67)
by
unknown
18:14
created
htdocs/core/lib/functions2.lib.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
 		} else {
193 193
 			print ': ';
194 194
 		}
195
-		if (! empty($object->user_creation) && is_object($object->user_creation)) {	// deprecated mode
195
+		if (!empty($object->user_creation) && is_object($object->user_creation)) {	// deprecated mode
196 196
 			if ($object->user_creation->id) {
197 197
 				print $object->user_creation->getNomUrl(-1, '', 0, 0, 0);
198 198
 			} else {
@@ -1209,13 +1209,13 @@  discard block
 block discarded – undo
1209 1209
 	$counter = 0;
1210 1210
 	$sql = "SELECT MAX(".$sqlstring.") as val";
1211 1211
 	$sql .= " FROM ".MAIN_DB_PREFIX.$table;
1212
-	$sql .= " WHERE ".$field." LIKE '".$db->escape($maskLike) . (getDolGlobalString('SEARCH_FOR_NEXT_VAL_ON_START_ONLY') ? "%" : "") . "'";
1212
+	$sql .= " WHERE ".$field." LIKE '".$db->escape($maskLike).(getDolGlobalString('SEARCH_FOR_NEXT_VAL_ON_START_ONLY') ? "%" : "")."'";
1213 1213
 	$sql .= " AND ".$field." NOT LIKE '(PROV%)'";
1214 1214
 
1215 1215
 	// To ensure that all variables within the MAX() brackets are integers
1216 1216
 	// This avoid bad detection of max when data are noised with non numeric values at the position of the numero
1217 1217
 	if (getDolGlobalInt('MAIN_NUMBERING_FILTER_ON_INT_ONLY')) {
1218
-		$sql .= " AND ". $db->regexpsql($sqlstring, '^[0-9]+$', 1);
1218
+		$sql .= " AND ".$db->regexpsql($sqlstring, '^[0-9]+$', 1);
1219 1219
 	}
1220 1220
 
1221 1221
 	if ($bentityon) { // only if entity enable
@@ -1276,7 +1276,7 @@  discard block
 block discarded – undo
1276 1276
 		$ref = '';
1277 1277
 		$sql = "SELECT ".$field." as ref";
1278 1278
 		$sql .= " FROM ".MAIN_DB_PREFIX.$table;
1279
-		$sql .= " WHERE ".$field." LIKE '".$db->escape($maskLike) . (getDolGlobalString('SEARCH_FOR_NEXT_VAL_ON_START_ONLY') ? "%" : "") . "'";
1279
+		$sql .= " WHERE ".$field." LIKE '".$db->escape($maskLike).(getDolGlobalString('SEARCH_FOR_NEXT_VAL_ON_START_ONLY') ? "%" : "")."'";
1280 1280
 		$sql .= " AND ".$field." NOT LIKE '%PROV%'";
1281 1281
 		if ($bentityon) { // only if entity enable
1282 1282
 			$sql .= " AND entity IN (".getEntity($sharetable).")";
@@ -1338,7 +1338,7 @@  discard block
 block discarded – undo
1338 1338
 			$maskrefclient_sql = "SELECT MAX(".$maskrefclient_sqlstring.") as val";
1339 1339
 			$maskrefclient_sql .= " FROM ".MAIN_DB_PREFIX.$table;
1340 1340
 			//$sql.= " WHERE ".$field." not like '(%'";
1341
-			$maskrefclient_sql .= " WHERE ".$field." LIKE '".$db->escape($maskrefclient_maskLike) . (getDolGlobalString('SEARCH_FOR_NEXT_VAL_ON_START_ONLY') ? "%" : "") . "'";
1341
+			$maskrefclient_sql .= " WHERE ".$field." LIKE '".$db->escape($maskrefclient_maskLike).(getDolGlobalString('SEARCH_FOR_NEXT_VAL_ON_START_ONLY') ? "%" : "")."'";
1342 1342
 			if ($bentityon) { // only if entity enable
1343 1343
 				$maskrefclient_sql .= " AND entity IN (".getEntity($sharetable).")";
1344 1344
 			} elseif (!empty($forceentity)) {
@@ -2566,8 +2566,8 @@  discard block
 block discarded – undo
2566 2566
 		$saturation += 1;
2567 2567
 	}
2568 2568
 
2569
-	$lightness = round($lightness*100);
2570
-	$saturation = round($saturation*100);
2569
+	$lightness = round($lightness * 100);
2570
+	$saturation = round($saturation * 100);
2571 2571
 
2572 2572
 	if ($returnArray) {
2573 2573
 		return array(
@@ -2921,7 +2921,7 @@  discard block
 block discarded – undo
2921 2921
 	$string = trim($string);
2922 2922
 
2923 2923
 	// If string does not start and end with parenthesis, we return $string as is.
2924
-	if (! preg_match('/^\(.*\)$/', $string)) {
2924
+	if (!preg_match('/^\(.*\)$/', $string)) {
2925 2925
 		return $string;
2926 2926
 	}
2927 2927
 
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
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 		if (getDolGlobalString('MAIN_USE_JQUERY_JEDITABLE') && !preg_match('/^select;/', $typeofdata)) {
120 120
 			if (!empty($perm)) {
121 121
 				$tmp = explode(':', $typeofdata);
122
-				$ret .= '<div class="editkey_' . $tmp[0] . (!empty($tmp[1]) ? ' ' . $tmp[1] : '') . '" id="' . $htmlname . '">';
122
+				$ret .= '<div class="editkey_'.$tmp[0].(!empty($tmp[1]) ? ' '.$tmp[1] : '').'" id="'.$htmlname.'">';
123 123
 				if ($fieldrequired) {
124 124
 					$ret .= '<span class="fieldrequired">';
125 125
 				}
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
 				if ($fieldrequired) {
132 132
 					$ret .= '</span>';
133 133
 				}
134
-				$ret .= '</div>' . "\n";
134
+				$ret .= '</div>'."\n";
135 135
 			} else {
136 136
 				if ($fieldrequired) {
137 137
 					$ret .= '<span class="fieldrequired">';
@@ -169,8 +169,8 @@  discard block
 block discarded – undo
169 169
 			if (empty($notabletag) && $perm) {
170 170
 				$ret .= '<td class="right">';
171 171
 			}
172
-			if ($htmlname && GETPOST('action', 'aZ09') != 'edit' . $htmlname && $perm) {
173
-				$ret .= '<a class="editfielda reposition" href="' . $_SERVER["PHP_SELF"] . '?action=edit' . $htmlname . '&token=' . newToken() . '&' . $paramid . '=' . $object->id . $moreparam . '">' . img_edit($langs->trans('Edit'), ($notabletag ? 0 : 1)) . '</a>';
172
+			if ($htmlname && GETPOST('action', 'aZ09') != 'edit'.$htmlname && $perm) {
173
+				$ret .= '<a class="editfielda reposition" href="'.$_SERVER["PHP_SELF"].'?action=edit'.$htmlname.'&token='.newToken().'&'.$paramid.'='.$object->id.$moreparam.'">'.img_edit($langs->trans('Edit'), ($notabletag ? 0 : 1)).'</a>';
174 174
 			}
175 175
 			if (!empty($notabletag) && $notabletag == 1) {
176 176
 				if ($text) {
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
 			} elseif ($reg[1] == 'int') {
238 238
 				$typeofdata = 'numeric';
239 239
 			} else {
240
-				return 'ErrorBadParameter ' . $typeofdata;
240
+				return 'ErrorBadParameter '.$typeofdata;
241 241
 			}
242 242
 		}
243 243
 
@@ -248,13 +248,13 @@  discard block
 block discarded – undo
248 248
 			if ($editaction == '') {
249 249
 				$editaction = GETPOST('action', 'aZ09');
250 250
 			}
251
-			$editmode = ($editaction == 'edit' . $htmlname);
251
+			$editmode = ($editaction == 'edit'.$htmlname);
252 252
 			if ($editmode) {	// edit mode
253 253
 				$ret .= "\n";
254
-				$ret .= '<form method="post" action="' . $_SERVER["PHP_SELF"] . ($moreparam ? '?' . $moreparam : '') . '">';
255
-				$ret .= '<input type="hidden" name="action" value="set' . $htmlname . '">';
256
-				$ret .= '<input type="hidden" name="token" value="' . newToken() . '">';
257
-				$ret .= '<input type="hidden" name="' . $paramid . '" value="' . $object->id . '">';
254
+				$ret .= '<form method="post" action="'.$_SERVER["PHP_SELF"].($moreparam ? '?'.$moreparam : '').'">';
255
+				$ret .= '<input type="hidden" name="action" value="set'.$htmlname.'">';
256
+				$ret .= '<input type="hidden" name="token" value="'.newToken().'">';
257
+				$ret .= '<input type="hidden" name="'.$paramid.'" value="'.$object->id.'">';
258 258
 				if (empty($notabletag)) {
259 259
 					$ret .= '<table class="nobordernopadding centpercent">';
260 260
 				}
@@ -263,28 +263,28 @@  discard block
 block discarded – undo
263 263
 				}
264 264
 				if (preg_match('/^(string|safehtmlstring|email|phone|url)/', $typeofdata)) {
265 265
 					$tmp = explode(':', $typeofdata);
266
-					$ret .= '<input type="text" id="' . $htmlname . '" name="' . $htmlname . '" value="' . ($editvalue ? $editvalue : $value) . '"' . (empty($tmp[1]) ? '' : ' size="' . $tmp[1] . '"') . ' autofocus>';
266
+					$ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($editvalue ? $editvalue : $value).'"'.(empty($tmp[1]) ? '' : ' size="'.$tmp[1].'"').' autofocus>';
267 267
 				} elseif (preg_match('/^(integer)/', $typeofdata)) {
268 268
 					$tmp = explode(':', $typeofdata);
269 269
 					$valuetoshow = price2num($editvalue ? $editvalue : $value, 0);
270
-					$ret .= '<input type="text" id="' . $htmlname . '" name="' . $htmlname . '" value="' . $valuetoshow . '"' . (empty($tmp[1]) ? '' : ' size="' . $tmp[1] . '"') . ' autofocus>';
270
+					$ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.$valuetoshow.'"'.(empty($tmp[1]) ? '' : ' size="'.$tmp[1].'"').' autofocus>';
271 271
 				} elseif (preg_match('/^(numeric|amount)/', $typeofdata)) {
272 272
 					$tmp = explode(':', $typeofdata);
273 273
 					$valuetoshow = price2num($editvalue ? $editvalue : $value);
274
-					$ret .= '<input type="text" id="' . $htmlname . '" name="' . $htmlname . '" value="' . ($valuetoshow != '' ? price($valuetoshow) : '') . '"' . (empty($tmp[1]) ? '' : ' size="' . $tmp[1] . '"') . ' autofocus>';
274
+					$ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($valuetoshow != '' ? price($valuetoshow) : '').'"'.(empty($tmp[1]) ? '' : ' size="'.$tmp[1].'"').' autofocus>';
275 275
 				} elseif (preg_match('/^(checkbox)/', $typeofdata)) {
276 276
 					$tmp = explode(':', $typeofdata);
277
-					$ret .= '<input type="checkbox" id="' . $htmlname . '" name="' . $htmlname . '" value="' . ($value ? $value : 'on') . '"' . ($value ? ' checked' : '') . (empty($tmp[1]) ? '' : $tmp[1]) . '/>';
277
+					$ret .= '<input type="checkbox" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($value ? $value : 'on').'"'.($value ? ' checked' : '').(empty($tmp[1]) ? '' : $tmp[1]).'/>';
278 278
 				} elseif (preg_match('/^text/', $typeofdata) || preg_match('/^note/', $typeofdata)) {    // if wysiwyg is enabled $typeofdata = 'ckeditor'
279 279
 					$tmp = explode(':', $typeofdata);
280 280
 					$cols = (empty($tmp[2]) ? '' : $tmp[2]);
281 281
 					$morealt = '';
282 282
 					if (preg_match('/%/', $cols)) {
283
-						$morealt = ' style="width: ' . $cols . '"';
283
+						$morealt = ' style="width: '.$cols.'"';
284 284
 						$cols = '';
285 285
 					}
286 286
 					$valuetoshow = ($editvalue ? $editvalue : $value);
287
-					$ret .= '<textarea id="' . $htmlname . '" name="' . $htmlname . '" wrap="soft" rows="' . (empty($tmp[1]) ? '20' : $tmp[1]) . '"' . ($cols ? ' cols="' . $cols . '"' : 'class="quatrevingtpercent"') . $morealt . '" autofocus>';
287
+					$ret .= '<textarea id="'.$htmlname.'" name="'.$htmlname.'" wrap="soft" rows="'.(empty($tmp[1]) ? '20' : $tmp[1]).'"'.($cols ? ' cols="'.$cols.'"' : 'class="quatrevingtpercent"').$morealt.'" autofocus>';
288 288
 					// textarea convert automatically entities chars into simple chars.
289 289
 					// So we convert & into &amp; so a string like 'a &lt; <b>b</b><br>é<br>&lt;script&gt;alert('X');&lt;script&gt;' stay a correct html and is not converted by textarea component when wysiwig is off.
290 290
 					$valuetoshow = str_replace('&', '&amp;', $valuetoshow);
@@ -294,12 +294,12 @@  discard block
 block discarded – undo
294 294
 					$addnowlink = empty($moreoptions['addnowlink']) ? 0 : $moreoptions['addnowlink'];
295 295
 					$adddateof = empty($moreoptions['adddateof']) ? '' : $moreoptions['adddateof'];
296 296
 					$labeladddateof = empty($moreoptions['labeladddateof']) ? '' : $moreoptions['labeladddateof'];
297
-					$ret .= $this->selectDate($value, $htmlname, 0, 0, 1, 'form' . $htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm);
297
+					$ret .= $this->selectDate($value, $htmlname, 0, 0, 1, 'form'.$htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm);
298 298
 				} elseif ($typeofdata == 'dayhour' || $typeofdata == 'datehourpicker') {
299 299
 					$addnowlink = empty($moreoptions['addnowlink']) ? 0 : $moreoptions['addnowlink'];
300 300
 					$adddateof = empty($moreoptions['adddateof']) ? '' : $moreoptions['adddateof'];
301 301
 					$labeladddateof = empty($moreoptions['labeladddateof']) ? '' : $moreoptions['labeladddateof'];
302
-					$ret .= $this->selectDate($value, $htmlname, 1, 1, 1, 'form' . $htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm);
302
+					$ret .= $this->selectDate($value, $htmlname, 1, 1, 1, 'form'.$htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm);
303 303
 				} elseif (preg_match('/^select;/', $typeofdata)) {
304 304
 					$arraydata = explode(',', preg_replace('/^select;/', '', $typeofdata));
305 305
 					$arraylist = array();
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
 					// TODO Not yet implemented. See code for extrafields
314 314
 				} elseif (preg_match('/^ckeditor/', $typeofdata)) {
315 315
 					$tmp = explode(':', $typeofdata); // Example: ckeditor:dolibarr_zzz:width:height:savemethod:toolbarstartexpanded:rows:cols:uselocalbrowser
316
-					require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';
316
+					require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
317 317
 					$doleditor = new DolEditor($htmlname, ($editvalue ? $editvalue : $value), (empty($tmp[2]) ? '' : $tmp[2]), (empty($tmp[3]) ? '100' : $tmp[3]), (empty($tmp[1]) ? 'dolibarr_notes' : $tmp[1]), 'In', (empty($tmp[5]) ? 0 : $tmp[5]), (isset($tmp[8]) ? ($tmp[8] ? true : false) : true), true, (empty($tmp[6]) ? '20' : $tmp[6]), (empty($tmp[7]) ? '100' : $tmp[7]));
318 318
 					$ret .= $doleditor->Create(1);
319 319
 				} elseif ($typeofdata == 'asis') {
@@ -328,19 +328,19 @@  discard block
 block discarded – undo
328 328
 					$ret .= '<td>';
329 329
 				}
330 330
 				//else $ret.='<div class="clearboth"></div>';
331
-				$ret .= '<input type="submit" class="smallpaddingimp button' . (empty($notabletag) ? '' : ' ') . '" name="modify" value="' . $langs->trans("Modify") . '">';
331
+				$ret .= '<input type="submit" class="smallpaddingimp button'.(empty($notabletag) ? '' : ' ').'" name="modify" value="'.$langs->trans("Modify").'">';
332 332
 				if (preg_match('/ckeditor|textarea/', $typeofdata) && empty($notabletag)) {
333
-					$ret .= '<br>' . "\n";
333
+					$ret .= '<br>'."\n";
334 334
 				}
335
-				$ret .= '<input type="submit" class="smallpaddingimp button button-cancel' . (empty($notabletag) ? '' : ' ') . '" name="cancel" value="' . $langs->trans("Cancel") . '">';
335
+				$ret .= '<input type="submit" class="smallpaddingimp button button-cancel'.(empty($notabletag) ? '' : ' ').'" name="cancel" value="'.$langs->trans("Cancel").'">';
336 336
 				if (empty($notabletag)) {
337 337
 					$ret .= '</td>';
338 338
 				}
339 339
 
340 340
 				if (empty($notabletag)) {
341
-					$ret .= '</tr></table>' . "\n";
341
+					$ret .= '</tr></table>'."\n";
342 342
 				}
343
-				$ret .= '</form>' . "\n";
343
+				$ret .= '</form>'."\n";
344 344
 			} else {		// view mode
345 345
 				if (preg_match('/^email/', $typeofdata)) {
346 346
 					$ret .= dol_print_email($value, 0, 0, 0, 0, 1);
@@ -352,15 +352,15 @@  discard block
 block discarded – undo
352 352
 					$ret .= ($value != '' ? price($value, '', $langs, 0, -1, -1, $conf->currency) : '');
353 353
 				} elseif (preg_match('/^checkbox/', $typeofdata)) {
354 354
 					$tmp = explode(':', $typeofdata);
355
-					$ret .= '<input type="checkbox" disabled id="' . $htmlname . '" name="' . $htmlname . '" value="' . $value . '"' . ($value ? ' checked' : '') . ($tmp[1] ? $tmp[1] : '') . '/>';
355
+					$ret .= '<input type="checkbox" disabled id="'.$htmlname.'" name="'.$htmlname.'" value="'.$value.'"'.($value ? ' checked' : '').($tmp[1] ? $tmp[1] : '').'/>';
356 356
 				} elseif (preg_match('/^text/', $typeofdata) || preg_match('/^note/', $typeofdata)) {
357 357
 					$ret .= dol_htmlwithnojs(dol_string_onlythesehtmltags(dol_htmlentitiesbr($value), 1, 1, 1));
358 358
 				} elseif (preg_match('/^(safehtmlstring|restricthtml)/', $typeofdata)) {	// 'restricthtml' is not an allowed type for editfieldval. Value is 'safehtmlstring'
359 359
 					$ret .= dol_htmlwithnojs(dol_string_onlythesehtmltags($value));
360 360
 				} elseif ($typeofdata == 'day' || $typeofdata == 'datepicker') {
361
-					$ret .= '<span class="valuedate">' . dol_print_date($value, 'day', $gm) . '</span>';
361
+					$ret .= '<span class="valuedate">'.dol_print_date($value, 'day', $gm).'</span>';
362 362
 				} elseif ($typeofdata == 'dayhour' || $typeofdata == 'datehourpicker') {
363
-					$ret .= '<span class="valuedate">' . dol_print_date($value, 'dayhour', $gm) . '</span>';
363
+					$ret .= '<span class="valuedate">'.dol_print_date($value, 'dayhour', $gm).'</span>';
364 364
 				} elseif (preg_match('/^select;/', $typeofdata)) {
365 365
 					$arraydata = explode(',', preg_replace('/^select;/', '', $typeofdata));
366 366
 					$arraylist = array();
@@ -371,9 +371,9 @@  discard block
 block discarded – undo
371 371
 					$ret .= $arraylist[$value];
372 372
 					if ($htmlname == 'fk_product_type') {
373 373
 						if ($value == 0) {
374
-							$ret = img_picto($langs->trans("Product"), 'product', 'class="paddingleftonly paddingrightonly colorgrey"') . $ret;
374
+							$ret = img_picto($langs->trans("Product"), 'product', 'class="paddingleftonly paddingrightonly colorgrey"').$ret;
375 375
 						} else {
376
-							$ret = img_picto($langs->trans("Service"), 'service', 'class="paddingleftonly paddingrightonly colorgrey"') . $ret;
376
+							$ret = img_picto($langs->trans("Service"), 'service', 'class="paddingleftonly paddingrightonly colorgrey"').$ret;
377 377
 						}
378 378
 					}
379 379
 				} elseif (preg_match('/^ckeditor/', $typeofdata)) {
@@ -381,7 +381,7 @@  discard block
 block discarded – undo
381 381
 					if (getDolGlobalString('MAIN_DISABLE_NOTES_TAB')) {
382 382
 						$firstline = preg_replace('/<br>.*/', '', $tmpcontent);
383 383
 						$firstline = preg_replace('/[\n\r].*/', '', $firstline);
384
-						$tmpcontent = $firstline . ((strlen($firstline) != strlen($tmpcontent)) ? '...' : '');
384
+						$tmpcontent = $firstline.((strlen($firstline) != strlen($tmpcontent)) ? '...' : '');
385 385
 					}
386 386
 					// We don't use dol_escape_htmltag to get the html formatting active, but this need we must also
387 387
 					// clean data from some dangerous html
@@ -390,7 +390,7 @@  discard block
 block discarded – undo
390 390
 					if (empty($moreoptions['valuealreadyhtmlescaped'])) {
391 391
 						$ret .= dol_escape_htmltag($value);
392 392
 					} else {
393
-						$ret .= $value;        // $value must be already html escaped.
393
+						$ret .= $value; // $value must be already html escaped.
394 394
 					}
395 395
 				}
396 396
 
@@ -428,7 +428,7 @@  discard block
 block discarded – undo
428 428
 
429 429
 		if (is_array($arrayoflangcode) && count($arrayoflangcode)) {
430 430
 			if (!is_object($extralanguages)) {
431
-				include_once DOL_DOCUMENT_ROOT . '/core/class/extralanguages.class.php';
431
+				include_once DOL_DOCUMENT_ROOT.'/core/class/extralanguages.class.php';
432 432
 				$extralanguages = new ExtraLanguages($this->db);
433 433
 			}
434 434
 			$extralanguages->fetch_name_extralanguages('societe');
@@ -437,17 +437,17 @@  discard block
 block discarded – undo
437 437
 				return ''; // No extralang field to show
438 438
 			}
439 439
 
440
-			$result .= '<!-- Widget for translation -->' . "\n";
441
-			$result .= '<div class="inline-block paddingleft image-' . $object->element . '-' . $fieldname . '">';
440
+			$result .= '<!-- Widget for translation -->'."\n";
441
+			$result .= '<div class="inline-block paddingleft image-'.$object->element.'-'.$fieldname.'">';
442 442
 			$s = img_picto($langs->trans("ShowOtherLanguages"), 'language', '', false, 0, 0, '', 'fa-15 editfieldlang');
443 443
 			$result .= $s;
444 444
 			$result .= '</div>';
445 445
 
446
-			$result .= '<div class="inline-block hidden field-' . $object->element . '-' . $fieldname . '">';
446
+			$result .= '<div class="inline-block hidden field-'.$object->element.'-'.$fieldname.'">';
447 447
 
448 448
 			$resultforextrlang = '';
449 449
 			foreach ($arrayoflangcode as $langcode) {
450
-				$valuetoshow = GETPOSTISSET('field-' . $object->element . "-" . $fieldname . "-" . $langcode) ? GETPOST('field-' . $object->element . '-' . $fieldname . "-" . $langcode, $check) : '';
450
+				$valuetoshow = GETPOSTISSET('field-'.$object->element."-".$fieldname."-".$langcode) ? GETPOST('field-'.$object->element.'-'.$fieldname."-".$langcode, $check) : '';
451 451
 				if (empty($valuetoshow)) {
452 452
 					$object->fetchValuesForExtraLanguages();
453 453
 					//var_dump($object->array_languages);
@@ -459,17 +459,17 @@  discard block
 block discarded – undo
459 459
 
460 460
 				// TODO Use the showInputField() method of ExtraLanguages object
461 461
 				if ($typeofdata == 'textarea') {
462
-					$resultforextrlang .= '<textarea name="field-' . $object->element . "-" . $fieldname . "-" . $langcode . '" id="' . $fieldname . "-" . $langcode . '" class="' . $morecss . '" rows="' . ROWS_2 . '" wrap="soft">';
462
+					$resultforextrlang .= '<textarea name="field-'.$object->element."-".$fieldname."-".$langcode.'" id="'.$fieldname."-".$langcode.'" class="'.$morecss.'" rows="'.ROWS_2.'" wrap="soft">';
463 463
 					$resultforextrlang .= $valuetoshow;
464 464
 					$resultforextrlang .= '</textarea>';
465 465
 				} else {
466
-					$resultforextrlang .= '<input type="text" class="inputfieldforlang ' . ($morecss ? ' ' . $morecss : '') . '" name="field-' . $object->element . '-' . $fieldname . '-' . $langcode . '" value="' . $valuetoshow . '">';
466
+					$resultforextrlang .= '<input type="text" class="inputfieldforlang '.($morecss ? ' '.$morecss : '').'" name="field-'.$object->element.'-'.$fieldname.'-'.$langcode.'" value="'.$valuetoshow.'">';
467 467
 				}
468 468
 			}
469 469
 			$result .= $resultforextrlang;
470 470
 
471 471
 			$result .= '</div>';
472
-			$result .= '<script nonce="' . getNonce() . '">$(".image-' . $object->element . '-' . $fieldname . '").click(function() { console.log("Toggle lang widget"); jQuery(".field-' . $object->element . '-' . $fieldname . '").toggle(); });</script>';
472
+			$result .= '<script nonce="'.getNonce().'">$(".image-'.$object->element.'-'.$fieldname.'").click(function() { console.log("Toggle lang widget"); jQuery(".field-'.$object->element.'-'.$fieldname.'").toggle(); });</script>';
473 473
 		}
474 474
 
475 475
 		return $result;
@@ -534,7 +534,7 @@  discard block
 block discarded – undo
534 534
 				if (!empty($tmp[2])) {
535 535
 					$savemethod = $tmp[2];
536 536
 				}
537
-				$out .= '<input id="width_' . $htmlname . '" value="' . $inputOption . '" type="hidden"/>' . "\n";
537
+				$out .= '<input id="width_'.$htmlname.'" value="'.$inputOption.'" type="hidden"/>'."\n";
538 538
 			} elseif ((preg_match('/^day$/', $inputType)) || (preg_match('/^datepicker/', $inputType)) || (preg_match('/^datehourpicker/', $inputType))) {
539 539
 				$tmp = explode(':', $inputType);
540 540
 				$inputType = $tmp[0];
@@ -545,7 +545,7 @@  discard block
 block discarded – undo
545 545
 					$savemethod = $tmp[2];
546 546
 				}
547 547
 
548
-				$out .= '<input id="timestamp" type="hidden"/>' . "\n"; // Use for timestamp format
548
+				$out .= '<input id="timestamp" type="hidden"/>'."\n"; // Use for timestamp format
549 549
 			} elseif (preg_match('/^(select|autocomplete)/', $inputType)) {
550 550
 				$tmp = explode(':', $inputType);
551 551
 				$inputType = $tmp[0];
@@ -576,40 +576,40 @@  discard block
 block discarded – undo
576 576
 				}
577 577
 
578 578
 				if (isModEnabled('fckeditor')) {
579
-					$out .= '<input id="ckeditor_toolbar" value="' . $toolbar . '" type="hidden"/>' . "\n";
579
+					$out .= '<input id="ckeditor_toolbar" value="'.$toolbar.'" type="hidden"/>'."\n";
580 580
 				} else {
581 581
 					$inputType = 'textarea';
582 582
 				}
583 583
 			}
584 584
 
585
-			$out .= '<input id="element_' . $htmlname . '" value="' . $element . '" type="hidden"/>' . "\n";
586
-			$out .= '<input id="table_element_' . $htmlname . '" value="' . $table_element . '" type="hidden"/>' . "\n";
587
-			$out .= '<input id="fk_element_' . $htmlname . '" value="' . $fk_element . '" type="hidden"/>' . "\n";
588
-			$out .= '<input id="loadmethod_' . $htmlname . '" value="' . $loadmethod . '" type="hidden"/>' . "\n";
585
+			$out .= '<input id="element_'.$htmlname.'" value="'.$element.'" type="hidden"/>'."\n";
586
+			$out .= '<input id="table_element_'.$htmlname.'" value="'.$table_element.'" type="hidden"/>'."\n";
587
+			$out .= '<input id="fk_element_'.$htmlname.'" value="'.$fk_element.'" type="hidden"/>'."\n";
588
+			$out .= '<input id="loadmethod_'.$htmlname.'" value="'.$loadmethod.'" type="hidden"/>'."\n";
589 589
 			if (!empty($savemethod)) {
590
-				$out .= '<input id="savemethod_' . $htmlname . '" value="' . $savemethod . '" type="hidden"/>' . "\n";
590
+				$out .= '<input id="savemethod_'.$htmlname.'" value="'.$savemethod.'" type="hidden"/>'."\n";
591 591
 			}
592 592
 			if (!empty($ext_element)) {
593
-				$out .= '<input id="ext_element_' . $htmlname . '" value="' . $ext_element . '" type="hidden"/>' . "\n";
593
+				$out .= '<input id="ext_element_'.$htmlname.'" value="'.$ext_element.'" type="hidden"/>'."\n";
594 594
 			}
595 595
 			if (!empty($custommsg)) {
596 596
 				if (is_array($custommsg)) {
597 597
 					if (!empty($custommsg['success'])) {
598
-						$out .= '<input id="successmsg_' . $htmlname . '" value="' . $custommsg['success'] . '" type="hidden"/>' . "\n";
598
+						$out .= '<input id="successmsg_'.$htmlname.'" value="'.$custommsg['success'].'" type="hidden"/>'."\n";
599 599
 					}
600 600
 					if (!empty($custommsg['error'])) {
601
-						$out .= '<input id="errormsg_' . $htmlname . '" value="' . $custommsg['error'] . '" type="hidden"/>' . "\n";
601
+						$out .= '<input id="errormsg_'.$htmlname.'" value="'.$custommsg['error'].'" type="hidden"/>'."\n";
602 602
 					}
603 603
 				} else {
604
-					$out .= '<input id="successmsg_' . $htmlname . '" value="' . $custommsg . '" type="hidden"/>' . "\n";
604
+					$out .= '<input id="successmsg_'.$htmlname.'" value="'.$custommsg.'" type="hidden"/>'."\n";
605 605
 				}
606 606
 			}
607 607
 			if ($inputType == 'textarea') {
608
-				$out .= '<input id="textarea_' . $htmlname . '_rows" value="' . $rows . '" type="hidden"/>' . "\n";
609
-				$out .= '<input id="textarea_' . $htmlname . '_cols" value="' . $cols . '" type="hidden"/>' . "\n";
608
+				$out .= '<input id="textarea_'.$htmlname.'_rows" value="'.$rows.'" type="hidden"/>'."\n";
609
+				$out .= '<input id="textarea_'.$htmlname.'_cols" value="'.$cols.'" type="hidden"/>'."\n";
610 610
 			}
611
-			$out .= '<span id="viewval_' . $htmlname . '" class="viewval_' . $inputType . ($button_only ? ' inactive' : ' active') . '">' . $value . '</span>' . "\n";
612
-			$out .= '<span id="editval_' . $htmlname . '" class="editval_' . $inputType . ($button_only ? ' inactive' : ' active') . ' hideobject">' . (!empty($editvalue) ? $editvalue : $value) . '</span>' . "\n";
611
+			$out .= '<span id="viewval_'.$htmlname.'" class="viewval_'.$inputType.($button_only ? ' inactive' : ' active').'">'.$value.'</span>'."\n";
612
+			$out .= '<span id="editval_'.$htmlname.'" class="editval_'.$inputType.($button_only ? ' inactive' : ' active').' hideobject">'.(!empty($editvalue) ? $editvalue : $value).'</span>'."\n";
613 613
 		} else {
614 614
 			$out = $value;
615 615
 		}
@@ -638,12 +638,12 @@  discard block
 block discarded – undo
638 638
 	public function textwithtooltip($text, $htmltext, $tooltipon = 1, $direction = 0, $img = '', $extracss = '', $notabs = 3, $incbefore = '', $noencodehtmltext = 0, $tooltiptrigger = '', $forcenowrap = 0)
639 639
 	{
640 640
 		if ($incbefore) {
641
-			$text = $incbefore . $text;
641
+			$text = $incbefore.$text;
642 642
 		}
643 643
 		if (!$htmltext) {
644 644
 			return $text;
645 645
 		}
646
-		$direction = (int) $direction;    // For backward compatibility when $direction was set to '' instead of 0
646
+		$direction = (int) $direction; // For backward compatibility when $direction was set to '' instead of 0
647 647
 
648 648
 		$tag = 'td';
649 649
 		if ($notabs == 2) {
@@ -657,11 +657,11 @@  discard block
 block discarded – undo
657 657
 
658 658
 		$extrastyle = '';
659 659
 		if ($direction < 0) {
660
-			$extracss = ($extracss ? $extracss . ' ' : '') . ($notabs != 3 ? 'inline-block' : '');
660
+			$extracss = ($extracss ? $extracss.' ' : '').($notabs != 3 ? 'inline-block' : '');
661 661
 			$extrastyle = 'padding: 0px; padding-left: 3px;';
662 662
 		}
663 663
 		if ($direction > 0) {
664
-			$extracss = ($extracss ? $extracss . ' ' : '') . ($notabs != 3 ? 'inline-block' : '');
664
+			$extracss = ($extracss ? $extracss.' ' : '').($notabs != 3 ? 'inline-block' : '');
665 665
 			$extrastyle = 'padding: 0px; padding-right: 3px;';
666 666
 		}
667 667
 
@@ -674,53 +674,53 @@  discard block
 block discarded – undo
674 674
 			$htmltext = str_replace('"', '&quot;', $htmltext);
675 675
 		} else {
676 676
 			$classfortooltip = 'classfortooltiponclick';
677
-			$textfordialog .= '<div style="display: none;" id="idfortooltiponclick_' . $tooltiptrigger . '" class="classfortooltiponclicktext">' . $htmltext . '</div>';
677
+			$textfordialog .= '<div style="display: none;" id="idfortooltiponclick_'.$tooltiptrigger.'" class="classfortooltiponclicktext">'.$htmltext.'</div>';
678 678
 		}
679 679
 		if ($tooltipon == 2 || $tooltipon == 3) {
680
-			$paramfortooltipimg = ' class="' . $classfortooltip . ($notabs != 3 ? ' inline-block' : '') . ($extracss ? ' ' . $extracss : '') . '" style="padding: 0px;' . ($extrastyle ? ' ' . $extrastyle : '') . '"';
680
+			$paramfortooltipimg = ' class="'.$classfortooltip.($notabs != 3 ? ' inline-block' : '').($extracss ? ' '.$extracss : '').'" style="padding: 0px;'.($extrastyle ? ' '.$extrastyle : '').'"';
681 681
 			if ($tooltiptrigger == '') {
682
-				$paramfortooltipimg .= ' title="' . ($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)) . '"'; // Attribute to put on img tag to store tooltip
682
+				$paramfortooltipimg .= ' title="'.($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)).'"'; // Attribute to put on img tag to store tooltip
683 683
 			} else {
684
-				$paramfortooltipimg .= ' dolid="' . $tooltiptrigger . '"';
684
+				$paramfortooltipimg .= ' dolid="'.$tooltiptrigger.'"';
685 685
 			}
686 686
 		} else {
687
-			$paramfortooltipimg = ($extracss ? ' class="' . $extracss . '"' : '') . ($extrastyle ? ' style="' . $extrastyle . '"' : ''); // Attribute to put on td text tag
687
+			$paramfortooltipimg = ($extracss ? ' class="'.$extracss.'"' : '').($extrastyle ? ' style="'.$extrastyle.'"' : ''); // Attribute to put on td text tag
688 688
 		}
689 689
 		if ($tooltipon == 1 || $tooltipon == 3) {
690
-			$paramfortooltiptd = ' class="' . ($tooltipon == 3 ? 'cursorpointer ' : '') . $classfortooltip . ' inline-block' . ($extracss ? ' ' . $extracss : '') . '" style="padding: 0px;' . ($extrastyle ? ' ' . $extrastyle : '') . '" ';
690
+			$paramfortooltiptd = ' class="'.($tooltipon == 3 ? 'cursorpointer ' : '').$classfortooltip.' inline-block'.($extracss ? ' '.$extracss : '').'" style="padding: 0px;'.($extrastyle ? ' '.$extrastyle : '').'" ';
691 691
 			if ($tooltiptrigger == '') {
692
-				$paramfortooltiptd .= ' title="' . ($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)) . '"'; // Attribute to put on td tag to store tooltip
692
+				$paramfortooltiptd .= ' title="'.($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)).'"'; // Attribute to put on td tag to store tooltip
693 693
 			} else {
694
-				$paramfortooltiptd .= ' dolid="' . $tooltiptrigger . '"';
694
+				$paramfortooltiptd .= ' dolid="'.$tooltiptrigger.'"';
695 695
 			}
696 696
 		} else {
697
-			$paramfortooltiptd = ($extracss ? ' class="' . $extracss . '"' : '') . ($extrastyle ? ' style="' . $extrastyle . '"' : ''); // Attribute to put on td text tag
697
+			$paramfortooltiptd = ($extracss ? ' class="'.$extracss.'"' : '').($extrastyle ? ' style="'.$extrastyle.'"' : ''); // Attribute to put on td text tag
698 698
 		}
699 699
 		if (empty($notabs)) {
700 700
 			$s .= '<table class="nobordernopadding"><tr style="height: auto;">';
701 701
 		} elseif ($notabs == 2) {
702
-			$s .= '<div class="inline-block' . ($forcenowrap ? ' nowrap' : '') . '">';
702
+			$s .= '<div class="inline-block'.($forcenowrap ? ' nowrap' : '').'">';
703 703
 		}
704 704
 		// Define value if value is before
705 705
 		if ($direction < 0) {
706
-			$s .= '<' . $tag . $paramfortooltipimg;
706
+			$s .= '<'.$tag.$paramfortooltipimg;
707 707
 			if ($tag == 'td') {
708 708
 				$s .= ' class="valigntop" width="14"';
709 709
 			}
710
-			$s .= '>' . $textfordialog . $img . '</' . $tag . '>';
710
+			$s .= '>'.$textfordialog.$img.'</'.$tag.'>';
711 711
 		}
712 712
 		// Use another method to help avoid having a space in value in order to use this value with jquery
713 713
 		// Define label
714 714
 		if ((string) $text != '') {
715
-			$s .= '<' . $tag . $paramfortooltiptd . '>' . $text . '</' . $tag . '>';
715
+			$s .= '<'.$tag.$paramfortooltiptd.'>'.$text.'</'.$tag.'>';
716 716
 		}
717 717
 		// Define value if value is after
718 718
 		if ($direction > 0) {
719
-			$s .= '<' . $tag . $paramfortooltipimg;
719
+			$s .= '<'.$tag.$paramfortooltipimg;
720 720
 			if ($tag == 'td') {
721 721
 				$s .= ' class="valignmiddle" width="14"';
722 722
 			}
723
-			$s .= '>' . $textfordialog . $img . '</' . $tag . '>';
723
+			$s .= '>'.$textfordialog.$img.'</'.$tag.'>';
724 724
 		}
725 725
 		if (empty($notabs)) {
726 726
 			$s .= '</tr></table>';
@@ -824,7 +824,7 @@  discard block
 block discarded – undo
824 824
 
825 825
 		$disabled = 0;
826 826
 		$ret = '<div class="centpercent center">';
827
-		$ret .= '<select class="flat' . (empty($conf->use_javascript_ajax) ? '' : ' hideobject') . ' ' . $name . ' ' . $name . 'select valignmiddle alignstart" id="' . $name . '" name="' . $name . '"' . ($disabled ? ' disabled="disabled"' : '') . '>';
827
+		$ret .= '<select class="flat'.(empty($conf->use_javascript_ajax) ? '' : ' hideobject').' '.$name.' '.$name.'select valignmiddle alignstart" id="'.$name.'" name="'.$name.'"'.($disabled ? ' disabled="disabled"' : '').'>';
828 828
 
829 829
 		// 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.
830 830
 		$parameters = array();
@@ -834,9 +834,9 @@  discard block
 block discarded – undo
834 834
 			return;
835 835
 		}
836 836
 		if (empty($reshook)) {
837
-			$ret .= '<option value="0"' . ($disabled ? ' disabled="disabled"' : '') . '>-- ' . $langs->trans("SelectAction") . ' --</option>';
837
+			$ret .= '<option value="0"'.($disabled ? ' disabled="disabled"' : '').'>-- '.$langs->trans("SelectAction").' --</option>';
838 838
 			foreach ($arrayofaction as $code => $label) {
839
-				$ret .= '<option value="' . $code . '"' . ($disabled ? ' disabled="disabled"' : '') . ' data-html="' . dol_escape_htmltag($label) . '">' . $label . '</option>';
839
+				$ret .= '<option value="'.$code.'"'.($disabled ? ' disabled="disabled"' : '').' data-html="'.dol_escape_htmltag($label).'">'.$label.'</option>';
840 840
 			}
841 841
 		}
842 842
 		$ret .= $hookmanager->resPrint;
@@ -844,17 +844,17 @@  discard block
 block discarded – undo
844 844
 		$ret .= '</select>';
845 845
 
846 846
 		if (empty($conf->dol_optimize_smallscreen)) {
847
-			$ret .= ajax_combobox('.' . $name . 'select');
847
+			$ret .= ajax_combobox('.'.$name.'select');
848 848
 		}
849 849
 
850 850
 		// 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
851 851
 		$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.
852
-		$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")) . '">';
852
+		$ret .= '<input type="submit" disabled name="confirmmassaction"'.(empty($conf->use_javascript_ajax) ? '' : ' style="display: none"').' class="reposition button smallpaddingimp'.(empty($conf->use_javascript_ajax) ? '' : ' hideobject').' '.$name.' '.$name.'confirmed" value="'.dol_escape_htmltag($langs->trans("Confirm")).'">';
853 853
 		$ret .= '</div>';
854 854
 
855 855
 		if (!empty($conf->use_javascript_ajax)) {
856 856
 			$ret .= '<!-- JS CODE TO ENABLE mass action select -->
857
-    		<script nonce="' . getNonce() . '">
857
+    		<script nonce="' . getNonce().'">
858 858
                         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 */
859 859
         		{
860 860
         			atleastoneselected=0;
@@ -865,11 +865,11 @@  discard block
 block discarded – undo
865 865
 
866 866
 					console.log("initCheckForSelect mode="+mode+" name="+name+" cssclass="+cssclass+" atleastoneselected="+atleastoneselected);
867 867
 
868
-    	  			if (atleastoneselected || ' . $alwaysvisible . ')
868
+    	  			if (atleastoneselected || ' . $alwaysvisible.')
869 869
     	  			{
870 870
                                     jQuery("."+name).show();
871
-        			    ' . ($selected ? 'if (atleastoneselected) { jQuery("."+name+"select").val("' . $selected . '").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', false); }' : '') . '
872
-        			    ' . ($selected ? 'if (! atleastoneselected) { jQuery("."+name+"select").val("0").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', true); } ' : '') . '
871
+        			    ' . ($selected ? 'if (atleastoneselected) { jQuery("."+name+"select").val("'.$selected.'").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', false); }' : '').'
872
+        			    ' . ($selected ? 'if (! atleastoneselected) { jQuery("."+name+"select").val("0").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', true); } ' : '').'
873 873
     	  			}
874 874
     	  			else
875 875
     	  			{
@@ -879,11 +879,11 @@  discard block
 block discarded – undo
879 879
         		}
880 880
 
881 881
         	jQuery(document).ready(function () {
882
-                    initCheckForSelect(0, "' . $name . '", "' . $cssclass . '");
883
-                    jQuery(".' . $cssclass . '").click(function() {
884
-                        initCheckForSelect(1, "' . $name . '", "' . $cssclass . '");
882
+                    initCheckForSelect(0, "' . $name.'", "'.$cssclass.'");
883
+                    jQuery(".' . $cssclass.'").click(function() {
884
+                        initCheckForSelect(1, "' . $name.'", "'.$cssclass.'");
885 885
                     });
886
-                        jQuery(".' . $name . 'select").change(function() {
886
+                        jQuery(".' . $name.'select").change(function() {
887 887
         			var massaction = $( this ).val();
888 888
         			var urlform = $( this ).closest("form").attr("action").replace("#show_files","");
889 889
         			if (massaction == "builddoc")
@@ -891,18 +891,18 @@  discard block
 block discarded – undo
891 891
                         urlform = urlform + "#show_files";
892 892
     	            }
893 893
         			$( this ).closest("form").attr("action", urlform);
894
-                    console.log("we select a mass action name=' . $name . ' massaction="+massaction+" - "+urlform);
894
+                    console.log("we select a mass action name=' . $name.' massaction="+massaction+" - "+urlform);
895 895
         	        /* Warning: if you set submit button to disabled, post using Enter will no more work if there is no other button */
896 896
         			if ($(this).val() != \'0\')
897 897
     	  			{
898
-                                        jQuery(".' . $name . 'confirmed").prop(\'disabled\', false);
899
-										jQuery(".' . $name . 'other").hide();	/* To disable if another div was open */
900
-                                        jQuery(".' . $name . '"+massaction).show();
898
+                                        jQuery(".' . $name.'confirmed").prop(\'disabled\', false);
899
+										jQuery(".' . $name.'other").hide();	/* To disable if another div was open */
900
+                                        jQuery(".' . $name.'"+massaction).show();
901 901
     	  			}
902 902
     	  			else
903 903
     	  			{
904
-                                        jQuery(".' . $name . 'confirmed").prop(\'disabled\', true);
905
-										jQuery(".' . $name . 'other").hide();	/* To disable any div open */
904
+                                        jQuery(".' . $name.'confirmed").prop(\'disabled\', true);
905
+										jQuery(".' . $name.'other").hide();	/* To disable any div open */
906 906
     	  			}
907 907
     	        });
908 908
         	});
@@ -945,14 +945,14 @@  discard block
 block discarded – undo
945 945
 		$atleastonefavorite = 0;
946 946
 
947 947
 		$sql = "SELECT rowid, code as code_iso, code_iso as code_iso3, label, favorite, eec";
948
-		$sql .= " FROM " . $this->db->prefix() . "c_country";
948
+		$sql .= " FROM ".$this->db->prefix()."c_country";
949 949
 		$sql .= " WHERE active > 0";
950 950
 		//$sql.= " ORDER BY code ASC";
951 951
 
952
-		dol_syslog(get_class($this) . "::select_country", LOG_DEBUG);
952
+		dol_syslog(get_class($this)."::select_country", LOG_DEBUG);
953 953
 		$resql = $this->db->query($sql);
954 954
 		if ($resql) {
955
-			$out .= '<select id="select' . $htmlname . '" class="flat maxwidth200onsmartphone selectcountry' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" ' . $htmloption . '>';
955
+			$out .= '<select id="select'.$htmlname.'" class="flat maxwidth200onsmartphone selectcountry'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" '.$htmloption.'>';
956 956
 			$num = $this->db->num_rows($resql);
957 957
 			$i = 0;
958 958
 			if ($num) {
@@ -962,7 +962,7 @@  discard block
 block discarded – undo
962 962
 					$countryArray[$i]['rowid'] = $obj->rowid;
963 963
 					$countryArray[$i]['code_iso'] = $obj->code_iso;
964 964
 					$countryArray[$i]['code_iso3'] = $obj->code_iso3;
965
-					$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 : ''));
965
+					$countryArray[$i]['label'] = ($obj->code_iso && $langs->transnoentitiesnoconv("Country".$obj->code_iso) != "Country".$obj->code_iso ? $langs->transnoentitiesnoconv("Country".$obj->code_iso) : ($obj->label != '-' ? $obj->label : ''));
966 966
 					$countryArray[$i]['favorite'] = $obj->favorite;
967 967
 					$countryArray[$i]['eec'] = $obj->eec;
968 968
 					$favorite[$i] = $obj->favorite;
@@ -980,20 +980,20 @@  discard block
 block discarded – undo
980 980
 
981 981
 				if ($showempty) {
982 982
 					if (is_numeric($showempty)) {
983
-						$out .= '<option value="">&nbsp;</option>' . "\n";
983
+						$out .= '<option value="">&nbsp;</option>'."\n";
984 984
 					} else {
985
-						$out .= '<option value="-1">' . $langs->trans($showempty) . '</option>' . "\n";
985
+						$out .= '<option value="-1">'.$langs->trans($showempty).'</option>'."\n";
986 986
 					}
987 987
 				}
988 988
 
989 989
 				if ($addspecialentries) {    // Add dedicated entries for groups of countries
990 990
 					//if ($showempty) $out.= '<option value="" disabled class="selectoptiondisabledwhite">--------------</option>';
991
-					$out .= '<option value="special_allnotme"' . ($selected == 'special_allnotme' ? ' selected' : '') . '>' . $langs->trans("CountriesExceptMe", $langs->transnoentitiesnoconv("Country" . $mysoc->country_code)) . '</option>';
992
-					$out .= '<option value="special_eec"' . ($selected == 'special_eec' ? ' selected' : '') . '>' . $langs->trans("CountriesInEEC") . '</option>';
991
+					$out .= '<option value="special_allnotme"'.($selected == 'special_allnotme' ? ' selected' : '').'>'.$langs->trans("CountriesExceptMe", $langs->transnoentitiesnoconv("Country".$mysoc->country_code)).'</option>';
992
+					$out .= '<option value="special_eec"'.($selected == 'special_eec' ? ' selected' : '').'>'.$langs->trans("CountriesInEEC").'</option>';
993 993
 					if ($mysoc->isInEEC()) {
994
-						$out .= '<option value="special_eecnotme"' . ($selected == 'special_eecnotme' ? ' selected' : '') . '>' . $langs->trans("CountriesInEECExceptMe", $langs->transnoentitiesnoconv("Country" . $mysoc->country_code)) . '</option>';
994
+						$out .= '<option value="special_eecnotme"'.($selected == 'special_eecnotme' ? ' selected' : '').'>'.$langs->trans("CountriesInEECExceptMe", $langs->transnoentitiesnoconv("Country".$mysoc->country_code)).'</option>';
995 995
 					}
996
-					$out .= '<option value="special_noteec"' . ($selected == 'special_noteec' ? ' selected' : '') . '>' . $langs->trans("CountriesNotInEEC") . '</option>';
996
+					$out .= '<option value="special_noteec"'.($selected == 'special_noteec' ? ' selected' : '').'>'.$langs->trans("CountriesNotInEEC").'</option>';
997 997
 					$out .= '<option value="" disabled class="selectoptiondisabledwhite">------------</option>';
998 998
 				}
999 999
 
@@ -1021,20 +1021,20 @@  discard block
 block discarded – undo
1021 1021
 						$labeltoshow .= '&nbsp;';
1022 1022
 					}
1023 1023
 					if ($row['code_iso']) {
1024
-						$labeltoshow .= ' <span class="opacitymedium">(' . $row['code_iso'] . ')</span>';
1024
+						$labeltoshow .= ' <span class="opacitymedium">('.$row['code_iso'].')</span>';
1025 1025
 						if (empty($hideflags)) {
1026 1026
 							$tmpflag = picto_from_langcode($row['code_iso'], 'class="saturatemedium paddingrightonly"', 1);
1027
-							$labeltoshow = $tmpflag . ' ' . $labeltoshow;
1027
+							$labeltoshow = $tmpflag.' '.$labeltoshow;
1028 1028
 						}
1029 1029
 					}
1030 1030
 
1031 1031
 					if ($selected && $selected != '-1' && ($selected == $row['rowid'] || $selected == $row['code_iso'] || $selected == $row['code_iso3'] || $selected == $row['label'])) {
1032
-						$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']) . '">';
1032
+						$out .= '<option value="'.($usecodeaskey ? ($usecodeaskey == 'code2' ? $row['code_iso'] : $row['code_iso3']) : $row['rowid']).'" selected data-html="'.dol_escape_htmltag($labeltoshow).'" data-eec="'.((int) $row['eec']).'">';
1033 1033
 					} else {
1034
-						$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']) . '">';
1034
+						$out .= '<option value="'.($usecodeaskey ? ($usecodeaskey == 'code2' ? $row['code_iso'] : $row['code_iso3']) : $row['rowid']).'" data-html="'.dol_escape_htmltag($labeltoshow).'" data-eec="'.((int) $row['eec']).'">';
1035 1035
 					}
1036 1036
 					$out .= $labeltoshow;
1037
-					$out .= '</option>' . "\n";
1037
+					$out .= '</option>'."\n";
1038 1038
 				}
1039 1039
 			}
1040 1040
 			$out .= '</select>';
@@ -1043,8 +1043,8 @@  discard block
 block discarded – undo
1043 1043
 		}
1044 1044
 
1045 1045
 		// Make select dynamic
1046
-		include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
1047
-		$out .= ajax_combobox('select' . $htmlname, array(), 0, 0, 'resolve');
1046
+		include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
1047
+		$out .= ajax_combobox('select'.$htmlname, array(), 0, 0, 'resolve');
1048 1048
 
1049 1049
 		return $out;
1050 1050
 	}
@@ -1076,25 +1076,25 @@  discard block
 block discarded – undo
1076 1076
 		$incotermArray = array();
1077 1077
 
1078 1078
 		$sql = "SELECT rowid, code";
1079
-		$sql .= " FROM " . $this->db->prefix() . "c_incoterms";
1079
+		$sql .= " FROM ".$this->db->prefix()."c_incoterms";
1080 1080
 		$sql .= " WHERE active > 0";
1081 1081
 		$sql .= " ORDER BY code ASC";
1082 1082
 
1083
-		dol_syslog(get_class($this) . "::select_incoterm", LOG_DEBUG);
1083
+		dol_syslog(get_class($this)."::select_incoterm", LOG_DEBUG);
1084 1084
 		$resql = $this->db->query($sql);
1085 1085
 		if ($resql) {
1086 1086
 			if ($conf->use_javascript_ajax && !$forcecombo) {
1087
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
1087
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
1088 1088
 				$out .= ajax_combobox($htmlname, $events);
1089 1089
 			}
1090 1090
 
1091 1091
 			if (!empty($page)) {
1092
-				$out .= '<form method="post" action="' . $page . '">';
1092
+				$out .= '<form method="post" action="'.$page.'">';
1093 1093
 				$out .= '<input type="hidden" name="action" value="set_incoterms">';
1094
-				$out .= '<input type="hidden" name="token" value="' . newToken() . '">';
1094
+				$out .= '<input type="hidden" name="token" value="'.newToken().'">';
1095 1095
 			}
1096 1096
 
1097
-			$out .= '<select id="' . $htmlname . '" class="flat selectincoterm width75" name="' . $htmlname . '" ' . $htmloption . '>';
1097
+			$out .= '<select id="'.$htmlname.'" class="flat selectincoterm width75" name="'.$htmlname.'" '.$htmloption.'>';
1098 1098
 			$out .= '<option value="0">&nbsp;</option>';
1099 1099
 			$num = $this->db->num_rows($resql);
1100 1100
 			$i = 0;
@@ -1108,9 +1108,9 @@  discard block
 block discarded – undo
1108 1108
 
1109 1109
 				foreach ($incotermArray as $row) {
1110 1110
 					if ($selected && ($selected == $row['rowid'] || $selected == $row['code'])) {
1111
-						$out .= '<option value="' . $row['rowid'] . '" selected>';
1111
+						$out .= '<option value="'.$row['rowid'].'" selected>';
1112 1112
 					} else {
1113
-						$out .= '<option value="' . $row['rowid'] . '">';
1113
+						$out .= '<option value="'.$row['rowid'].'">';
1114 1114
 					}
1115 1115
 
1116 1116
 					if ($row['code']) {
@@ -1123,13 +1123,13 @@  discard block
 block discarded – undo
1123 1123
 			$out .= '</select>';
1124 1124
 
1125 1125
 			if ($conf->use_javascript_ajax && empty($disableautocomplete)) {
1126
-				$out .= ajax_multiautocompleter('location_incoterms', array(), DOL_URL_ROOT . '/core/ajax/locationincoterms.php') . "\n";
1126
+				$out .= ajax_multiautocompleter('location_incoterms', array(), DOL_URL_ROOT.'/core/ajax/locationincoterms.php')."\n";
1127 1127
 				$moreattrib .= ' autocomplete="off"';
1128 1128
 			}
1129
-			$out .= '<input id="location_incoterms" class="maxwidthonsmartphone type="text" name="location_incoterms" value="' . $location_incoterms . '">' . "\n";
1129
+			$out .= '<input id="location_incoterms" class="maxwidthonsmartphone type="text" name="location_incoterms" value="'.$location_incoterms.'">'."\n";
1130 1130
 
1131 1131
 			if (!empty($page)) {
1132
-				$out .= '<input type="submit" class="button valignmiddle smallpaddingimp nomargintop nomarginbottom" value="' . $langs->trans("Modify") . '"></form>';
1132
+				$out .= '<input type="submit" class="button valignmiddle smallpaddingimp nomargintop nomarginbottom" value="'.$langs->trans("Modify").'"></form>';
1133 1133
 			}
1134 1134
 		} else {
1135 1135
 			dol_print_error($this->db);
@@ -1160,9 +1160,9 @@  discard block
 block discarded – undo
1160 1160
 		if ($forceall == 1 || (empty($forceall) && isModEnabled("product") && isModEnabled("service"))
1161 1161
 			|| (empty($forceall) && !isModEnabled('product') && !isModEnabled('service'))) {
1162 1162
 			if (empty($hidetext)) {
1163
-				print $langs->trans("Type") . ': ';
1163
+				print $langs->trans("Type").': ';
1164 1164
 			}
1165
-			print '<select class="flat" id="select_' . $htmlname . '" name="' . $htmlname . '">';
1165
+			print '<select class="flat" id="select_'.$htmlname.'" name="'.$htmlname.'">';
1166 1166
 			if ($showempty) {
1167 1167
 				print '<option value="-1"';
1168 1168
 				if ($selected == -1) {
@@ -1175,28 +1175,28 @@  discard block
 block discarded – undo
1175 1175
 			if (0 == $selected || ($selected == -1 && getDolGlobalString('MAIN_FREE_PRODUCT_CHECKED_BY_DEFAULT') == 'product')) {
1176 1176
 				print ' selected';
1177 1177
 			}
1178
-			print '>' . $langs->trans("Product");
1178
+			print '>'.$langs->trans("Product");
1179 1179
 
1180 1180
 			print '<option value="1"';
1181 1181
 			if (1 == $selected || ($selected == -1 && getDolGlobalString('MAIN_FREE_PRODUCT_CHECKED_BY_DEFAULT') == 'service')) {
1182 1182
 				print ' selected';
1183 1183
 			}
1184
-			print '>' . $langs->trans("Service");
1184
+			print '>'.$langs->trans("Service");
1185 1185
 
1186 1186
 			print '</select>';
1187
-			print ajax_combobox('select_' . $htmlname);
1187
+			print ajax_combobox('select_'.$htmlname);
1188 1188
 			//if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1);
1189 1189
 		}
1190 1190
 		if ((empty($forceall) && !isModEnabled('product') && isModEnabled("service")) || $forceall == 3) {
1191 1191
 			print $langs->trans("Service");
1192
-			print '<input type="hidden" name="' . $htmlname . '" value="1">';
1192
+			print '<input type="hidden" name="'.$htmlname.'" value="1">';
1193 1193
 		}
1194 1194
 		if ((empty($forceall) && isModEnabled("product") && !isModEnabled('service')) || $forceall == 2) {
1195 1195
 			print $langs->trans("Product");
1196
-			print '<input type="hidden" name="' . $htmlname . '" value="0">';
1196
+			print '<input type="hidden" name="'.$htmlname.'" value="0">';
1197 1197
 		}
1198 1198
 		if ($forceall < 0) {    // This should happened only for contracts when both predefined product and service are disabled.
1199
-			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
1199
+			print '<input type="hidden" name="'.$htmlname.'" value="1">'; // By default we set on service for contract. If CONTRACT_SUPPORT_PRODUCTS is set, forceall should be 1 not -1
1200 1200
 		}
1201 1201
 	}
1202 1202
 
@@ -1222,7 +1222,7 @@  discard block
 block discarded – undo
1222 1222
 		$langs->load("trips");
1223 1223
 
1224 1224
 		$sql = "SELECT c.code, c.label";
1225
-		$sql .= " FROM " . $this->db->prefix() . "c_type_fees as c";
1225
+		$sql .= " FROM ".$this->db->prefix()."c_type_fees as c";
1226 1226
 		$sql .= " WHERE active > 0";
1227 1227
 
1228 1228
 		$resql = $this->db->query($sql);
@@ -1263,11 +1263,11 @@  discard block
 block discarded – undo
1263 1263
 		// phpcs:enable
1264 1264
 		global $user, $langs;
1265 1265
 
1266
-		dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG);
1266
+		dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG);
1267 1267
 
1268 1268
 		$this->load_cache_types_fees();
1269 1269
 
1270
-		print '<select id="select_' . $htmlname . '" class="flat" name="' . $htmlname . '">';
1270
+		print '<select id="select_'.$htmlname.'" class="flat" name="'.$htmlname.'">';
1271 1271
 		if ($showempty) {
1272 1272
 			print '<option value="-1"';
1273 1273
 			if ($selected == -1) {
@@ -1277,7 +1277,7 @@  discard block
 block discarded – undo
1277 1277
 		}
1278 1278
 
1279 1279
 		foreach ($this->cache_types_fees as $key => $value) {
1280
-			print '<option value="' . $key . '"';
1280
+			print '<option value="'.$key.'"';
1281 1281
 			if ($key == $selected) {
1282 1282
 				print ' selected';
1283 1283
 			}
@@ -1328,12 +1328,12 @@  discard block
 block discarded – undo
1328 1328
 				$ajaxoptions = array();
1329 1329
 			}
1330 1330
 
1331
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
1331
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
1332 1332
 
1333 1333
 			// No immediate load of all database
1334 1334
 			$placeholder = '';
1335 1335
 			if ($selected && empty($selected_input_value)) {
1336
-				require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
1336
+				require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
1337 1337
 				$societetmp = new Societe($this->db);
1338 1338
 				$societetmp->fetch($selected);
1339 1339
 				$selected_input_value = $societetmp->name;
@@ -1341,25 +1341,25 @@  discard block
 block discarded – undo
1341 1341
 			}
1342 1342
 
1343 1343
 			// mode 1
1344
-			$urloption = 'htmlname=' . urlencode(str_replace('.', '_', $htmlname)) . '&outjson=1&filter=' . urlencode($filter) . (empty($excludeids) ? '' : '&excludeids=' . join(',', $excludeids)) . ($showtype ? '&showtype=' . urlencode($showtype) : '') . ($showcode ? '&showcode=' . urlencode($showcode) : '');
1344
+			$urloption = 'htmlname='.urlencode(str_replace('.', '_', $htmlname)).'&outjson=1&filter='.urlencode($filter).(empty($excludeids) ? '' : '&excludeids='.join(',', $excludeids)).($showtype ? '&showtype='.urlencode($showtype) : '').($showcode ? '&showcode='.urlencode($showcode) : '');
1345 1345
 
1346 1346
 			$out .= '<!-- force css to be higher than dialog popup --><style type="text/css">.ui-autocomplete { z-index: 1010; }</style>';
1347 1347
 			if (empty($hidelabel)) {
1348
-				print $langs->trans("RefOrLabel") . ' : ';
1348
+				print $langs->trans("RefOrLabel").' : ';
1349 1349
 			} elseif ($hidelabel > 1) {
1350 1350
 				$placeholder = $langs->trans("RefOrLabel");
1351 1351
 				if ($hidelabel == 2) {
1352 1352
 					$out .= img_picto($langs->trans("Search"), 'search');
1353 1353
 				}
1354 1354
 			}
1355
-			$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' : '') . ' />';
1355
+			$out .= '<input type="text" class="'.$morecss.'" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.($placeholder ? ' placeholder="'.dol_escape_htmltag($placeholder).'"' : '').' '.(getDolGlobalString('THIRDPARTY_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />';
1356 1356
 			if ($hidelabel == 3) {
1357 1357
 				$out .= img_picto($langs->trans("Search"), 'search');
1358 1358
 			}
1359 1359
 
1360 1360
 			$out .= ajax_event($htmlname, $events);
1361 1361
 
1362
-			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/societe/ajax/company.php', $urloption, $conf->global->COMPANY_USE_SEARCH_TO_SELECT, 0, $ajaxoptions);
1362
+			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/societe/ajax/company.php', $urloption, $conf->global->COMPANY_USE_SEARCH_TO_SELECT, 0, $ajaxoptions);
1363 1363
 		} else {
1364 1364
 			// Immediate load of all database
1365 1365
 			$out .= $this->select_thirdparty_list($selected, $htmlname, $filter, $showempty, $showtype, $forcecombo, $events, '', 0, $limit, $morecss, $moreparam, $multiple, $excludeids, $showcode);
@@ -1443,30 +1443,30 @@  discard block
 block discarded – undo
1443 1443
 			$sql .= ", s.address, s.zip, s.town";
1444 1444
 			$sql .= ", dictp.code as country_code";
1445 1445
 		}
1446
-		$sql .= " FROM " . $this->db->prefix() . "societe as s";
1446
+		$sql .= " FROM ".$this->db->prefix()."societe as s";
1447 1447
 		if (getDolGlobalString('COMPANY_SHOW_ADDRESS_SELECTLIST')) {
1448
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "c_country as dictp ON dictp.rowid = s.fk_pays";
1448
+			$sql .= " LEFT JOIN ".$this->db->prefix()."c_country as dictp ON dictp.rowid = s.fk_pays";
1449 1449
 		}
1450 1450
 		if (!$user->hasRight('societe', 'client', 'voir')) {
1451
-			$sql .= ", " . $this->db->prefix() . "societe_commerciaux as sc";
1451
+			$sql .= ", ".$this->db->prefix()."societe_commerciaux as sc";
1452 1452
 		}
1453
-		$sql .= " WHERE s.entity IN (" . getEntity('societe') . ")";
1453
+		$sql .= " WHERE s.entity IN (".getEntity('societe').")";
1454 1454
 		if (!empty($user->socid)) {
1455
-			$sql .= " AND s.rowid = " . ((int) $user->socid);
1455
+			$sql .= " AND s.rowid = ".((int) $user->socid);
1456 1456
 		}
1457 1457
 		if ($filter) {
1458 1458
 			// $filter is safe because, if it contains '(' or ')', it has been sanitized by testSqlAndScriptInject() and forgeSQLFromUniversalSearchCriteria()
1459 1459
 			// if not, by testSqlAndScriptInject() only.
1460
-			$sql .= " AND (" . $filter . ")";
1460
+			$sql .= " AND (".$filter.")";
1461 1461
 		}
1462 1462
 		if (!$user->hasRight('societe', 'client', 'voir')) {
1463
-			$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " . ((int) $user->id);
1463
+			$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
1464 1464
 		}
1465 1465
 		if (getDolGlobalString('COMPANY_HIDE_INACTIVE_IN_COMBOBOX')) {
1466 1466
 			$sql .= " AND s.status <> 0";
1467 1467
 		}
1468 1468
 		if (!empty($excludeids)) {
1469
-			$sql .= " AND s.rowid NOT IN (" . $this->db->sanitize(join(',', $excludeids)) . ")";
1469
+			$sql .= " AND s.rowid NOT IN (".$this->db->sanitize(join(',', $excludeids)).")";
1470 1470
 		}
1471 1471
 		// Add where from hooks
1472 1472
 		$parameters = array();
@@ -1486,17 +1486,17 @@  discard block
 block discarded – undo
1486 1486
 				if ($i > 0) {
1487 1487
 					$sql .= " AND ";
1488 1488
 				}
1489
-				$sql .= "(s.nom LIKE '" . $this->db->escape($prefix . $crit) . "%')";
1489
+				$sql .= "(s.nom LIKE '".$this->db->escape($prefix.$crit)."%')";
1490 1490
 				$i++;
1491 1491
 			}
1492 1492
 			if (count($scrit) > 1) {
1493 1493
 				$sql .= ")";
1494 1494
 			}
1495 1495
 			if (isModEnabled('barcode')) {
1496
-				$sql .= " OR s.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
1496
+				$sql .= " OR s.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'";
1497 1497
 			}
1498
-			$sql .= " OR s.code_client LIKE '" . $this->db->escape($prefix . $filterkey) . "%' OR s.code_fournisseur LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
1499
-			$sql .= " OR s.name_alias LIKE '" . $this->db->escape($prefix . $filterkey) . "%' OR s.tva_intra LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
1498
+			$sql .= " OR s.code_client LIKE '".$this->db->escape($prefix.$filterkey)."%' OR s.code_fournisseur LIKE '".$this->db->escape($prefix.$filterkey)."%'";
1499
+			$sql .= " OR s.name_alias LIKE '".$this->db->escape($prefix.$filterkey)."%' OR s.tva_intra LIKE '".$this->db->escape($prefix.$filterkey)."%'";
1500 1500
 			$sql .= ")";
1501 1501
 		}
1502 1502
 		$sql .= $this->db->order("nom", "ASC");
@@ -1507,12 +1507,12 @@  discard block
 block discarded – undo
1507 1507
 		$resql = $this->db->query($sql);
1508 1508
 		if ($resql) {
1509 1509
 			if (!$forcecombo) {
1510
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
1510
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
1511 1511
 				$out .= ajax_combobox($htmlname, $events, getDolGlobalString("COMPANY_USE_SEARCH_TO_SELECT"));
1512 1512
 			}
1513 1513
 
1514 1514
 			// Construct $out and $outarray
1515
-			$out .= '<select id="' . $htmlname . '" class="flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($moreparam ? ' ' . $moreparam : '') . ' name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . '>' . "\n";
1515
+			$out .= '<select id="'.$htmlname.'" class="flat'.($morecss ? ' '.$morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').'>'."\n";
1516 1516
 
1517 1517
 			$textifempty = (($showempty && !is_numeric($showempty)) ? $langs->trans($showempty) : '');
1518 1518
 			if (getDolGlobalString('COMPANY_USE_SEARCH_TO_SELECT')) {
@@ -1525,7 +1525,7 @@  discard block
 block discarded – undo
1525 1525
 				}
1526 1526
 			}
1527 1527
 			if ($showempty) {
1528
-				$out .= '<option value="-1" data-html="' . dol_escape_htmltag('<span class="opacitymedium">' . ($textifempty ? $textifempty : '&nbsp;') . '</span>') . '">' . $textifempty . '</option>' . "\n";
1528
+				$out .= '<option value="-1" data-html="'.dol_escape_htmltag('<span class="opacitymedium">'.($textifempty ? $textifempty : '&nbsp;').'</span>').'">'.$textifempty.'</option>'."\n";
1529 1529
 			}
1530 1530
 
1531 1531
 			$companytemp = new Societe($this->db);
@@ -1538,18 +1538,18 @@  discard block
 block discarded – undo
1538 1538
 					$label = '';
1539 1539
 					if ($showcode || getDolGlobalString('SOCIETE_ADD_REF_IN_LIST')) {
1540 1540
 						if (($obj->client) && (!empty($obj->code_client))) {
1541
-							$label = $obj->code_client . ' - ';
1541
+							$label = $obj->code_client.' - ';
1542 1542
 						}
1543 1543
 						if (($obj->fournisseur) && (!empty($obj->code_fournisseur))) {
1544
-							$label .= $obj->code_fournisseur . ' - ';
1544
+							$label .= $obj->code_fournisseur.' - ';
1545 1545
 						}
1546
-						$label .= ' ' . $obj->name;
1546
+						$label .= ' '.$obj->name;
1547 1547
 					} else {
1548 1548
 						$label = $obj->name;
1549 1549
 					}
1550 1550
 
1551 1551
 					if (!empty($obj->name_alias)) {
1552
-						$label .= ' (' . $obj->name_alias . ')';
1552
+						$label .= ' ('.$obj->name_alias.')';
1553 1553
 					}
1554 1554
 
1555 1555
 					if (getDolGlobalString('SOCIETE_SHOW_VAT_IN_LIST') && !empty($obj->tva_intra)) {
@@ -1564,7 +1564,7 @@  discard block
 block discarded – undo
1564 1564
 						$companytemp->fournisseur = $obj->fournisseur;
1565 1565
 						$tmptype = $companytemp->getTypeUrl(1, '', 0, 'span');
1566 1566
 						if ($tmptype) {
1567
-							$labelhtml .= ' ' . $tmptype;
1567
+							$labelhtml .= ' '.$tmptype;
1568 1568
 						}
1569 1569
 
1570 1570
 						if ($obj->client || $obj->fournisseur) {
@@ -1574,10 +1574,10 @@  discard block
 block discarded – undo
1574 1574
 							$label .= $langs->trans("Customer");
1575 1575
 						}
1576 1576
 						if ($obj->client == 2 || $obj->client == 3) {
1577
-							$label .= ($obj->client == 3 ? ', ' : '') . $langs->trans("Prospect");
1577
+							$label .= ($obj->client == 3 ? ', ' : '').$langs->trans("Prospect");
1578 1578
 						}
1579 1579
 						if ($obj->fournisseur) {
1580
-							$label .= ($obj->client ? ', ' : '') . $langs->trans("Supplier");
1580
+							$label .= ($obj->client ? ', ' : '').$langs->trans("Supplier");
1581 1581
 						}
1582 1582
 						if ($obj->client || $obj->fournisseur) {
1583 1583
 							$label .= ')';
@@ -1585,9 +1585,9 @@  discard block
 block discarded – undo
1585 1585
 					}
1586 1586
 
1587 1587
 					if (getDolGlobalString('COMPANY_SHOW_ADDRESS_SELECTLIST')) {
1588
-						$s = ($obj->address ? ' - ' . $obj->address : '') . ($obj->zip ? ' - ' . $obj->zip : '') . ($obj->town ? ' ' . $obj->town : '');
1588
+						$s = ($obj->address ? ' - '.$obj->address : '').($obj->zip ? ' - '.$obj->zip : '').($obj->town ? ' '.$obj->town : '');
1589 1589
 						if (!empty($obj->country_code)) {
1590
-							$s .= ', ' . $langs->trans('Country' . $obj->country_code);
1590
+							$s .= ', '.$langs->trans('Country'.$obj->country_code);
1591 1591
 						}
1592 1592
 						$label .= $s;
1593 1593
 						$labelhtml .= $s;
@@ -1595,9 +1595,9 @@  discard block
 block discarded – undo
1595 1595
 
1596 1596
 					if (empty($outputmode)) {
1597 1597
 						if (in_array($obj->rowid, $selected)) {
1598
-							$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>';
1598
+							$out .= '<option value="'.$obj->rowid.'" selected data-html="'.dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1).'">'.dol_escape_htmltag($label, 0, 0, '', 0, 1).'</option>';
1599 1599
 						} else {
1600
-							$out .= '<option value="' . $obj->rowid . '" data-html="' . dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1) . '">' . dol_escape_htmltag($label, 0, 0, '', 0, 1) . '</option>';
1600
+							$out .= '<option value="'.$obj->rowid.'" data-html="'.dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1).'">'.dol_escape_htmltag($label, 0, 0, '', 0, 1).'</option>';
1601 1601
 						}
1602 1602
 					} else {
1603 1603
 						array_push($outarray, array('key' => $obj->rowid, 'value' => $label, 'label' => $label, 'labelhtml' => $labelhtml));
@@ -1609,7 +1609,7 @@  discard block
 block discarded – undo
1609 1609
 					}
1610 1610
 				}
1611 1611
 			}
1612
-			$out .= '</select>' . "\n";
1612
+			$out .= '</select>'."\n";
1613 1613
 		} else {
1614 1614
 			dol_print_error($this->db);
1615 1615
 		}
@@ -1643,18 +1643,18 @@  discard block
 block discarded – undo
1643 1643
 		// On recherche les remises
1644 1644
 		$sql = "SELECT re.rowid, re.amount_ht, re.amount_tva, re.amount_ttc,";
1645 1645
 		$sql .= " re.description, re.fk_facture_source";
1646
-		$sql .= " FROM " . $this->db->prefix() . "societe_remise_except as re";
1647
-		$sql .= " WHERE re.fk_soc = " . (int) $socid;
1648
-		$sql .= " AND re.entity = " . $conf->entity;
1646
+		$sql .= " FROM ".$this->db->prefix()."societe_remise_except as re";
1647
+		$sql .= " WHERE re.fk_soc = ".(int) $socid;
1648
+		$sql .= " AND re.entity = ".$conf->entity;
1649 1649
 		if ($filter) {
1650
-			$sql .= " AND " . $filter;
1650
+			$sql .= " AND ".$filter;
1651 1651
 		}
1652 1652
 		$sql .= " ORDER BY re.description ASC";
1653 1653
 
1654
-		dol_syslog(get_class($this) . "::select_remises", LOG_DEBUG);
1654
+		dol_syslog(get_class($this)."::select_remises", LOG_DEBUG);
1655 1655
 		$resql = $this->db->query($sql);
1656 1656
 		if ($resql) {
1657
-			print '<select id="select_' . $htmlname . '" class="flat maxwidthonsmartphone" name="' . $htmlname . '">';
1657
+			print '<select id="select_'.$htmlname.'" class="flat maxwidthonsmartphone" name="'.$htmlname.'">';
1658 1658
 			$num = $this->db->num_rows($resql);
1659 1659
 
1660 1660
 			$qualifiedlines = $num;
@@ -1692,16 +1692,16 @@  discard block
 block discarded – undo
1692 1692
 					if (getDolGlobalString('MAIN_SHOW_FACNUMBER_IN_DISCOUNT_LIST') && !empty($obj->fk_facture_source)) {
1693 1693
 						$tmpfac = new Facture($this->db);
1694 1694
 						if ($tmpfac->fetch($obj->fk_facture_source) > 0) {
1695
-							$desc = $desc . ' - ' . $tmpfac->ref;
1695
+							$desc = $desc.' - '.$tmpfac->ref;
1696 1696
 						}
1697 1697
 					}
1698 1698
 
1699
-					print '<option value="' . $obj->rowid . '"' . $selectstring . $disabled . '>' . $desc . ' (' . price($obj->amount_ht) . ' ' . $langs->trans("HT") . ' - ' . price($obj->amount_ttc) . ' ' . $langs->trans("TTC") . ')</option>';
1699
+					print '<option value="'.$obj->rowid.'"'.$selectstring.$disabled.'>'.$desc.' ('.price($obj->amount_ht).' '.$langs->trans("HT").' - '.price($obj->amount_ttc).' '.$langs->trans("TTC").')</option>';
1700 1700
 					$i++;
1701 1701
 				}
1702 1702
 			}
1703 1703
 			print '</select>';
1704
-			print ajax_combobox('select_' . $htmlname);
1704
+			print ajax_combobox('select_'.$htmlname);
1705 1705
 
1706 1706
 			return $qualifiedlines;
1707 1707
 		} else {
@@ -1782,7 +1782,7 @@  discard block
 block discarded – undo
1782 1782
 		$out = '';
1783 1783
 
1784 1784
 		if (!is_object($hookmanager)) {
1785
-			include_once DOL_DOCUMENT_ROOT . '/core/class/hookmanager.class.php';
1785
+			include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
1786 1786
 			$hookmanager = new HookManager($this->db);
1787 1787
 		}
1788 1788
 
@@ -1791,13 +1791,13 @@  discard block
 block discarded – undo
1791 1791
 		if ($showsoc > 0 || getDolGlobalString('CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST')) {
1792 1792
 			$sql .= ", s.nom as company, s.town AS company_town";
1793 1793
 		}
1794
-		$sql .= " FROM " . $this->db->prefix() . "socpeople as sp";
1794
+		$sql .= " FROM ".$this->db->prefix()."socpeople as sp";
1795 1795
 		if ($showsoc > 0 || getDolGlobalString('CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST')) {
1796
-			$sql .= " LEFT OUTER JOIN  " . $this->db->prefix() . "societe as s ON s.rowid=sp.fk_soc";
1796
+			$sql .= " LEFT OUTER JOIN  ".$this->db->prefix()."societe as s ON s.rowid=sp.fk_soc";
1797 1797
 		}
1798
-		$sql .= " WHERE sp.entity IN (" . getEntity('contact') . ")";
1798
+		$sql .= " WHERE sp.entity IN (".getEntity('contact').")";
1799 1799
 		if ($socid > 0 || $socid == -1) {
1800
-			$sql .= " AND sp.fk_soc = " . ((int) $socid);
1800
+			$sql .= " AND sp.fk_soc = ".((int) $socid);
1801 1801
 		}
1802 1802
 		if (getDolGlobalString('CONTACT_HIDE_INACTIVE_IN_COMBOBOX')) {
1803 1803
 			$sql .= " AND sp.statut <> 0";
@@ -1808,30 +1808,30 @@  discard block
 block discarded – undo
1808 1808
 		$sql .= $hookmanager->resPrint;
1809 1809
 		$sql .= " ORDER BY sp.lastname ASC";
1810 1810
 
1811
-		dol_syslog(get_class($this) . "::selectcontacts", LOG_DEBUG);
1811
+		dol_syslog(get_class($this)."::selectcontacts", LOG_DEBUG);
1812 1812
 		$resql = $this->db->query($sql);
1813 1813
 		if ($resql) {
1814 1814
 			$num = $this->db->num_rows($resql);
1815 1815
 
1816 1816
 			if ($htmlname != 'none' && !$options_only) {
1817
-				$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlid . '" name="' . $htmlname . (($num || empty($disableifempty)) ? '' : ' disabled') . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . ' ' . (!empty($moreparam) ? $moreparam : '') . '>';
1817
+				$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="'.$htmlid.'" name="'.$htmlname.(($num || empty($disableifempty)) ? '' : ' disabled').($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.(!empty($moreparam) ? $moreparam : '').'>';
1818 1818
 			}
1819 1819
 
1820 1820
 			if ($showempty && !is_numeric($showempty)) {
1821 1821
 				$textforempty = $showempty;
1822
-				$out .= '<option class="optiongrey" value="-1"' . (in_array(-1, $selected) ? ' selected' : '') . '>' . $textforempty . '</option>';
1822
+				$out .= '<option class="optiongrey" value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'>'.$textforempty.'</option>';
1823 1823
 			} else {
1824 1824
 				if (($showempty == 1 || ($showempty == 3 && $num > 1)) && !$multiple) {
1825
-					$out .= '<option value="0"' . (in_array(0, $selected) ? ' selected' : '') . '>&nbsp;</option>';
1825
+					$out .= '<option value="0"'.(in_array(0, $selected) ? ' selected' : '').'>&nbsp;</option>';
1826 1826
 				}
1827 1827
 				if ($showempty == 2) {
1828
-					$out .= '<option value="0"' . (in_array(0, $selected) ? ' selected' : '') . '>-- ' . $langs->trans("Internal") . ' --</option>';
1828
+					$out .= '<option value="0"'.(in_array(0, $selected) ? ' selected' : '').'>-- '.$langs->trans("Internal").' --</option>';
1829 1829
 				}
1830 1830
 			}
1831 1831
 
1832 1832
 			$i = 0;
1833 1833
 			if ($num) {
1834
-				include_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php';
1834
+				include_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
1835 1835
 				$contactstatic = new Contact($this->db);
1836 1836
 
1837 1837
 				while ($i < $num) {
@@ -1867,7 +1867,7 @@  discard block
 block discarded – undo
1867 1867
 						}
1868 1868
 						$extendedInfos = implode(' - ', $extendedInfos);
1869 1869
 						if (!empty($extendedInfos)) {
1870
-							$extendedInfos = ' - ' . $extendedInfos;
1870
+							$extendedInfos = ' - '.$extendedInfos;
1871 1871
 						}
1872 1872
 					}
1873 1873
 
@@ -1884,42 +1884,42 @@  discard block
 block discarded – undo
1884 1884
 								$disabled = 1;
1885 1885
 							}
1886 1886
 							if (!empty($selected) && in_array($obj->rowid, $selected)) {
1887
-								$out .= '<option value="' . $obj->rowid . '"';
1887
+								$out .= '<option value="'.$obj->rowid.'"';
1888 1888
 								if ($disabled) {
1889 1889
 									$out .= ' disabled';
1890 1890
 								}
1891 1891
 								$out .= ' selected>';
1892
-								$out .= $contactstatic->getFullName($langs) . $extendedInfos;
1892
+								$out .= $contactstatic->getFullName($langs).$extendedInfos;
1893 1893
 								if ($showfunction && $obj->poste) {
1894
-									$out .= ' (' . $obj->poste . ')';
1894
+									$out .= ' ('.$obj->poste.')';
1895 1895
 								}
1896 1896
 								if (($showsoc > 0) && $obj->company) {
1897
-									$out .= ' - (' . $obj->company . ')';
1897
+									$out .= ' - ('.$obj->company.')';
1898 1898
 								}
1899 1899
 								$out .= '</option>';
1900 1900
 							} else {
1901
-								$out .= '<option value="' . $obj->rowid . '"';
1901
+								$out .= '<option value="'.$obj->rowid.'"';
1902 1902
 								if ($disabled) {
1903 1903
 									$out .= ' disabled';
1904 1904
 								}
1905 1905
 								$out .= '>';
1906
-								$out .= $contactstatic->getFullName($langs) . $extendedInfos;
1906
+								$out .= $contactstatic->getFullName($langs).$extendedInfos;
1907 1907
 								if ($showfunction && $obj->poste) {
1908
-									$out .= ' (' . $obj->poste . ')';
1908
+									$out .= ' ('.$obj->poste.')';
1909 1909
 								}
1910 1910
 								if (($showsoc > 0) && $obj->company) {
1911
-									$out .= ' - (' . $obj->company . ')';
1911
+									$out .= ' - ('.$obj->company.')';
1912 1912
 								}
1913 1913
 								$out .= '</option>';
1914 1914
 							}
1915 1915
 						} else {
1916 1916
 							if (in_array($obj->rowid, $selected)) {
1917
-								$out .= $contactstatic->getFullName($langs) . $extendedInfos;
1917
+								$out .= $contactstatic->getFullName($langs).$extendedInfos;
1918 1918
 								if ($showfunction && $obj->poste) {
1919
-									$out .= ' (' . $obj->poste . ')';
1919
+									$out .= ' ('.$obj->poste.')';
1920 1920
 								}
1921 1921
 								if (($showsoc > 0) && $obj->company) {
1922
-									$out .= ' - (' . $obj->company . ')';
1922
+									$out .= ' - ('.$obj->company.')';
1923 1923
 								}
1924 1924
 							}
1925 1925
 						}
@@ -1928,7 +1928,7 @@  discard block
 block discarded – undo
1928 1928
 				}
1929 1929
 			} else {
1930 1930
 				$labeltoshow = ($socid != -1) ? ($langs->trans($socid ? "NoContactDefinedForThirdParty" : "NoContactDefined")) : $langs->trans('SelectAThirdPartyFirst');
1931
-				$out .= '<option class="disabled" value="-1"' . (($showempty == 2 || $multiple) ? '' : ' selected') . ' disabled="disabled">';
1931
+				$out .= '<option class="disabled" value="-1"'.(($showempty == 2 || $multiple) ? '' : ' selected').' disabled="disabled">';
1932 1932
 				$out .= $labeltoshow;
1933 1933
 				$out .= '</option>';
1934 1934
 			}
@@ -1949,7 +1949,7 @@  discard block
 block discarded – undo
1949 1949
 			}
1950 1950
 
1951 1951
 			if ($conf->use_javascript_ajax && !$forcecombo && !$options_only) {
1952
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
1952
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
1953 1953
 				$out .= ajax_combobox($htmlid, $events, getDolGlobalString("CONTACT_USE_SEARCH_TO_SELECT"));
1954 1954
 			}
1955 1955
 
@@ -2054,11 +2054,11 @@  discard block
 block discarded – undo
2054 2054
 		if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) {
2055 2055
 			$sql .= ", e.label";
2056 2056
 		}
2057
-		$sql .= " FROM " . $this->db->prefix() . "user as u";
2057
+		$sql .= " FROM ".$this->db->prefix()."user as u";
2058 2058
 		if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) {
2059
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "entity as e ON e.rowid = u.entity";
2059
+			$sql .= " LEFT JOIN ".$this->db->prefix()."entity as e ON e.rowid = u.entity";
2060 2060
 			if (!empty($force_entity)) {
2061
-				$sql .= " WHERE u.entity IN (0, " . $this->db->sanitize($force_entity) . ")";
2061
+				$sql .= " WHERE u.entity IN (0, ".$this->db->sanitize($force_entity).")";
2062 2062
 			} else {
2063 2063
 				$sql .= " WHERE u.entity IS NOT NULL";
2064 2064
 			}
@@ -2066,17 +2066,17 @@  discard block
 block discarded – undo
2066 2066
 			if (isModEnabled('multicompany') && getDolGlobalInt('MULTICOMPANY_TRANSVERSE_MODE')) {
2067 2067
 				$sql .= " WHERE u.rowid IN (SELECT ug.fk_user FROM ".$this->db->prefix()."usergroup_user as ug WHERE ug.entity IN (".getEntity('usergroup')."))";
2068 2068
 			} else {
2069
-				$sql .= " WHERE u.entity IN (" . getEntity('user') . ")";
2069
+				$sql .= " WHERE u.entity IN (".getEntity('user').")";
2070 2070
 			}
2071 2071
 		}
2072 2072
 		if (!empty($user->socid)) {
2073
-			$sql .= " AND u.fk_soc = " . ((int) $user->socid);
2073
+			$sql .= " AND u.fk_soc = ".((int) $user->socid);
2074 2074
 		}
2075 2075
 		if (is_array($exclude) && $excludeUsers) {
2076
-			$sql .= " AND u.rowid NOT IN (" . $this->db->sanitize($excludeUsers) . ")";
2076
+			$sql .= " AND u.rowid NOT IN (".$this->db->sanitize($excludeUsers).")";
2077 2077
 		}
2078 2078
 		if ($includeUsers) {
2079
-			$sql .= " AND u.rowid IN (" . $this->db->sanitize($includeUsers) . ")";
2079
+			$sql .= " AND u.rowid IN (".$this->db->sanitize($includeUsers).")";
2080 2080
 		}
2081 2081
 		if (getDolGlobalString('USER_HIDE_INACTIVE_IN_COMBOBOX') || $notdisabled) {
2082 2082
 			$sql .= " AND u.statut <> 0";
@@ -2088,7 +2088,7 @@  discard block
 block discarded – undo
2088 2088
 			$sql .= " AND u.fk_soc IS NULL";
2089 2089
 		}
2090 2090
 		if (!empty($morefilter)) {
2091
-			$sql .= " " . $morefilter;
2091
+			$sql .= " ".$morefilter;
2092 2092
 		}
2093 2093
 
2094 2094
 		//Add hook to filter on user (for example on usergroup define in custom modules)
@@ -2103,7 +2103,7 @@  discard block
 block discarded – undo
2103 2103
 			$sql .= " ORDER BY u.statut DESC, u.lastname ASC, u.firstname ASC";
2104 2104
 		}
2105 2105
 
2106
-		dol_syslog(get_class($this) . "::select_dolusers", LOG_DEBUG);
2106
+		dol_syslog(get_class($this)."::select_dolusers", LOG_DEBUG);
2107 2107
 
2108 2108
 		$resql = $this->db->query($sql);
2109 2109
 		if ($resql) {
@@ -2111,7 +2111,7 @@  discard block
 block discarded – undo
2111 2111
 			$i = 0;
2112 2112
 			if ($num) {
2113 2113
 				// do not use maxwidthonsmartphone by default. Set it by caller so auto size to 100% will work when not defined
2114
-				$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : ' minwidth200') . '" id="' . $htmlname . '" name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . ' ' . ($disabled ? ' disabled' : '') . '>';
2114
+				$out .= '<select class="flat'.($morecss ? ' '.$morecss : ' minwidth200').'" id="'.$htmlname.'" name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.($disabled ? ' disabled' : '').'>';
2115 2115
 				if ($show_empty && !$multiple) {
2116 2116
 					$textforempty = ' ';
2117 2117
 					if (!empty($conf->use_javascript_ajax)) {
@@ -2120,10 +2120,10 @@  discard block
 block discarded – undo
2120 2120
 					if (!is_numeric($show_empty)) {
2121 2121
 						$textforempty = $show_empty;
2122 2122
 					}
2123
-					$out .= '<option class="optiongrey" value="' . ($show_empty < 0 ? $show_empty : -1) . '"' . ((empty($selected) || in_array(-1, $selected)) ? ' selected' : '') . '>' . $textforempty . '</option>' . "\n";
2123
+					$out .= '<option class="optiongrey" value="'.($show_empty < 0 ? $show_empty : -1).'"'.((empty($selected) || in_array(-1, $selected)) ? ' selected' : '').'>'.$textforempty.'</option>'."\n";
2124 2124
 				}
2125 2125
 				if ($show_every) {
2126
-					$out .= '<option value="-2"' . ((in_array(-2, $selected)) ? ' selected' : '') . '>-- ' . $langs->trans("Everybody") . ' --</option>' . "\n";
2126
+					$out .= '<option value="-2"'.((in_array(-2, $selected)) ? ' selected' : '').'>-- '.$langs->trans("Everybody").' --</option>'."\n";
2127 2127
 				}
2128 2128
 
2129 2129
 				$userstatic = new User($this->db);
@@ -2170,22 +2170,22 @@  discard block
 block discarded – undo
2170 2170
 					}
2171 2171
 					if ($showstatus >= 0) {
2172 2172
 						if ($obj->status == 1 && $showstatus == 1) {
2173
-							$moreinfo .= ($moreinfo ? ' - ' : ' (') . $langs->trans('Enabled');
2174
-							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . $langs->trans('Enabled');
2173
+							$moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans('Enabled');
2174
+							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').$langs->trans('Enabled');
2175 2175
 						}
2176 2176
 						if ($obj->status == 0 && $showstatus == 1) {
2177
-							$moreinfo .= ($moreinfo ? ' - ' : ' (') . $langs->trans('Disabled');
2178
-							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . $langs->trans('Disabled');
2177
+							$moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans('Disabled');
2178
+							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').$langs->trans('Disabled');
2179 2179
 						}
2180 2180
 					}
2181 2181
 					if (isModEnabled('multicompany') && !getDolGlobalInt('MULTICOMPANY_TRANSVERSE_MODE') && $conf->entity == 1 && !empty($user->admin) && empty($user->entity)) {
2182 2182
 						if (empty($obj->entity)) {
2183
-							$moreinfo .= ($moreinfo ? ' - ' : ' (') . $langs->trans("AllEntities");
2184
-							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . $langs->trans("AllEntities");
2183
+							$moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans("AllEntities");
2184
+							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').$langs->trans("AllEntities");
2185 2185
 						} else {
2186 2186
 							if ($obj->entity != $conf->entity) {
2187
-								$moreinfo .= ($moreinfo ? ' - ' : ' (') . ($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined"));
2188
-								$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . ($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined"));
2187
+								$moreinfo .= ($moreinfo ? ' - ' : ' (').($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined"));
2188
+								$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined"));
2189 2189
 							}
2190 2190
 						}
2191 2191
 					}
@@ -2193,13 +2193,13 @@  discard block
 block discarded – undo
2193 2193
 					$moreinfohtml .= (!empty($moreinfohtml) ? ')</span>' : '');
2194 2194
 					if (!empty($disableline) && $disableline != '1') {
2195 2195
 						// Add text from $enableonlytext parameter
2196
-						$moreinfo .= ' - ' . $disableline;
2197
-						$moreinfohtml .= ' - ' . $disableline;
2196
+						$moreinfo .= ' - '.$disableline;
2197
+						$moreinfohtml .= ' - '.$disableline;
2198 2198
 					}
2199 2199
 					$labeltoshow .= $moreinfo;
2200 2200
 					$labeltoshowhtml .= $moreinfohtml;
2201 2201
 
2202
-					$out .= '<option value="' . $obj->rowid . '"';
2202
+					$out .= '<option value="'.$obj->rowid.'"';
2203 2203
 					if (!empty($disableline)) {
2204 2204
 						$out .= ' disabled';
2205 2205
 					}
@@ -2207,7 +2207,7 @@  discard block
 block discarded – undo
2207 2207
 						$out .= ' selected';
2208 2208
 					}
2209 2209
 					$out .= ' data-html="';
2210
-					$outhtml = $userstatic->getNomUrl(-3, '', 0, 1, 24, 1, 'login', '', 1) . ' ';
2210
+					$outhtml = $userstatic->getNomUrl(-3, '', 0, 1, 24, 1, 'login', '', 1).' ';
2211 2211
 					if ($showstatus >= 0 && $obj->status == 0) {
2212 2212
 						$outhtml .= '<strike class="opacitymediumxxx">';
2213 2213
 					}
@@ -2220,7 +2220,7 @@  discard block
 block discarded – undo
2220 2220
 					$out .= $labeltoshow;
2221 2221
 					$out .= '</option>';
2222 2222
 
2223
-					$outarray[$userstatic->id] = $userstatic->getFullName($langs, $fullNameMode, -1, $maxlength) . $moreinfo;
2223
+					$outarray[$userstatic->id] = $userstatic->getFullName($langs, $fullNameMode, -1, $maxlength).$moreinfo;
2224 2224
 					$outarray2[$userstatic->id] = array(
2225 2225
 						'id'=>$userstatic->id,
2226 2226
 						'label'=>$labeltoshow,
@@ -2232,14 +2232,14 @@  discard block
 block discarded – undo
2232 2232
 					$i++;
2233 2233
 				}
2234 2234
 			} else {
2235
-				$out .= '<select class="flat" id="' . $htmlname . '" name="' . $htmlname . '" disabled>';
2236
-				$out .= '<option value="">' . $langs->trans("None") . '</option>';
2235
+				$out .= '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'" disabled>';
2236
+				$out .= '<option value="">'.$langs->trans("None").'</option>';
2237 2237
 			}
2238 2238
 			$out .= '</select>';
2239 2239
 
2240 2240
 			if ($num && !$forcecombo) {
2241 2241
 				// Enhance with select2
2242
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
2242
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
2243 2243
 				$out .= ajax_combobox($htmlname);
2244 2244
 			}
2245 2245
 		} else {
@@ -2309,16 +2309,16 @@  discard block
 block discarded – undo
2309 2309
 			$out .= $userstatic->getNomUrl(-1);
2310 2310
 			if ($i == 0) {
2311 2311
 				$ownerid = $value['id'];
2312
-				$out .= ' (' . $langs->trans("Owner") . ')';
2312
+				$out .= ' ('.$langs->trans("Owner").')';
2313 2313
 			}
2314 2314
 			if ($nbassignetouser > 1 && $action != 'view') {
2315
-				$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 . '">';
2315
+				$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.'">';
2316 2316
 			}
2317 2317
 			// Show my availability
2318 2318
 			if ($showproperties) {
2319 2319
 				if ($ownerid == $value['id'] && is_array($listofuserid) && count($listofuserid) && in_array($ownerid, array_keys($listofuserid))) {
2320 2320
 					$out .= '<div class="myavailability inline-block">';
2321
-					$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>';
2321
+					$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>';
2322 2322
 					$out .= '</div>';
2323 2323
 				}
2324 2324
 			}
@@ -2335,15 +2335,15 @@  discard block
 block discarded – undo
2335 2335
 		// Method with no ajax
2336 2336
 		if ($action != 'view') {
2337 2337
 			$out .= '<input type="hidden" class="removedassignedhidden" name="removedassigned" value="">';
2338
-			$out .= '<script nonce="' . getNonce() . '" type="text/javascript">jQuery(document).ready(function () {';
2338
+			$out .= '<script nonce="'.getNonce().'" type="text/javascript">jQuery(document).ready(function () {';
2339 2339
 			$out .= 'jQuery(".removedassigned").click(function() { jQuery(".removedassignedhidden").val(jQuery(this).val()); });';
2340 2340
 			$out .= 'jQuery(".assignedtouser").change(function() { console.log(jQuery(".assignedtouser option:selected").val());';
2341
-			$out .= ' if (jQuery(".assignedtouser option:selected").val() > 0) { jQuery("#' . $action . 'assignedtouser").attr("disabled", false); }';
2342
-			$out .= ' else { jQuery("#' . $action . 'assignedtouser").attr("disabled", true); }';
2341
+			$out .= ' if (jQuery(".assignedtouser option:selected").val() > 0) { jQuery("#'.$action.'assignedtouser").attr("disabled", false); }';
2342
+			$out .= ' else { jQuery("#'.$action.'assignedtouser").attr("disabled", true); }';
2343 2343
 			$out .= '});';
2344 2344
 			$out .= '})</script>';
2345 2345
 			$out .= $this->select_dolusers('', $htmlname, $show_empty, $exclude, $disabled, $include, $enableonly, $force_entity, $maxlength, $showstatus, $morefilter);
2346
-			$out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="' . $action . 'assignedtouser" name="' . $action . 'assignedtouser" value="' . dol_escape_htmltag($langs->trans("Add")) . '">';
2346
+			$out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="'.$action.'assignedtouser" name="'.$action.'assignedtouser" value="'.dol_escape_htmltag($langs->trans("Add")).'">';
2347 2347
 			$out .= '<br>';
2348 2348
 		}
2349 2349
 
@@ -2398,13 +2398,13 @@  discard block
 block discarded – undo
2398 2398
 			$resourcestatic->fetch($value['id']);
2399 2399
 			$out .= $resourcestatic->getNomUrl(-1);
2400 2400
 			if ($nbassignetoresource > 1 && $action != 'view') {
2401
-				$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 . '">';
2401
+				$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.'">';
2402 2402
 			}
2403 2403
 			// Show my availability
2404 2404
 			if ($showproperties) {
2405 2405
 				if (is_array($listofresourceid) && count($listofresourceid)) {
2406 2406
 					$out .= '<div class="myavailability inline-block">';
2407
-					$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>';
2407
+					$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>';
2408 2408
 					$out .= '</div>';
2409 2409
 				}
2410 2410
 			}
@@ -2421,11 +2421,11 @@  discard block
 block discarded – undo
2421 2421
 		// Method with no ajax
2422 2422
 		if ($action != 'view') {
2423 2423
 			$out .= '<input type="hidden" class="removedassignedhidden" name="removedassignedresource" value="">';
2424
-			$out .= '<script nonce="' . getNonce() . '" type="text/javascript">jQuery(document).ready(function () {';
2424
+			$out .= '<script nonce="'.getNonce().'" type="text/javascript">jQuery(document).ready(function () {';
2425 2425
 			$out .= 'jQuery(".removedassignedresource").click(function() { jQuery(".removedassignedresourcehidden").val(jQuery(this).val()); });';
2426 2426
 			$out .= 'jQuery(".assignedtoresource").change(function() { console.log(jQuery(".assignedtoresource option:selected").val());';
2427
-			$out .= ' if (jQuery(".assignedtoresource option:selected").val() > 0) { jQuery("#' . $action . 'assignedtoresource").attr("disabled", false); }';
2428
-			$out .= ' else { jQuery("#' . $action . 'assignedtoresource").attr("disabled", true); }';
2427
+			$out .= ' if (jQuery(".assignedtoresource option:selected").val() > 0) { jQuery("#'.$action.'assignedtoresource").attr("disabled", false); }';
2428
+			$out .= ' else { jQuery("#'.$action.'assignedtoresource").attr("disabled", true); }';
2429 2429
 			$out .= '});';
2430 2430
 			$out .= '})</script>';
2431 2431
 
@@ -2433,7 +2433,7 @@  discard block
 block discarded – undo
2433 2433
 			$out .= img_picto('', 'resource', 'class="pictofixedwidth"');
2434 2434
 			$out .= $formresources->select_resource_list(0, $htmlname, '', 1, 1, 0, $events, '', 2, null);
2435 2435
 			//$out .= $this->select_dolusers('', $htmlname, $show_empty, $exclude, $disabled, $include, $enableonly, $force_entity, $maxlength, $showstatus, $morefilter);
2436
-			$out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="' . $action . 'assignedtoresource" name="' . $action . 'assignedtoresource" value="' . dol_escape_htmltag($langs->trans("Add")) . '">';
2436
+			$out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="'.$action.'assignedtoresource" name="'.$action.'assignedtoresource" value="'.dol_escape_htmltag($langs->trans("Add")).'">';
2437 2437
 			$out .= '<br>';
2438 2438
 		}
2439 2439
 
@@ -2494,7 +2494,7 @@  discard block
 block discarded – undo
2494 2494
 			$placeholder = '';
2495 2495
 
2496 2496
 			if ($selected && empty($selected_input_value)) {
2497
-				require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
2497
+				require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
2498 2498
 				$producttmpselect = new Product($this->db);
2499 2499
 				$producttmpselect->fetch($selected);
2500 2500
 				$selected_input_value = $producttmpselect->ref;
@@ -2509,17 +2509,17 @@  discard block
 block discarded – undo
2509 2509
 				}
2510 2510
 			}
2511 2511
 			// mode=1 means customers products
2512
-			$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;
2513
-			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
2512
+			$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;
2513
+			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
2514 2514
 
2515 2515
 			if (isModEnabled('variants') && is_array($selected_combinations)) {
2516 2516
 				// Code to automatically insert with javascript the select of attributes under the select of product
2517 2517
 				// when a parent of variant has been selected.
2518 2518
 				$out .= '
2519 2519
 				<!-- script to auto show attributes select tags if a variant was selected -->
2520
-				<script nonce="' . getNonce() . '">
2520
+				<script nonce="' . getNonce().'">
2521 2521
 					// auto show attributes fields
2522
-					selected = ' . json_encode($selected_combinations) . ';
2522
+					selected = ' . json_encode($selected_combinations).';
2523 2523
 					combvalues = {};
2524 2524
 
2525 2525
 					jQuery(document).ready(function () {
@@ -2530,7 +2530,7 @@  discard block
 block discarded – undo
2530 2530
 							}
2531 2531
 						});
2532 2532
 
2533
-						jQuery("input#' . $htmlname . '").change(function () {
2533
+						jQuery("input#' . $htmlname.'").change(function () {
2534 2534
 
2535 2535
 							if (!jQuery(this).val()) {
2536 2536
 								jQuery(\'div#attributes_box\').empty();
@@ -2539,7 +2539,7 @@  discard block
 block discarded – undo
2539 2539
 
2540 2540
 							console.log("A change has started. We get variants fields to inject html select");
2541 2541
 
2542
-							jQuery.getJSON("' . DOL_URL_ROOT . '/variants/ajax/getCombinations.php", {
2542
+							jQuery.getJSON("' . DOL_URL_ROOT.'/variants/ajax/getCombinations.php", {
2543 2543
 								id: jQuery(this).val()
2544 2544
 							}, function (data) {
2545 2545
 								jQuery(\'div#attributes_box\').empty();
@@ -2582,21 +2582,21 @@  discard block
 block discarded – undo
2582 2582
 							})
2583 2583
 						});
2584 2584
 
2585
-						' . ($selected ? 'jQuery("input#' . $htmlname . '").change();' : '') . '
2585
+						' . ($selected ? 'jQuery("input#'.$htmlname.'").change();' : '').'
2586 2586
 					});
2587 2587
 				</script>
2588 2588
                 ';
2589 2589
 			}
2590 2590
 
2591 2591
 			if (empty($hidelabel)) {
2592
-				$out .= $langs->trans("RefOrLabel") . ' : ';
2592
+				$out .= $langs->trans("RefOrLabel").' : ';
2593 2593
 			} elseif ($hidelabel > 1) {
2594
-				$placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"';
2594
+				$placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"';
2595 2595
 				if ($hidelabel == 2) {
2596 2596
 					$out .= img_picto($langs->trans("Search"), 'search');
2597 2597
 				}
2598 2598
 			}
2599
-			$out .= '<input type="text" class="minwidth100' . ($morecss ? ' ' . $morecss : '') . '" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />';
2599
+			$out .= '<input type="text" class="minwidth100'.($morecss ? ' '.$morecss : '').'" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />';
2600 2600
 			if ($hidelabel == 3) {
2601 2601
 				$out .= img_picto($langs->trans("Search"), 'search');
2602 2602
 			}
@@ -2633,33 +2633,33 @@  discard block
 block discarded – undo
2633 2633
 		// phpcs:enable
2634 2634
 		global $conf, $user, $langs, $db;
2635 2635
 
2636
-		require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
2636
+		require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
2637 2637
 
2638 2638
 		$error = 0;
2639 2639
 		$out = '';
2640 2640
 
2641 2641
 		if (!$forcecombo) {
2642
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
2642
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
2643 2643
 			$events = array();
2644 2644
 			$out .= ajax_combobox($htmlname, $events, getDolGlobalInt("PRODUIT_USE_SEARCH_TO_SELECT"));
2645 2645
 		}
2646 2646
 
2647
-		$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
2647
+		$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
2648 2648
 
2649 2649
 		$sql = 'SELECT b.rowid, b.ref, b.label, b.fk_product';
2650
-		$sql .= ' FROM ' . MAIN_DB_PREFIX . 'bom_bom as b';
2651
-		$sql .= ' WHERE b.entity IN (' . getEntity('bom') . ')';
2650
+		$sql .= ' FROM '.MAIN_DB_PREFIX.'bom_bom as b';
2651
+		$sql .= ' WHERE b.entity IN ('.getEntity('bom').')';
2652 2652
 		if (!empty($status)) {
2653
-			$sql .= ' AND status = ' . (int) $status;
2653
+			$sql .= ' AND status = '.(int) $status;
2654 2654
 		}
2655 2655
 		if (!empty($type)) {
2656
-			$sql .= ' AND bomtype = ' . (int) $type;
2656
+			$sql .= ' AND bomtype = '.(int) $type;
2657 2657
 		}
2658 2658
 		if (!empty($TProducts)) {
2659
-			$sql .= ' AND fk_product IN (' . $this->db->sanitize(implode(',', $TProducts)) . ')';
2659
+			$sql .= ' AND fk_product IN ('.$this->db->sanitize(implode(',', $TProducts)).')';
2660 2660
 		}
2661 2661
 		if (!empty($limit)) {
2662
-			$sql .= ' LIMIT ' . (int) $limit;
2662
+			$sql .= ' LIMIT '.(int) $limit;
2663 2663
 		}
2664 2664
 		$resql = $db->query($sql);
2665 2665
 		if ($resql) {
@@ -2673,11 +2673,11 @@  discard block
 block discarded – undo
2673 2673
 			while ($obj = $db->fetch_object($resql)) {
2674 2674
 				$product = new Product($db);
2675 2675
 				$res = $product->fetch($obj->fk_product);
2676
-				$out .= '<option value="' . $obj->rowid . '"';
2676
+				$out .= '<option value="'.$obj->rowid.'"';
2677 2677
 				if ($obj->rowid == $selected) {
2678 2678
 					$out .= 'selected';
2679 2679
 				}
2680
-				$out .= '>' . $obj->ref . ' - ' . $product->label . ' - ' . $obj->label . '</option>';
2680
+				$out .= '>'.$obj->ref.' - '.$product->label.' - '.$obj->label.'</option>';
2681 2681
 			}
2682 2682
 		} else {
2683 2683
 			$error++;
@@ -2734,7 +2734,7 @@  discard block
 block discarded – undo
2734 2734
 
2735 2735
 		$warehouseStatusArray = array();
2736 2736
 		if (!empty($warehouseStatus)) {
2737
-			require_once DOL_DOCUMENT_ROOT . '/product/stock/class/entrepot.class.php';
2737
+			require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php';
2738 2738
 			if (preg_match('/warehouseclosed/', $warehouseStatus)) {
2739 2739
 				$warehouseStatusArray[] = Entrepot::STATUS_CLOSED;
2740 2740
 			}
@@ -2748,9 +2748,9 @@  discard block
 block discarded – undo
2748 2748
 
2749 2749
 		$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";
2750 2750
 		if (count($warehouseStatusArray)) {
2751
-			$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
2751
+			$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
2752 2752
 		} else {
2753
-			$selectFieldsGrouped = ", " . $this->db->ifsql("p.stock IS NULL", 0, "p.stock") . " AS stock";
2753
+			$selectFieldsGrouped = ", ".$this->db->ifsql("p.stock IS NULL", 0, "p.stock")." AS stock";
2754 2754
 		}
2755 2755
 
2756 2756
 		$sql = "SELECT ";
@@ -2766,9 +2766,9 @@  discard block
 block discarded – undo
2766 2766
 
2767 2767
 		if (getDolGlobalString('PRODUCT_SORT_BY_CATEGORY')) {
2768 2768
 			//Product category
2769
-			$sql .= ", (SELECT " . $this->db->prefix() . "categorie_product.fk_categorie
2770
-						FROM " . $this->db->prefix() . "categorie_product
2771
-						WHERE " . $this->db->prefix() . "categorie_product.fk_product=p.rowid
2769
+			$sql .= ", (SELECT ".$this->db->prefix()."categorie_product.fk_categorie
2770
+						FROM " . $this->db->prefix()."categorie_product
2771
+						WHERE " . $this->db->prefix()."categorie_product.fk_product=p.rowid
2772 2772
 						LIMIT 1
2773 2773
 				) AS categorie_product_id ";
2774 2774
 		}
@@ -2794,15 +2794,15 @@  discard block
 block discarded – undo
2794 2794
 		}
2795 2795
 		// Price by quantity
2796 2796
 		if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) {
2797
-			$sql .= ", (SELECT pp.rowid FROM " . $this->db->prefix() . "product_price as pp WHERE pp.fk_product = p.rowid";
2797
+			$sql .= ", (SELECT pp.rowid FROM ".$this->db->prefix()."product_price as pp WHERE pp.fk_product = p.rowid";
2798 2798
 			if ($price_level >= 1 && getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) {
2799
-				$sql .= " AND price_level = " . ((int) $price_level);
2799
+				$sql .= " AND price_level = ".((int) $price_level);
2800 2800
 			}
2801 2801
 			$sql .= " ORDER BY date_price";
2802 2802
 			$sql .= " DESC LIMIT 1) as price_rowid";
2803
-			$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
2803
+			$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
2804 2804
 			if ($price_level >= 1 && getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) {
2805
-				$sql .= " AND price_level = " . ((int) $price_level);
2805
+				$sql .= " AND price_level = ".((int) $price_level);
2806 2806
 			}
2807 2807
 			$sql .= " ORDER BY date_price";
2808 2808
 			$sql .= " DESC LIMIT 1) as price_by_qty";
@@ -2816,53 +2816,53 @@  discard block
 block discarded – undo
2816 2816
 		$sql .= $hookmanager->resPrint;
2817 2817
 
2818 2818
 		if (count($warehouseStatusArray)) {
2819
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "product_stock as ps on ps.fk_product = p.rowid";
2820
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "entrepot as e on ps.fk_entrepot = e.rowid AND e.entity IN (" . getEntity('stock') . ")";
2821
-			$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.
2819
+			$sql .= " LEFT JOIN ".$this->db->prefix()."product_stock as ps on ps.fk_product = p.rowid";
2820
+			$sql .= " LEFT JOIN ".$this->db->prefix()."entrepot as e on ps.fk_entrepot = e.rowid AND e.entity IN (".getEntity('stock').")";
2821
+			$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.
2822 2822
 		}
2823 2823
 
2824 2824
 		// include search in supplier ref
2825 2825
 		if (getDolGlobalString('MAIN_SEARCH_PRODUCT_BY_FOURN_REF')) {
2826
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
2826
+			$sql .= " LEFT JOIN ".$this->db->prefix()."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
2827 2827
 		}
2828 2828
 
2829 2829
 		//Price by customer
2830 2830
 		if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES') && !empty($socid)) {
2831
-			$sql .= " LEFT JOIN  " . $this->db->prefix() . "product_customer_price as pcp ON pcp.fk_soc=" . ((int) $socid) . " AND pcp.fk_product=p.rowid";
2831
+			$sql .= " LEFT JOIN  ".$this->db->prefix()."product_customer_price as pcp ON pcp.fk_soc=".((int) $socid)." AND pcp.fk_product=p.rowid";
2832 2832
 		}
2833 2833
 		// Units
2834 2834
 		if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
2835
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "c_units u ON u.rowid = p.fk_unit";
2835
+			$sql .= " LEFT JOIN ".$this->db->prefix()."c_units u ON u.rowid = p.fk_unit";
2836 2836
 		}
2837 2837
 		// Multilang : we add translation
2838 2838
 		if (getDolGlobalInt('MAIN_MULTILANGS')) {
2839
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "product_lang as pl ON pl.fk_product = p.rowid ";
2839
+			$sql .= " LEFT JOIN ".$this->db->prefix()."product_lang as pl ON pl.fk_product = p.rowid ";
2840 2840
 			if (getDolGlobalString('PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE') && !empty($socid)) {
2841
-				require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
2841
+				require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
2842 2842
 				$soc = new Societe($this->db);
2843 2843
 				$result = $soc->fetch($socid);
2844 2844
 				if ($result > 0 && !empty($soc->default_lang)) {
2845
-					$sql .= " AND pl.lang = '" . $this->db->escape($soc->default_lang) . "'";
2845
+					$sql .= " AND pl.lang = '".$this->db->escape($soc->default_lang)."'";
2846 2846
 				} else {
2847
-					$sql .= " AND pl.lang = '" . $this->db->escape($langs->getDefaultLang()) . "'";
2847
+					$sql .= " AND pl.lang = '".$this->db->escape($langs->getDefaultLang())."'";
2848 2848
 				}
2849 2849
 			} else {
2850
-				$sql .= " AND pl.lang = '" . $this->db->escape($langs->getDefaultLang()) . "'";
2850
+				$sql .= " AND pl.lang = '".$this->db->escape($langs->getDefaultLang())."'";
2851 2851
 			}
2852 2852
 		}
2853 2853
 
2854 2854
 		if (getDolGlobalString('PRODUIT_ATTRIBUTES_HIDECHILD')) {
2855
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "product_attribute_combination pac ON pac.fk_product_child = p.rowid";
2855
+			$sql .= " LEFT JOIN ".$this->db->prefix()."product_attribute_combination pac ON pac.fk_product_child = p.rowid";
2856 2856
 		}
2857 2857
 
2858
-		$sql .= ' WHERE p.entity IN (' . getEntity('product') . ')';
2858
+		$sql .= ' WHERE p.entity IN ('.getEntity('product').')';
2859 2859
 
2860 2860
 		if (getDolGlobalString('PRODUIT_ATTRIBUTES_HIDECHILD')) {
2861 2861
 			$sql .= " AND pac.rowid IS NULL";
2862 2862
 		}
2863 2863
 
2864 2864
 		if ($finished == 0) {
2865
-			$sql .= " AND p.finished = " . ((int) $finished);
2865
+			$sql .= " AND p.finished = ".((int) $finished);
2866 2866
 		} elseif ($finished == 1) {
2867 2867
 			$sql .= " AND p.finished = ".((int) $finished);
2868 2868
 		}
@@ -2870,11 +2870,11 @@  discard block
 block discarded – undo
2870 2870
 			$sql .= " AND p.tosell = ".((int) $status);
2871 2871
 		}
2872 2872
 		if ($status_purchase >= 0) {
2873
-			$sql .= " AND p.tobuy = " . ((int) $status_purchase);
2873
+			$sql .= " AND p.tobuy = ".((int) $status_purchase);
2874 2874
 		}
2875 2875
 		// Filter by product type
2876 2876
 		if (strval($filtertype) != '') {
2877
-			$sql .= " AND p.fk_product_type = " . ((int) $filtertype);
2877
+			$sql .= " AND p.fk_product_type = ".((int) $filtertype);
2878 2878
 		} elseif (!isModEnabled('product')) { // when product module is disabled, show services only
2879 2879
 			$sql .= " AND p.fk_product_type = 1";
2880 2880
 		} elseif (!isModEnabled('service')) { // when service module is disabled, show products only
@@ -2898,21 +2898,21 @@  discard block
 block discarded – undo
2898 2898
 				if ($i > 0) {
2899 2899
 					$sql .= " AND ";
2900 2900
 				}
2901
-				$sql .= "(p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%' OR p.label LIKE '" . $this->db->escape($prefix . $crit) . "%'";
2901
+				$sql .= "(p.ref LIKE '".$this->db->escape($prefix.$crit)."%' OR p.label LIKE '".$this->db->escape($prefix.$crit)."%'";
2902 2902
 				if (getDolGlobalInt('MAIN_MULTILANGS')) {
2903
-					$sql .= " OR pl.label LIKE '" . $this->db->escape($prefix . $crit) . "%'";
2903
+					$sql .= " OR pl.label LIKE '".$this->db->escape($prefix.$crit)."%'";
2904 2904
 				}
2905 2905
 				if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES') && !empty($socid)) {
2906
-					$sql .= " OR pcp.ref_customer LIKE '" . $this->db->escape($prefix . $crit) . "%'";
2906
+					$sql .= " OR pcp.ref_customer LIKE '".$this->db->escape($prefix.$crit)."%'";
2907 2907
 				}
2908 2908
 				if (getDolGlobalString('PRODUCT_AJAX_SEARCH_ON_DESCRIPTION')) {
2909
-					$sql .= " OR p.description LIKE '" . $this->db->escape($prefix . $crit) . "%'";
2909
+					$sql .= " OR p.description LIKE '".$this->db->escape($prefix.$crit)."%'";
2910 2910
 					if (getDolGlobalInt('MAIN_MULTILANGS')) {
2911
-						$sql .= " OR pl.description LIKE '" . $this->db->escape($prefix . $crit) . "%'";
2911
+						$sql .= " OR pl.description LIKE '".$this->db->escape($prefix.$crit)."%'";
2912 2912
 					}
2913 2913
 				}
2914 2914
 				if (getDolGlobalString('MAIN_SEARCH_PRODUCT_BY_FOURN_REF')) {
2915
-					$sql .= " OR pfp.ref_fourn LIKE '" . $this->db->escape($prefix . $crit) . "%'";
2915
+					$sql .= " OR pfp.ref_fourn LIKE '".$this->db->escape($prefix.$crit)."%'";
2916 2916
 				}
2917 2917
 				$sql .= ")";
2918 2918
 				$i++;
@@ -2921,12 +2921,12 @@  discard block
 block discarded – undo
2921 2921
 				$sql .= ")";
2922 2922
 			}
2923 2923
 			if (isModEnabled('barcode')) {
2924
-				$sql .= " OR p.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
2924
+				$sql .= " OR p.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'";
2925 2925
 			}
2926 2926
 			$sql .= ')';
2927 2927
 		}
2928 2928
 		if (count($warehouseStatusArray)) {
2929
-			$sql .= " GROUP BY " . $selectFields;
2929
+			$sql .= " GROUP BY ".$selectFields;
2930 2930
 		}
2931 2931
 
2932 2932
 		//Sort by category
@@ -2941,23 +2941,23 @@  discard block
 block discarded – undo
2941 2941
 		$sql .= $this->db->plimit($limit, 0);
2942 2942
 
2943 2943
 		// Build output string
2944
-		dol_syslog(get_class($this) . "::select_produits_list search products", LOG_DEBUG);
2944
+		dol_syslog(get_class($this)."::select_produits_list search products", LOG_DEBUG);
2945 2945
 		$result = $this->db->query($sql);
2946 2946
 		if ($result) {
2947
-			require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
2948
-			require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
2949
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/product.lib.php';
2947
+			require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
2948
+			require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
2949
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php';
2950 2950
 
2951 2951
 			$num = $this->db->num_rows($result);
2952 2952
 
2953 2953
 			$events = null;
2954 2954
 
2955 2955
 			if (!$forcecombo) {
2956
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
2956
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
2957 2957
 				$out .= ajax_combobox($htmlname, $events, getDolGlobalInt("PRODUIT_USE_SEARCH_TO_SELECT"));
2958 2958
 			}
2959 2959
 
2960
-			$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
2960
+			$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
2961 2961
 
2962 2962
 			$textifempty = '';
2963 2963
 			// Do not use textifempty = ' ' or '&nbsp;' here, or search on key will search on ' key'.
@@ -2974,7 +2974,7 @@  discard block
 block discarded – undo
2974 2974
 				}
2975 2975
 			}
2976 2976
 			if ($showempty) {
2977
-				$out .= '<option value="-1" selected>' . ($textifempty ? $textifempty : '&nbsp;') . '</option>';
2977
+				$out .= '<option value="-1" selected>'.($textifempty ? $textifempty : '&nbsp;').'</option>';
2978 2978
 			}
2979 2979
 
2980 2980
 			$i = 0;
@@ -2985,11 +2985,11 @@  discard block
 block discarded – undo
2985 2985
 
2986 2986
 				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
2987 2987
 					$sql = "SELECT rowid, quantity, price, unitprice, remise_percent, remise, price_base_type";
2988
-					$sql .= " FROM " . $this->db->prefix() . "product_price_by_qty";
2989
-					$sql .= " WHERE fk_product_price = " . ((int) $objp->price_rowid);
2988
+					$sql .= " FROM ".$this->db->prefix()."product_price_by_qty";
2989
+					$sql .= " WHERE fk_product_price = ".((int) $objp->price_rowid);
2990 2990
 					$sql .= " ORDER BY quantity ASC";
2991 2991
 
2992
-					dol_syslog(get_class($this) . "::select_produits_list search prices by qty", LOG_DEBUG);
2992
+					dol_syslog(get_class($this)."::select_produits_list search prices by qty", LOG_DEBUG);
2993 2993
 					$result2 = $this->db->query($sql);
2994 2994
 					if ($result2) {
2995 2995
 						$nb_prices = $this->db->num_rows($result2);
@@ -3027,7 +3027,7 @@  discard block
 block discarded – undo
3027 3027
 						$price_product = new Product($this->db);
3028 3028
 						$price_product->fetch($objp->rowid, '', '', 1);
3029 3029
 
3030
-						require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
3030
+						require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
3031 3031
 						$priceparser = new PriceParser($this->db);
3032 3032
 						$price_result = $priceparser->parseProduct($price_product);
3033 3033
 						if ($price_result >= 0) {
@@ -3111,7 +3111,7 @@  discard block
 block discarded – undo
3111 3111
 			$label = $objp->label_translated;
3112 3112
 		}
3113 3113
 		if (!empty($filterkey) && $filterkey != '') {
3114
-			$label = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $label, 1);
3114
+			$label = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $label, 1);
3115 3115
 		}
3116 3116
 
3117 3117
 		$outkey = $objp->rowid;
@@ -3132,32 +3132,32 @@  discard block
 block discarded – undo
3132 3132
 		$outdurationunit = $outtype == Product::TYPE_SERVICE ? substr($objp->duration, -1) : '';
3133 3133
 
3134 3134
 		if ($outorigin && getDolGlobalString('PRODUCT_SHOW_ORIGIN_IN_COMBO')) {
3135
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
3135
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
3136 3136
 		}
3137 3137
 
3138 3138
 		// Units
3139 3139
 		$outvalUnits = '';
3140 3140
 		if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
3141 3141
 			if (!empty($objp->unit_short)) {
3142
-				$outvalUnits .= ' - ' . $objp->unit_short;
3142
+				$outvalUnits .= ' - '.$objp->unit_short;
3143 3143
 			}
3144 3144
 		}
3145 3145
 		if (getDolGlobalString('PRODUCT_SHOW_DIMENSIONS_IN_COMBO')) {
3146 3146
 			if (!empty($objp->weight) && $objp->weight_units !== null) {
3147 3147
 				$unitToShow = showDimensionInBestUnit($objp->weight, $objp->weight_units, 'weight', $langs);
3148
-				$outvalUnits .= ' - ' . $unitToShow;
3148
+				$outvalUnits .= ' - '.$unitToShow;
3149 3149
 			}
3150 3150
 			if ((!empty($objp->length) || !empty($objp->width) || !empty($objp->height)) && $objp->length_units !== null) {
3151
-				$unitToShow = $objp->length . ' x ' . $objp->width . ' x ' . $objp->height . ' ' . measuringUnitString(0, 'size', $objp->length_units);
3152
-				$outvalUnits .= ' - ' . $unitToShow;
3151
+				$unitToShow = $objp->length.' x '.$objp->width.' x '.$objp->height.' '.measuringUnitString(0, 'size', $objp->length_units);
3152
+				$outvalUnits .= ' - '.$unitToShow;
3153 3153
 			}
3154 3154
 			if (!empty($objp->surface) && $objp->surface_units !== null) {
3155 3155
 				$unitToShow = showDimensionInBestUnit($objp->surface, $objp->surface_units, 'surface', $langs);
3156
-				$outvalUnits .= ' - ' . $unitToShow;
3156
+				$outvalUnits .= ' - '.$unitToShow;
3157 3157
 			}
3158 3158
 			if (!empty($objp->volume) && $objp->volume_units !== null) {
3159 3159
 				$unitToShow = showDimensionInBestUnit($objp->volume, $objp->volume_units, 'volume', $langs);
3160
-				$outvalUnits .= ' - ' . $unitToShow;
3160
+				$outvalUnits .= ' - '.$unitToShow;
3161 3161
 			}
3162 3162
 		}
3163 3163
 		if ($outdurationvalue && $outdurationunit) {
@@ -3169,14 +3169,14 @@  discard block
 block discarded – undo
3169 3169
 				'y' => $langs->trans('Year')
3170 3170
 			);
3171 3171
 			if (isset($da[$outdurationunit])) {
3172
-				$outvalUnits .= ' - ' . $outdurationvalue . ' ' . $langs->transnoentities($da[$outdurationunit] . ($outdurationvalue > 1 ? 's' : ''));
3172
+				$outvalUnits .= ' - '.$outdurationvalue.' '.$langs->transnoentities($da[$outdurationunit].($outdurationvalue > 1 ? 's' : ''));
3173 3173
 			}
3174 3174
 		}
3175 3175
 
3176
-		$opt = '<option value="' . $objp->rowid . '"';
3176
+		$opt = '<option value="'.$objp->rowid.'"';
3177 3177
 		$opt .= ($objp->rowid == $selected) ? ' selected' : '';
3178 3178
 		if (!empty($objp->price_by_qty_rowid) && $objp->price_by_qty_rowid > 0) {
3179
-			$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 . '"';
3179
+			$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.'"';
3180 3180
 		}
3181 3181
 		if (isModEnabled('stock') && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || getDolGlobalString('STOCK_SUPPORTS_SERVICES'))) {
3182 3182
 			if ($user->hasRight('stock', 'lire')) {
@@ -3188,36 +3188,36 @@  discard block
 block discarded – undo
3188 3188
 			}
3189 3189
 		}
3190 3190
 		if (getDolGlobalString('PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE')) {
3191
-			$opt .= ' data-labeltrans="' . $outlabel_translated . '"';
3192
-			$opt .= ' data-desctrans="' . dol_escape_htmltag($outdesc_translated) . '"';
3191
+			$opt .= ' data-labeltrans="'.$outlabel_translated.'"';
3192
+			$opt .= ' data-desctrans="'.dol_escape_htmltag($outdesc_translated).'"';
3193 3193
 		}
3194 3194
 		$opt .= '>';
3195 3195
 		$opt .= $objp->ref;
3196 3196
 		if (!empty($objp->custref)) {
3197
-			$opt .= ' (' . $objp->custref . ')';
3197
+			$opt .= ' ('.$objp->custref.')';
3198 3198
 		}
3199 3199
 		if ($outbarcode) {
3200
-			$opt .= ' (' . $outbarcode . ')';
3200
+			$opt .= ' ('.$outbarcode.')';
3201 3201
 		}
3202
-		$opt .= ' - ' . dol_trunc($label, $maxlengtharticle);
3202
+		$opt .= ' - '.dol_trunc($label, $maxlengtharticle);
3203 3203
 		if ($outorigin && getDolGlobalString('PRODUCT_SHOW_ORIGIN_IN_COMBO')) {
3204
-			$opt .= ' (' . getCountry($outorigin, 1) . ')';
3204
+			$opt .= ' ('.getCountry($outorigin, 1).')';
3205 3205
 		}
3206 3206
 
3207 3207
 		$objRef = $objp->ref;
3208 3208
 		if (!empty($objp->custref)) {
3209
-			$objRef .= ' (' . $objp->custref . ')';
3209
+			$objRef .= ' ('.$objp->custref.')';
3210 3210
 		}
3211 3211
 		if (!empty($filterkey) && $filterkey != '') {
3212
-			$objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1);
3212
+			$objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1);
3213 3213
 		}
3214 3214
 		$outval .= $objRef;
3215 3215
 		if ($outbarcode) {
3216
-			$outval .= ' (' . $outbarcode . ')';
3216
+			$outval .= ' ('.$outbarcode.')';
3217 3217
 		}
3218
-		$outval .= ' - ' . dol_trunc($label, $maxlengtharticle);
3218
+		$outval .= ' - '.dol_trunc($label, $maxlengtharticle);
3219 3219
 		if ($outorigin && getDolGlobalString('PRODUCT_SHOW_ORIGIN_IN_COMBO')) {
3220
-			$outval .= ' (' . getCountry($outorigin, 1) . ')';
3220
+			$outval .= ' ('.getCountry($outorigin, 1).')';
3221 3221
 		}
3222 3222
 
3223 3223
 		// Units
@@ -3230,35 +3230,35 @@  discard block
 block discarded – undo
3230 3230
 		// If we need a particular price level (from 1 to n)
3231 3231
 		if (empty($hidepriceinlabel) && $price_level >= 1 && (getDolGlobalString('PRODUIT_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES'))) {
3232 3232
 			$sql = "SELECT price, price_ttc, price_base_type, tva_tx, default_vat_code";
3233
-			$sql .= " FROM " . $this->db->prefix() . "product_price";
3234
-			$sql .= " WHERE fk_product = " . ((int) $objp->rowid);
3235
-			$sql .= " AND entity IN (" . getEntity('productprice') . ")";
3236
-			$sql .= " AND price_level = " . ((int) $price_level);
3233
+			$sql .= " FROM ".$this->db->prefix()."product_price";
3234
+			$sql .= " WHERE fk_product = ".((int) $objp->rowid);
3235
+			$sql .= " AND entity IN (".getEntity('productprice').")";
3236
+			$sql .= " AND price_level = ".((int) $price_level);
3237 3237
 			$sql .= " ORDER BY date_price DESC, rowid DESC"; // Warning DESC must be both on date_price and rowid.
3238 3238
 			$sql .= " LIMIT 1";
3239 3239
 
3240
-			dol_syslog(get_class($this) . '::constructProductListOption search price for product ' . $objp->rowid . ' AND level ' . $price_level, LOG_DEBUG);
3240
+			dol_syslog(get_class($this).'::constructProductListOption search price for product '.$objp->rowid.' AND level '.$price_level, LOG_DEBUG);
3241 3241
 			$result2 = $this->db->query($sql);
3242 3242
 			if ($result2) {
3243 3243
 				$objp2 = $this->db->fetch_object($result2);
3244 3244
 				if ($objp2) {
3245 3245
 					$found = 1;
3246 3246
 					if ($objp2->price_base_type == 'HT') {
3247
-						$opt .= ' - ' . price($objp2->price, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("HT");
3248
-						$outval .= ' - ' . price($objp2->price, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("HT");
3247
+						$opt .= ' - '.price($objp2->price, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT");
3248
+						$outval .= ' - '.price($objp2->price, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT");
3249 3249
 					} else {
3250
-						$opt .= ' - ' . price($objp2->price_ttc, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("TTC");
3251
-						$outval .= ' - ' . price($objp2->price_ttc, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("TTC");
3250
+						$opt .= ' - '.price($objp2->price_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC");
3251
+						$outval .= ' - '.price($objp2->price_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC");
3252 3252
 					}
3253 3253
 					$outprice_ht = price($objp2->price);
3254 3254
 					$outprice_ttc = price($objp2->price_ttc);
3255 3255
 					$outpricebasetype = $objp2->price_base_type;
3256 3256
 					if (getDolGlobalString('PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL')) {  // using this option is a bug. kept for backward compatibility
3257
-						$outtva_tx = $objp2->tva_tx;                        // We use the vat rate on line of multiprice
3258
-						$outdefault_vat_code = $objp2->default_vat_code;    // We use the vat code on line of multiprice
3257
+						$outtva_tx = $objp2->tva_tx; // We use the vat rate on line of multiprice
3258
+						$outdefault_vat_code = $objp2->default_vat_code; // We use the vat code on line of multiprice
3259 3259
 					} else {
3260
-						$outtva_tx = $objp->tva_tx;                            // We use the vat rate of product, not the one on line of multiprice
3261
-						$outdefault_vat_code = $objp->default_vat_code;        // We use the vat code or product, not the one on line of multiprice
3260
+						$outtva_tx = $objp->tva_tx; // We use the vat rate of product, not the one on line of multiprice
3261
+						$outdefault_vat_code = $objp->default_vat_code; // We use the vat code or product, not the one on line of multiprice
3262 3262
 					}
3263 3263
 				}
3264 3264
 			} else {
@@ -3272,13 +3272,13 @@  discard block
 block discarded – undo
3272 3272
 			$outqty = $objp->quantity;
3273 3273
 			$outdiscount = $objp->remise_percent;
3274 3274
 			if ($objp->quantity == 1) {
3275
-				$opt .= ' - ' . price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency) . "/";
3276
-				$outval .= ' - ' . price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency) . "/";
3275
+				$opt .= ' - '.price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency)."/";
3276
+				$outval .= ' - '.price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency)."/";
3277 3277
 				$opt .= $langs->trans("Unit"); // Do not use strtolower because it breaks utf8 encoding
3278 3278
 				$outval .= $langs->transnoentities("Unit");
3279 3279
 			} else {
3280
-				$opt .= ' - ' . price($objp->price, 1, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity;
3281
-				$outval .= ' - ' . price($objp->price, 0, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity;
3280
+				$opt .= ' - '.price($objp->price, 1, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity;
3281
+				$outval .= ' - '.price($objp->price, 0, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity;
3282 3282
 				$opt .= $langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding
3283 3283
 				$outval .= $langs->transnoentities("Units");
3284 3284
 			}
@@ -3286,16 +3286,16 @@  discard block
 block discarded – undo
3286 3286
 			$outprice_ht = price($objp->unitprice);
3287 3287
 			$outprice_ttc = price($objp->unitprice * (1 + ($objp->tva_tx / 100)));
3288 3288
 			$outpricebasetype = $objp->price_base_type;
3289
-			$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
3290
-			$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
3289
+			$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
3290
+			$outdefault_vat_code = $objp->default_vat_code; // This value is the value on product when constructProductListOption is called by select_produits_list even if other field $objp-> are from table price_by_qty
3291 3291
 		}
3292 3292
 		if (empty($hidepriceinlabel) && !empty($objp->quantity) && $objp->quantity >= 1) {
3293
-			$opt .= " (" . price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->trans("Unit") . ")"; // Do not use strtolower because it breaks utf8 encoding
3294
-			$outval .= " (" . price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->transnoentities("Unit") . ")"; // Do not use strtolower because it breaks utf8 encoding
3293
+			$opt .= " (".price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency)."/".$langs->trans("Unit").")"; // Do not use strtolower because it breaks utf8 encoding
3294
+			$outval .= " (".price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency)."/".$langs->transnoentities("Unit").")"; // Do not use strtolower because it breaks utf8 encoding
3295 3295
 		}
3296 3296
 		if (empty($hidepriceinlabel) && !empty($objp->remise_percent) && $objp->remise_percent >= 1) {
3297
-			$opt .= " - " . $langs->trans("Discount") . " : " . vatrate($objp->remise_percent) . ' %';
3298
-			$outval .= " - " . $langs->transnoentities("Discount") . " : " . vatrate($objp->remise_percent) . ' %';
3297
+			$opt .= " - ".$langs->trans("Discount")." : ".vatrate($objp->remise_percent).' %';
3298
+			$outval .= " - ".$langs->transnoentities("Discount")." : ".vatrate($objp->remise_percent).' %';
3299 3299
 		}
3300 3300
 
3301 3301
 		// Price by customer
@@ -3304,11 +3304,11 @@  discard block
 block discarded – undo
3304 3304
 				$found = 1;
3305 3305
 
3306 3306
 				if ($objp->custprice_base_type == 'HT') {
3307
-					$opt .= ' - ' . price($objp->custprice, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("HT");
3308
-					$outval .= ' - ' . price($objp->custprice, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("HT");
3307
+					$opt .= ' - '.price($objp->custprice, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT");
3308
+					$outval .= ' - '.price($objp->custprice, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT");
3309 3309
 				} else {
3310
-					$opt .= ' - ' . price($objp->custprice_ttc, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("TTC");
3311
-					$outval .= ' - ' . price($objp->custprice_ttc, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("TTC");
3310
+					$opt .= ' - '.price($objp->custprice_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC");
3311
+					$outval .= ' - '.price($objp->custprice_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC");
3312 3312
 				}
3313 3313
 
3314 3314
 				$outprice_ht = price($objp->custprice);
@@ -3322,11 +3322,11 @@  discard block
 block discarded – undo
3322 3322
 		// If level no defined or multiprice not found, we used the default price
3323 3323
 		if (empty($hidepriceinlabel) && !$found) {
3324 3324
 			if ($objp->price_base_type == 'HT') {
3325
-				$opt .= ' - ' . price($objp->price, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("HT");
3326
-				$outval .= ' - ' . price($objp->price, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("HT");
3325
+				$opt .= ' - '.price($objp->price, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT");
3326
+				$outval .= ' - '.price($objp->price, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT");
3327 3327
 			} else {
3328
-				$opt .= ' - ' . price($objp->price_ttc, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("TTC");
3329
-				$outval .= ' - ' . price($objp->price_ttc, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("TTC");
3328
+				$opt .= ' - '.price($objp->price_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC");
3329
+				$outval .= ' - '.price($objp->price_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC");
3330 3330
 			}
3331 3331
 			$outprice_ht = price($objp->price);
3332 3332
 			$outprice_ttc = price($objp->price_ttc);
@@ -3337,14 +3337,14 @@  discard block
 block discarded – undo
3337 3337
 
3338 3338
 		if (isModEnabled('stock') && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || getDolGlobalString('STOCK_SUPPORTS_SERVICES'))) {
3339 3339
 			if ($user->hasRight('stock', 'lire')) {
3340
-				$opt .= ' - ' . $langs->trans("Stock") . ': ' . price(price2num($objp->stock, 'MS'));
3340
+				$opt .= ' - '.$langs->trans("Stock").': '.price(price2num($objp->stock, 'MS'));
3341 3341
 
3342 3342
 				if ($objp->stock > 0) {
3343 3343
 					$outval .= ' - <span class="product_line_stock_ok">';
3344 3344
 				} elseif ($objp->stock <= 0) {
3345 3345
 					$outval .= ' - <span class="product_line_stock_too_low">';
3346 3346
 				}
3347
-				$outval .= $langs->transnoentities("Stock") . ': ' . price(price2num($objp->stock, 'MS'));
3347
+				$outval .= $langs->transnoentities("Stock").': '.price(price2num($objp->stock, 'MS'));
3348 3348
 				$outval .= '</span>';
3349 3349
 				if (empty($novirtualstock) && getDolGlobalString('STOCK_SHOW_VIRTUAL_STOCK_IN_PRODUCTS_COMBO')) {  // Warning, this option may slow down combo list generation
3350 3350
 					$langs->load("stocks");
@@ -3354,9 +3354,9 @@  discard block
 block discarded – undo
3354 3354
 					$tmpproduct->load_virtual_stock();
3355 3355
 					$virtualstock = $tmpproduct->stock_theorique;
3356 3356
 
3357
-					$opt .= ' - ' . $langs->trans("VirtualStock") . ':' . $virtualstock;
3357
+					$opt .= ' - '.$langs->trans("VirtualStock").':'.$virtualstock;
3358 3358
 
3359
-					$outval .= ' - ' . $langs->transnoentities("VirtualStock") . ':';
3359
+					$outval .= ' - '.$langs->transnoentities("VirtualStock").':';
3360 3360
 					if ($virtualstock > 0) {
3361 3361
 						$outval .= '<span class="product_line_stock_ok">';
3362 3362
 					} elseif ($virtualstock <= 0) {
@@ -3434,7 +3434,7 @@  discard block
 block discarded – undo
3434 3434
 		$selected_input_value = '';
3435 3435
 		if (!empty($conf->use_javascript_ajax) && getDolGlobalString('PRODUIT_USE_SEARCH_TO_SELECT')) {
3436 3436
 			if ($selected > 0) {
3437
-				require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
3437
+				require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
3438 3438
 				$producttmpselect = new Product($this->db);
3439 3439
 				$producttmpselect->fetch($selected);
3440 3440
 				$selected_input_value = $producttmpselect->ref;
@@ -3442,10 +3442,10 @@  discard block
 block discarded – undo
3442 3442
 			}
3443 3443
 
3444 3444
 			// mode=2 means suppliers products
3445
-			$urloption = ($socid > 0 ? 'socid=' . $socid . '&' : '') . 'htmlname=' . $htmlname . '&outjson=1&price_level=' . $price_level . '&type=' . $filtertype . '&mode=2&status=' . $status . '&finished=' . $finished . '&alsoproductwithnosupplierprice=' . $alsoproductwithnosupplierprice;
3446
-			print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 0, $ajaxoptions);
3445
+			$urloption = ($socid > 0 ? 'socid='.$socid.'&' : '').'htmlname='.$htmlname.'&outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=2&status='.$status.'&finished='.$finished.'&alsoproductwithnosupplierprice='.$alsoproductwithnosupplierprice;
3446
+			print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 0, $ajaxoptions);
3447 3447
 
3448
-			print($hidelabel ? '' : $langs->trans("RefOrLabel") . ' : ') . '<input type="text" class="minwidth300" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . ($placeholder ? ' placeholder="' . $placeholder . '"' : '') . '>';
3448
+			print($hidelabel ? '' : $langs->trans("RefOrLabel").' : ').'<input type="text" class="minwidth300" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.($placeholder ? ' placeholder="'.$placeholder.'"' : '').'>';
3449 3449
 		} else {
3450 3450
 			print $this->select_produits_fournisseurs_list($socid, $selected, $htmlname, $filtertype, $filtre, '', $status, 0, 0, $alsoproductwithnosupplierprice, $morecss, 0, $placeholder);
3451 3451
 		}
@@ -3505,25 +3505,25 @@  discard block
 block discarded – undo
3505 3505
 		if (isModEnabled('barcode')) {
3506 3506
 			$sql .= ", pfp.barcode";
3507 3507
 		}
3508
-		$sql .= " FROM " . $this->db->prefix() . "product as p";
3509
-		$sql .= " LEFT JOIN " . $this->db->prefix() . "product_fournisseur_price as pfp ON ( p.rowid = pfp.fk_product AND pfp.entity IN (" . getEntity('product') . ") )";
3508
+		$sql .= " FROM ".$this->db->prefix()."product as p";
3509
+		$sql .= " LEFT JOIN ".$this->db->prefix()."product_fournisseur_price as pfp ON ( p.rowid = pfp.fk_product AND pfp.entity IN (".getEntity('product').") )";
3510 3510
 		if ($socid > 0) {
3511
-			$sql .= " AND pfp.fk_soc = " . ((int) $socid);
3511
+			$sql .= " AND pfp.fk_soc = ".((int) $socid);
3512 3512
 		}
3513
-		$sql .= " LEFT JOIN " . $this->db->prefix() . "societe as s ON pfp.fk_soc = s.rowid";
3513
+		$sql .= " LEFT JOIN ".$this->db->prefix()."societe as s ON pfp.fk_soc = s.rowid";
3514 3514
 		// Units
3515 3515
 		if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
3516
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "c_units u ON u.rowid = p.fk_unit";
3516
+			$sql .= " LEFT JOIN ".$this->db->prefix()."c_units u ON u.rowid = p.fk_unit";
3517 3517
 		}
3518
-		$sql .= " WHERE p.entity IN (" . getEntity('product') . ")";
3518
+		$sql .= " WHERE p.entity IN (".getEntity('product').")";
3519 3519
 		if ($statut != -1) {
3520
-			$sql .= " AND p.tobuy = " . ((int) $statut);
3520
+			$sql .= " AND p.tobuy = ".((int) $statut);
3521 3521
 		}
3522 3522
 		if (strval($filtertype) != '') {
3523
-			$sql .= " AND p.fk_product_type = " . ((int) $filtertype);
3523
+			$sql .= " AND p.fk_product_type = ".((int) $filtertype);
3524 3524
 		}
3525 3525
 		if (!empty($filtre)) {
3526
-			$sql .= " " . $filtre;
3526
+			$sql .= " ".$filtre;
3527 3527
 		}
3528 3528
 		// Add where from hooks
3529 3529
 		$parameters = array();
@@ -3543,9 +3543,9 @@  discard block
 block discarded – undo
3543 3543
 				if ($i > 0) {
3544 3544
 					$sql .= " AND ";
3545 3545
 				}
3546
-				$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) . "%'";
3546
+				$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)."%'";
3547 3547
 				if (getDolGlobalString('PRODUIT_FOURN_TEXTS')) {
3548
-					$sql .= " OR pfp.desc_fourn LIKE '" . $this->db->escape($prefix . $crit) . "%'";
3548
+					$sql .= " OR pfp.desc_fourn LIKE '".$this->db->escape($prefix.$crit)."%'";
3549 3549
 				}
3550 3550
 				$sql .= ")";
3551 3551
 				$i++;
@@ -3554,8 +3554,8 @@  discard block
 block discarded – undo
3554 3554
 				$sql .= ")";
3555 3555
 			}
3556 3556
 			if (isModEnabled('barcode')) {
3557
-				$sql .= " OR p.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
3558
-				$sql .= " OR pfp.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
3557
+				$sql .= " OR p.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'";
3558
+				$sql .= " OR pfp.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'";
3559 3559
 			}
3560 3560
 			$sql .= ')';
3561 3561
 		}
@@ -3564,20 +3564,20 @@  discard block
 block discarded – undo
3564 3564
 
3565 3565
 		// Build output string
3566 3566
 
3567
-		dol_syslog(get_class($this) . "::select_produits_fournisseurs_list", LOG_DEBUG);
3567
+		dol_syslog(get_class($this)."::select_produits_fournisseurs_list", LOG_DEBUG);
3568 3568
 		$result = $this->db->query($sql);
3569 3569
 		if ($result) {
3570
-			require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
3571
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/product.lib.php';
3570
+			require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
3571
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php';
3572 3572
 
3573 3573
 			$num = $this->db->num_rows($result);
3574 3574
 
3575 3575
 			//$out.='<select class="flat" id="select'.$htmlname.'" name="'.$htmlname.'">';	// remove select to have id same with combo and ajax
3576
-			$out .= '<select class="flat ' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . '">';
3576
+			$out .= '<select class="flat '.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.'">';
3577 3577
 			if (!$selected) {
3578
-				$out .= '<option value="-1" selected>' . ($placeholder ? $placeholder : '&nbsp;') . '</option>';
3578
+				$out .= '<option value="-1" selected>'.($placeholder ? $placeholder : '&nbsp;').'</option>';
3579 3579
 			} else {
3580
-				$out .= '<option value="-1">' . ($placeholder ? $placeholder : '&nbsp;') . '</option>';
3580
+				$out .= '<option value="-1">'.($placeholder ? $placeholder : '&nbsp;').'</option>';
3581 3581
 			}
3582 3582
 
3583 3583
 			$i = 0;
@@ -3592,7 +3592,7 @@  discard block
 block discarded – undo
3592 3592
 
3593 3593
 				$outkey = $objp->idprodfournprice; // id in table of price
3594 3594
 				if (!$outkey && $alsoproductwithnosupplierprice) {
3595
-					$outkey = 'idprod_' . $objp->rowid; // id of product
3595
+					$outkey = 'idprod_'.$objp->rowid; // id of product
3596 3596
 				}
3597 3597
 
3598 3598
 				$outref = $objp->ref;
@@ -3607,23 +3607,23 @@  discard block
 block discarded – undo
3607 3607
 				$outvalUnits = '';
3608 3608
 				if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
3609 3609
 					if (!empty($objp->unit_short)) {
3610
-						$outvalUnits .= ' - ' . $objp->unit_short;
3610
+						$outvalUnits .= ' - '.$objp->unit_short;
3611 3611
 					}
3612 3612
 					if (!empty($objp->weight) && $objp->weight_units !== null) {
3613 3613
 						$unitToShow = showDimensionInBestUnit($objp->weight, $objp->weight_units, 'weight', $langs);
3614
-						$outvalUnits .= ' - ' . $unitToShow;
3614
+						$outvalUnits .= ' - '.$unitToShow;
3615 3615
 					}
3616 3616
 					if ((!empty($objp->length) || !empty($objp->width) || !empty($objp->height)) && $objp->length_units !== null) {
3617
-						$unitToShow = $objp->length . ' x ' . $objp->width . ' x ' . $objp->height . ' ' . measuringUnitString(0, 'size', $objp->length_units);
3618
-						$outvalUnits .= ' - ' . $unitToShow;
3617
+						$unitToShow = $objp->length.' x '.$objp->width.' x '.$objp->height.' '.measuringUnitString(0, 'size', $objp->length_units);
3618
+						$outvalUnits .= ' - '.$unitToShow;
3619 3619
 					}
3620 3620
 					if (!empty($objp->surface) && $objp->surface_units !== null) {
3621 3621
 						$unitToShow = showDimensionInBestUnit($objp->surface, $objp->surface_units, 'surface', $langs);
3622
-						$outvalUnits .= ' - ' . $unitToShow;
3622
+						$outvalUnits .= ' - '.$unitToShow;
3623 3623
 					}
3624 3624
 					if (!empty($objp->volume) && $objp->volume_units !== null) {
3625 3625
 						$unitToShow = showDimensionInBestUnit($objp->volume, $objp->volume_units, 'volume', $langs);
3626
-						$outvalUnits .= ' - ' . $unitToShow;
3626
+						$outvalUnits .= ' - '.$unitToShow;
3627 3627
 					}
3628 3628
 					if ($outdurationvalue && $outdurationunit) {
3629 3629
 						$da = array(
@@ -3634,22 +3634,22 @@  discard block
 block discarded – undo
3634 3634
 							'y' => $langs->trans('Year')
3635 3635
 						);
3636 3636
 						if (isset($da[$outdurationunit])) {
3637
-							$outvalUnits .= ' - ' . $outdurationvalue . ' ' . $langs->transnoentities($da[$outdurationunit] . ($outdurationvalue > 1 ? 's' : ''));
3637
+							$outvalUnits .= ' - '.$outdurationvalue.' '.$langs->transnoentities($da[$outdurationunit].($outdurationvalue > 1 ? 's' : ''));
3638 3638
 						}
3639 3639
 					}
3640 3640
 				}
3641 3641
 
3642 3642
 				$objRef = $objp->ref;
3643 3643
 				if ($filterkey && $filterkey != '') {
3644
-					$objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1);
3644
+					$objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1);
3645 3645
 				}
3646 3646
 				$objRefFourn = $objp->ref_fourn;
3647 3647
 				if ($filterkey && $filterkey != '') {
3648
-					$objRefFourn = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRefFourn, 1);
3648
+					$objRefFourn = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRefFourn, 1);
3649 3649
 				}
3650 3650
 				$label = $objp->label;
3651 3651
 				if ($filterkey && $filterkey != '') {
3652
-					$label = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $label, 1);
3652
+					$label = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $label, 1);
3653 3653
 				}
3654 3654
 
3655 3655
 				switch ($objp->fk_product_type) {
@@ -3672,21 +3672,21 @@  discard block
 block discarded – undo
3672 3672
 
3673 3673
 				$optlabel .= $objp->ref;
3674 3674
 				if (!empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) {
3675
-					$optlabel .= ' <span class="opacitymedium">(' . $objp->ref_fourn . ')</span>';
3675
+					$optlabel .= ' <span class="opacitymedium">('.$objp->ref_fourn.')</span>';
3676 3676
 				}
3677 3677
 				if (isModEnabled('barcode') && !empty($objp->barcode)) {
3678
-					$optlabel .= ' (' . $outbarcode . ')';
3678
+					$optlabel .= ' ('.$outbarcode.')';
3679 3679
 				}
3680
-				$optlabel .= ' - ' . dol_trunc($label, $maxlengtharticle);
3680
+				$optlabel .= ' - '.dol_trunc($label, $maxlengtharticle);
3681 3681
 
3682 3682
 				$outvallabel = $objRef;
3683 3683
 				if (!empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) {
3684
-					$outvallabel .= ' (' . $objRefFourn . ')';
3684
+					$outvallabel .= ' ('.$objRefFourn.')';
3685 3685
 				}
3686 3686
 				if (isModEnabled('barcode') && !empty($objp->barcode)) {
3687
-					$outvallabel .= ' (' . $outbarcode . ')';
3687
+					$outvallabel .= ' ('.$outbarcode.')';
3688 3688
 				}
3689
-				$outvallabel .= ' - ' . dol_trunc($label, $maxlengtharticle);
3689
+				$outvallabel .= ' - '.dol_trunc($label, $maxlengtharticle);
3690 3690
 
3691 3691
 				// Units
3692 3692
 				$optlabel .= $outvalUnits;
@@ -3703,7 +3703,7 @@  discard block
 block discarded – undo
3703 3703
 						$prod_supplier->fourn_tva_tx = $objp->tva_tx;
3704 3704
 						$prod_supplier->fk_supplier_price_expression = $objp->fk_supplier_price_expression;
3705 3705
 
3706
-						require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
3706
+						require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
3707 3707
 						$priceparser = new PriceParser($this->db);
3708 3708
 						$price_result = $priceparser->parseProductSupplier($prod_supplier);
3709 3709
 						if ($price_result >= 0) {
@@ -3714,47 +3714,47 @@  discard block
 block discarded – undo
3714 3714
 						}
3715 3715
 					}
3716 3716
 					if ($objp->quantity == 1) {
3717
-						$optlabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/";
3718
-						$outvallabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency) . "/";
3717
+						$optlabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/";
3718
+						$outvallabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency)."/";
3719 3719
 						$optlabel .= $langs->trans("Unit"); // Do not use strtolower because it breaks utf8 encoding
3720 3720
 						$outvallabel .= $langs->transnoentities("Unit");
3721 3721
 					} else {
3722
-						$optlabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity;
3723
-						$outvallabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity;
3724
-						$optlabel .= ' ' . $langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding
3725
-						$outvallabel .= ' ' . $langs->transnoentities("Units");
3722
+						$optlabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity;
3723
+						$outvallabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity;
3724
+						$optlabel .= ' '.$langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding
3725
+						$outvallabel .= ' '.$langs->transnoentities("Units");
3726 3726
 					}
3727 3727
 
3728 3728
 					if ($objp->quantity > 1) {
3729
-						$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
3730
-						$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
3729
+						$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
3730
+						$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
3731 3731
 					}
3732 3732
 					if ($objp->remise_percent >= 1) {
3733
-						$optlabel .= " - " . $langs->trans("Discount") . " : " . vatrate($objp->remise_percent) . ' %';
3734
-						$outvallabel .= " - " . $langs->transnoentities("Discount") . " : " . vatrate($objp->remise_percent) . ' %';
3733
+						$optlabel .= " - ".$langs->trans("Discount")." : ".vatrate($objp->remise_percent).' %';
3734
+						$outvallabel .= " - ".$langs->transnoentities("Discount")." : ".vatrate($objp->remise_percent).' %';
3735 3735
 					}
3736 3736
 					if ($objp->duration) {
3737
-						$optlabel .= " - " . $objp->duration;
3738
-						$outvallabel .= " - " . $objp->duration;
3737
+						$optlabel .= " - ".$objp->duration;
3738
+						$outvallabel .= " - ".$objp->duration;
3739 3739
 					}
3740 3740
 					if (!$socid) {
3741
-						$optlabel .= " - " . dol_trunc($objp->name, 8);
3742
-						$outvallabel .= " - " . dol_trunc($objp->name, 8);
3741
+						$optlabel .= " - ".dol_trunc($objp->name, 8);
3742
+						$outvallabel .= " - ".dol_trunc($objp->name, 8);
3743 3743
 					}
3744 3744
 					if ($objp->supplier_reputation) {
3745 3745
 						//TODO dictionary
3746 3746
 						$reputations = array('' => $langs->trans('Standard'), 'FAVORITE' => $langs->trans('Favorite'), 'NOTTHGOOD' => $langs->trans('NotTheGoodQualitySupplier'), 'DONOTORDER' => $langs->trans('DoNotOrderThisProductToThisSupplier'));
3747 3747
 
3748
-						$optlabel .= " - " . $reputations[$objp->supplier_reputation];
3749
-						$outvallabel .= " - " . $reputations[$objp->supplier_reputation];
3748
+						$optlabel .= " - ".$reputations[$objp->supplier_reputation];
3749
+						$outvallabel .= " - ".$reputations[$objp->supplier_reputation];
3750 3750
 					}
3751 3751
 				} else {
3752 3752
 					if (empty($alsoproductwithnosupplierprice)) {     // No supplier price defined for couple product/supplier
3753
-						$optlabel .= " - <span class='opacitymedium'>" . $langs->trans("NoPriceDefinedForThisSupplier") . '</span>';
3754
-						$outvallabel .= ' - ' . $langs->transnoentities("NoPriceDefinedForThisSupplier");
3753
+						$optlabel .= " - <span class='opacitymedium'>".$langs->trans("NoPriceDefinedForThisSupplier").'</span>';
3754
+						$outvallabel .= ' - '.$langs->transnoentities("NoPriceDefinedForThisSupplier");
3755 3755
 					} else { // No supplier price defined for product, even on other suppliers
3756
-						$optlabel .= " - <span class='opacitymedium'>" . $langs->trans("NoPriceDefinedForThisSupplier") . '</span>';
3757
-						$outvallabel .= ' - ' . $langs->transnoentities("NoPriceDefinedForThisSupplier");
3756
+						$optlabel .= " - <span class='opacitymedium'>".$langs->trans("NoPriceDefinedForThisSupplier").'</span>';
3757
+						$outvallabel .= ' - '.$langs->transnoentities("NoPriceDefinedForThisSupplier");
3758 3758
 					}
3759 3759
 				}
3760 3760
 
@@ -3762,14 +3762,14 @@  discard block
 block discarded – undo
3762 3762
 					$novirtualstock = ($showstockinlist == 2);
3763 3763
 
3764 3764
 					if ($user->hasRight('stock', 'lire')) {
3765
-						$outvallabel .= ' - ' . $langs->trans("Stock") . ': ' . price(price2num($objp->stock, 'MS'));
3765
+						$outvallabel .= ' - '.$langs->trans("Stock").': '.price(price2num($objp->stock, 'MS'));
3766 3766
 
3767 3767
 						if ($objp->stock > 0) {
3768 3768
 							$optlabel .= ' - <span class="product_line_stock_ok">';
3769 3769
 						} elseif ($objp->stock <= 0) {
3770 3770
 							$optlabel .= ' - <span class="product_line_stock_too_low">';
3771 3771
 						}
3772
-						$optlabel .= $langs->transnoentities("Stock") . ':' . price(price2num($objp->stock, 'MS'));
3772
+						$optlabel .= $langs->transnoentities("Stock").':'.price(price2num($objp->stock, 'MS'));
3773 3773
 						$optlabel .= '</span>';
3774 3774
 						if (empty($novirtualstock) && getDolGlobalString('STOCK_SHOW_VIRTUAL_STOCK_IN_PRODUCTS_COMBO')) {  // Warning, this option may slow down combo list generation
3775 3775
 							$langs->load("stocks");
@@ -3779,9 +3779,9 @@  discard block
 block discarded – undo
3779 3779
 							$tmpproduct->load_virtual_stock();
3780 3780
 							$virtualstock = $tmpproduct->stock_theorique;
3781 3781
 
3782
-							$outvallabel .= ' - ' . $langs->trans("VirtualStock") . ':' . $virtualstock;
3782
+							$outvallabel .= ' - '.$langs->trans("VirtualStock").':'.$virtualstock;
3783 3783
 
3784
-							$optlabel .= ' - ' . $langs->transnoentities("VirtualStock") . ':';
3784
+							$optlabel .= ' - '.$langs->transnoentities("VirtualStock").':';
3785 3785
 							if ($virtualstock > 0) {
3786 3786
 								$optlabel .= '<span class="product_line_stock_ok">';
3787 3787
 							} elseif ($virtualstock <= 0) {
@@ -3795,7 +3795,7 @@  discard block
 block discarded – undo
3795 3795
 					}
3796 3796
 				}
3797 3797
 
3798
-				$optstart = '<option value="' . $outkey . '"';
3798
+				$optstart = '<option value="'.$outkey.'"';
3799 3799
 				if ($selected && $selected == $objp->idprodfournprice) {
3800 3800
 					$optstart .= ' selected';
3801 3801
 				}
@@ -3804,27 +3804,27 @@  discard block
 block discarded – undo
3804 3804
 				}
3805 3805
 
3806 3806
 				if (!empty($objp->idprodfournprice) && $objp->idprodfournprice > 0) {
3807
-					$optstart .= ' data-product-id="' . dol_escape_htmltag($objp->rowid) . '"';
3808
-					$optstart .= ' data-price-id="' . dol_escape_htmltag($objp->idprodfournprice) . '"';
3809
-					$optstart .= ' data-qty="' . dol_escape_htmltag($objp->quantity) . '"';
3810
-					$optstart .= ' data-up="' . dol_escape_htmltag(price2num($objp->unitprice)) . '"';
3811
-					$optstart .= ' data-up-locale="' . dol_escape_htmltag(price($objp->unitprice)) . '"';
3812
-					$optstart .= ' data-discount="' . dol_escape_htmltag($outdiscount) . '"';
3813
-					$optstart .= ' data-tvatx="' . dol_escape_htmltag(price2num($objp->tva_tx)) . '"';
3814
-					$optstart .= ' data-tvatx-formated="' . dol_escape_htmltag(price($objp->tva_tx, 0, $langs, 1, -1, 2)) . '"';
3815
-					$optstart .= ' data-default-vat-code="' . dol_escape_htmltag($objp->default_vat_code) . '"';
3816
-					$optstart .= ' data-supplier-ref="' . dol_escape_htmltag($objp->ref_fourn) . '"';
3817
-				}
3818
-				$optstart .= ' data-description="' . dol_escape_htmltag($objp->description, 0, 1) . '"';
3807
+					$optstart .= ' data-product-id="'.dol_escape_htmltag($objp->rowid).'"';
3808
+					$optstart .= ' data-price-id="'.dol_escape_htmltag($objp->idprodfournprice).'"';
3809
+					$optstart .= ' data-qty="'.dol_escape_htmltag($objp->quantity).'"';
3810
+					$optstart .= ' data-up="'.dol_escape_htmltag(price2num($objp->unitprice)).'"';
3811
+					$optstart .= ' data-up-locale="'.dol_escape_htmltag(price($objp->unitprice)).'"';
3812
+					$optstart .= ' data-discount="'.dol_escape_htmltag($outdiscount).'"';
3813
+					$optstart .= ' data-tvatx="'.dol_escape_htmltag(price2num($objp->tva_tx)).'"';
3814
+					$optstart .= ' data-tvatx-formated="'.dol_escape_htmltag(price($objp->tva_tx, 0, $langs, 1, -1, 2)).'"';
3815
+					$optstart .= ' data-default-vat-code="'.dol_escape_htmltag($objp->default_vat_code).'"';
3816
+					$optstart .= ' data-supplier-ref="'.dol_escape_htmltag($objp->ref_fourn).'"';
3817
+				}
3818
+				$optstart .= ' data-description="'.dol_escape_htmltag($objp->description, 0, 1).'"';
3819 3819
 
3820 3820
 				$outarrayentry = array(
3821 3821
 					'key' => $outkey,
3822 3822
 					'value' => $outref,
3823 3823
 					'label' => $outvallabel,
3824 3824
 					'qty' => $outqty,
3825
-					'price_qty_ht' => price2num($objp->fprice, 'MU'),    // Keep higher resolution for price for the min qty
3826
-					'price_unit_ht' => price2num($objp->unitprice, 'MU'),    // This is used to fill the Unit Price
3827
-					'price_ht' => price2num($objp->unitprice, 'MU'),        // This is used to fill the Unit Price (for compatibility)
3825
+					'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty
3826
+					'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price
3827
+					'price_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility)
3828 3828
 					'tva_tx_formated' => price($objp->tva_tx, 0, $langs, 1, -1, 2),
3829 3829
 					'tva_tx' => price2num($objp->tva_tx),
3830 3830
 					'default_vat_code' => $objp->default_vat_code,
@@ -3849,18 +3849,18 @@  discard block
 block discarded – undo
3849 3849
 				// Add new entry
3850 3850
 				// "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
3851 3851
 				// "label" value of json key array is used by jQuery automatically as text for combo box
3852
-				$out .= $optstart . ' data-html="' . dol_escape_htmltag($optlabel) . '">' . $optlabel . "</option>\n";
3852
+				$out .= $optstart.' data-html="'.dol_escape_htmltag($optlabel).'">'.$optlabel."</option>\n";
3853 3853
 				array_push(
3854 3854
 					$outarray,
3855 3855
 					array('key' => $outkey,
3856 3856
 						'value' => $outref,
3857 3857
 						'label' => $outvallabel,
3858 3858
 						'qty' => $outqty,
3859
-						'price_qty_ht' => price2num($objp->fprice, 'MU'),        // Keep higher resolution for price for the min qty
3859
+						'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty
3860 3860
 						'price_qty_ht_locale' => price($objp->fprice),
3861
-						'price_unit_ht' => price2num($objp->unitprice, 'MU'),    // This is used to fill the Unit Price
3861
+						'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price
3862 3862
 						'price_unit_ht_locale' => price($objp->unitprice),
3863
-						'price_ht' => price2num($objp->unitprice, 'MU'),        // This is used to fill the Unit Price (for compatibility)
3863
+						'price_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility)
3864 3864
 						'tva_tx_formated' => price($objp->tva_tx),
3865 3865
 						'tva_tx' => price2num($objp->tva_tx),
3866 3866
 						'default_vat_code' => $objp->default_vat_code,
@@ -3887,7 +3887,7 @@  discard block
 block discarded – undo
3887 3887
 
3888 3888
 			$this->db->free($result);
3889 3889
 
3890
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
3890
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
3891 3891
 			$out .= ajax_combobox($htmlname);
3892 3892
 		} else {
3893 3893
 			dol_print_error($this->db);
@@ -3919,43 +3919,43 @@  discard block
 block discarded – undo
3919 3919
 		$sql = "SELECT p.rowid, p.ref, p.label, p.price, p.duration, pfp.fk_soc,";
3920 3920
 		$sql .= " pfp.ref_fourn, pfp.rowid as idprodfournprice, pfp.price as fprice, pfp.remise_percent, pfp.quantity, pfp.unitprice,";
3921 3921
 		$sql .= " pfp.fk_supplier_price_expression, pfp.fk_product, pfp.tva_tx, s.nom as name";
3922
-		$sql .= " FROM " . $this->db->prefix() . "product as p";
3923
-		$sql .= " LEFT JOIN " . $this->db->prefix() . "product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
3924
-		$sql .= " LEFT JOIN " . $this->db->prefix() . "societe as s ON pfp.fk_soc = s.rowid";
3925
-		$sql .= " WHERE pfp.entity IN (" . getEntity('productsupplierprice') . ")";
3922
+		$sql .= " FROM ".$this->db->prefix()."product as p";
3923
+		$sql .= " LEFT JOIN ".$this->db->prefix()."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
3924
+		$sql .= " LEFT JOIN ".$this->db->prefix()."societe as s ON pfp.fk_soc = s.rowid";
3925
+		$sql .= " WHERE pfp.entity IN (".getEntity('productsupplierprice').")";
3926 3926
 		$sql .= " AND p.tobuy = 1";
3927 3927
 		$sql .= " AND s.fournisseur = 1";
3928
-		$sql .= " AND p.rowid = " . ((int) $productid);
3928
+		$sql .= " AND p.rowid = ".((int) $productid);
3929 3929
 		if (!getDolGlobalString('PRODUCT_BEST_SUPPLIER_PRICE_PRESELECTED')) {
3930 3930
 			$sql .= " ORDER BY s.nom, pfp.ref_fourn DESC";
3931 3931
 		} else {
3932 3932
 			$sql .= " ORDER BY pfp.unitprice ASC";
3933 3933
 		}
3934 3934
 
3935
-		dol_syslog(get_class($this) . "::select_product_fourn_price", LOG_DEBUG);
3935
+		dol_syslog(get_class($this)."::select_product_fourn_price", LOG_DEBUG);
3936 3936
 		$result = $this->db->query($sql);
3937 3937
 
3938 3938
 		if ($result) {
3939 3939
 			$num = $this->db->num_rows($result);
3940 3940
 
3941
-			$form = '<select class="flat" id="select_' . $htmlname . '" name="' . $htmlname . '">';
3941
+			$form = '<select class="flat" id="select_'.$htmlname.'" name="'.$htmlname.'">';
3942 3942
 
3943 3943
 			if (!$num) {
3944
-				$form .= '<option value="0">-- ' . $langs->trans("NoSupplierPriceDefinedForThisProduct") . ' --</option>';
3944
+				$form .= '<option value="0">-- '.$langs->trans("NoSupplierPriceDefinedForThisProduct").' --</option>';
3945 3945
 			} else {
3946
-				require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
3946
+				require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
3947 3947
 				$form .= '<option value="0">&nbsp;</option>';
3948 3948
 
3949 3949
 				$i = 0;
3950 3950
 				while ($i < $num) {
3951 3951
 					$objp = $this->db->fetch_object($result);
3952 3952
 
3953
-					$opt = '<option value="' . $objp->idprodfournprice . '"';
3953
+					$opt = '<option value="'.$objp->idprodfournprice.'"';
3954 3954
 					//if there is only one supplier, preselect it
3955 3955
 					if ($num == 1 || ($selected_supplier > 0 && $objp->fk_soc == $selected_supplier) || ($i == 0 && getDolGlobalString('PRODUCT_BEST_SUPPLIER_PRICE_PRESELECTED'))) {
3956 3956
 						$opt .= ' selected';
3957 3957
 					}
3958
-					$opt .= '>' . $objp->name . ' - ' . $objp->ref_fourn . ' - ';
3958
+					$opt .= '>'.$objp->name.' - '.$objp->ref_fourn.' - ';
3959 3959
 
3960 3960
 					if (isModEnabled('dynamicprices') && !empty($objp->fk_supplier_price_expression)) {
3961 3961
 						$prod_supplier = new ProductFournisseur($this->db);
@@ -3965,7 +3965,7 @@  discard block
 block discarded – undo
3965 3965
 						$prod_supplier->fourn_tva_tx = $objp->tva_tx;
3966 3966
 						$prod_supplier->fk_supplier_price_expression = $objp->fk_supplier_price_expression;
3967 3967
 
3968
-						require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
3968
+						require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
3969 3969
 						$priceparser = new PriceParser($this->db);
3970 3970
 						$price_result = $priceparser->parseProductSupplier($prod_supplier);
3971 3971
 						if ($price_result >= 0) {
@@ -3976,10 +3976,10 @@  discard block
 block discarded – undo
3976 3976
 						}
3977 3977
 					}
3978 3978
 					if ($objp->quantity == 1) {
3979
-						$opt .= price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/";
3979
+						$opt .= price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/";
3980 3980
 					}
3981 3981
 
3982
-					$opt .= $objp->quantity . ' ';
3982
+					$opt .= $objp->quantity.' ';
3983 3983
 
3984 3984
 					if ($objp->quantity == 1) {
3985 3985
 						$opt .= $langs->trans("Unit");
@@ -3988,10 +3988,10 @@  discard block
 block discarded – undo
3988 3988
 					}
3989 3989
 					if ($objp->quantity > 1) {
3990 3990
 						$opt .= " - ";
3991
-						$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");
3991
+						$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");
3992 3992
 					}
3993 3993
 					if ($objp->duration) {
3994
-						$opt .= " - " . $objp->duration;
3994
+						$opt .= " - ".$objp->duration;
3995 3995
 					}
3996 3996
 					$opt .= "</option>\n";
3997 3997
 
@@ -4029,8 +4029,8 @@  discard block
 block discarded – undo
4029 4029
 		dol_syslog(__METHOD__, LOG_DEBUG);
4030 4030
 
4031 4031
 		$sql = "SELECT rowid, code, libelle as label, deposit_percent";
4032
-		$sql .= " FROM " . $this->db->prefix() . 'c_payment_term';
4033
-		$sql .= " WHERE entity IN (" . getEntity('c_payment_term') . ")";
4032
+		$sql .= " FROM ".$this->db->prefix().'c_payment_term';
4033
+		$sql .= " WHERE entity IN (".getEntity('c_payment_term').")";
4034 4034
 		$sql .= " AND active > 0";
4035 4035
 		$sql .= " ORDER BY sortorder";
4036 4036
 
@@ -4042,7 +4042,7 @@  discard block
 block discarded – undo
4042 4042
 				$obj = $this->db->fetch_object($resql);
4043 4043
 
4044 4044
 				// Si traduction existe, on l'utilise, sinon on prend le libelle par default
4045
-				$label = ($langs->trans("PaymentConditionShort" . $obj->code) != "PaymentConditionShort" . $obj->code ? $langs->trans("PaymentConditionShort" . $obj->code) : ($obj->label != '-' ? $obj->label : ''));
4045
+				$label = ($langs->trans("PaymentConditionShort".$obj->code) != "PaymentConditionShort".$obj->code ? $langs->trans("PaymentConditionShort".$obj->code) : ($obj->label != '-' ? $obj->label : ''));
4046 4046
 				$this->cache_conditions_paiements[$obj->rowid]['code'] = $obj->code;
4047 4047
 				$this->cache_conditions_paiements[$obj->rowid]['label'] = $label;
4048 4048
 				$this->cache_conditions_paiements[$obj->rowid]['deposit_percent'] = $obj->deposit_percent;
@@ -4070,7 +4070,7 @@  discard block
 block discarded – undo
4070 4070
 		// phpcs:enable
4071 4071
 		global $langs;
4072 4072
 
4073
-		$num = count($this->cache_availability);    // TODO Use $conf->cache['availability'] instead of $this->cache_availability
4073
+		$num = count($this->cache_availability); // TODO Use $conf->cache['availability'] instead of $this->cache_availability
4074 4074
 		if ($num > 0) {
4075 4075
 			return 0; // Cache already loaded
4076 4076
 		}
@@ -4080,7 +4080,7 @@  discard block
 block discarded – undo
4080 4080
 		$langs->load('propal');
4081 4081
 
4082 4082
 		$sql = "SELECT rowid, code, label, position";
4083
-		$sql .= " FROM " . $this->db->prefix() . 'c_availability';
4083
+		$sql .= " FROM ".$this->db->prefix().'c_availability';
4084 4084
 		$sql .= " WHERE active > 0";
4085 4085
 
4086 4086
 		$resql = $this->db->query($sql);
@@ -4091,7 +4091,7 @@  discard block
 block discarded – undo
4091 4091
 				$obj = $this->db->fetch_object($resql);
4092 4092
 
4093 4093
 				// Si traduction existe, on l'utilise, sinon on prend le libelle par default
4094
-				$label = ($langs->trans("AvailabilityType" . $obj->code) != "AvailabilityType" . $obj->code ? $langs->trans("AvailabilityType" . $obj->code) : ($obj->label != '-' ? $obj->label : ''));
4094
+				$label = ($langs->trans("AvailabilityType".$obj->code) != "AvailabilityType".$obj->code ? $langs->trans("AvailabilityType".$obj->code) : ($obj->label != '-' ? $obj->label : ''));
4095 4095
 				$this->cache_availability[$obj->rowid]['code'] = $obj->code;
4096 4096
 				$this->cache_availability[$obj->rowid]['label'] = $label;
4097 4097
 				$this->cache_availability[$obj->rowid]['position'] = $obj->position;
@@ -4123,17 +4123,17 @@  discard block
 block discarded – undo
4123 4123
 
4124 4124
 		$this->load_cache_availability();
4125 4125
 
4126
-		dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG);
4126
+		dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG);
4127 4127
 
4128
-		print '<select id="' . $htmlname . '" class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">';
4128
+		print '<select id="'.$htmlname.'" class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
4129 4129
 		if ($addempty) {
4130 4130
 			print '<option value="0">&nbsp;</option>';
4131 4131
 		}
4132 4132
 		foreach ($this->cache_availability as $id => $arrayavailability) {
4133 4133
 			if ($selected == $id) {
4134
-				print '<option value="' . $id . '" selected>';
4134
+				print '<option value="'.$id.'" selected>';
4135 4135
 			} else {
4136
-				print '<option value="' . $id . '">';
4136
+				print '<option value="'.$id.'">';
4137 4137
 			}
4138 4138
 			print dol_escape_htmltag($arrayavailability['label']);
4139 4139
 			print '</option>';
@@ -4154,13 +4154,13 @@  discard block
 block discarded – undo
4154 4154
 	{
4155 4155
 		global $langs;
4156 4156
 
4157
-		$num = count($this->cache_demand_reason);    // TODO Use $conf->cache['input_reason'] instead of $this->cache_demand_reason
4157
+		$num = count($this->cache_demand_reason); // TODO Use $conf->cache['input_reason'] instead of $this->cache_demand_reason
4158 4158
 		if ($num > 0) {
4159 4159
 			return 0; // Cache already loaded
4160 4160
 		}
4161 4161
 
4162 4162
 		$sql = "SELECT rowid, code, label";
4163
-		$sql .= " FROM " . $this->db->prefix() . 'c_input_reason';
4163
+		$sql .= " FROM ".$this->db->prefix().'c_input_reason';
4164 4164
 		$sql .= " WHERE active > 0";
4165 4165
 
4166 4166
 		$resql = $this->db->query($sql);
@@ -4173,8 +4173,8 @@  discard block
 block discarded – undo
4173 4173
 
4174 4174
 				// Si traduction existe, on l'utilise, sinon on prend le libelle par default
4175 4175
 				$label = ($obj->label != '-' ? $obj->label : '');
4176
-				if ($langs->trans("DemandReasonType" . $obj->code) != "DemandReasonType" . $obj->code) {
4177
-					$label = $langs->trans("DemandReasonType" . $obj->code); // So translation key DemandReasonTypeSRC_XXX will work
4176
+				if ($langs->trans("DemandReasonType".$obj->code) != "DemandReasonType".$obj->code) {
4177
+					$label = $langs->trans("DemandReasonType".$obj->code); // So translation key DemandReasonTypeSRC_XXX will work
4178 4178
 				}
4179 4179
 				if ($langs->trans($obj->code) != $obj->code) {
4180 4180
 					$label = $langs->trans($obj->code); // So translation key SRC_XXX will work
@@ -4214,9 +4214,9 @@  discard block
 block discarded – undo
4214 4214
 
4215 4215
 		$this->loadCacheInputReason();
4216 4216
 
4217
-		print '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="select_' . $htmlname . '" name="' . $htmlname . '">';
4217
+		print '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="select_'.$htmlname.'" name="'.$htmlname.'">';
4218 4218
 		if ($addempty) {
4219
-			print '<option value="0"' . (empty($selected) ? ' selected' : '') . '>&nbsp;</option>';
4219
+			print '<option value="0"'.(empty($selected) ? ' selected' : '').'>&nbsp;</option>';
4220 4220
 		}
4221 4221
 		foreach ($this->cache_demand_reason as $id => $arraydemandreason) {
4222 4222
 			if ($arraydemandreason['code'] == $exclude) {
@@ -4224,9 +4224,9 @@  discard block
 block discarded – undo
4224 4224
 			}
4225 4225
 
4226 4226
 			if ($selected && ($selected == $arraydemandreason['id'] || $selected == $arraydemandreason['code'])) {
4227
-				print '<option value="' . $arraydemandreason['id'] . '" selected>';
4227
+				print '<option value="'.$arraydemandreason['id'].'" selected>';
4228 4228
 			} else {
4229
-				print '<option value="' . $arraydemandreason['id'] . '">';
4229
+				print '<option value="'.$arraydemandreason['id'].'">';
4230 4230
 			}
4231 4231
 			$label = $arraydemandreason['label']; // Translation of label was already done into the ->loadCacheInputReason
4232 4232
 			print $langs->trans($label);
@@ -4236,7 +4236,7 @@  discard block
 block discarded – undo
4236 4236
 		if ($user->admin && empty($notooltip)) {
4237 4237
 			print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
4238 4238
 		}
4239
-		print ajax_combobox('select_' . $htmlname);
4239
+		print ajax_combobox('select_'.$htmlname);
4240 4240
 	}
4241 4241
 
4242 4242
 	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
@@ -4251,7 +4251,7 @@  discard block
 block discarded – undo
4251 4251
 		// phpcs:enable
4252 4252
 		global $langs;
4253 4253
 
4254
-		$num = count($this->cache_types_paiements);        // TODO Use $conf->cache['payment_mode'] instead of $this->cache_types_paiements
4254
+		$num = count($this->cache_types_paiements); // TODO Use $conf->cache['payment_mode'] instead of $this->cache_types_paiements
4255 4255
 		if ($num > 0) {
4256 4256
 			return $num; // Cache already loaded
4257 4257
 		}
@@ -4261,8 +4261,8 @@  discard block
 block discarded – undo
4261 4261
 		$this->cache_types_paiements = array();
4262 4262
 
4263 4263
 		$sql = "SELECT id, code, libelle as label, type, active";
4264
-		$sql .= " FROM " . $this->db->prefix() . "c_paiement";
4265
-		$sql .= " WHERE entity IN (" . getEntity('c_paiement') . ")";
4264
+		$sql .= " FROM ".$this->db->prefix()."c_paiement";
4265
+		$sql .= " WHERE entity IN (".getEntity('c_paiement').")";
4266 4266
 
4267 4267
 		$resql = $this->db->query($sql);
4268 4268
 		if ($resql) {
@@ -4272,7 +4272,7 @@  discard block
 block discarded – undo
4272 4272
 				$obj = $this->db->fetch_object($resql);
4273 4273
 
4274 4274
 				// Si traduction existe, on l'utilise, sinon on prend le libelle par default
4275
-				$label = ($langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) != "PaymentTypeShort" . $obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) : ($obj->label != '-' ? $obj->label : ''));
4275
+				$label = ($langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) != "PaymentTypeShort".$obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) : ($obj->label != '-' ? $obj->label : ''));
4276 4276
 				$this->cache_types_paiements[$obj->id]['id'] = $obj->id;
4277 4277
 				$this->cache_types_paiements[$obj->id]['code'] = $obj->code;
4278 4278
 				$this->cache_types_paiements[$obj->id]['label'] = $label;
@@ -4344,17 +4344,17 @@  discard block
 block discarded – undo
4344 4344
 		global $langs, $user, $conf;
4345 4345
 
4346 4346
 		$out = '';
4347
-		dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG);
4347
+		dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG);
4348 4348
 
4349 4349
 		$this->load_cache_conditions_paiements();
4350 4350
 
4351 4351
 		// Set default value if not already set by caller
4352 4352
 		if (empty($selected) && getDolGlobalString('MAIN_DEFAULT_PAYMENT_TERM_ID')) {
4353
-			dol_syslog(__METHOD__ . "Using deprecated option MAIN_DEFAULT_PAYMENT_TERM_ID", LOG_NOTICE);
4353
+			dol_syslog(__METHOD__."Using deprecated option MAIN_DEFAULT_PAYMENT_TERM_ID", LOG_NOTICE);
4354 4354
 			$selected = getDolGlobalString('MAIN_DEFAULT_PAYMENT_TERM_ID');
4355 4355
 		}
4356 4356
 
4357
-		$out .= '<select id="' . $htmlname . '" class="flat selectpaymentterms' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">';
4357
+		$out .= '<select id="'.$htmlname.'" class="flat selectpaymentterms'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
4358 4358
 		if ($addempty) {
4359 4359
 			$out .= '<option value="0">&nbsp;</option>';
4360 4360
 		}
@@ -4368,9 +4368,9 @@  discard block
 block discarded – undo
4368 4368
 
4369 4369
 			if ($selected == $id) {
4370 4370
 				$selectedDepositPercent = $deposit_percent > 0 ? $deposit_percent : $arrayconditions['deposit_percent'];
4371
-				$out .= '<option value="' . $id . '" data-deposit_percent="' . $arrayconditions['deposit_percent'] . '" selected>';
4371
+				$out .= '<option value="'.$id.'" data-deposit_percent="'.$arrayconditions['deposit_percent'].'" selected>';
4372 4372
 			} else {
4373
-				$out .= '<option value="' . $id . '" data-deposit_percent="' . $arrayconditions['deposit_percent'] . '">';
4373
+				$out .= '<option value="'.$id.'" data-deposit_percent="'.$arrayconditions['deposit_percent'].'">';
4374 4374
 			}
4375 4375
 			$label = $arrayconditions['label'];
4376 4376
 
@@ -4388,21 +4388,21 @@  discard block
 block discarded – undo
4388 4388
 		$out .= ajax_combobox($htmlname);
4389 4389
 
4390 4390
 		if ($deposit_percent >= 0) {
4391
-			$out .= ' <span id="' . $htmlname . '_deposit_percent_container"' . (empty($selectedDepositPercent) ? ' style="display: none"' : '') . '>';
4392
-			$out .= $langs->trans('DepositPercent') . ' : ';
4393
-			$out .= '<input id="' . $htmlname . '_deposit_percent" name="' . $htmlname . '_deposit_percent" class="maxwidth50" value="' . $deposit_percent . '" />';
4391
+			$out .= ' <span id="'.$htmlname.'_deposit_percent_container"'.(empty($selectedDepositPercent) ? ' style="display: none"' : '').'>';
4392
+			$out .= $langs->trans('DepositPercent').' : ';
4393
+			$out .= '<input id="'.$htmlname.'_deposit_percent" name="'.$htmlname.'_deposit_percent" class="maxwidth50" value="'.$deposit_percent.'" />';
4394 4394
 			$out .= '</span>';
4395 4395
 			$out .= '
4396
-				<script nonce="' . getNonce() . '">
4396
+				<script nonce="' . getNonce().'">
4397 4397
 					$(document).ready(function () {
4398
-						$("#' . $htmlname . '").change(function () {
4398
+						$("#' . $htmlname.'").change(function () {
4399 4399
 							let $selected = $(this).find("option:selected");
4400 4400
 							let depositPercent = $selected.attr("data-deposit_percent");
4401 4401
 
4402 4402
 							if (depositPercent.length > 0) {
4403
-								$("#' . $htmlname . '_deposit_percent_container").show().find("#' . $htmlname . '_deposit_percent").val(depositPercent);
4403
+								$("#' . $htmlname.'_deposit_percent_container").show().find("#'.$htmlname.'_deposit_percent").val(depositPercent);
4404 4404
 							} else {
4405
-								$("#' . $htmlname . '_deposit_percent_container").hide();
4405
+								$("#' . $htmlname.'_deposit_percent_container").hide();
4406 4406
 							}
4407 4407
 
4408 4408
 							return true;
@@ -4440,7 +4440,7 @@  discard block
 block discarded – undo
4440 4440
 
4441 4441
 		$out = '';
4442 4442
 
4443
-		dol_syslog(__METHOD__ . " " . $selected . ", " . $htmlname . ", " . $filtertype . ", " . $format, LOG_DEBUG);
4443
+		dol_syslog(__METHOD__." ".$selected.", ".$htmlname.", ".$filtertype.", ".$format, LOG_DEBUG);
4444 4444
 
4445 4445
 		$filterarray = array();
4446 4446
 		if ($filtertype == 'CRDT') {
@@ -4455,11 +4455,11 @@  discard block
 block discarded – undo
4455 4455
 
4456 4456
 		// Set default value if not already set by caller
4457 4457
 		if (empty($selected) && getDolGlobalString('MAIN_DEFAULT_PAYMENT_TYPE_ID')) {
4458
-			dol_syslog(__METHOD__ . "Using deprecated option MAIN_DEFAULT_PAYMENT_TYPE_ID", LOG_NOTICE);
4458
+			dol_syslog(__METHOD__."Using deprecated option MAIN_DEFAULT_PAYMENT_TYPE_ID", LOG_NOTICE);
4459 4459
 			$selected = getDolGlobalString('MAIN_DEFAULT_PAYMENT_TYPE_ID');
4460 4460
 		}
4461 4461
 
4462
-		$out .= '<select id="select' . $htmlname . '" class="flat selectpaymenttypes' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">';
4462
+		$out .= '<select id="select'.$htmlname.'" class="flat selectpaymenttypes'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
4463 4463
 		if ($empty) {
4464 4464
 			$out .= '<option value="">&nbsp;</option>';
4465 4465
 		}
@@ -4480,13 +4480,13 @@  discard block
 block discarded – undo
4480 4480
 			}
4481 4481
 
4482 4482
 			if ($format == 0) {
4483
-				$out .= '<option value="' . $id . '"';
4483
+				$out .= '<option value="'.$id.'"';
4484 4484
 			} elseif ($format == 1) {
4485
-				$out .= '<option value="' . $arraytypes['code'] . '"';
4485
+				$out .= '<option value="'.$arraytypes['code'].'"';
4486 4486
 			} elseif ($format == 2) {
4487
-				$out .= '<option value="' . $arraytypes['code'] . '"';
4487
+				$out .= '<option value="'.$arraytypes['code'].'"';
4488 4488
 			} elseif ($format == 3) {
4489
-				$out .= '<option value="' . $id . '"';
4489
+				$out .= '<option value="'.$id.'"';
4490 4490
 			}
4491 4491
 			// Print attribute selected or not
4492 4492
 			if ($format == 1 || $format == 2) {
@@ -4516,7 +4516,7 @@  discard block
 block discarded – undo
4516 4516
 		if ($user->admin && !$noadmininfo) {
4517 4517
 			$out .= info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
4518 4518
 		}
4519
-		$out .= ajax_combobox('select' . $htmlname);
4519
+		$out .= ajax_combobox('select'.$htmlname);
4520 4520
 
4521 4521
 		if (empty($nooutput)) {
4522 4522
 			print $out;
@@ -4538,22 +4538,22 @@  discard block
 block discarded – undo
4538 4538
 	{
4539 4539
 		global $langs;
4540 4540
 
4541
-		$return = '<select class="flat maxwidth100" id="select_' . $htmlname . '" name="' . $htmlname . '">';
4541
+		$return = '<select class="flat maxwidth100" id="select_'.$htmlname.'" name="'.$htmlname.'">';
4542 4542
 		$options = array(
4543 4543
 			'HT' => $langs->trans("HT"),
4544 4544
 			'TTC' => $langs->trans("TTC")
4545 4545
 		);
4546 4546
 		foreach ($options as $id => $value) {
4547 4547
 			if ($selected == $id) {
4548
-				$return .= '<option value="' . $id . '" selected>' . $value;
4548
+				$return .= '<option value="'.$id.'" selected>'.$value;
4549 4549
 			} else {
4550
-				$return .= '<option value="' . $id . '">' . $value;
4550
+				$return .= '<option value="'.$id.'">'.$value;
4551 4551
 			}
4552 4552
 			$return .= '</option>';
4553 4553
 		}
4554 4554
 		$return .= '</select>';
4555 4555
 		if ($addjscombo) {
4556
-			$return .= ajax_combobox('select_' . $htmlname);
4556
+			$return .= ajax_combobox('select_'.$htmlname);
4557 4557
 		}
4558 4558
 
4559 4559
 		return $return;
@@ -4571,7 +4571,7 @@  discard block
 block discarded – undo
4571 4571
 		// phpcs:enable
4572 4572
 		global $langs;
4573 4573
 
4574
-		$num = count($this->cache_transport_mode);        // TODO Use $conf->cache['payment_mode'] instead of $this->cache_transport_mode
4574
+		$num = count($this->cache_transport_mode); // TODO Use $conf->cache['payment_mode'] instead of $this->cache_transport_mode
4575 4575
 		if ($num > 0) {
4576 4576
 			return $num; // Cache already loaded
4577 4577
 		}
@@ -4581,8 +4581,8 @@  discard block
 block discarded – undo
4581 4581
 		$this->cache_transport_mode = array();
4582 4582
 
4583 4583
 		$sql = "SELECT rowid, code, label, active";
4584
-		$sql .= " FROM " . $this->db->prefix() . "c_transport_mode";
4585
-		$sql .= " WHERE entity IN (" . getEntity('c_transport_mode') . ")";
4584
+		$sql .= " FROM ".$this->db->prefix()."c_transport_mode";
4585
+		$sql .= " WHERE entity IN (".getEntity('c_transport_mode').")";
4586 4586
 
4587 4587
 		$resql = $this->db->query($sql);
4588 4588
 		if ($resql) {
@@ -4592,7 +4592,7 @@  discard block
 block discarded – undo
4592 4592
 				$obj = $this->db->fetch_object($resql);
4593 4593
 
4594 4594
 				// If traduction exist, we use it else we take the default label
4595
-				$label = ($langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) != "PaymentTypeShort" . $obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) : ($obj->label != '-' ? $obj->label : ''));
4595
+				$label = ($langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) != "PaymentTypeShort".$obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) : ($obj->label != '-' ? $obj->label : ''));
4596 4596
 				$this->cache_transport_mode[$obj->rowid]['rowid'] = $obj->rowid;
4597 4597
 				$this->cache_transport_mode[$obj->rowid]['code'] = $obj->code;
4598 4598
 				$this->cache_transport_mode[$obj->rowid]['label'] = $label;
@@ -4626,11 +4626,11 @@  discard block
 block discarded – undo
4626 4626
 	{
4627 4627
 		global $langs, $user;
4628 4628
 
4629
-		dol_syslog(__METHOD__ . " " . $selected . ", " . $htmlname . ", " . $format, LOG_DEBUG);
4629
+		dol_syslog(__METHOD__." ".$selected.", ".$htmlname.", ".$format, LOG_DEBUG);
4630 4630
 
4631 4631
 		$this->load_cache_transport_mode();
4632 4632
 
4633
-		print '<select id="select' . $htmlname . '" class="flat selectmodetransport' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">';
4633
+		print '<select id="select'.$htmlname.'" class="flat selectmodetransport'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
4634 4634
 		if ($empty) {
4635 4635
 			print '<option value="">&nbsp;</option>';
4636 4636
 		}
@@ -4646,13 +4646,13 @@  discard block
 block discarded – undo
4646 4646
 			}
4647 4647
 
4648 4648
 			if ($format == 0) {
4649
-				print '<option value="' . $id . '"';
4649
+				print '<option value="'.$id.'"';
4650 4650
 			} elseif ($format == 1) {
4651
-				print '<option value="' . $arraytypes['code'] . '"';
4651
+				print '<option value="'.$arraytypes['code'].'"';
4652 4652
 			} elseif ($format == 2) {
4653
-				print '<option value="' . $arraytypes['code'] . '"';
4653
+				print '<option value="'.$arraytypes['code'].'"';
4654 4654
 			} elseif ($format == 3) {
4655
-				print '<option value="' . $id . '"';
4655
+				print '<option value="'.$id.'"';
4656 4656
 			}
4657 4657
 			// If text is selected, we compare with code, else with id
4658 4658
 			if (preg_match('/[a-z]/i', $selected) && $selected == $arraytypes['code']) {
@@ -4700,31 +4700,31 @@  discard block
 block discarded – undo
4700 4700
 		$langs->load("deliveries");
4701 4701
 
4702 4702
 		$sql = "SELECT rowid, code, libelle as label";
4703
-		$sql .= " FROM " . $this->db->prefix() . "c_shipment_mode";
4703
+		$sql .= " FROM ".$this->db->prefix()."c_shipment_mode";
4704 4704
 		$sql .= " WHERE active > 0";
4705 4705
 		if ($filtre) {
4706
-			$sql .= " AND " . $filtre;
4706
+			$sql .= " AND ".$filtre;
4707 4707
 		}
4708 4708
 		$sql .= " ORDER BY libelle ASC";
4709 4709
 
4710
-		dol_syslog(get_class($this) . "::selectShippingMode", LOG_DEBUG);
4710
+		dol_syslog(get_class($this)."::selectShippingMode", LOG_DEBUG);
4711 4711
 		$result = $this->db->query($sql);
4712 4712
 		if ($result) {
4713 4713
 			$num = $this->db->num_rows($result);
4714 4714
 			$i = 0;
4715 4715
 			if ($num) {
4716
-				print '<select id="select' . $htmlname . '" class="flat selectshippingmethod' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>';
4716
+				print '<select id="select'.$htmlname.'" class="flat selectshippingmethod'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>';
4717 4717
 				if ($useempty == 1 || ($useempty == 2 && $num > 1)) {
4718 4718
 					print '<option value="-1">&nbsp;</option>';
4719 4719
 				}
4720 4720
 				while ($i < $num) {
4721 4721
 					$obj = $this->db->fetch_object($result);
4722 4722
 					if ($selected == $obj->rowid) {
4723
-						print '<option value="' . $obj->rowid . '" selected>';
4723
+						print '<option value="'.$obj->rowid.'" selected>';
4724 4724
 					} else {
4725
-						print '<option value="' . $obj->rowid . '">';
4725
+						print '<option value="'.$obj->rowid.'">';
4726 4726
 					}
4727
-					print ($langs->trans("SendingMethod" . strtoupper($obj->code)) != "SendingMethod" . strtoupper($obj->code)) ? $langs->trans("SendingMethod" . strtoupper($obj->code)) : $obj->label;
4727
+					print ($langs->trans("SendingMethod".strtoupper($obj->code)) != "SendingMethod".strtoupper($obj->code)) ? $langs->trans("SendingMethod".strtoupper($obj->code)) : $obj->label;
4728 4728
 					print '</option>';
4729 4729
 					$i++;
4730 4730
 				}
@@ -4733,7 +4733,7 @@  discard block
 block discarded – undo
4733 4733
 					print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
4734 4734
 				}
4735 4735
 
4736
-				print ajax_combobox('select' . $htmlname);
4736
+				print ajax_combobox('select'.$htmlname);
4737 4737
 			} else {
4738 4738
 				print $langs->trans("NoShippingMethodDefined");
4739 4739
 			}
@@ -4758,16 +4758,16 @@  discard block
 block discarded – undo
4758 4758
 		$langs->load("deliveries");
4759 4759
 
4760 4760
 		if ($htmlname != "none") {
4761
-			print '<form method="POST" action="' . $page . '">';
4761
+			print '<form method="POST" action="'.$page.'">';
4762 4762
 			print '<input type="hidden" name="action" value="setshippingmethod">';
4763
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
4763
+			print '<input type="hidden" name="token" value="'.newToken().'">';
4764 4764
 			$this->selectShippingMethod($selected, $htmlname, '', $addempty);
4765
-			print '<input type="submit" class="button valignmiddle" value="' . $langs->trans("Modify") . '">';
4765
+			print '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
4766 4766
 			print '</form>';
4767 4767
 		} else {
4768 4768
 			if ($selected) {
4769 4769
 				$code = $langs->getLabelFromKey($this->db, $selected, 'c_shipment_mode', 'rowid', 'code');
4770
-				print $langs->trans("SendingMethod" . strtoupper($code));
4770
+				print $langs->trans("SendingMethod".strtoupper($code));
4771 4771
 			} else {
4772 4772
 				print "&nbsp;";
4773 4773
 			}
@@ -4790,10 +4790,10 @@  discard block
 block discarded – undo
4790 4790
 
4791 4791
 		$opt = '<option value="" selected></option>';
4792 4792
 		$sql = "SELECT rowid, ref, situation_cycle_ref, situation_counter, situation_final, fk_soc";
4793
-		$sql .= ' FROM ' . $this->db->prefix() . 'facture';
4794
-		$sql .= ' WHERE entity IN (' . getEntity('invoice') . ')';
4793
+		$sql .= ' FROM '.$this->db->prefix().'facture';
4794
+		$sql .= ' WHERE entity IN ('.getEntity('invoice').')';
4795 4795
 		$sql .= ' AND situation_counter >= 1';
4796
-		$sql .= ' AND fk_soc = ' . (int) $socid;
4796
+		$sql .= ' AND fk_soc = '.(int) $socid;
4797 4797
 		$sql .= ' AND type <> 2';
4798 4798
 		$sql .= ' ORDER by situation_cycle_ref, situation_counter desc';
4799 4799
 		$resql = $this->db->query($sql);
@@ -4811,19 +4811,19 @@  discard block
 block discarded – undo
4811 4811
 						//Not prov?
4812 4812
 						if (substr($obj->ref, 1, 4) != 'PROV') {
4813 4813
 							if ($selected == $obj->rowid) {
4814
-								$opt .= '<option value="' . $obj->rowid . '" selected>' . $obj->ref . '</option>';
4814
+								$opt .= '<option value="'.$obj->rowid.'" selected>'.$obj->ref.'</option>';
4815 4815
 							} else {
4816
-								$opt .= '<option value="' . $obj->rowid . '">' . $obj->ref . '</option>';
4816
+								$opt .= '<option value="'.$obj->rowid.'">'.$obj->ref.'</option>';
4817 4817
 							}
4818 4818
 						}
4819 4819
 					}
4820 4820
 				}
4821 4821
 			}
4822 4822
 		} else {
4823
-			dol_syslog("Error sql=" . $sql . ", error=" . $this->error, LOG_ERR);
4823
+			dol_syslog("Error sql=".$sql.", error=".$this->error, LOG_ERR);
4824 4824
 		}
4825 4825
 		if ($opt == '<option value ="" selected></option>') {
4826
-			$opt = '<option value ="0" selected>' . $langs->trans('NoSituations') . '</option>';
4826
+			$opt = '<option value ="0" selected>'.$langs->trans('NoSituations').'</option>';
4827 4827
 		}
4828 4828
 		return $opt;
4829 4829
 	}
@@ -4843,12 +4843,12 @@  discard block
 block discarded – undo
4843 4843
 
4844 4844
 		$langs->load('products');
4845 4845
 
4846
-		$return = '<select class="flat" id="' . $htmlname . '" name="' . $htmlname . '">';
4846
+		$return = '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'">';
4847 4847
 
4848
-		$sql = "SELECT rowid, label, code FROM " . $this->db->prefix() . "c_units";
4848
+		$sql = "SELECT rowid, label, code FROM ".$this->db->prefix()."c_units";
4849 4849
 		$sql .= ' WHERE active > 0';
4850 4850
 		if (!empty($unit_type)) {
4851
-			$sql .= " AND unit_type = '" . $this->db->escape($unit_type) . "'";
4851
+			$sql .= " AND unit_type = '".$this->db->escape($unit_type)."'";
4852 4852
 		}
4853 4853
 		$sql .= " ORDER BY sortorder";
4854 4854
 
@@ -4860,14 +4860,14 @@  discard block
 block discarded – undo
4860 4860
 
4861 4861
 			while ($res = $this->db->fetch_object($resql)) {
4862 4862
 				$unitLabel = $res->label;
4863
-				if (!empty($langs->tab_translate['unit' . $res->code])) {    // check if Translation is available before
4864
-					$unitLabel = $langs->trans('unit' . $res->code) != $res->label ? $langs->trans('unit' . $res->code) : $res->label;
4863
+				if (!empty($langs->tab_translate['unit'.$res->code])) {    // check if Translation is available before
4864
+					$unitLabel = $langs->trans('unit'.$res->code) != $res->label ? $langs->trans('unit'.$res->code) : $res->label;
4865 4865
 				}
4866 4866
 
4867 4867
 				if ($selected == $res->rowid) {
4868
-					$return .= '<option value="' . $res->rowid . '" selected>' . $unitLabel . '</option>';
4868
+					$return .= '<option value="'.$res->rowid.'" selected>'.$unitLabel.'</option>';
4869 4869
 				} else {
4870
-					$return .= '<option value="' . $res->rowid . '">' . $unitLabel . '</option>';
4870
+					$return .= '<option value="'.$res->rowid.'">'.$unitLabel.'</option>';
4871 4871
 				}
4872 4872
 			}
4873 4873
 			$return .= '</select>';
@@ -4902,23 +4902,23 @@  discard block
 block discarded – undo
4902 4902
 		$num = 0;
4903 4903
 
4904 4904
 		$sql = "SELECT rowid, label, bank, clos as status, currency_code";
4905
-		$sql .= " FROM " . $this->db->prefix() . "bank_account";
4906
-		$sql .= " WHERE entity IN (" . getEntity('bank_account') . ")";
4905
+		$sql .= " FROM ".$this->db->prefix()."bank_account";
4906
+		$sql .= " WHERE entity IN (".getEntity('bank_account').")";
4907 4907
 		if ($status != 2) {
4908
-			$sql .= " AND clos = " . (int) $status;
4908
+			$sql .= " AND clos = ".(int) $status;
4909 4909
 		}
4910 4910
 		if ($filtre) {
4911
-			$sql .= " AND " . $filtre;
4911
+			$sql .= " AND ".$filtre;
4912 4912
 		}
4913 4913
 		$sql .= " ORDER BY label";
4914 4914
 
4915
-		dol_syslog(get_class($this) . "::select_comptes", LOG_DEBUG);
4915
+		dol_syslog(get_class($this)."::select_comptes", LOG_DEBUG);
4916 4916
 		$result = $this->db->query($sql);
4917 4917
 		if ($result) {
4918 4918
 			$num = $this->db->num_rows($result);
4919 4919
 			$i = 0;
4920 4920
 			if ($num) {
4921
-				$out .= '<select id="select' . $htmlname . '" class="flat selectbankaccount' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>';
4921
+				$out .= '<select id="select'.$htmlname.'" class="flat selectbankaccount'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>';
4922 4922
 				if ($useempty == 1 || ($useempty == 2 && $num > 1)) {
4923 4923
 					$out .= '<option value="-1">&nbsp;</option>';
4924 4924
 				}
@@ -4926,27 +4926,27 @@  discard block
 block discarded – undo
4926 4926
 				while ($i < $num) {
4927 4927
 					$obj = $this->db->fetch_object($result);
4928 4928
 					if ($selected == $obj->rowid || ($useempty == 2 && $num == 1 && empty($selected))) {
4929
-						$out .= '<option value="' . $obj->rowid . '" data-currency-code="' . $obj->currency_code . '" selected>';
4929
+						$out .= '<option value="'.$obj->rowid.'" data-currency-code="'.$obj->currency_code.'" selected>';
4930 4930
 					} else {
4931
-						$out .= '<option value="' . $obj->rowid . '" data-currency-code="' . $obj->currency_code . '">';
4931
+						$out .= '<option value="'.$obj->rowid.'" data-currency-code="'.$obj->currency_code.'">';
4932 4932
 					}
4933 4933
 					$out .= trim($obj->label);
4934 4934
 					if ($showcurrency) {
4935
-						$out .= ' (' . $obj->currency_code . ')';
4935
+						$out .= ' ('.$obj->currency_code.')';
4936 4936
 					}
4937 4937
 					if ($status == 2 && $obj->status == 1) {
4938
-						$out .= ' (' . $langs->trans("Closed") . ')';
4938
+						$out .= ' ('.$langs->trans("Closed").')';
4939 4939
 					}
4940 4940
 					$out .= '</option>';
4941 4941
 					$i++;
4942 4942
 				}
4943 4943
 				$out .= "</select>";
4944
-				$out .= ajax_combobox('select' . $htmlname);
4944
+				$out .= ajax_combobox('select'.$htmlname);
4945 4945
 			} else {
4946 4946
 				if ($status == 0) {
4947
-					$out .= '<span class="opacitymedium">' . $langs->trans("NoActiveBankAccountDefined") . '</span>';
4947
+					$out .= '<span class="opacitymedium">'.$langs->trans("NoActiveBankAccountDefined").'</span>';
4948 4948
 				} else {
4949
-					$out .= '<span class="opacitymedium">' . $langs->trans("NoBankAccountFound") . '</span>';
4949
+					$out .= '<span class="opacitymedium">'.$langs->trans("NoBankAccountFound").'</span>';
4950 4950
 				}
4951 4951
 			}
4952 4952
 		} else {
@@ -4982,23 +4982,23 @@  discard block
 block discarded – undo
4982 4982
 		$num = 0;
4983 4983
 
4984 4984
 		$sql = "SELECT rowid, name, fk_country, status, entity";
4985
-		$sql .= " FROM " . $this->db->prefix() . "establishment";
4985
+		$sql .= " FROM ".$this->db->prefix()."establishment";
4986 4986
 		$sql .= " WHERE 1=1";
4987 4987
 		if ($status != 2) {
4988
-			$sql .= " AND status = " . (int) $status;
4988
+			$sql .= " AND status = ".(int) $status;
4989 4989
 		}
4990 4990
 		if ($filtre) {
4991
-			$sql .= " AND " . $filtre;
4991
+			$sql .= " AND ".$filtre;
4992 4992
 		}
4993 4993
 		$sql .= " ORDER BY name";
4994 4994
 
4995
-		dol_syslog(get_class($this) . "::select_establishment", LOG_DEBUG);
4995
+		dol_syslog(get_class($this)."::select_establishment", LOG_DEBUG);
4996 4996
 		$result = $this->db->query($sql);
4997 4997
 		if ($result) {
4998 4998
 			$num = $this->db->num_rows($result);
4999 4999
 			$i = 0;
5000 5000
 			if ($num) {
5001
-				print '<select id="select' . $htmlname . '" class="flat selectestablishment" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>';
5001
+				print '<select id="select'.$htmlname.'" class="flat selectestablishment" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>';
5002 5002
 				if ($useempty == 1 || ($useempty == 2 && $num > 1)) {
5003 5003
 					print '<option value="-1">&nbsp;</option>';
5004 5004
 				}
@@ -5006,13 +5006,13 @@  discard block
 block discarded – undo
5006 5006
 				while ($i < $num) {
5007 5007
 					$obj = $this->db->fetch_object($result);
5008 5008
 					if ($selected == $obj->rowid) {
5009
-						print '<option value="' . $obj->rowid . '" selected>';
5009
+						print '<option value="'.$obj->rowid.'" selected>';
5010 5010
 					} else {
5011
-						print '<option value="' . $obj->rowid . '">';
5011
+						print '<option value="'.$obj->rowid.'">';
5012 5012
 					}
5013 5013
 					print trim($obj->name);
5014 5014
 					if ($status == 2 && $obj->status == 1) {
5015
-						print ' (' . $langs->trans("Closed") . ')';
5015
+						print ' ('.$langs->trans("Closed").')';
5016 5016
 					}
5017 5017
 					print '</option>';
5018 5018
 					$i++;
@@ -5020,9 +5020,9 @@  discard block
 block discarded – undo
5020 5020
 				print "</select>";
5021 5021
 			} else {
5022 5022
 				if ($status == 0) {
5023
-					print '<span class="opacitymedium">' . $langs->trans("NoActiveEstablishmentDefined") . '</span>';
5023
+					print '<span class="opacitymedium">'.$langs->trans("NoActiveEstablishmentDefined").'</span>';
5024 5024
 				} else {
5025
-					print '<span class="opacitymedium">' . $langs->trans("NoEstablishmentFound") . '</span>';
5025
+					print '<span class="opacitymedium">'.$langs->trans("NoEstablishmentFound").'</span>';
5026 5026
 				}
5027 5027
 			}
5028 5028
 
@@ -5046,20 +5046,20 @@  discard block
 block discarded – undo
5046 5046
 	{
5047 5047
 		global $langs;
5048 5048
 		if ($htmlname != "none") {
5049
-			print '<form method="POST" action="' . $page . '">';
5049
+			print '<form method="POST" action="'.$page.'">';
5050 5050
 			print '<input type="hidden" name="action" value="setbankaccount">';
5051
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
5051
+			print '<input type="hidden" name="token" value="'.newToken().'">';
5052 5052
 			print img_picto('', 'bank_account', 'class="pictofixedwidth"');
5053 5053
 			$nbaccountfound = $this->select_comptes($selected, $htmlname, 0, '', $addempty);
5054 5054
 			if ($nbaccountfound > 0) {
5055
-				print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
5055
+				print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
5056 5056
 			}
5057 5057
 			print '</form>';
5058 5058
 		} else {
5059 5059
 			$langs->load('banks');
5060 5060
 
5061 5061
 			if ($selected) {
5062
-				require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php';
5062
+				require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
5063 5063
 				$bankstatic = new Account($this->db);
5064 5064
 				$result = $bankstatic->fetch($selected);
5065 5065
 				if ($result) {
@@ -5097,19 +5097,19 @@  discard block
 block discarded – undo
5097 5097
 		global $conf, $langs;
5098 5098
 		$langs->load("categories");
5099 5099
 
5100
-		include_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
5100
+		include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
5101 5101
 
5102 5102
 		// For backward compatibility
5103 5103
 		if (is_numeric($type)) {
5104
-			dol_syslog(__METHOD__ . ': using numeric value for parameter type is deprecated. Use string code instead.', LOG_WARNING);
5104
+			dol_syslog(__METHOD__.': using numeric value for parameter type is deprecated. Use string code instead.', LOG_WARNING);
5105 5105
 		}
5106 5106
 
5107 5107
 		if ($type === Categorie::TYPE_BANK_LINE) {
5108 5108
 			// TODO Move this into common category feature
5109 5109
 			$cate_arbo = array();
5110 5110
 			$sql = "SELECT c.label, c.rowid";
5111
-			$sql .= " FROM " . $this->db->prefix() . "bank_categ as c";
5112
-			$sql .= " WHERE entity = " . $conf->entity;
5111
+			$sql .= " FROM ".$this->db->prefix()."bank_categ as c";
5112
+			$sql .= " WHERE entity = ".$conf->entity;
5113 5113
 			$sql .= " ORDER BY c.label";
5114 5114
 			$result = $this->db->query($sql);
5115 5115
 			if ($result) {
@@ -5134,10 +5134,10 @@  discard block
 block discarded – undo
5134 5134
 		$outarray = array();
5135 5135
 		$outarrayrichhtml = array();
5136 5136
 
5137
-		$output = '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
5137
+		$output = '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
5138 5138
 		if (is_array($cate_arbo)) {
5139 5139
 			if (!count($cate_arbo)) {
5140
-				$output .= '<option value="-1" disabled>' . $langs->trans("NoCategoriesDefined") . '</option>';
5140
+				$output .= '<option value="-1" disabled>'.$langs->trans("NoCategoriesDefined").'</option>';
5141 5141
 			} else {
5142 5142
 				$output .= '<option value="-1">&nbsp;</option>';
5143 5143
 				foreach ($cate_arbo as $key => $value) {
@@ -5147,15 +5147,15 @@  discard block
 block discarded – undo
5147 5147
 						$add = '';
5148 5148
 					}
5149 5149
 
5150
-					$labeltoshow = img_picto('', 'category', 'class="pictofixedwidth" style="color: #' . $cate_arbo[$key]['color'] . '"');
5150
+					$labeltoshow = img_picto('', 'category', 'class="pictofixedwidth" style="color: #'.$cate_arbo[$key]['color'].'"');
5151 5151
 					$labeltoshow .= dol_trunc($cate_arbo[$key]['fulllabel'], $maxlength, 'middle');
5152 5152
 
5153 5153
 					$outarray[$cate_arbo[$key]['id']] = $cate_arbo[$key]['fulllabel'];
5154 5154
 
5155 5155
 					$outarrayrichhtml[$cate_arbo[$key]['id']] = $labeltoshow;
5156 5156
 
5157
-					$output .= '<option ' . $add . 'value="' . $cate_arbo[$key]['id'] . '"';
5158
-					$output .= ' data-html="' . dol_escape_htmltag($labeltoshow) . '"';
5157
+					$output .= '<option '.$add.'value="'.$cate_arbo[$key]['id'].'"';
5158
+					$output .= ' data-html="'.dol_escape_htmltag($labeltoshow).'"';
5159 5159
 					$output .= '>';
5160 5160
 					$output .= dol_trunc($cate_arbo[$key]['fulllabel'], $maxlength, 'middle');
5161 5161
 					$output .= '</option>';
@@ -5196,7 +5196,7 @@  discard block
 block discarded – undo
5196 5196
 	public function form_confirm($page, $title, $question, $action, $formquestion = array(), $selectedchoice = "", $useajax = 0, $height = 170, $width = 500)
5197 5197
 	{
5198 5198
 		// phpcs:enable
5199
-		dol_syslog(__METHOD__ . ': using form_confirm is deprecated. Use formconfim instead.', LOG_WARNING);
5199
+		dol_syslog(__METHOD__.': using form_confirm is deprecated. Use formconfim instead.', LOG_WARNING);
5200 5200
 		print $this->formconfirm($page, $title, $question, $action, $formquestion, $selectedchoice, $useajax, $height, $width);
5201 5201
 	}
5202 5202
 
@@ -5231,7 +5231,7 @@  discard block
 block discarded – undo
5231 5231
 	{
5232 5232
 		global $langs, $conf;
5233 5233
 
5234
-		$more = '<!-- formconfirm - before call, page=' . dol_escape_htmltag($page) . ' -->';
5234
+		$more = '<!-- formconfirm - before call, page='.dol_escape_htmltag($page).' -->';
5235 5235
 		$formconfirm = '';
5236 5236
 		$inputok = array();
5237 5237
 		$inputko = array();
@@ -5255,27 +5255,27 @@  discard block
 block discarded – undo
5255 5255
 			foreach ($formquestion as $key => $input) {
5256 5256
 				if (is_array($input) && !empty($input)) {
5257 5257
 					if ($input['type'] == 'hidden') {
5258
-						$moreattr = (!empty($input['moreattr']) ? ' ' . $input['moreattr'] : '');
5259
-						$morecss = (!empty($input['morecss']) ? ' ' . $input['morecss'] : '');
5258
+						$moreattr = (!empty($input['moreattr']) ? ' '.$input['moreattr'] : '');
5259
+						$morecss = (!empty($input['morecss']) ? ' '.$input['morecss'] : '');
5260 5260
 
5261
-						$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";
5261
+						$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";
5262 5262
 					}
5263 5263
 				}
5264 5264
 			}
5265 5265
 
5266 5266
 			// Now add questions
5267 5267
 			$moreonecolumn = '';
5268
-			$more .= '<div class="tagtable paddingtopbottomonly centpercent noborderspacing">' . "\n";
5268
+			$more .= '<div class="tagtable paddingtopbottomonly centpercent noborderspacing">'."\n";
5269 5269
 			foreach ($formquestion as $key => $input) {
5270 5270
 				if (is_array($input) && !empty($input)) {
5271
-					$size = (!empty($input['size']) ? ' size="' . $input['size'] . '"' : '');    // deprecated. Use morecss instead.
5272
-					$moreattr = (!empty($input['moreattr']) ? ' ' . $input['moreattr'] : '');
5273
-					$morecss = (!empty($input['morecss']) ? ' ' . $input['morecss'] : '');
5271
+					$size = (!empty($input['size']) ? ' size="'.$input['size'].'"' : ''); // deprecated. Use morecss instead.
5272
+					$moreattr = (!empty($input['moreattr']) ? ' '.$input['moreattr'] : '');
5273
+					$morecss = (!empty($input['morecss']) ? ' '.$input['morecss'] : '');
5274 5274
 
5275 5275
 					if ($input['type'] == 'text') {
5276
-						$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";
5276
+						$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";
5277 5277
 					} elseif ($input['type'] == 'password') {
5278
-						$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";
5278
+						$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";
5279 5279
 					} elseif ($input['type'] == 'textarea') {
5280 5280
 						/*$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div><div class="tagtd">';
5281 5281
 						$more .= '<textarea name="'.$input['name'].'" class="'.$morecss.'"'.$moreattr.'>';
@@ -5283,8 +5283,8 @@  discard block
 block discarded – undo
5283 5283
 						$more .= '</textarea>';
5284 5284
 						$more .= '</div></div>'."\n";*/
5285 5285
 						$moreonecolumn .= '<div class="margintoponly">';
5286
-						$moreonecolumn .= $input['label'] . '<br>';
5287
-						$moreonecolumn .= '<textarea name="' . dol_escape_htmltag($input['name']) . '" id="' . dol_escape_htmltag($input['name']) . '" class="' . $morecss . '"' . $moreattr . '>';
5286
+						$moreonecolumn .= $input['label'].'<br>';
5287
+						$moreonecolumn .= '<textarea name="'.dol_escape_htmltag($input['name']).'" id="'.dol_escape_htmltag($input['name']).'" class="'.$morecss.'"'.$moreattr.'>';
5288 5288
 						$moreonecolumn .= $input['value'];
5289 5289
 						$moreonecolumn .= '</textarea>';
5290 5290
 						$moreonecolumn .= '</div>';
@@ -5301,20 +5301,20 @@  discard block
 block discarded – undo
5301 5301
 						$disabled = isset($input['select_disabled']) ? $input['select_disabled'] : 0;
5302 5302
 						$sort = isset($input['select_sort']) ? $input['select_sort'] : '';
5303 5303
 
5304
-						$more .= '<div class="tagtr"><div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '">';
5304
+						$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">';
5305 5305
 						if (!empty($input['label'])) {
5306
-							$more .= $input['label'] . '</div><div class="tagtd left">';
5306
+							$more .= $input['label'].'</div><div class="tagtd left">';
5307 5307
 						}
5308 5308
 						if ($input['type'] == 'select') {
5309 5309
 							$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);
5310 5310
 						} else {
5311 5311
 							$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);
5312 5312
 						}
5313
-						$more .= '</div></div>' . "\n";
5313
+						$more .= '</div></div>'."\n";
5314 5314
 					} elseif ($input['type'] == 'checkbox') {
5315 5315
 						$more .= '<div class="tagtr">';
5316
-						$more .= '<div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '"><label for="' . dol_escape_htmltag($input['name']) . '">' . $input['label'] . '</label></div><div class="tagtd">';
5317
-						$more .= '<input type="checkbox" class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . dol_escape_htmltag($input['name']) . '" name="' . dol_escape_htmltag($input['name']) . '"' . $moreattr;
5316
+						$more .= '<div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'"><label for="'.dol_escape_htmltag($input['name']).'">'.$input['label'].'</label></div><div class="tagtd">';
5317
+						$more .= '<input type="checkbox" class="flat'.($morecss ? ' '.$morecss : '').'" id="'.dol_escape_htmltag($input['name']).'" name="'.dol_escape_htmltag($input['name']).'"'.$moreattr;
5318 5318
 						if (!is_bool($input['value']) && $input['value'] != 'false' && $input['value'] != '0' && $input['value'] != '') {
5319 5319
 							$more .= ' checked';
5320 5320
 						}
@@ -5325,19 +5325,19 @@  discard block
 block discarded – undo
5325 5325
 							$more .= ' disabled';
5326 5326
 						}
5327 5327
 						$more .= ' /></div>';
5328
-						$more .= '</div>' . "\n";
5328
+						$more .= '</div>'."\n";
5329 5329
 					} elseif ($input['type'] == 'radio') {
5330 5330
 						$i = 0;
5331 5331
 						foreach ($input['values'] as $selkey => $selval) {
5332 5332
 							$more .= '<div class="tagtr">';
5333 5333
 							if (isset($input['label'])) {
5334 5334
 								if ($i == 0) {
5335
-									$more .= '<div class="tagtd' . (empty($input['tdclass']) ? ' tdtop' : (' tdtop ' . $input['tdclass'])) . '">' . $input['label'] . '</div>';
5335
+									$more .= '<div class="tagtd'.(empty($input['tdclass']) ? ' tdtop' : (' tdtop '.$input['tdclass'])).'">'.$input['label'].'</div>';
5336 5336
 								} else {
5337
-									$more .= '<div class="tagtd' . (empty($input['tdclass']) ? '' : (' "' . $input['tdclass'])) . '">&nbsp;</div>';
5337
+									$more .= '<div class="tagtd'.(empty($input['tdclass']) ? '' : (' "'.$input['tdclass'])).'">&nbsp;</div>';
5338 5338
 								}
5339 5339
 							}
5340
-							$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;
5340
+							$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;
5341 5341
 							if (!empty($input['disabled'])) {
5342 5342
 								$more .= ' disabled';
5343 5343
 							}
@@ -5345,12 +5345,12 @@  discard block
 block discarded – undo
5345 5345
 								$more .= ' checked="checked"';
5346 5346
 							}
5347 5347
 							$more .= ' /> ';
5348
-							$more .= '<label for="' . dol_escape_htmltag($input['name'] . $selkey) . '" class="valignmiddle">' . $selval . '</label>';
5349
-							$more .= '</div></div>' . "\n";
5348
+							$more .= '<label for="'.dol_escape_htmltag($input['name'].$selkey).'" class="valignmiddle">'.$selval.'</label>';
5349
+							$more .= '</div></div>'."\n";
5350 5350
 							$i++;
5351 5351
 						}
5352 5352
 					} elseif ($input['type'] == 'date' || $input['type'] == 'datetime') {
5353
-						$more .= '<div class="tagtr"><div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '">' . $input['label'] . '</div>';
5353
+						$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div>';
5354 5354
 						$more .= '<div class="tagtd">';
5355 5355
 						$addnowlink = (empty($input['datenow']) ? 0 : 1);
5356 5356
 						$h = $m = 0;
@@ -5368,24 +5368,24 @@  discard block
 block discarded – undo
5368 5368
 					} elseif ($input['type'] == 'other') { // can be 1 column or 2 depending if label is set or not
5369 5369
 						$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">';
5370 5370
 						if (!empty($input['label'])) {
5371
-							$more .= $input['label'] . '</div><div class="tagtd">';
5371
+							$more .= $input['label'].'</div><div class="tagtd">';
5372 5372
 						}
5373 5373
 						$more .= $input['value'];
5374
-						$more .= '</div></div>' . "\n";
5374
+						$more .= '</div></div>'."\n";
5375 5375
 					} elseif ($input['type'] == 'onecolumn') {
5376 5376
 						$moreonecolumn .= '<div class="margintoponly">';
5377 5377
 						$moreonecolumn .= $input['value'];
5378
-						$moreonecolumn .= '</div>' . "\n";
5378
+						$moreonecolumn .= '</div>'."\n";
5379 5379
 					} elseif ($input['type'] == 'hidden') {
5380 5380
 						// Do nothing more, already added by a previous loop
5381 5381
 					} elseif ($input['type'] == 'separator') {
5382 5382
 						$more .= '<br>';
5383 5383
 					} else {
5384
-						$more .= 'Error type ' . $input['type'] . ' for the confirm box is not a supported type';
5384
+						$more .= 'Error type '.$input['type'].' for the confirm box is not a supported type';
5385 5385
 					}
5386 5386
 				}
5387 5387
 			}
5388
-			$more .= '</div>' . "\n";
5388
+			$more .= '</div>'."\n";
5389 5389
 			$more .= $moreonecolumn;
5390 5390
 		}
5391 5391
 
@@ -5407,10 +5407,10 @@  discard block
 block discarded – undo
5407 5407
 				$button = $useajax;
5408 5408
 				$useajax = 1;
5409 5409
 				$autoOpen = false;
5410
-				$dialogconfirm .= '-' . $button;
5410
+				$dialogconfirm .= '-'.$button;
5411 5411
 			}
5412
-			$pageyes = $page . (preg_match('/\?/', $page) ? '&' : '?') . 'action=' . urlencode($action) . '&confirm=yes';
5413
-			$pageno = ($useajax == 2 ? $page . (preg_match('/\?/', $page) ? '&' : '?') . 'action=' . urlencode($action) . '&confirm=no' : '');
5412
+			$pageyes = $page.(preg_match('/\?/', $page) ? '&' : '?').'action='.urlencode($action).'&confirm=yes';
5413
+			$pageno = ($useajax == 2 ? $page.(preg_match('/\?/', $page) ? '&' : '?').'action='.urlencode($action).'&confirm=no' : '');
5414 5414
 
5415 5415
 			// Add input fields into list of fields to read during submit (inputok and inputko)
5416 5416
 			if (is_array($formquestion)) {
@@ -5432,24 +5432,24 @@  discard block
 block discarded – undo
5432 5432
 			}
5433 5433
 
5434 5434
 			// Show JQuery confirm box.
5435
-			$formconfirm .= '<div id="' . $dialogconfirm . '" title="' . dol_escape_htmltag($title) . '" style="display: none;">';
5435
+			$formconfirm .= '<div id="'.$dialogconfirm.'" title="'.dol_escape_htmltag($title).'" style="display: none;">';
5436 5436
 			if (is_array($formquestion) && !empty($formquestion['text'])) {
5437
-				$formconfirm .= '<div class="confirmtext">' . $formquestion['text'] . '</div>' . "\n";
5437
+				$formconfirm .= '<div class="confirmtext">'.$formquestion['text'].'</div>'."\n";
5438 5438
 			}
5439 5439
 			if (!empty($more)) {
5440
-				$formconfirm .= '<div class="confirmquestions">' . $more . '</div>' . "\n";
5440
+				$formconfirm .= '<div class="confirmquestions">'.$more.'</div>'."\n";
5441 5441
 			}
5442
-			$formconfirm .= ($question ? '<div class="confirmmessage">' . img_help('', '') . ' ' . $question . '</div>' : '');
5443
-			$formconfirm .= '</div>' . "\n";
5442
+			$formconfirm .= ($question ? '<div class="confirmmessage">'.img_help('', '').' '.$question.'</div>' : '');
5443
+			$formconfirm .= '</div>'."\n";
5444 5444
 
5445
-			$formconfirm .= "\n<!-- begin code of popup for formconfirm page=" . $page . " -->\n";
5446
-			$formconfirm .= '<script nonce="' . getNonce() . '" type="text/javascript">' . "\n";
5445
+			$formconfirm .= "\n<!-- begin code of popup for formconfirm page=".$page." -->\n";
5446
+			$formconfirm .= '<script nonce="'.getNonce().'" type="text/javascript">'."\n";
5447 5447
 			$formconfirm .= "/* Code for the jQuery('#dialogforpopup').dialog() */\n";
5448 5448
 			$formconfirm .= 'jQuery(document).ready(function() {
5449 5449
             $(function() {
5450
-            	$( "#' . $dialogconfirm . '" ).dialog(
5450
+            	$( "#' . $dialogconfirm.'" ).dialog(
5451 5451
             	{
5452
-                    autoOpen: ' . ($autoOpen ? "true" : "false") . ',';
5452
+                    autoOpen: ' . ($autoOpen ? "true" : "false").',';
5453 5453
 			if ($newselectedchoice == 'no') {
5454 5454
 				$formconfirm .= '
5455 5455
 						open: function() {
@@ -5459,24 +5459,24 @@  discard block
 block discarded – undo
5459 5459
 
5460 5460
 			$jsforcursor = '';
5461 5461
 			if ($useajax == 1) {
5462
-				$jsforcursor = '// The call to urljump can be slow, so we set the wait cursor' . "\n";
5463
-				$jsforcursor .= 'jQuery("html,body,#id-container").addClass("cursorwait");' . "\n";
5462
+				$jsforcursor = '// The call to urljump can be slow, so we set the wait cursor'."\n";
5463
+				$jsforcursor .= 'jQuery("html,body,#id-container").addClass("cursorwait");'."\n";
5464 5464
 			}
5465 5465
 
5466 5466
 			$postconfirmas = 'GET';
5467 5467
 
5468 5468
 			$formconfirm .= '
5469 5469
                     resizable: false,
5470
-                    height: "' . $height . '",
5471
-                    width: "' . $width . '",
5470
+                    height: "' . $height.'",
5471
+                    width: "' . $width.'",
5472 5472
                     modal: true,
5473 5473
                     closeOnEscape: false,
5474 5474
                     buttons: {
5475
-                        "' . dol_escape_js($langs->transnoentities($labelbuttonyes)) . '": function() {
5476
-							var options = "token=' . urlencode(newToken()) . '";
5477
-                        	var inputok = ' . json_encode($inputok) . ';	/* List of fields into form */
5478
-							var page = "' . dol_escape_js(!empty($page) ? $page : '') . '";
5479
-                         	var pageyes = "' . dol_escape_js(!empty($pageyes) ? $pageyes : '') . '";
5475
+                        "' . dol_escape_js($langs->transnoentities($labelbuttonyes)).'": function() {
5476
+							var options = "token=' . urlencode(newToken()).'";
5477
+                        	var inputok = ' . json_encode($inputok).';	/* List of fields into form */
5478
+							var page = "' . dol_escape_js(!empty($page) ? $page : '').'";
5479
+                         	var pageyes = "' . dol_escape_js(!empty($pageyes) ? $pageyes : '').'";
5480 5480
 
5481 5481
                          	if (inputok.length > 0) {
5482 5482
                          		$.each(inputok, function(i, inputname) {
@@ -5510,11 +5510,11 @@  discard block
 block discarded – undo
5510 5510
 							}
5511 5511
 	                        $(this).dialog("close");
5512 5512
                         },
5513
-                        "' . dol_escape_js($langs->transnoentities($labelbuttonno)) . '": function() {
5514
-                        	var options = "token=' . urlencode(newToken()) . '";
5515
-                         	var inputko = ' . json_encode($inputko) . ';	/* List of fields into form */
5516
-							var page = "' . dol_escape_js(!empty($page) ? $page : '') . '";
5517
-                         	var pageno="' . dol_escape_js(!empty($pageno) ? $pageno : '') . '";
5513
+                        "' . dol_escape_js($langs->transnoentities($labelbuttonno)).'": function() {
5514
+                        	var options = "token=' . urlencode(newToken()).'";
5515
+                         	var inputko = ' . json_encode($inputko).';	/* List of fields into form */
5516
+							var page = "' . dol_escape_js(!empty($page) ? $page : '').'";
5517
+                         	var pageno="' . dol_escape_js(!empty($pageno) ? $pageno : '').'";
5518 5518
                          	if (inputko.length > 0) {
5519 5519
                          		$.each(inputko, function(i, inputname) {
5520 5520
                          			var more = "";
@@ -5546,10 +5546,10 @@  discard block
 block discarded – undo
5546 5546
                 }
5547 5547
                 );
5548 5548
 
5549
-            	var button = "' . $button . '";
5549
+            	var button = "' . $button.'";
5550 5550
             	if (button.length > 0) {
5551 5551
                 	$( "#" + button ).click(function() {
5552
-                		$("#' . $dialogconfirm . '").dialog("open");
5552
+                		$("#' . $dialogconfirm.'").dialog("open");
5553 5553
         			});
5554 5554
                 }
5555 5555
             });
@@ -5557,44 +5557,44 @@  discard block
 block discarded – undo
5557 5557
             </script>';
5558 5558
 			$formconfirm .= "<!-- end ajax formconfirm -->\n";
5559 5559
 		} else {
5560
-			$formconfirm .= "\n<!-- begin formconfirm page=" . dol_escape_htmltag($page) . " -->\n";
5560
+			$formconfirm .= "\n<!-- begin formconfirm page=".dol_escape_htmltag($page)." -->\n";
5561 5561
 
5562 5562
 			if (empty($disableformtag)) {
5563
-				$formconfirm .= '<form method="POST" action="' . $page . '" class="notoptoleftroright">' . "\n";
5563
+				$formconfirm .= '<form method="POST" action="'.$page.'" class="notoptoleftroright">'."\n";
5564 5564
 			}
5565 5565
 
5566
-			$formconfirm .= '<input type="hidden" name="action" value="' . $action . '">' . "\n";
5567
-			$formconfirm .= '<input type="hidden" name="token" value="' . newToken() . '">' . "\n";
5566
+			$formconfirm .= '<input type="hidden" name="action" value="'.$action.'">'."\n";
5567
+			$formconfirm .= '<input type="hidden" name="token" value="'.newToken().'">'."\n";
5568 5568
 
5569
-			$formconfirm .= '<table class="valid centpercent">' . "\n";
5569
+			$formconfirm .= '<table class="valid centpercent">'."\n";
5570 5570
 
5571 5571
 			// Line title
5572 5572
 			$formconfirm .= '<tr class="validtitre"><td class="validtitre" colspan="2">';
5573
-			$formconfirm .= img_picto('', 'pictoconfirm') . ' ' . $title;
5574
-			$formconfirm .= '</td></tr>' . "\n";
5573
+			$formconfirm .= img_picto('', 'pictoconfirm').' '.$title;
5574
+			$formconfirm .= '</td></tr>'."\n";
5575 5575
 
5576 5576
 			// Line text
5577 5577
 			if (is_array($formquestion) && !empty($formquestion['text'])) {
5578
-				$formconfirm .= '<tr class="valid"><td class="valid" colspan="2">' . $formquestion['text'] . '</td></tr>' . "\n";
5578
+				$formconfirm .= '<tr class="valid"><td class="valid" colspan="2">'.$formquestion['text'].'</td></tr>'."\n";
5579 5579
 			}
5580 5580
 
5581 5581
 			// Line form fields
5582 5582
 			if ($more) {
5583
-				$formconfirm .= '<tr class="valid"><td class="valid" colspan="2">' . "\n";
5583
+				$formconfirm .= '<tr class="valid"><td class="valid" colspan="2">'."\n";
5584 5584
 				$formconfirm .= $more;
5585
-				$formconfirm .= '</td></tr>' . "\n";
5585
+				$formconfirm .= '</td></tr>'."\n";
5586 5586
 			}
5587 5587
 
5588 5588
 			// Line with question
5589 5589
 			$formconfirm .= '<tr class="valid">';
5590
-			$formconfirm .= '<td class="valid">' . $question . '</td>';
5590
+			$formconfirm .= '<td class="valid">'.$question.'</td>';
5591 5591
 			$formconfirm .= '<td class="valid center">';
5592 5592
 			$formconfirm .= $this->selectyesno("confirm", $newselectedchoice, 0, false, 0, 0, 'marginleftonly marginrightonly', $labelbuttonyes, $labelbuttonno);
5593
-			$formconfirm .= '<input class="button valignmiddle confirmvalidatebutton small" type="submit" value="' . $langs->trans("Validate") . '">';
5593
+			$formconfirm .= '<input class="button valignmiddle confirmvalidatebutton small" type="submit" value="'.$langs->trans("Validate").'">';
5594 5594
 			$formconfirm .= '</td>';
5595
-			$formconfirm .= '</tr>' . "\n";
5595
+			$formconfirm .= '</tr>'."\n";
5596 5596
 
5597
-			$formconfirm .= '</table>' . "\n";
5597
+			$formconfirm .= '</table>'."\n";
5598 5598
 
5599 5599
 			if (empty($disableformtag)) {
5600 5600
 				$formconfirm .= "</form>\n";
@@ -5603,7 +5603,7 @@  discard block
 block discarded – undo
5603 5603
 
5604 5604
 			if (!empty($conf->use_javascript_ajax)) {
5605 5605
 				$formconfirm .= '<!-- code to disable button to avoid double clic -->';
5606
-				$formconfirm .= '<script nonce="' . getNonce() . '" type="text/javascript">' . "\n";
5606
+				$formconfirm .= '<script nonce="'.getNonce().'" type="text/javascript">'."\n";
5607 5607
 				$formconfirm .= '
5608 5608
 				$(document).ready(function () {
5609 5609
 					$(".confirmvalidatebutton").on("click", function() {
@@ -5615,7 +5615,7 @@  discard block
 block discarded – undo
5615 5615
 					});
5616 5616
 				});
5617 5617
 				';
5618
-				$formconfirm .= '</script>' . "\n";
5618
+				$formconfirm .= '</script>'."\n";
5619 5619
 			}
5620 5620
 
5621 5621
 			$formconfirm .= "<!-- end formconfirm -->\n";
@@ -5647,8 +5647,8 @@  discard block
 block discarded – undo
5647 5647
 		// phpcs:enable
5648 5648
 		global $langs;
5649 5649
 
5650
-		require_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php';
5651
-		require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php';
5650
+		require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
5651
+		require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
5652 5652
 
5653 5653
 		$out = '';
5654 5654
 
@@ -5656,11 +5656,11 @@  discard block
 block discarded – undo
5656 5656
 
5657 5657
 		$langs->load("project");
5658 5658
 		if ($htmlname != "none") {
5659
-			$out .= '<form method="post" action="' . $page . '">';
5659
+			$out .= '<form method="post" action="'.$page.'">';
5660 5660
 			$out .= '<input type="hidden" name="action" value="classin">';
5661
-			$out .= '<input type="hidden" name="token" value="' . newToken() . '">';
5661
+			$out .= '<input type="hidden" name="token" value="'.newToken().'">';
5662 5662
 			$out .= $formproject->select_projects($socid, $selected, $htmlname, $maxlength, 0, 1, $discard_closed, $forcefocus, 0, 0, '', 1, 0, $morecss);
5663
-			$out .= '<input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '">';
5663
+			$out .= '<input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">';
5664 5664
 			$out .= '</form>';
5665 5665
 		} else {
5666 5666
 			$out .= '<span class="project_head_block">';
@@ -5669,7 +5669,7 @@  discard block
 block discarded – undo
5669 5669
 				$projet->fetch($selected);
5670 5670
 				$out .= $projet->getNomUrl(0, '', 1);
5671 5671
 			} else {
5672
-				$out .= '<span class="opacitymedium">' . $textifnoproject . '</span>';
5672
+				$out .= '<span class="opacitymedium">'.$textifnoproject.'</span>';
5673 5673
 			}
5674 5674
 			$out .= '</span>';
5675 5675
 		}
@@ -5706,14 +5706,14 @@  discard block
 block discarded – undo
5706 5706
 		$out = '';
5707 5707
 
5708 5708
 		if ($htmlname != "none") {
5709
-			$out .= '<form method="POST" action="' . $page . '">';
5709
+			$out .= '<form method="POST" action="'.$page.'">';
5710 5710
 			$out .= '<input type="hidden" name="action" value="setconditions">';
5711
-			$out .= '<input type="hidden" name="token" value="' . newToken() . '">';
5711
+			$out .= '<input type="hidden" name="token" value="'.newToken().'">';
5712 5712
 			if ($type) {
5713
-				$out .= '<input type="hidden" name="type" value="' . dol_escape_htmltag($type) . '">';
5713
+				$out .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">';
5714 5714
 			}
5715 5715
 			$out .= $this->getSelectConditionsPaiements($selected, $htmlname, $filtertype, $addempty, 0, '', $deposit_percent);
5716
-			$out .= '<input type="submit" class="button valignmiddle smallpaddingimp" value="' . $langs->trans("Modify") . '">';
5716
+			$out .= '<input type="submit" class="button valignmiddle smallpaddingimp" value="'.$langs->trans("Modify").'">';
5717 5717
 			$out .= '</form>';
5718 5718
 		} else {
5719 5719
 			if ($selected) {
@@ -5758,12 +5758,12 @@  discard block
 block discarded – undo
5758 5758
 		// phpcs:enable
5759 5759
 		global $langs;
5760 5760
 		if ($htmlname != "none") {
5761
-			print '<form method="post" action="' . $page . '">';
5761
+			print '<form method="post" action="'.$page.'">';
5762 5762
 			print '<input type="hidden" name="action" value="setavailability">';
5763
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
5763
+			print '<input type="hidden" name="token" value="'.newToken().'">';
5764 5764
 			$this->selectAvailabilityDelay($selected, $htmlname, -1, $addempty);
5765
-			print '<input type="submit" name="modify" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '">';
5766
-			print '<input type="submit" name="cancel" class="button smallpaddingimp" value="' . $langs->trans("Cancel") . '">';
5765
+			print '<input type="submit" name="modify" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">';
5766
+			print '<input type="submit" name="cancel" class="button smallpaddingimp" value="'.$langs->trans("Cancel").'">';
5767 5767
 			print '</form>';
5768 5768
 		} else {
5769 5769
 			if ($selected) {
@@ -5789,11 +5789,11 @@  discard block
 block discarded – undo
5789 5789
 	{
5790 5790
 		global $langs;
5791 5791
 		if ($htmlname != "none") {
5792
-			print '<form method="post" action="' . $page . '">';
5792
+			print '<form method="post" action="'.$page.'">';
5793 5793
 			print '<input type="hidden" name="action" value="setdemandreason">';
5794
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
5794
+			print '<input type="hidden" name="token" value="'.newToken().'">';
5795 5795
 			$this->selectInputReason($selected, $htmlname, -1, $addempty);
5796
-			print '<input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '">';
5796
+			print '<input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">';
5797 5797
 			print '</form>';
5798 5798
 		} else {
5799 5799
 			if ($selected) {
@@ -5833,17 +5833,17 @@  discard block
 block discarded – undo
5833 5833
 		$ret = '';
5834 5834
 
5835 5835
 		if ($htmlname != "none") {
5836
-			$ret .= '<form method="POST" action="' . $page . '" name="form' . $htmlname . '">';
5837
-			$ret .= '<input type="hidden" name="action" value="set' . $htmlname . '">';
5838
-			$ret .= '<input type="hidden" name="token" value="' . newToken() . '">';
5836
+			$ret .= '<form method="POST" action="'.$page.'" name="form'.$htmlname.'">';
5837
+			$ret .= '<input type="hidden" name="action" value="set'.$htmlname.'">';
5838
+			$ret .= '<input type="hidden" name="token" value="'.newToken().'">';
5839 5839
 			if ($type) {
5840
-				$ret .= '<input type="hidden" name="type" value="' . dol_escape_htmltag($type) . '">';
5840
+				$ret .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">';
5841 5841
 			}
5842 5842
 			$ret .= '<table class="nobordernopadding">';
5843 5843
 			$ret .= '<tr><td>';
5844
-			$ret .= $this->selectDate($selected, $htmlname, $displayhour, $displaymin, 1, 'form' . $htmlname, 1, 0);
5844
+			$ret .= $this->selectDate($selected, $htmlname, $displayhour, $displaymin, 1, 'form'.$htmlname, 1, 0);
5845 5845
 			$ret .= '</td>';
5846
-			$ret .= '<td class="left"><input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '"></td>';
5846
+			$ret .= '<td class="left"><input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'"></td>';
5847 5847
 			$ret .= '</tr></table></form>';
5848 5848
 		} else {
5849 5849
 			if ($displayhour) {
@@ -5878,15 +5878,15 @@  discard block
 block discarded – undo
5878 5878
 		global $langs;
5879 5879
 
5880 5880
 		if ($htmlname != "none") {
5881
-			print '<form method="POST" action="' . $page . '" name="form' . $htmlname . '">';
5882
-			print '<input type="hidden" name="action" value="set' . $htmlname . '">';
5883
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
5881
+			print '<form method="POST" action="'.$page.'" name="form'.$htmlname.'">';
5882
+			print '<input type="hidden" name="action" value="set'.$htmlname.'">';
5883
+			print '<input type="hidden" name="token" value="'.newToken().'">';
5884 5884
 			print $this->select_dolusers($selected, $htmlname, 1, $exclude, 0, $include);
5885
-			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
5885
+			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
5886 5886
 			print '</form>';
5887 5887
 		} else {
5888 5888
 			if ($selected) {
5889
-				require_once DOL_DOCUMENT_ROOT . '/user/class/user.class.php';
5889
+				require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
5890 5890
 				$theuser = new User($this->db);
5891 5891
 				$theuser->fetch($selected);
5892 5892
 				print $theuser->getNomUrl(1);
@@ -5919,14 +5919,14 @@  discard block
 block discarded – undo
5919 5919
 
5920 5920
 		$out = '';
5921 5921
 		if ($htmlname != "none") {
5922
-			$out .= '<form method="POST" action="' . $page . '">';
5922
+			$out .= '<form method="POST" action="'.$page.'">';
5923 5923
 			$out .= '<input type="hidden" name="action" value="setmode">';
5924
-			$out .= '<input type="hidden" name="token" value="' . newToken() . '">';
5924
+			$out .= '<input type="hidden" name="token" value="'.newToken().'">';
5925 5925
 			if ($type) {
5926
-				$out .= '<input type="hidden" name="type" value="' . dol_escape_htmltag($type) . '">';
5926
+				$out .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">';
5927 5927
 			}
5928 5928
 			$out .= $this->select_types_paiements($selected, $htmlname, $filtertype, 0, $addempty, 0, 0, $active, '', 1);
5929
-			$out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
5929
+			$out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
5930 5930
 			$out .= '</form>';
5931 5931
 		} else {
5932 5932
 			if ($selected) {
@@ -5959,11 +5959,11 @@  discard block
 block discarded – undo
5959 5959
 	{
5960 5960
 		global $langs;
5961 5961
 		if ($htmlname != "none") {
5962
-			print '<form method="POST" action="' . $page . '">';
5962
+			print '<form method="POST" action="'.$page.'">';
5963 5963
 			print '<input type="hidden" name="action" value="settransportmode">';
5964
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
5964
+			print '<input type="hidden" name="token" value="'.newToken().'">';
5965 5965
 			$this->selectTransportMode($selected, $htmlname, 0, $addempty, 0, 0, $active);
5966
-			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
5966
+			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
5967 5967
 			print '</form>';
5968 5968
 		} else {
5969 5969
 			if ($selected) {
@@ -5990,11 +5990,11 @@  discard block
 block discarded – undo
5990 5990
 		// phpcs:enable
5991 5991
 		global $langs;
5992 5992
 		if ($htmlname != "none") {
5993
-			print '<form method="POST" action="' . $page . '">';
5993
+			print '<form method="POST" action="'.$page.'">';
5994 5994
 			print '<input type="hidden" name="action" value="setmulticurrencycode">';
5995
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
5995
+			print '<input type="hidden" name="token" value="'.newToken().'">';
5996 5996
 			print $this->selectMultiCurrency($selected, $htmlname, 0);
5997
-			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
5997
+			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
5998 5998
 			print '</form>';
5999 5999
 		} else {
6000 6000
 			dol_include_once('/core/lib/company.lib.php');
@@ -6019,21 +6019,21 @@  discard block
 block discarded – undo
6019 6019
 		global $langs, $mysoc, $conf;
6020 6020
 
6021 6021
 		if ($htmlname != "none") {
6022
-			print '<form method="POST" action="' . $page . '">';
6022
+			print '<form method="POST" action="'.$page.'">';
6023 6023
 			print '<input type="hidden" name="action" value="setmulticurrencyrate">';
6024
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
6025
-			print '<input type="text" class="maxwidth100" name="' . $htmlname . '" value="' . (!empty($rate) ? price(price2num($rate, 'CU')) : 1) . '" /> ';
6024
+			print '<input type="hidden" name="token" value="'.newToken().'">';
6025
+			print '<input type="text" class="maxwidth100" name="'.$htmlname.'" value="'.(!empty($rate) ? price(price2num($rate, 'CU')) : 1).'" /> ';
6026 6026
 			print '<select name="calculation_mode">';
6027
-			print '<option value="1">Change ' . $langs->trans("PriceUHT") . ' of lines</option>';
6028
-			print '<option value="2">Change ' . $langs->trans("PriceUHTCurrency") . ' of lines</option>';
6027
+			print '<option value="1">Change '.$langs->trans("PriceUHT").' of lines</option>';
6028
+			print '<option value="2">Change '.$langs->trans("PriceUHTCurrency").' of lines</option>';
6029 6029
 			print '</select> ';
6030
-			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
6030
+			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
6031 6031
 			print '</form>';
6032 6032
 		} else {
6033 6033
 			if (!empty($rate)) {
6034 6034
 				print price($rate, 1, $langs, 1, 0);
6035 6035
 				if ($currency && $rate != 1) {
6036
-					print ' &nbsp; (' . price($rate, 1, $langs, 1, 0) . ' ' . $currency . ' = 1 ' . $conf->currency . ')';
6036
+					print ' &nbsp; ('.price($rate, 1, $langs, 1, 0).' '.$currency.' = 1 '.$conf->currency.')';
6037 6037
 				}
6038 6038
 			} else {
6039 6039
 				print 1;
@@ -6064,9 +6064,9 @@  discard block
 block discarded – undo
6064 6064
 		// phpcs:enable
6065 6065
 		global $conf, $langs;
6066 6066
 		if ($htmlname != "none") {
6067
-			print '<form method="post" action="' . $page . '">';
6067
+			print '<form method="post" action="'.$page.'">';
6068 6068
 			print '<input type="hidden" name="action" value="setabsolutediscount">';
6069
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
6069
+			print '<input type="hidden" name="token" value="'.newToken().'">';
6070 6070
 			print '<div class="inline-block">';
6071 6071
 			if (!empty($discount_type)) {
6072 6072
 				if (getDolGlobalString('FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS')) {
@@ -6104,24 +6104,24 @@  discard block
 block discarded – undo
6104 6104
 			print '</div>';
6105 6105
 			if (empty($hidelist)) {
6106 6106
 				print '<div class="inline-block" style="padding-right: 10px">';
6107
-				$newfilter = 'discount_type=' . intval($discount_type);
6107
+				$newfilter = 'discount_type='.intval($discount_type);
6108 6108
 				if (!empty($discount_type)) {
6109 6109
 					$newfilter .= ' AND fk_invoice_supplier IS NULL AND fk_invoice_supplier_line IS NULL'; // Supplier discounts available
6110 6110
 				} else {
6111 6111
 					$newfilter .= ' AND fk_facture IS NULL AND fk_facture_line IS NULL'; // Customer discounts available
6112 6112
 				}
6113 6113
 				if ($filter) {
6114
-					$newfilter .= ' AND (' . $filter . ')';
6114
+					$newfilter .= ' AND ('.$filter.')';
6115 6115
 				}
6116 6116
 				// output the combo of discounts
6117 6117
 				$nbqualifiedlines = $this->select_remises($selected, $htmlname, $newfilter, $socid, $maxvalue);
6118 6118
 				if ($nbqualifiedlines > 0) {
6119
-					print ' &nbsp; <input type="submit" class="button smallpaddingimp" value="' . dol_escape_htmltag($langs->trans("UseLine")) . '"';
6119
+					print ' &nbsp; <input type="submit" class="button smallpaddingimp" value="'.dol_escape_htmltag($langs->trans("UseLine")).'"';
6120 6120
 					if (!empty($discount_type) && $filter && $filter != "fk_invoice_supplier_source IS NULL OR (description LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS PAID)%')") {
6121
-						print ' title="' . $langs->trans("UseCreditNoteInInvoicePayment") . '"';
6121
+						print ' title="'.$langs->trans("UseCreditNoteInInvoicePayment").'"';
6122 6122
 					}
6123 6123
 					if (empty($discount_type) && $filter && $filter != "fk_facture_source IS NULL OR (description LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS RECEIVED)%')") {
6124
-						print ' title="' . $langs->trans("UseCreditNoteInInvoicePayment") . '"';
6124
+						print ' title="'.$langs->trans("UseCreditNoteInInvoicePayment").'"';
6125 6125
 					}
6126 6126
 
6127 6127
 					print '>';
@@ -6161,23 +6161,23 @@  discard block
 block discarded – undo
6161 6161
 		global $langs, $conf;
6162 6162
 
6163 6163
 		if ($htmlname != "none") {
6164
-			print '<form method="post" action="' . $page . '">';
6164
+			print '<form method="post" action="'.$page.'">';
6165 6165
 			print '<input type="hidden" name="action" value="set_contact">';
6166
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
6166
+			print '<input type="hidden" name="token" value="'.newToken().'">';
6167 6167
 			print '<table class="nobordernopadding">';
6168 6168
 			print '<tr><td>';
6169 6169
 			print $this->selectcontacts($societe->id, $selected, $htmlname);
6170 6170
 			$num = $this->num;
6171 6171
 			if ($num == 0) {
6172 6172
 				$addcontact = (getDolGlobalString('SOCIETE_ADDRESSES_MANAGEMENT') ? $langs->trans("AddContact") : $langs->trans("AddContactAddress"));
6173
-				print '<a href="' . DOL_URL_ROOT . '/contact/card.php?socid=' . $societe->id . '&amp;action=create&amp;backtoreferer=1">' . $addcontact . '</a>';
6173
+				print '<a href="'.DOL_URL_ROOT.'/contact/card.php?socid='.$societe->id.'&amp;action=create&amp;backtoreferer=1">'.$addcontact.'</a>';
6174 6174
 			}
6175 6175
 			print '</td>';
6176
-			print '<td class="left"><input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '"></td>';
6176
+			print '<td class="left"><input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'"></td>';
6177 6177
 			print '</tr></table></form>';
6178 6178
 		} else {
6179 6179
 			if ($selected) {
6180
-				require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php';
6180
+				require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
6181 6181
 				$contact = new Contact($this->db);
6182 6182
 				$contact->fetch($selected);
6183 6183
 				print $contact->getFullName($langs);
@@ -6212,20 +6212,20 @@  discard block
 block discarded – undo
6212 6212
 
6213 6213
 		$out = '';
6214 6214
 		if ($htmlname != "none") {
6215
-			$out .= '<form method="post" action="' . $page . '">';
6215
+			$out .= '<form method="post" action="'.$page.'">';
6216 6216
 			$out .= '<input type="hidden" name="action" value="set_thirdparty">';
6217
-			$out .= '<input type="hidden" name="token" value="' . newToken() . '">';
6217
+			$out .= '<input type="hidden" name="token" value="'.newToken().'">';
6218 6218
 			$out .= $this->select_company($selected, $htmlname, $filter, $showempty, $showtype, $forcecombo, $events, 0, 'minwidth100', '', '', 1, array(), false, $excludeids);
6219
-			$out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
6219
+			$out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
6220 6220
 			$out .= '</form>';
6221 6221
 		} else {
6222 6222
 			if ($selected) {
6223
-				require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
6223
+				require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
6224 6224
 				$soc = new Societe($this->db);
6225 6225
 				$soc->fetch($selected);
6226 6226
 				$out .= $soc->getNomUrl(0, '');
6227 6227
 			} else {
6228
-				$out .= '<span class="opacitymedium">' . $textifnothirdparty . '</span>';
6228
+				$out .= '<span class="opacitymedium">'.$textifnothirdparty.'</span>';
6229 6229
 			}
6230 6230
 		}
6231 6231
 
@@ -6275,22 +6275,22 @@  discard block
 block discarded – undo
6275 6275
 			$selected = 'EUR'; // Pour compatibilite
6276 6276
 		}
6277 6277
 
6278
-		$out .= '<select class="flat maxwidth200onsmartphone minwidth300" name="' . $htmlname . '" id="' . $htmlname . '">';
6278
+		$out .= '<select class="flat maxwidth200onsmartphone minwidth300" name="'.$htmlname.'" id="'.$htmlname.'">';
6279 6279
 		if ($useempty) {
6280 6280
 			$out .= '<option value="-1" selected></option>';
6281 6281
 		}
6282 6282
 		foreach ($langs->cache_currencies as $code_iso => $currency) {
6283 6283
 			$labeltoshow = $currency['label'];
6284 6284
 			if ($mode == 1) {
6285
-				$labeltoshow .= ' <span class="opacitymedium">(' . $code_iso . ')</span>';
6285
+				$labeltoshow .= ' <span class="opacitymedium">('.$code_iso.')</span>';
6286 6286
 			} else {
6287
-				$labeltoshow .= ' <span class="opacitymedium">(' . $langs->getCurrencySymbol($code_iso) . ')</span>';
6287
+				$labeltoshow .= ' <span class="opacitymedium">('.$langs->getCurrencySymbol($code_iso).')</span>';
6288 6288
 			}
6289 6289
 
6290 6290
 			if ($selected && $selected == $code_iso) {
6291
-				$out .= '<option value="' . $code_iso . '" selected data-html="' . dol_escape_htmltag($labeltoshow) . '">';
6291
+				$out .= '<option value="'.$code_iso.'" selected data-html="'.dol_escape_htmltag($labeltoshow).'">';
6292 6292
 			} else {
6293
-				$out .= '<option value="' . $code_iso . '" data-html="' . dol_escape_htmltag($labeltoshow) . '">';
6293
+				$out .= '<option value="'.$code_iso.'" data-html="'.dol_escape_htmltag($labeltoshow).'">';
6294 6294
 			}
6295 6295
 			$out .= $labeltoshow;
6296 6296
 			$out .= '</option>';
@@ -6301,7 +6301,7 @@  discard block
 block discarded – undo
6301 6301
 		}
6302 6302
 
6303 6303
 		// Make select dynamic
6304
-		include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
6304
+		include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
6305 6305
 		$out .= ajax_combobox($htmlname);
6306 6306
 
6307 6307
 		return $out;
@@ -6327,10 +6327,10 @@  discard block
 block discarded – undo
6327 6327
 
6328 6328
 		$TCurrency = array();
6329 6329
 
6330
-		$sql = "SELECT code FROM " . $this->db->prefix() . "multicurrency";
6331
-		$sql .= " WHERE entity IN ('" . getEntity('mutlicurrency') . "')";
6330
+		$sql = "SELECT code FROM ".$this->db->prefix()."multicurrency";
6331
+		$sql .= " WHERE entity IN ('".getEntity('mutlicurrency')."')";
6332 6332
 		if ($filter) {
6333
-			$sql .= " AND " . $filter;
6333
+			$sql .= " AND ".$filter;
6334 6334
 		}
6335 6335
 		$resql = $this->db->query($sql);
6336 6336
 		if ($resql) {
@@ -6340,7 +6340,7 @@  discard block
 block discarded – undo
6340 6340
 		}
6341 6341
 
6342 6342
 		$out = '';
6343
-		$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
6343
+		$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
6344 6344
 		if ($useempty) {
6345 6345
 			$out .= '<option value="">&nbsp;</option>';
6346 6346
 		}
@@ -6352,13 +6352,13 @@  discard block
 block discarded – undo
6352 6352
 			foreach ($langs->cache_currencies as $code_iso => $currency) {
6353 6353
 				if (isset($TCurrency[$code_iso])) {
6354 6354
 					if (!empty($selected) && $selected == $code_iso) {
6355
-						$out .= '<option value="' . $code_iso . '" selected="selected">';
6355
+						$out .= '<option value="'.$code_iso.'" selected="selected">';
6356 6356
 					} else {
6357
-						$out .= '<option value="' . $code_iso . '">';
6357
+						$out .= '<option value="'.$code_iso.'">';
6358 6358
 					}
6359 6359
 
6360 6360
 					$out .= $currency['label'];
6361
-					$out .= ' (' . $langs->getCurrencySymbol($code_iso) . ')';
6361
+					$out .= ' ('.$langs->getCurrencySymbol($code_iso).')';
6362 6362
 					$out .= '</option>';
6363 6363
 				}
6364 6364
 			}
@@ -6367,7 +6367,7 @@  discard block
 block discarded – undo
6367 6367
 		$out .= '</select>';
6368 6368
 
6369 6369
 		// Make select dynamic
6370
-		include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
6370
+		include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
6371 6371
 		$out .= ajax_combobox($htmlname);
6372 6372
 
6373 6373
 		return $out;
@@ -6398,7 +6398,7 @@  discard block
 block discarded – undo
6398 6398
 		$sql .= " WHERE t.fk_pays = c.rowid";
6399 6399
 		$sql .= " AND t.active > 0";
6400 6400
 		$sql .= " AND t.entity IN (".getEntity('c_tva').")";
6401
-		$sql .= " AND c.code IN (" . $this->db->sanitize($country_code, 1) . ")";
6401
+		$sql .= " AND c.code IN (".$this->db->sanitize($country_code, 1).")";
6402 6402
 		$sql .= " ORDER BY t.code ASC, t.taux ASC, t.recuperableonly ASC";
6403 6403
 
6404 6404
 		$resql = $this->db->query($sql);
@@ -6410,30 +6410,30 @@  discard block
 block discarded – undo
6410 6410
 
6411 6411
 					$tmparray = array();
6412 6412
 					$tmparray['rowid']			= $obj->rowid;
6413
-					$tmparray['type_vat']		= $obj->type_vat;
6414
-					$tmparray['code']			= $obj->code;
6413
+					$tmparray['type_vat'] = $obj->type_vat;
6414
+					$tmparray['code'] = $obj->code;
6415 6415
 					$tmparray['txtva']			= $obj->taux;
6416
-					$tmparray['nprtva']			= $obj->recuperableonly;
6416
+					$tmparray['nprtva'] = $obj->recuperableonly;
6417 6417
 					$tmparray['localtax1']	    = $obj->localtax1;
6418 6418
 					$tmparray['localtax1_type']	= $obj->localtax1_type;
6419 6419
 					$tmparray['localtax2']	    = $obj->localtax2;
6420 6420
 					$tmparray['localtax2_type']	= $obj->localtax1_type;
6421
-					$tmparray['label']			= $obj->taux . '%' . ($obj->code ? ' (' . $obj->code . ')' : ''); // Label must contains only 0-9 , . % or *
6422
-					$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
6421
+					$tmparray['label'] = $obj->taux.'%'.($obj->code ? ' ('.$obj->code.')' : ''); // Label must contains only 0-9 , . % or *
6422
+					$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
6423 6423
 					$positiverates = '';
6424 6424
 					if ($obj->taux) {
6425
-						$positiverates .= ($positiverates ? '/' : '') . $obj->taux;
6425
+						$positiverates .= ($positiverates ? '/' : '').$obj->taux;
6426 6426
 					}
6427 6427
 					if ($obj->localtax1) {
6428
-						$positiverates .= ($positiverates ? '/' : '') . $obj->localtax1;
6428
+						$positiverates .= ($positiverates ? '/' : '').$obj->localtax1;
6429 6429
 					}
6430 6430
 					if ($obj->localtax2) {
6431
-						$positiverates .= ($positiverates ? '/' : '') . $obj->localtax2;
6431
+						$positiverates .= ($positiverates ? '/' : '').$obj->localtax2;
6432 6432
 					}
6433 6433
 					if (empty($positiverates)) {
6434 6434
 						$positiverates = '0';
6435 6435
 					}
6436
-					$tmparray['labelpositiverates'] = $positiverates . ($obj->code ? ' (' . $obj->code . ')' : ''); // Must never be used as key, only label
6436
+					$tmparray['labelpositiverates'] = $positiverates.($obj->code ? ' ('.$obj->code.')' : ''); // Must never be used as key, only label
6437 6437
 
6438 6438
 					$this->cache_vatrates[$obj->rowid] = $tmparray;
6439 6439
 				}
@@ -6453,7 +6453,7 @@  discard block
 block discarded – undo
6453 6453
 				return -1;
6454 6454
 			}
6455 6455
 		} else {
6456
-			$this->error = '<span class="error">' . $this->db->error() . '</span>';
6456
+			$this->error = '<span class="error">'.$this->db->error().'</span>';
6457 6457
 			return -2;
6458 6458
 		}
6459 6459
 	}
@@ -6506,9 +6506,9 @@  discard block
 block discarded – undo
6506 6506
 		// Check parameters
6507 6507
 		if (is_object($societe_vendeuse) && !$societe_vendeuse->country_code) {
6508 6508
 			if ($societe_vendeuse->id == $mysoc->id) {
6509
-				$return .= '<span class="error">' . $langs->trans("ErrorYourCountryIsNotDefined") . '</span>';
6509
+				$return .= '<span class="error">'.$langs->trans("ErrorYourCountryIsNotDefined").'</span>';
6510 6510
 			} else {
6511
-				$return .= '<span class="error">' . $langs->trans("ErrorSupplierCountryIsNotDefined") . '</span>';
6511
+				$return .= '<span class="error">'.$langs->trans("ErrorSupplierCountryIsNotDefined").'</span>';
6512 6512
 			}
6513 6513
 			return $return;
6514 6514
 		}
@@ -6520,12 +6520,12 @@  discard block
 block discarded – undo
6520 6520
 		// Define list of countries to use to search VAT rates to show
6521 6521
 		// First we defined code_country to use to find list
6522 6522
 		if (is_object($societe_vendeuse)) {
6523
-			$code_country = "'" . $societe_vendeuse->country_code . "'";
6523
+			$code_country = "'".$societe_vendeuse->country_code."'";
6524 6524
 		} else {
6525
-			$code_country = "'" . $mysoc->country_code . "'"; // Pour compatibilite ascendente
6525
+			$code_country = "'".$mysoc->country_code."'"; // Pour compatibilite ascendente
6526 6526
 		}
6527 6527
 		if (getDolGlobalString('SERVICE_ARE_ECOMMERCE_200238EC')) {    // If option to have vat for end customer for services is on
6528
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
6528
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
6529 6529
 			// If SERVICE_ARE_ECOMMERCE_200238EC=1 combo list vat rate of purchaser and seller countries
6530 6530
 			// If SERVICE_ARE_ECOMMERCE_200238EC=2 combo list only the vat rate of the purchaser country
6531 6531
 			$selectVatComboMode = getDolGlobalString('SERVICE_ARE_ECOMMERCE_200238EC');
@@ -6535,27 +6535,27 @@  discard block
 block discarded – undo
6535 6535
 					if ($type == 1) { // We know product is a service
6536 6536
 						switch ($selectVatComboMode) {
6537 6537
 							case '1':
6538
-								$code_country .= ",'" . $societe_acheteuse->country_code . "'";
6538
+								$code_country .= ",'".$societe_acheteuse->country_code."'";
6539 6539
 								break;
6540 6540
 							case '2':
6541
-								$code_country = "'" . $societe_acheteuse->country_code . "'";
6541
+								$code_country = "'".$societe_acheteuse->country_code."'";
6542 6542
 								break;
6543 6543
 						}
6544 6544
 					}
6545 6545
 				} elseif (!$idprod) {  // We don't know type of product
6546 6546
 					switch ($selectVatComboMode) {
6547 6547
 						case '1':
6548
-							$code_country .= ",'" . $societe_acheteuse->country_code . "'";
6548
+							$code_country .= ",'".$societe_acheteuse->country_code."'";
6549 6549
 							break;
6550 6550
 						case '2':
6551
-							$code_country = "'" . $societe_acheteuse->country_code . "'";
6551
+							$code_country = "'".$societe_acheteuse->country_code."'";
6552 6552
 							break;
6553 6553
 					}
6554 6554
 				} else {
6555 6555
 					$prodstatic = new Product($this->db);
6556 6556
 					$prodstatic->fetch($idprod);
6557 6557
 					if ($prodstatic->type == Product::TYPE_SERVICE) {   // We know product is a service
6558
-						$code_country .= ",'" . $societe_acheteuse->country_code . "'";
6558
+						$code_country .= ",'".$societe_acheteuse->country_code."'";
6559 6559
 					}
6560 6560
 				}
6561 6561
 			}
@@ -6617,13 +6617,13 @@  discard block
 block discarded – undo
6617 6617
 				// Override/enable VAT for expense report regardless of global setting - needed if expense report used for business expenses instead
6618 6618
 				// of using supplier invoices (this is a very bad idea !)
6619 6619
 				if (!getDolGlobalString('EXPENSEREPORT_OVERRIDE_VAT')) {
6620
-					$title = ' title="' . dol_escape_htmltag($langs->trans('VATIsNotUsed')) . '"';
6620
+					$title = ' title="'.dol_escape_htmltag($langs->trans('VATIsNotUsed')).'"';
6621 6621
 					$disabled = true;
6622 6622
 				}
6623 6623
 			}
6624 6624
 
6625 6625
 			if (!$options_only) {
6626
-				$return .= '<select class="flat minwidth50imp maxwidth100" id="' . $htmlname . '" name="' . $htmlname . '"' . ($disabled ? ' disabled' : '') . $title . '>';
6626
+				$return .= '<select class="flat minwidth50imp maxwidth100" id="'.$htmlname.'" name="'.$htmlname.'"'.($disabled ? ' disabled' : '').$title.'>';
6627 6627
 			}
6628 6628
 
6629 6629
 			$selectedfound = false;
@@ -6637,13 +6637,13 @@  discard block
 block discarded – undo
6637 6637
 				$key = $rate['txtva'];
6638 6638
 				$key .= $rate['nprtva'] ? '*' : '';
6639 6639
 				if ($mode > 0 && $rate['code']) {
6640
-					$key .= ' (' . $rate['code'] . ')';
6640
+					$key .= ' ('.$rate['code'].')';
6641 6641
 				}
6642 6642
 				if ($mode < 0) {
6643 6643
 					$key = $rate['rowid'];
6644 6644
 				}
6645 6645
 
6646
-				$return .= '<option value="' . $key . '"';
6646
+				$return .= '<option value="'.$key.'"';
6647 6647
 				if (!$selectedfound) {
6648 6648
 					if ($defaultcode) { // If defaultcode is defined, we used it in priority to select combo option instead of using rate+npr flag
6649 6649
 						if ($defaultcode == $rate['code']) {
@@ -6714,7 +6714,7 @@  discard block
 block discarded – undo
6714 6714
 	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 = '')
6715 6715
 	{
6716 6716
 		// phpcs:enable
6717
-		dol_syslog(__METHOD__ . ': using select_date is deprecated. Use selectDate instead.', LOG_WARNING);
6717
+		dol_syslog(__METHOD__.': using select_date is deprecated. Use selectDate instead.', LOG_WARNING);
6718 6718
 		$retstring = $this->selectDate($set_time, $prefix, $h, $m, $empty, $form_name, $d, $addnowlink, $disabled, $fullday, $addplusone, $adddateof);
6719 6719
 		if (!empty($nooutput)) {
6720 6720
 			return $retstring;
@@ -6743,11 +6743,11 @@  discard block
 block discarded – undo
6743 6743
 	{
6744 6744
 		global $langs;
6745 6745
 
6746
-		$ret = $this->selectDate($set_time, $prefix . '_start', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("from"), 'tzuserrel');
6746
+		$ret = $this->selectDate($set_time, $prefix.'_start', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("from"), 'tzuserrel');
6747 6747
 		if ($forcenewline) {
6748 6748
 			$ret .= '<br>';
6749 6749
 		}
6750
-		$ret .= $this->selectDate($set_time_end, $prefix . '_end', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"), 'tzuserrel');
6750
+		$ret .= $this->selectDate($set_time_end, $prefix.'_end', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"), 'tzuserrel');
6751 6751
 		return $ret;
6752 6752
 	}
6753 6753
 
@@ -6813,7 +6813,7 @@  discard block
 block discarded – undo
6813 6813
 		$orig_set_time = $set_time;
6814 6814
 
6815 6815
 		if ($set_time === '' && $emptydate == 0) {
6816
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
6816
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
6817 6817
 			if ($gm == 'tzuser' || $gm == 'tzuserrel') {
6818 6818
 				$set_time = dol_now($gm);
6819 6819
 			} else {
@@ -6881,38 +6881,38 @@  discard block
 block discarded – undo
6881 6881
 				// Calendrier popup version eldy
6882 6882
 				if ($usecalendar == "eldy") {
6883 6883
 					// Input area to enter date manually
6884
-					$retstring .= '<input id="' . $prefix . '" name="' . $prefix . '" type="text" class="maxwidthdate" maxlength="11" value="' . $formated_date . '"';
6884
+					$retstring .= '<input id="'.$prefix.'" name="'.$prefix.'" type="text" class="maxwidthdate" maxlength="11" value="'.$formated_date.'"';
6885 6885
 					$retstring .= ($disabled ? ' disabled' : '');
6886
-					$retstring .= ' onChange="dpChangeDay(\'' . $prefix . '\',\'' . $langs->trans("FormatDateShortJavaInput") . '\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript
6886
+					$retstring .= ' onChange="dpChangeDay(\''.$prefix.'\',\''.$langs->trans("FormatDateShortJavaInput").'\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript
6887 6887
 					$retstring .= '>';
6888 6888
 
6889 6889
 					// Icon calendar
6890 6890
 					$retstringbuttom = '';
6891 6891
 					if (!$disabled) {
6892
-						$retstringbuttom = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons"';
6893
-						$base = DOL_URL_ROOT . '/core/';
6894
-						$retstringbuttom .= ' onClick="showDP(\'' . $base . '\',\'' . $prefix . '\',\'' . $langs->trans("FormatDateShortJavaInput") . '\',\'' . $langs->defaultlang . '\');"';
6895
-						$retstringbuttom .= '>' . img_object($langs->trans("SelectDate"), 'calendarday', 'class="datecallink"') . '</button>';
6892
+						$retstringbuttom = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons"';
6893
+						$base = DOL_URL_ROOT.'/core/';
6894
+						$retstringbuttom .= ' onClick="showDP(\''.$base.'\',\''.$prefix.'\',\''.$langs->trans("FormatDateShortJavaInput").'\',\''.$langs->defaultlang.'\');"';
6895
+						$retstringbuttom .= '>'.img_object($langs->trans("SelectDate"), 'calendarday', 'class="datecallink"').'</button>';
6896 6896
 					} else {
6897
-						$retstringbuttom = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons">' . img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"') . '</button>';
6897
+						$retstringbuttom = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons">'.img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"').'</button>';
6898 6898
 					}
6899
-					$retstring = $retstringbuttom . $retstring;
6899
+					$retstring = $retstringbuttom.$retstring;
6900 6900
 
6901
-					$retstring .= '<input type="hidden" id="' . $prefix . 'day"   name="' . $prefix . 'day"   value="' . $sday . '">' . "\n";
6902
-					$retstring .= '<input type="hidden" id="' . $prefix . 'month" name="' . $prefix . 'month" value="' . $smonth . '">' . "\n";
6903
-					$retstring .= '<input type="hidden" id="' . $prefix . 'year"  name="' . $prefix . 'year"  value="' . $syear . '">' . "\n";
6901
+					$retstring .= '<input type="hidden" id="'.$prefix.'day"   name="'.$prefix.'day"   value="'.$sday.'">'."\n";
6902
+					$retstring .= '<input type="hidden" id="'.$prefix.'month" name="'.$prefix.'month" value="'.$smonth.'">'."\n";
6903
+					$retstring .= '<input type="hidden" id="'.$prefix.'year"  name="'.$prefix.'year"  value="'.$syear.'">'."\n";
6904 6904
 				} elseif ($usecalendar == 'jquery') {
6905 6905
 					if (!$disabled) {
6906 6906
 						// Output javascript for datepicker
6907 6907
 						$minYear = getDolGlobalInt('MIN_YEAR_SELECT_DATE', (date('Y') - 100));
6908 6908
 						$maxYear = getDolGlobalInt('MAX_YEAR_SELECT_DATE', (date('Y') + 100));
6909 6909
 
6910
-						$retstring .= '<script nonce="' . getNonce() . '" type="text/javascript">';
6911
-						$retstring .= "$(function(){ $('#" . $prefix . "').datepicker({
6912
-							dateFormat: '" . $langs->trans("FormatDateShortJQueryInput") . "',
6910
+						$retstring .= '<script nonce="'.getNonce().'" type="text/javascript">';
6911
+						$retstring .= "$(function(){ $('#".$prefix."').datepicker({
6912
+							dateFormat: '" . $langs->trans("FormatDateShortJQueryInput")."',
6913 6913
 							autoclose: true,
6914 6914
 							todayHighlight: true,
6915
-							yearRange: '" . $minYear . ":" . $maxYear . "',";
6915
+							yearRange: '" . $minYear.":".$maxYear."',";
6916 6916
 						if (!empty($conf->dol_use_jmobile)) {
6917 6917
 							$retstring .= "
6918 6918
 								beforeShow: function (input, datePicker) {
@@ -6927,7 +6927,7 @@  discard block
 block discarded – undo
6927 6927
 						if (!getDolGlobalString('MAIN_POPUP_CALENDAR_ON_FOCUS')) {
6928 6928
 							$retstring .= "
6929 6929
 								showOn: 'button',	/* both has problem with autocompletion */
6930
-								buttonImage: '" . DOL_URL_ROOT . "/theme/" . dol_escape_js($conf->theme) . "/img/object_calendarday.png',
6930
+								buttonImage: '" . DOL_URL_ROOT."/theme/".dol_escape_js($conf->theme)."/img/object_calendarday.png',
6931 6931
 								buttonImageOnly: true";
6932 6932
 						}
6933 6933
 						$retstring .= "
@@ -6939,8 +6939,8 @@  discard block
 block discarded – undo
6939 6939
 					$retstring .= '<div class="nowraponall inline-block divfordateinput">';
6940 6940
 					$retstring .= '<input id="'.$prefix.'" name="'.$prefix.'" type="text" class="maxwidthdate" maxlength="11" value="'.$formated_date.'"';
6941 6941
 					$retstring .= ($disabled ? ' disabled' : '');
6942
-					$retstring .= ($placeholder ? ' placeholder="' . dol_escape_htmltag($placeholder) . '"' : '');
6943
-					$retstring .= ' onChange="dpChangeDay(\'' . dol_escape_js($prefix) . '\',\'' . dol_escape_js($langs->trans("FormatDateShortJavaInput")) . '\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript
6942
+					$retstring .= ($placeholder ? ' placeholder="'.dol_escape_htmltag($placeholder).'"' : '');
6943
+					$retstring .= ' onChange="dpChangeDay(\''.dol_escape_js($prefix).'\',\''.dol_escape_js($langs->trans("FormatDateShortJavaInput")).'\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript
6944 6944
 					$retstring .= '>';
6945 6945
 
6946 6946
 					// Icone calendrier
@@ -6955,40 +6955,40 @@  discard block
 block discarded – undo
6955 6955
 						$retstring.='});';
6956 6956
 						$retstring.="</script>";*/
6957 6957
 					} else {
6958
-						$retstringbutton = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons">' . img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"') . '</button>';
6959
-						$retsring = $retstringbutton . $retstring;
6958
+						$retstringbutton = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons">'.img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"').'</button>';
6959
+						$retsring = $retstringbutton.$retstring;
6960 6960
 					}
6961 6961
 
6962 6962
 					$retstring .= '</div>';
6963
-					$retstring .= '<input type="hidden" id="' . $prefix . 'day"   name="' . $prefix . 'day"   value="' . $sday . '">' . "\n";
6964
-					$retstring .= '<input type="hidden" id="' . $prefix . 'month" name="' . $prefix . 'month" value="' . $smonth . '">' . "\n";
6965
-					$retstring .= '<input type="hidden" id="' . $prefix . 'year"  name="' . $prefix . 'year"  value="' . $syear . '">' . "\n";
6963
+					$retstring .= '<input type="hidden" id="'.$prefix.'day"   name="'.$prefix.'day"   value="'.$sday.'">'."\n";
6964
+					$retstring .= '<input type="hidden" id="'.$prefix.'month" name="'.$prefix.'month" value="'.$smonth.'">'."\n";
6965
+					$retstring .= '<input type="hidden" id="'.$prefix.'year"  name="'.$prefix.'year"  value="'.$syear.'">'."\n";
6966 6966
 				} else {
6967 6967
 					$retstring .= "Bad value of MAIN_POPUP_CALENDAR";
6968 6968
 				}
6969 6969
 			} else {
6970 6970
 				// Show date with combo selects
6971 6971
 				// Day
6972
-				$retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth50imp" id="' . $prefix . 'day" name="' . $prefix . 'day">';
6972
+				$retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50imp" id="'.$prefix.'day" name="'.$prefix.'day">';
6973 6973
 
6974 6974
 				if ($emptydate || $set_time == -1) {
6975 6975
 					$retstring .= '<option value="0" selected>&nbsp;</option>';
6976 6976
 				}
6977 6977
 
6978 6978
 				for ($day = 1; $day <= 31; $day++) {
6979
-					$retstring .= '<option value="' . $day . '"' . ($day == $sday ? ' selected' : '') . '>' . $day . '</option>';
6979
+					$retstring .= '<option value="'.$day.'"'.($day == $sday ? ' selected' : '').'>'.$day.'</option>';
6980 6980
 				}
6981 6981
 
6982 6982
 				$retstring .= "</select>";
6983 6983
 
6984
-				$retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth75imp" id="' . $prefix . 'month" name="' . $prefix . 'month">';
6984
+				$retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth75imp" id="'.$prefix.'month" name="'.$prefix.'month">';
6985 6985
 				if ($emptydate || $set_time == -1) {
6986 6986
 					$retstring .= '<option value="0" selected>&nbsp;</option>';
6987 6987
 				}
6988 6988
 
6989 6989
 				// Month
6990 6990
 				for ($month = 1; $month <= 12; $month++) {
6991
-					$retstring .= '<option value="' . $month . '"' . ($month == $smonth ? ' selected' : '') . '>';
6991
+					$retstring .= '<option value="'.$month.'"'.($month == $smonth ? ' selected' : '').'>';
6992 6992
 					$retstring .= dol_print_date(mktime(12, 0, 0, $month, 1, 2000), "%b");
6993 6993
 					$retstring .= "</option>";
6994 6994
 				}
@@ -6996,12 +6996,12 @@  discard block
 block discarded – undo
6996 6996
 
6997 6997
 				// Year
6998 6998
 				if ($emptydate || $set_time == -1) {
6999
-					$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 . '">';
6999
+					$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.'">';
7000 7000
 				} else {
7001
-					$retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth75imp" id="' . $prefix . 'year" name="' . $prefix . 'year">';
7001
+					$retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth75imp" id="'.$prefix.'year" name="'.$prefix.'year">';
7002 7002
 
7003 7003
 					for ($year = $syear - 10; $year < $syear + 10; $year++) {
7004
-						$retstring .= '<option value="' . $year . '"' . ($year == $syear ? ' selected' : '') . '>' . $year . '</option>';
7004
+						$retstring .= '<option value="'.$year.'"'.($year == $syear ? ' selected' : '').'>'.$year.'</option>';
7005 7005
 					}
7006 7006
 					$retstring .= "</select>\n";
7007 7007
 				}
@@ -7025,15 +7025,15 @@  discard block
 block discarded – undo
7025 7025
 				}
7026 7026
 			}
7027 7027
 			// Show hour
7028
-			$retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth50 ' . ($fullday ? $fullday . 'hour' : '') . '" id="' . $prefix . 'hour" name="' . $prefix . 'hour">';
7028
+			$retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50 '.($fullday ? $fullday.'hour' : '').'" id="'.$prefix.'hour" name="'.$prefix.'hour">';
7029 7029
 			if ($emptyhours) {
7030 7030
 				$retstring .= '<option value="-1">&nbsp;</option>';
7031 7031
 			}
7032 7032
 			for ($hour = $hourstart; $hour < $hourend; $hour++) {
7033 7033
 				if (strlen($hour) < 2) {
7034
-					$hour = "0" . $hour;
7034
+					$hour = "0".$hour;
7035 7035
 				}
7036
-				$retstring .= '<option value="' . $hour . '"' . (($hour == $shour) ? ' selected' : '') . '>' . $hour;
7036
+				$retstring .= '<option value="'.$hour.'"'.(($hour == $shour) ? ' selected' : '').'>'.$hour;
7037 7037
 				//$retstring .= (empty($conf->dol_optimize_smallscreen) ? '' : 'H');
7038 7038
 				$retstring .= '</option>';
7039 7039
 			}
@@ -7046,19 +7046,19 @@  discard block
 block discarded – undo
7046 7046
 
7047 7047
 		if ($m) {
7048 7048
 			// Show minutes
7049
-			$retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth50 ' . ($fullday ? $fullday . 'min' : '') . '" id="' . $prefix . 'min" name="' . $prefix . 'min">';
7049
+			$retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50 '.($fullday ? $fullday.'min' : '').'" id="'.$prefix.'min" name="'.$prefix.'min">';
7050 7050
 			if ($emptyhours) {
7051 7051
 				$retstring .= '<option value="-1">&nbsp;</option>';
7052 7052
 			}
7053 7053
 			for ($min = 0; $min < 60; $min += $stepminutes) {
7054 7054
 				if (strlen($min) < 2) {
7055
-					$min = "0" . $min;
7055
+					$min = "0".$min;
7056 7056
 				}
7057
-				$retstring .= '<option value="' . $min . '"' . (($min == $smin) ? ' selected' : '') . '>' . $min . (empty($conf->dol_optimize_smallscreen) ? '' : '') . '</option>';
7057
+				$retstring .= '<option value="'.$min.'"'.(($min == $smin) ? ' selected' : '').'>'.$min.(empty($conf->dol_optimize_smallscreen) ? '' : '').'</option>';
7058 7058
 			}
7059 7059
 			$retstring .= '</select>';
7060 7060
 
7061
-			$retstring .= '<input type="hidden" name="' . $prefix . 'sec" value="' . $ssec . '">';
7061
+			$retstring .= '<input type="hidden" name="'.$prefix.'sec" value="'.$ssec.'">';
7062 7062
 		}
7063 7063
 
7064 7064
 		if ($d && $h) {
@@ -7081,10 +7081,10 @@  discard block
 block discarded – undo
7081 7081
 
7082 7082
 			// Generate the date part, depending on the use or not of the javascript calendar
7083 7083
 			if ($addnowlink == 1) { // server time expressed in user time setup
7084
-				$reset_scripts .= 'jQuery(\'#' . $prefix . '\').val(\'' . dol_print_date($nowgmt, 'day', 'tzuserrel') . '\');';
7085
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'day\').val(\'' . dol_print_date($nowgmt, '%d', 'tzuserrel') . '\');';
7086
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'month\').val(\'' . dol_print_date($nowgmt, '%m', 'tzuserrel') . '\');';
7087
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'year\').val(\'' . dol_print_date($nowgmt, '%Y', 'tzuserrel') . '\');';
7084
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'day', 'tzuserrel').'\');';
7085
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');';
7086
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');';
7087
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');';
7088 7088
 			} elseif ($addnowlink == 2) {
7089 7089
 				/* Disabled because the output does not use the string format defined by FormatDateShort key to forge the value into #prefix.
7090 7090
 				 * This break application for foreign languages.
@@ -7093,10 +7093,10 @@  discard block
 block discarded – undo
7093 7093
 				$reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(parseInt(d.getMonth().pad()) + 1);';
7094 7094
 				$reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(d.getFullYear());';
7095 7095
 				*/
7096
-				$reset_scripts .= 'jQuery(\'#' . $prefix . '\').val(\'' . dol_print_date($nowgmt, 'day', 'tzuserrel') . '\');';
7097
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'day\').val(\'' . dol_print_date($nowgmt, '%d', 'tzuserrel') . '\');';
7098
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'month\').val(\'' . dol_print_date($nowgmt, '%m', 'tzuserrel') . '\');';
7099
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'year\').val(\'' . dol_print_date($nowgmt, '%Y', 'tzuserrel') . '\');';
7096
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'day', 'tzuserrel').'\');';
7097
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');';
7098
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');';
7099
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');';
7100 7100
 			}
7101 7101
 			/*if ($usecalendar == "eldy")
7102 7102
 			{
@@ -7116,11 +7116,11 @@  discard block
 block discarded – undo
7116 7116
 				}
7117 7117
 				//$reset_scripts .= 'this.form.elements[\''.$prefix.'hour\'].value=formatDate(new Date(), \'HH\'); ';
7118 7118
 				if ($addnowlink == 1) {
7119
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').val(\'' . dol_print_date($nowgmt, '%H', 'tzuserrel') . '\');';
7120
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').change();';
7119
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(\''.dol_print_date($nowgmt, '%H', 'tzuserrel').'\');';
7120
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').change();';
7121 7121
 				} elseif ($addnowlink == 2) {
7122
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').val(d.getHours().pad());';
7123
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').change();';
7122
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(d.getHours().pad());';
7123
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').change();';
7124 7124
 				}
7125 7125
 
7126 7126
 				if ($fullday) {
@@ -7134,11 +7134,11 @@  discard block
 block discarded – undo
7134 7134
 				}
7135 7135
 				//$reset_scripts .= 'this.form.elements[\''.$prefix.'min\'].value=formatDate(new Date(), \'mm\'); ';
7136 7136
 				if ($addnowlink == 1) {
7137
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').val(\'' . dol_print_date($nowgmt, '%M', 'tzuserrel') . '\');';
7138
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').change();';
7137
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(\''.dol_print_date($nowgmt, '%M', 'tzuserrel').'\');';
7138
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').change();';
7139 7139
 				} elseif ($addnowlink == 2) {
7140
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').val(d.getMinutes().pad());';
7141
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').change();';
7140
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(d.getMinutes().pad());';
7141
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').change();';
7142 7142
 				}
7143 7143
 				if ($fullday) {
7144 7144
 					$reset_scripts .= ' } ';
@@ -7146,7 +7146,7 @@  discard block
 block discarded – undo
7146 7146
 			}
7147 7147
 			// If reset_scripts is not empty, print the link with the reset_scripts in the onClick
7148 7148
 			if ($reset_scripts && !getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
7149
-				$retstring .= ' <button class="dpInvisibleButtons datenowlink" id="' . $prefix . 'ButtonNow" type="button" name="_useless" value="now" onClick="' . $reset_scripts . '">';
7149
+				$retstring .= ' <button class="dpInvisibleButtons datenowlink" id="'.$prefix.'ButtonNow" type="button" name="_useless" value="now" onClick="'.$reset_scripts.'">';
7150 7150
 				$retstring .= $langs->trans("Now");
7151 7151
 				$retstring .= '</button> ';
7152 7152
 			}
@@ -7158,16 +7158,16 @@  discard block
 block discarded – undo
7158 7158
 			$reset_scripts = "";
7159 7159
 
7160 7160
 			// Generate the date part, depending on the use or not of the javascript calendar
7161
-			$reset_scripts .= 'jQuery(\'#' . $prefix . '\').val(\'' . dol_print_date($nowgmt, 'dayinputnoreduce', 'tzuserrel') . '\');';
7162
-			$reset_scripts .= 'jQuery(\'#' . $prefix . 'day\').val(\'' . dol_print_date($nowgmt, '%d', 'tzuserrel') . '\');';
7163
-			$reset_scripts .= 'jQuery(\'#' . $prefix . 'month\').val(\'' . dol_print_date($nowgmt, '%m', 'tzuserrel') . '\');';
7164
-			$reset_scripts .= 'jQuery(\'#' . $prefix . 'year\').val(\'' . dol_print_date($nowgmt, '%Y', 'tzuserrel') . '\');';
7161
+			$reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'dayinputnoreduce', 'tzuserrel').'\');';
7162
+			$reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');';
7163
+			$reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');';
7164
+			$reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');';
7165 7165
 			// Update the hour part
7166 7166
 			if ($h) {
7167 7167
 				if ($fullday) {
7168 7168
 					$reset_scripts .= " if (jQuery('#fullday:checked').val() == null) {";
7169 7169
 				}
7170
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').val(\'' . dol_print_date($nowgmt, '%H', 'tzuserrel') . '\');';
7170
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(\''.dol_print_date($nowgmt, '%H', 'tzuserrel').'\');';
7171 7171
 				if ($fullday) {
7172 7172
 					$reset_scripts .= ' } ';
7173 7173
 				}
@@ -7177,14 +7177,14 @@  discard block
 block discarded – undo
7177 7177
 				if ($fullday) {
7178 7178
 					$reset_scripts .= " if (jQuery('#fullday:checked').val() == null) {";
7179 7179
 				}
7180
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').val(\'' . dol_print_date($nowgmt, '%M', 'tzuserrel') . '\');';
7180
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(\''.dol_print_date($nowgmt, '%M', 'tzuserrel').'\');';
7181 7181
 				if ($fullday) {
7182 7182
 					$reset_scripts .= ' } ';
7183 7183
 				}
7184 7184
 			}
7185 7185
 			// If reset_scripts is not empty, print the link with the reset_scripts in the onClick
7186 7186
 			if ($reset_scripts && empty($conf->dol_optimize_smallscreen)) {
7187
-				$retstring .= ' <button class="dpInvisibleButtons datenowlink" id="' . $prefix . 'ButtonPlusOne" type="button" name="_useless2" value="plusone" onClick="' . $reset_scripts . '">';
7187
+				$retstring .= ' <button class="dpInvisibleButtons datenowlink" id="'.$prefix.'ButtonPlusOne" type="button" name="_useless2" value="plusone" onClick="'.$reset_scripts.'">';
7188 7188
 				$retstring .= $langs->trans("DateStartPlusOne");
7189 7189
 				$retstring .= '</button> ';
7190 7190
 			}
@@ -7242,17 +7242,17 @@  discard block
 block discarded – undo
7242 7242
 			unset($TDurationTypes[$value]);
7243 7243
 		}
7244 7244
 
7245
-		$retstring = '<select class="flat minwidth75 maxwidth100" id="select_' . $prefix . 'type_duration" name="' . $prefix . 'type_duration">';
7245
+		$retstring = '<select class="flat minwidth75 maxwidth100" id="select_'.$prefix.'type_duration" name="'.$prefix.'type_duration">';
7246 7246
 		foreach ($TDurationTypes as $key => $typeduration) {
7247
-			$retstring .= '<option value="' . $key . '"';
7247
+			$retstring .= '<option value="'.$key.'"';
7248 7248
 			if ($key == $selected) {
7249 7249
 				$retstring .= " selected";
7250 7250
 			}
7251
-			$retstring .= ">" . $typeduration . "</option>";
7251
+			$retstring .= ">".$typeduration."</option>";
7252 7252
 		}
7253 7253
 		$retstring .= "</select>";
7254 7254
 
7255
-		$retstring .= ajax_combobox('select_' . $prefix . 'type_duration');
7255
+		$retstring .= ajax_combobox('select_'.$prefix.'type_duration');
7256 7256
 
7257 7257
 		return $retstring;
7258 7258
 	}
@@ -7284,30 +7284,30 @@  discard block
 block discarded – undo
7284 7284
 
7285 7285
 		// Hours
7286 7286
 		if ($iSecond != '') {
7287
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
7287
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
7288 7288
 
7289 7289
 			$hourSelected = convertSecondToTime($iSecond, 'allhour');
7290 7290
 			$minSelected = convertSecondToTime($iSecond, 'min');
7291 7291
 		}
7292 7292
 
7293 7293
 		if ($typehour == 'select') {
7294
-			$retstring .= '<select class="flat" id="select_' . $prefix . 'hour" name="' . $prefix . 'hour"' . ($disabled ? ' disabled' : '') . '>';
7294
+			$retstring .= '<select class="flat" id="select_'.$prefix.'hour" name="'.$prefix.'hour"'.($disabled ? ' disabled' : '').'>';
7295 7295
 			for ($hour = 0; $hour < 25; $hour++) {    // For a duration, we allow 24 hours
7296
-				$retstring .= '<option value="' . $hour . '"';
7296
+				$retstring .= '<option value="'.$hour.'"';
7297 7297
 				if (is_numeric($hourSelected) && $hourSelected == $hour) {
7298 7298
 					$retstring .= " selected";
7299 7299
 				}
7300
-				$retstring .= ">" . $hour . "</option>";
7300
+				$retstring .= ">".$hour."</option>";
7301 7301
 			}
7302 7302
 			$retstring .= "</select>";
7303 7303
 		} elseif ($typehour == 'text' || $typehour == 'textselect') {
7304
-			$retstring .= '<input placeholder="' . $langs->trans('HourShort') . '" type="number" min="0" name="' . $prefix . 'hour"' . ($disabled ? ' disabled' : '') . ' class="flat maxwidth50 inputhour right" value="' . (($hourSelected != '') ? ((int) $hourSelected) : '') . '">';
7304
+			$retstring .= '<input placeholder="'.$langs->trans('HourShort').'" type="number" min="0" name="'.$prefix.'hour"'.($disabled ? ' disabled' : '').' class="flat maxwidth50 inputhour right" value="'.(($hourSelected != '') ? ((int) $hourSelected) : '').'">';
7305 7305
 		} else {
7306 7306
 			return 'BadValueForParameterTypeHour';
7307 7307
 		}
7308 7308
 
7309 7309
 		if ($typehour != 'text') {
7310
-			$retstring .= ' ' . $langs->trans('HourShort');
7310
+			$retstring .= ' '.$langs->trans('HourShort');
7311 7311
 		} else {
7312 7312
 			$retstring .= '<span class="">:</span>';
7313 7313
 		}
@@ -7322,21 +7322,21 @@  discard block
 block discarded – undo
7322 7322
 		}
7323 7323
 
7324 7324
 		if ($typehour == 'select' || $typehour == 'textselect') {
7325
-			$retstring .= '<select class="flat" id="select_' . $prefix . 'min" name="' . $prefix . 'min"' . ($disabled ? ' disabled' : '') . '>';
7325
+			$retstring .= '<select class="flat" id="select_'.$prefix.'min" name="'.$prefix.'min"'.($disabled ? ' disabled' : '').'>';
7326 7326
 			for ($min = 0; $min <= 55; $min = $min + 5) {
7327
-				$retstring .= '<option value="' . $min . '"';
7327
+				$retstring .= '<option value="'.$min.'"';
7328 7328
 				if (is_numeric($minSelected) && $minSelected == $min) {
7329 7329
 					$retstring .= ' selected';
7330 7330
 				}
7331
-				$retstring .= '>' . $min . '</option>';
7331
+				$retstring .= '>'.$min.'</option>';
7332 7332
 			}
7333 7333
 			$retstring .= "</select>";
7334 7334
 		} elseif ($typehour == 'text') {
7335
-			$retstring .= '<input placeholder="' . $langs->trans('MinuteShort') . '" type="number" min="0" name="' . $prefix . 'min"' . ($disabled ? ' disabled' : '') . ' class="flat maxwidth50 inputminute right" value="' . (($minSelected != '') ? ((int) $minSelected) : '') . '">';
7335
+			$retstring .= '<input placeholder="'.$langs->trans('MinuteShort').'" type="number" min="0" name="'.$prefix.'min"'.($disabled ? ' disabled' : '').' class="flat maxwidth50 inputminute right" value="'.(($minSelected != '') ? ((int) $minSelected) : '').'">';
7336 7336
 		}
7337 7337
 
7338 7338
 		if ($typehour != 'text') {
7339
-			$retstring .= ' ' . $langs->trans('MinuteShort');
7339
+			$retstring .= ' '.$langs->trans('MinuteShort');
7340 7340
 		}
7341 7341
 
7342 7342
 		$retstring .= "</span>";
@@ -7384,7 +7384,7 @@  discard block
 block discarded – undo
7384 7384
 			$placeholder = '';
7385 7385
 
7386 7386
 			if ($selected && empty($selected_input_value)) {
7387
-				require_once DOL_DOCUMENT_ROOT . '/ticket/class/ticket.class.php';
7387
+				require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php';
7388 7388
 				$tickettmpselect = new Ticket($this->db);
7389 7389
 				$tickettmpselect->fetch($selected);
7390 7390
 				$selected_input_value = $tickettmpselect->ref;
@@ -7392,17 +7392,17 @@  discard block
 block discarded – undo
7392 7392
 			}
7393 7393
 
7394 7394
 			$urloption = '';
7395
-			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/ticket/ajax/tickets.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
7395
+			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/ticket/ajax/tickets.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
7396 7396
 
7397 7397
 			if (empty($hidelabel)) {
7398
-				$out .= $langs->trans("RefOrLabel") . ' : ';
7398
+				$out .= $langs->trans("RefOrLabel").' : ';
7399 7399
 			} elseif ($hidelabel > 1) {
7400
-				$placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"';
7400
+				$placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"';
7401 7401
 				if ($hidelabel == 2) {
7402 7402
 					$out .= img_picto($langs->trans("Search"), 'search');
7403 7403
 				}
7404 7404
 			}
7405
-			$out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />';
7405
+			$out .= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />';
7406 7406
 			if ($hidelabel == 3) {
7407 7407
 				$out .= img_picto($langs->trans("Search"), 'search');
7408 7408
 			}
@@ -7446,8 +7446,8 @@  discard block
 block discarded – undo
7446 7446
 
7447 7447
 		$sql = "SELECT ";
7448 7448
 		$sql .= $selectFields;
7449
-		$sql .= " FROM " . $this->db->prefix() . "ticket as p";
7450
-		$sql .= ' WHERE p.entity IN (' . getEntity('ticket') . ')';
7449
+		$sql .= " FROM ".$this->db->prefix()."ticket as p";
7450
+		$sql .= ' WHERE p.entity IN ('.getEntity('ticket').')';
7451 7451
 
7452 7452
 		// Add criteria on ref/label
7453 7453
 		if ($filterkey != '') {
@@ -7463,7 +7463,7 @@  discard block
 block discarded – undo
7463 7463
 				if ($i > 0) {
7464 7464
 					$sql .= " AND ";
7465 7465
 				}
7466
-				$sql .= "(p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%' OR p.subject LIKE '" . $this->db->escape($prefix . $crit) . "%'";
7466
+				$sql .= "(p.ref LIKE '".$this->db->escape($prefix.$crit)."%' OR p.subject LIKE '".$this->db->escape($prefix.$crit)."%'";
7467 7467
 				$sql .= ")";
7468 7468
 				$i++;
7469 7469
 			}
@@ -7476,22 +7476,22 @@  discard block
 block discarded – undo
7476 7476
 		$sql .= $this->db->plimit($limit, 0);
7477 7477
 
7478 7478
 		// Build output string
7479
-		dol_syslog(get_class($this) . "::selectTicketsList search tickets", LOG_DEBUG);
7479
+		dol_syslog(get_class($this)."::selectTicketsList search tickets", LOG_DEBUG);
7480 7480
 		$result = $this->db->query($sql);
7481 7481
 		if ($result) {
7482
-			require_once DOL_DOCUMENT_ROOT . '/ticket/class/ticket.class.php';
7483
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/ticket.lib.php';
7482
+			require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php';
7483
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/ticket.lib.php';
7484 7484
 
7485 7485
 			$num = $this->db->num_rows($result);
7486 7486
 
7487 7487
 			$events = null;
7488 7488
 
7489 7489
 			if (!$forcecombo) {
7490
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
7490
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
7491 7491
 				$out .= ajax_combobox($htmlname, $events, $conf->global->TICKET_USE_SEARCH_TO_SELECT);
7492 7492
 			}
7493 7493
 
7494
-			$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
7494
+			$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
7495 7495
 
7496 7496
 			$textifempty = '';
7497 7497
 			// Do not use textifempty = ' ' or '&nbsp;' here, or search on key will search on ' key'.
@@ -7508,7 +7508,7 @@  discard block
 block discarded – undo
7508 7508
 				}
7509 7509
 			}
7510 7510
 			if ($showempty) {
7511
-				$out .= '<option value="0" selected>' . $textifempty . '</option>';
7511
+				$out .= '<option value="0" selected>'.$textifempty.'</option>';
7512 7512
 			}
7513 7513
 
7514 7514
 			$i = 0;
@@ -7563,13 +7563,13 @@  discard block
 block discarded – undo
7563 7563
 		$outref = $objp->ref;
7564 7564
 		$outtype = $objp->fk_product_type;
7565 7565
 
7566
-		$opt = '<option value="' . $objp->rowid . '"';
7566
+		$opt = '<option value="'.$objp->rowid.'"';
7567 7567
 		$opt .= ($objp->rowid == $selected) ? ' selected' : '';
7568 7568
 		$opt .= '>';
7569 7569
 		$opt .= $objp->ref;
7570 7570
 		$objRef = $objp->ref;
7571 7571
 		if (!empty($filterkey) && $filterkey != '') {
7572
-			$objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1);
7572
+			$objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1);
7573 7573
 		}
7574 7574
 
7575 7575
 		$opt .= "</option>\n";
@@ -7610,7 +7610,7 @@  discard block
 block discarded – undo
7610 7610
 			$placeholder = '';
7611 7611
 
7612 7612
 			if ($selected && empty($selected_input_value)) {
7613
-				require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
7613
+				require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
7614 7614
 				$projecttmpselect = new Project($this->db);
7615 7615
 				$projecttmpselect->fetch($selected);
7616 7616
 				$selected_input_value = $projecttmpselect->ref;
@@ -7618,17 +7618,17 @@  discard block
 block discarded – undo
7618 7618
 			}
7619 7619
 
7620 7620
 			$urloption = '';
7621
-			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/projet/ajax/projects.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
7621
+			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/projet/ajax/projects.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
7622 7622
 
7623 7623
 			if (empty($hidelabel)) {
7624
-				$out .= $langs->trans("RefOrLabel") . ' : ';
7624
+				$out .= $langs->trans("RefOrLabel").' : ';
7625 7625
 			} elseif ($hidelabel > 1) {
7626
-				$placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"';
7626
+				$placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"';
7627 7627
 				if ($hidelabel == 2) {
7628 7628
 					$out .= img_picto($langs->trans("Search"), 'search');
7629 7629
 				}
7630 7630
 			}
7631
-			$out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />';
7631
+			$out .= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />';
7632 7632
 			if ($hidelabel == 3) {
7633 7633
 				$out .= img_picto($langs->trans("Search"), 'search');
7634 7634
 			}
@@ -7671,8 +7671,8 @@  discard block
 block discarded – undo
7671 7671
 
7672 7672
 		$sql = "SELECT ";
7673 7673
 		$sql .= $selectFields;
7674
-		$sql .= " FROM " . $this->db->prefix() . "projet as p";
7675
-		$sql .= ' WHERE p.entity IN (' . getEntity('project') . ')';
7674
+		$sql .= " FROM ".$this->db->prefix()."projet as p";
7675
+		$sql .= ' WHERE p.entity IN ('.getEntity('project').')';
7676 7676
 
7677 7677
 		// Add criteria on ref/label
7678 7678
 		if ($filterkey != '') {
@@ -7688,7 +7688,7 @@  discard block
 block discarded – undo
7688 7688
 				if ($i > 0) {
7689 7689
 					$sql .= " AND ";
7690 7690
 				}
7691
-				$sql .= "p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%'";
7691
+				$sql .= "p.ref LIKE '".$this->db->escape($prefix.$crit)."%'";
7692 7692
 				$sql .= "";
7693 7693
 				$i++;
7694 7694
 			}
@@ -7701,22 +7701,22 @@  discard block
 block discarded – undo
7701 7701
 		$sql .= $this->db->plimit($limit, 0);
7702 7702
 
7703 7703
 		// Build output string
7704
-		dol_syslog(get_class($this) . "::selectProjectsList search projects", LOG_DEBUG);
7704
+		dol_syslog(get_class($this)."::selectProjectsList search projects", LOG_DEBUG);
7705 7705
 		$result = $this->db->query($sql);
7706 7706
 		if ($result) {
7707
-			require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
7708
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php';
7707
+			require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
7708
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
7709 7709
 
7710 7710
 			$num = $this->db->num_rows($result);
7711 7711
 
7712 7712
 			$events = null;
7713 7713
 
7714 7714
 			if (!$forcecombo) {
7715
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
7715
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
7716 7716
 				$out .= ajax_combobox($htmlname, $events, $conf->global->PROJECT_USE_SEARCH_TO_SELECT);
7717 7717
 			}
7718 7718
 
7719
-			$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
7719
+			$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
7720 7720
 
7721 7721
 			$textifempty = '';
7722 7722
 			// Do not use textifempty = ' ' or '&nbsp;' here, or search on key will search on ' key'.
@@ -7733,7 +7733,7 @@  discard block
 block discarded – undo
7733 7733
 				}
7734 7734
 			}
7735 7735
 			if ($showempty) {
7736
-				$out .= '<option value="0" selected>' . $textifempty . '</option>';
7736
+				$out .= '<option value="0" selected>'.$textifempty.'</option>';
7737 7737
 			}
7738 7738
 
7739 7739
 			$i = 0;
@@ -7791,13 +7791,13 @@  discard block
 block discarded – undo
7791 7791
 		$outlabel = $objp->label;
7792 7792
 		$outtype = $objp->fk_product_type;
7793 7793
 
7794
-		$opt = '<option value="' . $objp->rowid . '"';
7794
+		$opt = '<option value="'.$objp->rowid.'"';
7795 7795
 		$opt .= ($objp->rowid == $selected) ? ' selected' : '';
7796 7796
 		$opt .= '>';
7797 7797
 		$opt .= $objp->ref;
7798 7798
 		$objRef = $objp->ref;
7799 7799
 		if (!empty($filterkey) && $filterkey != '') {
7800
-			$objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1);
7800
+			$objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1);
7801 7801
 		}
7802 7802
 
7803 7803
 		$opt .= "</option>\n";
@@ -7840,7 +7840,7 @@  discard block
 block discarded – undo
7840 7840
 			$urloption = '';
7841 7841
 
7842 7842
 			if ($selected && empty($selected_input_value)) {
7843
-				require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php';
7843
+				require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
7844 7844
 				$adherenttmpselect = new Adherent($this->db);
7845 7845
 				$adherenttmpselect->fetch($selected);
7846 7846
 				$selected_input_value = $adherenttmpselect->ref;
@@ -7849,17 +7849,17 @@  discard block
 block discarded – undo
7849 7849
 
7850 7850
 			$urloption = '';
7851 7851
 
7852
-			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/adherents/ajax/adherents.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
7852
+			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/adherents/ajax/adherents.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
7853 7853
 
7854 7854
 			if (empty($hidelabel)) {
7855
-				$out .= $langs->trans("RefOrLabel") . ' : ';
7855
+				$out .= $langs->trans("RefOrLabel").' : ';
7856 7856
 			} elseif ($hidelabel > 1) {
7857
-				$placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"';
7857
+				$placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"';
7858 7858
 				if ($hidelabel == 2) {
7859 7859
 					$out .= img_picto($langs->trans("Search"), 'search');
7860 7860
 				}
7861 7861
 			}
7862
-			$out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />';
7862
+			$out .= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />';
7863 7863
 			if ($hidelabel == 3) {
7864 7864
 				$out .= img_picto($langs->trans("Search"), 'search');
7865 7865
 			}
@@ -7904,8 +7904,8 @@  discard block
 block discarded – undo
7904 7904
 
7905 7905
 		$sql = "SELECT ";
7906 7906
 		$sql .= $selectFields;
7907
-		$sql .= " FROM " . $this->db->prefix() . "adherent as p";
7908
-		$sql .= ' WHERE p.entity IN (' . getEntity('adherent') . ')';
7907
+		$sql .= " FROM ".$this->db->prefix()."adherent as p";
7908
+		$sql .= ' WHERE p.entity IN ('.getEntity('adherent').')';
7909 7909
 
7910 7910
 		// Add criteria on ref/label
7911 7911
 		if ($filterkey != '') {
@@ -7921,8 +7921,8 @@  discard block
 block discarded – undo
7921 7921
 				if ($i > 0) {
7922 7922
 					$sql .= " AND ";
7923 7923
 				}
7924
-				$sql .= "(p.firstname LIKE '" . $this->db->escape($prefix . $crit) . "%'";
7925
-				$sql .= " OR p.lastname LIKE '" . $this->db->escape($prefix . $crit) . "%')";
7924
+				$sql .= "(p.firstname LIKE '".$this->db->escape($prefix.$crit)."%'";
7925
+				$sql .= " OR p.lastname LIKE '".$this->db->escape($prefix.$crit)."%')";
7926 7926
 				$i++;
7927 7927
 			}
7928 7928
 			if (count($scrit) > 1) {
@@ -7931,27 +7931,27 @@  discard block
 block discarded – undo
7931 7931
 			$sql .= ')';
7932 7932
 		}
7933 7933
 		if ($status != -1) {
7934
-			$sql .= ' AND statut = ' . ((int) $status);
7934
+			$sql .= ' AND statut = '.((int) $status);
7935 7935
 		}
7936 7936
 		$sql .= $this->db->plimit($limit, 0);
7937 7937
 
7938 7938
 		// Build output string
7939
-		dol_syslog(get_class($this) . "::selectMembersList search adherents", LOG_DEBUG);
7939
+		dol_syslog(get_class($this)."::selectMembersList search adherents", LOG_DEBUG);
7940 7940
 		$result = $this->db->query($sql);
7941 7941
 		if ($result) {
7942
-			require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php';
7943
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/member.lib.php';
7942
+			require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
7943
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
7944 7944
 
7945 7945
 			$num = $this->db->num_rows($result);
7946 7946
 
7947 7947
 			$events = null;
7948 7948
 
7949 7949
 			if (!$forcecombo) {
7950
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
7950
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
7951 7951
 				$out .= ajax_combobox($htmlname, $events, getDolGlobalString('PROJECT_USE_SEARCH_TO_SELECT') ? $conf->global->PROJECT_USE_SEARCH_TO_SELECT : '');
7952 7952
 			}
7953 7953
 
7954
-			$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
7954
+			$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
7955 7955
 
7956 7956
 			$textifempty = '';
7957 7957
 			// Do not use textifempty = ' ' or '&nbsp;' here, or search on key will search on ' key'.
@@ -7968,7 +7968,7 @@  discard block
 block discarded – undo
7968 7968
 				}
7969 7969
 			}
7970 7970
 			if ($showempty) {
7971
-				$out .= '<option value="-1" selected>' . $textifempty . '</option>';
7971
+				$out .= '<option value="-1" selected>'.$textifempty.'</option>';
7972 7972
 			}
7973 7973
 
7974 7974
 			$i = 0;
@@ -8024,11 +8024,11 @@  discard block
 block discarded – undo
8024 8024
 		$outlabel = dolGetFirstLastname($objp->firstname, $objp->lastname);
8025 8025
 		$outtype = $objp->fk_adherent_type;
8026 8026
 
8027
-		$opt = '<option value="' . $objp->rowid . '"';
8027
+		$opt = '<option value="'.$objp->rowid.'"';
8028 8028
 		$opt .= ($objp->rowid == $selected) ? ' selected' : '';
8029 8029
 		$opt .= '>';
8030 8030
 		if (!empty($filterkey) && $filterkey != '') {
8031
-			$outlabel = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $outlabel, 1);
8031
+			$outlabel = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $outlabel, 1);
8032 8032
 		}
8033 8033
 		$opt .= $outlabel;
8034 8034
 		$opt .= "</option>\n";
@@ -8101,9 +8101,9 @@  discard block
 block discarded – undo
8101 8101
 			$vartmp = (empty($InfoFieldList[3]) ? '' : $InfoFieldList[3]);
8102 8102
 			$reg = array();
8103 8103
 			if (preg_match('/^.*:(\w*)$/', $vartmp, $reg)) {
8104
-				$InfoFieldList[4] = $reg[1];    // take the sort field
8104
+				$InfoFieldList[4] = $reg[1]; // take the sort field
8105 8105
 			}
8106
-			$InfoFieldList[3] = preg_replace('/:\w*$/', '', $vartmp);    // take the filter field
8106
+			$InfoFieldList[3] = preg_replace('/:\w*$/', '', $vartmp); // take the filter field
8107 8107
 
8108 8108
 			$classname = $InfoFieldList[0];
8109 8109
 			$classpath = $InfoFieldList[1];
@@ -8134,8 +8134,8 @@  discard block
 block discarded – undo
8134 8134
 		);
8135 8135
 
8136 8136
 		if (!is_object($objecttmp)) {
8137
-			dol_syslog('selectForForms: Error bad setup of field objectdescorig=' . $objectdescorig.', objectfield='.$objectfield, LOG_WARNING);
8138
-			return 'selectForForms: Error bad setup of field objectdescorig=' . $objectdescorig.', objectfield='.$objectfield;
8137
+			dol_syslog('selectForForms: Error bad setup of field objectdescorig='.$objectdescorig.', objectfield='.$objectfield, LOG_WARNING);
8138
+			return 'selectForForms: Error bad setup of field objectdescorig='.$objectdescorig.', objectfield='.$objectfield;
8139 8139
 		}
8140 8140
 
8141 8141
 		//var_dump($filter);
@@ -8146,9 +8146,9 @@  discard block
 block discarded – undo
8146 8146
 		if ($prefixforautocompletemode == 'product') {
8147 8147
 			$prefixforautocompletemode = 'produit';
8148 8148
 		}
8149
-		$confkeyforautocompletemode = strtoupper($prefixforautocompletemode) . '_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT
8149
+		$confkeyforautocompletemode = strtoupper($prefixforautocompletemode).'_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT
8150 8150
 
8151
-		dol_syslog(get_class($this) . "::selectForForms filter=" . $filter, LOG_DEBUG);
8151
+		dol_syslog(get_class($this)."::selectForForms filter=".$filter, LOG_DEBUG);
8152 8152
 
8153 8153
 		// Generate the combo HTML component
8154 8154
 		$out = '';
@@ -8162,13 +8162,13 @@  discard block
 block discarded – undo
8162 8162
 			}
8163 8163
 
8164 8164
 			// Set url and param to call to get json of the search results
8165
-			$urlforajaxcall = DOL_URL_ROOT . '/core/ajax/selectobject.php';
8166
-			$urloption = 'htmlname=' . urlencode($htmlname) . '&outjson=1&objectdesc=' . urlencode($objectdescorig) . '&objectfield='.urlencode($objectfield) . ($sortfield ? '&sortfield=' . urlencode($sortfield) : '');
8165
+			$urlforajaxcall = DOL_URL_ROOT.'/core/ajax/selectobject.php';
8166
+			$urloption = 'htmlname='.urlencode($htmlname).'&outjson=1&objectdesc='.urlencode($objectdescorig).'&objectfield='.urlencode($objectfield).($sortfield ? '&sortfield='.urlencode($sortfield) : '');
8167 8167
 
8168 8168
 			// Activate the auto complete using ajax call.
8169 8169
 			$out .= ajax_autocompleter($preselectedvalue, $htmlname, $urlforajaxcall, $urloption, getDolGlobalString($confkeyforautocompletemode), 0, array());
8170 8170
 			$out .= '<!-- force css to be higher than dialog popup --><style type="text/css">.ui-autocomplete { z-index: 1010; }</style>';
8171
-			$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) . '"' : '') . ' />';
8171
+			$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).'"' : '').' />';
8172 8172
 		} else {
8173 8173
 			// Immediate load of table record.
8174 8174
 			$out .= $this->selectForFormsList($objecttmp, $htmlname, $preselectedvalue, $showempty, $searchkey, $placeholder, $morecss, $moreparams, $forcecombo, 0, $disabled, $sortfield, $filter);
@@ -8208,7 +8208,7 @@  discard block
 block discarded – undo
8208 8208
 		if ($prefixforautocompletemode == 'societe') {
8209 8209
 			$prefixforautocompletemode = 'company';
8210 8210
 		}
8211
-		$confkeyforautocompletemode = strtoupper($prefixforautocompletemode) . '_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT
8211
+		$confkeyforautocompletemode = strtoupper($prefixforautocompletemode).'_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT
8212 8212
 
8213 8213
 		if (!empty($objecttmp->fields)) {    // For object that declare it, it is better to use declared fields (like societe, contact, ...)
8214 8214
 			$tmpfieldstoshow = '';
@@ -8217,7 +8217,7 @@  discard block
 block discarded – undo
8217 8217
 					continue;
8218 8218
 				}
8219 8219
 				if (!empty($val['showoncombobox'])) {
8220
-					$tmpfieldstoshow .= ($tmpfieldstoshow ? ',' : '') . 't.' . $key;
8220
+					$tmpfieldstoshow .= ($tmpfieldstoshow ? ',' : '').'t.'.$key;
8221 8221
 				}
8222 8222
 			}
8223 8223
 			if ($tmpfieldstoshow) {
@@ -8245,18 +8245,18 @@  discard block
 block discarded – undo
8245 8245
 		$num = 0;
8246 8246
 
8247 8247
 		// Search data
8248
-		$sql = "SELECT t.rowid, " . $fieldstoshow . " FROM " . $this->db->prefix() . $objecttmp->table_element . " as t";
8248
+		$sql = "SELECT t.rowid, ".$fieldstoshow." FROM ".$this->db->prefix().$objecttmp->table_element." as t";
8249 8249
 		if (!empty($objecttmp->isextrafieldmanaged)) {
8250
-			$sql .= " LEFT JOIN " . $this->db->prefix() . $objecttmp->table_element . "_extrafields as e ON t.rowid=e.fk_object";
8250
+			$sql .= " LEFT JOIN ".$this->db->prefix().$objecttmp->table_element."_extrafields as e ON t.rowid=e.fk_object";
8251 8251
 		}
8252 8252
 		if (isset($objecttmp->ismultientitymanaged)) {
8253 8253
 			if (!is_numeric($objecttmp->ismultientitymanaged)) {
8254 8254
 				$tmparray = explode('@', $objecttmp->ismultientitymanaged);
8255
-				$sql .= " INNER JOIN " . $this->db->prefix() . $tmparray[1] . " as parenttable ON parenttable.rowid = t." . $tmparray[0];
8255
+				$sql .= " INNER JOIN ".$this->db->prefix().$tmparray[1]." as parenttable ON parenttable.rowid = t.".$tmparray[0];
8256 8256
 			}
8257 8257
 			if ($objecttmp->ismultientitymanaged === 'fk_soc@societe') {
8258 8258
 				if (!$user->hasRight('societe', 'client', 'voir')) {
8259
-					$sql .= ", " . $this->db->prefix() . "societe_commerciaux as sc";
8259
+					$sql .= ", ".$this->db->prefix()."societe_commerciaux as sc";
8260 8260
 				}
8261 8261
 			}
8262 8262
 		}
@@ -8276,21 +8276,21 @@  discard block
 block discarded – undo
8276 8276
 			$sql .= " WHERE 1=1";
8277 8277
 			if (isset($objecttmp->ismultientitymanaged)) {
8278 8278
 				if ($objecttmp->ismultientitymanaged == 1) {
8279
-					$sql .= " AND t.entity IN (" . getEntity($objecttmp->table_element) . ")";
8279
+					$sql .= " AND t.entity IN (".getEntity($objecttmp->table_element).")";
8280 8280
 				}
8281 8281
 				if (!is_numeric($objecttmp->ismultientitymanaged)) {
8282
-					$sql .= " AND parenttable.entity = t." . $tmparray[0];
8282
+					$sql .= " AND parenttable.entity = t.".$tmparray[0];
8283 8283
 				}
8284 8284
 				if ($objecttmp->ismultientitymanaged == 1 && !empty($user->socid)) {
8285 8285
 					if ($objecttmp->element == 'societe') {
8286
-						$sql .= " AND t.rowid = " . ((int) $user->socid);
8286
+						$sql .= " AND t.rowid = ".((int) $user->socid);
8287 8287
 					} else {
8288
-						$sql .= " AND t.fk_soc = " . ((int) $user->socid);
8288
+						$sql .= " AND t.fk_soc = ".((int) $user->socid);
8289 8289
 					}
8290 8290
 				}
8291 8291
 				if ($objecttmp->ismultientitymanaged === 'fk_soc@societe') {
8292 8292
 					if (!$user->hasRight('societe', 'client', 'voir')) {
8293
-						$sql .= " AND t.rowid = sc.fk_soc AND sc.fk_user = " . ((int) $user->id);
8293
+						$sql .= " AND t.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
8294 8294
 					}
8295 8295
 				}
8296 8296
 			}
@@ -8302,7 +8302,7 @@  discard block
 block discarded – undo
8302 8302
 				$errormessage = '';
8303 8303
 				$sql .= forgeSQLFromUniversalSearchCriteria($filter, $errormessage);
8304 8304
 				if ($errormessage) {
8305
-					return 'Error forging a SQL request from an universal criteria: ' . $errormessage;
8305
+					return 'Error forging a SQL request from an universal criteria: '.$errormessage;
8306 8306
 				}
8307 8307
 			}
8308 8308
 		}
@@ -8314,7 +8314,7 @@  discard block
 block discarded – undo
8314 8314
 		$resql = $this->db->query($sql);
8315 8315
 		if ($resql) {
8316 8316
 			// Construct $out and $outarray
8317
-			$out .= '<select id="' . $htmlname . '" class="flat minwidth100' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ($moreparams ? ' ' . $moreparams : '') . ' name="' . $htmlname . '">' . "\n";
8317
+			$out .= '<select id="'.$htmlname.'" class="flat minwidth100'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').($moreparams ? ' '.$moreparams : '').' name="'.$htmlname.'">'."\n";
8318 8318
 
8319 8319
 			// 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
8320 8320
 			$textifempty = '&nbsp;';
@@ -8328,7 +8328,7 @@  discard block
 block discarded – undo
8328 8328
 				}
8329 8329
 			}
8330 8330
 			if ($showempty) {
8331
-				$out .= '<option value="-1">' . $textifempty . '</option>' . "\n";
8331
+				$out .= '<option value="-1">'.$textifempty.'</option>'."\n";
8332 8332
 			}
8333 8333
 
8334 8334
 			$num = $this->db->num_rows($resql);
@@ -8351,9 +8351,9 @@  discard block
 block discarded – undo
8351 8351
 					}
8352 8352
 					if (empty($outputmode)) {
8353 8353
 						if ($preselectedvalue > 0 && $preselectedvalue == $obj->rowid) {
8354
-							$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>';
8354
+							$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>';
8355 8355
 						} else {
8356
-							$out .= '<option value="' . $obj->rowid . '" data-html="' . dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1) . '">' . dol_escape_htmltag($label, 0, 0, '', 0, 1) . '</option>';
8356
+							$out .= '<option value="'.$obj->rowid.'" data-html="'.dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1).'">'.dol_escape_htmltag($label, 0, 0, '', 0, 1).'</option>';
8357 8357
 						}
8358 8358
 					} else {
8359 8359
 						array_push($outarray, array('key' => $obj->rowid, 'value' => $label, 'label' => $label));
@@ -8366,10 +8366,10 @@  discard block
 block discarded – undo
8366 8366
 				}
8367 8367
 			}
8368 8368
 
8369
-			$out .= '</select>' . "\n";
8369
+			$out .= '</select>'."\n";
8370 8370
 
8371 8371
 			if (!$forcecombo) {
8372
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
8372
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
8373 8373
 				$out .= ajax_combobox($htmlname, null, getDolGlobalInt($confkeyforautocompletemode, 0));
8374 8374
 			}
8375 8375
 		} else {
@@ -8431,8 +8431,8 @@  discard block
 block discarded – undo
8431 8431
 			}
8432 8432
 		}
8433 8433
 		$idname = str_replace(array('[', ']'), array('', ''), $htmlname);
8434
-		$out .= '<select id="' . preg_replace('/^\./', '', $idname) . '" ' . ($disabled ? 'disabled="disabled" ' : '') . 'class="flat ' . (preg_replace('/^\./', '', $htmlname)) . ($morecss ? ' ' . $morecss : '') . ' selectformat"';
8435
-		$out .= ' name="' . preg_replace('/^\./', '', $htmlname) . '" ' . ($moreparam ? $moreparam : '');
8434
+		$out .= '<select id="'.preg_replace('/^\./', '', $idname).'" '.($disabled ? 'disabled="disabled" ' : '').'class="flat '.(preg_replace('/^\./', '', $htmlname)).($morecss ? ' '.$morecss : '').' selectformat"';
8435
+		$out .= ' name="'.preg_replace('/^\./', '', $htmlname).'" '.($moreparam ? $moreparam : '');
8436 8436
 		$out .= '>'."\n";
8437 8437
 
8438 8438
 		if ($show_empty) {
@@ -8443,7 +8443,7 @@  discard block
 block discarded – undo
8443 8443
 			if (!is_numeric($show_empty)) {
8444 8444
 				$textforempty = $show_empty;
8445 8445
 			}
8446
-			$out .= '<option class="optiongrey" ' . ($moreparamonempty ? $moreparamonempty . ' ' : '') . 'value="' . (((int) $show_empty) < 0 ? $show_empty : -1) . '"' . ($id == $show_empty ? ' selected' : '') . '>' . $textforempty . '</option>' . "\n";
8446
+			$out .= '<option class="optiongrey" '.($moreparamonempty ? $moreparamonempty.' ' : '').'value="'.(((int) $show_empty) < 0 ? $show_empty : -1).'"'.($id == $show_empty ? ' selected' : '').'>'.$textforempty.'</option>'."\n";
8447 8447
 		}
8448 8448
 		if (is_array($array)) {
8449 8449
 			// Translate
@@ -8466,7 +8466,7 @@  discard block
 block discarded – undo
8466 8466
 				if (is_array($tmpvalue)) {
8467 8467
 					$value = $tmpvalue['label'];
8468 8468
 					$disabled = empty($tmpvalue['disabled']) ? '' : ' disabled';
8469
-					$style = empty($tmpvalue['css']) ? '' : ' class="' . $tmpvalue['css'] . '"';
8469
+					$style = empty($tmpvalue['css']) ? '' : ' class="'.$tmpvalue['css'].'"';
8470 8470
 				} else {
8471 8471
 					$value = $tmpvalue;
8472 8472
 					$disabled = '';
@@ -8481,9 +8481,9 @@  discard block
 block discarded – undo
8481 8481
 				}
8482 8482
 				if ($key_in_label) {
8483 8483
 					if (empty($nohtmlescape)) {
8484
-						$selectOptionValue = dol_escape_htmltag($key . ' - ' . ($maxlen ? dol_trunc($value, $maxlen) : $value));
8484
+						$selectOptionValue = dol_escape_htmltag($key.' - '.($maxlen ? dol_trunc($value, $maxlen) : $value));
8485 8485
 					} else {
8486
-						$selectOptionValue = $key . ' - ' . ($maxlen ? dol_trunc($value, $maxlen) : $value);
8486
+						$selectOptionValue = $key.' - '.($maxlen ? dol_trunc($value, $maxlen) : $value);
8487 8487
 					}
8488 8488
 				} else {
8489 8489
 					if (empty($nohtmlescape)) {
@@ -8495,8 +8495,8 @@  discard block
 block discarded – undo
8495 8495
 						$selectOptionValue = '&nbsp;';
8496 8496
 					}
8497 8497
 				}
8498
-				$out .= '<option value="' . $key . '"';
8499
-				$out .= $style . $disabled;
8498
+				$out .= '<option value="'.$key.'"';
8499
+				$out .= $style.$disabled;
8500 8500
 				if (is_array($id)) {
8501 8501
 					if (in_array($key, $id) && !$disabled) {
8502 8502
 						$out .= ' selected'; // To preselect a value
@@ -8508,7 +8508,7 @@  discard block
 block discarded – undo
8508 8508
 					}
8509 8509
 				}
8510 8510
 				if ($nohtmlescape) {
8511
-					$out .= ' data-html="' . dol_escape_htmltag($selectOptionValue) . '"';
8511
+					$out .= ' data-html="'.dol_escape_htmltag($selectOptionValue).'"';
8512 8512
 				}
8513 8513
 				if (is_array($tmpvalue)) {
8514 8514
 					foreach ($tmpvalue as $keyforvalue => $valueforvalue) {
@@ -8526,7 +8526,7 @@  discard block
 block discarded – undo
8526 8526
 		// Add code for jquery to use multiselect
8527 8527
 		if ($addjscombo && $jsbeautify) {
8528 8528
 			// Enhance with select2
8529
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
8529
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
8530 8530
 			$out .= ajax_combobox($idname, array(), 0, 0, 'resolve', (((int) $show_empty) < 0 ? (string) $show_empty : '-1'), $morecss);
8531 8531
 		}
8532 8532
 
@@ -8554,28 +8554,28 @@  discard block
 block discarded – undo
8554 8554
 	public static function selectArrayAjax($htmlname, $url, $id = '', $moreparam = '', $moreparamtourl = '', $disabled = 0, $minimumInputLength = 1, $morecss = '', $callurlonselect = 0, $placeholder = '', $acceptdelayedhtml = 0)
8555 8555
 	{
8556 8556
 		global $conf, $langs;
8557
-		global $delayedhtmlcontent;    // Will be used later outside of this function
8557
+		global $delayedhtmlcontent; // Will be used later outside of this function
8558 8558
 
8559 8559
 		// TODO Use an internal dolibarr component instead of select2
8560 8560
 		if (!getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') && !defined('REQUIRE_JQUERY_MULTISELECT')) {
8561 8561
 			return '';
8562 8562
 		}
8563 8563
 
8564
-		$out = '<select type="text" class="' . $htmlname . ($morecss ? ' ' . $morecss : '') . '" ' . ($moreparam ? $moreparam . ' ' : '') . 'name="' . $htmlname . '"></select>';
8564
+		$out = '<select type="text" class="'.$htmlname.($morecss ? ' '.$morecss : '').'" '.($moreparam ? $moreparam.' ' : '').'name="'.$htmlname.'"></select>';
8565 8565
 
8566 8566
 		$outdelayed = '';
8567 8567
 		if (!empty($conf->use_javascript_ajax)) {
8568 8568
 			$tmpplugin = 'select2';
8569
-			$outdelayed = "\n" . '<!-- JS CODE TO ENABLE ' . $tmpplugin . ' for id ' . $htmlname . ' -->
8570
-		    	<script nonce="' . getNonce() . '">
8569
+			$outdelayed = "\n".'<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' -->
8570
+		    	<script nonce="' . getNonce().'">
8571 8571
 		    	$(document).ready(function () {
8572 8572
 
8573
-	    	        ' . ($callurlonselect ? 'var saveRemoteData = [];' : '') . '
8573
+	    	        ' . ($callurlonselect ? 'var saveRemoteData = [];' : '').'
8574 8574
 
8575
-	                $(".' . $htmlname . '").select2({
8575
+	                $(".' . $htmlname.'").select2({
8576 8576
 				    	ajax: {
8577 8577
 					    	dir: "ltr",
8578
-					    	url: "' . $url . '",
8578
+					    	url: "' . $url.'",
8579 8579
 					    	dataType: \'json\',
8580 8580
 					    	delay: 250,
8581 8581
 					    	data: function (params) {
@@ -8602,9 +8602,9 @@  discard block
 block discarded – undo
8602 8602
 				    	},
8603 8603
 		 				language: select2arrayoflanguage,
8604 8604
 						containerCssClass: \':all:\',					/* Line to add class of origin SELECT propagated to the new <span class="select2-selection...> tag */
8605
-					    placeholder: "' . dol_escape_js($placeholder) . '",
8605
+					    placeholder: "' . dol_escape_js($placeholder).'",
8606 8606
 				    	escapeMarkup: function (markup) { return markup; }, 	// let our custom formatter work
8607
-				    	minimumInputLength: ' . ((int) $minimumInputLength) . ',
8607
+				    	minimumInputLength: ' . ((int) $minimumInputLength).',
8608 8608
 				        formatResult: function (result, container, query, escapeMarkup) {
8609 8609
 	                        return escapeMarkup(result.text);
8610 8610
 	                    },
@@ -8612,10 +8612,10 @@  discard block
 block discarded – undo
8612 8612
 
8613 8613
 	                ' . ($callurlonselect ? '
8614 8614
 	                /* Code to execute a GET when we select a value */
8615
-	                $(".' . $htmlname . '").change(function() {
8616
-				    	var selected = $(".' . $htmlname . '").val();
8615
+	                $(".' . $htmlname.'").change(function() {
8616
+				    	var selected = $(".' . $htmlname.'").val();
8617 8617
 	                	console.log("We select in selectArrayAjax the entry "+selected)
8618
-				        $(".' . $htmlname . '").val("");  /* reset visible combo value */
8618
+				        $(".' . $htmlname.'").val("");  /* reset visible combo value */
8619 8619
 	    			    $.each( saveRemoteData, function( key, value ) {
8620 8620
 	    				        if (key == selected)
8621 8621
 	    			            {
@@ -8623,7 +8623,7 @@  discard block
 block discarded – undo
8623 8623
 	    			                 location.assign(value.url);
8624 8624
 	    			            }
8625 8625
 	                    });
8626
-	    			});' : '') . '
8626
+	    			});' : '').'
8627 8627
 
8628 8628
 	    	   });
8629 8629
 		       </script>';
@@ -8659,14 +8659,14 @@  discard block
 block discarded – undo
8659 8659
 	public static function selectArrayFilter($htmlname, $array, $id = '', $moreparam = '', $disableFiltering = 0, $disabled = 0, $minimumInputLength = 1, $morecss = '', $callurlonselect = 0, $placeholder = '', $acceptdelayedhtml = 0, $textfortitle = '')
8660 8660
 	{
8661 8661
 		global $conf, $langs;
8662
-		global $delayedhtmlcontent;    // Will be used later outside of this function
8662
+		global $delayedhtmlcontent; // Will be used later outside of this function
8663 8663
 
8664 8664
 		// TODO Use an internal dolibarr component instead of select2
8665 8665
 		if (!getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') && !defined('REQUIRE_JQUERY_MULTISELECT')) {
8666 8666
 			return '';
8667 8667
 		}
8668 8668
 
8669
-		$out = '<select type="text"'.($textfortitle ? ' title="'.dol_escape_htmltag($textfortitle).'"' : '').' id="'.$htmlname.'" class="'.$htmlname.($morecss ? ' ' . $morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.'"><option></option></select>';
8669
+		$out = '<select type="text"'.($textfortitle ? ' title="'.dol_escape_htmltag($textfortitle).'"' : '').' id="'.$htmlname.'" class="'.$htmlname.($morecss ? ' '.$morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.'"><option></option></select>';
8670 8670
 
8671 8671
 		$formattedarrayresult = array();
8672 8672
 
@@ -8681,20 +8681,20 @@  discard block
 block discarded – undo
8681 8681
 		$outdelayed = '';
8682 8682
 		if (!empty($conf->use_javascript_ajax)) {
8683 8683
 			$tmpplugin = 'select2';
8684
-			$outdelayed = "\n" . '<!-- JS CODE TO ENABLE ' . $tmpplugin . ' for id ' . $htmlname . ' -->
8685
-				<script nonce="' . getNonce() . '">
8684
+			$outdelayed = "\n".'<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' -->
8685
+				<script nonce="' . getNonce().'">
8686 8686
 				$(document).ready(function () {
8687
-					var data = ' . json_encode($formattedarrayresult) . ';
8687
+					var data = ' . json_encode($formattedarrayresult).';
8688 8688
 
8689
-					' . ($callurlonselect ? 'var saveRemoteData = ' . json_encode($array) . ';' : '') . '
8689
+					' . ($callurlonselect ? 'var saveRemoteData = '.json_encode($array).';' : '').'
8690 8690
 
8691
-					$(".' . $htmlname . '").select2({
8691
+					$(".' . $htmlname.'").select2({
8692 8692
 						data: data,
8693 8693
 						language: select2arrayoflanguage,
8694 8694
 						containerCssClass: \':all:\',					/* Line to add class of origin SELECT propagated to the new <span class="select2-selection...> tag */
8695
-						placeholder: "' . dol_escape_js($placeholder) . '",
8695
+						placeholder: "' . dol_escape_js($placeholder).'",
8696 8696
 						escapeMarkup: function (markup) { return markup; }, 	// let our custom formatter work
8697
-						minimumInputLength: ' . $minimumInputLength . ',
8697
+						minimumInputLength: ' . $minimumInputLength.',
8698 8698
 						formatResult: function (result, container, query, escapeMarkup) {
8699 8699
 							return escapeMarkup(result.text);
8700 8700
 						},
@@ -8733,11 +8733,11 @@  discard block
 block discarded – undo
8733 8733
 
8734 8734
 					' . ($callurlonselect ? '
8735 8735
 					/* Code to execute a GET when we select a value */
8736
-					$(".' . $htmlname . '").change(function() {
8737
-						var selected = $(".' . $htmlname . '").val();
8736
+					$(".' . $htmlname.'").change(function() {
8737
+						var selected = $(".' . $htmlname.'").val();
8738 8738
 						console.log("We select "+selected)
8739 8739
 
8740
-						$(".' . $htmlname . '").val("");  /* reset visible combo value */
8740
+						$(".' . $htmlname.'").val("");  /* reset visible combo value */
8741 8741
 						$.each( saveRemoteData, function( key, value ) {
8742 8742
 							if (key == selected)
8743 8743
 							{
@@ -8745,7 +8745,7 @@  discard block
 block discarded – undo
8745 8745
 								location.assign(value.url);
8746 8746
 							}
8747 8747
 						});
8748
-					});' : '') . '
8748
+					});' : '').'
8749 8749
 
8750 8750
 				});
8751 8751
 				</script>';
@@ -8794,7 +8794,7 @@  discard block
 block discarded – undo
8794 8794
 		$useenhancedmultiselect = 0;
8795 8795
 		if (!empty($conf->use_javascript_ajax) && (getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') || defined('REQUIRE_JQUERY_MULTISELECT'))) {
8796 8796
 			if ($addjscombo) {
8797
-				$useenhancedmultiselect = 1;	// Use the js multiselect in one line. Possible only if $addjscombo not 0.
8797
+				$useenhancedmultiselect = 1; // Use the js multiselect in one line. Possible only if $addjscombo not 0.
8798 8798
 			}
8799 8799
 		}
8800 8800
 
@@ -8803,7 +8803,7 @@  discard block
 block discarded – undo
8803 8803
 		// submitted to nothing.
8804 8804
 		$out .= '<input type="hidden" name="'.$htmlname.'_multiselect" value="1">';
8805 8805
 		// Output select component
8806
-		$out .= '<select id="' . $htmlname . '" class="multiselect' . ($useenhancedmultiselect ? ' multiselectononeline' : '') . ($morecss ? ' ' . $morecss : '') . '" multiple name="' . $htmlname . '[]"' . ($moreattrib ? ' ' . $moreattrib : '') . ($width ? ' style="width: ' . (preg_match('/%/', $width) ? $width : $width . 'px') . '"' : '') . '>' . "\n";
8806
+		$out .= '<select id="'.$htmlname.'" class="multiselect'.($useenhancedmultiselect ? ' multiselectononeline' : '').($morecss ? ' '.$morecss : '').'" multiple name="'.$htmlname.'[]"'.($moreattrib ? ' '.$moreattrib : '').($width ? ' style="width: '.(preg_match('/%/', $width) ? $width : $width.'px').'"' : '').'>'."\n";
8807 8807
 		if (is_array($array) && !empty($array)) {
8808 8808
 			if ($value_as_key) {
8809 8809
 				$array = array_combine($array, $array);
@@ -8824,57 +8824,57 @@  discard block
 block discarded – undo
8824 8824
 						$tmplabelhtml = empty($value['labelhtml']) ? '' : $value['labelhtml'];
8825 8825
 					}
8826 8826
 					$newval = ($translate ? $langs->trans($tmpvalue) : $tmpvalue);
8827
-					$newval = ($key_in_label ? $tmpkey . ' - ' . $newval : $newval);
8827
+					$newval = ($key_in_label ? $tmpkey.' - '.$newval : $newval);
8828 8828
 
8829
-					$out .= '<option value="' . $tmpkey . '"';
8829
+					$out .= '<option value="'.$tmpkey.'"';
8830 8830
 					if (is_array($selected) && !empty($selected) && in_array((string) $tmpkey, $selected) && ((string) $tmpkey != '')) {
8831 8831
 						$out .= ' selected';
8832 8832
 					}
8833 8833
 					if (!empty($tmplabelhtml)) {
8834
-						$out .= ' data-html="' . dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1) . '"';
8834
+						$out .= ' data-html="'.dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1).'"';
8835 8835
 					} else {
8836
-						$tmplabelhtml = ($tmppicto ? img_picto('', $tmppicto, 'class="pictofixedwidth" style="color: #' . $tmpcolor . '"') : '') . $newval;
8837
-						$out .= ' data-html="' . dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1) . '"';
8836
+						$tmplabelhtml = ($tmppicto ? img_picto('', $tmppicto, 'class="pictofixedwidth" style="color: #'.$tmpcolor.'"') : '').$newval;
8837
+						$out .= ' data-html="'.dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1).'"';
8838 8838
 					}
8839 8839
 					$out .= '>';
8840 8840
 					$out .= dol_htmlentitiesbr($newval);
8841
-					$out .= '</option>' . "\n";
8841
+					$out .= '</option>'."\n";
8842 8842
 				}
8843 8843
 			}
8844 8844
 		}
8845
-		$out .= '</select>' . "\n";
8845
+		$out .= '</select>'."\n";
8846 8846
 
8847 8847
 		// Add code for jquery to use multiselect
8848 8848
 		if (!empty($conf->use_javascript_ajax) && getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') || defined('REQUIRE_JQUERY_MULTISELECT')) {
8849
-			$out .= "\n" . '<!-- JS CODE TO ENABLE select for id ' . $htmlname . ', addjscombo=' . $addjscombo . ' -->';
8850
-			$out .= "\n" . '<script nonce="' . getNonce() . '">' . "\n";
8849
+			$out .= "\n".'<!-- JS CODE TO ENABLE select for id '.$htmlname.', addjscombo='.$addjscombo.' -->';
8850
+			$out .= "\n".'<script nonce="'.getNonce().'">'."\n";
8851 8851
 			if ($addjscombo == 1) {
8852 8852
 				$tmpplugin = !getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') ? constant('REQUIRE_JQUERY_MULTISELECT') : $conf->global->MAIN_USE_JQUERY_MULTISELECT;
8853
-				$out .= 'function formatResult(record, container) {' . "\n";
8853
+				$out .= 'function formatResult(record, container) {'."\n";
8854 8854
 				// If property html set, we decode html entities and use this.
8855 8855
 				// Note that HTML content must have been sanitized from js with dol_escape_htmltag(xxx, 0, 0, '', 0, 1) when building the select option.
8856 8856
 				$out .= '	if ($(record.element).attr("data-html") != undefined) { return htmlEntityDecodeJs($(record.element).attr("data-html")); }'."\n";
8857 8857
 				$out .= '	return record.text;';
8858
-				$out .= '}' . "\n";
8859
-				$out .= 'function formatSelection(record) {' . "\n";
8858
+				$out .= '}'."\n";
8859
+				$out .= 'function formatSelection(record) {'."\n";
8860 8860
 				if ($elemtype == 'category') {
8861
-					$out .= 'return \'<span><img src="' . DOL_URL_ROOT . '/theme/eldy/img/object_category.png"> \'+record.text+\'</span>\';';
8861
+					$out .= 'return \'<span><img src="'.DOL_URL_ROOT.'/theme/eldy/img/object_category.png"> \'+record.text+\'</span>\';';
8862 8862
 				} else {
8863 8863
 					$out .= 'return record.text;';
8864 8864
 				}
8865
-				$out .= '}' . "\n";
8865
+				$out .= '}'."\n";
8866 8866
 				$out .= '$(document).ready(function () {
8867
-							$(\'#' . $htmlname . '\').' . $tmpplugin . '({';
8867
+							$(\'#' . $htmlname.'\').'.$tmpplugin.'({';
8868 8868
 				if ($placeholder) {
8869 8869
 					$out .= '
8870 8870
 								placeholder: {
8871 8871
 								    id: \'-1\',
8872
-								    text: \'' . dol_escape_js($placeholder) . '\'
8872
+								    text: \'' . dol_escape_js($placeholder).'\'
8873 8873
 								  },';
8874 8874
 				}
8875 8875
 				$out .= '		dir: \'ltr\',
8876 8876
 								containerCssClass: \':all:\',					/* Line to add class of origin SELECT propagated to the new <span class="select2-selection...> tag (ko with multiselect) */
8877
-								dropdownCssClass: \'' . $morecss . '\',				/* Line to add class on the new <span class="select2-selection...> tag (ok with multiselect) */
8877
+								dropdownCssClass: \'' . $morecss.'\',				/* Line to add class on the new <span class="select2-selection...> tag (ok with multiselect) */
8878 8878
 								// Specify format function for dropdown item
8879 8879
 								formatResult: formatResult,
8880 8880
 							 	templateResult: formatResult,		/* For 4.0 */
@@ -8886,21 +8886,21 @@  discard block
 block discarded – undo
8886 8886
 
8887 8887
 							/* Add also morecss to the css .select2 that is after the #htmlname, for component that are show dynamically after load, because select2 set
8888 8888
 								 the size only if component is not hidden by default on load */
8889
-							$(\'#' . $htmlname . ' + .select2\').addClass(\'' . $morecss . '\');
8889
+							$(\'#' . $htmlname.' + .select2\').addClass(\''.$morecss.'\');
8890 8890
 						});' . "\n";
8891 8891
 			} elseif ($addjscombo == 2 && !defined('DISABLE_MULTISELECT')) {
8892 8892
 				// Add other js lib
8893 8893
 				// TODO external lib multiselect/jquery.multi-select.js must have been loaded to use this multiselect plugin
8894 8894
 				// ...
8895
-				$out .= 'console.log(\'addjscombo=2 for htmlname=' . $htmlname . '\');';
8895
+				$out .= 'console.log(\'addjscombo=2 for htmlname='.$htmlname.'\');';
8896 8896
 				$out .= '$(document).ready(function () {
8897
-							$(\'#' . $htmlname . '\').multiSelect({
8897
+							$(\'#' . $htmlname.'\').multiSelect({
8898 8898
 								containerHTML: \'<div class="multi-select-container">\',
8899 8899
 								menuHTML: \'<div class="multi-select-menu">\',
8900
-								buttonHTML: \'<span class="multi-select-button ' . $morecss . '">\',
8900
+								buttonHTML: \'<span class="multi-select-button ' . $morecss.'">\',
8901 8901
 								menuItemHTML: \'<label class="multi-select-menuitem">\',
8902 8902
 								activeClass: \'multi-select-container--open\',
8903
-								noneText: \'' . $placeholder . '\'
8903
+								noneText: \'' . $placeholder.'\'
8904 8904
 							});
8905 8905
 						})';
8906 8906
 			}
@@ -8932,7 +8932,7 @@  discard block
 block discarded – undo
8932 8932
 			return '';
8933 8933
 		}
8934 8934
 
8935
-		$tmpvar = "MAIN_SELECTEDFIELDS_" . $varpage; // To get list of saved selected fields to show
8935
+		$tmpvar = "MAIN_SELECTEDFIELDS_".$varpage; // To get list of saved selected fields to show
8936 8936
 
8937 8937
 		if (!empty($user->conf->$tmpvar)) {        // A list of fields was already customized for user
8938 8938
 			$tmparray = explode(',', $user->conf->$tmpvar);
@@ -8975,19 +8975,19 @@  discard block
 block discarded – undo
8975 8975
 				}
8976 8976
 
8977 8977
 				// Note: $val['checked'] <> 0 means we must show the field into the combo list
8978
-				$listoffieldsforselection .= '<li><input type="checkbox" id="checkbox' . $key . '" value="' . $key . '"' . ((empty($val['checked']) || $val['checked'] == '-1') ? '' : ' checked="checked"') . '/><label for="checkbox' . $key . '">' . dol_escape_htmltag($langs->trans($val['label'])) . '</label></li>';
8979
-				$listcheckedstring .= (empty($val['checked']) ? '' : $key . ',');
8978
+				$listoffieldsforselection .= '<li><input type="checkbox" id="checkbox'.$key.'" value="'.$key.'"'.((empty($val['checked']) || $val['checked'] == '-1') ? '' : ' checked="checked"').'/><label for="checkbox'.$key.'">'.dol_escape_htmltag($langs->trans($val['label'])).'</label></li>';
8979
+				$listcheckedstring .= (empty($val['checked']) ? '' : $key.',');
8980 8980
 			}
8981 8981
 		}
8982 8982
 
8983
-		$out = '<!-- Component multiSelectArrayWithCheckbox ' . $htmlname . ' -->
8983
+		$out = '<!-- Component multiSelectArrayWithCheckbox '.$htmlname.' -->
8984 8984
 
8985 8985
         <dl class="dropdown">
8986 8986
             <dt>
8987
-            <a href="#' . $htmlname . '">
8988
-              ' . img_picto('', 'list') . '
8987
+            <a href="#' . $htmlname.'">
8988
+              ' . img_picto('', 'list').'
8989 8989
             </a>
8990
-            <input type="hidden" class="' . $htmlname . '" name="' . $htmlname . '" value="' . $listcheckedstring . '">
8990
+            <input type="hidden" class="' . $htmlname.'" name="'.$htmlname.'" value="'.$listcheckedstring.'">
8991 8991
             </dt>
8992 8992
             <dd class="dropdowndd">
8993 8993
                 <div class="multiselectcheckbox'.$htmlname.'">
@@ -8999,19 +8999,19 @@  discard block
 block discarded – undo
8999 8999
             </dd>
9000 9000
         </dl>
9001 9001
 
9002
-        <script nonce="' . getNonce() . '" type="text/javascript">
9002
+        <script nonce="' . getNonce().'" type="text/javascript">
9003 9003
           jQuery(document).ready(function () {
9004
-              $(\'.multiselectcheckbox' . $htmlname . ' input[type="checkbox"]\').on(\'click\', function () {
9004
+              $(\'.multiselectcheckbox' . $htmlname.' input[type="checkbox"]\').on(\'click\', function () {
9005 9005
                   console.log("A new field was added/removed, we edit field input[name=formfilteraction]");
9006 9006
 
9007 9007
                   $("input:hidden[name=formfilteraction]").val(\'listafterchangingselectedfields\');	// Update field so we know we changed something on selected fields after POST
9008 9008
 
9009 9009
                   var title = $(this).val() + ",";
9010 9010
                   if ($(this).is(\':checked\')) {
9011
-                      $(\'.' . $htmlname . '\').val(title + $(\'.' . $htmlname . '\').val());
9011
+                      $(\'.' . $htmlname.'\').val(title + $(\'.'.$htmlname.'\').val());
9012 9012
                   }
9013 9013
                   else {
9014
-                      $(\'.' . $htmlname . '\').val( $(\'.' . $htmlname . '\').val().replace(title, \'\') )
9014
+                      $(\'.' . $htmlname.'\').val( $(\'.'.$htmlname.'\').val().replace(title, \'\') )
9015 9015
                   }
9016 9016
                   // Now, we submit page
9017 9017
                   //$(this).parents(\'form:first\').submit();
@@ -9042,7 +9042,7 @@  discard block
 block discarded – undo
9042 9042
 	 */
9043 9043
 	public function showCategories($id, $type, $rendermode = 0, $nolink = 0)
9044 9044
 	{
9045
-		include_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
9045
+		include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
9046 9046
 
9047 9047
 		$cat = new Categorie($this->db);
9048 9048
 		$categories = $cat->containing($id, $type);
@@ -9052,10 +9052,10 @@  discard block
 block discarded – undo
9052 9052
 			foreach ($categories as $c) {
9053 9053
 				$ways = $c->print_all_ways(' &gt;&gt; ', ($nolink ? 'none' : ''), 0, 1); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text
9054 9054
 				foreach ($ways as $way) {
9055
-					$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #bbb"') . '>' . $way . '</li>';
9055
+					$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #bbb"').'>'.$way.'</li>';
9056 9056
 				}
9057 9057
 			}
9058
-			return '<div class="select2-container-multi-dolibarr"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>';
9058
+			return '<div class="select2-container-multi-dolibarr"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
9059 9059
 		}
9060 9060
 
9061 9061
 		if ($rendermode == 0) {
@@ -9103,15 +9103,15 @@  discard block
 block discarded – undo
9103 9103
 
9104 9104
 
9105 9105
 			print '<div class="div-table-responsive-no-min">';
9106
-			print '<table class="noborder allwidth" data-block="showLinkedObject" data-element="' . $object->element . '"  data-elementid="' . $object->id . '"   >';
9106
+			print '<table class="noborder allwidth" data-block="showLinkedObject" data-element="'.$object->element.'"  data-elementid="'.$object->id.'"   >';
9107 9107
 
9108 9108
 			print '<tr class="liste_titre">';
9109
-			print '<td>' . $langs->trans("Type") . '</td>';
9110
-			print '<td>' . $langs->trans("Ref") . '</td>';
9109
+			print '<td>'.$langs->trans("Type").'</td>';
9110
+			print '<td>'.$langs->trans("Ref").'</td>';
9111 9111
 			print '<td class="center"></td>';
9112
-			print '<td class="center">' . $langs->trans("Date") . '</td>';
9113
-			print '<td class="right">' . $langs->trans("AmountHTShort") . '</td>';
9114
-			print '<td class="right">' . $langs->trans("Status") . '</td>';
9112
+			print '<td class="center">'.$langs->trans("Date").'</td>';
9113
+			print '<td class="right">'.$langs->trans("AmountHTShort").'</td>';
9114
+			print '<td class="right">'.$langs->trans("Status").'</td>';
9115 9115
 			print '<td></td>';
9116 9116
 			print '</tr>';
9117 9117
 
@@ -9130,13 +9130,13 @@  discard block
 block discarded – undo
9130 9130
 				if ($objecttype != 'supplier_proposal' && preg_match('/^([^_]+)_([^_]+)/i', $objecttype, $regs)) {
9131 9131
 					$element = $regs[1];
9132 9132
 					$subelement = $regs[2];
9133
-					$tplpath = $element . '/' . $subelement;
9133
+					$tplpath = $element.'/'.$subelement;
9134 9134
 				}
9135 9135
 				$tplname = 'linkedobjectblock';
9136 9136
 
9137 9137
 				// To work with non standard path
9138 9138
 				if ($objecttype == 'facture') {
9139
-					$tplpath = 'compta/' . $element;
9139
+					$tplpath = 'compta/'.$element;
9140 9140
 					if (!isModEnabled('facture')) {
9141 9141
 						continue; // Do not show if module disabled
9142 9142
 					}
@@ -9147,7 +9147,7 @@  discard block
 block discarded – undo
9147 9147
 						continue; // Do not show if module disabled
9148 9148
 					}
9149 9149
 				} elseif ($objecttype == 'propal') {
9150
-					$tplpath = 'comm/' . $element;
9150
+					$tplpath = 'comm/'.$element;
9151 9151
 					if (!isModEnabled('propal')) {
9152 9152
 						continue; // Do not show if module disabled
9153 9153
 					}
@@ -9198,14 +9198,14 @@  discard block
 block discarded – undo
9198 9198
 				$linkedObjectBlock = $objects;
9199 9199
 
9200 9200
 				// Output template part (modules that overwrite templates must declare this into descriptor)
9201
-				$dirtpls = array_merge($conf->modules_parts['tpl'], array('/' . $tplpath . '/tpl'));
9201
+				$dirtpls = array_merge($conf->modules_parts['tpl'], array('/'.$tplpath.'/tpl'));
9202 9202
 				foreach ($dirtpls as $reldir) {
9203 9203
 					if ($nboftypesoutput == ($nbofdifferenttypes - 1)) {    // No more type to show after
9204 9204
 						global $noMoreLinkedObjectBlockAfter;
9205 9205
 						$noMoreLinkedObjectBlockAfter = 1;
9206 9206
 					}
9207 9207
 
9208
-					$res = @include dol_buildpath($reldir . '/' . $tplname . '.tpl.php');
9208
+					$res = @include dol_buildpath($reldir.'/'.$tplname.'.tpl.php');
9209 9209
 					if ($res) {
9210 9210
 						$nboftypesoutput++;
9211 9211
 						break;
@@ -9214,7 +9214,7 @@  discard block
 block discarded – undo
9214 9214
 			}
9215 9215
 
9216 9216
 			if (!$nboftypesoutput) {
9217
-				print '<tr><td class="impair" colspan="7"><span class="opacitymedium">' . $langs->trans("None") . '</span></td></tr>';
9217
+				print '<tr><td class="impair" colspan="7"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
9218 9218
 			}
9219 9219
 
9220 9220
 			print '</table>';
@@ -9254,14 +9254,14 @@  discard block
 block discarded – undo
9254 9254
 		if (is_object($object->thirdparty) && !empty($object->thirdparty->id) && $object->thirdparty->id > 0) {
9255 9255
 			$listofidcompanytoscan = $object->thirdparty->id;
9256 9256
 			if (($object->thirdparty->parent > 0) && getDolGlobalString('THIRDPARTY_INCLUDE_PARENT_IN_LINKTO')) {
9257
-				$listofidcompanytoscan .= ',' . $object->thirdparty->parent;
9257
+				$listofidcompanytoscan .= ','.$object->thirdparty->parent;
9258 9258
 			}
9259 9259
 			if (($object->fk_project > 0) && getDolGlobalString('THIRDPARTY_INCLUDE_PROJECT_THIRDPARY_IN_LINKTO')) {
9260
-				include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
9260
+				include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
9261 9261
 				$tmpproject = new Project($this->db);
9262 9262
 				$tmpproject->fetch($object->fk_project);
9263 9263
 				if ($tmpproject->socid > 0 && ($tmpproject->socid != $object->thirdparty->id)) {
9264
-					$listofidcompanytoscan .= ',' . $tmpproject->socid;
9264
+					$listofidcompanytoscan .= ','.$tmpproject->socid;
9265 9265
 				}
9266 9266
 				unset($tmpproject);
9267 9267
 			}
@@ -9271,63 +9271,63 @@  discard block
 block discarded – undo
9271 9271
 					'enabled' => isModEnabled('propal'),
9272 9272
 					'perms' => 1,
9273 9273
 					'label' => 'LinkToProposal',
9274
-					'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') . ')'),
9274
+					'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').')'),
9275 9275
 				'shipping' => array(
9276 9276
 					'enabled' => isModEnabled('expedition'),
9277 9277
 					'perms' => 1,
9278 9278
 					'label' => 'LinkToExpedition',
9279
-					'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') . ')'),
9279
+					'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').')'),
9280 9280
 				'order' => array(
9281 9281
 					'enabled' => isModEnabled('commande'),
9282 9282
 					'perms' => 1,
9283 9283
 					'label' => 'LinkToOrder',
9284
-					'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') . ')'),
9284
+					'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').')'),
9285 9285
 				'invoice' => array(
9286 9286
 					'enabled' => isModEnabled('facture'),
9287 9287
 					'perms' => 1,
9288 9288
 					'label' => 'LinkToInvoice',
9289
-					'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') . ')'),
9289
+					'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').')'),
9290 9290
 				'invoice_template' => array(
9291 9291
 					'enabled' => isModEnabled('facture'),
9292 9292
 					'perms' => 1,
9293 9293
 					'label' => 'LinkToTemplateInvoice',
9294
-					'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') . ')'),
9294
+					'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').')'),
9295 9295
 				'contrat' => array(
9296 9296
 					'enabled' => isModEnabled('contrat'),
9297 9297
 					'perms' => 1,
9298 9298
 					'label' => 'LinkToContract',
9299 9299
 					'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
9300
-							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'
9300
+							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'
9301 9301
 				),
9302 9302
 				'fichinter' => array(
9303 9303
 					'enabled' => isModEnabled('ficheinter'),
9304 9304
 					'perms' => 1,
9305 9305
 					'label' => 'LinkToIntervention',
9306
-					'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') . ')'),
9306
+					'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').')'),
9307 9307
 				'supplier_proposal' => array(
9308 9308
 					'enabled' => isModEnabled('supplier_proposal'),
9309 9309
 					'perms' => 1,
9310 9310
 					'label' => 'LinkToSupplierProposal',
9311
-					'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') . ')'),
9311
+					'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').')'),
9312 9312
 				'order_supplier' => array(
9313 9313
 					'enabled' => isModEnabled("supplier_order"),
9314 9314
 					'perms' => 1,
9315 9315
 					'label' => 'LinkToSupplierOrder',
9316
-					'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') . ')'),
9316
+					'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').')'),
9317 9317
 				'invoice_supplier' => array(
9318 9318
 					'enabled' => isModEnabled("supplier_invoice"),
9319 9319
 					'perms' => 1, 'label' => 'LinkToSupplierInvoice',
9320
-					'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') . ')'),
9320
+					'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').')'),
9321 9321
 				'ticket' => array(
9322 9322
 					'enabled' => isModEnabled('ticket'),
9323 9323
 					'perms' => 1,
9324 9324
 					'label' => 'LinkToTicket',
9325
-					'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') . ')'),
9325
+					'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').')'),
9326 9326
 				'mo' => array(
9327 9327
 					'enabled' => isModEnabled('mrp'),
9328 9328
 					'perms' => 1,
9329 9329
 					'label' => 'LinkToMo',
9330
-					'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') . ')')
9330
+					'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').')')
9331 9331
 			);
9332 9332
 		}
9333 9333
 
@@ -9362,22 +9362,22 @@  discard block
 block discarded – undo
9362 9362
 			}
9363 9363
 
9364 9364
 			if (!empty($possiblelink['perms']) && (empty($restrictlinksto) || in_array($key, $restrictlinksto)) && (empty($excludelinksto) || !in_array($key, $excludelinksto))) {
9365
-				print '<div id="' . $key . 'list"' . (empty($conf->use_javascript_ajax) ? '' : ' style="display:none"') . '>';
9365
+				print '<div id="'.$key.'list"'.(empty($conf->use_javascript_ajax) ? '' : ' style="display:none"').'>';
9366 9366
 
9367 9367
 				if (getDolGlobalString('MAIN_LINK_BY_REF_IN_LINKTO')) {
9368 9368
 					print '<br>'."\n";
9369 9369
 					print '<!-- form to add a link from anywhere -->'."\n";
9370
-					print '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST" name="formlinkedbyref' . $key . '">';
9371
-					print '<input type="hidden" name="id" value="' . $object->id . '">';
9370
+					print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" name="formlinkedbyref'.$key.'">';
9371
+					print '<input type="hidden" name="id" value="'.$object->id.'">';
9372 9372
 					print '<input type="hidden" name="action" value="addlinkbyref">';
9373
-					print '<input type="hidden" name="token" value="' . newToken() . '">';
9374
-					print '<input type="hidden" name="addlink" value="' . $key . '">';
9373
+					print '<input type="hidden" name="token" value="'.newToken().'">';
9374
+					print '<input type="hidden" name="addlink" value="'.$key.'">';
9375 9375
 					print '<table class="noborder">';
9376 9376
 					print '<tr>';
9377 9377
 					//print '<td>' . $langs->trans("Ref") . '</td>';
9378
-					print '<td class="center"><input type="text" placeholder="'.dol_escape_htmltag($langs->trans("Ref")).'" name="reftolinkto" value="' . dol_escape_htmltag(GETPOST('reftolinkto', 'alpha')) . '">&nbsp;';
9379
-					print '<input type="submit" class="button small valignmiddle" value="' . $langs->trans('ToLink') . '">&nbsp;';
9380
-					print '<input type="submit" class="button small" name="cancel" value="' . $langs->trans('Cancel') . '"></td>';
9378
+					print '<td class="center"><input type="text" placeholder="'.dol_escape_htmltag($langs->trans("Ref")).'" name="reftolinkto" value="'.dol_escape_htmltag(GETPOST('reftolinkto', 'alpha')).'">&nbsp;';
9379
+					print '<input type="submit" class="button small valignmiddle" value="'.$langs->trans('ToLink').'">&nbsp;';
9380
+					print '<input type="submit" class="button small" name="cancel" value="'.$langs->trans('Cancel').'"></td>';
9381 9381
 					print '</tr>';
9382 9382
 					print '</table>';
9383 9383
 					print '</form>';
@@ -9392,48 +9392,48 @@  discard block
 block discarded – undo
9392 9392
 
9393 9393
 					print '<br>';
9394 9394
 					print '<!-- form to add a link from object to same thirdparty -->'."\n";
9395
-					print '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST" name="formlinked' . $key . '">';
9395
+					print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" name="formlinked'.$key.'">';
9396 9396
 					print '<input type="hidden" name="action" value="addlink">';
9397
-					print '<input type="hidden" name="token" value="' . newToken() . '">';
9398
-					print '<input type="hidden" name="id" value="' . $object->id . '">';
9399
-					print '<input type="hidden" name="addlink" value="' . $key . '">';
9397
+					print '<input type="hidden" name="token" value="'.newToken().'">';
9398
+					print '<input type="hidden" name="id" value="'.$object->id.'">';
9399
+					print '<input type="hidden" name="addlink" value="'.$key.'">';
9400 9400
 					print '<table class="noborder">';
9401 9401
 					print '<tr class="liste_titre">';
9402 9402
 					print '<td class="nowrap"></td>';
9403
-					print '<td class="center">' . $langs->trans("Ref") . '</td>';
9404
-					print '<td class="left">' . $langs->trans("RefCustomer") . '</td>';
9405
-					print '<td class="right">' . $langs->trans("AmountHTShort") . '</td>';
9406
-					print '<td class="left">' . $langs->trans("Company") . '</td>';
9403
+					print '<td class="center">'.$langs->trans("Ref").'</td>';
9404
+					print '<td class="left">'.$langs->trans("RefCustomer").'</td>';
9405
+					print '<td class="right">'.$langs->trans("AmountHTShort").'</td>';
9406
+					print '<td class="left">'.$langs->trans("Company").'</td>';
9407 9407
 					print '</tr>';
9408 9408
 					while ($i < $num) {
9409 9409
 						$objp = $this->db->fetch_object($resqllist);
9410 9410
 
9411 9411
 						print '<tr class="oddeven">';
9412 9412
 						print '<td class="left">';
9413
-						print '<input type="radio" name="idtolinkto" id="' . $key . '_' . $objp->rowid . '" value="' . $objp->rowid . '">';
9413
+						print '<input type="radio" name="idtolinkto" id="'.$key.'_'.$objp->rowid.'" value="'.$objp->rowid.'">';
9414 9414
 						print '</td>';
9415
-						print '<td class="center"><label for="' . $key . '_' . $objp->rowid . '">' . $objp->ref . '</label></td>';
9416
-						print '<td>' . (!empty($objp->ref_client) ? $objp->ref_client : (!empty($objp->ref_supplier) ? $objp->ref_supplier : '')) . '</td>';
9415
+						print '<td class="center"><label for="'.$key.'_'.$objp->rowid.'">'.$objp->ref.'</label></td>';
9416
+						print '<td>'.(!empty($objp->ref_client) ? $objp->ref_client : (!empty($objp->ref_supplier) ? $objp->ref_supplier : '')).'</td>';
9417 9417
 						print '<td class="right">';
9418 9418
 						if ($possiblelink['label'] == 'LinkToContract') {
9419 9419
 							$form = new Form($this->db);
9420
-							print $form->textwithpicto('', $langs->trans("InformationOnLinkToContract")) . ' ';
9420
+							print $form->textwithpicto('', $langs->trans("InformationOnLinkToContract")).' ';
9421 9421
 						}
9422
-						print '<span class="amount">' . (isset($objp->total_ht) ? price($objp->total_ht) : '') . '</span>';
9422
+						print '<span class="amount">'.(isset($objp->total_ht) ? price($objp->total_ht) : '').'</span>';
9423 9423
 						print '</td>';
9424
-						print '<td>' . $objp->name . '</td>';
9424
+						print '<td>'.$objp->name.'</td>';
9425 9425
 						print '</tr>';
9426 9426
 						$i++;
9427 9427
 					}
9428 9428
 					print '</table>';
9429 9429
 					print '<div class="center">';
9430 9430
 					if ($num) {
9431
-						print '<input type="submit" class="button valignmiddle marginleftonly marginrightonly small" value="' . $langs->trans('ToLink') . '">';
9431
+						print '<input type="submit" class="button valignmiddle marginleftonly marginrightonly small" value="'.$langs->trans('ToLink').'">';
9432 9432
 					}
9433 9433
 					if (empty($conf->use_javascript_ajax)) {
9434
-						print '<input type="submit" class="button button-cancel marginleftonly marginrightonly small" name="cancel" value="' . $langs->trans("Cancel") . '"></div>';
9434
+						print '<input type="submit" class="button button-cancel marginleftonly marginrightonly small" name="cancel" value="'.$langs->trans("Cancel").'"></div>';
9435 9435
 					} else {
9436
-						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>';
9436
+						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>';
9437 9437
 					}
9438 9438
 					print '</form>';
9439 9439
 					$this->db->free($resqllist);
@@ -9444,10 +9444,10 @@  discard block
 block discarded – undo
9444 9444
 
9445 9445
 				//$linktoelem.=($linktoelem?' &nbsp; ':'');
9446 9446
 				if ($num > 0 || getDolGlobalString('MAIN_LINK_BY_REF_IN_LINKTO')) {
9447
-					$linktoelemlist .= '<li><a href="#linkto' . $key . '" class="linkto dropdowncloseonclick" rel="' . $key . '">' . $langs->trans($possiblelink['label']) . ' (' . $num . ')</a></li>';
9447
+					$linktoelemlist .= '<li><a href="#linkto'.$key.'" class="linkto dropdowncloseonclick" rel="'.$key.'">'.$langs->trans($possiblelink['label']).' ('.$num.')</a></li>';
9448 9448
 					// } else $linktoelem.=$langs->trans($possiblelink['label']);
9449 9449
 				} else {
9450
-					$linktoelemlist .= '<li><span class="linktodisabled">' . $langs->trans($possiblelink['label']) . ' (0)</span></li>';
9450
+					$linktoelemlist .= '<li><span class="linktodisabled">'.$langs->trans($possiblelink['label']).' (0)</span></li>';
9451 9451
 				}
9452 9452
 			}
9453 9453
 		}
@@ -9457,11 +9457,11 @@  discard block
 block discarded – undo
9457 9457
     		<dl class="dropdown" id="linktoobjectname">
9458 9458
     		';
9459 9459
 			if (!empty($conf->use_javascript_ajax)) {
9460
-				$linktoelem .= '<dt><a href="#linktoobjectname"><span class="fas fa-link paddingrightonly"></span>' . $langs->trans("LinkTo") . '...</a></dt>';
9460
+				$linktoelem .= '<dt><a href="#linktoobjectname"><span class="fas fa-link paddingrightonly"></span>'.$langs->trans("LinkTo").'...</a></dt>';
9461 9461
 			}
9462 9462
 			$linktoelem .= '<dd>
9463 9463
     		<div class="multiselectlinkto">
9464
-    		<ul class="ulselectedfields">' . $linktoelemlist . '
9464
+    		<ul class="ulselectedfields">' . $linktoelemlist.'
9465 9465
     		</ul>
9466 9466
     		</div>
9467 9467
     		</dd>
@@ -9472,7 +9472,7 @@  discard block
 block discarded – undo
9472 9472
 
9473 9473
 		if (!empty($conf->use_javascript_ajax)) {
9474 9474
 			print '<!-- Add js to show linkto box -->
9475
-				<script nonce="' . getNonce() . '">
9475
+				<script nonce="' . getNonce().'">
9476 9476
 				jQuery(document).ready(function() {
9477 9477
 					jQuery(".linkto").click(function() {
9478 9478
 						console.log("We choose to show/hide links for rel="+jQuery(this).attr(\'rel\')+" so #"+jQuery(this).attr(\'rel\')+"list");
@@ -9513,19 +9513,19 @@  discard block
 block discarded – undo
9513 9513
 
9514 9514
 		$disabled = ($disabled ? ' disabled' : '');
9515 9515
 
9516
-		$resultyesno = '<select class="flat width75' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . '"' . $disabled . '>' . "\n";
9516
+		$resultyesno = '<select class="flat width75'.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.'"'.$disabled.'>'."\n";
9517 9517
 		if ($useempty) {
9518
-			$resultyesno .= '<option value="-1"' . (($value < 0) ? ' selected' : '') . '>&nbsp;</option>' . "\n";
9518
+			$resultyesno .= '<option value="-1"'.(($value < 0) ? ' selected' : '').'>&nbsp;</option>'."\n";
9519 9519
 		}
9520 9520
 		if (("$value" == 'yes') || ($value == 1)) {
9521
-			$resultyesno .= '<option value="' . $yes . '" selected>' . $langs->trans($labelyes) . '</option>' . "\n";
9522
-			$resultyesno .= '<option value="' . $no . '">' . $langs->trans($labelno) . '</option>' . "\n";
9521
+			$resultyesno .= '<option value="'.$yes.'" selected>'.$langs->trans($labelyes).'</option>'."\n";
9522
+			$resultyesno .= '<option value="'.$no.'">'.$langs->trans($labelno).'</option>'."\n";
9523 9523
 		} else {
9524 9524
 			$selected = (($useempty && $value != '0' && $value != 'no') ? '' : ' selected');
9525
-			$resultyesno .= '<option value="' . $yes . '">' . $langs->trans($labelyes) . '</option>' . "\n";
9526
-			$resultyesno .= '<option value="' . $no . '"' . $selected . '>' . $langs->trans($labelno) . '</option>' . "\n";
9525
+			$resultyesno .= '<option value="'.$yes.'">'.$langs->trans($labelyes).'</option>'."\n";
9526
+			$resultyesno .= '<option value="'.$no.'"'.$selected.'>'.$langs->trans($labelno).'</option>'."\n";
9527 9527
 		}
9528
-		$resultyesno .= '</select>' . "\n";
9528
+		$resultyesno .= '</select>'."\n";
9529 9529
 
9530 9530
 		if ($addjscombo) {
9531 9531
 			$resultyesno .= ajax_combobox($htmlname, array(), 0, 0, 'resolve', ($useempty < 0 ? (string) $useempty : '-1'), $morecss);
@@ -9549,12 +9549,12 @@  discard block
 block discarded – undo
9549 9549
 	{
9550 9550
 		// phpcs:enable
9551 9551
 		$sql = "SELECT rowid, label";
9552
-		$sql .= " FROM " . $this->db->prefix() . "export_model";
9553
-		$sql .= " WHERE type = '" . $this->db->escape($type) . "'";
9552
+		$sql .= " FROM ".$this->db->prefix()."export_model";
9553
+		$sql .= " WHERE type = '".$this->db->escape($type)."'";
9554 9554
 		$sql .= " ORDER BY rowid";
9555 9555
 		$result = $this->db->query($sql);
9556 9556
 		if ($result) {
9557
-			print '<select class="flat" id="select_' . $htmlname . '" name="' . $htmlname . '">';
9557
+			print '<select class="flat" id="select_'.$htmlname.'" name="'.$htmlname.'">';
9558 9558
 			if ($useempty) {
9559 9559
 				print '<option value="-1">&nbsp;</option>';
9560 9560
 			}
@@ -9564,9 +9564,9 @@  discard block
 block discarded – undo
9564 9564
 			while ($i < $num) {
9565 9565
 				$obj = $this->db->fetch_object($result);
9566 9566
 				if ($selected == $obj->rowid) {
9567
-					print '<option value="' . $obj->rowid . '" selected>';
9567
+					print '<option value="'.$obj->rowid.'" selected>';
9568 9568
 				} else {
9569
-					print '<option value="' . $obj->rowid . '">';
9569
+					print '<option value="'.$obj->rowid.'">';
9570 9570
 				}
9571 9571
 				print $obj->label;
9572 9572
 				print '</option>';
@@ -9656,8 +9656,8 @@  discard block
 block discarded – undo
9656 9656
 				$stringforfirstkey .= ' CTL +';
9657 9657
 			}
9658 9658
 
9659
-			$previous_ref = $object->ref_previous ? '<a accesskey="p" title="' . $stringforfirstkey . ' p" class="classfortooltip" href="' . $navurl . '?' . $paramid . '=' . urlencode($object->ref_previous) . $moreparam . '"><i class="fa fa-chevron-left"></i></a>' : '<span class="inactive"><i class="fa fa-chevron-left opacitymedium"></i></span>';
9660
-			$next_ref = $object->ref_next ? '<a accesskey="n" title="' . $stringforfirstkey . ' n" class="classfortooltip" href="' . $navurl . '?' . $paramid . '=' . urlencode($object->ref_next) . $moreparam . '"><i class="fa fa-chevron-right"></i></a>' : '<span class="inactive"><i class="fa fa-chevron-right opacitymedium"></i></span>';
9659
+			$previous_ref = $object->ref_previous ? '<a accesskey="p" title="'.$stringforfirstkey.' p" class="classfortooltip" href="'.$navurl.'?'.$paramid.'='.urlencode($object->ref_previous).$moreparam.'"><i class="fa fa-chevron-left"></i></a>' : '<span class="inactive"><i class="fa fa-chevron-left opacitymedium"></i></span>';
9660
+			$next_ref = $object->ref_next ? '<a accesskey="n" title="'.$stringforfirstkey.' n" class="classfortooltip" href="'.$navurl.'?'.$paramid.'='.urlencode($object->ref_next).$moreparam.'"><i class="fa fa-chevron-right"></i></a>' : '<span class="inactive"><i class="fa fa-chevron-right opacitymedium"></i></span>';
9661 9661
 		}
9662 9662
 
9663 9663
 		//print "xx".$previous_ref."x".$next_ref;
@@ -9665,18 +9665,18 @@  discard block
 block discarded – undo
9665 9665
 
9666 9666
 		// Right part of banner
9667 9667
 		if ($morehtmlright) {
9668
-			$ret .= '<div class="inline-block floatleft">' . $morehtmlright . '</div>';
9668
+			$ret .= '<div class="inline-block floatleft">'.$morehtmlright.'</div>';
9669 9669
 		}
9670 9670
 
9671 9671
 		if ($previous_ref || $next_ref || $morehtml) {
9672 9672
 			$ret .= '<div class="pagination paginationref"><ul class="right">';
9673 9673
 		}
9674 9674
 		if ($morehtml) {
9675
-			$ret .= '<li class="noborder litext' . (($shownav && $previous_ref && $next_ref) ? ' clearbothonsmartphone' : '') . '">' . $morehtml . '</li>';
9675
+			$ret .= '<li class="noborder litext'.(($shownav && $previous_ref && $next_ref) ? ' clearbothonsmartphone' : '').'">'.$morehtml.'</li>';
9676 9676
 		}
9677 9677
 		if ($shownav && ($previous_ref || $next_ref)) {
9678
-			$ret .= '<li class="pagination">' . $previous_ref . '</li>';
9679
-			$ret .= '<li class="pagination">' . $next_ref . '</li>';
9678
+			$ret .= '<li class="pagination">'.$previous_ref.'</li>';
9679
+			$ret .= '<li class="pagination">'.$next_ref.'</li>';
9680 9680
 		}
9681 9681
 		if ($previous_ref || $next_ref || $morehtml) {
9682 9682
 			$ret .= '</ul></div>';
@@ -9691,7 +9691,7 @@  discard block
 block discarded – undo
9691 9691
 			$morehtmlstatus = $hookmanager->resPrint;
9692 9692
 		}
9693 9693
 		if ($morehtmlstatus) {
9694
-			$ret .= '<div class="statusref">' . $morehtmlstatus . '</div>';
9694
+			$ret .= '<div class="statusref">'.$morehtmlstatus.'</div>';
9695 9695
 		}
9696 9696
 
9697 9697
 		$parameters = array();
@@ -9705,14 +9705,14 @@  discard block
 block discarded – undo
9705 9705
 		// Left part of banner
9706 9706
 		if ($morehtmlleft) {
9707 9707
 			if ($conf->browser->layout == 'phone') {
9708
-				$ret .= '<!-- morehtmlleft --><div class="floatleft">' . $morehtmlleft . '</div>';
9708
+				$ret .= '<!-- morehtmlleft --><div class="floatleft">'.$morehtmlleft.'</div>';
9709 9709
 			} else {
9710
-				$ret .= '<!-- morehtmlleft --><div class="inline-block floatleft">' . $morehtmlleft . '</div>';
9710
+				$ret .= '<!-- morehtmlleft --><div class="inline-block floatleft">'.$morehtmlleft.'</div>';
9711 9711
 			}
9712 9712
 		}
9713 9713
 
9714 9714
 		//if ($conf->browser->layout == 'phone') $ret.='<div class="clearboth"></div>';
9715
-		$ret .= '<div class="inline-block floatleft valignmiddle maxwidth750 marginbottomonly refid' . (($shownav && ($previous_ref || $next_ref)) ? ' refidpadding' : '') . '">';
9715
+		$ret .= '<div class="inline-block floatleft valignmiddle maxwidth750 marginbottomonly refid'.(($shownav && ($previous_ref || $next_ref)) ? ' refidpadding' : '').'">';
9716 9716
 
9717 9717
 		// For thirdparty, contact, user, member, the ref is the id, so we show something else
9718 9718
 		if ($object->element == 'societe') {
@@ -9726,7 +9726,7 @@  discard block
 block discarded – undo
9726 9726
 
9727 9727
 			if (is_array($arrayoflangcode) && count($arrayoflangcode)) {
9728 9728
 				if (!is_object($extralanguages)) {
9729
-					include_once DOL_DOCUMENT_ROOT . '/core/class/extralanguages.class.php';
9729
+					include_once DOL_DOCUMENT_ROOT.'/core/class/extralanguages.class.php';
9730 9730
 					$extralanguages = new ExtraLanguages($this->db);
9731 9731
 				}
9732 9732
 				$extralanguages->fetch_name_extralanguages('societe');
@@ -9741,27 +9741,27 @@  discard block
 block discarded – undo
9741 9741
 						if ($object->array_languages['name'][$extralangcode]) {
9742 9742
 							$htmltext .= $object->array_languages['name'][$extralangcode];
9743 9743
 						} else {
9744
-							$htmltext .= '<span class="opacitymedium">' . $langs->trans("SwitchInEditModeToAddTranslation") . '</span>';
9744
+							$htmltext .= '<span class="opacitymedium">'.$langs->trans("SwitchInEditModeToAddTranslation").'</span>';
9745 9745
 						}
9746 9746
 					}
9747
-					$ret .= '<!-- Show translations of name -->' . "\n";
9747
+					$ret .= '<!-- Show translations of name -->'."\n";
9748 9748
 					$ret .= $this->textwithpicto('', $htmltext, -1, 'language', 'opacitymedium paddingleft');
9749 9749
 				}
9750 9750
 			}
9751 9751
 		} elseif ($object->element == 'member') {
9752
-			$ret .= $object->ref . '<br>';
9752
+			$ret .= $object->ref.'<br>';
9753 9753
 			$fullname = $object->getFullName($langs);
9754 9754
 			if ($object->morphy == 'mor' && $object->societe) {
9755
-				$ret .= dol_htmlentities($object->societe) . ((!empty($fullname) && $object->societe != $fullname) ? ' (' . dol_htmlentities($fullname) . $addgendertxt . ')' : '');
9755
+				$ret .= dol_htmlentities($object->societe).((!empty($fullname) && $object->societe != $fullname) ? ' ('.dol_htmlentities($fullname).$addgendertxt.')' : '');
9756 9756
 			} else {
9757
-				$ret .= dol_htmlentities($fullname) . $addgendertxt . ((!empty($object->societe) && $object->societe != $fullname) ? ' (' . dol_htmlentities($object->societe) . ')' : '');
9757
+				$ret .= dol_htmlentities($fullname).$addgendertxt.((!empty($object->societe) && $object->societe != $fullname) ? ' ('.dol_htmlentities($object->societe).')' : '');
9758 9758
 			}
9759 9759
 		} elseif (in_array($object->element, array('contact', 'user'))) {
9760
-			$ret .= dol_htmlentities($object->getFullName($langs)) . $addgendertxt;
9760
+			$ret .= dol_htmlentities($object->getFullName($langs)).$addgendertxt;
9761 9761
 		} elseif ($object->element == 'usergroup') {
9762 9762
 			$ret .= dol_htmlentities($object->name);
9763 9763
 		} elseif (in_array($object->element, array('action', 'agenda'))) {
9764
-			$ret .= $object->ref . '<br>' . $object->label;
9764
+			$ret .= $object->ref.'<br>'.$object->label;
9765 9765
 		} elseif (in_array($object->element, array('adherent_type'))) {
9766 9766
 			$ret .= $object->label;
9767 9767
 		} elseif ($object->element == 'ecm_directories') {
@@ -9813,9 +9813,9 @@  discard block
 block discarded – undo
9813 9813
 		}
9814 9814
 
9815 9815
 		// Barcode image
9816
-		$url = DOL_URL_ROOT . '/viewimage.php?modulepart=barcode&generator=' . urlencode($object->barcode_type_coder) . '&code=' . urlencode($object->barcode) . '&encoding=' . urlencode($object->barcode_type_code);
9817
-		$out = '<!-- url barcode = ' . $url . ' -->';
9818
-		$out .= '<img src="' . $url . '"' . ($morecss ? ' class="' . $morecss . '"' : '') . '>';
9816
+		$url = DOL_URL_ROOT.'/viewimage.php?modulepart=barcode&generator='.urlencode($object->barcode_type_coder).'&code='.urlencode($object->barcode).'&encoding='.urlencode($object->barcode_type_code);
9817
+		$out = '<!-- url barcode = '.$url.' -->';
9818
+		$out .= '<img src="'.$url.'"'.($morecss ? ' class="'.$morecss.'"' : '').'>';
9819 9819
 
9820 9820
 		return $out;
9821 9821
 	}
@@ -9855,28 +9855,28 @@  discard block
 block discarded – undo
9855 9855
 			if (!empty($object->logo)) {
9856 9856
 				if (dolIsAllowedForPreview($object->logo)) {
9857 9857
 					if ((string) $imagesize == 'mini') {
9858
-						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . getImageFileNameForSize($object->logo, '_mini'); // getImageFileNameForSize include the thumbs
9858
+						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.getImageFileNameForSize($object->logo, '_mini'); // getImageFileNameForSize include the thumbs
9859 9859
 					} elseif ((string) $imagesize == 'small') {
9860
-						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . getImageFileNameForSize($object->logo, '_small');
9860
+						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.getImageFileNameForSize($object->logo, '_small');
9861 9861
 					} else {
9862
-						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . $object->logo;
9862
+						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.$object->logo;
9863 9863
 					}
9864
-					$originalfile = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . $object->logo;
9864
+					$originalfile = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.$object->logo;
9865 9865
 				}
9866 9866
 			}
9867 9867
 			$email = $object->email;
9868 9868
 		} elseif ($modulepart == 'contact') {
9869
-			$dir = $conf->societe->multidir_output[$entity] . '/contact';
9869
+			$dir = $conf->societe->multidir_output[$entity].'/contact';
9870 9870
 			if (!empty($object->photo)) {
9871 9871
 				if (dolIsAllowedForPreview($object->photo)) {
9872 9872
 					if ((string) $imagesize == 'mini') {
9873
-						$file = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . getImageFileNameForSize($object->photo, '_mini');
9873
+						$file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.getImageFileNameForSize($object->photo, '_mini');
9874 9874
 					} elseif ((string) $imagesize == 'small') {
9875
-						$file = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . getImageFileNameForSize($object->photo, '_small');
9875
+						$file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.getImageFileNameForSize($object->photo, '_small');
9876 9876
 					} else {
9877
-						$file = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . $object->photo;
9877
+						$file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.$object->photo;
9878 9878
 					}
9879
-					$originalfile = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . $object->photo;
9879
+					$originalfile = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.$object->photo;
9880 9880
 				}
9881 9881
 			}
9882 9882
 			$email = $object->email;
@@ -9886,17 +9886,17 @@  discard block
 block discarded – undo
9886 9886
 			if (!empty($object->photo)) {
9887 9887
 				if (dolIsAllowedForPreview($object->photo)) {
9888 9888
 					if ((string) $imagesize == 'mini') {
9889
-						$file = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . getImageFileNameForSize($object->photo, '_mini');
9889
+						$file = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.getImageFileNameForSize($object->photo, '_mini');
9890 9890
 					} elseif ((string) $imagesize == 'small') {
9891
-						$file = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . getImageFileNameForSize($object->photo, '_small');
9891
+						$file = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.getImageFileNameForSize($object->photo, '_small');
9892 9892
 					} else {
9893
-						$file = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . $object->photo;
9893
+						$file = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.$object->photo;
9894 9894
 					}
9895
-					$originalfile = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . $object->photo;
9895
+					$originalfile = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.$object->photo;
9896 9896
 				}
9897 9897
 			}
9898 9898
 			if (getDolGlobalString('MAIN_OLD_IMAGE_LINKS')) {
9899
-				$altfile = $object->id . ".jpg"; // For backward compatibility
9899
+				$altfile = $object->id.".jpg"; // For backward compatibility
9900 9900
 			}
9901 9901
 			$email = $object->email;
9902 9902
 			$capture = 'user';
@@ -9905,17 +9905,17 @@  discard block
 block discarded – undo
9905 9905
 			if (!empty($object->photo)) {
9906 9906
 				if (dolIsAllowedForPreview($object->photo)) {
9907 9907
 					if ((string) $imagesize == 'mini') {
9908
-						$file = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . getImageFileNameForSize($object->photo, '_mini');
9908
+						$file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_mini');
9909 9909
 					} elseif ((string) $imagesize == 'small') {
9910
-						$file = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . getImageFileNameForSize($object->photo, '_small');
9910
+						$file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_small');
9911 9911
 					} else {
9912
-						$file = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . $object->photo;
9912
+						$file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.$object->photo;
9913 9913
 					}
9914
-					$originalfile = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . $object->photo;
9914
+					$originalfile = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.$object->photo;
9915 9915
 				}
9916 9916
 			}
9917 9917
 			if (getDolGlobalString('MAIN_OLD_IMAGE_LINKS')) {
9918
-				$altfile = $object->id . ".jpg"; // For backward compatibility
9918
+				$altfile = $object->id.".jpg"; // For backward compatibility
9919 9919
 			}
9920 9920
 			$email = $object->email;
9921 9921
 			$capture = 'user';
@@ -9941,35 +9941,35 @@  discard block
 block discarded – undo
9941 9941
 		$ret = '';
9942 9942
 
9943 9943
 		if ($dir) {
9944
-			if ($file && file_exists($dir . "/" . $file)) {
9944
+			if ($file && file_exists($dir."/".$file)) {
9945 9945
 				if ($addlinktofullsize) {
9946
-					$urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity=' . $entity);
9946
+					$urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity='.$entity);
9947 9947
 					if ($urladvanced) {
9948
-						$ret .= '<a href="' . $urladvanced . '">';
9948
+						$ret .= '<a href="'.$urladvanced.'">';
9949 9949
 					} else {
9950
-						$ret .= '<a href="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($originalfile) . '&cache=' . $cache . '">';
9950
+						$ret .= '<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($originalfile).'&cache='.$cache.'">';
9951 9951
 					}
9952 9952
 				}
9953
-				$ret .= '<img alt="Photo" class="photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . ' photologo' . (preg_replace('/[^a-z]/i', '_', $file)) . '" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . ' src="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($file) . '&cache=' . $cache . '">';
9953
+				$ret .= '<img alt="Photo" class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').' photologo'.(preg_replace('/[^a-z]/i', '_', $file)).'" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').' src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($file).'&cache='.$cache.'">';
9954 9954
 				if ($addlinktofullsize) {
9955 9955
 					$ret .= '</a>';
9956 9956
 				}
9957
-			} elseif ($altfile && file_exists($dir . "/" . $altfile)) {
9957
+			} elseif ($altfile && file_exists($dir."/".$altfile)) {
9958 9958
 				if ($addlinktofullsize) {
9959
-					$urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity=' . $entity);
9959
+					$urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity='.$entity);
9960 9960
 					if ($urladvanced) {
9961
-						$ret .= '<a href="' . $urladvanced . '">';
9961
+						$ret .= '<a href="'.$urladvanced.'">';
9962 9962
 					} else {
9963
-						$ret .= '<a href="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($originalfile) . '&cache=' . $cache . '">';
9963
+						$ret .= '<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($originalfile).'&cache='.$cache.'">';
9964 9964
 					}
9965 9965
 				}
9966
-				$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 . '">';
9966
+				$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.'">';
9967 9967
 				if ($addlinktofullsize) {
9968 9968
 					$ret .= '</a>';
9969 9969
 				}
9970 9970
 			} else {
9971 9971
 				$nophoto = '/public/theme/common/nophoto.png';
9972
-				$defaultimg = 'identicon';        // For gravatar
9972
+				$defaultimg = 'identicon'; // For gravatar
9973 9973
 				if (in_array($modulepart, array('societe', 'userphoto', 'contact', 'memberphoto'))) {    // For modules that need a special image when photo not found
9974 9974
 					if ($modulepart == 'societe' || ($modulepart == 'memberphoto' && !empty($object->morphy) && strpos($object->morphy, 'mor')) !== false) {
9975 9975
 						$nophoto = 'company';
@@ -9987,13 +9987,13 @@  discard block
 block discarded – undo
9987 9987
 				if (isModEnabled('gravatar') && $email && empty($noexternsourceoverwrite)) {
9988 9988
 					// see https://gravatar.com/site/implement/images/php/
9989 9989
 					$ret .= '<!-- Put link to gravatar -->';
9990
-					$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
9990
+					$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
9991 9991
 				} else {
9992 9992
 					if ($nophoto == 'company') {
9993
-						$ret .= '<div class="divforspanimg photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . '>' . img_picto('', 'company') . '</div>';
9993
+						$ret .= '<div class="divforspanimg photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').'>'.img_picto('', 'company').'</div>';
9994 9994
 						$ret .= '<div class="difforspanimgright"></div>';
9995 9995
 					} else {
9996
-						$ret .= '<img class="photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . ' src="' . DOL_URL_ROOT . $nophoto . '">';
9996
+						$ret .= '<img class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').' src="'.DOL_URL_ROOT.$nophoto.'">';
9997 9997
 					}
9998 9998
 				}
9999 9999
 			}
@@ -10004,15 +10004,15 @@  discard block
 block discarded – undo
10004 10004
 				}
10005 10005
 				$ret .= '<table class="nobordernopadding centpercent">';
10006 10006
 				if ($object->photo) {
10007
-					$ret .= '<tr><td><input type="checkbox" class="flat photodelete" name="deletephoto" id="photodelete"> <label for="photodelete">' . $langs->trans("Delete") . '</label><br><br></td></tr>';
10007
+					$ret .= '<tr><td><input type="checkbox" class="flat photodelete" name="deletephoto" id="photodelete"> <label for="photodelete">'.$langs->trans("Delete").'</label><br><br></td></tr>';
10008 10008
 				}
10009 10009
 				$ret .= '<tr><td class="tdoverflow">';
10010 10010
 				$maxfilesizearray = getMaxFileSizeArray();
10011 10011
 				$maxmin = $maxfilesizearray['maxmin'];
10012 10012
 				if ($maxmin > 0) {
10013
-					$ret .= '<input type="hidden" name="MAX_FILE_SIZE" value="' . ($maxmin * 1024) . '">';    // MAX_FILE_SIZE must precede the field type=file
10013
+					$ret .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file
10014 10014
 				}
10015
-				$ret .= '<input type="file" class="flat maxwidth200onsmartphone" name="photo" id="photoinput" accept="image/*"' . ($capture ? ' capture="' . $capture . '"' : '') . '>';
10015
+				$ret .= '<input type="file" class="flat maxwidth200onsmartphone" name="photo" id="photoinput" accept="image/*"'.($capture ? ' capture="'.$capture.'"' : '').'>';
10016 10016
 				$ret .= '</td></tr>';
10017 10017
 				$ret .= '</table>';
10018 10018
 			}
@@ -10066,38 +10066,38 @@  discard block
 block discarded – undo
10066 10066
 		if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) {
10067 10067
 			$sql .= ", e.label";
10068 10068
 		}
10069
-		$sql .= " FROM " . $this->db->prefix() . "usergroup as ug ";
10069
+		$sql .= " FROM ".$this->db->prefix()."usergroup as ug ";
10070 10070
 		if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) {
10071
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "entity as e ON e.rowid=ug.entity";
10071
+			$sql .= " LEFT JOIN ".$this->db->prefix()."entity as e ON e.rowid=ug.entity";
10072 10072
 			if ($force_entity) {
10073
-				$sql .= " WHERE ug.entity IN (0, " . $force_entity . ")";
10073
+				$sql .= " WHERE ug.entity IN (0, ".$force_entity.")";
10074 10074
 			} else {
10075 10075
 				$sql .= " WHERE ug.entity IS NOT NULL";
10076 10076
 			}
10077 10077
 		} else {
10078
-			$sql .= " WHERE ug.entity IN (0, " . $conf->entity . ")";
10078
+			$sql .= " WHERE ug.entity IN (0, ".$conf->entity.")";
10079 10079
 		}
10080 10080
 		if (is_array($exclude) && $excludeGroups) {
10081
-			$sql .= " AND ug.rowid NOT IN (" . $this->db->sanitize($excludeGroups) . ")";
10081
+			$sql .= " AND ug.rowid NOT IN (".$this->db->sanitize($excludeGroups).")";
10082 10082
 		}
10083 10083
 		if (is_array($include) && $includeGroups) {
10084
-			$sql .= " AND ug.rowid IN (" . $this->db->sanitize($includeGroups) . ")";
10084
+			$sql .= " AND ug.rowid IN (".$this->db->sanitize($includeGroups).")";
10085 10085
 		}
10086 10086
 		$sql .= " ORDER BY ug.nom ASC";
10087 10087
 
10088
-		dol_syslog(get_class($this) . "::select_dolgroups", LOG_DEBUG);
10088
+		dol_syslog(get_class($this)."::select_dolgroups", LOG_DEBUG);
10089 10089
 		$resql = $this->db->query($sql);
10090 10090
 		if ($resql) {
10091 10091
 			// Enhance with select2
10092
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
10092
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
10093 10093
 
10094
-			$out .= '<select class="flat minwidth200' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . ' ' . ($disabled ? ' disabled' : '') . '>';
10094
+			$out .= '<select class="flat minwidth200'.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.($disabled ? ' disabled' : '').'>';
10095 10095
 
10096 10096
 			$num = $this->db->num_rows($resql);
10097 10097
 			$i = 0;
10098 10098
 			if ($num) {
10099 10099
 				if ($show_empty && !$multiple) {
10100
-					$out .= '<option value="-1"' . (in_array(-1, $selected) ? ' selected' : '') . '>&nbsp;</option>' . "\n";
10100
+					$out .= '<option value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'>&nbsp;</option>'."\n";
10101 10101
 				}
10102 10102
 
10103 10103
 				while ($i < $num) {
@@ -10110,11 +10110,11 @@  discard block
 block discarded – undo
10110 10110
 					$label = $obj->name;
10111 10111
 					$labelhtml = $obj->name;
10112 10112
 					if (isModEnabled('multicompany') && !getDolGlobalInt('MULTICOMPANY_TRANSVERSE_MODE') && $conf->entity == 1) {
10113
-						$label .= " (" . $obj->label . ")";
10114
-						$labelhtml .= ' <span class="opacitymedium">(' . $obj->label . ')</span>';
10113
+						$label .= " (".$obj->label.")";
10114
+						$labelhtml .= ' <span class="opacitymedium">('.$obj->label.')</span>';
10115 10115
 					}
10116 10116
 
10117
-					$out .= '<option value="' . $obj->rowid . '"';
10117
+					$out .= '<option value="'.$obj->rowid.'"';
10118 10118
 					if ($disableline) {
10119 10119
 						$out .= ' disabled';
10120 10120
 					}
@@ -10130,9 +10130,9 @@  discard block
 block discarded – undo
10130 10130
 				}
10131 10131
 			} else {
10132 10132
 				if ($show_empty) {
10133
-					$out .= '<option value="-1"' . (in_array(-1, $selected) ? ' selected' : '') . '></option>' . "\n";
10133
+					$out .= '<option value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'></option>'."\n";
10134 10134
 				}
10135
-				$out .= '<option value="" disabled>' . $langs->trans("NoUserGroupDefined") . '</option>';
10135
+				$out .= '<option value="" disabled>'.$langs->trans("NoUserGroupDefined").'</option>';
10136 10136
 			}
10137 10137
 			$out .= '</select>';
10138 10138
 
@@ -10181,25 +10181,25 @@  discard block
 block discarded – undo
10181 10181
 		$out = '';
10182 10182
 
10183 10183
 		if (!empty($conf->use_javascript_ajax)) {
10184
-			$out .= '<div class="inline-block checkallactions"><input type="checkbox" id="' . $cssclass . 's" name="' . $cssclass . 's" class="checkallactions"></div>';
10184
+			$out .= '<div class="inline-block checkallactions"><input type="checkbox" id="'.$cssclass.'s" name="'.$cssclass.'s" class="checkallactions"></div>';
10185 10185
 		}
10186
-		$out .= '<script nonce="' . getNonce() . '">
10186
+		$out .= '<script nonce="'.getNonce().'">
10187 10187
             $(document).ready(function() {
10188
-                $("#' . $cssclass . 's").click(function() {
10188
+                $("#' . $cssclass.'s").click(function() {
10189 10189
                     if($(this).is(\':checked\')){
10190
-                        console.log("We check all ' . $cssclass . ' and trigger the change method");
10191
-                		$(".' . $cssclass . '").prop(\'checked\', true).trigger(\'change\');
10190
+                        console.log("We check all ' . $cssclass.' and trigger the change method");
10191
+                		$(".' . $cssclass.'").prop(\'checked\', true).trigger(\'change\');
10192 10192
                     }
10193 10193
                     else
10194 10194
                     {
10195 10195
                         console.log("We uncheck all");
10196
-                		$(".' . $cssclass . '").prop(\'checked\', false).trigger(\'change\');
10196
+                		$(".' . $cssclass.'").prop(\'checked\', false).trigger(\'change\');
10197 10197
                     }' . "\n";
10198 10198
 		if ($calljsfunction) {
10199
-			$out .= 'if (typeof initCheckForSelect == \'function\') { initCheckForSelect(0, "' . $massactionname . '", "' . $cssclass . '"); } else { console.log("No function initCheckForSelect found. Call won\'t be done."); }';
10199
+			$out .= 'if (typeof initCheckForSelect == \'function\') { initCheckForSelect(0, "'.$massactionname.'", "'.$cssclass.'"); } else { console.log("No function initCheckForSelect found. Call won\'t be done."); }';
10200 10200
 		}
10201 10201
 		$out .= '         });
10202
-        	        $(".' . $cssclass . '").change(function() {
10202
+        	        $(".' . $cssclass.'").change(function() {
10203 10203
 					$(this).closest("tr").toggleClass("highlight", this.checked);
10204 10204
 				});
10205 10205
 		 	});
@@ -10244,67 +10244,67 @@  discard block
 block discarded – undo
10244 10244
 		global $langs, $user;
10245 10245
 
10246 10246
 		$out = '';
10247
-		$sql = "SELECT rowid, label FROM " . $this->db->prefix() . "c_exp_tax_cat WHERE active = 1";
10248
-		$sql .= " AND entity IN (0," . getEntity('exp_tax_cat') . ")";
10247
+		$sql = "SELECT rowid, label FROM ".$this->db->prefix()."c_exp_tax_cat WHERE active = 1";
10248
+		$sql .= " AND entity IN (0,".getEntity('exp_tax_cat').")";
10249 10249
 		if (!empty($excludeid)) {
10250
-			$sql .= " AND rowid NOT IN (" . $this->db->sanitize(implode(',', $excludeid)) . ")";
10250
+			$sql .= " AND rowid NOT IN (".$this->db->sanitize(implode(',', $excludeid)).")";
10251 10251
 		}
10252 10252
 		$sql .= " ORDER BY label";
10253 10253
 
10254 10254
 		$resql = $this->db->query($sql);
10255 10255
 		if ($resql) {
10256
-			$out = '<select id="select_' . $htmlname . '" name="' . $htmlname . '" class="' . $htmlname . ' flat minwidth75imp maxwidth200">';
10256
+			$out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp maxwidth200">';
10257 10257
 			if ($useempty) {
10258 10258
 				$out .= '<option value="0">&nbsp;</option>';
10259 10259
 			}
10260 10260
 
10261 10261
 			while ($obj = $this->db->fetch_object($resql)) {
10262
-				$out .= '<option ' . ($selected == $obj->rowid ? 'selected="selected"' : '') . ' value="' . $obj->rowid . '">' . $langs->trans($obj->label) . '</option>';
10262
+				$out .= '<option '.($selected == $obj->rowid ? 'selected="selected"' : '').' value="'.$obj->rowid.'">'.$langs->trans($obj->label).'</option>';
10263 10263
 			}
10264 10264
 			$out .= '</select>';
10265
-			$out .= ajax_combobox('select_' . $htmlname);
10265
+			$out .= ajax_combobox('select_'.$htmlname);
10266 10266
 
10267 10267
 			if (!empty($htmlname) && $user->admin && $info_admin) {
10268
-				$out .= ' ' . info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
10268
+				$out .= ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
10269 10269
 			}
10270 10270
 
10271 10271
 			if (!empty($target)) {
10272
-				$sql = "SELECT c.id FROM " . $this->db->prefix() . "c_type_fees as c WHERE c.code = 'EX_KME' AND c.active = 1";
10272
+				$sql = "SELECT c.id FROM ".$this->db->prefix()."c_type_fees as c WHERE c.code = 'EX_KME' AND c.active = 1";
10273 10273
 				$resql = $this->db->query($sql);
10274 10274
 				if ($resql) {
10275 10275
 					if ($this->db->num_rows($resql) > 0) {
10276 10276
 						$obj = $this->db->fetch_object($resql);
10277
-						$out .= '<script nonce="' . getNonce() . '">
10277
+						$out .= '<script nonce="'.getNonce().'">
10278 10278
 							$(function() {
10279
-								$("select[name=' . $target . ']").on("change", function() {
10279
+								$("select[name=' . $target.']").on("change", function() {
10280 10280
 									var current_val = $(this).val();
10281
-									if (current_val == ' . $obj->id . ') {';
10281
+									if (current_val == ' . $obj->id.') {';
10282 10282
 						if (!empty($default_selected) || !empty($selected)) {
10283
-							$out .= '$("select[name=' . $htmlname . ']").val("' . ($default_selected > 0 ? $default_selected : $selected) . '");';
10283
+							$out .= '$("select[name='.$htmlname.']").val("'.($default_selected > 0 ? $default_selected : $selected).'");';
10284 10284
 						}
10285 10285
 
10286 10286
 						$out .= '
10287
-										$("select[name=' . $htmlname . ']").change();
10287
+										$("select[name=' . $htmlname.']").change();
10288 10288
 									}
10289 10289
 								});
10290 10290
 
10291
-								$("select[name=' . $htmlname . ']").change(function() {
10291
+								$("select[name=' . $htmlname.']").change(function() {
10292 10292
 
10293
-									if ($("select[name=' . $target . ']").val() == ' . $obj->id . ') {
10293
+									if ($("select[name=' . $target.']").val() == '.$obj->id.') {
10294 10294
 										// get price of kilometer to fill the unit price
10295 10295
 										$.ajax({
10296 10296
 											method: "POST",
10297 10297
 											dataType: "json",
10298
-											data: { fk_c_exp_tax_cat: $(this).val(), token: \'' . currentToken() . '\' },
10299
-											url: "' . (DOL_URL_ROOT . '/expensereport/ajax/ajaxik.php?' . join('&', $params)) . '",
10298
+											data: { fk_c_exp_tax_cat: $(this).val(), token: \'' . currentToken().'\' },
10299
+											url: "' . (DOL_URL_ROOT.'/expensereport/ajax/ajaxik.php?'.join('&', $params)).'",
10300 10300
 										}).done(function( data, textStatus, jqXHR ) {
10301 10301
 											console.log(data);
10302 10302
 											if (typeof data.up != "undefined") {
10303 10303
 												$("input[name=value_unit]").val(data.up);
10304
-												$("select[name=' . $htmlname . ']").attr("title", data.title);
10304
+												$("select[name=' . $htmlname.']").attr("title", data.title);
10305 10305
 											} else {
10306 10306
 												$("input[name=value_unit]").val("");
10307
-												$("select[name=' . $htmlname . ']").attr("title", "");
10307
+												$("select[name=' . $htmlname.']").attr("title", "");
10308 10308
 											}
10309 10309
 										});
10310 10310
 									}
@@ -10334,18 +10334,18 @@  discard block
 block discarded – undo
10334 10334
 		global $conf, $langs;
10335 10335
 
10336 10336
 		$out = '';
10337
-		$sql = "SELECT rowid, range_ik FROM " . $this->db->prefix() . "c_exp_tax_range";
10338
-		$sql .= " WHERE entity = " . $conf->entity . " AND active = 1";
10337
+		$sql = "SELECT rowid, range_ik FROM ".$this->db->prefix()."c_exp_tax_range";
10338
+		$sql .= " WHERE entity = ".$conf->entity." AND active = 1";
10339 10339
 
10340 10340
 		$resql = $this->db->query($sql);
10341 10341
 		if ($resql) {
10342
-			$out = '<select id="select_' . $htmlname . '" name="' . $htmlname . '" class="' . $htmlname . ' flat minwidth75imp">';
10342
+			$out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp">';
10343 10343
 			if ($useempty) {
10344 10344
 				$out .= '<option value="0"></option>';
10345 10345
 			}
10346 10346
 
10347 10347
 			while ($obj = $this->db->fetch_object($resql)) {
10348
-				$out .= '<option ' . ($selected == $obj->rowid ? 'selected="selected"' : '') . ' value="' . $obj->rowid . '">' . price($obj->range_ik, 0, $langs, 1, 0) . '</option>';
10348
+				$out .= '<option '.($selected == $obj->rowid ? 'selected="selected"' : '').' value="'.$obj->rowid.'">'.price($obj->range_ik, 0, $langs, 1, 0).'</option>';
10349 10349
 			}
10350 10350
 			$out .= '</select>';
10351 10351
 		} else {
@@ -10376,12 +10376,12 @@  discard block
 block discarded – undo
10376 10376
 
10377 10377
 		$resql = $this->db->query($sql);
10378 10378
 		if ($resql) {
10379
-			$out = '<select id="select_' . $htmlname . '" name="' . $htmlname . '" class="' . $htmlname . ' flat minwidth75imp">';
10379
+			$out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp">';
10380 10380
 			if ($useempty) {
10381 10381
 				$out .= '<option value="0"></option>';
10382 10382
 			}
10383 10383
 			if ($allchoice) {
10384
-				$out .= '<option value="-1">' . $langs->trans('AllExpenseReport') . '</option>';
10384
+				$out .= '<option value="-1">'.$langs->trans('AllExpenseReport').'</option>';
10385 10385
 			}
10386 10386
 
10387 10387
 			$field = 'code';
@@ -10391,7 +10391,7 @@  discard block
 block discarded – undo
10391 10391
 
10392 10392
 			while ($obj = $this->db->fetch_object($resql)) {
10393 10393
 				$key = $langs->trans($obj->code);
10394
-				$out .= '<option ' . ($selected == $obj->{$field} ? 'selected="selected"' : '') . ' value="' . $obj->{$field} . '">' . ($key != $obj->code ? $key : $obj->label) . '</option>';
10394
+				$out .= '<option '.($selected == $obj->{$field} ? 'selected="selected"' : '').' value="'.$obj->{$field}.'">'.($key != $obj->code ? $key : $obj->label).'</option>';
10395 10395
 			}
10396 10396
 			$out .= '</select>';
10397 10397
 
@@ -10425,7 +10425,7 @@  discard block
 block discarded – undo
10425 10425
 	{
10426 10426
 		global $user, $conf, $langs;
10427 10427
 
10428
-		require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
10428
+		require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
10429 10429
 
10430 10430
 		if (is_null($usertofilter)) {
10431 10431
 			$usertofilter = $user;
@@ -10449,10 +10449,10 @@  discard block
 block discarded – undo
10449 10449
 		$sql = "SELECT f.rowid, f.ref as fref, 'nolabel' as flabel, p.rowid as pid, f.ref,
10450 10450
             p.title, p.fk_soc, p.fk_statut, p.public,";
10451 10451
 		$sql .= ' s.nom as name';
10452
-		$sql .= ' FROM ' . $this->db->prefix() . 'projet as p';
10453
-		$sql .= ' LEFT JOIN ' . $this->db->prefix() . 'societe as s ON s.rowid = p.fk_soc,';
10454
-		$sql .= ' ' . $this->db->prefix() . 'facture as f';
10455
-		$sql .= " WHERE p.entity IN (" . getEntity('project') . ")";
10452
+		$sql .= ' FROM '.$this->db->prefix().'projet as p';
10453
+		$sql .= ' LEFT JOIN '.$this->db->prefix().'societe as s ON s.rowid = p.fk_soc,';
10454
+		$sql .= ' '.$this->db->prefix().'facture as f';
10455
+		$sql .= " WHERE p.entity IN (".getEntity('project').")";
10456 10456
 		$sql .= " AND f.fk_projet = p.rowid AND f.fk_statut=0"; //Brouillons seulement
10457 10457
 		//if ($projectsListId) $sql.= " AND p.rowid IN (".$this->db->sanitize($projectsListId).")";
10458 10458
 		//if ($socid == 0) $sql.= " AND (p.fk_soc=0 OR p.fk_soc IS NULL)";
@@ -10463,14 +10463,14 @@  discard block
 block discarded – undo
10463 10463
 		if ($resql) {
10464 10464
 			// Use select2 selector
10465 10465
 			if (!empty($conf->use_javascript_ajax)) {
10466
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
10466
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
10467 10467
 				$comboenhancement = ajax_combobox($htmlname, '', 0, $forcefocus);
10468 10468
 				$out .= $comboenhancement;
10469 10469
 				$morecss = 'minwidth200imp maxwidth500';
10470 10470
 			}
10471 10471
 
10472 10472
 			if (empty($option_only)) {
10473
-				$out .= '<select class="valignmiddle flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ' id="' . $htmlname . '" name="' . $htmlname . '">';
10473
+				$out .= '<select class="valignmiddle flat'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').' id="'.$htmlname.'" name="'.$htmlname.'">';
10474 10474
 			}
10475 10475
 			if (!empty($show_empty)) {
10476 10476
 				$out .= '<option value="0" class="optiongrey">';
@@ -10500,33 +10500,33 @@  discard block
 block discarded – undo
10500 10500
 						if ($showproject == 'all') {
10501 10501
 							$labeltoshow .= dol_trunc($obj->ref, 18); // Invoice ref
10502 10502
 							if ($obj->name) {
10503
-								$labeltoshow .= ' - ' . $obj->name; // Soc name
10503
+								$labeltoshow .= ' - '.$obj->name; // Soc name
10504 10504
 							}
10505 10505
 
10506 10506
 							$disabled = 0;
10507 10507
 							if ($obj->fk_statut == Project::STATUS_DRAFT) {
10508 10508
 								$disabled = 1;
10509
-								$labeltoshow .= ' - ' . $langs->trans("Draft");
10509
+								$labeltoshow .= ' - '.$langs->trans("Draft");
10510 10510
 							} elseif ($obj->fk_statut == Project::STATUS_CLOSED) {
10511 10511
 								if ($discard_closed == 2) {
10512 10512
 									$disabled = 1;
10513 10513
 								}
10514
-								$labeltoshow .= ' - ' . $langs->trans("Closed");
10514
+								$labeltoshow .= ' - '.$langs->trans("Closed");
10515 10515
 							} elseif ($socid > 0 && (!empty($obj->fk_soc) && $obj->fk_soc != $socid)) {
10516 10516
 								$disabled = 1;
10517
-								$labeltoshow .= ' - ' . $langs->trans("LinkedToAnotherCompany");
10517
+								$labeltoshow .= ' - '.$langs->trans("LinkedToAnotherCompany");
10518 10518
 							}
10519 10519
 						}
10520 10520
 
10521 10521
 						if (!empty($selected) && $selected == $obj->rowid) {
10522
-							$out .= '<option value="' . $obj->rowid . '" selected';
10522
+							$out .= '<option value="'.$obj->rowid.'" selected';
10523 10523
 							//if ($disabled) $out.=' disabled';						// with select2, field can't be preselected if disabled
10524
-							$out .= '>' . $labeltoshow . '</option>';
10524
+							$out .= '>'.$labeltoshow.'</option>';
10525 10525
 						} else {
10526 10526
 							if ($hideunselectables && $disabled && ($selected != $obj->rowid)) {
10527 10527
 								$resultat = '';
10528 10528
 							} else {
10529
-								$resultat = '<option value="' . $obj->rowid . '"';
10529
+								$resultat = '<option value="'.$obj->rowid.'"';
10530 10530
 								if ($disabled) {
10531 10531
 									$resultat .= ' disabled';
10532 10532
 								}
@@ -10578,22 +10578,22 @@  discard block
 block discarded – undo
10578 10578
 
10579 10579
 		$sql = 'SELECT f.rowid, f.entity, f.titre as title, f.suspended, f.fk_soc';
10580 10580
 		//$sql.= ', el.fk_source';
10581
-		$sql .= ' FROM ' . MAIN_DB_PREFIX . 'facture_rec as f';
10582
-		$sql .= " WHERE f.entity IN (" . getEntity('invoice') . ")";
10581
+		$sql .= ' FROM '.MAIN_DB_PREFIX.'facture_rec as f';
10582
+		$sql .= " WHERE f.entity IN (".getEntity('invoice').")";
10583 10583
 		$sql .= " ORDER BY f.titre ASC";
10584 10584
 
10585 10585
 		$resql = $this->db->query($sql);
10586 10586
 		if ($resql) {
10587 10587
 			// Use select2 selector
10588 10588
 			if (!empty($conf->use_javascript_ajax)) {
10589
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
10589
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
10590 10590
 				$comboenhancement = ajax_combobox($htmlname, '', 0, $forcefocus);
10591 10591
 				$out .= $comboenhancement;
10592 10592
 				$morecss = 'minwidth200imp maxwidth500';
10593 10593
 			}
10594 10594
 
10595 10595
 			if (empty($option_only)) {
10596
-				$out .= '<select class="valignmiddle flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ' id="' . $htmlname . '" name="' . $htmlname . '">';
10596
+				$out .= '<select class="valignmiddle flat'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').' id="'.$htmlname.'" name="'.$htmlname.'">';
10597 10597
 			}
10598 10598
 			if (!empty($show_empty)) {
10599 10599
 				$out .= '<option value="0" class="optiongrey">';
@@ -10612,19 +10612,19 @@  discard block
 block discarded – undo
10612 10612
 					$disabled = 0;
10613 10613
 					if (!empty($obj->suspended)) {
10614 10614
 						$disabled = 1;
10615
-						$labeltoshow .= ' - ' . $langs->trans("Closed");
10615
+						$labeltoshow .= ' - '.$langs->trans("Closed");
10616 10616
 					}
10617 10617
 
10618 10618
 
10619 10619
 					if (!empty($selected) && $selected == $obj->rowid) {
10620
-						$out .= '<option value="' . $obj->rowid . '" selected';
10620
+						$out .= '<option value="'.$obj->rowid.'" selected';
10621 10621
 						//if ($disabled) $out.=' disabled';						// with select2, field can't be preselected if disabled
10622
-						$out .= '>' . $labeltoshow . '</option>';
10622
+						$out .= '>'.$labeltoshow.'</option>';
10623 10623
 					} else {
10624 10624
 						if ($disabled && ($selected != $obj->rowid)) {
10625 10625
 							$resultat = '';
10626 10626
 						} else {
10627
-							$resultat = '<option value="' . $obj->rowid . '"';
10627
+							$resultat = '<option value="'.$obj->rowid.'"';
10628 10628
 							if ($disabled) {
10629 10629
 								$resultat .= ' disabled';
10630 10630
 							}
@@ -10664,14 +10664,14 @@  discard block
 block discarded – undo
10664 10664
 		global $langs;
10665 10665
 
10666 10666
 		if ($search_component_params_hidden != '' && !preg_match('/^\(.*\)$/', $search_component_params_hidden)) {    // If $search_component_params_hidden does not start and end with ()
10667
-			$search_component_params_hidden = '(' . $search_component_params_hidden . ')';
10667
+			$search_component_params_hidden = '('.$search_component_params_hidden.')';
10668 10668
 		}
10669 10669
 
10670 10670
 		$ret = '';
10671 10671
 
10672 10672
 		$ret .= '<div class="divadvancedsearchfieldcomp inline-block">';
10673 10673
 		$ret .= '<a href="#" class="dropdownsearch-toggle unsetcolor">';
10674
-		$ret .= '<span class="fas fa-filter linkobject boxfilter paddingright pictofixedwidth" title="' . dol_escape_htmltag($langs->trans("Filters")) . '" id="idsubimgproductdistribution"></span>';
10674
+		$ret .= '<span class="fas fa-filter linkobject boxfilter paddingright pictofixedwidth" title="'.dol_escape_htmltag($langs->trans("Filters")).'" id="idsubimgproductdistribution"></span>';
10675 10675
 		$ret .= '</a>';
10676 10676
 
10677 10677
 		$ret .= '<div class="divadvancedsearchfieldcompinput inline-block minwidth500 maxwidth300onsmartphone">';
@@ -10698,13 +10698,13 @@  discard block
 block discarded – undo
10698 10698
 				}
10699 10699
 
10700 10700
 				if ($countparenthesis == 0) {
10701
-					$char2 = dol_substr($search_component_params_hidden, $i+1, 1);
10702
-					$char3 = dol_substr($search_component_params_hidden, $i+2, 1);
10701
+					$char2 = dol_substr($search_component_params_hidden, $i + 1, 1);
10702
+					$char3 = dol_substr($search_component_params_hidden, $i + 2, 1);
10703 10703
 					if ($char == 'A' && $char2 == 'N' && $char3 == 'D') {
10704 10704
 						// We found a AND
10705 10705
 						$arrayofandtags[] = trim($s);
10706 10706
 						$s = '';
10707
-						$i+=2;
10707
+						$i += 2;
10708 10708
 					} else {
10709 10709
 						$s .= $char;
10710 10710
 					}
@@ -10728,8 +10728,8 @@  discard block
 block discarded – undo
10728 10728
 				include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
10729 10729
 				$searchtags = removeGlobalParenthesis($searchtags);
10730 10730
 
10731
-				$ret .= '<span class="marginleftonlyshort valignmiddle tagsearch" data-ufilterid="'.($tmpkey+1).'" data-ufilter="'.dol_escape_htmltag($tmpval).'">';
10732
-				$ret .= '<span class="tagsearchdelete select2-selection__choice__remove" data-ufilterid="'.($tmpkey+1).'">x</span> ';
10731
+				$ret .= '<span class="marginleftonlyshort valignmiddle tagsearch" data-ufilterid="'.($tmpkey + 1).'" data-ufilter="'.dol_escape_htmltag($tmpval).'">';
10732
+				$ret .= '<span class="tagsearchdelete select2-selection__choice__remove" data-ufilterid="'.($tmpkey + 1).'">x</span> ';
10733 10733
 				$ret .= dol_escape_htmltag($searchtags);
10734 10734
 				$ret .= '</span>';
10735 10735
 			}
@@ -10746,29 +10746,29 @@  discard block
 block discarded – undo
10746 10746
 			$ret .= '<input type="hidden" name="show_search_component_params_hidden" value="1">';
10747 10747
 		}
10748 10748
 		$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%')) -->";
10749
-		$ret .= '<input type="hidden" name="search_component_params_hidden" value="' . dol_escape_htmltag($search_component_params_hidden) . '">';
10749
+		$ret .= '<input type="hidden" name="search_component_params_hidden" value="'.dol_escape_htmltag($search_component_params_hidden).'">';
10750 10750
 		// $ret .= "<!-- sql= ".forgeSQLFromUniversalSearchCriteria($search_component_params_hidden, $errormessage)." -->";
10751 10751
 
10752 10752
 		// For compatibility with forms that show themself the search criteria in addition of this component, we output these fields
10753 10753
 		foreach ($arrayofcriterias as $criteria) {
10754 10754
 			foreach ($criteria as $criteriafamilykey => $criteriafamilyval) {
10755
-				if (in_array('search_' . $criteriafamilykey, $arrayofinputfieldsalreadyoutput)) {
10755
+				if (in_array('search_'.$criteriafamilykey, $arrayofinputfieldsalreadyoutput)) {
10756 10756
 					continue;
10757 10757
 				}
10758 10758
 				if (in_array($criteriafamilykey, array('rowid', 'ref_ext', 'entity', 'extraparams'))) {
10759 10759
 					continue;
10760 10760
 				}
10761 10761
 				if (in_array($criteriafamilyval['type'], array('date', 'datetime', 'timestamp'))) {
10762
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_start">';
10763
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_startyear">';
10764
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_startmonth">';
10765
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_startday">';
10766
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_end">';
10767
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_endyear">';
10768
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_endmonth">';
10769
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_endday">';
10762
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_start">';
10763
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_startyear">';
10764
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_startmonth">';
10765
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_startday">';
10766
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_end">';
10767
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_endyear">';
10768
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_endmonth">';
10769
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_endday">';
10770 10770
 				} else {
10771
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '">';
10771
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'">';
10772 10772
 				}
10773 10773
 			}
10774 10774
 		}
@@ -10776,7 +10776,7 @@  discard block
 block discarded – undo
10776 10776
 		$ret .= '</div>';
10777 10777
 
10778 10778
 		$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";
10779
-		$ret .= '<input type="text" placeholder="' . $langs->trans("Search") . '" name="search_component_params_input" class="noborderbottom search_component_input" value="">';
10779
+		$ret .= '<input type="text" placeholder="'.$langs->trans("Search").'" name="search_component_params_input" class="noborderbottom search_component_input" value="">';
10780 10780
 
10781 10781
 		$ret .= '</div>';
10782 10782
 		$ret .= '</div>';
@@ -10812,7 +10812,7 @@  discard block
 block discarded – undo
10812 10812
 
10813 10813
 		$TModels = array();
10814 10814
 
10815
-		include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php';
10815
+		include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
10816 10816
 		$formmail = new FormMail($this->db);
10817 10817
 		$result = $formmail->fetchAllEMailTemplate($modelType, $user, $langs);
10818 10818
 
@@ -10825,17 +10825,17 @@  discard block
 block discarded – undo
10825 10825
 			}
10826 10826
 		}
10827 10827
 
10828
-		$retstring .= '<select class="flat" id="select_' . $prefix . 'model_mail" name="' . $prefix . 'model_mail">';
10828
+		$retstring .= '<select class="flat" id="select_'.$prefix.'model_mail" name="'.$prefix.'model_mail">';
10829 10829
 
10830 10830
 		foreach ($TModels as $id_model => $label_model) {
10831
-			$retstring .= '<option value="' . $id_model . '"';
10832
-			$retstring .= ">" . $label_model . "</option>";
10831
+			$retstring .= '<option value="'.$id_model.'"';
10832
+			$retstring .= ">".$label_model."</option>";
10833 10833
 		}
10834 10834
 
10835 10835
 		$retstring .= "</select>";
10836 10836
 
10837 10837
 		if ($addjscombo) {
10838
-			$retstring .= ajax_combobox('select_' . $prefix . 'model_mail');
10838
+			$retstring .= ajax_combobox('select_'.$prefix.'model_mail');
10839 10839
 		}
10840 10840
 
10841 10841
 		return $retstring;
@@ -10886,16 +10886,16 @@  discard block
 block discarded – undo
10886 10886
 
10887 10887
 		foreach ($buttons as $button) {
10888 10888
 			$addclass = empty($button['addclass']) ? '' : $button['addclass'];
10889
-			$retstring .= '<input type="submit" class="button button-' . $button['name'] . ($morecss ? ' ' . $morecss : '') . ' ' . $addclass . '" name="' . $button['name'] . '" value="' . dol_escape_htmltag($langs->trans($button['label_key'])) . '">';
10889
+			$retstring .= '<input type="submit" class="button button-'.$button['name'].($morecss ? ' '.$morecss : '').' '.$addclass.'" name="'.$button['name'].'" value="'.dol_escape_htmltag($langs->trans($button['label_key'])).'">';
10890 10890
 		}
10891 10891
 		$retstring .= $withoutdiv ? '' : '</div>';
10892 10892
 
10893 10893
 		if ($dol_openinpopup) {
10894
-			$retstring .= '<!-- buttons are shown into a $dol_openinpopup=' . $dol_openinpopup . ' context, so we enable the close of dialog on cancel -->' . "\n";
10895
-			$retstring .= '<script nonce="' . getNonce() . '">';
10894
+			$retstring .= '<!-- buttons are shown into a $dol_openinpopup='.$dol_openinpopup.' context, so we enable the close of dialog on cancel -->'."\n";
10895
+			$retstring .= '<script nonce="'.getNonce().'">';
10896 10896
 			$retstring .= 'jQuery(".button-cancel").click(function(e) {
10897
-				e.preventDefault(); console.log(\'We click on cancel in iframe popup ' . $dol_openinpopup . '\');
10898
-				window.parent.jQuery(\'#idfordialog' . $dol_openinpopup . '\').dialog(\'close\');
10897
+				e.preventDefault(); console.log(\'We click on cancel in iframe popup ' . $dol_openinpopup.'\');
10898
+				window.parent.jQuery(\'#idfordialog' . $dol_openinpopup.'\').dialog(\'close\');
10899 10899
 				 });';
10900 10900
 			$retstring .= '</script>';
10901 10901
 		}
@@ -10924,7 +10924,7 @@  discard block
 block discarded – undo
10924 10924
 		dol_syslog(__METHOD__, LOG_DEBUG);
10925 10925
 
10926 10926
 		$sql = "SELECT rowid, code, label as label";
10927
-		$sql .= " FROM " . MAIN_DB_PREFIX . 'c_invoice_subtype';
10927
+		$sql .= " FROM ".MAIN_DB_PREFIX.'c_invoice_subtype';
10928 10928
 		$sql .= " WHERE active = 1";
10929 10929
 
10930 10930
 		$resql = $this->db->query($sql);
@@ -10935,7 +10935,7 @@  discard block
 block discarded – undo
10935 10935
 				$obj = $this->db->fetch_object($resql);
10936 10936
 
10937 10937
 				// If translation exists, we use it, otherwise we take the default wording
10938
-				$label = ($langs->trans("InvoiceSubtype" . $obj->rowid) != "InvoiceSubtype" . $obj->rowid) ? $langs->trans("InvoiceSubtype" . $obj->rowid) : (($obj->label != '-') ? $obj->label : '');
10938
+				$label = ($langs->trans("InvoiceSubtype".$obj->rowid) != "InvoiceSubtype".$obj->rowid) ? $langs->trans("InvoiceSubtype".$obj->rowid) : (($obj->label != '-') ? $obj->label : '');
10939 10939
 				$this->cache_invoice_subtype[$obj->rowid]['rowid'] = $obj->rowid;
10940 10940
 				$this->cache_invoice_subtype[$obj->rowid]['code'] = $obj->code;
10941 10941
 				$this->cache_invoice_subtype[$obj->rowid]['label'] = $label;
@@ -10967,18 +10967,18 @@  discard block
 block discarded – undo
10967 10967
 		global $langs, $user;
10968 10968
 
10969 10969
 		$out = '';
10970
-		dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG);
10970
+		dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG);
10971 10971
 
10972 10972
 		$this->load_cache_invoice_subtype();
10973 10973
 
10974
-		$out .= '<select id="' . $htmlname . '" class="flat selectsubtype' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">';
10974
+		$out .= '<select id="'.$htmlname.'" class="flat selectsubtype'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
10975 10975
 		if ($addempty) {
10976 10976
 			$out .= '<option value="0">&nbsp;</option>';
10977 10977
 		}
10978 10978
 
10979 10979
 		foreach ($this->cache_invoice_subtype as $rowid => $subtype) {
10980 10980
 			$label = $subtype['label'];
10981
-			$out .= '<option value="' . $subtype['rowid'] . '"';
10981
+			$out .= '<option value="'.$subtype['rowid'].'"';
10982 10982
 			if ($selected == $subtype['rowid']) {
10983 10983
 				$out .= ' selected="selected"';
10984 10984
 			}
Please login to merge, or discard this patch.
htdocs/core/class/html.formprojet.class.php 1 patch
Spacing   +105 added lines, -105 removed lines patch added patch discarded remove patch
@@ -96,18 +96,18 @@  discard block
 block discarded – undo
96 96
 			$placeholder = '';
97 97
 
98 98
 			if ($selected && empty($selected_input_value)) {
99
-				require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
99
+				require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
100 100
 				$project = new Project($this->db);
101 101
 				$project->fetch($selected);
102 102
 				$selected_input_value = $project->ref;
103 103
 			}
104
-			$urloption = 'socid=' . ((int) $socid) . '&htmlname=' . urlencode($htmlname) . '&discardclosed=' . ((int) $discard_closed);
104
+			$urloption = 'socid='.((int) $socid).'&htmlname='.urlencode($htmlname).'&discardclosed='.((int) $discard_closed);
105 105
 			if ($morefilter == 'usage_organize_event=1') {
106 106
 				$urloption .= '&usage_organize_event=1';
107 107
 			}
108
-			$out .= '<input type="text" class="minwidth200' . ($morecss ? ' ' . $morecss : '') . '" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' />';
108
+			$out .= '<input type="text" class="minwidth200'.($morecss ? ' '.$morecss : '').'" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' />';
109 109
 
110
-			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/projet/ajax/projects.php', $urloption, $conf->global->PROJECT_USE_SEARCH_TO_SELECT, 0, array());
110
+			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/projet/ajax/projects.php', $urloption, $conf->global->PROJECT_USE_SEARCH_TO_SELECT, 0, array());
111 111
 		} else {
112 112
 			$out .= $this->select_projects_list($socid, $selected, $htmlname, $maxlength, $option_only, $show_empty, abs($discard_closed), $forcefocus, $disabled, 0, $filterkey, 1, $forceaddid, $htmlid, $morecss, $morefilter);
113 113
 		}
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
 		// phpcs:enable
154 154
 		global $user, $conf, $langs;
155 155
 
156
-		require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
156
+		require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
157 157
 
158 158
 		if (empty($htmlid)) {
159 159
 			$htmlid = $htmlname;
@@ -175,26 +175,26 @@  discard block
 block discarded – undo
175 175
 
176 176
 		// Search all projects
177 177
 		$sql = "SELECT p.rowid, p.ref, p.title, p.fk_soc, p.fk_statut, p.public, s.nom as name, s.name_alias";
178
-		$sql .= " FROM " . $this->db->prefix() . "projet as p LEFT JOIN " . $this->db->prefix() . "societe as s ON s.rowid = p.fk_soc";
179
-		$sql .= " WHERE p.entity IN (" . getEntity('project') . ")";
178
+		$sql .= " FROM ".$this->db->prefix()."projet as p LEFT JOIN ".$this->db->prefix()."societe as s ON s.rowid = p.fk_soc";
179
+		$sql .= " WHERE p.entity IN (".getEntity('project').")";
180 180
 		if ($projectsListId !== false) {
181
-			$sql .= " AND p.rowid IN (" . $this->db->sanitize($projectsListId) . ")";
181
+			$sql .= " AND p.rowid IN (".$this->db->sanitize($projectsListId).")";
182 182
 		}
183 183
 		if ($socid == 0) {
184 184
 			$sql .= " AND (p.fk_soc=0 OR p.fk_soc IS NULL)";
185 185
 		}
186 186
 		if ($socid > 0) {
187 187
 			if (!getDolGlobalString('PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY')) {
188
-				$sql .= " AND (p.fk_soc=" . ((int) $socid) . " OR p.fk_soc IS NULL)";
188
+				$sql .= " AND (p.fk_soc=".((int) $socid)." OR p.fk_soc IS NULL)";
189 189
 			} elseif (getDolGlobalString('PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY') != 'all') {    // PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY is 'all' or a list of ids separated by coma.
190
-				$sql .= " AND (p.fk_soc IN (" . $this->db->sanitize(((int) $socid) . ", " . getDolGlobalString('PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY')) . ") OR p.fk_soc IS NULL)";
190
+				$sql .= " AND (p.fk_soc IN (".$this->db->sanitize(((int) $socid).", ".getDolGlobalString('PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY')).") OR p.fk_soc IS NULL)";
191 191
 			}
192 192
 		}
193 193
 		if (!empty($filterkey)) {
194 194
 			$sql .= natural_search(array('p.title', 'p.ref'), $filterkey);
195 195
 		}
196 196
 		if ($morefilter) {
197
-			$sql .= ' AND (' . $this->db->sanitize($morefilter, 0, 1) . ')';
197
+			$sql .= ' AND ('.$this->db->sanitize($morefilter, 0, 1).')';
198 198
 		}
199 199
 		$sql .= " ORDER BY p.ref ASC";
200 200
 
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
 				$morecss .= ' minwidth100';
205 205
 			}
206 206
 			if (empty($option_only)) {
207
-				$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ' id="' . $htmlid . '" name="' . $htmlname . '">';
207
+				$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').' id="'.$htmlid.'" name="'.$htmlname.'">';
208 208
 			}
209 209
 			if (!empty($show_empty)) {
210 210
 				if (is_numeric($show_empty)) {
@@ -230,37 +230,37 @@  discard block
 block discarded – undo
230 230
 						$labeltoshow = dol_trunc($obj->ref, 18);
231 231
 						//if ($obj->public) $labeltoshow.=' ('.$langs->trans("SharedProject").')';
232 232
 						//else $labeltoshow.=' ('.$langs->trans("Private").')';
233
-						$labeltoshow .= ', ' . dol_trunc($obj->title, $maxlength);
233
+						$labeltoshow .= ', '.dol_trunc($obj->title, $maxlength);
234 234
 						if ($obj->name) {
235
-							$labeltoshow .= ' - ' . $obj->name;
235
+							$labeltoshow .= ' - '.$obj->name;
236 236
 							if ($obj->name_alias) {
237
-								$labeltoshow .= ' (' . $obj->name_alias . ')';
237
+								$labeltoshow .= ' ('.$obj->name_alias.')';
238 238
 							}
239 239
 						}
240 240
 
241 241
 						$disabled = 0;
242 242
 						if ($obj->fk_statut == 0) {
243 243
 							$disabled = 1;
244
-							$labeltoshow .= ' - ' . $langs->trans("Draft");
244
+							$labeltoshow .= ' - '.$langs->trans("Draft");
245 245
 						} elseif ($obj->fk_statut == 2) {
246 246
 							if ($discard_closed == 2) {
247 247
 								$disabled = 1;
248 248
 							}
249
-							$labeltoshow .= ' - ' . $langs->trans("Closed");
249
+							$labeltoshow .= ' - '.$langs->trans("Closed");
250 250
 						} elseif (!getDolGlobalString('PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY') && $socid > 0 && (!empty($obj->fk_soc) && $obj->fk_soc != $socid)) {
251 251
 							$disabled = 1;
252
-							$labeltoshow .= ' - ' . $langs->trans("LinkedToAnotherCompany");
252
+							$labeltoshow .= ' - '.$langs->trans("LinkedToAnotherCompany");
253 253
 						}
254 254
 
255 255
 						if (!empty($selected) && $selected == $obj->rowid) {
256
-							$out .= '<option value="' . $obj->rowid . '" selected';
256
+							$out .= '<option value="'.$obj->rowid.'" selected';
257 257
 							//if ($disabled) $out.=' disabled';						// with select2, field can't be preselected if disabled
258
-							$out .= '>' . $labeltoshow . '</option>';
258
+							$out .= '>'.$labeltoshow.'</option>';
259 259
 						} else {
260 260
 							if ($hideunselectables && $disabled && ($selected != $obj->rowid)) {
261 261
 								$resultat = '';
262 262
 							} else {
263
-								$resultat = '<option value="' . $obj->rowid . '"';
263
+								$resultat = '<option value="'.$obj->rowid.'"';
264 264
 								if ($disabled) {
265 265
 									$resultat .= ' disabled';
266 266
 								}
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
 								'value' => $obj->ref,
278 278
 								'ref' => $obj->ref,
279 279
 								'labelx' => $labeltoshow,
280
-								'label' => ($disabled ? '<span class="opacitymedium">' . $labeltoshow . '</span>' : $labeltoshow),
280
+								'label' => ($disabled ? '<span class="opacitymedium">'.$labeltoshow.'</span>' : $labeltoshow),
281 281
 								'disabled' => (bool) $disabled
282 282
 							);
283 283
 						}
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
 
296 296
 				// Use select2 selector
297 297
 				if (!empty($conf->use_javascript_ajax)) {
298
-					include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
298
+					include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
299 299
 					$comboenhancement = ajax_combobox($htmlid, array(), 0, $forcefocus);
300 300
 					$out .= $comboenhancement;
301 301
 					$morecss .= ' minwidth100';
@@ -338,7 +338,7 @@  discard block
 block discarded – undo
338 338
 	{
339 339
 		global $user, $conf, $langs;
340 340
 
341
-		require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
341
+		require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
342 342
 
343 343
 		if (is_null($usertofilter)) {
344 344
 			$usertofilter = $user;
@@ -362,19 +362,19 @@  discard block
 block discarded – undo
362 362
 		$sql = "SELECT t.rowid, t.ref as tref, t.label as tlabel, t.progress,";
363 363
 		$sql .= " p.rowid as pid, p.ref, p.title, p.fk_soc, p.fk_statut, p.public, p.usage_task,";
364 364
 		$sql .= " s.nom as name";
365
-		$sql .= " FROM " . $this->db->prefix() . "projet as p";
366
-		$sql .= " LEFT JOIN " . $this->db->prefix() . "societe as s ON s.rowid = p.fk_soc,";
367
-		$sql .= " " . $this->db->prefix() . "projet_task as t";
368
-		$sql .= " WHERE p.entity IN (" . getEntity('project') . ")";
365
+		$sql .= " FROM ".$this->db->prefix()."projet as p";
366
+		$sql .= " LEFT JOIN ".$this->db->prefix()."societe as s ON s.rowid = p.fk_soc,";
367
+		$sql .= " ".$this->db->prefix()."projet_task as t";
368
+		$sql .= " WHERE p.entity IN (".getEntity('project').")";
369 369
 		$sql .= " AND t.fk_projet = p.rowid";
370 370
 		if ($projectsListId) {
371
-			$sql .= " AND p.rowid IN (" . $this->db->sanitize($projectsListId) . ")";
371
+			$sql .= " AND p.rowid IN (".$this->db->sanitize($projectsListId).")";
372 372
 		}
373 373
 		if ($socid == 0) {
374 374
 			$sql .= " AND (p.fk_soc=0 OR p.fk_soc IS NULL)";
375 375
 		}
376 376
 		if ($socid > 0) {
377
-			$sql .= " AND (p.fk_soc=" . ((int) $socid) . " OR p.fk_soc IS NULL)";
377
+			$sql .= " AND (p.fk_soc=".((int) $socid)." OR p.fk_soc IS NULL)";
378 378
 		}
379 379
 		$sql .= " ORDER BY p.ref, t.ref ASC";
380 380
 
@@ -382,14 +382,14 @@  discard block
 block discarded – undo
382 382
 		if ($resql) {
383 383
 			// Use select2 selector
384 384
 			if (empty($option_only) && !empty($conf->use_javascript_ajax)) {
385
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
385
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
386 386
 				$comboenhancement = ajax_combobox($htmlname, '', 0, $forcefocus);
387 387
 				$out .= $comboenhancement;
388 388
 				$morecss .= ' minwidth150imp';
389 389
 			}
390 390
 
391 391
 			if (empty($option_only)) {
392
-				$out .= '<select class="valignmiddle flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ' id="' . $htmlname . '" name="' . $htmlname . '">';
392
+				$out .= '<select class="valignmiddle flat'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').' id="'.$htmlname.'" name="'.$htmlname.'">';
393 393
 			}
394 394
 			if (!empty($show_empty)) {
395 395
 				$out .= '<option value="0" class="optiongrey">';
@@ -435,58 +435,58 @@  discard block
 block discarded – undo
435 435
 							$labeltoshow .= dol_trunc($obj->ref, 18); // Project ref
436 436
 							//if ($obj->public) $labeltoshow.=' ('.$langs->trans("SharedProject").')';
437 437
 							//else $labeltoshow.=' ('.$langs->trans("Private").')';
438
-							$labeltoshow .= ' ' . dol_trunc($obj->title, $maxlength);
438
+							$labeltoshow .= ' '.dol_trunc($obj->title, $maxlength);
439 439
 							$titletoshow = $labeltoshow;
440 440
 
441 441
 							if ($obj->name) {
442
-								$labeltoshow .= ' (' . $obj->name . ')';
443
-								$titletoshow .= ' <span class="opacitymedium">(' . $obj->name . ')</span>';
442
+								$labeltoshow .= ' ('.$obj->name.')';
443
+								$titletoshow .= ' <span class="opacitymedium">('.$obj->name.')</span>';
444 444
 							}
445 445
 
446 446
 							$disabled = 0;
447 447
 							if ($obj->fk_statut == Project::STATUS_DRAFT) {
448 448
 								$disabled = 1;
449
-								$labeltoshow .= ' - ' . $langs->trans("Draft");
450
-								$titletoshow .= ' -  <span class="opacitymedium">' . $langs->trans("Draft") . '</span>';
449
+								$labeltoshow .= ' - '.$langs->trans("Draft");
450
+								$titletoshow .= ' -  <span class="opacitymedium">'.$langs->trans("Draft").'</span>';
451 451
 							} elseif ($obj->fk_statut == Project::STATUS_CLOSED) {
452 452
 								if ($discard_closed == 2) {
453 453
 									$disabled = 1;
454 454
 								}
455
-								$labeltoshow .= ' - ' . $langs->trans("Closed");
456
-								$titletoshow .= ' - <span class="opacitymedium">' . $langs->trans("Closed") . '</span>';
455
+								$labeltoshow .= ' - '.$langs->trans("Closed");
456
+								$titletoshow .= ' - <span class="opacitymedium">'.$langs->trans("Closed").'</span>';
457 457
 							} elseif ($socid > 0 && (!empty($obj->fk_soc) && $obj->fk_soc != $socid)) {
458 458
 								$disabled = 1;
459
-								$labeltoshow .= ' - ' . $langs->trans("LinkedToAnotherCompany");
460
-								$titletoshow .= ' - <span class="opacitymedium">' . $langs->trans("LinkedToAnotherCompany") . '</span>';
459
+								$labeltoshow .= ' - '.$langs->trans("LinkedToAnotherCompany");
460
+								$titletoshow .= ' - <span class="opacitymedium">'.$langs->trans("LinkedToAnotherCompany").'</span>';
461 461
 							}
462 462
 							$labeltoshow .= ' - ';
463 463
 							$titletoshow .= ' - ';
464 464
 						}
465 465
 
466 466
 						// Label for task
467
-						$labeltoshow .= $obj->tref . ' ' . dol_trunc($obj->tlabel, $maxlength);
468
-						$titletoshow .= $obj->tref . ' ' . dol_trunc($obj->tlabel, $maxlength);
467
+						$labeltoshow .= $obj->tref.' '.dol_trunc($obj->tlabel, $maxlength);
468
+						$titletoshow .= $obj->tref.' '.dol_trunc($obj->tlabel, $maxlength);
469 469
 						if ($obj->usage_task && preg_match('/progress/', $showmore)) {
470
-							$labeltoshow .= ' <span class="opacitymedium">(' . $obj->progress . '%)</span>';
471
-							$titletoshow .= ' <span class="opacitymedium">(' . $obj->progress . '%)</span>';
470
+							$labeltoshow .= ' <span class="opacitymedium">('.$obj->progress.'%)</span>';
471
+							$titletoshow .= ' <span class="opacitymedium">('.$obj->progress.'%)</span>';
472 472
 						}
473 473
 
474 474
 						if (!empty($selected) && $selected == $obj->rowid) {
475
-							$out .= '<option value="' . $obj->rowid . '" selected';
476
-							$out .= ' data-html="' . dol_escape_htmltag($titletoshow) . '"';
475
+							$out .= '<option value="'.$obj->rowid.'" selected';
476
+							$out .= ' data-html="'.dol_escape_htmltag($titletoshow).'"';
477 477
 							//if ($disabled) $out.=' disabled';						// with select2, field can't be preselected if disabled
478
-							$out .= '>' . $labeltoshow . '</option>';
478
+							$out .= '>'.$labeltoshow.'</option>';
479 479
 						} else {
480 480
 							if ($hideunselectables && $disabled && ($selected != $obj->rowid)) {
481 481
 								$resultat = '';
482 482
 							} else {
483
-								$resultat = '<option value="' . $obj->rowid . '"';
483
+								$resultat = '<option value="'.$obj->rowid.'"';
484 484
 								if ($disabled) {
485 485
 									$resultat .= ' disabled';
486 486
 								}
487 487
 								//if ($obj->public) $labeltoshow.=' ('.$langs->trans("Public").')';
488 488
 								//else $labeltoshow.=' ('.$langs->trans("Private").')';
489
-								$resultat .= ' data-html="' . dol_escape_htmltag($titletoshow) . '"';
489
+								$resultat .= ' data-html="'.dol_escape_htmltag($titletoshow).'"';
490 490
 								$resultat .= '>';
491 491
 								$resultat .= $labeltoshow;
492 492
 								$resultat .= '</option>';
@@ -607,30 +607,30 @@  discard block
 block discarded – undo
607 607
 		if ($linkedtothirdparty) {
608 608
 			$sql .= ", s.nom as name";
609 609
 		}
610
-		$sql .= " FROM " . $this->db->prefix() . $table_element . " as t";
610
+		$sql .= " FROM ".$this->db->prefix().$table_element." as t";
611 611
 		if ($linkedtothirdparty) {
612
-			$sql .= ", " . $this->db->prefix() . "societe as s";
612
+			$sql .= ", ".$this->db->prefix()."societe as s";
613 613
 		}
614
-		$sql .= " WHERE " . $projectkey . " is null";
614
+		$sql .= " WHERE ".$projectkey." is null";
615 615
 		if (!empty($socid) && $linkedtothirdparty) {
616 616
 			if (is_numeric($socid)) {
617
-				$sql .= " AND t.fk_soc = " . ((int) $socid);
617
+				$sql .= " AND t.fk_soc = ".((int) $socid);
618 618
 			} else {
619
-				$sql .= " AND t.fk_soc IN (" . $this->db->sanitize($socid) . ")";
619
+				$sql .= " AND t.fk_soc IN (".$this->db->sanitize($socid).")";
620 620
 			}
621 621
 		}
622 622
 		if (!in_array($table_element, array('expensereport_det', 'stock_mouvement'))) {
623
-			$sql .= ' AND t.entity IN (' . getEntity('project') . ')';
623
+			$sql .= ' AND t.entity IN ('.getEntity('project').')';
624 624
 		}
625 625
 		if ($linkedtothirdparty) {
626 626
 			$sql .= " AND s.rowid = t.fk_soc";
627 627
 		}
628 628
 		if ($sqlfilter) {
629
-			$sql .= " AND " . $sqlfilter;
629
+			$sql .= " AND ".$sqlfilter;
630 630
 		}
631 631
 		$sql .= " ORDER BY ref DESC";
632 632
 
633
-		dol_syslog(get_class($this) . '::select_element', LOG_DEBUG);
633
+		dol_syslog(get_class($this).'::select_element', LOG_DEBUG);
634 634
 		$resql = $this->db->query($sql);
635 635
 		if ($resql) {
636 636
 			$num = $this->db->num_rows($resql);
@@ -638,18 +638,18 @@  discard block
 block discarded – undo
638 638
 			$sellist = '';
639 639
 
640 640
 			if ($num > 0) {
641
-				$sellist = '<select class="flat elementselect css' . $table_element . ($morecss ? ' ' . $morecss : '') . '" name="elementselect">';
642
-				$sellist .= '<option value="-1"' . ($placeholder ? ' class="optiongrey"' : '') . '>' . $placeholder . '</option>';
641
+				$sellist = '<select class="flat elementselect css'.$table_element.($morecss ? ' '.$morecss : '').'" name="elementselect">';
642
+				$sellist .= '<option value="-1"'.($placeholder ? ' class="optiongrey"' : '').'>'.$placeholder.'</option>';
643 643
 				while ($i < $num) {
644 644
 					$obj = $this->db->fetch_object($resql);
645 645
 					$ref = $obj->ref ? $obj->ref : $obj->rowid;
646 646
 					if (!empty($obj->ref_supplier)) {
647
-						$ref .= ' (' . $obj->ref_supplier . ')';
647
+						$ref .= ' ('.$obj->ref_supplier.')';
648 648
 					}
649 649
 					if (!empty($obj->name)) {
650
-						$ref .= ' - ' . $obj->name;
650
+						$ref .= ' - '.$obj->name;
651 651
 					}
652
-					$sellist .= '<option value="' . $obj->rowid . '">' . $ref . '</option>';
652
+					$sellist .= '<option value="'.$obj->rowid.'">'.$ref.'</option>';
653 653
 					$i++;
654 654
 				}
655 655
 				$sellist .= '</select>';
@@ -667,7 +667,7 @@  discard block
 block discarded – undo
667 667
 			dol_print_error($this->db);
668 668
 			$this->error = $this->db->lasterror();
669 669
 			$this->errors[] = $this->db->lasterror();
670
-			dol_syslog(get_class($this) . "::select_element " . $this->error, LOG_ERR);
670
+			dol_syslog(get_class($this)."::select_element ".$this->error, LOG_ERR);
671 671
 			return -1;
672 672
 		}
673 673
 	}
@@ -692,7 +692,7 @@  discard block
 block discarded – undo
692 692
 		global $conf, $langs, $user;
693 693
 
694 694
 		$sql = "SELECT rowid, code, label, percent";
695
-		$sql .= " FROM " . $this->db->prefix() . 'c_lead_status';
695
+		$sql .= " FROM ".$this->db->prefix().'c_lead_status';
696 696
 		$sql .= " WHERE active = 1";
697 697
 		$sql .= " ORDER BY position";
698 698
 
@@ -701,31 +701,31 @@  discard block
 block discarded – undo
701 701
 			$num = $this->db->num_rows($resql);
702 702
 			$i = 0;
703 703
 			if ($num > 0) {
704
-				$sellist = '<select class="flat oppstatus' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . '">';
704
+				$sellist = '<select class="flat oppstatus'.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.'">';
705 705
 				if ($showempty) {
706 706
 					// Without &nbsp, strange move of screen when switching value
707 707
 					$sellist .= '<option value="-1">&nbsp;</option>';
708 708
 				}
709 709
 				if ($showallnone) {
710
-					$sellist .= '<option value="all"' . ($preselected == 'all' ? ' selected="selected"' : '') . '>-- ' . $langs->trans("OnlyOpportunitiesShort") . '</option>';
711
-					$sellist .= '<option value="openedopp"' . ($preselected == 'openedopp' ? ' selected="selected"' : '') . '>-- ' . $langs->trans("OpenedOpportunitiesShort") . '</option>';
712
-					$sellist .= '<option value="notopenedopp"' . ($preselected == 'notopenedopp' ? ' selected="selected"' : '') . '>-- ' . $langs->trans("NotOpenedOpportunitiesShort") . '</option>';
713
-					$sellist .= '<option value="none"' . ($preselected == 'none' ? ' selected="selected"' : '') . '>-- ' . $langs->trans("NotAnOpportunityShort") . '</option>';
710
+					$sellist .= '<option value="all"'.($preselected == 'all' ? ' selected="selected"' : '').'>-- '.$langs->trans("OnlyOpportunitiesShort").'</option>';
711
+					$sellist .= '<option value="openedopp"'.($preselected == 'openedopp' ? ' selected="selected"' : '').'>-- '.$langs->trans("OpenedOpportunitiesShort").'</option>';
712
+					$sellist .= '<option value="notopenedopp"'.($preselected == 'notopenedopp' ? ' selected="selected"' : '').'>-- '.$langs->trans("NotOpenedOpportunitiesShort").'</option>';
713
+					$sellist .= '<option value="none"'.($preselected == 'none' ? ' selected="selected"' : '').'>-- '.$langs->trans("NotAnOpportunityShort").'</option>';
714 714
 				}
715 715
 				while ($i < $num) {
716 716
 					$obj = $this->db->fetch_object($resql);
717 717
 
718
-					$sellist .= '<option value="' . $obj->rowid . '" defaultpercent="' . $obj->percent . '" elemcode="' . $obj->code . '"';
718
+					$sellist .= '<option value="'.$obj->rowid.'" defaultpercent="'.$obj->percent.'" elemcode="'.$obj->code.'"';
719 719
 					if ($obj->rowid == $preselected) {
720 720
 						$sellist .= ' selected="selected"';
721 721
 					}
722 722
 					$sellist .= '>';
723 723
 					if ($useshortlabel) {
724
-						$finallabel = ($langs->transnoentitiesnoconv("OppStatus" . $obj->code) != "OppStatus" . $obj->code ? $langs->transnoentitiesnoconv("OppStatus" . $obj->code) : $obj->label);
724
+						$finallabel = ($langs->transnoentitiesnoconv("OppStatus".$obj->code) != "OppStatus".$obj->code ? $langs->transnoentitiesnoconv("OppStatus".$obj->code) : $obj->label);
725 725
 					} else {
726
-						$finallabel = ($langs->transnoentitiesnoconv("OppStatus" . $obj->code) != "OppStatus" . $obj->code ? $langs->transnoentitiesnoconv("OppStatus" . $obj->code) : $obj->label);
726
+						$finallabel = ($langs->transnoentitiesnoconv("OppStatus".$obj->code) != "OppStatus".$obj->code ? $langs->transnoentitiesnoconv("OppStatus".$obj->code) : $obj->label);
727 727
 						if ($showpercent) {
728
-							$finallabel .= ' (' . $obj->percent . '%)';
728
+							$finallabel .= ' ('.$obj->percent.'%)';
729 729
 						}
730 730
 					}
731 731
 					$sellist .= $finallabel;
@@ -754,7 +754,7 @@  discard block
 block discarded – undo
754 754
 		} else {
755 755
 			$this->error = $this->db->lasterror();
756 756
 			$this->errors[] = $this->db->lasterror();
757
-			dol_syslog(get_class($this) . "::selectOpportunityStatus " . $this->error, LOG_ERR);
757
+			dol_syslog(get_class($this)."::selectOpportunityStatus ".$this->error, LOG_ERR);
758 758
 			return -1;
759 759
 		}
760 760
 	}
@@ -788,7 +788,7 @@  discard block
 block discarded – undo
788 788
 		if (is_array($selected)) {
789 789
 			$selectedarray = $selected;
790 790
 		} elseif ($selected == 99) {
791
-			$selectedarray = array(0,1);
791
+			$selectedarray = array(0, 1);
792 792
 		} else {
793 793
 			$selectedarray = explode(',', $selected);
794 794
 		}
@@ -812,24 +812,24 @@  discard block
 block discarded – undo
812 812
 	{
813 813
 		global $user, $conf, $langs;
814 814
 
815
-		require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
815
+		require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
816 816
 
817 817
 		$out = '';
818 818
 		if (empty($lineOnly)) {
819 819
 			// Search Invoice
820 820
 			$sql = "SELECT f.rowid, f.ref as fref,";
821 821
 			$sql .= ' s.nom as name';
822
-			$sql .= ' FROM ' . $this->db->prefix() . 'projet as p';
823
-			$sql .= ' INNER JOIN ' . $this->db->prefix() . 'societe as s ON s.rowid = p.fk_soc';
824
-			$sql .= ' INNER JOIN ' . $this->db->prefix() . 'facture as f ON f.fk_projet = p.rowid';
825
-			$sql .= " WHERE p.entity IN (" . getEntity('project') . ")";
822
+			$sql .= ' FROM '.$this->db->prefix().'projet as p';
823
+			$sql .= ' INNER JOIN '.$this->db->prefix().'societe as s ON s.rowid = p.fk_soc';
824
+			$sql .= ' INNER JOIN '.$this->db->prefix().'facture as f ON f.fk_projet = p.rowid';
825
+			$sql .= " WHERE p.entity IN (".getEntity('project').")";
826 826
 			if (!empty($filters)) {
827 827
 				foreach ($filters as $key => $value) {
828 828
 					if ($key == 'p.rowid') {
829
-						$sql .= " AND p.rowid=" . (int) $value;
829
+						$sql .= " AND p.rowid=".(int) $value;
830 830
 					}
831 831
 					if ($key == 'f.rowid') {
832
-						$sql .= " AND f.rowid=" . (int) $value;
832
+						$sql .= " AND f.rowid=".(int) $value;
833 833
 					}
834 834
 				}
835 835
 			}
@@ -839,26 +839,26 @@  discard block
 block discarded – undo
839 839
 			if ($resql) {
840 840
 				// Use select2 selector
841 841
 				if (!empty($conf->use_javascript_ajax)) {
842
-					include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
842
+					include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
843 843
 					$comboenhancement = ajax_combobox($htmlNameInvoice, array(array('method'=>'getLines', 'url'=>dol_buildpath('/core/ajax/ajaxinvoiceline.php', 1), 'htmlname'=>$htmlNameInvoiceLine)), 0, 0);
844 844
 					$out .= $comboenhancement;
845 845
 					$morecss = 'minwidth200imp maxwidth500';
846 846
 				}
847 847
 
848
-				$out .= '<select class="valignmiddle flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlNameInvoice . '" name="' . $htmlNameInvoice . '">';
848
+				$out .= '<select class="valignmiddle flat'.($morecss ? ' '.$morecss : '').'" id="'.$htmlNameInvoice.'" name="'.$htmlNameInvoice.'">';
849 849
 				$num = $this->db->num_rows($resql);
850 850
 				if ($num) {
851 851
 					while ($obj = $this->db->fetch_object($resql)) {
852 852
 						$labeltoshow = $obj->fref; // Invoice ref
853 853
 						if ($obj->name) {
854
-							$labeltoshow .= ' - ' . $obj->name;
854
+							$labeltoshow .= ' - '.$obj->name;
855 855
 						}
856 856
 
857
-						$out .= '<option value="' . $obj->rowid . '" ';
857
+						$out .= '<option value="'.$obj->rowid.'" ';
858 858
 						if (!empty($selectedInvoiceId) && $selectedInvoiceId == $obj->rowid) {
859 859
 							$out .= ' selected ';
860 860
 						}
861
-						$out .= '>' . $labeltoshow . '</option>';
861
+						$out .= '>'.$labeltoshow.'</option>';
862 862
 					}
863 863
 				}
864 864
 				$out .= '</select>';
@@ -870,20 +870,20 @@  discard block
 block discarded – undo
870 870
 
871 871
 		// Search Invoice Line
872 872
 		$sql = "SELECT fd.rowid, fd.label, fd.description";
873
-		$sql .= ' FROM ' . $this->db->prefix() . 'projet as p';
874
-		$sql .= ' INNER JOIN ' . $this->db->prefix() . 'societe as s ON s.rowid = p.fk_soc';
875
-		$sql .= ' INNER JOIN ' . $this->db->prefix() . 'facture as f ON f.fk_projet = p.rowid';
876
-		$sql .= ' INNER JOIN ' . $this->db->prefix() . 'facturedet as fd ON fd.fk_facture = f.rowid';
877
-		$sql .= " WHERE p.entity IN (" . getEntity('project') . ")";
873
+		$sql .= ' FROM '.$this->db->prefix().'projet as p';
874
+		$sql .= ' INNER JOIN '.$this->db->prefix().'societe as s ON s.rowid = p.fk_soc';
875
+		$sql .= ' INNER JOIN '.$this->db->prefix().'facture as f ON f.fk_projet = p.rowid';
876
+		$sql .= ' INNER JOIN '.$this->db->prefix().'facturedet as fd ON fd.fk_facture = f.rowid';
877
+		$sql .= " WHERE p.entity IN (".getEntity('project').")";
878 878
 		if (!empty($filters)) {
879 879
 			foreach ($filters as $key => $value) {
880 880
 				if ($key == 'p.rowid') {
881
-					$sql .= " AND p.rowid=" . (int) $value;
881
+					$sql .= " AND p.rowid=".(int) $value;
882 882
 				}
883 883
 			}
884 884
 		}
885 885
 		if (!empty($selectedInvoiceId)) {
886
-			$sql .= " AND f.rowid=" . (int) $selectedInvoiceId;
886
+			$sql .= " AND f.rowid=".(int) $selectedInvoiceId;
887 887
 		}
888 888
 		$sql .= " ORDER BY p.ref, f.ref ASC";
889 889
 		$resql = $this->db->query($sql);
@@ -891,24 +891,24 @@  discard block
 block discarded – undo
891 891
 			// Use select2 selector
892 892
 			if (empty($lineOnly)) {
893 893
 				if (!empty($conf->use_javascript_ajax)) {
894
-					include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
894
+					include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
895 895
 					$comboenhancement = ajax_combobox($htmlNameInvoiceLine, '', 0, 0);
896 896
 					$out .= $comboenhancement;
897 897
 					$morecss = 'minwidth200imp maxwidth500';
898 898
 				}
899 899
 
900
-				$out .= '<select class="valignmiddle flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlNameInvoiceLine . '" name="' . $htmlNameInvoiceLine . '">';
900
+				$out .= '<select class="valignmiddle flat'.($morecss ? ' '.$morecss : '').'" id="'.$htmlNameInvoiceLine.'" name="'.$htmlNameInvoiceLine.'">';
901 901
 			}
902 902
 			$num = $this->db->num_rows($resql);
903 903
 			if ($num) {
904 904
 				while ($obj = $this->db->fetch_object($resql)) {
905 905
 					$labeltoshow .= $obj->description; // Invoice ref
906 906
 
907
-					$out .= '<option value="' . $obj->rowid . '" ';
907
+					$out .= '<option value="'.$obj->rowid.'" ';
908 908
 					if (!empty($selectedLineId) && $selectedLineId == $obj->rowid) {
909 909
 						$out .= ' selected ';
910 910
 					}
911
-					$out .= '>' . $labeltoshow . '</option>';
911
+					$out .= '>'.$labeltoshow.'</option>';
912 912
 				}
913 913
 			}
914 914
 			if (empty($lineOnly)) {
@@ -941,14 +941,14 @@  discard block
 block discarded – undo
941 941
 
942 942
 		$out = '';
943 943
 		if ($htmlname_status != "none" && $htmlname_percent != 'none') {
944
-			$out .= '<form method="post" action="' . $page . '">';
944
+			$out .= '<form method="post" action="'.$page.'">';
945 945
 			$out .= '<input type="hidden" name="action" value="set_opp_status">';
946
-			$out .= '<input type="hidden" name="token" value="' . newToken() . '">';
946
+			$out .= '<input type="hidden" name="token" value="'.newToken().'">';
947 947
 			$out .= $this-> selectOpportunityStatus($htmlname_status, $selected, 1, 0, 0, 0, 'minwidth150 inline-block valignmiddle', 1, 1);
948 948
 			$out .= ' / <span title="'.$langs->trans("OpportunityProbability").'"> ';
949 949
 			$out .= '<input class="width50 right" type="text" id="'.$htmlname_percent.'" name="'.$htmlname_percent.'" title="'.dol_escape_htmltag($langs->trans("OpportunityProbability")).'" value="'.$percent_value.'"> %';
950 950
 			$out .= '</span>';
951
-			$out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
951
+			$out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
952 952
 			$out .= '</form>';
953 953
 		} else {
954 954
 			if ($selected > 0) {
@@ -956,9 +956,9 @@  discard block
 block discarded – undo
956 956
 				$out .= $langs->trans("OppStatus".$code);
957 957
 
958 958
 				// Opportunity percent
959
-				$out.= ' / <span title="'.$langs->trans("OpportunityProbability").'"> ';
960
-				$out.= price($percent_value, 0, $langs, 1, 0).' %';
961
-				$out.= '</span>';
959
+				$out .= ' / <span title="'.$langs->trans("OpportunityProbability").'"> ';
960
+				$out .= price($percent_value, 0, $langs, 1, 0).' %';
961
+				$out .= '</span>';
962 962
 			} else {
963 963
 				$out .= "&nbsp;";
964 964
 			}
Please login to merge, or discard this patch.
htdocs/core/class/commondocgenerator.class.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -153,8 +153,8 @@  discard block
 block discarded – undo
153 153
 	public $posxlabel;
154 154
 	public $posxup;
155 155
 	public $posxref;
156
-	public $posxpicture;	// For picture
157
-	public $posxdesc;		// For description
156
+	public $posxpicture; // For picture
157
+	public $posxdesc; // For description
158 158
 	public $posxqty;
159 159
 	public $posxpuht;
160 160
 	public $posxtva;
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
 		// phpcs:enable
194 194
 		global $conf, $extrafields;
195 195
 
196
-		$logotouse = $conf->user->dir_output . '/' . get_exdir(0, 0, 0, 0, $user, 'user') . 'photos/' . getImageFileNameForSize($user->photo, '_small');
196
+		$logotouse = $conf->user->dir_output.'/'.get_exdir(0, 0, 0, 0, $user, 'user').'photos/'.getImageFileNameForSize($user->photo, '_small');
197 197
 
198 198
 		$array_user = array(
199 199
 			'myuser_lastname'=>$user->lastname,
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
 			'myuser_email'=>$user->email,
214 214
 			'myuser_logo'=>$logotouse,
215 215
 			'myuser_job'=>$user->job,
216
-			'myuser_web'=>'',	// url not exist in $user object
216
+			'myuser_web'=>'', // url not exist in $user object
217 217
 			'myuser_birth'=>dol_print_date($user->birth, 'day', 'gmt'),
218 218
 			'myuser_dateemployment'=>dol_print_date($user->dateemployment, 'day', 'tzuser'),
219 219
 			'myuser_dateemploymentend'=>dol_print_date($user->dateemploymentend, 'day', 'tzuser'),
@@ -529,7 +529,7 @@  discard block
 block discarded – undo
529 529
 
530 530
 		if (get_class($object) == 'CommandeFournisseur') {
531 531
 			/* @var $object CommandeFournisseur*/
532
-			$object->date_validation =  $object->date_valid;
532
+			$object->date_validation = $object->date_valid;
533 533
 			$object->date_commande = $object->date;
534 534
 		}
535 535
 		$resarray = array(
@@ -615,10 +615,10 @@  discard block
 block discarded – undo
615 615
 			$resarray[$array_key.'_bank_bic'] = (empty($bank_account) ? '' : $bank_account->bic);
616 616
 			$resarray[$array_key.'_bank_label'] = (empty($bank_account) ? '' : $bank_account->label);
617 617
 			$resarray[$array_key.'_bank_number'] = (empty($bank_account) ? '' : $bank_account->number);
618
-			$resarray[$array_key.'_bank_proprio'] =(empty($bank_account) ? '' : $bank_account->proprio);
619
-			$resarray[$array_key.'_bank_address'] =(empty($bank_account) ? '' : $bank_account->address);
620
-			$resarray[$array_key.'_bank_state'] =(empty($bank_account) ? '' : $bank_account->state);
621
-			$resarray[$array_key.'_bank_country'] =(empty($bank_account) ? '' : $bank_account->country);
618
+			$resarray[$array_key.'_bank_proprio'] = (empty($bank_account) ? '' : $bank_account->proprio);
619
+			$resarray[$array_key.'_bank_address'] = (empty($bank_account) ? '' : $bank_account->address);
620
+			$resarray[$array_key.'_bank_state'] = (empty($bank_account) ? '' : $bank_account->state);
621
+			$resarray[$array_key.'_bank_country'] = (empty($bank_account) ? '' : $bank_account->country);
622 622
 		}
623 623
 
624 624
 		if (method_exists($object, 'getTotalDiscount') && in_array(get_class($object), array('Propal', 'Proposal', 'Commande', 'Facture', 'SupplierProposal', 'CommandeFournisseur', 'FactureFournisseur'))) {
@@ -641,7 +641,7 @@  discard block
 block discarded – undo
641 641
 			$resarray[$array_key.'_project_date_start'] = dol_print_date($object->project->date_start, 'day');
642 642
 			$resarray[$array_key.'_project_date_end'] = dol_print_date($object->project->date_end, 'day');
643 643
 		} else { // empty replacement
644
-			$resarray[$array_key.'_project_ref'] ='';
644
+			$resarray[$array_key.'_project_ref'] = '';
645 645
 			$resarray[$array_key.'_project_title'] = '';
646 646
 			$resarray[$array_key.'_project_description'] = '';
647 647
 			$resarray[$array_key.'_project_date_start'] = '';
@@ -1478,7 +1478,7 @@  discard block
 block discarded – undo
1478 1478
 
1479 1479
 		if (!empty($fields)) {
1480 1480
 			// Sort extrafields by rank
1481
-			uasort($fields, function ($a, $b) {
1481
+			uasort($fields, function($a, $b) {
1482 1482
 				return  ($a->rank > $b->rank) ? 1 : -1;
1483 1483
 			});
1484 1484
 
Please login to merge, or discard this patch.
htdocs/core/class/commonobject.class.php 1 patch
Spacing   +148 added lines, -148 removed lines patch added patch discarded remove patch
@@ -902,17 +902,17 @@  discard block
 block discarded – undo
902 902
 				}
903 903
 				$labelextra = $langs->trans((string) $extrafields->attributes[$this->table_element]['label'][$key]);
904 904
 				if ($extrafields->attributes[$this->table_element]['type'][$key] == 'separate') {
905
-					$data[$key]= '<br><b><u>'. $labelextra . '</u></b>';
905
+					$data[$key] = '<br><b><u>'.$labelextra.'</u></b>';
906 906
 				} else {
907
-					$value = (empty($this->array_options['options_' . $key]) ? '' : $this->array_options['options_' . $key]);
908
-					$data[$key]= '<br><b>'. $labelextra . ':</b> ' . $extrafields->showOutputField($key, $value, '', $this->table_element);
907
+					$value = (empty($this->array_options['options_'.$key]) ? '' : $this->array_options['options_'.$key]);
908
+					$data[$key] = '<br><b>'.$labelextra.':</b> '.$extrafields->showOutputField($key, $value, '', $this->table_element);
909 909
 					$count++;
910 910
 				}
911 911
 			}
912 912
 			$data['closedivextra'] = '</div>';
913 913
 		}
914 914
 
915
-		$hookmanager->initHooks(array($this->element . 'dao'));
915
+		$hookmanager->initHooks(array($this->element.'dao'));
916 916
 		$parameters = array(
917 917
 			'tooltipcontentarray' => &$data,
918 918
 			'params' => $params,
@@ -1403,7 +1403,7 @@  discard block
 block discarded – undo
1403 1403
 		if ($source == 'external' || $source == 'thirdparty') {
1404 1404
 			$sql .= " AND tc.source = 'external'";
1405 1405
 			if ($status >= 0) {
1406
-				$sql .= " AND t.statut = ".((int) $status);	// t is llx_socpeople
1406
+				$sql .= " AND t.statut = ".((int) $status); // t is llx_socpeople
1407 1407
 			}
1408 1408
 		}
1409 1409
 		$sql .= " AND tc.active = 1";
@@ -1760,8 +1760,8 @@  discard block
 block discarded – undo
1760 1760
 		if ($idtofetch) {
1761 1761
 			$thirdparty = new Societe($this->db);
1762 1762
 			$result = $thirdparty->fetch($idtofetch);
1763
-			if ($result<0) {
1764
-				$this->errors=array_merge($this->errors, $thirdparty->errors);
1763
+			if ($result < 0) {
1764
+				$this->errors = array_merge($this->errors, $thirdparty->errors);
1765 1765
 			}
1766 1766
 			$this->thirdparty = $thirdparty;
1767 1767
 
@@ -1791,7 +1791,7 @@  discard block
 block discarded – undo
1791 1791
 		}
1792 1792
 
1793 1793
 		$sql = "SELECT rowid FROM ".$this->db->prefix().$this->table_element;
1794
-		$sql .= " WHERE ".$this->table_ref_field." LIKE '".$this->db->escape($ref)."'";	// no escapeforlike here
1794
+		$sql .= " WHERE ".$this->table_ref_field." LIKE '".$this->db->escape($ref)."'"; // no escapeforlike here
1795 1795
 		$sql .= " LIMIT 1";
1796 1796
 
1797 1797
 		$query = $this->db->query($sql);
@@ -2084,9 +2084,9 @@  discard block
 block discarded – undo
2084 2084
 		if ($trigkey) {
2085 2085
 			$oldvalue = null;
2086 2086
 
2087
-			$sql = "SELECT " . $field;
2088
-			$sql .= " FROM " . MAIN_DB_PREFIX . $table;
2089
-			$sql .= " WHERE " . $id_field . " = " . ((int) $id);
2087
+			$sql = "SELECT ".$field;
2088
+			$sql .= " FROM ".MAIN_DB_PREFIX.$table;
2089
+			$sql .= " WHERE ".$id_field." = ".((int) $id);
2090 2090
 
2091 2091
 			$resql = $this->db->query($sql);
2092 2092
 			if ($resql) {
@@ -2439,7 +2439,7 @@  discard block
 block discarded – undo
2439 2439
 		// Triggers
2440 2440
 		if (!$error && !$notrigger) {
2441 2441
 			// Call triggers
2442
-			$result = $this->call_trigger(strtoupper($this->element) . '_MODIFY', $user);
2442
+			$result = $this->call_trigger(strtoupper($this->element).'_MODIFY', $user);
2443 2443
 			if ($result < 0) {
2444 2444
 				$error++;
2445 2445
 			} //Do also here what you must do to rollback action if trigger fail
@@ -2805,7 +2805,7 @@  discard block
 block discarded – undo
2805 2805
 			$sql = 'UPDATE '.$this->db->prefix().$this->table_element;
2806 2806
 			$sql .= " SET ".$fieldname." = ".(($id > 0 || $id == '0') ? ((int) $id) : 'NULL');
2807 2807
 			if (in_array($this->table_element, array('propal', 'commande', 'societe'))) {
2808
-				$sql .= " , deposit_percent = " . (empty($deposit_percent) ? 'NULL' : "'".$this->db->escape($deposit_percent)."'");
2808
+				$sql .= " , deposit_percent = ".(empty($deposit_percent) ? 'NULL' : "'".$this->db->escape($deposit_percent)."'");
2809 2809
 			}
2810 2810
 			$sql .= ' WHERE rowid='.((int) $this->id);
2811 2811
 
@@ -3153,10 +3153,10 @@  discard block
 block discarded – undo
3153 3153
 		$sql = "SELECT count(rowid) FROM ".$this->db->prefix().$this->table_element_line;
3154 3154
 		$sql .= " WHERE ".$this->fk_element." = ".((int) $this->id);
3155 3155
 		if (!$renum) {
3156
-			$sql .= " AND " . $fieldposition . " = 0";
3156
+			$sql .= " AND ".$fieldposition." = 0";
3157 3157
 		}
3158 3158
 		if ($renum) {
3159
-			$sql .= " AND " . $fieldposition . " <> 0";
3159
+			$sql .= " AND ".$fieldposition." <> 0";
3160 3160
 		}
3161 3161
 
3162 3162
 		dol_syslog(get_class($this)."::line_order", LOG_DEBUG);
@@ -3177,7 +3177,7 @@  discard block
 block discarded – undo
3177 3177
 			if ($fk_parent_line) {
3178 3178
 				$sql .= ' AND fk_parent_line IS NULL';
3179 3179
 			}
3180
-			$sql .= " ORDER BY " . $fieldposition . " ASC, rowid " . $rowidorder;
3180
+			$sql .= " ORDER BY ".$fieldposition." ASC, rowid ".$rowidorder;
3181 3181
 
3182 3182
 			dol_syslog(get_class($this)."::line_order search all parent lines", LOG_DEBUG);
3183 3183
 			$resql = $this->db->query($sql);
@@ -3228,7 +3228,7 @@  discard block
 block discarded – undo
3228 3228
 		$sql = "SELECT rowid FROM ".$this->db->prefix().$this->table_element_line;
3229 3229
 		$sql .= " WHERE ".$this->fk_element." = ".((int) $this->id);
3230 3230
 		$sql .= ' AND fk_parent_line = '.((int) $id);
3231
-		$sql .= " ORDER BY " . $fieldposition . " ASC";
3231
+		$sql .= " ORDER BY ".$fieldposition." ASC";
3232 3232
 
3233 3233
 		dol_syslog(get_class($this)."::getChildrenOfLine search children lines for line ".$id, LOG_DEBUG);
3234 3234
 		$resql = $this->db->query($sql);
@@ -3311,8 +3311,8 @@  discard block
 block discarded – undo
3311 3311
 			dol_print_error($this->db);
3312 3312
 			return -1;
3313 3313
 		} else {
3314
-			$parameters=array('rowid'=>$rowid, 'rang'=>$rang, 'fieldposition' => $fieldposition);
3315
-			$action='';
3314
+			$parameters = array('rowid'=>$rowid, 'rang'=>$rang, 'fieldposition' => $fieldposition);
3315
+			$action = '';
3316 3316
 			$reshook = $hookmanager->executeHooks('afterRankOfLineUpdate', $parameters, $this, $action);
3317 3317
 			return 1;
3318 3318
 		}
@@ -3351,7 +3351,7 @@  discard block
 block discarded – undo
3351 3351
 
3352 3352
 			$sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) $rang);
3353 3353
 			$sql .= " WHERE ".$this->fk_element." = ".((int) $this->id);
3354
-			$sql .= " AND " . $fieldposition . " = " . ((int) ($rang - 1));
3354
+			$sql .= " AND ".$fieldposition." = ".((int) ($rang - 1));
3355 3355
 			if ($this->db->query($sql)) {
3356 3356
 				$sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) ($rang - 1));
3357 3357
 				$sql .= ' WHERE rowid = '.((int) $rowid);
@@ -3382,7 +3382,7 @@  discard block
 block discarded – undo
3382 3382
 
3383 3383
 			$sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) $rang);
3384 3384
 			$sql .= " WHERE ".$this->fk_element." = ".((int) $this->id);
3385
-			$sql .= " AND " . $fieldposition . " = " . ((int) ($rang + 1));
3385
+			$sql .= " AND ".$fieldposition." = ".((int) ($rang + 1));
3386 3386
 			if ($this->db->query($sql)) {
3387 3387
 				$sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) ($rang + 1));
3388 3388
 				$sql .= ' WHERE rowid = '.((int) $rowid);
@@ -3408,7 +3408,7 @@  discard block
 block discarded – undo
3408 3408
 			$fieldposition = 'position';
3409 3409
 		}
3410 3410
 
3411
-		$sql = "SELECT " . $fieldposition . " FROM ".$this->db->prefix().$this->table_element_line;
3411
+		$sql = "SELECT ".$fieldposition." FROM ".$this->db->prefix().$this->table_element_line;
3412 3412
 		$sql .= " WHERE rowid = ".((int) $rowid);
3413 3413
 
3414 3414
 		dol_syslog(get_class($this)."::getRangOfLine", LOG_DEBUG);
@@ -3436,7 +3436,7 @@  discard block
 block discarded – undo
3436 3436
 
3437 3437
 		$sql = "SELECT rowid FROM ".$this->db->prefix().$this->table_element_line;
3438 3438
 		$sql .= " WHERE ".$this->fk_element." = ".((int) $this->id);
3439
-		$sql .= " AND " . $fieldposition . " = ".((int) $rang);
3439
+		$sql .= " AND ".$fieldposition." = ".((int) $rang);
3440 3440
 		$resql = $this->db->query($sql);
3441 3441
 		if ($resql) {
3442 3442
 			$row = $this->db->fetch_row($resql);
@@ -3554,7 +3554,7 @@  discard block
 block discarded – undo
3554 3554
 			$newsuffix = '';
3555 3555
 		}
3556 3556
 		if (in_array($this->table_element, array('actioncomm', 'adherent', 'advtargetemailing', 'cronjob', 'establishment'))) {
3557
-			$fieldusermod =  "fk_user_mod";
3557
+			$fieldusermod = "fk_user_mod";
3558 3558
 		} elseif ($this->table_element == 'ecm_files') {
3559 3559
 			$fieldusermod = "fk_user_m";
3560 3560
 		} else {
@@ -3596,7 +3596,7 @@  discard block
 block discarded – undo
3596 3596
 						$trigger_name = 'EXPENSE_REPORT_MODIFY';
3597 3597
 						break;
3598 3598
 					default:
3599
-						$trigger_name = strtoupper($this->element) . '_MODIFY';
3599
+						$trigger_name = strtoupper($this->element).'_MODIFY';
3600 3600
 				}
3601 3601
 				$ret = $this->call_trigger($trigger_name, $user);
3602 3602
 				if ($ret < 0) {
@@ -3954,7 +3954,7 @@  discard block
 block discarded – undo
3954 3954
 		// It's because an entry for this element may be exist in llx_element_element before this modification (version <=14.2) and ave named only with their element name in fk_source or fk_target.
3955 3955
 		$coremodule = array('knowledgemanagement', 'partnership', 'workstation', 'ticket', 'recruitment', 'eventorganization', 'asset');
3956 3956
 		// Add module part to target type if object has $module property and isn't in core modules.
3957
-		$targettype = ((!empty($this->module) && ! in_array($this->module, $coremodule)) ? $this->module.'_' : '').$this->element;
3957
+		$targettype = ((!empty($this->module) && !in_array($this->module, $coremodule)) ? $this->module.'_' : '').$this->element;
3958 3958
 
3959 3959
 		$parameters = array('targettype'=>$targettype);
3960 3960
 		// Hook for explicitly set the targettype if it must be differtent than $this->element
@@ -3968,19 +3968,19 @@  discard block
 block discarded – undo
3968 3968
 		$this->db->begin();
3969 3969
 		$error = 0;
3970 3970
 
3971
-		$sql = "INSERT INTO " . $this->db->prefix() . "element_element (";
3971
+		$sql = "INSERT INTO ".$this->db->prefix()."element_element (";
3972 3972
 		$sql .= "fk_source";
3973 3973
 		$sql .= ", sourcetype";
3974 3974
 		$sql .= ", fk_target";
3975 3975
 		$sql .= ", targettype";
3976 3976
 		$sql .= ") VALUES (";
3977 3977
 		$sql .= ((int) $origin_id);
3978
-		$sql .= ", '" . $this->db->escape($origin) . "'";
3979
-		$sql .= ", " . ((int) $this->id);
3980
-		$sql .= ", '" . $this->db->escape($targettype) . "'";
3978
+		$sql .= ", '".$this->db->escape($origin)."'";
3979
+		$sql .= ", ".((int) $this->id);
3980
+		$sql .= ", '".$this->db->escape($targettype)."'";
3981 3981
 		$sql .= ")";
3982 3982
 
3983
-		dol_syslog(get_class($this) . "::add_object_linked", LOG_DEBUG);
3983
+		dol_syslog(get_class($this)."::add_object_linked", LOG_DEBUG);
3984 3984
 		if ($this->db->query($sql)) {
3985 3985
 			if (!$notrigger) {
3986 3986
 				// Call trigger
@@ -4295,20 +4295,20 @@  discard block
 block discarded – undo
4295 4295
 		$this->db->begin();
4296 4296
 		$error = 0;
4297 4297
 
4298
-		$sql = "UPDATE " . $this->db->prefix() . "element_element SET ";
4298
+		$sql = "UPDATE ".$this->db->prefix()."element_element SET ";
4299 4299
 		if ($updatesource) {
4300
-			$sql .= "fk_source = " . ((int) $sourceid);
4301
-			$sql .= ", sourcetype = '" . $this->db->escape($sourcetype) . "'";
4302
-			$sql .= " WHERE fk_target = " . ((int) $this->id);
4303
-			$sql .= " AND targettype = '" . $this->db->escape($this->element) . "'";
4300
+			$sql .= "fk_source = ".((int) $sourceid);
4301
+			$sql .= ", sourcetype = '".$this->db->escape($sourcetype)."'";
4302
+			$sql .= " WHERE fk_target = ".((int) $this->id);
4303
+			$sql .= " AND targettype = '".$this->db->escape($this->element)."'";
4304 4304
 		} elseif ($updatetarget) {
4305
-			$sql .= "fk_target = " . ((int) $targetid);
4306
-			$sql .= ", targettype = '" . $this->db->escape($targettype) . "'";
4307
-			$sql .= " WHERE fk_source = " . ((int) $this->id);
4308
-			$sql .= " AND sourcetype = '" . $this->db->escape($this->element) . "'";
4305
+			$sql .= "fk_target = ".((int) $targetid);
4306
+			$sql .= ", targettype = '".$this->db->escape($targettype)."'";
4307
+			$sql .= " WHERE fk_source = ".((int) $this->id);
4308
+			$sql .= " AND sourcetype = '".$this->db->escape($this->element)."'";
4309 4309
 		}
4310 4310
 
4311
-		dol_syslog(get_class($this) . "::updateObjectLinked", LOG_DEBUG);
4311
+		dol_syslog(get_class($this)."::updateObjectLinked", LOG_DEBUG);
4312 4312
 		if ($this->db->query($sql)) {
4313 4313
 			if (!$notrigger) {
4314 4314
 				// Call trigger
@@ -4384,25 +4384,25 @@  discard block
 block discarded – undo
4384 4384
 		}
4385 4385
 
4386 4386
 		if (!$error) {
4387
-			$sql = "DELETE FROM " . $this->db->prefix() . "element_element";
4387
+			$sql = "DELETE FROM ".$this->db->prefix()."element_element";
4388 4388
 			$sql .= " WHERE";
4389 4389
 			if ($rowid > 0) {
4390
-				$sql .= " rowid = " . ((int) $rowid);
4390
+				$sql .= " rowid = ".((int) $rowid);
4391 4391
 			} else {
4392 4392
 				if ($deletesource) {
4393
-					$sql .= " fk_source = " . ((int) $sourceid) . " AND sourcetype = '" . $this->db->escape($sourcetype) . "'";
4394
-					$sql .= " AND fk_target = " . ((int) $this->id) . " AND targettype = '" . $this->db->escape($this->element) . "'";
4393
+					$sql .= " fk_source = ".((int) $sourceid)." AND sourcetype = '".$this->db->escape($sourcetype)."'";
4394
+					$sql .= " AND fk_target = ".((int) $this->id)." AND targettype = '".$this->db->escape($this->element)."'";
4395 4395
 				} elseif ($deletetarget) {
4396
-					$sql .= " fk_target = " . ((int) $targetid) . " AND targettype = '" . $this->db->escape($targettype) . "'";
4397
-					$sql .= " AND fk_source = " . ((int) $this->id) . " AND sourcetype = '" . $this->db->escape($this->element) . "'";
4396
+					$sql .= " fk_target = ".((int) $targetid)." AND targettype = '".$this->db->escape($targettype)."'";
4397
+					$sql .= " AND fk_source = ".((int) $this->id)." AND sourcetype = '".$this->db->escape($this->element)."'";
4398 4398
 				} else {
4399
-					$sql .= " (fk_source = " . ((int) $this->id) . " AND sourcetype = '" . $this->db->escape($this->element) . "')";
4399
+					$sql .= " (fk_source = ".((int) $this->id)." AND sourcetype = '".$this->db->escape($this->element)."')";
4400 4400
 					$sql .= " OR";
4401
-					$sql .= " (fk_target = " . ((int) $this->id) . " AND targettype = '" . $this->db->escape($this->element) . "')";
4401
+					$sql .= " (fk_target = ".((int) $this->id)." AND targettype = '".$this->db->escape($this->element)."')";
4402 4402
 				}
4403 4403
 			}
4404 4404
 
4405
-			dol_syslog(get_class($this) . "::deleteObjectLinked", LOG_DEBUG);
4405
+			dol_syslog(get_class($this)."::deleteObjectLinked", LOG_DEBUG);
4406 4406
 			if (!$this->db->query($sql)) {
4407 4407
 				$this->error = $this->db->lasterror();
4408 4408
 				$this->errors[] = $this->error;
@@ -4567,14 +4567,14 @@  discard block
 block discarded – undo
4567 4567
 			$sql .= ", date_validation = '".$this->db->idate(dol_now())."'";
4568 4568
 		}
4569 4569
 		$sql .= " WHERE rowid = ".((int) $elementId);
4570
-		$sql .= " AND ".$fieldstatus." <> ".((int) $status);	// We avoid update if status already correct
4570
+		$sql .= " AND ".$fieldstatus." <> ".((int) $status); // We avoid update if status already correct
4571 4571
 
4572 4572
 		dol_syslog(get_class($this)."::setStatut", LOG_DEBUG);
4573 4573
 		$resql = $this->db->query($sql);
4574 4574
 		if ($resql) {
4575 4575
 			$error = 0;
4576 4576
 
4577
-			$nb_rows_affected = $this->db->affected_rows($resql);	// should be 1 or 0 if status was already correct
4577
+			$nb_rows_affected = $this->db->affected_rows($resql); // should be 1 or 0 if status was already correct
4578 4578
 
4579 4579
 			if ($nb_rows_affected > 0) {
4580 4580
 				if (empty($trigkey)) {
@@ -4619,7 +4619,7 @@  discard block
 block discarded – undo
4619 4619
 					if ($fieldstatus == 'tosell') {
4620 4620
 						$this->status = $status;
4621 4621
 					} elseif ($fieldstatus == 'tobuy') {
4622
-						$this->status_buy = $status;	// @phpstan-ignore-line
4622
+						$this->status_buy = $status; // @phpstan-ignore-line
4623 4623
 					} else {
4624 4624
 						$this->statut = $status;
4625 4625
 						$this->status = $status;
@@ -4728,7 +4728,7 @@  discard block
 block discarded – undo
4728 4728
 			return -1;
4729 4729
 		}
4730 4730
 
4731
-		$arraytoscan = $this->childtables;		// array('tablename'=>array('fk_element'=>'parentfield'), ...) or array('tablename'=>array('parent'=>table_parent, 'parentkey'=>'nameoffieldforparentfkkey'), ...)
4731
+		$arraytoscan = $this->childtables; // array('tablename'=>array('fk_element'=>'parentfield'), ...) or array('tablename'=>array('parent'=>table_parent, 'parentkey'=>'nameoffieldforparentfkkey'), ...)
4732 4732
 		// For backward compatibility, we check if array is old format array('tablename1', 'tablename2', ...)
4733 4733
 		$tmparray = array_keys($this->childtables);
4734 4734
 		if (is_numeric($tmparray[0])) {
@@ -4741,26 +4741,26 @@  discard block
 block discarded – undo
4741 4741
 			//print $id.'-'.$table.'-'.$elementname.'<br>';
4742 4742
 			// Check if element can be deleted
4743 4743
 			$sql = "SELECT COUNT(*) as nb";
4744
-			$sql.= " FROM ".$this->db->prefix().$table." as c";
4744
+			$sql .= " FROM ".$this->db->prefix().$table." as c";
4745 4745
 			if (!empty($element['parent']) && !empty($element['parentkey'])) {
4746
-				$sql.= ", ".$this->db->prefix().$element['parent']." as p";
4746
+				$sql .= ", ".$this->db->prefix().$element['parent']." as p";
4747 4747
 			}
4748 4748
 			if (!empty($element['fk_element'])) {
4749
-				$sql.= " WHERE c.".$element['fk_element']." = ".((int) $id);
4749
+				$sql .= " WHERE c.".$element['fk_element']." = ".((int) $id);
4750 4750
 			} else {
4751
-				$sql.= " WHERE c.".$this->fk_element." = ".((int) $id);
4751
+				$sql .= " WHERE c.".$this->fk_element." = ".((int) $id);
4752 4752
 			}
4753 4753
 			if (!empty($element['parent']) && !empty($element['parentkey'])) {
4754
-				$sql.= " AND c.".$element['parentkey']." = p.rowid";
4754
+				$sql .= " AND c.".$element['parentkey']." = p.rowid";
4755 4755
 			}
4756 4756
 			if (!empty($element['parent']) && !empty($element['parenttypefield']) && !empty($element['parenttypevalue'])) {
4757
-				$sql.= " AND c.".$element['parenttypefield']." = '".$this->db->escape($element['parenttypevalue'])."'";
4757
+				$sql .= " AND c.".$element['parenttypefield']." = '".$this->db->escape($element['parenttypevalue'])."'";
4758 4758
 			}
4759 4759
 			if (!empty($entity)) {
4760 4760
 				if (!empty($element['parent']) && !empty($element['parentkey'])) {
4761
-					$sql.= " AND p.entity = ".((int) $entity);
4761
+					$sql .= " AND p.entity = ".((int) $entity);
4762 4762
 				} else {
4763
-					$sql.= " AND c.entity = ".((int) $entity);
4763
+					$sql .= " AND c.entity = ".((int) $entity);
4764 4764
 				}
4765 4765
 			}
4766 4766
 
@@ -5795,7 +5795,7 @@  discard block
 block discarded – undo
5795 5795
 			$setsharekey = false;
5796 5796
 			if ($this->element == 'propal' || $this->element == 'proposal') {
5797 5797
 				if (getDolGlobalInt("PROPOSAL_ALLOW_ONLINESIGN")) {
5798
-					$setsharekey = true;	// feature to make online signature is not set or set to on (default)
5798
+					$setsharekey = true; // feature to make online signature is not set or set to on (default)
5799 5799
 				}
5800 5800
 				if (getDolGlobalInt("PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD")) {
5801 5801
 					$setsharekey = true;
@@ -5853,7 +5853,7 @@  discard block
 block discarded – undo
5853 5853
 				$ecmfile->gen_or_uploaded = 'generated';
5854 5854
 				$ecmfile->description = ''; // indexed content
5855 5855
 				$ecmfile->keywords = ''; // keyword content
5856
-				$ecmfile->src_object_type = $this->table_element;	// $this->table_name is 'myobject' or 'mymodule_myobject'.
5856
+				$ecmfile->src_object_type = $this->table_element; // $this->table_name is 'myobject' or 'mymodule_myobject'.
5857 5857
 				$ecmfile->src_object_id   = $this->id;
5858 5858
 
5859 5859
 				$result = $ecmfile->create($user);
@@ -5905,7 +5905,7 @@  discard block
 block discarded – undo
5905 5905
 			$maxwidthmini = $tmparraysize['maxwidthmini'];
5906 5906
 			$maxheightmini = $tmparraysize['maxheightmini'];
5907 5907
 			//$quality = $tmparraysize['quality'];
5908
-			$quality = 50;	// For thumbs, we force quality to 50
5908
+			$quality = 50; // For thumbs, we force quality to 50
5909 5909
 
5910 5910
 			// Create small thumbs for company (Ratio is near 16/9)
5911 5911
 			// Used on logon for example
@@ -6007,8 +6007,8 @@  discard block
 block discarded – undo
6007 6007
 		// phpcs:enable
6008 6008
 		global $langs, $conf;
6009 6009
 
6010
-		if (!empty(self::TRIGGER_PREFIX) && strpos($triggerName, self::TRIGGER_PREFIX . '_') !== 0) {
6011
-			dol_print_error(null, 'The trigger "' . $triggerName . '" does not start with "' . self::TRIGGER_PREFIX . '_" as required.');
6010
+		if (!empty(self::TRIGGER_PREFIX) && strpos($triggerName, self::TRIGGER_PREFIX.'_') !== 0) {
6011
+			dol_print_error(null, 'The trigger "'.$triggerName.'" does not start with "'.self::TRIGGER_PREFIX.'_" as required.');
6012 6012
 			exit;
6013 6013
 		}
6014 6014
 		if (!is_object($langs)) {	// If lang was not defined, we set it. It is required by run_triggers().
@@ -6202,7 +6202,7 @@  discard block
 block discarded – undo
6202 6202
 		$savDisableCompute = $conf->disable_compute;
6203 6203
 		$conf->disable_compute = 1;
6204 6204
 
6205
-		$ret = $this->fetch($id);	/* @phpstan-ignore-line */
6205
+		$ret = $this->fetch($id); /* @phpstan-ignore-line */
6206 6206
 
6207 6207
 		$conf->disable_compute = $savDisableCompute;
6208 6208
 
@@ -6306,9 +6306,9 @@  discard block
 block discarded – undo
6306 6306
 						if (!empty($extrafields->attributes[$this->table_element]) && !empty($extrafields->attributes[$this->table_element]['computed'][$key])) {
6307 6307
 							//var_dump($conf->disable_compute);
6308 6308
 							if (empty($conf->disable_compute)) {
6309
-								global $objectoffield;        // We set a global variable to $objectoffield so
6310
-								$objectoffield = $this;        // we can use it inside computed formula
6311
-								$this->array_options['options_' . $key] = dol_eval($extrafields->attributes[$this->table_element]['computed'][$key], 1, 0, '2');
6309
+								global $objectoffield; // We set a global variable to $objectoffield so
6310
+								$objectoffield = $this; // we can use it inside computed formula
6311
+								$this->array_options['options_'.$key] = dol_eval($extrafields->attributes[$this->table_element]['computed'][$key], 1, 0, '2');
6312 6312
 							}
6313 6313
 						}
6314 6314
 					}
@@ -6322,7 +6322,7 @@  discard block
 block discarded – undo
6322 6322
 					return 0;
6323 6323
 				}
6324 6324
 			} else {
6325
-				$this->errors[]=$this->db->lasterror;
6325
+				$this->errors[] = $this->db->lasterror;
6326 6326
 				return -1;
6327 6327
 			}
6328 6328
 		}
@@ -6489,7 +6489,7 @@  discard block
 block discarded – undo
6489 6489
 										// If old value encrypted in database is same than submitted new value, it means we don't change it, so we don't update.
6490 6490
 										if ($algo == 'dolcrypt') {	// dolibarr reversible encryption
6491 6491
 											if (!preg_match('/^dolcrypt:/', $this->array_options[$key])) {
6492
-												$new_array_options[$key] = dolEncrypt($this->array_options[$key]);	// warning, must be called when on the master
6492
+												$new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master
6493 6493
 											} else {
6494 6494
 												$new_array_options[$key] = $this->array_options[$key]; // Value is kept
6495 6495
 											}
@@ -6500,7 +6500,7 @@  discard block
 block discarded – undo
6500 6500
 										// If value has changed
6501 6501
 										if ($algo == 'dolcrypt') {	// dolibarr reversible encryption
6502 6502
 											if (!preg_match('/^dolcrypt:/', $this->array_options[$key])) {
6503
-												$new_array_options[$key] = dolEncrypt($this->array_options[$key]);	// warning, must be called when on the master
6503
+												$new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master
6504 6504
 											} else {
6505 6505
 												$new_array_options[$key] = $this->array_options[$key]; // Value is kept
6506 6506
 											}
@@ -6512,7 +6512,7 @@  discard block
 block discarded – undo
6512 6512
 									//var_dump('jjj'.$algo.' '.$this->oldcopy->array_options[$key].' -> '.$this->array_options[$key]);
6513 6513
 									// If this->oldcopy is not defined, we can't know if we change attribute or not, so we must keep value
6514 6514
 									if ($algo == 'dolcrypt' && !preg_match('/^dolcrypt:/', $this->array_options[$key])) {	// dolibarr reversible encryption
6515
-										$new_array_options[$key] = dolEncrypt($this->array_options[$key]);	// warning, must be called when on the master
6515
+										$new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master
6516 6516
 									} else {
6517 6517
 										$new_array_options[$key] = $this->array_options[$key]; // Value is kept
6518 6518
 									}
@@ -6909,7 +6909,7 @@  discard block
 block discarded – undo
6909 6909
 								if (isset($this->oldcopy->array_options["options_".$key]) && $this->array_options["options_".$key] == $this->oldcopy->array_options["options_".$key]) {	// If old value encrypted in database is same than submitted new value, it means we don't change it, so we don't update.
6910 6910
 									if ($algo == 'dolcrypt') {	// dolibarr reversible encryption
6911 6911
 										if (!preg_match('/^dolcrypt:/', $this->array_options["options_".$key])) {
6912
-											$new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]);	// warning, must be called when on the master
6912
+											$new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]); // warning, must be called when on the master
6913 6913
 										} else {
6914 6914
 											$new_array_options["options_".$key] = $this->array_options["options_".$key]; // Value is kept
6915 6915
 										}
@@ -6929,7 +6929,7 @@  discard block
 block discarded – undo
6929 6929
 								}
6930 6930
 							} else {
6931 6931
 								if ($algo == 'dolcrypt' && !preg_match('/^dolcrypt:/', $this->array_options["options_".$key])) {	// dolibarr reversible encryption
6932
-									$new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]);	// warning, must be called when on the master
6932
+									$new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]); // warning, must be called when on the master
6933 6933
 								} else {
6934 6934
 									$new_array_options["options_".$key] = $this->array_options["options_".$key]; // Value is kept
6935 6935
 								}
@@ -7187,7 +7187,7 @@  discard block
 block discarded – undo
7187 7187
 		// Special case that force options and type ($type can be integer, varchar, ...)
7188 7188
 		if (!empty($this->fields[$key]['arrayofkeyval']) && is_array($this->fields[$key]['arrayofkeyval'])) {
7189 7189
 			$param['options'] = $this->fields[$key]['arrayofkeyval'];
7190
-			$type = (($this->fields[$key]['type']=='checkbox') ? $this->fields[$key]['type'] : 'select');
7190
+			$type = (($this->fields[$key]['type'] == 'checkbox') ? $this->fields[$key]['type'] : 'select');
7191 7191
 		}
7192 7192
 
7193 7193
 		$label = $this->fields[$key]['label'];
@@ -7239,7 +7239,7 @@  discard block
 block discarded – undo
7239 7239
 
7240 7240
 		// Add validation state class
7241 7241
 		if (!empty($validationClass)) {
7242
-			$morecss.= $validationClass;
7242
+			$morecss .= $validationClass;
7243 7243
 		}
7244 7244
 
7245 7245
 		if (in_array($type, array('date'))) {
@@ -7352,7 +7352,7 @@  discard block
 block discarded – undo
7352 7352
 			if (is_array($param['options'])) {
7353 7353
 				$param_list = array_keys($param['options']);
7354 7354
 				$InfoFieldList = explode(":", $param_list[0], 5);
7355
-				if (! empty($InfoFieldList[4])) {
7355
+				if (!empty($InfoFieldList[4])) {
7356 7356
 					$pos = 0;
7357 7357
 					$parenthesisopen = 0;
7358 7358
 					while (substr($InfoFieldList[4], $pos, 1) !== '' && ($parenthesisopen || $pos == 0 || substr($InfoFieldList[4], $pos, 1) != ':')) {
@@ -7365,7 +7365,7 @@  discard block
 block discarded – undo
7365 7365
 						$pos++;
7366 7366
 					}
7367 7367
 					$tmpbefore = substr($InfoFieldList[4], 0, $pos);
7368
-					$tmpafter = substr($InfoFieldList[4], $pos+1);
7368
+					$tmpafter = substr($InfoFieldList[4], $pos + 1);
7369 7369
 					//var_dump($InfoFieldList[4].' -> '.$pos); var_dump($tmpafter);
7370 7370
 					$InfoFieldList[4] = $tmpbefore;
7371 7371
 					if ($tmpafter !== '') {
@@ -7413,8 +7413,8 @@  discard block
 block discarded – undo
7413 7413
 					}
7414 7414
 
7415 7415
 					$sqlwhere = '';
7416
-					$sql = "SELECT " . $keyList;
7417
-					$sql .= " FROM " . $this->db->prefix() . $InfoFieldList[0];
7416
+					$sql = "SELECT ".$keyList;
7417
+					$sql .= " FROM ".$this->db->prefix().$InfoFieldList[0];
7418 7418
 					if (!empty($InfoFieldList[4])) {
7419 7419
 						// can use SELECT request
7420 7420
 						if (strpos($InfoFieldList[4], '$SEL$') !== false) {
@@ -7431,18 +7431,18 @@  discard block
 block discarded – undo
7431 7431
 						// We have to join on extrafield table
7432 7432
 						$errstr = '';
7433 7433
 						if (strpos($InfoFieldList[4], 'extra') !== false) {
7434
-							$sql .= " as main, " . $this->db->prefix() . $InfoFieldList[0] . "_extrafields as extra";
7435
-							$sqlwhere .= " WHERE extra.fk_object=main." . $InfoFieldList[2];
7436
-							$sqlwhere .= " AND " . forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1);
7434
+							$sql .= " as main, ".$this->db->prefix().$InfoFieldList[0]."_extrafields as extra";
7435
+							$sqlwhere .= " WHERE extra.fk_object=main.".$InfoFieldList[2];
7436
+							$sqlwhere .= " AND ".forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1);
7437 7437
 						} else {
7438
-							$sqlwhere .= " WHERE " . forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1);
7438
+							$sqlwhere .= " WHERE ".forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1);
7439 7439
 						}
7440 7440
 					} else {
7441 7441
 						$sqlwhere .= ' WHERE 1=1';
7442 7442
 					}
7443 7443
 					// Some tables may have field, some other not. For the moment we disable it.
7444 7444
 					if (in_array($InfoFieldList[0], array('tablewithentity'))) {
7445
-						$sqlwhere .= " AND entity = " . ((int) $conf->entity);
7445
+						$sqlwhere .= " AND entity = ".((int) $conf->entity);
7446 7446
 					}
7447 7447
 					$sql .= $sqlwhere;
7448 7448
 					//print $sql;
@@ -7454,7 +7454,7 @@  discard block
 block discarded – undo
7454 7454
 						$sql .= " ORDER BY ".$this->db->sanitize(implode(', ', $fields_label));
7455 7455
 					}
7456 7456
 
7457
-					dol_syslog(get_class($this) . '::showInputField type=sellist', LOG_DEBUG);
7457
+					dol_syslog(get_class($this).'::showInputField type=sellist', LOG_DEBUG);
7458 7458
 					$resql = $this->db->query($sql);
7459 7459
 					if ($resql) {
7460 7460
 						$out .= '<option value="0">&nbsp;</option>';
@@ -7470,7 +7470,7 @@  discard block
 block discarded – undo
7470 7470
 							if (count($fields_label) > 1) {
7471 7471
 								$notrans = true;
7472 7472
 								foreach ($fields_label as $field_toshow) {
7473
-									$labeltoshow .= $obj->$field_toshow . ' ';
7473
+									$labeltoshow .= $obj->$field_toshow.' ';
7474 7474
 								}
7475 7475
 							} else {
7476 7476
 								$labeltoshow = $obj->{$InfoFieldList[1]};
@@ -7481,12 +7481,12 @@  discard block
 block discarded – undo
7481 7481
 								foreach ($fields_label as $field_toshow) {
7482 7482
 									$translabel = $langs->trans($obj->$field_toshow);
7483 7483
 									if ($translabel != $obj->$field_toshow) {
7484
-										$labeltoshow = dol_trunc($translabel) . ' ';
7484
+										$labeltoshow = dol_trunc($translabel).' ';
7485 7485
 									} else {
7486
-										$labeltoshow = dol_trunc($obj->$field_toshow) . ' ';
7486
+										$labeltoshow = dol_trunc($obj->$field_toshow).' ';
7487 7487
 									}
7488 7488
 								}
7489
-								$out .= '<option value="' . $obj->rowid . '" selected>' . $labeltoshow . '</option>';
7489
+								$out .= '<option value="'.$obj->rowid.'" selected>'.$labeltoshow.'</option>';
7490 7490
 							} else {
7491 7491
 								if (!$notrans) {
7492 7492
 									$translabel = $langs->trans($obj->{$InfoFieldList[1]});
@@ -7500,34 +7500,34 @@  discard block
 block discarded – undo
7500 7500
 									$labeltoshow = '(not defined)';
7501 7501
 								}
7502 7502
 								if ($value == $obj->rowid) {
7503
-									$out .= '<option value="' . $obj->rowid . '" selected>' . $labeltoshow . '</option>';
7503
+									$out .= '<option value="'.$obj->rowid.'" selected>'.$labeltoshow.'</option>';
7504 7504
 								}
7505 7505
 
7506 7506
 								if (!empty($InfoFieldList[3]) && $parentField) {
7507
-									$parent = $parentName . ':' . $obj->{$parentField};
7507
+									$parent = $parentName.':'.$obj->{$parentField};
7508 7508
 									$isDependList = 1;
7509 7509
 								}
7510 7510
 
7511
-								$out .= '<option value="' . $obj->rowid . '"';
7511
+								$out .= '<option value="'.$obj->rowid.'"';
7512 7512
 								$out .= ($value == $obj->rowid ? ' selected' : '');
7513
-								$out .= (!empty($parent) ? ' parent="' . $parent . '"' : '');
7514
-								$out .= '>' . $labeltoshow . '</option>';
7513
+								$out .= (!empty($parent) ? ' parent="'.$parent.'"' : '');
7514
+								$out .= '>'.$labeltoshow.'</option>';
7515 7515
 							}
7516 7516
 
7517 7517
 							$i++;
7518 7518
 						}
7519 7519
 						$this->db->free($resql);
7520 7520
 					} else {
7521
-						print 'Error in request ' . $sql . ' ' . $this->db->lasterror() . '. Check setup of extra parameters.<br>';
7521
+						print 'Error in request '.$sql.' '.$this->db->lasterror().'. Check setup of extra parameters.<br>';
7522 7522
 					}
7523 7523
 				} else {
7524 7524
 					require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
7525 7525
 					$data = $form->select_all_categories(Categorie::$MAP_ID_TO_CODE[$InfoFieldList[5]], '', 'parent', 64, $InfoFieldList[6], 1, 1);
7526 7526
 					$out .= '<option value="0">&nbsp;</option>';
7527 7527
 					foreach ($data as $data_key => $data_value) {
7528
-						$out .= '<option value="' . $data_key . '"';
7528
+						$out .= '<option value="'.$data_key.'"';
7529 7529
 						$out .= ($value == $data_key ? ' selected' : '');
7530
-						$out .= '>' . $data_value . '</option>';
7530
+						$out .= '>'.$data_value.'</option>';
7531 7531
 					}
7532 7532
 				}
7533 7533
 			}
@@ -7592,8 +7592,8 @@  discard block
 block discarded – undo
7592 7592
 					}
7593 7593
 
7594 7594
 					$sqlwhere = '';
7595
-					$sql = "SELECT " . $keyList;
7596
-					$sql .= ' FROM ' . $this->db->prefix() . $InfoFieldList[0];
7595
+					$sql = "SELECT ".$keyList;
7596
+					$sql .= ' FROM '.$this->db->prefix().$InfoFieldList[0];
7597 7597
 					if (!empty($InfoFieldList[4])) {
7598 7598
 						// can use SELECT request
7599 7599
 						if (strpos($InfoFieldList[4], '$SEL$') !== false) {
@@ -7609,23 +7609,23 @@  discard block
 block discarded – undo
7609 7609
 
7610 7610
 						// We have to join on extrafield table
7611 7611
 						if (strpos($InfoFieldList[4], 'extra') !== false) {
7612
-							$sql .= ' as main, ' . $this->db->prefix() . $InfoFieldList[0] . '_extrafields as extra';
7613
-							$sqlwhere .= " WHERE extra.fk_object=main." . $InfoFieldList[2] . " AND " . $InfoFieldList[4];
7612
+							$sql .= ' as main, '.$this->db->prefix().$InfoFieldList[0].'_extrafields as extra';
7613
+							$sqlwhere .= " WHERE extra.fk_object=main.".$InfoFieldList[2]." AND ".$InfoFieldList[4];
7614 7614
 						} else {
7615
-							$sqlwhere .= " WHERE " . $InfoFieldList[4];
7615
+							$sqlwhere .= " WHERE ".$InfoFieldList[4];
7616 7616
 						}
7617 7617
 					} else {
7618 7618
 						$sqlwhere .= ' WHERE 1=1';
7619 7619
 					}
7620 7620
 					// Some tables may have field, some other not. For the moment we disable it.
7621 7621
 					if (in_array($InfoFieldList[0], array('tablewithentity'))) {
7622
-						$sqlwhere .= " AND entity = " . ((int) $conf->entity);
7622
+						$sqlwhere .= " AND entity = ".((int) $conf->entity);
7623 7623
 					}
7624 7624
 					// $sql.=preg_replace('/^ AND /','',$sqlwhere);
7625 7625
 					// print $sql;
7626 7626
 
7627 7627
 					$sql .= $sqlwhere;
7628
-					dol_syslog(get_class($this) . '::showInputField type=chkbxlst', LOG_DEBUG);
7628
+					dol_syslog(get_class($this).'::showInputField type=chkbxlst', LOG_DEBUG);
7629 7629
 					$resql = $this->db->query($sql);
7630 7630
 					if ($resql) {
7631 7631
 						$num = $this->db->num_rows($resql);
@@ -7643,7 +7643,7 @@  discard block
 block discarded – undo
7643 7643
 							if (count($fields_label) > 1) {
7644 7644
 								$notrans = true;
7645 7645
 								foreach ($fields_label as $field_toshow) {
7646
-									$labeltoshow .= $obj->$field_toshow . ' ';
7646
+									$labeltoshow .= $obj->$field_toshow.' ';
7647 7647
 								}
7648 7648
 							} else {
7649 7649
 								$labeltoshow = $obj->{$InfoFieldList[1]};
@@ -7654,9 +7654,9 @@  discard block
 block discarded – undo
7654 7654
 								foreach ($fields_label as $field_toshow) {
7655 7655
 									$translabel = $langs->trans($obj->$field_toshow);
7656 7656
 									if ($translabel != $obj->$field_toshow) {
7657
-										$labeltoshow = dol_trunc($translabel, 18) . ' ';
7657
+										$labeltoshow = dol_trunc($translabel, 18).' ';
7658 7658
 									} else {
7659
-										$labeltoshow = dol_trunc($obj->$field_toshow, 18) . ' ';
7659
+										$labeltoshow = dol_trunc($obj->$field_toshow, 18).' ';
7660 7660
 									}
7661 7661
 								}
7662 7662
 
@@ -7679,7 +7679,7 @@  discard block
 block discarded – undo
7679 7679
 								}
7680 7680
 
7681 7681
 								if (!empty($InfoFieldList[3]) && $parentField) {
7682
-									$parent = $parentName . ':' . $obj->{$parentField};
7682
+									$parent = $parentName.':'.$obj->{$parentField};
7683 7683
 									$isDependList = 1;
7684 7684
 								}
7685 7685
 
@@ -7690,14 +7690,14 @@  discard block
 block discarded – undo
7690 7690
 						}
7691 7691
 						$this->db->free($resql);
7692 7692
 
7693
-						$out = $form->multiselectarray($keyprefix . $key . $keysuffix, $data, $value_arr, '', 0, $morecss, 0, '100%');
7693
+						$out = $form->multiselectarray($keyprefix.$key.$keysuffix, $data, $value_arr, '', 0, $morecss, 0, '100%');
7694 7694
 					} else {
7695
-						print 'Error in request ' . $sql . ' ' . $this->db->lasterror() . '. Check setup of extra parameters.<br>';
7695
+						print 'Error in request '.$sql.' '.$this->db->lasterror().'. Check setup of extra parameters.<br>';
7696 7696
 					}
7697 7697
 				} else {
7698 7698
 					require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
7699 7699
 					$data = $form->select_all_categories(Categorie::$MAP_ID_TO_CODE[$InfoFieldList[5]], '', 'parent', 64, $InfoFieldList[6], 1, 1);
7700
-					$out = $form->multiselectarray($keyprefix . $key . $keysuffix, $data, $value_arr, '', 0, $morecss, 0, '100%');
7700
+					$out = $form->multiselectarray($keyprefix.$key.$keysuffix, $data, $value_arr, '', 0, $morecss, 0, '100%');
7701 7701
 				}
7702 7702
 			}
7703 7703
 		} elseif ($type == 'link') {
@@ -7786,7 +7786,7 @@  discard block
 block discarded – undo
7786 7786
 			$out = '<input type="hidden" value="'.$value.'" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'"/>';
7787 7787
 		}
7788 7788
 
7789
-		if ($isDependList==1) {
7789
+		if ($isDependList == 1) {
7790 7790
 			$out .= $this->getJSListDependancies('_common');
7791 7791
 		}
7792 7792
 		/* Add comments
@@ -7837,7 +7837,7 @@  discard block
 block discarded – undo
7837 7837
 			$type = 'varchar'; // convert varchar(xx) int varchar
7838 7838
 		}
7839 7839
 		if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) {
7840
-			$type = (($this->fields[$key]['type']=='checkbox') ? $this->fields[$key]['type'] : 'select');
7840
+			$type = (($this->fields[$key]['type'] == 'checkbox') ? $this->fields[$key]['type'] : 'select');
7841 7841
 		}
7842 7842
 		if (preg_match('/^integer:(.*):(.*)/i', $val['type'], $reg)) {
7843 7843
 			$type = 'link';
@@ -7922,7 +7922,7 @@  discard block
 block discarded – undo
7922 7922
 			$value = $this->getLibStatut(3);
7923 7923
 		} elseif ($type == 'date') {
7924 7924
 			if (!empty($value)) {
7925
-				$value = dol_print_date($value, 'day');	// We suppose dates without time are always gmt (storage of course + output)
7925
+				$value = dol_print_date($value, 'day'); // We suppose dates without time are always gmt (storage of course + output)
7926 7926
 			} else {
7927 7927
 				$value = '';
7928 7928
 			}
@@ -8020,9 +8020,9 @@  discard block
 block discarded – undo
8020 8020
 									$translabel = $langs->trans($obj->$field_toshow);
8021 8021
 								}
8022 8022
 								if ($translabel != $field_toshow) {
8023
-									$value .= dol_trunc($translabel, 18) . ' ';
8023
+									$value .= dol_trunc($translabel, 18).' ';
8024 8024
 								} else {
8025
-									$value .= $obj->$field_toshow . ' ';
8025
+									$value .= $obj->$field_toshow.' ';
8026 8026
 								}
8027 8027
 							}
8028 8028
 						} else {
@@ -8038,7 +8038,7 @@  discard block
 block discarded – undo
8038 8038
 						}
8039 8039
 					}
8040 8040
 				} else {
8041
-					require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
8041
+					require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
8042 8042
 
8043 8043
 					$toprint = array();
8044 8044
 					$obj = $this->db->fetch_object($resql);
@@ -8046,7 +8046,7 @@  discard block
 block discarded – undo
8046 8046
 					$c->fetch($obj->rowid);
8047 8047
 					$ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text
8048 8048
 					foreach ($ways as $way) {
8049
-						$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #aaa"') . '>' . img_object('', 'category') . ' ' . $way . '</li>';
8049
+						$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #aaa"').'>'.img_object('', 'category').' '.$way.'</li>';
8050 8050
 					}
8051 8051
 					$value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
8052 8052
 				}
@@ -8062,11 +8062,11 @@  discard block
 block discarded – undo
8062 8062
 				$toprint = array();
8063 8063
 				foreach ($value_arr as $keyval => $valueval) {
8064 8064
 					if (!empty($valueval)) {
8065
-						$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . $param['options'][$valueval] . '</li>';
8065
+						$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$param['options'][$valueval].'</li>';
8066 8066
 					}
8067 8067
 				}
8068 8068
 				if (!empty($toprint)) {
8069
-					$value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>';
8069
+					$value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
8070 8070
 				}
8071 8071
 			}
8072 8072
 		} elseif ($type == 'chkbxlst') {
@@ -8121,9 +8121,9 @@  discard block
 block discarded – undo
8121 8121
 										$translabel = $langs->trans($obj->$field_toshow);
8122 8122
 									}
8123 8123
 									if ($translabel != $field_toshow) {
8124
-										$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . dol_trunc($translabel, 18) . '</li>';
8124
+										$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.dol_trunc($translabel, 18).'</li>';
8125 8125
 									} else {
8126
-										$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . $obj->$field_toshow . '</li>';
8126
+										$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$obj->$field_toshow.'</li>';
8127 8127
 									}
8128 8128
 								}
8129 8129
 							} else {
@@ -8132,15 +8132,15 @@  discard block
 block discarded – undo
8132 8132
 									$translabel = $langs->trans($obj->{$InfoFieldList[1]});
8133 8133
 								}
8134 8134
 								if ($translabel != $obj->{$InfoFieldList[1]}) {
8135
-									$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . dol_trunc($translabel, 18) . '</li>';
8135
+									$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.dol_trunc($translabel, 18).'</li>';
8136 8136
 								} else {
8137
-									$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . $obj->{$InfoFieldList[1]} . '</li>';
8137
+									$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$obj->{$InfoFieldList[1]}.'</li>';
8138 8138
 								}
8139 8139
 							}
8140 8140
 						}
8141 8141
 					}
8142 8142
 				} else {
8143
-					require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
8143
+					require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
8144 8144
 
8145 8145
 					$toprint = array();
8146 8146
 					while ($obj = $this->db->fetch_object($resql)) {
@@ -8149,7 +8149,7 @@  discard block
 block discarded – undo
8149 8149
 							$c->fetch($obj->rowid);
8150 8150
 							$ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text
8151 8151
 							foreach ($ways as $way) {
8152
-								$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #aaa"') . '>' . img_object('', 'category') . ' ' . $way . '</li>';
8152
+								$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #aaa"').'>'.img_object('', 'category').' '.$way.'</li>';
8153 8153
 							}
8154 8154
 						}
8155 8155
 					}
@@ -8297,7 +8297,7 @@  discard block
 block discarded – undo
8297 8297
 		global $langs;
8298 8298
 
8299 8299
 		if (!class_exists('Validate')) {
8300
-			require_once DOL_DOCUMENT_ROOT . '/core/class/validate.class.php';
8300
+			require_once DOL_DOCUMENT_ROOT.'/core/class/validate.class.php';
8301 8301
 		}
8302 8302
 
8303 8303
 		$this->clearFieldError($fieldKey);
@@ -8529,7 +8529,7 @@  discard block
 block discarded – undo
8529 8529
 				$out .= "\n";
8530 8530
 
8531 8531
 				$nbofextrafieldsshown = 0;
8532
-				$e = 0;	// var to manage the modulo (odd/even)
8532
+				$e = 0; // var to manage the modulo (odd/even)
8533 8533
 
8534 8534
 				$lastseparatorkeyfound = '';
8535 8535
 				$extrafields_collapse_num = '';
@@ -8580,7 +8580,7 @@  discard block
 block discarded – undo
8580 8580
 					}
8581 8581
 
8582 8582
 					$colspan = 0;
8583
-					if (is_array($params) && count($params) > 0 && $display_type=='card') {
8583
+					if (is_array($params) && count($params) > 0 && $display_type == 'card') {
8584 8584
 						if (array_key_exists('cols', $params)) {
8585 8585
 							$colspan = $params['cols'];
8586 8586
 						} elseif (array_key_exists('colspan', $params)) {	// For backward compatibility. Use cols instead now.
@@ -8667,7 +8667,7 @@  discard block
 block discarded – undo
8667 8667
 						$domData .= ' data-targetid="'.$this->id.'"';
8668 8668
 
8669 8669
 						$html_id = (empty($this->id) ? '' : 'extrarow-'.$this->element.'_'.$key.'_'.$this->id);
8670
-						if ($display_type=='card') {
8670
+						if ($display_type == 'card') {
8671 8671
 							if (getDolGlobalString('MAIN_EXTRAFIELDS_USE_TWO_COLUMS') && ($e % 2) == 0) {
8672 8672
 								$colspan = 0;
8673 8673
 							}
@@ -8778,12 +8778,12 @@  discard block
 block discarded – undo
8778 8778
 								break;
8779 8779
 						}
8780 8780
 
8781
-						$out .= ($display_type=='card' ? '</td>' : '</div>');
8781
+						$out .= ($display_type == 'card' ? '</td>' : '</div>');
8782 8782
 
8783 8783
 						if (getDolGlobalString('MAIN_EXTRAFIELDS_USE_TWO_COLUMS') && (($e % 2) == 1)) {
8784
-							$out .= ($display_type=='card' ? '</tr>' : '</div>');
8784
+							$out .= ($display_type == 'card' ? '</tr>' : '</div>');
8785 8785
 						} else {
8786
-							$out .= ($display_type=='card' ? '</tr>' : '</div>');
8786
+							$out .= ($display_type == 'card' ? '</tr>' : '</div>');
8787 8787
 						}
8788 8788
 
8789 8789
 						$e++;
@@ -9052,13 +9052,13 @@  discard block
 block discarded – undo
9052 9052
 		if (!empty($this->photo)) {
9053 9053
 			if (dolIsAllowedForPreview($this->photo)) {
9054 9054
 				if ((string) $imagesize == 'mini') {
9055
-					$file = get_exdir(0, 0, 0, 0, $this, $newmodulepart) . 'photos/' . dol_sanitizeFileName(getImageFileNameForSize($this->photo, '_mini'));
9055
+					$file = get_exdir(0, 0, 0, 0, $this, $newmodulepart).'photos/'.dol_sanitizeFileName(getImageFileNameForSize($this->photo, '_mini'));
9056 9056
 				} elseif ((string) $imagesize == 'small') {
9057
-					$file = get_exdir(0, 0, 0, 0, $this, $newmodulepart) . 'photos/' . dol_sanitizeFileName(getImageFileNameForSize($this->photo, '_small'));
9057
+					$file = get_exdir(0, 0, 0, 0, $this, $newmodulepart).'photos/'.dol_sanitizeFileName(getImageFileNameForSize($this->photo, '_small'));
9058 9058
 				} else {
9059
-					$file = get_exdir(0, 0, 0, 0, $this, $newmodulepart) . 'photos/' . dol_sanitizeFileName($this->photo);
9059
+					$file = get_exdir(0, 0, 0, 0, $this, $newmodulepart).'photos/'.dol_sanitizeFileName($this->photo);
9060 9060
 				}
9061
-				$originalfile = get_exdir(0, 0, 0, 0, $this, $newmodulepart) . 'photos/' . dol_sanitizeFileName($this->photo);
9061
+				$originalfile = get_exdir(0, 0, 0, 0, $this, $newmodulepart).'photos/'.dol_sanitizeFileName($this->photo);
9062 9062
 			}
9063 9063
 		}
9064 9064
 
@@ -9626,7 +9626,7 @@  discard block
 block discarded – undo
9626 9626
 						continue;
9627 9627
 					}
9628 9628
 				}
9629
-				$keys_with_alias[] = $alias . '.' . $fieldname;
9629
+				$keys_with_alias[] = $alias.'.'.$fieldname;
9630 9630
 			}
9631 9631
 			return implode(',', $keys_with_alias);
9632 9632
 		} else {
@@ -9746,7 +9746,7 @@  discard block
 block discarded – undo
9746 9746
 		if (!$error) {
9747 9747
 			$sql = "INSERT INTO ".$this->db->prefix().$this->table_element;
9748 9748
 			$sql .= " (".implode(", ", $keys).')';
9749
-			$sql .= " VALUES (".implode(", ", $values).")";		// $values can contains 'abc' or 123
9749
+			$sql .= " VALUES (".implode(", ", $values).")"; // $values can contains 'abc' or 123
9750 9750
 
9751 9751
 			$res = $this->db->query($sql);
9752 9752
 			if (!$res) {
@@ -10031,7 +10031,7 @@  discard block
 block discarded – undo
10031 10031
 
10032 10032
 		// Update extrafield
10033 10033
 		if (!$error) {
10034
-			$result = $this->insertExtraFields();	// This delete and reinsert extrafields
10034
+			$result = $this->insertExtraFields(); // This delete and reinsert extrafields
10035 10035
 			if ($result < 0) {
10036 10036
 				$error++;
10037 10037
 			}
@@ -10239,12 +10239,12 @@  discard block
 block discarded – undo
10239 10239
 				$error++;
10240 10240
 			} else {
10241 10241
 				while ($obj = $this->db->fetch_object($resql)) {
10242
-					$result = $this->fetch($obj->rowid);	// @phpstan-ignore-line
10242
+					$result = $this->fetch($obj->rowid); // @phpstan-ignore-line
10243 10243
 					if ($result < 0) {
10244 10244
 						$error++;
10245 10245
 						$this->errors[] = $this->error;
10246 10246
 					} else {
10247
-						$result = $this->delete($user);	// @phpstan-ignore-line
10247
+						$result = $this->delete($user); // @phpstan-ignore-line
10248 10248
 						if ($result < 0) {
10249 10249
 							$error++;
10250 10250
 							$this->errors[] = $this->error;
@@ -10407,7 +10407,7 @@  discard block
 block discarded – undo
10407 10407
 		);
10408 10408
 		foreach ($fields as $key => $value) {
10409 10409
 			if (array_key_exists($key, $this->fields)) {
10410
-				$this->{$key} = $value;		// @phpstan-ignore-line
10410
+				$this->{$key} = $value; // @phpstan-ignore-line
10411 10411
 			}
10412 10412
 		}
10413 10413
 
@@ -10553,7 +10553,7 @@  discard block
 block discarded – undo
10553 10553
 		// Process
10554 10554
 		foreach ($to_del as $del) {
10555 10555
 			if ($c->fetch($del) > 0) {
10556
-				$result=$c->del_type($this, $type_categ);
10556
+				$result = $c->del_type($this, $type_categ);
10557 10557
 				if ($result < 0) {
10558 10558
 					$error++;
10559 10559
 					$this->error = $c->error;
Please login to merge, or discard this patch.
htdocs/core/class/conf.class.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 
120 120
 	public $liste_limit;
121 121
 
122
-	public $tzuserinputkey = 'tzserver';		// Use 'tzuserrel' to always store date in GMT and show date in time zone of user.
122
+	public $tzuserinputkey = 'tzserver'; // Use 'tzuserrel' to always store date in GMT and show date in time zone of user.
123 123
 
124 124
 
125 125
 	// TODO Remove this part.
@@ -344,7 +344,7 @@  discard block
 block discarded – undo
344 344
 							$value = $_ENV['DOLIBARR_'.$key];
345 345
 						}
346 346
 
347
-						$this->global->$key = dolDecrypt($value);	// decrypt data excrypted with dolibarr_set_const($db, $name, $value)
347
+						$this->global->$key = dolDecrypt($value); // decrypt data excrypted with dolibarr_set_const($db, $name, $value)
348 348
 
349 349
 						if ($value && strpos($key, 'MAIN_MODULE_') === 0) {
350 350
 							$reg = array();
@@ -400,9 +400,9 @@  discard block
 block discarded – undo
400 400
 								// deprecated in php 8.2
401 401
 								//if (version_compare(phpversion(), '8.2') < 0) {
402 402
 								if (!isset($this->$modulename) || !is_object($this->$modulename)) {
403
-									$this->$modulename = new stdClass();	// We need this to use the ->enabled and the ->multidir, ->dir...
403
+									$this->$modulename = new stdClass(); // We need this to use the ->enabled and the ->multidir, ->dir...
404 404
 								}
405
-								$this->$modulename->enabled = true;	// TODO Remove this
405
+								$this->$modulename->enabled = true; // TODO Remove this
406 406
 								//}
407 407
 							}
408 408
 						}
@@ -732,7 +732,7 @@  discard block
 block discarded – undo
732 732
 			}
733 733
 
734 734
 			if (!isset($this->global->MAIN_ENABLE_AJAX_TOOLTIP)) {
735
-				$this->global->MAIN_ENABLE_AJAX_TOOLTIP = 0;	// Not enabled by default (still trouble of persistent tooltip)
735
+				$this->global->MAIN_ENABLE_AJAX_TOOLTIP = 0; // Not enabled by default (still trouble of persistent tooltip)
736 736
 			}
737 737
 
738 738
 			// By default, suppliers objects can be linked to all projects
@@ -1011,7 +1011,7 @@  discard block
 block discarded – undo
1011 1011
 			}
1012 1012
 
1013 1013
 			if (!isset($this->global->MAIL_SMTP_USE_FROM_FOR_HELO)) {
1014
-				$this->global->MAIL_SMTP_USE_FROM_FOR_HELO = 2;	// Use the domain in $dolibarr_main_url_root (mydomain.com)
1014
+				$this->global->MAIL_SMTP_USE_FROM_FOR_HELO = 2; // Use the domain in $dolibarr_main_url_root (mydomain.com)
1015 1015
 			}
1016 1016
 
1017 1017
 			if (!defined('MAIN_ANTIVIRUS_BYPASS_COMMAND_AND_PARAM')) {
@@ -1041,7 +1041,7 @@  discard block
 block discarded – undo
1041 1041
 			}
1042 1042
 
1043 1043
 			if (!empty($this->global->MAIN_TZUSERINPUTKEY)) {
1044
-				$this->tzuserinputkey = $this->global->MAIN_TZUSERINPUTKEY;	// 'tzserver' or 'tzuserrel'
1044
+				$this->tzuserinputkey = $this->global->MAIN_TZUSERINPUTKEY; // 'tzserver' or 'tzuserrel'
1045 1045
 			}
1046 1046
 
1047 1047
 			if (!empty($this->global->PRODUIT_AUTOFILL_DESC)) {
Please login to merge, or discard this patch.
htdocs/projet/card.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -38,9 +38,9 @@  discard block
 block discarded – undo
38 38
 require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
39 39
 
40 40
 // Load translation files required by the page
41
-$langsLoad=array('projects', 'companies');
41
+$langsLoad = array('projects', 'companies');
42 42
 if (isModEnabled('eventorganization')) {
43
-	$langsLoad[]='eventorganization';
43
+	$langsLoad[] = 'eventorganization';
44 44
 }
45 45
 
46 46
 $langs->loadLangs($langsLoad);
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 
110 110
 $permissiontoadd = $user->hasRight('projet', 'creer');
111 111
 $permissiontodelete = $user->hasRight('projet', 'supprimer');
112
-$permissiondellink = $user->hasRight('projet', 'creer');	// Used by the include of actions_dellink.inc.php
112
+$permissiondellink = $user->hasRight('projet', 'creer'); // Used by the include of actions_dellink.inc.php
113 113
 
114 114
 
115 115
 /*
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
 		$action = '';
161 161
 	}
162 162
 
163
-	include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php';		// Must be include, not include_once
163
+	include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be include, not include_once
164 164
 
165 165
 	// Action setdraft object
166 166
 	if ($action == 'confirm_setdraft' && $confirm == 'yes' && $permissiontoadd) {
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
 			$object->date_end_event   = (!GETPOST('date_end_event')) ? '' : $date_end_event;
321 321
 			$object->location     = $location;
322 322
 			if (GETPOSTISSET('opp_amount')) {
323
-				$object->opp_amount   = price2num(GETPOST('opp_amount', 'alpha'));
323
+				$object->opp_amount = price2num(GETPOST('opp_amount', 'alpha'));
324 324
 			}
325 325
 			if (GETPOSTISSET('budget_amount')) {
326 326
 				$object->budget_amount = price2num(GETPOST('budget_amount', 'alpha'));
@@ -508,7 +508,7 @@  discard block
 block discarded – undo
508 508
 			if (!empty($_SESSION['pageforbacktolist']) && !empty($_SESSION['pageforbacktolist']['project'])) {
509 509
 				$tmpurl = $_SESSION['pageforbacktolist']['project'];
510 510
 				$tmpurl = preg_replace('/__SOCID__/', $object->socid, $tmpurl);
511
-				$urlback = $tmpurl.(preg_match('/\?/', $tmpurl) ? '&' : '?'). 'restore_lastsearch_values=1';
511
+				$urlback = $tmpurl.(preg_match('/\?/', $tmpurl) ? '&' : '?').'restore_lastsearch_values=1';
512 512
 			} else {
513 513
 				$urlback = DOL_URL_ROOT.'/projet/list.php?restore_lastsearch_values=1';
514 514
 			}
@@ -1069,7 +1069,7 @@  discard block
 block discarded – undo
1069 1069
 				print '<br>';
1070 1070
 			}
1071 1071
 			if (!getDolGlobalString('PROJECT_HIDE_TASKS')) {
1072
-				print '<input type="checkbox" id="usage_task" name="usage_task"' . (GETPOSTISSET('usage_task') ? (GETPOST('usage_task', 'alpha') != '' ? ' checked="checked"' : '') : ($object->usage_task ? ' checked="checked"' : '')) . '> ';
1072
+				print '<input type="checkbox" id="usage_task" name="usage_task"'.(GETPOSTISSET('usage_task') ? (GETPOST('usage_task', 'alpha') != '' ? ' checked="checked"' : '') : ($object->usage_task ? ' checked="checked"' : '')).'> ';
1073 1073
 				$htmltext = $langs->trans("ProjectFollowTasks");
1074 1074
 				print '<label for="usage_task">'.$form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext).'</label>';
1075 1075
 				print '<script>';
@@ -1095,7 +1095,7 @@  discard block
 block discarded – undo
1095 1095
 				print '<br>';
1096 1096
 			}
1097 1097
 			if (!getDolGlobalString('PROJECT_HIDE_TASKS') && getDolGlobalString('PROJECT_BILL_TIME_SPENT')) {
1098
-				print '<input type="checkbox" id="usage_bill_time" name="usage_bill_time"' . (GETPOSTISSET('usage_bill_time') ? (GETPOST('usage_bill_time', 'alpha') != '' ? ' checked="checked"' : '') : ($object->usage_bill_time ? ' checked="checked"' : '')) . '> ';
1098
+				print '<input type="checkbox" id="usage_bill_time" name="usage_bill_time"'.(GETPOSTISSET('usage_bill_time') ? (GETPOST('usage_bill_time', 'alpha') != '' ? ' checked="checked"' : '') : ($object->usage_bill_time ? ' checked="checked"' : '')).'> ';
1099 1099
 				$htmltext = $langs->trans("ProjectBillTimeDescription");
1100 1100
 				print '<label for="usage_bill_time">'.$form->textwithpicto($langs->trans("BillTime"), $htmltext).'</label>';
1101 1101
 				print '<script>';
@@ -1121,7 +1121,7 @@  discard block
 block discarded – undo
1121 1121
 				print '<br>';
1122 1122
 			}
1123 1123
 			if (isModEnabled('eventorganization')) {
1124
-				print '<input type="checkbox" id="usage_organize_event" name="usage_organize_event"'. (GETPOSTISSET('usage_organize_event') ? (GETPOST('usage_organize_event', 'alpha') != '' ? ' checked="checked"' : '') : ($object->usage_organize_event ? ' checked="checked"' : '')) . '> ';
1124
+				print '<input type="checkbox" id="usage_organize_event" name="usage_organize_event"'.(GETPOSTISSET('usage_organize_event') ? (GETPOST('usage_organize_event', 'alpha') != '' ? ' checked="checked"' : '') : ($object->usage_organize_event ? ' checked="checked"' : '')).'> ';
1125 1125
 				$htmltext = $langs->trans("EventOrganizationDescriptionLong");
1126 1126
 				print '<label for="usage_organize_event">'.$form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext).'</label>';
1127 1127
 				print '<script>';
@@ -1300,7 +1300,7 @@  discard block
 block discarded – undo
1300 1300
 		if (!empty($_SESSION['pageforbacktolist']) && !empty($_SESSION['pageforbacktolist']['project'])) {
1301 1301
 			$tmpurl = $_SESSION['pageforbacktolist']['project'];
1302 1302
 			$tmpurl = preg_replace('/__SOCID__/', $object->socid, $tmpurl);
1303
-			$linkback = '<a href="'.$tmpurl.(preg_match('/\?/', $tmpurl) ? '&' : '?'). 'restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
1303
+			$linkback = '<a href="'.$tmpurl.(preg_match('/\?/', $tmpurl) ? '&' : '?').'restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
1304 1304
 		} else {
1305 1305
 			$linkback = '<a href="'.DOL_URL_ROOT.'/projet/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
1306 1306
 		}
@@ -1388,8 +1388,8 @@  discard block
 block discarded – undo
1388 1388
 				print '<a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=edit_opp_status&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('Edit'), 1).'</a>';
1389 1389
 			}
1390 1390
 			print '</td><td>';
1391
-			$html_name_status 	= ($action == 'edit_opp_status') ? 'opp_status' : 'none';
1392
-			$html_name_percent 	= ($action == 'edit_opp_status') ? 'opp_percent' : 'none';
1391
+			$html_name_status = ($action == 'edit_opp_status') ? 'opp_status' : 'none';
1392
+			$html_name_percent = ($action == 'edit_opp_status') ? 'opp_percent' : 'none';
1393 1393
 			$percent_value = (GETPOSTISSET('opp_percent') ? GETPOST('opp_percent') : (strcmp($object->opp_percent, '') ? vatrate($object->opp_percent) : ''));
1394 1394
 			$formproject->formOpportunityStatus($_SERVER['PHP_SELF'].'?socid='.$object->id, $object->opp_status, $percent_value, $html_name_status, $html_name_percent);
1395 1395
 			print '</td></tr>';
@@ -1600,7 +1600,7 @@  discard block
 block discarded – undo
1600 1600
 					if ($userWrite > 0) {
1601 1601
 						print dolGetButtonAction('', $langs->trans('SetToDraft'), 'default', $_SERVER["PHP_SELF"].'?action=confirm_setdraft&amp;confirm=yes&amp;token='.newToken().'&amp;id='.$object->id, '');
1602 1602
 					} else {
1603
-						print dolGetButtonAction($langs->trans('NotOwnerOfProject'), $langs->trans('SetToDraft'), 'default', $_SERVER['PHP_SELF']. '#', '', false);
1603
+						print dolGetButtonAction($langs->trans('NotOwnerOfProject'), $langs->trans('SetToDraft'), 'default', $_SERVER['PHP_SELF'].'#', '', false);
1604 1604
 					}
1605 1605
 				}
1606 1606
 			}
@@ -1610,7 +1610,7 @@  discard block
 block discarded – undo
1610 1610
 				if ($userWrite > 0) {
1611 1611
 					print dolGetButtonAction('', $langs->trans('Modify'), 'default', $_SERVER["PHP_SELF"].'?action=edit&token='.newToken().'&id='.$object->id, '');
1612 1612
 				} else {
1613
-					print dolGetButtonAction($langs->trans('NotOwnerOfProject'), $langs->trans('Modify'), 'default', $_SERVER['PHP_SELF']. '#', '', false);
1613
+					print dolGetButtonAction($langs->trans('NotOwnerOfProject'), $langs->trans('Modify'), 'default', $_SERVER['PHP_SELF'].'#', '', false);
1614 1614
 				}
1615 1615
 			}
1616 1616
 
@@ -1619,7 +1619,7 @@  discard block
 block discarded – undo
1619 1619
 				if ($userWrite > 0) {
1620 1620
 					print dolGetButtonAction('', $langs->trans('Validate'), 'default', $_SERVER["PHP_SELF"].'?action=validate&amp;token='.newToken().'&amp;id='.$object->id, '');
1621 1621
 				} else {
1622
-					print dolGetButtonAction($langs->trans('NotOwnerOfProject'), $langs->trans('Validate'), 'default', $_SERVER['PHP_SELF']. '#', '', false);
1622
+					print dolGetButtonAction($langs->trans('NotOwnerOfProject'), $langs->trans('Validate'), 'default', $_SERVER['PHP_SELF'].'#', '', false);
1623 1623
 				}
1624 1624
 			}
1625 1625
 
@@ -1628,7 +1628,7 @@  discard block
 block discarded – undo
1628 1628
 				if ($userWrite > 0) {
1629 1629
 					print dolGetButtonAction('', $langs->trans('Close'), 'default', $_SERVER["PHP_SELF"].'?action=close&amp;token='.newToken().'&amp;id='.$object->id, '');
1630 1630
 				} else {
1631
-					print dolGetButtonAction($langs->trans('NotOwnerOfProject'), $langs->trans('Close'), 'default', $_SERVER['PHP_SELF']. '#', '', false);
1631
+					print dolGetButtonAction($langs->trans('NotOwnerOfProject'), $langs->trans('Close'), 'default', $_SERVER['PHP_SELF'].'#', '', false);
1632 1632
 				}
1633 1633
 			}
1634 1634
 
@@ -1637,7 +1637,7 @@  discard block
 block discarded – undo
1637 1637
 				if ($userWrite > 0) {
1638 1638
 					print dolGetButtonAction('', $langs->trans('ReOpen'), 'default', $_SERVER["PHP_SELF"].'?action=reopen&amp;token='.newToken().'&amp;id='.$object->id, '');
1639 1639
 				} else {
1640
-					print dolGetButtonAction($langs->trans('NotOwnerOfProject'), $langs->trans('ReOpen'), 'default', $_SERVER['PHP_SELF']. '#', '', false);
1640
+					print dolGetButtonAction($langs->trans('NotOwnerOfProject'), $langs->trans('ReOpen'), 'default', $_SERVER['PHP_SELF'].'#', '', false);
1641 1641
 				}
1642 1642
 			}
1643 1643
 
@@ -1666,7 +1666,7 @@  discard block
 block discarded – undo
1666 1666
 				if ($userWrite > 0) {
1667 1667
 					print dolGetButtonAction('', $langs->trans('ToClone'), 'default', $_SERVER["PHP_SELF"].'?action=clone&amp;token='.newToken().'&amp;id='.$object->id, '');
1668 1668
 				} else {
1669
-					print dolGetButtonAction($langs->trans('NotOwnerOfProject'), $langs->trans('ToClone'), 'default', $_SERVER['PHP_SELF']. '#', '', false);
1669
+					print dolGetButtonAction($langs->trans('NotOwnerOfProject'), $langs->trans('ToClone'), 'default', $_SERVER['PHP_SELF'].'#', '', false);
1670 1670
 				}
1671 1671
 			}
1672 1672
 
@@ -1675,7 +1675,7 @@  discard block
 block discarded – undo
1675 1675
 				if ($userDelete > 0 || ($object->statut == Project::STATUS_DRAFT && $user->hasRight('projet', 'creer'))) {
1676 1676
 					print dolGetButtonAction('', $langs->trans('Delete'), 'delete', $_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&id='.$object->id, '');
1677 1677
 				} else {
1678
-					print dolGetButtonAction($langs->trans('NotOwnerOfProject'), $langs->trans('Delete'), 'default', $_SERVER['PHP_SELF']. '#', '', false);
1678
+					print dolGetButtonAction($langs->trans('NotOwnerOfProject'), $langs->trans('Delete'), 'default', $_SERVER['PHP_SELF'].'#', '', false);
1679 1679
 				}
1680 1680
 			}
1681 1681
 		}
Please login to merge, or discard this patch.
htdocs/projet/contact.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -34,9 +34,9 @@  discard block
 block discarded – undo
34 34
 }
35 35
 
36 36
 // Load translation files required by the page
37
-$langsLoad=array('projects', 'companies');
37
+$langsLoad = array('projects', 'companies');
38 38
 if (isModEnabled('eventorganization')) {
39
-	$langsLoad[]='eventorganization';
39
+	$langsLoad[] = 'eventorganization';
40 40
 }
41 41
 
42 42
 $langs->loadLangs($langsLoad);
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 	if ($action == 'addcontact') {
82 82
 		$form = new Form($db);
83 83
 
84
-		$source=GETPOST("source", 'aZ09');
84
+		$source = GETPOST("source", 'aZ09');
85 85
 
86 86
 		$taskstatic = new Task($db);
87 87
 		$task_array = $taskstatic->getTasksArray(0, 0, $object->id, 0, 0);
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 		$type_to = (GETPOST('typecontact') ? 'typecontact='.GETPOST('typecontact') : 'type='.GETPOST('type'));
92 92
 		$personToAffect = (GETPOST('userid') ? GETPOST('userid', 'int') : GETPOST('contactid', 'int'));
93 93
 		$affect_to = (GETPOST('userid') ? 'userid='.$personToAffect : 'contactid='.$personToAffect);
94
-		$url_redirect='?id='.$object->id.'&'.$affect_to.'&'.$type_to.'&source='.$source;
94
+		$url_redirect = '?id='.$object->id.'&'.$affect_to.'&'.$type_to.'&source='.$source;
95 95
 
96 96
 		if ($personToAffect > 0 && (!getDolGlobalString('PROJECT_HIDE_TASKS') || $nbTasks > 0)) {
97 97
 			$text = $langs->trans('AddPersonToTask');
@@ -100,13 +100,13 @@  discard block
 block discarded – undo
100 100
 
101 101
 			$task_to_affect = array();
102 102
 			foreach ($task_array as $task) {
103
-				$task_already_affected=false;
103
+				$task_already_affected = false;
104 104
 				$personsLinked = $task->liste_contact(-1, $source);
105 105
 				if (!is_array($personsLinked) && count($personsLinked) < 0) {
106 106
 					setEventMessage($object->error, 'errors');
107 107
 				} else {
108 108
 					foreach ($personsLinked as $person) {
109
-						if ($person['id']==$personToAffect) {
109
+						if ($person['id'] == $personToAffect) {
110 110
 							$task_already_affected = true;
111 111
 							break;
112 112
 						}
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
 				$formcompany = new FormCompany($db);
124 124
 				foreach ($task_array as $task) {
125 125
 					$key = $task->id;
126
-					$val = $task->ref . ' '.dol_trunc($task->label);
126
+					$val = $task->ref.' '.dol_trunc($task->label);
127 127
 					$formquestion[] = array(
128 128
 						'type' => 'other',
129 129
 						'name' => 'person_'.$key.',person_role_'.$key,
@@ -134,8 +134,8 @@  discard block
 block discarded – undo
134 134
 				$formquestion[] = array('type'=> 'other', 'name'=>'tasksavailable', 'label'=>'', 'value' => '<input type="hidden" id="tasksavailable" name="tasksavailable" value="'.implode(',', array_keys($task_to_affect)).'">');
135 135
 			}
136 136
 
137
-			$formconfirmtoaddtasks = $form->formconfirm($_SERVER['PHP_SELF'] . $url_redirect, $text, '', 'addcontact_confirm', $formquestion, '', 1, 300, 590);
138
-			$formconfirmtoaddtasks .='
137
+			$formconfirmtoaddtasks = $form->formconfirm($_SERVER['PHP_SELF'].$url_redirect, $text, '', 'addcontact_confirm', $formquestion, '', 1, 300, 590);
138
+			$formconfirmtoaddtasks .= '
139 139
 			 <script>
140 140
 			 $(document).ready(function() {
141 141
 				var saveprop = false;
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
 			} else {
187 187
 				$error++;
188 188
 			}
189
-		} elseif (! ($contactid > 0)) {
189
+		} elseif (!($contactid > 0)) {
190 190
 			$error++;
191 191
 			$langs->load("errors");
192 192
 			setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Contact")), null, 'errors');
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
 					}
223 223
 				}
224 224
 
225
-				$affecttotask=GETPOST('tasksavailable', 'intcomma');
225
+				$affecttotask = GETPOST('tasksavailable', 'intcomma');
226 226
 				if (!empty($affecttotask)) {
227 227
 					require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php';
228 228
 					$task_to_affect = explode(',', $affecttotask);
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
 						foreach ($task_to_affect as $task_id) {
231 231
 							if (GETPOSTISSET('person_'.$task_id) && GETPOST('person_'.$task_id, 'san_alpha')) {
232 232
 								$tasksToAffect = new Task($db);
233
-								$result=$tasksToAffect->fetch($task_id);
233
+								$result = $tasksToAffect->fetch($task_id);
234 234
 								if ($result < 0) {
235 235
 									setEventMessages($tasksToAffect->error, null, 'errors');
236 236
 								} else {
@@ -347,7 +347,7 @@  discard block
 block discarded – undo
347 347
 	if (!empty($_SESSION['pageforbacktolist']) && !empty($_SESSION['pageforbacktolist']['project'])) {
348 348
 		$tmpurl = $_SESSION['pageforbacktolist']['project'];
349 349
 		$tmpurl = preg_replace('/__SOCID__/', $object->socid, $tmpurl);
350
-		$linkback = '<a href="'.$tmpurl.(preg_match('/\?/', $tmpurl) ? '&' : '?'). 'restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
350
+		$linkback = '<a href="'.$tmpurl.(preg_match('/\?/', $tmpurl) ? '&' : '?').'restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
351 351
 	} else {
352 352
 		$linkback = '<a href="'.DOL_URL_ROOT.'/projet/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
353 353
 	}
Please login to merge, or discard this patch.
htdocs/expedition/class/expedition.class.php 1 patch
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -2720,43 +2720,43 @@
 block discarded – undo
2720 2720
 	public $product_type = 0;
2721 2721
 
2722 2722
 	/**
2723
-	* @var int rang of line
2724
-	*/
2723
+	 * @var int rang of line
2724
+	 */
2725 2725
 	public $rang;
2726 2726
 
2727 2727
 	/**
2728
-	* @var float weight
2729
-	*/
2728
+	 * @var float weight
2729
+	 */
2730 2730
 	public $weight;
2731 2731
 	public $weight_units;
2732 2732
 
2733 2733
 	/**
2734
-	* @var float length
2735
-	*/
2734
+	 * @var float length
2735
+	 */
2736 2736
 	public $length;
2737 2737
 	public $length_units;
2738 2738
 
2739 2739
 	/**
2740
-	* @var float width
2741
-	*/
2740
+	 * @var float width
2741
+	 */
2742 2742
 	public $width;
2743 2743
 	public $width_units;
2744 2744
 
2745 2745
 	/**
2746
-	* @var float height
2747
-	*/
2746
+	 * @var float height
2747
+	 */
2748 2748
 	public $height;
2749 2749
 	public $height_units;
2750 2750
 
2751 2751
 	/**
2752
-	* @var float surface
2753
-	*/
2752
+	 * @var float surface
2753
+	 */
2754 2754
 	public $surface;
2755 2755
 	public $surface_units;
2756 2756
 
2757 2757
 	/**
2758
-	* @var float volume
2759
-	*/
2758
+	 * @var float volume
2759
+	 */
2760 2760
 	public $volume;
2761 2761
 	public $volume_units;
2762 2762
 
Please login to merge, or discard this patch.