Completed
Branch develop (c11bea)
by
unknown
24:44
created
htdocs/compta/bank/annuel.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -237,8 +237,8 @@  discard block
 block discarded – undo
237 237
 // Total debit-credit
238 238
 print '<tr class="liste_total"><td class="borderrightlight liste_total"><b>'.$langs->trans("Total")."</b></td>";
239 239
 for ($annee = $year_start; $annee <= $year_end; $annee++) {
240
-	print '<td class="right nowraponall liste_total"><b>'. (isset($totsorties[$annee]) ? price($totsorties[$annee]) : '') .'</b></td>';
241
-	print '<td class="right nowraponall liste_total borderrightlight"><b>'. (isset($totentrees[$annee]) ? price($totentrees[$annee]) : '') .'</b></td>';
240
+	print '<td class="right nowraponall liste_total"><b>'.(isset($totsorties[$annee]) ? price($totsorties[$annee]) : '').'</b></td>';
241
+	print '<td class="right nowraponall liste_total borderrightlight"><b>'.(isset($totentrees[$annee]) ? price($totentrees[$annee]) : '').'</b></td>';
242 242
 }
243 243
 print "</tr>\n";
244 244
 
@@ -479,9 +479,9 @@  discard block
 block discarded – undo
479 479
 	unset($tblyear[2]);
480 480
 
481 481
 	print '<div class="fichecenter"><div class="fichehalfleft"><div align="center">'; // do not use class="center" here, it will have no effect for the js graph inside.
482
-	print $show2;	// debit
482
+	print $show2; // debit
483 483
 	print '</div></div><div class="fichehalfright"><div align="center">'; // do not use class="center" here, it will have no effect for the js graph inside.
484
-	print $show1;	// credit
484
+	print $show1; // credit
485 485
 	print '</div></div></div>';
486 486
 	print '<div class="clearboth"></div>';
487 487
 }
Please login to merge, or discard this patch.
htdocs/accountancy/journal/bankjournal.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
 $date_start = dol_mktime(0, 0, 0, $date_startmonth, $date_startday, $date_startyear);
122 122
 $date_end = dol_mktime(23, 59, 59, $date_endmonth, $date_endday, $date_endyear);
123 123
 
124
-$pastmonth = null;  // Initialise for static analysis  (could be really unseg)
124
+$pastmonth = null; // Initialise for static analysis  (could be really unseg)
125 125
 $pastmonthyear = null;
126 126
 
127 127
 if (empty($date_startmonth)) {
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank_url as bu4 ON bu4.fk_bank = b.rowid AND bu4.type='payment_supplier'";
170 170
 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as soc on bu1.url_id=soc.rowid";
171 171
 if (getDolGlobalString('MAIN_COMPANY_PERENTITY_SHARED')) {
172
-	$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe_perentity as spe ON spe.fk_soc = soc.rowid AND spe.entity = " . ((int) $conf->entity);
172
+	$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_perentity as spe ON spe.fk_soc = soc.rowid AND spe.entity = ".((int) $conf->entity);
173 173
 }
174 174
 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as u on bu2.url_id=u.rowid";
175 175
 $sql .= " WHERE ba.fk_accountancy_journal=".((int) $id_journal);
@@ -698,7 +698,7 @@  discard block
 block discarded – undo
698 698
 				if ($mt) {
699 699
 					if (empty($conf->cache['accountingaccountincurrententity'][$k])) {
700 700
 						$accountingaccount = new AccountingAccount($db);
701
-						$accountingaccount->fetch(0, $k, true);	// $k is accounting account of the bank.
701
+						$accountingaccount->fetch(0, $k, true); // $k is accounting account of the bank.
702 702
 						$conf->cache['accountingaccountincurrententity'][$k] = $accountingaccount;
703 703
 					} else {
704 704
 						$accountingaccount = $conf->cache['accountingaccountincurrententity'][$k];
@@ -819,43 +819,43 @@  discard block
 block discarded – undo
819 819
 						} elseif (in_array($tabtype[$key], array('sc', 'payment_sc'))) {   // If payment is payment of social contribution
820 820
 							$bookkeeping->subledger_account = '';
821 821
 							$bookkeeping->subledger_label = '';
822
-							$accountingaccount->fetch(0, $k, true);	// TODO Use a cache
822
+							$accountingaccount->fetch(0, $k, true); // TODO Use a cache
823 823
 							$bookkeeping->numero_compte = $k;
824 824
 							$bookkeeping->label_compte = $accountingaccount->label;
825 825
 						} elseif ($tabtype[$key] == 'payment_vat') {
826 826
 							$bookkeeping->subledger_account = '';
827 827
 							$bookkeeping->subledger_label = '';
828
-							$accountingaccount->fetch(0, $k, true);		// TODO Use a cache
828
+							$accountingaccount->fetch(0, $k, true); // TODO Use a cache
829 829
 							$bookkeeping->numero_compte = $k;
830 830
 							$bookkeeping->label_compte = $accountingaccount->label;
831 831
 						} elseif ($tabtype[$key] == 'payment_donation') {
832 832
 							$bookkeeping->subledger_account = '';
833 833
 							$bookkeeping->subledger_label = '';
834
-							$accountingaccount->fetch(0, $k, true);		// TODO Use a cache
834
+							$accountingaccount->fetch(0, $k, true); // TODO Use a cache
835 835
 							$bookkeeping->numero_compte = $k;
836 836
 							$bookkeeping->label_compte = $accountingaccount->label;
837 837
 						} elseif ($tabtype[$key] == 'member') {
838 838
 							$bookkeeping->subledger_account = '';
839 839
 							$bookkeeping->subledger_label = '';
840
-							$accountingaccount->fetch(0, $k, true);		// TODO Use a cache
840
+							$accountingaccount->fetch(0, $k, true); // TODO Use a cache
841 841
 							$bookkeeping->numero_compte = $k;
842 842
 							$bookkeeping->label_compte = $accountingaccount->label;
843 843
 						} elseif ($tabtype[$key] == 'payment_loan') {
844 844
 							$bookkeeping->subledger_account = '';
845 845
 							$bookkeeping->subledger_label = '';
846
-							$accountingaccount->fetch(0, $k, true);		// TODO Use a cache
846
+							$accountingaccount->fetch(0, $k, true); // TODO Use a cache
847 847
 							$bookkeeping->numero_compte = $k;
848 848
 							$bookkeeping->label_compte = $accountingaccount->label;
849 849
 						} elseif ($tabtype[$key] == 'payment_various') {
850 850
 							$bookkeeping->subledger_account = $k;
851 851
 							$bookkeeping->subledger_label = $tabcompany[$key]['name'];
852
-							$accountingaccount->fetch(0, $tabpay[$key]["account_various"], true);	// TODO Use a cache
852
+							$accountingaccount->fetch(0, $tabpay[$key]["account_various"], true); // TODO Use a cache
853 853
 							$bookkeeping->numero_compte = $tabpay[$key]["account_various"];
854 854
 							$bookkeeping->label_compte = $accountingaccount->label;
855 855
 						} elseif ($tabtype[$key] == 'banktransfert') {
856 856
 							$bookkeeping->subledger_account = '';
857 857
 							$bookkeeping->subledger_label = '';
858
-							$accountingaccount->fetch(0, $k, true);		// TODO Use a cache
858
+							$accountingaccount->fetch(0, $k, true); // TODO Use a cache
859 859
 							$bookkeeping->numero_compte = $k;
860 860
 							$bookkeeping->label_compte = $accountingaccount->label;
861 861
 						} else {
@@ -886,7 +886,7 @@  discard block
 block discarded – undo
886 886
 							}
887 887
 						} else {
888 888
 							if ($lettering && getDolGlobalInt('ACCOUNTING_ENABLE_LETTERING') && getDolGlobalInt('ACCOUNTING_ENABLE_AUTOLETTERING')) {
889
-								require_once DOL_DOCUMENT_ROOT . '/accountancy/class/lettering.class.php';
889
+								require_once DOL_DOCUMENT_ROOT.'/accountancy/class/lettering.class.php';
890 890
 								$lettering_static = new Lettering($db);
891 891
 								$nb_lettering = $lettering_static->bookkeepingLetteringAll(array($bookkeeping->id));
892 892
 							}
@@ -1147,7 +1147,7 @@  discard block
 block discarded – undo
1147 1147
 		1 => $langs->trans("TransfertAllBankLines"),
1148 1148
 		2 => $langs->trans("TransfertOnlyConciliatedBankLine")
1149 1149
 	);
1150
-	$moreoptions = [ "BankLineConciliated" => $form->selectarray('only_rappro', $listofchoices, $only_rappro)];
1150
+	$moreoptions = ["BankLineConciliated" => $form->selectarray('only_rappro', $listofchoices, $only_rappro)];
1151 1151
 
1152 1152
 	journalHead($nom, '', $period, $periodlink, $description, $builddate, $exportlink, array('action' => ''), '', $varlink, $moreoptions);
1153 1153
 
@@ -1307,7 +1307,7 @@  discard block
 block discarded – undo
1307 1307
 
1308 1308
 				// Label operation
1309 1309
 				print '<td class="maxwidth300 nopaddingtopimp nopaddingbottomimp">';
1310
-				print $reflabel;	// This is already html escaped content
1310
+				print $reflabel; // This is already html escaped content
1311 1311
 				print "</td>";
1312 1312
 
1313 1313
 				print '<td class="center">'.$val["type_payment"]."</td>";
@@ -1401,7 +1401,7 @@  discard block
 block discarded – undo
1401 1401
 						}
1402 1402
 					}
1403 1403
 					print '<td class="maxwidth300" title="'.dol_escape_htmltag(dol_string_nohtmltag($accounttoshow)).'">';
1404
-					print $accounttoshow;	// This is a HTML string
1404
+					print $accounttoshow; // This is a HTML string
1405 1405
 					print "</td>";
1406 1406
 
1407 1407
 					// Subledger account
@@ -1429,12 +1429,12 @@  discard block
 block discarded – undo
1429 1429
 						}
1430 1430
 					}
1431 1431
 					print '<td class="maxwidth300 nopaddingtopimp nopaddingbottomimp">';
1432
-					print $accounttoshowsubledger;	// This is a html string
1432
+					print $accounttoshowsubledger; // This is a html string
1433 1433
 					print "</td>";
1434 1434
 
1435 1435
 					// Label operation
1436 1436
 					print '<td class="nopaddingtopimpo paddingbottomimp">';
1437
-					print $reflabel;		// This is a html string
1437
+					print $reflabel; // This is a html string
1438 1438
 					print "</td>";
1439 1439
 
1440 1440
 					print '<td class="center">'.$val["type_payment"]."</td>";
Please login to merge, or discard this patch.
test/phpunit/SocieteTest.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
  *      \remarks    To run this script as CLI:  phpunit filename.php
28 28
  */
29 29
 
30
-global $conf,$user,$langs,$db;
30
+global $conf, $user, $langs, $db;
31 31
 //define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver
32 32
 //require_once 'PHPUnit/Autoload.php';
33 33
 require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
@@ -60,10 +60,10 @@  discard block
 block discarded – undo
60 60
 	 */
61 61
 	public static function setUpBeforeClass(): void
62 62
 	{
63
-		global $conf,$user,$langs,$db;
63
+		global $conf, $user, $langs, $db;
64 64
 
65 65
 		if ($conf->global->SOCIETE_CODECLIENT_ADDON != 'mod_codeclient_monkey') {
66
-			print "\n".__METHOD__." third party ref checker must be setup to 'mod_codeclient_monkey' not to '" . getDolGlobalString('SOCIETE_CODECLIENT_ADDON')."'.\n";
66
+			print "\n".__METHOD__." third party ref checker must be setup to 'mod_codeclient_monkey' not to '".getDolGlobalString('SOCIETE_CODECLIENT_ADDON')."'.\n";
67 67
 			die(1);
68 68
 		}
69 69
 
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 			die(1);
78 78
 		}
79 79
 
80
-		$db->begin();    // This is to have all actions inside a transaction even if test launched without suite.
80
+		$db->begin(); // This is to have all actions inside a transaction even if test launched without suite.
81 81
 
82 82
 		print __METHOD__."\n";
83 83
 	}
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 	 */
90 90
 	public function testSocieteCreate()
91 91
 	{
92
-		global $conf,$user,$langs,$db;
92
+		global $conf, $user, $langs, $db;
93 93
 		$conf = $this->savconf;
94 94
 		$user = $this->savuser;
95 95
 		$langs = $this->savlangs;
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 	 */
121 121
 	public function testSocieteFetch($id)
122 122
 	{
123
-		global $conf,$user,$langs,$db;
123
+		global $conf, $user, $langs, $db;
124 124
 		$conf = $this->savconf;
125 125
 		$user = $this->savuser;
126 126
 		$langs = $this->savlangs;
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 	 */
150 150
 	public function testSocieteUpdate($localobject)
151 151
 	{
152
-		global $conf,$user,$langs,$db;
152
+		global $conf, $user, $langs, $db;
153 153
 		$conf = $this->savconf;
154 154
 		$user = $this->savuser;
155 155
 		$langs = $this->savlangs;
@@ -225,10 +225,10 @@  discard block
 block discarded – undo
225 225
 		$localobject->country_code = 'FR';
226 226
 		$localobject->idprof1 = 493861496;
227 227
 		$localobject->idprof2 = 49386149600021;
228
-		$result = $localobject->id_prof_check(1, $localobject);    // Must be > 0
228
+		$result = $localobject->id_prof_check(1, $localobject); // Must be > 0
229 229
 		print __METHOD__." OK FR idprof1 result=".$result."\n";
230 230
 		$this->assertGreaterThanOrEqual(1, $result);
231
-		$result = $localobject->id_prof_check(2, $localobject);    // Must be > 0
231
+		$result = $localobject->id_prof_check(2, $localobject); // Must be > 0
232 232
 		print __METHOD__." OK FR idprof2 result=".$result."\n";
233 233
 		$this->assertGreaterThanOrEqual(1, $result);
234 234
 
@@ -236,17 +236,17 @@  discard block
 block discarded – undo
236 236
 		$localobject->country_code = 'FR';
237 237
 		$localobject->idprof1 = 'id1ko';
238 238
 		$localobject->idprof2 = 'id2ko';
239
-		$result = $localobject->id_prof_check(1, $localobject);    // Must be <= 0
239
+		$result = $localobject->id_prof_check(1, $localobject); // Must be <= 0
240 240
 		print __METHOD__." KO FR idprof1 result=".$result."\n";
241 241
 		$this->assertLessThan(1, $result);
242
-		$result = $localobject->id_prof_check(2, $localobject);    // Must be <= 0
242
+		$result = $localobject->id_prof_check(2, $localobject); // Must be <= 0
243 243
 		print __METHOD__." KO FR idprof2 result=".$result."\n";
244 244
 		$this->assertLessThan(1, $result);
245 245
 
246 246
 		// KO ES
247 247
 		$localobject->country_code = 'ES';
248 248
 		$localobject->idprof1 = 'id1ko';
249
-		$result = $localobject->id_prof_check(1, $localobject);    // Must be <= 0
249
+		$result = $localobject->id_prof_check(1, $localobject); // Must be <= 0
250 250
 		print __METHOD__." KO ES idprof1 result=".$result."\n";
251 251
 		$this->assertLessThan(1, $result);
252 252
 
@@ -254,10 +254,10 @@  discard block
 block discarded – undo
254 254
 		$localobject->country_code = 'AR';
255 255
 		$localobject->idprof1 = 'id1ko';
256 256
 		$localobject->idprof2 = 'id2ko';
257
-		$result = $localobject->id_prof_check(1, $localobject);    // Must be > 0
257
+		$result = $localobject->id_prof_check(1, $localobject); // Must be > 0
258 258
 		print __METHOD__." OK AR idprof1 result=".$result."\n";
259 259
 		$this->assertGreaterThanOrEqual(0, $result);
260
-		$result = $localobject->id_prof_check(2, $localobject);    // Must be > 0
260
+		$result = $localobject->id_prof_check(2, $localobject); // Must be > 0
261 261
 		print __METHOD__." OK AR idprof2 result=".$result."\n";
262 262
 		$this->assertGreaterThanOrEqual(1, $result);
263 263
 
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
 	 */
277 277
 	public function testSocieteOther($localobject)
278 278
 	{
279
-		global $conf,$user,$langs,$db;
279
+		global $conf, $user, $langs, $db;
280 280
 		$conf = $this->savconf;
281 281
 		$user = $this->savuser;
282 282
 		$langs = $this->savlangs;
@@ -336,7 +336,7 @@  discard block
 block discarded – undo
336 336
 	 */
337 337
 	public function testGetOutstandingBills($id)
338 338
 	{
339
-		global $conf,$user,$langs,$db;
339
+		global $conf, $user, $langs, $db;
340 340
 		$conf = $this->savconf;
341 341
 		$user = $this->savuser;
342 342
 		$langs = $this->savlangs;
@@ -365,7 +365,7 @@  discard block
 block discarded – undo
365 365
 	 */
366 366
 	public function testSocieteDelete($id)
367 367
 	{
368
-		global $conf,$user,$langs,$db;
368
+		global $conf, $user, $langs, $db;
369 369
 		$conf = $this->savconf;
370 370
 		$user = $this->savuser;
371 371
 		$langs = $this->savlangs;
@@ -389,7 +389,7 @@  discard block
 block discarded – undo
389 389
 	 */
390 390
 	public function testSocieteGetFullAddress()
391 391
 	{
392
-		global $conf,$user,$langs,$db;
392
+		global $conf, $user, $langs, $db;
393 393
 		$conf = $this->savconf;
394 394
 		$user = $this->savuser;
395 395
 		$langs = $this->savlangs;
Please login to merge, or discard this patch.
htdocs/eventorganization/class/conferenceorbooth.class.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -340,7 +340,7 @@  discard block
 block discarded – undo
340 340
 					} elseif (array_key_exists($key, $this->fields) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) {
341 341
 						$sqlwhere[] = $this->db->sanitize($key)." = '".$this->db->idate($value)."'";
342 342
 					} elseif ($key == 'customsql') {
343
-						$sqlwhere[] = $value;	// deprecated
343
+						$sqlwhere[] = $value; // deprecated
344 344
 					} elseif (strpos($value, '%') === false) {
345 345
 						$sqlwhere[] = $this->db->sanitize($key).' IN ('.$this->db->sanitize($this->db->escape($value)).')';
346 346
 					} else {
@@ -750,7 +750,7 @@  discard block
 block discarded – undo
750 750
 		}
751 751
 		if (property_exists($this, 'amount')) {
752 752
 			$return .= '<br>';
753
-			$return .= '<span class="info-box-label amount">'.price($this->amount, 0, $langs, 1, -1, -1, $conf->currency).'</span>';  // @phan-suppress-current-line PhanUndeclaredProperty
753
+			$return .= '<span class="info-box-label amount">'.price($this->amount, 0, $langs, 1, -1, -1, $conf->currency).'</span>'; // @phan-suppress-current-line PhanUndeclaredProperty
754 754
 		}
755 755
 		if (method_exists($this, 'getLibStatut')) {
756 756
 			$return .= '<br><div class="info-box-status">'.$this->getLibStatut(3).'</div>';
Please login to merge, or discard this patch.
htdocs/core/lib/functions2.lib.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
 		} else {
197 197
 			print ': ';
198 198
 		}
199
-		if (! empty($object->user_creation) && is_object($object->user_creation)) {	// deprecated mode
199
+		if (!empty($object->user_creation) && is_object($object->user_creation)) {	// deprecated mode
200 200
 			if ($object->user_creation->id) {
201 201
 				print $object->user_creation->getNomUrl(-1, '', 0, 0, 0);
202 202
 			} else {
@@ -610,9 +610,9 @@  discard block
 block discarded – undo
610 610
 		} else {
611 611
 			print ': ';
612 612
 		}
613
-		print dol_print_date($object->date_rappro, 'dayhour', 'tzserver');  // @phan-suppress-current-line PhanUndeclaredProperty
613
+		print dol_print_date($object->date_rappro, 'dayhour', 'tzserver'); // @phan-suppress-current-line PhanUndeclaredProperty
614 614
 		if ($deltadateforuser) {
615
-			print ' <span class="opacitymedium">'.$langs->trans("CurrentHour").'</span> &nbsp; / &nbsp; '.dol_print_date($object->date_rappro, "dayhour", 'tzuserrel').' &nbsp;<span class="opacitymedium">'.$langs->trans("ClientHour").'</span>';  // @phan-suppress-current-line PhanUndeclaredProperty
615
+			print ' <span class="opacitymedium">'.$langs->trans("CurrentHour").'</span> &nbsp; / &nbsp; '.dol_print_date($object->date_rappro, "dayhour", 'tzuserrel').' &nbsp;<span class="opacitymedium">'.$langs->trans("ClientHour").'</span>'; // @phan-suppress-current-line PhanUndeclaredProperty
616 616
 		}
617 617
 		if ($usetable) {
618 618
 			print '</td></tr>';
@@ -1232,14 +1232,14 @@  discard block
 block discarded – undo
1232 1232
 	$counter = 0;
1233 1233
 	$sql = "SELECT MAX(".$sqlstring.") as val";
1234 1234
 	$sql .= " FROM ".MAIN_DB_PREFIX.$db->sanitize($table);
1235
-	$sql .= " WHERE ".$db->sanitize($field)." LIKE '".$db->escape($maskLike) . (getDolGlobalString('SEARCH_FOR_NEXT_VAL_ON_START_ONLY') ? "%" : "") . "'";
1235
+	$sql .= " WHERE ".$db->sanitize($field)." LIKE '".$db->escape($maskLike).(getDolGlobalString('SEARCH_FOR_NEXT_VAL_ON_START_ONLY') ? "%" : "")."'";
1236 1236
 	$sql .= " AND ".$db->sanitize($field)." NOT LIKE '(PROV%)'";
1237 1237
 
1238 1238
 	// To ensure that all variables within the MAX() brackets are integers
1239 1239
 	// This avoid bad detection of max when data are noised with non numeric values at the position of the numero
1240 1240
 	if (getDolGlobalInt('MAIN_NUMBERING_FILTER_ON_INT_ONLY')) {
1241 1241
 		// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
1242
-		$sql .= " AND ". $db->regexpsql($sqlstring, '^[0-9]+$', 1);
1242
+		$sql .= " AND ".$db->regexpsql($sqlstring, '^[0-9]+$', 1);
1243 1243
 	}
1244 1244
 
1245 1245
 	if ($bentityon) { // only if entity enable
@@ -1301,7 +1301,7 @@  discard block
 block discarded – undo
1301 1301
 		$ref = '';
1302 1302
 		$sql = "SELECT ".$db->sanitize($field)." as ref";
1303 1303
 		$sql .= " FROM ".MAIN_DB_PREFIX.$db->sanitize($table);
1304
-		$sql .= " WHERE ".$db->sanitize($field)." LIKE '".$db->escape($maskLike) . (getDolGlobalString('SEARCH_FOR_NEXT_VAL_ON_START_ONLY') ? "%" : "") . "'";
1304
+		$sql .= " WHERE ".$db->sanitize($field)." LIKE '".$db->escape($maskLike).(getDolGlobalString('SEARCH_FOR_NEXT_VAL_ON_START_ONLY') ? "%" : "")."'";
1305 1305
 		$sql .= " AND ".$db->sanitize($field)." NOT LIKE '%PROV%'";
1306 1306
 		if ($bentityon) { // only if entity enable
1307 1307
 			$sql .= " AND entity IN (".getEntity($sharetable).")";
@@ -1364,7 +1364,7 @@  discard block
 block discarded – undo
1364 1364
 			// Get counter in database
1365 1365
 			$maskrefclient_sql = "SELECT MAX(".$maskrefclient_sqlstring.") as val";
1366 1366
 			$maskrefclient_sql .= " FROM ".MAIN_DB_PREFIX.$table;
1367
-			$maskrefclient_sql .= " WHERE ".$db->sanitize($field)." LIKE '".$db->escape($maskrefclient_maskLike) . (getDolGlobalString('SEARCH_FOR_NEXT_VAL_ON_START_ONLY') ? "%" : "") . "'";
1367
+			$maskrefclient_sql .= " WHERE ".$db->sanitize($field)." LIKE '".$db->escape($maskrefclient_maskLike).(getDolGlobalString('SEARCH_FOR_NEXT_VAL_ON_START_ONLY') ? "%" : "")."'";
1368 1368
 			if ($bentityon) { // only if entity enable
1369 1369
 				$maskrefclient_sql .= " AND entity IN (".getEntity($sharetable).")";
1370 1370
 			} elseif (!empty($forceentity)) {
@@ -2988,7 +2988,7 @@  discard block
 block discarded – undo
2988 2988
 	$string = trim($string);
2989 2989
 
2990 2990
 	// If string does not start and end with parenthesis, we return $string as is.
2991
-	if (! preg_match('/^\(.*\)$/', $string)) {
2991
+	if (!preg_match('/^\(.*\)$/', $string)) {
2992 2992
 		return $string;
2993 2993
 	}
2994 2994
 
@@ -3026,15 +3026,15 @@  discard block
 block discarded – undo
3026 3026
 function getArrayOfEmojiBis()
3027 3027
 {
3028 3028
 	$arrayofcommonemoji = array(
3029
-		'misc' => array('2600', '26FF'),		// Miscellaneous Symbols
3030
-		'ding' => array('2700', '27BF'),		// Dingbats
3031
-		'????' => array('9989', '9989'),		// Variation Selectors
3032
-		'vars' => array('FE00', 'FE0F'),		// Variation Selectors
3033
-		'pict' => array('1F300', '1F5FF'),		// Miscellaneous Symbols and Pictographs
3034
-		'emot' => array('1F600', '1F64F'),		// Emoticons
3035
-		'tran' => array('1F680', '1F6FF'),		// Transport and Map Symbols
3036
-		'flag' => array('1F1E0', '1F1FF'),		// Flags (note: may be 1F1E6 instead of 1F1E0)
3037
-		'supp' => array('1F900', '1F9FF'),		// Supplemental Symbols and Pictographs
3029
+		'misc' => array('2600', '26FF'), // Miscellaneous Symbols
3030
+		'ding' => array('2700', '27BF'), // Dingbats
3031
+		'????' => array('9989', '9989'), // Variation Selectors
3032
+		'vars' => array('FE00', 'FE0F'), // Variation Selectors
3033
+		'pict' => array('1F300', '1F5FF'), // Miscellaneous Symbols and Pictographs
3034
+		'emot' => array('1F600', '1F64F'), // Emoticons
3035
+		'tran' => array('1F680', '1F6FF'), // Transport and Map Symbols
3036
+		'flag' => array('1F1E0', '1F1FF'), // Flags (note: may be 1F1E6 instead of 1F1E0)
3037
+		'supp' => array('1F900', '1F9FF'), // Supplemental Symbols and Pictographs
3038 3038
 	);
3039 3039
 
3040 3040
 	return $arrayofcommonemoji;
Please login to merge, or discard this patch.
htdocs/core/class/html.form.class.php 1 patch
Spacing   +1258 added lines, -1258 removed lines patch added patch discarded remove patch
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
 		if (getDolGlobalString('MAIN_USE_JQUERY_JEDITABLE') && !preg_match('/^select;/', $typeofdata)) {
124 124
 			if (!empty($perm)) {
125 125
 				$tmp = explode(':', $typeofdata);
126
-				$ret .= '<div class="editkey_' . $tmp[0] . (!empty($tmp[1]) ? ' ' . $tmp[1] : '') . '" id="' . $htmlname . '">';
126
+				$ret .= '<div class="editkey_'.$tmp[0].(!empty($tmp[1]) ? ' '.$tmp[1] : '').'" id="'.$htmlname.'">';
127 127
 				if ($fieldrequired) {
128 128
 					$ret .= '<span class="fieldrequired">';
129 129
 				}
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
 				if ($fieldrequired) {
136 136
 					$ret .= '</span>';
137 137
 				}
138
-				$ret .= '</div>' . "\n";
138
+				$ret .= '</div>'."\n";
139 139
 			} else {
140 140
 				if ($fieldrequired) {
141 141
 					$ret .= '<span class="fieldrequired">';
@@ -173,8 +173,8 @@  discard block
 block discarded – undo
173 173
 			if (empty($notabletag) && $perm) {
174 174
 				$ret .= '<td class="right">';
175 175
 			}
176
-			if ($htmlname && GETPOST('action', 'aZ09') != 'edit' . $htmlname && $perm) {
177
-				$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>';
176
+			if ($htmlname && GETPOST('action', 'aZ09') != 'edit'.$htmlname && $perm) {
177
+				$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>';
178 178
 			}
179 179
 			if (!empty($notabletag) && $notabletag == 1) {
180 180
 				if ($text) {
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
 			} elseif ($reg[1] == 'int') {
242 242
 				$typeofdata = 'numeric';
243 243
 			} else {
244
-				return 'ErrorBadParameter ' . $typeofdata;
244
+				return 'ErrorBadParameter '.$typeofdata;
245 245
 			}
246 246
 		}
247 247
 
@@ -252,13 +252,13 @@  discard block
 block discarded – undo
252 252
 			if ($editaction == '') {
253 253
 				$editaction = GETPOST('action', 'aZ09');
254 254
 			}
255
-			$editmode = ($editaction == 'edit' . $htmlname);
255
+			$editmode = ($editaction == 'edit'.$htmlname);
256 256
 			if ($editmode) {	// edit mode
257 257
 				$ret .= "<!-- formeditfieldval -->\n";
258
-				$ret .= '<form method="post" action="' . $_SERVER["PHP_SELF"] . ($moreparam ? '?' . $moreparam : '') . '">';
259
-				$ret .= '<input type="hidden" name="action" value="set' . $htmlname . '">';
260
-				$ret .= '<input type="hidden" name="token" value="' . newToken() . '">';
261
-				$ret .= '<input type="hidden" name="' . $paramid . '" value="' . $object->id . '">';
258
+				$ret .= '<form method="post" action="'.$_SERVER["PHP_SELF"].($moreparam ? '?'.$moreparam : '').'">';
259
+				$ret .= '<input type="hidden" name="action" value="set'.$htmlname.'">';
260
+				$ret .= '<input type="hidden" name="token" value="'.newToken().'">';
261
+				$ret .= '<input type="hidden" name="'.$paramid.'" value="'.$object->id.'">';
262 262
 				if (empty($notabletag)) {
263 263
 					$ret .= '<table class="nobordernopadding centpercent">';
264 264
 				}
@@ -267,28 +267,28 @@  discard block
 block discarded – undo
267 267
 				}
268 268
 				if (preg_match('/^(string|safehtmlstring|email|phone|url)/', $typeofdata)) {
269 269
 					$tmp = explode(':', $typeofdata);
270
-					$ret .= '<input type="text" id="' . $htmlname . '" name="' . $htmlname . '" value="' . ($editvalue ? $editvalue : $value) . '"' . (empty($tmp[1]) ? '' : ' size="' . $tmp[1] . '"') . ' autofocus>';
270
+					$ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($editvalue ? $editvalue : $value).'"'.(empty($tmp[1]) ? '' : ' size="'.$tmp[1].'"').' autofocus>';
271 271
 				} elseif (preg_match('/^(integer)/', $typeofdata)) {
272 272
 					$tmp = explode(':', $typeofdata);
273 273
 					$valuetoshow = price2num($editvalue ? $editvalue : $value, 0);
274
-					$ret .= '<input type="text" id="' . $htmlname . '" name="' . $htmlname . '" value="' . $valuetoshow . '"' . (empty($tmp[1]) ? '' : ' size="' . $tmp[1] . '"') . ' autofocus>';
274
+					$ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.$valuetoshow.'"'.(empty($tmp[1]) ? '' : ' size="'.$tmp[1].'"').' autofocus>';
275 275
 				} elseif (preg_match('/^(numeric|amount)/', $typeofdata)) {
276 276
 					$tmp = explode(':', $typeofdata);
277 277
 					$valuetoshow = price2num($editvalue ? $editvalue : $value);
278
-					$ret .= '<input type="text" id="' . $htmlname . '" name="' . $htmlname . '" value="' . ($valuetoshow != '' ? price($valuetoshow) : '') . '"' . (empty($tmp[1]) ? '' : ' size="' . $tmp[1] . '"') . ' autofocus>';
278
+					$ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($valuetoshow != '' ? price($valuetoshow) : '').'"'.(empty($tmp[1]) ? '' : ' size="'.$tmp[1].'"').' autofocus>';
279 279
 				} elseif (preg_match('/^(checkbox)/', $typeofdata)) {
280 280
 					$tmp = explode(':', $typeofdata);
281
-					$ret .= '<input type="checkbox" id="' . $htmlname . '" name="' . $htmlname . '" value="' . ($value ? $value : 'on') . '"' . ($value ? ' checked' : '') . (empty($tmp[1]) ? '' : $tmp[1]) . '/>';
281
+					$ret .= '<input type="checkbox" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($value ? $value : 'on').'"'.($value ? ' checked' : '').(empty($tmp[1]) ? '' : $tmp[1]).'/>';
282 282
 				} elseif (preg_match('/^text/', $typeofdata) || preg_match('/^note/', $typeofdata)) {    // if wysiwyg is enabled $typeofdata = 'ckeditor'
283 283
 					$tmp = explode(':', $typeofdata);
284 284
 					$cols = (empty($tmp[2]) ? '' : $tmp[2]);
285 285
 					$morealt = '';
286 286
 					if (preg_match('/%/', $cols)) {
287
-						$morealt = ' style="width: ' . $cols . '"';
287
+						$morealt = ' style="width: '.$cols.'"';
288 288
 						$cols = '';
289 289
 					}
290 290
 					$valuetoshow = ($editvalue ? $editvalue : $value);
291
-					$ret .= '<textarea id="' . $htmlname . '" name="' . $htmlname . '" wrap="soft" rows="' . (empty($tmp[1]) ? '20' : $tmp[1]) . '"' . ($cols ? ' cols="' . $cols . '"' : 'class="quatrevingtpercent"') . $morealt . '" autofocus>';
291
+					$ret .= '<textarea id="'.$htmlname.'" name="'.$htmlname.'" wrap="soft" rows="'.(empty($tmp[1]) ? '20' : $tmp[1]).'"'.($cols ? ' cols="'.$cols.'"' : 'class="quatrevingtpercent"').$morealt.'" autofocus>';
292 292
 					// textarea convert automatically entities chars into simple chars.
293 293
 					// So we convert & into &amp; so a string like 'a &lt; <b>b</b><br>é<br>&lt;script&gt;alert('X');&lt;script&gt;' stay a correct html and is not converted by textarea component when wysiwyg is off.
294 294
 					$valuetoshow = str_replace('&', '&amp;', $valuetoshow);
@@ -298,12 +298,12 @@  discard block
 block discarded – undo
298 298
 					$addnowlink = empty($moreoptions['addnowlink']) ? 0 : $moreoptions['addnowlink'];
299 299
 					$adddateof = empty($moreoptions['adddateof']) ? '' : $moreoptions['adddateof'];
300 300
 					$labeladddateof = empty($moreoptions['labeladddateof']) ? '' : $moreoptions['labeladddateof'];
301
-					$ret .= $this->selectDate($value, $htmlname, 0, 0, 1, 'form' . $htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm);
301
+					$ret .= $this->selectDate($value, $htmlname, 0, 0, 1, 'form'.$htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm);
302 302
 				} elseif ($typeofdata == 'dayhour' || $typeofdata == 'datehourpicker') {
303 303
 					$addnowlink = empty($moreoptions['addnowlink']) ? 0 : $moreoptions['addnowlink'];
304 304
 					$adddateof = empty($moreoptions['adddateof']) ? '' : $moreoptions['adddateof'];
305 305
 					$labeladddateof = empty($moreoptions['labeladddateof']) ? '' : $moreoptions['labeladddateof'];
306
-					$ret .= $this->selectDate($value, $htmlname, 1, 1, 1, 'form' . $htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm);
306
+					$ret .= $this->selectDate($value, $htmlname, 1, 1, 1, 'form'.$htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm);
307 307
 				} elseif (preg_match('/^select;/', $typeofdata)) {
308 308
 					$arraydata = explode(',', preg_replace('/^select;/', '', $typeofdata));
309 309
 					$arraylist = array();
@@ -317,7 +317,7 @@  discard block
 block discarded – undo
317 317
 					// TODO Not yet implemented. See code for extrafields
318 318
 				} elseif (preg_match('/^ckeditor/', $typeofdata)) {
319 319
 					$tmp = explode(':', $typeofdata); // Example: ckeditor:dolibarr_zzz:width:height:savemethod:toolbarstartexpanded:rows:cols:uselocalbrowser
320
-					require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';
320
+					require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
321 321
 					$doleditor = new DolEditor($htmlname, ($editvalue ? $editvalue : $value), (empty($tmp[2]) ? '' : $tmp[2]), (empty($tmp[3]) ? 100 : (int) $tmp[3]), (empty($tmp[1]) ? 'dolibarr_notes' : $tmp[1]), 'In', (empty($tmp[5]) ? false : (bool) $tmp[5]), (isset($tmp[8]) ? ($tmp[8] ? true : false) : true), true, (empty($tmp[6]) ? 20 : (int) $tmp[6]), (empty($tmp[7]) ? '100' : $tmp[7]));
322 322
 					$ret .= $doleditor->Create(1);
323 323
 				} elseif ($typeofdata == 'asis') {
@@ -332,19 +332,19 @@  discard block
 block discarded – undo
332 332
 					$ret .= '<td>';
333 333
 				}
334 334
 				//else $ret.='<div class="clearboth"></div>';
335
-				$ret .= '<input type="submit" class="smallpaddingimp nomargingtop nomarginbottom button' . (empty($notabletag) ? '' : ' ') . '" name="modify" value="' . $langs->trans("Modify") . '">';
335
+				$ret .= '<input type="submit" class="smallpaddingimp nomargingtop nomarginbottom button'.(empty($notabletag) ? '' : ' ').'" name="modify" value="'.$langs->trans("Modify").'">';
336 336
 				if (preg_match('/ckeditor|textarea/', $typeofdata) && empty($notabletag)) {
337
-					$ret .= '<br>' . "\n";
337
+					$ret .= '<br>'."\n";
338 338
 				}
339
-				$ret .= '<input type="submit" class="smallpaddingimp nomargingtop nomarginbottom button button-cancel' . (empty($notabletag) ? '' : ' ') . '" name="cancel" value="' . $langs->trans("Cancel") . '">';
339
+				$ret .= '<input type="submit" class="smallpaddingimp nomargingtop nomarginbottom button button-cancel'.(empty($notabletag) ? '' : ' ').'" name="cancel" value="'.$langs->trans("Cancel").'">';
340 340
 				if (empty($notabletag)) {
341 341
 					$ret .= '</td>';
342 342
 				}
343 343
 
344 344
 				if (empty($notabletag)) {
345
-					$ret .= '</tr></table>' . "\n";
345
+					$ret .= '</tr></table>'."\n";
346 346
 				}
347
-				$ret .= '</form>' . "\n";
347
+				$ret .= '</form>'."\n";
348 348
 			} else {		// view mode
349 349
 				if (preg_match('/^email/', $typeofdata)) {
350 350
 					$ret .= dol_print_email($value, 0, 0, 0, 0, 1);
@@ -356,15 +356,15 @@  discard block
 block discarded – undo
356 356
 					$ret .= ($value != '' ? price($value, 0, $langs, 0, -1, -1, $conf->currency) : '');
357 357
 				} elseif (preg_match('/^checkbox/', $typeofdata)) {
358 358
 					$tmp = explode(':', $typeofdata);
359
-					$ret .= '<input type="checkbox" disabled id="' . $htmlname . '" name="' . $htmlname . '" value="' . $value . '"' . ($value ? ' checked' : '') . ($tmp[1] ? $tmp[1] : '') . '/>';
359
+					$ret .= '<input type="checkbox" disabled id="'.$htmlname.'" name="'.$htmlname.'" value="'.$value.'"'.($value ? ' checked' : '').($tmp[1] ? $tmp[1] : '').'/>';
360 360
 				} elseif (preg_match('/^text/', $typeofdata) || preg_match('/^note/', $typeofdata)) {
361 361
 					$ret .= dol_htmlwithnojs(dol_string_onlythesehtmltags(dol_htmlentitiesbr($value), 1, 1, 1));
362 362
 				} elseif (preg_match('/^(safehtmlstring|restricthtml)/', $typeofdata)) {	// 'restricthtml' is not an allowed type for editfieldval. Value is 'safehtmlstring'
363 363
 					$ret .= dol_htmlwithnojs(dol_string_onlythesehtmltags($value));
364 364
 				} elseif ($typeofdata == 'day' || $typeofdata == 'datepicker') {
365
-					$ret .= '<span class="valuedate">' . dol_print_date($value, 'day', $gm) . '</span>';
365
+					$ret .= '<span class="valuedate">'.dol_print_date($value, 'day', $gm).'</span>';
366 366
 				} elseif ($typeofdata == 'dayhour' || $typeofdata == 'datehourpicker') {
367
-					$ret .= '<span class="valuedate">' . dol_print_date($value, 'dayhour', $gm) . '</span>';
367
+					$ret .= '<span class="valuedate">'.dol_print_date($value, 'dayhour', $gm).'</span>';
368 368
 				} elseif (preg_match('/^select;/', $typeofdata)) {
369 369
 					$arraydata = explode(',', preg_replace('/^select;/', '', $typeofdata));
370 370
 					$arraylist = array();
@@ -375,9 +375,9 @@  discard block
 block discarded – undo
375 375
 					$ret .= $arraylist[$value];
376 376
 					if ($htmlname == 'fk_product_type') {
377 377
 						if ($value == 0) {
378
-							$ret = img_picto($langs->trans("Product"), 'product', 'class="paddingleftonly paddingrightonly colorgrey"') . $ret;
378
+							$ret = img_picto($langs->trans("Product"), 'product', 'class="paddingleftonly paddingrightonly colorgrey"').$ret;
379 379
 						} else {
380
-							$ret = img_picto($langs->trans("Service"), 'service', 'class="paddingleftonly paddingrightonly colorgrey"') . $ret;
380
+							$ret = img_picto($langs->trans("Service"), 'service', 'class="paddingleftonly paddingrightonly colorgrey"').$ret;
381 381
 						}
382 382
 					}
383 383
 				} elseif (preg_match('/^ckeditor/', $typeofdata)) {
@@ -385,7 +385,7 @@  discard block
 block discarded – undo
385 385
 					if (getDolGlobalString('MAIN_DISABLE_NOTES_TAB')) {
386 386
 						$firstline = preg_replace('/<br>.*/', '', $tmpcontent);
387 387
 						$firstline = preg_replace('/[\n\r].*/', '', $firstline);
388
-						$tmpcontent = $firstline . ((strlen($firstline) != strlen($tmpcontent)) ? '...' : '');
388
+						$tmpcontent = $firstline.((strlen($firstline) != strlen($tmpcontent)) ? '...' : '');
389 389
 					}
390 390
 					// We don't use dol_escape_htmltag to get the html formatting active, but this need we must also
391 391
 					// clean data from some dangerous html
@@ -394,7 +394,7 @@  discard block
 block discarded – undo
394 394
 					if (empty($moreoptions['valuealreadyhtmlescaped'])) {
395 395
 						$ret .= dol_escape_htmltag($value);
396 396
 					} else {
397
-						$ret .= $value;        // $value must be already html escaped.
397
+						$ret .= $value; // $value must be already html escaped.
398 398
 					}
399 399
 				}
400 400
 
@@ -432,7 +432,7 @@  discard block
 block discarded – undo
432 432
 
433 433
 		if (is_array($arrayoflangcode) && count($arrayoflangcode)) {
434 434
 			if (!is_object($extralanguages)) {
435
-				include_once DOL_DOCUMENT_ROOT . '/core/class/extralanguages.class.php';
435
+				include_once DOL_DOCUMENT_ROOT.'/core/class/extralanguages.class.php';
436 436
 				$extralanguages = new ExtraLanguages($this->db);
437 437
 			}
438 438
 			$extralanguages->fetch_name_extralanguages('societe');
@@ -441,17 +441,17 @@  discard block
 block discarded – undo
441 441
 				return ''; // No extralang field to show
442 442
 			}
443 443
 
444
-			$result .= '<!-- Widget for translation -->' . "\n";
445
-			$result .= '<div class="inline-block paddingleft image-' . $object->element . '-' . $fieldname . '">';
444
+			$result .= '<!-- Widget for translation -->'."\n";
445
+			$result .= '<div class="inline-block paddingleft image-'.$object->element.'-'.$fieldname.'">';
446 446
 			$s = img_picto($langs->trans("ShowOtherLanguages"), 'language', '', 0, 0, 0, '', 'fa-15 editfieldlang');
447 447
 			$result .= $s;
448 448
 			$result .= '</div>';
449 449
 
450
-			$result .= '<div class="inline-block hidden field-' . $object->element . '-' . $fieldname . '">';
450
+			$result .= '<div class="inline-block hidden field-'.$object->element.'-'.$fieldname.'">';
451 451
 
452 452
 			$resultforextrlang = '';
453 453
 			foreach ($arrayoflangcode as $langcode) {
454
-				$valuetoshow = GETPOSTISSET('field-' . $object->element . "-" . $fieldname . "-" . $langcode) ? GETPOST('field-' . $object->element . '-' . $fieldname . "-" . $langcode, $check) : '';
454
+				$valuetoshow = GETPOSTISSET('field-'.$object->element."-".$fieldname."-".$langcode) ? GETPOST('field-'.$object->element.'-'.$fieldname."-".$langcode, $check) : '';
455 455
 				if (empty($valuetoshow)) {
456 456
 					$object->fetchValuesForExtraLanguages();
457 457
 					//var_dump($object->array_languages);
@@ -463,17 +463,17 @@  discard block
 block discarded – undo
463 463
 
464 464
 				// TODO Use the showInputField() method of ExtraLanguages object
465 465
 				if ($typeofdata == 'textarea') {
466
-					$resultforextrlang .= '<textarea name="field-' . $object->element . "-" . $fieldname . "-" . $langcode . '" id="' . $fieldname . "-" . $langcode . '" class="' . $morecss . '" rows="' . ROWS_2 . '" wrap="soft">';
466
+					$resultforextrlang .= '<textarea name="field-'.$object->element."-".$fieldname."-".$langcode.'" id="'.$fieldname."-".$langcode.'" class="'.$morecss.'" rows="'.ROWS_2.'" wrap="soft">';
467 467
 					$resultforextrlang .= $valuetoshow;
468 468
 					$resultforextrlang .= '</textarea>';
469 469
 				} else {
470
-					$resultforextrlang .= '<input type="text" class="inputfieldforlang ' . ($morecss ? ' ' . $morecss : '') . '" name="field-' . $object->element . '-' . $fieldname . '-' . $langcode . '" value="' . $valuetoshow . '">';
470
+					$resultforextrlang .= '<input type="text" class="inputfieldforlang '.($morecss ? ' '.$morecss : '').'" name="field-'.$object->element.'-'.$fieldname.'-'.$langcode.'" value="'.$valuetoshow.'">';
471 471
 				}
472 472
 			}
473 473
 			$result .= $resultforextrlang;
474 474
 
475 475
 			$result .= '</div>';
476
-			$result .= '<script nonce="' . getNonce() . '">$(".image-' . $object->element . '-' . $fieldname . '").click(function() { console.log("Toggle lang widget"); jQuery(".field-' . $object->element . '-' . $fieldname . '").toggle(); });</script>';
476
+			$result .= '<script nonce="'.getNonce().'">$(".image-'.$object->element.'-'.$fieldname.'").click(function() { console.log("Toggle lang widget"); jQuery(".field-'.$object->element.'-'.$fieldname.'").toggle(); });</script>';
477 477
 		}
478 478
 
479 479
 		return $result;
@@ -536,7 +536,7 @@  discard block
 block discarded – undo
536 536
 				if (!empty($tmp[2])) {
537 537
 					$savemethod = $tmp[2];
538 538
 				}
539
-				$out .= '<input id="width_' . $htmlname . '" value="' . $inputOption . '" type="hidden"/>' . "\n";
539
+				$out .= '<input id="width_'.$htmlname.'" value="'.$inputOption.'" type="hidden"/>'."\n";
540 540
 			} elseif ((preg_match('/^day$/', $inputType)) || (preg_match('/^datepicker/', $inputType)) || (preg_match('/^datehourpicker/', $inputType))) {
541 541
 				$tmp = explode(':', $inputType);
542 542
 				$inputType = $tmp[0];
@@ -547,7 +547,7 @@  discard block
 block discarded – undo
547 547
 					$savemethod = $tmp[2];
548 548
 				}
549 549
 
550
-				$out .= '<input id="timestamp" type="hidden"/>' . "\n"; // Use for timestamp format
550
+				$out .= '<input id="timestamp" type="hidden"/>'."\n"; // Use for timestamp format
551 551
 			} elseif (preg_match('/^(select|autocomplete)/', $inputType)) {
552 552
 				$tmp = explode(':', $inputType);
553 553
 				$inputType = $tmp[0];
@@ -578,40 +578,40 @@  discard block
 block discarded – undo
578 578
 				}
579 579
 
580 580
 				if (isModEnabled('fckeditor')) {
581
-					$out .= '<input id="ckeditor_toolbar" value="' . $toolbar . '" type="hidden"/>' . "\n";
581
+					$out .= '<input id="ckeditor_toolbar" value="'.$toolbar.'" type="hidden"/>'."\n";
582 582
 				} else {
583 583
 					$inputType = 'textarea';
584 584
 				}
585 585
 			}
586 586
 
587
-			$out .= '<input id="element_' . $htmlname . '" value="' . $element . '" type="hidden"/>' . "\n";
588
-			$out .= '<input id="table_element_' . $htmlname . '" value="' . $table_element . '" type="hidden"/>' . "\n";
589
-			$out .= '<input id="fk_element_' . $htmlname . '" value="' . $fk_element . '" type="hidden"/>' . "\n";
590
-			$out .= '<input id="loadmethod_' . $htmlname . '" value="' . $loadmethod . '" type="hidden"/>' . "\n";
587
+			$out .= '<input id="element_'.$htmlname.'" value="'.$element.'" type="hidden"/>'."\n";
588
+			$out .= '<input id="table_element_'.$htmlname.'" value="'.$table_element.'" type="hidden"/>'."\n";
589
+			$out .= '<input id="fk_element_'.$htmlname.'" value="'.$fk_element.'" type="hidden"/>'."\n";
590
+			$out .= '<input id="loadmethod_'.$htmlname.'" value="'.$loadmethod.'" type="hidden"/>'."\n";
591 591
 			if (!empty($savemethod)) {
592
-				$out .= '<input id="savemethod_' . $htmlname . '" value="' . $savemethod . '" type="hidden"/>' . "\n";
592
+				$out .= '<input id="savemethod_'.$htmlname.'" value="'.$savemethod.'" type="hidden"/>'."\n";
593 593
 			}
594 594
 			if (!empty($ext_element)) {
595
-				$out .= '<input id="ext_element_' . $htmlname . '" value="' . $ext_element . '" type="hidden"/>' . "\n";
595
+				$out .= '<input id="ext_element_'.$htmlname.'" value="'.$ext_element.'" type="hidden"/>'."\n";
596 596
 			}
597 597
 			if (!empty($custommsg)) {
598 598
 				if (is_array($custommsg)) {
599 599
 					if (!empty($custommsg['success'])) {
600
-						$out .= '<input id="successmsg_' . $htmlname . '" value="' . $custommsg['success'] . '" type="hidden"/>' . "\n";
600
+						$out .= '<input id="successmsg_'.$htmlname.'" value="'.$custommsg['success'].'" type="hidden"/>'."\n";
601 601
 					}
602 602
 					if (!empty($custommsg['error'])) {
603
-						$out .= '<input id="errormsg_' . $htmlname . '" value="' . $custommsg['error'] . '" type="hidden"/>' . "\n";
603
+						$out .= '<input id="errormsg_'.$htmlname.'" value="'.$custommsg['error'].'" type="hidden"/>'."\n";
604 604
 					}
605 605
 				} else {
606
-					$out .= '<input id="successmsg_' . $htmlname . '" value="' . $custommsg . '" type="hidden"/>' . "\n";
606
+					$out .= '<input id="successmsg_'.$htmlname.'" value="'.$custommsg.'" type="hidden"/>'."\n";
607 607
 				}
608 608
 			}
609 609
 			if ($inputType == 'textarea') {
610
-				$out .= '<input id="textarea_' . $htmlname . '_rows" value="' . $rows . '" type="hidden"/>' . "\n";
611
-				$out .= '<input id="textarea_' . $htmlname . '_cols" value="' . $cols . '" type="hidden"/>' . "\n";
610
+				$out .= '<input id="textarea_'.$htmlname.'_rows" value="'.$rows.'" type="hidden"/>'."\n";
611
+				$out .= '<input id="textarea_'.$htmlname.'_cols" value="'.$cols.'" type="hidden"/>'."\n";
612 612
 			}
613
-			$out .= '<span id="viewval_' . $htmlname . '" class="viewval_' . $inputType . ($button_only ? ' inactive' : ' active') . '">' . $value . '</span>' . "\n";
614
-			$out .= '<span id="editval_' . $htmlname . '" class="editval_' . $inputType . ($button_only ? ' inactive' : ' active') . ' hideobject">' . (!empty($editvalue) ? $editvalue : $value) . '</span>' . "\n";
613
+			$out .= '<span id="viewval_'.$htmlname.'" class="viewval_'.$inputType.($button_only ? ' inactive' : ' active').'">'.$value.'</span>'."\n";
614
+			$out .= '<span id="editval_'.$htmlname.'" class="editval_'.$inputType.($button_only ? ' inactive' : ' active').' hideobject">'.(!empty($editvalue) ? $editvalue : $value).'</span>'."\n";
615 615
 		} else {
616 616
 			$out = $value;
617 617
 		}
@@ -640,12 +640,12 @@  discard block
 block discarded – undo
640 640
 	public function textwithtooltip($text, $htmltext, $tooltipon = 1, $direction = 0, $img = '', $extracss = '', $notabs = 3, $incbefore = '', $noencodehtmltext = 0, $tooltiptrigger = '', $forcenowrap = 0)
641 641
 	{
642 642
 		if ($incbefore) {
643
-			$text = $incbefore . $text;
643
+			$text = $incbefore.$text;
644 644
 		}
645 645
 		if (!$htmltext) {
646 646
 			return $text;
647 647
 		}
648
-		$direction = (int) $direction;    // For backward compatibility when $direction was set to '' instead of 0
648
+		$direction = (int) $direction; // For backward compatibility when $direction was set to '' instead of 0
649 649
 
650 650
 		$tag = 'td';
651 651
 		if ($notabs == 2) {
@@ -659,11 +659,11 @@  discard block
 block discarded – undo
659 659
 
660 660
 		$extrastyle = '';
661 661
 		if ($direction < 0) {
662
-			$extracss = ($extracss ? $extracss : '') . ($notabs != 3 ? ' inline-block' : '');
662
+			$extracss = ($extracss ? $extracss : '').($notabs != 3 ? ' inline-block' : '');
663 663
 			$extrastyle = 'padding: 0px; padding-left: 2px;';
664 664
 		}
665 665
 		if ($direction > 0) {
666
-			$extracss = ($extracss ? $extracss : '') . ($notabs != 3 ? ' inline-block' : '');
666
+			$extracss = ($extracss ? $extracss : '').($notabs != 3 ? ' inline-block' : '');
667 667
 			$extrastyle = 'padding: 0px; padding-right: 2px;';
668 668
 		}
669 669
 
@@ -676,53 +676,53 @@  discard block
 block discarded – undo
676 676
 			$htmltext = str_replace('"', '&quot;', $htmltext);
677 677
 		} else {
678 678
 			$classfortooltip = 'classfortooltiponclick';
679
-			$textfordialog .= '<div style="display: none;" id="idfortooltiponclick_' . $tooltiptrigger . '" class="classfortooltiponclicktext">' . $htmltext . '</div>';
679
+			$textfordialog .= '<div style="display: none;" id="idfortooltiponclick_'.$tooltiptrigger.'" class="classfortooltiponclicktext">'.$htmltext.'</div>';
680 680
 		}
681 681
 		if ($tooltipon == 2 || $tooltipon == 3) {
682
-			$paramfortooltipimg = ' class="' . $classfortooltip . ($notabs != 3 ? ' inline-block' : '') . ($extracss ? ' ' . $extracss : '') . '" style="padding: 0px;' . ($extrastyle ? ' ' . $extrastyle : '') . '"';
682
+			$paramfortooltipimg = ' class="'.$classfortooltip.($notabs != 3 ? ' inline-block' : '').($extracss ? ' '.$extracss : '').'" style="padding: 0px;'.($extrastyle ? ' '.$extrastyle : '').'"';
683 683
 			if ($tooltiptrigger == '') {
684
-				$paramfortooltipimg .= ' title="' . ($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)) . '"'; // Attribute to put on img tag to store tooltip
684
+				$paramfortooltipimg .= ' title="'.($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)).'"'; // Attribute to put on img tag to store tooltip
685 685
 			} else {
686
-				$paramfortooltipimg .= ' dolid="' . $tooltiptrigger . '"';
686
+				$paramfortooltipimg .= ' dolid="'.$tooltiptrigger.'"';
687 687
 			}
688 688
 		} else {
689
-			$paramfortooltipimg = ($extracss ? ' class="' . $extracss . '"' : '') . ($extrastyle ? ' style="' . $extrastyle . '"' : ''); // Attribute to put on td text tag
689
+			$paramfortooltipimg = ($extracss ? ' class="'.$extracss.'"' : '').($extrastyle ? ' style="'.$extrastyle.'"' : ''); // Attribute to put on td text tag
690 690
 		}
691 691
 		if ($tooltipon == 1 || $tooltipon == 3) {
692
-			$paramfortooltiptd = ' class="' . ($tooltipon == 3 ? 'cursorpointer ' : '') . $classfortooltip . ($tag != 'td' ? ' inline-block' : '') . ($extracss ? ' ' . $extracss : '') . '" style="padding: 0px;' . ($extrastyle ? ' ' . $extrastyle : '') . '" ';
692
+			$paramfortooltiptd = ' class="'.($tooltipon == 3 ? 'cursorpointer ' : '').$classfortooltip.($tag != 'td' ? ' inline-block' : '').($extracss ? ' '.$extracss : '').'" style="padding: 0px;'.($extrastyle ? ' '.$extrastyle : '').'" ';
693 693
 			if ($tooltiptrigger == '') {
694
-				$paramfortooltiptd .= ' title="' . ($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)) . '"'; // Attribute to put on td tag to store tooltip
694
+				$paramfortooltiptd .= ' title="'.($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)).'"'; // Attribute to put on td tag to store tooltip
695 695
 			} else {
696
-				$paramfortooltiptd .= ' dolid="' . $tooltiptrigger . '"';
696
+				$paramfortooltiptd .= ' dolid="'.$tooltiptrigger.'"';
697 697
 			}
698 698
 		} else {
699
-			$paramfortooltiptd = ($extracss ? ' class="' . $extracss . '"' : '') . ($extrastyle ? ' style="' . $extrastyle . '"' : ''); // Attribute to put on td text tag
699
+			$paramfortooltiptd = ($extracss ? ' class="'.$extracss.'"' : '').($extrastyle ? ' style="'.$extrastyle.'"' : ''); // Attribute to put on td text tag
700 700
 		}
701 701
 		if (empty($notabs)) {
702 702
 			$s .= '<table class="nobordernopadding"><tr style="height: auto;">';
703 703
 		} elseif ($notabs == 2) {
704
-			$s .= '<div class="inline-block' . ($forcenowrap ? ' nowrap' : '') . '">';
704
+			$s .= '<div class="inline-block'.($forcenowrap ? ' nowrap' : '').'">';
705 705
 		}
706 706
 		// Define value if value is before
707 707
 		if ($direction < 0) {
708
-			$s .= '<' . $tag . $paramfortooltipimg;
708
+			$s .= '<'.$tag.$paramfortooltipimg;
709 709
 			if ($tag == 'td') {
710 710
 				$s .= ' class="valigntop" width="14"';
711 711
 			}
712
-			$s .= '>' . $textfordialog . $img . '</' . $tag . '>';
712
+			$s .= '>'.$textfordialog.$img.'</'.$tag.'>';
713 713
 		}
714 714
 		// Use another method to help avoid having a space in value in order to use this value with jquery
715 715
 		// Define label
716 716
 		if ((string) $text != '') {
717
-			$s .= '<' . $tag . $paramfortooltiptd . '>' . $text . '</' . $tag . '>';
717
+			$s .= '<'.$tag.$paramfortooltiptd.'>'.$text.'</'.$tag.'>';
718 718
 		}
719 719
 		// Define value if value is after
720 720
 		if ($direction > 0) {
721
-			$s .= '<' . $tag . $paramfortooltipimg;
721
+			$s .= '<'.$tag.$paramfortooltipimg;
722 722
 			if ($tag == 'td') {
723 723
 				$s .= ' class="valignmiddle" width="14"';
724 724
 			}
725
-			$s .= '>' . $textfordialog . $img . '</' . $tag . '>';
725
+			$s .= '>'.$textfordialog.$img.'</'.$tag.'>';
726 726
 		}
727 727
 		if (empty($notabs)) {
728 728
 			$s .= '</tr></table>';
@@ -829,7 +829,7 @@  discard block
 block discarded – undo
829 829
 
830 830
 		$disabled = 0;
831 831
 		$ret = '<div class="centpercent center">';
832
-		$ret .= '<select class="flat' . (empty($conf->use_javascript_ajax) ? '' : ' hideobject') . ' ' . $name . ' ' . $name . 'select valignmiddle alignstart" id="' . $name . '" name="' . $name . '"' . ($disabled ? ' disabled="disabled"' : '') . '>';
832
+		$ret .= '<select class="flat'.(empty($conf->use_javascript_ajax) ? '' : ' hideobject').' '.$name.' '.$name.'select valignmiddle alignstart" id="'.$name.'" name="'.$name.'"'.($disabled ? ' disabled="disabled"' : '').'>';
833 833
 
834 834
 		// 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.
835 835
 		$parameters = array();
@@ -840,10 +840,10 @@  discard block
 block discarded – undo
840 840
 			return;
841 841
 		}
842 842
 		if (empty($reshook)) {
843
-			$ret .= '<option value="0"' . ($disabled ? ' disabled="disabled"' : '') . '>-- ' . $langs->trans("SelectAction") . ' --</option>';
843
+			$ret .= '<option value="0"'.($disabled ? ' disabled="disabled"' : '').'>-- '.$langs->trans("SelectAction").' --</option>';
844 844
 			if (is_array($arrayofaction)) {
845 845
 				foreach ($arrayofaction as $code => $label) {
846
-					$ret .= '<option value="' . $code . '"' . ($disabled ? ' disabled="disabled"' : '') . ' data-html="' . dol_escape_htmltag($label) . '">' . $label . '</option>';
846
+					$ret .= '<option value="'.$code.'"'.($disabled ? ' disabled="disabled"' : '').' data-html="'.dol_escape_htmltag($label).'">'.$label.'</option>';
847 847
 				}
848 848
 			}
849 849
 		}
@@ -852,17 +852,17 @@  discard block
 block discarded – undo
852 852
 		$ret .= '</select>';
853 853
 
854 854
 		if (empty($conf->dol_optimize_smallscreen)) {
855
-			$ret .= ajax_combobox('.' . $name . 'select');
855
+			$ret .= ajax_combobox('.'.$name.'select');
856 856
 		}
857 857
 
858 858
 		// 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
859 859
 		$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.
860
-		$ret .= '<input type="submit" disabled name="confirmmassaction"' . (empty($conf->use_javascript_ajax) ? '' : ' style="display: none"') . ' class="reposition button smallpaddingimp' . (empty($conf->use_javascript_ajax) ? '' : ' hideobject') . ' ' . $name . ' ' . $name . 'confirmed" value="' . dol_escape_htmltag($langs->trans("Confirm")) . '">';
860
+		$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")).'">';
861 861
 		$ret .= '</div>';
862 862
 
863 863
 		if (!empty($conf->use_javascript_ajax)) {
864 864
 			$ret .= '<!-- JS CODE TO ENABLE mass action select -->
865
-    		<script nonce="' . getNonce() . '">
865
+    		<script nonce="' . getNonce().'">
866 866
                         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 */
867 867
         		{
868 868
         			atleastoneselected=0;
@@ -873,11 +873,11 @@  discard block
 block discarded – undo
873 873
 
874 874
 					console.log("initCheckForSelect mode="+mode+" name="+name+" cssclass="+cssclass+" atleastoneselected="+atleastoneselected);
875 875
 
876
-    	  			if (atleastoneselected || ' . $alwaysvisible . ')
876
+    	  			if (atleastoneselected || ' . $alwaysvisible.')
877 877
     	  			{
878 878
                                     jQuery("."+name).show();
879
-        			    ' . ($selected ? 'if (atleastoneselected) { jQuery("."+name+"select").val("' . $selected . '").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', false); }' : '') . '
880
-        			    ' . ($selected ? 'if (! atleastoneselected) { jQuery("."+name+"select").val("0").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', true); } ' : '') . '
879
+        			    ' . ($selected ? 'if (atleastoneselected) { jQuery("."+name+"select").val("'.$selected.'").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', false); }' : '').'
880
+        			    ' . ($selected ? 'if (! atleastoneselected) { jQuery("."+name+"select").val("0").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', true); } ' : '').'
881 881
     	  			}
882 882
     	  			else
883 883
     	  			{
@@ -887,26 +887,26 @@  discard block
 block discarded – undo
887 887
         		}
888 888
 
889 889
         	jQuery(document).ready(function () {
890
-                    initCheckForSelect(0, "' . $name . '", "' . $cssclass . '");
891
-                    jQuery(".' . $cssclass . '").click(function() {
892
-                        initCheckForSelect(1, "' . $name . '", "' . $cssclass . '");
890
+                    initCheckForSelect(0, "' . $name.'", "'.$cssclass.'");
891
+                    jQuery(".' . $cssclass.'").click(function() {
892
+                        initCheckForSelect(1, "' . $name.'", "'.$cssclass.'");
893 893
                     });
894
-                    jQuery(".' . $name . 'select").change(function() {
894
+                    jQuery(".' . $name.'select").change(function() {
895 895
         				var massaction = $( this ).val();
896 896
         				var urlform = $( this ).closest("form").attr("action").replace("#show_files","");
897 897
         				if (massaction == "builddoc") {
898 898
                         	urlform = urlform + "#show_files";
899 899
     	            	}
900 900
         				$( this ).closest("form").attr("action", urlform);
901
-                    	console.log("we select a mass action name=' . $name . ' massaction="+massaction+" - "+urlform);
901
+                    	console.log("we select a mass action name=' . $name.' massaction="+massaction+" - "+urlform);
902 902
         	        	/* Warning: if you set submit button to disabled, post using Enter will no more work if there is no other button */
903 903
         				if ($(this).val() != \'0\') {
904
-                                        jQuery(".' . $name . 'confirmed").prop(\'disabled\', false);
905
-										jQuery(".' . $name . 'other").hide();	/* To disable if another div was open */
906
-                                        jQuery(".' . $name . '"+massaction).show();
904
+                                        jQuery(".' . $name.'confirmed").prop(\'disabled\', false);
905
+										jQuery(".' . $name.'other").hide();	/* To disable if another div was open */
906
+                                        jQuery(".' . $name.'"+massaction).show();
907 907
     	  				} else {
908
-                                        jQuery(".' . $name . 'confirmed").prop(\'disabled\', true);
909
-										jQuery(".' . $name . 'other").hide();	/* To disable any div open */
908
+                                        jQuery(".' . $name.'confirmed").prop(\'disabled\', true);
909
+										jQuery(".' . $name.'other").hide();	/* To disable any div open */
910 910
     	  				}
911 911
     	        });
912 912
         	});
@@ -949,14 +949,14 @@  discard block
 block discarded – undo
949 949
 		$atleastonefavorite = 0;
950 950
 
951 951
 		$sql = "SELECT rowid, code as code_iso, code_iso as code_iso3, label, favorite, eec";
952
-		$sql .= " FROM " . $this->db->prefix() . "c_country";
952
+		$sql .= " FROM ".$this->db->prefix()."c_country";
953 953
 		$sql .= " WHERE active > 0";
954 954
 		//$sql.= " ORDER BY code ASC";
955 955
 
956
-		dol_syslog(get_class($this) . "::select_country", LOG_DEBUG);
956
+		dol_syslog(get_class($this)."::select_country", LOG_DEBUG);
957 957
 		$resql = $this->db->query($sql);
958 958
 		if ($resql) {
959
-			$out .= '<select id="select' . $htmlname . '" class="flat maxwidth200onsmartphone selectcountry' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" ' . $htmloption . '>';
959
+			$out .= '<select id="select'.$htmlname.'" class="flat maxwidth200onsmartphone selectcountry'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" '.$htmloption.'>';
960 960
 			$num = $this->db->num_rows($resql);
961 961
 			$i = 0;
962 962
 			if ($num) {
@@ -966,7 +966,7 @@  discard block
 block discarded – undo
966 966
 					$countryArray[$i]['rowid'] = $obj->rowid;
967 967
 					$countryArray[$i]['code_iso'] = $obj->code_iso;
968 968
 					$countryArray[$i]['code_iso3'] = $obj->code_iso3;
969
-					$countryArray[$i]['label'] = ($obj->code_iso && $langs->transnoentitiesnoconv("Country" . $obj->code_iso) != "Country" . $obj->code_iso ? $langs->transnoentitiesnoconv("Country" . $obj->code_iso) : ($obj->label != '-' ? $obj->label : ''));
969
+					$countryArray[$i]['label'] = ($obj->code_iso && $langs->transnoentitiesnoconv("Country".$obj->code_iso) != "Country".$obj->code_iso ? $langs->transnoentitiesnoconv("Country".$obj->code_iso) : ($obj->label != '-' ? $obj->label : ''));
970 970
 					$countryArray[$i]['favorite'] = $obj->favorite;
971 971
 					$countryArray[$i]['eec'] = $obj->eec;
972 972
 					$favorite[$i] = $obj->favorite;
@@ -984,20 +984,20 @@  discard block
 block discarded – undo
984 984
 
985 985
 				if ($showempty) {
986 986
 					if (is_numeric($showempty)) {
987
-						$out .= '<option value="">&nbsp;</option>' . "\n";
987
+						$out .= '<option value="">&nbsp;</option>'."\n";
988 988
 					} else {
989
-						$out .= '<option value="-1">' . $langs->trans($showempty) . '</option>' . "\n";
989
+						$out .= '<option value="-1">'.$langs->trans($showempty).'</option>'."\n";
990 990
 					}
991 991
 				}
992 992
 
993 993
 				if ($addspecialentries) {    // Add dedicated entries for groups of countries
994 994
 					//if ($showempty) $out.= '<option value="" disabled class="selectoptiondisabledwhite">--------------</option>';
995
-					$out .= '<option value="special_allnotme"' . ($selected == 'special_allnotme' ? ' selected' : '') . '>' . $langs->trans("CountriesExceptMe", $langs->transnoentitiesnoconv("Country" . $mysoc->country_code)) . '</option>';
996
-					$out .= '<option value="special_eec"' . ($selected == 'special_eec' ? ' selected' : '') . '>' . $langs->trans("CountriesInEEC") . '</option>';
995
+					$out .= '<option value="special_allnotme"'.($selected == 'special_allnotme' ? ' selected' : '').'>'.$langs->trans("CountriesExceptMe", $langs->transnoentitiesnoconv("Country".$mysoc->country_code)).'</option>';
996
+					$out .= '<option value="special_eec"'.($selected == 'special_eec' ? ' selected' : '').'>'.$langs->trans("CountriesInEEC").'</option>';
997 997
 					if ($mysoc->isInEEC()) {
998
-						$out .= '<option value="special_eecnotme"' . ($selected == 'special_eecnotme' ? ' selected' : '') . '>' . $langs->trans("CountriesInEECExceptMe", $langs->transnoentitiesnoconv("Country" . $mysoc->country_code)) . '</option>';
998
+						$out .= '<option value="special_eecnotme"'.($selected == 'special_eecnotme' ? ' selected' : '').'>'.$langs->trans("CountriesInEECExceptMe", $langs->transnoentitiesnoconv("Country".$mysoc->country_code)).'</option>';
999 999
 					}
1000
-					$out .= '<option value="special_noteec"' . ($selected == 'special_noteec' ? ' selected' : '') . '>' . $langs->trans("CountriesNotInEEC") . '</option>';
1000
+					$out .= '<option value="special_noteec"'.($selected == 'special_noteec' ? ' selected' : '').'>'.$langs->trans("CountriesNotInEEC").'</option>';
1001 1001
 					$out .= '<option value="" disabled class="selectoptiondisabledwhite">------------</option>';
1002 1002
 				}
1003 1003
 
@@ -1025,20 +1025,20 @@  discard block
 block discarded – undo
1025 1025
 						$labeltoshow .= '&nbsp;';
1026 1026
 					}
1027 1027
 					if ($row['code_iso']) {
1028
-						$labeltoshow .= ' <span class="opacitymedium">(' . $row['code_iso'] . ')</span>';
1028
+						$labeltoshow .= ' <span class="opacitymedium">('.$row['code_iso'].')</span>';
1029 1029
 						if (empty($hideflags)) {
1030 1030
 							$tmpflag = picto_from_langcode($row['code_iso'], 'class="saturatemedium paddingrightonly"', 1);
1031
-							$labeltoshow = $tmpflag . ' ' . $labeltoshow;
1031
+							$labeltoshow = $tmpflag.' '.$labeltoshow;
1032 1032
 						}
1033 1033
 					}
1034 1034
 
1035 1035
 					if ($selected && $selected != '-1' && ($selected == $row['rowid'] || $selected == $row['code_iso'] || $selected == $row['code_iso3'] || $selected == $row['label'])) {
1036
-						$out .= '<option value="' . ($usecodeaskey ? ($usecodeaskey == 'code2' ? $row['code_iso'] : $row['code_iso3']) : $row['rowid']) . '" selected data-html="' . dol_escape_htmltag($labeltoshow) . '" data-eec="' . ((int) $row['eec']) . '">';
1036
+						$out .= '<option value="'.($usecodeaskey ? ($usecodeaskey == 'code2' ? $row['code_iso'] : $row['code_iso3']) : $row['rowid']).'" selected data-html="'.dol_escape_htmltag($labeltoshow).'" data-eec="'.((int) $row['eec']).'">';
1037 1037
 					} else {
1038
-						$out .= '<option value="' . ($usecodeaskey ? ($usecodeaskey == 'code2' ? $row['code_iso'] : $row['code_iso3']) : $row['rowid']) . '" data-html="' . dol_escape_htmltag($labeltoshow) . '" data-eec="' . ((int) $row['eec']) . '">';
1038
+						$out .= '<option value="'.($usecodeaskey ? ($usecodeaskey == 'code2' ? $row['code_iso'] : $row['code_iso3']) : $row['rowid']).'" data-html="'.dol_escape_htmltag($labeltoshow).'" data-eec="'.((int) $row['eec']).'">';
1039 1039
 					}
1040 1040
 					$out .= dol_string_nohtmltag($labeltoshow);
1041
-					$out .= '</option>' . "\n";
1041
+					$out .= '</option>'."\n";
1042 1042
 				}
1043 1043
 			}
1044 1044
 			$out .= '</select>';
@@ -1047,8 +1047,8 @@  discard block
 block discarded – undo
1047 1047
 		}
1048 1048
 
1049 1049
 		// Make select dynamic
1050
-		include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
1051
-		$out .= ajax_combobox('select' . $htmlname, array(), 0, 0, 'resolve');
1050
+		include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
1051
+		$out .= ajax_combobox('select'.$htmlname, array(), 0, 0, 'resolve');
1052 1052
 
1053 1053
 		return $out;
1054 1054
 	}
@@ -1080,25 +1080,25 @@  discard block
 block discarded – undo
1080 1080
 		$incotermArray = array();
1081 1081
 
1082 1082
 		$sql = "SELECT rowid, code";
1083
-		$sql .= " FROM " . $this->db->prefix() . "c_incoterms";
1083
+		$sql .= " FROM ".$this->db->prefix()."c_incoterms";
1084 1084
 		$sql .= " WHERE active > 0";
1085 1085
 		$sql .= " ORDER BY code ASC";
1086 1086
 
1087
-		dol_syslog(get_class($this) . "::select_incoterm", LOG_DEBUG);
1087
+		dol_syslog(get_class($this)."::select_incoterm", LOG_DEBUG);
1088 1088
 		$resql = $this->db->query($sql);
1089 1089
 		if ($resql) {
1090 1090
 			if ($conf->use_javascript_ajax && !$forcecombo) {
1091
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
1091
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
1092 1092
 				$out .= ajax_combobox($htmlname, $events);
1093 1093
 			}
1094 1094
 
1095 1095
 			if (!empty($page)) {
1096
-				$out .= '<form method="post" action="' . $page . '">';
1096
+				$out .= '<form method="post" action="'.$page.'">';
1097 1097
 				$out .= '<input type="hidden" name="action" value="set_incoterms">';
1098
-				$out .= '<input type="hidden" name="token" value="' . newToken() . '">';
1098
+				$out .= '<input type="hidden" name="token" value="'.newToken().'">';
1099 1099
 			}
1100 1100
 
1101
-			$out .= '<select id="' . $htmlname . '" class="flat selectincoterm width75" name="' . $htmlname . '" ' . $htmloption . '>';
1101
+			$out .= '<select id="'.$htmlname.'" class="flat selectincoterm width75" name="'.$htmlname.'" '.$htmloption.'>';
1102 1102
 			$out .= '<option value="0">&nbsp;</option>';
1103 1103
 			$num = $this->db->num_rows($resql);
1104 1104
 			$i = 0;
@@ -1112,9 +1112,9 @@  discard block
 block discarded – undo
1112 1112
 
1113 1113
 				foreach ($incotermArray as $row) {
1114 1114
 					if ($selected && ($selected == $row['rowid'] || $selected == $row['code'])) {
1115
-						$out .= '<option value="' . $row['rowid'] . '" selected>';
1115
+						$out .= '<option value="'.$row['rowid'].'" selected>';
1116 1116
 					} else {
1117
-						$out .= '<option value="' . $row['rowid'] . '">';
1117
+						$out .= '<option value="'.$row['rowid'].'">';
1118 1118
 					}
1119 1119
 
1120 1120
 					if ($row['code']) {
@@ -1128,13 +1128,13 @@  discard block
 block discarded – undo
1128 1128
 			$out .= ajax_combobox($htmlname);
1129 1129
 
1130 1130
 			if ($conf->use_javascript_ajax && empty($disableautocomplete)) {
1131
-				$out .= ajax_multiautocompleter('location_incoterms', array(), DOL_URL_ROOT . '/core/ajax/locationincoterms.php') . "\n";
1131
+				$out .= ajax_multiautocompleter('location_incoterms', array(), DOL_URL_ROOT.'/core/ajax/locationincoterms.php')."\n";
1132 1132
 				$moreattrib .= ' autocomplete="off"';
1133 1133
 			}
1134
-			$out .= '<input id="location_incoterms" class="maxwidthonsmartphone type="text" name="location_incoterms" value="' . $location_incoterms . '">' . "\n";
1134
+			$out .= '<input id="location_incoterms" class="maxwidthonsmartphone type="text" name="location_incoterms" value="'.$location_incoterms.'">'."\n";
1135 1135
 
1136 1136
 			if (!empty($page)) {
1137
-				$out .= '<input type="submit" class="button valignmiddle smallpaddingimp nomargintop nomarginbottom" value="' . $langs->trans("Modify") . '"></form>';
1137
+				$out .= '<input type="submit" class="button valignmiddle smallpaddingimp nomargintop nomarginbottom" value="'.$langs->trans("Modify").'"></form>';
1138 1138
 			}
1139 1139
 		} else {
1140 1140
 			dol_print_error($this->db);
@@ -1169,7 +1169,7 @@  discard block
 block discarded – undo
1169 1169
 			if (empty($hidetext)) {
1170 1170
 				print $langs->trans("Type").'...';
1171 1171
 			}
1172
-			print '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="select_' . $htmlname . '" name="' . $htmlname . '">';
1172
+			print '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="select_'.$htmlname.'" name="'.$htmlname.'">';
1173 1173
 			if ($showempty) {
1174 1174
 				print '<option value="-1" class="opacitymedium"'.($useajaxcombo ? '' : ' disabled="disabled"');
1175 1175
 				if ($selected == -1) {
@@ -1188,31 +1188,31 @@  discard block
 block discarded – undo
1188 1188
 			if (0 == $selected || ($selected == -1 && getDolGlobalString('MAIN_FREE_PRODUCT_CHECKED_BY_DEFAULT') == 'product')) {
1189 1189
 				print ' selected';
1190 1190
 			}
1191
-			print '>' . $langs->trans("Product");
1191
+			print '>'.$langs->trans("Product");
1192 1192
 
1193 1193
 			print '<option value="1"';
1194 1194
 			if (1 == $selected || ($selected == -1 && getDolGlobalString('MAIN_FREE_PRODUCT_CHECKED_BY_DEFAULT') == 'service')) {
1195 1195
 				print ' selected';
1196 1196
 			}
1197
-			print '>' . $langs->trans("Service");
1197
+			print '>'.$langs->trans("Service");
1198 1198
 
1199 1199
 			print '</select>';
1200 1200
 
1201 1201
 			if ($useajaxcombo) {
1202
-				print ajax_combobox('select_' . $htmlname);
1202
+				print ajax_combobox('select_'.$htmlname);
1203 1203
 			}
1204 1204
 			//if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1);
1205 1205
 		}
1206 1206
 		if ((empty($forceall) && !isModEnabled('product') && isModEnabled("service")) || $forceall == 3) {
1207 1207
 			print $langs->trans("Service");
1208
-			print '<input type="hidden" name="' . $htmlname . '" value="1">';
1208
+			print '<input type="hidden" name="'.$htmlname.'" value="1">';
1209 1209
 		}
1210 1210
 		if ((empty($forceall) && isModEnabled("product") && !isModEnabled('service')) || $forceall == 2) {
1211 1211
 			print $langs->trans("Product");
1212
-			print '<input type="hidden" name="' . $htmlname . '" value="0">';
1212
+			print '<input type="hidden" name="'.$htmlname.'" value="0">';
1213 1213
 		}
1214 1214
 		if ($forceall < 0) {    // This should happened only for contracts when both predefined product and service are disabled.
1215
-			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
1215
+			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
1216 1216
 		}
1217 1217
 	}
1218 1218
 
@@ -1238,7 +1238,7 @@  discard block
 block discarded – undo
1238 1238
 		$langs->load("trips");
1239 1239
 
1240 1240
 		$sql = "SELECT c.code, c.label";
1241
-		$sql .= " FROM " . $this->db->prefix() . "c_type_fees as c";
1241
+		$sql .= " FROM ".$this->db->prefix()."c_type_fees as c";
1242 1242
 		$sql .= " WHERE active > 0";
1243 1243
 
1244 1244
 		$resql = $this->db->query($sql);
@@ -1279,11 +1279,11 @@  discard block
 block discarded – undo
1279 1279
 		// phpcs:enable
1280 1280
 		global $user, $langs;
1281 1281
 
1282
-		dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG);
1282
+		dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG);
1283 1283
 
1284 1284
 		$this->load_cache_types_fees();
1285 1285
 
1286
-		print '<select id="select_' . $htmlname . '" class="flat" name="' . $htmlname . '">';
1286
+		print '<select id="select_'.$htmlname.'" class="flat" name="'.$htmlname.'">';
1287 1287
 		if ($showempty) {
1288 1288
 			print '<option value="-1"';
1289 1289
 			if ($selected == -1) {
@@ -1293,7 +1293,7 @@  discard block
 block discarded – undo
1293 1293
 		}
1294 1294
 
1295 1295
 		foreach ($this->cache_types_fees as $key => $value) {
1296
-			print '<option value="' . $key . '"';
1296
+			print '<option value="'.$key.'"';
1297 1297
 			if ($key == $selected) {
1298 1298
 				print ' selected';
1299 1299
 			}
@@ -1345,12 +1345,12 @@  discard block
 block discarded – undo
1345 1345
 				$ajaxoptions = array();
1346 1346
 			}
1347 1347
 
1348
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
1348
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
1349 1349
 
1350 1350
 			// No immediate load of all database
1351 1351
 			$placeholder = '';
1352 1352
 			if ($selected && empty($selected_input_value)) {
1353
-				require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
1353
+				require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
1354 1354
 				$societetmp = new Societe($this->db);
1355 1355
 				$societetmp->fetch($selected);
1356 1356
 				$selected_input_value = $societetmp->name;
@@ -1358,11 +1358,11 @@  discard block
 block discarded – undo
1358 1358
 			}
1359 1359
 
1360 1360
 			// mode 1
1361
-			$urloption = 'htmlname=' . urlencode((string) (str_replace('.', '_', $htmlname))) . '&outjson=1&filter=' . urlencode((string) ($filter)) . (empty($excludeids) ? '' : '&excludeids=' . implode(',', $excludeids)) . ($showtype ? '&showtype=' . urlencode((string) ($showtype)) : '') . ($showcode ? '&showcode=' . urlencode((string) ($showcode)) : '');
1361
+			$urloption = 'htmlname='.urlencode((string) (str_replace('.', '_', $htmlname))).'&outjson=1&filter='.urlencode((string) ($filter)).(empty($excludeids) ? '' : '&excludeids='.implode(',', $excludeids)).($showtype ? '&showtype='.urlencode((string) ($showtype)) : '').($showcode ? '&showcode='.urlencode((string) ($showcode)) : '');
1362 1362
 
1363 1363
 			$out .= '<!-- force css to be higher than dialog popup --><style type="text/css">.ui-autocomplete { z-index: 1010; }</style>';
1364 1364
 			if (empty($hidelabel)) {
1365
-				$out .= $langs->trans("RefOrLabel") . ' : ';
1365
+				$out .= $langs->trans("RefOrLabel").' : ';
1366 1366
 			} elseif ($hidelabel == 1 && !is_numeric($showempty)) {
1367 1367
 				$placeholder = $langs->trans($showempty);
1368 1368
 			} elseif ($hidelabel > 1) {
@@ -1371,7 +1371,7 @@  discard block
 block discarded – undo
1371 1371
 					$out .= img_picto($langs->trans("Search"), 'search');
1372 1372
 				}
1373 1373
 			}
1374
-			$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' : '') . ' />';
1374
+			$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' : '').' />';
1375 1375
 			if ($hidelabel == 3) {
1376 1376
 				$out .= img_picto($langs->trans("Search"), 'search');
1377 1377
 			}
@@ -1433,12 +1433,12 @@  discard block
 block discarded – undo
1433 1433
 				$events = array();
1434 1434
 			}
1435 1435
 
1436
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
1436
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
1437 1437
 
1438 1438
 			// No immediate load of all database
1439 1439
 			$placeholder = '';
1440 1440
 			if ($selected && empty($selected_input_value)) {
1441
-				require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php';
1441
+				require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
1442 1442
 				$contacttmp = new Contact($this->db);
1443 1443
 				$contacttmp->fetch($selected);
1444 1444
 				$selected_input_value = $contacttmp->getFullName($langs);
@@ -1449,11 +1449,11 @@  discard block
 block discarded – undo
1449 1449
 			}
1450 1450
 
1451 1451
 			// mode 1
1452
-			$urloption = 'htmlname=' . urlencode((string) (str_replace('.', '_', $htmlname))) . '&outjson=1&filter=' . urlencode((string) ($filter)) . (empty($exclude) ? '' : '&exclude=' . urlencode($exclude)) . ($showsoc ? '&showsoc=' . urlencode((string) ($showsoc)) : '');
1452
+			$urloption = 'htmlname='.urlencode((string) (str_replace('.', '_', $htmlname))).'&outjson=1&filter='.urlencode((string) ($filter)).(empty($exclude) ? '' : '&exclude='.urlencode($exclude)).($showsoc ? '&showsoc='.urlencode((string) ($showsoc)) : '');
1453 1453
 
1454 1454
 			$out .= '<!-- force css to be higher than dialog popup --><style type="text/css">.ui-autocomplete { z-index: 1010; }</style>';
1455 1455
 
1456
-			$out .= '<input type="text" class="' . $morecss . '" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . ($placeholder ? ' placeholder="' . dol_escape_htmltag($placeholder) . '"' : '') . ' ' . (getDolGlobalString('CONTACT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />';
1456
+			$out .= '<input type="text" class="'.$morecss.'" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.($placeholder ? ' placeholder="'.dol_escape_htmltag($placeholder).'"' : '').' '.(getDolGlobalString('CONTACT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />';
1457 1457
 
1458 1458
 			$out .= ajax_event($htmlname, $events);
1459 1459
 
@@ -1552,30 +1552,30 @@  discard block
 block discarded – undo
1552 1552
 			$sql .= ", s.address, s.zip, s.town";
1553 1553
 			$sql .= ", dictp.code as country_code";
1554 1554
 		}
1555
-		$sql .= " FROM " . $this->db->prefix() . "societe as s";
1555
+		$sql .= " FROM ".$this->db->prefix()."societe as s";
1556 1556
 		if (getDolGlobalString('COMPANY_SHOW_ADDRESS_SELECTLIST')) {
1557
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "c_country as dictp ON dictp.rowid = s.fk_pays";
1557
+			$sql .= " LEFT JOIN ".$this->db->prefix()."c_country as dictp ON dictp.rowid = s.fk_pays";
1558 1558
 		}
1559 1559
 		if (!$user->hasRight('societe', 'client', 'voir')) {
1560
-			$sql .= ", " . $this->db->prefix() . "societe_commerciaux as sc";
1560
+			$sql .= ", ".$this->db->prefix()."societe_commerciaux as sc";
1561 1561
 		}
1562
-		$sql .= " WHERE s.entity IN (" . getEntity('societe') . ")";
1562
+		$sql .= " WHERE s.entity IN (".getEntity('societe').")";
1563 1563
 		if (!empty($user->socid)) {
1564
-			$sql .= " AND s.rowid = " . ((int) $user->socid);
1564
+			$sql .= " AND s.rowid = ".((int) $user->socid);
1565 1565
 		}
1566 1566
 		if ($filter) {
1567 1567
 			// $filter is safe because, if it contains '(' or ')', it has been sanitized by testSqlAndScriptInject() and forgeSQLFromUniversalSearchCriteria()
1568 1568
 			// if not, by testSqlAndScriptInject() only.
1569
-			$sql .= " AND (" . $filter . ")";
1569
+			$sql .= " AND (".$filter.")";
1570 1570
 		}
1571 1571
 		if (!$user->hasRight('societe', 'client', 'voir')) {
1572
-			$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " . ((int) $user->id);
1572
+			$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
1573 1573
 		}
1574 1574
 		if (getDolGlobalString('COMPANY_HIDE_INACTIVE_IN_COMBOBOX')) {
1575 1575
 			$sql .= " AND s.status <> 0";
1576 1576
 		}
1577 1577
 		if (!empty($excludeids)) {
1578
-			$sql .= " AND s.rowid NOT IN (" . $this->db->sanitize(implode(',', $excludeids)) . ")";
1578
+			$sql .= " AND s.rowid NOT IN (".$this->db->sanitize(implode(',', $excludeids)).")";
1579 1579
 		}
1580 1580
 		// Add where from hooks
1581 1581
 		$parameters = array();
@@ -1595,17 +1595,17 @@  discard block
 block discarded – undo
1595 1595
 				if ($i > 0) {
1596 1596
 					$sql .= " AND ";
1597 1597
 				}
1598
-				$sql .= "(s.nom LIKE '" . $this->db->escape($prefix . $crit) . "%')";
1598
+				$sql .= "(s.nom LIKE '".$this->db->escape($prefix.$crit)."%')";
1599 1599
 				$i++;
1600 1600
 			}
1601 1601
 			if (count($search_crit) > 1) {
1602 1602
 				$sql .= ")";
1603 1603
 			}
1604 1604
 			if (isModEnabled('barcode')) {
1605
-				$sql .= " OR s.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
1605
+				$sql .= " OR s.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'";
1606 1606
 			}
1607
-			$sql .= " OR s.code_client LIKE '" . $this->db->escape($prefix . $filterkey) . "%' OR s.code_fournisseur LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
1608
-			$sql .= " OR s.name_alias LIKE '" . $this->db->escape($prefix . $filterkey) . "%' OR s.tva_intra LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
1607
+			$sql .= " OR s.code_client LIKE '".$this->db->escape($prefix.$filterkey)."%' OR s.code_fournisseur LIKE '".$this->db->escape($prefix.$filterkey)."%'";
1608
+			$sql .= " OR s.name_alias LIKE '".$this->db->escape($prefix.$filterkey)."%' OR s.tva_intra LIKE '".$this->db->escape($prefix.$filterkey)."%'";
1609 1609
 			$sql .= ")";
1610 1610
 		}
1611 1611
 		$sql .= $this->db->order("nom", "ASC");
@@ -1616,7 +1616,7 @@  discard block
 block discarded – undo
1616 1616
 		$resql = $this->db->query($sql);
1617 1617
 		if ($resql) {
1618 1618
 			// Construct $out and $outarray
1619
-			$out .= '<select id="' . $htmlname . '" class="flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($moreparam ? ' ' . $moreparam : '') . ' name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . '>' . "\n";
1619
+			$out .= '<select id="'.$htmlname.'" class="flat'.($morecss ? ' '.$morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').'>'."\n";
1620 1620
 
1621 1621
 			$textifempty = (($showempty && !is_numeric($showempty)) ? $langs->trans($showempty) : '');
1622 1622
 			if (getDolGlobalString('COMPANY_USE_SEARCH_TO_SELECT')) {
@@ -1629,7 +1629,7 @@  discard block
 block discarded – undo
1629 1629
 				}
1630 1630
 			}
1631 1631
 			if ($showempty) {
1632
-				$out .= '<option value="-1" data-html="' . dol_escape_htmltag('<span class="opacitymedium">' . ($textifempty ? $textifempty : '&nbsp;') . '</span>') . '">' . $textifempty . '</option>' . "\n";
1632
+				$out .= '<option value="-1" data-html="'.dol_escape_htmltag('<span class="opacitymedium">'.($textifempty ? $textifempty : '&nbsp;').'</span>').'">'.$textifempty.'</option>'."\n";
1633 1633
 			}
1634 1634
 
1635 1635
 			$companytemp = new Societe($this->db);
@@ -1642,18 +1642,18 @@  discard block
 block discarded – undo
1642 1642
 					$label = '';
1643 1643
 					if ($showcode || getDolGlobalString('SOCIETE_ADD_REF_IN_LIST')) {
1644 1644
 						if (($obj->client) && (!empty($obj->code_client))) {
1645
-							$label = $obj->code_client . ' - ';
1645
+							$label = $obj->code_client.' - ';
1646 1646
 						}
1647 1647
 						if (($obj->fournisseur) && (!empty($obj->code_fournisseur))) {
1648
-							$label .= $obj->code_fournisseur . ' - ';
1648
+							$label .= $obj->code_fournisseur.' - ';
1649 1649
 						}
1650
-						$label .= ' ' . $obj->name;
1650
+						$label .= ' '.$obj->name;
1651 1651
 					} else {
1652 1652
 						$label = $obj->name;
1653 1653
 					}
1654 1654
 
1655 1655
 					if (!empty($obj->name_alias)) {
1656
-						$label .= ' (' . $obj->name_alias . ')';
1656
+						$label .= ' ('.$obj->name_alias.')';
1657 1657
 					}
1658 1658
 
1659 1659
 					if (getDolGlobalString('SOCIETE_SHOW_VAT_IN_LIST') && !empty($obj->tva_intra)) {
@@ -1668,7 +1668,7 @@  discard block
 block discarded – undo
1668 1668
 						$companytemp->fournisseur = $obj->fournisseur;
1669 1669
 						$tmptype = $companytemp->getTypeUrl(1, '', 0, 'span');
1670 1670
 						if ($tmptype) {
1671
-							$labelhtml .= ' ' . $tmptype;
1671
+							$labelhtml .= ' '.$tmptype;
1672 1672
 						}
1673 1673
 
1674 1674
 						if ($obj->client || $obj->fournisseur) {
@@ -1678,10 +1678,10 @@  discard block
 block discarded – undo
1678 1678
 							$label .= $langs->trans("Customer");
1679 1679
 						}
1680 1680
 						if ($obj->client == 2 || $obj->client == 3) {
1681
-							$label .= ($obj->client == 3 ? ', ' : '') . $langs->trans("Prospect");
1681
+							$label .= ($obj->client == 3 ? ', ' : '').$langs->trans("Prospect");
1682 1682
 						}
1683 1683
 						if ($obj->fournisseur) {
1684
-							$label .= ($obj->client ? ', ' : '') . $langs->trans("Supplier");
1684
+							$label .= ($obj->client ? ', ' : '').$langs->trans("Supplier");
1685 1685
 						}
1686 1686
 						if ($obj->client || $obj->fournisseur) {
1687 1687
 							$label .= ')';
@@ -1689,9 +1689,9 @@  discard block
 block discarded – undo
1689 1689
 					}
1690 1690
 
1691 1691
 					if (getDolGlobalString('COMPANY_SHOW_ADDRESS_SELECTLIST')) {
1692
-						$s = ($obj->address ? ' - ' . $obj->address : '') . ($obj->zip ? ' - ' . $obj->zip : '') . ($obj->town ? ' ' . $obj->town : '');
1692
+						$s = ($obj->address ? ' - '.$obj->address : '').($obj->zip ? ' - '.$obj->zip : '').($obj->town ? ' '.$obj->town : '');
1693 1693
 						if (!empty($obj->country_code)) {
1694
-							$s .= ', ' . $langs->trans('Country' . $obj->country_code);
1694
+							$s .= ', '.$langs->trans('Country'.$obj->country_code);
1695 1695
 						}
1696 1696
 						$label .= $s;
1697 1697
 						$labelhtml .= $s;
@@ -1699,9 +1699,9 @@  discard block
 block discarded – undo
1699 1699
 
1700 1700
 					if (empty($outputmode)) {
1701 1701
 						if (in_array($obj->rowid, $selected)) {
1702
-							$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>';
1702
+							$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>';
1703 1703
 						} else {
1704
-							$out .= '<option value="' . $obj->rowid . '" data-html="' . dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1) . '">' . dol_escape_htmltag($label, 0, 0, '', 0, 1) . '</option>';
1704
+							$out .= '<option value="'.$obj->rowid.'" data-html="'.dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1).'">'.dol_escape_htmltag($label, 0, 0, '', 0, 1).'</option>';
1705 1705
 						}
1706 1706
 					} else {
1707 1707
 						array_push($outarray, array('key' => $obj->rowid, 'value' => $label, 'label' => $label, 'labelhtml' => $labelhtml));
@@ -1713,9 +1713,9 @@  discard block
 block discarded – undo
1713 1713
 					}
1714 1714
 				}
1715 1715
 			}
1716
-			$out .= '</select>' . "\n";
1716
+			$out .= '</select>'."\n";
1717 1717
 			if (!$forcecombo) {
1718
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
1718
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
1719 1719
 				$out .= ajax_combobox($htmlname, $events, getDolGlobalInt("COMPANY_USE_SEARCH_TO_SELECT"));
1720 1720
 			}
1721 1721
 		} else {
@@ -1804,7 +1804,7 @@  discard block
 block discarded – undo
1804 1804
 		}
1805 1805
 
1806 1806
 		if (!is_object($hookmanager)) {
1807
-			include_once DOL_DOCUMENT_ROOT . '/core/class/hookmanager.class.php';
1807
+			include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
1808 1808
 			$hookmanager = new HookManager($this->db);
1809 1809
 		}
1810 1810
 
@@ -1813,14 +1813,14 @@  discard block
 block discarded – undo
1813 1813
 		if ($showsoc > 0 || getDolGlobalString('CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST')) {
1814 1814
 			$sql .= ", s.nom as company, s.town AS company_town";
1815 1815
 		}
1816
-		$sql .= " FROM " . $this->db->prefix() . "socpeople as sp";
1816
+		$sql .= " FROM ".$this->db->prefix()."socpeople as sp";
1817 1817
 		if ($showsoc > 0 || getDolGlobalString('CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST')) {
1818
-			$sql .= " LEFT OUTER JOIN  " . $this->db->prefix() . "societe as s ON s.rowid=sp.fk_soc";
1818
+			$sql .= " LEFT OUTER JOIN  ".$this->db->prefix()."societe as s ON s.rowid=sp.fk_soc";
1819 1819
 		}
1820
-		$sql .= " WHERE sp.entity IN (" . getEntity('contact') . ")";
1820
+		$sql .= " WHERE sp.entity IN (".getEntity('contact').")";
1821 1821
 		$sql .= " AND ((sp.fk_user_creat = ".((int) $user->id)." AND sp.priv = 1) OR sp.priv = 0)"; // check if this is a private contact
1822 1822
 		if ($socid > 0 || $socid == -1) {
1823
-			$sql .= " AND sp.fk_soc = " . ((int) $socid);
1823
+			$sql .= " AND sp.fk_soc = ".((int) $socid);
1824 1824
 		}
1825 1825
 		if (getDolGlobalString('CONTACT_HIDE_INACTIVE_IN_COMBOBOX')) {
1826 1826
 			$sql .= " AND sp.statut <> 0";
@@ -1828,7 +1828,7 @@  discard block
 block discarded – undo
1828 1828
 		if ($filter) {
1829 1829
 			// $filter is safe because, if it contains '(' or ')', it has been sanitized by testSqlAndScriptInject() and forgeSQLFromUniversalSearchCriteria()
1830 1830
 			// if not, by testSqlAndScriptInject() only.
1831
-			$sql .= " AND (" . $filter . ")";
1831
+			$sql .= " AND (".$filter.")";
1832 1832
 		}
1833 1833
 		// Add where from hooks
1834 1834
 		$parameters = array();
@@ -1836,30 +1836,30 @@  discard block
 block discarded – undo
1836 1836
 		$sql .= $hookmanager->resPrint;
1837 1837
 		$sql .= " ORDER BY sp.lastname ASC";
1838 1838
 
1839
-		dol_syslog(get_class($this) . "::selectcontacts", LOG_DEBUG);
1839
+		dol_syslog(get_class($this)."::selectcontacts", LOG_DEBUG);
1840 1840
 		$resql = $this->db->query($sql);
1841 1841
 		if ($resql) {
1842 1842
 			$num = $this->db->num_rows($resql);
1843 1843
 
1844 1844
 			if ($htmlname != 'none' && !$options_only) {
1845
-				$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlid . '" name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . (($num || empty($disableifempty)) ? '' : ' disabled') . ($multiple ? 'multiple' : '') . ' ' . (!empty($moreparam) ? $moreparam : '') . '>';
1845
+				$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="'.$htmlid.'" name="'.$htmlname.($multiple ? '[]' : '').'" '.(($num || empty($disableifempty)) ? '' : ' disabled').($multiple ? 'multiple' : '').' '.(!empty($moreparam) ? $moreparam : '').'>';
1846 1846
 			}
1847 1847
 
1848 1848
 			if ($showempty && !is_numeric($showempty)) {
1849 1849
 				$textforempty = $showempty;
1850
-				$out .= '<option class="optiongrey" value="-1"' . (in_array(-1, $selected) ? ' selected' : '') . '>' . $textforempty . '</option>';
1850
+				$out .= '<option class="optiongrey" value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'>'.$textforempty.'</option>';
1851 1851
 			} else {
1852 1852
 				if (($showempty == 1 || ($showempty == 3 && $num > 1)) && !$multiple) {
1853
-					$out .= '<option value="0"' . (in_array(0, $selected) ? ' selected' : '') . '>&nbsp;</option>';
1853
+					$out .= '<option value="0"'.(in_array(0, $selected) ? ' selected' : '').'>&nbsp;</option>';
1854 1854
 				}
1855 1855
 				if ($showempty == 2) {
1856
-					$out .= '<option value="0"' . (in_array(0, $selected) ? ' selected' : '') . '>-- ' . $langs->trans("Internal") . ' --</option>';
1856
+					$out .= '<option value="0"'.(in_array(0, $selected) ? ' selected' : '').'>-- '.$langs->trans("Internal").' --</option>';
1857 1857
 				}
1858 1858
 			}
1859 1859
 
1860 1860
 			$i = 0;
1861 1861
 			if ($num) {
1862
-				include_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php';
1862
+				include_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
1863 1863
 				$contactstatic = new Contact($this->db);
1864 1864
 
1865 1865
 				while ($i < $num) {
@@ -1895,7 +1895,7 @@  discard block
 block discarded – undo
1895 1895
 						}
1896 1896
 						$extendedInfos = implode(' - ', $extendedInfos);
1897 1897
 						if (!empty($extendedInfos)) {
1898
-							$extendedInfos = ' - ' . $extendedInfos;
1898
+							$extendedInfos = ' - '.$extendedInfos;
1899 1899
 						}
1900 1900
 					}
1901 1901
 
@@ -1913,35 +1913,35 @@  discard block
 block discarded – undo
1913 1913
 								$disabled = 1;
1914 1914
 							}
1915 1915
 							if (!empty($selected) && in_array($obj->rowid, $selected)) {
1916
-								$out .= '<option value="' . $obj->rowid . '"';
1916
+								$out .= '<option value="'.$obj->rowid.'"';
1917 1917
 								if ($disabled) {
1918 1918
 									$out .= ' disabled';
1919 1919
 								}
1920 1920
 								$out .= ' selected>';
1921 1921
 
1922
-								$tmplabel = $contactstatic->getFullName($langs) . $extendedInfos;
1922
+								$tmplabel = $contactstatic->getFullName($langs).$extendedInfos;
1923 1923
 								if ($showfunction && $obj->poste) {
1924
-									$tmplabel .= ' (' . $obj->poste . ')';
1924
+									$tmplabel .= ' ('.$obj->poste.')';
1925 1925
 								}
1926 1926
 								if (($showsoc > 0) && $obj->company) {
1927
-									$tmplabel .= ' - (' . $obj->company . ')';
1927
+									$tmplabel .= ' - ('.$obj->company.')';
1928 1928
 								}
1929 1929
 
1930 1930
 								$out .= $tmplabel;
1931 1931
 								$out .= '</option>';
1932 1932
 							} else {
1933
-								$out .= '<option value="' . $obj->rowid . '"';
1933
+								$out .= '<option value="'.$obj->rowid.'"';
1934 1934
 								if ($disabled) {
1935 1935
 									$out .= ' disabled';
1936 1936
 								}
1937 1937
 								$out .= '>';
1938 1938
 
1939
-								$tmplabel = $contactstatic->getFullName($langs) . $extendedInfos;
1939
+								$tmplabel = $contactstatic->getFullName($langs).$extendedInfos;
1940 1940
 								if ($showfunction && $obj->poste) {
1941
-									$tmplabel .= ' (' . $obj->poste . ')';
1941
+									$tmplabel .= ' ('.$obj->poste.')';
1942 1942
 								}
1943 1943
 								if (($showsoc > 0) && $obj->company) {
1944
-									$tmplabel .= ' - (' . $obj->company . ')';
1944
+									$tmplabel .= ' - ('.$obj->company.')';
1945 1945
 								}
1946 1946
 
1947 1947
 								$out .= $tmplabel;
@@ -1949,12 +1949,12 @@  discard block
 block discarded – undo
1949 1949
 							}
1950 1950
 						} else {
1951 1951
 							if (in_array($obj->rowid, $selected)) {
1952
-								$tmplabel = $contactstatic->getFullName($langs) . $extendedInfos;
1952
+								$tmplabel = $contactstatic->getFullName($langs).$extendedInfos;
1953 1953
 								if ($showfunction && $obj->poste) {
1954
-									$tmplabel .= ' (' . $obj->poste . ')';
1954
+									$tmplabel .= ' ('.$obj->poste.')';
1955 1955
 								}
1956 1956
 								if (($showsoc > 0) && $obj->company) {
1957
-									$tmplabel .= ' - (' . $obj->company . ')';
1957
+									$tmplabel .= ' - ('.$obj->company.')';
1958 1958
 								}
1959 1959
 
1960 1960
 								$out .= $tmplabel;
@@ -1969,7 +1969,7 @@  discard block
 block discarded – undo
1969 1969
 				}
1970 1970
 			} else {
1971 1971
 				$labeltoshow = ($socid != -1) ? ($langs->trans($socid ? "NoContactDefinedForThirdParty" : "NoContactDefined")) : $langs->trans('SelectAThirdPartyFirst');
1972
-				$out .= '<option class="disabled" value="-1"' . (($showempty == 2 || $multiple) ? '' : ' selected') . ' disabled="disabled">';
1972
+				$out .= '<option class="disabled" value="-1"'.(($showempty == 2 || $multiple) ? '' : ' selected').' disabled="disabled">';
1973 1973
 				$out .= $labeltoshow;
1974 1974
 				$out .= '</option>';
1975 1975
 			}
@@ -1990,7 +1990,7 @@  discard block
 block discarded – undo
1990 1990
 			}
1991 1991
 
1992 1992
 			if ($conf->use_javascript_ajax && !$forcecombo && !$options_only) {
1993
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
1993
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
1994 1994
 				$out .= ajax_combobox($htmlid, $events, getDolGlobalInt("CONTACT_USE_SEARCH_TO_SELECT"));
1995 1995
 			}
1996 1996
 
@@ -2029,18 +2029,18 @@  discard block
 block discarded – undo
2029 2029
 		// On recherche les remises
2030 2030
 		$sql = "SELECT re.rowid, re.amount_ht, re.amount_tva, re.amount_ttc,";
2031 2031
 		$sql .= " re.description, re.fk_facture_source";
2032
-		$sql .= " FROM " . $this->db->prefix() . "societe_remise_except as re";
2033
-		$sql .= " WHERE re.fk_soc = " . (int) $socid;
2034
-		$sql .= " AND re.entity = " . $conf->entity;
2032
+		$sql .= " FROM ".$this->db->prefix()."societe_remise_except as re";
2033
+		$sql .= " WHERE re.fk_soc = ".(int) $socid;
2034
+		$sql .= " AND re.entity = ".$conf->entity;
2035 2035
 		if ($filter) {
2036
-			$sql .= " AND " . $filter;
2036
+			$sql .= " AND ".$filter;
2037 2037
 		}
2038 2038
 		$sql .= " ORDER BY re.description ASC";
2039 2039
 
2040
-		dol_syslog(get_class($this) . "::select_remises", LOG_DEBUG);
2040
+		dol_syslog(get_class($this)."::select_remises", LOG_DEBUG);
2041 2041
 		$resql = $this->db->query($sql);
2042 2042
 		if ($resql) {
2043
-			print '<select id="select_' . $htmlname . '" class="flat maxwidthonsmartphone" name="' . $htmlname . '">';
2043
+			print '<select id="select_'.$htmlname.'" class="flat maxwidthonsmartphone" name="'.$htmlname.'">';
2044 2044
 			$num = $this->db->num_rows($resql);
2045 2045
 
2046 2046
 			$qualifiedlines = $num;
@@ -2078,16 +2078,16 @@  discard block
 block discarded – undo
2078 2078
 					if (getDolGlobalString('MAIN_SHOW_FACNUMBER_IN_DISCOUNT_LIST') && !empty($obj->fk_facture_source)) {
2079 2079
 						$tmpfac = new Facture($this->db);
2080 2080
 						if ($tmpfac->fetch($obj->fk_facture_source) > 0) {
2081
-							$desc = $desc . ' - ' . $tmpfac->ref;
2081
+							$desc = $desc.' - '.$tmpfac->ref;
2082 2082
 						}
2083 2083
 					}
2084 2084
 
2085
-					print '<option value="' . $obj->rowid . '"' . $selectstring . $disabled . '>' . $desc . ' (' . price($obj->amount_ht) . ' ' . $langs->trans("HT") . ' - ' . price($obj->amount_ttc) . ' ' . $langs->trans("TTC") . ')</option>';
2085
+					print '<option value="'.$obj->rowid.'"'.$selectstring.$disabled.'>'.$desc.' ('.price($obj->amount_ht).' '.$langs->trans("HT").' - '.price($obj->amount_ttc).' '.$langs->trans("TTC").')</option>';
2086 2086
 					$i++;
2087 2087
 				}
2088 2088
 			}
2089 2089
 			print '</select>';
2090
-			print ajax_combobox('select_' . $htmlname);
2090
+			print ajax_combobox('select_'.$htmlname);
2091 2091
 
2092 2092
 			return $qualifiedlines;
2093 2093
 		} else {
@@ -2196,14 +2196,14 @@  discard block
 block discarded – undo
2196 2196
 		if ($showlabelofentity) {
2197 2197
 			$sql .= ", e.label";
2198 2198
 		}
2199
-		$sql .= " FROM " . $this->db->prefix() . "user as u";
2199
+		$sql .= " FROM ".$this->db->prefix()."user as u";
2200 2200
 		if ($showlabelofentity) {
2201
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "entity as e ON e.rowid = u.entity";
2201
+			$sql .= " LEFT JOIN ".$this->db->prefix()."entity as e ON e.rowid = u.entity";
2202 2202
 		}
2203 2203
 		// Condition here should be the same than into societe->getSalesRepresentatives().
2204 2204
 		if ($userissuperadminentityone && $force_entity != 'default') {
2205 2205
 			if (!empty($force_entity)) {
2206
-				$sql .= " WHERE u.entity IN (0, " . $this->db->sanitize($force_entity) . ")";
2206
+				$sql .= " WHERE u.entity IN (0, ".$this->db->sanitize($force_entity).")";
2207 2207
 			} else {
2208 2208
 				$sql .= " WHERE u.entity IS NOT NULL";
2209 2209
 			}
@@ -2211,18 +2211,18 @@  discard block
 block discarded – undo
2211 2211
 			if (isModEnabled('multicompany') && getDolGlobalInt('MULTICOMPANY_TRANSVERSE_MODE')) {
2212 2212
 				$sql .= " WHERE u.rowid IN (SELECT ug.fk_user FROM ".$this->db->prefix()."usergroup_user as ug WHERE ug.entity IN (".getEntity('usergroup')."))";
2213 2213
 			} else {
2214
-				$sql .= " WHERE u.entity IN (" . getEntity('user') . ")";
2214
+				$sql .= " WHERE u.entity IN (".getEntity('user').")";
2215 2215
 			}
2216 2216
 		}
2217 2217
 
2218 2218
 		if (!empty($user->socid)) {
2219
-			$sql .= " AND u.fk_soc = " . ((int) $user->socid);
2219
+			$sql .= " AND u.fk_soc = ".((int) $user->socid);
2220 2220
 		}
2221 2221
 		if (is_array($exclude) && $excludeUsers) {
2222
-			$sql .= " AND u.rowid NOT IN (" . $this->db->sanitize($excludeUsers) . ")";
2222
+			$sql .= " AND u.rowid NOT IN (".$this->db->sanitize($excludeUsers).")";
2223 2223
 		}
2224 2224
 		if ($includeUsers) {
2225
-			$sql .= " AND u.rowid IN (" . $this->db->sanitize($includeUsers) . ")";
2225
+			$sql .= " AND u.rowid IN (".$this->db->sanitize($includeUsers).")";
2226 2226
 		}
2227 2227
 		if (getDolGlobalString('USER_HIDE_INACTIVE_IN_COMBOBOX') || $notdisabled) {
2228 2228
 			$sql .= " AND u.statut <> 0";
@@ -2259,7 +2259,7 @@  discard block
 block discarded – undo
2259 2259
 			$sql .= " ORDER BY u.statut DESC, u.lastname ASC, u.firstname ASC";
2260 2260
 		}
2261 2261
 
2262
-		dol_syslog(get_class($this) . "::select_dolusers", LOG_DEBUG);
2262
+		dol_syslog(get_class($this)."::select_dolusers", LOG_DEBUG);
2263 2263
 
2264 2264
 		$resql = $this->db->query($sql);
2265 2265
 		if ($resql) {
@@ -2267,7 +2267,7 @@  discard block
 block discarded – undo
2267 2267
 			$i = 0;
2268 2268
 			if ($num) {
2269 2269
 				// do not use maxwidthonsmartphone by default. Set it by caller so auto size to 100% will work when not defined
2270
-				$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : ' minwidth200') . '" id="' . $htmlname . '" name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . ' ' . ($disabled ? ' disabled' : '') . '>';
2270
+				$out .= '<select class="flat'.($morecss ? ' '.$morecss : ' minwidth200').'" id="'.$htmlname.'" name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.($disabled ? ' disabled' : '').'>';
2271 2271
 				if ($show_empty && !$multiple) {
2272 2272
 					$textforempty = ' ';
2273 2273
 					if (!empty($conf->use_javascript_ajax)) {
@@ -2276,7 +2276,7 @@  discard block
 block discarded – undo
2276 2276
 					if (!is_numeric($show_empty)) {
2277 2277
 						$textforempty = $show_empty;
2278 2278
 					}
2279
-					$out .= '<option class="optiongrey" value="' . ($show_empty < 0 ? $show_empty : -1) . '"' . ((empty($selected) || in_array(-1, $selected)) ? ' selected' : '') . '>' . $textforempty . '</option>' . "\n";
2279
+					$out .= '<option class="optiongrey" value="'.($show_empty < 0 ? $show_empty : -1).'"'.((empty($selected) || in_array(-1, $selected)) ? ' selected' : '').'>'.$textforempty.'</option>'."\n";
2280 2280
 
2281 2281
 					$outarray[($show_empty < 0 ? $show_empty : -1)] = $textforempty;
2282 2282
 					$outarray2[($show_empty < 0 ? $show_empty : -1)] = array(
@@ -2288,13 +2288,13 @@  discard block
 block discarded – undo
2288 2288
 					);
2289 2289
 				}
2290 2290
 				if ($show_every) {
2291
-					$out .= '<option value="-2"' . ((in_array(-2, $selected)) ? ' selected' : '') . '>-- ' . $langs->trans("Everybody") . ' --</option>' . "\n";
2291
+					$out .= '<option value="-2"'.((in_array(-2, $selected)) ? ' selected' : '').'>-- '.$langs->trans("Everybody").' --</option>'."\n";
2292 2292
 
2293
-					$outarray[-2] = '-- ' . $langs->trans("Everybody") . ' --';
2293
+					$outarray[-2] = '-- '.$langs->trans("Everybody").' --';
2294 2294
 					$outarray2[-2] = array(
2295 2295
 						'id' => -2,
2296
-						'label' => '-- ' . $langs->trans("Everybody") . ' --',
2297
-						'labelhtml' => '-- ' . $langs->trans("Everybody") . ' --',
2296
+						'label' => '-- '.$langs->trans("Everybody").' --',
2297
+						'labelhtml' => '-- '.$langs->trans("Everybody").' --',
2298 2298
 						'color' => '',
2299 2299
 						'picto' => ''
2300 2300
 					);
@@ -2345,21 +2345,21 @@  discard block
 block discarded – undo
2345 2345
 					}
2346 2346
 					if ($showstatus >= 0) {
2347 2347
 						if ($obj->status == 1 && $showstatus == 1) {
2348
-							$moreinfo .= ($moreinfo ? ' - ' : ' (') . $langs->trans('Enabled');
2349
-							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . $langs->trans('Enabled');
2348
+							$moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans('Enabled');
2349
+							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').$langs->trans('Enabled');
2350 2350
 						}
2351 2351
 						if ($obj->status == 0 && $showstatus == 1) {
2352
-							$moreinfo .= ($moreinfo ? ' - ' : ' (') . $langs->trans('Disabled');
2353
-							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . $langs->trans('Disabled');
2352
+							$moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans('Disabled');
2353
+							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').$langs->trans('Disabled');
2354 2354
 						}
2355 2355
 					}
2356 2356
 					if ($showlabelofentity) {
2357 2357
 						if (empty($obj->entity)) {
2358
-							$moreinfo .= ($moreinfo ? ' - ' : ' (') . $langs->trans("AllEntities");
2359
-							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . $langs->trans("AllEntities");
2358
+							$moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans("AllEntities");
2359
+							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').$langs->trans("AllEntities");
2360 2360
 						} else {
2361 2361
 							if ($obj->entity != $conf->entity) {
2362
-								$moreinfo .= ($moreinfo ? ' - ' : ' (') . ($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined"));
2362
+								$moreinfo .= ($moreinfo ? ' - ' : ' (').($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined"));
2363 2363
 								$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined"));
2364 2364
 							}
2365 2365
 						}
@@ -2368,13 +2368,13 @@  discard block
 block discarded – undo
2368 2368
 					$moreinfohtml .= (!empty($moreinfohtml) ? ')</span>' : '');
2369 2369
 					if (!empty($disableline) && $disableline != '1') {
2370 2370
 						// Add text from $enableonlytext parameter
2371
-						$moreinfo .= ' - ' . $disableline;
2372
-						$moreinfohtml .= ' - ' . $disableline;
2371
+						$moreinfo .= ' - '.$disableline;
2372
+						$moreinfohtml .= ' - '.$disableline;
2373 2373
 					}
2374 2374
 					$labeltoshow .= $moreinfo;
2375 2375
 					$labeltoshowhtml .= $moreinfohtml;
2376 2376
 
2377
-					$out .= '<option value="' . $obj->rowid . '"';
2377
+					$out .= '<option value="'.$obj->rowid.'"';
2378 2378
 					if (!empty($disableline)) {
2379 2379
 						$out .= ' disabled';
2380 2380
 					}
@@ -2383,7 +2383,7 @@  discard block
 block discarded – undo
2383 2383
 					}
2384 2384
 					$out .= ' data-html="';
2385 2385
 
2386
-					$outhtml = $userstatic->getNomUrl(-3, '', 0, 1, 24, 1, 'login', '', 1) . ' ';
2386
+					$outhtml = $userstatic->getNomUrl(-3, '', 0, 1, 24, 1, 'login', '', 1).' ';
2387 2387
 					if ($showstatus >= 0 && $obj->status == 0) {
2388 2388
 						$outhtml .= '<strike class="opacitymediumxxx">';
2389 2389
 					}
@@ -2398,7 +2398,7 @@  discard block
 block discarded – undo
2398 2398
 					$out .= $labeltoshow;
2399 2399
 					$out .= '</option>';
2400 2400
 
2401
-					$outarray[$userstatic->id] = $userstatic->getFullName($langs, $fullNameMode, -1, $maxlength) . $moreinfo;
2401
+					$outarray[$userstatic->id] = $userstatic->getFullName($langs, $fullNameMode, -1, $maxlength).$moreinfo;
2402 2402
 					$outarray2[$userstatic->id] = array(
2403 2403
 						'id' => $userstatic->id,
2404 2404
 						'label' => $labeltoshow,
@@ -2410,14 +2410,14 @@  discard block
 block discarded – undo
2410 2410
 					$i++;
2411 2411
 				}
2412 2412
 			} else {
2413
-				$out .= '<select class="flat" id="' . $htmlname . '" name="' . $htmlname . '" disabled>';
2414
-				$out .= '<option value="">' . $langs->trans("None") . '</option>';
2413
+				$out .= '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'" disabled>';
2414
+				$out .= '<option value="">'.$langs->trans("None").'</option>';
2415 2415
 			}
2416 2416
 			$out .= '</select>';
2417 2417
 
2418 2418
 			if ($num && !$forcecombo) {
2419 2419
 				// Enhance with select2
2420
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
2420
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
2421 2421
 				$out .= ajax_combobox($htmlname);
2422 2422
 			}
2423 2423
 		} else {
@@ -2494,7 +2494,7 @@  discard block
 block discarded – undo
2494 2494
 			$out .= $userstatic->getNomUrl(-1);
2495 2495
 			if ($i == 0) {
2496 2496
 				$ownerid = $value['id'];
2497
-				$out .= ' (' . $langs->trans("Owner") . ')';
2497
+				$out .= ' ('.$langs->trans("Owner").')';
2498 2498
 			}
2499 2499
 			// Add picto to delete owner/assignee
2500 2500
 			if ($nbassignetouser > 1 && $action != 'view') {
@@ -2505,7 +2505,7 @@  discard block
 block discarded – undo
2505 2505
 						$canremoveassignee = 0;
2506 2506
 					}
2507 2507
 					if (!$user->hasRight('agenda', 'allactions', 'create')) {
2508
-						$canremoveassignee = 0;		// Can't remove the owner
2508
+						$canremoveassignee = 0; // Can't remove the owner
2509 2509
 					}
2510 2510
 				} else {
2511 2511
 					// We are not on the owner of the event but on a secondary assignee
@@ -2513,14 +2513,14 @@  discard block
 block discarded – undo
2513 2513
 				if ($canremoveassignee) {
2514 2514
 					// If user has all permission, he should be ableto remove a assignee.
2515 2515
 					// If user has not all permission, he can onlyremove assignee of other (he can't remove itself)
2516
-					$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 . '">';
2516
+					$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.'">';
2517 2517
 				}
2518 2518
 			}
2519 2519
 			// Show my availability
2520 2520
 			if ($showproperties) {
2521 2521
 				if ($ownerid == $value['id'] && is_array($listofuserid) && count($listofuserid) && in_array($ownerid, array_keys($listofuserid))) {
2522 2522
 					$out .= '<div class="myavailability inline-block">';
2523
-					$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>';
2523
+					$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>';
2524 2524
 					$out .= '</div>';
2525 2525
 				}
2526 2526
 			}
@@ -2537,15 +2537,15 @@  discard block
 block discarded – undo
2537 2537
 		// Method with no ajax
2538 2538
 		if ($action != 'view') {
2539 2539
 			$out .= '<input type="hidden" class="removedassignedhidden" name="removedassigned" value="">';
2540
-			$out .= '<script nonce="' . getNonce() . '" type="text/javascript">jQuery(document).ready(function () {';
2540
+			$out .= '<script nonce="'.getNonce().'" type="text/javascript">jQuery(document).ready(function () {';
2541 2541
 			$out .= 'jQuery(".removedassigned").click(function() { jQuery(".removedassignedhidden").val(jQuery(this).val()); });';
2542 2542
 			$out .= 'jQuery(".assignedtouser").change(function() { console.log(jQuery(".assignedtouser option:selected").val());';
2543
-			$out .= ' if (jQuery(".assignedtouser option:selected").val() > 0) { jQuery("#' . $action . 'assignedtouser").attr("disabled", false); }';
2544
-			$out .= ' else { jQuery("#' . $action . 'assignedtouser").attr("disabled", true); }';
2543
+			$out .= ' if (jQuery(".assignedtouser option:selected").val() > 0) { jQuery("#'.$action.'assignedtouser").attr("disabled", false); }';
2544
+			$out .= ' else { jQuery("#'.$action.'assignedtouser").attr("disabled", true); }';
2545 2545
 			$out .= '});';
2546 2546
 			$out .= '})</script>';
2547 2547
 			$out .= $this->select_dolusers('', $htmlname, $show_empty, $exclude, $disabled, $include, $enableonly, $force_entity, $maxlength, $showstatus, $morefilter);
2548
-			$out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="' . $action . 'assignedtouser" name="' . $action . 'assignedtouser" value="' . dol_escape_htmltag($langs->trans("Add")) . '">';
2548
+			$out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="'.$action.'assignedtouser" name="'.$action.'assignedtouser" value="'.dol_escape_htmltag($langs->trans("Add")).'">';
2549 2549
 			$out .= '<br>';
2550 2550
 		}
2551 2551
 
@@ -2604,13 +2604,13 @@  discard block
 block discarded – undo
2604 2604
 			$resourcestatic->fetch($value['id']);
2605 2605
 			$out .= $resourcestatic->getNomUrl(-1);
2606 2606
 			if ($nbassignetoresource >= 1 && $action != 'view') {
2607
-				$out .= ' <input type="image" style="border: 0px;" src="' . img_picto($langs->trans("Remove"), 'delete', '', 0, 1) . '" value="' . $resourcestatic->id . '" class="removedassignedresource reposition" id="removedassignedresource_' . $resourcestatic->id . '" name="removedassignedresource_' . $resourcestatic->id . '">';
2607
+				$out .= ' <input type="image" style="border: 0px;" src="'.img_picto($langs->trans("Remove"), 'delete', '', 0, 1).'" value="'.$resourcestatic->id.'" class="removedassignedresource reposition" id="removedassignedresource_'.$resourcestatic->id.'" name="removedassignedresource_'.$resourcestatic->id.'">';
2608 2608
 			}
2609 2609
 			// Show my availability
2610 2610
 			if ($showproperties) {
2611 2611
 				if (is_array($listofresourceid) && count($listofresourceid)) {
2612 2612
 					$out .= '<div class="myavailability inline-block">';
2613
-					$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>';
2613
+					$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>';
2614 2614
 					$out .= '</div>';
2615 2615
 				}
2616 2616
 			}
@@ -2627,11 +2627,11 @@  discard block
 block discarded – undo
2627 2627
 		// Method with no ajax
2628 2628
 		if ($action != 'view') {
2629 2629
 			$out .= '<input type="hidden" class="removedassignedresourcehidden" name="removedassignedresource" value="">';
2630
-			$out .= '<script nonce="' . getNonce() . '" type="text/javascript">jQuery(document).ready(function () {';
2630
+			$out .= '<script nonce="'.getNonce().'" type="text/javascript">jQuery(document).ready(function () {';
2631 2631
 			$out .= 'jQuery(".removedassignedresource").click(function() { jQuery(".removedassignedresourcehidden").val(jQuery(this).val()); });';
2632 2632
 			$out .= 'jQuery(".assignedtoresource").change(function() { console.log(jQuery(".assignedtoresource option:selected").val());';
2633
-			$out .= ' if (jQuery(".assignedtoresource option:selected").val() > 0) { jQuery("#' . $action . 'assignedtoresource").attr("disabled", false); }';
2634
-			$out .= ' else { jQuery("#' . $action . 'assignedtoresource").attr("disabled", true); }';
2633
+			$out .= ' if (jQuery(".assignedtoresource option:selected").val() > 0) { jQuery("#'.$action.'assignedtoresource").attr("disabled", false); }';
2634
+			$out .= ' else { jQuery("#'.$action.'assignedtoresource").attr("disabled", true); }';
2635 2635
 			$out .= '});';
2636 2636
 			$out .= '})</script>';
2637 2637
 
@@ -2639,7 +2639,7 @@  discard block
 block discarded – undo
2639 2639
 			$out .= img_picto('', 'resource', 'class="pictofixedwidth"');
2640 2640
 			$out .= $formresources->select_resource_list(0, $htmlname, [], 1, 1, 0, $events, array(), 2, 0);
2641 2641
 			//$out .= $this->select_dolusers('', $htmlname, $show_empty, $exclude, $disabled, $include, $enableonly, $force_entity, $maxlength, $showstatus, $morefilter);
2642
-			$out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="' . $action . 'assignedtoresource" name="' . $action . 'assignedtoresource" value="' . dol_escape_htmltag($langs->trans("Add")) . '">';
2642
+			$out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="'.$action.'assignedtoresource" name="'.$action.'assignedtoresource" value="'.dol_escape_htmltag($langs->trans("Add")).'">';
2643 2643
 			$out .= '<br>';
2644 2644
 		}
2645 2645
 
@@ -2702,7 +2702,7 @@  discard block
 block discarded – undo
2702 2702
 			$placeholder = (is_numeric($showempty) ? '' : 'placeholder="'.dolPrintHTML($showempty).'"');
2703 2703
 
2704 2704
 			if ($selected && empty($selected_input_value)) {
2705
-				require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
2705
+				require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
2706 2706
 				$producttmpselect = new Product($this->db);
2707 2707
 				$producttmpselect->fetch($selected);
2708 2708
 				$selected_input_value = $producttmpselect->ref;
@@ -2717,21 +2717,21 @@  discard block
 block discarded – undo
2717 2717
 				}
2718 2718
 			}
2719 2719
 			// mode=1 means customers products
2720
-			$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;
2720
+			$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;
2721 2721
 			if ((int) $warehouseId > 0) {
2722
-				$urloption .= '&warehouseid=' . (int) $warehouseId;
2722
+				$urloption .= '&warehouseid='.(int) $warehouseId;
2723 2723
 			}
2724 2724
 
2725
-			$out .= ajax_autocompleter((string) $selected, $htmlname, DOL_URL_ROOT . '/product/ajax/products.php', $urloption, getDolGlobalInt('PRODUIT_USE_SEARCH_TO_SELECT'), getDolGlobalInt('PRODUCT_SEARCH_AUTO_SELECT_IF_ONLY_ONE', 1), $ajaxoptions);
2725
+			$out .= ajax_autocompleter((string) $selected, $htmlname, DOL_URL_ROOT.'/product/ajax/products.php', $urloption, getDolGlobalInt('PRODUIT_USE_SEARCH_TO_SELECT'), getDolGlobalInt('PRODUCT_SEARCH_AUTO_SELECT_IF_ONLY_ONE', 1), $ajaxoptions);
2726 2726
 
2727 2727
 			if (isModEnabled('variants') && is_array($selected_combinations)) {
2728 2728
 				// Code to automatically insert with javascript the select of attributes under the select of product
2729 2729
 				// when a parent of variant has been selected.
2730 2730
 				$out .= '
2731 2731
 				<!-- script to auto show attributes select tags if a variant was selected -->
2732
-				<script nonce="' . getNonce() . '">
2732
+				<script nonce="' . getNonce().'">
2733 2733
 					// auto show attributes fields
2734
-					selected = ' . json_encode($selected_combinations) . ';
2734
+					selected = ' . json_encode($selected_combinations).';
2735 2735
 					combvalues = {};
2736 2736
 
2737 2737
 					jQuery(document).ready(function () {
@@ -2742,7 +2742,7 @@  discard block
 block discarded – undo
2742 2742
 							}
2743 2743
 						});
2744 2744
 
2745
-						jQuery("input#' . $htmlname . '").change(function () {
2745
+						jQuery("input#' . $htmlname.'").change(function () {
2746 2746
 
2747 2747
 							if (!jQuery(this).val()) {
2748 2748
 								jQuery(\'div#attributes_box\').empty();
@@ -2751,7 +2751,7 @@  discard block
 block discarded – undo
2751 2751
 
2752 2752
 							console.log("A change has started. We get variants fields to inject html select");
2753 2753
 
2754
-							jQuery.getJSON("' . DOL_URL_ROOT . '/variants/ajax/getCombinations.php", {
2754
+							jQuery.getJSON("' . DOL_URL_ROOT.'/variants/ajax/getCombinations.php", {
2755 2755
 								id: jQuery(this).val()
2756 2756
 							}, function (data) {
2757 2757
 								jQuery(\'div#attributes_box\').empty();
@@ -2794,22 +2794,22 @@  discard block
 block discarded – undo
2794 2794
 							})
2795 2795
 						});
2796 2796
 
2797
-						' . ($selected ? 'jQuery("input#' . $htmlname . '").change();' : '') . '
2797
+						' . ($selected ? 'jQuery("input#'.$htmlname.'").change();' : '').'
2798 2798
 					});
2799 2799
 				</script>
2800 2800
                 ';
2801 2801
 			}
2802 2802
 
2803 2803
 			if (empty($hidelabel)) {
2804
-				$placeholder = ' placeholder="' . dolPrintHTMLForAttribute($langs->trans("RefOrLabel")) . '"';
2804
+				$placeholder = ' placeholder="'.dolPrintHTMLForAttribute($langs->trans("RefOrLabel")).'"';
2805 2805
 			} elseif ($hidelabel > 1) {
2806
-				$placeholder = ' placeholder="' . dolPrintHTMLForAttribute($langs->trans("RefOrLabel")) . '"';
2806
+				$placeholder = ' placeholder="'.dolPrintHTMLForAttribute($langs->trans("RefOrLabel")).'"';
2807 2807
 				if ($hidelabel == 2) {
2808 2808
 					$out .= img_picto($langs->trans("Search"), 'search');
2809 2809
 				}
2810 2810
 			}
2811 2811
 
2812
-			$out .= '<input type="text" class="minwidth100' . ($morecss ? ' ' . $morecss : '') . '" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />';
2812
+			$out .= '<input type="text" class="minwidth100'.($morecss ? ' '.$morecss : '').'" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />';
2813 2813
 			if ($hidelabel == 3) {
2814 2814
 				$out .= img_picto($langs->trans("Search"), 'search');
2815 2815
 			}
@@ -2846,33 +2846,33 @@  discard block
 block discarded – undo
2846 2846
 		// phpcs:enable
2847 2847
 		global $db;
2848 2848
 
2849
-		require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
2849
+		require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
2850 2850
 
2851 2851
 		$error = 0;
2852 2852
 		$out = '';
2853 2853
 
2854 2854
 		if (!$forcecombo) {
2855
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
2855
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
2856 2856
 			$events = array();
2857 2857
 			$out .= ajax_combobox($htmlname, $events, getDolGlobalInt("PRODUIT_USE_SEARCH_TO_SELECT"));
2858 2858
 		}
2859 2859
 
2860
-		$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
2860
+		$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
2861 2861
 
2862 2862
 		$sql = 'SELECT b.rowid, b.ref, b.label, b.fk_product';
2863
-		$sql .= ' FROM ' . MAIN_DB_PREFIX . 'bom_bom as b';
2864
-		$sql .= ' WHERE b.entity IN (' . getEntity('bom') . ')';
2863
+		$sql .= ' FROM '.MAIN_DB_PREFIX.'bom_bom as b';
2864
+		$sql .= ' WHERE b.entity IN ('.getEntity('bom').')';
2865 2865
 		if (!empty($status)) {
2866
-			$sql .= ' AND status = ' . (int) $status;
2866
+			$sql .= ' AND status = '.(int) $status;
2867 2867
 		}
2868 2868
 		if (!empty($type)) {
2869
-			$sql .= ' AND bomtype = ' . (int) $type;
2869
+			$sql .= ' AND bomtype = '.(int) $type;
2870 2870
 		}
2871 2871
 		if (!empty($TProducts)) {
2872
-			$sql .= ' AND fk_product IN (' . $this->db->sanitize(implode(',', $TProducts)) . ')';
2872
+			$sql .= ' AND fk_product IN ('.$this->db->sanitize(implode(',', $TProducts)).')';
2873 2873
 		}
2874 2874
 		if (!empty($limit)) {
2875
-			$sql .= ' LIMIT ' . (int) $limit;
2875
+			$sql .= ' LIMIT '.(int) $limit;
2876 2876
 		}
2877 2877
 		$resql = $db->query($sql);
2878 2878
 		if ($resql) {
@@ -2886,11 +2886,11 @@  discard block
 block discarded – undo
2886 2886
 			while ($obj = $db->fetch_object($resql)) {
2887 2887
 				$product = new Product($db);
2888 2888
 				$res = $product->fetch($obj->fk_product);
2889
-				$out .= '<option value="' . $obj->rowid . '"';
2889
+				$out .= '<option value="'.$obj->rowid.'"';
2890 2890
 				if ($obj->rowid == $selected) {
2891 2891
 					$out .= 'selected';
2892 2892
 				}
2893
-				$out .= '>' . $obj->ref . ' - ' . $product->label . ' - ' . $obj->label . '</option>';
2893
+				$out .= '>'.$obj->ref.' - '.$product->label.' - '.$obj->label.'</option>';
2894 2894
 			}
2895 2895
 		} else {
2896 2896
 			$error++;
@@ -2948,7 +2948,7 @@  discard block
 block discarded – undo
2948 2948
 
2949 2949
 		$warehouseStatusArray = array();
2950 2950
 		if (!empty($warehouseStatus)) {
2951
-			require_once DOL_DOCUMENT_ROOT . '/product/stock/class/entrepot.class.php';
2951
+			require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php';
2952 2952
 			if (preg_match('/warehouseclosed/', $warehouseStatus)) {
2953 2953
 				$warehouseStatusArray[] = Entrepot::STATUS_CLOSED;
2954 2954
 			}
@@ -2962,9 +2962,9 @@  discard block
 block discarded – undo
2962 2962
 
2963 2963
 		$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";
2964 2964
 		if (count($warehouseStatusArray)) {
2965
-			$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
2965
+			$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
2966 2966
 		} else {
2967
-			$selectFieldsGrouped = ", " . $this->db->ifsql("p.stock IS NULL", 0, "p.stock") . " AS stock";
2967
+			$selectFieldsGrouped = ", ".$this->db->ifsql("p.stock IS NULL", 0, "p.stock")." AS stock";
2968 2968
 		}
2969 2969
 
2970 2970
 		$sql = "SELECT ";
@@ -2980,9 +2980,9 @@  discard block
 block discarded – undo
2980 2980
 
2981 2981
 		if (getDolGlobalString('PRODUCT_SORT_BY_CATEGORY')) {
2982 2982
 			//Product category
2983
-			$sql .= ", (SELECT " . $this->db->prefix() . "categorie_product.fk_categorie
2984
-						FROM " . $this->db->prefix() . "categorie_product
2985
-						WHERE " . $this->db->prefix() . "categorie_product.fk_product=p.rowid
2983
+			$sql .= ", (SELECT ".$this->db->prefix()."categorie_product.fk_categorie
2984
+						FROM " . $this->db->prefix()."categorie_product
2985
+						WHERE " . $this->db->prefix()."categorie_product.fk_product=p.rowid
2986 2986
 						LIMIT 1
2987 2987
 				) AS categorie_product_id ";
2988 2988
 		}
@@ -3008,15 +3008,15 @@  discard block
 block discarded – undo
3008 3008
 		}
3009 3009
 		// Price by quantity
3010 3010
 		if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) {
3011
-			$sql .= ", (SELECT pp.rowid FROM " . $this->db->prefix() . "product_price as pp WHERE pp.fk_product = p.rowid";
3011
+			$sql .= ", (SELECT pp.rowid FROM ".$this->db->prefix()."product_price as pp WHERE pp.fk_product = p.rowid";
3012 3012
 			if ($price_level >= 1 && getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) {
3013
-				$sql .= " AND price_level = " . ((int) $price_level);
3013
+				$sql .= " AND price_level = ".((int) $price_level);
3014 3014
 			}
3015 3015
 			$sql .= " ORDER BY date_price";
3016 3016
 			$sql .= " DESC LIMIT 1) as price_rowid";
3017
-			$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
3017
+			$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
3018 3018
 			if ($price_level >= 1 && getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) {
3019
-				$sql .= " AND price_level = " . ((int) $price_level);
3019
+				$sql .= " AND price_level = ".((int) $price_level);
3020 3020
 			}
3021 3021
 			$sql .= " ORDER BY date_price";
3022 3022
 			$sql .= " DESC LIMIT 1) as price_by_qty";
@@ -3026,7 +3026,7 @@  discard block
 block discarded – undo
3026 3026
 		$sql .= " FROM ".$this->db->prefix()."product as p";
3027 3027
 
3028 3028
 		if (getDolGlobalString('MAIN_SEARCH_PRODUCT_FORCE_INDEX')) {
3029
-			$sql .= " USE INDEX (" . $this->db->sanitize(getDolGlobalString('MAIN_PRODUCT_FORCE_INDEX')) . ")";
3029
+			$sql .= " USE INDEX (".$this->db->sanitize(getDolGlobalString('MAIN_PRODUCT_FORCE_INDEX')).")";
3030 3030
 		}
3031 3031
 
3032 3032
 		// Add from (left join) from hooks
@@ -3035,48 +3035,48 @@  discard block
 block discarded – undo
3035 3035
 		$sql .= $hookmanager->resPrint;
3036 3036
 
3037 3037
 		if (count($warehouseStatusArray)) {
3038
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "product_stock as ps on ps.fk_product = p.rowid";
3039
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "entrepot as e on ps.fk_entrepot = e.rowid AND e.entity IN (" . getEntity('stock') . ")";
3040
-			$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.
3038
+			$sql .= " LEFT JOIN ".$this->db->prefix()."product_stock as ps on ps.fk_product = p.rowid";
3039
+			$sql .= " LEFT JOIN ".$this->db->prefix()."entrepot as e on ps.fk_entrepot = e.rowid AND e.entity IN (".getEntity('stock').")";
3040
+			$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.
3041 3041
 		}
3042 3042
 
3043 3043
 		//Price by customer
3044 3044
 		if ((getDolGlobalString('PRODUIT_CUSTOMER_PRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) && !empty($socid)) {
3045
-			$sql .= " LEFT JOIN  " . $this->db->prefix() . "product_customer_price as pcp ON pcp.fk_soc=" . ((int) $socid) . " AND pcp.fk_product=p.rowid";
3045
+			$sql .= " LEFT JOIN  ".$this->db->prefix()."product_customer_price as pcp ON pcp.fk_soc=".((int) $socid)." AND pcp.fk_product=p.rowid";
3046 3046
 		}
3047 3047
 		// Units
3048 3048
 		if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
3049
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "c_units u ON u.rowid = p.fk_unit";
3049
+			$sql .= " LEFT JOIN ".$this->db->prefix()."c_units u ON u.rowid = p.fk_unit";
3050 3050
 		}
3051 3051
 		// Multilang : we add translation
3052 3052
 		if (getDolGlobalInt('MAIN_MULTILANGS')) {
3053
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "product_lang as pl ON pl.fk_product = p.rowid ";
3053
+			$sql .= " LEFT JOIN ".$this->db->prefix()."product_lang as pl ON pl.fk_product = p.rowid ";
3054 3054
 			if (getDolGlobalString('PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE') && !empty($socid)) {
3055
-				require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
3055
+				require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
3056 3056
 				$soc = new Societe($this->db);
3057 3057
 				$result = $soc->fetch($socid);
3058 3058
 				if ($result > 0 && !empty($soc->default_lang)) {
3059
-					$sql .= " AND pl.lang = '" . $this->db->escape($soc->default_lang) . "'";
3059
+					$sql .= " AND pl.lang = '".$this->db->escape($soc->default_lang)."'";
3060 3060
 				} else {
3061
-					$sql .= " AND pl.lang = '" . $this->db->escape($langs->getDefaultLang()) . "'";
3061
+					$sql .= " AND pl.lang = '".$this->db->escape($langs->getDefaultLang())."'";
3062 3062
 				}
3063 3063
 			} else {
3064
-				$sql .= " AND pl.lang = '" . $this->db->escape($langs->getDefaultLang()) . "'";
3064
+				$sql .= " AND pl.lang = '".$this->db->escape($langs->getDefaultLang())."'";
3065 3065
 			}
3066 3066
 		}
3067 3067
 
3068 3068
 		if (getDolGlobalString('PRODUIT_ATTRIBUTES_HIDECHILD')) {
3069
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "product_attribute_combination pac ON pac.fk_product_child = p.rowid";
3069
+			$sql .= " LEFT JOIN ".$this->db->prefix()."product_attribute_combination pac ON pac.fk_product_child = p.rowid";
3070 3070
 		}
3071 3071
 
3072
-		$sql .= ' WHERE p.entity IN (' . getEntity('product') . ')';
3072
+		$sql .= ' WHERE p.entity IN ('.getEntity('product').')';
3073 3073
 
3074 3074
 		if (getDolGlobalString('PRODUIT_ATTRIBUTES_HIDECHILD')) {
3075 3075
 			$sql .= " AND pac.rowid IS NULL";
3076 3076
 		}
3077 3077
 
3078 3078
 		if ($finished == 0) {
3079
-			$sql .= " AND p.finished = " . ((int) $finished);
3079
+			$sql .= " AND p.finished = ".((int) $finished);
3080 3080
 		} elseif ($finished == 1) {
3081 3081
 			$sql .= " AND p.finished = ".((int) $finished);
3082 3082
 		}
@@ -3084,11 +3084,11 @@  discard block
 block discarded – undo
3084 3084
 			$sql .= " AND p.tosell = ".((int) $status);
3085 3085
 		}
3086 3086
 		if ($status_purchase >= 0) {
3087
-			$sql .= " AND p.tobuy = " . ((int) $status_purchase);
3087
+			$sql .= " AND p.tobuy = ".((int) $status_purchase);
3088 3088
 		}
3089 3089
 		// Filter by product type
3090 3090
 		if (strval($filtertype) != '') {
3091
-			$sql .= " AND p.fk_product_type = " . ((int) $filtertype);
3091
+			$sql .= " AND p.fk_product_type = ".((int) $filtertype);
3092 3092
 		} elseif (!isModEnabled('product')) { // when product module is disabled, show services only
3093 3093
 			$sql .= " AND p.fk_product_type = 1";
3094 3094
 		} elseif (!isModEnabled('service')) { // when service module is disabled, show products only
@@ -3096,7 +3096,7 @@  discard block
 block discarded – undo
3096 3096
 		}
3097 3097
 
3098 3098
 		if ((int) $warehouseId > 0) {
3099
-			$sql .= " AND EXISTS (SELECT psw.fk_product FROM " . $this->db->prefix() . "product_stock as psw WHERE psw.reel>0 AND psw.fk_entrepot=".(int) $warehouseId." AND psw.fk_product = p.rowid)";
3099
+			$sql .= " AND EXISTS (SELECT psw.fk_product FROM ".$this->db->prefix()."product_stock as psw WHERE psw.reel>0 AND psw.fk_entrepot=".(int) $warehouseId." AND psw.fk_product = p.rowid)";
3100 3100
 		}
3101 3101
 
3102 3102
 		// Add where from hooks
@@ -3105,7 +3105,7 @@  discard block
 block discarded – undo
3105 3105
 		$sql .= $hookmanager->resPrint;
3106 3106
 		// Add criteria on ref/label
3107 3107
 		if ($filterkey != '') {
3108
-			$sqlSupplierSearch= '';
3108
+			$sqlSupplierSearch = '';
3109 3109
 
3110 3110
 			$sql .= ' AND (';
3111 3111
 			$prefix = !getDolGlobalString('PRODUCT_DONOTSEARCH_ANYWHERE') ? '%' : ''; // Can use index if PRODUCT_DONOTSEARCH_ANYWHERE is on
@@ -3119,24 +3119,24 @@  discard block
 block discarded – undo
3119 3119
 				if ($i > 0) {
3120 3120
 					$sql .= " AND ";
3121 3121
 				}
3122
-				$sql .= "(p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%' OR p.label LIKE '" . $this->db->escape($prefix . $crit) . "%'";
3122
+				$sql .= "(p.ref LIKE '".$this->db->escape($prefix.$crit)."%' OR p.label LIKE '".$this->db->escape($prefix.$crit)."%'";
3123 3123
 				if (getDolGlobalInt('MAIN_MULTILANGS')) {
3124
-					$sql .= " OR pl.label LIKE '" . $this->db->escape($prefix . $crit) . "%'";
3124
+					$sql .= " OR pl.label LIKE '".$this->db->escape($prefix.$crit)."%'";
3125 3125
 				}
3126 3126
 				if ((getDolGlobalString('PRODUIT_CUSTOMER_PRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) && !empty($socid)) {
3127
-					$sql .= " OR pcp.ref_customer LIKE '" . $this->db->escape($prefix . $crit) . "%'";
3127
+					$sql .= " OR pcp.ref_customer LIKE '".$this->db->escape($prefix.$crit)."%'";
3128 3128
 				}
3129 3129
 				if (getDolGlobalString('PRODUCT_AJAX_SEARCH_ON_DESCRIPTION')) {
3130
-					$sql .= " OR p.description LIKE '" . $this->db->escape($prefix . $crit) . "%'";
3130
+					$sql .= " OR p.description LIKE '".$this->db->escape($prefix.$crit)."%'";
3131 3131
 					if (getDolGlobalInt('MAIN_MULTILANGS')) {
3132
-						$sql .= " OR pl.description LIKE '" . $this->db->escape($prefix . $crit) . "%'";
3132
+						$sql .= " OR pl.description LIKE '".$this->db->escape($prefix.$crit)."%'";
3133 3133
 					}
3134 3134
 				}
3135 3135
 
3136 3136
 				// include search in supplier ref
3137 3137
 				if (getDolGlobalString('MAIN_SEARCH_PRODUCT_BY_FOURN_REF')) {
3138
-					$sqlSupplierSearch .= !empty($sqlSupplierSearch) ? ' OR ':'';
3139
-					$sqlSupplierSearch .= " pfp.ref_fourn LIKE '" . $this->db->escape($prefix . $crit) . "%'";
3138
+					$sqlSupplierSearch .= !empty($sqlSupplierSearch) ? ' OR ' : '';
3139
+					$sqlSupplierSearch .= " pfp.ref_fourn LIKE '".$this->db->escape($prefix.$crit)."%'";
3140 3140
 				}
3141 3141
 				$sql .= ")";
3142 3142
 				$i++;
@@ -3145,12 +3145,12 @@  discard block
 block discarded – undo
3145 3145
 				$sql .= ")";
3146 3146
 			}
3147 3147
 			if (isModEnabled('barcode')) {
3148
-				$sql .= " OR p.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
3148
+				$sql .= " OR p.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'";
3149 3149
 			}
3150 3150
 
3151 3151
 			// include search in supplier ref
3152 3152
 			if (getDolGlobalString('MAIN_SEARCH_PRODUCT_BY_FOURN_REF')) {
3153
-				$sql .= " OR EXISTS (SELECT pfp.fk_product FROM " . $this->db->prefix() . "product_fournisseur_price as pfp WHERE p.rowid = pfp.fk_product";
3153
+				$sql .= " OR EXISTS (SELECT pfp.fk_product FROM ".$this->db->prefix()."product_fournisseur_price as pfp WHERE p.rowid = pfp.fk_product";
3154 3154
 				$sql .= " AND (";
3155 3155
 				$sql .= $sqlSupplierSearch;
3156 3156
 				$sql .= "))";
@@ -3159,7 +3159,7 @@  discard block
 block discarded – undo
3159 3159
 			$sql .= ')';
3160 3160
 		}
3161 3161
 		if (count($warehouseStatusArray)) {
3162
-			$sql .= " GROUP BY " . $selectFields;
3162
+			$sql .= " GROUP BY ".$selectFields;
3163 3163
 		}
3164 3164
 
3165 3165
 		//Sort by category
@@ -3174,23 +3174,23 @@  discard block
 block discarded – undo
3174 3174
 		$sql .= $this->db->plimit($limit, 0);
3175 3175
 
3176 3176
 		// Build output string
3177
-		dol_syslog(get_class($this) . "::select_produits_list search products", LOG_DEBUG);
3177
+		dol_syslog(get_class($this)."::select_produits_list search products", LOG_DEBUG);
3178 3178
 		$result = $this->db->query($sql);
3179 3179
 		if ($result) {
3180
-			require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
3181
-			require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
3182
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/product.lib.php';
3180
+			require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
3181
+			require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
3182
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php';
3183 3183
 
3184 3184
 			$num = $this->db->num_rows($result);
3185 3185
 
3186 3186
 			$events = array();
3187 3187
 
3188 3188
 			if (!$forcecombo) {
3189
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
3189
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
3190 3190
 				$out .= ajax_combobox($htmlname, $events, getDolGlobalInt("PRODUIT_USE_SEARCH_TO_SELECT"));
3191 3191
 			}
3192 3192
 
3193
-			$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
3193
+			$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
3194 3194
 
3195 3195
 			$textifempty = '';
3196 3196
 			// Do not use textifempty = ' ' or '&nbsp;' here, or search on key will search on ' key'.
@@ -3207,7 +3207,7 @@  discard block
 block discarded – undo
3207 3207
 				}
3208 3208
 			}
3209 3209
 			if ($showempty) {
3210
-				$out .= '<option value="-1" selected>' . ($textifempty ? $textifempty : '&nbsp;') . '</option>';
3210
+				$out .= '<option value="-1" selected>'.($textifempty ? $textifempty : '&nbsp;').'</option>';
3211 3211
 			}
3212 3212
 
3213 3213
 			$i = 0;
@@ -3218,11 +3218,11 @@  discard block
 block discarded – undo
3218 3218
 
3219 3219
 				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
3220 3220
 					$sql = "SELECT rowid, quantity, price, unitprice, remise_percent, remise, price_base_type";
3221
-					$sql .= " FROM " . $this->db->prefix() . "product_price_by_qty";
3222
-					$sql .= " WHERE fk_product_price = " . ((int) $objp->price_rowid);
3221
+					$sql .= " FROM ".$this->db->prefix()."product_price_by_qty";
3222
+					$sql .= " WHERE fk_product_price = ".((int) $objp->price_rowid);
3223 3223
 					$sql .= " ORDER BY quantity ASC";
3224 3224
 
3225
-					dol_syslog(get_class($this) . "::select_produits_list search prices by qty", LOG_DEBUG);
3225
+					dol_syslog(get_class($this)."::select_produits_list search prices by qty", LOG_DEBUG);
3226 3226
 					$result2 = $this->db->query($sql);
3227 3227
 					if ($result2) {
3228 3228
 						$nb_prices = $this->db->num_rows($result2);
@@ -3260,7 +3260,7 @@  discard block
 block discarded – undo
3260 3260
 						$price_product = new Product($this->db);
3261 3261
 						$price_product->fetch($objp->rowid, '', '', 1);
3262 3262
 
3263
-						require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
3263
+						require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
3264 3264
 						$priceparser = new PriceParser($this->db);
3265 3265
 						$price_result = $priceparser->parseProduct($price_product);
3266 3266
 						if ($price_result >= 0) {
@@ -3346,7 +3346,7 @@  discard block
 block discarded – undo
3346 3346
 			$label = $objp->label_translated;
3347 3347
 		}
3348 3348
 		if (!empty($filterkey) && $filterkey != '') {
3349
-			$label = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $label, 1);
3349
+			$label = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $label, 1);
3350 3350
 		}
3351 3351
 
3352 3352
 		$outkey = $objp->rowid;
@@ -3367,32 +3367,32 @@  discard block
 block discarded – undo
3367 3367
 		$outdurationunit = $outtype == Product::TYPE_SERVICE ? substr($objp->duration, -1) : '';
3368 3368
 
3369 3369
 		if ($outorigin && getDolGlobalString('PRODUCT_SHOW_ORIGIN_IN_COMBO')) {
3370
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
3370
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
3371 3371
 		}
3372 3372
 
3373 3373
 		// Units
3374 3374
 		$outvalUnits = '';
3375 3375
 		if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
3376 3376
 			if (!empty($objp->unit_short)) {
3377
-				$outvalUnits .= ' - ' . $objp->unit_short;
3377
+				$outvalUnits .= ' - '.$objp->unit_short;
3378 3378
 			}
3379 3379
 		}
3380 3380
 		if (getDolGlobalString('PRODUCT_SHOW_DIMENSIONS_IN_COMBO')) {
3381 3381
 			if (!empty($objp->weight) && $objp->weight_units !== null) {
3382 3382
 				$unitToShow = showDimensionInBestUnit($objp->weight, $objp->weight_units, 'weight', $langs);
3383
-				$outvalUnits .= ' - ' . $unitToShow;
3383
+				$outvalUnits .= ' - '.$unitToShow;
3384 3384
 			}
3385 3385
 			if ((!empty($objp->length) || !empty($objp->width) || !empty($objp->height)) && $objp->length_units !== null) {
3386
-				$unitToShow = $objp->length . ' x ' . $objp->width . ' x ' . $objp->height . ' ' . measuringUnitString(0, 'size', $objp->length_units);
3387
-				$outvalUnits .= ' - ' . $unitToShow;
3386
+				$unitToShow = $objp->length.' x '.$objp->width.' x '.$objp->height.' '.measuringUnitString(0, 'size', $objp->length_units);
3387
+				$outvalUnits .= ' - '.$unitToShow;
3388 3388
 			}
3389 3389
 			if (!empty($objp->surface) && $objp->surface_units !== null) {
3390 3390
 				$unitToShow = showDimensionInBestUnit($objp->surface, $objp->surface_units, 'surface', $langs);
3391
-				$outvalUnits .= ' - ' . $unitToShow;
3391
+				$outvalUnits .= ' - '.$unitToShow;
3392 3392
 			}
3393 3393
 			if (!empty($objp->volume) && $objp->volume_units !== null) {
3394 3394
 				$unitToShow = showDimensionInBestUnit($objp->volume, $objp->volume_units, 'volume', $langs);
3395
-				$outvalUnits .= ' - ' . $unitToShow;
3395
+				$outvalUnits .= ' - '.$unitToShow;
3396 3396
 			}
3397 3397
 		}
3398 3398
 		if ($outdurationvalue && $outdurationunit) {
@@ -3404,7 +3404,7 @@  discard block
 block discarded – undo
3404 3404
 				'y' => $langs->trans('Year')
3405 3405
 			);
3406 3406
 			if (isset($da[$outdurationunit])) {
3407
-				$outvalUnits .= ' - ' . $outdurationvalue . ' ' . $langs->transnoentities($da[$outdurationunit] . ($outdurationvalue > 1 ? 's' : ''));
3407
+				$outvalUnits .= ' - '.$outdurationvalue.' '.$langs->transnoentities($da[$outdurationunit].($outdurationvalue > 1 ? 's' : ''));
3408 3408
 			}
3409 3409
 		}
3410 3410
 
@@ -3424,31 +3424,31 @@  discard block
 block discarded – undo
3424 3424
 		$labeltoshow = '';
3425 3425
 		$labeltoshow .= $objp->ref;
3426 3426
 		if (!empty($objp->custref)) {
3427
-			$labeltoshow .= ' (' . $objp->custref . ')';
3427
+			$labeltoshow .= ' ('.$objp->custref.')';
3428 3428
 		}
3429 3429
 		if ($outbarcode) {
3430
-			$labeltoshow .= ' (' . $outbarcode . ')';
3430
+			$labeltoshow .= ' ('.$outbarcode.')';
3431 3431
 		}
3432
-		$labeltoshow .= ' - ' . dol_trunc($label, $maxlengtharticle);
3432
+		$labeltoshow .= ' - '.dol_trunc($label, $maxlengtharticle);
3433 3433
 		if ($outorigin && getDolGlobalString('PRODUCT_SHOW_ORIGIN_IN_COMBO')) {
3434
-			$labeltoshow .= ' (' . getCountry($outorigin, '1') . ')';
3434
+			$labeltoshow .= ' ('.getCountry($outorigin, '1').')';
3435 3435
 		}
3436 3436
 
3437 3437
 		// Set $labltoshowhtml
3438 3438
 		$labeltoshowhtml = '';
3439 3439
 		$labeltoshowhtml .= $objp->ref;
3440 3440
 		if (!empty($objp->custref)) {
3441
-			$labeltoshowhtml .= ' (' . $objp->custref . ')';
3441
+			$labeltoshowhtml .= ' ('.$objp->custref.')';
3442 3442
 		}
3443 3443
 		if (!empty($filterkey) && $filterkey != '') {
3444
-			$labeltoshowhtml = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $labeltoshowhtml, 1);
3444
+			$labeltoshowhtml = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $labeltoshowhtml, 1);
3445 3445
 		}
3446 3446
 		if ($outbarcode) {
3447
-			$labeltoshowhtml .= ' (' . $outbarcode . ')';
3447
+			$labeltoshowhtml .= ' ('.$outbarcode.')';
3448 3448
 		}
3449
-		$labeltoshowhtml .= ' - ' . dol_trunc($label, $maxlengtharticle);
3449
+		$labeltoshowhtml .= ' - '.dol_trunc($label, $maxlengtharticle);
3450 3450
 		if ($outorigin && getDolGlobalString('PRODUCT_SHOW_ORIGIN_IN_COMBO')) {
3451
-			$labeltoshowhtml .= ' (' . getCountry($outorigin, '1') . ')';
3451
+			$labeltoshowhtml .= ' ('.getCountry($outorigin, '1').')';
3452 3452
 		}
3453 3453
 
3454 3454
 		// Stock
@@ -3456,14 +3456,14 @@  discard block
 block discarded – undo
3456 3456
 		$labeltoshowhtmlstock = '';
3457 3457
 		if (isModEnabled('stock') && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || getDolGlobalString('STOCK_SUPPORTS_SERVICES'))) {
3458 3458
 			if ($user->hasRight('stock', 'lire')) {
3459
-				$labeltoshowstock .= ' - ' . $langs->trans("Stock") . ': ' . price(price2num($objp->stock, 'MS'), 0, $langs, 0, 0);
3459
+				$labeltoshowstock .= ' - '.$langs->trans("Stock").': '.price(price2num($objp->stock, 'MS'), 0, $langs, 0, 0);
3460 3460
 
3461 3461
 				if ($objp->stock > 0) {
3462 3462
 					$labeltoshowhtmlstock .= ' - <span class="product_line_stock_ok">';
3463 3463
 				} elseif ($objp->stock <= 0) {
3464 3464
 					$labeltoshowhtmlstock .= ' - <span class="product_line_stock_too_low">';
3465 3465
 				}
3466
-				$labeltoshowhtmlstock .= $langs->transnoentities("Stock") . ': ' . price(price2num($objp->stock, 'MS'), 0, $langs, 0, 0);
3466
+				$labeltoshowhtmlstock .= $langs->transnoentities("Stock").': '.price(price2num($objp->stock, 'MS'), 0, $langs, 0, 0);
3467 3467
 				$labeltoshowhtmlstock .= '</span>';
3468 3468
 
3469 3469
 				if (empty($novirtualstock) && getDolGlobalString('STOCK_SHOW_VIRTUAL_STOCK_IN_PRODUCTS_COMBO')) {  // Warning, this option may slow down combo list generation
@@ -3474,9 +3474,9 @@  discard block
 block discarded – undo
3474 3474
 					$tmpproduct->load_virtual_stock();
3475 3475
 					$virtualstock = $tmpproduct->stock_theorique;
3476 3476
 
3477
-					$labeltoshowstock .= ' - ' . $langs->trans("VirtualStock") . ':' . $virtualstock;
3477
+					$labeltoshowstock .= ' - '.$langs->trans("VirtualStock").':'.$virtualstock;
3478 3478
 
3479
-					$labeltoshowhtmlstock .= ' - ' . $langs->transnoentities("VirtualStock") . ':';
3479
+					$labeltoshowhtmlstock .= ' - '.$langs->transnoentities("VirtualStock").':';
3480 3480
 					if ($virtualstock > 0) {
3481 3481
 						$labeltoshowhtmlstock .= '<span class="product_line_stock_ok">';
3482 3482
 					} elseif ($virtualstock <= 0) {
@@ -3497,35 +3497,35 @@  discard block
 block discarded – undo
3497 3497
 		// If we need a particular price level (from 1 to n)
3498 3498
 		if (empty($hidepriceinlabel) && $price_level >= 1 && (getDolGlobalString('PRODUIT_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES'))) {
3499 3499
 			$sql = "SELECT price, price_ttc, price_base_type, tva_tx, default_vat_code";
3500
-			$sql .= " FROM " . $this->db->prefix() . "product_price";
3501
-			$sql .= " WHERE fk_product = " . ((int) $objp->rowid);
3502
-			$sql .= " AND entity IN (" . getEntity('productprice') . ")";
3503
-			$sql .= " AND price_level = " . ((int) $price_level);
3500
+			$sql .= " FROM ".$this->db->prefix()."product_price";
3501
+			$sql .= " WHERE fk_product = ".((int) $objp->rowid);
3502
+			$sql .= " AND entity IN (".getEntity('productprice').")";
3503
+			$sql .= " AND price_level = ".((int) $price_level);
3504 3504
 			$sql .= " ORDER BY date_price DESC, rowid DESC"; // Warning DESC must be both on date_price and rowid.
3505 3505
 			$sql .= " LIMIT 1";
3506 3506
 
3507
-			dol_syslog(get_class($this) . '::constructProductListOption search price for product ' . $objp->rowid . ' AND level ' . $price_level, LOG_DEBUG);
3507
+			dol_syslog(get_class($this).'::constructProductListOption search price for product '.$objp->rowid.' AND level '.$price_level, LOG_DEBUG);
3508 3508
 			$result2 = $this->db->query($sql);
3509 3509
 			if ($result2) {
3510 3510
 				$objp2 = $this->db->fetch_object($result2);
3511 3511
 				if ($objp2) {
3512 3512
 					$found = 1;
3513 3513
 					if ($objp2->price_base_type == 'HT') {
3514
-						$labeltoshowprice .= ' - ' . price($objp2->price, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("HT");
3515
-						$labeltoshowhtmlprice .= ' - ' . price($objp2->price, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("HT");
3514
+						$labeltoshowprice .= ' - '.price($objp2->price, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT");
3515
+						$labeltoshowhtmlprice .= ' - '.price($objp2->price, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT");
3516 3516
 					} else {
3517
-						$labeltoshowprice .= ' - ' . price($objp2->price_ttc, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("TTC");
3518
-						$labeltoshowhtmlprice .= ' - ' . price($objp2->price_ttc, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("TTC");
3517
+						$labeltoshowprice .= ' - '.price($objp2->price_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC");
3518
+						$labeltoshowhtmlprice .= ' - '.price($objp2->price_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC");
3519 3519
 					}
3520 3520
 					$outprice_ht = price($objp2->price);
3521 3521
 					$outprice_ttc = price($objp2->price_ttc);
3522 3522
 					$outpricebasetype = $objp2->price_base_type;
3523 3523
 					if (getDolGlobalString('PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL')) {  // using this option is a bug. kept for backward compatibility
3524
-						$outtva_tx = $objp2->tva_tx;                        // We use the vat rate on line of multiprice
3525
-						$outdefault_vat_code = $objp2->default_vat_code;    // We use the vat code on line of multiprice
3524
+						$outtva_tx = $objp2->tva_tx; // We use the vat rate on line of multiprice
3525
+						$outdefault_vat_code = $objp2->default_vat_code; // We use the vat code on line of multiprice
3526 3526
 					} else {
3527
-						$outtva_tx = $objp->tva_tx;                            // We use the vat rate of product, not the one on line of multiprice
3528
-						$outdefault_vat_code = $objp->default_vat_code;        // We use the vat code or product, not the one on line of multiprice
3527
+						$outtva_tx = $objp->tva_tx; // We use the vat rate of product, not the one on line of multiprice
3528
+						$outdefault_vat_code = $objp->default_vat_code; // We use the vat code or product, not the one on line of multiprice
3529 3529
 					}
3530 3530
 				}
3531 3531
 			} else {
@@ -3539,13 +3539,13 @@  discard block
 block discarded – undo
3539 3539
 			$outqty = $objp->quantity;
3540 3540
 			$outdiscount = $objp->remise_percent;
3541 3541
 			if ($objp->quantity == 1) {
3542
-				$labeltoshowprice .= ' - ' . price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency) . "/";
3543
-				$labeltoshowhtmlprice .= ' - ' . price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency) . "/";
3542
+				$labeltoshowprice .= ' - '.price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency)."/";
3543
+				$labeltoshowhtmlprice .= ' - '.price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency)."/";
3544 3544
 				$labeltoshowprice .= $langs->trans("Unit"); // Do not use strtolower because it breaks utf8 encoding
3545 3545
 				$labeltoshowhtmlprice .= $langs->transnoentities("Unit");
3546 3546
 			} else {
3547
-				$labeltoshowprice .= ' - ' . price($objp->price, 1, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity;
3548
-				$labeltoshowhtmlprice .= ' - ' . price($objp->price, 0, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity;
3547
+				$labeltoshowprice .= ' - '.price($objp->price, 1, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity;
3548
+				$labeltoshowhtmlprice .= ' - '.price($objp->price, 0, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity;
3549 3549
 				$labeltoshowprice .= $langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding
3550 3550
 				$labeltoshowhtmlprice .= $langs->transnoentities("Units");
3551 3551
 			}
@@ -3553,16 +3553,16 @@  discard block
 block discarded – undo
3553 3553
 			$outprice_ht = price($objp->unitprice);
3554 3554
 			$outprice_ttc = price($objp->unitprice * (1 + ($objp->tva_tx / 100)));
3555 3555
 			$outpricebasetype = $objp->price_base_type;
3556
-			$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
3557
-			$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
3556
+			$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
3557
+			$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
3558 3558
 		}
3559 3559
 		if (empty($hidepriceinlabel) && !empty($objp->quantity) && $objp->quantity >= 1) {
3560
-			$labeltoshowprice .= " (" . price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->trans("Unit") . ")"; // Do not use strtolower because it breaks utf8 encoding
3561
-			$labeltoshowhtmlprice .= " (" . price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->transnoentities("Unit") . ")"; // Do not use strtolower because it breaks utf8 encoding
3560
+			$labeltoshowprice .= " (".price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency)."/".$langs->trans("Unit").")"; // Do not use strtolower because it breaks utf8 encoding
3561
+			$labeltoshowhtmlprice .= " (".price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency)."/".$langs->transnoentities("Unit").")"; // Do not use strtolower because it breaks utf8 encoding
3562 3562
 		}
3563 3563
 		if (empty($hidepriceinlabel) && !empty($objp->remise_percent) && $objp->remise_percent >= 1) {
3564
-			$labeltoshowprice .= " - " . $langs->trans("Discount") . " : " . vatrate($objp->remise_percent) . ' %';
3565
-			$labeltoshowhtmlprice .= " - " . $langs->transnoentities("Discount") . " : " . vatrate($objp->remise_percent) . ' %';
3564
+			$labeltoshowprice .= " - ".$langs->trans("Discount")." : ".vatrate($objp->remise_percent).' %';
3565
+			$labeltoshowhtmlprice .= " - ".$langs->transnoentities("Discount")." : ".vatrate($objp->remise_percent).' %';
3566 3566
 		}
3567 3567
 
3568 3568
 		// Price by customer
@@ -3571,11 +3571,11 @@  discard block
 block discarded – undo
3571 3571
 				$found = 1;
3572 3572
 
3573 3573
 				if ($objp->custprice_base_type == 'HT') {
3574
-					$labeltoshowprice .= ' - ' . price($objp->custprice, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("HT");
3575
-					$labeltoshowhtmlprice .= ' - ' . price($objp->custprice, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("HT");
3574
+					$labeltoshowprice .= ' - '.price($objp->custprice, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT");
3575
+					$labeltoshowhtmlprice .= ' - '.price($objp->custprice, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT");
3576 3576
 				} else {
3577
-					$labeltoshowprice .= ' - ' . price($objp->custprice_ttc, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("TTC");
3578
-					$labeltoshowhtmlprice .= ' - ' . price($objp->custprice_ttc, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("TTC");
3577
+					$labeltoshowprice .= ' - '.price($objp->custprice_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC");
3578
+					$labeltoshowhtmlprice .= ' - '.price($objp->custprice_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC");
3579 3579
 				}
3580 3580
 
3581 3581
 				$outprice_ht = price($objp->custprice);
@@ -3589,11 +3589,11 @@  discard block
 block discarded – undo
3589 3589
 		// If level no defined or multiprice not found, we used the default price
3590 3590
 		if (empty($hidepriceinlabel) && !$found) {
3591 3591
 			if ($objp->price_base_type == 'HT') {
3592
-				$labeltoshowprice .= ' - ' . price($objp->price, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("HT");
3593
-				$labeltoshowhtmlprice .= ' - ' . price($objp->price, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("HT");
3592
+				$labeltoshowprice .= ' - '.price($objp->price, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT");
3593
+				$labeltoshowhtmlprice .= ' - '.price($objp->price, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT");
3594 3594
 			} else {
3595
-				$labeltoshowprice .= ' - ' . price($objp->price_ttc, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("TTC");
3596
-				$labeltoshowhtmlprice .= ' - ' . price($objp->price_ttc, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("TTC");
3595
+				$labeltoshowprice .= ' - '.price($objp->price_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC");
3596
+				$labeltoshowhtmlprice .= ' - '.price($objp->price_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC");
3597 3597
 			}
3598 3598
 			$outprice_ht = price($objp->price);
3599 3599
 			$outprice_ttc = price($objp->price_ttc);
@@ -3603,14 +3603,14 @@  discard block
 block discarded – undo
3603 3603
 		}
3604 3604
 
3605 3605
 		// Build options
3606
-		$opt = '<option value="' . $objp->rowid . '"';
3606
+		$opt = '<option value="'.$objp->rowid.'"';
3607 3607
 		$opt .= ($objp->rowid == $selected) ? ' selected' : '';
3608 3608
 		if (!empty($objp->price_by_qty_rowid) && $objp->price_by_qty_rowid > 0) {
3609
-			$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 . '"';
3609
+			$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.'"';
3610 3610
 		}
3611 3611
 		if (getDolGlobalString('PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE')) {
3612
-			$opt .= ' data-labeltrans="' . $outlabel_translated . '"';
3613
-			$opt .= ' data-desctrans="' . dol_escape_htmltag($outdesc_translated) . '"';
3612
+			$opt .= ' data-labeltrans="'.$outlabel_translated.'"';
3613
+			$opt .= ' data-desctrans="'.dol_escape_htmltag($outdesc_translated).'"';
3614 3614
 		}
3615 3615
 
3616 3616
 		if ($stocktag == 1) {
@@ -3705,7 +3705,7 @@  discard block
 block discarded – undo
3705 3705
 		$selected_input_value = '';
3706 3706
 		if (!empty($conf->use_javascript_ajax) && getDolGlobalString('PRODUIT_USE_SEARCH_TO_SELECT')) {
3707 3707
 			if ($selected > 0) {
3708
-				require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
3708
+				require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
3709 3709
 				$producttmpselect = new Product($this->db);
3710 3710
 				$producttmpselect->fetch($selected);
3711 3711
 				$selected_input_value = $producttmpselect->ref;
@@ -3713,10 +3713,10 @@  discard block
 block discarded – undo
3713 3713
 			}
3714 3714
 
3715 3715
 			// mode=2 means suppliers products
3716
-			$urloption = ($socid > 0 ? 'socid=' . $socid . '&' : '') . 'htmlname=' . $htmlname . '&outjson=1&price_level=' . $price_level . '&type=' . $filtertype . '&mode=2&status=' . $status . '&finished=' . $finished . '&alsoproductwithnosupplierprice=' . $alsoproductwithnosupplierprice;
3717
-			print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/product/ajax/products.php', $urloption, getDolGlobalInt('PRODUIT_USE_SEARCH_TO_SELECT'), 0, $ajaxoptions);
3716
+			$urloption = ($socid > 0 ? 'socid='.$socid.'&' : '').'htmlname='.$htmlname.'&outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=2&status='.$status.'&finished='.$finished.'&alsoproductwithnosupplierprice='.$alsoproductwithnosupplierprice;
3717
+			print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajax/products.php', $urloption, getDolGlobalInt('PRODUIT_USE_SEARCH_TO_SELECT'), 0, $ajaxoptions);
3718 3718
 
3719
-			print($hidelabel ? '' : $langs->trans("RefOrLabel") . ' : ') . '<input type="text" class="'.$morecss.'" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . ($placeholder ? ' placeholder="' . $placeholder . '"' : '') . '>';
3719
+			print($hidelabel ? '' : $langs->trans("RefOrLabel").' : ').'<input type="text" class="'.$morecss.'" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.($placeholder ? ' placeholder="'.$placeholder.'"' : '').'>';
3720 3720
 		} else {
3721 3721
 			print $this->select_produits_fournisseurs_list($socid, $selected, $htmlname, $filtertype, $filtre, '', $status, 0, 0, $alsoproductwithnosupplierprice, $morecss, 0, $placeholder);
3722 3722
 		}
@@ -3774,25 +3774,25 @@  discard block
 block discarded – undo
3774 3774
 		if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
3775 3775
 			$sql .= ", u.label as unit_long, u.short_label as unit_short, p.weight, p.weight_units, p.length, p.length_units, p.width, p.width_units, p.height, p.height_units, p.surface, p.surface_units, p.volume, p.volume_units";
3776 3776
 		}
3777
-		$sql .= " FROM " . $this->db->prefix() . "product as p";
3778
-		$sql .= " LEFT JOIN " . $this->db->prefix() . "product_fournisseur_price as pfp ON ( p.rowid = pfp.fk_product AND pfp.entity IN (" . getEntity('product') . ") )";
3777
+		$sql .= " FROM ".$this->db->prefix()."product as p";
3778
+		$sql .= " LEFT JOIN ".$this->db->prefix()."product_fournisseur_price as pfp ON ( p.rowid = pfp.fk_product AND pfp.entity IN (".getEntity('product').") )";
3779 3779
 		if ($socid > 0) {
3780
-			$sql .= " AND pfp.fk_soc = " . ((int) $socid);
3780
+			$sql .= " AND pfp.fk_soc = ".((int) $socid);
3781 3781
 		}
3782
-		$sql .= " LEFT JOIN " . $this->db->prefix() . "societe as s ON pfp.fk_soc = s.rowid";
3782
+		$sql .= " LEFT JOIN ".$this->db->prefix()."societe as s ON pfp.fk_soc = s.rowid";
3783 3783
 		// Units
3784 3784
 		if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
3785
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "c_units u ON u.rowid = p.fk_unit";
3785
+			$sql .= " LEFT JOIN ".$this->db->prefix()."c_units u ON u.rowid = p.fk_unit";
3786 3786
 		}
3787
-		$sql .= " WHERE p.entity IN (" . getEntity('product') . ")";
3787
+		$sql .= " WHERE p.entity IN (".getEntity('product').")";
3788 3788
 		if ($statut != -1) {
3789
-			$sql .= " AND p.tobuy = " . ((int) $statut);
3789
+			$sql .= " AND p.tobuy = ".((int) $statut);
3790 3790
 		}
3791 3791
 		if (strval($filtertype) != '') {
3792
-			$sql .= " AND p.fk_product_type = " . ((int) $filtertype);
3792
+			$sql .= " AND p.fk_product_type = ".((int) $filtertype);
3793 3793
 		}
3794 3794
 		if (!empty($filtre)) {
3795
-			$sql .= " " . $filtre;
3795
+			$sql .= " ".$filtre;
3796 3796
 		}
3797 3797
 		// Add where from hooks
3798 3798
 		$parameters = array();
@@ -3812,9 +3812,9 @@  discard block
 block discarded – undo
3812 3812
 				if ($i > 0) {
3813 3813
 					$sql .= " AND ";
3814 3814
 				}
3815
-				$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) . "%'";
3815
+				$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)."%'";
3816 3816
 				if (getDolGlobalString('PRODUIT_FOURN_TEXTS')) {
3817
-					$sql .= " OR pfp.desc_fourn LIKE '" . $this->db->escape($prefix . $crit) . "%'";
3817
+					$sql .= " OR pfp.desc_fourn LIKE '".$this->db->escape($prefix.$crit)."%'";
3818 3818
 				}
3819 3819
 				$sql .= ")";
3820 3820
 				$i++;
@@ -3823,8 +3823,8 @@  discard block
 block discarded – undo
3823 3823
 				$sql .= ")";
3824 3824
 			}
3825 3825
 			if (isModEnabled('barcode')) {
3826
-				$sql .= " OR p.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
3827
-				$sql .= " OR pfp.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
3826
+				$sql .= " OR p.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'";
3827
+				$sql .= " OR pfp.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'";
3828 3828
 			}
3829 3829
 			$sql .= ')';
3830 3830
 		}
@@ -3833,20 +3833,20 @@  discard block
 block discarded – undo
3833 3833
 
3834 3834
 		// Build output string
3835 3835
 
3836
-		dol_syslog(get_class($this) . "::select_produits_fournisseurs_list", LOG_DEBUG);
3836
+		dol_syslog(get_class($this)."::select_produits_fournisseurs_list", LOG_DEBUG);
3837 3837
 		$result = $this->db->query($sql);
3838 3838
 		if ($result) {
3839
-			require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
3840
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/product.lib.php';
3839
+			require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
3840
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php';
3841 3841
 
3842 3842
 			$num = $this->db->num_rows($result);
3843 3843
 
3844 3844
 			//$out.='<select class="flat" id="select'.$htmlname.'" name="'.$htmlname.'">';	// remove select to have id same with combo and ajax
3845
-			$out .= '<select class="flat ' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . '">';
3845
+			$out .= '<select class="flat '.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.'">';
3846 3846
 			if (!$selected) {
3847
-				$out .= '<option value="-1" selected>' . ($placeholder ? $placeholder : '&nbsp;') . '</option>';
3847
+				$out .= '<option value="-1" selected>'.($placeholder ? $placeholder : '&nbsp;').'</option>';
3848 3848
 			} else {
3849
-				$out .= '<option value="-1">' . ($placeholder ? $placeholder : '&nbsp;') . '</option>';
3849
+				$out .= '<option value="-1">'.($placeholder ? $placeholder : '&nbsp;').'</option>';
3850 3850
 			}
3851 3851
 
3852 3852
 			$i = 0;
@@ -3861,7 +3861,7 @@  discard block
 block discarded – undo
3861 3861
 
3862 3862
 				$outkey = $objp->idprodfournprice; // id in table of price
3863 3863
 				if (!$outkey && $alsoproductwithnosupplierprice) {
3864
-					$outkey = 'idprod_' . $objp->rowid; // id of product
3864
+					$outkey = 'idprod_'.$objp->rowid; // id of product
3865 3865
 				}
3866 3866
 
3867 3867
 				$outref = $objp->ref;
@@ -3876,23 +3876,23 @@  discard block
 block discarded – undo
3876 3876
 				$outvalUnits = '';
3877 3877
 				if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
3878 3878
 					if (!empty($objp->unit_short)) {
3879
-						$outvalUnits .= ' - ' . $objp->unit_short;
3879
+						$outvalUnits .= ' - '.$objp->unit_short;
3880 3880
 					}
3881 3881
 					if (!empty($objp->weight) && $objp->weight_units !== null) {
3882 3882
 						$unitToShow = showDimensionInBestUnit($objp->weight, $objp->weight_units, 'weight', $langs);
3883
-						$outvalUnits .= ' - ' . $unitToShow;
3883
+						$outvalUnits .= ' - '.$unitToShow;
3884 3884
 					}
3885 3885
 					if ((!empty($objp->length) || !empty($objp->width) || !empty($objp->height)) && $objp->length_units !== null) {
3886
-						$unitToShow = $objp->length . ' x ' . $objp->width . ' x ' . $objp->height . ' ' . measuringUnitString(0, 'size', $objp->length_units);
3887
-						$outvalUnits .= ' - ' . $unitToShow;
3886
+						$unitToShow = $objp->length.' x '.$objp->width.' x '.$objp->height.' '.measuringUnitString(0, 'size', $objp->length_units);
3887
+						$outvalUnits .= ' - '.$unitToShow;
3888 3888
 					}
3889 3889
 					if (!empty($objp->surface) && $objp->surface_units !== null) {
3890 3890
 						$unitToShow = showDimensionInBestUnit($objp->surface, $objp->surface_units, 'surface', $langs);
3891
-						$outvalUnits .= ' - ' . $unitToShow;
3891
+						$outvalUnits .= ' - '.$unitToShow;
3892 3892
 					}
3893 3893
 					if (!empty($objp->volume) && $objp->volume_units !== null) {
3894 3894
 						$unitToShow = showDimensionInBestUnit($objp->volume, $objp->volume_units, 'volume', $langs);
3895
-						$outvalUnits .= ' - ' . $unitToShow;
3895
+						$outvalUnits .= ' - '.$unitToShow;
3896 3896
 					}
3897 3897
 					if ($outdurationvalue && $outdurationunit) {
3898 3898
 						$da = array(
@@ -3903,22 +3903,22 @@  discard block
 block discarded – undo
3903 3903
 							'y' => $langs->trans('Year')
3904 3904
 						);
3905 3905
 						if (isset($da[$outdurationunit])) {
3906
-							$outvalUnits .= ' - ' . $outdurationvalue . ' ' . $langs->transnoentities($da[$outdurationunit] . ($outdurationvalue > 1 ? 's' : ''));
3906
+							$outvalUnits .= ' - '.$outdurationvalue.' '.$langs->transnoentities($da[$outdurationunit].($outdurationvalue > 1 ? 's' : ''));
3907 3907
 						}
3908 3908
 					}
3909 3909
 				}
3910 3910
 
3911 3911
 				$objRef = $objp->ref;
3912 3912
 				if ($filterkey && $filterkey != '') {
3913
-					$objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1);
3913
+					$objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1);
3914 3914
 				}
3915 3915
 				$objRefFourn = $objp->ref_fourn;
3916 3916
 				if ($filterkey && $filterkey != '') {
3917
-					$objRefFourn = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRefFourn, 1);
3917
+					$objRefFourn = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRefFourn, 1);
3918 3918
 				}
3919 3919
 				$label = $objp->label;
3920 3920
 				if ($filterkey && $filterkey != '') {
3921
-					$label = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $label, 1);
3921
+					$label = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $label, 1);
3922 3922
 				}
3923 3923
 
3924 3924
 				switch ($objp->fk_product_type) {
@@ -3941,21 +3941,21 @@  discard block
 block discarded – undo
3941 3941
 
3942 3942
 				$optlabel .= $objp->ref;
3943 3943
 				if (!empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) {
3944
-					$optlabel .= ' <span class="opacitymedium">(' . $objp->ref_fourn . ')</span>';
3944
+					$optlabel .= ' <span class="opacitymedium">('.$objp->ref_fourn.')</span>';
3945 3945
 				}
3946 3946
 				if (isModEnabled('barcode') && !empty($objp->barcode)) {
3947
-					$optlabel .= ' (' . $outbarcode . ')';
3947
+					$optlabel .= ' ('.$outbarcode.')';
3948 3948
 				}
3949
-				$optlabel .= ' - ' . dol_trunc($label, $maxlengtharticle);
3949
+				$optlabel .= ' - '.dol_trunc($label, $maxlengtharticle);
3950 3950
 
3951 3951
 				$outvallabel = $objRef;
3952 3952
 				if (!empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) {
3953
-					$outvallabel .= ' (' . $objRefFourn . ')';
3953
+					$outvallabel .= ' ('.$objRefFourn.')';
3954 3954
 				}
3955 3955
 				if (isModEnabled('barcode') && !empty($objp->barcode)) {
3956
-					$outvallabel .= ' (' . $outbarcode . ')';
3956
+					$outvallabel .= ' ('.$outbarcode.')';
3957 3957
 				}
3958
-				$outvallabel .= ' - ' . dol_trunc($label, $maxlengtharticle);
3958
+				$outvallabel .= ' - '.dol_trunc($label, $maxlengtharticle);
3959 3959
 
3960 3960
 				// Units
3961 3961
 				$optlabel .= $outvalUnits;
@@ -3972,7 +3972,7 @@  discard block
 block discarded – undo
3972 3972
 						$prod_supplier->fourn_tva_tx = $objp->tva_tx;
3973 3973
 						$prod_supplier->fk_supplier_price_expression = $objp->fk_supplier_price_expression;
3974 3974
 
3975
-						require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
3975
+						require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
3976 3976
 						$priceparser = new PriceParser($this->db);
3977 3977
 						$price_result = $priceparser->parseProductSupplier($prod_supplier);
3978 3978
 						if ($price_result >= 0) {
@@ -3983,57 +3983,57 @@  discard block
 block discarded – undo
3983 3983
 						}
3984 3984
 					}
3985 3985
 					if ($objp->quantity == 1) {
3986
-						$optlabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/";
3987
-						$outvallabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency) . "/";
3986
+						$optlabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/";
3987
+						$outvallabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency)."/";
3988 3988
 						$optlabel .= $langs->trans("Unit"); // Do not use strtolower because it breaks utf8 encoding
3989 3989
 						$outvallabel .= $langs->transnoentities("Unit");
3990 3990
 					} else {
3991
-						$optlabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity;
3992
-						$outvallabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity;
3993
-						$optlabel .= ' ' . $langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding
3994
-						$outvallabel .= ' ' . $langs->transnoentities("Units");
3991
+						$optlabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity;
3992
+						$outvallabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity;
3993
+						$optlabel .= ' '.$langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding
3994
+						$outvallabel .= ' '.$langs->transnoentities("Units");
3995 3995
 					}
3996 3996
 
3997 3997
 					if ($objp->quantity > 1) {
3998
-						$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
3999
-						$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
3998
+						$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
3999
+						$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
4000 4000
 					}
4001 4001
 					if ($objp->remise_percent >= 1) {
4002
-						$optlabel .= " - " . $langs->trans("Discount") . " : " . vatrate($objp->remise_percent) . ' %';
4003
-						$outvallabel .= " - " . $langs->transnoentities("Discount") . " : " . vatrate($objp->remise_percent) . ' %';
4002
+						$optlabel .= " - ".$langs->trans("Discount")." : ".vatrate($objp->remise_percent).' %';
4003
+						$outvallabel .= " - ".$langs->transnoentities("Discount")." : ".vatrate($objp->remise_percent).' %';
4004 4004
 					}
4005 4005
 					if ($objp->duration) {
4006
-						$optlabel .= " - " . $objp->duration;
4007
-						$outvallabel .= " - " . $objp->duration;
4006
+						$optlabel .= " - ".$objp->duration;
4007
+						$outvallabel .= " - ".$objp->duration;
4008 4008
 					}
4009 4009
 					if (!$socid) {
4010
-						$optlabel .= " - " . dol_trunc($objp->name, 8);
4011
-						$outvallabel .= " - " . dol_trunc($objp->name, 8);
4010
+						$optlabel .= " - ".dol_trunc($objp->name, 8);
4011
+						$outvallabel .= " - ".dol_trunc($objp->name, 8);
4012 4012
 					}
4013 4013
 					if ($objp->supplier_reputation) {
4014 4014
 						//TODO dictionary
4015 4015
 						$reputations = array('' => $langs->trans('Standard'), 'FAVORITE' => $langs->trans('Favorite'), 'NOTTHGOOD' => $langs->trans('NotTheGoodQualitySupplier'), 'DONOTORDER' => $langs->trans('DoNotOrderThisProductToThisSupplier'));
4016 4016
 
4017
-						$optlabel .= " - " . $reputations[$objp->supplier_reputation];
4018
-						$outvallabel .= " - " . $reputations[$objp->supplier_reputation];
4017
+						$optlabel .= " - ".$reputations[$objp->supplier_reputation];
4018
+						$outvallabel .= " - ".$reputations[$objp->supplier_reputation];
4019 4019
 					}
4020 4020
 				} else {
4021
-					$optlabel .= " - <span class='opacitymedium'>" . $langs->trans("NoPriceDefinedForThisSupplier") . '</span>';
4022
-					$outvallabel .= ' - ' . $langs->transnoentities("NoPriceDefinedForThisSupplier");
4021
+					$optlabel .= " - <span class='opacitymedium'>".$langs->trans("NoPriceDefinedForThisSupplier").'</span>';
4022
+					$outvallabel .= ' - '.$langs->transnoentities("NoPriceDefinedForThisSupplier");
4023 4023
 				}
4024 4024
 
4025 4025
 				if (isModEnabled('stock') && $showstockinlist && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || getDolGlobalString('STOCK_SUPPORTS_SERVICES'))) {
4026 4026
 					$novirtualstock = ($showstockinlist == 2);
4027 4027
 
4028 4028
 					if ($user->hasRight('stock', 'lire')) {
4029
-						$outvallabel .= ' - ' . $langs->trans("Stock") . ': ' . price(price2num($objp->stock, 'MS'), 0, $langs, 0, 0);
4029
+						$outvallabel .= ' - '.$langs->trans("Stock").': '.price(price2num($objp->stock, 'MS'), 0, $langs, 0, 0);
4030 4030
 
4031 4031
 						if ($objp->stock > 0) {
4032 4032
 							$optlabel .= ' - <span class="product_line_stock_ok">';
4033 4033
 						} elseif ($objp->stock <= 0) {
4034 4034
 							$optlabel .= ' - <span class="product_line_stock_too_low">';
4035 4035
 						}
4036
-						$optlabel .= $langs->transnoentities("Stock") . ':' . price(price2num($objp->stock, 'MS'));
4036
+						$optlabel .= $langs->transnoentities("Stock").':'.price(price2num($objp->stock, 'MS'));
4037 4037
 						$optlabel .= '</span>';
4038 4038
 						if (empty($novirtualstock) && getDolGlobalString('STOCK_SHOW_VIRTUAL_STOCK_IN_PRODUCTS_COMBO')) {  // Warning, this option may slow down combo list generation
4039 4039
 							$langs->load("stocks");
@@ -4043,9 +4043,9 @@  discard block
 block discarded – undo
4043 4043
 							$tmpproduct->load_virtual_stock();
4044 4044
 							$virtualstock = $tmpproduct->stock_theorique;
4045 4045
 
4046
-							$outvallabel .= ' - ' . $langs->trans("VirtualStock") . ':' . $virtualstock;
4046
+							$outvallabel .= ' - '.$langs->trans("VirtualStock").':'.$virtualstock;
4047 4047
 
4048
-							$optlabel .= ' - ' . $langs->transnoentities("VirtualStock") . ':';
4048
+							$optlabel .= ' - '.$langs->transnoentities("VirtualStock").':';
4049 4049
 							if ($virtualstock > 0) {
4050 4050
 								$optlabel .= '<span class="product_line_stock_ok">';
4051 4051
 							} elseif ($virtualstock <= 0) {
@@ -4059,7 +4059,7 @@  discard block
 block discarded – undo
4059 4059
 					}
4060 4060
 				}
4061 4061
 
4062
-				$optstart = '<option value="' . $outkey . '"';
4062
+				$optstart = '<option value="'.$outkey.'"';
4063 4063
 				if ($selected && $selected == $objp->idprodfournprice) {
4064 4064
 					$optstart .= ' selected';
4065 4065
 				}
@@ -4068,22 +4068,22 @@  discard block
 block discarded – undo
4068 4068
 				}
4069 4069
 
4070 4070
 				if (!empty($objp->idprodfournprice) && $objp->idprodfournprice > 0) {
4071
-					$optstart .= ' data-product-id="' . dol_escape_htmltag($objp->rowid) . '"';
4072
-					$optstart .= ' data-price-id="' . dol_escape_htmltag($objp->idprodfournprice) . '"';
4073
-					$optstart .= ' data-qty="' . dol_escape_htmltag($objp->quantity) . '"';
4074
-					$optstart .= ' data-up="' . dol_escape_htmltag(price2num($objp->unitprice)) . '"';
4075
-					$optstart .= ' data-up-locale="' . dol_escape_htmltag(price($objp->unitprice)) . '"';
4076
-					$optstart .= ' data-discount="' . dol_escape_htmltag($outdiscount) . '"';
4077
-					$optstart .= ' data-tvatx="' . dol_escape_htmltag(price2num($objp->tva_tx)) . '"';
4078
-					$optstart .= ' data-tvatx-formated="' . dol_escape_htmltag(price($objp->tva_tx, 0, $langs, 1, -1, 2)) . '"';
4079
-					$optstart .= ' data-default-vat-code="' . dol_escape_htmltag($objp->default_vat_code) . '"';
4080
-					$optstart .= ' data-supplier-ref="' . dol_escape_htmltag($objp->ref_fourn) . '"';
4071
+					$optstart .= ' data-product-id="'.dol_escape_htmltag($objp->rowid).'"';
4072
+					$optstart .= ' data-price-id="'.dol_escape_htmltag($objp->idprodfournprice).'"';
4073
+					$optstart .= ' data-qty="'.dol_escape_htmltag($objp->quantity).'"';
4074
+					$optstart .= ' data-up="'.dol_escape_htmltag(price2num($objp->unitprice)).'"';
4075
+					$optstart .= ' data-up-locale="'.dol_escape_htmltag(price($objp->unitprice)).'"';
4076
+					$optstart .= ' data-discount="'.dol_escape_htmltag($outdiscount).'"';
4077
+					$optstart .= ' data-tvatx="'.dol_escape_htmltag(price2num($objp->tva_tx)).'"';
4078
+					$optstart .= ' data-tvatx-formated="'.dol_escape_htmltag(price($objp->tva_tx, 0, $langs, 1, -1, 2)).'"';
4079
+					$optstart .= ' data-default-vat-code="'.dol_escape_htmltag($objp->default_vat_code).'"';
4080
+					$optstart .= ' data-supplier-ref="'.dol_escape_htmltag($objp->ref_fourn).'"';
4081 4081
 					if (isModEnabled('multicurrency')) {
4082
-						$optstart .= ' data-multicurrency-code="' . dol_escape_htmltag($objp->multicurrency_code) . '"';
4083
-						$optstart .= ' data-multicurrency-unitprice="' . dol_escape_htmltag($objp->multicurrency_unitprice) . '"';
4082
+						$optstart .= ' data-multicurrency-code="'.dol_escape_htmltag($objp->multicurrency_code).'"';
4083
+						$optstart .= ' data-multicurrency-unitprice="'.dol_escape_htmltag($objp->multicurrency_unitprice).'"';
4084 4084
 					}
4085 4085
 				}
4086
-				$optstart .= ' data-description="' . dol_escape_htmltag($objp->description, 0, 1) . '"';
4086
+				$optstart .= ' data-description="'.dol_escape_htmltag($objp->description, 0, 1).'"';
4087 4087
 
4088 4088
 				// set $parameters to call hook
4089 4089
 				$outarrayentry = array(
@@ -4092,9 +4092,9 @@  discard block
 block discarded – undo
4092 4092
 					'label' => $outvallabel,
4093 4093
 					'labelhtml' => $optlabel,
4094 4094
 					'qty' => $outqty,
4095
-					'price_qty_ht' => price2num($objp->fprice, 'MU'),    // Keep higher resolution for price for the min qty
4096
-					'price_unit_ht' => price2num($objp->unitprice, 'MU'),    // This is used to fill the Unit Price
4097
-					'price_ht' => price2num($objp->unitprice, 'MU'),        // This is used to fill the Unit Price (for compatibility)
4095
+					'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty
4096
+					'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price
4097
+					'price_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility)
4098 4098
 					'tva_tx_formated' => price($objp->tva_tx, 0, $langs, 1, -1, 2),
4099 4099
 					'tva_tx' => price2num($objp->tva_tx),
4100 4100
 					'default_vat_code' => $objp->default_vat_code,
@@ -4124,18 +4124,18 @@  discard block
 block discarded – undo
4124 4124
 				// Add new entry
4125 4125
 				// "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
4126 4126
 				// "label" value of json key array is used by jQuery automatically as text for combo box
4127
-				$out .= $optstart . ' data-html="' . dol_escape_htmltag($optlabel) . '">' . $optlabel . "</option>\n";
4127
+				$out .= $optstart.' data-html="'.dol_escape_htmltag($optlabel).'">'.$optlabel."</option>\n";
4128 4128
 				$outarraypush = array(
4129 4129
 					'key' => $outkey,
4130 4130
 					'value' => $outref,
4131 4131
 					'label' => $outvallabel,
4132 4132
 					'labelhtml' => $optlabel,
4133 4133
 					'qty' => $outqty,
4134
-					'price_qty_ht' => price2num($objp->fprice, 'MU'),        // Keep higher resolution for price for the min qty
4134
+					'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty
4135 4135
 					'price_qty_ht_locale' => price($objp->fprice),
4136
-					'price_unit_ht' => price2num($objp->unitprice, 'MU'),    // This is used to fill the Unit Price
4136
+					'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price
4137 4137
 					'price_unit_ht_locale' => price($objp->unitprice),
4138
-					'price_ht' => price2num($objp->unitprice, 'MU'),        // This is used to fill the Unit Price (for compatibility)
4138
+					'price_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility)
4139 4139
 					'tva_tx_formated' => price($objp->tva_tx),
4140 4140
 					'tva_tx' => price2num($objp->tva_tx),
4141 4141
 					'default_vat_code' => $objp->default_vat_code,
@@ -4168,7 +4168,7 @@  discard block
 block discarded – undo
4168 4168
 
4169 4169
 			$this->db->free($result);
4170 4170
 
4171
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
4171
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
4172 4172
 			$out .= ajax_combobox($htmlname);
4173 4173
 		} else {
4174 4174
 			dol_print_error($this->db);
@@ -4200,43 +4200,43 @@  discard block
 block discarded – undo
4200 4200
 		$sql = "SELECT p.rowid, p.ref, p.label, p.price, p.duration, pfp.fk_soc,";
4201 4201
 		$sql .= " pfp.ref_fourn, pfp.rowid as idprodfournprice, pfp.price as fprice, pfp.remise_percent, pfp.quantity, pfp.unitprice,";
4202 4202
 		$sql .= " pfp.fk_supplier_price_expression, pfp.fk_product, pfp.tva_tx, s.nom as name";
4203
-		$sql .= " FROM " . $this->db->prefix() . "product as p";
4204
-		$sql .= " LEFT JOIN " . $this->db->prefix() . "product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
4205
-		$sql .= " LEFT JOIN " . $this->db->prefix() . "societe as s ON pfp.fk_soc = s.rowid";
4206
-		$sql .= " WHERE pfp.entity IN (" . getEntity('productsupplierprice') . ")";
4203
+		$sql .= " FROM ".$this->db->prefix()."product as p";
4204
+		$sql .= " LEFT JOIN ".$this->db->prefix()."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
4205
+		$sql .= " LEFT JOIN ".$this->db->prefix()."societe as s ON pfp.fk_soc = s.rowid";
4206
+		$sql .= " WHERE pfp.entity IN (".getEntity('productsupplierprice').")";
4207 4207
 		$sql .= " AND p.tobuy = 1";
4208 4208
 		$sql .= " AND s.fournisseur = 1";
4209
-		$sql .= " AND p.rowid = " . ((int) $productid);
4209
+		$sql .= " AND p.rowid = ".((int) $productid);
4210 4210
 		if (!getDolGlobalString('PRODUCT_BEST_SUPPLIER_PRICE_PRESELECTED')) {
4211 4211
 			$sql .= " ORDER BY s.nom, pfp.ref_fourn DESC";
4212 4212
 		} else {
4213 4213
 			$sql .= " ORDER BY pfp.unitprice ASC";
4214 4214
 		}
4215 4215
 
4216
-		dol_syslog(get_class($this) . "::select_product_fourn_price", LOG_DEBUG);
4216
+		dol_syslog(get_class($this)."::select_product_fourn_price", LOG_DEBUG);
4217 4217
 		$result = $this->db->query($sql);
4218 4218
 
4219 4219
 		if ($result) {
4220 4220
 			$num = $this->db->num_rows($result);
4221 4221
 
4222
-			$form = '<select class="flat" id="select_' . $htmlname . '" name="' . $htmlname . '">';
4222
+			$form = '<select class="flat" id="select_'.$htmlname.'" name="'.$htmlname.'">';
4223 4223
 
4224 4224
 			if (!$num) {
4225
-				$form .= '<option value="0">-- ' . $langs->trans("NoSupplierPriceDefinedForThisProduct") . ' --</option>';
4225
+				$form .= '<option value="0">-- '.$langs->trans("NoSupplierPriceDefinedForThisProduct").' --</option>';
4226 4226
 			} else {
4227
-				require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
4227
+				require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
4228 4228
 				$form .= '<option value="0">&nbsp;</option>';
4229 4229
 
4230 4230
 				$i = 0;
4231 4231
 				while ($i < $num) {
4232 4232
 					$objp = $this->db->fetch_object($result);
4233 4233
 
4234
-					$opt = '<option value="' . $objp->idprodfournprice . '"';
4234
+					$opt = '<option value="'.$objp->idprodfournprice.'"';
4235 4235
 					//if there is only one supplier, preselect it
4236 4236
 					if ($num == 1 || ($selected_supplier > 0 && $objp->fk_soc == $selected_supplier) || ($i == 0 && getDolGlobalString('PRODUCT_BEST_SUPPLIER_PRICE_PRESELECTED'))) {
4237 4237
 						$opt .= ' selected';
4238 4238
 					}
4239
-					$opt .= '>' . $objp->name . ' - ' . $objp->ref_fourn . ' - ';
4239
+					$opt .= '>'.$objp->name.' - '.$objp->ref_fourn.' - ';
4240 4240
 
4241 4241
 					if (isModEnabled('dynamicprices') && !empty($objp->fk_supplier_price_expression)) {
4242 4242
 						$prod_supplier = new ProductFournisseur($this->db);
@@ -4246,7 +4246,7 @@  discard block
 block discarded – undo
4246 4246
 						$prod_supplier->fourn_tva_tx = $objp->tva_tx;
4247 4247
 						$prod_supplier->fk_supplier_price_expression = $objp->fk_supplier_price_expression;
4248 4248
 
4249
-						require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
4249
+						require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
4250 4250
 						$priceparser = new PriceParser($this->db);
4251 4251
 						$price_result = $priceparser->parseProductSupplier($prod_supplier);
4252 4252
 						if ($price_result >= 0) {
@@ -4257,10 +4257,10 @@  discard block
 block discarded – undo
4257 4257
 						}
4258 4258
 					}
4259 4259
 					if ($objp->quantity == 1) {
4260
-						$opt .= price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/";
4260
+						$opt .= price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/";
4261 4261
 					}
4262 4262
 
4263
-					$opt .= $objp->quantity . ' ';
4263
+					$opt .= $objp->quantity.' ';
4264 4264
 
4265 4265
 					if ($objp->quantity == 1) {
4266 4266
 						$opt .= $langs->trans("Unit");
@@ -4269,10 +4269,10 @@  discard block
 block discarded – undo
4269 4269
 					}
4270 4270
 					if ($objp->quantity > 1) {
4271 4271
 						$opt .= " - ";
4272
-						$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");
4272
+						$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");
4273 4273
 					}
4274 4274
 					if ($objp->duration) {
4275
-						$opt .= " - " . $objp->duration;
4275
+						$opt .= " - ".$objp->duration;
4276 4276
 					}
4277 4277
 					$opt .= "</option>\n";
4278 4278
 
@@ -4310,8 +4310,8 @@  discard block
 block discarded – undo
4310 4310
 		dol_syslog(__METHOD__, LOG_DEBUG);
4311 4311
 
4312 4312
 		$sql = "SELECT rowid, code, libelle as label, deposit_percent";
4313
-		$sql .= " FROM " . $this->db->prefix() . 'c_payment_term';
4314
-		$sql .= " WHERE entity IN (" . getEntity('c_payment_term') . ")";
4313
+		$sql .= " FROM ".$this->db->prefix().'c_payment_term';
4314
+		$sql .= " WHERE entity IN (".getEntity('c_payment_term').")";
4315 4315
 		$sql .= " AND active > 0";
4316 4316
 		$sql .= " ORDER BY sortorder";
4317 4317
 
@@ -4323,7 +4323,7 @@  discard block
 block discarded – undo
4323 4323
 				$obj = $this->db->fetch_object($resql);
4324 4324
 
4325 4325
 				// Si traduction existe, on l'utilise, sinon on prend le libelle par default
4326
-				$label = ($langs->trans("PaymentConditionShort" . $obj->code) != "PaymentConditionShort" . $obj->code ? $langs->trans("PaymentConditionShort" . $obj->code) : ($obj->label != '-' ? $obj->label : ''));
4326
+				$label = ($langs->trans("PaymentConditionShort".$obj->code) != "PaymentConditionShort".$obj->code ? $langs->trans("PaymentConditionShort".$obj->code) : ($obj->label != '-' ? $obj->label : ''));
4327 4327
 				$this->cache_conditions_paiements[$obj->rowid]['code'] = $obj->code;
4328 4328
 				$this->cache_conditions_paiements[$obj->rowid]['label'] = $label;
4329 4329
 				$this->cache_conditions_paiements[$obj->rowid]['deposit_percent'] = $obj->deposit_percent;
@@ -4351,7 +4351,7 @@  discard block
 block discarded – undo
4351 4351
 		// phpcs:enable
4352 4352
 		global $langs;
4353 4353
 
4354
-		$num = count($this->cache_availability);    // TODO Use $conf->cache['availability'] instead of $this->cache_availability
4354
+		$num = count($this->cache_availability); // TODO Use $conf->cache['availability'] instead of $this->cache_availability
4355 4355
 		if ($num > 0) {
4356 4356
 			return 0; // Cache already loaded
4357 4357
 		}
@@ -4361,7 +4361,7 @@  discard block
 block discarded – undo
4361 4361
 		$langs->load('propal');
4362 4362
 
4363 4363
 		$sql = "SELECT rowid, code, label, position";
4364
-		$sql .= " FROM " . $this->db->prefix() . 'c_availability';
4364
+		$sql .= " FROM ".$this->db->prefix().'c_availability';
4365 4365
 		$sql .= " WHERE active > 0";
4366 4366
 
4367 4367
 		$resql = $this->db->query($sql);
@@ -4372,7 +4372,7 @@  discard block
 block discarded – undo
4372 4372
 				$obj = $this->db->fetch_object($resql);
4373 4373
 
4374 4374
 				// Si traduction existe, on l'utilise, sinon on prend le libelle par default
4375
-				$label = ($langs->trans("AvailabilityType" . $obj->code) != "AvailabilityType" . $obj->code ? $langs->trans("AvailabilityType" . $obj->code) : ($obj->label != '-' ? $obj->label : ''));
4375
+				$label = ($langs->trans("AvailabilityType".$obj->code) != "AvailabilityType".$obj->code ? $langs->trans("AvailabilityType".$obj->code) : ($obj->label != '-' ? $obj->label : ''));
4376 4376
 				$this->cache_availability[$obj->rowid]['code'] = $obj->code;
4377 4377
 				$this->cache_availability[$obj->rowid]['label'] = $label;
4378 4378
 				$this->cache_availability[$obj->rowid]['position'] = $obj->position;
@@ -4404,17 +4404,17 @@  discard block
 block discarded – undo
4404 4404
 
4405 4405
 		$this->load_cache_availability();
4406 4406
 
4407
-		dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG);
4407
+		dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG);
4408 4408
 
4409
-		print '<select id="' . $htmlname . '" class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">';
4409
+		print '<select id="'.$htmlname.'" class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
4410 4410
 		if ($addempty) {
4411 4411
 			print '<option value="0">&nbsp;</option>';
4412 4412
 		}
4413 4413
 		foreach ($this->cache_availability as $id => $arrayavailability) {
4414 4414
 			if ($selected == $id) {
4415
-				print '<option value="' . $id . '" selected>';
4415
+				print '<option value="'.$id.'" selected>';
4416 4416
 			} else {
4417
-				print '<option value="' . $id . '">';
4417
+				print '<option value="'.$id.'">';
4418 4418
 			}
4419 4419
 			print dol_escape_htmltag($arrayavailability['label']);
4420 4420
 			print '</option>';
@@ -4435,13 +4435,13 @@  discard block
 block discarded – undo
4435 4435
 	{
4436 4436
 		global $langs;
4437 4437
 
4438
-		$num = count($this->cache_demand_reason);    // TODO Use $conf->cache['input_reason'] instead of $this->cache_demand_reason
4438
+		$num = count($this->cache_demand_reason); // TODO Use $conf->cache['input_reason'] instead of $this->cache_demand_reason
4439 4439
 		if ($num > 0) {
4440 4440
 			return 0; // Cache already loaded
4441 4441
 		}
4442 4442
 
4443 4443
 		$sql = "SELECT rowid, code, label";
4444
-		$sql .= " FROM " . $this->db->prefix() . 'c_input_reason';
4444
+		$sql .= " FROM ".$this->db->prefix().'c_input_reason';
4445 4445
 		$sql .= " WHERE active > 0";
4446 4446
 
4447 4447
 		$resql = $this->db->query($sql);
@@ -4454,8 +4454,8 @@  discard block
 block discarded – undo
4454 4454
 
4455 4455
 				// Si traduction existe, on l'utilise, sinon on prend le libelle par default
4456 4456
 				$label = ($obj->label != '-' ? $obj->label : '');
4457
-				if ($langs->trans("DemandReasonType" . $obj->code) != "DemandReasonType" . $obj->code) {
4458
-					$label = $langs->trans("DemandReasonType" . $obj->code); // So translation key DemandReasonTypeSRC_XXX will work
4457
+				if ($langs->trans("DemandReasonType".$obj->code) != "DemandReasonType".$obj->code) {
4458
+					$label = $langs->trans("DemandReasonType".$obj->code); // So translation key DemandReasonTypeSRC_XXX will work
4459 4459
 				}
4460 4460
 				if ($langs->trans($obj->code) != $obj->code) {
4461 4461
 					$label = $langs->trans($obj->code); // So translation key SRC_XXX will work
@@ -4495,9 +4495,9 @@  discard block
 block discarded – undo
4495 4495
 
4496 4496
 		$this->loadCacheInputReason();
4497 4497
 
4498
-		print '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="select_' . $htmlname . '" name="' . $htmlname . '">';
4498
+		print '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="select_'.$htmlname.'" name="'.$htmlname.'">';
4499 4499
 		if ($addempty) {
4500
-			print '<option value="0"' . (empty($selected) ? ' selected' : '') . '>&nbsp;</option>';
4500
+			print '<option value="0"'.(empty($selected) ? ' selected' : '').'>&nbsp;</option>';
4501 4501
 		}
4502 4502
 		foreach ($this->cache_demand_reason as $id => $arraydemandreason) {
4503 4503
 			if ($arraydemandreason['code'] == $exclude) {
@@ -4505,9 +4505,9 @@  discard block
 block discarded – undo
4505 4505
 			}
4506 4506
 
4507 4507
 			if ($selected && ($selected == $arraydemandreason['id'] || $selected == $arraydemandreason['code'])) {
4508
-				print '<option value="' . $arraydemandreason['id'] . '" selected>';
4508
+				print '<option value="'.$arraydemandreason['id'].'" selected>';
4509 4509
 			} else {
4510
-				print '<option value="' . $arraydemandreason['id'] . '">';
4510
+				print '<option value="'.$arraydemandreason['id'].'">';
4511 4511
 			}
4512 4512
 			$label = $arraydemandreason['label']; // Translation of label was already done into the ->loadCacheInputReason
4513 4513
 			print $langs->trans($label);
@@ -4517,7 +4517,7 @@  discard block
 block discarded – undo
4517 4517
 		if ($user->admin && empty($notooltip)) {
4518 4518
 			print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
4519 4519
 		}
4520
-		print ajax_combobox('select_' . $htmlname);
4520
+		print ajax_combobox('select_'.$htmlname);
4521 4521
 	}
4522 4522
 
4523 4523
 	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
@@ -4532,7 +4532,7 @@  discard block
 block discarded – undo
4532 4532
 		// phpcs:enable
4533 4533
 		global $langs;
4534 4534
 
4535
-		$num = count($this->cache_types_paiements);        // TODO Use $conf->cache['payment_mode'] instead of $this->cache_types_paiements
4535
+		$num = count($this->cache_types_paiements); // TODO Use $conf->cache['payment_mode'] instead of $this->cache_types_paiements
4536 4536
 		if ($num > 0) {
4537 4537
 			return $num; // Cache already loaded
4538 4538
 		}
@@ -4542,8 +4542,8 @@  discard block
 block discarded – undo
4542 4542
 		$this->cache_types_paiements = array();
4543 4543
 
4544 4544
 		$sql = "SELECT id, code, libelle as label, type, active";
4545
-		$sql .= " FROM " . $this->db->prefix() . "c_paiement";
4546
-		$sql .= " WHERE entity IN (" . getEntity('c_paiement') . ")";
4545
+		$sql .= " FROM ".$this->db->prefix()."c_paiement";
4546
+		$sql .= " WHERE entity IN (".getEntity('c_paiement').")";
4547 4547
 
4548 4548
 		$resql = $this->db->query($sql);
4549 4549
 		if ($resql) {
@@ -4553,7 +4553,7 @@  discard block
 block discarded – undo
4553 4553
 				$obj = $this->db->fetch_object($resql);
4554 4554
 
4555 4555
 				// Si traduction existe, on l'utilise, sinon on prend le libelle par default
4556
-				$label = ($langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) != "PaymentTypeShort" . $obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) : ($obj->label != '-' ? $obj->label : ''));
4556
+				$label = ($langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) != "PaymentTypeShort".$obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) : ($obj->label != '-' ? $obj->label : ''));
4557 4557
 				$this->cache_types_paiements[$obj->id]['id'] = $obj->id;
4558 4558
 				$this->cache_types_paiements[$obj->id]['code'] = $obj->code;
4559 4559
 				$this->cache_types_paiements[$obj->id]['label'] = $label;
@@ -4625,17 +4625,17 @@  discard block
 block discarded – undo
4625 4625
 		global $langs, $user, $conf;
4626 4626
 
4627 4627
 		$out = '';
4628
-		dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG);
4628
+		dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG);
4629 4629
 
4630 4630
 		$this->load_cache_conditions_paiements();
4631 4631
 
4632 4632
 		// Set default value if not already set by caller
4633 4633
 		if (empty($selected) && getDolGlobalString('MAIN_DEFAULT_PAYMENT_TERM_ID')) {
4634
-			dol_syslog(__METHOD__ . "Using deprecated option MAIN_DEFAULT_PAYMENT_TERM_ID", LOG_NOTICE);
4634
+			dol_syslog(__METHOD__."Using deprecated option MAIN_DEFAULT_PAYMENT_TERM_ID", LOG_NOTICE);
4635 4635
 			$selected = getDolGlobalString('MAIN_DEFAULT_PAYMENT_TERM_ID');
4636 4636
 		}
4637 4637
 
4638
-		$out .= '<select id="' . $htmlname . '" class="flat selectpaymentterms' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">';
4638
+		$out .= '<select id="'.$htmlname.'" class="flat selectpaymentterms'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
4639 4639
 		if ($addempty) {
4640 4640
 			$out .= '<option value="0">&nbsp;</option>';
4641 4641
 		}
@@ -4649,9 +4649,9 @@  discard block
 block discarded – undo
4649 4649
 
4650 4650
 			if ($selected == $id) {
4651 4651
 				$selectedDepositPercent = $deposit_percent > 0 ? $deposit_percent : $arrayconditions['deposit_percent'];
4652
-				$out .= '<option value="' . $id . '" data-deposit_percent="' . $arrayconditions['deposit_percent'] . '" selected>';
4652
+				$out .= '<option value="'.$id.'" data-deposit_percent="'.$arrayconditions['deposit_percent'].'" selected>';
4653 4653
 			} else {
4654
-				$out .= '<option value="' . $id . '" data-deposit_percent="' . $arrayconditions['deposit_percent'] . '">';
4654
+				$out .= '<option value="'.$id.'" data-deposit_percent="'.$arrayconditions['deposit_percent'].'">';
4655 4655
 			}
4656 4656
 			$label = $arrayconditions['label'];
4657 4657
 
@@ -4669,21 +4669,21 @@  discard block
 block discarded – undo
4669 4669
 		$out .= ajax_combobox($htmlname);
4670 4670
 
4671 4671
 		if ($deposit_percent >= 0) {
4672
-			$out .= ' <span id="' . $htmlname . '_deposit_percent_container"' . (empty($selectedDepositPercent) ? ' style="display: none"' : '') . '>';
4673
-			$out .= $langs->trans('DepositPercent') . ' : ';
4674
-			$out .= '<input id="' . $htmlname . '_deposit_percent" name="' . $htmlname . '_deposit_percent" class="maxwidth50" value="' . $deposit_percent . '" />';
4672
+			$out .= ' <span id="'.$htmlname.'_deposit_percent_container"'.(empty($selectedDepositPercent) ? ' style="display: none"' : '').'>';
4673
+			$out .= $langs->trans('DepositPercent').' : ';
4674
+			$out .= '<input id="'.$htmlname.'_deposit_percent" name="'.$htmlname.'_deposit_percent" class="maxwidth50" value="'.$deposit_percent.'" />';
4675 4675
 			$out .= '</span>';
4676 4676
 			$out .= '
4677
-				<script nonce="' . getNonce() . '">
4677
+				<script nonce="' . getNonce().'">
4678 4678
 					$(document).ready(function () {
4679
-						$("#' . $htmlname . '").change(function () {
4679
+						$("#' . $htmlname.'").change(function () {
4680 4680
 							let $selected = $(this).find("option:selected");
4681 4681
 							let depositPercent = $selected.attr("data-deposit_percent");
4682 4682
 
4683 4683
 							if (depositPercent.length > 0) {
4684
-								$("#' . $htmlname . '_deposit_percent_container").show().find("#' . $htmlname . '_deposit_percent").val(depositPercent);
4684
+								$("#' . $htmlname.'_deposit_percent_container").show().find("#'.$htmlname.'_deposit_percent").val(depositPercent);
4685 4685
 							} else {
4686
-								$("#' . $htmlname . '_deposit_percent_container").hide();
4686
+								$("#' . $htmlname.'_deposit_percent_container").hide();
4687 4687
 							}
4688 4688
 
4689 4689
 							return true;
@@ -4721,7 +4721,7 @@  discard block
 block discarded – undo
4721 4721
 
4722 4722
 		$out = '';
4723 4723
 
4724
-		dol_syslog(__METHOD__ . " " . $selected . ", " . $htmlname . ", " . $filtertype . ", " . $format, LOG_DEBUG);
4724
+		dol_syslog(__METHOD__." ".$selected.", ".$htmlname.", ".$filtertype.", ".$format, LOG_DEBUG);
4725 4725
 
4726 4726
 		$filterarray = array();
4727 4727
 		if ($filtertype == 'CRDT') {
@@ -4736,11 +4736,11 @@  discard block
 block discarded – undo
4736 4736
 
4737 4737
 		// Set default value if not already set by caller
4738 4738
 		if (empty($selected) && getDolGlobalString('MAIN_DEFAULT_PAYMENT_TYPE_ID')) {
4739
-			dol_syslog(__METHOD__ . "Using deprecated option MAIN_DEFAULT_PAYMENT_TYPE_ID", LOG_NOTICE);
4739
+			dol_syslog(__METHOD__."Using deprecated option MAIN_DEFAULT_PAYMENT_TYPE_ID", LOG_NOTICE);
4740 4740
 			$selected = getDolGlobalString('MAIN_DEFAULT_PAYMENT_TYPE_ID');
4741 4741
 		}
4742 4742
 
4743
-		$out .= '<select id="select' . $htmlname . '" class="flat selectpaymenttypes' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">';
4743
+		$out .= '<select id="select'.$htmlname.'" class="flat selectpaymenttypes'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
4744 4744
 		if ($empty) {
4745 4745
 			$out .= '<option value="">&nbsp;</option>';
4746 4746
 		}
@@ -4761,13 +4761,13 @@  discard block
 block discarded – undo
4761 4761
 			}
4762 4762
 
4763 4763
 			if ($format == 0) {
4764
-				$out .= '<option value="' . $id . '" data-code="'.$arraytypes['code'].'"';
4764
+				$out .= '<option value="'.$id.'" data-code="'.$arraytypes['code'].'"';
4765 4765
 			} elseif ($format == 1) {
4766
-				$out .= '<option value="' . $arraytypes['code'] . '"';
4766
+				$out .= '<option value="'.$arraytypes['code'].'"';
4767 4767
 			} elseif ($format == 2) {
4768
-				$out .= '<option value="' . $arraytypes['code'] . '"';
4768
+				$out .= '<option value="'.$arraytypes['code'].'"';
4769 4769
 			} elseif ($format == 3) {
4770
-				$out .= '<option value="' . $id . '"';
4770
+				$out .= '<option value="'.$id.'"';
4771 4771
 			}
4772 4772
 			// Print attribute selected or not
4773 4773
 			if ($format == 1 || $format == 2) {
@@ -4797,7 +4797,7 @@  discard block
 block discarded – undo
4797 4797
 		if ($user->admin && !$noadmininfo) {
4798 4798
 			$out .= info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
4799 4799
 		}
4800
-		$out .= ajax_combobox('select' . $htmlname);
4800
+		$out .= ajax_combobox('select'.$htmlname);
4801 4801
 
4802 4802
 		if (empty($nooutput)) {
4803 4803
 			print $out;
@@ -4819,22 +4819,22 @@  discard block
 block discarded – undo
4819 4819
 	{
4820 4820
 		global $langs;
4821 4821
 
4822
-		$return = '<select class="flat maxwidth100" id="select_' . $htmlname . '" name="' . $htmlname . '">';
4822
+		$return = '<select class="flat maxwidth100" id="select_'.$htmlname.'" name="'.$htmlname.'">';
4823 4823
 		$options = array(
4824 4824
 			'HT' => $langs->trans("HT"),
4825 4825
 			'TTC' => $langs->trans("TTC")
4826 4826
 		);
4827 4827
 		foreach ($options as $id => $value) {
4828 4828
 			if ($selected == $id) {
4829
-				$return .= '<option value="' . $id . '" selected>' . $value;
4829
+				$return .= '<option value="'.$id.'" selected>'.$value;
4830 4830
 			} else {
4831
-				$return .= '<option value="' . $id . '">' . $value;
4831
+				$return .= '<option value="'.$id.'">'.$value;
4832 4832
 			}
4833 4833
 			$return .= '</option>';
4834 4834
 		}
4835 4835
 		$return .= '</select>';
4836 4836
 		if ($addjscombo) {
4837
-			$return .= ajax_combobox('select_' . $htmlname);
4837
+			$return .= ajax_combobox('select_'.$htmlname);
4838 4838
 		}
4839 4839
 
4840 4840
 		return $return;
@@ -4852,7 +4852,7 @@  discard block
 block discarded – undo
4852 4852
 		// phpcs:enable
4853 4853
 		global $langs;
4854 4854
 
4855
-		$num = count($this->cache_transport_mode);        // TODO Use $conf->cache['payment_mode'] instead of $this->cache_transport_mode
4855
+		$num = count($this->cache_transport_mode); // TODO Use $conf->cache['payment_mode'] instead of $this->cache_transport_mode
4856 4856
 		if ($num > 0) {
4857 4857
 			return $num; // Cache already loaded
4858 4858
 		}
@@ -4862,8 +4862,8 @@  discard block
 block discarded – undo
4862 4862
 		$this->cache_transport_mode = array();
4863 4863
 
4864 4864
 		$sql = "SELECT rowid, code, label, active";
4865
-		$sql .= " FROM " . $this->db->prefix() . "c_transport_mode";
4866
-		$sql .= " WHERE entity IN (" . getEntity('c_transport_mode') . ")";
4865
+		$sql .= " FROM ".$this->db->prefix()."c_transport_mode";
4866
+		$sql .= " WHERE entity IN (".getEntity('c_transport_mode').")";
4867 4867
 
4868 4868
 		$resql = $this->db->query($sql);
4869 4869
 		if ($resql) {
@@ -4873,7 +4873,7 @@  discard block
 block discarded – undo
4873 4873
 				$obj = $this->db->fetch_object($resql);
4874 4874
 
4875 4875
 				// If traduction exist, we use it else we take the default label
4876
-				$label = ($langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) != "PaymentTypeShort" . $obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) : ($obj->label != '-' ? $obj->label : ''));
4876
+				$label = ($langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) != "PaymentTypeShort".$obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) : ($obj->label != '-' ? $obj->label : ''));
4877 4877
 				$this->cache_transport_mode[$obj->rowid]['rowid'] = $obj->rowid;
4878 4878
 				$this->cache_transport_mode[$obj->rowid]['code'] = $obj->code;
4879 4879
 				$this->cache_transport_mode[$obj->rowid]['label'] = $label;
@@ -4907,11 +4907,11 @@  discard block
 block discarded – undo
4907 4907
 	{
4908 4908
 		global $langs, $user;
4909 4909
 
4910
-		dol_syslog(__METHOD__ . " " . $selected . ", " . $htmlname . ", " . $format, LOG_DEBUG);
4910
+		dol_syslog(__METHOD__." ".$selected.", ".$htmlname.", ".$format, LOG_DEBUG);
4911 4911
 
4912 4912
 		$this->load_cache_transport_mode();
4913 4913
 
4914
-		print '<select id="select' . $htmlname . '" class="flat selectmodetransport' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">';
4914
+		print '<select id="select'.$htmlname.'" class="flat selectmodetransport'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
4915 4915
 		if ($empty) {
4916 4916
 			print '<option value="">&nbsp;</option>';
4917 4917
 		}
@@ -4927,13 +4927,13 @@  discard block
 block discarded – undo
4927 4927
 			}
4928 4928
 
4929 4929
 			if ($format == 0) {
4930
-				print '<option value="' . $id . '"';
4930
+				print '<option value="'.$id.'"';
4931 4931
 			} elseif ($format == 1) {
4932
-				print '<option value="' . $arraytypes['code'] . '"';
4932
+				print '<option value="'.$arraytypes['code'].'"';
4933 4933
 			} elseif ($format == 2) {
4934
-				print '<option value="' . $arraytypes['code'] . '"';
4934
+				print '<option value="'.$arraytypes['code'].'"';
4935 4935
 			} elseif ($format == 3) {
4936
-				print '<option value="' . $id . '"';
4936
+				print '<option value="'.$id.'"';
4937 4937
 			}
4938 4938
 			// If text is selected, we compare with code, else with id
4939 4939
 			if (preg_match('/[a-z]/i', $selected) && $selected == $arraytypes['code']) {
@@ -4984,31 +4984,31 @@  discard block
 block discarded – undo
4984 4984
 		$langs->load("deliveries");
4985 4985
 
4986 4986
 		$sql = "SELECT rowid, code, libelle as label";
4987
-		$sql .= " FROM " . $this->db->prefix() . "c_shipment_mode";
4987
+		$sql .= " FROM ".$this->db->prefix()."c_shipment_mode";
4988 4988
 		$sql .= " WHERE active > 0";
4989 4989
 		if ($filtre) {
4990
-			$sql .= " AND " . $filtre;
4990
+			$sql .= " AND ".$filtre;
4991 4991
 		}
4992 4992
 		$sql .= " ORDER BY libelle ASC";
4993 4993
 
4994
-		dol_syslog(get_class($this) . "::selectShippingMode", LOG_DEBUG);
4994
+		dol_syslog(get_class($this)."::selectShippingMode", LOG_DEBUG);
4995 4995
 		$result = $this->db->query($sql);
4996 4996
 		if ($result) {
4997 4997
 			$num = $this->db->num_rows($result);
4998 4998
 			$i = 0;
4999 4999
 			if ($num) {
5000
-				print '<select id="select' . $htmlname . '" class="flat selectshippingmethod' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>';
5000
+				print '<select id="select'.$htmlname.'" class="flat selectshippingmethod'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>';
5001 5001
 				if ($useempty == 1 || ($useempty == 2 && $num > 1)) {
5002 5002
 					print '<option value="-1">&nbsp;</option>';
5003 5003
 				}
5004 5004
 				while ($i < $num) {
5005 5005
 					$obj = $this->db->fetch_object($result);
5006 5006
 					if ($selected == $obj->rowid) {
5007
-						print '<option value="' . $obj->rowid . '" selected>';
5007
+						print '<option value="'.$obj->rowid.'" selected>';
5008 5008
 					} else {
5009
-						print '<option value="' . $obj->rowid . '">';
5009
+						print '<option value="'.$obj->rowid.'">';
5010 5010
 					}
5011
-					print ($langs->trans("SendingMethod" . strtoupper($obj->code)) != "SendingMethod" . strtoupper($obj->code)) ? $langs->trans("SendingMethod" . strtoupper($obj->code)) : $obj->label;
5011
+					print ($langs->trans("SendingMethod".strtoupper($obj->code)) != "SendingMethod".strtoupper($obj->code)) ? $langs->trans("SendingMethod".strtoupper($obj->code)) : $obj->label;
5012 5012
 					print '</option>';
5013 5013
 					$i++;
5014 5014
 				}
@@ -5017,7 +5017,7 @@  discard block
 block discarded – undo
5017 5017
 					print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
5018 5018
 				}
5019 5019
 
5020
-				print ajax_combobox('select' . $htmlname);
5020
+				print ajax_combobox('select'.$htmlname);
5021 5021
 			} else {
5022 5022
 				print $langs->trans("NoShippingMethodDefined");
5023 5023
 			}
@@ -5042,16 +5042,16 @@  discard block
 block discarded – undo
5042 5042
 		$langs->load("deliveries");
5043 5043
 
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="setshippingmethod">';
5047
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
5047
+			print '<input type="hidden" name="token" value="'.newToken().'">';
5048 5048
 			$this->selectShippingMethod($selected, $htmlname, '', $addempty);
5049
-			print '<input type="submit" class="button valignmiddle" value="' . $langs->trans("Modify") . '">';
5049
+			print '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
5050 5050
 			print '</form>';
5051 5051
 		} else {
5052 5052
 			if ($selected) {
5053 5053
 				$code = $langs->getLabelFromKey($this->db, $selected, 'c_shipment_mode', 'rowid', 'code');
5054
-				print $langs->trans("SendingMethod" . strtoupper($code));
5054
+				print $langs->trans("SendingMethod".strtoupper($code));
5055 5055
 			} else {
5056 5056
 				print "&nbsp;";
5057 5057
 			}
@@ -5074,10 +5074,10 @@  discard block
 block discarded – undo
5074 5074
 
5075 5075
 		$opt = '<option value="" selected></option>';
5076 5076
 		$sql = "SELECT rowid, ref, situation_cycle_ref, situation_counter, situation_final, fk_soc";
5077
-		$sql .= ' FROM ' . $this->db->prefix() . 'facture';
5078
-		$sql .= ' WHERE entity IN (' . getEntity('invoice') . ')';
5077
+		$sql .= ' FROM '.$this->db->prefix().'facture';
5078
+		$sql .= ' WHERE entity IN ('.getEntity('invoice').')';
5079 5079
 		$sql .= ' AND situation_counter >= 1';
5080
-		$sql .= ' AND fk_soc = ' . (int) $socid;
5080
+		$sql .= ' AND fk_soc = '.(int) $socid;
5081 5081
 		$sql .= ' AND type <> 2';
5082 5082
 		$sql .= ' ORDER by situation_cycle_ref, situation_counter desc';
5083 5083
 		$resql = $this->db->query($sql);
@@ -5095,19 +5095,19 @@  discard block
 block discarded – undo
5095 5095
 						//Not prov?
5096 5096
 						if (substr($obj->ref, 1, 4) != 'PROV') {
5097 5097
 							if ($selected == $obj->rowid) {
5098
-								$opt .= '<option value="' . $obj->rowid . '" selected>' . $obj->ref . '</option>';
5098
+								$opt .= '<option value="'.$obj->rowid.'" selected>'.$obj->ref.'</option>';
5099 5099
 							} else {
5100
-								$opt .= '<option value="' . $obj->rowid . '">' . $obj->ref . '</option>';
5100
+								$opt .= '<option value="'.$obj->rowid.'">'.$obj->ref.'</option>';
5101 5101
 							}
5102 5102
 						}
5103 5103
 					}
5104 5104
 				}
5105 5105
 			}
5106 5106
 		} else {
5107
-			dol_syslog("Error sql=" . $sql . ", error=" . $this->error, LOG_ERR);
5107
+			dol_syslog("Error sql=".$sql.", error=".$this->error, LOG_ERR);
5108 5108
 		}
5109 5109
 		if ($opt == '<option value ="" selected></option>') {
5110
-			$opt = '<option value ="0" selected>' . $langs->trans('NoSituations') . '</option>';
5110
+			$opt = '<option value ="0" selected>'.$langs->trans('NoSituations').'</option>';
5111 5111
 		}
5112 5112
 		return $opt;
5113 5113
 	}
@@ -5127,12 +5127,12 @@  discard block
 block discarded – undo
5127 5127
 
5128 5128
 		$langs->load('products');
5129 5129
 
5130
-		$return = '<select class="flat" id="' . $htmlname . '" name="' . $htmlname . '">';
5130
+		$return = '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'">';
5131 5131
 
5132
-		$sql = "SELECT rowid, label, code FROM " . $this->db->prefix() . "c_units";
5132
+		$sql = "SELECT rowid, label, code FROM ".$this->db->prefix()."c_units";
5133 5133
 		$sql .= ' WHERE active > 0';
5134 5134
 		if (!empty($unit_type)) {
5135
-			$sql .= " AND unit_type = '" . $this->db->escape($unit_type) . "'";
5135
+			$sql .= " AND unit_type = '".$this->db->escape($unit_type)."'";
5136 5136
 		}
5137 5137
 		$sql .= " ORDER BY sortorder";
5138 5138
 
@@ -5144,14 +5144,14 @@  discard block
 block discarded – undo
5144 5144
 
5145 5145
 			while ($res = $this->db->fetch_object($resql)) {
5146 5146
 				$unitLabel = $res->label;
5147
-				if (!empty($langs->tab_translate['unit' . $res->code])) {    // check if Translation is available before
5148
-					$unitLabel = $langs->trans('unit' . $res->code) != $res->label ? $langs->trans('unit' . $res->code) : $res->label;
5147
+				if (!empty($langs->tab_translate['unit'.$res->code])) {    // check if Translation is available before
5148
+					$unitLabel = $langs->trans('unit'.$res->code) != $res->label ? $langs->trans('unit'.$res->code) : $res->label;
5149 5149
 				}
5150 5150
 
5151 5151
 				if ($selected == $res->rowid) {
5152
-					$return .= '<option value="' . $res->rowid . '" selected>' . $unitLabel . '</option>';
5152
+					$return .= '<option value="'.$res->rowid.'" selected>'.$unitLabel.'</option>';
5153 5153
 				} else {
5154
-					$return .= '<option value="' . $res->rowid . '">' . $unitLabel . '</option>';
5154
+					$return .= '<option value="'.$res->rowid.'">'.$unitLabel.'</option>';
5155 5155
 				}
5156 5156
 			}
5157 5157
 			$return .= '</select>';
@@ -5188,29 +5188,29 @@  discard block
 block discarded – undo
5188 5188
 		$num = 0;
5189 5189
 
5190 5190
 		$sql = "SELECT rowid, label, bank, clos as status, currency_code";
5191
-		$sql .= " FROM " . $this->db->prefix() . "bank_account";
5192
-		$sql .= " WHERE entity IN (" . getEntity('bank_account') . ")";
5191
+		$sql .= " FROM ".$this->db->prefix()."bank_account";
5192
+		$sql .= " WHERE entity IN (".getEntity('bank_account').")";
5193 5193
 		if ($status != 2) {
5194
-			$sql .= " AND clos = " . (int) $status;
5194
+			$sql .= " AND clos = ".(int) $status;
5195 5195
 		}
5196 5196
 		if ($filtre) {	// TODO Support USF
5197
-			$sql .= " AND " . $filtre;
5197
+			$sql .= " AND ".$filtre;
5198 5198
 		}
5199 5199
 		$sql .= " ORDER BY label";
5200 5200
 
5201
-		dol_syslog(get_class($this) . "::select_comptes", LOG_DEBUG);
5201
+		dol_syslog(get_class($this)."::select_comptes", LOG_DEBUG);
5202 5202
 		$result = $this->db->query($sql);
5203 5203
 		if ($result) {
5204 5204
 			$num = $this->db->num_rows($result);
5205 5205
 			$i = 0;
5206 5206
 
5207
-			$out .= '<select id="select' . $htmlname . '" class="flat selectbankaccount' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>';
5207
+			$out .= '<select id="select'.$htmlname.'" class="flat selectbankaccount'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>';
5208 5208
 
5209 5209
 			if ($num == 0) {
5210 5210
 				if ($status == 0) {
5211
-					$out .= '<option class="opacitymedium" value="-1">' . $langs->trans("NoActiveBankAccountDefined") . '</span>';
5211
+					$out .= '<option class="opacitymedium" value="-1">'.$langs->trans("NoActiveBankAccountDefined").'</span>';
5212 5212
 				} else {
5213
-					$out .= '<option class="opacitymedium" value="-1">' . $langs->trans("NoBankAccountDefined") . '</span>';
5213
+					$out .= '<option class="opacitymedium" value="-1">'.$langs->trans("NoBankAccountDefined").'</span>';
5214 5214
 				}
5215 5215
 			} else {
5216 5216
 				if (!empty($useempty) && !is_numeric($useempty)) {
@@ -5226,25 +5226,25 @@  discard block
 block discarded – undo
5226 5226
 				$labeltoshow = trim($obj->label);
5227 5227
 				$labeltoshowhtml = trim($obj->label);
5228 5228
 				if ($showcurrency) {
5229
-					$labeltoshow .= ' (' . $obj->currency_code . ')';
5230
-					$labeltoshowhtml .= ' <span class="opacitymedium">(' . $obj->currency_code . ')</span>';
5229
+					$labeltoshow .= ' ('.$obj->currency_code.')';
5230
+					$labeltoshowhtml .= ' <span class="opacitymedium">('.$obj->currency_code.')</span>';
5231 5231
 				}
5232 5232
 				if ($status == 2 && $obj->status == 1) {
5233
-					$labeltoshow .= ' (' . $langs->trans("Closed") . ')';
5234
-					$labeltoshowhtml .= ' <span class="opacitymedium">(' . $langs->trans("Closed") . ')</span>';
5233
+					$labeltoshow .= ' ('.$langs->trans("Closed").')';
5234
+					$labeltoshowhtml .= ' <span class="opacitymedium">('.$langs->trans("Closed").')</span>';
5235 5235
 				}
5236 5236
 
5237 5237
 				if ($selected == $obj->rowid || ($useempty == 2 && $num == 1 && empty($selected))) {
5238
-					$out .= '<option value="' . $obj->rowid . '" data-currency-code="' . $obj->currency_code . '" data-html="'.dolPrintHTMLForAttribute($labeltoshowhtml).'" selected>';
5238
+					$out .= '<option value="'.$obj->rowid.'" data-currency-code="'.$obj->currency_code.'" data-html="'.dolPrintHTMLForAttribute($labeltoshowhtml).'" selected>';
5239 5239
 				} else {
5240
-					$out .= '<option value="' . $obj->rowid . '" data-currency-code="' . $obj->currency_code . '" data-html="'.dolPrintHTMLForAttribute($labeltoshowhtml).'">';
5240
+					$out .= '<option value="'.$obj->rowid.'" data-currency-code="'.$obj->currency_code.'" data-html="'.dolPrintHTMLForAttribute($labeltoshowhtml).'">';
5241 5241
 				}
5242 5242
 				$out .= $labeltoshow;
5243 5243
 				$out .= '</option>';
5244 5244
 				$i++;
5245 5245
 			}
5246 5246
 			$out .= "</select>";
5247
-			$out .= ajax_combobox('select' . $htmlname);
5247
+			$out .= ajax_combobox('select'.$htmlname);
5248 5248
 		} else {
5249 5249
 			dol_print_error($this->db);
5250 5250
 		}
@@ -5283,22 +5283,22 @@  discard block
 block discarded – undo
5283 5283
 		$num = 0;
5284 5284
 
5285 5285
 		$sql = "SELECT rowid, label, bank, status, iban_prefix, bic";
5286
-		$sql .= " FROM " . $this->db->prefix() . "societe_rib";
5287
-		$sql .=  " WHERE type = 'ban'";
5286
+		$sql .= " FROM ".$this->db->prefix()."societe_rib";
5287
+		$sql .= " WHERE type = 'ban'";
5288 5288
 		if ($filtre) {	// TODO Support USF
5289
-			$sql .= " AND " . $filtre;
5289
+			$sql .= " AND ".$filtre;
5290 5290
 		}
5291 5291
 		$sql .= " ORDER BY label";
5292
-		dol_syslog(get_class($this) . "::select_comptes", LOG_DEBUG);
5292
+		dol_syslog(get_class($this)."::select_comptes", LOG_DEBUG);
5293 5293
 		$result = $this->db->query($sql);
5294 5294
 		if ($result) {
5295 5295
 			$num = $this->db->num_rows($result);
5296 5296
 			$i = 0;
5297 5297
 
5298
-			$out .= '<select id="select' . $htmlname . '" class="flat selectbankaccount' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>';
5298
+			$out .= '<select id="select'.$htmlname.'" class="flat selectbankaccount'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>';
5299 5299
 
5300 5300
 			if ($num == 0) {
5301
-				$out .= '<option class="opacitymedium" value="-1">' . $langs->trans("NoBankAccountDefined") . '</span>';
5301
+				$out .= '<option class="opacitymedium" value="-1">'.$langs->trans("NoBankAccountDefined").'</span>';
5302 5302
 			} else {
5303 5303
 				if (!empty($useempty) && !is_numeric($useempty)) {
5304 5304
 					$out .= '<option value="-1">'.$langs->trans($useempty).'</option>';
@@ -5311,19 +5311,19 @@  discard block
 block discarded – undo
5311 5311
 				$obj = $this->db->fetch_object($result);
5312 5312
 				$iban = dolDecrypt($obj->iban_prefix);
5313 5313
 				if ($selected == $obj->rowid || ($useempty == 2 && $num == 1 && empty($selected))) {
5314
-					$out .= '<option value="' . $obj->rowid . '" data-iban-prefix="' . $iban . ' data-bic="' . $obj->bic . '" selected>';
5314
+					$out .= '<option value="'.$obj->rowid.'" data-iban-prefix="'.$iban.' data-bic="'.$obj->bic.'" selected>';
5315 5315
 				} else {
5316
-					$out .= '<option value="' . $obj->rowid . '" data-iban-prefix="' . $iban . ' data-bic="' . $obj->bic . '">';
5316
+					$out .= '<option value="'.$obj->rowid.'" data-iban-prefix="'.$iban.' data-bic="'.$obj->bic.'">';
5317 5317
 				}
5318 5318
 				$out .= trim($obj->label);
5319 5319
 				if ($showibanbic) {
5320
-					$out .= ' (' . $iban . '/' .$obj->bic. ')';
5320
+					$out .= ' ('.$iban.'/'.$obj->bic.')';
5321 5321
 				}
5322 5322
 				$out .= '</option>';
5323 5323
 				$i++;
5324 5324
 			}
5325 5325
 			$out .= "</select>";
5326
-			$out .= ajax_combobox('select' . $htmlname);
5326
+			$out .= ajax_combobox('select'.$htmlname);
5327 5327
 		} else {
5328 5328
 			dol_print_error($this->db);
5329 5329
 		}
@@ -5357,23 +5357,23 @@  discard block
 block discarded – undo
5357 5357
 		$num = 0;
5358 5358
 
5359 5359
 		$sql = "SELECT rowid, name, fk_country, status, entity";
5360
-		$sql .= " FROM " . $this->db->prefix() . "establishment";
5360
+		$sql .= " FROM ".$this->db->prefix()."establishment";
5361 5361
 		$sql .= " WHERE 1=1";
5362 5362
 		if ($status != 2) {
5363
-			$sql .= " AND status = " . (int) $status;
5363
+			$sql .= " AND status = ".(int) $status;
5364 5364
 		}
5365 5365
 		if ($filtre) {	// TODO Support USF
5366
-			$sql .= " AND " . $filtre;
5366
+			$sql .= " AND ".$filtre;
5367 5367
 		}
5368 5368
 		$sql .= " ORDER BY name";
5369 5369
 
5370
-		dol_syslog(get_class($this) . "::select_establishment", LOG_DEBUG);
5370
+		dol_syslog(get_class($this)."::select_establishment", LOG_DEBUG);
5371 5371
 		$result = $this->db->query($sql);
5372 5372
 		if ($result) {
5373 5373
 			$num = $this->db->num_rows($result);
5374 5374
 			$i = 0;
5375 5375
 			if ($num) {
5376
-				print '<select id="select' . $htmlname . '" class="flat selectestablishment" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>';
5376
+				print '<select id="select'.$htmlname.'" class="flat selectestablishment" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>';
5377 5377
 				if ($useempty == 1 || ($useempty == 2 && $num > 1)) {
5378 5378
 					print '<option value="-1">&nbsp;</option>';
5379 5379
 				}
@@ -5381,13 +5381,13 @@  discard block
 block discarded – undo
5381 5381
 				while ($i < $num) {
5382 5382
 					$obj = $this->db->fetch_object($result);
5383 5383
 					if ($selected == $obj->rowid) {
5384
-						print '<option value="' . $obj->rowid . '" selected>';
5384
+						print '<option value="'.$obj->rowid.'" selected>';
5385 5385
 					} else {
5386
-						print '<option value="' . $obj->rowid . '">';
5386
+						print '<option value="'.$obj->rowid.'">';
5387 5387
 					}
5388 5388
 					print trim($obj->name);
5389 5389
 					if ($status == 2 && $obj->status == 1) {
5390
-						print ' (' . $langs->trans("Closed") . ')';
5390
+						print ' ('.$langs->trans("Closed").')';
5391 5391
 					}
5392 5392
 					print '</option>';
5393 5393
 					$i++;
@@ -5395,9 +5395,9 @@  discard block
 block discarded – undo
5395 5395
 				print "</select>";
5396 5396
 			} else {
5397 5397
 				if ($status == 0) {
5398
-					print '<span class="opacitymedium">' . $langs->trans("NoActiveEstablishmentDefined") . '</span>';
5398
+					print '<span class="opacitymedium">'.$langs->trans("NoActiveEstablishmentDefined").'</span>';
5399 5399
 				} else {
5400
-					print '<span class="opacitymedium">' . $langs->trans("NoEstablishmentFound") . '</span>';
5400
+					print '<span class="opacitymedium">'.$langs->trans("NoEstablishmentFound").'</span>';
5401 5401
 				}
5402 5402
 			}
5403 5403
 
@@ -5421,20 +5421,20 @@  discard block
 block discarded – undo
5421 5421
 	{
5422 5422
 		global $langs;
5423 5423
 		if ($htmlname != "none") {
5424
-			print '<form method="POST" action="' . $page . '">';
5424
+			print '<form method="POST" action="'.$page.'">';
5425 5425
 			print '<input type="hidden" name="action" value="setbankaccount">';
5426
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
5426
+			print '<input type="hidden" name="token" value="'.newToken().'">';
5427 5427
 			print img_picto('', 'bank_account', 'class="pictofixedwidth"');
5428 5428
 			$nbaccountfound = $this->select_comptes($selected, $htmlname, 0, '', $addempty);
5429 5429
 			if ($nbaccountfound > 0) {
5430
-				print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
5430
+				print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
5431 5431
 			}
5432 5432
 			print '</form>';
5433 5433
 		} else {
5434 5434
 			$langs->load('banks');
5435 5435
 
5436 5436
 			if ($selected) {
5437
-				require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php';
5437
+				require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
5438 5438
 				$bankstatic = new Account($this->db);
5439 5439
 				$result = $bankstatic->fetch($selected);
5440 5440
 				if ($result) {
@@ -5461,25 +5461,25 @@  discard block
 block discarded – undo
5461 5461
 	{
5462 5462
 		global $langs;
5463 5463
 		if ($htmlname != "none") {
5464
-			print '<form method="POST" action="' . $page . '">';
5464
+			print '<form method="POST" action="'.$page.'">';
5465 5465
 			print '<input type="hidden" name="action" value="setbankaccountcustomer">';
5466
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
5466
+			print '<input type="hidden" name="token" value="'.newToken().'">';
5467 5467
 			$nbaccountfound = $this->selectRib($selected, $htmlname, $filtre, $addempty, '', $showibanbic);
5468 5468
 			if ($nbaccountfound > 0) {
5469
-				print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
5469
+				print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
5470 5470
 			}
5471 5471
 			print '</form>';
5472 5472
 		} else {
5473 5473
 			$langs->load('banks');
5474 5474
 
5475 5475
 			if ($selected) {
5476
-				require_once DOL_DOCUMENT_ROOT . '/societe/class/companybankaccount.class.php';
5476
+				require_once DOL_DOCUMENT_ROOT.'/societe/class/companybankaccount.class.php';
5477 5477
 				$bankstatic = new CompanyBankAccount($this->db);
5478 5478
 				$result = $bankstatic->fetch($selected);
5479 5479
 				if ($result) {
5480 5480
 					print $bankstatic->label;
5481 5481
 					if ($showibanbic) {
5482
-						print ' (' . $bankstatic->iban . '/' .$bankstatic->bic. ')';
5482
+						print ' ('.$bankstatic->iban.'/'.$bankstatic->bic.')';
5483 5483
 					}
5484 5484
 				}
5485 5485
 			} else {
@@ -5515,11 +5515,11 @@  discard block
 block discarded – undo
5515 5515
 		global $conf, $langs;
5516 5516
 		$langs->load("categories");
5517 5517
 
5518
-		include_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
5518
+		include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
5519 5519
 
5520 5520
 		// For backward compatibility
5521 5521
 		if (is_numeric($type)) {
5522
-			dol_syslog(__METHOD__ . ': using numeric value for parameter type is deprecated. Use string code instead.', LOG_WARNING);
5522
+			dol_syslog(__METHOD__.': using numeric value for parameter type is deprecated. Use string code instead.', LOG_WARNING);
5523 5523
 		}
5524 5524
 
5525 5525
 		if ($type === Categorie::TYPE_BANK_LINE) {
@@ -5527,8 +5527,8 @@  discard block
 block discarded – undo
5527 5527
 			$cat = new Categorie($this->db);
5528 5528
 			$cate_arbo = array();
5529 5529
 			$sql = "SELECT c.label, c.rowid";
5530
-			$sql .= " FROM " . $this->db->prefix() . "categorie as c";
5531
-			$sql .= " WHERE entity = " . $conf->entity . " AND type = " . ((int) $cat->getMapId()[$type]);
5530
+			$sql .= " FROM ".$this->db->prefix()."categorie as c";
5531
+			$sql .= " WHERE entity = ".$conf->entity." AND type = ".((int) $cat->getMapId()[$type]);
5532 5532
 			$sql .= " ORDER BY c.label";
5533 5533
 			$result = $this->db->query($sql);
5534 5534
 			if ($result) {
@@ -5554,12 +5554,12 @@  discard block
 block discarded – undo
5554 5554
 		$outarrayrichhtml = array();
5555 5555
 
5556 5556
 
5557
-		$output = '<select class="flat minwidth100' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
5557
+		$output = '<select class="flat minwidth100'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
5558 5558
 		if (is_array($cate_arbo)) {
5559 5559
 			$num = count($cate_arbo);
5560 5560
 
5561 5561
 			if (!$num) {
5562
-				$output .= '<option value="-1" disabled>' . $langs->trans("NoCategoriesDefined") . '</option>';
5562
+				$output .= '<option value="-1" disabled>'.$langs->trans("NoCategoriesDefined").'</option>';
5563 5563
 			} else {
5564 5564
 				if ($useempty == 1 || ($useempty == 2 && $num > 1)) {
5565 5565
 					$output .= '<option value="-1">&nbsp;</option>';
@@ -5571,15 +5571,15 @@  discard block
 block discarded – undo
5571 5571
 						$add = '';
5572 5572
 					}
5573 5573
 
5574
-					$labeltoshow = img_picto('', 'category', 'class="pictofixedwidth" style="color: #' . $cate_arbo[$key]['color'] . '"');
5574
+					$labeltoshow = img_picto('', 'category', 'class="pictofixedwidth" style="color: #'.$cate_arbo[$key]['color'].'"');
5575 5575
 					$labeltoshow .= dol_trunc($cate_arbo[$key]['fulllabel'], $maxlength, 'middle');
5576 5576
 
5577 5577
 					$outarray[$cate_arbo[$key]['id']] = $cate_arbo[$key]['fulllabel'];
5578 5578
 
5579 5579
 					$outarrayrichhtml[$cate_arbo[$key]['id']] = $labeltoshow;
5580 5580
 
5581
-					$output .= '<option ' . $add . 'value="' . $cate_arbo[$key]['id'] . '"';
5582
-					$output .= ' data-html="' . dol_escape_htmltag($labeltoshow) . '"';
5581
+					$output .= '<option '.$add.'value="'.$cate_arbo[$key]['id'].'"';
5582
+					$output .= ' data-html="'.dol_escape_htmltag($labeltoshow).'"';
5583 5583
 					$output .= '>';
5584 5584
 					$output .= dol_trunc($cate_arbo[$key]['fulllabel'], $maxlength, 'middle');
5585 5585
 					$output .= '</option>';
@@ -5625,7 +5625,7 @@  discard block
 block discarded – undo
5625 5625
 	public function form_confirm($page, $title, $question, $action, $formquestion = array(), $selectedchoice = "", $useajax = 0, $height = 170, $width = 500)
5626 5626
 	{
5627 5627
 		// phpcs:enable
5628
-		dol_syslog(__METHOD__ . ': using form_confirm is deprecated. Use formconfim instead.', LOG_WARNING);
5628
+		dol_syslog(__METHOD__.': using form_confirm is deprecated. Use formconfim instead.', LOG_WARNING);
5629 5629
 		print $this->formconfirm($page, $title, $question, $action, $formquestion, $selectedchoice, $useajax, $height, $width);
5630 5630
 	}
5631 5631
 
@@ -5660,7 +5660,7 @@  discard block
 block discarded – undo
5660 5660
 	{
5661 5661
 		global $langs, $conf;
5662 5662
 
5663
-		$more = '<!-- formconfirm - before call, page=' . dol_escape_htmltag($page) . ' -->';
5663
+		$more = '<!-- formconfirm - before call, page='.dol_escape_htmltag($page).' -->';
5664 5664
 		$formconfirm = '';
5665 5665
 		$inputok = array();
5666 5666
 		$inputko = array();
@@ -5684,27 +5684,27 @@  discard block
 block discarded – undo
5684 5684
 			foreach ($formquestion as $key => $input) {
5685 5685
 				if (is_array($input) && !empty($input)) {
5686 5686
 					if ($input['type'] == 'hidden') {
5687
-						$moreattr = (!empty($input['moreattr']) ? ' ' . $input['moreattr'] : '');
5688
-						$morecss = (!empty($input['morecss']) ? ' ' . $input['morecss'] : '');
5687
+						$moreattr = (!empty($input['moreattr']) ? ' '.$input['moreattr'] : '');
5688
+						$morecss = (!empty($input['morecss']) ? ' '.$input['morecss'] : '');
5689 5689
 
5690
-						$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";
5690
+						$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";
5691 5691
 					}
5692 5692
 				}
5693 5693
 			}
5694 5694
 
5695 5695
 			// Now add questions
5696 5696
 			$moreonecolumn = '';
5697
-			$more .= '<div class="tagtable paddingtopbottomonly centpercent noborderspacing">' . "\n";
5697
+			$more .= '<div class="tagtable paddingtopbottomonly centpercent noborderspacing">'."\n";
5698 5698
 			foreach ($formquestion as $key => $input) {
5699 5699
 				if (is_array($input) && !empty($input)) {
5700
-					$size = (!empty($input['size']) ? ' size="' . $input['size'] . '"' : '');    // deprecated. Use morecss instead.
5701
-					$moreattr = (!empty($input['moreattr']) ? ' ' . $input['moreattr'] : '');
5702
-					$morecss = (!empty($input['morecss']) ? ' ' . $input['morecss'] : '');
5700
+					$size = (!empty($input['size']) ? ' size="'.$input['size'].'"' : ''); // deprecated. Use morecss instead.
5701
+					$moreattr = (!empty($input['moreattr']) ? ' '.$input['moreattr'] : '');
5702
+					$morecss = (!empty($input['morecss']) ? ' '.$input['morecss'] : '');
5703 5703
 
5704 5704
 					if ($input['type'] == 'text') {
5705
-						$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";
5705
+						$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";
5706 5706
 					} elseif ($input['type'] == 'password') {
5707
-						$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";
5707
+						$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";
5708 5708
 					} elseif ($input['type'] == 'textarea') {
5709 5709
 						/*$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div><div class="tagtd">';
5710 5710
 						$more .= '<textarea name="'.$input['name'].'" class="'.$morecss.'"'.$moreattr.'>';
@@ -5712,8 +5712,8 @@  discard block
 block discarded – undo
5712 5712
 						$more .= '</textarea>';
5713 5713
 						$more .= '</div></div>'."\n";*/
5714 5714
 						$moreonecolumn .= '<div class="margintoponly">';
5715
-						$moreonecolumn .= $input['label'] . '<br>';
5716
-						$moreonecolumn .= '<textarea name="' . dol_escape_htmltag($input['name']) . '" id="' . dol_escape_htmltag($input['name']) . '" class="' . $morecss . '"' . $moreattr . '>';
5715
+						$moreonecolumn .= $input['label'].'<br>';
5716
+						$moreonecolumn .= '<textarea name="'.dol_escape_htmltag($input['name']).'" id="'.dol_escape_htmltag($input['name']).'" class="'.$morecss.'"'.$moreattr.'>';
5717 5717
 						$moreonecolumn .= $input['value'];
5718 5718
 						$moreonecolumn .= '</textarea>';
5719 5719
 						$moreonecolumn .= '</div>';
@@ -5730,20 +5730,20 @@  discard block
 block discarded – undo
5730 5730
 						$disabled = isset($input['select_disabled']) ? $input['select_disabled'] : 0;
5731 5731
 						$sort = isset($input['select_sort']) ? $input['select_sort'] : '';
5732 5732
 
5733
-						$more .= '<div class="tagtr"><div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '">';
5733
+						$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">';
5734 5734
 						if (!empty($input['label'])) {
5735
-							$more .= $input['label'] . '</div><div class="tagtd left">';
5735
+							$more .= $input['label'].'</div><div class="tagtd left">';
5736 5736
 						}
5737 5737
 						if ($input['type'] == 'select') {
5738 5738
 							$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);
5739 5739
 						} else {
5740 5740
 							$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);
5741 5741
 						}
5742
-						$more .= '</div></div>' . "\n";
5742
+						$more .= '</div></div>'."\n";
5743 5743
 					} elseif ($input['type'] == 'checkbox') {
5744 5744
 						$more .= '<div class="tagtr">';
5745
-						$more .= '<div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '"><label for="' . dol_escape_htmltag($input['name']) . '">' . $input['label'] . '</label></div><div class="tagtd">';
5746
-						$more .= '<input type="checkbox" class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . dol_escape_htmltag($input['name']) . '" name="' . dol_escape_htmltag($input['name']) . '"' . $moreattr;
5745
+						$more .= '<div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'"><label for="'.dol_escape_htmltag($input['name']).'">'.$input['label'].'</label></div><div class="tagtd">';
5746
+						$more .= '<input type="checkbox" class="flat'.($morecss ? ' '.$morecss : '').'" id="'.dol_escape_htmltag($input['name']).'" name="'.dol_escape_htmltag($input['name']).'"'.$moreattr;
5747 5747
 						if (!is_bool($input['value']) && $input['value'] != 'false' && $input['value'] != '0' && $input['value'] != '') {
5748 5748
 							$more .= ' checked';
5749 5749
 						}
@@ -5754,19 +5754,19 @@  discard block
 block discarded – undo
5754 5754
 							$more .= ' disabled';
5755 5755
 						}
5756 5756
 						$more .= ' /></div>';
5757
-						$more .= '</div>' . "\n";
5757
+						$more .= '</div>'."\n";
5758 5758
 					} elseif ($input['type'] == 'radio') {
5759 5759
 						$i = 0;
5760 5760
 						foreach ($input['values'] as $selkey => $selval) {
5761 5761
 							$more .= '<div class="tagtr">';
5762 5762
 							if (isset($input['label'])) {
5763 5763
 								if ($i == 0) {
5764
-									$more .= '<div class="tagtd' . (empty($input['tdclass']) ? ' tdtop' : (' tdtop ' . $input['tdclass'])) . '">' . $input['label'] . '</div>';
5764
+									$more .= '<div class="tagtd'.(empty($input['tdclass']) ? ' tdtop' : (' tdtop '.$input['tdclass'])).'">'.$input['label'].'</div>';
5765 5765
 								} else {
5766
-									$more .= '<div class="tagtd' . (empty($input['tdclass']) ? '' : (' "' . $input['tdclass'])) . '">&nbsp;</div>';
5766
+									$more .= '<div class="tagtd'.(empty($input['tdclass']) ? '' : (' "'.$input['tdclass'])).'">&nbsp;</div>';
5767 5767
 								}
5768 5768
 							}
5769
-							$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;
5769
+							$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;
5770 5770
 							if (!empty($input['disabled'])) {
5771 5771
 								$more .= ' disabled';
5772 5772
 							}
@@ -5774,12 +5774,12 @@  discard block
 block discarded – undo
5774 5774
 								$more .= ' checked="checked"';
5775 5775
 							}
5776 5776
 							$more .= ' /> ';
5777
-							$more .= '<label for="' . dol_escape_htmltag($input['name'] . $selkey) . '" class="valignmiddle">' . $selval . '</label>';
5778
-							$more .= '</div></div>' . "\n";
5777
+							$more .= '<label for="'.dol_escape_htmltag($input['name'].$selkey).'" class="valignmiddle">'.$selval.'</label>';
5778
+							$more .= '</div></div>'."\n";
5779 5779
 							$i++;
5780 5780
 						}
5781 5781
 					} elseif ($input['type'] == 'date' || $input['type'] == 'datetime') {
5782
-						$more .= '<div class="tagtr"><div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '">' . $input['label'] . '</div>';
5782
+						$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div>';
5783 5783
 						$more .= '<div class="tagtd">';
5784 5784
 						$addnowlink = (empty($input['datenow']) ? 0 : 1);
5785 5785
 						$h = $m = 0;
@@ -5797,24 +5797,24 @@  discard block
 block discarded – undo
5797 5797
 					} elseif ($input['type'] == 'other') { // can be 1 column or 2 depending if label is set or not
5798 5798
 						$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">';
5799 5799
 						if (!empty($input['label'])) {
5800
-							$more .= $input['label'] . '</div><div class="tagtd">';
5800
+							$more .= $input['label'].'</div><div class="tagtd">';
5801 5801
 						}
5802 5802
 						$more .= $input['value'];
5803
-						$more .= '</div></div>' . "\n";
5803
+						$more .= '</div></div>'."\n";
5804 5804
 					} elseif ($input['type'] == 'onecolumn') {
5805 5805
 						$moreonecolumn .= '<div class="margintoponly">';
5806 5806
 						$moreonecolumn .= $input['value'];
5807
-						$moreonecolumn .= '</div>' . "\n";
5807
+						$moreonecolumn .= '</div>'."\n";
5808 5808
 					} elseif ($input['type'] == 'hidden') {
5809 5809
 						// Do nothing more, already added by a previous loop
5810 5810
 					} elseif ($input['type'] == 'separator') {
5811 5811
 						$more .= '<br>';
5812 5812
 					} else {
5813
-						$more .= 'Error type ' . $input['type'] . ' for the confirm box is not a supported type';
5813
+						$more .= 'Error type '.$input['type'].' for the confirm box is not a supported type';
5814 5814
 					}
5815 5815
 				}
5816 5816
 			}
5817
-			$more .= '</div>' . "\n";
5817
+			$more .= '</div>'."\n";
5818 5818
 			$more .= $moreonecolumn;
5819 5819
 		}
5820 5820
 
@@ -5836,10 +5836,10 @@  discard block
 block discarded – undo
5836 5836
 				$button = $useajax;
5837 5837
 				$useajax = 1;
5838 5838
 				$autoOpen = false;
5839
-				$dialogconfirm .= '-' . $button;
5839
+				$dialogconfirm .= '-'.$button;
5840 5840
 			}
5841
-			$pageyes = $page . (preg_match('/\?/', $page) ? '&' : '?') . 'action=' . urlencode($action) . '&confirm=yes';
5842
-			$pageno = ($useajax == 2 ? $page . (preg_match('/\?/', $page) ? '&' : '?') . 'action=' . urlencode($action) . '&confirm=no' : '');
5841
+			$pageyes = $page.(preg_match('/\?/', $page) ? '&' : '?').'action='.urlencode($action).'&confirm=yes';
5842
+			$pageno = ($useajax == 2 ? $page.(preg_match('/\?/', $page) ? '&' : '?').'action='.urlencode($action).'&confirm=no' : '');
5843 5843
 
5844 5844
 			// Add input fields into list of fields to read during submit (inputok and inputko)
5845 5845
 			if (is_array($formquestion)) {
@@ -5862,24 +5862,24 @@  discard block
 block discarded – undo
5862 5862
 			}
5863 5863
 
5864 5864
 			// Show JQuery confirm box.
5865
-			$formconfirm .= '<div id="' . $dialogconfirm . '" title="' . dol_escape_htmltag($title) . '" style="display: none;">';
5865
+			$formconfirm .= '<div id="'.$dialogconfirm.'" title="'.dol_escape_htmltag($title).'" style="display: none;">';
5866 5866
 			if (is_array($formquestion) && array_key_exists('text', $formquestion) && !empty($formquestion['text'])) {
5867
-				$formconfirm .= '<div class="confirmtext">' . $formquestion['text'] . '</div>' . "\n";
5867
+				$formconfirm .= '<div class="confirmtext">'.$formquestion['text'].'</div>'."\n";
5868 5868
 			}
5869 5869
 			if (!empty($more)) {
5870
-				$formconfirm .= '<div class="confirmquestions">' . $more . '</div>' . "\n";
5870
+				$formconfirm .= '<div class="confirmquestions">'.$more.'</div>'."\n";
5871 5871
 			}
5872
-			$formconfirm .= ($question ? '<div class="confirmmessage">' . img_help(0, '') . ' ' . $question . '</div>' : '');
5873
-			$formconfirm .= '</div>' . "\n";
5872
+			$formconfirm .= ($question ? '<div class="confirmmessage">'.img_help(0, '').' '.$question.'</div>' : '');
5873
+			$formconfirm .= '</div>'."\n";
5874 5874
 
5875
-			$formconfirm .= "\n<!-- begin code of popup for formconfirm page=" . $page . " -->\n";
5876
-			$formconfirm .= '<script nonce="' . getNonce() . '" type="text/javascript">' . "\n";
5875
+			$formconfirm .= "\n<!-- begin code of popup for formconfirm page=".$page." -->\n";
5876
+			$formconfirm .= '<script nonce="'.getNonce().'" type="text/javascript">'."\n";
5877 5877
 			$formconfirm .= "/* Code for the jQuery('#dialogforpopup').dialog() */\n";
5878 5878
 			$formconfirm .= 'jQuery(document).ready(function() {
5879 5879
             $(function() {
5880
-            	$( "#' . $dialogconfirm . '" ).dialog(
5880
+            	$( "#' . $dialogconfirm.'" ).dialog(
5881 5881
             	{
5882
-                    autoOpen: ' . ($autoOpen ? "true" : "false") . ',';
5882
+                    autoOpen: ' . ($autoOpen ? "true" : "false").',';
5883 5883
 			if ($newselectedchoice == 'no') {
5884 5884
 				$formconfirm .= '
5885 5885
 						open: function() {
@@ -5889,24 +5889,24 @@  discard block
 block discarded – undo
5889 5889
 
5890 5890
 			$jsforcursor = '';
5891 5891
 			if ($useajax == 1) {
5892
-				$jsforcursor = '// The call to urljump can be slow, so we set the wait cursor' . "\n";
5893
-				$jsforcursor .= 'jQuery("html,body,#id-container").addClass("cursorwait");' . "\n";
5892
+				$jsforcursor = '// The call to urljump can be slow, so we set the wait cursor'."\n";
5893
+				$jsforcursor .= 'jQuery("html,body,#id-container").addClass("cursorwait");'."\n";
5894 5894
 			}
5895 5895
 
5896 5896
 			$postconfirmas = 'GET';
5897 5897
 
5898 5898
 			$formconfirm .= '
5899 5899
                     resizable: false,
5900
-                    height: "' . $height . '",
5901
-                    width: "' . $width . '",
5900
+                    height: "' . $height.'",
5901
+                    width: "' . $width.'",
5902 5902
                     modal: true,
5903 5903
                     closeOnEscape: false,
5904 5904
                     buttons: {
5905
-                        "' . dol_escape_js($langs->transnoentities($labelbuttonyes)) . '": function() {
5906
-							var options = "token=' . urlencode(newToken()) . '";
5907
-                        	var inputok = ' . json_encode($inputok) . ';	/* List of fields into form */
5908
-							var page = "' . dol_escape_js(!empty($page) ? $page : '') . '";
5909
-                         	var pageyes = "' . dol_escape_js(!empty($pageyes) ? $pageyes : '') . '";
5905
+                        "' . dol_escape_js($langs->transnoentities($labelbuttonyes)).'": function() {
5906
+							var options = "token=' . urlencode(newToken()).'";
5907
+                        	var inputok = ' . json_encode($inputok).';	/* List of fields into form */
5908
+							var page = "' . dol_escape_js(!empty($page) ? $page : '').'";
5909
+                         	var pageyes = "' . dol_escape_js(!empty($pageyes) ? $pageyes : '').'";
5910 5910
 
5911 5911
                          	if (inputok.length > 0) {
5912 5912
                          		$.each(inputok, function(i, inputname) {
@@ -5940,11 +5940,11 @@  discard block
 block discarded – undo
5940 5940
 							}
5941 5941
 	                        $(this).dialog("close");
5942 5942
                         },
5943
-                        "' . dol_escape_js($langs->transnoentities($labelbuttonno)) . '": function() {
5944
-                        	var options = "token=' . urlencode(newToken()) . '";
5945
-                         	var inputko = ' . json_encode($inputko) . ';	/* List of fields into form */
5946
-							var page = "' . dol_escape_js(!empty($page) ? $page : '') . '";
5947
-                         	var pageno="' . dol_escape_js(!empty($pageno) ? $pageno : '') . '";
5943
+                        "' . dol_escape_js($langs->transnoentities($labelbuttonno)).'": function() {
5944
+                        	var options = "token=' . urlencode(newToken()).'";
5945
+                         	var inputko = ' . json_encode($inputko).';	/* List of fields into form */
5946
+							var page = "' . dol_escape_js(!empty($page) ? $page : '').'";
5947
+                         	var pageno="' . dol_escape_js(!empty($pageno) ? $pageno : '').'";
5948 5948
                          	if (inputko.length > 0) {
5949 5949
                          		$.each(inputko, function(i, inputname) {
5950 5950
                          			var more = "";
@@ -5976,10 +5976,10 @@  discard block
 block discarded – undo
5976 5976
                 }
5977 5977
                 );
5978 5978
 
5979
-            	var button = "' . $button . '";
5979
+            	var button = "' . $button.'";
5980 5980
             	if (button.length > 0) {
5981 5981
                 	$( "#" + button ).click(function() {
5982
-                		$("#' . $dialogconfirm . '").dialog("open");
5982
+                		$("#' . $dialogconfirm.'").dialog("open");
5983 5983
         			});
5984 5984
                 }
5985 5985
             });
@@ -5987,44 +5987,44 @@  discard block
 block discarded – undo
5987 5987
             </script>';
5988 5988
 			$formconfirm .= "<!-- end ajax formconfirm -->\n";
5989 5989
 		} else {
5990
-			$formconfirm .= "\n<!-- begin formconfirm page=" . dol_escape_htmltag($page) . " -->\n";
5990
+			$formconfirm .= "\n<!-- begin formconfirm page=".dol_escape_htmltag($page)." -->\n";
5991 5991
 
5992 5992
 			if (empty($disableformtag)) {
5993
-				$formconfirm .= '<form method="POST" action="' . $page . '" class="notoptoleftnoright">' . "\n";
5993
+				$formconfirm .= '<form method="POST" action="'.$page.'" class="notoptoleftnoright">'."\n";
5994 5994
 			}
5995 5995
 
5996
-			$formconfirm .= '<input type="hidden" name="action" value="' . $action . '">' . "\n";
5997
-			$formconfirm .= '<input type="hidden" name="token" value="' . newToken() . '">' . "\n";
5996
+			$formconfirm .= '<input type="hidden" name="action" value="'.$action.'">'."\n";
5997
+			$formconfirm .= '<input type="hidden" name="token" value="'.newToken().'">'."\n";
5998 5998
 
5999
-			$formconfirm .= '<table class="valid centpercent">' . "\n";
5999
+			$formconfirm .= '<table class="valid centpercent">'."\n";
6000 6000
 
6001 6001
 			// Line title
6002 6002
 			$formconfirm .= '<tr class="validtitre"><td class="validtitre" colspan="2">';
6003
-			$formconfirm .= img_picto('', 'pictoconfirm') . ' ' . $title;
6004
-			$formconfirm .= '</td></tr>' . "\n";
6003
+			$formconfirm .= img_picto('', 'pictoconfirm').' '.$title;
6004
+			$formconfirm .= '</td></tr>'."\n";
6005 6005
 
6006 6006
 			// Line text
6007 6007
 			if (is_array($formquestion) && array_key_exists('text', $formquestion) && !empty($formquestion['text'])) {
6008
-				$formconfirm .= '<tr class="valid"><td class="valid" colspan="2">' . $formquestion['text'] . '</td></tr>' . "\n";
6008
+				$formconfirm .= '<tr class="valid"><td class="valid" colspan="2">'.$formquestion['text'].'</td></tr>'."\n";
6009 6009
 			}
6010 6010
 
6011 6011
 			// Line form fields
6012 6012
 			if ($more) {
6013
-				$formconfirm .= '<tr class="valid"><td class="valid" colspan="2">' . "\n";
6013
+				$formconfirm .= '<tr class="valid"><td class="valid" colspan="2">'."\n";
6014 6014
 				$formconfirm .= $more;
6015
-				$formconfirm .= '</td></tr>' . "\n";
6015
+				$formconfirm .= '</td></tr>'."\n";
6016 6016
 			}
6017 6017
 
6018 6018
 			// Line with question
6019 6019
 			$formconfirm .= '<tr class="valid">';
6020
-			$formconfirm .= '<td class="valid">' . $question . '</td>';
6020
+			$formconfirm .= '<td class="valid">'.$question.'</td>';
6021 6021
 			$formconfirm .= '<td class="valid center">';
6022 6022
 			$formconfirm .= $this->selectyesno("confirm", $newselectedchoice, 0, false, 0, 0, 'marginleftonly marginrightonly', $labelbuttonyes, $labelbuttonno);
6023
-			$formconfirm .= '<input class="button valignmiddle confirmvalidatebutton small" type="submit" value="' . $langs->trans("Validate") . '">';
6023
+			$formconfirm .= '<input class="button valignmiddle confirmvalidatebutton small" type="submit" value="'.$langs->trans("Validate").'">';
6024 6024
 			$formconfirm .= '</td>';
6025
-			$formconfirm .= '</tr>' . "\n";
6025
+			$formconfirm .= '</tr>'."\n";
6026 6026
 
6027
-			$formconfirm .= '</table>' . "\n";
6027
+			$formconfirm .= '</table>'."\n";
6028 6028
 
6029 6029
 			if (empty($disableformtag)) {
6030 6030
 				$formconfirm .= "</form>\n";
@@ -6033,7 +6033,7 @@  discard block
 block discarded – undo
6033 6033
 
6034 6034
 			if (!empty($conf->use_javascript_ajax)) {
6035 6035
 				$formconfirm .= '<!-- code to disable button to avoid double clic -->';
6036
-				$formconfirm .= '<script nonce="' . getNonce() . '" type="text/javascript">' . "\n";
6036
+				$formconfirm .= '<script nonce="'.getNonce().'" type="text/javascript">'."\n";
6037 6037
 				$formconfirm .= '
6038 6038
 				$(document).ready(function () {
6039 6039
 					$(".confirmvalidatebutton").on("click", function() {
@@ -6045,7 +6045,7 @@  discard block
 block discarded – undo
6045 6045
 					});
6046 6046
 				});
6047 6047
 				';
6048
-				$formconfirm .= '</script>' . "\n";
6048
+				$formconfirm .= '</script>'."\n";
6049 6049
 			}
6050 6050
 
6051 6051
 			$formconfirm .= "<!-- end formconfirm -->\n";
@@ -6077,8 +6077,8 @@  discard block
 block discarded – undo
6077 6077
 		// phpcs:enable
6078 6078
 		global $langs;
6079 6079
 
6080
-		require_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php';
6081
-		require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php';
6080
+		require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
6081
+		require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
6082 6082
 
6083 6083
 		$out = '';
6084 6084
 
@@ -6086,11 +6086,11 @@  discard block
 block discarded – undo
6086 6086
 
6087 6087
 		$langs->load("project");
6088 6088
 		if ($htmlname != "none") {
6089
-			$out .= '<form method="post" action="' . $page . '">';
6089
+			$out .= '<form method="post" action="'.$page.'">';
6090 6090
 			$out .= '<input type="hidden" name="action" value="classin">';
6091
-			$out .= '<input type="hidden" name="token" value="' . newToken() . '">';
6091
+			$out .= '<input type="hidden" name="token" value="'.newToken().'">';
6092 6092
 			$out .= $formproject->select_projects($socid, $selected, $htmlname, $maxlength, 0, 1, $discard_closed, $forcefocus, 0, 0, '', 1, 0, $morecss);
6093
-			$out .= '<input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '">';
6093
+			$out .= '<input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">';
6094 6094
 			$out .= '</form>';
6095 6095
 		} else {
6096 6096
 			$out .= '<span class="project_head_block">';
@@ -6099,7 +6099,7 @@  discard block
 block discarded – undo
6099 6099
 				$projet->fetch($selected);
6100 6100
 				$out .= $projet->getNomUrl(0, '', 1);
6101 6101
 			} else {
6102
-				$out .= '<span class="opacitymedium">' . $textifnoproject . '</span>';
6102
+				$out .= '<span class="opacitymedium">'.$textifnoproject.'</span>';
6103 6103
 			}
6104 6104
 			$out .= '</span>';
6105 6105
 		}
@@ -6136,14 +6136,14 @@  discard block
 block discarded – undo
6136 6136
 		$out = '';
6137 6137
 
6138 6138
 		if ($htmlname != "none") {
6139
-			$out .= '<form method="POST" action="' . $page . '">';
6139
+			$out .= '<form method="POST" action="'.$page.'">';
6140 6140
 			$out .= '<input type="hidden" name="action" value="setconditions">';
6141
-			$out .= '<input type="hidden" name="token" value="' . newToken() . '">';
6141
+			$out .= '<input type="hidden" name="token" value="'.newToken().'">';
6142 6142
 			if ($type) {
6143
-				$out .= '<input type="hidden" name="type" value="' . dol_escape_htmltag($type) . '">';
6143
+				$out .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">';
6144 6144
 			}
6145 6145
 			$out .= $this->getSelectConditionsPaiements($selected, $htmlname, $filtertype, $addempty, 0, '', $deposit_percent);
6146
-			$out .= '<input type="submit" class="button valignmiddle smallpaddingimp" value="' . $langs->trans("Modify") . '">';
6146
+			$out .= '<input type="submit" class="button valignmiddle smallpaddingimp" value="'.$langs->trans("Modify").'">';
6147 6147
 			$out .= '</form>';
6148 6148
 		} else {
6149 6149
 			if ($selected) {
@@ -6188,12 +6188,12 @@  discard block
 block discarded – undo
6188 6188
 		// phpcs:enable
6189 6189
 		global $langs;
6190 6190
 		if ($htmlname != "none") {
6191
-			print '<form method="post" action="' . $page . '">';
6191
+			print '<form method="post" action="'.$page.'">';
6192 6192
 			print '<input type="hidden" name="action" value="setavailability">';
6193
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
6193
+			print '<input type="hidden" name="token" value="'.newToken().'">';
6194 6194
 			$this->selectAvailabilityDelay($selected, $htmlname, '', $addempty);
6195
-			print '<input type="submit" name="modify" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '">';
6196
-			print '<input type="submit" name="cancel" class="button smallpaddingimp" value="' . $langs->trans("Cancel") . '">';
6195
+			print '<input type="submit" name="modify" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">';
6196
+			print '<input type="submit" name="cancel" class="button smallpaddingimp" value="'.$langs->trans("Cancel").'">';
6197 6197
 			print '</form>';
6198 6198
 		} else {
6199 6199
 			if ($selected) {
@@ -6219,11 +6219,11 @@  discard block
 block discarded – undo
6219 6219
 	{
6220 6220
 		global $langs;
6221 6221
 		if ($htmlname != "none") {
6222
-			print '<form method="post" action="' . $page . '">';
6222
+			print '<form method="post" action="'.$page.'">';
6223 6223
 			print '<input type="hidden" name="action" value="setdemandreason">';
6224
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
6224
+			print '<input type="hidden" name="token" value="'.newToken().'">';
6225 6225
 			$this->selectInputReason($selected, $htmlname, '-1', $addempty);
6226
-			print '<input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '">';
6226
+			print '<input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">';
6227 6227
 			print '</form>';
6228 6228
 		} else {
6229 6229
 			if ($selected) {
@@ -6263,17 +6263,17 @@  discard block
 block discarded – undo
6263 6263
 		$ret = '';
6264 6264
 
6265 6265
 		if ($htmlname != "none") {
6266
-			$ret .= '<form method="POST" action="' . $page . '" name="form' . $htmlname . '">';
6267
-			$ret .= '<input type="hidden" name="action" value="set' . $htmlname . '">';
6268
-			$ret .= '<input type="hidden" name="token" value="' . newToken() . '">';
6266
+			$ret .= '<form method="POST" action="'.$page.'" name="form'.$htmlname.'">';
6267
+			$ret .= '<input type="hidden" name="action" value="set'.$htmlname.'">';
6268
+			$ret .= '<input type="hidden" name="token" value="'.newToken().'">';
6269 6269
 			if ($type) {
6270
-				$ret .= '<input type="hidden" name="type" value="' . dol_escape_htmltag($type) . '">';
6270
+				$ret .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">';
6271 6271
 			}
6272 6272
 			$ret .= '<table class="nobordernopadding">';
6273 6273
 			$ret .= '<tr><td>';
6274
-			$ret .= $this->selectDate($selected, $htmlname, $displayhour, $displaymin, 1, 'form' . $htmlname, 1, 0);
6274
+			$ret .= $this->selectDate($selected, $htmlname, $displayhour, $displaymin, 1, 'form'.$htmlname, 1, 0);
6275 6275
 			$ret .= '</td>';
6276
-			$ret .= '<td class="left"><input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '"></td>';
6276
+			$ret .= '<td class="left"><input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'"></td>';
6277 6277
 			$ret .= '</tr></table></form>';
6278 6278
 		} else {
6279 6279
 			if ($displayhour) {
@@ -6308,15 +6308,15 @@  discard block
 block discarded – undo
6308 6308
 		global $langs;
6309 6309
 
6310 6310
 		if ($htmlname != "none") {
6311
-			print '<form method="POST" action="' . $page . '" name="form' . $htmlname . '">';
6312
-			print '<input type="hidden" name="action" value="set' . $htmlname . '">';
6313
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
6311
+			print '<form method="POST" action="'.$page.'" name="form'.$htmlname.'">';
6312
+			print '<input type="hidden" name="action" value="set'.$htmlname.'">';
6313
+			print '<input type="hidden" name="token" value="'.newToken().'">';
6314 6314
 			print $this->select_dolusers($selected, $htmlname, 1, $exclude, 0, $include);
6315
-			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
6315
+			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
6316 6316
 			print '</form>';
6317 6317
 		} else {
6318 6318
 			if ($selected) {
6319
-				require_once DOL_DOCUMENT_ROOT . '/user/class/user.class.php';
6319
+				require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
6320 6320
 				$theuser = new User($this->db);
6321 6321
 				$theuser->fetch($selected);
6322 6322
 				print $theuser->getNomUrl(1);
@@ -6349,14 +6349,14 @@  discard block
 block discarded – undo
6349 6349
 
6350 6350
 		$out = '';
6351 6351
 		if ($htmlname != "none") {
6352
-			$out .= '<form method="POST" action="' . $page . '">';
6352
+			$out .= '<form method="POST" action="'.$page.'">';
6353 6353
 			$out .= '<input type="hidden" name="action" value="setmode">';
6354
-			$out .= '<input type="hidden" name="token" value="' . newToken() . '">';
6354
+			$out .= '<input type="hidden" name="token" value="'.newToken().'">';
6355 6355
 			if ($type) {
6356
-				$out .= '<input type="hidden" name="type" value="' . dol_escape_htmltag($type) . '">';
6356
+				$out .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">';
6357 6357
 			}
6358 6358
 			$out .= $this->select_types_paiements($selected, $htmlname, $filtertype, 0, $addempty, 0, 0, $active, '', 1);
6359
-			$out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
6359
+			$out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
6360 6360
 			$out .= '</form>';
6361 6361
 		} else {
6362 6362
 			if ($selected) {
@@ -6389,11 +6389,11 @@  discard block
 block discarded – undo
6389 6389
 	{
6390 6390
 		global $langs;
6391 6391
 		if ($htmlname != "none") {
6392
-			print '<form method="POST" action="' . $page . '">';
6392
+			print '<form method="POST" action="'.$page.'">';
6393 6393
 			print '<input type="hidden" name="action" value="settransportmode">';
6394
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
6394
+			print '<input type="hidden" name="token" value="'.newToken().'">';
6395 6395
 			$this->selectTransportMode($selected, $htmlname, 0, $addempty, 0, 0, $active);
6396
-			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
6396
+			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
6397 6397
 			print '</form>';
6398 6398
 		} else {
6399 6399
 			if ($selected) {
@@ -6420,14 +6420,14 @@  discard block
 block discarded – undo
6420 6420
 		// phpcs:enable
6421 6421
 		global $langs;
6422 6422
 		if ($htmlname != "none") {
6423
-			print '<form method="POST" action="' . $page . '">';
6423
+			print '<form method="POST" action="'.$page.'">';
6424 6424
 			print '<input type="hidden" name="action" value="setmulticurrencycode">';
6425
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
6425
+			print '<input type="hidden" name="token" value="'.newToken().'">';
6426 6426
 			print $this->selectMultiCurrency($selected, $htmlname, 0);
6427
-			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
6427
+			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
6428 6428
 			print '</form>';
6429 6429
 		} else {
6430
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
6430
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
6431 6431
 			print !empty($selected) ? currency_name($selected, 1) : '&nbsp;';
6432 6432
 		}
6433 6433
 	}
@@ -6449,22 +6449,22 @@  discard block
 block discarded – undo
6449 6449
 		global $langs, $mysoc, $conf;
6450 6450
 
6451 6451
 		if ($htmlname != "none") {
6452
-			print '<form method="POST" action="' . $page . '">';
6452
+			print '<form method="POST" action="'.$page.'">';
6453 6453
 			print '<input type="hidden" name="action" value="setmulticurrencyrate">';
6454
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
6455
-			print '<input type="text" class="maxwidth75" name="' . $htmlname . '" value="' . (!empty($rate) ? price(price2num($rate, 'CU')) : 1) . '" /> ';
6454
+			print '<input type="hidden" name="token" value="'.newToken().'">';
6455
+			print '<input type="text" class="maxwidth75" name="'.$htmlname.'" value="'.(!empty($rate) ? price(price2num($rate, 'CU')) : 1).'" /> ';
6456 6456
 			print '<select name="calculation_mode" id="calculation_mode">';
6457
-			print '<option value="1">Change ' . $langs->trans("PriceUHT") . ' of lines</option>';
6458
-			print '<option value="2">Change ' . $langs->trans("PriceUHTCurrency") . ' of lines</option>';
6457
+			print '<option value="1">Change '.$langs->trans("PriceUHT").' of lines</option>';
6458
+			print '<option value="2">Change '.$langs->trans("PriceUHTCurrency").' of lines</option>';
6459 6459
 			print '</select> ';
6460 6460
 			print ajax_combobox("calculation_mode");
6461
-			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
6461
+			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
6462 6462
 			print '</form>';
6463 6463
 		} else {
6464 6464
 			if (!empty($rate)) {
6465 6465
 				print price($rate, 1, $langs, 0, 0);
6466 6466
 				if ($currency && $rate != 1) {
6467
-					print ' &nbsp; <span class="opacitymedium">(' . price($rate, 1, $langs, 0, 0) . ' ' . $currency . ' = 1 ' . $conf->currency . ')</span>';
6467
+					print ' &nbsp; <span class="opacitymedium">('.price($rate, 1, $langs, 0, 0).' '.$currency.' = 1 '.$conf->currency.')</span>';
6468 6468
 				}
6469 6469
 			} else {
6470 6470
 				print 1;
@@ -6494,9 +6494,9 @@  discard block
 block discarded – undo
6494 6494
 		// phpcs:enable
6495 6495
 		global $conf, $langs;
6496 6496
 		if ($htmlname != "none") {
6497
-			print '<form method="post" action="' . $page . '">';
6497
+			print '<form method="post" action="'.$page.'">';
6498 6498
 			print '<input type="hidden" name="action" value="setabsolutediscount">';
6499
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
6499
+			print '<input type="hidden" name="token" value="'.newToken().'">';
6500 6500
 			print '<div class="inline-block">';
6501 6501
 			if (!empty($discount_type)) {
6502 6502
 				if (getDolGlobalString('FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS')) {
@@ -6534,24 +6534,24 @@  discard block
 block discarded – undo
6534 6534
 			print '</div>';
6535 6535
 			if (empty($hidelist)) {
6536 6536
 				print '<div class="inline-block" style="padding-right: 10px">';
6537
-				$newfilter = 'discount_type=' . intval($discount_type);
6537
+				$newfilter = 'discount_type='.intval($discount_type);
6538 6538
 				if (!empty($discount_type)) {
6539 6539
 					$newfilter .= ' AND fk_invoice_supplier IS NULL AND fk_invoice_supplier_line IS NULL'; // Supplier discounts available
6540 6540
 				} else {
6541 6541
 					$newfilter .= ' AND fk_facture IS NULL AND fk_facture_line IS NULL'; // Customer discounts available
6542 6542
 				}
6543 6543
 				if ($filter) {
6544
-					$newfilter .= ' AND (' . $filter . ')';
6544
+					$newfilter .= ' AND ('.$filter.')';
6545 6545
 				}
6546 6546
 				// output the combo of discounts
6547 6547
 				$nbqualifiedlines = $this->select_remises((string) $selected, $htmlname, $newfilter, $socid, $maxvalue);
6548 6548
 				if ($nbqualifiedlines > 0) {
6549
-					print ' &nbsp; <input type="submit" class="button smallpaddingimp" value="' . dol_escape_htmltag($langs->trans("UseLine")) . '"';
6549
+					print ' &nbsp; <input type="submit" class="button smallpaddingimp" value="'.dol_escape_htmltag($langs->trans("UseLine")).'"';
6550 6550
 					if (!empty($discount_type) && $filter && $filter != "fk_invoice_supplier_source IS NULL OR (description LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS PAID)%')") {
6551
-						print ' title="' . $langs->trans("UseCreditNoteInInvoicePayment") . '"';
6551
+						print ' title="'.$langs->trans("UseCreditNoteInInvoicePayment").'"';
6552 6552
 					}
6553 6553
 					if (empty($discount_type) && $filter && $filter != "fk_facture_source IS NULL OR (description LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS RECEIVED)%')") {
6554
-						print ' title="' . $langs->trans("UseCreditNoteInInvoicePayment") . '"';
6554
+						print ' title="'.$langs->trans("UseCreditNoteInInvoicePayment").'"';
6555 6555
 					}
6556 6556
 
6557 6557
 					print '>';
@@ -6591,23 +6591,23 @@  discard block
 block discarded – undo
6591 6591
 		global $langs;
6592 6592
 
6593 6593
 		if ($htmlname != "none") {
6594
-			print '<form method="post" action="' . $page . '">';
6594
+			print '<form method="post" action="'.$page.'">';
6595 6595
 			print '<input type="hidden" name="action" value="set_contact">';
6596
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
6596
+			print '<input type="hidden" name="token" value="'.newToken().'">';
6597 6597
 			print '<table class="nobordernopadding">';
6598 6598
 			print '<tr><td>';
6599 6599
 			print $this->selectcontacts($societe->id, $selected, $htmlname);
6600 6600
 			$num = $this->num;
6601 6601
 			if ($num == 0) {
6602 6602
 				$addcontact = (getDolGlobalString('SOCIETE_ADDRESSES_MANAGEMENT') ? $langs->trans("AddContact") : $langs->trans("AddContactAddress"));
6603
-				print '<a href="' . DOL_URL_ROOT . '/contact/card.php?socid=' . $societe->id . '&action=create&backtoreferer=1">' . $addcontact . '</a>';
6603
+				print '<a href="'.DOL_URL_ROOT.'/contact/card.php?socid='.$societe->id.'&action=create&backtoreferer=1">'.$addcontact.'</a>';
6604 6604
 			}
6605 6605
 			print '</td>';
6606
-			print '<td class="left"><input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '"></td>';
6606
+			print '<td class="left"><input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'"></td>';
6607 6607
 			print '</tr></table></form>';
6608 6608
 		} else {
6609 6609
 			if ($selected) {
6610
-				require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php';
6610
+				require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
6611 6611
 				$contact = new Contact($this->db);
6612 6612
 				$contact->fetch($selected);
6613 6613
 				print $contact->getFullName($langs);
@@ -6642,20 +6642,20 @@  discard block
 block discarded – undo
6642 6642
 
6643 6643
 		$out = '';
6644 6644
 		if ($htmlname != "none") {
6645
-			$out .= '<form method="post" action="' . $page . '">';
6645
+			$out .= '<form method="post" action="'.$page.'">';
6646 6646
 			$out .= '<input type="hidden" name="action" value="set_thirdparty">';
6647
-			$out .= '<input type="hidden" name="token" value="' . newToken() . '">';
6647
+			$out .= '<input type="hidden" name="token" value="'.newToken().'">';
6648 6648
 			$out .= $this->select_company($selected, $htmlname, $filter, $showempty, $showtype, $forcecombo, $events, 0, 'minwidth100', '', '', 1, array(), false, $excludeids);
6649
-			$out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
6649
+			$out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
6650 6650
 			$out .= '</form>';
6651 6651
 		} else {
6652 6652
 			if ($selected) {
6653
-				require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
6653
+				require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
6654 6654
 				$soc = new Societe($this->db);
6655 6655
 				$soc->fetch($selected);
6656 6656
 				$out .= $soc->getNomUrl(0, '');
6657 6657
 			} else {
6658
-				$out .= '<span class="opacitymedium">' . $textifnothirdparty . '</span>';
6658
+				$out .= '<span class="opacitymedium">'.$textifnothirdparty.'</span>';
6659 6659
 			}
6660 6660
 		}
6661 6661
 
@@ -6705,22 +6705,22 @@  discard block
 block discarded – undo
6705 6705
 			$selected = 'EUR'; // Pour compatibilite
6706 6706
 		}
6707 6707
 
6708
-		$out .= '<select class="flat maxwidth200onsmartphone minwidth300" name="' . $htmlname . '" id="' . $htmlname . '">';
6708
+		$out .= '<select class="flat maxwidth200onsmartphone minwidth300" name="'.$htmlname.'" id="'.$htmlname.'">';
6709 6709
 		if ($useempty) {
6710 6710
 			$out .= '<option value="-1" selected></option>';
6711 6711
 		}
6712 6712
 		foreach ($langs->cache_currencies as $code_iso => $currency) {
6713 6713
 			$labeltoshow = $currency['label'];
6714 6714
 			if ($mode == 1) {
6715
-				$labeltoshow .= ' <span class="opacitymedium">(' . $code_iso . ')</span>';
6715
+				$labeltoshow .= ' <span class="opacitymedium">('.$code_iso.')</span>';
6716 6716
 			} else {
6717
-				$labeltoshow .= ' <span class="opacitymedium">(' . $langs->getCurrencySymbol($code_iso) . ')</span>';
6717
+				$labeltoshow .= ' <span class="opacitymedium">('.$langs->getCurrencySymbol($code_iso).')</span>';
6718 6718
 			}
6719 6719
 
6720 6720
 			if ($selected && $selected == $code_iso) {
6721
-				$out .= '<option value="' . $code_iso . '" selected data-html="' . dol_escape_htmltag($labeltoshow) . '">';
6721
+				$out .= '<option value="'.$code_iso.'" selected data-html="'.dol_escape_htmltag($labeltoshow).'">';
6722 6722
 			} else {
6723
-				$out .= '<option value="' . $code_iso . '" data-html="' . dol_escape_htmltag($labeltoshow) . '">';
6723
+				$out .= '<option value="'.$code_iso.'" data-html="'.dol_escape_htmltag($labeltoshow).'">';
6724 6724
 			}
6725 6725
 			$out .= dol_string_nohtmltag($labeltoshow);
6726 6726
 			$out .= '</option>';
@@ -6731,7 +6731,7 @@  discard block
 block discarded – undo
6731 6731
 		}
6732 6732
 
6733 6733
 		// Make select dynamic
6734
-		include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
6734
+		include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
6735 6735
 		$out .= ajax_combobox($htmlname);
6736 6736
 
6737 6737
 		return $out;
@@ -6757,10 +6757,10 @@  discard block
 block discarded – undo
6757 6757
 
6758 6758
 		$TCurrency = array();
6759 6759
 
6760
-		$sql = "SELECT code FROM " . $this->db->prefix() . "multicurrency";
6761
-		$sql .= " WHERE entity IN ('" . getEntity('mutlicurrency') . "')";
6760
+		$sql = "SELECT code FROM ".$this->db->prefix()."multicurrency";
6761
+		$sql .= " WHERE entity IN ('".getEntity('mutlicurrency')."')";
6762 6762
 		if ($filter) {
6763
-			$sql .= " AND " . $filter;
6763
+			$sql .= " AND ".$filter;
6764 6764
 		}
6765 6765
 		$resql = $this->db->query($sql);
6766 6766
 		if ($resql) {
@@ -6770,7 +6770,7 @@  discard block
 block discarded – undo
6770 6770
 		}
6771 6771
 
6772 6772
 		$out = '';
6773
-		$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
6773
+		$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
6774 6774
 		if ($useempty) {
6775 6775
 			$out .= '<option value="">&nbsp;</option>';
6776 6776
 		}
@@ -6782,13 +6782,13 @@  discard block
 block discarded – undo
6782 6782
 			foreach ($langs->cache_currencies as $code_iso => $currency) {
6783 6783
 				if (isset($TCurrency[$code_iso])) {
6784 6784
 					if (!empty($selected) && $selected == $code_iso) {
6785
-						$out .= '<option value="' . $code_iso . '" selected="selected">';
6785
+						$out .= '<option value="'.$code_iso.'" selected="selected">';
6786 6786
 					} else {
6787
-						$out .= '<option value="' . $code_iso . '">';
6787
+						$out .= '<option value="'.$code_iso.'">';
6788 6788
 					}
6789 6789
 
6790 6790
 					$out .= $currency['label'];
6791
-					$out .= ' (' . $langs->getCurrencySymbol($code_iso) . ')';
6791
+					$out .= ' ('.$langs->getCurrencySymbol($code_iso).')';
6792 6792
 					$out .= '</option>';
6793 6793
 				}
6794 6794
 			}
@@ -6797,7 +6797,7 @@  discard block
 block discarded – undo
6797 6797
 		$out .= '</select>';
6798 6798
 
6799 6799
 		// Make select dynamic
6800
-		include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
6800
+		include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
6801 6801
 		$out .= ajax_combobox($htmlname);
6802 6802
 
6803 6803
 		return $out;
@@ -6828,7 +6828,7 @@  discard block
 block discarded – undo
6828 6828
 		$sql .= " WHERE t.fk_pays = c.rowid";
6829 6829
 		$sql .= " AND t.active > 0";
6830 6830
 		$sql .= " AND t.entity IN (".getEntity('c_tva').")";
6831
-		$sql .= " AND c.code IN (" . $this->db->sanitize($country_code, 1) . ")";
6831
+		$sql .= " AND c.code IN (".$this->db->sanitize($country_code, 1).")";
6832 6832
 		$sql .= " ORDER BY t.code ASC, t.taux ASC, t.recuperableonly ASC";
6833 6833
 
6834 6834
 		$resql = $this->db->query($sql);
@@ -6840,30 +6840,30 @@  discard block
 block discarded – undo
6840 6840
 
6841 6841
 					$tmparray = array();
6842 6842
 					$tmparray['rowid']			= $obj->rowid;
6843
-					$tmparray['type_vat']		= $obj->type_vat;
6844
-					$tmparray['code']			= $obj->code;
6843
+					$tmparray['type_vat'] = $obj->type_vat;
6844
+					$tmparray['code'] = $obj->code;
6845 6845
 					$tmparray['txtva']			= $obj->taux;
6846
-					$tmparray['nprtva']			= $obj->recuperableonly;
6846
+					$tmparray['nprtva'] = $obj->recuperableonly;
6847 6847
 					$tmparray['localtax1']	    = $obj->localtax1;
6848 6848
 					$tmparray['localtax1_type']	= $obj->localtax1_type;
6849 6849
 					$tmparray['localtax2']	    = $obj->localtax2;
6850 6850
 					$tmparray['localtax2_type']	= $obj->localtax1_type;
6851
-					$tmparray['label']			= $obj->taux . '%' . ($obj->code ? ' (' . $obj->code . ')' : ''); // Label must contains only 0-9 , . % or *
6852
-					$tmparray['labelallrates']	= $obj->taux . '/' . ($obj->localtax1 ? $obj->localtax1 : '0') . '/' . ($obj->localtax2 ? $obj->localtax2 : '0') . ($obj->code ? ' (' . $obj->code . ')' : ''); // Must never be used as key, only label
6851
+					$tmparray['label'] = $obj->taux.'%'.($obj->code ? ' ('.$obj->code.')' : ''); // Label must contains only 0-9 , . % or *
6852
+					$tmparray['labelallrates']	= $obj->taux.'/'.($obj->localtax1 ? $obj->localtax1 : '0').'/'.($obj->localtax2 ? $obj->localtax2 : '0').($obj->code ? ' ('.$obj->code.')' : ''); // Must never be used as key, only label
6853 6853
 					$positiverates = '';
6854 6854
 					if ($obj->taux) {
6855
-						$positiverates .= ($positiverates ? '/' : '') . $obj->taux;
6855
+						$positiverates .= ($positiverates ? '/' : '').$obj->taux;
6856 6856
 					}
6857 6857
 					if ($obj->localtax1) {
6858
-						$positiverates .= ($positiverates ? '/' : '') . $obj->localtax1;
6858
+						$positiverates .= ($positiverates ? '/' : '').$obj->localtax1;
6859 6859
 					}
6860 6860
 					if ($obj->localtax2) {
6861
-						$positiverates .= ($positiverates ? '/' : '') . $obj->localtax2;
6861
+						$positiverates .= ($positiverates ? '/' : '').$obj->localtax2;
6862 6862
 					}
6863 6863
 					if (empty($positiverates)) {
6864 6864
 						$positiverates = '0';
6865 6865
 					}
6866
-					$tmparray['labelpositiverates'] = $positiverates . ($obj->code ? ' (' . $obj->code . ')' : ''); // Must never be used as key, only label
6866
+					$tmparray['labelpositiverates'] = $positiverates.($obj->code ? ' ('.$obj->code.')' : ''); // Must never be used as key, only label
6867 6867
 
6868 6868
 					$this->cache_vatrates[$obj->rowid] = $tmparray;
6869 6869
 				}
@@ -6883,7 +6883,7 @@  discard block
 block discarded – undo
6883 6883
 				return -1;
6884 6884
 			}
6885 6885
 		} else {
6886
-			$this->error = '<span class="error">' . $this->db->error() . '</span>';
6886
+			$this->error = '<span class="error">'.$this->db->error().'</span>';
6887 6887
 			return -2;
6888 6888
 		}
6889 6889
 	}
@@ -6955,9 +6955,9 @@  discard block
 block discarded – undo
6955 6955
 		// Check parameters
6956 6956
 		if (is_object($societe_vendeuse) && !$societe_vendeuse->country_code) {
6957 6957
 			if ($societe_vendeuse->id == $mysoc->id) {
6958
-				$return .= '<span class="error">' . $langs->trans("ErrorYourCountryIsNotDefined") . '</span>';
6958
+				$return .= '<span class="error">'.$langs->trans("ErrorYourCountryIsNotDefined").'</span>';
6959 6959
 			} else {
6960
-				$return .= '<span class="error">' . $langs->trans("ErrorSupplierCountryIsNotDefined") . '</span>';
6960
+				$return .= '<span class="error">'.$langs->trans("ErrorSupplierCountryIsNotDefined").'</span>';
6961 6961
 			}
6962 6962
 			return $return;
6963 6963
 		}
@@ -6969,12 +6969,12 @@  discard block
 block discarded – undo
6969 6969
 		// Define list of countries to use to search VAT rates to show
6970 6970
 		// First we defined code_country to use to find list
6971 6971
 		if (is_object($societe_vendeuse)) {
6972
-			$code_country = "'" . $societe_vendeuse->country_code . "'";
6972
+			$code_country = "'".$societe_vendeuse->country_code."'";
6973 6973
 		} else {
6974
-			$code_country = "'" . $mysoc->country_code . "'"; // Pour compatibilite ascendente
6974
+			$code_country = "'".$mysoc->country_code."'"; // Pour compatibilite ascendente
6975 6975
 		}
6976 6976
 		if (getDolGlobalString('SERVICE_ARE_ECOMMERCE_200238EC')) {    // If option to have vat for end customer for services is on
6977
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
6977
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
6978 6978
 			// If SERVICE_ARE_ECOMMERCE_200238EC=1 combo list vat rate of purchaser and seller countries
6979 6979
 			// If SERVICE_ARE_ECOMMERCE_200238EC=2 combo list only the vat rate of the purchaser country
6980 6980
 			$selectVatComboMode = getDolGlobalString('SERVICE_ARE_ECOMMERCE_200238EC');
@@ -6984,27 +6984,27 @@  discard block
 block discarded – undo
6984 6984
 					if ($type == 1) { // We know product is a service
6985 6985
 						switch ($selectVatComboMode) {
6986 6986
 							case '1':
6987
-								$code_country .= ",'" . $societe_acheteuse->country_code . "'";
6987
+								$code_country .= ",'".$societe_acheteuse->country_code."'";
6988 6988
 								break;
6989 6989
 							case '2':
6990
-								$code_country = "'" . $societe_acheteuse->country_code . "'";
6990
+								$code_country = "'".$societe_acheteuse->country_code."'";
6991 6991
 								break;
6992 6992
 						}
6993 6993
 					}
6994 6994
 				} elseif (!$idprod) {  // We don't know type of product
6995 6995
 					switch ($selectVatComboMode) {
6996 6996
 						case '1':
6997
-							$code_country .= ",'" . $societe_acheteuse->country_code . "'";
6997
+							$code_country .= ",'".$societe_acheteuse->country_code."'";
6998 6998
 							break;
6999 6999
 						case '2':
7000
-							$code_country = "'" . $societe_acheteuse->country_code . "'";
7000
+							$code_country = "'".$societe_acheteuse->country_code."'";
7001 7001
 							break;
7002 7002
 					}
7003 7003
 				} else {
7004 7004
 					$prodstatic = new Product($this->db);
7005 7005
 					$prodstatic->fetch($idprod);
7006 7006
 					if ($prodstatic->type == Product::TYPE_SERVICE) {   // We know product is a service
7007
-						$code_country .= ",'" . $societe_acheteuse->country_code . "'";
7007
+						$code_country .= ",'".$societe_acheteuse->country_code."'";
7008 7008
 					}
7009 7009
 				}
7010 7010
 			}
@@ -7066,13 +7066,13 @@  discard block
 block discarded – undo
7066 7066
 				// Override/enable VAT for expense report regardless of global setting - needed if expense report used for business expenses instead
7067 7067
 				// of using supplier invoices (this is a very bad idea !)
7068 7068
 				if (!getDolGlobalString('EXPENSEREPORT_OVERRIDE_VAT')) {
7069
-					$title = ' title="' . dol_escape_htmltag($langs->trans('VATIsNotUsed')) . '"';
7069
+					$title = ' title="'.dol_escape_htmltag($langs->trans('VATIsNotUsed')).'"';
7070 7070
 					$disabled = true;
7071 7071
 				}
7072 7072
 			}
7073 7073
 
7074 7074
 			if (!$options_only) {
7075
-				$return .= '<select class="flat minwidth75imp maxwidth100 right" id="' . $htmlname . '" name="' . $htmlname . '"' . ($disabled ? ' disabled' : '') . $title . '>';
7075
+				$return .= '<select class="flat minwidth75imp maxwidth100 right" id="'.$htmlname.'" name="'.$htmlname.'"'.($disabled ? ' disabled' : '').$title.'>';
7076 7076
 			}
7077 7077
 
7078 7078
 			$selectedfound = false;
@@ -7086,13 +7086,13 @@  discard block
 block discarded – undo
7086 7086
 				$key = $rate['txtva'];
7087 7087
 				$key .= $rate['nprtva'] ? '*' : '';
7088 7088
 				if ($mode > 0 && $rate['code']) {
7089
-					$key .= ' (' . $rate['code'] . ')';
7089
+					$key .= ' ('.$rate['code'].')';
7090 7090
 				}
7091 7091
 				if ($mode < 0) {
7092 7092
 					$key = $rate['rowid'];
7093 7093
 				}
7094 7094
 
7095
-				$return .= '<option value="' . $key . '"';
7095
+				$return .= '<option value="'.$key.'"';
7096 7096
 				if (!$selectedfound) {
7097 7097
 					if ($defaultcode) { // If defaultcode is defined, we used it in priority to select combo option instead of using rate+npr flag
7098 7098
 						if ($defaultcode == $rate['code']) {
@@ -7163,7 +7163,7 @@  discard block
 block discarded – undo
7163 7163
 	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 = '')
7164 7164
 	{
7165 7165
 		// phpcs:enable
7166
-		dol_syslog(__METHOD__ . ': using select_date is deprecated. Use selectDate instead.', LOG_WARNING);
7166
+		dol_syslog(__METHOD__.': using select_date is deprecated. Use selectDate instead.', LOG_WARNING);
7167 7167
 		$retstring = $this->selectDate($set_time, $prefix, $h, $m, $empty, $form_name, $d, $addnowlink, $disabled, $fullday, $addplusone, $adddateof);
7168 7168
 		if (!empty($nooutput)) {
7169 7169
 			return $retstring;
@@ -7192,11 +7192,11 @@  discard block
 block discarded – undo
7192 7192
 	{
7193 7193
 		global $langs;
7194 7194
 
7195
-		$ret = $this->selectDate($set_time, $prefix . '_start', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("from"), 'tzuserrel');
7195
+		$ret = $this->selectDate($set_time, $prefix.'_start', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("from"), 'tzuserrel');
7196 7196
 		if ($forcenewline) {
7197 7197
 			$ret .= '<br>';
7198 7198
 		}
7199
-		$ret .= $this->selectDate($set_time_end, $prefix . '_end', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"), 'tzuserrel');
7199
+		$ret .= $this->selectDate($set_time_end, $prefix.'_end', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"), 'tzuserrel');
7200 7200
 		return $ret;
7201 7201
 	}
7202 7202
 
@@ -7263,7 +7263,7 @@  discard block
 block discarded – undo
7263 7263
 		$orig_set_time = $set_time;
7264 7264
 
7265 7265
 		if ($set_time === '' && $emptydate == 0) {
7266
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
7266
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
7267 7267
 			if ($gm == 'tzuser' || $gm == 'tzuserrel') {
7268 7268
 				$set_time = dol_now($gm);
7269 7269
 			} else {
@@ -7335,38 +7335,38 @@  discard block
 block discarded – undo
7335 7335
 				// Calendrier popup version eldy
7336 7336
 				if ($usecalendar == "eldy") {
7337 7337
 					// Input area to enter date manually
7338
-					$retstring .= '<input id="' . $prefix . '" name="' . $prefix . '" type="text" class="maxwidthdate center" maxlength="11" value="' . $formated_date . '"';
7338
+					$retstring .= '<input id="'.$prefix.'" name="'.$prefix.'" type="text" class="maxwidthdate center" maxlength="11" value="'.$formated_date.'"';
7339 7339
 					$retstring .= ($disabled ? ' disabled' : '');
7340
-					$retstring .= ' onChange="dpChangeDay(\'' . dol_escape_js($prefix) . '\',\'' . dol_escape_js($langs->trans("FormatDateShortJavaInput")) . '\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript
7340
+					$retstring .= ' onChange="dpChangeDay(\''.dol_escape_js($prefix).'\',\''.dol_escape_js($langs->trans("FormatDateShortJavaInput")).'\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript
7341 7341
 					$retstring .= ' autocomplete="off">';
7342 7342
 
7343 7343
 					// Icon calendar
7344 7344
 					$retstringbuttom = '';
7345 7345
 					if (!$disabled) {
7346
-						$retstringbuttom = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons"';
7347
-						$base = DOL_URL_ROOT . '/core/';
7348
-						$retstringbuttom .= ' onClick="showDP(\'' . dol_escape_js($base) . '\',\'' . dol_escape_js($prefix) . '\',\'' . dol_escape_js($langs->trans("FormatDateShortJavaInput")) . '\',\'' . dol_escape_js($langs->defaultlang) . '\');"';
7349
-						$retstringbuttom .= '>' . img_object($langs->trans("SelectDate"), 'calendarday', 'class="datecallink"') . '</button>';
7346
+						$retstringbuttom = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons"';
7347
+						$base = DOL_URL_ROOT.'/core/';
7348
+						$retstringbuttom .= ' onClick="showDP(\''.dol_escape_js($base).'\',\''.dol_escape_js($prefix).'\',\''.dol_escape_js($langs->trans("FormatDateShortJavaInput")).'\',\''.dol_escape_js($langs->defaultlang).'\');"';
7349
+						$retstringbuttom .= '>'.img_object($langs->trans("SelectDate"), 'calendarday', 'class="datecallink"').'</button>';
7350 7350
 					} else {
7351
-						$retstringbuttom = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons">' . img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"') . '</button>';
7351
+						$retstringbuttom = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons">'.img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"').'</button>';
7352 7352
 					}
7353
-					$retstring = $retstringbuttom . $retstring;
7353
+					$retstring = $retstringbuttom.$retstring;
7354 7354
 
7355
-					$retstring .= '<input type="hidden" id="' . $prefix . 'day"   name="' . $prefix . 'day"   value="' . $sday . '">' . "\n";
7356
-					$retstring .= '<input type="hidden" id="' . $prefix . 'month" name="' . $prefix . 'month" value="' . $smonth . '">' . "\n";
7357
-					$retstring .= '<input type="hidden" id="' . $prefix . 'year"  name="' . $prefix . 'year"  value="' . $syear . '">' . "\n";
7355
+					$retstring .= '<input type="hidden" id="'.$prefix.'day"   name="'.$prefix.'day"   value="'.$sday.'">'."\n";
7356
+					$retstring .= '<input type="hidden" id="'.$prefix.'month" name="'.$prefix.'month" value="'.$smonth.'">'."\n";
7357
+					$retstring .= '<input type="hidden" id="'.$prefix.'year"  name="'.$prefix.'year"  value="'.$syear.'">'."\n";
7358 7358
 				} elseif ($usecalendar == 'jquery' || $usecalendar == 'html') {
7359 7359
 					if (!$disabled && $usecalendar != 'html') {
7360 7360
 						// Output javascript for datepicker
7361 7361
 						$minYear = getDolGlobalInt('MIN_YEAR_SELECT_DATE', (idate('Y') - 100));
7362 7362
 						$maxYear = getDolGlobalInt('MAX_YEAR_SELECT_DATE', (idate('Y') + 100));
7363 7363
 
7364
-						$retstring .= '<script nonce="' . getNonce() . '" type="text/javascript">';
7365
-						$retstring .= "$(function(){ $('#" . $prefix . "').datepicker({
7366
-							dateFormat: '" . $langs->trans("FormatDateShortJQueryInput") . "',
7364
+						$retstring .= '<script nonce="'.getNonce().'" type="text/javascript">';
7365
+						$retstring .= "$(function(){ $('#".$prefix."').datepicker({
7366
+							dateFormat: '" . $langs->trans("FormatDateShortJQueryInput")."',
7367 7367
 							autoclose: true,
7368 7368
 							todayHighlight: true,
7369
-							yearRange: '" . $minYear . ":" . $maxYear . "',";
7369
+							yearRange: '" . $minYear.":".$maxYear."',";
7370 7370
 						if (!empty($conf->dol_use_jmobile)) {
7371 7371
 							$retstring .= "
7372 7372
 								beforeShow: function (input, datePicker) {
@@ -7379,10 +7379,10 @@  discard block
 block discarded – undo
7379 7379
 						}
7380 7380
 						// Note: We don't need monthNames, monthNamesShort, dayNames, dayNamesShort, dayNamesMin, they are set globally on datepicker component in lib_head.js.php
7381 7381
 						if (!getDolGlobalString('MAIN_POPUP_CALENDAR_ON_FOCUS')) {
7382
-							$buttonImage = $calendarpicto ?: DOL_URL_ROOT . "/theme/" . dol_escape_js($conf->theme) . "/img/object_calendarday.png";
7382
+							$buttonImage = $calendarpicto ?: DOL_URL_ROOT."/theme/".dol_escape_js($conf->theme)."/img/object_calendarday.png";
7383 7383
 							$retstring .= "
7384 7384
 								showOn: 'button',	/* both has problem with autocompletion */
7385
-								buttonImage: '" . $buttonImage . "',
7385
+								buttonImage: '" . $buttonImage."',
7386 7386
 								buttonImageOnly: true";
7387 7387
 						}
7388 7388
 						$retstring .= "
@@ -7394,46 +7394,46 @@  discard block
 block discarded – undo
7394 7394
 					$retstring .= '<div class="nowraponall inline-block divfordateinput">';
7395 7395
 					$retstring .= '<input id="'.$prefix.'" name="'.$prefix.'" type="'.($usecalendar == 'html' ? "date" : "text").'" class="maxwidthdate center" maxlength="11" value="'.$formated_date.'"';
7396 7396
 					$retstring .= ($disabled ? ' disabled' : '');
7397
-					$retstring .= ($placeholder ? ' placeholder="' . dol_escape_htmltag($placeholder) . '"' : '');
7398
-					$retstring .= ' onChange="dpChangeDay(\'' . dol_escape_js($prefix) . '\',\'' . dol_escape_js($langs->trans("FormatDateShortJavaInput")) . '\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript
7397
+					$retstring .= ($placeholder ? ' placeholder="'.dol_escape_htmltag($placeholder).'"' : '');
7398
+					$retstring .= ' onChange="dpChangeDay(\''.dol_escape_js($prefix).'\',\''.dol_escape_js($langs->trans("FormatDateShortJavaInput")).'\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript
7399 7399
 					$retstring .= ' autocomplete="off">';
7400 7400
 
7401 7401
 					// Icone calendrier
7402 7402
 					if ($disabled) {
7403
-						$retstringbutton = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons">' . img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"') . '</button>';
7404
-						$retstring = $retstringbutton . $retstring;
7403
+						$retstringbutton = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons">'.img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"').'</button>';
7404
+						$retstring = $retstringbutton.$retstring;
7405 7405
 					}
7406 7406
 
7407 7407
 					$retstring .= '</div>';
7408
-					$retstring .= '<input type="hidden" id="' . $prefix . 'day"   name="' . $prefix . 'day"   value="' . $sday . '">' . "\n";
7409
-					$retstring .= '<input type="hidden" id="' . $prefix . 'month" name="' . $prefix . 'month" value="' . $smonth . '">' . "\n";
7410
-					$retstring .= '<input type="hidden" id="' . $prefix . 'year"  name="' . $prefix . 'year"  value="' . $syear . '">' . "\n";
7408
+					$retstring .= '<input type="hidden" id="'.$prefix.'day"   name="'.$prefix.'day"   value="'.$sday.'">'."\n";
7409
+					$retstring .= '<input type="hidden" id="'.$prefix.'month" name="'.$prefix.'month" value="'.$smonth.'">'."\n";
7410
+					$retstring .= '<input type="hidden" id="'.$prefix.'year"  name="'.$prefix.'year"  value="'.$syear.'">'."\n";
7411 7411
 				} else {
7412 7412
 					$retstring .= "Bad value of MAIN_POPUP_CALENDAR";
7413 7413
 				}
7414 7414
 			} else {
7415 7415
 				// Show date with combo selects
7416 7416
 				// Day
7417
-				$retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth50imp" id="' . $prefix . 'day" name="' . $prefix . 'day">';
7417
+				$retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50imp" id="'.$prefix.'day" name="'.$prefix.'day">';
7418 7418
 
7419 7419
 				if ($emptydate || $set_time == -1) {
7420 7420
 					$retstring .= '<option value="0" selected>&nbsp;</option>';
7421 7421
 				}
7422 7422
 
7423 7423
 				for ($day = 1; $day <= 31; $day++) {
7424
-					$retstring .= '<option value="' . $day . '"' . ($day == $sday ? ' selected' : '') . '>' . $day . '</option>';
7424
+					$retstring .= '<option value="'.$day.'"'.($day == $sday ? ' selected' : '').'>'.$day.'</option>';
7425 7425
 				}
7426 7426
 
7427 7427
 				$retstring .= "</select>";
7428 7428
 
7429
-				$retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth75imp" id="' . $prefix . 'month" name="' . $prefix . 'month">';
7429
+				$retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth75imp" id="'.$prefix.'month" name="'.$prefix.'month">';
7430 7430
 				if ($emptydate || $set_time == -1) {
7431 7431
 					$retstring .= '<option value="0" selected>&nbsp;</option>';
7432 7432
 				}
7433 7433
 
7434 7434
 				// Month
7435 7435
 				for ($month = 1; $month <= 12; $month++) {
7436
-					$retstring .= '<option value="' . $month . '"' . ($month == $smonth ? ' selected' : '') . '>';
7436
+					$retstring .= '<option value="'.$month.'"'.($month == $smonth ? ' selected' : '').'>';
7437 7437
 					$retstring .= dol_print_date(mktime(12, 0, 0, $month, 1, 2000), "%b");
7438 7438
 					$retstring .= "</option>";
7439 7439
 				}
@@ -7441,13 +7441,13 @@  discard block
 block discarded – undo
7441 7441
 
7442 7442
 				// Year
7443 7443
 				if ($emptydate || $set_time == -1) {
7444
-					$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 . '">';
7444
+					$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.'">';
7445 7445
 				} else {
7446
-					$retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth75imp" id="' . $prefix . 'year" name="' . $prefix . 'year">';
7446
+					$retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth75imp" id="'.$prefix.'year" name="'.$prefix.'year">';
7447 7447
 
7448 7448
 					$syear = (int) $syear;
7449 7449
 					for ($year = $syear - 10; $year < (int) $syear + 10; $year++) {
7450
-						$retstring .= '<option value="' . $year . '"' . ($year == $syear ? ' selected' : '') . '>' . $year . '</option>';
7450
+						$retstring .= '<option value="'.$year.'"'.($year == $syear ? ' selected' : '').'>'.$year.'</option>';
7451 7451
 					}
7452 7452
 					$retstring .= "</select>\n";
7453 7453
 				}
@@ -7472,15 +7472,15 @@  discard block
 block discarded – undo
7472 7472
 			}
7473 7473
 
7474 7474
 			// Show hour
7475
-			$retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth50 ' . ($fullday ? $fullday . 'hour' : '') . '" id="' . $prefix . 'hour" name="' . $prefix . 'hour">';
7475
+			$retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50 '.($fullday ? $fullday.'hour' : '').'" id="'.$prefix.'hour" name="'.$prefix.'hour">';
7476 7476
 			if ($emptyhours) {
7477 7477
 				$retstring .= '<option value="-1">&nbsp;</option>';
7478 7478
 			}
7479 7479
 			for ($hour = $hourstart; $hour < $hourend; $hour++) {
7480 7480
 				if (strlen($hour) < 2) {
7481
-					$hour = "0" . $hour;
7481
+					$hour = "0".$hour;
7482 7482
 				}
7483
-				$retstring .= '<option value="' . $hour . '"' . (($hour == $shour) ? ' selected' : '') . '>' . $hour;
7483
+				$retstring .= '<option value="'.$hour.'"'.(($hour == $shour) ? ' selected' : '').'>'.$hour;
7484 7484
 				//$retstring .= (empty($conf->dol_optimize_smallscreen) ? '' : 'H');
7485 7485
 				$retstring .= '</option>';
7486 7486
 			}
@@ -7493,17 +7493,17 @@  discard block
 block discarded – undo
7493 7493
 
7494 7494
 		if ($m) {
7495 7495
 			// Show minutes
7496
-			$retstring .= '<select ' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth50 ' . ($fullday ? $fullday . 'min' : '') . '" id="' . $prefix . 'min" name="' . $prefix . 'min">';
7496
+			$retstring .= '<select '.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50 '.($fullday ? $fullday.'min' : '').'" id="'.$prefix.'min" name="'.$prefix.'min">';
7497 7497
 			if ($emptyhours) {
7498 7498
 				$retstring .= '<option value="-1">&nbsp;</option>';
7499 7499
 			}
7500 7500
 			for ($min = 0; $min < 60; $min += $stepminutes) {
7501 7501
 				$min_str = sprintf("%02d", $min);
7502
-				$retstring .= '<option value="' . $min_str . '"' . (($min_str == $smin) ? ' selected' : '') . '>' . $min_str . '</option>';
7502
+				$retstring .= '<option value="'.$min_str.'"'.(($min_str == $smin) ? ' selected' : '').'>'.$min_str.'</option>';
7503 7503
 			}
7504 7504
 			$retstring .= '</select>';
7505 7505
 
7506
-			$retstring .= '<input type="hidden" name="' . $prefix . 'sec" value="' . $ssec . '">';
7506
+			$retstring .= '<input type="hidden" name="'.$prefix.'sec" value="'.$ssec.'">';
7507 7507
 		}
7508 7508
 
7509 7509
 		if ($d && $h) {
@@ -7526,10 +7526,10 @@  discard block
 block discarded – undo
7526 7526
 
7527 7527
 			// Generate the date part, depending on the use or not of the javascript calendar
7528 7528
 			if ($addnowlink == 1) { // server time expressed in user time setup
7529
-				$reset_scripts .= 'jQuery(\'#' . $prefix . '\').val(\'' . dol_print_date($nowgmt, 'day', 'tzuserrel') . '\');';
7530
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'day\').val(\'' . dol_print_date($nowgmt, '%d', 'tzuserrel') . '\');';
7531
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'month\').val(\'' . dol_print_date($nowgmt, '%m', 'tzuserrel') . '\');';
7532
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'year\').val(\'' . dol_print_date($nowgmt, '%Y', 'tzuserrel') . '\');';
7529
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'day', 'tzuserrel').'\');';
7530
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');';
7531
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');';
7532
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');';
7533 7533
 			} elseif ($addnowlink == 2) {
7534 7534
 				/* Disabled because the output does not use the string format defined by FormatDateShort key to forge the value into #prefix.
7535 7535
 				 * This break application for foreign languages.
@@ -7538,10 +7538,10 @@  discard block
 block discarded – undo
7538 7538
 				$reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(parseInt(d.getMonth().pad()) + 1);';
7539 7539
 				$reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(d.getFullYear());';
7540 7540
 				*/
7541
-				$reset_scripts .= 'jQuery(\'#' . $prefix . '\').val(\'' . dol_print_date($nowgmt, 'day', 'tzuserrel') . '\');';
7542
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'day\').val(\'' . dol_print_date($nowgmt, '%d', 'tzuserrel') . '\');';
7543
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'month\').val(\'' . dol_print_date($nowgmt, '%m', 'tzuserrel') . '\');';
7544
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'year\').val(\'' . dol_print_date($nowgmt, '%Y', 'tzuserrel') . '\');';
7541
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'day', 'tzuserrel').'\');';
7542
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');';
7543
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');';
7544
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');';
7545 7545
 			}
7546 7546
 			/*if ($usecalendar == "eldy")
7547 7547
 			{
@@ -7561,11 +7561,11 @@  discard block
 block discarded – undo
7561 7561
 				}
7562 7562
 				//$reset_scripts .= 'this.form.elements[\''.$prefix.'hour\'].value=formatDate(new Date(), \'HH\'); ';
7563 7563
 				if ($addnowlink == 1) {
7564
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').val(\'' . dol_print_date($nowgmt, '%H', 'tzuserrel') . '\');';
7565
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').change();';
7564
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(\''.dol_print_date($nowgmt, '%H', 'tzuserrel').'\');';
7565
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').change();';
7566 7566
 				} elseif ($addnowlink == 2) {
7567
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').val(d.getHours().pad());';
7568
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').change();';
7567
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(d.getHours().pad());';
7568
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').change();';
7569 7569
 				}
7570 7570
 
7571 7571
 				if ($fullday) {
@@ -7579,11 +7579,11 @@  discard block
 block discarded – undo
7579 7579
 				}
7580 7580
 				//$reset_scripts .= 'this.form.elements[\''.$prefix.'min\'].value=formatDate(new Date(), \'mm\'); ';
7581 7581
 				if ($addnowlink == 1) {
7582
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').val(\'' . dol_print_date($nowgmt, '%M', 'tzuserrel') . '\');';
7583
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').change();';
7582
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(\''.dol_print_date($nowgmt, '%M', 'tzuserrel').'\');';
7583
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').change();';
7584 7584
 				} elseif ($addnowlink == 2) {
7585
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').val(d.getMinutes().pad());';
7586
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').change();';
7585
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(d.getMinutes().pad());';
7586
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').change();';
7587 7587
 				}
7588 7588
 				if ($fullday) {
7589 7589
 					$reset_scripts .= ' } ';
@@ -7591,7 +7591,7 @@  discard block
 block discarded – undo
7591 7591
 			}
7592 7592
 			// If reset_scripts is not empty, print the link with the reset_scripts in the onClick
7593 7593
 			if ($reset_scripts && !getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
7594
-				$retstring .= ' <button class="dpInvisibleButtons datenowlink" id="' . $prefix . 'ButtonNow" type="button" name="_useless" value="now" onClick="' . $reset_scripts . '">';
7594
+				$retstring .= ' <button class="dpInvisibleButtons datenowlink" id="'.$prefix.'ButtonNow" type="button" name="_useless" value="now" onClick="'.$reset_scripts.'">';
7595 7595
 				$retstring .= $langs->trans("Now");
7596 7596
 				$retstring .= '</button> ';
7597 7597
 			}
@@ -7603,16 +7603,16 @@  discard block
 block discarded – undo
7603 7603
 			$reset_scripts = "";
7604 7604
 
7605 7605
 			// Generate the date part, depending on the use or not of the javascript calendar
7606
-			$reset_scripts .= 'jQuery(\'#' . $prefix . '\').val(\'' . dol_print_date($nowgmt, 'dayinputnoreduce', 'tzuserrel') . '\');';
7607
-			$reset_scripts .= 'jQuery(\'#' . $prefix . 'day\').val(\'' . dol_print_date($nowgmt, '%d', 'tzuserrel') . '\');';
7608
-			$reset_scripts .= 'jQuery(\'#' . $prefix . 'month\').val(\'' . dol_print_date($nowgmt, '%m', 'tzuserrel') . '\');';
7609
-			$reset_scripts .= 'jQuery(\'#' . $prefix . 'year\').val(\'' . dol_print_date($nowgmt, '%Y', 'tzuserrel') . '\');';
7606
+			$reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'dayinputnoreduce', 'tzuserrel').'\');';
7607
+			$reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');';
7608
+			$reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');';
7609
+			$reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');';
7610 7610
 			// Update the hour part
7611 7611
 			if ($h) {
7612 7612
 				if ($fullday) {
7613 7613
 					$reset_scripts .= " if (jQuery('#fullday:checked').val() == null) {";
7614 7614
 				}
7615
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').val(\'' . dol_print_date($nowgmt, '%H', 'tzuserrel') . '\');';
7615
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(\''.dol_print_date($nowgmt, '%H', 'tzuserrel').'\');';
7616 7616
 				if ($fullday) {
7617 7617
 					$reset_scripts .= ' } ';
7618 7618
 				}
@@ -7622,14 +7622,14 @@  discard block
 block discarded – undo
7622 7622
 				if ($fullday) {
7623 7623
 					$reset_scripts .= " if (jQuery('#fullday:checked').val() == null) {";
7624 7624
 				}
7625
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').val(\'' . dol_print_date($nowgmt, '%M', 'tzuserrel') . '\');';
7625
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(\''.dol_print_date($nowgmt, '%M', 'tzuserrel').'\');';
7626 7626
 				if ($fullday) {
7627 7627
 					$reset_scripts .= ' } ';
7628 7628
 				}
7629 7629
 			}
7630 7630
 			// If reset_scripts is not empty, print the link with the reset_scripts in the onClick
7631 7631
 			if ($reset_scripts && empty($conf->dol_optimize_smallscreen)) {
7632
-				$retstring .= ' <button class="dpInvisibleButtons datenowlink" id="' . $prefix . 'ButtonPlusOne" type="button" name="_useless2" value="plusone" onClick="' . $reset_scripts . '">';
7632
+				$retstring .= ' <button class="dpInvisibleButtons datenowlink" id="'.$prefix.'ButtonPlusOne" type="button" name="_useless2" value="plusone" onClick="'.$reset_scripts.'">';
7633 7633
 				$retstring .= $langs->trans("DateStartPlusOne");
7634 7634
 				$retstring .= '</button> ';
7635 7635
 			}
@@ -7687,17 +7687,17 @@  discard block
 block discarded – undo
7687 7687
 			unset($TDurationTypes[$value]);
7688 7688
 		}
7689 7689
 
7690
-		$retstring = '<select class="flat minwidth75 maxwidth100" id="select_' . $prefix . 'type_duration" name="' . $prefix . 'type_duration">';
7690
+		$retstring = '<select class="flat minwidth75 maxwidth100" id="select_'.$prefix.'type_duration" name="'.$prefix.'type_duration">';
7691 7691
 		foreach ($TDurationTypes as $key => $typeduration) {
7692
-			$retstring .= '<option value="' . $key . '"';
7692
+			$retstring .= '<option value="'.$key.'"';
7693 7693
 			if ($key == $selected) {
7694 7694
 				$retstring .= " selected";
7695 7695
 			}
7696
-			$retstring .= ">" . $typeduration . "</option>";
7696
+			$retstring .= ">".$typeduration."</option>";
7697 7697
 		}
7698 7698
 		$retstring .= "</select>";
7699 7699
 
7700
-		$retstring .= ajax_combobox('select_' . $prefix . 'type_duration');
7700
+		$retstring .= ajax_combobox('select_'.$prefix.'type_duration');
7701 7701
 
7702 7702
 		return $retstring;
7703 7703
 	}
@@ -7729,30 +7729,30 @@  discard block
 block discarded – undo
7729 7729
 
7730 7730
 		// Hours
7731 7731
 		if ($iSecond != '') {
7732
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
7732
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
7733 7733
 
7734 7734
 			$hourSelected = convertSecondToTime($iSecond, 'allhour');
7735 7735
 			$minSelected = convertSecondToTime($iSecond, 'min');
7736 7736
 		}
7737 7737
 
7738 7738
 		if ($typehour == 'select') {
7739
-			$retstring .= '<select class="flat" id="select_' . $prefix . 'hour" name="' . $prefix . 'hour"' . ($disabled ? ' disabled' : '') . '>';
7739
+			$retstring .= '<select class="flat" id="select_'.$prefix.'hour" name="'.$prefix.'hour"'.($disabled ? ' disabled' : '').'>';
7740 7740
 			for ($hour = 0; $hour < 25; $hour++) {    // For a duration, we allow 24 hours
7741
-				$retstring .= '<option value="' . $hour . '"';
7741
+				$retstring .= '<option value="'.$hour.'"';
7742 7742
 				if (is_numeric($hourSelected) && $hourSelected == $hour) {
7743 7743
 					$retstring .= " selected";
7744 7744
 				}
7745
-				$retstring .= ">" . $hour . "</option>";
7745
+				$retstring .= ">".$hour."</option>";
7746 7746
 			}
7747 7747
 			$retstring .= "</select>";
7748 7748
 		} elseif ($typehour == 'text' || $typehour == 'textselect') {
7749
-			$retstring .= '<input placeholder="' . $langs->trans('HourShort') . '" type="number" min="0" name="' . $prefix . 'hour"' . ($disabled ? ' disabled' : '') . ' class="flat maxwidth50 inputhour right" value="' . (($hourSelected != '') ? ((int) $hourSelected) : '') . '">';
7749
+			$retstring .= '<input placeholder="'.$langs->trans('HourShort').'" type="number" min="0" name="'.$prefix.'hour"'.($disabled ? ' disabled' : '').' class="flat maxwidth50 inputhour right" value="'.(($hourSelected != '') ? ((int) $hourSelected) : '').'">';
7750 7750
 		} else {
7751 7751
 			return 'BadValueForParameterTypeHour';
7752 7752
 		}
7753 7753
 
7754 7754
 		if ($typehour != 'text') {
7755
-			$retstring .= ' ' . $langs->trans('HourShort');
7755
+			$retstring .= ' '.$langs->trans('HourShort');
7756 7756
 		} else {
7757 7757
 			$retstring .= '<span class="">:</span>';
7758 7758
 		}
@@ -7767,21 +7767,21 @@  discard block
 block discarded – undo
7767 7767
 		}
7768 7768
 
7769 7769
 		if ($typehour == 'select' || $typehour == 'textselect') {
7770
-			$retstring .= '<select class="flat" id="select_' . $prefix . 'min" name="' . $prefix . 'min"' . ($disabled ? ' disabled' : '') . '>';
7770
+			$retstring .= '<select class="flat" id="select_'.$prefix.'min" name="'.$prefix.'min"'.($disabled ? ' disabled' : '').'>';
7771 7771
 			for ($min = 0; $min <= 55; $min += 5) {
7772
-				$retstring .= '<option value="' . $min . '"';
7772
+				$retstring .= '<option value="'.$min.'"';
7773 7773
 				if (is_numeric($minSelected) && $minSelected == $min) {
7774 7774
 					$retstring .= ' selected';
7775 7775
 				}
7776
-				$retstring .= '>' . $min . '</option>';
7776
+				$retstring .= '>'.$min.'</option>';
7777 7777
 			}
7778 7778
 			$retstring .= "</select>";
7779 7779
 		} elseif ($typehour == 'text') {
7780
-			$retstring .= '<input placeholder="' . $langs->trans('MinuteShort') . '" type="number" min="0" name="' . $prefix . 'min"' . ($disabled ? ' disabled' : '') . ' class="flat maxwidth50 inputminute right" value="' . (($minSelected != '') ? ((int) $minSelected) : '') . '">';
7780
+			$retstring .= '<input placeholder="'.$langs->trans('MinuteShort').'" type="number" min="0" name="'.$prefix.'min"'.($disabled ? ' disabled' : '').' class="flat maxwidth50 inputminute right" value="'.(($minSelected != '') ? ((int) $minSelected) : '').'">';
7781 7781
 		}
7782 7782
 
7783 7783
 		if ($typehour != 'text') {
7784
-			$retstring .= ' ' . $langs->trans('MinuteShort');
7784
+			$retstring .= ' '.$langs->trans('MinuteShort');
7785 7785
 		}
7786 7786
 
7787 7787
 		$retstring .= "</span>";
@@ -7829,7 +7829,7 @@  discard block
 block discarded – undo
7829 7829
 			$placeholder = '';
7830 7830
 
7831 7831
 			if ($selected && empty($selected_input_value)) {
7832
-				require_once DOL_DOCUMENT_ROOT . '/ticket/class/ticket.class.php';
7832
+				require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php';
7833 7833
 				$tickettmpselect = new Ticket($this->db);
7834 7834
 				$tickettmpselect->fetch($selected);
7835 7835
 				$selected_input_value = $tickettmpselect->ref;
@@ -7837,17 +7837,17 @@  discard block
 block discarded – undo
7837 7837
 			}
7838 7838
 
7839 7839
 			$urloption = '';
7840
-			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/ticket/ajax/tickets.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
7840
+			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/ticket/ajax/tickets.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
7841 7841
 
7842 7842
 			if (empty($hidelabel)) {
7843
-				$out .= $langs->trans("RefOrLabel") . ' : ';
7843
+				$out .= $langs->trans("RefOrLabel").' : ';
7844 7844
 			} elseif ($hidelabel > 1) {
7845
-				$placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"';
7845
+				$placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"';
7846 7846
 				if ($hidelabel == 2) {
7847 7847
 					$out .= img_picto($langs->trans("Search"), 'search');
7848 7848
 				}
7849 7849
 			}
7850
-			$out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />';
7850
+			$out .= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />';
7851 7851
 			if ($hidelabel == 3) {
7852 7852
 				$out .= img_picto($langs->trans("Search"), 'search');
7853 7853
 			}
@@ -7891,8 +7891,8 @@  discard block
 block discarded – undo
7891 7891
 
7892 7892
 		$sql = "SELECT ";
7893 7893
 		$sql .= $selectFields;
7894
-		$sql .= " FROM " . $this->db->prefix() . "ticket as p";
7895
-		$sql .= ' WHERE p.entity IN (' . getEntity('ticket') . ')';
7894
+		$sql .= " FROM ".$this->db->prefix()."ticket as p";
7895
+		$sql .= ' WHERE p.entity IN ('.getEntity('ticket').')';
7896 7896
 
7897 7897
 		// Add criteria on ref/label
7898 7898
 		if ($filterkey != '') {
@@ -7908,7 +7908,7 @@  discard block
 block discarded – undo
7908 7908
 				if ($i > 0) {
7909 7909
 					$sql .= " AND ";
7910 7910
 				}
7911
-				$sql .= "(p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%' OR p.subject LIKE '" . $this->db->escape($prefix . $crit) . "%'";
7911
+				$sql .= "(p.ref LIKE '".$this->db->escape($prefix.$crit)."%' OR p.subject LIKE '".$this->db->escape($prefix.$crit)."%'";
7912 7912
 				$sql .= ")";
7913 7913
 				$i++;
7914 7914
 			}
@@ -7921,22 +7921,22 @@  discard block
 block discarded – undo
7921 7921
 		$sql .= $this->db->plimit($limit, 0);
7922 7922
 
7923 7923
 		// Build output string
7924
-		dol_syslog(get_class($this) . "::selectTicketsList search tickets", LOG_DEBUG);
7924
+		dol_syslog(get_class($this)."::selectTicketsList search tickets", LOG_DEBUG);
7925 7925
 		$result = $this->db->query($sql);
7926 7926
 		if ($result) {
7927
-			require_once DOL_DOCUMENT_ROOT . '/ticket/class/ticket.class.php';
7928
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/ticket.lib.php';
7927
+			require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php';
7928
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/ticket.lib.php';
7929 7929
 
7930 7930
 			$num = $this->db->num_rows($result);
7931 7931
 
7932 7932
 			$events = array();
7933 7933
 
7934 7934
 			if (!$forcecombo) {
7935
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
7935
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
7936 7936
 				$out .= ajax_combobox($htmlname, $events, getDolGlobalInt('TICKET_USE_SEARCH_TO_SELECT'));
7937 7937
 			}
7938 7938
 
7939
-			$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
7939
+			$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
7940 7940
 
7941 7941
 			$textifempty = '';
7942 7942
 			// Do not use textifempty = ' ' or '&nbsp;' here, or search on key will search on ' key'.
@@ -7953,7 +7953,7 @@  discard block
 block discarded – undo
7953 7953
 				}
7954 7954
 			}
7955 7955
 			if ($showempty) {
7956
-				$out .= '<option value="0" selected>' . $textifempty . '</option>';
7956
+				$out .= '<option value="0" selected>'.$textifempty.'</option>';
7957 7957
 			}
7958 7958
 
7959 7959
 			$i = 0;
@@ -8008,13 +8008,13 @@  discard block
 block discarded – undo
8008 8008
 		$outkey = $objp->rowid;
8009 8009
 		$outref = $objp->ref;
8010 8010
 
8011
-		$opt = '<option value="' . $objp->rowid . '"';
8011
+		$opt = '<option value="'.$objp->rowid.'"';
8012 8012
 		$opt .= ($objp->rowid == $selected) ? ' selected' : '';
8013 8013
 		$opt .= '>';
8014 8014
 		$opt .= $objp->ref;
8015 8015
 		$objRef = $objp->ref;
8016 8016
 		if (!empty($filterkey) && $filterkey != '') {
8017
-			$objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1);
8017
+			$objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1);
8018 8018
 		}
8019 8019
 
8020 8020
 		$opt .= "</option>\n";
@@ -8055,7 +8055,7 @@  discard block
 block discarded – undo
8055 8055
 			$placeholder = '';
8056 8056
 
8057 8057
 			if ($selected && empty($selected_input_value)) {
8058
-				require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
8058
+				require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
8059 8059
 				$projecttmpselect = new Project($this->db);
8060 8060
 				$projecttmpselect->fetch($selected);
8061 8061
 				$selected_input_value = $projecttmpselect->ref;
@@ -8063,17 +8063,17 @@  discard block
 block discarded – undo
8063 8063
 			}
8064 8064
 
8065 8065
 			$urloption = '';
8066
-			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/projet/ajax/projects.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
8066
+			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/projet/ajax/projects.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
8067 8067
 
8068 8068
 			if (empty($hidelabel)) {
8069
-				$out .= $langs->trans("RefOrLabel") . ' : ';
8069
+				$out .= $langs->trans("RefOrLabel").' : ';
8070 8070
 			} elseif ($hidelabel > 1) {
8071
-				$placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"';
8071
+				$placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"';
8072 8072
 				if ($hidelabel == 2) {
8073 8073
 					$out .= img_picto($langs->trans("Search"), 'search');
8074 8074
 				}
8075 8075
 			}
8076
-			$out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />';
8076
+			$out .= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />';
8077 8077
 			if ($hidelabel == 3) {
8078 8078
 				$out .= img_picto($langs->trans("Search"), 'search');
8079 8079
 			}
@@ -8116,8 +8116,8 @@  discard block
 block discarded – undo
8116 8116
 
8117 8117
 		$sql = "SELECT ";
8118 8118
 		$sql .= $selectFields;
8119
-		$sql .= " FROM " . $this->db->prefix() . "projet as p";
8120
-		$sql .= ' WHERE p.entity IN (' . getEntity('project') . ')';
8119
+		$sql .= " FROM ".$this->db->prefix()."projet as p";
8120
+		$sql .= ' WHERE p.entity IN ('.getEntity('project').')';
8121 8121
 
8122 8122
 		// Add criteria on ref/label
8123 8123
 		if ($filterkey != '') {
@@ -8133,7 +8133,7 @@  discard block
 block discarded – undo
8133 8133
 				if ($i > 0) {
8134 8134
 					$sql .= " AND ";
8135 8135
 				}
8136
-				$sql .= "p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%'";
8136
+				$sql .= "p.ref LIKE '".$this->db->escape($prefix.$crit)."%'";
8137 8137
 				$sql .= "";
8138 8138
 				$i++;
8139 8139
 			}
@@ -8146,22 +8146,22 @@  discard block
 block discarded – undo
8146 8146
 		$sql .= $this->db->plimit($limit, 0);
8147 8147
 
8148 8148
 		// Build output string
8149
-		dol_syslog(get_class($this) . "::selectProjectsList search projects", LOG_DEBUG);
8149
+		dol_syslog(get_class($this)."::selectProjectsList search projects", LOG_DEBUG);
8150 8150
 		$result = $this->db->query($sql);
8151 8151
 		if ($result) {
8152
-			require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
8153
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php';
8152
+			require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
8153
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
8154 8154
 
8155 8155
 			$num = $this->db->num_rows($result);
8156 8156
 
8157 8157
 			$events = array();
8158 8158
 
8159 8159
 			if (!$forcecombo) {
8160
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
8160
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
8161 8161
 				$out .= ajax_combobox($htmlname, $events, getDolGlobalInt('PROJECT_USE_SEARCH_TO_SELECT'));
8162 8162
 			}
8163 8163
 
8164
-			$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
8164
+			$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
8165 8165
 
8166 8166
 			$textifempty = '';
8167 8167
 			// Do not use textifempty = ' ' or '&nbsp;' here, or search on key will search on ' key'.
@@ -8178,7 +8178,7 @@  discard block
 block discarded – undo
8178 8178
 				}
8179 8179
 			}
8180 8180
 			if ($showempty) {
8181
-				$out .= '<option value="0" selected>' . $textifempty . '</option>';
8181
+				$out .= '<option value="0" selected>'.$textifempty.'</option>';
8182 8182
 			}
8183 8183
 
8184 8184
 			$i = 0;
@@ -8236,13 +8236,13 @@  discard block
 block discarded – undo
8236 8236
 		$outlabel = $objp->label;
8237 8237
 		$outtype = $objp->fk_product_type;
8238 8238
 
8239
-		$opt = '<option value="' . $objp->rowid . '"';
8239
+		$opt = '<option value="'.$objp->rowid.'"';
8240 8240
 		$opt .= ($objp->rowid == $selected) ? ' selected' : '';
8241 8241
 		$opt .= '>';
8242 8242
 		$opt .= $objp->ref;
8243 8243
 		$objRef = $objp->ref;
8244 8244
 		if (!empty($filterkey) && $filterkey != '') {
8245
-			$objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1);
8245
+			$objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1);
8246 8246
 		}
8247 8247
 
8248 8248
 		$opt .= "</option>\n";
@@ -8284,7 +8284,7 @@  discard block
 block discarded – undo
8284 8284
 			$placeholder = '';
8285 8285
 
8286 8286
 			if ($selected && empty($selected_input_value)) {
8287
-				require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php';
8287
+				require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
8288 8288
 				$adherenttmpselect = new Adherent($this->db);
8289 8289
 				$adherenttmpselect->fetch($selected);
8290 8290
 				$selected_input_value = $adherenttmpselect->ref;
@@ -8293,17 +8293,17 @@  discard block
 block discarded – undo
8293 8293
 
8294 8294
 			$urloption = '';
8295 8295
 
8296
-			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/adherents/ajax/adherents.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
8296
+			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/adherents/ajax/adherents.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
8297 8297
 
8298 8298
 			if (empty($hidelabel)) {
8299
-				$out .= $langs->trans("RefOrLabel") . ' : ';
8299
+				$out .= $langs->trans("RefOrLabel").' : ';
8300 8300
 			} elseif ($hidelabel > 1) {
8301
-				$placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"';
8301
+				$placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"';
8302 8302
 				if ($hidelabel == 2) {
8303 8303
 					$out .= img_picto($langs->trans("Search"), 'search');
8304 8304
 				}
8305 8305
 			}
8306
-			$out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />';
8306
+			$out .= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />';
8307 8307
 			if ($hidelabel == 3) {
8308 8308
 				$out .= img_picto($langs->trans("Search"), 'search');
8309 8309
 			}
@@ -8348,8 +8348,8 @@  discard block
 block discarded – undo
8348 8348
 
8349 8349
 		$sql = "SELECT ";
8350 8350
 		$sql .= $selectFields;
8351
-		$sql .= " FROM " . $this->db->prefix() . "adherent as p";
8352
-		$sql .= ' WHERE p.entity IN (' . getEntity('adherent') . ')';
8351
+		$sql .= " FROM ".$this->db->prefix()."adherent as p";
8352
+		$sql .= ' WHERE p.entity IN ('.getEntity('adherent').')';
8353 8353
 
8354 8354
 		// Add criteria on ref/label
8355 8355
 		if ($filterkey != '') {
@@ -8365,8 +8365,8 @@  discard block
 block discarded – undo
8365 8365
 				if ($i > 0) {
8366 8366
 					$sql .= " AND ";
8367 8367
 				}
8368
-				$sql .= "(p.firstname LIKE '" . $this->db->escape($prefix . $crit) . "%'";
8369
-				$sql .= " OR p.lastname LIKE '" . $this->db->escape($prefix . $crit) . "%')";
8368
+				$sql .= "(p.firstname LIKE '".$this->db->escape($prefix.$crit)."%'";
8369
+				$sql .= " OR p.lastname LIKE '".$this->db->escape($prefix.$crit)."%')";
8370 8370
 				$i++;
8371 8371
 			}
8372 8372
 			if (count($search_crit) > 1) {
@@ -8375,27 +8375,27 @@  discard block
 block discarded – undo
8375 8375
 			$sql .= ')';
8376 8376
 		}
8377 8377
 		if ($status != -1) {
8378
-			$sql .= ' AND statut = ' . ((int) $status);
8378
+			$sql .= ' AND statut = '.((int) $status);
8379 8379
 		}
8380 8380
 		$sql .= $this->db->plimit($limit, 0);
8381 8381
 
8382 8382
 		// Build output string
8383
-		dol_syslog(get_class($this) . "::selectMembersList search adherents", LOG_DEBUG);
8383
+		dol_syslog(get_class($this)."::selectMembersList search adherents", LOG_DEBUG);
8384 8384
 		$result = $this->db->query($sql);
8385 8385
 		if ($result) {
8386
-			require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php';
8387
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/member.lib.php';
8386
+			require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
8387
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
8388 8388
 
8389 8389
 			$num = $this->db->num_rows($result);
8390 8390
 
8391 8391
 			$events = array();
8392 8392
 
8393 8393
 			if (!$forcecombo) {
8394
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
8394
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
8395 8395
 				$out .= ajax_combobox($htmlname, $events, getDolGlobalString('PROJECT_USE_SEARCH_TO_SELECT') ? $conf->global->PROJECT_USE_SEARCH_TO_SELECT : '');
8396 8396
 			}
8397 8397
 
8398
-			$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
8398
+			$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
8399 8399
 
8400 8400
 			$textifempty = '';
8401 8401
 			// Do not use textifempty = ' ' or '&nbsp;' here, or search on key will search on ' key'.
@@ -8412,7 +8412,7 @@  discard block
 block discarded – undo
8412 8412
 				}
8413 8413
 			}
8414 8414
 			if ($showempty) {
8415
-				$out .= '<option value="-1" selected>' . $textifempty . '</option>';
8415
+				$out .= '<option value="-1" selected>'.$textifempty.'</option>';
8416 8416
 			}
8417 8417
 
8418 8418
 			$i = 0;
@@ -8468,11 +8468,11 @@  discard block
 block discarded – undo
8468 8468
 		$outlabel = dolGetFirstLastname($objp->firstname, $objp->lastname);
8469 8469
 		$outtype = $objp->fk_adherent_type;
8470 8470
 
8471
-		$opt = '<option value="' . $objp->rowid . '"';
8471
+		$opt = '<option value="'.$objp->rowid.'"';
8472 8472
 		$opt .= ($objp->rowid == $selected) ? ' selected' : '';
8473 8473
 		$opt .= '>';
8474 8474
 		if (!empty($filterkey) && $filterkey != '') {
8475
-			$outlabel = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $outlabel, 1);
8475
+			$outlabel = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $outlabel, 1);
8476 8476
 		}
8477 8477
 		$opt .= $outlabel;
8478 8478
 		$opt .= "</option>\n";
@@ -8527,8 +8527,8 @@  discard block
 block discarded – undo
8527 8527
 		$objecttmp = null;
8528 8528
 		$InfoFieldList = array();
8529 8529
 		$classname = '';
8530
-		$filter = '';  // Ensure filter has value (for static analysis)
8531
-		$sortfield = '';  // Ensure filter has value (for static analysis)
8530
+		$filter = ''; // Ensure filter has value (for static analysis)
8531
+		$sortfield = ''; // Ensure filter has value (for static analysis)
8532 8532
 
8533 8533
 		if ($objectfield) {	// We must retrieve the objectdesc from the field or extrafield
8534 8534
 			// Example: $objectfield = 'product:options_package' or 'myobject@mymodule:options_myfield'
@@ -8572,9 +8572,9 @@  discard block
 block discarded – undo
8572 8572
 			$vartmp = (empty($InfoFieldList[3]) ? '' : $InfoFieldList[3]);
8573 8573
 			$reg = array();
8574 8574
 			if (preg_match('/^.*:(\w*)$/', $vartmp, $reg)) {
8575
-				$InfoFieldList[4] = $reg[1];    // take the sort field
8575
+				$InfoFieldList[4] = $reg[1]; // take the sort field
8576 8576
 			}
8577
-			$InfoFieldList[3] = preg_replace('/:\w*$/', '', $vartmp);    // take the filter field
8577
+			$InfoFieldList[3] = preg_replace('/:\w*$/', '', $vartmp); // take the filter field
8578 8578
 
8579 8579
 			$classname = $InfoFieldList[0];
8580 8580
 			$classpath = empty($InfoFieldList[1]) ? '' : $InfoFieldList[1];
@@ -8605,8 +8605,8 @@  discard block
 block discarded – undo
8605 8605
 		);
8606 8606
 
8607 8607
 		if (!is_object($objecttmp)) {
8608
-			dol_syslog('selectForForms: Error bad setup of field objectdescorig=' . $objectdescorig.', objectfield='.$objectfield.', objectdesc='.$objectdesc, LOG_WARNING);
8609
-			return 'selectForForms: Error bad setup of field objectdescorig=' . $objectdescorig.', objectfield='.$objectfield.', objectdesc='.$objectdesc;
8608
+			dol_syslog('selectForForms: Error bad setup of field objectdescorig='.$objectdescorig.', objectfield='.$objectfield.', objectdesc='.$objectdesc, LOG_WARNING);
8609
+			return 'selectForForms: Error bad setup of field objectdescorig='.$objectdescorig.', objectfield='.$objectfield.', objectdesc='.$objectdesc;
8610 8610
 		}
8611 8611
 		'@phan-var-force CommonObject $objecttmp';
8612 8612
 		/** @var CommonObject $objecttmp */
@@ -8618,9 +8618,9 @@  discard block
 block discarded – undo
8618 8618
 		if ($prefixforautocompletemode == 'product') {
8619 8619
 			$prefixforautocompletemode = 'produit';
8620 8620
 		}
8621
-		$confkeyforautocompletemode = strtoupper($prefixforautocompletemode) . '_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT
8621
+		$confkeyforautocompletemode = strtoupper($prefixforautocompletemode).'_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT
8622 8622
 
8623
-		dol_syslog(get_class($this) . "::selectForForms filter=" . $filter, LOG_DEBUG);
8623
+		dol_syslog(get_class($this)."::selectForForms filter=".$filter, LOG_DEBUG);
8624 8624
 
8625 8625
 		// Generate the combo HTML component
8626 8626
 		$out = '';
@@ -8649,13 +8649,13 @@  discard block
 block discarded – undo
8649 8649
 			}
8650 8650
 
8651 8651
 			// Set url and param to call to get json of the search results
8652
-			$urlforajaxcall = DOL_URL_ROOT . '/core/ajax/selectobject.php';
8653
-			$urloption = 'htmlname=' . urlencode($htmlname) . '&outjson=1&objectdesc=' . urlencode($objectdescorig) . '&objectfield='.urlencode($objectfield) . ($sortfield ? '&sortfield=' . urlencode($sortfield) : '');
8652
+			$urlforajaxcall = DOL_URL_ROOT.'/core/ajax/selectobject.php';
8653
+			$urloption = 'htmlname='.urlencode($htmlname).'&outjson=1&objectdesc='.urlencode($objectdescorig).'&objectfield='.urlencode($objectfield).($sortfield ? '&sortfield='.urlencode($sortfield) : '');
8654 8654
 
8655 8655
 			// Activate the auto complete using ajax call.
8656 8656
 			$out .= ajax_autocompleter((string) $preSelectedValue, $htmlname, $urlforajaxcall, $urloption, getDolGlobalInt($confkeyforautocompletemode), 0);
8657 8657
 			$out .= '<!-- force css to be higher than dialog popup --><style type="text/css">.ui-autocomplete { z-index: 1010; }</style>';
8658
-			$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) . '"' : '') . ' />';
8658
+			$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).'"' : '').' />';
8659 8659
 		} else {
8660 8660
 			// Immediate load of table record.
8661 8661
 			$out .= $this->selectForFormsList($objecttmp, $htmlname, $preSelectedValue, $showempty, $searchkey, $placeholder, $morecss, $moreparams, $forcecombo, 0, $disabled, $sortfield, $filter);
@@ -8695,16 +8695,16 @@  discard block
 block discarded – undo
8695 8695
 		if ($prefixforautocompletemode == 'societe') {
8696 8696
 			$prefixforautocompletemode = 'company';
8697 8697
 		}
8698
-		$confkeyforautocompletemode = strtoupper($prefixforautocompletemode) . '_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT
8698
+		$confkeyforautocompletemode = strtoupper($prefixforautocompletemode).'_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT
8699 8699
 
8700 8700
 		if (!empty($objecttmp->fields)) {    // For object that declare it, it is better to use declared fields (like societe, contact, ...)
8701 8701
 			$tmpfieldstoshow = '';
8702 8702
 			foreach ($objecttmp->fields as $key => $val) {
8703
-				if (! (int) dol_eval($val['enabled'], 1, 1, '1')) {
8703
+				if (!(int) dol_eval($val['enabled'], 1, 1, '1')) {
8704 8704
 					continue;
8705 8705
 				}
8706 8706
 				if (!empty($val['showoncombobox'])) {
8707
-					$tmpfieldstoshow .= ($tmpfieldstoshow ? ',' : '') . 't.' . $key;
8707
+					$tmpfieldstoshow .= ($tmpfieldstoshow ? ',' : '').'t.'.$key;
8708 8708
 				}
8709 8709
 			}
8710 8710
 			if ($tmpfieldstoshow) {
@@ -8741,25 +8741,25 @@  discard block
 block discarded – undo
8741 8741
 		$num = 0;
8742 8742
 
8743 8743
 		// Search data
8744
-		$sql = "SELECT t.rowid, " . $fieldstoshow . " FROM " . $this->db->prefix() . $this->db->sanitize($objecttmp->table_element) . " as t";
8744
+		$sql = "SELECT t.rowid, ".$fieldstoshow." FROM ".$this->db->prefix().$this->db->sanitize($objecttmp->table_element)." as t";
8745 8745
 		if (!empty($objecttmp->isextrafieldmanaged)) {
8746
-			$sql .= " LEFT JOIN " . $this->db->prefix() . $this->db->sanitize($objecttmp->table_element) . "_extrafields as e ON t.rowid = e.fk_object";
8746
+			$sql .= " LEFT JOIN ".$this->db->prefix().$this->db->sanitize($objecttmp->table_element)."_extrafields as e ON t.rowid = e.fk_object";
8747 8747
 		}
8748 8748
 		if (!empty($objecttmp->parent_element)) {
8749 8749
 			$parent_properties = getElementProperties($objecttmp->parent_element);
8750
-			$sql .= " INNER JOIN " . $this->db->prefix() . $this->db->sanitize($parent_properties['table_element']) . " as o ON o.rowid = t.".$objecttmp->fk_parent_attribute;
8750
+			$sql .= " INNER JOIN ".$this->db->prefix().$this->db->sanitize($parent_properties['table_element'])." as o ON o.rowid = t.".$objecttmp->fk_parent_attribute;
8751 8751
 		}
8752 8752
 		if (in_array($objecttmp->parent_element, ['commande', 'propal', 'facture', 'expedition'])) {
8753
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "product as p ON p.rowid = t.fk_product";
8753
+			$sql .= " LEFT JOIN ".$this->db->prefix()."product as p ON p.rowid = t.fk_product";
8754 8754
 		}
8755 8755
 		if (isset($objecttmp->ismultientitymanaged)) {
8756 8756
 			if (!is_numeric($objecttmp->ismultientitymanaged)) {
8757 8757
 				$tmparray = explode('@', $objecttmp->ismultientitymanaged);
8758
-				$sql .= " INNER JOIN " . $this->db->prefix() . $this->db->sanitize($tmparray[1]) . " as parenttable ON parenttable.rowid = t." . $this->db->sanitize($tmparray[0]);
8758
+				$sql .= " INNER JOIN ".$this->db->prefix().$this->db->sanitize($tmparray[1])." as parenttable ON parenttable.rowid = t.".$this->db->sanitize($tmparray[0]);
8759 8759
 			}
8760 8760
 			if ($objecttmp->ismultientitymanaged === 'fk_soc@societe') {
8761 8761
 				if (!$user->hasRight('societe', 'client', 'voir')) {
8762
-					$sql .= ", " . $this->db->prefix() . "societe_commerciaux as sc";
8762
+					$sql .= ", ".$this->db->prefix()."societe_commerciaux as sc";
8763 8763
 				}
8764 8764
 			}
8765 8765
 		}
@@ -8779,21 +8779,21 @@  discard block
 block discarded – undo
8779 8779
 			$sql .= " WHERE 1=1";
8780 8780
 			if (isset($objecttmp->ismultientitymanaged)) {
8781 8781
 				if ($objecttmp->ismultientitymanaged == 1) {
8782
-					$sql .= " AND t.entity IN (" . getEntity($objecttmp->table_element) . ")";
8782
+					$sql .= " AND t.entity IN (".getEntity($objecttmp->table_element).")";
8783 8783
 				}
8784 8784
 				if (!is_numeric($objecttmp->ismultientitymanaged)) {
8785
-					$sql .= " AND parenttable.entity = t." . $this->db->sanitize($tmparray[0]);
8785
+					$sql .= " AND parenttable.entity = t.".$this->db->sanitize($tmparray[0]);
8786 8786
 				}
8787 8787
 				if ($objecttmp->ismultientitymanaged == 1 && !empty($user->socid)) {
8788 8788
 					if ($objecttmp->element == 'societe') {
8789
-						$sql .= " AND t.rowid = " . ((int) $user->socid);
8789
+						$sql .= " AND t.rowid = ".((int) $user->socid);
8790 8790
 					} else {
8791
-						$sql .= " AND t.fk_soc = " . ((int) $user->socid);
8791
+						$sql .= " AND t.fk_soc = ".((int) $user->socid);
8792 8792
 					}
8793 8793
 				}
8794 8794
 				if ($objecttmp->ismultientitymanaged === 'fk_soc@societe') {
8795 8795
 					if (!$user->hasRight('societe', 'client', 'voir')) {
8796
-						$sql .= " AND t.rowid = sc.fk_soc AND sc.fk_user = " . ((int) $user->id);
8796
+						$sql .= " AND t.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
8797 8797
 					}
8798 8798
 				}
8799 8799
 			}
@@ -8811,7 +8811,7 @@  discard block
 block discarded – undo
8811 8811
 				$errormessage = '';
8812 8812
 				$sql .= forgeSQLFromUniversalSearchCriteria($filter, $errormessage);
8813 8813
 				if ($errormessage) {
8814
-					return 'Error forging a SQL request from an universal criteria: ' . $errormessage;
8814
+					return 'Error forging a SQL request from an universal criteria: '.$errormessage;
8815 8815
 				}
8816 8816
 			}
8817 8817
 		}
@@ -8823,7 +8823,7 @@  discard block
 block discarded – undo
8823 8823
 		$resql = $this->db->query($sql);
8824 8824
 		if ($resql) {
8825 8825
 			// Construct $out and $outarray
8826
-			$out .= '<select id="' . $htmlname . '" class="flat minwidth100' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ($moreparams ? ' ' . $moreparams : '') . ' name="' . $htmlname . '">' . "\n";
8826
+			$out .= '<select id="'.$htmlname.'" class="flat minwidth100'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').($moreparams ? ' '.$moreparams : '').' name="'.$htmlname.'">'."\n";
8827 8827
 
8828 8828
 			// 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
8829 8829
 			$textifempty = '&nbsp;';
@@ -8837,7 +8837,7 @@  discard block
 block discarded – undo
8837 8837
 				}
8838 8838
 			}
8839 8839
 			if ($showempty) {
8840
-				$out .= '<option value="-1">' . $textifempty . '</option>' . "\n";
8840
+				$out .= '<option value="-1">'.$textifempty.'</option>'."\n";
8841 8841
 			}
8842 8842
 
8843 8843
 			$num = $this->db->num_rows($resql);
@@ -8860,9 +8860,9 @@  discard block
 block discarded – undo
8860 8860
 					}
8861 8861
 					if (empty($outputmode)) {
8862 8862
 						if ($preselectedvalue > 0 && $preselectedvalue == $obj->rowid) {
8863
-							$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>';
8863
+							$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>';
8864 8864
 						} else {
8865
-							$out .= '<option value="' . $obj->rowid . '" data-html="' . dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1) . '">' . dol_escape_htmltag($label, 0, 0, '', 0, 1) . '</option>';
8865
+							$out .= '<option value="'.$obj->rowid.'" data-html="'.dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1).'">'.dol_escape_htmltag($label, 0, 0, '', 0, 1).'</option>';
8866 8866
 						}
8867 8867
 					} else {
8868 8868
 						array_push($outarray, array('key' => $obj->rowid, 'value' => $label, 'label' => $label));
@@ -8875,10 +8875,10 @@  discard block
 block discarded – undo
8875 8875
 				}
8876 8876
 			}
8877 8877
 
8878
-			$out .= '</select>' . "\n";
8878
+			$out .= '</select>'."\n";
8879 8879
 
8880 8880
 			if (!$forcecombo) {
8881
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
8881
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
8882 8882
 				$out .= ajax_combobox($htmlname, array(), getDolGlobalInt($confkeyforautocompletemode, 0));
8883 8883
 			}
8884 8884
 		} else {
@@ -8942,8 +8942,8 @@  discard block
 block discarded – undo
8942 8942
 			}
8943 8943
 		}
8944 8944
 		$idname = str_replace(array('[', ']'), array('', ''), $htmlname);
8945
-		$out .= '<select id="' . preg_replace('/^\./', '', $idname) . '" ' . ($disabled ? 'disabled="disabled" ' : '') . 'class="flat ' . (preg_replace('/^\./', '', $htmlname)) . ($morecss ? ' ' . $morecss : '') . ' selectformat"';
8946
-		$out .= ' name="' . preg_replace('/^\./', '', $htmlname) . '" ' . ($moreparam ? $moreparam : '');
8945
+		$out .= '<select id="'.preg_replace('/^\./', '', $idname).'" '.($disabled ? 'disabled="disabled" ' : '').'class="flat '.(preg_replace('/^\./', '', $htmlname)).($morecss ? ' '.$morecss : '').' selectformat"';
8946
+		$out .= ' name="'.preg_replace('/^\./', '', $htmlname).'" '.($moreparam ? $moreparam : '');
8947 8947
 		$out .= '>'."\n";
8948 8948
 
8949 8949
 		if ($show_empty) {
@@ -8954,7 +8954,7 @@  discard block
 block discarded – undo
8954 8954
 			if (!is_numeric($show_empty)) {
8955 8955
 				$textforempty = $show_empty;
8956 8956
 			}
8957
-			$out .= '<option class="optiongrey" ' . ($moreparamonempty ? $moreparamonempty . ' ' : '') . 'value="' . (((int) $show_empty) < 0 ? $show_empty : -1) . '"' . ($id == $show_empty ? ' selected' : '') . '>' . $textforempty . '</option>' . "\n";
8957
+			$out .= '<option class="optiongrey" '.($moreparamonempty ? $moreparamonempty.' ' : '').'value="'.(((int) $show_empty) < 0 ? $show_empty : -1).'"'.($id == $show_empty ? ' selected' : '').'>'.$textforempty.'</option>'."\n";
8958 8958
 		}
8959 8959
 		if (is_array($array)) {
8960 8960
 			// Translate
@@ -8979,7 +8979,7 @@  discard block
 block discarded – undo
8979 8979
 					$value = $tmpvalue['label'];
8980 8980
 					//$valuehtml = empty($tmpvalue['data-html']) ? $value : $tmpvalue['data-html'];
8981 8981
 					$disabled = empty($tmpvalue['disabled']) ? '' : ' disabled';
8982
-					$style = empty($tmpvalue['css']) ? '' : ' class="' . $tmpvalue['css'] . '"';
8982
+					$style = empty($tmpvalue['css']) ? '' : ' class="'.$tmpvalue['css'].'"';
8983 8983
 				} else {
8984 8984
 					$value = $tmpvalue;
8985 8985
 					//$valuehtml = $tmpvalue;
@@ -8995,9 +8995,9 @@  discard block
 block discarded – undo
8995 8995
 				}
8996 8996
 				if ($key_in_label) {
8997 8997
 					if (empty($nohtmlescape)) {
8998
-						$selectOptionValue = dol_escape_htmltag($key . ' - ' . ($maxlen ? dol_trunc($value, $maxlen) : $value));
8998
+						$selectOptionValue = dol_escape_htmltag($key.' - '.($maxlen ? dol_trunc($value, $maxlen) : $value));
8999 8999
 					} else {
9000
-						$selectOptionValue = $key . ' - ' . ($maxlen ? dol_trunc($value, $maxlen) : $value);
9000
+						$selectOptionValue = $key.' - '.($maxlen ? dol_trunc($value, $maxlen) : $value);
9001 9001
 					}
9002 9002
 				} else {
9003 9003
 					if (empty($nohtmlescape)) {
@@ -9009,8 +9009,8 @@  discard block
 block discarded – undo
9009 9009
 						$selectOptionValue = '&nbsp;';
9010 9010
 					}
9011 9011
 				}
9012
-				$out .= '<option value="' . $key . '"';
9013
-				$out .= $style . $disabled;
9012
+				$out .= '<option value="'.$key.'"';
9013
+				$out .= $style.$disabled;
9014 9014
 				if (is_array($id)) {
9015 9015
 					if (in_array($key, $id) && !$disabled) {
9016 9016
 						$out .= ' selected'; // To preselect a value
@@ -9022,7 +9022,7 @@  discard block
 block discarded – undo
9022 9022
 					}
9023 9023
 				}
9024 9024
 				if (!empty($nohtmlescape)) {	// deprecated. Use instead the key 'data-html' into input $array, managed at next step to use HTML content.
9025
-					$out .= ' data-html="' . dol_escape_htmltag($selectOptionValue) . '"';
9025
+					$out .= ' data-html="'.dol_escape_htmltag($selectOptionValue).'"';
9026 9026
 				}
9027 9027
 
9028 9028
 				if (is_array($tmpvalue)) {
@@ -9045,7 +9045,7 @@  discard block
 block discarded – undo
9045 9045
 		// Add code for jquery to use multiselect
9046 9046
 		if ($addjscombo && $jsbeautify) {
9047 9047
 			// Enhance with select2
9048
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
9048
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
9049 9049
 			$out .= ajax_combobox($idname, array(), 0, 0, 'resolve', (((int) $show_empty) < 0 ? (string) $show_empty : '-1'), $morecss);
9050 9050
 		}
9051 9051
 
@@ -9073,28 +9073,28 @@  discard block
 block discarded – undo
9073 9073
 	public static function selectArrayAjax($htmlname, $url, $id = '', $moreparam = '', $moreparamtourl = '', $disabled = 0, $minimumInputLength = 1, $morecss = '', $callurlonselect = 0, $placeholder = '', $acceptdelayedhtml = 0)
9074 9074
 	{
9075 9075
 		global $conf;
9076
-		global $delayedhtmlcontent;    // Will be used later outside of this function
9076
+		global $delayedhtmlcontent; // Will be used later outside of this function
9077 9077
 
9078 9078
 		// TODO Use an internal dolibarr component instead of select2
9079 9079
 		if (!getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') && !defined('REQUIRE_JQUERY_MULTISELECT')) {
9080 9080
 			return '';
9081 9081
 		}
9082 9082
 
9083
-		$out = '<select type="text" class="' . $htmlname . ($morecss ? ' ' . $morecss : '') . '" ' . ($moreparam ? $moreparam . ' ' : '') . 'name="' . $htmlname . '"></select>';
9083
+		$out = '<select type="text" class="'.$htmlname.($morecss ? ' '.$morecss : '').'" '.($moreparam ? $moreparam.' ' : '').'name="'.$htmlname.'"></select>';
9084 9084
 
9085 9085
 		$outdelayed = '';
9086 9086
 		if (!empty($conf->use_javascript_ajax)) {
9087 9087
 			$tmpplugin = 'select2';
9088
-			$outdelayed = "\n" . '<!-- JS CODE TO ENABLE ' . $tmpplugin . ' for id ' . $htmlname . ' -->
9089
-		    	<script nonce="' . getNonce() . '">
9088
+			$outdelayed = "\n".'<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' -->
9089
+		    	<script nonce="' . getNonce().'">
9090 9090
 		    	$(document).ready(function () {
9091 9091
 
9092
-	    	        ' . ($callurlonselect ? 'var saveRemoteData = [];' : '') . '
9092
+	    	        ' . ($callurlonselect ? 'var saveRemoteData = [];' : '').'
9093 9093
 
9094
-	                $(".' . $htmlname . '").select2({
9094
+	                $(".' . $htmlname.'").select2({
9095 9095
 				    	ajax: {
9096 9096
 					    	dir: "ltr",
9097
-					    	url: "' . $url . '",
9097
+					    	url: "' . $url.'",
9098 9098
 					    	dataType: \'json\',
9099 9099
 					    	delay: 250,
9100 9100
 					    	data: function (params) {
@@ -9121,9 +9121,9 @@  discard block
 block discarded – undo
9121 9121
 				    	},
9122 9122
 		 				language: (typeof select2arrayoflanguage === \'undefined\') ? \'en\' : select2arrayoflanguage,
9123 9123
 						containerCssClass: \':all:\',					/* Line to add class from the original SELECT propagated to the new <span class="select2-selection...> tag */
9124
-					    placeholder: \'' . dol_escape_js($placeholder) . '\',
9124
+					    placeholder: \'' . dol_escape_js($placeholder).'\',
9125 9125
 				    	escapeMarkup: function (markup) { return markup; }, 	// let our custom formatter work
9126
-				    	minimumInputLength: ' . ((int) $minimumInputLength) . ',
9126
+				    	minimumInputLength: ' . ((int) $minimumInputLength).',
9127 9127
 				        formatResult: function (result, container, query, escapeMarkup) {
9128 9128
 	                        return escapeMarkup(result.text);
9129 9129
 	                    },
@@ -9131,10 +9131,10 @@  discard block
 block discarded – undo
9131 9131
 
9132 9132
 	                ' . ($callurlonselect ? '
9133 9133
 	                /* Code to execute a GET when we select a value */
9134
-	                $(".' . $htmlname . '").change(function() {
9135
-				    	var selected = $(\'.' . dol_escape_js($htmlname) . '\').val();
9134
+	                $(".' . $htmlname.'").change(function() {
9135
+				    	var selected = $(\'.' . dol_escape_js($htmlname).'\').val();
9136 9136
 	                	console.log("We select in selectArrayAjax the entry "+selected)
9137
-				        $(\'.' . dol_escape_js($htmlname) . '\').val("");  /* reset visible combo value */
9137
+				        $(\'.' . dol_escape_js($htmlname).'\').val("");  /* reset visible combo value */
9138 9138
 	    			    $.each( saveRemoteData, function( key, value ) {
9139 9139
 	    				        if (key == selected)
9140 9140
 	    			            {
@@ -9142,7 +9142,7 @@  discard block
 block discarded – undo
9142 9142
 	    			                 location.assign(value.url);
9143 9143
 	    			            }
9144 9144
 	                    });
9145
-	    			});' : '') . '
9145
+	    			});' : '').'
9146 9146
 
9147 9147
 	    	   });
9148 9148
 		       </script>';
@@ -9178,14 +9178,14 @@  discard block
 block discarded – undo
9178 9178
 	public static function selectArrayFilter($htmlname, $array, $id = '', $moreparam = '', $disableFiltering = 0, $disabled = 0, $minimumInputLength = 1, $morecss = '', $callurlonselect = 0, $placeholder = '', $acceptdelayedhtml = 0, $textfortitle = '')
9179 9179
 	{
9180 9180
 		global $conf;
9181
-		global $delayedhtmlcontent;    // Will be used later outside of this function
9181
+		global $delayedhtmlcontent; // Will be used later outside of this function
9182 9182
 
9183 9183
 		// TODO Use an internal dolibarr component instead of select2
9184 9184
 		if (!getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') && !defined('REQUIRE_JQUERY_MULTISELECT')) {
9185 9185
 			return '';
9186 9186
 		}
9187 9187
 
9188
-		$out = '<select type="text"'.($textfortitle ? ' title="'.dol_escape_htmltag($textfortitle).'"' : '').' id="'.$htmlname.'" class="'.$htmlname.($morecss ? ' ' . $morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.'"><option></option></select>';
9188
+		$out = '<select type="text"'.($textfortitle ? ' title="'.dol_escape_htmltag($textfortitle).'"' : '').' id="'.$htmlname.'" class="'.$htmlname.($morecss ? ' '.$morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.'"><option></option></select>';
9189 9189
 
9190 9190
 		$formattedarrayresult = array();
9191 9191
 
@@ -9200,20 +9200,20 @@  discard block
 block discarded – undo
9200 9200
 		$outdelayed = '';
9201 9201
 		if (!empty($conf->use_javascript_ajax)) {
9202 9202
 			$tmpplugin = 'select2';
9203
-			$outdelayed = "\n" . '<!-- JS CODE TO ENABLE ' . $tmpplugin . ' for id ' . $htmlname . ' -->
9204
-				<script nonce="' . getNonce() . '">
9203
+			$outdelayed = "\n".'<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' -->
9204
+				<script nonce="' . getNonce().'">
9205 9205
 				$(document).ready(function () {
9206
-					var data = ' . json_encode($formattedarrayresult) . ';
9206
+					var data = ' . json_encode($formattedarrayresult).';
9207 9207
 
9208
-					' . ($callurlonselect ? 'var saveRemoteData = ' . json_encode($array) . ';' : '') . '
9208
+					' . ($callurlonselect ? 'var saveRemoteData = '.json_encode($array).';' : '').'
9209 9209
 
9210
-					$(\'.' . dol_escape_js($htmlname) . '\').select2({
9210
+					$(\'.' . dol_escape_js($htmlname).'\').select2({
9211 9211
 						data: data,
9212 9212
 						language: (typeof select2arrayoflanguage === \'undefined\') ? \'en\' : select2arrayoflanguage,
9213 9213
 						containerCssClass: \':all:\',					/* Line to add class from the original SELECT propagated to the new <span class="select2-selection...> tag */
9214
-						placeholder: \'' . dol_escape_js($placeholder) . '\',
9214
+						placeholder: \'' . dol_escape_js($placeholder).'\',
9215 9215
 						escapeMarkup: function (markup) { return markup; }, 	// let our custom formatter work
9216
-						minimumInputLength: ' . ((int) $minimumInputLength) . ',
9216
+						minimumInputLength: ' . ((int) $minimumInputLength).',
9217 9217
 						formatResult: function (result, container, query, escapeMarkup) {
9218 9218
 							return escapeMarkup(result.text);
9219 9219
 						},
@@ -9252,11 +9252,11 @@  discard block
 block discarded – undo
9252 9252
 
9253 9253
 					' . ($callurlonselect ? '
9254 9254
 					/* Code to execute a GET when we select a value */
9255
-					$(\'.' . dol_escape_js($htmlname) . '\').change(function() {
9256
-						var selected = $(\'.' . dol_escape_js($htmlname) . '\').val();
9255
+					$(\'.' . dol_escape_js($htmlname).'\').change(function() {
9256
+						var selected = $(\'.' . dol_escape_js($htmlname).'\').val();
9257 9257
 						console.log("We select "+selected)
9258 9258
 
9259
-						$(\'.' . dol_escape_js($htmlname) . '\').val("");  /* reset visible combo value */
9259
+						$(\'.' . dol_escape_js($htmlname).'\').val("");  /* reset visible combo value */
9260 9260
 						$.each( saveRemoteData, function( key, value ) {
9261 9261
 							if (key == selected)
9262 9262
 							{
@@ -9264,7 +9264,7 @@  discard block
 block discarded – undo
9264 9264
 								location.assign(value.url);
9265 9265
 							}
9266 9266
 						});
9267
-					});' : '') . '
9267
+					});' : '').'
9268 9268
 
9269 9269
 				});
9270 9270
 				</script>';
@@ -9312,7 +9312,7 @@  discard block
 block discarded – undo
9312 9312
 		$useenhancedmultiselect = 0;
9313 9313
 		if (!empty($conf->use_javascript_ajax) && !defined('MAIN_DO_NOT_USE_JQUERY_MULTISELECT') && (getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') || defined('REQUIRE_JQUERY_MULTISELECT'))) {
9314 9314
 			if ($addjscombo) {
9315
-				$useenhancedmultiselect = 1;	// Use the js multiselect in one line. Possible only if $addjscombo not 0.
9315
+				$useenhancedmultiselect = 1; // Use the js multiselect in one line. Possible only if $addjscombo not 0.
9316 9316
 			}
9317 9317
 		}
9318 9318
 
@@ -9321,7 +9321,7 @@  discard block
 block discarded – undo
9321 9321
 		// submitted to nothing.
9322 9322
 		$out .= '<input type="hidden" name="'.$htmlname.'_multiselect" value="1">';
9323 9323
 		// Output select component
9324
-		$out .= '<select id="' . $htmlname . '" class="multiselect' . ($useenhancedmultiselect ? ' multiselectononeline' : '') . ($morecss ? ' ' . $morecss : '') . '" multiple name="' . $htmlname . '[]"' . ($moreattrib ? ' ' . $moreattrib : '') . ($width ? ' style="width: ' . (preg_match('/%/', (string) $width) ? $width : $width . 'px') . '"' : '') . '>' . "\n";
9324
+		$out .= '<select id="'.$htmlname.'" class="multiselect'.($useenhancedmultiselect ? ' multiselectononeline' : '').($morecss ? ' '.$morecss : '').'" multiple name="'.$htmlname.'[]"'.($moreattrib ? ' '.$moreattrib : '').($width ? ' style="width: '.(preg_match('/%/', (string) $width) ? $width : $width.'px').'"' : '').'>'."\n";
9325 9325
 		if (is_array($array) && !empty($array)) {
9326 9326
 			if ($value_as_key) {
9327 9327
 				$array = array_combine($array, $array);
@@ -9342,33 +9342,33 @@  discard block
 block discarded – undo
9342 9342
 						$tmplabelhtml = empty($value['labelhtml']) ? (empty($value['data-html']) ? '' : $value['data-html']) : $value['labelhtml'];
9343 9343
 					}
9344 9344
 					$newval = ($translate ? $langs->trans($tmpvalue) : $tmpvalue);
9345
-					$newval = ($key_in_label ? $tmpkey . ' - ' . $newval : $newval);
9345
+					$newval = ($key_in_label ? $tmpkey.' - '.$newval : $newval);
9346 9346
 
9347
-					$out .= '<option value="' . $tmpkey . '"';
9347
+					$out .= '<option value="'.$tmpkey.'"';
9348 9348
 					if (is_array($selected) && !empty($selected) && in_array((string) $tmpkey, $selected) && ((string) $tmpkey != '')) {
9349 9349
 						$out .= ' selected';
9350 9350
 					}
9351 9351
 					if (!empty($tmplabelhtml)) {
9352
-						$out .= ' data-html="' . dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1) . '"';
9352
+						$out .= ' data-html="'.dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1).'"';
9353 9353
 					} else {
9354
-						$tmplabelhtml = ($tmppicto ? img_picto('', $tmppicto, 'class="pictofixedwidth" style="color: #' . $tmpcolor . '"') : '') . $newval;
9355
-						$out .= ' data-html="' . dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1) . '"';
9354
+						$tmplabelhtml = ($tmppicto ? img_picto('', $tmppicto, 'class="pictofixedwidth" style="color: #'.$tmpcolor.'"') : '').$newval;
9355
+						$out .= ' data-html="'.dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1).'"';
9356 9356
 					}
9357 9357
 					$out .= '>';
9358 9358
 					$out .= dol_htmlentitiesbr($newval);
9359
-					$out .= '</option>' . "\n";
9359
+					$out .= '</option>'."\n";
9360 9360
 				}
9361 9361
 			}
9362 9362
 		}
9363
-		$out .= '</select>' . "\n";
9363
+		$out .= '</select>'."\n";
9364 9364
 
9365 9365
 		// Add code for jquery to use multiselect
9366 9366
 		if (!empty($conf->use_javascript_ajax) && getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') || defined('REQUIRE_JQUERY_MULTISELECT')) {
9367
-			$out .= "\n" . '<!-- JS CODE TO ENABLE select for id ' . $htmlname . ', addjscombo=' . $addjscombo . ' -->';
9368
-			$out .= "\n" . '<script nonce="' . getNonce() . '">' . "\n";
9367
+			$out .= "\n".'<!-- JS CODE TO ENABLE select for id '.$htmlname.', addjscombo='.$addjscombo.' -->';
9368
+			$out .= "\n".'<script nonce="'.getNonce().'">'."\n";
9369 9369
 			if ($addjscombo == 1) {
9370 9370
 				$tmpplugin = !getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') ? constant('REQUIRE_JQUERY_MULTISELECT') : $conf->global->MAIN_USE_JQUERY_MULTISELECT;
9371
-				$out .= 'function formatResult(record, container) {' . "\n";
9371
+				$out .= 'function formatResult(record, container) {'."\n";
9372 9372
 				// If property data-html set, we decode html entities and use this.
9373 9373
 				// Note that HTML content must have been sanitized from js with dol_escape_htmltag(xxx, 0, 0, '', 0, 1) when building the select option.
9374 9374
 				$out .= '	if ($(record.element).attr("data-html") != undefined && typeof htmlEntityDecodeJs === "function") {';
@@ -9376,26 +9376,26 @@  discard block
 block discarded – undo
9376 9376
 				$out .= '		return htmlEntityDecodeJs($(record.element).attr("data-html"));';
9377 9377
 				$out .= '	}'."\n";
9378 9378
 				$out .= '	return record.text;';
9379
-				$out .= '}' . "\n";
9380
-				$out .= 'function formatSelection(record) {' . "\n";
9379
+				$out .= '}'."\n";
9380
+				$out .= 'function formatSelection(record) {'."\n";
9381 9381
 				if ($elemtype == 'category') {
9382
-					$out .= 'return \'<span><img src="' . DOL_URL_ROOT . '/theme/eldy/img/object_category.png"> \'+record.text+\'</span>\';';
9382
+					$out .= 'return \'<span><img src="'.DOL_URL_ROOT.'/theme/eldy/img/object_category.png"> \'+record.text+\'</span>\';';
9383 9383
 				} else {
9384 9384
 					$out .= 'return record.text;';
9385 9385
 				}
9386
-				$out .= '}' . "\n";
9386
+				$out .= '}'."\n";
9387 9387
 				$out .= '$(document).ready(function () {
9388
-							$(\'#' . dol_escape_js($htmlname) . '\').' . $tmpplugin . '({';
9388
+							$(\'#' . dol_escape_js($htmlname).'\').'.$tmpplugin.'({';
9389 9389
 				if ($placeholder) {
9390 9390
 					$out .= '
9391 9391
 								placeholder: {
9392 9392
 								    id: \'-1\',
9393
-								    text: \'' . dol_escape_js($placeholder) . '\'
9393
+								    text: \'' . dol_escape_js($placeholder).'\'
9394 9394
 								  },';
9395 9395
 				}
9396 9396
 				$out .= '		dir: \'ltr\',
9397 9397
 								containerCssClass: \':all:\',					/* Line to add class of origin SELECT propagated to the new <span class="select2-selection...> tag (ko with multiselect) */
9398
-								dropdownCssClass: \'' . dol_escape_js($morecss) . '\',				/* Line to add class on the new <span class="select2-selection...> tag (ok with multiselect). Need full version of select2. */
9398
+								dropdownCssClass: \'' . dol_escape_js($morecss).'\',				/* Line to add class on the new <span class="select2-selection...> tag (ok with multiselect). Need full version of select2. */
9399 9399
 								// Specify format function for dropdown item
9400 9400
 								formatResult: formatResult,
9401 9401
 							 	templateResult: formatResult,		/* For 4.0 */
@@ -9408,21 +9408,21 @@  discard block
 block discarded – undo
9408 9408
 
9409 9409
 							/* Add also morecss to the css .select2 that is after the #htmlname, for component that are show dynamically after load, because select2 set
9410 9410
 								 the size only if component is not hidden by default on load */
9411
-							$(\'#' . dol_escape_js($htmlname) . ' + .select2\').addClass(\'' . dol_escape_js($morecss) . '\');
9411
+							$(\'#' . dol_escape_js($htmlname).' + .select2\').addClass(\''.dol_escape_js($morecss).'\');
9412 9412
 						});' . "\n";
9413 9413
 			} elseif ($addjscombo == 2 && !defined('DISABLE_MULTISELECT')) {
9414 9414
 				// Add other js lib
9415 9415
 				// TODO external lib multiselect/jquery.multi-select.js must have been loaded to use this multiselect plugin
9416 9416
 				// ...
9417
-				$out .= 'console.log(\'addjscombo=2 for htmlname=' . dol_escape_js($htmlname) . '\');';
9417
+				$out .= 'console.log(\'addjscombo=2 for htmlname='.dol_escape_js($htmlname).'\');';
9418 9418
 				$out .= '$(document).ready(function () {
9419
-							$(\'#' . dol_escape_js($htmlname) . '\').multiSelect({
9419
+							$(\'#' . dol_escape_js($htmlname).'\').multiSelect({
9420 9420
 								containerHTML: \'<div class="multi-select-container">\',
9421 9421
 								menuHTML: \'<div class="multi-select-menu">\',
9422
-								buttonHTML: \'<span class="multi-select-button ' . dol_escape_js($morecss) . '">\',
9422
+								buttonHTML: \'<span class="multi-select-button ' . dol_escape_js($morecss).'">\',
9423 9423
 								menuItemHTML: \'<label class="multi-select-menuitem">\',
9424 9424
 								activeClass: \'multi-select-container--open\',
9425
-								noneText: \'' . dol_escape_js($placeholder) . '\'
9425
+								noneText: \'' . dol_escape_js($placeholder).'\'
9426 9426
 							});
9427 9427
 						})';
9428 9428
 			}
@@ -9455,7 +9455,7 @@  discard block
 block discarded – undo
9455 9455
 			return '';
9456 9456
 		}
9457 9457
 
9458
-		$tmpvar = "MAIN_SELECTEDFIELDS_" . $varpage; // To get list of saved selected fields to show
9458
+		$tmpvar = "MAIN_SELECTEDFIELDS_".$varpage; // To get list of saved selected fields to show
9459 9459
 
9460 9460
 		if (!empty($user->conf->$tmpvar)) {        // A list of fields was already customized for user
9461 9461
 			$tmparray = explode(',', $user->conf->$tmpvar);
@@ -9498,19 +9498,19 @@  discard block
 block discarded – undo
9498 9498
 				}
9499 9499
 
9500 9500
 				// Note: $val['checked'] <> 0 means we must show the field into the combo list  @phan-suppress-next-line PhanTypePossiblyInvalidDimOffset
9501
-				$listoffieldsforselection .= '<li><input type="checkbox" id="checkbox' . $key . '" value="' . $key . '"' . ((!array_key_exists('checked', $val) || empty($val['checked']) || $val['checked'] == '-1') ? '' : ' checked="checked"') . '/><label for="checkbox' . $key . '">' . dol_escape_htmltag($langs->trans($val['label'])) . '</label></li>';
9502
-				$listcheckedstring .= (empty($val['checked']) ? '' : $key . ',');
9501
+				$listoffieldsforselection .= '<li><input type="checkbox" id="checkbox'.$key.'" value="'.$key.'"'.((!array_key_exists('checked', $val) || empty($val['checked']) || $val['checked'] == '-1') ? '' : ' checked="checked"').'/><label for="checkbox'.$key.'">'.dol_escape_htmltag($langs->trans($val['label'])).'</label></li>';
9502
+				$listcheckedstring .= (empty($val['checked']) ? '' : $key.',');
9503 9503
 			}
9504 9504
 		}
9505 9505
 
9506
-		$out = '<!-- Component multiSelectArrayWithCheckbox ' . $htmlname . ' -->
9506
+		$out = '<!-- Component multiSelectArrayWithCheckbox '.$htmlname.' -->
9507 9507
 
9508 9508
         <dl class="dropdown">
9509 9509
             <dt>
9510
-            <a href="#' . $htmlname . '">
9511
-              ' . img_picto('', 'list') . '
9510
+            <a href="#' . $htmlname.'">
9511
+              ' . img_picto('', 'list').'
9512 9512
             </a>
9513
-            <input type="hidden" class="' . $htmlname . '" name="' . $htmlname . '" value="' . $listcheckedstring . '">
9513
+            <input type="hidden" class="' . $htmlname.'" name="'.$htmlname.'" value="'.$listcheckedstring.'">
9514 9514
             </dt>
9515 9515
             <dd class="dropdowndd">
9516 9516
                 <div class="multiselectcheckbox'.$htmlname.'">
@@ -9522,19 +9522,19 @@  discard block
 block discarded – undo
9522 9522
             </dd>
9523 9523
         </dl>
9524 9524
 
9525
-        <script nonce="' . getNonce() . '" type="text/javascript">
9525
+        <script nonce="' . getNonce().'" type="text/javascript">
9526 9526
           jQuery(document).ready(function () {
9527
-              $(\'.multiselectcheckbox' . $htmlname . ' input[type="checkbox"]\').on(\'click\', function () {
9527
+              $(\'.multiselectcheckbox' . $htmlname.' input[type="checkbox"]\').on(\'click\', function () {
9528 9528
                   console.log("A new field was added/removed, we edit field input[name=formfilteraction]");
9529 9529
 
9530 9530
                   $("input:hidden[name=formfilteraction]").val(\'listafterchangingselectedfields\');	// Update field so we know we changed something on selected fields after POST
9531 9531
 
9532 9532
                   var title = $(this).val() + ",";
9533 9533
                   if ($(this).is(\':checked\')) {
9534
-                      $(\'.' . $htmlname . '\').val(title + $(\'.' . $htmlname . '\').val());
9534
+                      $(\'.' . $htmlname.'\').val(title + $(\'.'.$htmlname.'\').val());
9535 9535
                   }
9536 9536
                   else {
9537
-                      $(\'.' . $htmlname . '\').val( $(\'.' . $htmlname . '\').val().replace(title, \'\') )
9537
+                      $(\'.' . $htmlname.'\').val( $(\'.'.$htmlname.'\').val().replace(title, \'\') )
9538 9538
                   }
9539 9539
                   // Now, we submit page
9540 9540
                   //$(this).parents(\'form:first\').submit();
@@ -9565,7 +9565,7 @@  discard block
 block discarded – undo
9565 9565
 	 */
9566 9566
 	public function showCategories($id, $type, $rendermode = 0, $nolink = 0)
9567 9567
 	{
9568
-		include_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
9568
+		include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
9569 9569
 
9570 9570
 		$cat = new Categorie($this->db);
9571 9571
 		$categories = $cat->containing($id, $type);
@@ -9575,13 +9575,13 @@  discard block
 block discarded – undo
9575 9575
 			foreach ($categories as $c) {
9576 9576
 				$ways = $c->print_all_ways(' &gt;&gt; ', ($nolink ? 'none' : ''), 0, 1); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text
9577 9577
 				foreach ($ways as $way) {
9578
-					$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #bbb"') . '>' . $way . '</li>';
9578
+					$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #bbb"').'>'.$way.'</li>';
9579 9579
 				}
9580 9580
 			}
9581 9581
 			if (empty($toprint)) {
9582 9582
 				return '';
9583 9583
 			} else {
9584
-				return '<div class="select2-container-multi-dolibarr"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>';
9584
+				return '<div class="select2-container-multi-dolibarr"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
9585 9585
 			}
9586 9586
 		}
9587 9587
 
@@ -9630,15 +9630,15 @@  discard block
 block discarded – undo
9630 9630
 
9631 9631
 
9632 9632
 			print '<div class="div-table-responsive-no-min">';
9633
-			print '<table class="noborder allwidth" data-block="showLinkedObject" data-element="' . $object->element . '"  data-elementid="' . $object->id . '"   >';
9633
+			print '<table class="noborder allwidth" data-block="showLinkedObject" data-element="'.$object->element.'"  data-elementid="'.$object->id.'"   >';
9634 9634
 
9635 9635
 			print '<tr class="liste_titre">';
9636
-			print '<td>' . $langs->trans("Type") . '</td>';
9637
-			print '<td>' . $langs->trans("Ref") . '</td>';
9636
+			print '<td>'.$langs->trans("Type").'</td>';
9637
+			print '<td>'.$langs->trans("Ref").'</td>';
9638 9638
 			print '<td class="center"></td>';
9639
-			print '<td class="center">' . $langs->trans("Date") . '</td>';
9640
-			print '<td class="right">' . $langs->trans("AmountHTShort") . '</td>';
9641
-			print '<td class="right">' . $langs->trans("Status") . '</td>';
9639
+			print '<td class="center">'.$langs->trans("Date").'</td>';
9640
+			print '<td class="right">'.$langs->trans("AmountHTShort").'</td>';
9641
+			print '<td class="right">'.$langs->trans("Status").'</td>';
9642 9642
 			print '<td></td>';
9643 9643
 			print '</tr>';
9644 9644
 
@@ -9657,13 +9657,13 @@  discard block
 block discarded – undo
9657 9657
 				if ($objecttype != 'supplier_proposal' && preg_match('/^([^_]+)_([^_]+)/i', $objecttype, $regs)) {
9658 9658
 					$element = $regs[1];
9659 9659
 					$subelement = $regs[2];
9660
-					$tplpath = $element . '/' . $subelement;
9660
+					$tplpath = $element.'/'.$subelement;
9661 9661
 				}
9662 9662
 				$tplname = 'linkedobjectblock';
9663 9663
 
9664 9664
 				// To work with non standard path
9665 9665
 				if ($objecttype == 'facture') {
9666
-					$tplpath = 'compta/' . $element;
9666
+					$tplpath = 'compta/'.$element;
9667 9667
 					if (!isModEnabled('invoice')) {
9668 9668
 						continue; // Do not show if module disabled
9669 9669
 					}
@@ -9674,7 +9674,7 @@  discard block
 block discarded – undo
9674 9674
 						continue; // Do not show if module disabled
9675 9675
 					}
9676 9676
 				} elseif ($objecttype == 'propal') {
9677
-					$tplpath = 'comm/' . $element;
9677
+					$tplpath = 'comm/'.$element;
9678 9678
 					if (!isModEnabled('propal')) {
9679 9679
 						continue; // Do not show if module disabled
9680 9680
 					}
@@ -9727,7 +9727,7 @@  discard block
 block discarded – undo
9727 9727
 				$linkedObjectBlock = $objects;
9728 9728
 
9729 9729
 				// Output template part (modules that overwrite templates must declare this into descriptor)
9730
-				$dirtpls = array_merge($conf->modules_parts['tpl'], array('/' . $tplpath . '/tpl'));
9730
+				$dirtpls = array_merge($conf->modules_parts['tpl'], array('/'.$tplpath.'/tpl'));
9731 9731
 				foreach ($dirtpls as $reldir) {
9732 9732
 					$reldir = rtrim($reldir, '/');
9733 9733
 					if ($nboftypesoutput == ($nbofdifferenttypes - 1)) {    // No more type to show after
@@ -9735,7 +9735,7 @@  discard block
 block discarded – undo
9735 9735
 						$noMoreLinkedObjectBlockAfter = 1;
9736 9736
 					}
9737 9737
 
9738
-					$res = @include dol_buildpath($reldir . '/' . $tplname . '.tpl.php');
9738
+					$res = @include dol_buildpath($reldir.'/'.$tplname.'.tpl.php');
9739 9739
 					if ($res) {
9740 9740
 						$nboftypesoutput++;
9741 9741
 						break;
@@ -9744,7 +9744,7 @@  discard block
 block discarded – undo
9744 9744
 			}
9745 9745
 
9746 9746
 			if (!$nboftypesoutput) {
9747
-				print '<tr><td colspan="7"><span class="opacitymedium">' . $langs->trans("None") . '</span></td></tr>';
9747
+				print '<tr><td colspan="7"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
9748 9748
 			}
9749 9749
 
9750 9750
 			print '</table>';
@@ -9792,14 +9792,14 @@  discard block
 block discarded – undo
9792 9792
 		if (is_object($object->thirdparty) && !empty($object->thirdparty->id) && $object->thirdparty->id > 0) {
9793 9793
 			$listofidcompanytoscan = (int) $object->thirdparty->id;
9794 9794
 			if (($object->thirdparty->parent > 0) && getDolGlobalString('THIRDPARTY_INCLUDE_PARENT_IN_LINKTO')) {
9795
-				$listofidcompanytoscan .= ',' . (int) $object->thirdparty->parent;
9795
+				$listofidcompanytoscan .= ','.(int) $object->thirdparty->parent;
9796 9796
 			}
9797 9797
 			if (($object->fk_project > 0) && getDolGlobalString('THIRDPARTY_INCLUDE_PROJECT_THIRDPARY_IN_LINKTO')) {
9798
-				include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
9798
+				include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
9799 9799
 				$tmpproject = new Project($this->db);
9800 9800
 				$tmpproject->fetch($object->fk_project);
9801 9801
 				if ($tmpproject->socid > 0 && ($tmpproject->socid != $object->thirdparty->id)) {
9802
-					$listofidcompanytoscan .= ',' . (int) $tmpproject->socid;
9802
+					$listofidcompanytoscan .= ','.(int) $tmpproject->socid;
9803 9803
 				}
9804 9804
 				unset($tmpproject);
9805 9805
 			}
@@ -9809,75 +9809,75 @@  discard block
 block discarded – undo
9809 9809
 					'enabled' => isModEnabled('propal'),
9810 9810
 					'perms' => 1,
9811 9811
 					'label' => 'LinkToProposal',
9812
-					'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') . ')'.($dontIncludeCompletedItems ? ' AND t.fk_statut < 4' : ''),
9812
+					'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').')'.($dontIncludeCompletedItems ? ' AND t.fk_statut < 4' : ''),
9813 9813
 				),
9814 9814
 				'shipping' => array(
9815 9815
 					'enabled' => isModEnabled('shipping'),
9816 9816
 					'perms' => 1,
9817 9817
 					'label' => 'LinkToExpedition',
9818
-					'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') . ')'.($dontIncludeCompletedItems ? ' AND t.fk_statut < 2' : ''),
9818
+					'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').')'.($dontIncludeCompletedItems ? ' AND t.fk_statut < 2' : ''),
9819 9819
 				),
9820 9820
 				'order' => array(
9821 9821
 					'enabled' => isModEnabled('order'),
9822 9822
 					'perms' => 1,
9823 9823
 					'label' => 'LinkToOrder',
9824
-					'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') . ')'.($dontIncludeCompletedItems ? ' AND t.facture < 1' : ''),
9824
+					'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').')'.($dontIncludeCompletedItems ? ' AND t.facture < 1' : ''),
9825 9825
 					'linkname' => 'commande',
9826 9826
 				),
9827 9827
 				'invoice' => array(
9828 9828
 					'enabled' => isModEnabled('invoice'),
9829 9829
 					'perms' => 1,
9830 9830
 					'label' => 'LinkToInvoice',
9831
-					'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') . ')'.($dontIncludeCompletedItems ? ' AND t.paye < 1' : ''),
9831
+					'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').')'.($dontIncludeCompletedItems ? ' AND t.paye < 1' : ''),
9832 9832
 					'linkname' => 'facture',
9833 9833
 				),
9834 9834
 				'invoice_template' => array(
9835 9835
 					'enabled' => isModEnabled('invoice'),
9836 9836
 					'perms' => 1,
9837 9837
 					'label' => 'LinkToTemplateInvoice',
9838
-					'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') . ')'.($dontIncludeCompletedItems ? ' AND t.paye < 1' : ''),
9838
+					'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').')'.($dontIncludeCompletedItems ? ' AND t.paye < 1' : ''),
9839 9839
 				),
9840 9840
 				'contrat' => array(
9841 9841
 					'enabled' => isModEnabled('contract'),
9842 9842
 					'perms' => 1,
9843 9843
 					'label' => 'LinkToContract',
9844 9844
 					'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
9845
-							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',
9845
+							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',
9846 9846
 				),
9847 9847
 				'fichinter' => array(
9848 9848
 					'enabled' => isModEnabled('intervention'),
9849 9849
 					'perms' => 1,
9850 9850
 					'label' => 'LinkToIntervention',
9851
-					'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') . ')',
9851
+					'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').')',
9852 9852
 				),
9853 9853
 				'supplier_proposal' => array(
9854 9854
 					'enabled' => isModEnabled('supplier_proposal'),
9855 9855
 					'perms' => 1,
9856 9856
 					'label' => 'LinkToSupplierProposal',
9857
-					'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') . ')'.($dontIncludeCompletedItems ? ' AND t.fk_statut < 4' : ''),
9857
+					'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').')'.($dontIncludeCompletedItems ? ' AND t.fk_statut < 4' : ''),
9858 9858
 				),
9859 9859
 				'order_supplier' => array(
9860 9860
 					'enabled' => isModEnabled("supplier_order"),
9861 9861
 					'perms' => 1,
9862 9862
 					'label' => 'LinkToSupplierOrder',
9863
-					'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') . ')'.($dontIncludeCompletedItems ? ' AND t.billed < 1' : ''),
9863
+					'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').')'.($dontIncludeCompletedItems ? ' AND t.billed < 1' : ''),
9864 9864
 				),
9865 9865
 				'invoice_supplier' => array(
9866 9866
 					'enabled' => isModEnabled("supplier_invoice"),
9867 9867
 					'perms' => 1, 'label' => 'LinkToSupplierInvoice',
9868
-					'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') . ')'.($dontIncludeCompletedItems ? ' AND t.paye < 1' : ''),
9868
+					'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').')'.($dontIncludeCompletedItems ? ' AND t.paye < 1' : ''),
9869 9869
 				),
9870 9870
 				'ticket' => array(
9871 9871
 					'enabled' => isModEnabled('ticket'),
9872 9872
 					'perms' => 1,
9873 9873
 					'label' => 'LinkToTicket',
9874
-					'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') . ')'.($dontIncludeCompletedItems ? ' AND t.fk_statut < 8' : ''),
9874
+					'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').')'.($dontIncludeCompletedItems ? ' AND t.fk_statut < 8' : ''),
9875 9875
 				),
9876 9876
 				'mo' => array(
9877 9877
 					'enabled' => isModEnabled('mrp'),
9878 9878
 					'perms' => 1,
9879 9879
 					'label' => 'LinkToMo',
9880
-					'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') . ')'.($dontIncludeCompletedItems ? ' AND t.status < 3' : ''),
9880
+					'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').')'.($dontIncludeCompletedItems ? ' AND t.status < 3' : ''),
9881 9881
 				),
9882 9882
 			);
9883 9883
 		}
@@ -9919,23 +9919,23 @@  discard block
 block discarded – undo
9919 9919
 			}
9920 9920
 
9921 9921
 			if (!empty($possiblelink['perms']) && (empty($restrictlinksto) || in_array($key, $restrictlinksto)) && (empty($excludelinksto) || !in_array($key, $excludelinksto))) {
9922
-				$htmltoenteralink .= '<div id="' . $key . 'list"' . (empty($conf->use_javascript_ajax) ? '' : ' style="display:none"') . '>';
9922
+				$htmltoenteralink .= '<div id="'.$key.'list"'.(empty($conf->use_javascript_ajax) ? '' : ' style="display:none"').'>';
9923 9923
 
9924 9924
 				// Section for free ref input
9925 9925
 				if (!getDolGlobalString('MAIN_HIDE_LINK_BY_REF_IN_LINKTO')) {
9926 9926
 					$htmltoenteralink .= '<br>'."\n";
9927 9927
 					$htmltoenteralink .= '<!-- form to add a link from anywhere -->'."\n";
9928
-					$htmltoenteralink .= '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST" name="formlinkedbyref' . $key . '">';
9929
-					$htmltoenteralink .= '<input type="hidden" name="token" value="' . newToken() . '">';
9928
+					$htmltoenteralink .= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" name="formlinkedbyref'.$key.'">';
9929
+					$htmltoenteralink .= '<input type="hidden" name="token" value="'.newToken().'">';
9930 9930
 					$htmltoenteralink .= '<input type="hidden" name="action" value="addlinkbyref">';
9931
-					$htmltoenteralink .= '<input type="hidden" name="id" value="' . $object->id . '">';
9932
-					$htmltoenteralink .= '<input type="hidden" name="addlink" value="' . $key . '">';
9931
+					$htmltoenteralink .= '<input type="hidden" name="id" value="'.$object->id.'">';
9932
+					$htmltoenteralink .= '<input type="hidden" name="addlink" value="'.$key.'">';
9933 9933
 					$htmltoenteralink .= '<table class="noborder">';
9934 9934
 					$htmltoenteralink .= '<tr class="liste_titre">';
9935 9935
 					//print '<td>' . $langs->trans("Ref") . '</td>';
9936
-					$htmltoenteralink .= '<td class="center"><input type="text" placeholder="'.dol_escape_htmltag($langs->trans("Ref")).'" name="reftolinkto" value="' . dol_escape_htmltag(GETPOST('reftolinkto', 'alpha')) . '">&nbsp;';
9937
-					$htmltoenteralink .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans('ToLink') . '">&nbsp;';
9938
-					$htmltoenteralink .= '<input type="submit" class="button smallpaddingimp" name="cancel" value="' . $langs->trans('Cancel') . '"></td>';
9936
+					$htmltoenteralink .= '<td class="center"><input type="text" placeholder="'.dol_escape_htmltag($langs->trans("Ref")).'" name="reftolinkto" value="'.dol_escape_htmltag(GETPOST('reftolinkto', 'alpha')).'">&nbsp;';
9937
+					$htmltoenteralink .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans('ToLink').'">&nbsp;';
9938
+					$htmltoenteralink .= '<input type="submit" class="button smallpaddingimp" name="cancel" value="'.$langs->trans('Cancel').'"></td>';
9939 9939
 					$htmltoenteralink .= '</tr>';
9940 9940
 					$htmltoenteralink .= '</table>';
9941 9941
 					$htmltoenteralink .= '</form>';
@@ -9954,18 +9954,18 @@  discard block
 block discarded – undo
9954 9954
 							$htmltoenteralink .= '<br>';
9955 9955
 						}
9956 9956
 						$htmltoenteralink .= '<!-- form to add a link from object to same thirdparty -->'."\n";
9957
-						$htmltoenteralink .= '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST" name="formlinked' . $key . '">';
9958
-						$htmltoenteralink .= '<input type="hidden" name="token" value="' . newToken() . '">';
9957
+						$htmltoenteralink .= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" name="formlinked'.$key.'">';
9958
+						$htmltoenteralink .= '<input type="hidden" name="token" value="'.newToken().'">';
9959 9959
 						$htmltoenteralink .= '<input type="hidden" name="action" value="addlink">';
9960
-						$htmltoenteralink .= '<input type="hidden" name="id" value="' . $object->id . '">';
9961
-						$htmltoenteralink .= '<input type="hidden" name="addlink" value="' . $key . '">';
9960
+						$htmltoenteralink .= '<input type="hidden" name="id" value="'.$object->id.'">';
9961
+						$htmltoenteralink .= '<input type="hidden" name="addlink" value="'.$key.'">';
9962 9962
 						$htmltoenteralink .= '<table class="noborder">';
9963 9963
 						$htmltoenteralink .= '<tr class="liste_titre">';
9964 9964
 						$htmltoenteralink .= '<td class="nowrap"></td>';
9965
-						$htmltoenteralink .= '<td>' . $langs->trans("Ref") . '</td>';
9966
-						$htmltoenteralink .= '<td>' . $langs->trans("RefCustomer") . '</td>';
9967
-						$htmltoenteralink .= '<td class="right">' . $langs->trans("AmountHTShort") . '</td>';
9968
-						$htmltoenteralink .= '<td>' . $langs->trans("Company") . '</td>';
9965
+						$htmltoenteralink .= '<td>'.$langs->trans("Ref").'</td>';
9966
+						$htmltoenteralink .= '<td>'.$langs->trans("RefCustomer").'</td>';
9967
+						$htmltoenteralink .= '<td class="right">'.$langs->trans("AmountHTShort").'</td>';
9968
+						$htmltoenteralink .= '<td>'.$langs->trans("Company").'</td>';
9969 9969
 						$htmltoenteralink .= '</tr>';
9970 9970
 						while ($i < $num) {
9971 9971
 							$objp = $this->db->fetch_object($resqllist);
@@ -9980,30 +9980,30 @@  discard block
 block discarded – undo
9980 9980
 							if ($alreadylinked) {
9981 9981
 								$htmltoenteralink .= img_picto('', 'link');
9982 9982
 							} else {
9983
-								$htmltoenteralink .= '<input type="checkbox" name="idtolinkto[' . $key . '_' . $objp->rowid . ']" id="' . $key . '_' . $objp->rowid . '" value="' . $objp->rowid . '">';
9983
+								$htmltoenteralink .= '<input type="checkbox" name="idtolinkto['.$key.'_'.$objp->rowid.']" id="'.$key.'_'.$objp->rowid.'" value="'.$objp->rowid.'">';
9984 9984
 							}
9985 9985
 							$htmltoenteralink .= '</td>';
9986
-							$htmltoenteralink .= '<td><label for="' . $key . '_' . $objp->rowid . '">' . $objp->ref . '</label></td>';
9987
-							$htmltoenteralink .= '<td>' . (!empty($objp->ref_client) ? $objp->ref_client : (!empty($objp->ref_supplier) ? $objp->ref_supplier : '')) . '</td>';
9986
+							$htmltoenteralink .= '<td><label for="'.$key.'_'.$objp->rowid.'">'.$objp->ref.'</label></td>';
9987
+							$htmltoenteralink .= '<td>'.(!empty($objp->ref_client) ? $objp->ref_client : (!empty($objp->ref_supplier) ? $objp->ref_supplier : '')).'</td>';
9988 9988
 							$htmltoenteralink .= '<td class="right">';
9989 9989
 							if ($possiblelink['label'] == 'LinkToContract') {
9990
-								$htmltoenteralink .= $form->textwithpicto('', $langs->trans("InformationOnLinkToContract")) . ' ';
9990
+								$htmltoenteralink .= $form->textwithpicto('', $langs->trans("InformationOnLinkToContract")).' ';
9991 9991
 							}
9992
-							$htmltoenteralink .= '<span class="amount">' . (isset($objp->total_ht) ? price($objp->total_ht) : '') . '</span>';
9992
+							$htmltoenteralink .= '<span class="amount">'.(isset($objp->total_ht) ? price($objp->total_ht) : '').'</span>';
9993 9993
 							$htmltoenteralink .= '</td>';
9994
-							$htmltoenteralink .= '<td>' . $objp->name . '</td>';
9994
+							$htmltoenteralink .= '<td>'.$objp->name.'</td>';
9995 9995
 							$htmltoenteralink .= '</tr>';
9996 9996
 							$i++;
9997 9997
 						}
9998 9998
 						$htmltoenteralink .= '</table>';
9999 9999
 						$htmltoenteralink .= '<div class="center">';
10000 10000
 						if ($num) {
10001
-							$htmltoenteralink .= '<input type="submit" class="button valignmiddle marginleftonly marginrightonly smallpaddingimp" value="' . $langs->trans('ToLink') . '">';
10001
+							$htmltoenteralink .= '<input type="submit" class="button valignmiddle marginleftonly marginrightonly smallpaddingimp" value="'.$langs->trans('ToLink').'">';
10002 10002
 						}
10003 10003
 						if (empty($conf->use_javascript_ajax)) {
10004
-							$htmltoenteralink .= '<input type="submit" class="button button-cancel marginleftonly marginrightonly smallpaddingimp" name="cancel" value="' . $langs->trans("Cancel") . '"></div>';
10004
+							$htmltoenteralink .= '<input type="submit" class="button button-cancel marginleftonly marginrightonly smallpaddingimp" name="cancel" value="'.$langs->trans("Cancel").'"></div>';
10005 10005
 						} else {
10006
-							$htmltoenteralink .= '<input type="submit" onclick="jQuery(\'#' . $key . 'list\').toggle(); return false;" class="button button-cancel marginleftonly marginrightonly smallpaddingimp" name="cancel" value="' . $langs->trans("Cancel") . '"></div>';
10006
+							$htmltoenteralink .= '<input type="submit" onclick="jQuery(\'#'.$key.'list\').toggle(); return false;" class="button button-cancel marginleftonly marginrightonly smallpaddingimp" name="cancel" value="'.$langs->trans("Cancel").'"></div>';
10007 10007
 						}
10008 10008
 						$htmltoenteralink .= '</form>';
10009 10009
 					}
@@ -10017,10 +10017,10 @@  discard block
 block discarded – undo
10017 10017
 
10018 10018
 				// Complete the list for the combo box
10019 10019
 				if ($num > 0 || !getDolGlobalString('MAIN_HIDE_LINK_BY_REF_IN_LINKTO')) {
10020
-					$linktoelemlist .= '<li><a href="#linkto' . $key . '" class="linkto dropdowncloseonclick" rel="' . $key . '">' . $langs->trans($possiblelink['label']) . ' (' . $num . ')</a></li>';
10020
+					$linktoelemlist .= '<li><a href="#linkto'.$key.'" class="linkto dropdowncloseonclick" rel="'.$key.'">'.$langs->trans($possiblelink['label']).' ('.$num.')</a></li>';
10021 10021
 					// } else $linktoelem.=$langs->trans($possiblelink['label']);
10022 10022
 				} else {
10023
-					$linktoelemlist .= '<li><span class="linktodisabled">' . $langs->trans($possiblelink['label']) . ' (0)</span></li>';
10023
+					$linktoelemlist .= '<li><span class="linktodisabled">'.$langs->trans($possiblelink['label']).' (0)</span></li>';
10024 10024
 				}
10025 10025
 			}
10026 10026
 		}
@@ -10030,11 +10030,11 @@  discard block
 block discarded – undo
10030 10030
 			<dl class="dropdown" id="linktoobjectname">
10031 10031
 			';
10032 10032
 			if (!empty($conf->use_javascript_ajax)) {
10033
-				$linktoelem .= '<dt><a href="#linktoobjectname"><span class="fas fa-link paddingrightonly"></span>' . $langs->trans("LinkTo") . '...</a></dt>';
10033
+				$linktoelem .= '<dt><a href="#linktoobjectname"><span class="fas fa-link paddingrightonly"></span>'.$langs->trans("LinkTo").'...</a></dt>';
10034 10034
 			}
10035 10035
 			$linktoelem .= '<dd>
10036 10036
 			<div class="multiselectlinkto">
10037
-			<ul class="ulselectedfields">' . $linktoelemlist . '
10037
+			<ul class="ulselectedfields">' . $linktoelemlist.'
10038 10038
 			</ul>
10039 10039
 			</div>
10040 10040
 			</dd>
@@ -10045,7 +10045,7 @@  discard block
 block discarded – undo
10045 10045
 
10046 10046
 		if (!empty($conf->use_javascript_ajax)) {
10047 10047
 			print '<!-- Add js to show linkto box -->
10048
-				<script nonce="' . getNonce() . '">
10048
+				<script nonce="' . getNonce().'">
10049 10049
 				jQuery(document).ready(function() {
10050 10050
 					jQuery(".linkto").click(function() {
10051 10051
 						console.log("We choose to show/hide links for rel="+jQuery(this).attr(\'rel\')+" so #"+jQuery(this).attr(\'rel\')+"list");
@@ -10092,19 +10092,19 @@  discard block
 block discarded – undo
10092 10092
 
10093 10093
 		$disabled = ($disabled ? ' disabled' : '');
10094 10094
 
10095
-		$resultyesno = '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . '"' . $disabled . '>' . "\n";
10095
+		$resultyesno = '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.'"'.$disabled.'>'."\n";
10096 10096
 		if ($useempty) {
10097
-			$resultyesno .= '<option value="-1"' . (($value < 0) ? ' selected' : '') . '>&nbsp;</option>' . "\n";
10097
+			$resultyesno .= '<option value="-1"'.(($value < 0) ? ' selected' : '').'>&nbsp;</option>'."\n";
10098 10098
 		}
10099 10099
 		if (("$value" == 'yes') || ($value == 1)) {
10100
-			$resultyesno .= '<option value="' . $yes . '" selected>' . $langs->trans($labelyes) . '</option>' . "\n";
10101
-			$resultyesno .= '<option value="' . $no . '">' . $langs->trans($labelno) . '</option>' . "\n";
10100
+			$resultyesno .= '<option value="'.$yes.'" selected>'.$langs->trans($labelyes).'</option>'."\n";
10101
+			$resultyesno .= '<option value="'.$no.'">'.$langs->trans($labelno).'</option>'."\n";
10102 10102
 		} else {
10103 10103
 			$selected = (($useempty && $value != '0' && $value != 'no') ? '' : ' selected');
10104
-			$resultyesno .= '<option value="' . $yes . '">' . $langs->trans($labelyes) . '</option>' . "\n";
10105
-			$resultyesno .= '<option value="' . $no . '"' . $selected . '>' . $langs->trans($labelno) . '</option>' . "\n";
10104
+			$resultyesno .= '<option value="'.$yes.'">'.$langs->trans($labelyes).'</option>'."\n";
10105
+			$resultyesno .= '<option value="'.$no.'"'.$selected.'>'.$langs->trans($labelno).'</option>'."\n";
10106 10106
 		}
10107
-		$resultyesno .= '</select>' . "\n";
10107
+		$resultyesno .= '</select>'."\n";
10108 10108
 
10109 10109
 		if ($addjscombo) {
10110 10110
 			$resultyesno .= ajax_combobox($htmlname, array(), 0, 0, 'resolve', ($useempty < 0 ? (string) $useempty : '-1'), $morecss);
@@ -10128,12 +10128,12 @@  discard block
 block discarded – undo
10128 10128
 	{
10129 10129
 		// phpcs:enable
10130 10130
 		$sql = "SELECT rowid, label";
10131
-		$sql .= " FROM " . $this->db->prefix() . "export_model";
10132
-		$sql .= " WHERE type = '" . $this->db->escape($type) . "'";
10131
+		$sql .= " FROM ".$this->db->prefix()."export_model";
10132
+		$sql .= " WHERE type = '".$this->db->escape($type)."'";
10133 10133
 		$sql .= " ORDER BY rowid";
10134 10134
 		$result = $this->db->query($sql);
10135 10135
 		if ($result) {
10136
-			print '<select class="flat" id="select_' . $htmlname . '" name="' . $htmlname . '">';
10136
+			print '<select class="flat" id="select_'.$htmlname.'" name="'.$htmlname.'">';
10137 10137
 			if ($useempty) {
10138 10138
 				print '<option value="-1">&nbsp;</option>';
10139 10139
 			}
@@ -10143,9 +10143,9 @@  discard block
 block discarded – undo
10143 10143
 			while ($i < $num) {
10144 10144
 				$obj = $this->db->fetch_object($result);
10145 10145
 				if ($selected == $obj->rowid) {
10146
-					print '<option value="' . $obj->rowid . '" selected>';
10146
+					print '<option value="'.$obj->rowid.'" selected>';
10147 10147
 				} else {
10148
-					print '<option value="' . $obj->rowid . '">';
10148
+					print '<option value="'.$obj->rowid.'">';
10149 10149
 				}
10150 10150
 				print $obj->label;
10151 10151
 				print '</option>';
@@ -10236,8 +10236,8 @@  discard block
 block discarded – undo
10236 10236
 				$stringforfirstkey .= ' CTL +';
10237 10237
 			}
10238 10238
 
10239
-			$previous_ref = $object->ref_previous ? '<a accesskey="p" alt="'.dol_escape_htmltag($langs->trans("Previous")).'" title="' . $stringforfirstkey . ' p" class="classfortooltip" href="' . $navurl . '?' . $paramid . '=' . urlencode($object->ref_previous) . $moreparam . '"><i class="fa fa-chevron-left"></i></a>' : '<span class="inactive"><i class="fa fa-chevron-left opacitymedium"></i></span>';
10240
-			$next_ref = $object->ref_next ? '<a accesskey="n" alt="'.dol_escape_htmltag($langs->trans("Next")).'" title="' . $stringforfirstkey . ' n" class="classfortooltip" href="' . $navurl . '?' . $paramid . '=' . urlencode($object->ref_next) . $moreparam . '"><i class="fa fa-chevron-right"></i></a>' : '<span class="inactive"><i class="fa fa-chevron-right opacitymedium"></i></span>';
10239
+			$previous_ref = $object->ref_previous ? '<a accesskey="p" alt="'.dol_escape_htmltag($langs->trans("Previous")).'" title="'.$stringforfirstkey.' p" class="classfortooltip" href="'.$navurl.'?'.$paramid.'='.urlencode($object->ref_previous).$moreparam.'"><i class="fa fa-chevron-left"></i></a>' : '<span class="inactive"><i class="fa fa-chevron-left opacitymedium"></i></span>';
10240
+			$next_ref = $object->ref_next ? '<a accesskey="n" alt="'.dol_escape_htmltag($langs->trans("Next")).'" title="'.$stringforfirstkey.' n" class="classfortooltip" href="'.$navurl.'?'.$paramid.'='.urlencode($object->ref_next).$moreparam.'"><i class="fa fa-chevron-right"></i></a>' : '<span class="inactive"><i class="fa fa-chevron-right opacitymedium"></i></span>';
10241 10241
 		}
10242 10242
 
10243 10243
 		//print "xx".$previous_ref."x".$next_ref;
@@ -10245,18 +10245,18 @@  discard block
 block discarded – undo
10245 10245
 
10246 10246
 		// Right part of banner
10247 10247
 		if ($morehtmlright) {
10248
-			$ret .= '<div class="inline-block floatleft">' . $morehtmlright . '</div>';
10248
+			$ret .= '<div class="inline-block floatleft">'.$morehtmlright.'</div>';
10249 10249
 		}
10250 10250
 
10251 10251
 		if ($previous_ref || $next_ref || $morehtml) {
10252 10252
 			$ret .= '<div class="pagination paginationref"><ul class="right">';
10253 10253
 		}
10254 10254
 		if ($morehtml && getDolGlobalInt('MAIN_OPTIMIZEFORTEXTBROWSER') < 2) {
10255
-			$ret .= '<!-- morehtml --><li class="noborder litext' . (($shownav && $previous_ref && $next_ref) ? ' clearbothonsmartphone' : '') . '">' . $morehtml . '</li>';
10255
+			$ret .= '<!-- morehtml --><li class="noborder litext'.(($shownav && $previous_ref && $next_ref) ? ' clearbothonsmartphone' : '').'">'.$morehtml.'</li>';
10256 10256
 		}
10257 10257
 		if ($shownav && ($previous_ref || $next_ref)) {
10258
-			$ret .= '<li class="pagination">' . $previous_ref . '</li>';
10259
-			$ret .= '<li class="pagination">' . $next_ref . '</li>';
10258
+			$ret .= '<li class="pagination">'.$previous_ref.'</li>';
10259
+			$ret .= '<li class="pagination">'.$next_ref.'</li>';
10260 10260
 		}
10261 10261
 		if ($previous_ref || $next_ref || $morehtml) {
10262 10262
 			$ret .= '</ul></div>';
@@ -10271,7 +10271,7 @@  discard block
 block discarded – undo
10271 10271
 			$morehtmlstatus = $hookmanager->resPrint;
10272 10272
 		}
10273 10273
 		if ($morehtmlstatus) {
10274
-			$ret .= '<div class="statusref">' . $morehtmlstatus . '</div>';
10274
+			$ret .= '<div class="statusref">'.$morehtmlstatus.'</div>';
10275 10275
 		}
10276 10276
 
10277 10277
 		$parameters = array();
@@ -10285,14 +10285,14 @@  discard block
 block discarded – undo
10285 10285
 		// Left part of banner
10286 10286
 		if ($morehtmlleft) {
10287 10287
 			if ($conf->browser->layout == 'phone') {
10288
-				$ret .= '<!-- morehtmlleft --><div class="floatleft">' . $morehtmlleft . '</div>';
10288
+				$ret .= '<!-- morehtmlleft --><div class="floatleft">'.$morehtmlleft.'</div>';
10289 10289
 			} else {
10290
-				$ret .= '<!-- morehtmlleft --><div class="inline-block floatleft">' . $morehtmlleft . '</div>';
10290
+				$ret .= '<!-- morehtmlleft --><div class="inline-block floatleft">'.$morehtmlleft.'</div>';
10291 10291
 			}
10292 10292
 		}
10293 10293
 
10294 10294
 		//if ($conf->browser->layout == 'phone') $ret.='<div class="clearboth"></div>';
10295
-		$ret .= '<div class="inline-block floatleft valignmiddle maxwidth750 marginbottomonly refid' . (($shownav && ($previous_ref || $next_ref)) ? ' refidpadding' : '') . '">';
10295
+		$ret .= '<div class="inline-block floatleft valignmiddle maxwidth750 marginbottomonly refid'.(($shownav && ($previous_ref || $next_ref)) ? ' refidpadding' : '').'">';
10296 10296
 
10297 10297
 		// For thirdparty, contact, user, member, the ref is the id, so we show something else
10298 10298
 		if ($object->element == 'societe') {
@@ -10306,7 +10306,7 @@  discard block
 block discarded – undo
10306 10306
 
10307 10307
 			if (is_array($arrayoflangcode) && count($arrayoflangcode)) {
10308 10308
 				if (!is_object($extralanguages)) {
10309
-					include_once DOL_DOCUMENT_ROOT . '/core/class/extralanguages.class.php';
10309
+					include_once DOL_DOCUMENT_ROOT.'/core/class/extralanguages.class.php';
10310 10310
 					$extralanguages = new ExtraLanguages($this->db);
10311 10311
 				}
10312 10312
 				$extralanguages->fetch_name_extralanguages('societe');
@@ -10321,21 +10321,21 @@  discard block
 block discarded – undo
10321 10321
 						if ($object->array_languages['name'][$extralangcode]) {
10322 10322
 							$htmltext .= $object->array_languages['name'][$extralangcode];
10323 10323
 						} else {
10324
-							$htmltext .= '<span class="opacitymedium">' . $langs->trans("SwitchInEditModeToAddTranslation") . '</span>';
10324
+							$htmltext .= '<span class="opacitymedium">'.$langs->trans("SwitchInEditModeToAddTranslation").'</span>';
10325 10325
 						}
10326 10326
 					}
10327
-					$ret .= '<!-- Show translations of name -->' . "\n";
10327
+					$ret .= '<!-- Show translations of name -->'."\n";
10328 10328
 					$ret .= $this->textwithpicto('', $htmltext, -1, 'language', 'opacitymedium paddingleft');
10329 10329
 				}
10330 10330
 			}
10331 10331
 		} elseif ($object->element == 'member') {
10332 10332
 			'@phan-var-force Adherent $object';
10333
-			$ret .= $object->ref . '<br>';
10333
+			$ret .= $object->ref.'<br>';
10334 10334
 			$fullname = $object->getFullName($langs);
10335 10335
 			if ($object->morphy == 'mor' && $object->societe) {
10336
-				$ret .= dol_htmlentities($object->societe) . ((!empty($fullname) && $object->societe != $fullname) ? ' (' . dol_htmlentities($fullname) . $addgendertxt . ')' : '');
10336
+				$ret .= dol_htmlentities($object->societe).((!empty($fullname) && $object->societe != $fullname) ? ' ('.dol_htmlentities($fullname).$addgendertxt.')' : '');
10337 10337
 			} else {
10338
-				$ret .= dol_htmlentities($fullname) . $addgendertxt . ((!empty($object->societe) && $object->societe != $fullname) ? ' (' . dol_htmlentities($object->societe) . ')' : '');
10338
+				$ret .= dol_htmlentities($fullname).$addgendertxt.((!empty($object->societe) && $object->societe != $fullname) ? ' ('.dol_htmlentities($object->societe).')' : '');
10339 10339
 			}
10340 10340
 		} elseif (in_array($object->element, array('contact', 'user'))) {
10341 10341
 			$ret .= '<span class="valignmiddle">'.dol_htmlentities($object->getFullName($langs)).'</span>'.$addgendertxt;
@@ -10343,7 +10343,7 @@  discard block
 block discarded – undo
10343 10343
 			$ret .= dol_htmlentities($object->name);
10344 10344
 		} elseif (in_array($object->element, array('action', 'agenda'))) {
10345 10345
 			'@phan-var-force ActionComm $object';
10346
-			$ret .= $object->ref . '<br>' . $object->label;
10346
+			$ret .= $object->ref.'<br>'.$object->label;
10347 10347
 		} elseif (in_array($object->element, array('adherent_type'))) {
10348 10348
 			$ret .= $object->label;
10349 10349
 		} elseif ($object->element == 'ecm_directories') {
@@ -10396,9 +10396,9 @@  discard block
 block discarded – undo
10396 10396
 		}
10397 10397
 
10398 10398
 		// Barcode image  @phan-suppress-next-line PhanUndeclaredProperty
10399
-		$url = DOL_URL_ROOT . '/viewimage.php?modulepart=barcode&generator=' . urlencode($object->barcode_type_coder) . '&code=' . urlencode($object->barcode) . '&encoding=' . urlencode($object->barcode_type_code);
10400
-		$out = '<!-- url barcode = ' . $url . ' -->';
10401
-		$out .= '<img src="' . $url . '"' . ($morecss ? ' class="' . $morecss . '"' : '') . '>';
10399
+		$url = DOL_URL_ROOT.'/viewimage.php?modulepart=barcode&generator='.urlencode($object->barcode_type_coder).'&code='.urlencode($object->barcode).'&encoding='.urlencode($object->barcode_type_code);
10400
+		$out = '<!-- url barcode = '.$url.' -->';
10401
+		$out .= '<img src="'.$url.'"'.($morecss ? ' class="'.$morecss.'"' : '').'>';
10402 10402
 
10403 10403
 		return $out;
10404 10404
 	}
@@ -10425,7 +10425,7 @@  discard block
 block discarded – undo
10425 10425
 		global $conf, $langs;
10426 10426
 
10427 10427
 		$entity = (empty($object->entity) ? $conf->entity : $object->entity);
10428
-		$id = (empty($object->id) ? $object->rowid : $object->id);  // @phan-suppress-current-line PhanUndeclaredProperty (->rowid)
10428
+		$id = (empty($object->id) ? $object->rowid : $object->id); // @phan-suppress-current-line PhanUndeclaredProperty (->rowid)
10429 10429
 
10430 10430
 		$dir = '';
10431 10431
 		$file = '';
@@ -10438,28 +10438,28 @@  discard block
 block discarded – undo
10438 10438
 			if (!empty($object->logo)) {
10439 10439
 				if (dolIsAllowedForPreview($object->logo)) {
10440 10440
 					if ((string) $imagesize == 'mini') {
10441
-						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . getImageFileNameForSize($object->logo, '_mini'); // getImageFileNameForSize include the thumbs
10441
+						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.getImageFileNameForSize($object->logo, '_mini'); // getImageFileNameForSize include the thumbs
10442 10442
 					} elseif ((string) $imagesize == 'small') {
10443
-						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . getImageFileNameForSize($object->logo, '_small');
10443
+						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.getImageFileNameForSize($object->logo, '_small');
10444 10444
 					} else {
10445
-						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . $object->logo;
10445
+						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.$object->logo;
10446 10446
 					}
10447
-					$originalfile = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . $object->logo;
10447
+					$originalfile = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.$object->logo;
10448 10448
 				}
10449 10449
 			}
10450 10450
 			$email = $object->email;
10451 10451
 		} elseif ($modulepart == 'contact') {
10452
-			$dir = $conf->societe->multidir_output[$entity] . '/contact';
10452
+			$dir = $conf->societe->multidir_output[$entity].'/contact';
10453 10453
 			if (!empty($object->photo)) {
10454 10454
 				if (dolIsAllowedForPreview($object->photo)) {
10455 10455
 					if ((string) $imagesize == 'mini') {
10456
-						$file = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . getImageFileNameForSize($object->photo, '_mini');
10456
+						$file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.getImageFileNameForSize($object->photo, '_mini');
10457 10457
 					} elseif ((string) $imagesize == 'small') {
10458
-						$file = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . getImageFileNameForSize($object->photo, '_small');
10458
+						$file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.getImageFileNameForSize($object->photo, '_small');
10459 10459
 					} else {
10460
-						$file = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . $object->photo;
10460
+						$file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.$object->photo;
10461 10461
 					}
10462
-					$originalfile = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . $object->photo;
10462
+					$originalfile = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.$object->photo;
10463 10463
 				}
10464 10464
 			}
10465 10465
 			$email = $object->email;
@@ -10469,17 +10469,17 @@  discard block
 block discarded – undo
10469 10469
 			if (!empty($object->photo)) {
10470 10470
 				if (dolIsAllowedForPreview($object->photo)) {
10471 10471
 					if ((string) $imagesize == 'mini') {
10472
-						$file = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . getImageFileNameForSize($object->photo, '_mini');
10472
+						$file = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.getImageFileNameForSize($object->photo, '_mini');
10473 10473
 					} elseif ((string) $imagesize == 'small') {
10474
-						$file = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . getImageFileNameForSize($object->photo, '_small');
10474
+						$file = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.getImageFileNameForSize($object->photo, '_small');
10475 10475
 					} else {
10476
-						$file = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . $object->photo;
10476
+						$file = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.$object->photo;
10477 10477
 					}
10478
-					$originalfile = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . $object->photo;
10478
+					$originalfile = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.$object->photo;
10479 10479
 				}
10480 10480
 			}
10481 10481
 			if (getDolGlobalString('MAIN_OLD_IMAGE_LINKS')) {
10482
-				$altfile = $object->id . ".jpg"; // For backward compatibility
10482
+				$altfile = $object->id.".jpg"; // For backward compatibility
10483 10483
 			}
10484 10484
 			$email = $object->email;
10485 10485
 			$capture = 'user';
@@ -10488,17 +10488,17 @@  discard block
 block discarded – undo
10488 10488
 			if (!empty($object->photo)) {
10489 10489
 				if (dolIsAllowedForPreview($object->photo)) {
10490 10490
 					if ((string) $imagesize == 'mini') {
10491
-						$file = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . getImageFileNameForSize($object->photo, '_mini');
10491
+						$file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_mini');
10492 10492
 					} elseif ((string) $imagesize == 'small') {
10493
-						$file = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . getImageFileNameForSize($object->photo, '_small');
10493
+						$file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_small');
10494 10494
 					} else {
10495
-						$file = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . $object->photo;
10495
+						$file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.$object->photo;
10496 10496
 					}
10497
-					$originalfile = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . $object->photo;
10497
+					$originalfile = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.$object->photo;
10498 10498
 				}
10499 10499
 			}
10500 10500
 			if (getDolGlobalString('MAIN_OLD_IMAGE_LINKS')) {
10501
-				$altfile = $object->id . ".jpg"; // For backward compatibility
10501
+				$altfile = $object->id.".jpg"; // For backward compatibility
10502 10502
 			}
10503 10503
 			$email = $object->email;
10504 10504
 			$capture = 'user';
@@ -10524,35 +10524,35 @@  discard block
 block discarded – undo
10524 10524
 		$ret = '';
10525 10525
 
10526 10526
 		if ($dir) {
10527
-			if ($file && file_exists($dir . "/" . $file)) {
10527
+			if ($file && file_exists($dir."/".$file)) {
10528 10528
 				if ($addlinktofullsize) {
10529
-					$urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity=' . $entity);
10529
+					$urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity='.$entity);
10530 10530
 					if ($urladvanced) {
10531
-						$ret .= '<a href="' . $urladvanced . '">';
10531
+						$ret .= '<a href="'.$urladvanced.'">';
10532 10532
 					} else {
10533
-						$ret .= '<a href="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($originalfile) . '&cache=' . $cache . '">';
10533
+						$ret .= '<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($originalfile).'&cache='.$cache.'">';
10534 10534
 					}
10535 10535
 				}
10536
-				$ret .= '<img alt="" class="photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . ' photologo' . (preg_replace('/[^a-z]/i', '_', $file)) . '" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . ' src="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($file) . '&cache=' . $cache . '">';
10536
+				$ret .= '<img alt="" class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').' photologo'.(preg_replace('/[^a-z]/i', '_', $file)).'" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').' src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($file).'&cache='.$cache.'">';
10537 10537
 				if ($addlinktofullsize) {
10538 10538
 					$ret .= '</a>';
10539 10539
 				}
10540
-			} elseif ($altfile && file_exists($dir . "/" . $altfile)) {
10540
+			} elseif ($altfile && file_exists($dir."/".$altfile)) {
10541 10541
 				if ($addlinktofullsize) {
10542
-					$urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity=' . $entity);
10542
+					$urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity='.$entity);
10543 10543
 					if ($urladvanced) {
10544
-						$ret .= '<a href="' . $urladvanced . '">';
10544
+						$ret .= '<a href="'.$urladvanced.'">';
10545 10545
 					} else {
10546
-						$ret .= '<a href="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($originalfile) . '&cache=' . $cache . '">';
10546
+						$ret .= '<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($originalfile).'&cache='.$cache.'">';
10547 10547
 					}
10548 10548
 				}
10549
-				$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 . '">';
10549
+				$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.'">';
10550 10550
 				if ($addlinktofullsize) {
10551 10551
 					$ret .= '</a>';
10552 10552
 				}
10553 10553
 			} else {
10554 10554
 				$nophoto = '/public/theme/common/nophoto.png';
10555
-				$defaultimg = 'identicon';        // For gravatar
10555
+				$defaultimg = 'identicon'; // For gravatar
10556 10556
 				if (in_array($modulepart, array('societe', 'userphoto', 'contact', 'memberphoto'))) {    // For modules that need a special image when photo not found
10557 10557
 					if ($modulepart == 'societe' || ($modulepart == 'memberphoto' && !empty($object->morphy) && strpos($object->morphy, 'mor') !== false)) {
10558 10558
 						$nophoto = 'company';
@@ -10570,13 +10570,13 @@  discard block
 block discarded – undo
10570 10570
 				if (isModEnabled('gravatar') && $email && empty($noexternsourceoverwrite)) {
10571 10571
 					// see https://gravatar.com/site/implement/images/php/
10572 10572
 					$ret .= '<!-- Put link to gravatar -->';
10573
-					$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
10573
+					$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
10574 10574
 				} else {
10575 10575
 					if ($nophoto == 'company') {
10576
-						$ret .= '<div class="divforspanimg valignmiddle center photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . '>' . img_picto('', 'company') . '</div>';
10576
+						$ret .= '<div class="divforspanimg valignmiddle center photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').'>'.img_picto('', 'company').'</div>';
10577 10577
 						//$ret .= '<div class="difforspanimgright"></div>';
10578 10578
 					} else {
10579
-						$ret .= '<img class="photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . ' src="' . DOL_URL_ROOT . $nophoto . '">';
10579
+						$ret .= '<img class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').' src="'.DOL_URL_ROOT.$nophoto.'">';
10580 10580
 					}
10581 10581
 				}
10582 10582
 			}
@@ -10587,15 +10587,15 @@  discard block
 block discarded – undo
10587 10587
 				}
10588 10588
 				$ret .= '<table class="nobordernopadding centpercent">';
10589 10589
 				if ($object->photo) {
10590
-					$ret .= '<tr><td><input type="checkbox" class="flat photodelete" name="deletephoto" id="photodelete"> <label for="photodelete">' . $langs->trans("Delete") . '</label><br><br></td></tr>';
10590
+					$ret .= '<tr><td><input type="checkbox" class="flat photodelete" name="deletephoto" id="photodelete"> <label for="photodelete">'.$langs->trans("Delete").'</label><br><br></td></tr>';
10591 10591
 				}
10592 10592
 				$ret .= '<tr><td class="tdoverflow">';
10593 10593
 				$maxfilesizearray = getMaxFileSizeArray();
10594 10594
 				$maxmin = $maxfilesizearray['maxmin'];
10595 10595
 				if ($maxmin > 0) {
10596
-					$ret .= '<input type="hidden" name="MAX_FILE_SIZE" value="' . ($maxmin * 1024) . '">';    // MAX_FILE_SIZE must precede the field type=file
10596
+					$ret .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file
10597 10597
 				}
10598
-				$ret .= '<input type="file" class="flat maxwidth200onsmartphone" name="photo" id="photoinput" accept="image/*"' . ($capture ? ' capture="' . $capture . '"' : '') . '>';
10598
+				$ret .= '<input type="file" class="flat maxwidth200onsmartphone" name="photo" id="photoinput" accept="image/*"'.($capture ? ' capture="'.$capture.'"' : '').'>';
10599 10599
 				$ret .= '</td></tr>';
10600 10600
 				$ret .= '</table>';
10601 10601
 			}
@@ -10649,38 +10649,38 @@  discard block
 block discarded – undo
10649 10649
 		if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) {
10650 10650
 			$sql .= ", e.label";
10651 10651
 		}
10652
-		$sql .= " FROM " . $this->db->prefix() . "usergroup as ug ";
10652
+		$sql .= " FROM ".$this->db->prefix()."usergroup as ug ";
10653 10653
 		if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) {
10654
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "entity as e ON e.rowid=ug.entity";
10654
+			$sql .= " LEFT JOIN ".$this->db->prefix()."entity as e ON e.rowid=ug.entity";
10655 10655
 			if ($force_entity) {
10656
-				$sql .= " WHERE ug.entity IN (0, " . $force_entity . ")";
10656
+				$sql .= " WHERE ug.entity IN (0, ".$force_entity.")";
10657 10657
 			} else {
10658 10658
 				$sql .= " WHERE ug.entity IS NOT NULL";
10659 10659
 			}
10660 10660
 		} else {
10661
-			$sql .= " WHERE ug.entity IN (0, " . $conf->entity . ")";
10661
+			$sql .= " WHERE ug.entity IN (0, ".$conf->entity.")";
10662 10662
 		}
10663 10663
 		if (is_array($exclude) && $excludeGroups) {
10664
-			$sql .= " AND ug.rowid NOT IN (" . $this->db->sanitize($excludeGroups) . ")";
10664
+			$sql .= " AND ug.rowid NOT IN (".$this->db->sanitize($excludeGroups).")";
10665 10665
 		}
10666 10666
 		if (is_array($include) && $includeGroups) {
10667
-			$sql .= " AND ug.rowid IN (" . $this->db->sanitize($includeGroups) . ")";
10667
+			$sql .= " AND ug.rowid IN (".$this->db->sanitize($includeGroups).")";
10668 10668
 		}
10669 10669
 		$sql .= " ORDER BY ug.nom ASC";
10670 10670
 
10671
-		dol_syslog(get_class($this) . "::select_dolgroups", LOG_DEBUG);
10671
+		dol_syslog(get_class($this)."::select_dolgroups", LOG_DEBUG);
10672 10672
 		$resql = $this->db->query($sql);
10673 10673
 		if ($resql) {
10674 10674
 			// Enhance with select2
10675
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
10675
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
10676 10676
 
10677
-			$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . ' ' . ($disabled ? ' disabled' : '') . '>';
10677
+			$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.($disabled ? ' disabled' : '').'>';
10678 10678
 
10679 10679
 			$num = $this->db->num_rows($resql);
10680 10680
 			$i = 0;
10681 10681
 			if ($num) {
10682 10682
 				if ($show_empty && !$multiple) {
10683
-					$out .= '<option value="-1"' . (in_array(-1, $selected) ? ' selected' : '') . '>&nbsp;</option>' . "\n";
10683
+					$out .= '<option value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'>&nbsp;</option>'."\n";
10684 10684
 				}
10685 10685
 
10686 10686
 				while ($i < $num) {
@@ -10693,11 +10693,11 @@  discard block
 block discarded – undo
10693 10693
 					$label = $obj->name;
10694 10694
 					$labelhtml = $obj->name;
10695 10695
 					if (isModEnabled('multicompany') && !getDolGlobalInt('MULTICOMPANY_TRANSVERSE_MODE') && $conf->entity == 1) {
10696
-						$label .= " (" . $obj->label . ")";
10697
-						$labelhtml .= ' <span class="opacitymedium">(' . $obj->label . ')</span>';
10696
+						$label .= " (".$obj->label.")";
10697
+						$labelhtml .= ' <span class="opacitymedium">('.$obj->label.')</span>';
10698 10698
 					}
10699 10699
 
10700
-					$out .= '<option value="' . $obj->rowid . '"';
10700
+					$out .= '<option value="'.$obj->rowid.'"';
10701 10701
 					if ($disableline) {
10702 10702
 						$out .= ' disabled';
10703 10703
 					}
@@ -10713,9 +10713,9 @@  discard block
 block discarded – undo
10713 10713
 				}
10714 10714
 			} else {
10715 10715
 				if ($show_empty) {
10716
-					$out .= '<option value="-1"' . (in_array(-1, $selected) ? ' selected' : '') . '></option>' . "\n";
10716
+					$out .= '<option value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'></option>'."\n";
10717 10717
 				}
10718
-				$out .= '<option value="" disabled>' . $langs->trans("NoUserGroupDefined") . '</option>';
10718
+				$out .= '<option value="" disabled>'.$langs->trans("NoUserGroupDefined").'</option>';
10719 10719
 			}
10720 10720
 			$out .= '</select>';
10721 10721
 
@@ -10759,25 +10759,25 @@  discard block
 block discarded – undo
10759 10759
 		$out = '';
10760 10760
 
10761 10761
 		if (!empty($conf->use_javascript_ajax)) {
10762
-			$out .= '<div class="inline-block checkallactions"><input type="checkbox" id="' . $cssclass . 's" name="' . $cssclass . 's" class="checkallactions"></div>';
10762
+			$out .= '<div class="inline-block checkallactions"><input type="checkbox" id="'.$cssclass.'s" name="'.$cssclass.'s" class="checkallactions"></div>';
10763 10763
 		}
10764
-		$out .= '<script nonce="' . getNonce() . '">
10764
+		$out .= '<script nonce="'.getNonce().'">
10765 10765
             $(document).ready(function() {
10766
-                $("#' . $cssclass . 's").click(function() {
10766
+                $("#' . $cssclass.'s").click(function() {
10767 10767
                     if($(this).is(\':checked\')){
10768
-                        console.log("We check all ' . $cssclass . ' and trigger the change method");
10769
-                		$(".' . $cssclass . '").prop(\'checked\', true).trigger(\'change\');
10768
+                        console.log("We check all ' . $cssclass.' and trigger the change method");
10769
+                		$(".' . $cssclass.'").prop(\'checked\', true).trigger(\'change\');
10770 10770
                     }
10771 10771
                     else
10772 10772
                     {
10773 10773
                         console.log("We uncheck all");
10774
-                		$(".' . $cssclass . '").prop(\'checked\', false).trigger(\'change\');
10774
+                		$(".' . $cssclass.'").prop(\'checked\', false).trigger(\'change\');
10775 10775
                     }' . "\n";
10776 10776
 		if ($calljsfunction) {
10777
-			$out .= 'if (typeof initCheckForSelect == \'function\') { initCheckForSelect(0, "' . $massactionname . '", "' . $cssclass . '"); } else { console.log("No function initCheckForSelect found. Call won\'t be done."); }';
10777
+			$out .= 'if (typeof initCheckForSelect == \'function\') { initCheckForSelect(0, "'.$massactionname.'", "'.$cssclass.'"); } else { console.log("No function initCheckForSelect found. Call won\'t be done."); }';
10778 10778
 		}
10779 10779
 		$out .= '         });
10780
-        	        $(".' . $cssclass . '").change(function() {
10780
+        	        $(".' . $cssclass.'").change(function() {
10781 10781
 					$(this).closest("tr").toggleClass("highlight", this.checked);
10782 10782
 				});
10783 10783
 		 	});
@@ -10822,67 +10822,67 @@  discard block
 block discarded – undo
10822 10822
 		global $langs, $user;
10823 10823
 
10824 10824
 		$out = '';
10825
-		$sql = "SELECT rowid, label FROM " . $this->db->prefix() . "c_exp_tax_cat WHERE active = 1";
10826
-		$sql .= " AND entity IN (0," . getEntity('exp_tax_cat') . ")";
10825
+		$sql = "SELECT rowid, label FROM ".$this->db->prefix()."c_exp_tax_cat WHERE active = 1";
10826
+		$sql .= " AND entity IN (0,".getEntity('exp_tax_cat').")";
10827 10827
 		if (!empty($excludeid)) {
10828
-			$sql .= " AND rowid NOT IN (" . $this->db->sanitize(implode(',', $excludeid)) . ")";
10828
+			$sql .= " AND rowid NOT IN (".$this->db->sanitize(implode(',', $excludeid)).")";
10829 10829
 		}
10830 10830
 		$sql .= " ORDER BY label";
10831 10831
 
10832 10832
 		$resql = $this->db->query($sql);
10833 10833
 		if ($resql) {
10834
-			$out = '<select id="select_' . $htmlname . '" name="' . $htmlname . '" class="' . $htmlname . ' flat minwidth75imp maxwidth200">';
10834
+			$out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp maxwidth200">';
10835 10835
 			if ($useempty) {
10836 10836
 				$out .= '<option value="0">&nbsp;</option>';
10837 10837
 			}
10838 10838
 
10839 10839
 			while ($obj = $this->db->fetch_object($resql)) {
10840
-				$out .= '<option ' . ($selected == $obj->rowid ? 'selected="selected"' : '') . ' value="' . $obj->rowid . '">' . $langs->trans($obj->label) . '</option>';
10840
+				$out .= '<option '.($selected == $obj->rowid ? 'selected="selected"' : '').' value="'.$obj->rowid.'">'.$langs->trans($obj->label).'</option>';
10841 10841
 			}
10842 10842
 			$out .= '</select>';
10843
-			$out .= ajax_combobox('select_' . $htmlname);
10843
+			$out .= ajax_combobox('select_'.$htmlname);
10844 10844
 
10845 10845
 			if (!empty($htmlname) && $user->admin && $info_admin) {
10846
-				$out .= ' ' . info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
10846
+				$out .= ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
10847 10847
 			}
10848 10848
 
10849 10849
 			if (!empty($target)) {
10850
-				$sql = "SELECT c.id FROM " . $this->db->prefix() . "c_type_fees as c WHERE c.code = 'EX_KME' AND c.active = 1";
10850
+				$sql = "SELECT c.id FROM ".$this->db->prefix()."c_type_fees as c WHERE c.code = 'EX_KME' AND c.active = 1";
10851 10851
 				$resql = $this->db->query($sql);
10852 10852
 				if ($resql) {
10853 10853
 					if ($this->db->num_rows($resql) > 0) {
10854 10854
 						$obj = $this->db->fetch_object($resql);
10855
-						$out .= '<script nonce="' . getNonce() . '">
10855
+						$out .= '<script nonce="'.getNonce().'">
10856 10856
 							$(function() {
10857
-								$("select[name=' . $target . ']").on("change", function() {
10857
+								$("select[name=' . $target.']").on("change", function() {
10858 10858
 									var current_val = $(this).val();
10859
-									if (current_val == ' . $obj->id . ') {';
10859
+									if (current_val == ' . $obj->id.') {';
10860 10860
 						if (!empty($default_selected) || !empty($selected)) {
10861
-							$out .= '$("select[name=' . $htmlname . ']").val("' . ($default_selected > 0 ? $default_selected : $selected) . '");';
10861
+							$out .= '$("select[name='.$htmlname.']").val("'.($default_selected > 0 ? $default_selected : $selected).'");';
10862 10862
 						}
10863 10863
 
10864 10864
 						$out .= '
10865
-										$("select[name=' . $htmlname . ']").change();
10865
+										$("select[name=' . $htmlname.']").change();
10866 10866
 									}
10867 10867
 								});
10868 10868
 
10869
-								$("select[name=' . $htmlname . ']").change(function() {
10869
+								$("select[name=' . $htmlname.']").change(function() {
10870 10870
 
10871
-									if ($("select[name=' . $target . ']").val() == ' . $obj->id . ') {
10871
+									if ($("select[name=' . $target.']").val() == '.$obj->id.') {
10872 10872
 										// get price of kilometer to fill the unit price
10873 10873
 										$.ajax({
10874 10874
 											method: "POST",
10875 10875
 											dataType: "json",
10876
-											data: { fk_c_exp_tax_cat: $(this).val(), token: \'' . currentToken() . '\' },
10877
-											url: "' . (DOL_URL_ROOT . '/expensereport/ajax/ajaxik.php?' . implode('&', $params)) . '",
10876
+											data: { fk_c_exp_tax_cat: $(this).val(), token: \'' . currentToken().'\' },
10877
+											url: "' . (DOL_URL_ROOT.'/expensereport/ajax/ajaxik.php?'.implode('&', $params)).'",
10878 10878
 										}).done(function( data, textStatus, jqXHR ) {
10879 10879
 											console.log(data);
10880 10880
 											if (typeof data.up != "undefined") {
10881 10881
 												$("input[name=value_unit]").val(data.up);
10882
-												$("select[name=' . $htmlname . ']").attr("title", data.title);
10882
+												$("select[name=' . $htmlname.']").attr("title", data.title);
10883 10883
 											} else {
10884 10884
 												$("input[name=value_unit]").val("");
10885
-												$("select[name=' . $htmlname . ']").attr("title", "");
10885
+												$("select[name=' . $htmlname.']").attr("title", "");
10886 10886
 											}
10887 10887
 										});
10888 10888
 									}
@@ -10912,18 +10912,18 @@  discard block
 block discarded – undo
10912 10912
 		global $conf, $langs;
10913 10913
 
10914 10914
 		$out = '';
10915
-		$sql = "SELECT rowid, range_ik FROM " . $this->db->prefix() . "c_exp_tax_range";
10916
-		$sql .= " WHERE entity = " . $conf->entity . " AND active = 1";
10915
+		$sql = "SELECT rowid, range_ik FROM ".$this->db->prefix()."c_exp_tax_range";
10916
+		$sql .= " WHERE entity = ".$conf->entity." AND active = 1";
10917 10917
 
10918 10918
 		$resql = $this->db->query($sql);
10919 10919
 		if ($resql) {
10920
-			$out = '<select id="select_' . $htmlname . '" name="' . $htmlname . '" class="' . $htmlname . ' flat minwidth75imp">';
10920
+			$out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp">';
10921 10921
 			if ($useempty) {
10922 10922
 				$out .= '<option value="0"></option>';
10923 10923
 			}
10924 10924
 
10925 10925
 			while ($obj = $this->db->fetch_object($resql)) {
10926
-				$out .= '<option ' . ($selected == $obj->rowid ? 'selected="selected"' : '') . ' value="' . $obj->rowid . '">' . price($obj->range_ik, 0, $langs, 1, 0) . '</option>';
10926
+				$out .= '<option '.($selected == $obj->rowid ? 'selected="selected"' : '').' value="'.$obj->rowid.'">'.price($obj->range_ik, 0, $langs, 1, 0).'</option>';
10927 10927
 			}
10928 10928
 			$out .= '</select>';
10929 10929
 		} else {
@@ -10954,12 +10954,12 @@  discard block
 block discarded – undo
10954 10954
 
10955 10955
 		$resql = $this->db->query($sql);
10956 10956
 		if ($resql) {
10957
-			$out = '<select id="select_' . $htmlname . '" name="' . $htmlname . '" class="' . $htmlname . ' flat minwidth75imp">';
10957
+			$out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp">';
10958 10958
 			if ($useempty) {
10959 10959
 				$out .= '<option value="0"></option>';
10960 10960
 			}
10961 10961
 			if ($allchoice) {
10962
-				$out .= '<option value="-1">' . $langs->trans('AllExpenseReport') . '</option>';
10962
+				$out .= '<option value="-1">'.$langs->trans('AllExpenseReport').'</option>';
10963 10963
 			}
10964 10964
 
10965 10965
 			$field = 'code';
@@ -10969,7 +10969,7 @@  discard block
 block discarded – undo
10969 10969
 
10970 10970
 			while ($obj = $this->db->fetch_object($resql)) {
10971 10971
 				$key = $langs->trans($obj->code);
10972
-				$out .= '<option ' . ($selected == $obj->{$field} ? 'selected="selected"' : '') . ' value="' . $obj->{$field} . '">' . ($key != $obj->code ? $key : $obj->label) . '</option>';
10972
+				$out .= '<option '.($selected == $obj->{$field} ? 'selected="selected"' : '').' value="'.$obj->{$field}.'">'.($key != $obj->code ? $key : $obj->label).'</option>';
10973 10973
 			}
10974 10974
 			$out .= '</select>';
10975 10975
 
@@ -11003,7 +11003,7 @@  discard block
 block discarded – undo
11003 11003
 	{
11004 11004
 		global $user, $conf, $langs;
11005 11005
 
11006
-		require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
11006
+		require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
11007 11007
 
11008 11008
 		if (is_null($usertofilter)) {
11009 11009
 			$usertofilter = $user;
@@ -11027,10 +11027,10 @@  discard block
 block discarded – undo
11027 11027
 		$sql = "SELECT f.rowid, f.ref as fref, 'nolabel' as flabel, p.rowid as pid, f.ref,
11028 11028
             p.title, p.fk_soc, p.fk_statut, p.public,";
11029 11029
 		$sql .= ' s.nom as name';
11030
-		$sql .= ' FROM ' . $this->db->prefix() . 'projet as p';
11031
-		$sql .= ' LEFT JOIN ' . $this->db->prefix() . 'societe as s ON s.rowid = p.fk_soc,';
11032
-		$sql .= ' ' . $this->db->prefix() . 'facture as f';
11033
-		$sql .= " WHERE p.entity IN (" . getEntity('project') . ")";
11030
+		$sql .= ' FROM '.$this->db->prefix().'projet as p';
11031
+		$sql .= ' LEFT JOIN '.$this->db->prefix().'societe as s ON s.rowid = p.fk_soc,';
11032
+		$sql .= ' '.$this->db->prefix().'facture as f';
11033
+		$sql .= " WHERE p.entity IN (".getEntity('project').")";
11034 11034
 		$sql .= " AND f.fk_projet = p.rowid AND f.fk_statut=0"; //Brouillons seulement
11035 11035
 		//if ($projectsListId) $sql.= " AND p.rowid IN (".$this->db->sanitize($projectsListId).")";
11036 11036
 		//if ($socid == 0) $sql.= " AND (p.fk_soc=0 OR p.fk_soc IS NULL)";
@@ -11041,14 +11041,14 @@  discard block
 block discarded – undo
11041 11041
 		if ($resql) {
11042 11042
 			// Use select2 selector
11043 11043
 			if (!empty($conf->use_javascript_ajax)) {
11044
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
11044
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
11045 11045
 				$comboenhancement = ajax_combobox($htmlname, array(), 0, $forcefocus);
11046 11046
 				$out .= $comboenhancement;
11047 11047
 				$morecss = 'minwidth200imp maxwidth500';
11048 11048
 			}
11049 11049
 
11050 11050
 			if (empty($option_only)) {
11051
-				$out .= '<select class="valignmiddle flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ' id="' . $htmlname . '" name="' . $htmlname . '">';
11051
+				$out .= '<select class="valignmiddle flat'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').' id="'.$htmlname.'" name="'.$htmlname.'">';
11052 11052
 			}
11053 11053
 			if (!empty($show_empty)) {
11054 11054
 				$out .= '<option value="0" class="optiongrey">';
@@ -11078,33 +11078,33 @@  discard block
 block discarded – undo
11078 11078
 						if ($showproject == 'all') {
11079 11079
 							$labeltoshow .= dol_trunc($obj->ref, 18); // Invoice ref
11080 11080
 							if ($obj->name) {
11081
-								$labeltoshow .= ' - ' . $obj->name; // Soc name
11081
+								$labeltoshow .= ' - '.$obj->name; // Soc name
11082 11082
 							}
11083 11083
 
11084 11084
 							$disabled = 0;
11085 11085
 							if ($obj->fk_statut == Project::STATUS_DRAFT) {
11086 11086
 								$disabled = 1;
11087
-								$labeltoshow .= ' - ' . $langs->trans("Draft");
11087
+								$labeltoshow .= ' - '.$langs->trans("Draft");
11088 11088
 							} elseif ($obj->fk_statut == Project::STATUS_CLOSED) {
11089 11089
 								if ($discard_closed == 2) {
11090 11090
 									$disabled = 1;
11091 11091
 								}
11092
-								$labeltoshow .= ' - ' . $langs->trans("Closed");
11092
+								$labeltoshow .= ' - '.$langs->trans("Closed");
11093 11093
 							} elseif ($socid > 0 && (!empty($obj->fk_soc) && $obj->fk_soc != $socid)) {
11094 11094
 								$disabled = 1;
11095
-								$labeltoshow .= ' - ' . $langs->trans("LinkedToAnotherCompany");
11095
+								$labeltoshow .= ' - '.$langs->trans("LinkedToAnotherCompany");
11096 11096
 							}
11097 11097
 						}
11098 11098
 
11099 11099
 						if (!empty($selected) && $selected == $obj->rowid) {
11100
-							$out .= '<option value="' . $obj->rowid . '" selected';
11100
+							$out .= '<option value="'.$obj->rowid.'" selected';
11101 11101
 							//if ($disabled) $out.=' disabled';						// with select2, field can't be preselected if disabled
11102
-							$out .= '>' . $labeltoshow . '</option>';
11102
+							$out .= '>'.$labeltoshow.'</option>';
11103 11103
 						} else {
11104 11104
 							if ($hideunselectables && $disabled && ($selected != $obj->rowid)) {
11105 11105
 								$resultat = '';
11106 11106
 							} else {
11107
-								$resultat = '<option value="' . $obj->rowid . '"';
11107
+								$resultat = '<option value="'.$obj->rowid.'"';
11108 11108
 								if ($disabled) {
11109 11109
 									$resultat .= ' disabled';
11110 11110
 								}
@@ -11156,22 +11156,22 @@  discard block
 block discarded – undo
11156 11156
 
11157 11157
 		$sql = 'SELECT f.rowid, f.entity, f.titre as title, f.suspended, f.fk_soc';
11158 11158
 		//$sql.= ', el.fk_source';
11159
-		$sql .= ' FROM ' . MAIN_DB_PREFIX . 'facture_rec as f';
11160
-		$sql .= " WHERE f.entity IN (" . getEntity('invoice') . ")";
11159
+		$sql .= ' FROM '.MAIN_DB_PREFIX.'facture_rec as f';
11160
+		$sql .= " WHERE f.entity IN (".getEntity('invoice').")";
11161 11161
 		$sql .= " ORDER BY f.titre ASC";
11162 11162
 
11163 11163
 		$resql = $this->db->query($sql);
11164 11164
 		if ($resql) {
11165 11165
 			// Use select2 selector
11166 11166
 			if (!empty($conf->use_javascript_ajax)) {
11167
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
11167
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
11168 11168
 				$comboenhancement = ajax_combobox($htmlname, array(), 0, $forcefocus);
11169 11169
 				$out .= $comboenhancement;
11170 11170
 				$morecss = 'minwidth200imp maxwidth500';
11171 11171
 			}
11172 11172
 
11173 11173
 			if (empty($option_only)) {
11174
-				$out .= '<select class="valignmiddle flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ' id="' . $htmlname . '" name="' . $htmlname . '">';
11174
+				$out .= '<select class="valignmiddle flat'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').' id="'.$htmlname.'" name="'.$htmlname.'">';
11175 11175
 			}
11176 11176
 			if (!empty($show_empty)) {
11177 11177
 				$out .= '<option value="0" class="optiongrey">';
@@ -11190,19 +11190,19 @@  discard block
 block discarded – undo
11190 11190
 					$disabled = 0;
11191 11191
 					if (!empty($obj->suspended)) {
11192 11192
 						$disabled = 1;
11193
-						$labeltoshow .= ' - ' . $langs->trans("Closed");
11193
+						$labeltoshow .= ' - '.$langs->trans("Closed");
11194 11194
 					}
11195 11195
 
11196 11196
 
11197 11197
 					if (!empty($selected) && $selected == $obj->rowid) {
11198
-						$out .= '<option value="' . $obj->rowid . '" selected';
11198
+						$out .= '<option value="'.$obj->rowid.'" selected';
11199 11199
 						//if ($disabled) $out.=' disabled';						// with select2, field can't be preselected if disabled
11200
-						$out .= '>' . $labeltoshow . '</option>';
11200
+						$out .= '>'.$labeltoshow.'</option>';
11201 11201
 					} else {
11202 11202
 						if ($disabled && ($selected != $obj->rowid)) {
11203 11203
 							$resultat = '';
11204 11204
 						} else {
11205
-							$resultat = '<option value="' . $obj->rowid . '"';
11205
+							$resultat = '<option value="'.$obj->rowid.'"';
11206 11206
 							if ($disabled) {
11207 11207
 								$resultat .= ' disabled';
11208 11208
 							}
@@ -11247,14 +11247,14 @@  discard block
 block discarded – undo
11247 11247
 		$formother = new FormOther($this->db);
11248 11248
 
11249 11249
 		if ($search_component_params_hidden != '' && !preg_match('/^\(.*\)$/', $search_component_params_hidden)) {    // If $search_component_params_hidden does not start and end with ()
11250
-			$search_component_params_hidden = '(' . $search_component_params_hidden . ')';
11250
+			$search_component_params_hidden = '('.$search_component_params_hidden.')';
11251 11251
 		}
11252 11252
 
11253 11253
 		$ret = '';
11254 11254
 
11255 11255
 		$ret .= '<div class="divadvancedsearchfieldcomp centpercent inline-block">';
11256 11256
 		$ret .= '<a href="#" class="dropdownsearch-toggle unsetcolor">';
11257
-		$ret .= '<span class="fas fa-filter linkobject boxfilter paddingright pictofixedwidth" title="' . dol_escape_htmltag($langs->trans("Filters")) . '" id="idsubimgproductdistribution"></span>';
11257
+		$ret .= '<span class="fas fa-filter linkobject boxfilter paddingright pictofixedwidth" title="'.dol_escape_htmltag($langs->trans("Filters")).'" id="idsubimgproductdistribution"></span>';
11258 11258
 		$ret .= '</a>';
11259 11259
 
11260 11260
 		$ret .= '<div class="divadvancedsearchfieldcompinput inline-block minwidth500 maxwidth300onsmartphone">';
@@ -11298,30 +11298,30 @@  discard block
 block discarded – undo
11298 11298
 			$ret .= '<input type="hidden" name="show_search_component_params_hidden" value="1">';
11299 11299
 		}
11300 11300
 		$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%')) -->";
11301
-		$ret .= '<input type="hidden" id="search_component_params_hidden" name="search_component_params_hidden" value="' . dol_escape_htmltag($search_component_params_hidden) . '">';
11301
+		$ret .= '<input type="hidden" id="search_component_params_hidden" name="search_component_params_hidden" value="'.dol_escape_htmltag($search_component_params_hidden).'">';
11302 11302
 		// $ret .= "<!-- sql= ".forgeSQLFromUniversalSearchCriteria($search_component_params_hidden, $errormessage)." -->";
11303 11303
 
11304 11304
 		// TODO : Use $arrayoffiltercriterias instead of $arrayofcriterias
11305 11305
 		// For compatibility with forms that show themself the search criteria in addition of this component, we output these fields
11306 11306
 		foreach ($arrayofcriterias as $criteria) {
11307 11307
 			foreach ($criteria as $criteriafamilykey => $criteriafamilyval) {
11308
-				if (in_array('search_' . $criteriafamilykey, $arrayofinputfieldsalreadyoutput)) {
11308
+				if (in_array('search_'.$criteriafamilykey, $arrayofinputfieldsalreadyoutput)) {
11309 11309
 					continue;
11310 11310
 				}
11311 11311
 				if (in_array($criteriafamilykey, array('rowid', 'ref_ext', 'entity', 'extraparams'))) {
11312 11312
 					continue;
11313 11313
 				}
11314 11314
 				if (in_array($criteriafamilyval['type'], array('date', 'datetime', 'timestamp'))) {
11315
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_start">';
11316
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_startyear">';
11317
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_startmonth">';
11318
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_startday">';
11319
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_end">';
11320
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_endyear">';
11321
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_endmonth">';
11322
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_endday">';
11315
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_start">';
11316
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_startyear">';
11317
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_startmonth">';
11318
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_startday">';
11319
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_end">';
11320
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_endyear">';
11321
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_endmonth">';
11322
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_endday">';
11323 11323
 				} else {
11324
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '">';
11324
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'">';
11325 11325
 				}
11326 11326
 			}
11327 11327
 		}
@@ -11329,7 +11329,7 @@  discard block
 block discarded – undo
11329 11329
 		$ret .= '</div>';
11330 11330
 
11331 11331
 		$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";
11332
-		$ret .= '<input type="text" placeholder="' . $langs->trans("Filters") . '" id="search_component_params_input" name="search_component_params_input" class="noborderbottom search_component_input" value="">';
11332
+		$ret .= '<input type="text" placeholder="'.$langs->trans("Filters").'" id="search_component_params_input" name="search_component_params_input" class="noborderbottom search_component_input" value="">';
11333 11333
 
11334 11334
 		$ret .= '</div>';
11335 11335
 		$ret .= '</div>';
@@ -11386,7 +11386,7 @@  discard block
 block discarded – undo
11386 11386
 		// Convert $arrayoffiltercriterias into a json object that can be used in jquery to build the search component dynamically
11387 11387
 		$arrayoffiltercriterias_json = json_encode($arrayoffiltercriterias);
11388 11388
 		$ret .= '<script>
11389
-			var arrayoffiltercriterias = ' . $arrayoffiltercriterias_json . ';
11389
+			var arrayoffiltercriterias = ' . $arrayoffiltercriterias_json.';
11390 11390
 		</script>';
11391 11391
 
11392 11392
 
@@ -11400,9 +11400,9 @@  discard block
 block discarded – undo
11400 11400
 		$ret .= '<div class="search-component-assistance">';
11401 11401
 		$ret .= '<div>';
11402 11402
 
11403
-		$ret .= '<p class="assistance-title">' . img_picto('', 'filter') . ' ' . $langs->trans('FilterAssistance') . ' </p>';
11403
+		$ret .= '<p class="assistance-title">'.img_picto('', 'filter').' '.$langs->trans('FilterAssistance').' </p>';
11404 11404
 
11405
-		$ret .= '<p class="assistance-errors error" style="display:none">' . $langs->trans('AllFieldsRequired') . ' </p>';
11405
+		$ret .= '<p class="assistance-errors error" style="display:none">'.$langs->trans('AllFieldsRequired').' </p>';
11406 11406
 
11407 11407
 		$ret .= '<div class="operand">';
11408 11408
 		$ret .= $form->selectarray('search_filter_field', $arrayoffilterfieldslabel, '', $langs->trans("Fields"), 0, 0, '', 0, 0, 0, '', 'width250', 1);
@@ -11416,7 +11416,7 @@  discard block
 block discarded – undo
11416 11416
 		$ret .= '</select>';
11417 11417
 		$ret .= '<script>$(document).ready(function() {';
11418 11418
 		$ret .= '   $(".operator-selector").select2({';
11419
-		$ret .= '       placeholder: \'' . dol_escape_js($langs->trans('Operator')) . '\'';
11419
+		$ret .= '       placeholder: \''.dol_escape_js($langs->trans('Operator')).'\'';
11420 11420
 		$ret .= '   });';
11421 11421
 		$ret .= '});</script>';
11422 11422
 		$ret .= '</div>';
@@ -11425,12 +11425,12 @@  discard block
 block discarded – undo
11425 11425
 
11426 11426
 		$ret .= '<div class="value">';
11427 11427
 		// Input field for entering values
11428
-		$ret .= '<input type="text" class="flat width100 value-input" placeholder="' . dolPrintHTML($langs->trans('Value')) . '">';
11428
+		$ret .= '<input type="text" class="flat width100 value-input" placeholder="'.dolPrintHTML($langs->trans('Value')).'">';
11429 11429
 
11430 11430
 		// Date selector
11431 11431
 		$dateOne = '';
11432 11432
 		$ret .= '<span class="date-one" style="display:none">';
11433
-		$ret .=  $form->selectDate(($dateOne ? $dateOne : -1), 'dateone', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '');
11433
+		$ret .= $form->selectDate(($dateOne ? $dateOne : -1), 'dateone', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '');
11434 11434
 		$ret .= '</span>';
11435 11435
 
11436 11436
 		// Value selector (will be populated dynamically) based on search_filter_field value if a selected value has an array of values
@@ -11439,7 +11439,7 @@  discard block
 block discarded – undo
11439 11439
 		$ret .= '<script>
11440 11440
 			$(document).ready(function() {
11441 11441
 				$("#value-selector").select2({
11442
-					placeholder: "' . dol_escape_js($langs->trans('Value')) . '"
11442
+					placeholder: "' . dol_escape_js($langs->trans('Value')).'"
11443 11443
 				});
11444 11444
 				$("#value-selector").hide();
11445 11445
 				$("#value-selector").next(".select2-container").hide();
@@ -11449,7 +11449,7 @@  discard block
 block discarded – undo
11449 11449
 		$ret .= '</div>';
11450 11450
 
11451 11451
 		$ret .= '<div class="btn-div">';
11452
-		$ret .= '<button class="button buttongen button-save add-filter-btn" type="button">' . $langs->trans("addToFilter") . '</button>';
11452
+		$ret .= '<button class="button buttongen button-save add-filter-btn" type="button">'.$langs->trans("addToFilter").'</button>';
11453 11453
 		$ret .= '</div>';
11454 11454
 
11455 11455
 		$ret .= '</div>';
@@ -11615,7 +11615,7 @@  discard block
 block discarded – undo
11615 11615
 
11616 11616
 		$TModels = array();
11617 11617
 
11618
-		include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php';
11618
+		include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
11619 11619
 		$formmail = new FormMail($this->db);
11620 11620
 		$result = $formmail->fetchAllEMailTemplate($modelType, $user, $langs);
11621 11621
 
@@ -11628,20 +11628,20 @@  discard block
 block discarded – undo
11628 11628
 			}
11629 11629
 		}
11630 11630
 
11631
-		$retstring .= '<select class="flat" id="select_' . $prefix . 'model_mail" name="' . $prefix . 'model_mail">';
11631
+		$retstring .= '<select class="flat" id="select_'.$prefix.'model_mail" name="'.$prefix.'model_mail">';
11632 11632
 
11633 11633
 		foreach ($TModels as $id_model => $label_model) {
11634
-			$retstring .= '<option value="' . $id_model . '"';
11634
+			$retstring .= '<option value="'.$id_model.'"';
11635 11635
 			if (!empty($selected) && $selected == $id_model) {
11636 11636
 				$retstring .= "selected";
11637 11637
 			}
11638
-			$retstring .= ">" . $label_model . "</option>";
11638
+			$retstring .= ">".$label_model."</option>";
11639 11639
 		}
11640 11640
 
11641 11641
 		$retstring .= "</select>";
11642 11642
 
11643 11643
 		if ($addjscombo) {
11644
-			$retstring .= ajax_combobox('select_' . $prefix . 'model_mail');
11644
+			$retstring .= ajax_combobox('select_'.$prefix.'model_mail');
11645 11645
 		}
11646 11646
 
11647 11647
 		return $retstring;
@@ -11692,16 +11692,16 @@  discard block
 block discarded – undo
11692 11692
 
11693 11693
 		foreach ($buttons as $button) {
11694 11694
 			$addclass = empty($button['addclass']) ? '' : $button['addclass'];
11695
-			$retstring .= '<input type="submit" class="button button-' . $button['name'] . ($morecss ? ' ' . $morecss : '') . ' ' . $addclass . '" name="' . $button['name'] . '" value="' . dol_escape_htmltag($langs->transnoentities($button['label_key'])) . '">';
11695
+			$retstring .= '<input type="submit" class="button button-'.$button['name'].($morecss ? ' '.$morecss : '').' '.$addclass.'" name="'.$button['name'].'" value="'.dol_escape_htmltag($langs->transnoentities($button['label_key'])).'">';
11696 11696
 		}
11697 11697
 		$retstring .= $withoutdiv ? '' : '</div>';
11698 11698
 
11699 11699
 		if ($dol_openinpopup) {
11700
-			$retstring .= '<!-- buttons are shown into a $dol_openinpopup=' . dol_escape_htmltag($dol_openinpopup) . ' context, so we enable the close of dialog on cancel -->' . "\n";
11701
-			$retstring .= '<script nonce="' . getNonce() . '">';
11700
+			$retstring .= '<!-- buttons are shown into a $dol_openinpopup='.dol_escape_htmltag($dol_openinpopup).' context, so we enable the close of dialog on cancel -->'."\n";
11701
+			$retstring .= '<script nonce="'.getNonce().'">';
11702 11702
 			$retstring .= 'jQuery(".button-cancel").click(function(e) {
11703
-				e.preventDefault(); console.log(\'We click on cancel in iframe popup ' . dol_escape_js($dol_openinpopup) . '\');
11704
-				window.parent.jQuery(\'#idfordialog' . dol_escape_js($dol_openinpopup) . '\').dialog(\'close\');
11703
+				e.preventDefault(); console.log(\'We click on cancel in iframe popup ' . dol_escape_js($dol_openinpopup).'\');
11704
+				window.parent.jQuery(\'#idfordialog' . dol_escape_js($dol_openinpopup).'\').dialog(\'close\');
11705 11705
 				 });';
11706 11706
 			$retstring .= '</script>';
11707 11707
 		}
@@ -11730,7 +11730,7 @@  discard block
 block discarded – undo
11730 11730
 		dol_syslog(__METHOD__, LOG_DEBUG);
11731 11731
 
11732 11732
 		$sql = "SELECT rowid, code, label as label";
11733
-		$sql .= " FROM " . MAIN_DB_PREFIX . 'c_invoice_subtype';
11733
+		$sql .= " FROM ".MAIN_DB_PREFIX.'c_invoice_subtype';
11734 11734
 		$sql .= " WHERE active = 1";
11735 11735
 
11736 11736
 		$resql = $this->db->query($sql);
@@ -11741,7 +11741,7 @@  discard block
 block discarded – undo
11741 11741
 				$obj = $this->db->fetch_object($resql);
11742 11742
 
11743 11743
 				// If translation exists, we use it, otherwise we take the default wording
11744
-				$label = ($langs->trans("InvoiceSubtype" . $obj->rowid) != "InvoiceSubtype" . $obj->rowid) ? $langs->trans("InvoiceSubtype" . $obj->rowid) : (($obj->label != '-') ? $obj->label : '');
11744
+				$label = ($langs->trans("InvoiceSubtype".$obj->rowid) != "InvoiceSubtype".$obj->rowid) ? $langs->trans("InvoiceSubtype".$obj->rowid) : (($obj->label != '-') ? $obj->label : '');
11745 11745
 				$this->cache_invoice_subtype[$obj->rowid]['rowid'] = $obj->rowid;
11746 11746
 				$this->cache_invoice_subtype[$obj->rowid]['code'] = $obj->code;
11747 11747
 				$this->cache_invoice_subtype[$obj->rowid]['label'] = $label;
@@ -11773,18 +11773,18 @@  discard block
 block discarded – undo
11773 11773
 		global $langs, $user;
11774 11774
 
11775 11775
 		$out = '';
11776
-		dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG);
11776
+		dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG);
11777 11777
 
11778 11778
 		$this->load_cache_invoice_subtype();
11779 11779
 
11780
-		$out .= '<select id="' . $htmlname . '" class="flat selectsubtype' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">';
11780
+		$out .= '<select id="'.$htmlname.'" class="flat selectsubtype'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
11781 11781
 		if ($addempty) {
11782 11782
 			$out .= '<option value="0">&nbsp;</option>';
11783 11783
 		}
11784 11784
 
11785 11785
 		foreach ($this->cache_invoice_subtype as $rowid => $subtype) {
11786 11786
 			$label = $subtype['label'];
11787
-			$out .= '<option value="' . $subtype['rowid'] . '"';
11787
+			$out .= '<option value="'.$subtype['rowid'].'"';
11788 11788
 			if ($selected == $subtype['rowid']) {
11789 11789
 				$out .= ' selected="selected"';
11790 11790
 			}
Please login to merge, or discard this patch.
htdocs/projet/tasks/time.php 1 patch
Spacing   +173 added lines, -173 removed lines patch added patch discarded remove patch
@@ -33,14 +33,14 @@  discard block
 block discarded – undo
33 33
 
34 34
 // Load Dolibarr environment
35 35
 require '../../main.inc.php';
36
-require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
37
-require_once DOL_DOCUMENT_ROOT . '/projet/class/task.class.php';
38
-require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
39
-require_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php';
40
-require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
41
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
42
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php';
43
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formintervention.class.php';
36
+require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
37
+require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php';
38
+require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
39
+require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
40
+require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
41
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
42
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
43
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formintervention.class.php';
44 44
 
45 45
 /**
46 46
  * @var Conf $conf
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
 	setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
177 177
 }
178 178
 
179
-include DOL_DOCUMENT_ROOT . '/core/actions_changeselectedfields.inc.php';
179
+include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
180 180
 
181 181
 // Purge search criteria
182 182
 if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers
@@ -358,10 +358,10 @@  discard block
 block discarded – undo
358 358
 }
359 359
 
360 360
 if ($action == 'confirm_deleteline' && $confirm == "yes" && ($user->hasRight('projet', 'time') || $user->hasRight('projet', 'all', 'creer'))) {
361
-	$object->fetchTimeSpent(GETPOSTINT('lineid'));    // load properties like $object->timespent_xxx
361
+	$object->fetchTimeSpent(GETPOSTINT('lineid')); // load properties like $object->timespent_xxx
362 362
 
363 363
 	if (in_array($object->timespent_fk_user, $childids) || $user->hasRight('projet', 'all', 'creer')) {
364
-		$result = $object->delTimeSpent($user);    // delete line with $object->timespent_id
364
+		$result = $object->delTimeSpent($user); // delete line with $object->timespent_id
365 365
 
366 366
 		if ($result < 0) {
367 367
 			$langs->load("errors");
@@ -381,7 +381,7 @@  discard block
 block discarded – undo
381 381
 		if (count($tasksarray) > 0) {
382 382
 			$id = $tasksarray[0]->id;
383 383
 		} else {
384
-			header("Location: " . DOL_URL_ROOT . '/projet/tasks.php?id=' . $projectstatic->id . ($withproject ? '&withproject=1' : '') . (empty($mode) ? '' : '&mode=' . $mode));
384
+			header("Location: ".DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.($withproject ? '&withproject=1' : '').(empty($mode) ? '' : '&mode='.$mode));
385 385
 			exit;
386 386
 		}
387 387
 	}
@@ -418,9 +418,9 @@  discard block
 block discarded – undo
418 418
 	if (!($projectstatic->thirdparty->id > 0)) {
419 419
 		setEventMessages($langs->trans("ThirdPartyRequiredToGenerateInvoice"), null, 'errors');
420 420
 	} else {
421
-		include_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
422
-		include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
423
-		include_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
421
+		include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
422
+		include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
423
+		include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
424 424
 
425 425
 		$tmpinvoice = new Facture($db);
426 426
 		$tmptimespent = new Task($db);
@@ -486,7 +486,7 @@  discard block
 block discarded – undo
486 486
 				$arrayoftasks = array();
487 487
 				foreach ($toselect as $key => $value) {
488 488
 					// Get userid, timepent
489
-					$object->fetchTimeSpent($value);    // $value is ID of 1 line in timespent table
489
+					$object->fetchTimeSpent($value); // $value is ID of 1 line in timespent table
490 490
 					$arrayoftasks[$object->timespent_fk_user][(int) $object->timespent_fk_product]['timespent'] += $object->timespent_duration;
491 491
 					$arrayoftasks[$object->timespent_fk_user][(int) $object->timespent_fk_product]['totalvaluetodivideby3600'] += ($object->timespent_duration * $object->timespent_thm);
492 492
 				}
@@ -559,7 +559,7 @@  discard block
 block discarded – undo
559 559
 						}
560 560
 
561 561
 						// Add lines
562
-						$lineid = $tmpinvoice->addline($langs->trans("TimeSpentForInvoice", $username) . ' : ' . $qtyhourtext, $pu_htline, round($qtyhour / $prodDurationHours, 2), $txtvaline, $localtax1line, $localtax2line, ($idprodline > 0 ? $idprodline : 0), $remiseproject);
562
+						$lineid = $tmpinvoice->addline($langs->trans("TimeSpentForInvoice", $username).' : '.$qtyhourtext, $pu_htline, round($qtyhour / $prodDurationHours, 2), $txtvaline, $localtax1line, $localtax2line, ($idprodline > 0 ? $idprodline : 0), $remiseproject);
563 563
 						if ($lineid < 0) {
564 564
 							$error++;
565 565
 							setEventMessages(null, $tmpinvoice->errors, 'errors');
@@ -592,16 +592,16 @@  discard block
 block discarded – undo
592 592
 
593 593
 					$arrayoftasks[$object->timespent_id]['timespent'] = $object->timespent_duration;
594 594
 					$arrayoftasks[$object->timespent_id]['totalvaluetodivideby3600'] = $object->timespent_duration * $object->timespent_thm;
595
-					$arrayoftasks[$object->timespent_id]['note'] = $ftask->ref . ' - ' . $ftask->label . ' - ' . $username;
595
+					$arrayoftasks[$object->timespent_id]['note'] = $ftask->ref.' - '.$ftask->label.' - '.$username;
596 596
 					$arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $object->timespent_note);
597 597
 
598 598
 					if (!empty($withdetail)) {
599 599
 						if (!empty($object->timespent_withhour)) {
600
-							$arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Date") . ': ' . dol_print_date($object->timespent_datehour));
600
+							$arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Date").': '.dol_print_date($object->timespent_datehour));
601 601
 						} else {
602
-							$arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Date") . ': ' . dol_print_date($object->timespent_date));
602
+							$arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Date").': '.dol_print_date($object->timespent_date));
603 603
 						}
604
-						$arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Duration") . ': ' . convertSecondToTime($object->timespent_duration, 'all', $conf->global->MAIN_DURATION_OF_WORKDAY));
604
+						$arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Duration").': '.convertSecondToTime($object->timespent_duration, 'all', $conf->global->MAIN_DURATION_OF_WORKDAY));
605 605
 					}
606 606
 					$arrayoftasks[$object->timespent_id]['user'] = $object->timespent_fk_user;
607 607
 					$arrayoftasks[$object->timespent_id]['fk_product'] = $object->timespent_fk_product;
@@ -679,7 +679,7 @@  discard block
 block discarded – undo
679 679
 				$arrayoftasks = array();
680 680
 				foreach ($toselect as $key => $value) {
681 681
 					// Get userid, timepent
682
-					$object->fetchTimeSpent($value);        // Call method to get list of timespent for a timespent line id (We use the utiliy method found into Task object)
682
+					$object->fetchTimeSpent($value); // Call method to get list of timespent for a timespent line id (We use the utiliy method found into Task object)
683 683
 					// $object->id is now the task id
684 684
 					$arrayoftasks[$object->id][(int) $object->timespent_fk_product]['timespent'] += $object->timespent_duration;
685 685
 					$arrayoftasks[$object->id][(int) $object->timespent_fk_product]['totalvaluetodivideby3600'] += ($object->timespent_duration * $object->timespent_thm);
@@ -755,7 +755,7 @@  discard block
 block discarded – undo
755 755
 						// Add lines
756 756
 						$date_start = '';
757 757
 						$date_end = '';
758
-						$lineName = $ftask->ref . ' - ' . $ftask->label;
758
+						$lineName = $ftask->ref.' - '.$ftask->label;
759 759
 						$lineid = $tmpinvoice->addline($lineName, $pu_ht_for_task, price2num($qtyhour / $prodDurationHours, 'MS'), $txtvaline, $localtax1line, $localtax2line, ($idprodline > 0 ? $idprodline : 0), $remiseproject, $date_start, $date_end, 0, 0, '', 'HT', 0, 1, -1, 0, '', 0, 0, null, $pa_ht);
760 760
 						if ($lineid < 0) {
761 761
 							$error++;
@@ -765,8 +765,8 @@  discard block
 block discarded – undo
765 765
 
766 766
 						if (!$error) {
767 767
 							// Update lineid into line of timespent
768
-							$sql = 'UPDATE ' . MAIN_DB_PREFIX . 'element_time SET invoice_line_id = ' . ((int) $lineid) . ', invoice_id = ' . ((int) $tmpinvoice->id);
769
-							$sql .= ' WHERE rowid IN (' . $db->sanitize(implode(',', $toselect)) . ')';
768
+							$sql = 'UPDATE '.MAIN_DB_PREFIX.'element_time SET invoice_line_id = '.((int) $lineid).', invoice_id = '.((int) $tmpinvoice->id);
769
+							$sql .= ' WHERE rowid IN ('.$db->sanitize(implode(',', $toselect)).')';
770 770
 							$result = $db->query($sql);
771 771
 							if (!$result) {
772 772
 								$error++;
@@ -802,12 +802,12 @@  discard block
 block discarded – undo
802 802
 	if (!($projectstatic->thirdparty->id > 0)) {
803 803
 		setEventMessages($langs->trans("ThirdPartyRequiredToGenerateIntervention"), null, 'errors');
804 804
 	} else {
805
-		include_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
806
-		include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
807
-		include_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
805
+		include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
806
+		include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
807
+		include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
808 808
 
809 809
 
810
-		require_once DOL_DOCUMENT_ROOT . '/fichinter/class/fichinter.class.php';
810
+		require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php';
811 811
 		$tmpinter = new Fichinter($db);
812 812
 		$tmptimespent = new Task($db);
813 813
 		$fuser = new User($db);
@@ -819,7 +819,7 @@  discard block
 block discarded – undo
819 819
 		$tmpinter->socid = $projectstatic->thirdparty->id;
820 820
 		$tmpinter->date = dol_mktime(GETPOSTINT('rehour'), GETPOSTINT('remin'), GETPOSTINT('resec'), GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'));
821 821
 		$tmpinter->fk_project = $projectstatic->id;
822
-		$tmpinter->description = $projectstatic->title . (!empty($projectstatic->description) ? '-' . $projectstatic->label : '');
822
+		$tmpinter->description = $projectstatic->title.(!empty($projectstatic->description) ? '-'.$projectstatic->label : '');
823 823
 
824 824
 		if ($interToUse) {
825 825
 			$tmpinter->fetch($interToUse);
@@ -852,7 +852,7 @@  discard block
 block discarded – undo
852 852
 				$qtyhourtext = convertSecondToTime($value['timespent'], 'all', $conf->global->MAIN_DURATION_OF_WORKDAY);
853 853
 
854 854
 				// Add lines
855
-				$lineid = $tmpinter->addline($user, $tmpinter->id, $ftask->label . (!empty($value['note']) ? ' - ' . $value['note'] : ''), $value['date'], $value['timespent']);
855
+				$lineid = $tmpinter->addline($user, $tmpinter->id, $ftask->label.(!empty($value['note']) ? ' - '.$value['note'] : ''), $value['date'], $value['timespent']);
856 856
 			}
857 857
 		}
858 858
 
@@ -883,9 +883,9 @@  discard block
 block discarded – undo
883 883
 //$result = $projectstatic->fetch($object->fk_project);
884 884
 $arrayofselected = is_array($toselect) ? $toselect : array();
885 885
 
886
-$title = $object->ref . ' - ' . $langs->trans("TimeSpent");
886
+$title = $object->ref.' - '.$langs->trans("TimeSpent");
887 887
 if (!empty($withproject)) {
888
-	$title .= ' | ' . $langs->trans("Project") . (!empty($projectstatic->ref) ? ': ' . $projectstatic->ref : '');
888
+	$title .= ' | '.$langs->trans("Project").(!empty($projectstatic->ref) ? ': '.$projectstatic->ref : '');
889 889
 }
890 890
 $help_url = '';
891 891
 
@@ -934,13 +934,13 @@  discard block
 block discarded – undo
934 934
 
935 935
 			$param = ((!empty($mode) && $mode == 'mine') ? '&mode=mine' : '');
936 936
 			if ($search_user) {
937
-				$param .= '&search_user=' . ((int) $search_user);
937
+				$param .= '&search_user='.((int) $search_user);
938 938
 			}
939 939
 			if ($search_month) {
940
-				$param .= '&search_month=' . ((int) $search_month);
940
+				$param .= '&search_month='.((int) $search_month);
941 941
 			}
942 942
 			if ($search_year) {
943
-				$param .= '&search_year=' . ((int) $search_year);
943
+				$param .= '&search_year='.((int) $search_year);
944 944
 			}
945 945
 
946 946
 			// Project card
@@ -952,14 +952,14 @@  discard block
 block discarded – undo
952 952
 			$morehtmlref .= $projectstatic->title;
953 953
 			// Thirdparty
954 954
 			if (!empty($projectstatic->thirdparty->id) && $projectstatic->thirdparty->id > 0) {
955
-				$morehtmlref .= '<br>' . $projectstatic->thirdparty->getNomUrl(1, 'project');
955
+				$morehtmlref .= '<br>'.$projectstatic->thirdparty->getNomUrl(1, 'project');
956 956
 			}
957 957
 			$morehtmlref .= '</div>';
958 958
 
959 959
 			// Define a complementary filter for search of next/prev ref.
960 960
 			if (!$user->hasRight('projet', 'all', 'lire')) {
961 961
 				$objectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 0);
962
-				$projectstatic->next_prev_filter = "rowid:IN:" . $db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0');
962
+				$projectstatic->next_prev_filter = "rowid:IN:".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0');
963 963
 			}
964 964
 
965 965
 			dol_banner_tab($projectstatic, 'project_ref', $linkback, 1, 'ref', 'ref', $morehtmlref, $param);
@@ -977,25 +977,25 @@  discard block
 block discarded – undo
977 977
 				print '</td>';
978 978
 				print '<td>';
979 979
 				if (getDolGlobalString('PROJECT_USE_OPPORTUNITIES')) {
980
-					print '<input type="checkbox" disabled name="usage_opportunity"' . (GETPOSTISSET('usage_opportunity') ? (GETPOST('usage_opportunity', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_opportunity ? ' checked="checked"' : '')) . '"> ';
980
+					print '<input type="checkbox" disabled name="usage_opportunity"'.(GETPOSTISSET('usage_opportunity') ? (GETPOST('usage_opportunity', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_opportunity ? ' checked="checked"' : '')).'"> ';
981 981
 					$htmltext = $langs->trans("ProjectFollowOpportunity");
982 982
 					print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext);
983 983
 					print '<br>';
984 984
 				}
985 985
 				if (!getDolGlobalString('PROJECT_HIDE_TASKS')) {
986
-					print '<input type="checkbox" disabled name="usage_task"' . (GETPOSTISSET('usage_task') ? (GETPOST('usage_task', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_task ? ' checked="checked"' : '')) . '"> ';
986
+					print '<input type="checkbox" disabled name="usage_task"'.(GETPOSTISSET('usage_task') ? (GETPOST('usage_task', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_task ? ' checked="checked"' : '')).'"> ';
987 987
 					$htmltext = $langs->trans("ProjectFollowTasks");
988 988
 					print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext);
989 989
 					print '<br>';
990 990
 				}
991 991
 				if (!getDolGlobalString('PROJECT_HIDE_TASKS') && getDolGlobalString('PROJECT_BILL_TIME_SPENT')) {
992
-					print '<input type="checkbox" disabled name="usage_bill_time"' . (GETPOSTISSET('usage_bill_time') ? (GETPOST('usage_bill_time', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_bill_time ? ' checked="checked"' : '')) . '"> ';
992
+					print '<input type="checkbox" disabled name="usage_bill_time"'.(GETPOSTISSET('usage_bill_time') ? (GETPOST('usage_bill_time', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_bill_time ? ' checked="checked"' : '')).'"> ';
993 993
 					$htmltext = $langs->trans("ProjectBillTimeDescription");
994 994
 					print $form->textwithpicto($langs->trans("BillTime"), $htmltext);
995 995
 					print '<br>';
996 996
 				}
997 997
 				if (isModEnabled('eventorganization')) {
998
-					print '<input type="checkbox" disabled name="usage_organize_event"' . (GETPOSTISSET('usage_organize_event') ? (GETPOST('usage_organize_event', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_organize_event ? ' checked="checked"' : '')) . '"> ';
998
+					print '<input type="checkbox" disabled name="usage_organize_event"'.(GETPOSTISSET('usage_organize_event') ? (GETPOST('usage_organize_event', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_organize_event ? ' checked="checked"' : '')).'"> ';
999 999
 					$htmltext = $langs->trans("EventOrganizationDescriptionLong");
1000 1000
 					print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext);
1001 1001
 				}
@@ -1003,7 +1003,7 @@  discard block
 block discarded – undo
1003 1003
 			}
1004 1004
 
1005 1005
 			// Visibility
1006
-			print '<tr><td class="titlefield">' . $langs->trans("Visibility") . '</td><td>';
1006
+			print '<tr><td class="titlefield">'.$langs->trans("Visibility").'</td><td>';
1007 1007
 			if ($projectstatic->public) {
1008 1008
 				print img_picto($langs->trans('SharedProject'), 'world', 'class="paddingrightonly"');
1009 1009
 				print $langs->trans('SharedProject');
@@ -1014,14 +1014,14 @@  discard block
 block discarded – undo
1014 1014
 			print '</td></tr>';
1015 1015
 
1016 1016
 			// Budget
1017
-			print '<tr><td>' . $langs->trans("Budget") . '</td><td>';
1017
+			print '<tr><td>'.$langs->trans("Budget").'</td><td>';
1018 1018
 			if (!is_null($projectstatic->budget_amount) && strcmp($projectstatic->budget_amount, '')) {
1019
-				print '<span class="amount">' . price($projectstatic->budget_amount, 0, $langs, 1, 0, 0, $conf->currency) . '</span>';
1019
+				print '<span class="amount">'.price($projectstatic->budget_amount, 0, $langs, 1, 0, 0, $conf->currency).'</span>';
1020 1020
 			}
1021 1021
 			print '</td></tr>';
1022 1022
 
1023 1023
 			// Date start - end project
1024
-			print '<tr><td>' . $langs->trans("Dates") . '</td><td>';
1024
+			print '<tr><td>'.$langs->trans("Dates").'</td><td>';
1025 1025
 			$start = dol_print_date($projectstatic->date_start, 'day');
1026 1026
 			print($start ? $start : '?');
1027 1027
 			$end = dol_print_date($projectstatic->date_end, 'day');
@@ -1036,7 +1036,7 @@  discard block
 block discarded – undo
1036 1036
 			$cols = 2;
1037 1037
 			$savobject = $object;
1038 1038
 			$object = $projectstatic;
1039
-			include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
1039
+			include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
1040 1040
 			$object = $savobject;
1041 1041
 
1042 1042
 			print '</table>';
@@ -1054,7 +1054,7 @@  discard block
 block discarded – undo
1054 1054
 
1055 1055
 			// Categories
1056 1056
 			if (isModEnabled('category')) {
1057
-				print '<tr><td class="valignmiddle">' . $langs->trans("Categories") . '</td><td>';
1057
+				print '<tr><td class="valignmiddle">'.$langs->trans("Categories").'</td><td>';
1058 1058
 				print $form->showCategories($projectstatic->id, 'project', 1);
1059 1059
 				print "</td></tr>";
1060 1060
 			}
@@ -1083,12 +1083,12 @@  discard block
 block discarded – undo
1083 1083
 
1084 1084
 				if (!empty($projectidforalltimes)) {
1085 1085
 					// We are on tab 'Time Spent' of project
1086
-					$backtourl = $_SERVER['PHP_SELF'] . '?projectid=' . $projectstatic->id . ($withproject ? '&withproject=1' : '');
1087
-					$linktocreatetimeUrl = $_SERVER['PHP_SELF'] . '?' . ($withproject ? 'withproject=1' : '') . '&projectid=' . $projectstatic->id . '&action=createtime&token=' . newToken() . $param . '&backtopage=' . urlencode($backtourl);
1086
+					$backtourl = $_SERVER['PHP_SELF'].'?projectid='.$projectstatic->id.($withproject ? '&withproject=1' : '');
1087
+					$linktocreatetimeUrl = $_SERVER['PHP_SELF'].'?'.($withproject ? 'withproject=1' : '').'&projectid='.$projectstatic->id.'&action=createtime&token='.newToken().$param.'&backtopage='.urlencode($backtourl);
1088 1088
 				} else {
1089 1089
 					// We are on tab 'Time Spent' of task
1090
-					$backtourl = $_SERVER['PHP_SELF'] . '?id=' . $object->id . ($withproject ? '&withproject=1' : '');
1091
-					$linktocreatetimeUrl = $_SERVER['PHP_SELF'] . '?' . ($withproject ? 'withproject=1' : '') . ($object->id > 0 ? '&id=' . $object->id : '&projectid=' . $projectstatic->id) . '&action=createtime&token=' . newToken() . $param . '&backtopage=' . urlencode($backtourl);
1090
+					$backtourl = $_SERVER['PHP_SELF'].'?id='.$object->id.($withproject ? '&withproject=1' : '');
1091
+					$linktocreatetimeUrl = $_SERVER['PHP_SELF'].'?'.($withproject ? 'withproject=1' : '').($object->id > 0 ? '&id='.$object->id : '&projectid='.$projectstatic->id).'&action=createtime&token='.newToken().$param.'&backtopage='.urlencode($backtourl);
1092 1092
 				}
1093 1093
 			} else {
1094 1094
 				$linktocreatetimeBtnStatus = -2;
@@ -1133,19 +1133,19 @@  discard block
 block discarded – undo
1133 1133
 		print dol_get_fiche_head($head, 'task_time', $langs->trans("Task"), -1, 'projecttask', 0, '', 'reposition');
1134 1134
 
1135 1135
 		if ($action == 'deleteline') {
1136
-			$urlafterconfirm = $_SERVER["PHP_SELF"] . "?" . ($object->id > 0 ? "id=" . $object->id : 'projectid=' . $projectstatic->id) . '&lineid=' . GETPOSTINT("lineid") . ($withproject ? '&withproject=1' : '');
1136
+			$urlafterconfirm = $_SERVER["PHP_SELF"]."?".($object->id > 0 ? "id=".$object->id : 'projectid='.$projectstatic->id).'&lineid='.GETPOSTINT("lineid").($withproject ? '&withproject=1' : '');
1137 1137
 			print $form->formconfirm($urlafterconfirm, $langs->trans("DeleteATimeSpent"), $langs->trans("ConfirmDeleteATimeSpent"), "confirm_deleteline", '', '', 1);
1138 1138
 		}
1139 1139
 
1140 1140
 		$param = ($withproject ? '&withproject=1' : '');
1141
-		$param .= ($param ? '&' : '') . 'id=' . $object->id;        // ID of task
1142
-		$linkback = $withproject ? '<a href="' . DOL_URL_ROOT . '/projet/tasks.php?id=' . $projectstatic->id . '">' . $langs->trans("BackToList") . '</a>' : '';
1141
+		$param .= ($param ? '&' : '').'id='.$object->id; // ID of task
1142
+		$linkback = $withproject ? '<a href="'.DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.'">'.$langs->trans("BackToList").'</a>' : '';
1143 1143
 
1144 1144
 		if (!GETPOST('withproject') || empty($projectstatic->id)) {
1145 1145
 			$projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1);
1146
-			$object->next_prev_filter = "fk_projet:IN:" . $db->sanitize($projectsListId);
1146
+			$object->next_prev_filter = "fk_projet:IN:".$db->sanitize($projectsListId);
1147 1147
 		} else {
1148
-			$object->next_prev_filter = "fk_projet:=:" . ((int) $projectstatic->id);
1148
+			$object->next_prev_filter = "fk_projet:=:".((int) $projectstatic->id);
1149 1149
 		}
1150 1150
 
1151 1151
 		$morehtmlref = '';
@@ -1153,12 +1153,12 @@  discard block
 block discarded – undo
1153 1153
 		// Project
1154 1154
 		if (empty($withproject)) {
1155 1155
 			$morehtmlref .= '<div class="refidno">';
1156
-			$morehtmlref .= $langs->trans("Project") . ': ';
1156
+			$morehtmlref .= $langs->trans("Project").': ';
1157 1157
 			$morehtmlref .= $projectstatic->getNomUrl(1);
1158 1158
 			$morehtmlref .= '<br>';
1159 1159
 
1160 1160
 			// Third party
1161
-			$morehtmlref .= $langs->trans("ThirdParty") . ': ';
1161
+			$morehtmlref .= $langs->trans("ThirdParty").': ';
1162 1162
 			if (!empty($projectstatic->thirdparty) && is_object($projectstatic->thirdparty)) {
1163 1163
 				$morehtmlref .= $projectstatic->thirdparty->getNomUrl(1);
1164 1164
 			}
@@ -1174,7 +1174,7 @@  discard block
 block discarded – undo
1174 1174
 		print '<table class="border centpercent tableforfield">';
1175 1175
 
1176 1176
 		// Task parent
1177
-		print '<tr><td>' . $langs->trans("ChildOfTask") . '</td><td>';
1177
+		print '<tr><td>'.$langs->trans("ChildOfTask").'</td><td>';
1178 1178
 		if ($object->fk_task_parent > 0) {
1179 1179
 			$tasktmp = new Task($db);
1180 1180
 			$tasktmp->fetch($object->fk_task_parent);
@@ -1183,7 +1183,7 @@  discard block
 block discarded – undo
1183 1183
 		print '</td></tr>';
1184 1184
 
1185 1185
 		// Date start - Date end task
1186
-		print '<tr><td class="titlefield">' . $langs->trans("DateStart") . ' - ' . $langs->trans("Deadline") . '</td><td>';
1186
+		print '<tr><td class="titlefield">'.$langs->trans("DateStart").' - '.$langs->trans("Deadline").'</td><td>';
1187 1187
 		$start = dol_print_date($object->date_start, 'dayhour');
1188 1188
 		print($start ? $start : '?');
1189 1189
 		$end = dol_print_date($object->date_end, 'dayhour');
@@ -1195,7 +1195,7 @@  discard block
 block discarded – undo
1195 1195
 		print '</td></tr>';
1196 1196
 
1197 1197
 		// Planned workload
1198
-		print '<tr><td>' . $langs->trans("PlannedWorkload") . '</td><td>';
1198
+		print '<tr><td>'.$langs->trans("PlannedWorkload").'</td><td>';
1199 1199
 		if ($object->planned_workload) {
1200 1200
 			print convertSecondToTime($object->planned_workload, 'allhourmin');
1201 1201
 		}
@@ -1210,21 +1210,21 @@  discard block
 block discarded – undo
1210 1210
 		print '<table class="border tableforfield centpercent">';
1211 1211
 
1212 1212
 		// Progress declared
1213
-		print '<tr><td class="titlefield">' . $langs->trans("ProgressDeclared") . '</td><td>';
1214
-		print $object->progress != '' ? $object->progress . ' %' : '';
1213
+		print '<tr><td class="titlefield">'.$langs->trans("ProgressDeclared").'</td><td>';
1214
+		print $object->progress != '' ? $object->progress.' %' : '';
1215 1215
 		print '</td></tr>';
1216 1216
 
1217 1217
 		// Progress calculated
1218
-		print '<tr><td>' . $langs->trans("ProgressCalculated") . '</td><td>';
1218
+		print '<tr><td>'.$langs->trans("ProgressCalculated").'</td><td>';
1219 1219
 		if ($object->planned_workload) {
1220 1220
 			$tmparray = $object->getSummaryOfTimeSpent();
1221 1221
 			if ($tmparray['total_duration'] > 0) {
1222
-				print round($tmparray['total_duration'] / $object->planned_workload * 100, 2) . ' %';
1222
+				print round($tmparray['total_duration'] / $object->planned_workload * 100, 2).' %';
1223 1223
 			} else {
1224 1224
 				print '0 %';
1225 1225
 			}
1226 1226
 		} else {
1227
-			print '<span class="opacitymedium">' . $langs->trans("WorkloadNotDefined") . '</span>';
1227
+			print '<span class="opacitymedium">'.$langs->trans("WorkloadNotDefined").'</span>';
1228 1228
 		}
1229 1229
 		print '</td>';
1230 1230
 
@@ -1240,7 +1240,7 @@  discard block
 block discarded – undo
1240 1240
 		print dol_get_fiche_end();
1241 1241
 	} else {
1242 1242
 		if ($action == 'deleteline') {
1243
-			$urlafterconfirm = $_SERVER["PHP_SELF"] . "?" . ($object->id > 0 ? "id=" . $object->id : 'projectid=' . $projectstatic->id) . '&lineid=' . GETPOSTINT("lineid") . ($withproject ? '&withproject=1' : '');
1243
+			$urlafterconfirm = $_SERVER["PHP_SELF"]."?".($object->id > 0 ? "id=".$object->id : 'projectid='.$projectstatic->id).'&lineid='.GETPOSTINT("lineid").($withproject ? '&withproject=1' : '');
1244 1244
 			print $form->formconfirm($urlafterconfirm, $langs->trans("DeleteATimeSpent"), $langs->trans("ConfirmDeleteATimeSpent"), "confirm_deleteline", '', '', 1);
1245 1245
 		}
1246 1246
 	}
@@ -1254,7 +1254,7 @@  discard block
 block discarded – undo
1254 1254
 
1255 1255
 		if ($action == 'deleteline' && !empty($projectidforalltimes)) {
1256 1256
 			// We must use projectidprojectid if on list of timespent of project and id=taskid if on list of timespent of a task
1257
-			$urlafterconfirm = $_SERVER["PHP_SELF"] . "?" . ($projectstatic->id > 0 ? 'projectid=' . $projectstatic->id : ($object->id > 0 ? "id=" . $object->id : '')) . '&lineid=' . GETPOSTINT('lineid') . ($withproject ? '&withproject=1' : '') . "&contextpage=" . urlencode($contextpage);
1257
+			$urlafterconfirm = $_SERVER["PHP_SELF"]."?".($projectstatic->id > 0 ? 'projectid='.$projectstatic->id : ($object->id > 0 ? "id=".$object->id : '')).'&lineid='.GETPOSTINT('lineid').($withproject ? '&withproject=1' : '')."&contextpage=".urlencode($contextpage);
1258 1258
 			$formconfirm = $form->formconfirm($urlafterconfirm, $langs->trans("DeleteATimeSpent"), $langs->trans("ConfirmDeleteATimeSpent"), "confirm_deleteline", '', '', 1);
1259 1259
 		}
1260 1260
 
@@ -1273,10 +1273,10 @@  discard block
 block discarded – undo
1273 1273
 		// Definition of fields for list
1274 1274
 		$arrayfields = array();
1275 1275
 		$arrayfields['t.element_date'] = array('label' => $langs->trans("Date"), 'checked' => 1);
1276
-		$arrayfields['p.fk_soc'] = array('label' => $langs->trans("ThirdParty"), 'type' => 'integer:Societe:/societe/class/societe.class.php:1','checked' => 1);
1276
+		$arrayfields['p.fk_soc'] = array('label' => $langs->trans("ThirdParty"), 'type' => 'integer:Societe:/societe/class/societe.class.php:1', 'checked' => 1);
1277 1277
 		$arrayfields['s.name_alias'] = array('label' => $langs->trans("AliasNameShort"), 'type' => 'integer:Societe:/societe/class/societe.class.php:1');
1278 1278
 		if ((empty($id) && empty($ref)) || !empty($projectidforalltimes)) {	// Not a dedicated task
1279
-			if (! empty($allprojectforuser)) {
1279
+			if (!empty($allprojectforuser)) {
1280 1280
 				$arrayfields['p.project_ref'] = ['label' => $langs->trans('RefProject'), 'checked' => 1];
1281 1281
 				$arrayfields['p.project_label'] = ['label' => $langs->trans('ProjectLabel'), 'checked' => 1];
1282 1282
 			}
@@ -1292,83 +1292,83 @@  discard block
 block discarded – undo
1292 1292
 		$arrayfields['value'] = array('label' => $langs->trans("Value"), 'checked' => 1, 'enabled' => isModEnabled("salaries"));
1293 1293
 		$arrayfields['valuebilled'] = array('label' => $langs->trans("Billed"), 'checked' => 1, 'enabled' => (((getDolGlobalInt('PROJECT_HIDE_TASKS') || !getDolGlobalInt('PROJECT_BILL_TIME_SPENT')) ? 0 : 1) && $projectstatic->usage_bill_time));
1294 1294
 		// Extra fields
1295
-		include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_array_fields.tpl.php';
1295
+		include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
1296 1296
 
1297 1297
 		$arrayfields = dol_sort_array($arrayfields, 'position');
1298
-		'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields';  // dol_sort_array looses type for Phan
1298
+		'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan
1299 1299
 
1300 1300
 		$param = '';
1301 1301
 		if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
1302
-			$param .= '&contextpage=' . urlencode($contextpage);
1302
+			$param .= '&contextpage='.urlencode($contextpage);
1303 1303
 		}
1304 1304
 		if ($limit > 0 && $limit != $conf->liste_limit) {
1305 1305
 			$param .= '&limit='.((int) $limit);
1306 1306
 		}
1307 1307
 		if ($search_month > 0) {
1308
-			$param .= '&search_month=' . urlencode((string) ($search_month));
1308
+			$param .= '&search_month='.urlencode((string) ($search_month));
1309 1309
 		}
1310 1310
 		if ($search_year > 0) {
1311
-			$param .= '&search_year=' . urlencode((string) ($search_year));
1311
+			$param .= '&search_year='.urlencode((string) ($search_year));
1312 1312
 		}
1313 1313
 		if (!empty($search_user)) { 	// We keep param if -1 because default value is forced to user id if not set
1314 1314
 			$param .= '&search_user='.urlencode($search_user);
1315 1315
 		}
1316 1316
 		if ($search_task_ref != '') {
1317
-			$param .= '&search_task_ref=' . urlencode($search_task_ref);
1317
+			$param .= '&search_task_ref='.urlencode($search_task_ref);
1318 1318
 		}
1319 1319
 		if ($search_company != '') {
1320
-			$param .= '&amp;$search_company=' . urlencode($search_company);
1320
+			$param .= '&amp;$search_company='.urlencode($search_company);
1321 1321
 		}
1322 1322
 		if ($search_company_alias != '') {
1323
-			$param .= '&amp;$search_company_alias=' . urlencode($search_company_alias);
1323
+			$param .= '&amp;$search_company_alias='.urlencode($search_company_alias);
1324 1324
 		}
1325 1325
 		if ($search_project_ref != '') {
1326
-			$param .= '&amp;$search_project_ref=' . urlencode($search_project_ref);
1326
+			$param .= '&amp;$search_project_ref='.urlencode($search_project_ref);
1327 1327
 		}
1328 1328
 		if ($search_project_label != '') {
1329
-			$param .= '&amp;$search_project_label=' . urlencode($search_project_label);
1329
+			$param .= '&amp;$search_project_label='.urlencode($search_project_label);
1330 1330
 		}
1331 1331
 		if ($search_task_label != '') {
1332
-			$param .= '&search_task_label=' . urlencode($search_task_label);
1332
+			$param .= '&search_task_label='.urlencode($search_task_label);
1333 1333
 		}
1334 1334
 		if ($search_note != '') {
1335
-			$param .= '&search_note=' . urlencode($search_note);
1335
+			$param .= '&search_note='.urlencode($search_note);
1336 1336
 		}
1337 1337
 		if ($search_duration != '') {
1338
-			$param .= '&amp;search_field2=' . urlencode((string) ($search_duration));
1338
+			$param .= '&amp;search_field2='.urlencode((string) ($search_duration));
1339 1339
 		}
1340 1340
 		if ($optioncss != '') {
1341
-			$param .= '&optioncss=' . urlencode($optioncss);
1341
+			$param .= '&optioncss='.urlencode($optioncss);
1342 1342
 		}
1343 1343
 		if ($search_date_startday) {
1344
-			$param .= '&search_date_startday=' . urlencode((string) ($search_date_startday));
1344
+			$param .= '&search_date_startday='.urlencode((string) ($search_date_startday));
1345 1345
 		}
1346 1346
 		if ($search_date_startmonth) {
1347
-			$param .= '&search_date_startmonth=' . urlencode((string) ($search_date_startmonth));
1347
+			$param .= '&search_date_startmonth='.urlencode((string) ($search_date_startmonth));
1348 1348
 		}
1349 1349
 		if ($search_date_startyear) {
1350
-			$param .= '&search_date_startyear=' . urlencode((string) ($search_date_startyear));
1350
+			$param .= '&search_date_startyear='.urlencode((string) ($search_date_startyear));
1351 1351
 		}
1352 1352
 		if ($search_date_endday) {
1353
-			$param .= '&search_date_endday=' . urlencode((string) ($search_date_endday));
1353
+			$param .= '&search_date_endday='.urlencode((string) ($search_date_endday));
1354 1354
 		}
1355 1355
 		if ($search_date_endmonth) {
1356
-			$param .= '&search_date_endmonth=' . urlencode((string) ($search_date_endmonth));
1356
+			$param .= '&search_date_endmonth='.urlencode((string) ($search_date_endmonth));
1357 1357
 		}
1358 1358
 		if ($search_date_endyear) {
1359
-			$param .= '&search_date_endyear=' . urlencode((string) ($search_date_endyear));
1359
+			$param .= '&search_date_endyear='.urlencode((string) ($search_date_endyear));
1360 1360
 		}
1361 1361
 		if ($search_timespent_starthour) {
1362
-			$param .= '&search_timespent_duration_starthour=' . urlencode((string) ($search_timespent_starthour));
1362
+			$param .= '&search_timespent_duration_starthour='.urlencode((string) ($search_timespent_starthour));
1363 1363
 		}
1364 1364
 		if ($search_timespent_startmin) {
1365
-			$param .= '&search_timespent_duration_startmin=' . urlencode((string) ($search_timespent_startmin));
1365
+			$param .= '&search_timespent_duration_startmin='.urlencode((string) ($search_timespent_startmin));
1366 1366
 		}
1367 1367
 		if ($search_timespent_endhour) {
1368
-			$param .= '&search_timespent_duration_endhour=' . urlencode((string) ($search_timespent_endhour));
1368
+			$param .= '&search_timespent_duration_endhour='.urlencode((string) ($search_timespent_endhour));
1369 1369
 		}
1370 1370
 		if ($search_timespent_endmin) {
1371
-			$param .= '&search_timespent_duration_endmin=' . urlencode((string) ($search_timespent_endmin));
1371
+			$param .= '&search_timespent_duration_endmin='.urlencode((string) ($search_timespent_endmin));
1372 1372
 		}
1373 1373
 
1374 1374
 		/*
@@ -1376,24 +1376,24 @@  discard block
 block discarded – undo
1376 1376
 		 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
1377 1377
 		 */
1378 1378
 		if ($id) {
1379
-			$param .= '&id=' . urlencode((string) ($id));
1379
+			$param .= '&id='.urlencode((string) ($id));
1380 1380
 		}
1381 1381
 		if ($projectid) {
1382
-			$param .= '&projectid=' . urlencode((string) ($projectid));
1382
+			$param .= '&projectid='.urlencode((string) ($projectid));
1383 1383
 		}
1384 1384
 		if ($withproject) {
1385
-			$param .= '&withproject=' . urlencode((string) ($withproject));
1385
+			$param .= '&withproject='.urlencode((string) ($withproject));
1386 1386
 		}
1387 1387
 		// Add $param from hooks
1388 1388
 		$parameters = array('param' => &$param);
1389 1389
 		$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
1390 1390
 		$param .= $hookmanager->resPrint;
1391 1391
 
1392
-		print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">';
1392
+		print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
1393 1393
 		if ($optioncss != '') {
1394
-			print '<input type="hidden" name="optioncss" value="' . $optioncss . '">';
1394
+			print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
1395 1395
 		}
1396
-		print '<input type="hidden" name="token" value="' . newToken() . '">';
1396
+		print '<input type="hidden" name="token" value="'.newToken().'">';
1397 1397
 		print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
1398 1398
 		if ($action == 'editline') {
1399 1399
 			print '<input type="hidden" name="action" value="updateline">';
@@ -1408,13 +1408,13 @@  discard block
 block discarded – undo
1408 1408
 		} else {
1409 1409
 			print '<input type="hidden" name="action" value="list">';
1410 1410
 		}
1411
-		print '<input type="hidden" name="sortfield" value="' . $sortfield . '">';
1412
-		print '<input type="hidden" name="sortorder" value="' . $sortorder . '">';
1411
+		print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
1412
+		print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
1413 1413
 
1414
-		print '<input type="hidden" name="id" value="' . $id . '">';
1415
-		print '<input type="hidden" name="projectid" value="' . $projectidforalltimes . '">';
1416
-		print '<input type="hidden" name="withproject" value="' . $withproject . '">';
1417
-		print '<input type="hidden" name="tab" value="' . $tab . '">';
1414
+		print '<input type="hidden" name="id" value="'.$id.'">';
1415
+		print '<input type="hidden" name="projectid" value="'.$projectidforalltimes.'">';
1416
+		print '<input type="hidden" name="withproject" value="'.$withproject.'">';
1417
+		print '<input type="hidden" name="tab" value="'.$tab.'">';
1418 1418
 		print '<input type="hidden" name="page_y" value="">';
1419 1419
 
1420 1420
 		// Form to convert time spent into invoice
@@ -1441,7 +1441,7 @@  discard block
 block discarded – undo
1441 1441
 					'onelineperperiod' => 'OneLinePerTimeSpentLine',
1442 1442
 				);
1443 1443
 				print $form->selectarray('generateinvoicemode', $tmparray, 'onelineperuser', 0, 0, 0, '', 1);
1444
-				print "\n" . '<script type="text/javascript">';
1444
+				print "\n".'<script type="text/javascript">';
1445 1445
 				print '
1446 1446
 				$(document).ready(function () {
1447 1447
 					setDetailVisibility();
@@ -1458,8 +1458,8 @@  discard block
 block discarded – undo
1458 1458
             		}
1459 1459
             	});
1460 1460
             			';
1461
-				print '</script>' . "\n";
1462
-				print '<span style="display:none" id="detail_time_duration"><input type="checkbox" value="detail" name="detail_time_duration"/>' . $langs->trans('AddDetailDateAndDuration') . '</span>';
1461
+				print '</script>'."\n";
1462
+				print '<span style="display:none" id="detail_time_duration"><input type="checkbox" value="detail" name="detail_time_duration"/>'.$langs->trans('AddDetailDateAndDuration').'</span>';
1463 1463
 				print '</td>';
1464 1464
 				print '</tr>';
1465 1465
 
@@ -1509,14 +1509,14 @@  discard block
 block discarded – undo
1509 1509
 
1510 1510
 				print '<br>';
1511 1511
 				print '<div class="center">';
1512
-				print '<input type="submit" class="button" id="createbills" name="createbills" value="' . $langs->trans('GenerateBill') . '">  ';
1513
-				print '<input type="submit" class="button button-cancel" id="cancel" name="cancel" value="' . $langs->trans("Cancel") . '">';
1512
+				print '<input type="submit" class="button" id="createbills" name="createbills" value="'.$langs->trans('GenerateBill').'">  ';
1513
+				print '<input type="submit" class="button button-cancel" id="cancel" name="cancel" value="'.$langs->trans("Cancel").'">';
1514 1514
 				print '</div>';
1515 1515
 				print '<br>';
1516 1516
 			} else {
1517
-				print '<div class="warning">' . $langs->trans("ThirdPartyRequiredToGenerateInvoice") . '</div>';
1517
+				print '<div class="warning">'.$langs->trans("ThirdPartyRequiredToGenerateInvoice").'</div>';
1518 1518
 				print '<div class="center">';
1519
-				print '<input type="submit" class="button button-cancel" id="cancel" name="cancel" value="' . $langs->trans("Cancel") . '">';
1519
+				print '<input type="submit" class="button button-cancel" id="cancel" name="cancel" value="'.$langs->trans("Cancel").'">';
1520 1520
 				print '</div>';
1521 1521
 				$massaction = '';
1522 1522
 			}
@@ -1529,7 +1529,7 @@  discard block
 block discarded – undo
1529 1529
 				print '<table class="noborder centpercent">';
1530 1530
 				print '<tr>';
1531 1531
 				print '<td class="titlefield">';
1532
-				print img_picto('', 'intervention', 'class="pictofixedwidth"') . $langs->trans('InterToUse');
1532
+				print img_picto('', 'intervention', 'class="pictofixedwidth"').$langs->trans('InterToUse');
1533 1533
 				print '</td>';
1534 1534
 				print '<td>';
1535 1535
 				$forminter = new FormIntervention($db);
@@ -1539,14 +1539,14 @@  discard block
 block discarded – undo
1539 1539
 				print '</table>';
1540 1540
 
1541 1541
 				print '<div class="center">';
1542
-				print '<input type="submit" class="button" id="createinter" name="createinter" value="' . $langs->trans('GenerateInter') . '">  ';
1543
-				print '<input type="submit" class="button" id="cancel" name="cancel" value="' . $langs->trans('Cancel') . '">';
1542
+				print '<input type="submit" class="button" id="createinter" name="createinter" value="'.$langs->trans('GenerateInter').'">  ';
1543
+				print '<input type="submit" class="button" id="cancel" name="cancel" value="'.$langs->trans('Cancel').'">';
1544 1544
 				print '</div>';
1545 1545
 				print '<br>';
1546 1546
 			} else {
1547
-				print '<div class="warning">' . $langs->trans("ThirdPartyRequiredToGenerateIntervention") . '</div>';
1547
+				print '<div class="warning">'.$langs->trans("ThirdPartyRequiredToGenerateIntervention").'</div>';
1548 1548
 				print '<div class="center">';
1549
-				print '<input type="submit" class="button" id="cancel" name="cancel" value="' . $langs->trans('Cancel') . '">';
1549
+				print '<input type="submit" class="button" id="cancel" name="cancel" value="'.$langs->trans('Cancel').'">';
1550 1550
 				print '</div>';
1551 1551
 				$massaction = '';
1552 1552
 			}
@@ -1616,14 +1616,14 @@  discard block
 block discarded – undo
1616 1616
 			$sql .= " AND t.fk_element =".((int) $object->id);
1617 1617
 		} elseif (!empty($projectidforalltimes)) {
1618 1618
 			// Limit on one project
1619
-			$sql .= " AND pt.fk_projet IN (" . $db->sanitize($projectidforalltimes) . ")";
1619
+			$sql .= " AND pt.fk_projet IN (".$db->sanitize($projectidforalltimes).")";
1620 1620
 		} elseif (!empty($allprojectforuser)) {
1621 1621
 			// Limit on on user
1622 1622
 			if (empty($search_user)) {
1623 1623
 				$search_user = $user->id;
1624 1624
 			}
1625 1625
 			if ($search_user > 0) {
1626
-				$sql .= " AND t.fk_user = " . ((int) $search_user);
1626
+				$sql .= " AND t.fk_user = ".((int) $search_user);
1627 1627
 			}
1628 1628
 		}
1629 1629
 
@@ -1676,13 +1676,13 @@  discard block
 block discarded – undo
1676 1676
 			if ($search_timespent_starthour || $search_timespent_startmin) {
1677 1677
 				$timespent_duration_start = $search_timespent_starthour * 60 * 60; // We store duration in seconds
1678 1678
 				$timespent_duration_start += ($search_timespent_startmin ? $search_timespent_startmin : 0) * 60; // We store duration in seconds
1679
-				$sql .= " AND t.element_duration >= " . $timespent_duration_start;
1679
+				$sql .= " AND t.element_duration >= ".$timespent_duration_start;
1680 1680
 			}
1681 1681
 
1682 1682
 			if ($search_timespent_endhour || $search_timespent_endmin) {
1683 1683
 				$timespent_duration_end = $search_timespent_endhour * 60 * 60; // We store duration in seconds
1684 1684
 				$timespent_duration_end += ($search_timespent_endmin ? $search_timespent_endmin : 0) * 60; // We store duration in seconds
1685
-				$sql .= " AND t.element_duration <= " . $timespent_duration_end;
1685
+				$sql .= " AND t.element_duration <= ".$timespent_duration_end;
1686 1686
 			}
1687 1687
 		}
1688 1688
 
@@ -1730,13 +1730,13 @@  discard block
 block discarded – undo
1730 1730
 
1731 1731
 		if ($num >= 0) {
1732 1732
 			if (!empty($projectidforalltimes)) {
1733
-				print '<!-- List of time spent for project -->' . "\n";
1733
+				print '<!-- List of time spent for project -->'."\n";
1734 1734
 
1735 1735
 				$title = $langs->trans("ListTaskTimeUserProject");
1736 1736
 
1737 1737
 				print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'clock', 0, $linktocreatetime, '', $limit, 0, 0, 1);
1738 1738
 			} else {
1739
-				print '<!-- List of time spent -->' . "\n";
1739
+				print '<!-- List of time spent -->'."\n";
1740 1740
 
1741 1741
 				$title = $langs->trans("ListTaskTimeForTask");
1742 1742
 
@@ -1758,26 +1758,26 @@  discard block
 block discarded – undo
1758 1758
 		 * Form to add a new line of time spent
1759 1759
 		 */
1760 1760
 		if ($action == 'createtime' && $user->hasRight('projet', 'time')) {
1761
-			print '<!-- table to add time spent -->' . "\n";
1761
+			print '<!-- table to add time spent -->'."\n";
1762 1762
 			if (!empty($id)) {
1763
-				print '<input type="hidden" name="taskid" value="' . $id . '">';
1763
+				print '<input type="hidden" name="taskid" value="'.$id.'">';
1764 1764
 			}
1765 1765
 
1766 1766
 			print '<div class="div-table-responsive-no-min">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
1767 1767
 			print '<table class="noborder nohover centpercent">';
1768 1768
 
1769 1769
 			print '<tr class="liste_titre">';
1770
-			print '<td>' . $langs->trans("Date") . '</td>';
1770
+			print '<td>'.$langs->trans("Date").'</td>';
1771 1771
 			if (!empty($allprojectforuser)) {
1772
-				print '<td>' . $langs->trans("Project") . '</td>';
1772
+				print '<td>'.$langs->trans("Project").'</td>';
1773 1773
 			}
1774 1774
 			if (empty($id)) {
1775
-				print '<td>' . $langs->trans("Task") . '</td>';
1775
+				print '<td>'.$langs->trans("Task").'</td>';
1776 1776
 			}
1777
-			print '<td>' . $langs->trans("By") . '</td>';
1778
-			print '<td>' . $langs->trans("Note") . '</td>';
1779
-			print '<td>' . $langs->trans("NewTimeSpent") . '</td>';
1780
-			print '<td>' . $langs->trans("ProgressDeclared") . '</td>';
1777
+			print '<td>'.$langs->trans("By").'</td>';
1778
+			print '<td>'.$langs->trans("Note").'</td>';
1779
+			print '<td>'.$langs->trans("NewTimeSpent").'</td>';
1780
+			print '<td>'.$langs->trans("ProgressDeclared").'</td>';
1781 1781
 			if (!getDolGlobalString('PROJECT_HIDE_TASKS') && getDolGlobalString('PROJECT_BILL_TIME_SPENT')) {
1782 1782
 				print '<td></td>';
1783 1783
 
@@ -1831,14 +1831,14 @@  discard block
 block discarded – undo
1831 1831
 				print $form->select_dolusers((GETPOSTINT('userid') ? GETPOSTINT('userid') : $userid), 'userid', 0, '', 0, '', $contactsofproject, 0, 0, 0, '', 0, $langs->trans("ResourceNotAssignedToProject"), 'minwidth150imp maxwidth200');
1832 1832
 			} else {
1833 1833
 				if ($nboftasks) {
1834
-					print img_error($langs->trans('FirstAddRessourceToAllocateTime')) . ' ' . $langs->trans('FirstAddRessourceToAllocateTime');
1834
+					print img_error($langs->trans('FirstAddRessourceToAllocateTime')).' '.$langs->trans('FirstAddRessourceToAllocateTime');
1835 1835
 				}
1836 1836
 			}
1837 1837
 			print '</td>';
1838 1838
 
1839 1839
 			// Note
1840 1840
 			print '<td>';
1841
-			print '<textarea name="timespent_note" class="maxwidth100onsmartphone" rows="' . ROWS_2 . '">' . (GETPOST('timespent_note') ? GETPOST('timespent_note') : '') . '</textarea>';
1841
+			print '<textarea name="timespent_note" class="maxwidth100onsmartphone" rows="'.ROWS_2.'">'.(GETPOST('timespent_note') ? GETPOST('timespent_note') : '').'</textarea>';
1842 1842
 			print '</td>';
1843 1843
 
1844 1844
 			// Duration - Time spent
@@ -1906,7 +1906,7 @@  discard block
 block discarded – undo
1906 1906
 		$selectedfields .= (is_array($arrayofmassactions) && count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
1907 1907
 
1908 1908
 		print '<div class="div-table-responsive">';
1909
-		print '<table class="tagtable nobottomiftotal liste' . ($moreforfilter ? " listwithfilterbefore" : "") . '">' . "\n";
1909
+		print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
1910 1910
 
1911 1911
 		// Fields title search
1912 1912
 		// --------------------------------------------------------------------
@@ -1931,20 +1931,20 @@  discard block
 block discarded – undo
1931 1931
 		}
1932 1932
 		// Thirdparty
1933 1933
 		if (!empty($arrayfields['p.fk_soc']['checked'])) {
1934
-			print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_company" value="' . dol_escape_htmltag($search_company) . '"></td>';
1934
+			print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_company" value="'.dol_escape_htmltag($search_company).'"></td>';
1935 1935
 		}
1936 1936
 
1937 1937
 		// Thirdparty alias
1938 1938
 		if (!empty($arrayfields['s.name_alias']['checked'])) {
1939
-			print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_company_alias" value="' . dol_escape_htmltag($search_company_alias) . '"></td>';
1939
+			print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_company_alias" value="'.dol_escape_htmltag($search_company_alias).'"></td>';
1940 1940
 		}
1941 1941
 
1942 1942
 		if (!empty($allprojectforuser)) {
1943 1943
 			if (!empty($arrayfields['p.project_ref']['checked'])) {
1944
-				print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_project_ref" value="' . dol_escape_htmltag($search_project_ref) . '"></td>';
1944
+				print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_project_ref" value="'.dol_escape_htmltag($search_project_ref).'"></td>';
1945 1945
 			}
1946 1946
 			if (!empty($arrayfields['p.project_label']['checked'])) {
1947
-				print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_project_label" value="' . dol_escape_htmltag($search_project_label) . '"></td>';
1947
+				print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_project_label" value="'.dol_escape_htmltag($search_project_label).'"></td>';
1948 1948
 			}
1949 1949
 		}
1950 1950
 		// Task
@@ -1962,7 +1962,7 @@  discard block
 block discarded – undo
1962 1962
 		}
1963 1963
 		// Note
1964 1964
 		if (!empty($arrayfields['t.note']['checked'])) {
1965
-			print '<td class="liste_titre"><input type="text" class="flat maxwidth75" name="search_note" value="' . dol_escape_htmltag($search_note) . '"></td>';
1965
+			print '<td class="liste_titre"><input type="text" class="flat maxwidth75" name="search_note" value="'.dol_escape_htmltag($search_note).'"></td>';
1966 1966
 		}
1967 1967
 		// Duration
1968 1968
 		if (!empty($arrayfields['t.element_duration']['checked'])) {
@@ -1973,7 +1973,7 @@  discard block
 block discarded – undo
1973 1973
 			if ($search_timespent_starthour || $search_timespent_startmin) {
1974 1974
 				$durationtouse_start = ($search_timespent_starthour * 3600 + $search_timespent_startmin * 60);
1975 1975
 			}
1976
-			print '<div class="nowraponall">' . $langs->trans('from') . ' ';
1976
+			print '<div class="nowraponall">'.$langs->trans('from').' ';
1977 1977
 			print $form->select_duration('search_timespent_duration_start', $durationtouse_start, 0, 'text', 0, 1);
1978 1978
 			print '</div>';
1979 1979
 
@@ -1981,7 +1981,7 @@  discard block
 block discarded – undo
1981 1981
 			if ($search_timespent_endhour || $search_timespent_endmin) {
1982 1982
 				$durationtouse_end = ($search_timespent_endhour * 3600 + $search_timespent_endmin * 60);
1983 1983
 			}
1984
-			print '<div class="nowraponall">' . $langs->trans('to') . ' ';
1984
+			print '<div class="nowraponall">'.$langs->trans('to').' ';
1985 1985
 			print $form->select_duration('search_timespent_duration_end', $durationtouse_end, 0, 'text', 0, 1);
1986 1986
 			print '</div>';
1987 1987
 
@@ -1997,7 +1997,7 @@  discard block
 block discarded – undo
1997 1997
 		}
1998 1998
 		// Value billed
1999 1999
 		if (!empty($arrayfields['valuebilled']['checked'])) {
2000
-			print '<td class="liste_titre center">' . $form->selectyesno('search_valuebilled', $search_valuebilled, 1, false, 1) . '</td>';
2000
+			print '<td class="liste_titre center">'.$form->selectyesno('search_valuebilled', $search_valuebilled, 1, false, 1).'</td>';
2001 2001
 		}
2002 2002
 
2003 2003
 		/*
@@ -2015,7 +2015,7 @@  discard block
 block discarded – undo
2015 2015
 			print $searchpicto;
2016 2016
 			print '</td>';
2017 2017
 		}
2018
-		print '</tr>' . "\n";
2018
+		print '</tr>'."\n";
2019 2019
 
2020 2020
 
2021 2021
 		$totalarray = array();
@@ -2133,7 +2133,7 @@  discard block
 block discarded – undo
2133 2133
 			if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
2134 2134
 				print '<td class="center nowraponall">';
2135 2135
 				if (($action == 'editline' || $action == 'splitline') && GETPOSTINT('lineid') == $task_time->rowid) {
2136
-					print '<input type="hidden" name="lineid" value="' . GETPOSTINT('lineid') . '">';
2136
+					print '<input type="hidden" name="lineid" value="'.GETPOSTINT('lineid').'">';
2137 2137
 					print '<input type="submit" class="button buttongen smallpaddingimp margintoponlyshort marginbottomonlyshort button-save" name="save" value="'.$langs->trans("Save").'">';
2138 2138
 					print '<br>';
2139 2139
 					print '<input type="submit" class="button buttongen smallpaddingimp margintoponlyshort marginbottomonlyshort button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">';
@@ -2144,7 +2144,7 @@  discard block
 block discarded – undo
2144 2144
 						print '</a>';
2145 2145
 
2146 2146
 						if (getDolGlobalString('PROJECT_ALLOW_SPLIT_TIMESPENT')) {
2147
-							print '<a class="reposition editfielda paddingleft" href="' . $_SERVER["PHP_SELF"] . '?action=splitline&token=' . newToken() . '&lineid=' . $task_time->rowid . $param . ((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '') . '">';
2147
+							print '<a class="reposition editfielda paddingleft" href="'.$_SERVER["PHP_SELF"].'?action=splitline&token='.newToken().'&lineid='.$task_time->rowid.$param.((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '').'">';
2148 2148
 							print img_split('', 'class="pictofixedwidth paddingleft"');
2149 2149
 							print '</a>';
2150 2150
 						}
@@ -2162,12 +2162,12 @@  discard block
 block discarded – undo
2162 2162
 
2163 2163
 							// Disable select if task not billable or already invoiced
2164 2164
 							$disabled = (intval($task_time->billable) != 1 || $invoiced);
2165
-							$ctrl = '<input '.($disabled ? 'disabled' : '').' id="cb' . $task_time->rowid . '" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="' . $task_time->rowid . '"' . ($selected ? ' checked="checked"' : '') . '>';
2165
+							$ctrl = '<input '.($disabled ? 'disabled' : '').' id="cb'.$task_time->rowid.'" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="'.$task_time->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
2166 2166
 							if ($disabled) {
2167 2167
 								// If disabled, a dbl-click very close outside the control
2168 2168
 								// will re-enable it, so that user is not blocked if needed.
2169
-								print '<span id="cbsp'. $task_time->rowid . '">'.$ctrl.'</span>';
2170
-								print '<script>$("#cbsp' . $task_time->rowid . '").dblclick(()=>{ $("#cb' . $task_time->rowid . '").removeAttr("disabled") })</script>';
2169
+								print '<span id="cbsp'.$task_time->rowid.'">'.$ctrl.'</span>';
2170
+								print '<script>$("#cbsp'.$task_time->rowid.'").dblclick(()=>{ $("#cb'.$task_time->rowid.'").removeAttr("disabled") })</script>';
2171 2171
 							} else {
2172 2172
 								print $ctrl;
2173 2173
 							}
@@ -2289,7 +2289,7 @@  discard block
 block discarded – undo
2289 2289
 					}
2290 2290
 				}
2291 2291
 			} elseif ($action !== 'createtime') {
2292
-				print '<input type="hidden" name="taskid" value="' . $id . '">';
2292
+				print '<input type="hidden" name="taskid" value="'.$id.'">';
2293 2293
 			}
2294 2294
 
2295 2295
 			// Task label
@@ -2318,9 +2318,9 @@  discard block
 block discarded – undo
2318 2318
 					}
2319 2319
 					if (count($contactsoftask) > 0) {
2320 2320
 						print img_object('', 'user', 'class="pictofixedwidth hideonsmartphone"');
2321
-						print $form->select_dolusers($task_time->fk_user, 'userid_line', 0, null, 0, '', $contactsoftask, '0', 0, 0, '', 0, '', 'minwidth100 maxwidth100');	// maxwidth must be lowed than minwidth of the td
2321
+						print $form->select_dolusers($task_time->fk_user, 'userid_line', 0, null, 0, '', $contactsoftask, '0', 0, 0, '', 0, '', 'minwidth100 maxwidth100'); // maxwidth must be lowed than minwidth of the td
2322 2322
 					} else {
2323
-						print img_error($langs->trans('FirstAddRessourceToAllocateTime')) . $langs->trans('FirstAddRessourceToAllocateTime');
2323
+						print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime');
2324 2324
 					}
2325 2325
 				} else {
2326 2326
 					$userstatic->id = $task_time->fk_user;
@@ -2342,7 +2342,7 @@  discard block
 block discarded – undo
2342 2342
 			if (!empty($arrayfields['t.note']['checked'])) {
2343 2343
 				if ($action == 'editline' && GETPOSTINT('lineid') == $task_time->rowid) {
2344 2344
 					print '<td class="small">';
2345
-					print '<textarea name="timespent_note_line" width="95%" rows="' . ROWS_2 . '">' . dol_escape_htmltag($task_time->note, 0, 1) . '</textarea>';
2345
+					print '<textarea name="timespent_note_line" width="95%" rows="'.ROWS_2.'">'.dol_escape_htmltag($task_time->note, 0, 1).'</textarea>';
2346 2346
 					print '</td>';
2347 2347
 				} else {
2348 2348
 					print '<td class="small tdoverflowmax150 classfortooltip" title="'.dol_string_onlythesehtmltags(dol_htmlentitiesbr($task_time->note)).'">';
@@ -2353,7 +2353,7 @@  discard block
 block discarded – undo
2353 2353
 					$totalarray['nbfield']++;
2354 2354
 				}
2355 2355
 			} elseif ($action == 'editline' && GETPOSTINT('lineid') == $task_time->rowid) {
2356
-				print '<input type="hidden" name="timespent_note_line" value="' . dol_escape_htmltag($task_time->note, 0, 1) . '">';
2356
+				print '<input type="hidden" name="timespent_note_line" value="'.dol_escape_htmltag($task_time->note, 0, 1).'">';
2357 2357
 			}
2358 2358
 
2359 2359
 			// Time spent
@@ -2414,7 +2414,7 @@  discard block
 block discarded – undo
2414 2414
 				$value = price2num($task_time->thm * $task_time->element_duration / 3600, 'MT', 1);
2415 2415
 
2416 2416
 				print '<td class="nowraponall right">';
2417
-				print '<span class="amount" title="' . $langs->trans("THM") . ': ' . price($task_time->thm) . '">';
2417
+				print '<span class="amount" title="'.$langs->trans("THM").': '.price($task_time->thm).'">';
2418 2418
 				print price($value, 1, $langs, 1, -1, -1, $conf->currency);
2419 2419
 				print '</span>';
2420 2420
 				print '</td>';
@@ -2470,7 +2470,7 @@  discard block
 block discarded – undo
2470 2470
 							}
2471 2471
 						}
2472 2472
 					} else {
2473
-						print '<span class="opacitymedium">' . $langs->trans("NA") . '</span>';
2473
+						print '<span class="opacitymedium">'.$langs->trans("NA").'</span>';
2474 2474
 					}
2475 2475
 				}
2476 2476
 				print '</td>';
@@ -2504,7 +2504,7 @@  discard block
 block discarded – undo
2504 2504
 						print '</a>';
2505 2505
 
2506 2506
 						if (getDolGlobalString('PROJECT_ALLOW_SPLIT_TIMESPENT')) {
2507
-							print '<a class="reposition editfielda paddingleft" href="' . $_SERVER["PHP_SELF"] . '?action=splitline&token=' . newToken() . '&lineid=' . $task_time->rowid . $param . ((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '') . '">';
2507
+							print '<a class="reposition editfielda paddingleft" href="'.$_SERVER["PHP_SELF"].'?action=splitline&token='.newToken().'&lineid='.$task_time->rowid.$param.((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '').'">';
2508 2508
 							print img_split('', 'class="pictofixedwidth paddingleft"');
2509 2509
 							print '</a>';
2510 2510
 						}
@@ -2522,12 +2522,12 @@  discard block
 block discarded – undo
2522 2522
 
2523 2523
 							// Disable select if task not billable or already invoiced
2524 2524
 							$disabled = (intval($task_time->billable) != 1 || $invoiced);
2525
-							$ctrl = '<input '.($disabled ? 'disabled' : '').' id="cb' . $task_time->rowid . '" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="' . $task_time->rowid . '"' . ($selected ? ' checked="checked"' : '') . '>';
2525
+							$ctrl = '<input '.($disabled ? 'disabled' : '').' id="cb'.$task_time->rowid.'" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="'.$task_time->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
2526 2526
 							if ($disabled) {
2527 2527
 								// If disabled, a dbl-click very close outside the control
2528 2528
 								// will re-enable it, so that user is not blocked if needed.
2529
-								print '<span id="cbsp'. $task_time->rowid . '">'.$ctrl.'</span>';
2530
-								print '<script>$("#cbsp' . $task_time->rowid . '").dblclick(()=>{ $("#cb' . $task_time->rowid . '").removeAttr("disabled") })</script>';
2529
+								print '<span id="cbsp'.$task_time->rowid.'">'.$ctrl.'</span>';
2530
+								print '<script>$("#cbsp'.$task_time->rowid.'").dblclick(()=>{ $("#cb'.$task_time->rowid.'").removeAttr("disabled") })</script>';
2531 2531
 							} else {
2532 2532
 								print $ctrl;
2533 2533
 							}
@@ -2626,7 +2626,7 @@  discard block
 block discarded – undo
2626 2626
 							print img_object('', 'user', 'class="hideonsmartphone"');
2627 2627
 							print $form->select_dolusers($task_time->fk_user, 'userid_line', 0, '', 0, '', $contactsoftask);
2628 2628
 						} else {
2629
-							print img_error($langs->trans('FirstAddRessourceToAllocateTime')) . $langs->trans('FirstAddRessourceToAllocateTime');
2629
+							print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime');
2630 2630
 						}
2631 2631
 					} else {
2632 2632
 						$userstatic->id = $task_time->fk_user;
@@ -2643,13 +2643,13 @@  discard block
 block discarded – undo
2643 2643
 				if (!empty($arrayfields['t.note']['checked'])) {
2644 2644
 					print '<td class="tdoverflowmax300">';
2645 2645
 					if ($action == 'splitline' && GETPOSTINT('lineid') == $task_time->rowid) {
2646
-						print '<textarea name="timespent_note_line" width="95%" rows="' . ROWS_2 . '">' . dol_escape_htmltag($task_time->note, 0, 1) . '</textarea>';
2646
+						print '<textarea name="timespent_note_line" width="95%" rows="'.ROWS_2.'">'.dol_escape_htmltag($task_time->note, 0, 1).'</textarea>';
2647 2647
 					} else {
2648 2648
 						print dol_nl2br($task_time->note);
2649 2649
 					}
2650 2650
 					print '</td>';
2651 2651
 				} elseif ($action == 'splitline' && GETPOSTINT('lineid') == $task_time->rowid) {
2652
-					print '<input type="hidden" name="timespent_note_line" rows="' . ROWS_2 . '" value="' . dol_escape_htmltag($task_time->note, 0, 1) . '">';
2652
+					print '<input type="hidden" name="timespent_note_line" rows="'.ROWS_2.'" value="'.dol_escape_htmltag($task_time->note, 0, 1).'">';
2653 2653
 				}
2654 2654
 
2655 2655
 				// Time spent
@@ -2791,7 +2791,7 @@  discard block
 block discarded – undo
2791 2791
 							print img_object('', 'user', 'class="hideonsmartphone"');
2792 2792
 							print $form->select_dolusers($task_time->fk_user, 'userid_line_2', 0, '', 0, '', $contactsoftask);
2793 2793
 						} else {
2794
-							print img_error($langs->trans('FirstAddRessourceToAllocateTime')) . $langs->trans('FirstAddRessourceToAllocateTime');
2794
+							print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime');
2795 2795
 						}
2796 2796
 					} else {
2797 2797
 						$userstatic->id = $task_time->fk_user;
@@ -2808,13 +2808,13 @@  discard block
 block discarded – undo
2808 2808
 				if (!empty($arrayfields['t.note']['checked'])) {
2809 2809
 					print '<td class="small tdoverflowmax300"">';
2810 2810
 					if ($action == 'splitline' && GETPOSTINT('lineid') == $task_time->rowid) {
2811
-						print '<textarea name="timespent_note_line_2" width="95%" rows="' . ROWS_2 . '">' . dol_escape_htmltag($task_time->note, 0, 1) . '</textarea>';
2811
+						print '<textarea name="timespent_note_line_2" width="95%" rows="'.ROWS_2.'">'.dol_escape_htmltag($task_time->note, 0, 1).'</textarea>';
2812 2812
 					} else {
2813 2813
 						print dol_nl2br($task_time->note);
2814 2814
 					}
2815 2815
 					print '</td>';
2816 2816
 				} elseif ($action == 'splitline' && GETPOSTINT('lineid') == $task_time->rowid) {
2817
-					print '<input type="hidden" name="timespent_note_line_2" value="' . dol_escape_htmltag($task_time->note, 0, 1) . '">';
2817
+					print '<input type="hidden" name="timespent_note_line_2" value="'.dol_escape_htmltag($task_time->note, 0, 1).'">';
2818 2818
 				}
2819 2819
 
2820 2820
 				// Time spent
@@ -2888,14 +2888,14 @@  discard block
 block discarded – undo
2888 2888
 				$i++;
2889 2889
 				if ($i == 1) {
2890 2890
 					if ($num < $limit && empty($offset)) {
2891
-						print '<td class="left">' . $langs->trans("Total") . '</td>';
2891
+						print '<td class="left">'.$langs->trans("Total").'</td>';
2892 2892
 					} else {
2893 2893
 						print '<td class="left">'.$form->textwithpicto($langs->trans("Total"), $langs->trans("Totalforthispage")).'</td>';
2894 2894
 					}
2895 2895
 				} elseif (isset($totalarray['totaldurationfield']) && $totalarray['totaldurationfield'] == $i) {
2896
-					print '<td class="right">' . convertSecondToTime($totalarray['totalduration'], 'allhourmin') . '</td>';
2896
+					print '<td class="right">'.convertSecondToTime($totalarray['totalduration'], 'allhourmin').'</td>';
2897 2897
 				} elseif (isset($totalarray['totalvaluefield']) && $totalarray['totalvaluefield'] == $i) {
2898
-					print '<td class="right">' . price($totalarray['totalvalue']) . '</td>';
2898
+					print '<td class="right">'.price($totalarray['totalvalue']).'</td>';
2899 2899
 					//} elseif ($totalarray['totalvaluebilledfield'] == $i) { print '<td class="center">'.price($totalarray['totalvaluebilled']).'</td>';
2900 2900
 				} else {
2901 2901
 					print '<td></td>';
@@ -2911,8 +2911,8 @@  discard block
 block discarded – undo
2911 2911
 					$totalnboffields++;
2912 2912
 				}
2913 2913
 			}
2914
-			print '<tr class="oddeven"><td colspan="' . $totalnboffields . '">';
2915
-			print '<span class="opacitymedium">' . $langs->trans("None") . '</span>';
2914
+			print '<tr class="oddeven"><td colspan="'.$totalnboffields.'">';
2915
+			print '<span class="opacitymedium">'.$langs->trans("None").'</span>';
2916 2916
 			print '</td></tr>';
2917 2917
 		}
2918 2918
 
Please login to merge, or discard this patch.
htdocs/projet/card.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 
121 121
 $permissiontoadd = $user->hasRight('projet', 'creer');
122 122
 $permissiontodelete = $user->hasRight('projet', 'supprimer');
123
-$permissiondellink = $user->hasRight('projet', 'creer');	// Used by the include of actions_dellink.inc.php
123
+$permissiondellink = $user->hasRight('projet', 'creer'); // Used by the include of actions_dellink.inc.php
124 124
 
125 125
 
126 126
 /*
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
 		$action = '';
172 172
 	}
173 173
 
174
-	include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php';		// Must be 'include', not 'include_once'
174
+	include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be 'include', not 'include_once'
175 175
 
176 176
 	// Action setdraft object
177 177
 	if ($action == 'confirm_setdraft' && $confirm == 'yes' && $permissiontoadd) {
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
 		$action = '';
186 186
 
187 187
 		// For backward compatibility
188
-		$object->statut = $object::STATUS_DRAFT;	// this already set for $object->status by $object->setStatut()
188
+		$object->statut = $object::STATUS_DRAFT; // this already set for $object->status by $object->setStatut()
189 189
 	}
190 190
 
191 191
 	// Action add
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
 			$object->date_end_event   = (!GETPOST('date_end_event')) ? '' : $date_end_event;
333 333
 			$object->location     = $location;
334 334
 			if (GETPOSTISSET('opp_amount')) {
335
-				$object->opp_amount   = price2num(GETPOST('opp_amount', 'alpha'));
335
+				$object->opp_amount = price2num(GETPOST('opp_amount', 'alpha'));
336 336
 			}
337 337
 			if (GETPOSTISSET('budget_amount')) {
338 338
 				$object->budget_amount = price2num(GETPOST('budget_amount', 'alpha'));
@@ -519,7 +519,7 @@  discard block
 block discarded – undo
519 519
 			if (!empty($_SESSION['pageforbacktolist']) && !empty($_SESSION['pageforbacktolist']['project'])) {
520 520
 				$tmpurl = $_SESSION['pageforbacktolist']['project'];
521 521
 				$tmpurl = preg_replace('/__SOCID__/', (string) $object->socid, $tmpurl);
522
-				$urlback = $tmpurl.(preg_match('/\?/', $tmpurl) ? '&' : '?'). 'restore_lastsearch_values=1';
522
+				$urlback = $tmpurl.(preg_match('/\?/', $tmpurl) ? '&' : '?').'restore_lastsearch_values=1';
523 523
 			} else {
524 524
 				$urlback = DOL_URL_ROOT.'/projet/list.php?restore_lastsearch_values=1';
525 525
 			}
@@ -970,7 +970,7 @@  discard block
 block discarded – undo
970 970
 	$userDelete = $object->restrictedProjectArea($user, 'delete');
971 971
 	//print "userAccess=".$userAccess." userWrite=".$userWrite." userDelete=".$userDelete;
972 972
 
973
-	$formconfirm = "" ;
973
+	$formconfirm = "";
974 974
 
975 975
 	// Confirmation validation
976 976
 	if ($action == 'validate') {
@@ -1108,7 +1108,7 @@  discard block
 block discarded – undo
1108 1108
 				print '<br>';
1109 1109
 			}
1110 1110
 			if (!getDolGlobalString('PROJECT_HIDE_TASKS')) {
1111
-				print '<input type="checkbox" id="usage_task" name="usage_task"' . (GETPOSTISSET('usage_task') ? (GETPOST('usage_task', 'alpha') != '' ? ' checked="checked"' : '') : ($object->usage_task ? ' checked="checked"' : '')) . '> ';
1111
+				print '<input type="checkbox" id="usage_task" name="usage_task"'.(GETPOSTISSET('usage_task') ? (GETPOST('usage_task', 'alpha') != '' ? ' checked="checked"' : '') : ($object->usage_task ? ' checked="checked"' : '')).'> ';
1112 1112
 				$htmltext = $langs->trans("ProjectFollowTasks");
1113 1113
 				print '<label for="usage_task">'.$form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext).'</label>';
1114 1114
 				print '<script>';
@@ -1134,7 +1134,7 @@  discard block
 block discarded – undo
1134 1134
 				print '<br>';
1135 1135
 			}
1136 1136
 			if (!getDolGlobalString('PROJECT_HIDE_TASKS') && getDolGlobalString('PROJECT_BILL_TIME_SPENT')) {
1137
-				print '<input type="checkbox" id="usage_bill_time" name="usage_bill_time"' . (GETPOSTISSET('usage_bill_time') ? (GETPOST('usage_bill_time', 'alpha') != '' ? ' checked="checked"' : '') : ($object->usage_bill_time ? ' checked="checked"' : '')) . '> ';
1137
+				print '<input type="checkbox" id="usage_bill_time" name="usage_bill_time"'.(GETPOSTISSET('usage_bill_time') ? (GETPOST('usage_bill_time', 'alpha') != '' ? ' checked="checked"' : '') : ($object->usage_bill_time ? ' checked="checked"' : '')).'> ';
1138 1138
 				$htmltext = $langs->trans("ProjectBillTimeDescription");
1139 1139
 				print '<label for="usage_bill_time">'.$form->textwithpicto($langs->trans("BillTime"), $htmltext).'</label>';
1140 1140
 				print '<script>';
@@ -1160,7 +1160,7 @@  discard block
 block discarded – undo
1160 1160
 				print '<br>';
1161 1161
 			}
1162 1162
 			if (isModEnabled('eventorganization')) {
1163
-				print '<input type="checkbox" id="usage_organize_event" name="usage_organize_event"'. (GETPOSTISSET('usage_organize_event') ? (GETPOST('usage_organize_event', 'alpha') != '' ? ' checked="checked"' : '') : ($object->usage_organize_event ? ' checked="checked"' : '')) . '> ';
1163
+				print '<input type="checkbox" id="usage_organize_event" name="usage_organize_event"'.(GETPOSTISSET('usage_organize_event') ? (GETPOST('usage_organize_event', 'alpha') != '' ? ' checked="checked"' : '') : ($object->usage_organize_event ? ' checked="checked"' : '')).'> ';
1164 1164
 				$htmltext = $langs->trans("EventOrganizationDescriptionLong");
1165 1165
 				print '<label for="usage_organize_event">'.$form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext).'</label>';
1166 1166
 				print '<script>';
@@ -1339,7 +1339,7 @@  discard block
 block discarded – undo
1339 1339
 		if (!empty($_SESSION['pageforbacktolist']) && !empty($_SESSION['pageforbacktolist']['project'])) {
1340 1340
 			$tmpurl = $_SESSION['pageforbacktolist']['project'];
1341 1341
 			$tmpurl = preg_replace('/__SOCID__/', (string) $object->socid, $tmpurl);
1342
-			$linkback = '<a href="'.$tmpurl.(preg_match('/\?/', $tmpurl) ? '&' : '?'). 'restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
1342
+			$linkback = '<a href="'.$tmpurl.(preg_match('/\?/', $tmpurl) ? '&' : '?').'restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
1343 1343
 		} else {
1344 1344
 			$linkback = '<a href="'.DOL_URL_ROOT.'/projet/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
1345 1345
 		}
@@ -1427,8 +1427,8 @@  discard block
 block discarded – undo
1427 1427
 				print '<a class="editfielda paddingtop" href="'.$_SERVER["PHP_SELF"].'?action=edit_opp_status&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('Edit'), 1).'</a>';
1428 1428
 			}
1429 1429
 			print '</td><td>';
1430
-			$html_name_status 	= ($action == 'edit_opp_status') ? 'opp_status' : 'none';
1431
-			$html_name_percent 	= ($action == 'edit_opp_status') ? 'opp_percent' : 'none';
1430
+			$html_name_status = ($action == 'edit_opp_status') ? 'opp_status' : 'none';
1431
+			$html_name_percent = ($action == 'edit_opp_status') ? 'opp_percent' : 'none';
1432 1432
 			$percent_value = (GETPOSTISSET('opp_percent') ? GETPOST('opp_percent') : (strcmp($object->opp_percent, '') ? vatrate($object->opp_percent) : ''));
1433 1433
 			$formproject->formOpportunityStatus($_SERVER['PHP_SELF'].'?socid='.$object->id, $object->opp_status, $percent_value, $html_name_status, $html_name_percent);
1434 1434
 			print '</td></tr>';
@@ -1641,7 +1641,7 @@  discard block
 block discarded – undo
1641 1641
 					if ($userWrite > 0) {
1642 1642
 						print dolGetButtonAction('', $langs->trans('SetToDraft'), 'default', $_SERVER["PHP_SELF"].'?action=confirm_setdraft&amp;confirm=yes&amp;token='.newToken().'&amp;id='.$object->id, '');
1643 1643
 					} else {
1644
-						print dolGetButtonAction($langs->trans('NotOwnerOfProject'), $langs->trans('SetToDraft'), 'default', $_SERVER['PHP_SELF']. '#', '', false);
1644
+						print dolGetButtonAction($langs->trans('NotOwnerOfProject'), $langs->trans('SetToDraft'), 'default', $_SERVER['PHP_SELF'].'#', '', false);
1645 1645
 					}
1646 1646
 				}
1647 1647
 			}
@@ -1651,7 +1651,7 @@  discard block
 block discarded – undo
1651 1651
 				if ($userWrite > 0) {
1652 1652
 					print dolGetButtonAction('', $langs->trans('Modify'), 'default', $_SERVER["PHP_SELF"].'?action=edit&token='.newToken().'&id='.$object->id, '');
1653 1653
 				} else {
1654
-					print dolGetButtonAction($langs->trans('NotOwnerOfProject'), $langs->trans('Modify'), 'default', $_SERVER['PHP_SELF']. '#', '', false);
1654
+					print dolGetButtonAction($langs->trans('NotOwnerOfProject'), $langs->trans('Modify'), 'default', $_SERVER['PHP_SELF'].'#', '', false);
1655 1655
 				}
1656 1656
 			}
1657 1657
 
@@ -1661,7 +1661,7 @@  discard block
 block discarded – undo
1661 1661
 					//print dolGetButtonAction('', $langs->trans('Validate'), 'default', $_SERVER["PHP_SELF"].'?action=validate&token='.newToken().'&id='.$object->id, '');
1662 1662
 					print dolGetButtonAction('', $langs->trans('Validate'), 'default', $_SERVER["PHP_SELF"].'?action=confirm_validate&confirm=yes&token='.newToken().'&id='.$object->id, '');
1663 1663
 				} else {
1664
-					print dolGetButtonAction($langs->trans('NotOwnerOfProject'), $langs->trans('Validate'), 'default', $_SERVER['PHP_SELF']. '#', '', false);
1664
+					print dolGetButtonAction($langs->trans('NotOwnerOfProject'), $langs->trans('Validate'), 'default', $_SERVER['PHP_SELF'].'#', '', false);
1665 1665
 				}
1666 1666
 			}
1667 1667
 
@@ -1671,7 +1671,7 @@  discard block
 block discarded – undo
1671 1671
 					//print dolGetButtonAction('', $langs->trans('Close'), 'default', $_SERVER["PHP_SELF"].'?action=close&amp;token='.newToken().'&amp;id='.$object->id, '');
1672 1672
 					print dolGetButtonAction('', $langs->trans('Close'), 'default', $_SERVER["PHP_SELF"].'?action=confirm_close&confirm=yes&token='.newToken().'&id='.$object->id, '');
1673 1673
 				} else {
1674
-					print dolGetButtonAction($langs->trans('NotOwnerOfProject'), $langs->trans('Close'), 'default', $_SERVER['PHP_SELF']. '#', '', false);
1674
+					print dolGetButtonAction($langs->trans('NotOwnerOfProject'), $langs->trans('Close'), 'default', $_SERVER['PHP_SELF'].'#', '', false);
1675 1675
 				}
1676 1676
 			}
1677 1677
 
@@ -1680,7 +1680,7 @@  discard block
 block discarded – undo
1680 1680
 				if ($userWrite > 0) {
1681 1681
 					print dolGetButtonAction('', $langs->trans('ReOpen'), 'default', $_SERVER["PHP_SELF"].'?action=reopen&amp;token='.newToken().'&amp;id='.$object->id, '');
1682 1682
 				} else {
1683
-					print dolGetButtonAction($langs->trans('NotOwnerOfProject'), $langs->trans('ReOpen'), 'default', $_SERVER['PHP_SELF']. '#', '', false);
1683
+					print dolGetButtonAction($langs->trans('NotOwnerOfProject'), $langs->trans('ReOpen'), 'default', $_SERVER['PHP_SELF'].'#', '', false);
1684 1684
 				}
1685 1685
 			}
1686 1686
 
@@ -1712,7 +1712,7 @@  discard block
 block discarded – undo
1712 1712
 				if ($userWrite > 0) {
1713 1713
 					print dolGetButtonAction('', $langs->trans('ToClone'), 'default', $_SERVER["PHP_SELF"].'?action=clone&token='.newToken().'&id='.((int) $object->id), '');
1714 1714
 				} else {
1715
-					print dolGetButtonAction($langs->trans('NotOwnerOfProject'), $langs->trans('ToClone'), 'default', $_SERVER['PHP_SELF']. '#', '', false);
1715
+					print dolGetButtonAction($langs->trans('NotOwnerOfProject'), $langs->trans('ToClone'), 'default', $_SERVER['PHP_SELF'].'#', '', false);
1716 1716
 				}
1717 1717
 			}
1718 1718
 
@@ -1721,7 +1721,7 @@  discard block
 block discarded – undo
1721 1721
 				if ($userDelete > 0 || ($object->status == Project::STATUS_DRAFT && $user->hasRight('projet', 'creer'))) {
1722 1722
 					print dolGetButtonAction('', $langs->trans('Delete'), 'delete', $_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&id='.$object->id, '');
1723 1723
 				} else {
1724
-					print dolGetButtonAction($langs->trans('NotOwnerOfProject'), $langs->trans('Delete'), 'default', $_SERVER['PHP_SELF']. '#', '', false);
1724
+					print dolGetButtonAction($langs->trans('NotOwnerOfProject'), $langs->trans('Delete'), 'default', $_SERVER['PHP_SELF'].'#', '', false);
1725 1725
 				}
1726 1726
 			}
1727 1727
 		}
Please login to merge, or discard this patch.
htdocs/compta/facture/prelevement.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -454,7 +454,7 @@  discard block
 block discarded – undo
454 454
 			$invoicecredits[] = $creditnote->getNomUrl(1);
455 455
 		}
456 456
 		print ' <span class="opacitymediumbycolor paddingleft">'.$langs->transnoentities("InvoiceHasAvoir");
457
-		print ' '. (count($invoicecredits) ? ' ' : '') . implode(',', $invoicecredits);
457
+		print ' '.(count($invoicecredits) ? ' ' : '').implode(',', $invoicecredits);
458 458
 		print '</span>';
459 459
 	}
460 460
 	/*
@@ -621,45 +621,45 @@  discard block
 block discarded – undo
621 621
 	}
622 622
 	print '<tr>';
623 623
 	// Amount HT
624
-	print '<td class="titlefieldmiddle">' . $langs->trans('AmountHT') . '</td>';
625
-	print '<td class="nowrap amountcard right">' . price($sign * $object->total_ht, 0, $langs, 0, -1, -1, $conf->currency) . '</td>';
624
+	print '<td class="titlefieldmiddle">'.$langs->trans('AmountHT').'</td>';
625
+	print '<td class="nowrap amountcard right">'.price($sign * $object->total_ht, 0, $langs, 0, -1, -1, $conf->currency).'</td>';
626 626
 	if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
627 627
 		// Multicurrency Amount HT
628
-		print '<td class="nowrap amountcard right">' . price($sign * $object->multicurrency_total_ht, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
628
+		print '<td class="nowrap amountcard right">'.price($sign * $object->multicurrency_total_ht, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
629 629
 	}
630 630
 	print '</tr>';
631 631
 
632 632
 	print '<tr>';
633 633
 	// Amount VAT
634
-	print '<td>' . $langs->trans('AmountVAT') . '</td>';
635
-	print '<td class="nowrap amountcard right">' . price($sign * $object->total_tva, 0, $langs, 0, -1, -1, $conf->currency) . '</td>';
634
+	print '<td>'.$langs->trans('AmountVAT').'</td>';
635
+	print '<td class="nowrap amountcard right">'.price($sign * $object->total_tva, 0, $langs, 0, -1, -1, $conf->currency).'</td>';
636 636
 	if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
637 637
 		// Multicurrency Amount VAT
638
-		print '<td class="nowrap amountcard right">' . price($sign * $object->multicurrency_total_tva, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
638
+		print '<td class="nowrap amountcard right">'.price($sign * $object->multicurrency_total_tva, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
639 639
 	}
640 640
 	print '</tr>';
641 641
 
642 642
 	// Amount Local Taxes
643 643
 	if (($mysoc->localtax1_assuj == "1" && $mysoc->useLocalTax(1)) || $object->total_localtax1 != 0) {
644 644
 		print '<tr>';
645
-		print '<td class="titlefieldmiddle">' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td>';
646
-		print '<td class="nowrap amountcard right">' . price($sign * $object->total_localtax1, 0, $langs, 0, -1, -1, $conf->currency) . '</td>';
645
+		print '<td class="titlefieldmiddle">'.$langs->transcountry("AmountLT1", $mysoc->country_code).'</td>';
646
+		print '<td class="nowrap amountcard right">'.price($sign * $object->total_localtax1, 0, $langs, 0, -1, -1, $conf->currency).'</td>';
647 647
 		if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
648 648
 			$object->multicurrency_total_localtax1 = (float) price2num($object->total_localtax1 * $object->multicurrency_tx, 'MT');
649 649
 
650
-			print '<td class="nowrap amountcard right">' . price($sign * $object->multicurrency_total_localtax1, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
650
+			print '<td class="nowrap amountcard right">'.price($sign * $object->multicurrency_total_localtax1, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
651 651
 		}
652 652
 		print '</tr>';
653 653
 	}
654 654
 
655 655
 	if (($mysoc->localtax2_assuj == "1" && $mysoc->useLocalTax(2)) || $object->total_localtax2 != 0) {
656 656
 		print '<tr>';
657
-		print '<td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td>';
658
-		print '<td class="nowrap amountcard right">' . price($sign * $object->total_localtax2, 0, $langs, 0, -1, -1, $conf->currency) . '</td>';
657
+		print '<td>'.$langs->transcountry("AmountLT2", $mysoc->country_code).'</td>';
658
+		print '<td class="nowrap amountcard right">'.price($sign * $object->total_localtax2, 0, $langs, 0, -1, -1, $conf->currency).'</td>';
659 659
 		if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
660 660
 			$object->multicurrency_total_localtax2 = (float) price2num($object->total_localtax2 * $object->multicurrency_tx, 'MT');
661 661
 
662
-			print '<td class="nowrap amountcard right">' . price($sign * $object->multicurrency_total_localtax2, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
662
+			print '<td class="nowrap amountcard right">'.price($sign * $object->multicurrency_total_localtax2, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
663 663
 		}
664 664
 		print '</tr>';
665 665
 	}
@@ -681,11 +681,11 @@  discard block
 block discarded – undo
681 681
 
682 682
 	print '<tr>';
683 683
 	// Amount TTC
684
-	print '<td>' . $langs->trans('AmountTTC') . '</td>';
685
-	print '<td class="nowrap amountcard right">' . price($sign * $object->total_ttc, 0, $langs, 0, -1, -1, $conf->currency) . '</td>';
684
+	print '<td>'.$langs->trans('AmountTTC').'</td>';
685
+	print '<td class="nowrap amountcard right">'.price($sign * $object->total_ttc, 0, $langs, 0, -1, -1, $conf->currency).'</td>';
686 686
 	if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
687 687
 		// Multicurrency Amount TTC
688
-		print '<td class="nowrap amountcard right">' . price($sign * $object->multicurrency_total_ttc, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
688
+		print '<td class="nowrap amountcard right">'.price($sign * $object->multicurrency_total_ttc, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
689 689
 	}
690 690
 	print '</tr>';
691 691
 
Please login to merge, or discard this patch.