Completed
Branch develop (786017)
by
unknown
17:38
created
htdocs/societe/index.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -292,7 +292,7 @@  discard block
 block discarded – undo
292 292
 $sql .= ", s.canvas, s.tms as date_modification, s.status as status";
293 293
 $sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
294 294
 if (getDolGlobalString('MAIN_COMPANY_PERENTITY_SHARED')) {
295
-	$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = " . ((int) $conf->entity);
295
+	$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = ".((int) $conf->entity);
296 296
 }
297 297
 if (!$user->hasRight('societe', 'client', 'voir')) {
298 298
 	$sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@@ -317,7 +317,7 @@  discard block
 block discarded – undo
317 317
 $sql .= $db->plimit($max, 0);
318 318
 
319 319
 //print $sql;
320
-$lastmodified="";
320
+$lastmodified = "";
321 321
 $result = $db->query($sql);
322 322
 if ($result) {
323 323
 	$num = $db->num_rows($result);
Please login to merge, or discard this patch.
htdocs/user/class/user.class.php 1 patch
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -581,9 +581,9 @@  discard block
 block discarded – undo
581 581
 				$this->admin		= $obj->admin;
582 582
 				$this->note_public = $obj->note_public;
583 583
 				$this->note_private = $obj->note_private;
584
-				$this->note			= $obj->note_private;	// deprecated
584
+				$this->note			= $obj->note_private; // deprecated
585 585
 
586
-				$this->statut		= $obj->status;			// deprecated
586
+				$this->statut		= $obj->status; // deprecated
587 587
 				$this->status		= $obj->status;
588 588
 
589 589
 				$this->photo		= $obj->photo;
@@ -710,7 +710,7 @@  discard block
 block discarded – undo
710 710
 			require_once DOL_DOCUMENT_ROOT.'/core/class/defaultvalues.class.php';
711 711
 
712 712
 			$defaultValues = new DefaultValues($this->db);
713
-			$result = $defaultValues->fetchAll('', '', 0, 0, array('t.user_id'=>array(0, $this->id), 'entity'=>array((isset($this->entity) ? $this->entity : $conf->entity), $conf->entity)));	// User 0 (all) + me (if defined)
713
+			$result = $defaultValues->fetchAll('', '', 0, 0, array('t.user_id'=>array(0, $this->id), 'entity'=>array((isset($this->entity) ? $this->entity : $conf->entity), $conf->entity))); // User 0 (all) + me (if defined)
714 714
 
715 715
 			if (!is_array($result) && $result < 0) {
716 716
 				setEventMessages($defaultValues->error, $defaultValues->errors, 'errors');
@@ -784,7 +784,7 @@  discard block
 block discarded – undo
784 784
 		}
785 785
 
786 786
 		$moduleRightsMapping = array(
787
-			'product' => 'produit',	// We must check $user->rights->produit...
787
+			'product' => 'produit', // We must check $user->rights->produit...
788 788
 			'margin' => 'margins',
789 789
 			'comptabilite' => 'compta'
790 790
 		);
@@ -819,7 +819,7 @@  discard block
 block discarded – undo
819 819
 		// Special case for external user
820 820
 		if (!empty($this->socid)) {
821 821
 			if ($module = 'societe' && $permlevel1 = 'client' && $permlevel2 == 'voir') {
822
-				return 0;	// An external user never has the permission ->societe->client->voir to see all thirdparties (always restricted to himself)
822
+				return 0; // An external user never has the permission ->societe->client->voir to see all thirdparties (always restricted to himself)
823 823
 			}
824 824
 		}
825 825
 
@@ -967,7 +967,7 @@  discard block
 block discarded – undo
967 967
 			$sql .= " FROM ".$this->db->prefix()."rights_def";
968 968
 			$sql .= " WHERE entity = ".((int) $entity);
969 969
 			if (!empty($whereforadd) && $whereforadd != 'allmodules') {
970
-				$sql .= " AND (".$whereforadd.")";	// Note: parenthesis are important because whereforadd can contains OR. Also note that $whereforadd is already sanitized
970
+				$sql .= " AND (".$whereforadd.")"; // Note: parenthesis are important because whereforadd can contains OR. Also note that $whereforadd is already sanitized
971 971
 			}
972 972
 
973 973
 			$sqldelete = "DELETE FROM ".$this->db->prefix()."user_rights";
@@ -1102,7 +1102,7 @@  discard block
 block discarded – undo
1102 1102
 			$sql .= " FROM ".$this->db->prefix()."rights_def";
1103 1103
 			$sql .= " WHERE entity = ".((int) $entity);
1104 1104
 			if (!empty($wherefordel) && $wherefordel != 'allmodules') {
1105
-				$sql .= " AND (".$wherefordel.")";	// Note: parenthesis are important because wherefordel can contains OR. Also note that $wherefordel is already sanitized
1105
+				$sql .= " AND (".$wherefordel.")"; // Note: parenthesis are important because wherefordel can contains OR. Also note that $wherefordel is already sanitized
1106 1106
 			}
1107 1107
 
1108 1108
 			// avoid admin can remove his own important rights
@@ -1273,12 +1273,12 @@  discard block
 block discarded – undo
1273 1273
 				$sql .= " AND r.entity = ".((int) $conf->entity);
1274 1274
 			}
1275 1275
 		} else {
1276
-			$sql .= " AND gr.entity = ".((int) $conf->entity);	// Only groups created in current entity
1276
+			$sql .= " AND gr.entity = ".((int) $conf->entity); // Only groups created in current entity
1277 1277
 			// The entity on the table usergroup_user should be useless and should never be used because it is alreay into gr and r.
1278 1278
 			// but when using MULTICOMPANY_TRANSVERSE_MODE, we may insert record that make rubbish result due to duplicate record of
1279 1279
 			// other entities, so we are forced to add a filter here
1280 1280
 			$sql .= " AND gu.entity IN (0,".$conf->entity.")";
1281
-			$sql .= " AND r.entity = ".((int) $conf->entity);	// Only permission of modules enabled in current entity
1281
+			$sql .= " AND r.entity = ".((int) $conf->entity); // Only permission of modules enabled in current entity
1282 1282
 		}
1283 1283
 		// End of strange business rule
1284 1284
 		$sql .= " AND gr.fk_usergroup = gu.fk_usergroup";
@@ -1810,7 +1810,7 @@  discard block
 block discarded – undo
1810 1810
 		$this->civility_code = $member->civility_id;
1811 1811
 		$this->lastname     = $member->lastname;
1812 1812
 		$this->firstname    = $member->firstname;
1813
-		$this->gender		= $member->gender;
1813
+		$this->gender = $member->gender;
1814 1814
 		$this->email        = $member->email;
1815 1815
 		$this->fk_member    = $member->id;
1816 1816
 		$this->address      = $member->address;
@@ -1948,43 +1948,43 @@  discard block
 block discarded – undo
1948 1948
 		$this->lastname						= trim((string) $this->lastname);
1949 1949
 		$this->firstname					= trim((string) $this->firstname);
1950 1950
 		$this->ref_employee					= trim((string) $this->ref_employee);
1951
-		$this->national_registration_number	= trim((string) $this->national_registration_number);
1951
+		$this->national_registration_number = trim((string) $this->national_registration_number);
1952 1952
 		$this->employee						= ($this->employee > 0 ? $this->employee : 0);
1953 1953
 		$this->login						= trim((string) $this->login);
1954
-		$this->gender						= trim((string) $this->gender);
1954
+		$this->gender = trim((string) $this->gender);
1955 1955
 
1956 1956
 		$this->pass							= trim((string) $this->pass);
1957
-		$this->api_key						= trim((string) $this->api_key);
1958
-		$this->datestartvalidity			= empty($this->datestartvalidity) ? '' : $this->datestartvalidity;
1959
-		$this->dateendvalidity				= empty($this->dateendvalidity) ? '' : $this->dateendvalidity;
1957
+		$this->api_key = trim((string) $this->api_key);
1958
+		$this->datestartvalidity = empty($this->datestartvalidity) ? '' : $this->datestartvalidity;
1959
+		$this->dateendvalidity = empty($this->dateendvalidity) ? '' : $this->dateendvalidity;
1960 1960
 
1961
-		$this->address						= trim((string) $this->address);
1962
-		$this->zip							= trim((string) $this->zip);
1963
-		$this->town							= trim((string) $this->town);
1961
+		$this->address = trim((string) $this->address);
1962
+		$this->zip = trim((string) $this->zip);
1963
+		$this->town = trim((string) $this->town);
1964 1964
 
1965
-		$this->state_id						= ($this->state_id > 0 ? $this->state_id : 0);
1965
+		$this->state_id = ($this->state_id > 0 ? $this->state_id : 0);
1966 1966
 		$this->country_id					= ($this->country_id > 0 ? $this->country_id : 0);
1967
-		$this->office_phone					= trim((string) $this->office_phone);
1967
+		$this->office_phone = trim((string) $this->office_phone);
1968 1968
 		$this->office_fax					= trim((string) $this->office_fax);
1969
-		$this->user_mobile					= trim((string) $this->user_mobile);
1970
-		$this->personal_mobile				= trim((string) $this->personal_mobile);
1971
-		$this->email						= trim((string) $this->email);
1972
-		$this->personal_email				= trim((string) $this->personal_email);
1973
-
1974
-		$this->job							= trim((string) $this->job);
1975
-		$this->signature					= trim((string) $this->signature);
1976
-		$this->note_public					= trim((string) $this->note_public);
1977
-		$this->note_private					= trim((string) $this->note_private);
1978
-		$this->openid						= trim((string) $this->openid);
1969
+		$this->user_mobile = trim((string) $this->user_mobile);
1970
+		$this->personal_mobile = trim((string) $this->personal_mobile);
1971
+		$this->email = trim((string) $this->email);
1972
+		$this->personal_email = trim((string) $this->personal_email);
1973
+
1974
+		$this->job = trim((string) $this->job);
1975
+		$this->signature = trim((string) $this->signature);
1976
+		$this->note_public = trim((string) $this->note_public);
1977
+		$this->note_private = trim((string) $this->note_private);
1978
+		$this->openid = trim((string) $this->openid);
1979 1979
 		$this->admin						= ($this->admin > 0 ? $this->admin : 0);
1980 1980
 
1981 1981
 		$this->accountancy_code				= trim((string) $this->accountancy_code);
1982 1982
 		$this->color						= trim((string) $this->color);
1983
-		$this->dateemployment				= empty($this->dateemployment) ? '' : $this->dateemployment;
1983
+		$this->dateemployment = empty($this->dateemployment) ? '' : $this->dateemployment;
1984 1984
 		$this->dateemploymentend			= empty($this->dateemploymentend) ? '' : $this->dateemploymentend;
1985 1985
 
1986
-		$this->birth						= empty($this->birth) ? '' : $this->birth;
1987
-		$this->fk_warehouse					= (int) $this->fk_warehouse;
1986
+		$this->birth = empty($this->birth) ? '' : $this->birth;
1987
+		$this->fk_warehouse = (int) $this->fk_warehouse;
1988 1988
 
1989 1989
 		$this->setUpperOrLowerCase();
1990 1990
 
@@ -2738,7 +2738,7 @@  discard block
 block discarded – undo
2738 2738
 		$sql .= " WHERE fk_user  = ".((int) $this->id);
2739 2739
 		$sql .= " AND fk_usergroup = ".((int) $group);
2740 2740
 		if (empty($entity)) {
2741
-			$sql .= " AND entity IN (0, 1)";	// group may be in entity 0 (so $entity=0) and link with user into entity 1.
2741
+			$sql .= " AND entity IN (0, 1)"; // group may be in entity 0 (so $entity=0) and link with user into entity 1.
2742 2742
 		} else {
2743 2743
 			$sql .= " AND entity = ".((int) $entity);
2744 2744
 		}
@@ -2998,7 +2998,7 @@  discard block
 block discarded – undo
2998 2998
 				$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
2999 2999
 			}
3000 3000
 			$linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"');
3001
-			$linkclose .= $dataparams . ' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"';
3001
+			$linkclose .= $dataparams.' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"';
3002 3002
 		} else {
3003 3003
 			$linkclose = ($morecss ? ' class="'.$morecss.'"' : '');
3004 3004
 		}
@@ -3237,11 +3237,11 @@  discard block
 block discarded – undo
3237 3237
 		global $conf;
3238 3238
 		$dn = '';
3239 3239
 		if ($mode == 0) {
3240
-			$dn = getDolGlobalString('LDAP_KEY_USERS') . "=".$info[getDolGlobalString('LDAP_KEY_USERS')]."," . getDolGlobalString('LDAP_USER_DN');
3240
+			$dn = getDolGlobalString('LDAP_KEY_USERS')."=".$info[getDolGlobalString('LDAP_KEY_USERS')].",".getDolGlobalString('LDAP_USER_DN');
3241 3241
 		} elseif ($mode == 1) {
3242 3242
 			$dn = getDolGlobalString('LDAP_USER_DN');
3243 3243
 		} elseif ($mode == 2) {
3244
-			$dn = getDolGlobalString('LDAP_KEY_USERS') . "=".$info[getDolGlobalString('LDAP_KEY_USERS')];
3244
+			$dn = getDolGlobalString('LDAP_KEY_USERS')."=".$info[getDolGlobalString('LDAP_KEY_USERS')];
3245 3245
 		}
3246 3246
 		return $dn;
3247 3247
 	}
@@ -3454,7 +3454,7 @@  discard block
 block discarded – undo
3454 3454
 		$this->iplastlogin = '127.0.0.1';
3455 3455
 		$this->datepreviouslogin = $now;
3456 3456
 		$this->ippreviouslogin = '127.0.0.1';
3457
-		$this->statut = 1;		// deprecated
3457
+		$this->statut = 1; // deprecated
3458 3458
 		$this->status = 1;
3459 3459
 
3460 3460
 		$this->entity = 1;
Please login to merge, or discard this patch.
htdocs/core/class/html.form.class.php 1 patch
Spacing   +1227 added lines, -1227 removed lines patch added patch discarded remove patch
@@ -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 dont use dol_escape_htmltag to get the html formating 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)) . '"'; // Attribut to put on img tag to store tooltip
682
+				$paramfortooltipimg .= ' title="'.($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)).'"'; // Attribut 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 . '"' : ''); // Attribut to put on td text tag
687
+			$paramfortooltipimg = ($extracss ? ' class="'.$extracss.'"' : '').($extrastyle ? ' style="'.$extrastyle.'"' : ''); // Attribut 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)) . '"'; // Attribut to put on td tag to store tooltip
692
+				$paramfortooltiptd .= ' title="'.($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)).'"'; // Attribut 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 . '"' : ''); // Attribut to put on td text tag
697
+			$paramfortooltiptd = ($extracss ? ' class="'.$extracss.'"' : '').($extrastyle ? ' style="'.$extrastyle.'"' : ''); // Attribut 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,23 +2066,23 @@  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";
2083 2083
 		}
2084 2084
 		if (!empty($morefilter)) {
2085
-			$sql .= " " . $morefilter;
2085
+			$sql .= " ".$morefilter;
2086 2086
 		}
2087 2087
 
2088 2088
 		//Add hook to filter on user (for exemple on usergroup define in custom modules)
@@ -2097,7 +2097,7 @@  discard block
 block discarded – undo
2097 2097
 			$sql .= " ORDER BY u.statut DESC, u.lastname ASC, u.firstname ASC";
2098 2098
 		}
2099 2099
 
2100
-		dol_syslog(get_class($this) . "::select_dolusers", LOG_DEBUG);
2100
+		dol_syslog(get_class($this)."::select_dolusers", LOG_DEBUG);
2101 2101
 
2102 2102
 		$resql = $this->db->query($sql);
2103 2103
 		if ($resql) {
@@ -2105,7 +2105,7 @@  discard block
 block discarded – undo
2105 2105
 			$i = 0;
2106 2106
 			if ($num) {
2107 2107
 				// do not use maxwidthonsmartphone by default. Set it by caller so auto size to 100% will work when not defined
2108
-				$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : ' minwidth200') . '" id="' . $htmlname . '" name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . ' ' . ($disabled ? ' disabled' : '') . '>';
2108
+				$out .= '<select class="flat'.($morecss ? ' '.$morecss : ' minwidth200').'" id="'.$htmlname.'" name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.($disabled ? ' disabled' : '').'>';
2109 2109
 				if ($show_empty && !$multiple) {
2110 2110
 					$textforempty = ' ';
2111 2111
 					if (!empty($conf->use_javascript_ajax)) {
@@ -2114,10 +2114,10 @@  discard block
 block discarded – undo
2114 2114
 					if (!is_numeric($show_empty)) {
2115 2115
 						$textforempty = $show_empty;
2116 2116
 					}
2117
-					$out .= '<option class="optiongrey" value="' . ($show_empty < 0 ? $show_empty : -1) . '"' . ((empty($selected) || in_array(-1, $selected)) ? ' selected' : '') . '>' . $textforempty . '</option>' . "\n";
2117
+					$out .= '<option class="optiongrey" value="'.($show_empty < 0 ? $show_empty : -1).'"'.((empty($selected) || in_array(-1, $selected)) ? ' selected' : '').'>'.$textforempty.'</option>'."\n";
2118 2118
 				}
2119 2119
 				if ($show_every) {
2120
-					$out .= '<option value="-2"' . ((in_array(-2, $selected)) ? ' selected' : '') . '>-- ' . $langs->trans("Everybody") . ' --</option>' . "\n";
2120
+					$out .= '<option value="-2"'.((in_array(-2, $selected)) ? ' selected' : '').'>-- '.$langs->trans("Everybody").' --</option>'."\n";
2121 2121
 				}
2122 2122
 
2123 2123
 				$userstatic = new User($this->db);
@@ -2164,22 +2164,22 @@  discard block
 block discarded – undo
2164 2164
 					}
2165 2165
 					if ($showstatus >= 0) {
2166 2166
 						if ($obj->status == 1 && $showstatus == 1) {
2167
-							$moreinfo .= ($moreinfo ? ' - ' : ' (') . $langs->trans('Enabled');
2168
-							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . $langs->trans('Enabled');
2167
+							$moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans('Enabled');
2168
+							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').$langs->trans('Enabled');
2169 2169
 						}
2170 2170
 						if ($obj->status == 0 && $showstatus == 1) {
2171
-							$moreinfo .= ($moreinfo ? ' - ' : ' (') . $langs->trans('Disabled');
2172
-							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . $langs->trans('Disabled');
2171
+							$moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans('Disabled');
2172
+							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').$langs->trans('Disabled');
2173 2173
 						}
2174 2174
 					}
2175 2175
 					if (isModEnabled('multicompany') && !getDolGlobalInt('MULTICOMPANY_TRANSVERSE_MODE') && $conf->entity == 1 && !empty($user->admin) && empty($user->entity)) {
2176 2176
 						if (empty($obj->entity)) {
2177
-							$moreinfo .= ($moreinfo ? ' - ' : ' (') . $langs->trans("AllEntities");
2178
-							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . $langs->trans("AllEntities");
2177
+							$moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans("AllEntities");
2178
+							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').$langs->trans("AllEntities");
2179 2179
 						} else {
2180 2180
 							if ($obj->entity != $conf->entity) {
2181
-								$moreinfo .= ($moreinfo ? ' - ' : ' (') . ($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined"));
2182
-								$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . ($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined"));
2181
+								$moreinfo .= ($moreinfo ? ' - ' : ' (').($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined"));
2182
+								$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined"));
2183 2183
 							}
2184 2184
 						}
2185 2185
 					}
@@ -2187,13 +2187,13 @@  discard block
 block discarded – undo
2187 2187
 					$moreinfohtml .= (!empty($moreinfohtml) ? ')</span>' : '');
2188 2188
 					if (!empty($disableline) && $disableline != '1') {
2189 2189
 						// Add text from $enableonlytext parameter
2190
-						$moreinfo .= ' - ' . $disableline;
2191
-						$moreinfohtml .= ' - ' . $disableline;
2190
+						$moreinfo .= ' - '.$disableline;
2191
+						$moreinfohtml .= ' - '.$disableline;
2192 2192
 					}
2193 2193
 					$labeltoshow .= $moreinfo;
2194 2194
 					$labeltoshowhtml .= $moreinfohtml;
2195 2195
 
2196
-					$out .= '<option value="' . $obj->rowid . '"';
2196
+					$out .= '<option value="'.$obj->rowid.'"';
2197 2197
 					if (!empty($disableline)) {
2198 2198
 						$out .= ' disabled';
2199 2199
 					}
@@ -2201,7 +2201,7 @@  discard block
 block discarded – undo
2201 2201
 						$out .= ' selected';
2202 2202
 					}
2203 2203
 					$out .= ' data-html="';
2204
-					$outhtml = $userstatic->getNomUrl(-3, '', 0, 1, 24, 1, 'login', '', 1) . ' ';
2204
+					$outhtml = $userstatic->getNomUrl(-3, '', 0, 1, 24, 1, 'login', '', 1).' ';
2205 2205
 					if ($showstatus >= 0 && $obj->status == 0) {
2206 2206
 						$outhtml .= '<strike class="opacitymediumxxx">';
2207 2207
 					}
@@ -2214,7 +2214,7 @@  discard block
 block discarded – undo
2214 2214
 					$out .= $labeltoshow;
2215 2215
 					$out .= '</option>';
2216 2216
 
2217
-					$outarray[$userstatic->id] = $userstatic->getFullName($langs, $fullNameMode, -1, $maxlength) . $moreinfo;
2217
+					$outarray[$userstatic->id] = $userstatic->getFullName($langs, $fullNameMode, -1, $maxlength).$moreinfo;
2218 2218
 					$outarray2[$userstatic->id] = array(
2219 2219
 						'id'=>$userstatic->id,
2220 2220
 						'label'=>$labeltoshow,
@@ -2226,14 +2226,14 @@  discard block
 block discarded – undo
2226 2226
 					$i++;
2227 2227
 				}
2228 2228
 			} else {
2229
-				$out .= '<select class="flat" id="' . $htmlname . '" name="' . $htmlname . '" disabled>';
2230
-				$out .= '<option value="">' . $langs->trans("None") . '</option>';
2229
+				$out .= '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'" disabled>';
2230
+				$out .= '<option value="">'.$langs->trans("None").'</option>';
2231 2231
 			}
2232 2232
 			$out .= '</select>';
2233 2233
 
2234 2234
 			if ($num && !$forcecombo) {
2235 2235
 				// Enhance with select2
2236
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
2236
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
2237 2237
 				$out .= ajax_combobox($htmlname);
2238 2238
 			}
2239 2239
 		} else {
@@ -2303,16 +2303,16 @@  discard block
 block discarded – undo
2303 2303
 			$out .= $userstatic->getNomUrl(-1);
2304 2304
 			if ($i == 0) {
2305 2305
 				$ownerid = $value['id'];
2306
-				$out .= ' (' . $langs->trans("Owner") . ')';
2306
+				$out .= ' ('.$langs->trans("Owner").')';
2307 2307
 			}
2308 2308
 			if ($nbassignetouser > 1 && $action != 'view') {
2309
-				$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 . '">';
2309
+				$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.'">';
2310 2310
 			}
2311 2311
 			// Show my availability
2312 2312
 			if ($showproperties) {
2313 2313
 				if ($ownerid == $value['id'] && is_array($listofuserid) && count($listofuserid) && in_array($ownerid, array_keys($listofuserid))) {
2314 2314
 					$out .= '<div class="myavailability inline-block">';
2315
-					$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>';
2315
+					$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>';
2316 2316
 					$out .= '</div>';
2317 2317
 				}
2318 2318
 			}
@@ -2329,15 +2329,15 @@  discard block
 block discarded – undo
2329 2329
 		// Method with no ajax
2330 2330
 		if ($action != 'view') {
2331 2331
 			$out .= '<input type="hidden" class="removedassignedhidden" name="removedassigned" value="">';
2332
-			$out .= '<script nonce="' . getNonce() . '" type="text/javascript">jQuery(document).ready(function () {';
2332
+			$out .= '<script nonce="'.getNonce().'" type="text/javascript">jQuery(document).ready(function () {';
2333 2333
 			$out .= 'jQuery(".removedassigned").click(function() { jQuery(".removedassignedhidden").val(jQuery(this).val()); });';
2334 2334
 			$out .= 'jQuery(".assignedtouser").change(function() { console.log(jQuery(".assignedtouser option:selected").val());';
2335
-			$out .= ' if (jQuery(".assignedtouser option:selected").val() > 0) { jQuery("#' . $action . 'assignedtouser").attr("disabled", false); }';
2336
-			$out .= ' else { jQuery("#' . $action . 'assignedtouser").attr("disabled", true); }';
2335
+			$out .= ' if (jQuery(".assignedtouser option:selected").val() > 0) { jQuery("#'.$action.'assignedtouser").attr("disabled", false); }';
2336
+			$out .= ' else { jQuery("#'.$action.'assignedtouser").attr("disabled", true); }';
2337 2337
 			$out .= '});';
2338 2338
 			$out .= '})</script>';
2339 2339
 			$out .= $this->select_dolusers('', $htmlname, $show_empty, $exclude, $disabled, $include, $enableonly, $force_entity, $maxlength, $showstatus, $morefilter);
2340
-			$out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="' . $action . 'assignedtouser" name="' . $action . 'assignedtouser" value="' . dol_escape_htmltag($langs->trans("Add")) . '">';
2340
+			$out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="'.$action.'assignedtouser" name="'.$action.'assignedtouser" value="'.dol_escape_htmltag($langs->trans("Add")).'">';
2341 2341
 			$out .= '<br>';
2342 2342
 		}
2343 2343
 
@@ -2392,13 +2392,13 @@  discard block
 block discarded – undo
2392 2392
 			$resourcestatic->fetch($value['id']);
2393 2393
 			$out .= $resourcestatic->getNomUrl(-1);
2394 2394
 			if ($nbassignetoresource > 1 && $action != 'view') {
2395
-				$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 . '">';
2395
+				$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.'">';
2396 2396
 			}
2397 2397
 			// Show my availability
2398 2398
 			if ($showproperties) {
2399 2399
 				if (is_array($listofresourceid) && count($listofresourceid)) {
2400 2400
 					$out .= '<div class="myavailability inline-block">';
2401
-					$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>';
2401
+					$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>';
2402 2402
 					$out .= '</div>';
2403 2403
 				}
2404 2404
 			}
@@ -2415,11 +2415,11 @@  discard block
 block discarded – undo
2415 2415
 		// Method with no ajax
2416 2416
 		if ($action != 'view') {
2417 2417
 			$out .= '<input type="hidden" class="removedassignedhidden" name="removedassignedresource" value="">';
2418
-			$out .= '<script nonce="' . getNonce() . '" type="text/javascript">jQuery(document).ready(function () {';
2418
+			$out .= '<script nonce="'.getNonce().'" type="text/javascript">jQuery(document).ready(function () {';
2419 2419
 			$out .= 'jQuery(".removedassignedresource").click(function() { jQuery(".removedassignedresourcehidden").val(jQuery(this).val()); });';
2420 2420
 			$out .= 'jQuery(".assignedtoresource").change(function() { console.log(jQuery(".assignedtoresource option:selected").val());';
2421
-			$out .= ' if (jQuery(".assignedtoresource option:selected").val() > 0) { jQuery("#' . $action . 'assignedtoresource").attr("disabled", false); }';
2422
-			$out .= ' else { jQuery("#' . $action . 'assignedtoresource").attr("disabled", true); }';
2421
+			$out .= ' if (jQuery(".assignedtoresource option:selected").val() > 0) { jQuery("#'.$action.'assignedtoresource").attr("disabled", false); }';
2422
+			$out .= ' else { jQuery("#'.$action.'assignedtoresource").attr("disabled", true); }';
2423 2423
 			$out .= '});';
2424 2424
 			$out .= '})</script>';
2425 2425
 
@@ -2427,7 +2427,7 @@  discard block
 block discarded – undo
2427 2427
 			$out .= img_picto('', 'resource', 'class="pictofixedwidth"');
2428 2428
 			$out .= $formresources->select_resource_list('', $htmlname, '', 1, 1, 0, $events, '', 2, null);
2429 2429
 			//$out .= $this->select_dolusers('', $htmlname, $show_empty, $exclude, $disabled, $include, $enableonly, $force_entity, $maxlength, $showstatus, $morefilter);
2430
-			$out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="' . $action . 'assignedtoresource" name="' . $action . 'assignedtoresource" value="' . dol_escape_htmltag($langs->trans("Add")) . '">';
2430
+			$out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="'.$action.'assignedtoresource" name="'.$action.'assignedtoresource" value="'.dol_escape_htmltag($langs->trans("Add")).'">';
2431 2431
 			$out .= '<br>';
2432 2432
 		}
2433 2433
 
@@ -2488,7 +2488,7 @@  discard block
 block discarded – undo
2488 2488
 			$placeholder = '';
2489 2489
 
2490 2490
 			if ($selected && empty($selected_input_value)) {
2491
-				require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
2491
+				require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
2492 2492
 				$producttmpselect = new Product($this->db);
2493 2493
 				$producttmpselect->fetch($selected);
2494 2494
 				$selected_input_value = $producttmpselect->ref;
@@ -2503,17 +2503,17 @@  discard block
 block discarded – undo
2503 2503
 				}
2504 2504
 			}
2505 2505
 			// mode=1 means customers products
2506
-			$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;
2507
-			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
2506
+			$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;
2507
+			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
2508 2508
 
2509 2509
 			if (isModEnabled('variants') && is_array($selected_combinations)) {
2510 2510
 				// Code to automatically insert with javascript the select of attributes under the select of product
2511 2511
 				// when a parent of variant has been selected.
2512 2512
 				$out .= '
2513 2513
 				<!-- script to auto show attributes select tags if a variant was selected -->
2514
-				<script nonce="' . getNonce() . '">
2514
+				<script nonce="' . getNonce().'">
2515 2515
 					// auto show attributes fields
2516
-					selected = ' . json_encode($selected_combinations) . ';
2516
+					selected = ' . json_encode($selected_combinations).';
2517 2517
 					combvalues = {};
2518 2518
 
2519 2519
 					jQuery(document).ready(function () {
@@ -2524,7 +2524,7 @@  discard block
 block discarded – undo
2524 2524
 							}
2525 2525
 						});
2526 2526
 
2527
-						jQuery("input#' . $htmlname . '").change(function () {
2527
+						jQuery("input#' . $htmlname.'").change(function () {
2528 2528
 
2529 2529
 							if (!jQuery(this).val()) {
2530 2530
 								jQuery(\'div#attributes_box\').empty();
@@ -2533,7 +2533,7 @@  discard block
 block discarded – undo
2533 2533
 
2534 2534
 							console.log("A change has started. We get variants fields to inject html select");
2535 2535
 
2536
-							jQuery.getJSON("' . DOL_URL_ROOT . '/variants/ajax/getCombinations.php", {
2536
+							jQuery.getJSON("' . DOL_URL_ROOT.'/variants/ajax/getCombinations.php", {
2537 2537
 								id: jQuery(this).val()
2538 2538
 							}, function (data) {
2539 2539
 								jQuery(\'div#attributes_box\').empty();
@@ -2576,21 +2576,21 @@  discard block
 block discarded – undo
2576 2576
 							})
2577 2577
 						});
2578 2578
 
2579
-						' . ($selected ? 'jQuery("input#' . $htmlname . '").change();' : '') . '
2579
+						' . ($selected ? 'jQuery("input#'.$htmlname.'").change();' : '').'
2580 2580
 					});
2581 2581
 				</script>
2582 2582
                 ';
2583 2583
 			}
2584 2584
 
2585 2585
 			if (empty($hidelabel)) {
2586
-				$out .= $langs->trans("RefOrLabel") . ' : ';
2586
+				$out .= $langs->trans("RefOrLabel").' : ';
2587 2587
 			} elseif ($hidelabel > 1) {
2588
-				$placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"';
2588
+				$placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"';
2589 2589
 				if ($hidelabel == 2) {
2590 2590
 					$out .= img_picto($langs->trans("Search"), 'search');
2591 2591
 				}
2592 2592
 			}
2593
-			$out .= '<input type="text" class="minwidth100' . ($morecss ? ' ' . $morecss : '') . '" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />';
2593
+			$out .= '<input type="text" class="minwidth100'.($morecss ? ' '.$morecss : '').'" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />';
2594 2594
 			if ($hidelabel == 3) {
2595 2595
 				$out .= img_picto($langs->trans("Search"), 'search');
2596 2596
 			}
@@ -2627,33 +2627,33 @@  discard block
 block discarded – undo
2627 2627
 		// phpcs:enable
2628 2628
 		global $conf, $user, $langs, $db;
2629 2629
 
2630
-		require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
2630
+		require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
2631 2631
 
2632 2632
 		$error = 0;
2633 2633
 		$out = '';
2634 2634
 
2635 2635
 		if (!$forcecombo) {
2636
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
2636
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
2637 2637
 			$events = array();
2638 2638
 			$out .= ajax_combobox($htmlname, $events, getDolGlobalInt("PRODUIT_USE_SEARCH_TO_SELECT"));
2639 2639
 		}
2640 2640
 
2641
-		$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
2641
+		$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
2642 2642
 
2643 2643
 		$sql = 'SELECT b.rowid, b.ref, b.label, b.fk_product';
2644
-		$sql .= ' FROM ' . MAIN_DB_PREFIX . 'bom_bom as b';
2645
-		$sql .= ' WHERE b.entity IN (' . getEntity('bom') . ')';
2644
+		$sql .= ' FROM '.MAIN_DB_PREFIX.'bom_bom as b';
2645
+		$sql .= ' WHERE b.entity IN ('.getEntity('bom').')';
2646 2646
 		if (!empty($status)) {
2647
-			$sql .= ' AND status = ' . (int) $status;
2647
+			$sql .= ' AND status = '.(int) $status;
2648 2648
 		}
2649 2649
 		if (!empty($type)) {
2650
-			$sql .= ' AND bomtype = ' . (int) $type;
2650
+			$sql .= ' AND bomtype = '.(int) $type;
2651 2651
 		}
2652 2652
 		if (!empty($TProducts)) {
2653
-			$sql .= ' AND fk_product IN (' . $this->db->sanitize(implode(',', $TProducts)) . ')';
2653
+			$sql .= ' AND fk_product IN ('.$this->db->sanitize(implode(',', $TProducts)).')';
2654 2654
 		}
2655 2655
 		if (!empty($limit)) {
2656
-			$sql .= ' LIMIT ' . (int) $limit;
2656
+			$sql .= ' LIMIT '.(int) $limit;
2657 2657
 		}
2658 2658
 		$resql = $db->query($sql);
2659 2659
 		if ($resql) {
@@ -2667,11 +2667,11 @@  discard block
 block discarded – undo
2667 2667
 			while ($obj = $db->fetch_object($resql)) {
2668 2668
 				$product = new Product($db);
2669 2669
 				$res = $product->fetch($obj->fk_product);
2670
-				$out .= '<option value="' . $obj->rowid . '"';
2670
+				$out .= '<option value="'.$obj->rowid.'"';
2671 2671
 				if ($obj->rowid == $selected) {
2672 2672
 					$out .= 'selected';
2673 2673
 				}
2674
-				$out .= '>' . $obj->ref . ' - ' . $product->label . ' - ' . $obj->label . '</option>';
2674
+				$out .= '>'.$obj->ref.' - '.$product->label.' - '.$obj->label.'</option>';
2675 2675
 			}
2676 2676
 		} else {
2677 2677
 			$error++;
@@ -2728,7 +2728,7 @@  discard block
 block discarded – undo
2728 2728
 
2729 2729
 		$warehouseStatusArray = array();
2730 2730
 		if (!empty($warehouseStatus)) {
2731
-			require_once DOL_DOCUMENT_ROOT . '/product/stock/class/entrepot.class.php';
2731
+			require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php';
2732 2732
 			if (preg_match('/warehouseclosed/', $warehouseStatus)) {
2733 2733
 				$warehouseStatusArray[] = Entrepot::STATUS_CLOSED;
2734 2734
 			}
@@ -2742,9 +2742,9 @@  discard block
 block discarded – undo
2742 2742
 
2743 2743
 		$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";
2744 2744
 		if (count($warehouseStatusArray)) {
2745
-			$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
2745
+			$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
2746 2746
 		} else {
2747
-			$selectFieldsGrouped = ", " . $this->db->ifsql("p.stock IS NULL", 0, "p.stock") . " AS stock";
2747
+			$selectFieldsGrouped = ", ".$this->db->ifsql("p.stock IS NULL", 0, "p.stock")." AS stock";
2748 2748
 		}
2749 2749
 
2750 2750
 		$sql = "SELECT ";
@@ -2760,9 +2760,9 @@  discard block
 block discarded – undo
2760 2760
 
2761 2761
 		if (getDolGlobalString('PRODUCT_SORT_BY_CATEGORY')) {
2762 2762
 			//Product category
2763
-			$sql .= ", (SELECT " . $this->db->prefix() . "categorie_product.fk_categorie
2764
-						FROM " . $this->db->prefix() . "categorie_product
2765
-						WHERE " . $this->db->prefix() . "categorie_product.fk_product=p.rowid
2763
+			$sql .= ", (SELECT ".$this->db->prefix()."categorie_product.fk_categorie
2764
+						FROM " . $this->db->prefix()."categorie_product
2765
+						WHERE " . $this->db->prefix()."categorie_product.fk_product=p.rowid
2766 2766
 						LIMIT 1
2767 2767
 				) AS categorie_product_id ";
2768 2768
 		}
@@ -2788,15 +2788,15 @@  discard block
 block discarded – undo
2788 2788
 		}
2789 2789
 		// Price by quantity
2790 2790
 		if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) {
2791
-			$sql .= ", (SELECT pp.rowid FROM " . $this->db->prefix() . "product_price as pp WHERE pp.fk_product = p.rowid";
2791
+			$sql .= ", (SELECT pp.rowid FROM ".$this->db->prefix()."product_price as pp WHERE pp.fk_product = p.rowid";
2792 2792
 			if ($price_level >= 1 && getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) {
2793
-				$sql .= " AND price_level = " . ((int) $price_level);
2793
+				$sql .= " AND price_level = ".((int) $price_level);
2794 2794
 			}
2795 2795
 			$sql .= " ORDER BY date_price";
2796 2796
 			$sql .= " DESC LIMIT 1) as price_rowid";
2797
-			$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
2797
+			$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
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_by_qty";
@@ -2810,67 +2810,67 @@  discard block
 block discarded – undo
2810 2810
 		$sql .= $hookmanager->resPrint;
2811 2811
 
2812 2812
 		if (count($warehouseStatusArray)) {
2813
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "product_stock as ps on ps.fk_product = p.rowid";
2814
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "entrepot as e on ps.fk_entrepot = e.rowid AND e.entity IN (" . getEntity('stock') . ")";
2815
-			$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.
2813
+			$sql .= " LEFT JOIN ".$this->db->prefix()."product_stock as ps on ps.fk_product = p.rowid";
2814
+			$sql .= " LEFT JOIN ".$this->db->prefix()."entrepot as e on ps.fk_entrepot = e.rowid AND e.entity IN (".getEntity('stock').")";
2815
+			$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.
2816 2816
 		}
2817 2817
 
2818 2818
 		// include search in supplier ref
2819 2819
 		if (getDolGlobalString('MAIN_SEARCH_PRODUCT_BY_FOURN_REF')) {
2820
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
2820
+			$sql .= " LEFT JOIN ".$this->db->prefix()."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
2821 2821
 		}
2822 2822
 
2823 2823
 		//Price by customer
2824 2824
 		if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES') && !empty($socid)) {
2825
-			$sql .= " LEFT JOIN  " . $this->db->prefix() . "product_customer_price as pcp ON pcp.fk_soc=" . ((int) $socid) . " AND pcp.fk_product=p.rowid";
2825
+			$sql .= " LEFT JOIN  ".$this->db->prefix()."product_customer_price as pcp ON pcp.fk_soc=".((int) $socid)." AND pcp.fk_product=p.rowid";
2826 2826
 		}
2827 2827
 		// Units
2828 2828
 		if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
2829
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "c_units u ON u.rowid = p.fk_unit";
2829
+			$sql .= " LEFT JOIN ".$this->db->prefix()."c_units u ON u.rowid = p.fk_unit";
2830 2830
 		}
2831 2831
 		// Multilang : we add translation
2832 2832
 		if (getDolGlobalInt('MAIN_MULTILANGS')) {
2833
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "product_lang as pl ON pl.fk_product = p.rowid ";
2833
+			$sql .= " LEFT JOIN ".$this->db->prefix()."product_lang as pl ON pl.fk_product = p.rowid ";
2834 2834
 			if (getDolGlobalString('PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE') && !empty($socid)) {
2835
-				require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
2835
+				require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
2836 2836
 				$soc = new Societe($this->db);
2837 2837
 				$result = $soc->fetch($socid);
2838 2838
 				if ($result > 0 && !empty($soc->default_lang)) {
2839
-					$sql .= " AND pl.lang = '" . $this->db->escape($soc->default_lang) . "'";
2839
+					$sql .= " AND pl.lang = '".$this->db->escape($soc->default_lang)."'";
2840 2840
 				} else {
2841
-					$sql .= " AND pl.lang = '" . $this->db->escape($langs->getDefaultLang()) . "'";
2841
+					$sql .= " AND pl.lang = '".$this->db->escape($langs->getDefaultLang())."'";
2842 2842
 				}
2843 2843
 			} else {
2844
-				$sql .= " AND pl.lang = '" . $this->db->escape($langs->getDefaultLang()) . "'";
2844
+				$sql .= " AND pl.lang = '".$this->db->escape($langs->getDefaultLang())."'";
2845 2845
 			}
2846 2846
 		}
2847 2847
 
2848 2848
 		if (getDolGlobalString('PRODUIT_ATTRIBUTES_HIDECHILD')) {
2849
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "product_attribute_combination pac ON pac.fk_product_child = p.rowid";
2849
+			$sql .= " LEFT JOIN ".$this->db->prefix()."product_attribute_combination pac ON pac.fk_product_child = p.rowid";
2850 2850
 		}
2851 2851
 
2852
-		$sql .= ' WHERE p.entity IN (' . getEntity('product') . ')';
2852
+		$sql .= ' WHERE p.entity IN ('.getEntity('product').')';
2853 2853
 
2854 2854
 		if (getDolGlobalString('PRODUIT_ATTRIBUTES_HIDECHILD')) {
2855 2855
 			$sql .= " AND pac.rowid IS NULL";
2856 2856
 		}
2857 2857
 
2858 2858
 		if ($finished == 0) {
2859
-			$sql .= " AND p.finished = " . ((int) $finished);
2859
+			$sql .= " AND p.finished = ".((int) $finished);
2860 2860
 		} elseif ($finished == 1) {
2861
-			$sql .= " AND p.finished = " . ((int) $finished);
2861
+			$sql .= " AND p.finished = ".((int) $finished);
2862 2862
 			if ($status >= 0) {
2863
-				$sql .= " AND p.tosell = " . ((int) $status);
2863
+				$sql .= " AND p.tosell = ".((int) $status);
2864 2864
 			}
2865 2865
 		} elseif ($status >= 0) {
2866
-			$sql .= " AND p.tosell = " . ((int) $status);
2866
+			$sql .= " AND p.tosell = ".((int) $status);
2867 2867
 		}
2868 2868
 		if ($status_purchase >= 0) {
2869
-			$sql .= " AND p.tobuy = " . ((int) $status_purchase);
2869
+			$sql .= " AND p.tobuy = ".((int) $status_purchase);
2870 2870
 		}
2871 2871
 		// Filter by product type
2872 2872
 		if (strval($filtertype) != '') {
2873
-			$sql .= " AND p.fk_product_type = " . ((int) $filtertype);
2873
+			$sql .= " AND p.fk_product_type = ".((int) $filtertype);
2874 2874
 		} elseif (!isModEnabled('product')) { // when product module is disabled, show services only
2875 2875
 			$sql .= " AND p.fk_product_type = 1";
2876 2876
 		} elseif (!isModEnabled('service')) { // when service module is disabled, show products only
@@ -2894,21 +2894,21 @@  discard block
 block discarded – undo
2894 2894
 				if ($i > 0) {
2895 2895
 					$sql .= " AND ";
2896 2896
 				}
2897
-				$sql .= "(p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%' OR p.label LIKE '" . $this->db->escape($prefix . $crit) . "%'";
2897
+				$sql .= "(p.ref LIKE '".$this->db->escape($prefix.$crit)."%' OR p.label LIKE '".$this->db->escape($prefix.$crit)."%'";
2898 2898
 				if (getDolGlobalInt('MAIN_MULTILANGS')) {
2899
-					$sql .= " OR pl.label LIKE '" . $this->db->escape($prefix . $crit) . "%'";
2899
+					$sql .= " OR pl.label LIKE '".$this->db->escape($prefix.$crit)."%'";
2900 2900
 				}
2901 2901
 				if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES') && !empty($socid)) {
2902
-					$sql .= " OR pcp.ref_customer LIKE '" . $this->db->escape($prefix . $crit) . "%'";
2902
+					$sql .= " OR pcp.ref_customer LIKE '".$this->db->escape($prefix.$crit)."%'";
2903 2903
 				}
2904 2904
 				if (getDolGlobalString('PRODUCT_AJAX_SEARCH_ON_DESCRIPTION')) {
2905
-					$sql .= " OR p.description LIKE '" . $this->db->escape($prefix . $crit) . "%'";
2905
+					$sql .= " OR p.description LIKE '".$this->db->escape($prefix.$crit)."%'";
2906 2906
 					if (getDolGlobalInt('MAIN_MULTILANGS')) {
2907
-						$sql .= " OR pl.description LIKE '" . $this->db->escape($prefix . $crit) . "%'";
2907
+						$sql .= " OR pl.description LIKE '".$this->db->escape($prefix.$crit)."%'";
2908 2908
 					}
2909 2909
 				}
2910 2910
 				if (getDolGlobalString('MAIN_SEARCH_PRODUCT_BY_FOURN_REF')) {
2911
-					$sql .= " OR pfp.ref_fourn LIKE '" . $this->db->escape($prefix . $crit) . "%'";
2911
+					$sql .= " OR pfp.ref_fourn LIKE '".$this->db->escape($prefix.$crit)."%'";
2912 2912
 				}
2913 2913
 				$sql .= ")";
2914 2914
 				$i++;
@@ -2917,12 +2917,12 @@  discard block
 block discarded – undo
2917 2917
 				$sql .= ")";
2918 2918
 			}
2919 2919
 			if (isModEnabled('barcode')) {
2920
-				$sql .= " OR p.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
2920
+				$sql .= " OR p.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'";
2921 2921
 			}
2922 2922
 			$sql .= ')';
2923 2923
 		}
2924 2924
 		if (count($warehouseStatusArray)) {
2925
-			$sql .= " GROUP BY " . $selectFields;
2925
+			$sql .= " GROUP BY ".$selectFields;
2926 2926
 		}
2927 2927
 
2928 2928
 		//Sort by category
@@ -2937,23 +2937,23 @@  discard block
 block discarded – undo
2937 2937
 		$sql .= $this->db->plimit($limit, 0);
2938 2938
 
2939 2939
 		// Build output string
2940
-		dol_syslog(get_class($this) . "::select_produits_list search products", LOG_DEBUG);
2940
+		dol_syslog(get_class($this)."::select_produits_list search products", LOG_DEBUG);
2941 2941
 		$result = $this->db->query($sql);
2942 2942
 		if ($result) {
2943
-			require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
2944
-			require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
2945
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/product.lib.php';
2943
+			require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
2944
+			require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
2945
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php';
2946 2946
 
2947 2947
 			$num = $this->db->num_rows($result);
2948 2948
 
2949 2949
 			$events = null;
2950 2950
 
2951 2951
 			if (!$forcecombo) {
2952
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
2952
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
2953 2953
 				$out .= ajax_combobox($htmlname, $events, getDolGlobalInt("PRODUIT_USE_SEARCH_TO_SELECT"));
2954 2954
 			}
2955 2955
 
2956
-			$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
2956
+			$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
2957 2957
 
2958 2958
 			$textifempty = '';
2959 2959
 			// Do not use textifempty = ' ' or '&nbsp;' here, or search on key will search on ' key'.
@@ -2970,7 +2970,7 @@  discard block
 block discarded – undo
2970 2970
 				}
2971 2971
 			}
2972 2972
 			if ($showempty) {
2973
-				$out .= '<option value="-1" selected>' . ($textifempty ? $textifempty : '&nbsp;') . '</option>';
2973
+				$out .= '<option value="-1" selected>'.($textifempty ? $textifempty : '&nbsp;').'</option>';
2974 2974
 			}
2975 2975
 
2976 2976
 			$i = 0;
@@ -2981,11 +2981,11 @@  discard block
 block discarded – undo
2981 2981
 
2982 2982
 				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
2983 2983
 					$sql = "SELECT rowid, quantity, price, unitprice, remise_percent, remise, price_base_type";
2984
-					$sql .= " FROM " . $this->db->prefix() . "product_price_by_qty";
2985
-					$sql .= " WHERE fk_product_price = " . ((int) $objp->price_rowid);
2984
+					$sql .= " FROM ".$this->db->prefix()."product_price_by_qty";
2985
+					$sql .= " WHERE fk_product_price = ".((int) $objp->price_rowid);
2986 2986
 					$sql .= " ORDER BY quantity ASC";
2987 2987
 
2988
-					dol_syslog(get_class($this) . "::select_produits_list search prices by qty", LOG_DEBUG);
2988
+					dol_syslog(get_class($this)."::select_produits_list search prices by qty", LOG_DEBUG);
2989 2989
 					$result2 = $this->db->query($sql);
2990 2990
 					if ($result2) {
2991 2991
 						$nb_prices = $this->db->num_rows($result2);
@@ -3023,7 +3023,7 @@  discard block
 block discarded – undo
3023 3023
 						$price_product = new Product($this->db);
3024 3024
 						$price_product->fetch($objp->rowid, '', '', 1);
3025 3025
 
3026
-						require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
3026
+						require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
3027 3027
 						$priceparser = new PriceParser($this->db);
3028 3028
 						$price_result = $priceparser->parseProduct($price_product);
3029 3029
 						if ($price_result >= 0) {
@@ -3107,7 +3107,7 @@  discard block
 block discarded – undo
3107 3107
 			$label = $objp->label_translated;
3108 3108
 		}
3109 3109
 		if (!empty($filterkey) && $filterkey != '') {
3110
-			$label = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $label, 1);
3110
+			$label = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $label, 1);
3111 3111
 		}
3112 3112
 
3113 3113
 		$outkey = $objp->rowid;
@@ -3128,32 +3128,32 @@  discard block
 block discarded – undo
3128 3128
 		$outdurationunit = $outtype == Product::TYPE_SERVICE ? substr($objp->duration, -1) : '';
3129 3129
 
3130 3130
 		if ($outorigin && getDolGlobalString('PRODUCT_SHOW_ORIGIN_IN_COMBO')) {
3131
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
3131
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
3132 3132
 		}
3133 3133
 
3134 3134
 		// Units
3135 3135
 		$outvalUnits = '';
3136 3136
 		if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
3137 3137
 			if (!empty($objp->unit_short)) {
3138
-				$outvalUnits .= ' - ' . $objp->unit_short;
3138
+				$outvalUnits .= ' - '.$objp->unit_short;
3139 3139
 			}
3140 3140
 		}
3141 3141
 		if (getDolGlobalString('PRODUCT_SHOW_DIMENSIONS_IN_COMBO')) {
3142 3142
 			if (!empty($objp->weight) && $objp->weight_units !== null) {
3143 3143
 				$unitToShow = showDimensionInBestUnit($objp->weight, $objp->weight_units, 'weight', $langs);
3144
-				$outvalUnits .= ' - ' . $unitToShow;
3144
+				$outvalUnits .= ' - '.$unitToShow;
3145 3145
 			}
3146 3146
 			if ((!empty($objp->length) || !empty($objp->width) || !empty($objp->height)) && $objp->length_units !== null) {
3147
-				$unitToShow = $objp->length . ' x ' . $objp->width . ' x ' . $objp->height . ' ' . measuringUnitString(0, 'size', $objp->length_units);
3148
-				$outvalUnits .= ' - ' . $unitToShow;
3147
+				$unitToShow = $objp->length.' x '.$objp->width.' x '.$objp->height.' '.measuringUnitString(0, 'size', $objp->length_units);
3148
+				$outvalUnits .= ' - '.$unitToShow;
3149 3149
 			}
3150 3150
 			if (!empty($objp->surface) && $objp->surface_units !== null) {
3151 3151
 				$unitToShow = showDimensionInBestUnit($objp->surface, $objp->surface_units, 'surface', $langs);
3152
-				$outvalUnits .= ' - ' . $unitToShow;
3152
+				$outvalUnits .= ' - '.$unitToShow;
3153 3153
 			}
3154 3154
 			if (!empty($objp->volume) && $objp->volume_units !== null) {
3155 3155
 				$unitToShow = showDimensionInBestUnit($objp->volume, $objp->volume_units, 'volume', $langs);
3156
-				$outvalUnits .= ' - ' . $unitToShow;
3156
+				$outvalUnits .= ' - '.$unitToShow;
3157 3157
 			}
3158 3158
 		}
3159 3159
 		if ($outdurationvalue && $outdurationunit) {
@@ -3165,14 +3165,14 @@  discard block
 block discarded – undo
3165 3165
 				'y' => $langs->trans('Year')
3166 3166
 			);
3167 3167
 			if (isset($da[$outdurationunit])) {
3168
-				$outvalUnits .= ' - ' . $outdurationvalue . ' ' . $langs->transnoentities($da[$outdurationunit] . ($outdurationvalue > 1 ? 's' : ''));
3168
+				$outvalUnits .= ' - '.$outdurationvalue.' '.$langs->transnoentities($da[$outdurationunit].($outdurationvalue > 1 ? 's' : ''));
3169 3169
 			}
3170 3170
 		}
3171 3171
 
3172
-		$opt = '<option value="' . $objp->rowid . '"';
3172
+		$opt = '<option value="'.$objp->rowid.'"';
3173 3173
 		$opt .= ($objp->rowid == $selected) ? ' selected' : '';
3174 3174
 		if (!empty($objp->price_by_qty_rowid) && $objp->price_by_qty_rowid > 0) {
3175
-			$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 . '"';
3175
+			$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.'"';
3176 3176
 		}
3177 3177
 		if (isModEnabled('stock') && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || getDolGlobalString('STOCK_SUPPORTS_SERVICES'))) {
3178 3178
 			if ($user->hasRight('stock', 'lire')) {
@@ -3184,36 +3184,36 @@  discard block
 block discarded – undo
3184 3184
 			}
3185 3185
 		}
3186 3186
 		if (getDolGlobalString('PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE')) {
3187
-			$opt .= ' data-labeltrans="' . $outlabel_translated . '"';
3188
-			$opt .= ' data-desctrans="' . dol_escape_htmltag($outdesc_translated) . '"';
3187
+			$opt .= ' data-labeltrans="'.$outlabel_translated.'"';
3188
+			$opt .= ' data-desctrans="'.dol_escape_htmltag($outdesc_translated).'"';
3189 3189
 		}
3190 3190
 		$opt .= '>';
3191 3191
 		$opt .= $objp->ref;
3192 3192
 		if (!empty($objp->custref)) {
3193
-			$opt .= ' (' . $objp->custref . ')';
3193
+			$opt .= ' ('.$objp->custref.')';
3194 3194
 		}
3195 3195
 		if ($outbarcode) {
3196
-			$opt .= ' (' . $outbarcode . ')';
3196
+			$opt .= ' ('.$outbarcode.')';
3197 3197
 		}
3198
-		$opt .= ' - ' . dol_trunc($label, $maxlengtharticle);
3198
+		$opt .= ' - '.dol_trunc($label, $maxlengtharticle);
3199 3199
 		if ($outorigin && getDolGlobalString('PRODUCT_SHOW_ORIGIN_IN_COMBO')) {
3200
-			$opt .= ' (' . getCountry($outorigin, 1) . ')';
3200
+			$opt .= ' ('.getCountry($outorigin, 1).')';
3201 3201
 		}
3202 3202
 
3203 3203
 		$objRef = $objp->ref;
3204 3204
 		if (!empty($objp->custref)) {
3205
-			$objRef .= ' (' . $objp->custref . ')';
3205
+			$objRef .= ' ('.$objp->custref.')';
3206 3206
 		}
3207 3207
 		if (!empty($filterkey) && $filterkey != '') {
3208
-			$objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1);
3208
+			$objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1);
3209 3209
 		}
3210 3210
 		$outval .= $objRef;
3211 3211
 		if ($outbarcode) {
3212
-			$outval .= ' (' . $outbarcode . ')';
3212
+			$outval .= ' ('.$outbarcode.')';
3213 3213
 		}
3214
-		$outval .= ' - ' . dol_trunc($label, $maxlengtharticle);
3214
+		$outval .= ' - '.dol_trunc($label, $maxlengtharticle);
3215 3215
 		if ($outorigin && getDolGlobalString('PRODUCT_SHOW_ORIGIN_IN_COMBO')) {
3216
-			$outval .= ' (' . getCountry($outorigin, 1) . ')';
3216
+			$outval .= ' ('.getCountry($outorigin, 1).')';
3217 3217
 		}
3218 3218
 
3219 3219
 		// Units
@@ -3226,35 +3226,35 @@  discard block
 block discarded – undo
3226 3226
 		// If we need a particular price level (from 1 to n)
3227 3227
 		if (empty($hidepriceinlabel) && $price_level >= 1 && (getDolGlobalString('PRODUIT_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES'))) {
3228 3228
 			$sql = "SELECT price, price_ttc, price_base_type, tva_tx, default_vat_code";
3229
-			$sql .= " FROM " . $this->db->prefix() . "product_price";
3230
-			$sql .= " WHERE fk_product = " . ((int) $objp->rowid);
3231
-			$sql .= " AND entity IN (" . getEntity('productprice') . ")";
3232
-			$sql .= " AND price_level = " . ((int) $price_level);
3229
+			$sql .= " FROM ".$this->db->prefix()."product_price";
3230
+			$sql .= " WHERE fk_product = ".((int) $objp->rowid);
3231
+			$sql .= " AND entity IN (".getEntity('productprice').")";
3232
+			$sql .= " AND price_level = ".((int) $price_level);
3233 3233
 			$sql .= " ORDER BY date_price DESC, rowid DESC"; // Warning DESC must be both on date_price and rowid.
3234 3234
 			$sql .= " LIMIT 1";
3235 3235
 
3236
-			dol_syslog(get_class($this) . '::constructProductListOption search price for product ' . $objp->rowid . ' AND level ' . $price_level, LOG_DEBUG);
3236
+			dol_syslog(get_class($this).'::constructProductListOption search price for product '.$objp->rowid.' AND level '.$price_level, LOG_DEBUG);
3237 3237
 			$result2 = $this->db->query($sql);
3238 3238
 			if ($result2) {
3239 3239
 				$objp2 = $this->db->fetch_object($result2);
3240 3240
 				if ($objp2) {
3241 3241
 					$found = 1;
3242 3242
 					if ($objp2->price_base_type == 'HT') {
3243
-						$opt .= ' - ' . price($objp2->price, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("HT");
3244
-						$outval .= ' - ' . price($objp2->price, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("HT");
3243
+						$opt .= ' - '.price($objp2->price, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT");
3244
+						$outval .= ' - '.price($objp2->price, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT");
3245 3245
 					} else {
3246
-						$opt .= ' - ' . price($objp2->price_ttc, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("TTC");
3247
-						$outval .= ' - ' . price($objp2->price_ttc, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("TTC");
3246
+						$opt .= ' - '.price($objp2->price_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC");
3247
+						$outval .= ' - '.price($objp2->price_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC");
3248 3248
 					}
3249 3249
 					$outprice_ht = price($objp2->price);
3250 3250
 					$outprice_ttc = price($objp2->price_ttc);
3251 3251
 					$outpricebasetype = $objp2->price_base_type;
3252 3252
 					if (getDolGlobalString('PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL')) {  // using this option is a bug. kept for backward compatibility
3253
-						$outtva_tx = $objp2->tva_tx;                        // We use the vat rate on line of multiprice
3254
-						$outdefault_vat_code = $objp2->default_vat_code;    // We use the vat code on line of multiprice
3253
+						$outtva_tx = $objp2->tva_tx; // We use the vat rate on line of multiprice
3254
+						$outdefault_vat_code = $objp2->default_vat_code; // We use the vat code on line of multiprice
3255 3255
 					} else {
3256
-						$outtva_tx = $objp->tva_tx;                            // We use the vat rate of product, not the one on line of multiprice
3257
-						$outdefault_vat_code = $objp->default_vat_code;        // We use the vat code or product, not the one on line of multiprice
3256
+						$outtva_tx = $objp->tva_tx; // We use the vat rate of product, not the one on line of multiprice
3257
+						$outdefault_vat_code = $objp->default_vat_code; // We use the vat code or product, not the one on line of multiprice
3258 3258
 					}
3259 3259
 				}
3260 3260
 			} else {
@@ -3268,13 +3268,13 @@  discard block
 block discarded – undo
3268 3268
 			$outqty = $objp->quantity;
3269 3269
 			$outdiscount = $objp->remise_percent;
3270 3270
 			if ($objp->quantity == 1) {
3271
-				$opt .= ' - ' . price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency) . "/";
3272
-				$outval .= ' - ' . price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency) . "/";
3271
+				$opt .= ' - '.price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency)."/";
3272
+				$outval .= ' - '.price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency)."/";
3273 3273
 				$opt .= $langs->trans("Unit"); // Do not use strtolower because it breaks utf8 encoding
3274 3274
 				$outval .= $langs->transnoentities("Unit");
3275 3275
 			} else {
3276
-				$opt .= ' - ' . price($objp->price, 1, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity;
3277
-				$outval .= ' - ' . price($objp->price, 0, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity;
3276
+				$opt .= ' - '.price($objp->price, 1, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity;
3277
+				$outval .= ' - '.price($objp->price, 0, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity;
3278 3278
 				$opt .= $langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding
3279 3279
 				$outval .= $langs->transnoentities("Units");
3280 3280
 			}
@@ -3282,16 +3282,16 @@  discard block
 block discarded – undo
3282 3282
 			$outprice_ht = price($objp->unitprice);
3283 3283
 			$outprice_ttc = price($objp->unitprice * (1 + ($objp->tva_tx / 100)));
3284 3284
 			$outpricebasetype = $objp->price_base_type;
3285
-			$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
3286
-			$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
3285
+			$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
3286
+			$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
3287 3287
 		}
3288 3288
 		if (empty($hidepriceinlabel) && !empty($objp->quantity) && $objp->quantity >= 1) {
3289
-			$opt .= " (" . price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->trans("Unit") . ")"; // Do not use strtolower because it breaks utf8 encoding
3290
-			$outval .= " (" . price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->transnoentities("Unit") . ")"; // Do not use strtolower because it breaks utf8 encoding
3289
+			$opt .= " (".price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency)."/".$langs->trans("Unit").")"; // Do not use strtolower because it breaks utf8 encoding
3290
+			$outval .= " (".price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency)."/".$langs->transnoentities("Unit").")"; // Do not use strtolower because it breaks utf8 encoding
3291 3291
 		}
3292 3292
 		if (empty($hidepriceinlabel) && !empty($objp->remise_percent) && $objp->remise_percent >= 1) {
3293
-			$opt .= " - " . $langs->trans("Discount") . " : " . vatrate($objp->remise_percent) . ' %';
3294
-			$outval .= " - " . $langs->transnoentities("Discount") . " : " . vatrate($objp->remise_percent) . ' %';
3293
+			$opt .= " - ".$langs->trans("Discount")." : ".vatrate($objp->remise_percent).' %';
3294
+			$outval .= " - ".$langs->transnoentities("Discount")." : ".vatrate($objp->remise_percent).' %';
3295 3295
 		}
3296 3296
 
3297 3297
 		// Price by customer
@@ -3300,11 +3300,11 @@  discard block
 block discarded – undo
3300 3300
 				$found = 1;
3301 3301
 
3302 3302
 				if ($objp->custprice_base_type == 'HT') {
3303
-					$opt .= ' - ' . price($objp->custprice, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("HT");
3304
-					$outval .= ' - ' . price($objp->custprice, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("HT");
3303
+					$opt .= ' - '.price($objp->custprice, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT");
3304
+					$outval .= ' - '.price($objp->custprice, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT");
3305 3305
 				} else {
3306
-					$opt .= ' - ' . price($objp->custprice_ttc, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("TTC");
3307
-					$outval .= ' - ' . price($objp->custprice_ttc, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("TTC");
3306
+					$opt .= ' - '.price($objp->custprice_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC");
3307
+					$outval .= ' - '.price($objp->custprice_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC");
3308 3308
 				}
3309 3309
 
3310 3310
 				$outprice_ht = price($objp->custprice);
@@ -3318,11 +3318,11 @@  discard block
 block discarded – undo
3318 3318
 		// If level no defined or multiprice not found, we used the default price
3319 3319
 		if (empty($hidepriceinlabel) && !$found) {
3320 3320
 			if ($objp->price_base_type == 'HT') {
3321
-				$opt .= ' - ' . price($objp->price, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("HT");
3322
-				$outval .= ' - ' . price($objp->price, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("HT");
3321
+				$opt .= ' - '.price($objp->price, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT");
3322
+				$outval .= ' - '.price($objp->price, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT");
3323 3323
 			} else {
3324
-				$opt .= ' - ' . price($objp->price_ttc, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("TTC");
3325
-				$outval .= ' - ' . price($objp->price_ttc, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("TTC");
3324
+				$opt .= ' - '.price($objp->price_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC");
3325
+				$outval .= ' - '.price($objp->price_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC");
3326 3326
 			}
3327 3327
 			$outprice_ht = price($objp->price);
3328 3328
 			$outprice_ttc = price($objp->price_ttc);
@@ -3333,14 +3333,14 @@  discard block
 block discarded – undo
3333 3333
 
3334 3334
 		if (isModEnabled('stock') && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || getDolGlobalString('STOCK_SUPPORTS_SERVICES'))) {
3335 3335
 			if ($user->hasRight('stock', 'lire')) {
3336
-				$opt .= ' - ' . $langs->trans("Stock") . ': ' . price(price2num($objp->stock, 'MS'));
3336
+				$opt .= ' - '.$langs->trans("Stock").': '.price(price2num($objp->stock, 'MS'));
3337 3337
 
3338 3338
 				if ($objp->stock > 0) {
3339 3339
 					$outval .= ' - <span class="product_line_stock_ok">';
3340 3340
 				} elseif ($objp->stock <= 0) {
3341 3341
 					$outval .= ' - <span class="product_line_stock_too_low">';
3342 3342
 				}
3343
-				$outval .= $langs->transnoentities("Stock") . ': ' . price(price2num($objp->stock, 'MS'));
3343
+				$outval .= $langs->transnoentities("Stock").': '.price(price2num($objp->stock, 'MS'));
3344 3344
 				$outval .= '</span>';
3345 3345
 				if (empty($novirtualstock) && getDolGlobalString('STOCK_SHOW_VIRTUAL_STOCK_IN_PRODUCTS_COMBO')) {  // Warning, this option may slow down combo list generation
3346 3346
 					$langs->load("stocks");
@@ -3350,9 +3350,9 @@  discard block
 block discarded – undo
3350 3350
 					$tmpproduct->load_virtual_stock();
3351 3351
 					$virtualstock = $tmpproduct->stock_theorique;
3352 3352
 
3353
-					$opt .= ' - ' . $langs->trans("VirtualStock") . ':' . $virtualstock;
3353
+					$opt .= ' - '.$langs->trans("VirtualStock").':'.$virtualstock;
3354 3354
 
3355
-					$outval .= ' - ' . $langs->transnoentities("VirtualStock") . ':';
3355
+					$outval .= ' - '.$langs->transnoentities("VirtualStock").':';
3356 3356
 					if ($virtualstock > 0) {
3357 3357
 						$outval .= '<span class="product_line_stock_ok">';
3358 3358
 					} elseif ($virtualstock <= 0) {
@@ -3430,7 +3430,7 @@  discard block
 block discarded – undo
3430 3430
 		$selected_input_value = '';
3431 3431
 		if (!empty($conf->use_javascript_ajax) && getDolGlobalString('PRODUIT_USE_SEARCH_TO_SELECT')) {
3432 3432
 			if ($selected > 0) {
3433
-				require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
3433
+				require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
3434 3434
 				$producttmpselect = new Product($this->db);
3435 3435
 				$producttmpselect->fetch($selected);
3436 3436
 				$selected_input_value = $producttmpselect->ref;
@@ -3438,10 +3438,10 @@  discard block
 block discarded – undo
3438 3438
 			}
3439 3439
 
3440 3440
 			// mode=2 means suppliers products
3441
-			$urloption = ($socid > 0 ? 'socid=' . $socid . '&' : '') . 'htmlname=' . $htmlname . '&outjson=1&price_level=' . $price_level . '&type=' . $filtertype . '&mode=2&status=' . $status . '&finished=' . $finished . '&alsoproductwithnosupplierprice=' . $alsoproductwithnosupplierprice;
3442
-			print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 0, $ajaxoptions);
3441
+			$urloption = ($socid > 0 ? 'socid='.$socid.'&' : '').'htmlname='.$htmlname.'&outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=2&status='.$status.'&finished='.$finished.'&alsoproductwithnosupplierprice='.$alsoproductwithnosupplierprice;
3442
+			print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 0, $ajaxoptions);
3443 3443
 
3444
-			print($hidelabel ? '' : $langs->trans("RefOrLabel") . ' : ') . '<input type="text" class="minwidth300" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . ($placeholder ? ' placeholder="' . $placeholder . '"' : '') . '>';
3444
+			print($hidelabel ? '' : $langs->trans("RefOrLabel").' : ').'<input type="text" class="minwidth300" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.($placeholder ? ' placeholder="'.$placeholder.'"' : '').'>';
3445 3445
 		} else {
3446 3446
 			print $this->select_produits_fournisseurs_list($socid, $selected, $htmlname, $filtertype, $filtre, '', $status, 0, 0, $alsoproductwithnosupplierprice, $morecss, 0, $placeholder);
3447 3447
 		}
@@ -3501,25 +3501,25 @@  discard block
 block discarded – undo
3501 3501
 		if (isModEnabled('barcode')) {
3502 3502
 			$sql .= ", pfp.barcode";
3503 3503
 		}
3504
-		$sql .= " FROM " . $this->db->prefix() . "product as p";
3505
-		$sql .= " LEFT JOIN " . $this->db->prefix() . "product_fournisseur_price as pfp ON ( p.rowid = pfp.fk_product AND pfp.entity IN (" . getEntity('product') . ") )";
3504
+		$sql .= " FROM ".$this->db->prefix()."product as p";
3505
+		$sql .= " LEFT JOIN ".$this->db->prefix()."product_fournisseur_price as pfp ON ( p.rowid = pfp.fk_product AND pfp.entity IN (".getEntity('product').") )";
3506 3506
 		if ($socid > 0) {
3507
-			$sql .= " AND pfp.fk_soc = " . ((int) $socid);
3507
+			$sql .= " AND pfp.fk_soc = ".((int) $socid);
3508 3508
 		}
3509
-		$sql .= " LEFT JOIN " . $this->db->prefix() . "societe as s ON pfp.fk_soc = s.rowid";
3509
+		$sql .= " LEFT JOIN ".$this->db->prefix()."societe as s ON pfp.fk_soc = s.rowid";
3510 3510
 		// Units
3511 3511
 		if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
3512
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "c_units u ON u.rowid = p.fk_unit";
3512
+			$sql .= " LEFT JOIN ".$this->db->prefix()."c_units u ON u.rowid = p.fk_unit";
3513 3513
 		}
3514
-		$sql .= " WHERE p.entity IN (" . getEntity('product') . ")";
3514
+		$sql .= " WHERE p.entity IN (".getEntity('product').")";
3515 3515
 		if ($statut != -1) {
3516
-			$sql .= " AND p.tobuy = " . ((int) $statut);
3516
+			$sql .= " AND p.tobuy = ".((int) $statut);
3517 3517
 		}
3518 3518
 		if (strval($filtertype) != '') {
3519
-			$sql .= " AND p.fk_product_type = " . ((int) $filtertype);
3519
+			$sql .= " AND p.fk_product_type = ".((int) $filtertype);
3520 3520
 		}
3521 3521
 		if (!empty($filtre)) {
3522
-			$sql .= " " . $filtre;
3522
+			$sql .= " ".$filtre;
3523 3523
 		}
3524 3524
 		// Add where from hooks
3525 3525
 		$parameters = array();
@@ -3539,9 +3539,9 @@  discard block
 block discarded – undo
3539 3539
 				if ($i > 0) {
3540 3540
 					$sql .= " AND ";
3541 3541
 				}
3542
-				$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) . "%'";
3542
+				$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)."%'";
3543 3543
 				if (getDolGlobalString('PRODUIT_FOURN_TEXTS')) {
3544
-					$sql .= " OR pfp.desc_fourn LIKE '" . $this->db->escape($prefix . $crit) . "%'";
3544
+					$sql .= " OR pfp.desc_fourn LIKE '".$this->db->escape($prefix.$crit)."%'";
3545 3545
 				}
3546 3546
 				$sql .= ")";
3547 3547
 				$i++;
@@ -3550,8 +3550,8 @@  discard block
 block discarded – undo
3550 3550
 				$sql .= ")";
3551 3551
 			}
3552 3552
 			if (isModEnabled('barcode')) {
3553
-				$sql .= " OR p.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
3554
-				$sql .= " OR pfp.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
3553
+				$sql .= " OR p.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'";
3554
+				$sql .= " OR pfp.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'";
3555 3555
 			}
3556 3556
 			$sql .= ')';
3557 3557
 		}
@@ -3560,20 +3560,20 @@  discard block
 block discarded – undo
3560 3560
 
3561 3561
 		// Build output string
3562 3562
 
3563
-		dol_syslog(get_class($this) . "::select_produits_fournisseurs_list", LOG_DEBUG);
3563
+		dol_syslog(get_class($this)."::select_produits_fournisseurs_list", LOG_DEBUG);
3564 3564
 		$result = $this->db->query($sql);
3565 3565
 		if ($result) {
3566
-			require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
3567
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/product.lib.php';
3566
+			require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
3567
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php';
3568 3568
 
3569 3569
 			$num = $this->db->num_rows($result);
3570 3570
 
3571 3571
 			//$out.='<select class="flat" id="select'.$htmlname.'" name="'.$htmlname.'">';	// remove select to have id same with combo and ajax
3572
-			$out .= '<select class="flat ' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . '">';
3572
+			$out .= '<select class="flat '.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.'">';
3573 3573
 			if (!$selected) {
3574
-				$out .= '<option value="-1" selected>' . ($placeholder ? $placeholder : '&nbsp;') . '</option>';
3574
+				$out .= '<option value="-1" selected>'.($placeholder ? $placeholder : '&nbsp;').'</option>';
3575 3575
 			} else {
3576
-				$out .= '<option value="-1">' . ($placeholder ? $placeholder : '&nbsp;') . '</option>';
3576
+				$out .= '<option value="-1">'.($placeholder ? $placeholder : '&nbsp;').'</option>';
3577 3577
 			}
3578 3578
 
3579 3579
 			$i = 0;
@@ -3588,7 +3588,7 @@  discard block
 block discarded – undo
3588 3588
 
3589 3589
 				$outkey = $objp->idprodfournprice; // id in table of price
3590 3590
 				if (!$outkey && $alsoproductwithnosupplierprice) {
3591
-					$outkey = 'idprod_' . $objp->rowid; // id of product
3591
+					$outkey = 'idprod_'.$objp->rowid; // id of product
3592 3592
 				}
3593 3593
 
3594 3594
 				$outref = $objp->ref;
@@ -3603,23 +3603,23 @@  discard block
 block discarded – undo
3603 3603
 				$outvalUnits = '';
3604 3604
 				if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
3605 3605
 					if (!empty($objp->unit_short)) {
3606
-						$outvalUnits .= ' - ' . $objp->unit_short;
3606
+						$outvalUnits .= ' - '.$objp->unit_short;
3607 3607
 					}
3608 3608
 					if (!empty($objp->weight) && $objp->weight_units !== null) {
3609 3609
 						$unitToShow = showDimensionInBestUnit($objp->weight, $objp->weight_units, 'weight', $langs);
3610
-						$outvalUnits .= ' - ' . $unitToShow;
3610
+						$outvalUnits .= ' - '.$unitToShow;
3611 3611
 					}
3612 3612
 					if ((!empty($objp->length) || !empty($objp->width) || !empty($objp->height)) && $objp->length_units !== null) {
3613
-						$unitToShow = $objp->length . ' x ' . $objp->width . ' x ' . $objp->height . ' ' . measuringUnitString(0, 'size', $objp->length_units);
3614
-						$outvalUnits .= ' - ' . $unitToShow;
3613
+						$unitToShow = $objp->length.' x '.$objp->width.' x '.$objp->height.' '.measuringUnitString(0, 'size', $objp->length_units);
3614
+						$outvalUnits .= ' - '.$unitToShow;
3615 3615
 					}
3616 3616
 					if (!empty($objp->surface) && $objp->surface_units !== null) {
3617 3617
 						$unitToShow = showDimensionInBestUnit($objp->surface, $objp->surface_units, 'surface', $langs);
3618
-						$outvalUnits .= ' - ' . $unitToShow;
3618
+						$outvalUnits .= ' - '.$unitToShow;
3619 3619
 					}
3620 3620
 					if (!empty($objp->volume) && $objp->volume_units !== null) {
3621 3621
 						$unitToShow = showDimensionInBestUnit($objp->volume, $objp->volume_units, 'volume', $langs);
3622
-						$outvalUnits .= ' - ' . $unitToShow;
3622
+						$outvalUnits .= ' - '.$unitToShow;
3623 3623
 					}
3624 3624
 					if ($outdurationvalue && $outdurationunit) {
3625 3625
 						$da = array(
@@ -3630,22 +3630,22 @@  discard block
 block discarded – undo
3630 3630
 							'y' => $langs->trans('Year')
3631 3631
 						);
3632 3632
 						if (isset($da[$outdurationunit])) {
3633
-							$outvalUnits .= ' - ' . $outdurationvalue . ' ' . $langs->transnoentities($da[$outdurationunit] . ($outdurationvalue > 1 ? 's' : ''));
3633
+							$outvalUnits .= ' - '.$outdurationvalue.' '.$langs->transnoentities($da[$outdurationunit].($outdurationvalue > 1 ? 's' : ''));
3634 3634
 						}
3635 3635
 					}
3636 3636
 				}
3637 3637
 
3638 3638
 				$objRef = $objp->ref;
3639 3639
 				if ($filterkey && $filterkey != '') {
3640
-					$objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1);
3640
+					$objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1);
3641 3641
 				}
3642 3642
 				$objRefFourn = $objp->ref_fourn;
3643 3643
 				if ($filterkey && $filterkey != '') {
3644
-					$objRefFourn = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRefFourn, 1);
3644
+					$objRefFourn = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRefFourn, 1);
3645 3645
 				}
3646 3646
 				$label = $objp->label;
3647 3647
 				if ($filterkey && $filterkey != '') {
3648
-					$label = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $label, 1);
3648
+					$label = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $label, 1);
3649 3649
 				}
3650 3650
 
3651 3651
 				switch ($objp->fk_product_type) {
@@ -3668,21 +3668,21 @@  discard block
 block discarded – undo
3668 3668
 
3669 3669
 				$optlabel .= $objp->ref;
3670 3670
 				if (!empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) {
3671
-					$optlabel .= ' <span class="opacitymedium">(' . $objp->ref_fourn . ')</span>';
3671
+					$optlabel .= ' <span class="opacitymedium">('.$objp->ref_fourn.')</span>';
3672 3672
 				}
3673 3673
 				if (isModEnabled('barcode') && !empty($objp->barcode)) {
3674
-					$optlabel .= ' (' . $outbarcode . ')';
3674
+					$optlabel .= ' ('.$outbarcode.')';
3675 3675
 				}
3676
-				$optlabel .= ' - ' . dol_trunc($label, $maxlengtharticle);
3676
+				$optlabel .= ' - '.dol_trunc($label, $maxlengtharticle);
3677 3677
 
3678 3678
 				$outvallabel = $objRef;
3679 3679
 				if (!empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) {
3680
-					$outvallabel .= ' (' . $objRefFourn . ')';
3680
+					$outvallabel .= ' ('.$objRefFourn.')';
3681 3681
 				}
3682 3682
 				if (isModEnabled('barcode') && !empty($objp->barcode)) {
3683
-					$outvallabel .= ' (' . $outbarcode . ')';
3683
+					$outvallabel .= ' ('.$outbarcode.')';
3684 3684
 				}
3685
-				$outvallabel .= ' - ' . dol_trunc($label, $maxlengtharticle);
3685
+				$outvallabel .= ' - '.dol_trunc($label, $maxlengtharticle);
3686 3686
 
3687 3687
 				// Units
3688 3688
 				$optlabel .= $outvalUnits;
@@ -3699,7 +3699,7 @@  discard block
 block discarded – undo
3699 3699
 						$prod_supplier->fourn_tva_tx = $objp->tva_tx;
3700 3700
 						$prod_supplier->fk_supplier_price_expression = $objp->fk_supplier_price_expression;
3701 3701
 
3702
-						require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
3702
+						require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
3703 3703
 						$priceparser = new PriceParser($this->db);
3704 3704
 						$price_result = $priceparser->parseProductSupplier($prod_supplier);
3705 3705
 						if ($price_result >= 0) {
@@ -3710,47 +3710,47 @@  discard block
 block discarded – undo
3710 3710
 						}
3711 3711
 					}
3712 3712
 					if ($objp->quantity == 1) {
3713
-						$optlabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/";
3714
-						$outvallabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency) . "/";
3713
+						$optlabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/";
3714
+						$outvallabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency)."/";
3715 3715
 						$optlabel .= $langs->trans("Unit"); // Do not use strtolower because it breaks utf8 encoding
3716 3716
 						$outvallabel .= $langs->transnoentities("Unit");
3717 3717
 					} else {
3718
-						$optlabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity;
3719
-						$outvallabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity;
3720
-						$optlabel .= ' ' . $langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding
3721
-						$outvallabel .= ' ' . $langs->transnoentities("Units");
3718
+						$optlabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity;
3719
+						$outvallabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity;
3720
+						$optlabel .= ' '.$langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding
3721
+						$outvallabel .= ' '.$langs->transnoentities("Units");
3722 3722
 					}
3723 3723
 
3724 3724
 					if ($objp->quantity > 1) {
3725
-						$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
3726
-						$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
3725
+						$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
3726
+						$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
3727 3727
 					}
3728 3728
 					if ($objp->remise_percent >= 1) {
3729
-						$optlabel .= " - " . $langs->trans("Discount") . " : " . vatrate($objp->remise_percent) . ' %';
3730
-						$outvallabel .= " - " . $langs->transnoentities("Discount") . " : " . vatrate($objp->remise_percent) . ' %';
3729
+						$optlabel .= " - ".$langs->trans("Discount")." : ".vatrate($objp->remise_percent).' %';
3730
+						$outvallabel .= " - ".$langs->transnoentities("Discount")." : ".vatrate($objp->remise_percent).' %';
3731 3731
 					}
3732 3732
 					if ($objp->duration) {
3733
-						$optlabel .= " - " . $objp->duration;
3734
-						$outvallabel .= " - " . $objp->duration;
3733
+						$optlabel .= " - ".$objp->duration;
3734
+						$outvallabel .= " - ".$objp->duration;
3735 3735
 					}
3736 3736
 					if (!$socid) {
3737
-						$optlabel .= " - " . dol_trunc($objp->name, 8);
3738
-						$outvallabel .= " - " . dol_trunc($objp->name, 8);
3737
+						$optlabel .= " - ".dol_trunc($objp->name, 8);
3738
+						$outvallabel .= " - ".dol_trunc($objp->name, 8);
3739 3739
 					}
3740 3740
 					if ($objp->supplier_reputation) {
3741 3741
 						//TODO dictionary
3742 3742
 						$reputations = array('' => $langs->trans('Standard'), 'FAVORITE' => $langs->trans('Favorite'), 'NOTTHGOOD' => $langs->trans('NotTheGoodQualitySupplier'), 'DONOTORDER' => $langs->trans('DoNotOrderThisProductToThisSupplier'));
3743 3743
 
3744
-						$optlabel .= " - " . $reputations[$objp->supplier_reputation];
3745
-						$outvallabel .= " - " . $reputations[$objp->supplier_reputation];
3744
+						$optlabel .= " - ".$reputations[$objp->supplier_reputation];
3745
+						$outvallabel .= " - ".$reputations[$objp->supplier_reputation];
3746 3746
 					}
3747 3747
 				} else {
3748 3748
 					if (empty($alsoproductwithnosupplierprice)) {     // No supplier price defined for couple product/supplier
3749
-						$optlabel .= " - <span class='opacitymedium'>" . $langs->trans("NoPriceDefinedForThisSupplier") . '</span>';
3750
-						$outvallabel .= ' - ' . $langs->transnoentities("NoPriceDefinedForThisSupplier");
3749
+						$optlabel .= " - <span class='opacitymedium'>".$langs->trans("NoPriceDefinedForThisSupplier").'</span>';
3750
+						$outvallabel .= ' - '.$langs->transnoentities("NoPriceDefinedForThisSupplier");
3751 3751
 					} else { // No supplier price defined for product, even on other suppliers
3752
-						$optlabel .= " - <span class='opacitymedium'>" . $langs->trans("NoPriceDefinedForThisSupplier") . '</span>';
3753
-						$outvallabel .= ' - ' . $langs->transnoentities("NoPriceDefinedForThisSupplier");
3752
+						$optlabel .= " - <span class='opacitymedium'>".$langs->trans("NoPriceDefinedForThisSupplier").'</span>';
3753
+						$outvallabel .= ' - '.$langs->transnoentities("NoPriceDefinedForThisSupplier");
3754 3754
 					}
3755 3755
 				}
3756 3756
 
@@ -3758,14 +3758,14 @@  discard block
 block discarded – undo
3758 3758
 					$novirtualstock = ($showstockinlist == 2);
3759 3759
 
3760 3760
 					if ($user->hasRight('stock', 'lire')) {
3761
-						$outvallabel .= ' - ' . $langs->trans("Stock") . ': ' . price(price2num($objp->stock, 'MS'));
3761
+						$outvallabel .= ' - '.$langs->trans("Stock").': '.price(price2num($objp->stock, 'MS'));
3762 3762
 
3763 3763
 						if ($objp->stock > 0) {
3764 3764
 							$optlabel .= ' - <span class="product_line_stock_ok">';
3765 3765
 						} elseif ($objp->stock <= 0) {
3766 3766
 							$optlabel .= ' - <span class="product_line_stock_too_low">';
3767 3767
 						}
3768
-						$optlabel .= $langs->transnoentities("Stock") . ':' . price(price2num($objp->stock, 'MS'));
3768
+						$optlabel .= $langs->transnoentities("Stock").':'.price(price2num($objp->stock, 'MS'));
3769 3769
 						$optlabel .= '</span>';
3770 3770
 						if (empty($novirtualstock) && getDolGlobalString('STOCK_SHOW_VIRTUAL_STOCK_IN_PRODUCTS_COMBO')) {  // Warning, this option may slow down combo list generation
3771 3771
 							$langs->load("stocks");
@@ -3775,9 +3775,9 @@  discard block
 block discarded – undo
3775 3775
 							$tmpproduct->load_virtual_stock();
3776 3776
 							$virtualstock = $tmpproduct->stock_theorique;
3777 3777
 
3778
-							$outvallabel .= ' - ' . $langs->trans("VirtualStock") . ':' . $virtualstock;
3778
+							$outvallabel .= ' - '.$langs->trans("VirtualStock").':'.$virtualstock;
3779 3779
 
3780
-							$optlabel .= ' - ' . $langs->transnoentities("VirtualStock") . ':';
3780
+							$optlabel .= ' - '.$langs->transnoentities("VirtualStock").':';
3781 3781
 							if ($virtualstock > 0) {
3782 3782
 								$optlabel .= '<span class="product_line_stock_ok">';
3783 3783
 							} elseif ($virtualstock <= 0) {
@@ -3791,7 +3791,7 @@  discard block
 block discarded – undo
3791 3791
 					}
3792 3792
 				}
3793 3793
 
3794
-				$optstart = '<option value="' . $outkey . '"';
3794
+				$optstart = '<option value="'.$outkey.'"';
3795 3795
 				if ($selected && $selected == $objp->idprodfournprice) {
3796 3796
 					$optstart .= ' selected';
3797 3797
 				}
@@ -3800,27 +3800,27 @@  discard block
 block discarded – undo
3800 3800
 				}
3801 3801
 
3802 3802
 				if (!empty($objp->idprodfournprice) && $objp->idprodfournprice > 0) {
3803
-					$optstart .= ' data-product-id="' . dol_escape_htmltag($objp->rowid) . '"';
3804
-					$optstart .= ' data-price-id="' . dol_escape_htmltag($objp->idprodfournprice) . '"';
3805
-					$optstart .= ' data-qty="' . dol_escape_htmltag($objp->quantity) . '"';
3806
-					$optstart .= ' data-up="' . dol_escape_htmltag(price2num($objp->unitprice)) . '"';
3807
-					$optstart .= ' data-up-locale="' . dol_escape_htmltag(price($objp->unitprice)) . '"';
3808
-					$optstart .= ' data-discount="' . dol_escape_htmltag($outdiscount) . '"';
3809
-					$optstart .= ' data-tvatx="' . dol_escape_htmltag(price2num($objp->tva_tx)) . '"';
3810
-					$optstart .= ' data-tvatx-formated="' . dol_escape_htmltag(price($objp->tva_tx, 0, $langs, 1, -1, 2)) . '"';
3811
-					$optstart .= ' data-default-vat-code="' . dol_escape_htmltag($objp->default_vat_code) . '"';
3812
-					$optstart .= ' data-supplier-ref="' . dol_escape_htmltag($objp->ref_fourn) . '"';
3813
-				}
3814
-				$optstart .= ' data-description="' . dol_escape_htmltag($objp->description, 0, 1) . '"';
3803
+					$optstart .= ' data-product-id="'.dol_escape_htmltag($objp->rowid).'"';
3804
+					$optstart .= ' data-price-id="'.dol_escape_htmltag($objp->idprodfournprice).'"';
3805
+					$optstart .= ' data-qty="'.dol_escape_htmltag($objp->quantity).'"';
3806
+					$optstart .= ' data-up="'.dol_escape_htmltag(price2num($objp->unitprice)).'"';
3807
+					$optstart .= ' data-up-locale="'.dol_escape_htmltag(price($objp->unitprice)).'"';
3808
+					$optstart .= ' data-discount="'.dol_escape_htmltag($outdiscount).'"';
3809
+					$optstart .= ' data-tvatx="'.dol_escape_htmltag(price2num($objp->tva_tx)).'"';
3810
+					$optstart .= ' data-tvatx-formated="'.dol_escape_htmltag(price($objp->tva_tx, 0, $langs, 1, -1, 2)).'"';
3811
+					$optstart .= ' data-default-vat-code="'.dol_escape_htmltag($objp->default_vat_code).'"';
3812
+					$optstart .= ' data-supplier-ref="'.dol_escape_htmltag($objp->ref_fourn).'"';
3813
+				}
3814
+				$optstart .= ' data-description="'.dol_escape_htmltag($objp->description, 0, 1).'"';
3815 3815
 
3816 3816
 				$outarrayentry = array(
3817 3817
 					'key' => $outkey,
3818 3818
 					'value' => $outref,
3819 3819
 					'label' => $outvallabel,
3820 3820
 					'qty' => $outqty,
3821
-					'price_qty_ht' => price2num($objp->fprice, 'MU'),    // Keep higher resolution for price for the min qty
3822
-					'price_unit_ht' => price2num($objp->unitprice, 'MU'),    // This is used to fill the Unit Price
3823
-					'price_ht' => price2num($objp->unitprice, 'MU'),        // This is used to fill the Unit Price (for compatibility)
3821
+					'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty
3822
+					'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price
3823
+					'price_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility)
3824 3824
 					'tva_tx_formated' => price($objp->tva_tx, 0, $langs, 1, -1, 2),
3825 3825
 					'tva_tx' => price2num($objp->tva_tx),
3826 3826
 					'default_vat_code' => $objp->default_vat_code,
@@ -3845,18 +3845,18 @@  discard block
 block discarded – undo
3845 3845
 				// Add new entry
3846 3846
 				// "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
3847 3847
 				// "label" value of json key array is used by jQuery automatically as text for combo box
3848
-				$out .= $optstart . ' data-html="' . dol_escape_htmltag($optlabel) . '">' . $optlabel . "</option>\n";
3848
+				$out .= $optstart.' data-html="'.dol_escape_htmltag($optlabel).'">'.$optlabel."</option>\n";
3849 3849
 				array_push(
3850 3850
 					$outarray,
3851 3851
 					array('key' => $outkey,
3852 3852
 						'value' => $outref,
3853 3853
 						'label' => $outvallabel,
3854 3854
 						'qty' => $outqty,
3855
-						'price_qty_ht' => price2num($objp->fprice, 'MU'),        // Keep higher resolution for price for the min qty
3855
+						'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty
3856 3856
 						'price_qty_ht_locale' => price($objp->fprice),
3857
-						'price_unit_ht' => price2num($objp->unitprice, 'MU'),    // This is used to fill the Unit Price
3857
+						'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price
3858 3858
 						'price_unit_ht_locale' => price($objp->unitprice),
3859
-						'price_ht' => price2num($objp->unitprice, 'MU'),        // This is used to fill the Unit Price (for compatibility)
3859
+						'price_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility)
3860 3860
 						'tva_tx_formated' => price($objp->tva_tx),
3861 3861
 						'tva_tx' => price2num($objp->tva_tx),
3862 3862
 						'default_vat_code' => $objp->default_vat_code,
@@ -3883,7 +3883,7 @@  discard block
 block discarded – undo
3883 3883
 
3884 3884
 			$this->db->free($result);
3885 3885
 
3886
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
3886
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
3887 3887
 			$out .= ajax_combobox($htmlname);
3888 3888
 		} else {
3889 3889
 			dol_print_error($this->db);
@@ -3915,43 +3915,43 @@  discard block
 block discarded – undo
3915 3915
 		$sql = "SELECT p.rowid, p.ref, p.label, p.price, p.duration, pfp.fk_soc,";
3916 3916
 		$sql .= " pfp.ref_fourn, pfp.rowid as idprodfournprice, pfp.price as fprice, pfp.remise_percent, pfp.quantity, pfp.unitprice,";
3917 3917
 		$sql .= " pfp.fk_supplier_price_expression, pfp.fk_product, pfp.tva_tx, s.nom as name";
3918
-		$sql .= " FROM " . $this->db->prefix() . "product as p";
3919
-		$sql .= " LEFT JOIN " . $this->db->prefix() . "product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
3920
-		$sql .= " LEFT JOIN " . $this->db->prefix() . "societe as s ON pfp.fk_soc = s.rowid";
3921
-		$sql .= " WHERE pfp.entity IN (" . getEntity('productsupplierprice') . ")";
3918
+		$sql .= " FROM ".$this->db->prefix()."product as p";
3919
+		$sql .= " LEFT JOIN ".$this->db->prefix()."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
3920
+		$sql .= " LEFT JOIN ".$this->db->prefix()."societe as s ON pfp.fk_soc = s.rowid";
3921
+		$sql .= " WHERE pfp.entity IN (".getEntity('productsupplierprice').")";
3922 3922
 		$sql .= " AND p.tobuy = 1";
3923 3923
 		$sql .= " AND s.fournisseur = 1";
3924
-		$sql .= " AND p.rowid = " . ((int) $productid);
3924
+		$sql .= " AND p.rowid = ".((int) $productid);
3925 3925
 		if (!getDolGlobalString('PRODUCT_BEST_SUPPLIER_PRICE_PRESELECTED')) {
3926 3926
 			$sql .= " ORDER BY s.nom, pfp.ref_fourn DESC";
3927 3927
 		} else {
3928 3928
 			$sql .= " ORDER BY pfp.unitprice ASC";
3929 3929
 		}
3930 3930
 
3931
-		dol_syslog(get_class($this) . "::select_product_fourn_price", LOG_DEBUG);
3931
+		dol_syslog(get_class($this)."::select_product_fourn_price", LOG_DEBUG);
3932 3932
 		$result = $this->db->query($sql);
3933 3933
 
3934 3934
 		if ($result) {
3935 3935
 			$num = $this->db->num_rows($result);
3936 3936
 
3937
-			$form = '<select class="flat" id="select_' . $htmlname . '" name="' . $htmlname . '">';
3937
+			$form = '<select class="flat" id="select_'.$htmlname.'" name="'.$htmlname.'">';
3938 3938
 
3939 3939
 			if (!$num) {
3940
-				$form .= '<option value="0">-- ' . $langs->trans("NoSupplierPriceDefinedForThisProduct") . ' --</option>';
3940
+				$form .= '<option value="0">-- '.$langs->trans("NoSupplierPriceDefinedForThisProduct").' --</option>';
3941 3941
 			} else {
3942
-				require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
3942
+				require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
3943 3943
 				$form .= '<option value="0">&nbsp;</option>';
3944 3944
 
3945 3945
 				$i = 0;
3946 3946
 				while ($i < $num) {
3947 3947
 					$objp = $this->db->fetch_object($result);
3948 3948
 
3949
-					$opt = '<option value="' . $objp->idprodfournprice . '"';
3949
+					$opt = '<option value="'.$objp->idprodfournprice.'"';
3950 3950
 					//if there is only one supplier, preselect it
3951 3951
 					if ($num == 1 || ($selected_supplier > 0 && $objp->fk_soc == $selected_supplier) || ($i == 0 && getDolGlobalString('PRODUCT_BEST_SUPPLIER_PRICE_PRESELECTED'))) {
3952 3952
 						$opt .= ' selected';
3953 3953
 					}
3954
-					$opt .= '>' . $objp->name . ' - ' . $objp->ref_fourn . ' - ';
3954
+					$opt .= '>'.$objp->name.' - '.$objp->ref_fourn.' - ';
3955 3955
 
3956 3956
 					if (isModEnabled('dynamicprices') && !empty($objp->fk_supplier_price_expression)) {
3957 3957
 						$prod_supplier = new ProductFournisseur($this->db);
@@ -3961,7 +3961,7 @@  discard block
 block discarded – undo
3961 3961
 						$prod_supplier->fourn_tva_tx = $objp->tva_tx;
3962 3962
 						$prod_supplier->fk_supplier_price_expression = $objp->fk_supplier_price_expression;
3963 3963
 
3964
-						require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
3964
+						require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
3965 3965
 						$priceparser = new PriceParser($this->db);
3966 3966
 						$price_result = $priceparser->parseProductSupplier($prod_supplier);
3967 3967
 						if ($price_result >= 0) {
@@ -3972,10 +3972,10 @@  discard block
 block discarded – undo
3972 3972
 						}
3973 3973
 					}
3974 3974
 					if ($objp->quantity == 1) {
3975
-						$opt .= price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/";
3975
+						$opt .= price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/";
3976 3976
 					}
3977 3977
 
3978
-					$opt .= $objp->quantity . ' ';
3978
+					$opt .= $objp->quantity.' ';
3979 3979
 
3980 3980
 					if ($objp->quantity == 1) {
3981 3981
 						$opt .= $langs->trans("Unit");
@@ -3984,10 +3984,10 @@  discard block
 block discarded – undo
3984 3984
 					}
3985 3985
 					if ($objp->quantity > 1) {
3986 3986
 						$opt .= " - ";
3987
-						$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");
3987
+						$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");
3988 3988
 					}
3989 3989
 					if ($objp->duration) {
3990
-						$opt .= " - " . $objp->duration;
3990
+						$opt .= " - ".$objp->duration;
3991 3991
 					}
3992 3992
 					$opt .= "</option>\n";
3993 3993
 
@@ -4025,8 +4025,8 @@  discard block
 block discarded – undo
4025 4025
 		dol_syslog(__METHOD__, LOG_DEBUG);
4026 4026
 
4027 4027
 		$sql = "SELECT rowid, code, libelle as label, deposit_percent";
4028
-		$sql .= " FROM " . $this->db->prefix() . 'c_payment_term';
4029
-		$sql .= " WHERE entity IN (" . getEntity('c_payment_term') . ")";
4028
+		$sql .= " FROM ".$this->db->prefix().'c_payment_term';
4029
+		$sql .= " WHERE entity IN (".getEntity('c_payment_term').")";
4030 4030
 		$sql .= " AND active > 0";
4031 4031
 		$sql .= " ORDER BY sortorder";
4032 4032
 
@@ -4038,7 +4038,7 @@  discard block
 block discarded – undo
4038 4038
 				$obj = $this->db->fetch_object($resql);
4039 4039
 
4040 4040
 				// Si traduction existe, on l'utilise, sinon on prend le libelle par defaut
4041
-				$label = ($langs->trans("PaymentConditionShort" . $obj->code) != "PaymentConditionShort" . $obj->code ? $langs->trans("PaymentConditionShort" . $obj->code) : ($obj->label != '-' ? $obj->label : ''));
4041
+				$label = ($langs->trans("PaymentConditionShort".$obj->code) != "PaymentConditionShort".$obj->code ? $langs->trans("PaymentConditionShort".$obj->code) : ($obj->label != '-' ? $obj->label : ''));
4042 4042
 				$this->cache_conditions_paiements[$obj->rowid]['code'] = $obj->code;
4043 4043
 				$this->cache_conditions_paiements[$obj->rowid]['label'] = $label;
4044 4044
 				$this->cache_conditions_paiements[$obj->rowid]['deposit_percent'] = $obj->deposit_percent;
@@ -4066,7 +4066,7 @@  discard block
 block discarded – undo
4066 4066
 		// phpcs:enable
4067 4067
 		global $langs;
4068 4068
 
4069
-		$num = count($this->cache_availability);    // TODO Use $conf->cache['availability'] instead of $this->cache_availability
4069
+		$num = count($this->cache_availability); // TODO Use $conf->cache['availability'] instead of $this->cache_availability
4070 4070
 		if ($num > 0) {
4071 4071
 			return 0; // Cache already loaded
4072 4072
 		}
@@ -4076,7 +4076,7 @@  discard block
 block discarded – undo
4076 4076
 		$langs->load('propal');
4077 4077
 
4078 4078
 		$sql = "SELECT rowid, code, label, position";
4079
-		$sql .= " FROM " . $this->db->prefix() . 'c_availability';
4079
+		$sql .= " FROM ".$this->db->prefix().'c_availability';
4080 4080
 		$sql .= " WHERE active > 0";
4081 4081
 
4082 4082
 		$resql = $this->db->query($sql);
@@ -4087,7 +4087,7 @@  discard block
 block discarded – undo
4087 4087
 				$obj = $this->db->fetch_object($resql);
4088 4088
 
4089 4089
 				// Si traduction existe, on l'utilise, sinon on prend le libelle par defaut
4090
-				$label = ($langs->trans("AvailabilityType" . $obj->code) != "AvailabilityType" . $obj->code ? $langs->trans("AvailabilityType" . $obj->code) : ($obj->label != '-' ? $obj->label : ''));
4090
+				$label = ($langs->trans("AvailabilityType".$obj->code) != "AvailabilityType".$obj->code ? $langs->trans("AvailabilityType".$obj->code) : ($obj->label != '-' ? $obj->label : ''));
4091 4091
 				$this->cache_availability[$obj->rowid]['code'] = $obj->code;
4092 4092
 				$this->cache_availability[$obj->rowid]['label'] = $label;
4093 4093
 				$this->cache_availability[$obj->rowid]['position'] = $obj->position;
@@ -4119,17 +4119,17 @@  discard block
 block discarded – undo
4119 4119
 
4120 4120
 		$this->load_cache_availability();
4121 4121
 
4122
-		dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG);
4122
+		dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG);
4123 4123
 
4124
-		print '<select id="' . $htmlname . '" class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">';
4124
+		print '<select id="'.$htmlname.'" class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
4125 4125
 		if ($addempty) {
4126 4126
 			print '<option value="0">&nbsp;</option>';
4127 4127
 		}
4128 4128
 		foreach ($this->cache_availability as $id => $arrayavailability) {
4129 4129
 			if ($selected == $id) {
4130
-				print '<option value="' . $id . '" selected>';
4130
+				print '<option value="'.$id.'" selected>';
4131 4131
 			} else {
4132
-				print '<option value="' . $id . '">';
4132
+				print '<option value="'.$id.'">';
4133 4133
 			}
4134 4134
 			print dol_escape_htmltag($arrayavailability['label']);
4135 4135
 			print '</option>';
@@ -4150,13 +4150,13 @@  discard block
 block discarded – undo
4150 4150
 	{
4151 4151
 		global $langs;
4152 4152
 
4153
-		$num = count($this->cache_demand_reason);    // TODO Use $conf->cache['input_reason'] instead of $this->cache_demand_reason
4153
+		$num = count($this->cache_demand_reason); // TODO Use $conf->cache['input_reason'] instead of $this->cache_demand_reason
4154 4154
 		if ($num > 0) {
4155 4155
 			return 0; // Cache already loaded
4156 4156
 		}
4157 4157
 
4158 4158
 		$sql = "SELECT rowid, code, label";
4159
-		$sql .= " FROM " . $this->db->prefix() . 'c_input_reason';
4159
+		$sql .= " FROM ".$this->db->prefix().'c_input_reason';
4160 4160
 		$sql .= " WHERE active > 0";
4161 4161
 
4162 4162
 		$resql = $this->db->query($sql);
@@ -4169,8 +4169,8 @@  discard block
 block discarded – undo
4169 4169
 
4170 4170
 				// Si traduction existe, on l'utilise, sinon on prend le libelle par defaut
4171 4171
 				$label = ($obj->label != '-' ? $obj->label : '');
4172
-				if ($langs->trans("DemandReasonType" . $obj->code) != "DemandReasonType" . $obj->code) {
4173
-					$label = $langs->trans("DemandReasonType" . $obj->code); // So translation key DemandReasonTypeSRC_XXX will work
4172
+				if ($langs->trans("DemandReasonType".$obj->code) != "DemandReasonType".$obj->code) {
4173
+					$label = $langs->trans("DemandReasonType".$obj->code); // So translation key DemandReasonTypeSRC_XXX will work
4174 4174
 				}
4175 4175
 				if ($langs->trans($obj->code) != $obj->code) {
4176 4176
 					$label = $langs->trans($obj->code); // So translation key SRC_XXX will work
@@ -4210,9 +4210,9 @@  discard block
 block discarded – undo
4210 4210
 
4211 4211
 		$this->loadCacheInputReason();
4212 4212
 
4213
-		print '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="select_' . $htmlname . '" name="' . $htmlname . '">';
4213
+		print '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="select_'.$htmlname.'" name="'.$htmlname.'">';
4214 4214
 		if ($addempty) {
4215
-			print '<option value="0"' . (empty($selected) ? ' selected' : '') . '>&nbsp;</option>';
4215
+			print '<option value="0"'.(empty($selected) ? ' selected' : '').'>&nbsp;</option>';
4216 4216
 		}
4217 4217
 		foreach ($this->cache_demand_reason as $id => $arraydemandreason) {
4218 4218
 			if ($arraydemandreason['code'] == $exclude) {
@@ -4220,9 +4220,9 @@  discard block
 block discarded – undo
4220 4220
 			}
4221 4221
 
4222 4222
 			if ($selected && ($selected == $arraydemandreason['id'] || $selected == $arraydemandreason['code'])) {
4223
-				print '<option value="' . $arraydemandreason['id'] . '" selected>';
4223
+				print '<option value="'.$arraydemandreason['id'].'" selected>';
4224 4224
 			} else {
4225
-				print '<option value="' . $arraydemandreason['id'] . '">';
4225
+				print '<option value="'.$arraydemandreason['id'].'">';
4226 4226
 			}
4227 4227
 			$label = $arraydemandreason['label']; // Translation of label was already done into the ->loadCacheInputReason
4228 4228
 			print $langs->trans($label);
@@ -4232,7 +4232,7 @@  discard block
 block discarded – undo
4232 4232
 		if ($user->admin && empty($notooltip)) {
4233 4233
 			print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
4234 4234
 		}
4235
-		print ajax_combobox('select_' . $htmlname);
4235
+		print ajax_combobox('select_'.$htmlname);
4236 4236
 	}
4237 4237
 
4238 4238
 	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
@@ -4247,7 +4247,7 @@  discard block
 block discarded – undo
4247 4247
 		// phpcs:enable
4248 4248
 		global $langs;
4249 4249
 
4250
-		$num = count($this->cache_types_paiements);        // TODO Use $conf->cache['payment_mode'] instead of $this->cache_types_paiements
4250
+		$num = count($this->cache_types_paiements); // TODO Use $conf->cache['payment_mode'] instead of $this->cache_types_paiements
4251 4251
 		if ($num > 0) {
4252 4252
 			return $num; // Cache already loaded
4253 4253
 		}
@@ -4257,8 +4257,8 @@  discard block
 block discarded – undo
4257 4257
 		$this->cache_types_paiements = array();
4258 4258
 
4259 4259
 		$sql = "SELECT id, code, libelle as label, type, active";
4260
-		$sql .= " FROM " . $this->db->prefix() . "c_paiement";
4261
-		$sql .= " WHERE entity IN (" . getEntity('c_paiement') . ")";
4260
+		$sql .= " FROM ".$this->db->prefix()."c_paiement";
4261
+		$sql .= " WHERE entity IN (".getEntity('c_paiement').")";
4262 4262
 
4263 4263
 		$resql = $this->db->query($sql);
4264 4264
 		if ($resql) {
@@ -4268,7 +4268,7 @@  discard block
 block discarded – undo
4268 4268
 				$obj = $this->db->fetch_object($resql);
4269 4269
 
4270 4270
 				// Si traduction existe, on l'utilise, sinon on prend le libelle par defaut
4271
-				$label = ($langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) != "PaymentTypeShort" . $obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) : ($obj->label != '-' ? $obj->label : ''));
4271
+				$label = ($langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) != "PaymentTypeShort".$obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) : ($obj->label != '-' ? $obj->label : ''));
4272 4272
 				$this->cache_types_paiements[$obj->id]['id'] = $obj->id;
4273 4273
 				$this->cache_types_paiements[$obj->id]['code'] = $obj->code;
4274 4274
 				$this->cache_types_paiements[$obj->id]['label'] = $label;
@@ -4340,17 +4340,17 @@  discard block
 block discarded – undo
4340 4340
 		global $langs, $user, $conf;
4341 4341
 
4342 4342
 		$out = '';
4343
-		dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG);
4343
+		dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG);
4344 4344
 
4345 4345
 		$this->load_cache_conditions_paiements();
4346 4346
 
4347 4347
 		// Set default value if not already set by caller
4348 4348
 		if (empty($selected) && getDolGlobalString('MAIN_DEFAULT_PAYMENT_TERM_ID')) {
4349
-			dol_syslog(__METHOD__ . "Using deprecated option MAIN_DEFAULT_PAYMENT_TERM_ID", LOG_NOTICE);
4349
+			dol_syslog(__METHOD__."Using deprecated option MAIN_DEFAULT_PAYMENT_TERM_ID", LOG_NOTICE);
4350 4350
 			$selected = getDolGlobalString('MAIN_DEFAULT_PAYMENT_TERM_ID');
4351 4351
 		}
4352 4352
 
4353
-		$out .= '<select id="' . $htmlname . '" class="flat selectpaymentterms' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">';
4353
+		$out .= '<select id="'.$htmlname.'" class="flat selectpaymentterms'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
4354 4354
 		if ($addempty) {
4355 4355
 			$out .= '<option value="0">&nbsp;</option>';
4356 4356
 		}
@@ -4364,9 +4364,9 @@  discard block
 block discarded – undo
4364 4364
 
4365 4365
 			if ($selected == $id) {
4366 4366
 				$selectedDepositPercent = $deposit_percent > 0 ? $deposit_percent : $arrayconditions['deposit_percent'];
4367
-				$out .= '<option value="' . $id . '" data-deposit_percent="' . $arrayconditions['deposit_percent'] . '" selected>';
4367
+				$out .= '<option value="'.$id.'" data-deposit_percent="'.$arrayconditions['deposit_percent'].'" selected>';
4368 4368
 			} else {
4369
-				$out .= '<option value="' . $id . '" data-deposit_percent="' . $arrayconditions['deposit_percent'] . '">';
4369
+				$out .= '<option value="'.$id.'" data-deposit_percent="'.$arrayconditions['deposit_percent'].'">';
4370 4370
 			}
4371 4371
 			$label = $arrayconditions['label'];
4372 4372
 
@@ -4384,21 +4384,21 @@  discard block
 block discarded – undo
4384 4384
 		$out .= ajax_combobox($htmlname);
4385 4385
 
4386 4386
 		if ($deposit_percent >= 0) {
4387
-			$out .= ' <span id="' . $htmlname . '_deposit_percent_container"' . (empty($selectedDepositPercent) ? ' style="display: none"' : '') . '>';
4388
-			$out .= $langs->trans('DepositPercent') . ' : ';
4389
-			$out .= '<input id="' . $htmlname . '_deposit_percent" name="' . $htmlname . '_deposit_percent" class="maxwidth50" value="' . $deposit_percent . '" />';
4387
+			$out .= ' <span id="'.$htmlname.'_deposit_percent_container"'.(empty($selectedDepositPercent) ? ' style="display: none"' : '').'>';
4388
+			$out .= $langs->trans('DepositPercent').' : ';
4389
+			$out .= '<input id="'.$htmlname.'_deposit_percent" name="'.$htmlname.'_deposit_percent" class="maxwidth50" value="'.$deposit_percent.'" />';
4390 4390
 			$out .= '</span>';
4391 4391
 			$out .= '
4392
-				<script nonce="' . getNonce() . '">
4392
+				<script nonce="' . getNonce().'">
4393 4393
 					$(document).ready(function () {
4394
-						$("#' . $htmlname . '").change(function () {
4394
+						$("#' . $htmlname.'").change(function () {
4395 4395
 							let $selected = $(this).find("option:selected");
4396 4396
 							let depositPercent = $selected.attr("data-deposit_percent");
4397 4397
 
4398 4398
 							if (depositPercent.length > 0) {
4399
-								$("#' . $htmlname . '_deposit_percent_container").show().find("#' . $htmlname . '_deposit_percent").val(depositPercent);
4399
+								$("#' . $htmlname.'_deposit_percent_container").show().find("#'.$htmlname.'_deposit_percent").val(depositPercent);
4400 4400
 							} else {
4401
-								$("#' . $htmlname . '_deposit_percent_container").hide();
4401
+								$("#' . $htmlname.'_deposit_percent_container").hide();
4402 4402
 							}
4403 4403
 
4404 4404
 							return true;
@@ -4436,7 +4436,7 @@  discard block
 block discarded – undo
4436 4436
 
4437 4437
 		$out = '';
4438 4438
 
4439
-		dol_syslog(__METHOD__ . " " . $selected . ", " . $htmlname . ", " . $filtertype . ", " . $format, LOG_DEBUG);
4439
+		dol_syslog(__METHOD__." ".$selected.", ".$htmlname.", ".$filtertype.", ".$format, LOG_DEBUG);
4440 4440
 
4441 4441
 		$filterarray = array();
4442 4442
 		if ($filtertype == 'CRDT') {
@@ -4451,11 +4451,11 @@  discard block
 block discarded – undo
4451 4451
 
4452 4452
 		// Set default value if not already set by caller
4453 4453
 		if (empty($selected) && getDolGlobalString('MAIN_DEFAULT_PAYMENT_TYPE_ID')) {
4454
-			dol_syslog(__METHOD__ . "Using deprecated option MAIN_DEFAULT_PAYMENT_TYPE_ID", LOG_NOTICE);
4454
+			dol_syslog(__METHOD__."Using deprecated option MAIN_DEFAULT_PAYMENT_TYPE_ID", LOG_NOTICE);
4455 4455
 			$selected = getDolGlobalString('MAIN_DEFAULT_PAYMENT_TYPE_ID');
4456 4456
 		}
4457 4457
 
4458
-		$out .= '<select id="select' . $htmlname . '" class="flat selectpaymenttypes' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">';
4458
+		$out .= '<select id="select'.$htmlname.'" class="flat selectpaymenttypes'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
4459 4459
 		if ($empty) {
4460 4460
 			$out .= '<option value="">&nbsp;</option>';
4461 4461
 		}
@@ -4476,13 +4476,13 @@  discard block
 block discarded – undo
4476 4476
 			}
4477 4477
 
4478 4478
 			if ($format == 0) {
4479
-				$out .= '<option value="' . $id . '"';
4479
+				$out .= '<option value="'.$id.'"';
4480 4480
 			} elseif ($format == 1) {
4481
-				$out .= '<option value="' . $arraytypes['code'] . '"';
4481
+				$out .= '<option value="'.$arraytypes['code'].'"';
4482 4482
 			} elseif ($format == 2) {
4483
-				$out .= '<option value="' . $arraytypes['code'] . '"';
4483
+				$out .= '<option value="'.$arraytypes['code'].'"';
4484 4484
 			} elseif ($format == 3) {
4485
-				$out .= '<option value="' . $id . '"';
4485
+				$out .= '<option value="'.$id.'"';
4486 4486
 			}
4487 4487
 			// Print attribute selected or not
4488 4488
 			if ($format == 1 || $format == 2) {
@@ -4512,7 +4512,7 @@  discard block
 block discarded – undo
4512 4512
 		if ($user->admin && !$noadmininfo) {
4513 4513
 			$out .= info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
4514 4514
 		}
4515
-		$out .= ajax_combobox('select' . $htmlname);
4515
+		$out .= ajax_combobox('select'.$htmlname);
4516 4516
 
4517 4517
 		if (empty($nooutput)) {
4518 4518
 			print $out;
@@ -4534,22 +4534,22 @@  discard block
 block discarded – undo
4534 4534
 	{
4535 4535
 		global $langs;
4536 4536
 
4537
-		$return = '<select class="flat maxwidth100" id="select_' . $htmlname . '" name="' . $htmlname . '">';
4537
+		$return = '<select class="flat maxwidth100" id="select_'.$htmlname.'" name="'.$htmlname.'">';
4538 4538
 		$options = array(
4539 4539
 			'HT' => $langs->trans("HT"),
4540 4540
 			'TTC' => $langs->trans("TTC")
4541 4541
 		);
4542 4542
 		foreach ($options as $id => $value) {
4543 4543
 			if ($selected == $id) {
4544
-				$return .= '<option value="' . $id . '" selected>' . $value;
4544
+				$return .= '<option value="'.$id.'" selected>'.$value;
4545 4545
 			} else {
4546
-				$return .= '<option value="' . $id . '">' . $value;
4546
+				$return .= '<option value="'.$id.'">'.$value;
4547 4547
 			}
4548 4548
 			$return .= '</option>';
4549 4549
 		}
4550 4550
 		$return .= '</select>';
4551 4551
 		if ($addjscombo) {
4552
-			$return .= ajax_combobox('select_' . $htmlname);
4552
+			$return .= ajax_combobox('select_'.$htmlname);
4553 4553
 		}
4554 4554
 
4555 4555
 		return $return;
@@ -4567,7 +4567,7 @@  discard block
 block discarded – undo
4567 4567
 		// phpcs:enable
4568 4568
 		global $langs;
4569 4569
 
4570
-		$num = count($this->cache_transport_mode);        // TODO Use $conf->cache['payment_mode'] instead of $this->cache_transport_mode
4570
+		$num = count($this->cache_transport_mode); // TODO Use $conf->cache['payment_mode'] instead of $this->cache_transport_mode
4571 4571
 		if ($num > 0) {
4572 4572
 			return $num; // Cache already loaded
4573 4573
 		}
@@ -4577,8 +4577,8 @@  discard block
 block discarded – undo
4577 4577
 		$this->cache_transport_mode = array();
4578 4578
 
4579 4579
 		$sql = "SELECT rowid, code, label, active";
4580
-		$sql .= " FROM " . $this->db->prefix() . "c_transport_mode";
4581
-		$sql .= " WHERE entity IN (" . getEntity('c_transport_mode') . ")";
4580
+		$sql .= " FROM ".$this->db->prefix()."c_transport_mode";
4581
+		$sql .= " WHERE entity IN (".getEntity('c_transport_mode').")";
4582 4582
 
4583 4583
 		$resql = $this->db->query($sql);
4584 4584
 		if ($resql) {
@@ -4588,7 +4588,7 @@  discard block
 block discarded – undo
4588 4588
 				$obj = $this->db->fetch_object($resql);
4589 4589
 
4590 4590
 				// If traduction exist, we use it else we take the default label
4591
-				$label = ($langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) != "PaymentTypeShort" . $obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) : ($obj->label != '-' ? $obj->label : ''));
4591
+				$label = ($langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) != "PaymentTypeShort".$obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) : ($obj->label != '-' ? $obj->label : ''));
4592 4592
 				$this->cache_transport_mode[$obj->rowid]['rowid'] = $obj->rowid;
4593 4593
 				$this->cache_transport_mode[$obj->rowid]['code'] = $obj->code;
4594 4594
 				$this->cache_transport_mode[$obj->rowid]['label'] = $label;
@@ -4622,11 +4622,11 @@  discard block
 block discarded – undo
4622 4622
 	{
4623 4623
 		global $langs, $user;
4624 4624
 
4625
-		dol_syslog(__METHOD__ . " " . $selected . ", " . $htmlname . ", " . $format, LOG_DEBUG);
4625
+		dol_syslog(__METHOD__." ".$selected.", ".$htmlname.", ".$format, LOG_DEBUG);
4626 4626
 
4627 4627
 		$this->load_cache_transport_mode();
4628 4628
 
4629
-		print '<select id="select' . $htmlname . '" class="flat selectmodetransport' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">';
4629
+		print '<select id="select'.$htmlname.'" class="flat selectmodetransport'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
4630 4630
 		if ($empty) {
4631 4631
 			print '<option value="">&nbsp;</option>';
4632 4632
 		}
@@ -4642,13 +4642,13 @@  discard block
 block discarded – undo
4642 4642
 			}
4643 4643
 
4644 4644
 			if ($format == 0) {
4645
-				print '<option value="' . $id . '"';
4645
+				print '<option value="'.$id.'"';
4646 4646
 			} elseif ($format == 1) {
4647
-				print '<option value="' . $arraytypes['code'] . '"';
4647
+				print '<option value="'.$arraytypes['code'].'"';
4648 4648
 			} elseif ($format == 2) {
4649
-				print '<option value="' . $arraytypes['code'] . '"';
4649
+				print '<option value="'.$arraytypes['code'].'"';
4650 4650
 			} elseif ($format == 3) {
4651
-				print '<option value="' . $id . '"';
4651
+				print '<option value="'.$id.'"';
4652 4652
 			}
4653 4653
 			// If text is selected, we compare with code, else with id
4654 4654
 			if (preg_match('/[a-z]/i', $selected) && $selected == $arraytypes['code']) {
@@ -4696,31 +4696,31 @@  discard block
 block discarded – undo
4696 4696
 		$langs->load("deliveries");
4697 4697
 
4698 4698
 		$sql = "SELECT rowid, code, libelle as label";
4699
-		$sql .= " FROM " . $this->db->prefix() . "c_shipment_mode";
4699
+		$sql .= " FROM ".$this->db->prefix()."c_shipment_mode";
4700 4700
 		$sql .= " WHERE active > 0";
4701 4701
 		if ($filtre) {
4702
-			$sql .= " AND " . $filtre;
4702
+			$sql .= " AND ".$filtre;
4703 4703
 		}
4704 4704
 		$sql .= " ORDER BY libelle ASC";
4705 4705
 
4706
-		dol_syslog(get_class($this) . "::selectShippingMode", LOG_DEBUG);
4706
+		dol_syslog(get_class($this)."::selectShippingMode", LOG_DEBUG);
4707 4707
 		$result = $this->db->query($sql);
4708 4708
 		if ($result) {
4709 4709
 			$num = $this->db->num_rows($result);
4710 4710
 			$i = 0;
4711 4711
 			if ($num) {
4712
-				print '<select id="select' . $htmlname . '" class="flat selectshippingmethod' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>';
4712
+				print '<select id="select'.$htmlname.'" class="flat selectshippingmethod'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>';
4713 4713
 				if ($useempty == 1 || ($useempty == 2 && $num > 1)) {
4714 4714
 					print '<option value="-1">&nbsp;</option>';
4715 4715
 				}
4716 4716
 				while ($i < $num) {
4717 4717
 					$obj = $this->db->fetch_object($result);
4718 4718
 					if ($selected == $obj->rowid) {
4719
-						print '<option value="' . $obj->rowid . '" selected>';
4719
+						print '<option value="'.$obj->rowid.'" selected>';
4720 4720
 					} else {
4721
-						print '<option value="' . $obj->rowid . '">';
4721
+						print '<option value="'.$obj->rowid.'">';
4722 4722
 					}
4723
-					print ($langs->trans("SendingMethod" . strtoupper($obj->code)) != "SendingMethod" . strtoupper($obj->code)) ? $langs->trans("SendingMethod" . strtoupper($obj->code)) : $obj->label;
4723
+					print ($langs->trans("SendingMethod".strtoupper($obj->code)) != "SendingMethod".strtoupper($obj->code)) ? $langs->trans("SendingMethod".strtoupper($obj->code)) : $obj->label;
4724 4724
 					print '</option>';
4725 4725
 					$i++;
4726 4726
 				}
@@ -4729,7 +4729,7 @@  discard block
 block discarded – undo
4729 4729
 					print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
4730 4730
 				}
4731 4731
 
4732
-				print ajax_combobox('select' . $htmlname);
4732
+				print ajax_combobox('select'.$htmlname);
4733 4733
 			} else {
4734 4734
 				print $langs->trans("NoShippingMethodDefined");
4735 4735
 			}
@@ -4754,16 +4754,16 @@  discard block
 block discarded – undo
4754 4754
 		$langs->load("deliveries");
4755 4755
 
4756 4756
 		if ($htmlname != "none") {
4757
-			print '<form method="POST" action="' . $page . '">';
4757
+			print '<form method="POST" action="'.$page.'">';
4758 4758
 			print '<input type="hidden" name="action" value="setshippingmethod">';
4759
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
4759
+			print '<input type="hidden" name="token" value="'.newToken().'">';
4760 4760
 			$this->selectShippingMethod($selected, $htmlname, '', $addempty);
4761
-			print '<input type="submit" class="button valignmiddle" value="' . $langs->trans("Modify") . '">';
4761
+			print '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
4762 4762
 			print '</form>';
4763 4763
 		} else {
4764 4764
 			if ($selected) {
4765 4765
 				$code = $langs->getLabelFromKey($this->db, $selected, 'c_shipment_mode', 'rowid', 'code');
4766
-				print $langs->trans("SendingMethod" . strtoupper($code));
4766
+				print $langs->trans("SendingMethod".strtoupper($code));
4767 4767
 			} else {
4768 4768
 				print "&nbsp;";
4769 4769
 			}
@@ -4786,10 +4786,10 @@  discard block
 block discarded – undo
4786 4786
 
4787 4787
 		$opt = '<option value="" selected></option>';
4788 4788
 		$sql = "SELECT rowid, ref, situation_cycle_ref, situation_counter, situation_final, fk_soc";
4789
-		$sql .= ' FROM ' . $this->db->prefix() . 'facture';
4790
-		$sql .= ' WHERE entity IN (' . getEntity('invoice') . ')';
4789
+		$sql .= ' FROM '.$this->db->prefix().'facture';
4790
+		$sql .= ' WHERE entity IN ('.getEntity('invoice').')';
4791 4791
 		$sql .= ' AND situation_counter >= 1';
4792
-		$sql .= ' AND fk_soc = ' . (int) $socid;
4792
+		$sql .= ' AND fk_soc = '.(int) $socid;
4793 4793
 		$sql .= ' AND type <> 2';
4794 4794
 		$sql .= ' ORDER by situation_cycle_ref, situation_counter desc';
4795 4795
 		$resql = $this->db->query($sql);
@@ -4807,19 +4807,19 @@  discard block
 block discarded – undo
4807 4807
 						//Not prov?
4808 4808
 						if (substr($obj->ref, 1, 4) != 'PROV') {
4809 4809
 							if ($selected == $obj->rowid) {
4810
-								$opt .= '<option value="' . $obj->rowid . '" selected>' . $obj->ref . '</option>';
4810
+								$opt .= '<option value="'.$obj->rowid.'" selected>'.$obj->ref.'</option>';
4811 4811
 							} else {
4812
-								$opt .= '<option value="' . $obj->rowid . '">' . $obj->ref . '</option>';
4812
+								$opt .= '<option value="'.$obj->rowid.'">'.$obj->ref.'</option>';
4813 4813
 							}
4814 4814
 						}
4815 4815
 					}
4816 4816
 				}
4817 4817
 			}
4818 4818
 		} else {
4819
-			dol_syslog("Error sql=" . $sql . ", error=" . $this->error, LOG_ERR);
4819
+			dol_syslog("Error sql=".$sql.", error=".$this->error, LOG_ERR);
4820 4820
 		}
4821 4821
 		if ($opt == '<option value ="" selected></option>') {
4822
-			$opt = '<option value ="0" selected>' . $langs->trans('NoSituations') . '</option>';
4822
+			$opt = '<option value ="0" selected>'.$langs->trans('NoSituations').'</option>';
4823 4823
 		}
4824 4824
 		return $opt;
4825 4825
 	}
@@ -4839,12 +4839,12 @@  discard block
 block discarded – undo
4839 4839
 
4840 4840
 		$langs->load('products');
4841 4841
 
4842
-		$return = '<select class="flat" id="' . $htmlname . '" name="' . $htmlname . '">';
4842
+		$return = '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'">';
4843 4843
 
4844
-		$sql = "SELECT rowid, label, code FROM " . $this->db->prefix() . "c_units";
4844
+		$sql = "SELECT rowid, label, code FROM ".$this->db->prefix()."c_units";
4845 4845
 		$sql .= ' WHERE active > 0';
4846 4846
 		if (!empty($unit_type)) {
4847
-			$sql .= " AND unit_type = '" . $this->db->escape($unit_type) . "'";
4847
+			$sql .= " AND unit_type = '".$this->db->escape($unit_type)."'";
4848 4848
 		}
4849 4849
 		$sql .= " ORDER BY sortorder";
4850 4850
 
@@ -4856,14 +4856,14 @@  discard block
 block discarded – undo
4856 4856
 
4857 4857
 			while ($res = $this->db->fetch_object($resql)) {
4858 4858
 				$unitLabel = $res->label;
4859
-				if (!empty($langs->tab_translate['unit' . $res->code])) {    // check if Translation is available before
4860
-					$unitLabel = $langs->trans('unit' . $res->code) != $res->label ? $langs->trans('unit' . $res->code) : $res->label;
4859
+				if (!empty($langs->tab_translate['unit'.$res->code])) {    // check if Translation is available before
4860
+					$unitLabel = $langs->trans('unit'.$res->code) != $res->label ? $langs->trans('unit'.$res->code) : $res->label;
4861 4861
 				}
4862 4862
 
4863 4863
 				if ($selected == $res->rowid) {
4864
-					$return .= '<option value="' . $res->rowid . '" selected>' . $unitLabel . '</option>';
4864
+					$return .= '<option value="'.$res->rowid.'" selected>'.$unitLabel.'</option>';
4865 4865
 				} else {
4866
-					$return .= '<option value="' . $res->rowid . '">' . $unitLabel . '</option>';
4866
+					$return .= '<option value="'.$res->rowid.'">'.$unitLabel.'</option>';
4867 4867
 				}
4868 4868
 			}
4869 4869
 			$return .= '</select>';
@@ -4898,23 +4898,23 @@  discard block
 block discarded – undo
4898 4898
 		$num = 0;
4899 4899
 
4900 4900
 		$sql = "SELECT rowid, label, bank, clos as status, currency_code";
4901
-		$sql .= " FROM " . $this->db->prefix() . "bank_account";
4902
-		$sql .= " WHERE entity IN (" . getEntity('bank_account') . ")";
4901
+		$sql .= " FROM ".$this->db->prefix()."bank_account";
4902
+		$sql .= " WHERE entity IN (".getEntity('bank_account').")";
4903 4903
 		if ($status != 2) {
4904
-			$sql .= " AND clos = " . (int) $status;
4904
+			$sql .= " AND clos = ".(int) $status;
4905 4905
 		}
4906 4906
 		if ($filtre) {
4907
-			$sql .= " AND " . $filtre;
4907
+			$sql .= " AND ".$filtre;
4908 4908
 		}
4909 4909
 		$sql .= " ORDER BY label";
4910 4910
 
4911
-		dol_syslog(get_class($this) . "::select_comptes", LOG_DEBUG);
4911
+		dol_syslog(get_class($this)."::select_comptes", LOG_DEBUG);
4912 4912
 		$result = $this->db->query($sql);
4913 4913
 		if ($result) {
4914 4914
 			$num = $this->db->num_rows($result);
4915 4915
 			$i = 0;
4916 4916
 			if ($num) {
4917
-				$out .= '<select id="select' . $htmlname . '" class="flat selectbankaccount' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>';
4917
+				$out .= '<select id="select'.$htmlname.'" class="flat selectbankaccount'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>';
4918 4918
 				if ($useempty == 1 || ($useempty == 2 && $num > 1)) {
4919 4919
 					$out .= '<option value="-1">&nbsp;</option>';
4920 4920
 				}
@@ -4922,27 +4922,27 @@  discard block
 block discarded – undo
4922 4922
 				while ($i < $num) {
4923 4923
 					$obj = $this->db->fetch_object($result);
4924 4924
 					if ($selected == $obj->rowid || ($useempty == 2 && $num == 1 && empty($selected))) {
4925
-						$out .= '<option value="' . $obj->rowid . '" data-currency-code="' . $obj->currency_code . '" selected>';
4925
+						$out .= '<option value="'.$obj->rowid.'" data-currency-code="'.$obj->currency_code.'" selected>';
4926 4926
 					} else {
4927
-						$out .= '<option value="' . $obj->rowid . '" data-currency-code="' . $obj->currency_code . '">';
4927
+						$out .= '<option value="'.$obj->rowid.'" data-currency-code="'.$obj->currency_code.'">';
4928 4928
 					}
4929 4929
 					$out .= trim($obj->label);
4930 4930
 					if ($showcurrency) {
4931
-						$out .= ' (' . $obj->currency_code . ')';
4931
+						$out .= ' ('.$obj->currency_code.')';
4932 4932
 					}
4933 4933
 					if ($status == 2 && $obj->status == 1) {
4934
-						$out .= ' (' . $langs->trans("Closed") . ')';
4934
+						$out .= ' ('.$langs->trans("Closed").')';
4935 4935
 					}
4936 4936
 					$out .= '</option>';
4937 4937
 					$i++;
4938 4938
 				}
4939 4939
 				$out .= "</select>";
4940
-				$out .= ajax_combobox('select' . $htmlname);
4940
+				$out .= ajax_combobox('select'.$htmlname);
4941 4941
 			} else {
4942 4942
 				if ($status == 0) {
4943
-					$out .= '<span class="opacitymedium">' . $langs->trans("NoActiveBankAccountDefined") . '</span>';
4943
+					$out .= '<span class="opacitymedium">'.$langs->trans("NoActiveBankAccountDefined").'</span>';
4944 4944
 				} else {
4945
-					$out .= '<span class="opacitymedium">' . $langs->trans("NoBankAccountFound") . '</span>';
4945
+					$out .= '<span class="opacitymedium">'.$langs->trans("NoBankAccountFound").'</span>';
4946 4946
 				}
4947 4947
 			}
4948 4948
 		} else {
@@ -4978,23 +4978,23 @@  discard block
 block discarded – undo
4978 4978
 		$num = 0;
4979 4979
 
4980 4980
 		$sql = "SELECT rowid, name, fk_country, status, entity";
4981
-		$sql .= " FROM " . $this->db->prefix() . "establishment";
4981
+		$sql .= " FROM ".$this->db->prefix()."establishment";
4982 4982
 		$sql .= " WHERE 1=1";
4983 4983
 		if ($status != 2) {
4984
-			$sql .= " AND status = " . (int) $status;
4984
+			$sql .= " AND status = ".(int) $status;
4985 4985
 		}
4986 4986
 		if ($filtre) {
4987
-			$sql .= " AND " . $filtre;
4987
+			$sql .= " AND ".$filtre;
4988 4988
 		}
4989 4989
 		$sql .= " ORDER BY name";
4990 4990
 
4991
-		dol_syslog(get_class($this) . "::select_establishment", LOG_DEBUG);
4991
+		dol_syslog(get_class($this)."::select_establishment", LOG_DEBUG);
4992 4992
 		$result = $this->db->query($sql);
4993 4993
 		if ($result) {
4994 4994
 			$num = $this->db->num_rows($result);
4995 4995
 			$i = 0;
4996 4996
 			if ($num) {
4997
-				print '<select id="select' . $htmlname . '" class="flat selectestablishment" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>';
4997
+				print '<select id="select'.$htmlname.'" class="flat selectestablishment" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>';
4998 4998
 				if ($useempty == 1 || ($useempty == 2 && $num > 1)) {
4999 4999
 					print '<option value="-1">&nbsp;</option>';
5000 5000
 				}
@@ -5002,13 +5002,13 @@  discard block
 block discarded – undo
5002 5002
 				while ($i < $num) {
5003 5003
 					$obj = $this->db->fetch_object($result);
5004 5004
 					if ($selected == $obj->rowid) {
5005
-						print '<option value="' . $obj->rowid . '" selected>';
5005
+						print '<option value="'.$obj->rowid.'" selected>';
5006 5006
 					} else {
5007
-						print '<option value="' . $obj->rowid . '">';
5007
+						print '<option value="'.$obj->rowid.'">';
5008 5008
 					}
5009 5009
 					print trim($obj->name);
5010 5010
 					if ($status == 2 && $obj->status == 1) {
5011
-						print ' (' . $langs->trans("Closed") . ')';
5011
+						print ' ('.$langs->trans("Closed").')';
5012 5012
 					}
5013 5013
 					print '</option>';
5014 5014
 					$i++;
@@ -5016,9 +5016,9 @@  discard block
 block discarded – undo
5016 5016
 				print "</select>";
5017 5017
 			} else {
5018 5018
 				if ($status == 0) {
5019
-					print '<span class="opacitymedium">' . $langs->trans("NoActiveEstablishmentDefined") . '</span>';
5019
+					print '<span class="opacitymedium">'.$langs->trans("NoActiveEstablishmentDefined").'</span>';
5020 5020
 				} else {
5021
-					print '<span class="opacitymedium">' . $langs->trans("NoEstablishmentFound") . '</span>';
5021
+					print '<span class="opacitymedium">'.$langs->trans("NoEstablishmentFound").'</span>';
5022 5022
 				}
5023 5023
 			}
5024 5024
 
@@ -5042,20 +5042,20 @@  discard block
 block discarded – undo
5042 5042
 	{
5043 5043
 		global $langs;
5044 5044
 		if ($htmlname != "none") {
5045
-			print '<form method="POST" action="' . $page . '">';
5045
+			print '<form method="POST" action="'.$page.'">';
5046 5046
 			print '<input type="hidden" name="action" value="setbankaccount">';
5047
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
5047
+			print '<input type="hidden" name="token" value="'.newToken().'">';
5048 5048
 			print img_picto('', 'bank_account', 'class="pictofixedwidth"');
5049 5049
 			$nbaccountfound = $this->select_comptes($selected, $htmlname, 0, '', $addempty);
5050 5050
 			if ($nbaccountfound > 0) {
5051
-				print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
5051
+				print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
5052 5052
 			}
5053 5053
 			print '</form>';
5054 5054
 		} else {
5055 5055
 			$langs->load('banks');
5056 5056
 
5057 5057
 			if ($selected) {
5058
-				require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php';
5058
+				require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
5059 5059
 				$bankstatic = new Account($this->db);
5060 5060
 				$result = $bankstatic->fetch($selected);
5061 5061
 				if ($result) {
@@ -5093,19 +5093,19 @@  discard block
 block discarded – undo
5093 5093
 		global $conf, $langs;
5094 5094
 		$langs->load("categories");
5095 5095
 
5096
-		include_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
5096
+		include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
5097 5097
 
5098 5098
 		// For backward compatibility
5099 5099
 		if (is_numeric($type)) {
5100
-			dol_syslog(__METHOD__ . ': using numeric value for parameter type is deprecated. Use string code instead.', LOG_WARNING);
5100
+			dol_syslog(__METHOD__.': using numeric value for parameter type is deprecated. Use string code instead.', LOG_WARNING);
5101 5101
 		}
5102 5102
 
5103 5103
 		if ($type === Categorie::TYPE_BANK_LINE) {
5104 5104
 			// TODO Move this into common category feature
5105 5105
 			$cate_arbo = array();
5106 5106
 			$sql = "SELECT c.label, c.rowid";
5107
-			$sql .= " FROM " . $this->db->prefix() . "bank_categ as c";
5108
-			$sql .= " WHERE entity = " . $conf->entity;
5107
+			$sql .= " FROM ".$this->db->prefix()."bank_categ as c";
5108
+			$sql .= " WHERE entity = ".$conf->entity;
5109 5109
 			$sql .= " ORDER BY c.label";
5110 5110
 			$result = $this->db->query($sql);
5111 5111
 			if ($result) {
@@ -5130,10 +5130,10 @@  discard block
 block discarded – undo
5130 5130
 		$outarray = array();
5131 5131
 		$outarrayrichhtml = array();
5132 5132
 
5133
-		$output = '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
5133
+		$output = '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
5134 5134
 		if (is_array($cate_arbo)) {
5135 5135
 			if (!count($cate_arbo)) {
5136
-				$output .= '<option value="-1" disabled>' . $langs->trans("NoCategoriesDefined") . '</option>';
5136
+				$output .= '<option value="-1" disabled>'.$langs->trans("NoCategoriesDefined").'</option>';
5137 5137
 			} else {
5138 5138
 				$output .= '<option value="-1">&nbsp;</option>';
5139 5139
 				foreach ($cate_arbo as $key => $value) {
@@ -5143,15 +5143,15 @@  discard block
 block discarded – undo
5143 5143
 						$add = '';
5144 5144
 					}
5145 5145
 
5146
-					$labeltoshow = img_picto('', 'category', 'class="pictofixedwidth" style="color: #' . $cate_arbo[$key]['color'] . '"');
5146
+					$labeltoshow = img_picto('', 'category', 'class="pictofixedwidth" style="color: #'.$cate_arbo[$key]['color'].'"');
5147 5147
 					$labeltoshow .= dol_trunc($cate_arbo[$key]['fulllabel'], $maxlength, 'middle');
5148 5148
 
5149 5149
 					$outarray[$cate_arbo[$key]['id']] = $cate_arbo[$key]['fulllabel'];
5150 5150
 
5151 5151
 					$outarrayrichhtml[$cate_arbo[$key]['id']] = $labeltoshow;
5152 5152
 
5153
-					$output .= '<option ' . $add . 'value="' . $cate_arbo[$key]['id'] . '"';
5154
-					$output .= ' data-html="' . dol_escape_htmltag($labeltoshow) . '"';
5153
+					$output .= '<option '.$add.'value="'.$cate_arbo[$key]['id'].'"';
5154
+					$output .= ' data-html="'.dol_escape_htmltag($labeltoshow).'"';
5155 5155
 					$output .= '>';
5156 5156
 					$output .= dol_trunc($cate_arbo[$key]['fulllabel'], $maxlength, 'middle');
5157 5157
 					$output .= '</option>';
@@ -5192,7 +5192,7 @@  discard block
 block discarded – undo
5192 5192
 	public function form_confirm($page, $title, $question, $action, $formquestion = array(), $selectedchoice = "", $useajax = 0, $height = 170, $width = 500)
5193 5193
 	{
5194 5194
 		// phpcs:enable
5195
-		dol_syslog(__METHOD__ . ': using form_confirm is deprecated. Use formconfim instead.', LOG_WARNING);
5195
+		dol_syslog(__METHOD__.': using form_confirm is deprecated. Use formconfim instead.', LOG_WARNING);
5196 5196
 		print $this->formconfirm($page, $title, $question, $action, $formquestion, $selectedchoice, $useajax, $height, $width);
5197 5197
 	}
5198 5198
 
@@ -5227,7 +5227,7 @@  discard block
 block discarded – undo
5227 5227
 	{
5228 5228
 		global $langs, $conf;
5229 5229
 
5230
-		$more = '<!-- formconfirm - before call, page=' . dol_escape_htmltag($page) . ' -->';
5230
+		$more = '<!-- formconfirm - before call, page='.dol_escape_htmltag($page).' -->';
5231 5231
 		$formconfirm = '';
5232 5232
 		$inputok = array();
5233 5233
 		$inputko = array();
@@ -5251,27 +5251,27 @@  discard block
 block discarded – undo
5251 5251
 			foreach ($formquestion as $key => $input) {
5252 5252
 				if (is_array($input) && !empty($input)) {
5253 5253
 					if ($input['type'] == 'hidden') {
5254
-						$moreattr = (!empty($input['moreattr']) ? ' ' . $input['moreattr'] : '');
5255
-						$morecss = (!empty($input['morecss']) ? ' ' . $input['morecss'] : '');
5254
+						$moreattr = (!empty($input['moreattr']) ? ' '.$input['moreattr'] : '');
5255
+						$morecss = (!empty($input['morecss']) ? ' '.$input['morecss'] : '');
5256 5256
 
5257
-						$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";
5257
+						$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";
5258 5258
 					}
5259 5259
 				}
5260 5260
 			}
5261 5261
 
5262 5262
 			// Now add questions
5263 5263
 			$moreonecolumn = '';
5264
-			$more .= '<div class="tagtable paddingtopbottomonly centpercent noborderspacing">' . "\n";
5264
+			$more .= '<div class="tagtable paddingtopbottomonly centpercent noborderspacing">'."\n";
5265 5265
 			foreach ($formquestion as $key => $input) {
5266 5266
 				if (is_array($input) && !empty($input)) {
5267
-					$size = (!empty($input['size']) ? ' size="' . $input['size'] . '"' : '');    // deprecated. Use morecss instead.
5268
-					$moreattr = (!empty($input['moreattr']) ? ' ' . $input['moreattr'] : '');
5269
-					$morecss = (!empty($input['morecss']) ? ' ' . $input['morecss'] : '');
5267
+					$size = (!empty($input['size']) ? ' size="'.$input['size'].'"' : ''); // deprecated. Use morecss instead.
5268
+					$moreattr = (!empty($input['moreattr']) ? ' '.$input['moreattr'] : '');
5269
+					$morecss = (!empty($input['morecss']) ? ' '.$input['morecss'] : '');
5270 5270
 
5271 5271
 					if ($input['type'] == 'text') {
5272
-						$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";
5272
+						$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";
5273 5273
 					} elseif ($input['type'] == 'password') {
5274
-						$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";
5274
+						$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";
5275 5275
 					} elseif ($input['type'] == 'textarea') {
5276 5276
 						/*$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div><div class="tagtd">';
5277 5277
 						$more .= '<textarea name="'.$input['name'].'" class="'.$morecss.'"'.$moreattr.'>';
@@ -5279,8 +5279,8 @@  discard block
 block discarded – undo
5279 5279
 						$more .= '</textarea>';
5280 5280
 						$more .= '</div></div>'."\n";*/
5281 5281
 						$moreonecolumn .= '<div class="margintoponly">';
5282
-						$moreonecolumn .= $input['label'] . '<br>';
5283
-						$moreonecolumn .= '<textarea name="' . dol_escape_htmltag($input['name']) . '" id="' . dol_escape_htmltag($input['name']) . '" class="' . $morecss . '"' . $moreattr . '>';
5282
+						$moreonecolumn .= $input['label'].'<br>';
5283
+						$moreonecolumn .= '<textarea name="'.dol_escape_htmltag($input['name']).'" id="'.dol_escape_htmltag($input['name']).'" class="'.$morecss.'"'.$moreattr.'>';
5284 5284
 						$moreonecolumn .= $input['value'];
5285 5285
 						$moreonecolumn .= '</textarea>';
5286 5286
 						$moreonecolumn .= '</div>';
@@ -5297,20 +5297,20 @@  discard block
 block discarded – undo
5297 5297
 						$disabled = isset($input['select_disabled']) ? $input['select_disabled'] : 0;
5298 5298
 						$sort = isset($input['select_sort']) ? $input['select_sort'] : '';
5299 5299
 
5300
-						$more .= '<div class="tagtr"><div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '">';
5300
+						$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">';
5301 5301
 						if (!empty($input['label'])) {
5302
-							$more .= $input['label'] . '</div><div class="tagtd left">';
5302
+							$more .= $input['label'].'</div><div class="tagtd left">';
5303 5303
 						}
5304 5304
 						if ($input['type'] == 'select') {
5305 5305
 							$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);
5306 5306
 						} else {
5307 5307
 							$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);
5308 5308
 						}
5309
-						$more .= '</div></div>' . "\n";
5309
+						$more .= '</div></div>'."\n";
5310 5310
 					} elseif ($input['type'] == 'checkbox') {
5311 5311
 						$more .= '<div class="tagtr">';
5312
-						$more .= '<div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '"><label for="' . dol_escape_htmltag($input['name']) . '">' . $input['label'] . '</label></div><div class="tagtd">';
5313
-						$more .= '<input type="checkbox" class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . dol_escape_htmltag($input['name']) . '" name="' . dol_escape_htmltag($input['name']) . '"' . $moreattr;
5312
+						$more .= '<div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'"><label for="'.dol_escape_htmltag($input['name']).'">'.$input['label'].'</label></div><div class="tagtd">';
5313
+						$more .= '<input type="checkbox" class="flat'.($morecss ? ' '.$morecss : '').'" id="'.dol_escape_htmltag($input['name']).'" name="'.dol_escape_htmltag($input['name']).'"'.$moreattr;
5314 5314
 						if (!is_bool($input['value']) && $input['value'] != 'false' && $input['value'] != '0' && $input['value'] != '') {
5315 5315
 							$more .= ' checked';
5316 5316
 						}
@@ -5321,19 +5321,19 @@  discard block
 block discarded – undo
5321 5321
 							$more .= ' disabled';
5322 5322
 						}
5323 5323
 						$more .= ' /></div>';
5324
-						$more .= '</div>' . "\n";
5324
+						$more .= '</div>'."\n";
5325 5325
 					} elseif ($input['type'] == 'radio') {
5326 5326
 						$i = 0;
5327 5327
 						foreach ($input['values'] as $selkey => $selval) {
5328 5328
 							$more .= '<div class="tagtr">';
5329 5329
 							if (isset($input['label'])) {
5330 5330
 								if ($i == 0) {
5331
-									$more .= '<div class="tagtd' . (empty($input['tdclass']) ? ' tdtop' : (' tdtop ' . $input['tdclass'])) . '">' . $input['label'] . '</div>';
5331
+									$more .= '<div class="tagtd'.(empty($input['tdclass']) ? ' tdtop' : (' tdtop '.$input['tdclass'])).'">'.$input['label'].'</div>';
5332 5332
 								} else {
5333
-									$more .= '<div clas="tagtd' . (empty($input['tdclass']) ? '' : (' "' . $input['tdclass'])) . '">&nbsp;</div>';
5333
+									$more .= '<div clas="tagtd'.(empty($input['tdclass']) ? '' : (' "'.$input['tdclass'])).'">&nbsp;</div>';
5334 5334
 								}
5335 5335
 							}
5336
-							$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;
5336
+							$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;
5337 5337
 							if (!empty($input['disabled'])) {
5338 5338
 								$more .= ' disabled';
5339 5339
 							}
@@ -5341,12 +5341,12 @@  discard block
 block discarded – undo
5341 5341
 								$more .= ' checked="checked"';
5342 5342
 							}
5343 5343
 							$more .= ' /> ';
5344
-							$more .= '<label for="' . dol_escape_htmltag($input['name'] . $selkey) . '" class="valignmiddle">' . $selval . '</label>';
5345
-							$more .= '</div></div>' . "\n";
5344
+							$more .= '<label for="'.dol_escape_htmltag($input['name'].$selkey).'" class="valignmiddle">'.$selval.'</label>';
5345
+							$more .= '</div></div>'."\n";
5346 5346
 							$i++;
5347 5347
 						}
5348 5348
 					} elseif ($input['type'] == 'date' || $input['type'] == 'datetime') {
5349
-						$more .= '<div class="tagtr"><div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '">' . $input['label'] . '</div>';
5349
+						$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div>';
5350 5350
 						$more .= '<div class="tagtd">';
5351 5351
 						$addnowlink = (empty($input['datenow']) ? 0 : 1);
5352 5352
 						$h = $m = 0;
@@ -5364,24 +5364,24 @@  discard block
 block discarded – undo
5364 5364
 					} elseif ($input['type'] == 'other') { // can be 1 column or 2 depending if label is set or not
5365 5365
 						$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">';
5366 5366
 						if (!empty($input['label'])) {
5367
-							$more .= $input['label'] . '</div><div class="tagtd">';
5367
+							$more .= $input['label'].'</div><div class="tagtd">';
5368 5368
 						}
5369 5369
 						$more .= $input['value'];
5370
-						$more .= '</div></div>' . "\n";
5370
+						$more .= '</div></div>'."\n";
5371 5371
 					} elseif ($input['type'] == 'onecolumn') {
5372 5372
 						$moreonecolumn .= '<div class="margintoponly">';
5373 5373
 						$moreonecolumn .= $input['value'];
5374
-						$moreonecolumn .= '</div>' . "\n";
5374
+						$moreonecolumn .= '</div>'."\n";
5375 5375
 					} elseif ($input['type'] == 'hidden') {
5376 5376
 						// Do nothing more, already added by a previous loop
5377 5377
 					} elseif ($input['type'] == 'separator') {
5378 5378
 						$more .= '<br>';
5379 5379
 					} else {
5380
-						$more .= 'Error type ' . $input['type'] . ' for the confirm box is not a supported type';
5380
+						$more .= 'Error type '.$input['type'].' for the confirm box is not a supported type';
5381 5381
 					}
5382 5382
 				}
5383 5383
 			}
5384
-			$more .= '</div>' . "\n";
5384
+			$more .= '</div>'."\n";
5385 5385
 			$more .= $moreonecolumn;
5386 5386
 		}
5387 5387
 
@@ -5403,10 +5403,10 @@  discard block
 block discarded – undo
5403 5403
 				$button = $useajax;
5404 5404
 				$useajax = 1;
5405 5405
 				$autoOpen = false;
5406
-				$dialogconfirm .= '-' . $button;
5406
+				$dialogconfirm .= '-'.$button;
5407 5407
 			}
5408
-			$pageyes = $page . (preg_match('/\?/', $page) ? '&' : '?') . 'action=' . urlencode($action) . '&confirm=yes';
5409
-			$pageno = ($useajax == 2 ? $page . (preg_match('/\?/', $page) ? '&' : '?') . 'action=' . urlencode($action) . '&confirm=no' : '');
5408
+			$pageyes = $page.(preg_match('/\?/', $page) ? '&' : '?').'action='.urlencode($action).'&confirm=yes';
5409
+			$pageno = ($useajax == 2 ? $page.(preg_match('/\?/', $page) ? '&' : '?').'action='.urlencode($action).'&confirm=no' : '');
5410 5410
 
5411 5411
 			// Add input fields into list of fields to read during submit (inputok and inputko)
5412 5412
 			if (is_array($formquestion)) {
@@ -5428,24 +5428,24 @@  discard block
 block discarded – undo
5428 5428
 			}
5429 5429
 
5430 5430
 			// Show JQuery confirm box.
5431
-			$formconfirm .= '<div id="' . $dialogconfirm . '" title="' . dol_escape_htmltag($title) . '" style="display: none;">';
5431
+			$formconfirm .= '<div id="'.$dialogconfirm.'" title="'.dol_escape_htmltag($title).'" style="display: none;">';
5432 5432
 			if (is_array($formquestion) && !empty($formquestion['text'])) {
5433
-				$formconfirm .= '<div class="confirmtext">' . $formquestion['text'] . '</div>' . "\n";
5433
+				$formconfirm .= '<div class="confirmtext">'.$formquestion['text'].'</div>'."\n";
5434 5434
 			}
5435 5435
 			if (!empty($more)) {
5436
-				$formconfirm .= '<div class="confirmquestions">' . $more . '</div>' . "\n";
5436
+				$formconfirm .= '<div class="confirmquestions">'.$more.'</div>'."\n";
5437 5437
 			}
5438
-			$formconfirm .= ($question ? '<div class="confirmmessage">' . img_help('', '') . ' ' . $question . '</div>' : '');
5439
-			$formconfirm .= '</div>' . "\n";
5438
+			$formconfirm .= ($question ? '<div class="confirmmessage">'.img_help('', '').' '.$question.'</div>' : '');
5439
+			$formconfirm .= '</div>'."\n";
5440 5440
 
5441
-			$formconfirm .= "\n<!-- begin code of popup for formconfirm page=" . $page . " -->\n";
5442
-			$formconfirm .= '<script nonce="' . getNonce() . '" type="text/javascript">' . "\n";
5441
+			$formconfirm .= "\n<!-- begin code of popup for formconfirm page=".$page." -->\n";
5442
+			$formconfirm .= '<script nonce="'.getNonce().'" type="text/javascript">'."\n";
5443 5443
 			$formconfirm .= "/* Code for the jQuery('#dialogforpopup').dialog() */\n";
5444 5444
 			$formconfirm .= 'jQuery(document).ready(function() {
5445 5445
             $(function() {
5446
-            	$( "#' . $dialogconfirm . '" ).dialog(
5446
+            	$( "#' . $dialogconfirm.'" ).dialog(
5447 5447
             	{
5448
-                    autoOpen: ' . ($autoOpen ? "true" : "false") . ',';
5448
+                    autoOpen: ' . ($autoOpen ? "true" : "false").',';
5449 5449
 			if ($newselectedchoice == 'no') {
5450 5450
 				$formconfirm .= '
5451 5451
 						open: function() {
@@ -5455,24 +5455,24 @@  discard block
 block discarded – undo
5455 5455
 
5456 5456
 			$jsforcursor = '';
5457 5457
 			if ($useajax == 1) {
5458
-				$jsforcursor = '// The call to urljump can be slow, so we set the wait cursor' . "\n";
5459
-				$jsforcursor .= 'jQuery("html,body,#id-container").addClass("cursorwait");' . "\n";
5458
+				$jsforcursor = '// The call to urljump can be slow, so we set the wait cursor'."\n";
5459
+				$jsforcursor .= 'jQuery("html,body,#id-container").addClass("cursorwait");'."\n";
5460 5460
 			}
5461 5461
 
5462 5462
 			$postconfirmas = 'GET';
5463 5463
 
5464 5464
 			$formconfirm .= '
5465 5465
                     resizable: false,
5466
-                    height: "' . $height . '",
5467
-                    width: "' . $width . '",
5466
+                    height: "' . $height.'",
5467
+                    width: "' . $width.'",
5468 5468
                     modal: true,
5469 5469
                     closeOnEscape: false,
5470 5470
                     buttons: {
5471
-                        "' . dol_escape_js($langs->transnoentities($labelbuttonyes)) . '": function() {
5472
-							var options = "token=' . urlencode(newToken()) . '";
5473
-                        	var inputok = ' . json_encode($inputok) . ';	/* List of fields into form */
5474
-							var page = "' . dol_escape_js(!empty($page) ? $page : '') . '";
5475
-                         	var pageyes = "' . dol_escape_js(!empty($pageyes) ? $pageyes : '') . '";
5471
+                        "' . dol_escape_js($langs->transnoentities($labelbuttonyes)).'": function() {
5472
+							var options = "token=' . urlencode(newToken()).'";
5473
+                        	var inputok = ' . json_encode($inputok).';	/* List of fields into form */
5474
+							var page = "' . dol_escape_js(!empty($page) ? $page : '').'";
5475
+                         	var pageyes = "' . dol_escape_js(!empty($pageyes) ? $pageyes : '').'";
5476 5476
 
5477 5477
                          	if (inputok.length > 0) {
5478 5478
                          		$.each(inputok, function(i, inputname) {
@@ -5506,11 +5506,11 @@  discard block
 block discarded – undo
5506 5506
 							}
5507 5507
 	                        $(this).dialog("close");
5508 5508
                         },
5509
-                        "' . dol_escape_js($langs->transnoentities($labelbuttonno)) . '": function() {
5510
-                        	var options = "token=' . urlencode(newToken()) . '";
5511
-                         	var inputko = ' . json_encode($inputko) . ';	/* List of fields into form */
5512
-							var page = "' . dol_escape_js(!empty($page) ? $page : '') . '";
5513
-                         	var pageno="' . dol_escape_js(!empty($pageno) ? $pageno : '') . '";
5509
+                        "' . dol_escape_js($langs->transnoentities($labelbuttonno)).'": function() {
5510
+                        	var options = "token=' . urlencode(newToken()).'";
5511
+                         	var inputko = ' . json_encode($inputko).';	/* List of fields into form */
5512
+							var page = "' . dol_escape_js(!empty($page) ? $page : '').'";
5513
+                         	var pageno="' . dol_escape_js(!empty($pageno) ? $pageno : '').'";
5514 5514
                          	if (inputko.length > 0) {
5515 5515
                          		$.each(inputko, function(i, inputname) {
5516 5516
                          			var more = "";
@@ -5542,10 +5542,10 @@  discard block
 block discarded – undo
5542 5542
                 }
5543 5543
                 );
5544 5544
 
5545
-            	var button = "' . $button . '";
5545
+            	var button = "' . $button.'";
5546 5546
             	if (button.length > 0) {
5547 5547
                 	$( "#" + button ).click(function() {
5548
-                		$("#' . $dialogconfirm . '").dialog("open");
5548
+                		$("#' . $dialogconfirm.'").dialog("open");
5549 5549
         			});
5550 5550
                 }
5551 5551
             });
@@ -5553,44 +5553,44 @@  discard block
 block discarded – undo
5553 5553
             </script>';
5554 5554
 			$formconfirm .= "<!-- end ajax formconfirm -->\n";
5555 5555
 		} else {
5556
-			$formconfirm .= "\n<!-- begin formconfirm page=" . dol_escape_htmltag($page) . " -->\n";
5556
+			$formconfirm .= "\n<!-- begin formconfirm page=".dol_escape_htmltag($page)." -->\n";
5557 5557
 
5558 5558
 			if (empty($disableformtag)) {
5559
-				$formconfirm .= '<form method="POST" action="' . $page . '" class="notoptoleftroright">' . "\n";
5559
+				$formconfirm .= '<form method="POST" action="'.$page.'" class="notoptoleftroright">'."\n";
5560 5560
 			}
5561 5561
 
5562
-			$formconfirm .= '<input type="hidden" name="action" value="' . $action . '">' . "\n";
5563
-			$formconfirm .= '<input type="hidden" name="token" value="' . newToken() . '">' . "\n";
5562
+			$formconfirm .= '<input type="hidden" name="action" value="'.$action.'">'."\n";
5563
+			$formconfirm .= '<input type="hidden" name="token" value="'.newToken().'">'."\n";
5564 5564
 
5565
-			$formconfirm .= '<table class="valid centpercent">' . "\n";
5565
+			$formconfirm .= '<table class="valid centpercent">'."\n";
5566 5566
 
5567 5567
 			// Line title
5568 5568
 			$formconfirm .= '<tr class="validtitre"><td class="validtitre" colspan="2">';
5569
-			$formconfirm .= img_picto('', 'pictoconfirm') . ' ' . $title;
5570
-			$formconfirm .= '</td></tr>' . "\n";
5569
+			$formconfirm .= img_picto('', 'pictoconfirm').' '.$title;
5570
+			$formconfirm .= '</td></tr>'."\n";
5571 5571
 
5572 5572
 			// Line text
5573 5573
 			if (is_array($formquestion) && !empty($formquestion['text'])) {
5574
-				$formconfirm .= '<tr class="valid"><td class="valid" colspan="2">' . $formquestion['text'] . '</td></tr>' . "\n";
5574
+				$formconfirm .= '<tr class="valid"><td class="valid" colspan="2">'.$formquestion['text'].'</td></tr>'."\n";
5575 5575
 			}
5576 5576
 
5577 5577
 			// Line form fields
5578 5578
 			if ($more) {
5579
-				$formconfirm .= '<tr class="valid"><td class="valid" colspan="2">' . "\n";
5579
+				$formconfirm .= '<tr class="valid"><td class="valid" colspan="2">'."\n";
5580 5580
 				$formconfirm .= $more;
5581
-				$formconfirm .= '</td></tr>' . "\n";
5581
+				$formconfirm .= '</td></tr>'."\n";
5582 5582
 			}
5583 5583
 
5584 5584
 			// Line with question
5585 5585
 			$formconfirm .= '<tr class="valid">';
5586
-			$formconfirm .= '<td class="valid">' . $question . '</td>';
5586
+			$formconfirm .= '<td class="valid">'.$question.'</td>';
5587 5587
 			$formconfirm .= '<td class="valid center">';
5588 5588
 			$formconfirm .= $this->selectyesno("confirm", $newselectedchoice, 0, false, 0, 0, 'marginleftonly marginrightonly', $labelbuttonyes, $labelbuttonno);
5589
-			$formconfirm .= '<input class="button valignmiddle confirmvalidatebutton small" type="submit" value="' . $langs->trans("Validate") . '">';
5589
+			$formconfirm .= '<input class="button valignmiddle confirmvalidatebutton small" type="submit" value="'.$langs->trans("Validate").'">';
5590 5590
 			$formconfirm .= '</td>';
5591
-			$formconfirm .= '</tr>' . "\n";
5591
+			$formconfirm .= '</tr>'."\n";
5592 5592
 
5593
-			$formconfirm .= '</table>' . "\n";
5593
+			$formconfirm .= '</table>'."\n";
5594 5594
 
5595 5595
 			if (empty($disableformtag)) {
5596 5596
 				$formconfirm .= "</form>\n";
@@ -5599,7 +5599,7 @@  discard block
 block discarded – undo
5599 5599
 
5600 5600
 			if (!empty($conf->use_javascript_ajax)) {
5601 5601
 				$formconfirm .= '<!-- code to disable button to avoid double clic -->';
5602
-				$formconfirm .= '<script nonce="' . getNonce() . '" type="text/javascript">' . "\n";
5602
+				$formconfirm .= '<script nonce="'.getNonce().'" type="text/javascript">'."\n";
5603 5603
 				$formconfirm .= '
5604 5604
 				$(document).ready(function () {
5605 5605
 					$(".confirmvalidatebutton").on("click", function() {
@@ -5611,7 +5611,7 @@  discard block
 block discarded – undo
5611 5611
 					});
5612 5612
 				});
5613 5613
 				';
5614
-				$formconfirm .= '</script>' . "\n";
5614
+				$formconfirm .= '</script>'."\n";
5615 5615
 			}
5616 5616
 
5617 5617
 			$formconfirm .= "<!-- end formconfirm -->\n";
@@ -5643,8 +5643,8 @@  discard block
 block discarded – undo
5643 5643
 		// phpcs:enable
5644 5644
 		global $langs;
5645 5645
 
5646
-		require_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php';
5647
-		require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php';
5646
+		require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
5647
+		require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
5648 5648
 
5649 5649
 		$out = '';
5650 5650
 
@@ -5652,11 +5652,11 @@  discard block
 block discarded – undo
5652 5652
 
5653 5653
 		$langs->load("project");
5654 5654
 		if ($htmlname != "none") {
5655
-			$out .= '<form method="post" action="' . $page . '">';
5655
+			$out .= '<form method="post" action="'.$page.'">';
5656 5656
 			$out .= '<input type="hidden" name="action" value="classin">';
5657
-			$out .= '<input type="hidden" name="token" value="' . newToken() . '">';
5657
+			$out .= '<input type="hidden" name="token" value="'.newToken().'">';
5658 5658
 			$out .= $formproject->select_projects($socid, $selected, $htmlname, $maxlength, 0, 1, $discard_closed, $forcefocus, 0, 0, '', 1, 0, $morecss);
5659
-			$out .= '<input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '">';
5659
+			$out .= '<input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">';
5660 5660
 			$out .= '</form>';
5661 5661
 		} else {
5662 5662
 			$out .= '<span class="project_head_block">';
@@ -5665,7 +5665,7 @@  discard block
 block discarded – undo
5665 5665
 				$projet->fetch($selected);
5666 5666
 				$out .= $projet->getNomUrl(0, '', 1);
5667 5667
 			} else {
5668
-				$out .= '<span class="opacitymedium">' . $textifnoproject . '</span>';
5668
+				$out .= '<span class="opacitymedium">'.$textifnoproject.'</span>';
5669 5669
 			}
5670 5670
 			$out .= '</span>';
5671 5671
 		}
@@ -5702,14 +5702,14 @@  discard block
 block discarded – undo
5702 5702
 		$out = '';
5703 5703
 
5704 5704
 		if ($htmlname != "none") {
5705
-			$out .= '<form method="POST" action="' . $page . '">';
5705
+			$out .= '<form method="POST" action="'.$page.'">';
5706 5706
 			$out .= '<input type="hidden" name="action" value="setconditions">';
5707
-			$out .= '<input type="hidden" name="token" value="' . newToken() . '">';
5707
+			$out .= '<input type="hidden" name="token" value="'.newToken().'">';
5708 5708
 			if ($type) {
5709
-				$out .= '<input type="hidden" name="type" value="' . dol_escape_htmltag($type) . '">';
5709
+				$out .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">';
5710 5710
 			}
5711 5711
 			$out .= $this->getSelectConditionsPaiements($selected, $htmlname, $filtertype, $addempty, 0, '', $deposit_percent);
5712
-			$out .= '<input type="submit" class="button valignmiddle smallpaddingimp" value="' . $langs->trans("Modify") . '">';
5712
+			$out .= '<input type="submit" class="button valignmiddle smallpaddingimp" value="'.$langs->trans("Modify").'">';
5713 5713
 			$out .= '</form>';
5714 5714
 		} else {
5715 5715
 			if ($selected) {
@@ -5754,12 +5754,12 @@  discard block
 block discarded – undo
5754 5754
 		// phpcs:enable
5755 5755
 		global $langs;
5756 5756
 		if ($htmlname != "none") {
5757
-			print '<form method="post" action="' . $page . '">';
5757
+			print '<form method="post" action="'.$page.'">';
5758 5758
 			print '<input type="hidden" name="action" value="setavailability">';
5759
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
5759
+			print '<input type="hidden" name="token" value="'.newToken().'">';
5760 5760
 			$this->selectAvailabilityDelay($selected, $htmlname, -1, $addempty);
5761
-			print '<input type="submit" name="modify" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '">';
5762
-			print '<input type="submit" name="cancel" class="button smallpaddingimp" value="' . $langs->trans("Cancel") . '">';
5761
+			print '<input type="submit" name="modify" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">';
5762
+			print '<input type="submit" name="cancel" class="button smallpaddingimp" value="'.$langs->trans("Cancel").'">';
5763 5763
 			print '</form>';
5764 5764
 		} else {
5765 5765
 			if ($selected) {
@@ -5785,11 +5785,11 @@  discard block
 block discarded – undo
5785 5785
 	{
5786 5786
 		global $langs;
5787 5787
 		if ($htmlname != "none") {
5788
-			print '<form method="post" action="' . $page . '">';
5788
+			print '<form method="post" action="'.$page.'">';
5789 5789
 			print '<input type="hidden" name="action" value="setdemandreason">';
5790
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
5790
+			print '<input type="hidden" name="token" value="'.newToken().'">';
5791 5791
 			$this->selectInputReason($selected, $htmlname, -1, $addempty);
5792
-			print '<input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '">';
5792
+			print '<input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">';
5793 5793
 			print '</form>';
5794 5794
 		} else {
5795 5795
 			if ($selected) {
@@ -5829,17 +5829,17 @@  discard block
 block discarded – undo
5829 5829
 		$ret = '';
5830 5830
 
5831 5831
 		if ($htmlname != "none") {
5832
-			$ret .= '<form method="POST" action="' . $page . '" name="form' . $htmlname . '">';
5833
-			$ret .= '<input type="hidden" name="action" value="set' . $htmlname . '">';
5834
-			$ret .= '<input type="hidden" name="token" value="' . newToken() . '">';
5832
+			$ret .= '<form method="POST" action="'.$page.'" name="form'.$htmlname.'">';
5833
+			$ret .= '<input type="hidden" name="action" value="set'.$htmlname.'">';
5834
+			$ret .= '<input type="hidden" name="token" value="'.newToken().'">';
5835 5835
 			if ($type) {
5836
-				$ret .= '<input type="hidden" name="type" value="' . dol_escape_htmltag($type) . '">';
5836
+				$ret .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">';
5837 5837
 			}
5838 5838
 			$ret .= '<table class="nobordernopadding">';
5839 5839
 			$ret .= '<tr><td>';
5840
-			$ret .= $this->selectDate($selected, $htmlname, $displayhour, $displaymin, 1, 'form' . $htmlname, 1, 0);
5840
+			$ret .= $this->selectDate($selected, $htmlname, $displayhour, $displaymin, 1, 'form'.$htmlname, 1, 0);
5841 5841
 			$ret .= '</td>';
5842
-			$ret .= '<td class="left"><input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '"></td>';
5842
+			$ret .= '<td class="left"><input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'"></td>';
5843 5843
 			$ret .= '</tr></table></form>';
5844 5844
 		} else {
5845 5845
 			if ($displayhour) {
@@ -5874,15 +5874,15 @@  discard block
 block discarded – undo
5874 5874
 		global $langs;
5875 5875
 
5876 5876
 		if ($htmlname != "none") {
5877
-			print '<form method="POST" action="' . $page . '" name="form' . $htmlname . '">';
5878
-			print '<input type="hidden" name="action" value="set' . $htmlname . '">';
5879
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
5877
+			print '<form method="POST" action="'.$page.'" name="form'.$htmlname.'">';
5878
+			print '<input type="hidden" name="action" value="set'.$htmlname.'">';
5879
+			print '<input type="hidden" name="token" value="'.newToken().'">';
5880 5880
 			print $this->select_dolusers($selected, $htmlname, 1, $exclude, 0, $include);
5881
-			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
5881
+			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
5882 5882
 			print '</form>';
5883 5883
 		} else {
5884 5884
 			if ($selected) {
5885
-				require_once DOL_DOCUMENT_ROOT . '/user/class/user.class.php';
5885
+				require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
5886 5886
 				$theuser = new User($this->db);
5887 5887
 				$theuser->fetch($selected);
5888 5888
 				print $theuser->getNomUrl(1);
@@ -5915,14 +5915,14 @@  discard block
 block discarded – undo
5915 5915
 
5916 5916
 		$out = '';
5917 5917
 		if ($htmlname != "none") {
5918
-			$out .= '<form method="POST" action="' . $page . '">';
5918
+			$out .= '<form method="POST" action="'.$page.'">';
5919 5919
 			$out .= '<input type="hidden" name="action" value="setmode">';
5920
-			$out .= '<input type="hidden" name="token" value="' . newToken() . '">';
5920
+			$out .= '<input type="hidden" name="token" value="'.newToken().'">';
5921 5921
 			if ($type) {
5922
-				$out .= '<input type="hidden" name="type" value="' . dol_escape_htmltag($type) . '">';
5922
+				$out .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">';
5923 5923
 			}
5924 5924
 			$out .= $this->select_types_paiements($selected, $htmlname, $filtertype, 0, $addempty, 0, 0, $active, '', 1);
5925
-			$out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
5925
+			$out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
5926 5926
 			$out .= '</form>';
5927 5927
 		} else {
5928 5928
 			if ($selected) {
@@ -5955,11 +5955,11 @@  discard block
 block discarded – undo
5955 5955
 	{
5956 5956
 		global $langs;
5957 5957
 		if ($htmlname != "none") {
5958
-			print '<form method="POST" action="' . $page . '">';
5958
+			print '<form method="POST" action="'.$page.'">';
5959 5959
 			print '<input type="hidden" name="action" value="settransportmode">';
5960
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
5960
+			print '<input type="hidden" name="token" value="'.newToken().'">';
5961 5961
 			$this->selectTransportMode($selected, $htmlname, 0, $addempty, 0, 0, $active);
5962
-			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
5962
+			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
5963 5963
 			print '</form>';
5964 5964
 		} else {
5965 5965
 			if ($selected) {
@@ -5986,11 +5986,11 @@  discard block
 block discarded – undo
5986 5986
 		// phpcs:enable
5987 5987
 		global $langs;
5988 5988
 		if ($htmlname != "none") {
5989
-			print '<form method="POST" action="' . $page . '">';
5989
+			print '<form method="POST" action="'.$page.'">';
5990 5990
 			print '<input type="hidden" name="action" value="setmulticurrencycode">';
5991
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
5991
+			print '<input type="hidden" name="token" value="'.newToken().'">';
5992 5992
 			print $this->selectMultiCurrency($selected, $htmlname, 0);
5993
-			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
5993
+			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
5994 5994
 			print '</form>';
5995 5995
 		} else {
5996 5996
 			dol_include_once('/core/lib/company.lib.php');
@@ -6015,21 +6015,21 @@  discard block
 block discarded – undo
6015 6015
 		global $langs, $mysoc, $conf;
6016 6016
 
6017 6017
 		if ($htmlname != "none") {
6018
-			print '<form method="POST" action="' . $page . '">';
6018
+			print '<form method="POST" action="'.$page.'">';
6019 6019
 			print '<input type="hidden" name="action" value="setmulticurrencyrate">';
6020
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
6021
-			print '<input type="text" class="maxwidth100" name="' . $htmlname . '" value="' . (!empty($rate) ? price(price2num($rate, 'CU')) : 1) . '" /> ';
6020
+			print '<input type="hidden" name="token" value="'.newToken().'">';
6021
+			print '<input type="text" class="maxwidth100" name="'.$htmlname.'" value="'.(!empty($rate) ? price(price2num($rate, 'CU')) : 1).'" /> ';
6022 6022
 			print '<select name="calculation_mode">';
6023
-			print '<option value="1">Change ' . $langs->trans("PriceUHT") . ' of lines</option>';
6024
-			print '<option value="2">Change ' . $langs->trans("PriceUHTCurrency") . ' of lines</option>';
6023
+			print '<option value="1">Change '.$langs->trans("PriceUHT").' of lines</option>';
6024
+			print '<option value="2">Change '.$langs->trans("PriceUHTCurrency").' of lines</option>';
6025 6025
 			print '</select> ';
6026
-			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
6026
+			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
6027 6027
 			print '</form>';
6028 6028
 		} else {
6029 6029
 			if (!empty($rate)) {
6030 6030
 				print price($rate, 1, $langs, 1, 0);
6031 6031
 				if ($currency && $rate != 1) {
6032
-					print ' &nbsp; (' . price($rate, 1, $langs, 1, 0) . ' ' . $currency . ' = 1 ' . $conf->currency . ')';
6032
+					print ' &nbsp; ('.price($rate, 1, $langs, 1, 0).' '.$currency.' = 1 '.$conf->currency.')';
6033 6033
 				}
6034 6034
 			} else {
6035 6035
 				print 1;
@@ -6060,9 +6060,9 @@  discard block
 block discarded – undo
6060 6060
 		// phpcs:enable
6061 6061
 		global $conf, $langs;
6062 6062
 		if ($htmlname != "none") {
6063
-			print '<form method="post" action="' . $page . '">';
6063
+			print '<form method="post" action="'.$page.'">';
6064 6064
 			print '<input type="hidden" name="action" value="setabsolutediscount">';
6065
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
6065
+			print '<input type="hidden" name="token" value="'.newToken().'">';
6066 6066
 			print '<div class="inline-block">';
6067 6067
 			if (!empty($discount_type)) {
6068 6068
 				if (getDolGlobalString('FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS')) {
@@ -6100,24 +6100,24 @@  discard block
 block discarded – undo
6100 6100
 			print '</div>';
6101 6101
 			if (empty($hidelist)) {
6102 6102
 				print '<div class="inline-block" style="padding-right: 10px">';
6103
-				$newfilter = 'discount_type=' . intval($discount_type);
6103
+				$newfilter = 'discount_type='.intval($discount_type);
6104 6104
 				if (!empty($discount_type)) {
6105 6105
 					$newfilter .= ' AND fk_invoice_supplier IS NULL AND fk_invoice_supplier_line IS NULL'; // Supplier discounts available
6106 6106
 				} else {
6107 6107
 					$newfilter .= ' AND fk_facture IS NULL AND fk_facture_line IS NULL'; // Customer discounts available
6108 6108
 				}
6109 6109
 				if ($filter) {
6110
-					$newfilter .= ' AND (' . $filter . ')';
6110
+					$newfilter .= ' AND ('.$filter.')';
6111 6111
 				}
6112 6112
 				// output the combo of discounts
6113 6113
 				$nbqualifiedlines = $this->select_remises($selected, $htmlname, $newfilter, $socid, $maxvalue);
6114 6114
 				if ($nbqualifiedlines > 0) {
6115
-					print ' &nbsp; <input type="submit" class="button smallpaddingimp" value="' . dol_escape_htmltag($langs->trans("UseLine")) . '"';
6115
+					print ' &nbsp; <input type="submit" class="button smallpaddingimp" value="'.dol_escape_htmltag($langs->trans("UseLine")).'"';
6116 6116
 					if (!empty($discount_type) && $filter && $filter != "fk_invoice_supplier_source IS NULL OR (description LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS PAID)%')") {
6117
-						print ' title="' . $langs->trans("UseCreditNoteInInvoicePayment") . '"';
6117
+						print ' title="'.$langs->trans("UseCreditNoteInInvoicePayment").'"';
6118 6118
 					}
6119 6119
 					if (empty($discount_type) && $filter && $filter != "fk_facture_source IS NULL OR (description LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS RECEIVED)%')") {
6120
-						print ' title="' . $langs->trans("UseCreditNoteInInvoicePayment") . '"';
6120
+						print ' title="'.$langs->trans("UseCreditNoteInInvoicePayment").'"';
6121 6121
 					}
6122 6122
 
6123 6123
 					print '>';
@@ -6157,23 +6157,23 @@  discard block
 block discarded – undo
6157 6157
 		global $langs, $conf;
6158 6158
 
6159 6159
 		if ($htmlname != "none") {
6160
-			print '<form method="post" action="' . $page . '">';
6160
+			print '<form method="post" action="'.$page.'">';
6161 6161
 			print '<input type="hidden" name="action" value="set_contact">';
6162
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
6162
+			print '<input type="hidden" name="token" value="'.newToken().'">';
6163 6163
 			print '<table class="nobordernopadding">';
6164 6164
 			print '<tr><td>';
6165 6165
 			print $this->selectcontacts($societe->id, $selected, $htmlname);
6166 6166
 			$num = $this->num;
6167 6167
 			if ($num == 0) {
6168 6168
 				$addcontact = (getDolGlobalString('SOCIETE_ADDRESSES_MANAGEMENT') ? $langs->trans("AddContact") : $langs->trans("AddContactAddress"));
6169
-				print '<a href="' . DOL_URL_ROOT . '/contact/card.php?socid=' . $societe->id . '&amp;action=create&amp;backtoreferer=1">' . $addcontact . '</a>';
6169
+				print '<a href="'.DOL_URL_ROOT.'/contact/card.php?socid='.$societe->id.'&amp;action=create&amp;backtoreferer=1">'.$addcontact.'</a>';
6170 6170
 			}
6171 6171
 			print '</td>';
6172
-			print '<td class="left"><input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '"></td>';
6172
+			print '<td class="left"><input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'"></td>';
6173 6173
 			print '</tr></table></form>';
6174 6174
 		} else {
6175 6175
 			if ($selected) {
6176
-				require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php';
6176
+				require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
6177 6177
 				$contact = new Contact($this->db);
6178 6178
 				$contact->fetch($selected);
6179 6179
 				print $contact->getFullName($langs);
@@ -6208,20 +6208,20 @@  discard block
 block discarded – undo
6208 6208
 
6209 6209
 		$out = '';
6210 6210
 		if ($htmlname != "none") {
6211
-			$out .= '<form method="post" action="' . $page . '">';
6211
+			$out .= '<form method="post" action="'.$page.'">';
6212 6212
 			$out .= '<input type="hidden" name="action" value="set_thirdparty">';
6213
-			$out .= '<input type="hidden" name="token" value="' . newToken() . '">';
6213
+			$out .= '<input type="hidden" name="token" value="'.newToken().'">';
6214 6214
 			$out .= $this->select_company($selected, $htmlname, $filter, $showempty, $showtype, $forcecombo, $events, 0, 'minwidth100', '', '', 1, array(), false, $excludeids);
6215
-			$out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
6215
+			$out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
6216 6216
 			$out .= '</form>';
6217 6217
 		} else {
6218 6218
 			if ($selected) {
6219
-				require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
6219
+				require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
6220 6220
 				$soc = new Societe($this->db);
6221 6221
 				$soc->fetch($selected);
6222 6222
 				$out .= $soc->getNomUrl(0, '');
6223 6223
 			} else {
6224
-				$out .= '<span class="opacitymedium">' . $textifnothirdparty . '</span>';
6224
+				$out .= '<span class="opacitymedium">'.$textifnothirdparty.'</span>';
6225 6225
 			}
6226 6226
 		}
6227 6227
 
@@ -6271,22 +6271,22 @@  discard block
 block discarded – undo
6271 6271
 			$selected = 'EUR'; // Pour compatibilite
6272 6272
 		}
6273 6273
 
6274
-		$out .= '<select class="flat maxwidth200onsmartphone minwidth300" name="' . $htmlname . '" id="' . $htmlname . '">';
6274
+		$out .= '<select class="flat maxwidth200onsmartphone minwidth300" name="'.$htmlname.'" id="'.$htmlname.'">';
6275 6275
 		if ($useempty) {
6276 6276
 			$out .= '<option value="-1" selected></option>';
6277 6277
 		}
6278 6278
 		foreach ($langs->cache_currencies as $code_iso => $currency) {
6279 6279
 			$labeltoshow = $currency['label'];
6280 6280
 			if ($mode == 1) {
6281
-				$labeltoshow .= ' <span class="opacitymedium">(' . $code_iso . ')</span>';
6281
+				$labeltoshow .= ' <span class="opacitymedium">('.$code_iso.')</span>';
6282 6282
 			} else {
6283
-				$labeltoshow .= ' <span class="opacitymedium">(' . $langs->getCurrencySymbol($code_iso) . ')</span>';
6283
+				$labeltoshow .= ' <span class="opacitymedium">('.$langs->getCurrencySymbol($code_iso).')</span>';
6284 6284
 			}
6285 6285
 
6286 6286
 			if ($selected && $selected == $code_iso) {
6287
-				$out .= '<option value="' . $code_iso . '" selected data-html="' . dol_escape_htmltag($labeltoshow) . '">';
6287
+				$out .= '<option value="'.$code_iso.'" selected data-html="'.dol_escape_htmltag($labeltoshow).'">';
6288 6288
 			} else {
6289
-				$out .= '<option value="' . $code_iso . '" data-html="' . dol_escape_htmltag($labeltoshow) . '">';
6289
+				$out .= '<option value="'.$code_iso.'" data-html="'.dol_escape_htmltag($labeltoshow).'">';
6290 6290
 			}
6291 6291
 			$out .= $labeltoshow;
6292 6292
 			$out .= '</option>';
@@ -6297,7 +6297,7 @@  discard block
 block discarded – undo
6297 6297
 		}
6298 6298
 
6299 6299
 		// Make select dynamic
6300
-		include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
6300
+		include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
6301 6301
 		$out .= ajax_combobox($htmlname);
6302 6302
 
6303 6303
 		return $out;
@@ -6323,10 +6323,10 @@  discard block
 block discarded – undo
6323 6323
 
6324 6324
 		$TCurrency = array();
6325 6325
 
6326
-		$sql = "SELECT code FROM " . $this->db->prefix() . "multicurrency";
6327
-		$sql .= " WHERE entity IN ('" . getEntity('mutlicurrency') . "')";
6326
+		$sql = "SELECT code FROM ".$this->db->prefix()."multicurrency";
6327
+		$sql .= " WHERE entity IN ('".getEntity('mutlicurrency')."')";
6328 6328
 		if ($filter) {
6329
-			$sql .= " AND " . $filter;
6329
+			$sql .= " AND ".$filter;
6330 6330
 		}
6331 6331
 		$resql = $this->db->query($sql);
6332 6332
 		if ($resql) {
@@ -6336,7 +6336,7 @@  discard block
 block discarded – undo
6336 6336
 		}
6337 6337
 
6338 6338
 		$out = '';
6339
-		$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
6339
+		$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
6340 6340
 		if ($useempty) {
6341 6341
 			$out .= '<option value="">&nbsp;</option>';
6342 6342
 		}
@@ -6348,13 +6348,13 @@  discard block
 block discarded – undo
6348 6348
 			foreach ($langs->cache_currencies as $code_iso => $currency) {
6349 6349
 				if (isset($TCurrency[$code_iso])) {
6350 6350
 					if (!empty($selected) && $selected == $code_iso) {
6351
-						$out .= '<option value="' . $code_iso . '" selected="selected">';
6351
+						$out .= '<option value="'.$code_iso.'" selected="selected">';
6352 6352
 					} else {
6353
-						$out .= '<option value="' . $code_iso . '">';
6353
+						$out .= '<option value="'.$code_iso.'">';
6354 6354
 					}
6355 6355
 
6356 6356
 					$out .= $currency['label'];
6357
-					$out .= ' (' . $langs->getCurrencySymbol($code_iso) . ')';
6357
+					$out .= ' ('.$langs->getCurrencySymbol($code_iso).')';
6358 6358
 					$out .= '</option>';
6359 6359
 				}
6360 6360
 			}
@@ -6363,7 +6363,7 @@  discard block
 block discarded – undo
6363 6363
 		$out .= '</select>';
6364 6364
 
6365 6365
 		// Make select dynamic
6366
-		include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
6366
+		include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
6367 6367
 		$out .= ajax_combobox($htmlname);
6368 6368
 
6369 6369
 		return $out;
@@ -6390,11 +6390,11 @@  discard block
 block discarded – undo
6390 6390
 		dol_syslog(__METHOD__, LOG_DEBUG);
6391 6391
 
6392 6392
 		$sql = "SELECT DISTINCT t.rowid, t.code, t.taux, t.localtax1, t.localtax1_type, t.localtax2, t.localtax2_type, t.recuperableonly";
6393
-		$sql .= " FROM " . $this->db->prefix() . "c_tva as t, " . $this->db->prefix() . "c_country as c";
6393
+		$sql .= " FROM ".$this->db->prefix()."c_tva as t, ".$this->db->prefix()."c_country as c";
6394 6394
 		$sql .= " WHERE t.fk_pays = c.rowid";
6395 6395
 		$sql .= " AND t.active > 0";
6396 6396
 		$sql .= " AND t.entity IN (".getEntity('c_tva').")";
6397
-		$sql .= " AND c.code IN (" . $this->db->sanitize($country_code, 1) . ")";
6397
+		$sql .= " AND c.code IN (".$this->db->sanitize($country_code, 1).")";
6398 6398
 		$sql .= " ORDER BY t.code ASC, t.taux ASC, t.recuperableonly ASC";
6399 6399
 
6400 6400
 		$resql = $this->db->query($sql);
@@ -6412,22 +6412,22 @@  discard block
 block discarded – undo
6412 6412
 					$this->cache_vatrates[$i]['localtax2'] = $obj->localtax2;
6413 6413
 					$this->cache_vatrates[$i]['localtax2_type'] = $obj->localtax1_type;
6414 6414
 
6415
-					$this->cache_vatrates[$i]['label'] = $obj->taux . '%' . ($obj->code ? ' (' . $obj->code . ')' : ''); // Label must contains only 0-9 , . % or *
6416
-					$this->cache_vatrates[$i]['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
6415
+					$this->cache_vatrates[$i]['label'] = $obj->taux.'%'.($obj->code ? ' ('.$obj->code.')' : ''); // Label must contains only 0-9 , . % or *
6416
+					$this->cache_vatrates[$i]['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
6417 6417
 					$positiverates = '';
6418 6418
 					if ($obj->taux) {
6419
-						$positiverates .= ($positiverates ? '/' : '') . $obj->taux;
6419
+						$positiverates .= ($positiverates ? '/' : '').$obj->taux;
6420 6420
 					}
6421 6421
 					if ($obj->localtax1) {
6422
-						$positiverates .= ($positiverates ? '/' : '') . $obj->localtax1;
6422
+						$positiverates .= ($positiverates ? '/' : '').$obj->localtax1;
6423 6423
 					}
6424 6424
 					if ($obj->localtax2) {
6425
-						$positiverates .= ($positiverates ? '/' : '') . $obj->localtax2;
6425
+						$positiverates .= ($positiverates ? '/' : '').$obj->localtax2;
6426 6426
 					}
6427 6427
 					if (empty($positiverates)) {
6428 6428
 						$positiverates = '0';
6429 6429
 					}
6430
-					$this->cache_vatrates[$i]['labelpositiverates'] = $positiverates . ($obj->code ? ' (' . $obj->code . ')' : ''); // Must never be used as key, only label
6430
+					$this->cache_vatrates[$i]['labelpositiverates'] = $positiverates.($obj->code ? ' ('.$obj->code.')' : ''); // Must never be used as key, only label
6431 6431
 				}
6432 6432
 
6433 6433
 				return $num;
@@ -6445,7 +6445,7 @@  discard block
 block discarded – undo
6445 6445
 				return -1;
6446 6446
 			}
6447 6447
 		} else {
6448
-			$this->error = '<span class="error">' . $this->db->error() . '</span>';
6448
+			$this->error = '<span class="error">'.$this->db->error().'</span>';
6449 6449
 			return -2;
6450 6450
 		}
6451 6451
 	}
@@ -6497,9 +6497,9 @@  discard block
 block discarded – undo
6497 6497
 		// Check parameters
6498 6498
 		if (is_object($societe_vendeuse) && !$societe_vendeuse->country_code) {
6499 6499
 			if ($societe_vendeuse->id == $mysoc->id) {
6500
-				$return .= '<span class="error">' . $langs->trans("ErrorYourCountryIsNotDefined") . '</span>';
6500
+				$return .= '<span class="error">'.$langs->trans("ErrorYourCountryIsNotDefined").'</span>';
6501 6501
 			} else {
6502
-				$return .= '<span class="error">' . $langs->trans("ErrorSupplierCountryIsNotDefined") . '</span>';
6502
+				$return .= '<span class="error">'.$langs->trans("ErrorSupplierCountryIsNotDefined").'</span>';
6503 6503
 			}
6504 6504
 			return $return;
6505 6505
 		}
@@ -6511,25 +6511,25 @@  discard block
 block discarded – undo
6511 6511
 		// Define list of countries to use to search VAT rates to show
6512 6512
 		// First we defined code_country to use to find list
6513 6513
 		if (is_object($societe_vendeuse)) {
6514
-			$code_country = "'" . $societe_vendeuse->country_code . "'";
6514
+			$code_country = "'".$societe_vendeuse->country_code."'";
6515 6515
 		} else {
6516
-			$code_country = "'" . $mysoc->country_code . "'"; // Pour compatibilite ascendente
6516
+			$code_country = "'".$mysoc->country_code."'"; // Pour compatibilite ascendente
6517 6517
 		}
6518 6518
 		if (getDolGlobalString('SERVICE_ARE_ECOMMERCE_200238EC')) {    // If option to have vat for end customer for services is on
6519
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
6519
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
6520 6520
 			if (!isInEEC($societe_vendeuse) && (!is_object($societe_acheteuse) || (isInEEC($societe_acheteuse) && !$societe_acheteuse->isACompany()))) {
6521 6521
 				// We also add the buyer country code
6522 6522
 				if (is_numeric($type)) {
6523 6523
 					if ($type == 1) { // We know product is a service
6524
-						$code_country .= ",'" . $societe_acheteuse->country_code . "'";
6524
+						$code_country .= ",'".$societe_acheteuse->country_code."'";
6525 6525
 					}
6526 6526
 				} elseif (!$idprod) {  // We don't know type of product
6527
-					$code_country .= ",'" . $societe_acheteuse->country_code . "'";
6527
+					$code_country .= ",'".$societe_acheteuse->country_code."'";
6528 6528
 				} else {
6529 6529
 					$prodstatic = new Product($this->db);
6530 6530
 					$prodstatic->fetch($idprod);
6531 6531
 					if ($prodstatic->type == Product::TYPE_SERVICE) {   // We know product is a service
6532
-						$code_country .= ",'" . $societe_acheteuse->country_code . "'";
6532
+						$code_country .= ",'".$societe_acheteuse->country_code."'";
6533 6533
 					}
6534 6534
 				}
6535 6535
 			}
@@ -6581,13 +6581,13 @@  discard block
 block discarded – undo
6581 6581
 				// Override/enable VAT for expense report regardless of global setting - needed if expense report used for business expenses instead
6582 6582
 				// of using supplier invoices (this is a very bad idea !)
6583 6583
 				if (!getDolGlobalString('EXPENSEREPORT_OVERRIDE_VAT')) {
6584
-					$title = ' title="' . dol_escape_htmltag($langs->trans('VATIsNotUsed')) . '"';
6584
+					$title = ' title="'.dol_escape_htmltag($langs->trans('VATIsNotUsed')).'"';
6585 6585
 					$disabled = true;
6586 6586
 				}
6587 6587
 			}
6588 6588
 
6589 6589
 			if (!$options_only) {
6590
-				$return .= '<select class="flat minwidth50imp maxwidth100" id="' . $htmlname . '" name="' . $htmlname . '"' . ($disabled ? ' disabled' : '') . $title . '>';
6590
+				$return .= '<select class="flat minwidth50imp maxwidth100" id="'.$htmlname.'" name="'.$htmlname.'"'.($disabled ? ' disabled' : '').$title.'>';
6591 6591
 			}
6592 6592
 
6593 6593
 			$selectedfound = false;
@@ -6601,13 +6601,13 @@  discard block
 block discarded – undo
6601 6601
 				$key = $rate['txtva'];
6602 6602
 				$key .= $rate['nprtva'] ? '*' : '';
6603 6603
 				if ($mode > 0 && $rate['code']) {
6604
-					$key .= ' (' . $rate['code'] . ')';
6604
+					$key .= ' ('.$rate['code'].')';
6605 6605
 				}
6606 6606
 				if ($mode < 0) {
6607 6607
 					$key = $rate['rowid'];
6608 6608
 				}
6609 6609
 
6610
-				$return .= '<option value="' . $key . '"';
6610
+				$return .= '<option value="'.$key.'"';
6611 6611
 				if (!$selectedfound) {
6612 6612
 					if ($defaultcode) { // If defaultcode is defined, we used it in priority to select combo option instead of using rate+npr flag
6613 6613
 						if ($defaultcode == $rate['code']) {
@@ -6678,7 +6678,7 @@  discard block
 block discarded – undo
6678 6678
 	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 = '')
6679 6679
 	{
6680 6680
 		// phpcs:enable
6681
-		dol_syslog(__METHOD__ . ': using select_date is deprecated. Use selectDate instead.', LOG_WARNING);
6681
+		dol_syslog(__METHOD__.': using select_date is deprecated. Use selectDate instead.', LOG_WARNING);
6682 6682
 		$retstring = $this->selectDate($set_time, $prefix, $h, $m, $empty, $form_name, $d, $addnowlink, $disabled, $fullday, $addplusone, $adddateof);
6683 6683
 		if (!empty($nooutput)) {
6684 6684
 			return $retstring;
@@ -6707,11 +6707,11 @@  discard block
 block discarded – undo
6707 6707
 	{
6708 6708
 		global $langs;
6709 6709
 
6710
-		$ret = $this->selectDate($set_time, $prefix . '_start', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("from"), 'tzuserrel');
6710
+		$ret = $this->selectDate($set_time, $prefix.'_start', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("from"), 'tzuserrel');
6711 6711
 		if ($forcenewline) {
6712 6712
 			$ret .= '<br>';
6713 6713
 		}
6714
-		$ret .= $this->selectDate($set_time_end, $prefix . '_end', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"), 'tzuserrel');
6714
+		$ret .= $this->selectDate($set_time_end, $prefix.'_end', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"), 'tzuserrel');
6715 6715
 		return $ret;
6716 6716
 	}
6717 6717
 
@@ -6777,7 +6777,7 @@  discard block
 block discarded – undo
6777 6777
 		$orig_set_time = $set_time;
6778 6778
 
6779 6779
 		if ($set_time === '' && $emptydate == 0) {
6780
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
6780
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
6781 6781
 			if ($gm == 'tzuser' || $gm == 'tzuserrel') {
6782 6782
 				$set_time = dol_now($gm);
6783 6783
 			} else {
@@ -6845,38 +6845,38 @@  discard block
 block discarded – undo
6845 6845
 				// Calendrier popup version eldy
6846 6846
 				if ($usecalendar == "eldy") {
6847 6847
 					// Input area to enter date manually
6848
-					$retstring .= '<input id="' . $prefix . '" name="' . $prefix . '" type="text" class="maxwidthdate" maxlength="11" value="' . $formated_date . '"';
6848
+					$retstring .= '<input id="'.$prefix.'" name="'.$prefix.'" type="text" class="maxwidthdate" maxlength="11" value="'.$formated_date.'"';
6849 6849
 					$retstring .= ($disabled ? ' disabled' : '');
6850
-					$retstring .= ' onChange="dpChangeDay(\'' . $prefix . '\',\'' . $langs->trans("FormatDateShortJavaInput") . '\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript
6850
+					$retstring .= ' onChange="dpChangeDay(\''.$prefix.'\',\''.$langs->trans("FormatDateShortJavaInput").'\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript
6851 6851
 					$retstring .= '>';
6852 6852
 
6853 6853
 					// Icon calendar
6854 6854
 					$retstringbuttom = '';
6855 6855
 					if (!$disabled) {
6856
-						$retstringbuttom = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons"';
6857
-						$base = DOL_URL_ROOT . '/core/';
6858
-						$retstringbuttom .= ' onClick="showDP(\'' . $base . '\',\'' . $prefix . '\',\'' . $langs->trans("FormatDateShortJavaInput") . '\',\'' . $langs->defaultlang . '\');"';
6859
-						$retstringbuttom .= '>' . img_object($langs->trans("SelectDate"), 'calendarday', 'class="datecallink"') . '</button>';
6856
+						$retstringbuttom = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons"';
6857
+						$base = DOL_URL_ROOT.'/core/';
6858
+						$retstringbuttom .= ' onClick="showDP(\''.$base.'\',\''.$prefix.'\',\''.$langs->trans("FormatDateShortJavaInput").'\',\''.$langs->defaultlang.'\');"';
6859
+						$retstringbuttom .= '>'.img_object($langs->trans("SelectDate"), 'calendarday', 'class="datecallink"').'</button>';
6860 6860
 					} else {
6861
-						$retstringbuttom = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons">' . img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"') . '</button>';
6861
+						$retstringbuttom = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons">'.img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"').'</button>';
6862 6862
 					}
6863
-					$retstring = $retstringbuttom . $retstring;
6863
+					$retstring = $retstringbuttom.$retstring;
6864 6864
 
6865
-					$retstring .= '<input type="hidden" id="' . $prefix . 'day"   name="' . $prefix . 'day"   value="' . $sday . '">' . "\n";
6866
-					$retstring .= '<input type="hidden" id="' . $prefix . 'month" name="' . $prefix . 'month" value="' . $smonth . '">' . "\n";
6867
-					$retstring .= '<input type="hidden" id="' . $prefix . 'year"  name="' . $prefix . 'year"  value="' . $syear . '">' . "\n";
6865
+					$retstring .= '<input type="hidden" id="'.$prefix.'day"   name="'.$prefix.'day"   value="'.$sday.'">'."\n";
6866
+					$retstring .= '<input type="hidden" id="'.$prefix.'month" name="'.$prefix.'month" value="'.$smonth.'">'."\n";
6867
+					$retstring .= '<input type="hidden" id="'.$prefix.'year"  name="'.$prefix.'year"  value="'.$syear.'">'."\n";
6868 6868
 				} elseif ($usecalendar == 'jquery') {
6869 6869
 					if (!$disabled) {
6870 6870
 						// Output javascript for datepicker
6871 6871
 						$minYear = getDolGlobalInt('MIN_YEAR_SELECT_DATE', (date('Y') - 100));
6872 6872
 						$maxYear = getDolGlobalInt('MAX_YEAR_SELECT_DATE', (date('Y') + 100));
6873 6873
 
6874
-						$retstring .= '<script nonce="' . getNonce() . '" type="text/javascript">';
6875
-						$retstring .= "$(function(){ $('#" . $prefix . "').datepicker({
6876
-							dateFormat: '" . $langs->trans("FormatDateShortJQueryInput") . "',
6874
+						$retstring .= '<script nonce="'.getNonce().'" type="text/javascript">';
6875
+						$retstring .= "$(function(){ $('#".$prefix."').datepicker({
6876
+							dateFormat: '" . $langs->trans("FormatDateShortJQueryInput")."',
6877 6877
 							autoclose: true,
6878 6878
 							todayHighlight: true,
6879
-							yearRange: '" . $minYear . ":" . $maxYear . "',";
6879
+							yearRange: '" . $minYear.":".$maxYear."',";
6880 6880
 						if (!empty($conf->dol_use_jmobile)) {
6881 6881
 							$retstring .= "
6882 6882
 								beforeShow: function (input, datePicker) {
@@ -6891,7 +6891,7 @@  discard block
 block discarded – undo
6891 6891
 						if (!getDolGlobalString('MAIN_POPUP_CALENDAR_ON_FOCUS')) {
6892 6892
 							$retstring .= "
6893 6893
 								showOn: 'button',	/* both has problem with autocompletion */
6894
-								buttonImage: '" . DOL_URL_ROOT . "/theme/" . dol_escape_js($conf->theme) . "/img/object_calendarday.png',
6894
+								buttonImage: '" . DOL_URL_ROOT."/theme/".dol_escape_js($conf->theme)."/img/object_calendarday.png',
6895 6895
 								buttonImageOnly: true";
6896 6896
 						}
6897 6897
 						$retstring .= "
@@ -6903,8 +6903,8 @@  discard block
 block discarded – undo
6903 6903
 					$retstring .= '<div class="nowraponall inline-block divfordateinput">';
6904 6904
 					$retstring .= '<input id="'.$prefix.'" name="'.$prefix.'" type="text" class="maxwidthdate" maxlength="11" value="'.$formated_date.'"';
6905 6905
 					$retstring .= ($disabled ? ' disabled' : '');
6906
-					$retstring .= ($placeholder ? ' placeholder="' . dol_escape_htmltag($placeholder) . '"' : '');
6907
-					$retstring .= ' onChange="dpChangeDay(\'' . dol_escape_js($prefix) . '\',\'' . dol_escape_js($langs->trans("FormatDateShortJavaInput")) . '\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript
6906
+					$retstring .= ($placeholder ? ' placeholder="'.dol_escape_htmltag($placeholder).'"' : '');
6907
+					$retstring .= ' onChange="dpChangeDay(\''.dol_escape_js($prefix).'\',\''.dol_escape_js($langs->trans("FormatDateShortJavaInput")).'\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript
6908 6908
 					$retstring .= '>';
6909 6909
 
6910 6910
 					// Icone calendrier
@@ -6919,40 +6919,40 @@  discard block
 block discarded – undo
6919 6919
 						$retstring.='});';
6920 6920
 						$retstring.="</script>";*/
6921 6921
 					} else {
6922
-						$retstringbutton = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons">' . img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"') . '</button>';
6923
-						$retsring = $retstringbutton . $retstring;
6922
+						$retstringbutton = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons">'.img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"').'</button>';
6923
+						$retsring = $retstringbutton.$retstring;
6924 6924
 					}
6925 6925
 
6926 6926
 					$retstring .= '</div>';
6927
-					$retstring .= '<input type="hidden" id="' . $prefix . 'day"   name="' . $prefix . 'day"   value="' . $sday . '">' . "\n";
6928
-					$retstring .= '<input type="hidden" id="' . $prefix . 'month" name="' . $prefix . 'month" value="' . $smonth . '">' . "\n";
6929
-					$retstring .= '<input type="hidden" id="' . $prefix . 'year"  name="' . $prefix . 'year"  value="' . $syear . '">' . "\n";
6927
+					$retstring .= '<input type="hidden" id="'.$prefix.'day"   name="'.$prefix.'day"   value="'.$sday.'">'."\n";
6928
+					$retstring .= '<input type="hidden" id="'.$prefix.'month" name="'.$prefix.'month" value="'.$smonth.'">'."\n";
6929
+					$retstring .= '<input type="hidden" id="'.$prefix.'year"  name="'.$prefix.'year"  value="'.$syear.'">'."\n";
6930 6930
 				} else {
6931 6931
 					$retstring .= "Bad value of MAIN_POPUP_CALENDAR";
6932 6932
 				}
6933 6933
 			} else {
6934 6934
 				// Show date with combo selects
6935 6935
 				// Day
6936
-				$retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth50imp" id="' . $prefix . 'day" name="' . $prefix . 'day">';
6936
+				$retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50imp" id="'.$prefix.'day" name="'.$prefix.'day">';
6937 6937
 
6938 6938
 				if ($emptydate || $set_time == -1) {
6939 6939
 					$retstring .= '<option value="0" selected>&nbsp;</option>';
6940 6940
 				}
6941 6941
 
6942 6942
 				for ($day = 1; $day <= 31; $day++) {
6943
-					$retstring .= '<option value="' . $day . '"' . ($day == $sday ? ' selected' : '') . '>' . $day . '</option>';
6943
+					$retstring .= '<option value="'.$day.'"'.($day == $sday ? ' selected' : '').'>'.$day.'</option>';
6944 6944
 				}
6945 6945
 
6946 6946
 				$retstring .= "</select>";
6947 6947
 
6948
-				$retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth75imp" id="' . $prefix . 'month" name="' . $prefix . 'month">';
6948
+				$retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth75imp" id="'.$prefix.'month" name="'.$prefix.'month">';
6949 6949
 				if ($emptydate || $set_time == -1) {
6950 6950
 					$retstring .= '<option value="0" selected>&nbsp;</option>';
6951 6951
 				}
6952 6952
 
6953 6953
 				// Month
6954 6954
 				for ($month = 1; $month <= 12; $month++) {
6955
-					$retstring .= '<option value="' . $month . '"' . ($month == $smonth ? ' selected' : '') . '>';
6955
+					$retstring .= '<option value="'.$month.'"'.($month == $smonth ? ' selected' : '').'>';
6956 6956
 					$retstring .= dol_print_date(mktime(12, 0, 0, $month, 1, 2000), "%b");
6957 6957
 					$retstring .= "</option>";
6958 6958
 				}
@@ -6960,12 +6960,12 @@  discard block
 block discarded – undo
6960 6960
 
6961 6961
 				// Year
6962 6962
 				if ($emptydate || $set_time == -1) {
6963
-					$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 . '">';
6963
+					$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.'">';
6964 6964
 				} else {
6965
-					$retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth75imp" id="' . $prefix . 'year" name="' . $prefix . 'year">';
6965
+					$retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth75imp" id="'.$prefix.'year" name="'.$prefix.'year">';
6966 6966
 
6967 6967
 					for ($year = $syear - 10; $year < $syear + 10; $year++) {
6968
-						$retstring .= '<option value="' . $year . '"' . ($year == $syear ? ' selected' : '') . '>' . $year . '</option>';
6968
+						$retstring .= '<option value="'.$year.'"'.($year == $syear ? ' selected' : '').'>'.$year.'</option>';
6969 6969
 					}
6970 6970
 					$retstring .= "</select>\n";
6971 6971
 				}
@@ -6989,15 +6989,15 @@  discard block
 block discarded – undo
6989 6989
 				}
6990 6990
 			}
6991 6991
 			// Show hour
6992
-			$retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth50 ' . ($fullday ? $fullday . 'hour' : '') . '" id="' . $prefix . 'hour" name="' . $prefix . 'hour">';
6992
+			$retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50 '.($fullday ? $fullday.'hour' : '').'" id="'.$prefix.'hour" name="'.$prefix.'hour">';
6993 6993
 			if ($emptyhours) {
6994 6994
 				$retstring .= '<option value="-1">&nbsp;</option>';
6995 6995
 			}
6996 6996
 			for ($hour = $hourstart; $hour < $hourend; $hour++) {
6997 6997
 				if (strlen($hour) < 2) {
6998
-					$hour = "0" . $hour;
6998
+					$hour = "0".$hour;
6999 6999
 				}
7000
-				$retstring .= '<option value="' . $hour . '"' . (($hour == $shour) ? ' selected' : '') . '>' . $hour;
7000
+				$retstring .= '<option value="'.$hour.'"'.(($hour == $shour) ? ' selected' : '').'>'.$hour;
7001 7001
 				//$retstring .= (empty($conf->dol_optimize_smallscreen) ? '' : 'H');
7002 7002
 				$retstring .= '</option>';
7003 7003
 			}
@@ -7010,19 +7010,19 @@  discard block
 block discarded – undo
7010 7010
 
7011 7011
 		if ($m) {
7012 7012
 			// Show minutes
7013
-			$retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth50 ' . ($fullday ? $fullday . 'min' : '') . '" id="' . $prefix . 'min" name="' . $prefix . 'min">';
7013
+			$retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50 '.($fullday ? $fullday.'min' : '').'" id="'.$prefix.'min" name="'.$prefix.'min">';
7014 7014
 			if ($emptyhours) {
7015 7015
 				$retstring .= '<option value="-1">&nbsp;</option>';
7016 7016
 			}
7017 7017
 			for ($min = 0; $min < 60; $min += $stepminutes) {
7018 7018
 				if (strlen($min) < 2) {
7019
-					$min = "0" . $min;
7019
+					$min = "0".$min;
7020 7020
 				}
7021
-				$retstring .= '<option value="' . $min . '"' . (($min == $smin) ? ' selected' : '') . '>' . $min . (empty($conf->dol_optimize_smallscreen) ? '' : '') . '</option>';
7021
+				$retstring .= '<option value="'.$min.'"'.(($min == $smin) ? ' selected' : '').'>'.$min.(empty($conf->dol_optimize_smallscreen) ? '' : '').'</option>';
7022 7022
 			}
7023 7023
 			$retstring .= '</select>';
7024 7024
 
7025
-			$retstring .= '<input type="hidden" name="' . $prefix . 'sec" value="' . $ssec . '">';
7025
+			$retstring .= '<input type="hidden" name="'.$prefix.'sec" value="'.$ssec.'">';
7026 7026
 		}
7027 7027
 
7028 7028
 		if ($d && $h) {
@@ -7045,10 +7045,10 @@  discard block
 block discarded – undo
7045 7045
 
7046 7046
 			// Generate the date part, depending on the use or not of the javascript calendar
7047 7047
 			if ($addnowlink == 1) { // server time expressed in user time setup
7048
-				$reset_scripts .= 'jQuery(\'#' . $prefix . '\').val(\'' . dol_print_date($nowgmt, 'day', 'tzuserrel') . '\');';
7049
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'day\').val(\'' . dol_print_date($nowgmt, '%d', 'tzuserrel') . '\');';
7050
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'month\').val(\'' . dol_print_date($nowgmt, '%m', 'tzuserrel') . '\');';
7051
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'year\').val(\'' . dol_print_date($nowgmt, '%Y', 'tzuserrel') . '\');';
7048
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'day', 'tzuserrel').'\');';
7049
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');';
7050
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');';
7051
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');';
7052 7052
 			} elseif ($addnowlink == 2) {
7053 7053
 				/* Disabled because the output does not use the string format defined by FormatDateShort key to forge the value into #prefix.
7054 7054
 				 * This break application for foreign languages.
@@ -7057,10 +7057,10 @@  discard block
 block discarded – undo
7057 7057
 				$reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(parseInt(d.getMonth().pad()) + 1);';
7058 7058
 				$reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(d.getFullYear());';
7059 7059
 				*/
7060
-				$reset_scripts .= 'jQuery(\'#' . $prefix . '\').val(\'' . dol_print_date($nowgmt, 'day', 'tzuserrel') . '\');';
7061
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'day\').val(\'' . dol_print_date($nowgmt, '%d', 'tzuserrel') . '\');';
7062
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'month\').val(\'' . dol_print_date($nowgmt, '%m', 'tzuserrel') . '\');';
7063
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'year\').val(\'' . dol_print_date($nowgmt, '%Y', 'tzuserrel') . '\');';
7060
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'day', 'tzuserrel').'\');';
7061
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');';
7062
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');';
7063
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');';
7064 7064
 			}
7065 7065
 			/*if ($usecalendar == "eldy")
7066 7066
 			{
@@ -7080,11 +7080,11 @@  discard block
 block discarded – undo
7080 7080
 				}
7081 7081
 				//$reset_scripts .= 'this.form.elements[\''.$prefix.'hour\'].value=formatDate(new Date(), \'HH\'); ';
7082 7082
 				if ($addnowlink == 1) {
7083
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').val(\'' . dol_print_date($nowgmt, '%H', 'tzuserrel') . '\');';
7084
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').change();';
7083
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(\''.dol_print_date($nowgmt, '%H', 'tzuserrel').'\');';
7084
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').change();';
7085 7085
 				} elseif ($addnowlink == 2) {
7086
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').val(d.getHours().pad());';
7087
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').change();';
7086
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(d.getHours().pad());';
7087
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').change();';
7088 7088
 				}
7089 7089
 
7090 7090
 				if ($fullday) {
@@ -7098,11 +7098,11 @@  discard block
 block discarded – undo
7098 7098
 				}
7099 7099
 				//$reset_scripts .= 'this.form.elements[\''.$prefix.'min\'].value=formatDate(new Date(), \'mm\'); ';
7100 7100
 				if ($addnowlink == 1) {
7101
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').val(\'' . dol_print_date($nowgmt, '%M', 'tzuserrel') . '\');';
7102
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').change();';
7101
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(\''.dol_print_date($nowgmt, '%M', 'tzuserrel').'\');';
7102
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').change();';
7103 7103
 				} elseif ($addnowlink == 2) {
7104
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').val(d.getMinutes().pad());';
7105
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').change();';
7104
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(d.getMinutes().pad());';
7105
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').change();';
7106 7106
 				}
7107 7107
 				if ($fullday) {
7108 7108
 					$reset_scripts .= ' } ';
@@ -7110,7 +7110,7 @@  discard block
 block discarded – undo
7110 7110
 			}
7111 7111
 			// If reset_scripts is not empty, print the link with the reset_scripts in the onClick
7112 7112
 			if ($reset_scripts && !getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
7113
-				$retstring .= ' <button class="dpInvisibleButtons datenowlink" id="' . $prefix . 'ButtonNow" type="button" name="_useless" value="now" onClick="' . $reset_scripts . '">';
7113
+				$retstring .= ' <button class="dpInvisibleButtons datenowlink" id="'.$prefix.'ButtonNow" type="button" name="_useless" value="now" onClick="'.$reset_scripts.'">';
7114 7114
 				$retstring .= $langs->trans("Now");
7115 7115
 				$retstring .= '</button> ';
7116 7116
 			}
@@ -7122,16 +7122,16 @@  discard block
 block discarded – undo
7122 7122
 			$reset_scripts = "";
7123 7123
 
7124 7124
 			// Generate the date part, depending on the use or not of the javascript calendar
7125
-			$reset_scripts .= 'jQuery(\'#' . $prefix . '\').val(\'' . dol_print_date($nowgmt, 'dayinputnoreduce', 'tzuserrel') . '\');';
7126
-			$reset_scripts .= 'jQuery(\'#' . $prefix . 'day\').val(\'' . dol_print_date($nowgmt, '%d', 'tzuserrel') . '\');';
7127
-			$reset_scripts .= 'jQuery(\'#' . $prefix . 'month\').val(\'' . dol_print_date($nowgmt, '%m', 'tzuserrel') . '\');';
7128
-			$reset_scripts .= 'jQuery(\'#' . $prefix . 'year\').val(\'' . dol_print_date($nowgmt, '%Y', 'tzuserrel') . '\');';
7125
+			$reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'dayinputnoreduce', 'tzuserrel').'\');';
7126
+			$reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');';
7127
+			$reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');';
7128
+			$reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');';
7129 7129
 			// Update the hour part
7130 7130
 			if ($h) {
7131 7131
 				if ($fullday) {
7132 7132
 					$reset_scripts .= " if (jQuery('#fullday:checked').val() == null) {";
7133 7133
 				}
7134
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').val(\'' . dol_print_date($nowgmt, '%H', 'tzuserrel') . '\');';
7134
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(\''.dol_print_date($nowgmt, '%H', 'tzuserrel').'\');';
7135 7135
 				if ($fullday) {
7136 7136
 					$reset_scripts .= ' } ';
7137 7137
 				}
@@ -7141,14 +7141,14 @@  discard block
 block discarded – undo
7141 7141
 				if ($fullday) {
7142 7142
 					$reset_scripts .= " if (jQuery('#fullday:checked').val() == null) {";
7143 7143
 				}
7144
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').val(\'' . dol_print_date($nowgmt, '%M', 'tzuserrel') . '\');';
7144
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(\''.dol_print_date($nowgmt, '%M', 'tzuserrel').'\');';
7145 7145
 				if ($fullday) {
7146 7146
 					$reset_scripts .= ' } ';
7147 7147
 				}
7148 7148
 			}
7149 7149
 			// If reset_scripts is not empty, print the link with the reset_scripts in the onClick
7150 7150
 			if ($reset_scripts && empty($conf->dol_optimize_smallscreen)) {
7151
-				$retstring .= ' <button class="dpInvisibleButtons datenowlink" id="' . $prefix . 'ButtonPlusOne" type="button" name="_useless2" value="plusone" onClick="' . $reset_scripts . '">';
7151
+				$retstring .= ' <button class="dpInvisibleButtons datenowlink" id="'.$prefix.'ButtonPlusOne" type="button" name="_useless2" value="plusone" onClick="'.$reset_scripts.'">';
7152 7152
 				$retstring .= $langs->trans("DateStartPlusOne");
7153 7153
 				$retstring .= '</button> ';
7154 7154
 			}
@@ -7206,17 +7206,17 @@  discard block
 block discarded – undo
7206 7206
 			unset($TDurationTypes[$value]);
7207 7207
 		}
7208 7208
 
7209
-		$retstring = '<select class="flat minwidth75 maxwidth100" id="select_' . $prefix . 'type_duration" name="' . $prefix . 'type_duration">';
7209
+		$retstring = '<select class="flat minwidth75 maxwidth100" id="select_'.$prefix.'type_duration" name="'.$prefix.'type_duration">';
7210 7210
 		foreach ($TDurationTypes as $key => $typeduration) {
7211
-			$retstring .= '<option value="' . $key . '"';
7211
+			$retstring .= '<option value="'.$key.'"';
7212 7212
 			if ($key == $selected) {
7213 7213
 				$retstring .= " selected";
7214 7214
 			}
7215
-			$retstring .= ">" . $typeduration . "</option>";
7215
+			$retstring .= ">".$typeduration."</option>";
7216 7216
 		}
7217 7217
 		$retstring .= "</select>";
7218 7218
 
7219
-		$retstring .= ajax_combobox('select_' . $prefix . 'type_duration');
7219
+		$retstring .= ajax_combobox('select_'.$prefix.'type_duration');
7220 7220
 
7221 7221
 		return $retstring;
7222 7222
 	}
@@ -7248,30 +7248,30 @@  discard block
 block discarded – undo
7248 7248
 
7249 7249
 		// Hours
7250 7250
 		if ($iSecond != '') {
7251
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
7251
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
7252 7252
 
7253 7253
 			$hourSelected = convertSecondToTime($iSecond, 'allhour');
7254 7254
 			$minSelected = convertSecondToTime($iSecond, 'min');
7255 7255
 		}
7256 7256
 
7257 7257
 		if ($typehour == 'select') {
7258
-			$retstring .= '<select class="flat" id="select_' . $prefix . 'hour" name="' . $prefix . 'hour"' . ($disabled ? ' disabled' : '') . '>';
7258
+			$retstring .= '<select class="flat" id="select_'.$prefix.'hour" name="'.$prefix.'hour"'.($disabled ? ' disabled' : '').'>';
7259 7259
 			for ($hour = 0; $hour < 25; $hour++) {    // For a duration, we allow 24 hours
7260
-				$retstring .= '<option value="' . $hour . '"';
7260
+				$retstring .= '<option value="'.$hour.'"';
7261 7261
 				if (is_numeric($hourSelected) && $hourSelected == $hour) {
7262 7262
 					$retstring .= " selected";
7263 7263
 				}
7264
-				$retstring .= ">" . $hour . "</option>";
7264
+				$retstring .= ">".$hour."</option>";
7265 7265
 			}
7266 7266
 			$retstring .= "</select>";
7267 7267
 		} elseif ($typehour == 'text' || $typehour == 'textselect') {
7268
-			$retstring .= '<input placeholder="' . $langs->trans('HourShort') . '" type="number" min="0" name="' . $prefix . 'hour"' . ($disabled ? ' disabled' : '') . ' class="flat maxwidth50 inputhour right" value="' . (($hourSelected != '') ? ((int) $hourSelected) : '') . '">';
7268
+			$retstring .= '<input placeholder="'.$langs->trans('HourShort').'" type="number" min="0" name="'.$prefix.'hour"'.($disabled ? ' disabled' : '').' class="flat maxwidth50 inputhour right" value="'.(($hourSelected != '') ? ((int) $hourSelected) : '').'">';
7269 7269
 		} else {
7270 7270
 			return 'BadValueForParameterTypeHour';
7271 7271
 		}
7272 7272
 
7273 7273
 		if ($typehour != 'text') {
7274
-			$retstring .= ' ' . $langs->trans('HourShort');
7274
+			$retstring .= ' '.$langs->trans('HourShort');
7275 7275
 		} else {
7276 7276
 			$retstring .= '<span class="">:</span>';
7277 7277
 		}
@@ -7286,21 +7286,21 @@  discard block
 block discarded – undo
7286 7286
 		}
7287 7287
 
7288 7288
 		if ($typehour == 'select' || $typehour == 'textselect') {
7289
-			$retstring .= '<select class="flat" id="select_' . $prefix . 'min" name="' . $prefix . 'min"' . ($disabled ? ' disabled' : '') . '>';
7289
+			$retstring .= '<select class="flat" id="select_'.$prefix.'min" name="'.$prefix.'min"'.($disabled ? ' disabled' : '').'>';
7290 7290
 			for ($min = 0; $min <= 55; $min = $min + 5) {
7291
-				$retstring .= '<option value="' . $min . '"';
7291
+				$retstring .= '<option value="'.$min.'"';
7292 7292
 				if (is_numeric($minSelected) && $minSelected == $min) {
7293 7293
 					$retstring .= ' selected';
7294 7294
 				}
7295
-				$retstring .= '>' . $min . '</option>';
7295
+				$retstring .= '>'.$min.'</option>';
7296 7296
 			}
7297 7297
 			$retstring .= "</select>";
7298 7298
 		} elseif ($typehour == 'text') {
7299
-			$retstring .= '<input placeholder="' . $langs->trans('MinuteShort') . '" type="number" min="0" name="' . $prefix . 'min"' . ($disabled ? ' disabled' : '') . ' class="flat maxwidth50 inputminute right" value="' . (($minSelected != '') ? ((int) $minSelected) : '') . '">';
7299
+			$retstring .= '<input placeholder="'.$langs->trans('MinuteShort').'" type="number" min="0" name="'.$prefix.'min"'.($disabled ? ' disabled' : '').' class="flat maxwidth50 inputminute right" value="'.(($minSelected != '') ? ((int) $minSelected) : '').'">';
7300 7300
 		}
7301 7301
 
7302 7302
 		if ($typehour != 'text') {
7303
-			$retstring .= ' ' . $langs->trans('MinuteShort');
7303
+			$retstring .= ' '.$langs->trans('MinuteShort');
7304 7304
 		}
7305 7305
 
7306 7306
 		$retstring .= "</span>";
@@ -7348,7 +7348,7 @@  discard block
 block discarded – undo
7348 7348
 			$placeholder = '';
7349 7349
 
7350 7350
 			if ($selected && empty($selected_input_value)) {
7351
-				require_once DOL_DOCUMENT_ROOT . '/ticket/class/ticket.class.php';
7351
+				require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php';
7352 7352
 				$tickettmpselect = new Ticket($this->db);
7353 7353
 				$tickettmpselect->fetch($selected);
7354 7354
 				$selected_input_value = $tickettmpselect->ref;
@@ -7356,17 +7356,17 @@  discard block
 block discarded – undo
7356 7356
 			}
7357 7357
 
7358 7358
 			$urloption = '';
7359
-			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/ticket/ajax/tickets.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
7359
+			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/ticket/ajax/tickets.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
7360 7360
 
7361 7361
 			if (empty($hidelabel)) {
7362
-				$out .= $langs->trans("RefOrLabel") . ' : ';
7362
+				$out .= $langs->trans("RefOrLabel").' : ';
7363 7363
 			} elseif ($hidelabel > 1) {
7364
-				$placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"';
7364
+				$placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"';
7365 7365
 				if ($hidelabel == 2) {
7366 7366
 					$out .= img_picto($langs->trans("Search"), 'search');
7367 7367
 				}
7368 7368
 			}
7369
-			$out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />';
7369
+			$out .= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />';
7370 7370
 			if ($hidelabel == 3) {
7371 7371
 				$out .= img_picto($langs->trans("Search"), 'search');
7372 7372
 			}
@@ -7410,8 +7410,8 @@  discard block
 block discarded – undo
7410 7410
 
7411 7411
 		$sql = "SELECT ";
7412 7412
 		$sql .= $selectFields;
7413
-		$sql .= " FROM " . $this->db->prefix() . "ticket as p";
7414
-		$sql .= ' WHERE p.entity IN (' . getEntity('ticket') . ')';
7413
+		$sql .= " FROM ".$this->db->prefix()."ticket as p";
7414
+		$sql .= ' WHERE p.entity IN ('.getEntity('ticket').')';
7415 7415
 
7416 7416
 		// Add criteria on ref/label
7417 7417
 		if ($filterkey != '') {
@@ -7427,7 +7427,7 @@  discard block
 block discarded – undo
7427 7427
 				if ($i > 0) {
7428 7428
 					$sql .= " AND ";
7429 7429
 				}
7430
-				$sql .= "(p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%' OR p.subject LIKE '" . $this->db->escape($prefix . $crit) . "%'";
7430
+				$sql .= "(p.ref LIKE '".$this->db->escape($prefix.$crit)."%' OR p.subject LIKE '".$this->db->escape($prefix.$crit)."%'";
7431 7431
 				$sql .= ")";
7432 7432
 				$i++;
7433 7433
 			}
@@ -7440,22 +7440,22 @@  discard block
 block discarded – undo
7440 7440
 		$sql .= $this->db->plimit($limit, 0);
7441 7441
 
7442 7442
 		// Build output string
7443
-		dol_syslog(get_class($this) . "::selectTicketsList search tickets", LOG_DEBUG);
7443
+		dol_syslog(get_class($this)."::selectTicketsList search tickets", LOG_DEBUG);
7444 7444
 		$result = $this->db->query($sql);
7445 7445
 		if ($result) {
7446
-			require_once DOL_DOCUMENT_ROOT . '/ticket/class/ticket.class.php';
7447
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/ticket.lib.php';
7446
+			require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php';
7447
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/ticket.lib.php';
7448 7448
 
7449 7449
 			$num = $this->db->num_rows($result);
7450 7450
 
7451 7451
 			$events = null;
7452 7452
 
7453 7453
 			if (!$forcecombo) {
7454
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
7454
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
7455 7455
 				$out .= ajax_combobox($htmlname, $events, $conf->global->TICKET_USE_SEARCH_TO_SELECT);
7456 7456
 			}
7457 7457
 
7458
-			$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
7458
+			$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
7459 7459
 
7460 7460
 			$textifempty = '';
7461 7461
 			// Do not use textifempty = ' ' or '&nbsp;' here, or search on key will search on ' key'.
@@ -7472,7 +7472,7 @@  discard block
 block discarded – undo
7472 7472
 				}
7473 7473
 			}
7474 7474
 			if ($showempty) {
7475
-				$out .= '<option value="0" selected>' . $textifempty . '</option>';
7475
+				$out .= '<option value="0" selected>'.$textifempty.'</option>';
7476 7476
 			}
7477 7477
 
7478 7478
 			$i = 0;
@@ -7527,13 +7527,13 @@  discard block
 block discarded – undo
7527 7527
 		$outref = $objp->ref;
7528 7528
 		$outtype = $objp->fk_product_type;
7529 7529
 
7530
-		$opt = '<option value="' . $objp->rowid . '"';
7530
+		$opt = '<option value="'.$objp->rowid.'"';
7531 7531
 		$opt .= ($objp->rowid == $selected) ? ' selected' : '';
7532 7532
 		$opt .= '>';
7533 7533
 		$opt .= $objp->ref;
7534 7534
 		$objRef = $objp->ref;
7535 7535
 		if (!empty($filterkey) && $filterkey != '') {
7536
-			$objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1);
7536
+			$objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1);
7537 7537
 		}
7538 7538
 
7539 7539
 		$opt .= "</option>\n";
@@ -7574,7 +7574,7 @@  discard block
 block discarded – undo
7574 7574
 			$placeholder = '';
7575 7575
 
7576 7576
 			if ($selected && empty($selected_input_value)) {
7577
-				require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
7577
+				require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
7578 7578
 				$projecttmpselect = new Project($this->db);
7579 7579
 				$projecttmpselect->fetch($selected);
7580 7580
 				$selected_input_value = $projecttmpselect->ref;
@@ -7582,17 +7582,17 @@  discard block
 block discarded – undo
7582 7582
 			}
7583 7583
 
7584 7584
 			$urloption = '';
7585
-			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/projet/ajax/projects.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
7585
+			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/projet/ajax/projects.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
7586 7586
 
7587 7587
 			if (empty($hidelabel)) {
7588
-				$out .= $langs->trans("RefOrLabel") . ' : ';
7588
+				$out .= $langs->trans("RefOrLabel").' : ';
7589 7589
 			} elseif ($hidelabel > 1) {
7590
-				$placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"';
7590
+				$placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"';
7591 7591
 				if ($hidelabel == 2) {
7592 7592
 					$out .= img_picto($langs->trans("Search"), 'search');
7593 7593
 				}
7594 7594
 			}
7595
-			$out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />';
7595
+			$out .= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />';
7596 7596
 			if ($hidelabel == 3) {
7597 7597
 				$out .= img_picto($langs->trans("Search"), 'search');
7598 7598
 			}
@@ -7635,8 +7635,8 @@  discard block
 block discarded – undo
7635 7635
 
7636 7636
 		$sql = "SELECT ";
7637 7637
 		$sql .= $selectFields;
7638
-		$sql .= " FROM " . $this->db->prefix() . "projet as p";
7639
-		$sql .= ' WHERE p.entity IN (' . getEntity('project') . ')';
7638
+		$sql .= " FROM ".$this->db->prefix()."projet as p";
7639
+		$sql .= ' WHERE p.entity IN ('.getEntity('project').')';
7640 7640
 
7641 7641
 		// Add criteria on ref/label
7642 7642
 		if ($filterkey != '') {
@@ -7652,7 +7652,7 @@  discard block
 block discarded – undo
7652 7652
 				if ($i > 0) {
7653 7653
 					$sql .= " AND ";
7654 7654
 				}
7655
-				$sql .= "p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%'";
7655
+				$sql .= "p.ref LIKE '".$this->db->escape($prefix.$crit)."%'";
7656 7656
 				$sql .= "";
7657 7657
 				$i++;
7658 7658
 			}
@@ -7665,22 +7665,22 @@  discard block
 block discarded – undo
7665 7665
 		$sql .= $this->db->plimit($limit, 0);
7666 7666
 
7667 7667
 		// Build output string
7668
-		dol_syslog(get_class($this) . "::selectProjectsList search projects", LOG_DEBUG);
7668
+		dol_syslog(get_class($this)."::selectProjectsList search projects", LOG_DEBUG);
7669 7669
 		$result = $this->db->query($sql);
7670 7670
 		if ($result) {
7671
-			require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
7672
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php';
7671
+			require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
7672
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
7673 7673
 
7674 7674
 			$num = $this->db->num_rows($result);
7675 7675
 
7676 7676
 			$events = null;
7677 7677
 
7678 7678
 			if (!$forcecombo) {
7679
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
7679
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
7680 7680
 				$out .= ajax_combobox($htmlname, $events, $conf->global->PROJECT_USE_SEARCH_TO_SELECT);
7681 7681
 			}
7682 7682
 
7683
-			$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
7683
+			$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
7684 7684
 
7685 7685
 			$textifempty = '';
7686 7686
 			// Do not use textifempty = ' ' or '&nbsp;' here, or search on key will search on ' key'.
@@ -7697,7 +7697,7 @@  discard block
 block discarded – undo
7697 7697
 				}
7698 7698
 			}
7699 7699
 			if ($showempty) {
7700
-				$out .= '<option value="0" selected>' . $textifempty . '</option>';
7700
+				$out .= '<option value="0" selected>'.$textifempty.'</option>';
7701 7701
 			}
7702 7702
 
7703 7703
 			$i = 0;
@@ -7755,13 +7755,13 @@  discard block
 block discarded – undo
7755 7755
 		$outlabel = $objp->label;
7756 7756
 		$outtype = $objp->fk_product_type;
7757 7757
 
7758
-		$opt = '<option value="' . $objp->rowid . '"';
7758
+		$opt = '<option value="'.$objp->rowid.'"';
7759 7759
 		$opt .= ($objp->rowid == $selected) ? ' selected' : '';
7760 7760
 		$opt .= '>';
7761 7761
 		$opt .= $objp->ref;
7762 7762
 		$objRef = $objp->ref;
7763 7763
 		if (!empty($filterkey) && $filterkey != '') {
7764
-			$objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1);
7764
+			$objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1);
7765 7765
 		}
7766 7766
 
7767 7767
 		$opt .= "</option>\n";
@@ -7804,7 +7804,7 @@  discard block
 block discarded – undo
7804 7804
 			$urloption = '';
7805 7805
 
7806 7806
 			if ($selected && empty($selected_input_value)) {
7807
-				require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php';
7807
+				require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
7808 7808
 				$adherenttmpselect = new Adherent($this->db);
7809 7809
 				$adherenttmpselect->fetch($selected);
7810 7810
 				$selected_input_value = $adherenttmpselect->ref;
@@ -7813,17 +7813,17 @@  discard block
 block discarded – undo
7813 7813
 
7814 7814
 			$urloption = '';
7815 7815
 
7816
-			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/adherents/ajax/adherents.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
7816
+			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/adherents/ajax/adherents.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
7817 7817
 
7818 7818
 			if (empty($hidelabel)) {
7819
-				$out .= $langs->trans("RefOrLabel") . ' : ';
7819
+				$out .= $langs->trans("RefOrLabel").' : ';
7820 7820
 			} elseif ($hidelabel > 1) {
7821
-				$placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"';
7821
+				$placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"';
7822 7822
 				if ($hidelabel == 2) {
7823 7823
 					$out .= img_picto($langs->trans("Search"), 'search');
7824 7824
 				}
7825 7825
 			}
7826
-			$out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />';
7826
+			$out .= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />';
7827 7827
 			if ($hidelabel == 3) {
7828 7828
 				$out .= img_picto($langs->trans("Search"), 'search');
7829 7829
 			}
@@ -7868,8 +7868,8 @@  discard block
 block discarded – undo
7868 7868
 
7869 7869
 		$sql = "SELECT ";
7870 7870
 		$sql .= $selectFields;
7871
-		$sql .= " FROM " . $this->db->prefix() . "adherent as p";
7872
-		$sql .= ' WHERE p.entity IN (' . getEntity('adherent') . ')';
7871
+		$sql .= " FROM ".$this->db->prefix()."adherent as p";
7872
+		$sql .= ' WHERE p.entity IN ('.getEntity('adherent').')';
7873 7873
 
7874 7874
 		// Add criteria on ref/label
7875 7875
 		if ($filterkey != '') {
@@ -7885,8 +7885,8 @@  discard block
 block discarded – undo
7885 7885
 				if ($i > 0) {
7886 7886
 					$sql .= " AND ";
7887 7887
 				}
7888
-				$sql .= "(p.firstname LIKE '" . $this->db->escape($prefix . $crit) . "%'";
7889
-				$sql .= " OR p.lastname LIKE '" . $this->db->escape($prefix . $crit) . "%')";
7888
+				$sql .= "(p.firstname LIKE '".$this->db->escape($prefix.$crit)."%'";
7889
+				$sql .= " OR p.lastname LIKE '".$this->db->escape($prefix.$crit)."%')";
7890 7890
 				$i++;
7891 7891
 			}
7892 7892
 			if (count($scrit) > 1) {
@@ -7895,27 +7895,27 @@  discard block
 block discarded – undo
7895 7895
 			$sql .= ')';
7896 7896
 		}
7897 7897
 		if ($status != -1) {
7898
-			$sql .= ' AND statut = ' . ((int) $status);
7898
+			$sql .= ' AND statut = '.((int) $status);
7899 7899
 		}
7900 7900
 		$sql .= $this->db->plimit($limit, 0);
7901 7901
 
7902 7902
 		// Build output string
7903
-		dol_syslog(get_class($this) . "::selectMembersList search adherents", LOG_DEBUG);
7903
+		dol_syslog(get_class($this)."::selectMembersList search adherents", LOG_DEBUG);
7904 7904
 		$result = $this->db->query($sql);
7905 7905
 		if ($result) {
7906
-			require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php';
7907
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/member.lib.php';
7906
+			require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
7907
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
7908 7908
 
7909 7909
 			$num = $this->db->num_rows($result);
7910 7910
 
7911 7911
 			$events = null;
7912 7912
 
7913 7913
 			if (!$forcecombo) {
7914
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
7914
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
7915 7915
 				$out .= ajax_combobox($htmlname, $events, getDolGlobalString('PROJECT_USE_SEARCH_TO_SELECT') ? $conf->global->PROJECT_USE_SEARCH_TO_SELECT : '');
7916 7916
 			}
7917 7917
 
7918
-			$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
7918
+			$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
7919 7919
 
7920 7920
 			$textifempty = '';
7921 7921
 			// Do not use textifempty = ' ' or '&nbsp;' here, or search on key will search on ' key'.
@@ -7932,7 +7932,7 @@  discard block
 block discarded – undo
7932 7932
 				}
7933 7933
 			}
7934 7934
 			if ($showempty) {
7935
-				$out .= '<option value="-1" selected>' . $textifempty . '</option>';
7935
+				$out .= '<option value="-1" selected>'.$textifempty.'</option>';
7936 7936
 			}
7937 7937
 
7938 7938
 			$i = 0;
@@ -7988,11 +7988,11 @@  discard block
 block discarded – undo
7988 7988
 		$outlabel = dolGetFirstLastname($objp->firstname, $objp->lastname);
7989 7989
 		$outtype = $objp->fk_adherent_type;
7990 7990
 
7991
-		$opt = '<option value="' . $objp->rowid . '"';
7991
+		$opt = '<option value="'.$objp->rowid.'"';
7992 7992
 		$opt .= ($objp->rowid == $selected) ? ' selected' : '';
7993 7993
 		$opt .= '>';
7994 7994
 		if (!empty($filterkey) && $filterkey != '') {
7995
-			$outlabel = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $outlabel, 1);
7995
+			$outlabel = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $outlabel, 1);
7996 7996
 		}
7997 7997
 		$opt .= $outlabel;
7998 7998
 		$opt .= "</option>\n";
@@ -8065,9 +8065,9 @@  discard block
 block discarded – undo
8065 8065
 			$vartmp = (empty($InfoFieldList[3]) ? '' : $InfoFieldList[3]);
8066 8066
 			$reg = array();
8067 8067
 			if (preg_match('/^.*:(\w*)$/', $vartmp, $reg)) {
8068
-				$InfoFieldList[4] = $reg[1];    // take the sort field
8068
+				$InfoFieldList[4] = $reg[1]; // take the sort field
8069 8069
 			}
8070
-			$InfoFieldList[3] = preg_replace('/:\w*$/', '', $vartmp);    // take the filter field
8070
+			$InfoFieldList[3] = preg_replace('/:\w*$/', '', $vartmp); // take the filter field
8071 8071
 
8072 8072
 			$classname = $InfoFieldList[0];
8073 8073
 			$classpath = $InfoFieldList[1];
@@ -8098,8 +8098,8 @@  discard block
 block discarded – undo
8098 8098
 		);
8099 8099
 
8100 8100
 		if (!is_object($objecttmp)) {
8101
-			dol_syslog('selectForForms: Error bad setup of field objectdescorig=' . $objectdescorig.', objectfield='.$objectfield, LOG_WARNING);
8102
-			return 'selectForForms: Error bad setup of field objectdescorig=' . $objectdescorig.', objectfield='.$objectfield;
8101
+			dol_syslog('selectForForms: Error bad setup of field objectdescorig='.$objectdescorig.', objectfield='.$objectfield, LOG_WARNING);
8102
+			return 'selectForForms: Error bad setup of field objectdescorig='.$objectdescorig.', objectfield='.$objectfield;
8103 8103
 		}
8104 8104
 
8105 8105
 		//var_dump($filter);
@@ -8110,9 +8110,9 @@  discard block
 block discarded – undo
8110 8110
 		if ($prefixforautocompletemode == 'product') {
8111 8111
 			$prefixforautocompletemode = 'produit';
8112 8112
 		}
8113
-		$confkeyforautocompletemode = strtoupper($prefixforautocompletemode) . '_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT
8113
+		$confkeyforautocompletemode = strtoupper($prefixforautocompletemode).'_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT
8114 8114
 
8115
-		dol_syslog(get_class($this) . "::selectForForms filter=" . $filter, LOG_DEBUG);
8115
+		dol_syslog(get_class($this)."::selectForForms filter=".$filter, LOG_DEBUG);
8116 8116
 
8117 8117
 		// Generate the combo HTML component
8118 8118
 		$out = '';
@@ -8126,13 +8126,13 @@  discard block
 block discarded – undo
8126 8126
 			}
8127 8127
 
8128 8128
 			// Set url and param to call to get json of the search results
8129
-			$urlforajaxcall = DOL_URL_ROOT . '/core/ajax/selectobject.php';
8130
-			$urloption = 'htmlname=' . urlencode($htmlname) . '&outjson=1&objectdesc=' . urlencode($objectdescorig) . '&objectfield='.urlencode($objectfield) . ($sortfield ? '&sortfield=' . urlencode($sortfield) : '');
8129
+			$urlforajaxcall = DOL_URL_ROOT.'/core/ajax/selectobject.php';
8130
+			$urloption = 'htmlname='.urlencode($htmlname).'&outjson=1&objectdesc='.urlencode($objectdescorig).'&objectfield='.urlencode($objectfield).($sortfield ? '&sortfield='.urlencode($sortfield) : '');
8131 8131
 
8132 8132
 			// Activate the auto complete using ajax call.
8133 8133
 			$out .= ajax_autocompleter($preselectedvalue, $htmlname, $urlforajaxcall, $urloption, getDolGlobalString($confkeyforautocompletemode), 0, array());
8134 8134
 			$out .= '<!-- force css to be higher than dialog popup --><style type="text/css">.ui-autocomplete { z-index: 1010; }</style>';
8135
-			$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) . '"' : '') . ' />';
8135
+			$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).'"' : '').' />';
8136 8136
 		} else {
8137 8137
 			// Immediate load of table record.
8138 8138
 			$out .= $this->selectForFormsList($objecttmp, $htmlname, $preselectedvalue, $showempty, $searchkey, $placeholder, $morecss, $moreparams, $forcecombo, 0, $disabled, $sortfield, $filter);
@@ -8172,7 +8172,7 @@  discard block
 block discarded – undo
8172 8172
 		if ($prefixforautocompletemode == 'societe') {
8173 8173
 			$prefixforautocompletemode = 'company';
8174 8174
 		}
8175
-		$confkeyforautocompletemode = strtoupper($prefixforautocompletemode) . '_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT
8175
+		$confkeyforautocompletemode = strtoupper($prefixforautocompletemode).'_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT
8176 8176
 
8177 8177
 		if (!empty($objecttmp->fields)) {    // For object that declare it, it is better to use declared fields (like societe, contact, ...)
8178 8178
 			$tmpfieldstoshow = '';
@@ -8181,7 +8181,7 @@  discard block
 block discarded – undo
8181 8181
 					continue;
8182 8182
 				}
8183 8183
 				if (!empty($val['showoncombobox'])) {
8184
-					$tmpfieldstoshow .= ($tmpfieldstoshow ? ',' : '') . 't.' . $key;
8184
+					$tmpfieldstoshow .= ($tmpfieldstoshow ? ',' : '').'t.'.$key;
8185 8185
 				}
8186 8186
 			}
8187 8187
 			if ($tmpfieldstoshow) {
@@ -8209,18 +8209,18 @@  discard block
 block discarded – undo
8209 8209
 		$num = 0;
8210 8210
 
8211 8211
 		// Search data
8212
-		$sql = "SELECT t.rowid, " . $fieldstoshow . " FROM " . $this->db->prefix() . $objecttmp->table_element . " as t";
8212
+		$sql = "SELECT t.rowid, ".$fieldstoshow." FROM ".$this->db->prefix().$objecttmp->table_element." as t";
8213 8213
 		if (!empty($objecttmp->isextrafieldmanaged)) {
8214
-			$sql .= " LEFT JOIN " . $this->db->prefix() . $objecttmp->table_element . "_extrafields as e ON t.rowid=e.fk_object";
8214
+			$sql .= " LEFT JOIN ".$this->db->prefix().$objecttmp->table_element."_extrafields as e ON t.rowid=e.fk_object";
8215 8215
 		}
8216 8216
 		if (isset($objecttmp->ismultientitymanaged)) {
8217 8217
 			if (!is_numeric($objecttmp->ismultientitymanaged)) {
8218 8218
 				$tmparray = explode('@', $objecttmp->ismultientitymanaged);
8219
-				$sql .= " INNER JOIN " . $this->db->prefix() . $tmparray[1] . " as parenttable ON parenttable.rowid = t." . $tmparray[0];
8219
+				$sql .= " INNER JOIN ".$this->db->prefix().$tmparray[1]." as parenttable ON parenttable.rowid = t.".$tmparray[0];
8220 8220
 			}
8221 8221
 			if ($objecttmp->ismultientitymanaged === 'fk_soc@societe') {
8222 8222
 				if (!$user->hasRight('societe', 'client', 'voir')) {
8223
-					$sql .= ", " . $this->db->prefix() . "societe_commerciaux as sc";
8223
+					$sql .= ", ".$this->db->prefix()."societe_commerciaux as sc";
8224 8224
 				}
8225 8225
 			}
8226 8226
 		}
@@ -8240,21 +8240,21 @@  discard block
 block discarded – undo
8240 8240
 			$sql .= " WHERE 1=1";
8241 8241
 			if (isset($objecttmp->ismultientitymanaged)) {
8242 8242
 				if ($objecttmp->ismultientitymanaged == 1) {
8243
-					$sql .= " AND t.entity IN (" . getEntity($objecttmp->table_element) . ")";
8243
+					$sql .= " AND t.entity IN (".getEntity($objecttmp->table_element).")";
8244 8244
 				}
8245 8245
 				if (!is_numeric($objecttmp->ismultientitymanaged)) {
8246
-					$sql .= " AND parenttable.entity = t." . $tmparray[0];
8246
+					$sql .= " AND parenttable.entity = t.".$tmparray[0];
8247 8247
 				}
8248 8248
 				if ($objecttmp->ismultientitymanaged == 1 && !empty($user->socid)) {
8249 8249
 					if ($objecttmp->element == 'societe') {
8250
-						$sql .= " AND t.rowid = " . ((int) $user->socid);
8250
+						$sql .= " AND t.rowid = ".((int) $user->socid);
8251 8251
 					} else {
8252
-						$sql .= " AND t.fk_soc = " . ((int) $user->socid);
8252
+						$sql .= " AND t.fk_soc = ".((int) $user->socid);
8253 8253
 					}
8254 8254
 				}
8255 8255
 				if ($objecttmp->ismultientitymanaged === 'fk_soc@societe') {
8256 8256
 					if (!$user->hasRight('societe', 'client', 'voir')) {
8257
-						$sql .= " AND t.rowid = sc.fk_soc AND sc.fk_user = " . ((int) $user->id);
8257
+						$sql .= " AND t.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
8258 8258
 					}
8259 8259
 				}
8260 8260
 			}
@@ -8266,7 +8266,7 @@  discard block
 block discarded – undo
8266 8266
 				$errormessage = '';
8267 8267
 				$sql .= forgeSQLFromUniversalSearchCriteria($filter, $errormessage);
8268 8268
 				if ($errormessage) {
8269
-					return 'Error forging a SQL request from an universal criteria: ' . $errormessage;
8269
+					return 'Error forging a SQL request from an universal criteria: '.$errormessage;
8270 8270
 				}
8271 8271
 			}
8272 8272
 		}
@@ -8278,7 +8278,7 @@  discard block
 block discarded – undo
8278 8278
 		$resql = $this->db->query($sql);
8279 8279
 		if ($resql) {
8280 8280
 			// Construct $out and $outarray
8281
-			$out .= '<select id="' . $htmlname . '" class="flat minwidth100' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ($moreparams ? ' ' . $moreparams : '') . ' name="' . $htmlname . '">' . "\n";
8281
+			$out .= '<select id="'.$htmlname.'" class="flat minwidth100'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').($moreparams ? ' '.$moreparams : '').' name="'.$htmlname.'">'."\n";
8282 8282
 
8283 8283
 			// 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
8284 8284
 			$textifempty = '&nbsp;';
@@ -8292,7 +8292,7 @@  discard block
 block discarded – undo
8292 8292
 				}
8293 8293
 			}
8294 8294
 			if ($showempty) {
8295
-				$out .= '<option value="-1">' . $textifempty . '</option>' . "\n";
8295
+				$out .= '<option value="-1">'.$textifempty.'</option>'."\n";
8296 8296
 			}
8297 8297
 
8298 8298
 			$num = $this->db->num_rows($resql);
@@ -8315,9 +8315,9 @@  discard block
 block discarded – undo
8315 8315
 					}
8316 8316
 					if (empty($outputmode)) {
8317 8317
 						if ($preselectedvalue > 0 && $preselectedvalue == $obj->rowid) {
8318
-							$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>';
8318
+							$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>';
8319 8319
 						} else {
8320
-							$out .= '<option value="' . $obj->rowid . '" data-html="' . dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1) . '">' . dol_escape_htmltag($label, 0, 0, '', 0, 1) . '</option>';
8320
+							$out .= '<option value="'.$obj->rowid.'" data-html="'.dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1).'">'.dol_escape_htmltag($label, 0, 0, '', 0, 1).'</option>';
8321 8321
 						}
8322 8322
 					} else {
8323 8323
 						array_push($outarray, array('key' => $obj->rowid, 'value' => $label, 'label' => $label));
@@ -8330,10 +8330,10 @@  discard block
 block discarded – undo
8330 8330
 				}
8331 8331
 			}
8332 8332
 
8333
-			$out .= '</select>' . "\n";
8333
+			$out .= '</select>'."\n";
8334 8334
 
8335 8335
 			if (!$forcecombo) {
8336
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
8336
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
8337 8337
 				$out .= ajax_combobox($htmlname, null, getDolGlobalInt($confkeyforautocompletemode, 0));
8338 8338
 			}
8339 8339
 		} else {
@@ -8395,8 +8395,8 @@  discard block
 block discarded – undo
8395 8395
 			}
8396 8396
 		}
8397 8397
 		$idname = str_replace(array('[', ']'), array('', ''), $htmlname);
8398
-		$out .= '<select id="' . preg_replace('/^\./', '', $idname) . '" ' . ($disabled ? 'disabled="disabled" ' : '') . 'class="flat ' . (preg_replace('/^\./', '', $htmlname)) . ($morecss ? ' ' . $morecss : '') . ' selectformat"';
8399
-		$out .= ' name="' . preg_replace('/^\./', '', $htmlname) . '" ' . ($moreparam ? $moreparam : '');
8398
+		$out .= '<select id="'.preg_replace('/^\./', '', $idname).'" '.($disabled ? 'disabled="disabled" ' : '').'class="flat '.(preg_replace('/^\./', '', $htmlname)).($morecss ? ' '.$morecss : '').' selectformat"';
8399
+		$out .= ' name="'.preg_replace('/^\./', '', $htmlname).'" '.($moreparam ? $moreparam : '');
8400 8400
 		$out .= '>'."\n";
8401 8401
 
8402 8402
 		if ($show_empty) {
@@ -8407,7 +8407,7 @@  discard block
 block discarded – undo
8407 8407
 			if (!is_numeric($show_empty)) {
8408 8408
 				$textforempty = $show_empty;
8409 8409
 			}
8410
-			$out .= '<option class="optiongrey" ' . ($moreparamonempty ? $moreparamonempty . ' ' : '') . 'value="' . (((int) $show_empty) < 0 ? $show_empty : -1) . '"' . ($id == $show_empty ? ' selected' : '') . '>' . $textforempty . '</option>' . "\n";
8410
+			$out .= '<option class="optiongrey" '.($moreparamonempty ? $moreparamonempty.' ' : '').'value="'.(((int) $show_empty) < 0 ? $show_empty : -1).'"'.($id == $show_empty ? ' selected' : '').'>'.$textforempty.'</option>'."\n";
8411 8411
 		}
8412 8412
 		if (is_array($array)) {
8413 8413
 			// Translate
@@ -8430,7 +8430,7 @@  discard block
 block discarded – undo
8430 8430
 				if (is_array($tmpvalue)) {
8431 8431
 					$value = $tmpvalue['label'];
8432 8432
 					$disabled = empty($tmpvalue['disabled']) ? '' : ' disabled';
8433
-					$style = empty($tmpvalue['css']) ? '' : ' class="' . $tmpvalue['css'] . '"';
8433
+					$style = empty($tmpvalue['css']) ? '' : ' class="'.$tmpvalue['css'].'"';
8434 8434
 				} else {
8435 8435
 					$value = $tmpvalue;
8436 8436
 					$disabled = '';
@@ -8445,9 +8445,9 @@  discard block
 block discarded – undo
8445 8445
 				}
8446 8446
 				if ($key_in_label) {
8447 8447
 					if (empty($nohtmlescape)) {
8448
-						$selectOptionValue = dol_escape_htmltag($key . ' - ' . ($maxlen ? dol_trunc($value, $maxlen) : $value));
8448
+						$selectOptionValue = dol_escape_htmltag($key.' - '.($maxlen ? dol_trunc($value, $maxlen) : $value));
8449 8449
 					} else {
8450
-						$selectOptionValue = $key . ' - ' . ($maxlen ? dol_trunc($value, $maxlen) : $value);
8450
+						$selectOptionValue = $key.' - '.($maxlen ? dol_trunc($value, $maxlen) : $value);
8451 8451
 					}
8452 8452
 				} else {
8453 8453
 					if (empty($nohtmlescape)) {
@@ -8459,8 +8459,8 @@  discard block
 block discarded – undo
8459 8459
 						$selectOptionValue = '&nbsp;';
8460 8460
 					}
8461 8461
 				}
8462
-				$out .= '<option value="' . $key . '"';
8463
-				$out .= $style . $disabled;
8462
+				$out .= '<option value="'.$key.'"';
8463
+				$out .= $style.$disabled;
8464 8464
 				if (is_array($id)) {
8465 8465
 					if (in_array($key, $id) && !$disabled) {
8466 8466
 						$out .= ' selected'; // To preselect a value
@@ -8472,7 +8472,7 @@  discard block
 block discarded – undo
8472 8472
 					}
8473 8473
 				}
8474 8474
 				if ($nohtmlescape) {
8475
-					$out .= ' data-html="' . dol_escape_htmltag($selectOptionValue) . '"';
8475
+					$out .= ' data-html="'.dol_escape_htmltag($selectOptionValue).'"';
8476 8476
 				}
8477 8477
 				if (is_array($tmpvalue)) {
8478 8478
 					foreach ($tmpvalue as $keyforvalue => $valueforvalue) {
@@ -8490,7 +8490,7 @@  discard block
 block discarded – undo
8490 8490
 		// Add code for jquery to use multiselect
8491 8491
 		if ($addjscombo && $jsbeautify) {
8492 8492
 			// Enhance with select2
8493
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
8493
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
8494 8494
 			$out .= ajax_combobox($idname, array(), 0, 0, 'resolve', (((int) $show_empty) < 0 ? (string) $show_empty : '-1'), $morecss);
8495 8495
 		}
8496 8496
 
@@ -8522,28 +8522,28 @@  discard block
 block discarded – undo
8522 8522
 	public static function selectArrayAjax($htmlname, $url, $id = '', $moreparam = '', $moreparamtourl = '', $disabled = 0, $minimumInputLength = 1, $morecss = '', $callurlonselect = 0, $placeholder = '', $acceptdelayedhtml = 0)
8523 8523
 	{
8524 8524
 		global $conf, $langs;
8525
-		global $delayedhtmlcontent;    // Will be used later outside of this function
8525
+		global $delayedhtmlcontent; // Will be used later outside of this function
8526 8526
 
8527 8527
 		// TODO Use an internal dolibarr component instead of select2
8528 8528
 		if (!getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') && !defined('REQUIRE_JQUERY_MULTISELECT')) {
8529 8529
 			return '';
8530 8530
 		}
8531 8531
 
8532
-		$out = '<select type="text" class="' . $htmlname . ($morecss ? ' ' . $morecss : '') . '" ' . ($moreparam ? $moreparam . ' ' : '') . 'name="' . $htmlname . '"></select>';
8532
+		$out = '<select type="text" class="'.$htmlname.($morecss ? ' '.$morecss : '').'" '.($moreparam ? $moreparam.' ' : '').'name="'.$htmlname.'"></select>';
8533 8533
 
8534 8534
 		$outdelayed = '';
8535 8535
 		if (!empty($conf->use_javascript_ajax)) {
8536 8536
 			$tmpplugin = 'select2';
8537
-			$outdelayed = "\n" . '<!-- JS CODE TO ENABLE ' . $tmpplugin . ' for id ' . $htmlname . ' -->
8538
-		    	<script nonce="' . getNonce() . '">
8537
+			$outdelayed = "\n".'<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' -->
8538
+		    	<script nonce="' . getNonce().'">
8539 8539
 		    	$(document).ready(function () {
8540 8540
 
8541
-	    	        ' . ($callurlonselect ? 'var saveRemoteData = [];' : '') . '
8541
+	    	        ' . ($callurlonselect ? 'var saveRemoteData = [];' : '').'
8542 8542
 
8543
-	                $(".' . $htmlname . '").select2({
8543
+	                $(".' . $htmlname.'").select2({
8544 8544
 				    	ajax: {
8545 8545
 					    	dir: "ltr",
8546
-					    	url: "' . $url . '",
8546
+					    	url: "' . $url.'",
8547 8547
 					    	dataType: \'json\',
8548 8548
 					    	delay: 250,
8549 8549
 					    	data: function (params) {
@@ -8570,9 +8570,9 @@  discard block
 block discarded – undo
8570 8570
 				    	},
8571 8571
 		 				language: select2arrayoflanguage,
8572 8572
 						containerCssClass: \':all:\',					/* Line to add class of origin SELECT propagated to the new <span class="select2-selection...> tag */
8573
-					    placeholder: "' . dol_escape_js($placeholder) . '",
8573
+					    placeholder: "' . dol_escape_js($placeholder).'",
8574 8574
 				    	escapeMarkup: function (markup) { return markup; }, 	// let our custom formatter work
8575
-				    	minimumInputLength: ' . ((int) $minimumInputLength) . ',
8575
+				    	minimumInputLength: ' . ((int) $minimumInputLength).',
8576 8576
 				        formatResult: function (result, container, query, escapeMarkup) {
8577 8577
 	                        return escapeMarkup(result.text);
8578 8578
 	                    },
@@ -8580,10 +8580,10 @@  discard block
 block discarded – undo
8580 8580
 
8581 8581
 	                ' . ($callurlonselect ? '
8582 8582
 	                /* Code to execute a GET when we select a value */
8583
-	                $(".' . $htmlname . '").change(function() {
8584
-				    	var selected = $(".' . $htmlname . '").val();
8583
+	                $(".' . $htmlname.'").change(function() {
8584
+				    	var selected = $(".' . $htmlname.'").val();
8585 8585
 	                	console.log("We select in selectArrayAjax the entry "+selected)
8586
-				        $(".' . $htmlname . '").val("");  /* reset visible combo value */
8586
+				        $(".' . $htmlname.'").val("");  /* reset visible combo value */
8587 8587
 	    			    $.each( saveRemoteData, function( key, value ) {
8588 8588
 	    				        if (key == selected)
8589 8589
 	    			            {
@@ -8591,7 +8591,7 @@  discard block
 block discarded – undo
8591 8591
 	    			                 location.assign(value.url);
8592 8592
 	    			            }
8593 8593
 	                    });
8594
-	    			});' : '') . '
8594
+	    			});' : '').'
8595 8595
 
8596 8596
 	    	   });
8597 8597
 		       </script>';
@@ -8627,14 +8627,14 @@  discard block
 block discarded – undo
8627 8627
 	public static function selectArrayFilter($htmlname, $array, $id = '', $moreparam = '', $disableFiltering = 0, $disabled = 0, $minimumInputLength = 1, $morecss = '', $callurlonselect = 0, $placeholder = '', $acceptdelayedhtml = 0, $textfortitle = '')
8628 8628
 	{
8629 8629
 		global $conf, $langs;
8630
-		global $delayedhtmlcontent;    // Will be used later outside of this function
8630
+		global $delayedhtmlcontent; // Will be used later outside of this function
8631 8631
 
8632 8632
 		// TODO Use an internal dolibarr component instead of select2
8633 8633
 		if (!getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') && !defined('REQUIRE_JQUERY_MULTISELECT')) {
8634 8634
 			return '';
8635 8635
 		}
8636 8636
 
8637
-		$out = '<select type="text"'.($textfortitle ? ' title="'.dol_escape_htmltag($textfortitle).'"' : '').' id="'.$htmlname.'" class="'.$htmlname.($morecss ? ' ' . $morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.'"><option></option></select>';
8637
+		$out = '<select type="text"'.($textfortitle ? ' title="'.dol_escape_htmltag($textfortitle).'"' : '').' id="'.$htmlname.'" class="'.$htmlname.($morecss ? ' '.$morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.'"><option></option></select>';
8638 8638
 
8639 8639
 		$formattedarrayresult = array();
8640 8640
 
@@ -8649,20 +8649,20 @@  discard block
 block discarded – undo
8649 8649
 		$outdelayed = '';
8650 8650
 		if (!empty($conf->use_javascript_ajax)) {
8651 8651
 			$tmpplugin = 'select2';
8652
-			$outdelayed = "\n" . '<!-- JS CODE TO ENABLE ' . $tmpplugin . ' for id ' . $htmlname . ' -->
8653
-				<script nonce="' . getNonce() . '">
8652
+			$outdelayed = "\n".'<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' -->
8653
+				<script nonce="' . getNonce().'">
8654 8654
 				$(document).ready(function () {
8655
-					var data = ' . json_encode($formattedarrayresult) . ';
8655
+					var data = ' . json_encode($formattedarrayresult).';
8656 8656
 
8657
-					' . ($callurlonselect ? 'var saveRemoteData = ' . json_encode($array) . ';' : '') . '
8657
+					' . ($callurlonselect ? 'var saveRemoteData = '.json_encode($array).';' : '').'
8658 8658
 
8659
-					$(".' . $htmlname . '").select2({
8659
+					$(".' . $htmlname.'").select2({
8660 8660
 						data: data,
8661 8661
 						language: select2arrayoflanguage,
8662 8662
 						containerCssClass: \':all:\',					/* Line to add class of origin SELECT propagated to the new <span class="select2-selection...> tag */
8663
-						placeholder: "' . dol_escape_js($placeholder) . '",
8663
+						placeholder: "' . dol_escape_js($placeholder).'",
8664 8664
 						escapeMarkup: function (markup) { return markup; }, 	// let our custom formatter work
8665
-						minimumInputLength: ' . $minimumInputLength . ',
8665
+						minimumInputLength: ' . $minimumInputLength.',
8666 8666
 						formatResult: function (result, container, query, escapeMarkup) {
8667 8667
 							return escapeMarkup(result.text);
8668 8668
 						},
@@ -8701,11 +8701,11 @@  discard block
 block discarded – undo
8701 8701
 
8702 8702
 					' . ($callurlonselect ? '
8703 8703
 					/* Code to execute a GET when we select a value */
8704
-					$(".' . $htmlname . '").change(function() {
8705
-						var selected = $(".' . $htmlname . '").val();
8704
+					$(".' . $htmlname.'").change(function() {
8705
+						var selected = $(".' . $htmlname.'").val();
8706 8706
 						console.log("We select "+selected)
8707 8707
 
8708
-						$(".' . $htmlname . '").val("");  /* reset visible combo value */
8708
+						$(".' . $htmlname.'").val("");  /* reset visible combo value */
8709 8709
 						$.each( saveRemoteData, function( key, value ) {
8710 8710
 							if (key == selected)
8711 8711
 							{
@@ -8713,7 +8713,7 @@  discard block
 block discarded – undo
8713 8713
 								location.assign(value.url);
8714 8714
 							}
8715 8715
 						});
8716
-					});' : '') . '
8716
+					});' : '').'
8717 8717
 
8718 8718
 				});
8719 8719
 				</script>';
@@ -8765,7 +8765,7 @@  discard block
 block discarded – undo
8765 8765
 		}
8766 8766
 
8767 8767
 		// Output select component
8768
-		$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";
8768
+		$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";
8769 8769
 		if (is_array($array) && !empty($array)) {
8770 8770
 			if ($value_as_key) {
8771 8771
 				$array = array_combine($array, $array);
@@ -8786,57 +8786,57 @@  discard block
 block discarded – undo
8786 8786
 						$tmplabelhtml = empty($value['labelhtml']) ? '' : $value['labelhtml'];
8787 8787
 					}
8788 8788
 					$newval = ($translate ? $langs->trans($tmpvalue) : $tmpvalue);
8789
-					$newval = ($key_in_label ? $tmpkey . ' - ' . $newval : $newval);
8789
+					$newval = ($key_in_label ? $tmpkey.' - '.$newval : $newval);
8790 8790
 
8791
-					$out .= '<option value="' . $tmpkey . '"';
8791
+					$out .= '<option value="'.$tmpkey.'"';
8792 8792
 					if (is_array($selected) && !empty($selected) && in_array((string) $tmpkey, $selected) && ((string) $tmpkey != '')) {
8793 8793
 						$out .= ' selected';
8794 8794
 					}
8795 8795
 					if (!empty($tmplabelhtml)) {
8796
-						$out .= ' data-html="' . dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1) . '"';
8796
+						$out .= ' data-html="'.dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1).'"';
8797 8797
 					} else {
8798
-						$tmplabelhtml = ($tmppicto ? img_picto('', $tmppicto, 'class="pictofixedwidth" style="color: #' . $tmpcolor . '"') : '') . $newval;
8799
-						$out .= ' data-html="' . dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1) . '"';
8798
+						$tmplabelhtml = ($tmppicto ? img_picto('', $tmppicto, 'class="pictofixedwidth" style="color: #'.$tmpcolor.'"') : '').$newval;
8799
+						$out .= ' data-html="'.dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1).'"';
8800 8800
 					}
8801 8801
 					$out .= '>';
8802 8802
 					$out .= dol_htmlentitiesbr($newval);
8803
-					$out .= '</option>' . "\n";
8803
+					$out .= '</option>'."\n";
8804 8804
 				}
8805 8805
 			}
8806 8806
 		}
8807
-		$out .= '</select>' . "\n";
8807
+		$out .= '</select>'."\n";
8808 8808
 
8809 8809
 		// Add code for jquery to use multiselect
8810 8810
 		if (!empty($conf->use_javascript_ajax) && getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') || defined('REQUIRE_JQUERY_MULTISELECT')) {
8811
-			$out .= "\n" . '<!-- JS CODE TO ENABLE select for id ' . $htmlname . ', addjscombo=' . $addjscombo . ' -->';
8812
-			$out .= "\n" . '<script nonce="' . getNonce() . '">' . "\n";
8811
+			$out .= "\n".'<!-- JS CODE TO ENABLE select for id '.$htmlname.', addjscombo='.$addjscombo.' -->';
8812
+			$out .= "\n".'<script nonce="'.getNonce().'">'."\n";
8813 8813
 			if ($addjscombo == 1) {
8814 8814
 				$tmpplugin = !getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') ? constant('REQUIRE_JQUERY_MULTISELECT') : $conf->global->MAIN_USE_JQUERY_MULTISELECT;
8815
-				$out .= 'function formatResult(record, container) {' . "\n";
8815
+				$out .= 'function formatResult(record, container) {'."\n";
8816 8816
 				// If property html set, we decode html entities and use this.
8817 8817
 				// Note that HTML content must have been sanitized from js with dol_escape_htmltag(xxx, 0, 0, '', 0, 1) when building the select option.
8818 8818
 				$out .= '	if ($(record.element).attr("data-html") != undefined) { return htmlEntityDecodeJs($(record.element).attr("data-html")); }'."\n";
8819 8819
 				$out .= '	return record.text;';
8820
-				$out .= '}' . "\n";
8821
-				$out .= 'function formatSelection(record) {' . "\n";
8820
+				$out .= '}'."\n";
8821
+				$out .= 'function formatSelection(record) {'."\n";
8822 8822
 				if ($elemtype == 'category') {
8823
-					$out .= 'return \'<span><img src="' . DOL_URL_ROOT . '/theme/eldy/img/object_category.png"> \'+record.text+\'</span>\';';
8823
+					$out .= 'return \'<span><img src="'.DOL_URL_ROOT.'/theme/eldy/img/object_category.png"> \'+record.text+\'</span>\';';
8824 8824
 				} else {
8825 8825
 					$out .= 'return record.text;';
8826 8826
 				}
8827
-				$out .= '}' . "\n";
8827
+				$out .= '}'."\n";
8828 8828
 				$out .= '$(document).ready(function () {
8829
-							$(\'#' . $htmlname . '\').' . $tmpplugin . '({';
8829
+							$(\'#' . $htmlname.'\').'.$tmpplugin.'({';
8830 8830
 				if ($placeholder) {
8831 8831
 					$out .= '
8832 8832
 								placeholder: {
8833 8833
 								    id: \'-1\',
8834
-								    text: \'' . dol_escape_js($placeholder) . '\'
8834
+								    text: \'' . dol_escape_js($placeholder).'\'
8835 8835
 								  },';
8836 8836
 				}
8837 8837
 				$out .= '		dir: \'ltr\',
8838 8838
 								containerCssClass: \':all:\',					/* Line to add class of origin SELECT propagated to the new <span class="select2-selection...> tag (ko with multiselect) */
8839
-								dropdownCssClass: \'' . $morecss . '\',				/* Line to add class on the new <span class="select2-selection...> tag (ok with multiselect) */
8839
+								dropdownCssClass: \'' . $morecss.'\',				/* Line to add class on the new <span class="select2-selection...> tag (ok with multiselect) */
8840 8840
 								// Specify format function for dropdown item
8841 8841
 								formatResult: formatResult,
8842 8842
 							 	templateResult: formatResult,		/* For 4.0 */
@@ -8848,21 +8848,21 @@  discard block
 block discarded – undo
8848 8848
 
8849 8849
 							/* Add also morecss to the css .select2 that is after the #htmlname, for component that are show dynamically after load, because select2 set
8850 8850
 								 the size only if component is not hidden by default on load */
8851
-							$(\'#' . $htmlname . ' + .select2\').addClass(\'' . $morecss . '\');
8851
+							$(\'#' . $htmlname.' + .select2\').addClass(\''.$morecss.'\');
8852 8852
 						});' . "\n";
8853 8853
 			} elseif ($addjscombo == 2 && !defined('DISABLE_MULTISELECT')) {
8854 8854
 				// Add other js lib
8855 8855
 				// TODO external lib multiselect/jquery.multi-select.js must have been loaded to use this multiselect plugin
8856 8856
 				// ...
8857
-				$out .= 'console.log(\'addjscombo=2 for htmlname=' . $htmlname . '\');';
8857
+				$out .= 'console.log(\'addjscombo=2 for htmlname='.$htmlname.'\');';
8858 8858
 				$out .= '$(document).ready(function () {
8859
-							$(\'#' . $htmlname . '\').multiSelect({
8859
+							$(\'#' . $htmlname.'\').multiSelect({
8860 8860
 								containerHTML: \'<div class="multi-select-container">\',
8861 8861
 								menuHTML: \'<div class="multi-select-menu">\',
8862
-								buttonHTML: \'<span class="multi-select-button ' . $morecss . '">\',
8862
+								buttonHTML: \'<span class="multi-select-button ' . $morecss.'">\',
8863 8863
 								menuItemHTML: \'<label class="multi-select-menuitem">\',
8864 8864
 								activeClass: \'multi-select-container--open\',
8865
-								noneText: \'' . $placeholder . '\'
8865
+								noneText: \'' . $placeholder.'\'
8866 8866
 							});
8867 8867
 						})';
8868 8868
 			}
@@ -8894,7 +8894,7 @@  discard block
 block discarded – undo
8894 8894
 			return '';
8895 8895
 		}
8896 8896
 
8897
-		$tmpvar = "MAIN_SELECTEDFIELDS_" . $varpage; // To get list of saved selected fields to show
8897
+		$tmpvar = "MAIN_SELECTEDFIELDS_".$varpage; // To get list of saved selected fields to show
8898 8898
 
8899 8899
 		if (!empty($user->conf->$tmpvar)) {        // A list of fields was already customized for user
8900 8900
 			$tmparray = explode(',', $user->conf->$tmpvar);
@@ -8937,19 +8937,19 @@  discard block
 block discarded – undo
8937 8937
 				}
8938 8938
 
8939 8939
 				// Note: $val['checked'] <> 0 means we must show the field into the combo list
8940
-				$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>';
8941
-				$listcheckedstring .= (empty($val['checked']) ? '' : $key . ',');
8940
+				$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>';
8941
+				$listcheckedstring .= (empty($val['checked']) ? '' : $key.',');
8942 8942
 			}
8943 8943
 		}
8944 8944
 
8945
-		$out = '<!-- Component multiSelectArrayWithCheckbox ' . $htmlname . ' -->
8945
+		$out = '<!-- Component multiSelectArrayWithCheckbox '.$htmlname.' -->
8946 8946
 
8947 8947
         <dl class="dropdown">
8948 8948
             <dt>
8949
-            <a href="#' . $htmlname . '">
8950
-              ' . img_picto('', 'list') . '
8949
+            <a href="#' . $htmlname.'">
8950
+              ' . img_picto('', 'list').'
8951 8951
             </a>
8952
-            <input type="hidden" class="' . $htmlname . '" name="' . $htmlname . '" value="' . $listcheckedstring . '">
8952
+            <input type="hidden" class="' . $htmlname.'" name="'.$htmlname.'" value="'.$listcheckedstring.'">
8953 8953
             </dt>
8954 8954
             <dd class="dropdowndd">
8955 8955
                 <div class="multiselectcheckbox'.$htmlname.'">
@@ -8961,19 +8961,19 @@  discard block
 block discarded – undo
8961 8961
             </dd>
8962 8962
         </dl>
8963 8963
 
8964
-        <script nonce="' . getNonce() . '" type="text/javascript">
8964
+        <script nonce="' . getNonce().'" type="text/javascript">
8965 8965
           jQuery(document).ready(function () {
8966
-              $(\'.multiselectcheckbox' . $htmlname . ' input[type="checkbox"]\').on(\'click\', function () {
8966
+              $(\'.multiselectcheckbox' . $htmlname.' input[type="checkbox"]\').on(\'click\', function () {
8967 8967
                   console.log("A new field was added/removed, we edit field input[name=formfilteraction]");
8968 8968
 
8969 8969
                   $("input:hidden[name=formfilteraction]").val(\'listafterchangingselectedfields\');	// Update field so we know we changed something on selected fields after POST
8970 8970
 
8971 8971
                   var title = $(this).val() + ",";
8972 8972
                   if ($(this).is(\':checked\')) {
8973
-                      $(\'.' . $htmlname . '\').val(title + $(\'.' . $htmlname . '\').val());
8973
+                      $(\'.' . $htmlname.'\').val(title + $(\'.'.$htmlname.'\').val());
8974 8974
                   }
8975 8975
                   else {
8976
-                      $(\'.' . $htmlname . '\').val( $(\'.' . $htmlname . '\').val().replace(title, \'\') )
8976
+                      $(\'.' . $htmlname.'\').val( $(\'.'.$htmlname.'\').val().replace(title, \'\') )
8977 8977
                   }
8978 8978
                   // Now, we submit page
8979 8979
                   //$(this).parents(\'form:first\').submit();
@@ -9004,7 +9004,7 @@  discard block
 block discarded – undo
9004 9004
 	 */
9005 9005
 	public function showCategories($id, $type, $rendermode = 0, $nolink = 0)
9006 9006
 	{
9007
-		include_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
9007
+		include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
9008 9008
 
9009 9009
 		$cat = new Categorie($this->db);
9010 9010
 		$categories = $cat->containing($id, $type);
@@ -9014,10 +9014,10 @@  discard block
 block discarded – undo
9014 9014
 			foreach ($categories as $c) {
9015 9015
 				$ways = $c->print_all_ways(' &gt;&gt; ', ($nolink ? 'none' : ''), 0, 1); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formated text
9016 9016
 				foreach ($ways as $way) {
9017
-					$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #bbb"') . '>' . $way . '</li>';
9017
+					$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #bbb"').'>'.$way.'</li>';
9018 9018
 				}
9019 9019
 			}
9020
-			return '<div class="select2-container-multi-dolibarr"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>';
9020
+			return '<div class="select2-container-multi-dolibarr"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
9021 9021
 		}
9022 9022
 
9023 9023
 		if ($rendermode == 0) {
@@ -9065,15 +9065,15 @@  discard block
 block discarded – undo
9065 9065
 
9066 9066
 
9067 9067
 			print '<div class="div-table-responsive-no-min">';
9068
-			print '<table class="noborder allwidth" data-block="showLinkedObject" data-element="' . $object->element . '"  data-elementid="' . $object->id . '"   >';
9068
+			print '<table class="noborder allwidth" data-block="showLinkedObject" data-element="'.$object->element.'"  data-elementid="'.$object->id.'"   >';
9069 9069
 
9070 9070
 			print '<tr class="liste_titre">';
9071
-			print '<td>' . $langs->trans("Type") . '</td>';
9072
-			print '<td>' . $langs->trans("Ref") . '</td>';
9071
+			print '<td>'.$langs->trans("Type").'</td>';
9072
+			print '<td>'.$langs->trans("Ref").'</td>';
9073 9073
 			print '<td class="center"></td>';
9074
-			print '<td class="center">' . $langs->trans("Date") . '</td>';
9075
-			print '<td class="right">' . $langs->trans("AmountHTShort") . '</td>';
9076
-			print '<td class="right">' . $langs->trans("Status") . '</td>';
9074
+			print '<td class="center">'.$langs->trans("Date").'</td>';
9075
+			print '<td class="right">'.$langs->trans("AmountHTShort").'</td>';
9076
+			print '<td class="right">'.$langs->trans("Status").'</td>';
9077 9077
 			print '<td></td>';
9078 9078
 			print '</tr>';
9079 9079
 
@@ -9092,13 +9092,13 @@  discard block
 block discarded – undo
9092 9092
 				if ($objecttype != 'supplier_proposal' && preg_match('/^([^_]+)_([^_]+)/i', $objecttype, $regs)) {
9093 9093
 					$element = $regs[1];
9094 9094
 					$subelement = $regs[2];
9095
-					$tplpath = $element . '/' . $subelement;
9095
+					$tplpath = $element.'/'.$subelement;
9096 9096
 				}
9097 9097
 				$tplname = 'linkedobjectblock';
9098 9098
 
9099 9099
 				// To work with non standard path
9100 9100
 				if ($objecttype == 'facture') {
9101
-					$tplpath = 'compta/' . $element;
9101
+					$tplpath = 'compta/'.$element;
9102 9102
 					if (!isModEnabled('facture')) {
9103 9103
 						continue; // Do not show if module disabled
9104 9104
 					}
@@ -9109,7 +9109,7 @@  discard block
 block discarded – undo
9109 9109
 						continue; // Do not show if module disabled
9110 9110
 					}
9111 9111
 				} elseif ($objecttype == 'propal') {
9112
-					$tplpath = 'comm/' . $element;
9112
+					$tplpath = 'comm/'.$element;
9113 9113
 					if (!isModEnabled('propal')) {
9114 9114
 						continue; // Do not show if module disabled
9115 9115
 					}
@@ -9160,14 +9160,14 @@  discard block
 block discarded – undo
9160 9160
 				$linkedObjectBlock = $objects;
9161 9161
 
9162 9162
 				// Output template part (modules that overwrite templates must declare this into descriptor)
9163
-				$dirtpls = array_merge($conf->modules_parts['tpl'], array('/' . $tplpath . '/tpl'));
9163
+				$dirtpls = array_merge($conf->modules_parts['tpl'], array('/'.$tplpath.'/tpl'));
9164 9164
 				foreach ($dirtpls as $reldir) {
9165 9165
 					if ($nboftypesoutput == ($nbofdifferenttypes - 1)) {    // No more type to show after
9166 9166
 						global $noMoreLinkedObjectBlockAfter;
9167 9167
 						$noMoreLinkedObjectBlockAfter = 1;
9168 9168
 					}
9169 9169
 
9170
-					$res = @include dol_buildpath($reldir . '/' . $tplname . '.tpl.php');
9170
+					$res = @include dol_buildpath($reldir.'/'.$tplname.'.tpl.php');
9171 9171
 					if ($res) {
9172 9172
 						$nboftypesoutput++;
9173 9173
 						break;
@@ -9176,7 +9176,7 @@  discard block
 block discarded – undo
9176 9176
 			}
9177 9177
 
9178 9178
 			if (!$nboftypesoutput) {
9179
-				print '<tr><td class="impair" colspan="7"><span class="opacitymedium">' . $langs->trans("None") . '</span></td></tr>';
9179
+				print '<tr><td class="impair" colspan="7"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
9180 9180
 			}
9181 9181
 
9182 9182
 			print '</table>';
@@ -9216,14 +9216,14 @@  discard block
 block discarded – undo
9216 9216
 		if (is_object($object->thirdparty) && !empty($object->thirdparty->id) && $object->thirdparty->id > 0) {
9217 9217
 			$listofidcompanytoscan = $object->thirdparty->id;
9218 9218
 			if (($object->thirdparty->parent > 0) && getDolGlobalString('THIRDPARTY_INCLUDE_PARENT_IN_LINKTO')) {
9219
-				$listofidcompanytoscan .= ',' . $object->thirdparty->parent;
9219
+				$listofidcompanytoscan .= ','.$object->thirdparty->parent;
9220 9220
 			}
9221 9221
 			if (($object->fk_project > 0) && getDolGlobalString('THIRDPARTY_INCLUDE_PROJECT_THIRDPARY_IN_LINKTO')) {
9222
-				include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
9222
+				include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
9223 9223
 				$tmpproject = new Project($this->db);
9224 9224
 				$tmpproject->fetch($object->fk_project);
9225 9225
 				if ($tmpproject->socid > 0 && ($tmpproject->socid != $object->thirdparty->id)) {
9226
-					$listofidcompanytoscan .= ',' . $tmpproject->socid;
9226
+					$listofidcompanytoscan .= ','.$tmpproject->socid;
9227 9227
 				}
9228 9228
 				unset($tmpproject);
9229 9229
 			}
@@ -9233,63 +9233,63 @@  discard block
 block discarded – undo
9233 9233
 					'enabled' => isModEnabled('propal'),
9234 9234
 					'perms' => 1,
9235 9235
 					'label' => 'LinkToProposal',
9236
-					'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') . ')'),
9236
+					'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').')'),
9237 9237
 				'shipping' => array(
9238 9238
 					'enabled' => isModEnabled('expedition'),
9239 9239
 					'perms' => 1,
9240 9240
 					'label' => 'LinkToExpedition',
9241
-					'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') . ')'),
9241
+					'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').')'),
9242 9242
 				'order' => array(
9243 9243
 					'enabled' => isModEnabled('commande'),
9244 9244
 					'perms' => 1,
9245 9245
 					'label' => 'LinkToOrder',
9246
-					'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') . ')'),
9246
+					'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').')'),
9247 9247
 				'invoice' => array(
9248 9248
 					'enabled' => isModEnabled('facture'),
9249 9249
 					'perms' => 1,
9250 9250
 					'label' => 'LinkToInvoice',
9251
-					'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') . ')'),
9251
+					'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').')'),
9252 9252
 				'invoice_template' => array(
9253 9253
 					'enabled' => isModEnabled('facture'),
9254 9254
 					'perms' => 1,
9255 9255
 					'label' => 'LinkToTemplateInvoice',
9256
-					'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') . ')'),
9256
+					'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').')'),
9257 9257
 				'contrat' => array(
9258 9258
 					'enabled' => isModEnabled('contrat'),
9259 9259
 					'perms' => 1,
9260 9260
 					'label' => 'LinkToContract',
9261 9261
 					'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
9262
-							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'
9262
+							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'
9263 9263
 				),
9264 9264
 				'fichinter' => array(
9265 9265
 					'enabled' => isModEnabled('ficheinter'),
9266 9266
 					'perms' => 1,
9267 9267
 					'label' => 'LinkToIntervention',
9268
-					'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') . ')'),
9268
+					'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').')'),
9269 9269
 				'supplier_proposal' => array(
9270 9270
 					'enabled' => isModEnabled('supplier_proposal'),
9271 9271
 					'perms' => 1,
9272 9272
 					'label' => 'LinkToSupplierProposal',
9273
-					'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') . ')'),
9273
+					'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').')'),
9274 9274
 				'order_supplier' => array(
9275 9275
 					'enabled' => isModEnabled("supplier_order"),
9276 9276
 					'perms' => 1,
9277 9277
 					'label' => 'LinkToSupplierOrder',
9278
-					'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') . ')'),
9278
+					'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').')'),
9279 9279
 				'invoice_supplier' => array(
9280 9280
 					'enabled' => isModEnabled("supplier_invoice"),
9281 9281
 					'perms' => 1, 'label' => 'LinkToSupplierInvoice',
9282
-					'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') . ')'),
9282
+					'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').')'),
9283 9283
 				'ticket' => array(
9284 9284
 					'enabled' => isModEnabled('ticket'),
9285 9285
 					'perms' => 1,
9286 9286
 					'label' => 'LinkToTicket',
9287
-					'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') . ')'),
9287
+					'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').')'),
9288 9288
 				'mo' => array(
9289 9289
 					'enabled' => isModEnabled('mrp'),
9290 9290
 					'perms' => 1,
9291 9291
 					'label' => 'LinkToMo',
9292
-					'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') . ')')
9292
+					'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').')')
9293 9293
 			);
9294 9294
 		}
9295 9295
 
@@ -9324,22 +9324,22 @@  discard block
 block discarded – undo
9324 9324
 			}
9325 9325
 
9326 9326
 			if (!empty($possiblelink['perms']) && (empty($restrictlinksto) || in_array($key, $restrictlinksto)) && (empty($excludelinksto) || !in_array($key, $excludelinksto))) {
9327
-				print '<div id="' . $key . 'list"' . (empty($conf->use_javascript_ajax) ? '' : ' style="display:none"') . '>';
9327
+				print '<div id="'.$key.'list"'.(empty($conf->use_javascript_ajax) ? '' : ' style="display:none"').'>';
9328 9328
 
9329 9329
 				if (getDolGlobalString('MAIN_LINK_BY_REF_IN_LINKTO')) {
9330 9330
 					print '<br>'."\n";
9331 9331
 					print '<!-- form to add a link from anywhere -->'."\n";
9332
-					print '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST" name="formlinkedbyref' . $key . '">';
9333
-					print '<input type="hidden" name="id" value="' . $object->id . '">';
9332
+					print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" name="formlinkedbyref'.$key.'">';
9333
+					print '<input type="hidden" name="id" value="'.$object->id.'">';
9334 9334
 					print '<input type="hidden" name="action" value="addlinkbyref">';
9335
-					print '<input type="hidden" name="token" value="' . newToken() . '">';
9336
-					print '<input type="hidden" name="addlink" value="' . $key . '">';
9335
+					print '<input type="hidden" name="token" value="'.newToken().'">';
9336
+					print '<input type="hidden" name="addlink" value="'.$key.'">';
9337 9337
 					print '<table class="noborder">';
9338 9338
 					print '<tr>';
9339 9339
 					//print '<td>' . $langs->trans("Ref") . '</td>';
9340
-					print '<td class="center"><input type="text" placeholder="'.dol_escape_htmltag($langs->trans("Ref")).'" name="reftolinkto" value="' . dol_escape_htmltag(GETPOST('reftolinkto', 'alpha')) . '">&nbsp;';
9341
-					print '<input type="submit" class="button small valignmiddle" value="' . $langs->trans('ToLink') . '">&nbsp;';
9342
-					print '<input type="submit" class="button small" name="cancel" value="' . $langs->trans('Cancel') . '"></td>';
9340
+					print '<td class="center"><input type="text" placeholder="'.dol_escape_htmltag($langs->trans("Ref")).'" name="reftolinkto" value="'.dol_escape_htmltag(GETPOST('reftolinkto', 'alpha')).'">&nbsp;';
9341
+					print '<input type="submit" class="button small valignmiddle" value="'.$langs->trans('ToLink').'">&nbsp;';
9342
+					print '<input type="submit" class="button small" name="cancel" value="'.$langs->trans('Cancel').'"></td>';
9343 9343
 					print '</tr>';
9344 9344
 					print '</table>';
9345 9345
 					print '</form>';
@@ -9354,48 +9354,48 @@  discard block
 block discarded – undo
9354 9354
 
9355 9355
 					print '<br>';
9356 9356
 					print '<!-- form to add a link from object to same thirdparty -->'."\n";
9357
-					print '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST" name="formlinked' . $key . '">';
9357
+					print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" name="formlinked'.$key.'">';
9358 9358
 					print '<input type="hidden" name="action" value="addlink">';
9359
-					print '<input type="hidden" name="token" value="' . newToken() . '">';
9360
-					print '<input type="hidden" name="id" value="' . $object->id . '">';
9361
-					print '<input type="hidden" name="addlink" value="' . $key . '">';
9359
+					print '<input type="hidden" name="token" value="'.newToken().'">';
9360
+					print '<input type="hidden" name="id" value="'.$object->id.'">';
9361
+					print '<input type="hidden" name="addlink" value="'.$key.'">';
9362 9362
 					print '<table class="noborder">';
9363 9363
 					print '<tr class="liste_titre">';
9364 9364
 					print '<td class="nowrap"></td>';
9365
-					print '<td class="center">' . $langs->trans("Ref") . '</td>';
9366
-					print '<td class="left">' . $langs->trans("RefCustomer") . '</td>';
9367
-					print '<td class="right">' . $langs->trans("AmountHTShort") . '</td>';
9368
-					print '<td class="left">' . $langs->trans("Company") . '</td>';
9365
+					print '<td class="center">'.$langs->trans("Ref").'</td>';
9366
+					print '<td class="left">'.$langs->trans("RefCustomer").'</td>';
9367
+					print '<td class="right">'.$langs->trans("AmountHTShort").'</td>';
9368
+					print '<td class="left">'.$langs->trans("Company").'</td>';
9369 9369
 					print '</tr>';
9370 9370
 					while ($i < $num) {
9371 9371
 						$objp = $this->db->fetch_object($resqllist);
9372 9372
 
9373 9373
 						print '<tr class="oddeven">';
9374 9374
 						print '<td class="left">';
9375
-						print '<input type="radio" name="idtolinkto" id="' . $key . '_' . $objp->rowid . '" value="' . $objp->rowid . '">';
9375
+						print '<input type="radio" name="idtolinkto" id="'.$key.'_'.$objp->rowid.'" value="'.$objp->rowid.'">';
9376 9376
 						print '</td>';
9377
-						print '<td class="center"><label for="' . $key . '_' . $objp->rowid . '">' . $objp->ref . '</label></td>';
9378
-						print '<td>' . (!empty($objp->ref_client) ? $objp->ref_client : (!empty($objp->ref_supplier) ? $objp->ref_supplier : '')) . '</td>';
9377
+						print '<td class="center"><label for="'.$key.'_'.$objp->rowid.'">'.$objp->ref.'</label></td>';
9378
+						print '<td>'.(!empty($objp->ref_client) ? $objp->ref_client : (!empty($objp->ref_supplier) ? $objp->ref_supplier : '')).'</td>';
9379 9379
 						print '<td class="right">';
9380 9380
 						if ($possiblelink['label'] == 'LinkToContract') {
9381 9381
 							$form = new Form($this->db);
9382
-							print $form->textwithpicto('', $langs->trans("InformationOnLinkToContract")) . ' ';
9382
+							print $form->textwithpicto('', $langs->trans("InformationOnLinkToContract")).' ';
9383 9383
 						}
9384
-						print '<span class="amount">' . (isset($objp->total_ht) ? price($objp->total_ht) : '') . '</span>';
9384
+						print '<span class="amount">'.(isset($objp->total_ht) ? price($objp->total_ht) : '').'</span>';
9385 9385
 						print '</td>';
9386
-						print '<td>' . $objp->name . '</td>';
9386
+						print '<td>'.$objp->name.'</td>';
9387 9387
 						print '</tr>';
9388 9388
 						$i++;
9389 9389
 					}
9390 9390
 					print '</table>';
9391 9391
 					print '<div class="center">';
9392 9392
 					if ($num) {
9393
-						print '<input type="submit" class="button valignmiddle marginleftonly marginrightonly small" value="' . $langs->trans('ToLink') . '">';
9393
+						print '<input type="submit" class="button valignmiddle marginleftonly marginrightonly small" value="'.$langs->trans('ToLink').'">';
9394 9394
 					}
9395 9395
 					if (empty($conf->use_javascript_ajax)) {
9396
-						print '<input type="submit" class="button button-cancel marginleftonly marginrightonly small" name="cancel" value="' . $langs->trans("Cancel") . '"></div>';
9396
+						print '<input type="submit" class="button button-cancel marginleftonly marginrightonly small" name="cancel" value="'.$langs->trans("Cancel").'"></div>';
9397 9397
 					} else {
9398
-						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>';
9398
+						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>';
9399 9399
 					}
9400 9400
 					print '</form>';
9401 9401
 					$this->db->free($resqllist);
@@ -9406,10 +9406,10 @@  discard block
 block discarded – undo
9406 9406
 
9407 9407
 				//$linktoelem.=($linktoelem?' &nbsp; ':'');
9408 9408
 				if ($num > 0 || getDolGlobalString('MAIN_LINK_BY_REF_IN_LINKTO')) {
9409
-					$linktoelemlist .= '<li><a href="#linkto' . $key . '" class="linkto dropdowncloseonclick" rel="' . $key . '">' . $langs->trans($possiblelink['label']) . ' (' . $num . ')</a></li>';
9409
+					$linktoelemlist .= '<li><a href="#linkto'.$key.'" class="linkto dropdowncloseonclick" rel="'.$key.'">'.$langs->trans($possiblelink['label']).' ('.$num.')</a></li>';
9410 9410
 					// } else $linktoelem.=$langs->trans($possiblelink['label']);
9411 9411
 				} else {
9412
-					$linktoelemlist .= '<li><span class="linktodisabled">' . $langs->trans($possiblelink['label']) . ' (0)</span></li>';
9412
+					$linktoelemlist .= '<li><span class="linktodisabled">'.$langs->trans($possiblelink['label']).' (0)</span></li>';
9413 9413
 				}
9414 9414
 			}
9415 9415
 		}
@@ -9419,11 +9419,11 @@  discard block
 block discarded – undo
9419 9419
     		<dl class="dropdown" id="linktoobjectname">
9420 9420
     		';
9421 9421
 			if (!empty($conf->use_javascript_ajax)) {
9422
-				$linktoelem .= '<dt><a href="#linktoobjectname"><span class="fas fa-link paddingrightonly"></span>' . $langs->trans("LinkTo") . '...</a></dt>';
9422
+				$linktoelem .= '<dt><a href="#linktoobjectname"><span class="fas fa-link paddingrightonly"></span>'.$langs->trans("LinkTo").'...</a></dt>';
9423 9423
 			}
9424 9424
 			$linktoelem .= '<dd>
9425 9425
     		<div class="multiselectlinkto">
9426
-    		<ul class="ulselectedfields">' . $linktoelemlist . '
9426
+    		<ul class="ulselectedfields">' . $linktoelemlist.'
9427 9427
     		</ul>
9428 9428
     		</div>
9429 9429
     		</dd>
@@ -9434,7 +9434,7 @@  discard block
 block discarded – undo
9434 9434
 
9435 9435
 		if (!empty($conf->use_javascript_ajax)) {
9436 9436
 			print '<!-- Add js to show linkto box -->
9437
-				<script nonce="' . getNonce() . '">
9437
+				<script nonce="' . getNonce().'">
9438 9438
 				jQuery(document).ready(function() {
9439 9439
 					jQuery(".linkto").click(function() {
9440 9440
 						console.log("We choose to show/hide links for rel="+jQuery(this).attr(\'rel\')+" so #"+jQuery(this).attr(\'rel\')+"list");
@@ -9475,19 +9475,19 @@  discard block
 block discarded – undo
9475 9475
 
9476 9476
 		$disabled = ($disabled ? ' disabled' : '');
9477 9477
 
9478
-		$resultyesno = '<select class="flat width75' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . '"' . $disabled . '>' . "\n";
9478
+		$resultyesno = '<select class="flat width75'.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.'"'.$disabled.'>'."\n";
9479 9479
 		if ($useempty) {
9480
-			$resultyesno .= '<option value="-1"' . (($value < 0) ? ' selected' : '') . '>&nbsp;</option>' . "\n";
9480
+			$resultyesno .= '<option value="-1"'.(($value < 0) ? ' selected' : '').'>&nbsp;</option>'."\n";
9481 9481
 		}
9482 9482
 		if (("$value" == 'yes') || ($value == 1)) {
9483
-			$resultyesno .= '<option value="' . $yes . '" selected>' . $langs->trans($labelyes) . '</option>' . "\n";
9484
-			$resultyesno .= '<option value="' . $no . '">' . $langs->trans($labelno) . '</option>' . "\n";
9483
+			$resultyesno .= '<option value="'.$yes.'" selected>'.$langs->trans($labelyes).'</option>'."\n";
9484
+			$resultyesno .= '<option value="'.$no.'">'.$langs->trans($labelno).'</option>'."\n";
9485 9485
 		} else {
9486 9486
 			$selected = (($useempty && $value != '0' && $value != 'no') ? '' : ' selected');
9487
-			$resultyesno .= '<option value="' . $yes . '">' . $langs->trans($labelyes) . '</option>' . "\n";
9488
-			$resultyesno .= '<option value="' . $no . '"' . $selected . '>' . $langs->trans($labelno) . '</option>' . "\n";
9487
+			$resultyesno .= '<option value="'.$yes.'">'.$langs->trans($labelyes).'</option>'."\n";
9488
+			$resultyesno .= '<option value="'.$no.'"'.$selected.'>'.$langs->trans($labelno).'</option>'."\n";
9489 9489
 		}
9490
-		$resultyesno .= '</select>' . "\n";
9490
+		$resultyesno .= '</select>'."\n";
9491 9491
 
9492 9492
 		if ($addjscombo) {
9493 9493
 			$resultyesno .= ajax_combobox($htmlname, array(), 0, 0, 'resolve', ($useempty < 0 ? (string) $useempty : '-1'), $morecss);
@@ -9511,12 +9511,12 @@  discard block
 block discarded – undo
9511 9511
 	{
9512 9512
 		// phpcs:enable
9513 9513
 		$sql = "SELECT rowid, label";
9514
-		$sql .= " FROM " . $this->db->prefix() . "export_model";
9515
-		$sql .= " WHERE type = '" . $this->db->escape($type) . "'";
9514
+		$sql .= " FROM ".$this->db->prefix()."export_model";
9515
+		$sql .= " WHERE type = '".$this->db->escape($type)."'";
9516 9516
 		$sql .= " ORDER BY rowid";
9517 9517
 		$result = $this->db->query($sql);
9518 9518
 		if ($result) {
9519
-			print '<select class="flat" id="select_' . $htmlname . '" name="' . $htmlname . '">';
9519
+			print '<select class="flat" id="select_'.$htmlname.'" name="'.$htmlname.'">';
9520 9520
 			if ($useempty) {
9521 9521
 				print '<option value="-1">&nbsp;</option>';
9522 9522
 			}
@@ -9526,9 +9526,9 @@  discard block
 block discarded – undo
9526 9526
 			while ($i < $num) {
9527 9527
 				$obj = $this->db->fetch_object($result);
9528 9528
 				if ($selected == $obj->rowid) {
9529
-					print '<option value="' . $obj->rowid . '" selected>';
9529
+					print '<option value="'.$obj->rowid.'" selected>';
9530 9530
 				} else {
9531
-					print '<option value="' . $obj->rowid . '">';
9531
+					print '<option value="'.$obj->rowid.'">';
9532 9532
 				}
9533 9533
 				print $obj->label;
9534 9534
 				print '</option>';
@@ -9618,8 +9618,8 @@  discard block
 block discarded – undo
9618 9618
 				$stringforfirstkey .= ' CTL +';
9619 9619
 			}
9620 9620
 
9621
-			$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>';
9622
-			$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>';
9621
+			$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>';
9622
+			$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>';
9623 9623
 		}
9624 9624
 
9625 9625
 		//print "xx".$previous_ref."x".$next_ref;
@@ -9627,18 +9627,18 @@  discard block
 block discarded – undo
9627 9627
 
9628 9628
 		// Right part of banner
9629 9629
 		if ($morehtmlright) {
9630
-			$ret .= '<div class="inline-block floatleft">' . $morehtmlright . '</div>';
9630
+			$ret .= '<div class="inline-block floatleft">'.$morehtmlright.'</div>';
9631 9631
 		}
9632 9632
 
9633 9633
 		if ($previous_ref || $next_ref || $morehtml) {
9634 9634
 			$ret .= '<div class="pagination paginationref"><ul class="right">';
9635 9635
 		}
9636 9636
 		if ($morehtml) {
9637
-			$ret .= '<li class="noborder litext' . (($shownav && $previous_ref && $next_ref) ? ' clearbothonsmartphone' : '') . '">' . $morehtml . '</li>';
9637
+			$ret .= '<li class="noborder litext'.(($shownav && $previous_ref && $next_ref) ? ' clearbothonsmartphone' : '').'">'.$morehtml.'</li>';
9638 9638
 		}
9639 9639
 		if ($shownav && ($previous_ref || $next_ref)) {
9640
-			$ret .= '<li class="pagination">' . $previous_ref . '</li>';
9641
-			$ret .= '<li class="pagination">' . $next_ref . '</li>';
9640
+			$ret .= '<li class="pagination">'.$previous_ref.'</li>';
9641
+			$ret .= '<li class="pagination">'.$next_ref.'</li>';
9642 9642
 		}
9643 9643
 		if ($previous_ref || $next_ref || $morehtml) {
9644 9644
 			$ret .= '</ul></div>';
@@ -9653,7 +9653,7 @@  discard block
 block discarded – undo
9653 9653
 			$morehtmlstatus = $hookmanager->resPrint;
9654 9654
 		}
9655 9655
 		if ($morehtmlstatus) {
9656
-			$ret .= '<div class="statusref">' . $morehtmlstatus . '</div>';
9656
+			$ret .= '<div class="statusref">'.$morehtmlstatus.'</div>';
9657 9657
 		}
9658 9658
 
9659 9659
 		$parameters = array();
@@ -9667,14 +9667,14 @@  discard block
 block discarded – undo
9667 9667
 		// Left part of banner
9668 9668
 		if ($morehtmlleft) {
9669 9669
 			if ($conf->browser->layout == 'phone') {
9670
-				$ret .= '<!-- morehtmlleft --><div class="floatleft">' . $morehtmlleft . '</div>';
9670
+				$ret .= '<!-- morehtmlleft --><div class="floatleft">'.$morehtmlleft.'</div>';
9671 9671
 			} else {
9672
-				$ret .= '<!-- morehtmlleft --><div class="inline-block floatleft">' . $morehtmlleft . '</div>';
9672
+				$ret .= '<!-- morehtmlleft --><div class="inline-block floatleft">'.$morehtmlleft.'</div>';
9673 9673
 			}
9674 9674
 		}
9675 9675
 
9676 9676
 		//if ($conf->browser->layout == 'phone') $ret.='<div class="clearboth"></div>';
9677
-		$ret .= '<div class="inline-block floatleft valignmiddle maxwidth750 marginbottomonly refid' . (($shownav && ($previous_ref || $next_ref)) ? ' refidpadding' : '') . '">';
9677
+		$ret .= '<div class="inline-block floatleft valignmiddle maxwidth750 marginbottomonly refid'.(($shownav && ($previous_ref || $next_ref)) ? ' refidpadding' : '').'">';
9678 9678
 
9679 9679
 		// For thirdparty, contact, user, member, the ref is the id, so we show something else
9680 9680
 		if ($object->element == 'societe') {
@@ -9688,7 +9688,7 @@  discard block
 block discarded – undo
9688 9688
 
9689 9689
 			if (is_array($arrayoflangcode) && count($arrayoflangcode)) {
9690 9690
 				if (!is_object($extralanguages)) {
9691
-					include_once DOL_DOCUMENT_ROOT . '/core/class/extralanguages.class.php';
9691
+					include_once DOL_DOCUMENT_ROOT.'/core/class/extralanguages.class.php';
9692 9692
 					$extralanguages = new ExtraLanguages($this->db);
9693 9693
 				}
9694 9694
 				$extralanguages->fetch_name_extralanguages('societe');
@@ -9703,27 +9703,27 @@  discard block
 block discarded – undo
9703 9703
 						if ($object->array_languages['name'][$extralangcode]) {
9704 9704
 							$htmltext .= $object->array_languages['name'][$extralangcode];
9705 9705
 						} else {
9706
-							$htmltext .= '<span class="opacitymedium">' . $langs->trans("SwitchInEditModeToAddTranslation") . '</span>';
9706
+							$htmltext .= '<span class="opacitymedium">'.$langs->trans("SwitchInEditModeToAddTranslation").'</span>';
9707 9707
 						}
9708 9708
 					}
9709
-					$ret .= '<!-- Show translations of name -->' . "\n";
9709
+					$ret .= '<!-- Show translations of name -->'."\n";
9710 9710
 					$ret .= $this->textwithpicto('', $htmltext, -1, 'language', 'opacitymedium paddingleft');
9711 9711
 				}
9712 9712
 			}
9713 9713
 		} elseif ($object->element == 'member') {
9714
-			$ret .= $object->ref . '<br>';
9714
+			$ret .= $object->ref.'<br>';
9715 9715
 			$fullname = $object->getFullName($langs);
9716 9716
 			if ($object->morphy == 'mor' && $object->societe) {
9717
-				$ret .= dol_htmlentities($object->societe) . ((!empty($fullname) && $object->societe != $fullname) ? ' (' . dol_htmlentities($fullname) . $addgendertxt . ')' : '');
9717
+				$ret .= dol_htmlentities($object->societe).((!empty($fullname) && $object->societe != $fullname) ? ' ('.dol_htmlentities($fullname).$addgendertxt.')' : '');
9718 9718
 			} else {
9719
-				$ret .= dol_htmlentities($fullname) . $addgendertxt . ((!empty($object->societe) && $object->societe != $fullname) ? ' (' . dol_htmlentities($object->societe) . ')' : '');
9719
+				$ret .= dol_htmlentities($fullname).$addgendertxt.((!empty($object->societe) && $object->societe != $fullname) ? ' ('.dol_htmlentities($object->societe).')' : '');
9720 9720
 			}
9721 9721
 		} elseif (in_array($object->element, array('contact', 'user'))) {
9722
-			$ret .= dol_htmlentities($object->getFullName($langs)) . $addgendertxt;
9722
+			$ret .= dol_htmlentities($object->getFullName($langs)).$addgendertxt;
9723 9723
 		} elseif ($object->element == 'usergroup') {
9724 9724
 			$ret .= dol_htmlentities($object->name);
9725 9725
 		} elseif (in_array($object->element, array('action', 'agenda'))) {
9726
-			$ret .= $object->ref . '<br>' . $object->label;
9726
+			$ret .= $object->ref.'<br>'.$object->label;
9727 9727
 		} elseif (in_array($object->element, array('adherent_type'))) {
9728 9728
 			$ret .= $object->label;
9729 9729
 		} elseif ($object->element == 'ecm_directories') {
@@ -9775,9 +9775,9 @@  discard block
 block discarded – undo
9775 9775
 		}
9776 9776
 
9777 9777
 		// Barcode image
9778
-		$url = DOL_URL_ROOT . '/viewimage.php?modulepart=barcode&generator=' . urlencode($object->barcode_type_coder) . '&code=' . urlencode($object->barcode) . '&encoding=' . urlencode($object->barcode_type_code);
9779
-		$out = '<!-- url barcode = ' . $url . ' -->';
9780
-		$out .= '<img src="' . $url . '"' . ($morecss ? ' class="' . $morecss . '"' : '') . '>';
9778
+		$url = DOL_URL_ROOT.'/viewimage.php?modulepart=barcode&generator='.urlencode($object->barcode_type_coder).'&code='.urlencode($object->barcode).'&encoding='.urlencode($object->barcode_type_code);
9779
+		$out = '<!-- url barcode = '.$url.' -->';
9780
+		$out .= '<img src="'.$url.'"'.($morecss ? ' class="'.$morecss.'"' : '').'>';
9781 9781
 
9782 9782
 		return $out;
9783 9783
 	}
@@ -9817,28 +9817,28 @@  discard block
 block discarded – undo
9817 9817
 			if (!empty($object->logo)) {
9818 9818
 				if (dolIsAllowedForPreview($object->logo)) {
9819 9819
 					if ((string) $imagesize == 'mini') {
9820
-						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . getImageFileNameForSize($object->logo, '_mini'); // getImageFileNameForSize include the thumbs
9820
+						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.getImageFileNameForSize($object->logo, '_mini'); // getImageFileNameForSize include the thumbs
9821 9821
 					} elseif ((string) $imagesize == 'small') {
9822
-						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . getImageFileNameForSize($object->logo, '_small');
9822
+						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.getImageFileNameForSize($object->logo, '_small');
9823 9823
 					} else {
9824
-						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . $object->logo;
9824
+						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.$object->logo;
9825 9825
 					}
9826
-					$originalfile = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . $object->logo;
9826
+					$originalfile = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.$object->logo;
9827 9827
 				}
9828 9828
 			}
9829 9829
 			$email = $object->email;
9830 9830
 		} elseif ($modulepart == 'contact') {
9831
-			$dir = $conf->societe->multidir_output[$entity] . '/contact';
9831
+			$dir = $conf->societe->multidir_output[$entity].'/contact';
9832 9832
 			if (!empty($object->photo)) {
9833 9833
 				if (dolIsAllowedForPreview($object->photo)) {
9834 9834
 					if ((string) $imagesize == 'mini') {
9835
-						$file = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . getImageFileNameForSize($object->photo, '_mini');
9835
+						$file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.getImageFileNameForSize($object->photo, '_mini');
9836 9836
 					} elseif ((string) $imagesize == 'small') {
9837
-						$file = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . getImageFileNameForSize($object->photo, '_small');
9837
+						$file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.getImageFileNameForSize($object->photo, '_small');
9838 9838
 					} else {
9839
-						$file = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . $object->photo;
9839
+						$file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.$object->photo;
9840 9840
 					}
9841
-					$originalfile = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . $object->photo;
9841
+					$originalfile = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.$object->photo;
9842 9842
 				}
9843 9843
 			}
9844 9844
 			$email = $object->email;
@@ -9848,17 +9848,17 @@  discard block
 block discarded – undo
9848 9848
 			if (!empty($object->photo)) {
9849 9849
 				if (dolIsAllowedForPreview($object->photo)) {
9850 9850
 					if ((string) $imagesize == 'mini') {
9851
-						$file = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . getImageFileNameForSize($object->photo, '_mini');
9851
+						$file = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.getImageFileNameForSize($object->photo, '_mini');
9852 9852
 					} elseif ((string) $imagesize == 'small') {
9853
-						$file = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . getImageFileNameForSize($object->photo, '_small');
9853
+						$file = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.getImageFileNameForSize($object->photo, '_small');
9854 9854
 					} else {
9855
-						$file = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . $object->photo;
9855
+						$file = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.$object->photo;
9856 9856
 					}
9857
-					$originalfile = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . $object->photo;
9857
+					$originalfile = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.$object->photo;
9858 9858
 				}
9859 9859
 			}
9860 9860
 			if (getDolGlobalString('MAIN_OLD_IMAGE_LINKS')) {
9861
-				$altfile = $object->id . ".jpg"; // For backward compatibility
9861
+				$altfile = $object->id.".jpg"; // For backward compatibility
9862 9862
 			}
9863 9863
 			$email = $object->email;
9864 9864
 			$capture = 'user';
@@ -9867,17 +9867,17 @@  discard block
 block discarded – undo
9867 9867
 			if (!empty($object->photo)) {
9868 9868
 				if (dolIsAllowedForPreview($object->photo)) {
9869 9869
 					if ((string) $imagesize == 'mini') {
9870
-						$file = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . getImageFileNameForSize($object->photo, '_mini');
9870
+						$file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_mini');
9871 9871
 					} elseif ((string) $imagesize == 'small') {
9872
-						$file = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . getImageFileNameForSize($object->photo, '_small');
9872
+						$file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_small');
9873 9873
 					} else {
9874
-						$file = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . $object->photo;
9874
+						$file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.$object->photo;
9875 9875
 					}
9876
-					$originalfile = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . $object->photo;
9876
+					$originalfile = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.$object->photo;
9877 9877
 				}
9878 9878
 			}
9879 9879
 			if (getDolGlobalString('MAIN_OLD_IMAGE_LINKS')) {
9880
-				$altfile = $object->id . ".jpg"; // For backward compatibility
9880
+				$altfile = $object->id.".jpg"; // For backward compatibility
9881 9881
 			}
9882 9882
 			$email = $object->email;
9883 9883
 			$capture = 'user';
@@ -9887,17 +9887,17 @@  discard block
 block discarded – undo
9887 9887
 			if (!empty($object->photo)) {
9888 9888
 				if (dolIsAllowedForPreview($object->photo)) {
9889 9889
 					if ((string) $imagesize == 'mini') {
9890
-						$file = get_exdir($id, 2, 0, 0, $object, $modulepart) . 'photos/' . getImageFileNameForSize($object->photo, '_mini');
9890
+						$file = get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.getImageFileNameForSize($object->photo, '_mini');
9891 9891
 					} elseif ((string) $imagesize == 'small') {
9892
-						$file = get_exdir($id, 2, 0, 0, $object, $modulepart) . 'photos/' . getImageFileNameForSize($object->photo, '_small');
9892
+						$file = get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.getImageFileNameForSize($object->photo, '_small');
9893 9893
 					} else {
9894
-						$file = get_exdir($id, 2, 0, 0, $object, $modulepart) . 'photos/' . $object->photo;
9894
+						$file = get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.$object->photo;
9895 9895
 					}
9896
-					$originalfile = get_exdir($id, 2, 0, 0, $object, $modulepart) . 'photos/' . $object->photo;
9896
+					$originalfile = get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.$object->photo;
9897 9897
 				}
9898 9898
 			}
9899 9899
 			if (getDolGlobalString('MAIN_OLD_IMAGE_LINKS')) {
9900
-				$altfile = $object->id . ".jpg"; // For backward compatibility
9900
+				$altfile = $object->id.".jpg"; // For backward compatibility
9901 9901
 			}
9902 9902
 			$email = $object->email;
9903 9903
 		}
@@ -9907,35 +9907,35 @@  discard block
 block discarded – undo
9907 9907
 		}
9908 9908
 
9909 9909
 		if ($dir) {
9910
-			if ($file && file_exists($dir . "/" . $file)) {
9910
+			if ($file && file_exists($dir."/".$file)) {
9911 9911
 				if ($addlinktofullsize) {
9912
-					$urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity=' . $entity);
9912
+					$urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity='.$entity);
9913 9913
 					if ($urladvanced) {
9914
-						$ret .= '<a href="' . $urladvanced . '">';
9914
+						$ret .= '<a href="'.$urladvanced.'">';
9915 9915
 					} else {
9916
-						$ret .= '<a href="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($originalfile) . '&cache=' . $cache . '">';
9916
+						$ret .= '<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($originalfile).'&cache='.$cache.'">';
9917 9917
 					}
9918 9918
 				}
9919
-				$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 . '">';
9919
+				$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.'">';
9920 9920
 				if ($addlinktofullsize) {
9921 9921
 					$ret .= '</a>';
9922 9922
 				}
9923
-			} elseif ($altfile && file_exists($dir . "/" . $altfile)) {
9923
+			} elseif ($altfile && file_exists($dir."/".$altfile)) {
9924 9924
 				if ($addlinktofullsize) {
9925
-					$urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity=' . $entity);
9925
+					$urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity='.$entity);
9926 9926
 					if ($urladvanced) {
9927
-						$ret .= '<a href="' . $urladvanced . '">';
9927
+						$ret .= '<a href="'.$urladvanced.'">';
9928 9928
 					} else {
9929
-						$ret .= '<a href="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($originalfile) . '&cache=' . $cache . '">';
9929
+						$ret .= '<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($originalfile).'&cache='.$cache.'">';
9930 9930
 					}
9931 9931
 				}
9932
-				$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 . '">';
9932
+				$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.'">';
9933 9933
 				if ($addlinktofullsize) {
9934 9934
 					$ret .= '</a>';
9935 9935
 				}
9936 9936
 			} else {
9937 9937
 				$nophoto = '/public/theme/common/nophoto.png';
9938
-				$defaultimg = 'identicon';        // For gravatar
9938
+				$defaultimg = 'identicon'; // For gravatar
9939 9939
 				if (in_array($modulepart, array('societe', 'userphoto', 'contact', 'memberphoto'))) {    // For modules that need a special image when photo not found
9940 9940
 					if ($modulepart == 'societe' || ($modulepart == 'memberphoto' && !empty($object->morphy) && strpos($object->morphy, 'mor')) !== false) {
9941 9941
 						$nophoto = 'company';
@@ -9953,13 +9953,13 @@  discard block
 block discarded – undo
9953 9953
 				if (isModEnabled('gravatar') && $email && empty($noexternsourceoverwrite)) {
9954 9954
 					// see https://gravatar.com/site/implement/images/php/
9955 9955
 					$ret .= '<!-- Put link to gravatar -->';
9956
-					$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
9956
+					$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
9957 9957
 				} else {
9958 9958
 					if ($nophoto == 'company') {
9959
-						$ret .= '<div class="divforspanimg photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . '>' . img_picto('', 'company') . '</div>';
9959
+						$ret .= '<div class="divforspanimg photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').'>'.img_picto('', 'company').'</div>';
9960 9960
 						$ret .= '<div class="difforspanimgright"></div>';
9961 9961
 					} else {
9962
-						$ret .= '<img class="photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . ' src="' . DOL_URL_ROOT . $nophoto . '">';
9962
+						$ret .= '<img class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').' src="'.DOL_URL_ROOT.$nophoto.'">';
9963 9963
 					}
9964 9964
 				}
9965 9965
 			}
@@ -9970,15 +9970,15 @@  discard block
 block discarded – undo
9970 9970
 				}
9971 9971
 				$ret .= '<table class="nobordernopadding centpercent">';
9972 9972
 				if ($object->photo) {
9973
-					$ret .= '<tr><td><input type="checkbox" class="flat photodelete" name="deletephoto" id="photodelete"> <label for="photodelete">' . $langs->trans("Delete") . '</label><br><br></td></tr>';
9973
+					$ret .= '<tr><td><input type="checkbox" class="flat photodelete" name="deletephoto" id="photodelete"> <label for="photodelete">'.$langs->trans("Delete").'</label><br><br></td></tr>';
9974 9974
 				}
9975 9975
 				$ret .= '<tr><td class="tdoverflow">';
9976 9976
 				$maxfilesizearray = getMaxFileSizeArray();
9977 9977
 				$maxmin = $maxfilesizearray['maxmin'];
9978 9978
 				if ($maxmin > 0) {
9979
-					$ret .= '<input type="hidden" name="MAX_FILE_SIZE" value="' . ($maxmin * 1024) . '">';    // MAX_FILE_SIZE must precede the field type=file
9979
+					$ret .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file
9980 9980
 				}
9981
-				$ret .= '<input type="file" class="flat maxwidth200onsmartphone" name="photo" id="photoinput" accept="image/*"' . ($capture ? ' capture="' . $capture . '"' : '') . '>';
9981
+				$ret .= '<input type="file" class="flat maxwidth200onsmartphone" name="photo" id="photoinput" accept="image/*"'.($capture ? ' capture="'.$capture.'"' : '').'>';
9982 9982
 				$ret .= '</td></tr>';
9983 9983
 				$ret .= '</table>';
9984 9984
 			}
@@ -10032,38 +10032,38 @@  discard block
 block discarded – undo
10032 10032
 		if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) {
10033 10033
 			$sql .= ", e.label";
10034 10034
 		}
10035
-		$sql .= " FROM " . $this->db->prefix() . "usergroup as ug ";
10035
+		$sql .= " FROM ".$this->db->prefix()."usergroup as ug ";
10036 10036
 		if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) {
10037
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "entity as e ON e.rowid=ug.entity";
10037
+			$sql .= " LEFT JOIN ".$this->db->prefix()."entity as e ON e.rowid=ug.entity";
10038 10038
 			if ($force_entity) {
10039
-				$sql .= " WHERE ug.entity IN (0, " . $force_entity . ")";
10039
+				$sql .= " WHERE ug.entity IN (0, ".$force_entity.")";
10040 10040
 			} else {
10041 10041
 				$sql .= " WHERE ug.entity IS NOT NULL";
10042 10042
 			}
10043 10043
 		} else {
10044
-			$sql .= " WHERE ug.entity IN (0, " . $conf->entity . ")";
10044
+			$sql .= " WHERE ug.entity IN (0, ".$conf->entity.")";
10045 10045
 		}
10046 10046
 		if (is_array($exclude) && $excludeGroups) {
10047
-			$sql .= " AND ug.rowid NOT IN (" . $this->db->sanitize($excludeGroups) . ")";
10047
+			$sql .= " AND ug.rowid NOT IN (".$this->db->sanitize($excludeGroups).")";
10048 10048
 		}
10049 10049
 		if (is_array($include) && $includeGroups) {
10050
-			$sql .= " AND ug.rowid IN (" . $this->db->sanitize($includeGroups) . ")";
10050
+			$sql .= " AND ug.rowid IN (".$this->db->sanitize($includeGroups).")";
10051 10051
 		}
10052 10052
 		$sql .= " ORDER BY ug.nom ASC";
10053 10053
 
10054
-		dol_syslog(get_class($this) . "::select_dolgroups", LOG_DEBUG);
10054
+		dol_syslog(get_class($this)."::select_dolgroups", LOG_DEBUG);
10055 10055
 		$resql = $this->db->query($sql);
10056 10056
 		if ($resql) {
10057 10057
 			// Enhance with select2
10058
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
10058
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
10059 10059
 
10060
-			$out .= '<select class="flat minwidth200' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . ' ' . ($disabled ? ' disabled' : '') . '>';
10060
+			$out .= '<select class="flat minwidth200'.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.($disabled ? ' disabled' : '').'>';
10061 10061
 
10062 10062
 			$num = $this->db->num_rows($resql);
10063 10063
 			$i = 0;
10064 10064
 			if ($num) {
10065 10065
 				if ($show_empty && !$multiple) {
10066
-					$out .= '<option value="-1"' . (in_array(-1, $selected) ? ' selected' : '') . '>&nbsp;</option>' . "\n";
10066
+					$out .= '<option value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'>&nbsp;</option>'."\n";
10067 10067
 				}
10068 10068
 
10069 10069
 				while ($i < $num) {
@@ -10076,11 +10076,11 @@  discard block
 block discarded – undo
10076 10076
 					$label = $obj->name;
10077 10077
 					$labelhtml = $obj->name;
10078 10078
 					if (isModEnabled('multicompany') && !getDolGlobalInt('MULTICOMPANY_TRANSVERSE_MODE') && $conf->entity == 1) {
10079
-						$label .= " (" . $obj->label . ")";
10080
-						$labelhtml .= ' <span class="opacitymedium">(' . $obj->label . ')</span>';
10079
+						$label .= " (".$obj->label.")";
10080
+						$labelhtml .= ' <span class="opacitymedium">('.$obj->label.')</span>';
10081 10081
 					}
10082 10082
 
10083
-					$out .= '<option value="' . $obj->rowid . '"';
10083
+					$out .= '<option value="'.$obj->rowid.'"';
10084 10084
 					if ($disableline) {
10085 10085
 						$out .= ' disabled';
10086 10086
 					}
@@ -10096,9 +10096,9 @@  discard block
 block discarded – undo
10096 10096
 				}
10097 10097
 			} else {
10098 10098
 				if ($show_empty) {
10099
-					$out .= '<option value="-1"' . (in_array(-1, $selected) ? ' selected' : '') . '></option>' . "\n";
10099
+					$out .= '<option value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'></option>'."\n";
10100 10100
 				}
10101
-				$out .= '<option value="" disabled>' . $langs->trans("NoUserGroupDefined") . '</option>';
10101
+				$out .= '<option value="" disabled>'.$langs->trans("NoUserGroupDefined").'</option>';
10102 10102
 			}
10103 10103
 			$out .= '</select>';
10104 10104
 
@@ -10147,25 +10147,25 @@  discard block
 block discarded – undo
10147 10147
 		$out = '';
10148 10148
 
10149 10149
 		if (!empty($conf->use_javascript_ajax)) {
10150
-			$out .= '<div class="inline-block checkallactions"><input type="checkbox" id="' . $cssclass . 's" name="' . $cssclass . 's" class="checkallactions"></div>';
10150
+			$out .= '<div class="inline-block checkallactions"><input type="checkbox" id="'.$cssclass.'s" name="'.$cssclass.'s" class="checkallactions"></div>';
10151 10151
 		}
10152
-		$out .= '<script nonce="' . getNonce() . '">
10152
+		$out .= '<script nonce="'.getNonce().'">
10153 10153
             $(document).ready(function() {
10154
-                $("#' . $cssclass . 's").click(function() {
10154
+                $("#' . $cssclass.'s").click(function() {
10155 10155
                     if($(this).is(\':checked\')){
10156
-                        console.log("We check all ' . $cssclass . ' and trigger the change method");
10157
-                		$(".' . $cssclass . '").prop(\'checked\', true).trigger(\'change\');
10156
+                        console.log("We check all ' . $cssclass.' and trigger the change method");
10157
+                		$(".' . $cssclass.'").prop(\'checked\', true).trigger(\'change\');
10158 10158
                     }
10159 10159
                     else
10160 10160
                     {
10161 10161
                         console.log("We uncheck all");
10162
-                		$(".' . $cssclass . '").prop(\'checked\', false).trigger(\'change\');
10162
+                		$(".' . $cssclass.'").prop(\'checked\', false).trigger(\'change\');
10163 10163
                     }' . "\n";
10164 10164
 		if ($calljsfunction) {
10165
-			$out .= 'if (typeof initCheckForSelect == \'function\') { initCheckForSelect(0, "' . $massactionname . '", "' . $cssclass . '"); } else { console.log("No function initCheckForSelect found. Call won\'t be done."); }';
10165
+			$out .= 'if (typeof initCheckForSelect == \'function\') { initCheckForSelect(0, "'.$massactionname.'", "'.$cssclass.'"); } else { console.log("No function initCheckForSelect found. Call won\'t be done."); }';
10166 10166
 		}
10167 10167
 		$out .= '         });
10168
-        	        $(".' . $cssclass . '").change(function() {
10168
+        	        $(".' . $cssclass.'").change(function() {
10169 10169
 					$(this).closest("tr").toggleClass("highlight", this.checked);
10170 10170
 				});
10171 10171
 		 	});
@@ -10210,67 +10210,67 @@  discard block
 block discarded – undo
10210 10210
 		global $langs, $user;
10211 10211
 
10212 10212
 		$out = '';
10213
-		$sql = "SELECT rowid, label FROM " . $this->db->prefix() . "c_exp_tax_cat WHERE active = 1";
10214
-		$sql .= " AND entity IN (0," . getEntity('exp_tax_cat') . ")";
10213
+		$sql = "SELECT rowid, label FROM ".$this->db->prefix()."c_exp_tax_cat WHERE active = 1";
10214
+		$sql .= " AND entity IN (0,".getEntity('exp_tax_cat').")";
10215 10215
 		if (!empty($excludeid)) {
10216
-			$sql .= " AND rowid NOT IN (" . $this->db->sanitize(implode(',', $excludeid)) . ")";
10216
+			$sql .= " AND rowid NOT IN (".$this->db->sanitize(implode(',', $excludeid)).")";
10217 10217
 		}
10218 10218
 		$sql .= " ORDER BY label";
10219 10219
 
10220 10220
 		$resql = $this->db->query($sql);
10221 10221
 		if ($resql) {
10222
-			$out = '<select id="select_' . $htmlname . '" name="' . $htmlname . '" class="' . $htmlname . ' flat minwidth75imp maxwidth200">';
10222
+			$out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp maxwidth200">';
10223 10223
 			if ($useempty) {
10224 10224
 				$out .= '<option value="0">&nbsp;</option>';
10225 10225
 			}
10226 10226
 
10227 10227
 			while ($obj = $this->db->fetch_object($resql)) {
10228
-				$out .= '<option ' . ($selected == $obj->rowid ? 'selected="selected"' : '') . ' value="' . $obj->rowid . '">' . $langs->trans($obj->label) . '</option>';
10228
+				$out .= '<option '.($selected == $obj->rowid ? 'selected="selected"' : '').' value="'.$obj->rowid.'">'.$langs->trans($obj->label).'</option>';
10229 10229
 			}
10230 10230
 			$out .= '</select>';
10231
-			$out .= ajax_combobox('select_' . $htmlname);
10231
+			$out .= ajax_combobox('select_'.$htmlname);
10232 10232
 
10233 10233
 			if (!empty($htmlname) && $user->admin && $info_admin) {
10234
-				$out .= ' ' . info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
10234
+				$out .= ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
10235 10235
 			}
10236 10236
 
10237 10237
 			if (!empty($target)) {
10238
-				$sql = "SELECT c.id FROM " . $this->db->prefix() . "c_type_fees as c WHERE c.code = 'EX_KME' AND c.active = 1";
10238
+				$sql = "SELECT c.id FROM ".$this->db->prefix()."c_type_fees as c WHERE c.code = 'EX_KME' AND c.active = 1";
10239 10239
 				$resql = $this->db->query($sql);
10240 10240
 				if ($resql) {
10241 10241
 					if ($this->db->num_rows($resql) > 0) {
10242 10242
 						$obj = $this->db->fetch_object($resql);
10243
-						$out .= '<script nonce="' . getNonce() . '">
10243
+						$out .= '<script nonce="'.getNonce().'">
10244 10244
 							$(function() {
10245
-								$("select[name=' . $target . ']").on("change", function() {
10245
+								$("select[name=' . $target.']").on("change", function() {
10246 10246
 									var current_val = $(this).val();
10247
-									if (current_val == ' . $obj->id . ') {';
10247
+									if (current_val == ' . $obj->id.') {';
10248 10248
 						if (!empty($default_selected) || !empty($selected)) {
10249
-							$out .= '$("select[name=' . $htmlname . ']").val("' . ($default_selected > 0 ? $default_selected : $selected) . '");';
10249
+							$out .= '$("select[name='.$htmlname.']").val("'.($default_selected > 0 ? $default_selected : $selected).'");';
10250 10250
 						}
10251 10251
 
10252 10252
 						$out .= '
10253
-										$("select[name=' . $htmlname . ']").change();
10253
+										$("select[name=' . $htmlname.']").change();
10254 10254
 									}
10255 10255
 								});
10256 10256
 
10257
-								$("select[name=' . $htmlname . ']").change(function() {
10257
+								$("select[name=' . $htmlname.']").change(function() {
10258 10258
 
10259
-									if ($("select[name=' . $target . ']").val() == ' . $obj->id . ') {
10259
+									if ($("select[name=' . $target.']").val() == '.$obj->id.') {
10260 10260
 										// get price of kilometer to fill the unit price
10261 10261
 										$.ajax({
10262 10262
 											method: "POST",
10263 10263
 											dataType: "json",
10264
-											data: { fk_c_exp_tax_cat: $(this).val(), token: \'' . currentToken() . '\' },
10265
-											url: "' . (DOL_URL_ROOT . '/expensereport/ajax/ajaxik.php?' . join('&', $params)) . '",
10264
+											data: { fk_c_exp_tax_cat: $(this).val(), token: \'' . currentToken().'\' },
10265
+											url: "' . (DOL_URL_ROOT.'/expensereport/ajax/ajaxik.php?'.join('&', $params)).'",
10266 10266
 										}).done(function( data, textStatus, jqXHR ) {
10267 10267
 											console.log(data);
10268 10268
 											if (typeof data.up != "undefined") {
10269 10269
 												$("input[name=value_unit]").val(data.up);
10270
-												$("select[name=' . $htmlname . ']").attr("title", data.title);
10270
+												$("select[name=' . $htmlname.']").attr("title", data.title);
10271 10271
 											} else {
10272 10272
 												$("input[name=value_unit]").val("");
10273
-												$("select[name=' . $htmlname . ']").attr("title", "");
10273
+												$("select[name=' . $htmlname.']").attr("title", "");
10274 10274
 											}
10275 10275
 										});
10276 10276
 									}
@@ -10300,18 +10300,18 @@  discard block
 block discarded – undo
10300 10300
 		global $conf, $langs;
10301 10301
 
10302 10302
 		$out = '';
10303
-		$sql = "SELECT rowid, range_ik FROM " . $this->db->prefix() . "c_exp_tax_range";
10304
-		$sql .= " WHERE entity = " . $conf->entity . " AND active = 1";
10303
+		$sql = "SELECT rowid, range_ik FROM ".$this->db->prefix()."c_exp_tax_range";
10304
+		$sql .= " WHERE entity = ".$conf->entity." AND active = 1";
10305 10305
 
10306 10306
 		$resql = $this->db->query($sql);
10307 10307
 		if ($resql) {
10308
-			$out = '<select id="select_' . $htmlname . '" name="' . $htmlname . '" class="' . $htmlname . ' flat minwidth75imp">';
10308
+			$out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp">';
10309 10309
 			if ($useempty) {
10310 10310
 				$out .= '<option value="0"></option>';
10311 10311
 			}
10312 10312
 
10313 10313
 			while ($obj = $this->db->fetch_object($resql)) {
10314
-				$out .= '<option ' . ($selected == $obj->rowid ? 'selected="selected"' : '') . ' value="' . $obj->rowid . '">' . price($obj->range_ik, 0, $langs, 1, 0) . '</option>';
10314
+				$out .= '<option '.($selected == $obj->rowid ? 'selected="selected"' : '').' value="'.$obj->rowid.'">'.price($obj->range_ik, 0, $langs, 1, 0).'</option>';
10315 10315
 			}
10316 10316
 			$out .= '</select>';
10317 10317
 		} else {
@@ -10336,17 +10336,17 @@  discard block
 block discarded – undo
10336 10336
 		global $langs;
10337 10337
 
10338 10338
 		$out = '';
10339
-		$sql = "SELECT id, code, label FROM " . $this->db->prefix() . "c_type_fees";
10339
+		$sql = "SELECT id, code, label FROM ".$this->db->prefix()."c_type_fees";
10340 10340
 		$sql .= " WHERE active = 1";
10341 10341
 
10342 10342
 		$resql = $this->db->query($sql);
10343 10343
 		if ($resql) {
10344
-			$out = '<select id="select_' . $htmlname . '" name="' . $htmlname . '" class="' . $htmlname . ' flat minwidth75imp">';
10344
+			$out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp">';
10345 10345
 			if ($useempty) {
10346 10346
 				$out .= '<option value="0"></option>';
10347 10347
 			}
10348 10348
 			if ($allchoice) {
10349
-				$out .= '<option value="-1">' . $langs->trans('AllExpenseReport') . '</option>';
10349
+				$out .= '<option value="-1">'.$langs->trans('AllExpenseReport').'</option>';
10350 10350
 			}
10351 10351
 
10352 10352
 			$field = 'code';
@@ -10356,7 +10356,7 @@  discard block
 block discarded – undo
10356 10356
 
10357 10357
 			while ($obj = $this->db->fetch_object($resql)) {
10358 10358
 				$key = $langs->trans($obj->code);
10359
-				$out .= '<option ' . ($selected == $obj->{$field} ? 'selected="selected"' : '') . ' value="' . $obj->{$field} . '">' . ($key != $obj->code ? $key : $obj->label) . '</option>';
10359
+				$out .= '<option '.($selected == $obj->{$field} ? 'selected="selected"' : '').' value="'.$obj->{$field}.'">'.($key != $obj->code ? $key : $obj->label).'</option>';
10360 10360
 			}
10361 10361
 			$out .= '</select>';
10362 10362
 		} else {
@@ -10388,7 +10388,7 @@  discard block
 block discarded – undo
10388 10388
 	{
10389 10389
 		global $user, $conf, $langs;
10390 10390
 
10391
-		require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
10391
+		require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
10392 10392
 
10393 10393
 		if (is_null($usertofilter)) {
10394 10394
 			$usertofilter = $user;
@@ -10412,10 +10412,10 @@  discard block
 block discarded – undo
10412 10412
 		$sql = "SELECT f.rowid, f.ref as fref, 'nolabel' as flabel, p.rowid as pid, f.ref,
10413 10413
             p.title, p.fk_soc, p.fk_statut, p.public,";
10414 10414
 		$sql .= ' s.nom as name';
10415
-		$sql .= ' FROM ' . $this->db->prefix() . 'projet as p';
10416
-		$sql .= ' LEFT JOIN ' . $this->db->prefix() . 'societe as s ON s.rowid = p.fk_soc,';
10417
-		$sql .= ' ' . $this->db->prefix() . 'facture as f';
10418
-		$sql .= " WHERE p.entity IN (" . getEntity('project') . ")";
10415
+		$sql .= ' FROM '.$this->db->prefix().'projet as p';
10416
+		$sql .= ' LEFT JOIN '.$this->db->prefix().'societe as s ON s.rowid = p.fk_soc,';
10417
+		$sql .= ' '.$this->db->prefix().'facture as f';
10418
+		$sql .= " WHERE p.entity IN (".getEntity('project').")";
10419 10419
 		$sql .= " AND f.fk_projet = p.rowid AND f.fk_statut=0"; //Brouillons seulement
10420 10420
 		//if ($projectsListId) $sql.= " AND p.rowid IN (".$this->db->sanitize($projectsListId).")";
10421 10421
 		//if ($socid == 0) $sql.= " AND (p.fk_soc=0 OR p.fk_soc IS NULL)";
@@ -10426,14 +10426,14 @@  discard block
 block discarded – undo
10426 10426
 		if ($resql) {
10427 10427
 			// Use select2 selector
10428 10428
 			if (!empty($conf->use_javascript_ajax)) {
10429
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
10429
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
10430 10430
 				$comboenhancement = ajax_combobox($htmlname, '', 0, $forcefocus);
10431 10431
 				$out .= $comboenhancement;
10432 10432
 				$morecss = 'minwidth200imp maxwidth500';
10433 10433
 			}
10434 10434
 
10435 10435
 			if (empty($option_only)) {
10436
-				$out .= '<select class="valignmiddle flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ' id="' . $htmlname . '" name="' . $htmlname . '">';
10436
+				$out .= '<select class="valignmiddle flat'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').' id="'.$htmlname.'" name="'.$htmlname.'">';
10437 10437
 			}
10438 10438
 			if (!empty($show_empty)) {
10439 10439
 				$out .= '<option value="0" class="optiongrey">';
@@ -10463,33 +10463,33 @@  discard block
 block discarded – undo
10463 10463
 						if ($showproject == 'all') {
10464 10464
 							$labeltoshow .= dol_trunc($obj->ref, 18); // Invoice ref
10465 10465
 							if ($obj->name) {
10466
-								$labeltoshow .= ' - ' . $obj->name; // Soc name
10466
+								$labeltoshow .= ' - '.$obj->name; // Soc name
10467 10467
 							}
10468 10468
 
10469 10469
 							$disabled = 0;
10470 10470
 							if ($obj->fk_statut == Project::STATUS_DRAFT) {
10471 10471
 								$disabled = 1;
10472
-								$labeltoshow .= ' - ' . $langs->trans("Draft");
10472
+								$labeltoshow .= ' - '.$langs->trans("Draft");
10473 10473
 							} elseif ($obj->fk_statut == Project::STATUS_CLOSED) {
10474 10474
 								if ($discard_closed == 2) {
10475 10475
 									$disabled = 1;
10476 10476
 								}
10477
-								$labeltoshow .= ' - ' . $langs->trans("Closed");
10477
+								$labeltoshow .= ' - '.$langs->trans("Closed");
10478 10478
 							} elseif ($socid > 0 && (!empty($obj->fk_soc) && $obj->fk_soc != $socid)) {
10479 10479
 								$disabled = 1;
10480
-								$labeltoshow .= ' - ' . $langs->trans("LinkedToAnotherCompany");
10480
+								$labeltoshow .= ' - '.$langs->trans("LinkedToAnotherCompany");
10481 10481
 							}
10482 10482
 						}
10483 10483
 
10484 10484
 						if (!empty($selected) && $selected == $obj->rowid) {
10485
-							$out .= '<option value="' . $obj->rowid . '" selected';
10485
+							$out .= '<option value="'.$obj->rowid.'" selected';
10486 10486
 							//if ($disabled) $out.=' disabled';						// with select2, field can't be preselected if disabled
10487
-							$out .= '>' . $labeltoshow . '</option>';
10487
+							$out .= '>'.$labeltoshow.'</option>';
10488 10488
 						} else {
10489 10489
 							if ($hideunselectables && $disabled && ($selected != $obj->rowid)) {
10490 10490
 								$resultat = '';
10491 10491
 							} else {
10492
-								$resultat = '<option value="' . $obj->rowid . '"';
10492
+								$resultat = '<option value="'.$obj->rowid.'"';
10493 10493
 								if ($disabled) {
10494 10494
 									$resultat .= ' disabled';
10495 10495
 								}
@@ -10541,22 +10541,22 @@  discard block
 block discarded – undo
10541 10541
 
10542 10542
 		$sql = 'SELECT f.rowid, f.entity, f.titre as title, f.suspended, f.fk_soc';
10543 10543
 		//$sql.= ', el.fk_source';
10544
-		$sql .= ' FROM ' . MAIN_DB_PREFIX . 'facture_rec as f';
10545
-		$sql .= " WHERE f.entity IN (" . getEntity('invoice') . ")";
10544
+		$sql .= ' FROM '.MAIN_DB_PREFIX.'facture_rec as f';
10545
+		$sql .= " WHERE f.entity IN (".getEntity('invoice').")";
10546 10546
 		$sql .= " ORDER BY f.titre ASC";
10547 10547
 
10548 10548
 		$resql = $this->db->query($sql);
10549 10549
 		if ($resql) {
10550 10550
 			// Use select2 selector
10551 10551
 			if (!empty($conf->use_javascript_ajax)) {
10552
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
10552
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
10553 10553
 				$comboenhancement = ajax_combobox($htmlname, '', 0, $forcefocus);
10554 10554
 				$out .= $comboenhancement;
10555 10555
 				$morecss = 'minwidth200imp maxwidth500';
10556 10556
 			}
10557 10557
 
10558 10558
 			if (empty($option_only)) {
10559
-				$out .= '<select class="valignmiddle flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ' id="' . $htmlname . '" name="' . $htmlname . '">';
10559
+				$out .= '<select class="valignmiddle flat'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').' id="'.$htmlname.'" name="'.$htmlname.'">';
10560 10560
 			}
10561 10561
 			if (!empty($show_empty)) {
10562 10562
 				$out .= '<option value="0" class="optiongrey">';
@@ -10575,19 +10575,19 @@  discard block
 block discarded – undo
10575 10575
 					$disabled = 0;
10576 10576
 					if (!empty($obj->suspended)) {
10577 10577
 						$disabled = 1;
10578
-						$labeltoshow .= ' - ' . $langs->trans("Closed");
10578
+						$labeltoshow .= ' - '.$langs->trans("Closed");
10579 10579
 					}
10580 10580
 
10581 10581
 
10582 10582
 					if (!empty($selected) && $selected == $obj->rowid) {
10583
-						$out .= '<option value="' . $obj->rowid . '" selected';
10583
+						$out .= '<option value="'.$obj->rowid.'" selected';
10584 10584
 						//if ($disabled) $out.=' disabled';						// with select2, field can't be preselected if disabled
10585
-						$out .= '>' . $labeltoshow . '</option>';
10585
+						$out .= '>'.$labeltoshow.'</option>';
10586 10586
 					} else {
10587 10587
 						if ($disabled && ($selected != $obj->rowid)) {
10588 10588
 							$resultat = '';
10589 10589
 						} else {
10590
-							$resultat = '<option value="' . $obj->rowid . '"';
10590
+							$resultat = '<option value="'.$obj->rowid.'"';
10591 10591
 							if ($disabled) {
10592 10592
 								$resultat .= ' disabled';
10593 10593
 							}
@@ -10627,14 +10627,14 @@  discard block
 block discarded – undo
10627 10627
 		global $langs;
10628 10628
 
10629 10629
 		if ($search_component_params_hidden != '' && !preg_match('/^\(.*\)$/', $search_component_params_hidden)) {    // If $search_component_params_hidden does not start and end with ()
10630
-			$search_component_params_hidden = '(' . $search_component_params_hidden . ')';
10630
+			$search_component_params_hidden = '('.$search_component_params_hidden.')';
10631 10631
 		}
10632 10632
 
10633 10633
 		$ret = '';
10634 10634
 
10635 10635
 		$ret .= '<div class="divadvancedsearchfieldcomp inline-block">';
10636 10636
 		$ret .= '<a href="#" class="dropdownsearch-toggle unsetcolor">';
10637
-		$ret .= '<span class="fas fa-filter linkobject boxfilter paddingright pictofixedwidth" title="' . dol_escape_htmltag($langs->trans("Filters")) . '" id="idsubimgproductdistribution"></span>';
10637
+		$ret .= '<span class="fas fa-filter linkobject boxfilter paddingright pictofixedwidth" title="'.dol_escape_htmltag($langs->trans("Filters")).'" id="idsubimgproductdistribution"></span>';
10638 10638
 		$ret .= '</a>';
10639 10639
 
10640 10640
 		$ret .= '<div class="divadvancedsearchfieldcompinput inline-block minwidth500 maxwidth300onsmartphone">';
@@ -10661,13 +10661,13 @@  discard block
 block discarded – undo
10661 10661
 				}
10662 10662
 
10663 10663
 				if ($countparenthesis == 0) {
10664
-					$char2 = dol_substr($search_component_params_hidden, $i+1, 1);
10665
-					$char3 = dol_substr($search_component_params_hidden, $i+2, 1);
10664
+					$char2 = dol_substr($search_component_params_hidden, $i + 1, 1);
10665
+					$char3 = dol_substr($search_component_params_hidden, $i + 2, 1);
10666 10666
 					if ($char == 'A' && $char2 == 'N' && $char3 == 'D') {
10667 10667
 						// We found a AND
10668 10668
 						$arrayofandtags[] = trim($s);
10669 10669
 						$s = '';
10670
-						$i+=2;
10670
+						$i += 2;
10671 10671
 					} else {
10672 10672
 						$s .= $char;
10673 10673
 					}
@@ -10691,8 +10691,8 @@  discard block
 block discarded – undo
10691 10691
 				include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
10692 10692
 				$searchtags = removeGlobalParenthesis($searchtags);
10693 10693
 
10694
-				$ret .= '<span class="marginleftonlyshort valignmiddle tagsearch" data-ufilterid="'.($tmpkey+1).'" data-ufilter="'.dol_escape_htmltag($tmpval).'">';
10695
-				$ret .= '<span class="tagsearchdelete select2-selection__choice__remove" data-ufilterid="'.($tmpkey+1).'">x</span> ';
10694
+				$ret .= '<span class="marginleftonlyshort valignmiddle tagsearch" data-ufilterid="'.($tmpkey + 1).'" data-ufilter="'.dol_escape_htmltag($tmpval).'">';
10695
+				$ret .= '<span class="tagsearchdelete select2-selection__choice__remove" data-ufilterid="'.($tmpkey + 1).'">x</span> ';
10696 10696
 				$ret .= dol_escape_htmltag($searchtags);
10697 10697
 				$ret .= '</span>';
10698 10698
 			}
@@ -10709,29 +10709,29 @@  discard block
 block discarded – undo
10709 10709
 			$ret .= '<input type="hidden" name="show_search_component_params_hidden" value="1">';
10710 10710
 		}
10711 10711
 		$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%')) -->";
10712
-		$ret .= '<input type="hidden" name="search_component_params_hidden" value="' . dol_escape_htmltag($search_component_params_hidden) . '">';
10712
+		$ret .= '<input type="hidden" name="search_component_params_hidden" value="'.dol_escape_htmltag($search_component_params_hidden).'">';
10713 10713
 		// $ret .= "<!-- sql= ".forgeSQLFromUniversalSearchCriteria($search_component_params_hidden, $errormessage)." -->";
10714 10714
 
10715 10715
 		// For compatibility with forms that show themself the search criteria in addition of this component, we output these fields
10716 10716
 		foreach ($arrayofcriterias as $criterias) {
10717 10717
 			foreach ($criterias as $criteriafamilykey => $criteriafamilyval) {
10718
-				if (in_array('search_' . $criteriafamilykey, $arrayofinputfieldsalreadyoutput)) {
10718
+				if (in_array('search_'.$criteriafamilykey, $arrayofinputfieldsalreadyoutput)) {
10719 10719
 					continue;
10720 10720
 				}
10721 10721
 				if (in_array($criteriafamilykey, array('rowid', 'ref_ext', 'entity', 'extraparams'))) {
10722 10722
 					continue;
10723 10723
 				}
10724 10724
 				if (in_array($criteriafamilyval['type'], array('date', 'datetime', 'timestamp'))) {
10725
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_start">';
10726
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_startyear">';
10727
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_startmonth">';
10728
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_startday">';
10729
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_end">';
10730
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_endyear">';
10731
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_endmonth">';
10732
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_endday">';
10725
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_start">';
10726
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_startyear">';
10727
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_startmonth">';
10728
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_startday">';
10729
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_end">';
10730
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_endyear">';
10731
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_endmonth">';
10732
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_endday">';
10733 10733
 				} else {
10734
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '">';
10734
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'">';
10735 10735
 				}
10736 10736
 			}
10737 10737
 		}
@@ -10739,7 +10739,7 @@  discard block
 block discarded – undo
10739 10739
 		$ret .= '</div>';
10740 10740
 
10741 10741
 		$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";
10742
-		$ret .= '<input type="text" placeholder="' . $langs->trans("Search") . '" name="search_component_params_input" class="noborderbottom search_component_input" value="">';
10742
+		$ret .= '<input type="text" placeholder="'.$langs->trans("Search").'" name="search_component_params_input" class="noborderbottom search_component_input" value="">';
10743 10743
 
10744 10744
 		$ret .= '</div>';
10745 10745
 		$ret .= '</div>';
@@ -10775,7 +10775,7 @@  discard block
 block discarded – undo
10775 10775
 
10776 10776
 		$TModels = array();
10777 10777
 
10778
-		include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php';
10778
+		include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
10779 10779
 		$formmail = new FormMail($this->db);
10780 10780
 		$result = $formmail->fetchAllEMailTemplate($modelType, $user, $langs);
10781 10781
 
@@ -10788,17 +10788,17 @@  discard block
 block discarded – undo
10788 10788
 			}
10789 10789
 		}
10790 10790
 
10791
-		$retstring .= '<select class="flat" id="select_' . $prefix . 'model_mail" name="' . $prefix . 'model_mail">';
10791
+		$retstring .= '<select class="flat" id="select_'.$prefix.'model_mail" name="'.$prefix.'model_mail">';
10792 10792
 
10793 10793
 		foreach ($TModels as $id_model => $label_model) {
10794
-			$retstring .= '<option value="' . $id_model . '"';
10795
-			$retstring .= ">" . $label_model . "</option>";
10794
+			$retstring .= '<option value="'.$id_model.'"';
10795
+			$retstring .= ">".$label_model."</option>";
10796 10796
 		}
10797 10797
 
10798 10798
 		$retstring .= "</select>";
10799 10799
 
10800 10800
 		if ($addjscombo) {
10801
-			$retstring .= ajax_combobox('select_' . $prefix . 'model_mail');
10801
+			$retstring .= ajax_combobox('select_'.$prefix.'model_mail');
10802 10802
 		}
10803 10803
 
10804 10804
 		return $retstring;
@@ -10849,16 +10849,16 @@  discard block
 block discarded – undo
10849 10849
 
10850 10850
 		foreach ($buttons as $button) {
10851 10851
 			$addclass = empty($button['addclass']) ? '' : $button['addclass'];
10852
-			$retstring .= '<input type="submit" class="button button-' . $button['name'] . ($morecss ? ' ' . $morecss : '') . ' ' . $addclass . '" name="' . $button['name'] . '" value="' . dol_escape_htmltag($langs->trans($button['label_key'])) . '">';
10852
+			$retstring .= '<input type="submit" class="button button-'.$button['name'].($morecss ? ' '.$morecss : '').' '.$addclass.'" name="'.$button['name'].'" value="'.dol_escape_htmltag($langs->trans($button['label_key'])).'">';
10853 10853
 		}
10854 10854
 		$retstring .= $withoutdiv ? '' : '</div>';
10855 10855
 
10856 10856
 		if ($dol_openinpopup) {
10857
-			$retstring .= '<!-- buttons are shown into a $dol_openinpopup=' . $dol_openinpopup . ' context, so we enable the close of dialog on cancel -->' . "\n";
10858
-			$retstring .= '<script nonce="' . getNonce() . '">';
10857
+			$retstring .= '<!-- buttons are shown into a $dol_openinpopup='.$dol_openinpopup.' context, so we enable the close of dialog on cancel -->'."\n";
10858
+			$retstring .= '<script nonce="'.getNonce().'">';
10859 10859
 			$retstring .= 'jQuery(".button-cancel").click(function(e) {
10860
-				e.preventDefault(); console.log(\'We click on cancel in iframe popup ' . $dol_openinpopup . '\');
10861
-				window.parent.jQuery(\'#idfordialog' . $dol_openinpopup . '\').dialog(\'close\');
10860
+				e.preventDefault(); console.log(\'We click on cancel in iframe popup ' . $dol_openinpopup.'\');
10861
+				window.parent.jQuery(\'#idfordialog' . $dol_openinpopup.'\').dialog(\'close\');
10862 10862
 				 });';
10863 10863
 			$retstring .= '</script>';
10864 10864
 		}
@@ -10887,7 +10887,7 @@  discard block
 block discarded – undo
10887 10887
 		dol_syslog(__METHOD__, LOG_DEBUG);
10888 10888
 
10889 10889
 		$sql = "SELECT rowid, code, label as label";
10890
-		$sql .= " FROM " . MAIN_DB_PREFIX . 'c_invoice_subtype';
10890
+		$sql .= " FROM ".MAIN_DB_PREFIX.'c_invoice_subtype';
10891 10891
 		$sql .= " WHERE active = 1";
10892 10892
 
10893 10893
 		$resql = $this->db->query($sql);
@@ -10898,7 +10898,7 @@  discard block
 block discarded – undo
10898 10898
 				$obj = $this->db->fetch_object($resql);
10899 10899
 
10900 10900
 				// If translation exists, we use it, otherwise we take the default wording
10901
-				$label = ($langs->trans("InvoiceSubtype" . $obj->rowid) != "InvoiceSubtype" . $obj->rowid) ? $langs->trans("InvoiceSubtype" . $obj->rowid) : (($obj->label != '-') ? $obj->label : '');
10901
+				$label = ($langs->trans("InvoiceSubtype".$obj->rowid) != "InvoiceSubtype".$obj->rowid) ? $langs->trans("InvoiceSubtype".$obj->rowid) : (($obj->label != '-') ? $obj->label : '');
10902 10902
 				$this->cache_invoice_subtype[$obj->rowid]['rowid'] = $obj->rowid;
10903 10903
 				$this->cache_invoice_subtype[$obj->rowid]['code'] = $obj->code;
10904 10904
 				$this->cache_invoice_subtype[$obj->rowid]['label'] = $label;
@@ -10930,18 +10930,18 @@  discard block
 block discarded – undo
10930 10930
 		global $langs, $user;
10931 10931
 
10932 10932
 		$out = '';
10933
-		dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG);
10933
+		dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG);
10934 10934
 
10935 10935
 		$this->load_cache_invoice_subtype();
10936 10936
 
10937
-		$out .= '<select id="' . $htmlname . '" class="flat selectsubtype' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">';
10937
+		$out .= '<select id="'.$htmlname.'" class="flat selectsubtype'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
10938 10938
 		if ($addempty) {
10939 10939
 			$out .= '<option value="0">&nbsp;</option>';
10940 10940
 		}
10941 10941
 
10942 10942
 		foreach ($this->cache_invoice_subtype as $rowid => $subtype) {
10943 10943
 			$label = $subtype['label'];
10944
-			$out .= '<option value="' . $subtype['rowid'] . '"';
10944
+			$out .= '<option value="'.$subtype['rowid'].'"';
10945 10945
 			if ($selected == $subtype['rowid']) {
10946 10946
 				$out .= ' selected="selected"';
10947 10947
 			}
Please login to merge, or discard this patch.
htdocs/core/boxes/box_factures_imp.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -107,7 +107,7 @@
 block discarded – undo
107 107
 			$sql1 .= ", SUM(pf.amount) as am";
108 108
 			$sql2 = " FROM ".MAIN_DB_PREFIX."societe as s";
109 109
 			if (getDolGlobalString('MAIN_COMPANY_PERENTITY_SHARED')) {
110
-				$sql2 .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = " . ((int) $conf->entity);
110
+				$sql2 .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = ".((int) $conf->entity);
111 111
 			}
112 112
 			if (!$user->hasRight('societe', 'client', 'voir')) {
113 113
 				$sql2 .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
Please login to merge, or discard this patch.
htdocs/core/boxes/box_shipments.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -109,7 +109,7 @@
 block discarded – undo
109 109
 				$sql .= " AND e.fk_statut = 1";
110 110
 			}
111 111
 			if ($user->socid > 0) {
112
-				$sql.= " AND s.rowid = ".((int) $user->socid);
112
+				$sql .= " AND s.rowid = ".((int) $user->socid);
113 113
 			}
114 114
 			if (!$user->hasRight('societe', 'client', 'voir')) {
115 115
 				$sql .= " AND sc.fk_user = ".((int) $user->id);
Please login to merge, or discard this patch.
htdocs/core/boxes/box_contacts.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -105,7 +105,7 @@
 block discarded – undo
105 105
 			$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as co ON sp.fk_pays = co.rowid";
106 106
 			$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON sp.fk_soc = s.rowid";
107 107
 			if (getDolGlobalString('MAIN_COMPANY_PERENTITY_SHARED')) {
108
-				$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = " . ((int) $conf->entity);
108
+				$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = ".((int) $conf->entity);
109 109
 			}
110 110
 			if (!$user->hasRight('societe', 'client', 'voir')) {
111 111
 				$sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
Please login to merge, or discard this patch.