Completed
Branch develop (4dc8eb)
by
unknown
14:58
created
htdocs/comm/mailing/cibles.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -362,7 +362,7 @@  discard block
 block discarded – undo
362 362
 			}
363 363
 		}
364 364
 		if (empty($nbemail)) {
365
-			$nbemail .= ' '.img_warning($langs->trans('ToAddRecipientsChooseHere'));//.' <span class="warning">'.$langs->trans("NoTargetYet").'</span>';
365
+			$nbemail .= ' '.img_warning($langs->trans('ToAddRecipientsChooseHere')); //.' <span class="warning">'.$langs->trans("NoTargetYet").'</span>';
366 366
 		}
367 367
 		if ($text) {
368 368
 			// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
@@ -441,7 +441,7 @@  discard block
 block discarded – undo
441 441
 		}
442 442
 		print '</div>';
443 443
 		print '<div class="tagtd">&nbsp;</div>';
444
-		print '</div>';	// End tr
444
+		print '</div>'; // End tr
445 445
 
446 446
 		clearstatcache();
447 447
 
@@ -512,12 +512,12 @@  discard block
 block discarded – undo
512 512
 					}
513 513
 					print img_object($langs->trans("EmailingTargetSelector").': '.get_class($obj), $obj->picto, 'class="valignmiddle width25 size15x"');
514 514
 					print '</div>';
515
-					print '<div class="tagtd valignmiddle">';	//  style="height: 4em"
515
+					print '<div class="tagtd valignmiddle">'; //  style="height: 4em"
516 516
 					print $obj->getDesc();
517 517
 					print '</div>';
518 518
 
519 519
 					try {
520
-						$obj->evenunsubscribe = $object->evenunsubscribe;	// Set flag to include/exclude email that has opt-out.
520
+						$obj->evenunsubscribe = $object->evenunsubscribe; // Set flag to include/exclude email that has opt-out.
521 521
 
522 522
 						$nbofrecipient = $obj->getNbOfRecipients('');
523 523
 					} catch (Exception $e) {
@@ -570,7 +570,7 @@  discard block
 block discarded – undo
570 570
 		$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
571 571
 		print $hookmanager->resPrint;
572 572
 
573
-		print '</div>';	// End table
573
+		print '</div>'; // End table
574 574
 		print '</div>';
575 575
 
576 576
 		print '<br>';
Please login to merge, or discard this patch.
htdocs/comm/action/index.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 	$conf->global->AGENDA_EXT_NB = 5;
51 51
 }
52 52
 $MAXAGENDA = getDolGlobalString('AGENDA_EXT_NB');
53
-$DELAYFORCACHE = 300;	// 300 seconds
53
+$DELAYFORCACHE = 300; // 300 seconds
54 54
 
55 55
 $disabledefaultvalues = GETPOSTINT('disabledefaultvalues');
56 56
 
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 
108 108
 $mode = GETPOST('mode', 'aZ09');
109 109
 if (empty($mode) && preg_match('/show_/', $action)) {
110
-	$mode = $action;	// For backward compatibility
110
+	$mode = $action; // For backward compatibility
111 111
 }
112 112
 $resourceid = GETPOST("search_resourceid", 'int');
113 113
 $year = GETPOSTINT("year") ? GETPOSTINT("year") : date("Y");
@@ -141,8 +141,8 @@  discard block
 block discarded – undo
141 141
 	$status = ((!getDolGlobalString('AGENDA_DEFAULT_FILTER_STATUS') || $disabledefaultvalues) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_STATUS);
142 142
 }
143 143
 
144
-$defaultview = getDolGlobalString('AGENDA_DEFAULT_VIEW', 'show_month');	// default for app
145
-$defaultview = getDolUserString('AGENDA_DEFAULT_VIEW', $defaultview);	// default for user
144
+$defaultview = getDolGlobalString('AGENDA_DEFAULT_VIEW', 'show_month'); // default for app
145
+$defaultview = getDolUserString('AGENDA_DEFAULT_VIEW', $defaultview); // default for user
146 146
 if (empty($mode) && !GETPOSTISSET('mode')) {
147 147
 	$mode = $defaultview;
148 148
 }
@@ -537,7 +537,7 @@  discard block
 block discarded – undo
537 537
 
538 538
 $viewmode .= '</div>';
539 539
 
540
-$viewmode .= '<span class="marginrightonly"></span>';	// To add a space before the navigation tools
540
+$viewmode .= '<span class="marginrightonly"></span>'; // To add a space before the navigation tools
541 541
 
542 542
 
543 543
 $newcardbutton = '';
@@ -548,7 +548,7 @@  discard block
 block discarded – undo
548 548
 	$newparam .= '&month='.((int) $month).'&year='.((int) $tmpforcreatebutton['year']).'&mode='.urlencode($mode);
549 549
 
550 550
 	//$param='month='.$monthshown.'&year='.$year;
551
-	$hourminsec = dol_print_date(dol_mktime(10, 0, 0, 1, 1, 1970, 'gmt'), '%H', 'gmt').'0000';	// Set $hourminsec to '100000' to auto set hour to 10:00 at creation
551
+	$hourminsec = dol_print_date(dol_mktime(10, 0, 0, 1, 1, 1970, 'gmt'), '%H', 'gmt').'0000'; // Set $hourminsec to '100000' to auto set hour to 10:00 at creation
552 552
 
553 553
 	$urltocreateaction = DOL_URL_ROOT.'/comm/action/card.php?action=create';
554 554
 	$urltocreateaction .= '&apyear='.$tmpforcreatebutton['year'].'&apmonth='.$tmpforcreatebutton['mon'].'&apday='.$tmpforcreatebutton['mday'].'&aphour='.$tmpforcreatebutton['hours'].'&apmin='.$tmpforcreatebutton['minutes'];
@@ -574,7 +574,7 @@  discard block
 block discarded – undo
574 574
 	$sql .= " WHERE bc.status = 1";
575 575
 	$sql .= " AND ba.status = 1";
576 576
 	if (!empty($filtert) && $filtert != -1) {
577
-		$sql .= " AND bc.visibility = ".(int) $filtert ;
577
+		$sql .= " AND bc.visibility = ".(int) $filtert;
578 578
 	}
579 579
 	$resql = $db->query($sql);
580 580
 	if ($resql) {
@@ -627,9 +627,9 @@  discard block
 block discarded – undo
627 627
 		// Holiday calendar
628 628
 		$s .= '
629 629
             <div class="nowrap inline-block minheight30"><input type="checkbox" id="check_holiday" name="check_holiday" value="1" class="check_holiday"' . ($check_holiday
630
-					? ' checked' : '') . '>
630
+					? ' checked' : '').'>
631 631
                 <label for="check_holiday">
632
-                    <span class="check_holiday_text">' . $langs->trans("Holidays") . '</span>
632
+                    <span class="check_holiday_text">' . $langs->trans("Holidays").'</span>
633 633
                 </label> &nbsp;
634 634
             </div>';
635 635
 	}
@@ -655,7 +655,7 @@  discard block
 block discarded – undo
655 655
 		$s .= '</script>'."\n";
656 656
 
657 657
 		foreach ($showextcals as $val) {
658
-			$htmlname = md5($val['name']);	// not used for security purpose, only to get a string with no special char
658
+			$htmlname = md5($val['name']); // not used for security purpose, only to get a string with no special char
659 659
 
660 660
 			if (!empty($val['default']) || GETPOSTINT('check_ext'.$htmlname)) {
661 661
 				$default = "checked";
@@ -900,7 +900,7 @@  discard block
 block discarded – undo
900 900
 		// event->datep and event->datef must be GMT date.
901 901
 		if ($event->fulldayevent) {
902 902
 			$tzforfullday = getDolGlobalString('MAIN_STORE_FULL_EVENT_IN_GMT');
903
-			$event->datep = $db->jdate($obj->datep, $tzforfullday ? 'tzuser' : 'tzserver');	// If saved in $tzforfullday = gmt, we must invert date to be in user tz
903
+			$event->datep = $db->jdate($obj->datep, $tzforfullday ? 'tzuser' : 'tzserver'); // If saved in $tzforfullday = gmt, we must invert date to be in user tz
904 904
 			$event->datef = $db->jdate($obj->datep2, $tzforfullday ? 'tzuser' : 'tzserver');
905 905
 		} else {
906 906
 			// Example: $obj->datep = '1970-01-01 01:00:00', jdate will return 0 if TZ of PHP server is Europe/Berlin (+1)
@@ -977,8 +977,8 @@  discard block
 block discarded – undo
977 977
 			// Loop on each day covered by action to prepare an index to show on calendar
978 978
 			$loop = true;
979 979
 			$j = 0;
980
-			$daykey = dol_mktime(0, 0, 0, $mois, $jour, $annee, 'gmt');	// $mois, $jour, $annee has been set for user tz
981
-			$daykeyend = dol_mktime(0, 0, 0, $moisend, $jourend, $anneeend, 'gmt');	// $moisend, $jourend, $anneeend has been set for user tz
980
+			$daykey = dol_mktime(0, 0, 0, $mois, $jour, $annee, 'gmt'); // $mois, $jour, $annee has been set for user tz
981
+			$daykeyend = dol_mktime(0, 0, 0, $moisend, $jourend, $anneeend, 'gmt'); // $moisend, $jourend, $anneeend has been set for user tz
982 982
 			/*
983 983
 			 print 'GMT '.$event->date_start_in_calendar.' '.dol_print_date($event->date_start_in_calendar, 'dayhour', 'gmt').'<br>';
984 984
 			 print 'TZSERVER '.$event->date_start_in_calendar.' '.dol_print_date($event->date_start_in_calendar, 'dayhour', 'tzserver').'<br>';
@@ -1106,7 +1106,7 @@  discard block
 block discarded – undo
1106 1106
 
1107 1107
 	if ($mode == 'show_day') {
1108 1108
 		// Request only leaves for the current selected day
1109
-		$sql .= " AND '".$db->escape($year)."-".$db->escape($month)."-".$db->escape($day)."' BETWEEN x.date_debut AND x.date_fin";	// date_debut and date_fin are date without time
1109
+		$sql .= " AND '".$db->escape($year)."-".$db->escape($month)."-".$db->escape($day)."' BETWEEN x.date_debut AND x.date_fin"; // date_debut and date_fin are date without time
1110 1110
 	} elseif ($mode == 'show_week') {
1111 1111
 		// Restrict on current month (we get more, but we will filter later)
1112 1112
 		$sql .= " AND date_debut < '".$db->idate(dol_get_last_day($year, $month))."'";
@@ -1652,7 +1652,7 @@  discard block
 block discarded – undo
1652 1652
 
1653 1653
 	for ($iter_day = 0; $iter_day < 7; $iter_day++) {
1654 1654
 		// Show days of the current week
1655
-		$curtime = dol_time_plus_duree($firstdaytoshow, $iter_day, 'd');		// $firstdaytoshow is in timezone of server
1655
+		$curtime = dol_time_plus_duree($firstdaytoshow, $iter_day, 'd'); // $firstdaytoshow is in timezone of server
1656 1656
 		$tmpday = dol_print_date($curtime, '%d', 'tzuserrel');
1657 1657
 		$tmpmonth = dol_print_date($curtime, '%m', 'tzuserrel');
1658 1658
 		$tmpyear = dol_print_date($curtime, '%Y', 'tzuserrel');
@@ -1882,9 +1882,9 @@  discard block
 block discarded – undo
1882 1882
 	$tmpholiday = new Holiday($db);
1883 1883
 
1884 1884
 	foreach ($eventarray as $daykey => $notused) {		// daykey is the 'YYYYMMDD' to show according to user
1885
-		$annee = dol_print_date($daykey, '%Y', 'gmt');	// We use gmt because we want the value represented by string 'YYYYMMDD'
1886
-		$mois =  dol_print_date($daykey, '%m', 'gmt');	// We use gmt because we want the value represented by string 'YYYYMMDD'
1887
-		$jour =  dol_print_date($daykey, '%d', 'gmt');	// We use gmt because we want the value represented by string 'YYYYMMDD'
1885
+		$annee = dol_print_date($daykey, '%Y', 'gmt'); // We use gmt because we want the value represented by string 'YYYYMMDD'
1886
+		$mois = dol_print_date($daykey, '%m', 'gmt'); // We use gmt because we want the value represented by string 'YYYYMMDD'
1887
+		$jour = dol_print_date($daykey, '%d', 'gmt'); // We use gmt because we want the value represented by string 'YYYYMMDD'
1888 1888
 
1889 1889
 		//print 'event daykey='.$daykey.' dol_print_date(daykey)='.dol_print_date($daykey, 'dayhour', 'gmt').' jour='.$jour.' mois='.$mois.' annee='.$annee."<br>\n";
1890 1890
 		//print 'event daykey='.$daykey.' dol_print_date(daykey)='.dol_print_date($daykey, 'dayhour', 'gmt').' day='.$day.' month='.$month.' year='.$year."<br>\n";
@@ -2175,7 +2175,7 @@  discard block
 block discarded – undo
2175 2175
 								$event->label = $titletoshow;
2176 2176
 								// Note: List of users are inside $event->userassigned. Link may be clickable depending on permissions of user.
2177 2177
 								$titletoshow = (($event->type_picto || $event->type_code) ? $event->getTypePicto() : '');
2178
-								$titletoshow .= $event->getNomUrl(0, $maxnbofchar, 'cal_event cal_event_title valignmiddle', '', 0, 0);	// do not add 'inline-block' in css here: it makes the title transformed completely into '...'
2178
+								$titletoshow .= $event->getNomUrl(0, $maxnbofchar, 'cal_event cal_event_title valignmiddle', '', 0, 0); // do not add 'inline-block' in css here: it makes the title transformed completely into '...'
2179 2179
 								$event->label = $savlabel;
2180 2180
 							}
2181 2181
 
Please login to merge, or discard this patch.
htdocs/expensereport/payment/list.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -58,20 +58,20 @@  discard block
 block discarded – undo
58 58
 	$socid = $user->socid;
59 59
 }
60 60
 
61
-$search_ref				= GETPOST('search_ref', 'alpha');
62
-$search_date_startday	= GETPOSTINT('search_date_startday');
63
-$search_date_startmonth	= GETPOSTINT('search_date_startmonth');
64
-$search_date_startyear	= GETPOSTINT('search_date_startyear');
61
+$search_ref = GETPOST('search_ref', 'alpha');
62
+$search_date_startday = GETPOSTINT('search_date_startday');
63
+$search_date_startmonth = GETPOSTINT('search_date_startmonth');
64
+$search_date_startyear = GETPOSTINT('search_date_startyear');
65 65
 $search_date_endday		= GETPOSTINT('search_date_endday');
66
-$search_date_endmonth	= GETPOSTINT('search_date_endmonth');
66
+$search_date_endmonth = GETPOSTINT('search_date_endmonth');
67 67
 $search_date_endyear	= GETPOSTINT('search_date_endyear');
68
-$search_date_start		= dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear);	// Use tzserver
69
-$search_date_end		= dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear);
70
-$search_user			= GETPOST('search_user', 'alpha');
68
+$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver
69
+$search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear);
70
+$search_user = GETPOST('search_user', 'alpha');
71 71
 $search_payment_type	= GETPOST('search_payment_type');
72
-$search_cheque_num		= GETPOST('search_cheque_num', 'alpha');
72
+$search_cheque_num = GETPOST('search_cheque_num', 'alpha');
73 73
 $search_bank_account	= GETPOST('search_bank_account', 'int');
74
-$search_amount			= GETPOST('search_amount', 'alpha'); // alpha because we must be able to search on '< x'
74
+$search_amount = GETPOST('search_amount', 'alpha'); // alpha because we must be able to search on '< x'
75 75
 
76 76
 $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
77 77
 $sortfield				= GETPOST('sortfield', 'aZ09comma');
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 	'pndf.amount'			=> array('label' => "Amount", 'checked' => 1, 'position' => 70),
113 113
 );
114 114
 $arrayfields = dol_sort_array($arrayfields, 'position');
115
-'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields';  // dol_sort_array looses type for Phan
115
+'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan
116 116
 
117 117
 // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
118 118
 $hookmanager->initHooks(array('paymentexpensereportlist'));
@@ -202,10 +202,10 @@  discard block
 block discarded – undo
202 202
 	$sql .= natural_search('pndf.rowid', $search_ref);
203 203
 }
204 204
 if ($search_date_start) {
205
-	$sql .= " AND pndf.datep >= '" . $db->idate($search_date_start) . "'";
205
+	$sql .= " AND pndf.datep >= '".$db->idate($search_date_start)."'";
206 206
 }
207 207
 if ($search_date_end) {
208
-	$sql .= " AND pndf.datep <= '" . $db->idate($search_date_end) . "'";
208
+	$sql .= " AND pndf.datep <= '".$db->idate($search_date_end)."'";
209 209
 }
210 210
 
211 211
 if ($search_user) {
Please login to merge, or discard this patch.
htdocs/fourn/paiement/list.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -53,21 +53,21 @@  discard block
 block discarded – undo
53 53
 
54 54
 $socid = GETPOSTINT('socid');
55 55
 
56
-$search_ref				= GETPOST('search_ref', 'alpha');
57
-$search_date_startday	= GETPOSTINT('search_date_startday');
58
-$search_date_startmonth	= GETPOSTINT('search_date_startmonth');
59
-$search_date_startyear	= GETPOSTINT('search_date_startyear');
56
+$search_ref = GETPOST('search_ref', 'alpha');
57
+$search_date_startday = GETPOSTINT('search_date_startday');
58
+$search_date_startmonth = GETPOSTINT('search_date_startmonth');
59
+$search_date_startyear = GETPOSTINT('search_date_startyear');
60 60
 $search_date_endday		= GETPOSTINT('search_date_endday');
61
-$search_date_endmonth	= GETPOSTINT('search_date_endmonth');
61
+$search_date_endmonth = GETPOSTINT('search_date_endmonth');
62 62
 $search_date_endyear	= GETPOSTINT('search_date_endyear');
63
-$search_date_start		= dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear);	// Use tzserver
63
+$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver
64 64
 $search_date_end		= dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear);
65 65
 $search_company			= GETPOST('search_company', 'alpha');
66 66
 $search_payment_type	= GETPOST('search_payment_type', 'alpha');
67
-$search_cheque_num		= GETPOST('search_cheque_num', 'alpha');
67
+$search_cheque_num = GETPOST('search_cheque_num', 'alpha');
68 68
 $search_bank_account	= GETPOST('search_bank_account', 'int');
69
-$search_amount			= GETPOST('search_amount', 'alpha'); // alpha because we must be able to search on '< x'
70
-$search_sale            = GETPOSTINT('search_sale');
69
+$search_amount = GETPOST('search_amount', 'alpha'); // alpha because we must be able to search on '< x'
70
+$search_sale = GETPOSTINT('search_sale');
71 71
 
72 72
 $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
73 73
 $sortfield				= GETPOST('sortfield', 'aZ09comma');
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
 	'p.amount'			=> array('label' => "Amount", 'checked' => 1, 'position' => 70),
109 109
 );
110 110
 $arrayfields = dol_sort_array($arrayfields, 'position');
111
-'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields';  // dol_sort_array looses type for Phan
111
+'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan
112 112
 
113 113
 // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
114 114
 $hookmanager->initHooks(array('paymentsupplierlist'));
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
 $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'facture_fourn AS f ON f.rowid = pf.fk_facturefourn';
204 204
 $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe AS s ON s.rowid = f.fk_soc';
205 205
 
206
-$sql .= ' WHERE f.entity IN ('.getEntity('supplier_invoice').')';		// TODO We should use p.entity that does not exists yet in this table
206
+$sql .= ' WHERE f.entity IN ('.getEntity('supplier_invoice').')'; // TODO We should use p.entity that does not exists yet in this table
207 207
 if ($socid > 0) {
208 208
 	$sql .= " AND EXISTS (SELECT f.fk_soc FROM ".MAIN_DB_PREFIX."facture_fourn as f, ".MAIN_DB_PREFIX."paiementfourn_facturefourn as pf";
209 209
 	$sql .= " WHERE p.rowid = pf.fk_paiementfourn AND pf.fk_facturefourn = f.rowid AND f.fk_soc = ".((int) $socid).")";
@@ -214,10 +214,10 @@  discard block
 block discarded – undo
214 214
 	$sql .= natural_search('p.ref', $search_ref);
215 215
 }
216 216
 if ($search_date_start) {
217
-	$sql .= " AND p.datep >= '" . $db->idate($search_date_start) . "'";
217
+	$sql .= " AND p.datep >= '".$db->idate($search_date_start)."'";
218 218
 }
219 219
 if ($search_date_end) {
220
-	$sql .= " AND p.datep <= '" . $db->idate($search_date_end) . "'";
220
+	$sql .= " AND p.datep <= '".$db->idate($search_date_end)."'";
221 221
 }
222 222
 
223 223
 if ($search_company) {
Please login to merge, or discard this patch.
htdocs/core/modules/modUser.class.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -276,7 +276,7 @@
 block discarded – undo
276 276
 		$r++;
277 277
 		$this->export_code[$r] = $this->rights_class.'_'.$r;
278 278
 		$this->export_label[$r] = 'List of security events';
279
-		$this->export_permission[$r] = array(array("user"));	// Only admin
279
+		$this->export_permission[$r] = array(array("user")); // Only admin
280 280
 		$this->export_fields_array[$r] = array(
281 281
 			'e.rowid'=>"Id", 'e.type'=>"Type",
282 282
 			'e.dateevent'=>"Date",
Please login to merge, or discard this patch.
htdocs/core/class/html.form.class.php 1 patch
Spacing   +1223 added lines, -1223 removed lines patch added patch discarded remove patch
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 		if (getDolGlobalString('MAIN_USE_JQUERY_JEDITABLE') && !preg_match('/^select;/', $typeofdata)) {
123 123
 			if (!empty($perm)) {
124 124
 				$tmp = explode(':', $typeofdata);
125
-				$ret .= '<div class="editkey_' . $tmp[0] . (!empty($tmp[1]) ? ' ' . $tmp[1] : '') . '" id="' . $htmlname . '">';
125
+				$ret .= '<div class="editkey_'.$tmp[0].(!empty($tmp[1]) ? ' '.$tmp[1] : '').'" id="'.$htmlname.'">';
126 126
 				if ($fieldrequired) {
127 127
 					$ret .= '<span class="fieldrequired">';
128 128
 				}
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
 				if ($fieldrequired) {
135 135
 					$ret .= '</span>';
136 136
 				}
137
-				$ret .= '</div>' . "\n";
137
+				$ret .= '</div>'."\n";
138 138
 			} else {
139 139
 				if ($fieldrequired) {
140 140
 					$ret .= '<span class="fieldrequired">';
@@ -172,8 +172,8 @@  discard block
 block discarded – undo
172 172
 			if (empty($notabletag) && $perm) {
173 173
 				$ret .= '<td class="right">';
174 174
 			}
175
-			if ($htmlname && GETPOST('action', 'aZ09') != 'edit' . $htmlname && $perm) {
176
-				$ret .= '<a class="editfielda reposition" href="' . $_SERVER["PHP_SELF"] . '?action=edit' . $htmlname . '&token=' . newToken() . '&' . $paramid . '=' . $object->id . $moreparam . '">' . img_edit($langs->trans('Edit'), ($notabletag ? 0 : 1)) . '</a>';
175
+			if ($htmlname && GETPOST('action', 'aZ09') != 'edit'.$htmlname && $perm) {
176
+				$ret .= '<a class="editfielda reposition" href="'.$_SERVER["PHP_SELF"].'?action=edit'.$htmlname.'&token='.newToken().'&'.$paramid.'='.$object->id.$moreparam.'">'.img_edit($langs->trans('Edit'), ($notabletag ? 0 : 1)).'</a>';
177 177
 			}
178 178
 			if (!empty($notabletag) && $notabletag == 1) {
179 179
 				if ($text) {
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
 			} elseif ($reg[1] == 'int') {
241 241
 				$typeofdata = 'numeric';
242 242
 			} else {
243
-				return 'ErrorBadParameter ' . $typeofdata;
243
+				return 'ErrorBadParameter '.$typeofdata;
244 244
 			}
245 245
 		}
246 246
 
@@ -251,13 +251,13 @@  discard block
 block discarded – undo
251 251
 			if ($editaction == '') {
252 252
 				$editaction = GETPOST('action', 'aZ09');
253 253
 			}
254
-			$editmode = ($editaction == 'edit' . $htmlname);
254
+			$editmode = ($editaction == 'edit'.$htmlname);
255 255
 			if ($editmode) {	// edit mode
256 256
 				$ret .= "\n";
257
-				$ret .= '<form method="post" action="' . $_SERVER["PHP_SELF"] . ($moreparam ? '?' . $moreparam : '') . '">';
258
-				$ret .= '<input type="hidden" name="action" value="set' . $htmlname . '">';
259
-				$ret .= '<input type="hidden" name="token" value="' . newToken() . '">';
260
-				$ret .= '<input type="hidden" name="' . $paramid . '" value="' . $object->id . '">';
257
+				$ret .= '<form method="post" action="'.$_SERVER["PHP_SELF"].($moreparam ? '?'.$moreparam : '').'">';
258
+				$ret .= '<input type="hidden" name="action" value="set'.$htmlname.'">';
259
+				$ret .= '<input type="hidden" name="token" value="'.newToken().'">';
260
+				$ret .= '<input type="hidden" name="'.$paramid.'" value="'.$object->id.'">';
261 261
 				if (empty($notabletag)) {
262 262
 					$ret .= '<table class="nobordernopadding centpercent">';
263 263
 				}
@@ -266,28 +266,28 @@  discard block
 block discarded – undo
266 266
 				}
267 267
 				if (preg_match('/^(string|safehtmlstring|email|phone|url)/', $typeofdata)) {
268 268
 					$tmp = explode(':', $typeofdata);
269
-					$ret .= '<input type="text" id="' . $htmlname . '" name="' . $htmlname . '" value="' . ($editvalue ? $editvalue : $value) . '"' . (empty($tmp[1]) ? '' : ' size="' . $tmp[1] . '"') . ' autofocus>';
269
+					$ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($editvalue ? $editvalue : $value).'"'.(empty($tmp[1]) ? '' : ' size="'.$tmp[1].'"').' autofocus>';
270 270
 				} elseif (preg_match('/^(integer)/', $typeofdata)) {
271 271
 					$tmp = explode(':', $typeofdata);
272 272
 					$valuetoshow = price2num($editvalue ? $editvalue : $value, 0);
273
-					$ret .= '<input type="text" id="' . $htmlname . '" name="' . $htmlname . '" value="' . $valuetoshow . '"' . (empty($tmp[1]) ? '' : ' size="' . $tmp[1] . '"') . ' autofocus>';
273
+					$ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.$valuetoshow.'"'.(empty($tmp[1]) ? '' : ' size="'.$tmp[1].'"').' autofocus>';
274 274
 				} elseif (preg_match('/^(numeric|amount)/', $typeofdata)) {
275 275
 					$tmp = explode(':', $typeofdata);
276 276
 					$valuetoshow = price2num($editvalue ? $editvalue : $value);
277
-					$ret .= '<input type="text" id="' . $htmlname . '" name="' . $htmlname . '" value="' . ($valuetoshow != '' ? price($valuetoshow) : '') . '"' . (empty($tmp[1]) ? '' : ' size="' . $tmp[1] . '"') . ' autofocus>';
277
+					$ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($valuetoshow != '' ? price($valuetoshow) : '').'"'.(empty($tmp[1]) ? '' : ' size="'.$tmp[1].'"').' autofocus>';
278 278
 				} elseif (preg_match('/^(checkbox)/', $typeofdata)) {
279 279
 					$tmp = explode(':', $typeofdata);
280
-					$ret .= '<input type="checkbox" id="' . $htmlname . '" name="' . $htmlname . '" value="' . ($value ? $value : 'on') . '"' . ($value ? ' checked' : '') . (empty($tmp[1]) ? '' : $tmp[1]) . '/>';
280
+					$ret .= '<input type="checkbox" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($value ? $value : 'on').'"'.($value ? ' checked' : '').(empty($tmp[1]) ? '' : $tmp[1]).'/>';
281 281
 				} elseif (preg_match('/^text/', $typeofdata) || preg_match('/^note/', $typeofdata)) {    // if wysiwyg is enabled $typeofdata = 'ckeditor'
282 282
 					$tmp = explode(':', $typeofdata);
283 283
 					$cols = (empty($tmp[2]) ? '' : $tmp[2]);
284 284
 					$morealt = '';
285 285
 					if (preg_match('/%/', $cols)) {
286
-						$morealt = ' style="width: ' . $cols . '"';
286
+						$morealt = ' style="width: '.$cols.'"';
287 287
 						$cols = '';
288 288
 					}
289 289
 					$valuetoshow = ($editvalue ? $editvalue : $value);
290
-					$ret .= '<textarea id="' . $htmlname . '" name="' . $htmlname . '" wrap="soft" rows="' . (empty($tmp[1]) ? '20' : $tmp[1]) . '"' . ($cols ? ' cols="' . $cols . '"' : 'class="quatrevingtpercent"') . $morealt . '" autofocus>';
290
+					$ret .= '<textarea id="'.$htmlname.'" name="'.$htmlname.'" wrap="soft" rows="'.(empty($tmp[1]) ? '20' : $tmp[1]).'"'.($cols ? ' cols="'.$cols.'"' : 'class="quatrevingtpercent"').$morealt.'" autofocus>';
291 291
 					// textarea convert automatically entities chars into simple chars.
292 292
 					// So we convert & into &amp; so a string like 'a &lt; <b>b</b><br>é<br>&lt;script&gt;alert('X');&lt;script&gt;' stay a correct html and is not converted by textarea component when wysiwig is off.
293 293
 					$valuetoshow = str_replace('&', '&amp;', $valuetoshow);
@@ -297,12 +297,12 @@  discard block
 block discarded – undo
297 297
 					$addnowlink = empty($moreoptions['addnowlink']) ? 0 : $moreoptions['addnowlink'];
298 298
 					$adddateof = empty($moreoptions['adddateof']) ? '' : $moreoptions['adddateof'];
299 299
 					$labeladddateof = empty($moreoptions['labeladddateof']) ? '' : $moreoptions['labeladddateof'];
300
-					$ret .= $this->selectDate($value, $htmlname, 0, 0, 1, 'form' . $htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm);
300
+					$ret .= $this->selectDate($value, $htmlname, 0, 0, 1, 'form'.$htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm);
301 301
 				} elseif ($typeofdata == 'dayhour' || $typeofdata == 'datehourpicker') {
302 302
 					$addnowlink = empty($moreoptions['addnowlink']) ? 0 : $moreoptions['addnowlink'];
303 303
 					$adddateof = empty($moreoptions['adddateof']) ? '' : $moreoptions['adddateof'];
304 304
 					$labeladddateof = empty($moreoptions['labeladddateof']) ? '' : $moreoptions['labeladddateof'];
305
-					$ret .= $this->selectDate($value, $htmlname, 1, 1, 1, 'form' . $htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm);
305
+					$ret .= $this->selectDate($value, $htmlname, 1, 1, 1, 'form'.$htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm);
306 306
 				} elseif (preg_match('/^select;/', $typeofdata)) {
307 307
 					$arraydata = explode(',', preg_replace('/^select;/', '', $typeofdata));
308 308
 					$arraylist = array();
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
 					// TODO Not yet implemented. See code for extrafields
317 317
 				} elseif (preg_match('/^ckeditor/', $typeofdata)) {
318 318
 					$tmp = explode(':', $typeofdata); // Example: ckeditor:dolibarr_zzz:width:height:savemethod:toolbarstartexpanded:rows:cols:uselocalbrowser
319
-					require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';
319
+					require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
320 320
 					$doleditor = new DolEditor($htmlname, ($editvalue ? $editvalue : $value), (empty($tmp[2]) ? '' : $tmp[2]), (empty($tmp[3]) ? '100' : $tmp[3]), (empty($tmp[1]) ? 'dolibarr_notes' : $tmp[1]), 'In', (empty($tmp[5]) ? 0 : $tmp[5]), (isset($tmp[8]) ? ($tmp[8] ? true : false) : true), true, (empty($tmp[6]) ? '20' : $tmp[6]), (empty($tmp[7]) ? '100' : $tmp[7]));
321 321
 					$ret .= $doleditor->Create(1);
322 322
 				} elseif ($typeofdata == 'asis') {
@@ -331,19 +331,19 @@  discard block
 block discarded – undo
331 331
 					$ret .= '<td>';
332 332
 				}
333 333
 				//else $ret.='<div class="clearboth"></div>';
334
-				$ret .= '<input type="submit" class="smallpaddingimp button' . (empty($notabletag) ? '' : ' ') . '" name="modify" value="' . $langs->trans("Modify") . '">';
334
+				$ret .= '<input type="submit" class="smallpaddingimp button'.(empty($notabletag) ? '' : ' ').'" name="modify" value="'.$langs->trans("Modify").'">';
335 335
 				if (preg_match('/ckeditor|textarea/', $typeofdata) && empty($notabletag)) {
336
-					$ret .= '<br>' . "\n";
336
+					$ret .= '<br>'."\n";
337 337
 				}
338
-				$ret .= '<input type="submit" class="smallpaddingimp button button-cancel' . (empty($notabletag) ? '' : ' ') . '" name="cancel" value="' . $langs->trans("Cancel") . '">';
338
+				$ret .= '<input type="submit" class="smallpaddingimp button button-cancel'.(empty($notabletag) ? '' : ' ').'" name="cancel" value="'.$langs->trans("Cancel").'">';
339 339
 				if (empty($notabletag)) {
340 340
 					$ret .= '</td>';
341 341
 				}
342 342
 
343 343
 				if (empty($notabletag)) {
344
-					$ret .= '</tr></table>' . "\n";
344
+					$ret .= '</tr></table>'."\n";
345 345
 				}
346
-				$ret .= '</form>' . "\n";
346
+				$ret .= '</form>'."\n";
347 347
 			} else {		// view mode
348 348
 				if (preg_match('/^email/', $typeofdata)) {
349 349
 					$ret .= dol_print_email($value, 0, 0, 0, 0, 1);
@@ -355,15 +355,15 @@  discard block
 block discarded – undo
355 355
 					$ret .= ($value != '' ? price($value, 0, $langs, 0, -1, -1, $conf->currency) : '');
356 356
 				} elseif (preg_match('/^checkbox/', $typeofdata)) {
357 357
 					$tmp = explode(':', $typeofdata);
358
-					$ret .= '<input type="checkbox" disabled id="' . $htmlname . '" name="' . $htmlname . '" value="' . $value . '"' . ($value ? ' checked' : '') . ($tmp[1] ? $tmp[1] : '') . '/>';
358
+					$ret .= '<input type="checkbox" disabled id="'.$htmlname.'" name="'.$htmlname.'" value="'.$value.'"'.($value ? ' checked' : '').($tmp[1] ? $tmp[1] : '').'/>';
359 359
 				} elseif (preg_match('/^text/', $typeofdata) || preg_match('/^note/', $typeofdata)) {
360 360
 					$ret .= dol_htmlwithnojs(dol_string_onlythesehtmltags(dol_htmlentitiesbr($value), 1, 1, 1));
361 361
 				} elseif (preg_match('/^(safehtmlstring|restricthtml)/', $typeofdata)) {	// 'restricthtml' is not an allowed type for editfieldval. Value is 'safehtmlstring'
362 362
 					$ret .= dol_htmlwithnojs(dol_string_onlythesehtmltags($value));
363 363
 				} elseif ($typeofdata == 'day' || $typeofdata == 'datepicker') {
364
-					$ret .= '<span class="valuedate">' . dol_print_date($value, 'day', $gm) . '</span>';
364
+					$ret .= '<span class="valuedate">'.dol_print_date($value, 'day', $gm).'</span>';
365 365
 				} elseif ($typeofdata == 'dayhour' || $typeofdata == 'datehourpicker') {
366
-					$ret .= '<span class="valuedate">' . dol_print_date($value, 'dayhour', $gm) . '</span>';
366
+					$ret .= '<span class="valuedate">'.dol_print_date($value, 'dayhour', $gm).'</span>';
367 367
 				} elseif (preg_match('/^select;/', $typeofdata)) {
368 368
 					$arraydata = explode(',', preg_replace('/^select;/', '', $typeofdata));
369 369
 					$arraylist = array();
@@ -374,9 +374,9 @@  discard block
 block discarded – undo
374 374
 					$ret .= $arraylist[$value];
375 375
 					if ($htmlname == 'fk_product_type') {
376 376
 						if ($value == 0) {
377
-							$ret = img_picto($langs->trans("Product"), 'product', 'class="paddingleftonly paddingrightonly colorgrey"') . $ret;
377
+							$ret = img_picto($langs->trans("Product"), 'product', 'class="paddingleftonly paddingrightonly colorgrey"').$ret;
378 378
 						} else {
379
-							$ret = img_picto($langs->trans("Service"), 'service', 'class="paddingleftonly paddingrightonly colorgrey"') . $ret;
379
+							$ret = img_picto($langs->trans("Service"), 'service', 'class="paddingleftonly paddingrightonly colorgrey"').$ret;
380 380
 						}
381 381
 					}
382 382
 				} elseif (preg_match('/^ckeditor/', $typeofdata)) {
@@ -384,7 +384,7 @@  discard block
 block discarded – undo
384 384
 					if (getDolGlobalString('MAIN_DISABLE_NOTES_TAB')) {
385 385
 						$firstline = preg_replace('/<br>.*/', '', $tmpcontent);
386 386
 						$firstline = preg_replace('/[\n\r].*/', '', $firstline);
387
-						$tmpcontent = $firstline . ((strlen($firstline) != strlen($tmpcontent)) ? '...' : '');
387
+						$tmpcontent = $firstline.((strlen($firstline) != strlen($tmpcontent)) ? '...' : '');
388 388
 					}
389 389
 					// We don't use dol_escape_htmltag to get the html formatting active, but this need we must also
390 390
 					// clean data from some dangerous html
@@ -393,7 +393,7 @@  discard block
 block discarded – undo
393 393
 					if (empty($moreoptions['valuealreadyhtmlescaped'])) {
394 394
 						$ret .= dol_escape_htmltag($value);
395 395
 					} else {
396
-						$ret .= $value;        // $value must be already html escaped.
396
+						$ret .= $value; // $value must be already html escaped.
397 397
 					}
398 398
 				}
399 399
 
@@ -431,7 +431,7 @@  discard block
 block discarded – undo
431 431
 
432 432
 		if (is_array($arrayoflangcode) && count($arrayoflangcode)) {
433 433
 			if (!is_object($extralanguages)) {
434
-				include_once DOL_DOCUMENT_ROOT . '/core/class/extralanguages.class.php';
434
+				include_once DOL_DOCUMENT_ROOT.'/core/class/extralanguages.class.php';
435 435
 				$extralanguages = new ExtraLanguages($this->db);
436 436
 			}
437 437
 			$extralanguages->fetch_name_extralanguages('societe');
@@ -440,17 +440,17 @@  discard block
 block discarded – undo
440 440
 				return ''; // No extralang field to show
441 441
 			}
442 442
 
443
-			$result .= '<!-- Widget for translation -->' . "\n";
444
-			$result .= '<div class="inline-block paddingleft image-' . $object->element . '-' . $fieldname . '">';
443
+			$result .= '<!-- Widget for translation -->'."\n";
444
+			$result .= '<div class="inline-block paddingleft image-'.$object->element.'-'.$fieldname.'">';
445 445
 			$s = img_picto($langs->trans("ShowOtherLanguages"), 'language', '', false, 0, 0, '', 'fa-15 editfieldlang');
446 446
 			$result .= $s;
447 447
 			$result .= '</div>';
448 448
 
449
-			$result .= '<div class="inline-block hidden field-' . $object->element . '-' . $fieldname . '">';
449
+			$result .= '<div class="inline-block hidden field-'.$object->element.'-'.$fieldname.'">';
450 450
 
451 451
 			$resultforextrlang = '';
452 452
 			foreach ($arrayoflangcode as $langcode) {
453
-				$valuetoshow = GETPOSTISSET('field-' . $object->element . "-" . $fieldname . "-" . $langcode) ? GETPOST('field-' . $object->element . '-' . $fieldname . "-" . $langcode, $check) : '';
453
+				$valuetoshow = GETPOSTISSET('field-'.$object->element."-".$fieldname."-".$langcode) ? GETPOST('field-'.$object->element.'-'.$fieldname."-".$langcode, $check) : '';
454 454
 				if (empty($valuetoshow)) {
455 455
 					$object->fetchValuesForExtraLanguages();
456 456
 					//var_dump($object->array_languages);
@@ -462,17 +462,17 @@  discard block
 block discarded – undo
462 462
 
463 463
 				// TODO Use the showInputField() method of ExtraLanguages object
464 464
 				if ($typeofdata == 'textarea') {
465
-					$resultforextrlang .= '<textarea name="field-' . $object->element . "-" . $fieldname . "-" . $langcode . '" id="' . $fieldname . "-" . $langcode . '" class="' . $morecss . '" rows="' . ROWS_2 . '" wrap="soft">';
465
+					$resultforextrlang .= '<textarea name="field-'.$object->element."-".$fieldname."-".$langcode.'" id="'.$fieldname."-".$langcode.'" class="'.$morecss.'" rows="'.ROWS_2.'" wrap="soft">';
466 466
 					$resultforextrlang .= $valuetoshow;
467 467
 					$resultforextrlang .= '</textarea>';
468 468
 				} else {
469
-					$resultforextrlang .= '<input type="text" class="inputfieldforlang ' . ($morecss ? ' ' . $morecss : '') . '" name="field-' . $object->element . '-' . $fieldname . '-' . $langcode . '" value="' . $valuetoshow . '">';
469
+					$resultforextrlang .= '<input type="text" class="inputfieldforlang '.($morecss ? ' '.$morecss : '').'" name="field-'.$object->element.'-'.$fieldname.'-'.$langcode.'" value="'.$valuetoshow.'">';
470 470
 				}
471 471
 			}
472 472
 			$result .= $resultforextrlang;
473 473
 
474 474
 			$result .= '</div>';
475
-			$result .= '<script nonce="' . getNonce() . '">$(".image-' . $object->element . '-' . $fieldname . '").click(function() { console.log("Toggle lang widget"); jQuery(".field-' . $object->element . '-' . $fieldname . '").toggle(); });</script>';
475
+			$result .= '<script nonce="'.getNonce().'">$(".image-'.$object->element.'-'.$fieldname.'").click(function() { console.log("Toggle lang widget"); jQuery(".field-'.$object->element.'-'.$fieldname.'").toggle(); });</script>';
476 476
 		}
477 477
 
478 478
 		return $result;
@@ -535,7 +535,7 @@  discard block
 block discarded – undo
535 535
 				if (!empty($tmp[2])) {
536 536
 					$savemethod = $tmp[2];
537 537
 				}
538
-				$out .= '<input id="width_' . $htmlname . '" value="' . $inputOption . '" type="hidden"/>' . "\n";
538
+				$out .= '<input id="width_'.$htmlname.'" value="'.$inputOption.'" type="hidden"/>'."\n";
539 539
 			} elseif ((preg_match('/^day$/', $inputType)) || (preg_match('/^datepicker/', $inputType)) || (preg_match('/^datehourpicker/', $inputType))) {
540 540
 				$tmp = explode(':', $inputType);
541 541
 				$inputType = $tmp[0];
@@ -546,7 +546,7 @@  discard block
 block discarded – undo
546 546
 					$savemethod = $tmp[2];
547 547
 				}
548 548
 
549
-				$out .= '<input id="timestamp" type="hidden"/>' . "\n"; // Use for timestamp format
549
+				$out .= '<input id="timestamp" type="hidden"/>'."\n"; // Use for timestamp format
550 550
 			} elseif (preg_match('/^(select|autocomplete)/', $inputType)) {
551 551
 				$tmp = explode(':', $inputType);
552 552
 				$inputType = $tmp[0];
@@ -577,40 +577,40 @@  discard block
 block discarded – undo
577 577
 				}
578 578
 
579 579
 				if (isModEnabled('fckeditor')) {
580
-					$out .= '<input id="ckeditor_toolbar" value="' . $toolbar . '" type="hidden"/>' . "\n";
580
+					$out .= '<input id="ckeditor_toolbar" value="'.$toolbar.'" type="hidden"/>'."\n";
581 581
 				} else {
582 582
 					$inputType = 'textarea';
583 583
 				}
584 584
 			}
585 585
 
586
-			$out .= '<input id="element_' . $htmlname . '" value="' . $element . '" type="hidden"/>' . "\n";
587
-			$out .= '<input id="table_element_' . $htmlname . '" value="' . $table_element . '" type="hidden"/>' . "\n";
588
-			$out .= '<input id="fk_element_' . $htmlname . '" value="' . $fk_element . '" type="hidden"/>' . "\n";
589
-			$out .= '<input id="loadmethod_' . $htmlname . '" value="' . $loadmethod . '" type="hidden"/>' . "\n";
586
+			$out .= '<input id="element_'.$htmlname.'" value="'.$element.'" type="hidden"/>'."\n";
587
+			$out .= '<input id="table_element_'.$htmlname.'" value="'.$table_element.'" type="hidden"/>'."\n";
588
+			$out .= '<input id="fk_element_'.$htmlname.'" value="'.$fk_element.'" type="hidden"/>'."\n";
589
+			$out .= '<input id="loadmethod_'.$htmlname.'" value="'.$loadmethod.'" type="hidden"/>'."\n";
590 590
 			if (!empty($savemethod)) {
591
-				$out .= '<input id="savemethod_' . $htmlname . '" value="' . $savemethod . '" type="hidden"/>' . "\n";
591
+				$out .= '<input id="savemethod_'.$htmlname.'" value="'.$savemethod.'" type="hidden"/>'."\n";
592 592
 			}
593 593
 			if (!empty($ext_element)) {
594
-				$out .= '<input id="ext_element_' . $htmlname . '" value="' . $ext_element . '" type="hidden"/>' . "\n";
594
+				$out .= '<input id="ext_element_'.$htmlname.'" value="'.$ext_element.'" type="hidden"/>'."\n";
595 595
 			}
596 596
 			if (!empty($custommsg)) {
597 597
 				if (is_array($custommsg)) {
598 598
 					if (!empty($custommsg['success'])) {
599
-						$out .= '<input id="successmsg_' . $htmlname . '" value="' . $custommsg['success'] . '" type="hidden"/>' . "\n";
599
+						$out .= '<input id="successmsg_'.$htmlname.'" value="'.$custommsg['success'].'" type="hidden"/>'."\n";
600 600
 					}
601 601
 					if (!empty($custommsg['error'])) {
602
-						$out .= '<input id="errormsg_' . $htmlname . '" value="' . $custommsg['error'] . '" type="hidden"/>' . "\n";
602
+						$out .= '<input id="errormsg_'.$htmlname.'" value="'.$custommsg['error'].'" type="hidden"/>'."\n";
603 603
 					}
604 604
 				} else {
605
-					$out .= '<input id="successmsg_' . $htmlname . '" value="' . $custommsg . '" type="hidden"/>' . "\n";
605
+					$out .= '<input id="successmsg_'.$htmlname.'" value="'.$custommsg.'" type="hidden"/>'."\n";
606 606
 				}
607 607
 			}
608 608
 			if ($inputType == 'textarea') {
609
-				$out .= '<input id="textarea_' . $htmlname . '_rows" value="' . $rows . '" type="hidden"/>' . "\n";
610
-				$out .= '<input id="textarea_' . $htmlname . '_cols" value="' . $cols . '" type="hidden"/>' . "\n";
609
+				$out .= '<input id="textarea_'.$htmlname.'_rows" value="'.$rows.'" type="hidden"/>'."\n";
610
+				$out .= '<input id="textarea_'.$htmlname.'_cols" value="'.$cols.'" type="hidden"/>'."\n";
611 611
 			}
612
-			$out .= '<span id="viewval_' . $htmlname . '" class="viewval_' . $inputType . ($button_only ? ' inactive' : ' active') . '">' . $value . '</span>' . "\n";
613
-			$out .= '<span id="editval_' . $htmlname . '" class="editval_' . $inputType . ($button_only ? ' inactive' : ' active') . ' hideobject">' . (!empty($editvalue) ? $editvalue : $value) . '</span>' . "\n";
612
+			$out .= '<span id="viewval_'.$htmlname.'" class="viewval_'.$inputType.($button_only ? ' inactive' : ' active').'">'.$value.'</span>'."\n";
613
+			$out .= '<span id="editval_'.$htmlname.'" class="editval_'.$inputType.($button_only ? ' inactive' : ' active').' hideobject">'.(!empty($editvalue) ? $editvalue : $value).'</span>'."\n";
614 614
 		} else {
615 615
 			$out = $value;
616 616
 		}
@@ -639,12 +639,12 @@  discard block
 block discarded – undo
639 639
 	public function textwithtooltip($text, $htmltext, $tooltipon = 1, $direction = 0, $img = '', $extracss = '', $notabs = 3, $incbefore = '', $noencodehtmltext = 0, $tooltiptrigger = '', $forcenowrap = 0)
640 640
 	{
641 641
 		if ($incbefore) {
642
-			$text = $incbefore . $text;
642
+			$text = $incbefore.$text;
643 643
 		}
644 644
 		if (!$htmltext) {
645 645
 			return $text;
646 646
 		}
647
-		$direction = (int) $direction;    // For backward compatibility when $direction was set to '' instead of 0
647
+		$direction = (int) $direction; // For backward compatibility when $direction was set to '' instead of 0
648 648
 
649 649
 		$tag = 'td';
650 650
 		if ($notabs == 2) {
@@ -658,11 +658,11 @@  discard block
 block discarded – undo
658 658
 
659 659
 		$extrastyle = '';
660 660
 		if ($direction < 0) {
661
-			$extracss = ($extracss ? $extracss . ' ' : '') . ($notabs != 3 ? 'inline-block' : '');
661
+			$extracss = ($extracss ? $extracss.' ' : '').($notabs != 3 ? 'inline-block' : '');
662 662
 			$extrastyle = 'padding: 0px; padding-left: 3px;';
663 663
 		}
664 664
 		if ($direction > 0) {
665
-			$extracss = ($extracss ? $extracss . ' ' : '') . ($notabs != 3 ? 'inline-block' : '');
665
+			$extracss = ($extracss ? $extracss.' ' : '').($notabs != 3 ? 'inline-block' : '');
666 666
 			$extrastyle = 'padding: 0px; padding-right: 3px;';
667 667
 		}
668 668
 
@@ -675,53 +675,53 @@  discard block
 block discarded – undo
675 675
 			$htmltext = str_replace('"', '&quot;', $htmltext);
676 676
 		} else {
677 677
 			$classfortooltip = 'classfortooltiponclick';
678
-			$textfordialog .= '<div style="display: none;" id="idfortooltiponclick_' . $tooltiptrigger . '" class="classfortooltiponclicktext">' . $htmltext . '</div>';
678
+			$textfordialog .= '<div style="display: none;" id="idfortooltiponclick_'.$tooltiptrigger.'" class="classfortooltiponclicktext">'.$htmltext.'</div>';
679 679
 		}
680 680
 		if ($tooltipon == 2 || $tooltipon == 3) {
681
-			$paramfortooltipimg = ' class="' . $classfortooltip . ($notabs != 3 ? ' inline-block' : '') . ($extracss ? ' ' . $extracss : '') . '" style="padding: 0px;' . ($extrastyle ? ' ' . $extrastyle : '') . '"';
681
+			$paramfortooltipimg = ' class="'.$classfortooltip.($notabs != 3 ? ' inline-block' : '').($extracss ? ' '.$extracss : '').'" style="padding: 0px;'.($extrastyle ? ' '.$extrastyle : '').'"';
682 682
 			if ($tooltiptrigger == '') {
683
-				$paramfortooltipimg .= ' title="' . ($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)) . '"'; // Attribute to put on img tag to store tooltip
683
+				$paramfortooltipimg .= ' title="'.($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)).'"'; // Attribute to put on img tag to store tooltip
684 684
 			} else {
685
-				$paramfortooltipimg .= ' dolid="' . $tooltiptrigger . '"';
685
+				$paramfortooltipimg .= ' dolid="'.$tooltiptrigger.'"';
686 686
 			}
687 687
 		} else {
688
-			$paramfortooltipimg = ($extracss ? ' class="' . $extracss . '"' : '') . ($extrastyle ? ' style="' . $extrastyle . '"' : ''); // Attribute to put on td text tag
688
+			$paramfortooltipimg = ($extracss ? ' class="'.$extracss.'"' : '').($extrastyle ? ' style="'.$extrastyle.'"' : ''); // Attribute to put on td text tag
689 689
 		}
690 690
 		if ($tooltipon == 1 || $tooltipon == 3) {
691
-			$paramfortooltiptd = ' class="' . ($tooltipon == 3 ? 'cursorpointer ' : '') . $classfortooltip . ' inline-block' . ($extracss ? ' ' . $extracss : '') . '" style="padding: 0px;' . ($extrastyle ? ' ' . $extrastyle : '') . '" ';
691
+			$paramfortooltiptd = ' class="'.($tooltipon == 3 ? 'cursorpointer ' : '').$classfortooltip.' inline-block'.($extracss ? ' '.$extracss : '').'" style="padding: 0px;'.($extrastyle ? ' '.$extrastyle : '').'" ';
692 692
 			if ($tooltiptrigger == '') {
693
-				$paramfortooltiptd .= ' title="' . ($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)) . '"'; // Attribute to put on td tag to store tooltip
693
+				$paramfortooltiptd .= ' title="'.($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)).'"'; // Attribute to put on td tag to store tooltip
694 694
 			} else {
695
-				$paramfortooltiptd .= ' dolid="' . $tooltiptrigger . '"';
695
+				$paramfortooltiptd .= ' dolid="'.$tooltiptrigger.'"';
696 696
 			}
697 697
 		} else {
698
-			$paramfortooltiptd = ($extracss ? ' class="' . $extracss . '"' : '') . ($extrastyle ? ' style="' . $extrastyle . '"' : ''); // Attribute to put on td text tag
698
+			$paramfortooltiptd = ($extracss ? ' class="'.$extracss.'"' : '').($extrastyle ? ' style="'.$extrastyle.'"' : ''); // Attribute to put on td text tag
699 699
 		}
700 700
 		if (empty($notabs)) {
701 701
 			$s .= '<table class="nobordernopadding"><tr style="height: auto;">';
702 702
 		} elseif ($notabs == 2) {
703
-			$s .= '<div class="inline-block' . ($forcenowrap ? ' nowrap' : '') . '">';
703
+			$s .= '<div class="inline-block'.($forcenowrap ? ' nowrap' : '').'">';
704 704
 		}
705 705
 		// Define value if value is before
706 706
 		if ($direction < 0) {
707
-			$s .= '<' . $tag . $paramfortooltipimg;
707
+			$s .= '<'.$tag.$paramfortooltipimg;
708 708
 			if ($tag == 'td') {
709 709
 				$s .= ' class="valigntop" width="14"';
710 710
 			}
711
-			$s .= '>' . $textfordialog . $img . '</' . $tag . '>';
711
+			$s .= '>'.$textfordialog.$img.'</'.$tag.'>';
712 712
 		}
713 713
 		// Use another method to help avoid having a space in value in order to use this value with jquery
714 714
 		// Define label
715 715
 		if ((string) $text != '') {
716
-			$s .= '<' . $tag . $paramfortooltiptd . '>' . $text . '</' . $tag . '>';
716
+			$s .= '<'.$tag.$paramfortooltiptd.'>'.$text.'</'.$tag.'>';
717 717
 		}
718 718
 		// Define value if value is after
719 719
 		if ($direction > 0) {
720
-			$s .= '<' . $tag . $paramfortooltipimg;
720
+			$s .= '<'.$tag.$paramfortooltipimg;
721 721
 			if ($tag == 'td') {
722 722
 				$s .= ' class="valignmiddle" width="14"';
723 723
 			}
724
-			$s .= '>' . $textfordialog . $img . '</' . $tag . '>';
724
+			$s .= '>'.$textfordialog.$img.'</'.$tag.'>';
725 725
 		}
726 726
 		if (empty($notabs)) {
727 727
 			$s .= '</tr></table>';
@@ -828,7 +828,7 @@  discard block
 block discarded – undo
828 828
 
829 829
 		$disabled = 0;
830 830
 		$ret = '<div class="centpercent center">';
831
-		$ret .= '<select class="flat' . (empty($conf->use_javascript_ajax) ? '' : ' hideobject') . ' ' . $name . ' ' . $name . 'select valignmiddle alignstart" id="' . $name . '" name="' . $name . '"' . ($disabled ? ' disabled="disabled"' : '') . '>';
831
+		$ret .= '<select class="flat'.(empty($conf->use_javascript_ajax) ? '' : ' hideobject').' '.$name.' '.$name.'select valignmiddle alignstart" id="'.$name.'" name="'.$name.'"'.($disabled ? ' disabled="disabled"' : '').'>';
832 832
 
833 833
 		// Complete list with data from external modules. THe module can use $_SERVER['PHP_SELF'] to know on which page we are, or use the $parameters['currentcontext'] completed by executeHooks.
834 834
 		$parameters = array();
@@ -839,10 +839,10 @@  discard block
 block discarded – undo
839 839
 			return;
840 840
 		}
841 841
 		if (empty($reshook)) {
842
-			$ret .= '<option value="0"' . ($disabled ? ' disabled="disabled"' : '') . '>-- ' . $langs->trans("SelectAction") . ' --</option>';
842
+			$ret .= '<option value="0"'.($disabled ? ' disabled="disabled"' : '').'>-- '.$langs->trans("SelectAction").' --</option>';
843 843
 			if (is_array($arrayofaction)) {
844 844
 				foreach ($arrayofaction as $code => $label) {
845
-					$ret .= '<option value="' . $code . '"' . ($disabled ? ' disabled="disabled"' : '') . ' data-html="' . dol_escape_htmltag($label) . '">' . $label . '</option>';
845
+					$ret .= '<option value="'.$code.'"'.($disabled ? ' disabled="disabled"' : '').' data-html="'.dol_escape_htmltag($label).'">'.$label.'</option>';
846 846
 				}
847 847
 			}
848 848
 		}
@@ -851,17 +851,17 @@  discard block
 block discarded – undo
851 851
 		$ret .= '</select>';
852 852
 
853 853
 		if (empty($conf->dol_optimize_smallscreen)) {
854
-			$ret .= ajax_combobox('.' . $name . 'select');
854
+			$ret .= ajax_combobox('.'.$name.'select');
855 855
 		}
856 856
 
857 857
 		// 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
858 858
 		$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.
859
-		$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")) . '">';
859
+		$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 860
 		$ret .= '</div>';
861 861
 
862 862
 		if (!empty($conf->use_javascript_ajax)) {
863 863
 			$ret .= '<!-- JS CODE TO ENABLE mass action select -->
864
-    		<script nonce="' . getNonce() . '">
864
+    		<script nonce="' . getNonce().'">
865 865
                         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 */
866 866
         		{
867 867
         			atleastoneselected=0;
@@ -872,11 +872,11 @@  discard block
 block discarded – undo
872 872
 
873 873
 					console.log("initCheckForSelect mode="+mode+" name="+name+" cssclass="+cssclass+" atleastoneselected="+atleastoneselected);
874 874
 
875
-    	  			if (atleastoneselected || ' . $alwaysvisible . ')
875
+    	  			if (atleastoneselected || ' . $alwaysvisible.')
876 876
     	  			{
877 877
                                     jQuery("."+name).show();
878
-        			    ' . ($selected ? 'if (atleastoneselected) { jQuery("."+name+"select").val("' . $selected . '").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', false); }' : '') . '
879
-        			    ' . ($selected ? 'if (! atleastoneselected) { jQuery("."+name+"select").val("0").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', true); } ' : '') . '
878
+        			    ' . ($selected ? 'if (atleastoneselected) { jQuery("."+name+"select").val("'.$selected.'").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', false); }' : '').'
879
+        			    ' . ($selected ? 'if (! atleastoneselected) { jQuery("."+name+"select").val("0").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', true); } ' : '').'
880 880
     	  			}
881 881
     	  			else
882 882
     	  			{
@@ -886,11 +886,11 @@  discard block
 block discarded – undo
886 886
         		}
887 887
 
888 888
         	jQuery(document).ready(function () {
889
-                    initCheckForSelect(0, "' . $name . '", "' . $cssclass . '");
890
-                    jQuery(".' . $cssclass . '").click(function() {
891
-                        initCheckForSelect(1, "' . $name . '", "' . $cssclass . '");
889
+                    initCheckForSelect(0, "' . $name.'", "'.$cssclass.'");
890
+                    jQuery(".' . $cssclass.'").click(function() {
891
+                        initCheckForSelect(1, "' . $name.'", "'.$cssclass.'");
892 892
                     });
893
-                        jQuery(".' . $name . 'select").change(function() {
893
+                        jQuery(".' . $name.'select").change(function() {
894 894
         			var massaction = $( this ).val();
895 895
         			var urlform = $( this ).closest("form").attr("action").replace("#show_files","");
896 896
         			if (massaction == "builddoc")
@@ -898,18 +898,18 @@  discard block
 block discarded – undo
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 904
     	  			{
905
-                                        jQuery(".' . $name . 'confirmed").prop(\'disabled\', false);
906
-										jQuery(".' . $name . 'other").hide();	/* To disable if another div was open */
907
-                                        jQuery(".' . $name . '"+massaction).show();
905
+                                        jQuery(".' . $name.'confirmed").prop(\'disabled\', false);
906
+										jQuery(".' . $name.'other").hide();	/* To disable if another div was open */
907
+                                        jQuery(".' . $name.'"+massaction).show();
908 908
     	  			}
909 909
     	  			else
910 910
     	  			{
911
-                                        jQuery(".' . $name . 'confirmed").prop(\'disabled\', true);
912
-										jQuery(".' . $name . 'other").hide();	/* To disable any div open */
911
+                                        jQuery(".' . $name.'confirmed").prop(\'disabled\', true);
912
+										jQuery(".' . $name.'other").hide();	/* To disable any div open */
913 913
     	  			}
914 914
     	        });
915 915
         	});
@@ -952,14 +952,14 @@  discard block
 block discarded – undo
952 952
 		$atleastonefavorite = 0;
953 953
 
954 954
 		$sql = "SELECT rowid, code as code_iso, code_iso as code_iso3, label, favorite, eec";
955
-		$sql .= " FROM " . $this->db->prefix() . "c_country";
955
+		$sql .= " FROM ".$this->db->prefix()."c_country";
956 956
 		$sql .= " WHERE active > 0";
957 957
 		//$sql.= " ORDER BY code ASC";
958 958
 
959
-		dol_syslog(get_class($this) . "::select_country", LOG_DEBUG);
959
+		dol_syslog(get_class($this)."::select_country", LOG_DEBUG);
960 960
 		$resql = $this->db->query($sql);
961 961
 		if ($resql) {
962
-			$out .= '<select id="select' . $htmlname . '" class="flat maxwidth200onsmartphone selectcountry' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" ' . $htmloption . '>';
962
+			$out .= '<select id="select'.$htmlname.'" class="flat maxwidth200onsmartphone selectcountry'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" '.$htmloption.'>';
963 963
 			$num = $this->db->num_rows($resql);
964 964
 			$i = 0;
965 965
 			if ($num) {
@@ -969,7 +969,7 @@  discard block
 block discarded – undo
969 969
 					$countryArray[$i]['rowid'] = $obj->rowid;
970 970
 					$countryArray[$i]['code_iso'] = $obj->code_iso;
971 971
 					$countryArray[$i]['code_iso3'] = $obj->code_iso3;
972
-					$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 : ''));
972
+					$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 : ''));
973 973
 					$countryArray[$i]['favorite'] = $obj->favorite;
974 974
 					$countryArray[$i]['eec'] = $obj->eec;
975 975
 					$favorite[$i] = $obj->favorite;
@@ -987,20 +987,20 @@  discard block
 block discarded – undo
987 987
 
988 988
 				if ($showempty) {
989 989
 					if (is_numeric($showempty)) {
990
-						$out .= '<option value="">&nbsp;</option>' . "\n";
990
+						$out .= '<option value="">&nbsp;</option>'."\n";
991 991
 					} else {
992
-						$out .= '<option value="-1">' . $langs->trans($showempty) . '</option>' . "\n";
992
+						$out .= '<option value="-1">'.$langs->trans($showempty).'</option>'."\n";
993 993
 					}
994 994
 				}
995 995
 
996 996
 				if ($addspecialentries) {    // Add dedicated entries for groups of countries
997 997
 					//if ($showempty) $out.= '<option value="" disabled class="selectoptiondisabledwhite">--------------</option>';
998
-					$out .= '<option value="special_allnotme"' . ($selected == 'special_allnotme' ? ' selected' : '') . '>' . $langs->trans("CountriesExceptMe", $langs->transnoentitiesnoconv("Country" . $mysoc->country_code)) . '</option>';
999
-					$out .= '<option value="special_eec"' . ($selected == 'special_eec' ? ' selected' : '') . '>' . $langs->trans("CountriesInEEC") . '</option>';
998
+					$out .= '<option value="special_allnotme"'.($selected == 'special_allnotme' ? ' selected' : '').'>'.$langs->trans("CountriesExceptMe", $langs->transnoentitiesnoconv("Country".$mysoc->country_code)).'</option>';
999
+					$out .= '<option value="special_eec"'.($selected == 'special_eec' ? ' selected' : '').'>'.$langs->trans("CountriesInEEC").'</option>';
1000 1000
 					if ($mysoc->isInEEC()) {
1001
-						$out .= '<option value="special_eecnotme"' . ($selected == 'special_eecnotme' ? ' selected' : '') . '>' . $langs->trans("CountriesInEECExceptMe", $langs->transnoentitiesnoconv("Country" . $mysoc->country_code)) . '</option>';
1001
+						$out .= '<option value="special_eecnotme"'.($selected == 'special_eecnotme' ? ' selected' : '').'>'.$langs->trans("CountriesInEECExceptMe", $langs->transnoentitiesnoconv("Country".$mysoc->country_code)).'</option>';
1002 1002
 					}
1003
-					$out .= '<option value="special_noteec"' . ($selected == 'special_noteec' ? ' selected' : '') . '>' . $langs->trans("CountriesNotInEEC") . '</option>';
1003
+					$out .= '<option value="special_noteec"'.($selected == 'special_noteec' ? ' selected' : '').'>'.$langs->trans("CountriesNotInEEC").'</option>';
1004 1004
 					$out .= '<option value="" disabled class="selectoptiondisabledwhite">------------</option>';
1005 1005
 				}
1006 1006
 
@@ -1028,20 +1028,20 @@  discard block
 block discarded – undo
1028 1028
 						$labeltoshow .= '&nbsp;';
1029 1029
 					}
1030 1030
 					if ($row['code_iso']) {
1031
-						$labeltoshow .= ' <span class="opacitymedium">(' . $row['code_iso'] . ')</span>';
1031
+						$labeltoshow .= ' <span class="opacitymedium">('.$row['code_iso'].')</span>';
1032 1032
 						if (empty($hideflags)) {
1033 1033
 							$tmpflag = picto_from_langcode($row['code_iso'], 'class="saturatemedium paddingrightonly"', 1);
1034
-							$labeltoshow = $tmpflag . ' ' . $labeltoshow;
1034
+							$labeltoshow = $tmpflag.' '.$labeltoshow;
1035 1035
 						}
1036 1036
 					}
1037 1037
 
1038 1038
 					if ($selected && $selected != '-1' && ($selected == $row['rowid'] || $selected == $row['code_iso'] || $selected == $row['code_iso3'] || $selected == $row['label'])) {
1039
-						$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']) . '">';
1039
+						$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']).'">';
1040 1040
 					} else {
1041
-						$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']) . '">';
1041
+						$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']).'">';
1042 1042
 					}
1043 1043
 					$out .= $labeltoshow;
1044
-					$out .= '</option>' . "\n";
1044
+					$out .= '</option>'."\n";
1045 1045
 				}
1046 1046
 			}
1047 1047
 			$out .= '</select>';
@@ -1050,8 +1050,8 @@  discard block
 block discarded – undo
1050 1050
 		}
1051 1051
 
1052 1052
 		// Make select dynamic
1053
-		include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
1054
-		$out .= ajax_combobox('select' . $htmlname, array(), 0, 0, 'resolve');
1053
+		include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
1054
+		$out .= ajax_combobox('select'.$htmlname, array(), 0, 0, 'resolve');
1055 1055
 
1056 1056
 		return $out;
1057 1057
 	}
@@ -1083,25 +1083,25 @@  discard block
 block discarded – undo
1083 1083
 		$incotermArray = array();
1084 1084
 
1085 1085
 		$sql = "SELECT rowid, code";
1086
-		$sql .= " FROM " . $this->db->prefix() . "c_incoterms";
1086
+		$sql .= " FROM ".$this->db->prefix()."c_incoterms";
1087 1087
 		$sql .= " WHERE active > 0";
1088 1088
 		$sql .= " ORDER BY code ASC";
1089 1089
 
1090
-		dol_syslog(get_class($this) . "::select_incoterm", LOG_DEBUG);
1090
+		dol_syslog(get_class($this)."::select_incoterm", LOG_DEBUG);
1091 1091
 		$resql = $this->db->query($sql);
1092 1092
 		if ($resql) {
1093 1093
 			if ($conf->use_javascript_ajax && !$forcecombo) {
1094
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
1094
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
1095 1095
 				$out .= ajax_combobox($htmlname, $events);
1096 1096
 			}
1097 1097
 
1098 1098
 			if (!empty($page)) {
1099
-				$out .= '<form method="post" action="' . $page . '">';
1099
+				$out .= '<form method="post" action="'.$page.'">';
1100 1100
 				$out .= '<input type="hidden" name="action" value="set_incoterms">';
1101
-				$out .= '<input type="hidden" name="token" value="' . newToken() . '">';
1101
+				$out .= '<input type="hidden" name="token" value="'.newToken().'">';
1102 1102
 			}
1103 1103
 
1104
-			$out .= '<select id="' . $htmlname . '" class="flat selectincoterm width75" name="' . $htmlname . '" ' . $htmloption . '>';
1104
+			$out .= '<select id="'.$htmlname.'" class="flat selectincoterm width75" name="'.$htmlname.'" '.$htmloption.'>';
1105 1105
 			$out .= '<option value="0">&nbsp;</option>';
1106 1106
 			$num = $this->db->num_rows($resql);
1107 1107
 			$i = 0;
@@ -1115,9 +1115,9 @@  discard block
 block discarded – undo
1115 1115
 
1116 1116
 				foreach ($incotermArray as $row) {
1117 1117
 					if ($selected && ($selected == $row['rowid'] || $selected == $row['code'])) {
1118
-						$out .= '<option value="' . $row['rowid'] . '" selected>';
1118
+						$out .= '<option value="'.$row['rowid'].'" selected>';
1119 1119
 					} else {
1120
-						$out .= '<option value="' . $row['rowid'] . '">';
1120
+						$out .= '<option value="'.$row['rowid'].'">';
1121 1121
 					}
1122 1122
 
1123 1123
 					if ($row['code']) {
@@ -1130,13 +1130,13 @@  discard block
 block discarded – undo
1130 1130
 			$out .= '</select>';
1131 1131
 
1132 1132
 			if ($conf->use_javascript_ajax && empty($disableautocomplete)) {
1133
-				$out .= ajax_multiautocompleter('location_incoterms', array(), DOL_URL_ROOT . '/core/ajax/locationincoterms.php') . "\n";
1133
+				$out .= ajax_multiautocompleter('location_incoterms', array(), DOL_URL_ROOT.'/core/ajax/locationincoterms.php')."\n";
1134 1134
 				$moreattrib .= ' autocomplete="off"';
1135 1135
 			}
1136
-			$out .= '<input id="location_incoterms" class="maxwidthonsmartphone type="text" name="location_incoterms" value="' . $location_incoterms . '">' . "\n";
1136
+			$out .= '<input id="location_incoterms" class="maxwidthonsmartphone type="text" name="location_incoterms" value="'.$location_incoterms.'">'."\n";
1137 1137
 
1138 1138
 			if (!empty($page)) {
1139
-				$out .= '<input type="submit" class="button valignmiddle smallpaddingimp nomargintop nomarginbottom" value="' . $langs->trans("Modify") . '"></form>';
1139
+				$out .= '<input type="submit" class="button valignmiddle smallpaddingimp nomargintop nomarginbottom" value="'.$langs->trans("Modify").'"></form>';
1140 1140
 			}
1141 1141
 		} else {
1142 1142
 			dol_print_error($this->db);
@@ -1167,9 +1167,9 @@  discard block
 block discarded – undo
1167 1167
 		if ($forceall == 1 || (empty($forceall) && isModEnabled("product") && isModEnabled("service"))
1168 1168
 			|| (empty($forceall) && !isModEnabled('product') && !isModEnabled('service'))) {
1169 1169
 			if (empty($hidetext)) {
1170
-				print $langs->trans("Type") . ': ';
1170
+				print $langs->trans("Type").': ';
1171 1171
 			}
1172
-			print '<select class="flat" id="select_' . $htmlname . '" name="' . $htmlname . '">';
1172
+			print '<select class="flat" id="select_'.$htmlname.'" name="'.$htmlname.'">';
1173 1173
 			if ($showempty) {
1174 1174
 				print '<option value="-1"';
1175 1175
 				if ($selected == -1) {
@@ -1188,28 +1188,28 @@  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
-			print ajax_combobox('select_' . $htmlname);
1200
+			print ajax_combobox('select_'.$htmlname);
1201 1201
 			//if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1);
1202 1202
 		}
1203 1203
 		if ((empty($forceall) && !isModEnabled('product') && isModEnabled("service")) || $forceall == 3) {
1204 1204
 			print $langs->trans("Service");
1205
-			print '<input type="hidden" name="' . $htmlname . '" value="1">';
1205
+			print '<input type="hidden" name="'.$htmlname.'" value="1">';
1206 1206
 		}
1207 1207
 		if ((empty($forceall) && isModEnabled("product") && !isModEnabled('service')) || $forceall == 2) {
1208 1208
 			print $langs->trans("Product");
1209
-			print '<input type="hidden" name="' . $htmlname . '" value="0">';
1209
+			print '<input type="hidden" name="'.$htmlname.'" value="0">';
1210 1210
 		}
1211 1211
 		if ($forceall < 0) {    // This should happened only for contracts when both predefined product and service are disabled.
1212
-			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
1212
+			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
1213 1213
 		}
1214 1214
 	}
1215 1215
 
@@ -1235,7 +1235,7 @@  discard block
 block discarded – undo
1235 1235
 		$langs->load("trips");
1236 1236
 
1237 1237
 		$sql = "SELECT c.code, c.label";
1238
-		$sql .= " FROM " . $this->db->prefix() . "c_type_fees as c";
1238
+		$sql .= " FROM ".$this->db->prefix()."c_type_fees as c";
1239 1239
 		$sql .= " WHERE active > 0";
1240 1240
 
1241 1241
 		$resql = $this->db->query($sql);
@@ -1276,11 +1276,11 @@  discard block
 block discarded – undo
1276 1276
 		// phpcs:enable
1277 1277
 		global $user, $langs;
1278 1278
 
1279
-		dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG);
1279
+		dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG);
1280 1280
 
1281 1281
 		$this->load_cache_types_fees();
1282 1282
 
1283
-		print '<select id="select_' . $htmlname . '" class="flat" name="' . $htmlname . '">';
1283
+		print '<select id="select_'.$htmlname.'" class="flat" name="'.$htmlname.'">';
1284 1284
 		if ($showempty) {
1285 1285
 			print '<option value="-1"';
1286 1286
 			if ($selected == -1) {
@@ -1290,7 +1290,7 @@  discard block
 block discarded – undo
1290 1290
 		}
1291 1291
 
1292 1292
 		foreach ($this->cache_types_fees as $key => $value) {
1293
-			print '<option value="' . $key . '"';
1293
+			print '<option value="'.$key.'"';
1294 1294
 			if ($key == $selected) {
1295 1295
 				print ' selected';
1296 1296
 			}
@@ -1341,12 +1341,12 @@  discard block
 block discarded – undo
1341 1341
 				$ajaxoptions = array();
1342 1342
 			}
1343 1343
 
1344
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
1344
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
1345 1345
 
1346 1346
 			// No immediate load of all database
1347 1347
 			$placeholder = '';
1348 1348
 			if ($selected && empty($selected_input_value)) {
1349
-				require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
1349
+				require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
1350 1350
 				$societetmp = new Societe($this->db);
1351 1351
 				$societetmp->fetch($selected);
1352 1352
 				$selected_input_value = $societetmp->name;
@@ -1354,25 +1354,25 @@  discard block
 block discarded – undo
1354 1354
 			}
1355 1355
 
1356 1356
 			// mode 1
1357
-			$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)) : '');
1357
+			$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)) : '');
1358 1358
 
1359 1359
 			$out .= '<!-- force css to be higher than dialog popup --><style type="text/css">.ui-autocomplete { z-index: 1010; }</style>';
1360 1360
 			if (empty($hidelabel)) {
1361
-				print $langs->trans("RefOrLabel") . ' : ';
1361
+				print $langs->trans("RefOrLabel").' : ';
1362 1362
 			} elseif ($hidelabel > 1) {
1363 1363
 				$placeholder = $langs->trans("RefOrLabel");
1364 1364
 				if ($hidelabel == 2) {
1365 1365
 					$out .= img_picto($langs->trans("Search"), 'search');
1366 1366
 				}
1367 1367
 			}
1368
-			$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' : '') . ' />';
1368
+			$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' : '').' />';
1369 1369
 			if ($hidelabel == 3) {
1370 1370
 				$out .= img_picto($langs->trans("Search"), 'search');
1371 1371
 			}
1372 1372
 
1373 1373
 			$out .= ajax_event($htmlname, $events);
1374 1374
 
1375
-			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/societe/ajax/company.php', $urloption, $conf->global->COMPANY_USE_SEARCH_TO_SELECT, 0, $ajaxoptions);
1375
+			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/societe/ajax/company.php', $urloption, $conf->global->COMPANY_USE_SEARCH_TO_SELECT, 0, $ajaxoptions);
1376 1376
 		} else {
1377 1377
 			// Immediate load of all database
1378 1378
 			$out .= $this->select_thirdparty_list($selected, $htmlname, $filter, $showempty, $showtype, $forcecombo, $events, '', 0, $limit, $morecss, $moreparam, $multiple, $excludeids, $showcode);
@@ -1457,30 +1457,30 @@  discard block
 block discarded – undo
1457 1457
 			$sql .= ", s.address, s.zip, s.town";
1458 1458
 			$sql .= ", dictp.code as country_code";
1459 1459
 		}
1460
-		$sql .= " FROM " . $this->db->prefix() . "societe as s";
1460
+		$sql .= " FROM ".$this->db->prefix()."societe as s";
1461 1461
 		if (getDolGlobalString('COMPANY_SHOW_ADDRESS_SELECTLIST')) {
1462
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "c_country as dictp ON dictp.rowid = s.fk_pays";
1462
+			$sql .= " LEFT JOIN ".$this->db->prefix()."c_country as dictp ON dictp.rowid = s.fk_pays";
1463 1463
 		}
1464 1464
 		if (!$user->hasRight('societe', 'client', 'voir')) {
1465
-			$sql .= ", " . $this->db->prefix() . "societe_commerciaux as sc";
1465
+			$sql .= ", ".$this->db->prefix()."societe_commerciaux as sc";
1466 1466
 		}
1467
-		$sql .= " WHERE s.entity IN (" . getEntity('societe') . ")";
1467
+		$sql .= " WHERE s.entity IN (".getEntity('societe').")";
1468 1468
 		if (!empty($user->socid)) {
1469
-			$sql .= " AND s.rowid = " . ((int) $user->socid);
1469
+			$sql .= " AND s.rowid = ".((int) $user->socid);
1470 1470
 		}
1471 1471
 		if ($filter) {
1472 1472
 			// $filter is safe because, if it contains '(' or ')', it has been sanitized by testSqlAndScriptInject() and forgeSQLFromUniversalSearchCriteria()
1473 1473
 			// if not, by testSqlAndScriptInject() only.
1474
-			$sql .= " AND (" . $filter . ")";
1474
+			$sql .= " AND (".$filter.")";
1475 1475
 		}
1476 1476
 		if (!$user->hasRight('societe', 'client', 'voir')) {
1477
-			$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " . ((int) $user->id);
1477
+			$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
1478 1478
 		}
1479 1479
 		if (getDolGlobalString('COMPANY_HIDE_INACTIVE_IN_COMBOBOX')) {
1480 1480
 			$sql .= " AND s.status <> 0";
1481 1481
 		}
1482 1482
 		if (!empty($excludeids)) {
1483
-			$sql .= " AND s.rowid NOT IN (" . $this->db->sanitize(implode(',', $excludeids)) . ")";
1483
+			$sql .= " AND s.rowid NOT IN (".$this->db->sanitize(implode(',', $excludeids)).")";
1484 1484
 		}
1485 1485
 		// Add where from hooks
1486 1486
 		$parameters = array();
@@ -1500,17 +1500,17 @@  discard block
 block discarded – undo
1500 1500
 				if ($i > 0) {
1501 1501
 					$sql .= " AND ";
1502 1502
 				}
1503
-				$sql .= "(s.nom LIKE '" . $this->db->escape($prefix . $crit) . "%')";
1503
+				$sql .= "(s.nom LIKE '".$this->db->escape($prefix.$crit)."%')";
1504 1504
 				$i++;
1505 1505
 			}
1506 1506
 			if (count($search_crit) > 1) {
1507 1507
 				$sql .= ")";
1508 1508
 			}
1509 1509
 			if (isModEnabled('barcode')) {
1510
-				$sql .= " OR s.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
1510
+				$sql .= " OR s.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'";
1511 1511
 			}
1512
-			$sql .= " OR s.code_client LIKE '" . $this->db->escape($prefix . $filterkey) . "%' OR s.code_fournisseur LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
1513
-			$sql .= " OR s.name_alias LIKE '" . $this->db->escape($prefix . $filterkey) . "%' OR s.tva_intra LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
1512
+			$sql .= " OR s.code_client LIKE '".$this->db->escape($prefix.$filterkey)."%' OR s.code_fournisseur LIKE '".$this->db->escape($prefix.$filterkey)."%'";
1513
+			$sql .= " OR s.name_alias LIKE '".$this->db->escape($prefix.$filterkey)."%' OR s.tva_intra LIKE '".$this->db->escape($prefix.$filterkey)."%'";
1514 1514
 			$sql .= ")";
1515 1515
 		}
1516 1516
 		$sql .= $this->db->order("nom", "ASC");
@@ -1521,7 +1521,7 @@  discard block
 block discarded – undo
1521 1521
 		$resql = $this->db->query($sql);
1522 1522
 		if ($resql) {
1523 1523
 			// Construct $out and $outarray
1524
-			$out .= '<select id="' . $htmlname . '" class="flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($moreparam ? ' ' . $moreparam : '') . ' name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . '>' . "\n";
1524
+			$out .= '<select id="'.$htmlname.'" class="flat'.($morecss ? ' '.$morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').'>'."\n";
1525 1525
 
1526 1526
 			$textifempty = (($showempty && !is_numeric($showempty)) ? $langs->trans($showempty) : '');
1527 1527
 			if (getDolGlobalString('COMPANY_USE_SEARCH_TO_SELECT')) {
@@ -1534,7 +1534,7 @@  discard block
 block discarded – undo
1534 1534
 				}
1535 1535
 			}
1536 1536
 			if ($showempty) {
1537
-				$out .= '<option value="-1" data-html="' . dol_escape_htmltag('<span class="opacitymedium">' . ($textifempty ? $textifempty : '&nbsp;') . '</span>') . '">' . $textifempty . '</option>' . "\n";
1537
+				$out .= '<option value="-1" data-html="'.dol_escape_htmltag('<span class="opacitymedium">'.($textifempty ? $textifempty : '&nbsp;').'</span>').'">'.$textifempty.'</option>'."\n";
1538 1538
 			}
1539 1539
 
1540 1540
 			$companytemp = new Societe($this->db);
@@ -1547,18 +1547,18 @@  discard block
 block discarded – undo
1547 1547
 					$label = '';
1548 1548
 					if ($showcode || getDolGlobalString('SOCIETE_ADD_REF_IN_LIST')) {
1549 1549
 						if (($obj->client) && (!empty($obj->code_client))) {
1550
-							$label = $obj->code_client . ' - ';
1550
+							$label = $obj->code_client.' - ';
1551 1551
 						}
1552 1552
 						if (($obj->fournisseur) && (!empty($obj->code_fournisseur))) {
1553
-							$label .= $obj->code_fournisseur . ' - ';
1553
+							$label .= $obj->code_fournisseur.' - ';
1554 1554
 						}
1555
-						$label .= ' ' . $obj->name;
1555
+						$label .= ' '.$obj->name;
1556 1556
 					} else {
1557 1557
 						$label = $obj->name;
1558 1558
 					}
1559 1559
 
1560 1560
 					if (!empty($obj->name_alias)) {
1561
-						$label .= ' (' . $obj->name_alias . ')';
1561
+						$label .= ' ('.$obj->name_alias.')';
1562 1562
 					}
1563 1563
 
1564 1564
 					if (getDolGlobalString('SOCIETE_SHOW_VAT_IN_LIST') && !empty($obj->tva_intra)) {
@@ -1573,7 +1573,7 @@  discard block
 block discarded – undo
1573 1573
 						$companytemp->fournisseur = $obj->fournisseur;
1574 1574
 						$tmptype = $companytemp->getTypeUrl(1, '', 0, 'span');
1575 1575
 						if ($tmptype) {
1576
-							$labelhtml .= ' ' . $tmptype;
1576
+							$labelhtml .= ' '.$tmptype;
1577 1577
 						}
1578 1578
 
1579 1579
 						if ($obj->client || $obj->fournisseur) {
@@ -1583,10 +1583,10 @@  discard block
 block discarded – undo
1583 1583
 							$label .= $langs->trans("Customer");
1584 1584
 						}
1585 1585
 						if ($obj->client == 2 || $obj->client == 3) {
1586
-							$label .= ($obj->client == 3 ? ', ' : '') . $langs->trans("Prospect");
1586
+							$label .= ($obj->client == 3 ? ', ' : '').$langs->trans("Prospect");
1587 1587
 						}
1588 1588
 						if ($obj->fournisseur) {
1589
-							$label .= ($obj->client ? ', ' : '') . $langs->trans("Supplier");
1589
+							$label .= ($obj->client ? ', ' : '').$langs->trans("Supplier");
1590 1590
 						}
1591 1591
 						if ($obj->client || $obj->fournisseur) {
1592 1592
 							$label .= ')';
@@ -1594,9 +1594,9 @@  discard block
 block discarded – undo
1594 1594
 					}
1595 1595
 
1596 1596
 					if (getDolGlobalString('COMPANY_SHOW_ADDRESS_SELECTLIST')) {
1597
-						$s = ($obj->address ? ' - ' . $obj->address : '') . ($obj->zip ? ' - ' . $obj->zip : '') . ($obj->town ? ' ' . $obj->town : '');
1597
+						$s = ($obj->address ? ' - '.$obj->address : '').($obj->zip ? ' - '.$obj->zip : '').($obj->town ? ' '.$obj->town : '');
1598 1598
 						if (!empty($obj->country_code)) {
1599
-							$s .= ', ' . $langs->trans('Country' . $obj->country_code);
1599
+							$s .= ', '.$langs->trans('Country'.$obj->country_code);
1600 1600
 						}
1601 1601
 						$label .= $s;
1602 1602
 						$labelhtml .= $s;
@@ -1604,9 +1604,9 @@  discard block
 block discarded – undo
1604 1604
 
1605 1605
 					if (empty($outputmode)) {
1606 1606
 						if (in_array($obj->rowid, $selected)) {
1607
-							$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>';
1607
+							$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>';
1608 1608
 						} else {
1609
-							$out .= '<option value="' . $obj->rowid . '" data-html="' . dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1) . '">' . dol_escape_htmltag($label, 0, 0, '', 0, 1) . '</option>';
1609
+							$out .= '<option value="'.$obj->rowid.'" data-html="'.dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1).'">'.dol_escape_htmltag($label, 0, 0, '', 0, 1).'</option>';
1610 1610
 						}
1611 1611
 					} else {
1612 1612
 						array_push($outarray, array('key' => $obj->rowid, 'value' => $label, 'label' => $label, 'labelhtml' => $labelhtml));
@@ -1618,9 +1618,9 @@  discard block
 block discarded – undo
1618 1618
 					}
1619 1619
 				}
1620 1620
 			}
1621
-			$out .= '</select>' . "\n";
1621
+			$out .= '</select>'."\n";
1622 1622
 			if (!$forcecombo) {
1623
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
1623
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
1624 1624
 				$out .= ajax_combobox($htmlname, $events, getDolGlobalString("COMPANY_USE_SEARCH_TO_SELECT"));
1625 1625
 			}
1626 1626
 		} else {
@@ -1656,18 +1656,18 @@  discard block
 block discarded – undo
1656 1656
 		// On recherche les remises
1657 1657
 		$sql = "SELECT re.rowid, re.amount_ht, re.amount_tva, re.amount_ttc,";
1658 1658
 		$sql .= " re.description, re.fk_facture_source";
1659
-		$sql .= " FROM " . $this->db->prefix() . "societe_remise_except as re";
1660
-		$sql .= " WHERE re.fk_soc = " . (int) $socid;
1661
-		$sql .= " AND re.entity = " . $conf->entity;
1659
+		$sql .= " FROM ".$this->db->prefix()."societe_remise_except as re";
1660
+		$sql .= " WHERE re.fk_soc = ".(int) $socid;
1661
+		$sql .= " AND re.entity = ".$conf->entity;
1662 1662
 		if ($filter) {
1663
-			$sql .= " AND " . $filter;
1663
+			$sql .= " AND ".$filter;
1664 1664
 		}
1665 1665
 		$sql .= " ORDER BY re.description ASC";
1666 1666
 
1667
-		dol_syslog(get_class($this) . "::select_remises", LOG_DEBUG);
1667
+		dol_syslog(get_class($this)."::select_remises", LOG_DEBUG);
1668 1668
 		$resql = $this->db->query($sql);
1669 1669
 		if ($resql) {
1670
-			print '<select id="select_' . $htmlname . '" class="flat maxwidthonsmartphone" name="' . $htmlname . '">';
1670
+			print '<select id="select_'.$htmlname.'" class="flat maxwidthonsmartphone" name="'.$htmlname.'">';
1671 1671
 			$num = $this->db->num_rows($resql);
1672 1672
 
1673 1673
 			$qualifiedlines = $num;
@@ -1705,16 +1705,16 @@  discard block
 block discarded – undo
1705 1705
 					if (getDolGlobalString('MAIN_SHOW_FACNUMBER_IN_DISCOUNT_LIST') && !empty($obj->fk_facture_source)) {
1706 1706
 						$tmpfac = new Facture($this->db);
1707 1707
 						if ($tmpfac->fetch($obj->fk_facture_source) > 0) {
1708
-							$desc = $desc . ' - ' . $tmpfac->ref;
1708
+							$desc = $desc.' - '.$tmpfac->ref;
1709 1709
 						}
1710 1710
 					}
1711 1711
 
1712
-					print '<option value="' . $obj->rowid . '"' . $selectstring . $disabled . '>' . $desc . ' (' . price($obj->amount_ht) . ' ' . $langs->trans("HT") . ' - ' . price($obj->amount_ttc) . ' ' . $langs->trans("TTC") . ')</option>';
1712
+					print '<option value="'.$obj->rowid.'"'.$selectstring.$disabled.'>'.$desc.' ('.price($obj->amount_ht).' '.$langs->trans("HT").' - '.price($obj->amount_ttc).' '.$langs->trans("TTC").')</option>';
1713 1713
 					$i++;
1714 1714
 				}
1715 1715
 			}
1716 1716
 			print '</select>';
1717
-			print ajax_combobox('select_' . $htmlname);
1717
+			print ajax_combobox('select_'.$htmlname);
1718 1718
 
1719 1719
 			return $qualifiedlines;
1720 1720
 		} else {
@@ -1795,7 +1795,7 @@  discard block
 block discarded – undo
1795 1795
 		$out = '';
1796 1796
 
1797 1797
 		if (!is_object($hookmanager)) {
1798
-			include_once DOL_DOCUMENT_ROOT . '/core/class/hookmanager.class.php';
1798
+			include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
1799 1799
 			$hookmanager = new HookManager($this->db);
1800 1800
 		}
1801 1801
 
@@ -1804,13 +1804,13 @@  discard block
 block discarded – undo
1804 1804
 		if ($showsoc > 0 || getDolGlobalString('CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST')) {
1805 1805
 			$sql .= ", s.nom as company, s.town AS company_town";
1806 1806
 		}
1807
-		$sql .= " FROM " . $this->db->prefix() . "socpeople as sp";
1807
+		$sql .= " FROM ".$this->db->prefix()."socpeople as sp";
1808 1808
 		if ($showsoc > 0 || getDolGlobalString('CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST')) {
1809
-			$sql .= " LEFT OUTER JOIN  " . $this->db->prefix() . "societe as s ON s.rowid=sp.fk_soc";
1809
+			$sql .= " LEFT OUTER JOIN  ".$this->db->prefix()."societe as s ON s.rowid=sp.fk_soc";
1810 1810
 		}
1811
-		$sql .= " WHERE sp.entity IN (" . getEntity('contact') . ")";
1811
+		$sql .= " WHERE sp.entity IN (".getEntity('contact').")";
1812 1812
 		if ($socid > 0 || $socid == -1) {
1813
-			$sql .= " AND sp.fk_soc = " . ((int) $socid);
1813
+			$sql .= " AND sp.fk_soc = ".((int) $socid);
1814 1814
 		}
1815 1815
 		if (getDolGlobalString('CONTACT_HIDE_INACTIVE_IN_COMBOBOX')) {
1816 1816
 			$sql .= " AND sp.statut <> 0";
@@ -1821,30 +1821,30 @@  discard block
 block discarded – undo
1821 1821
 		$sql .= $hookmanager->resPrint;
1822 1822
 		$sql .= " ORDER BY sp.lastname ASC";
1823 1823
 
1824
-		dol_syslog(get_class($this) . "::selectcontacts", LOG_DEBUG);
1824
+		dol_syslog(get_class($this)."::selectcontacts", LOG_DEBUG);
1825 1825
 		$resql = $this->db->query($sql);
1826 1826
 		if ($resql) {
1827 1827
 			$num = $this->db->num_rows($resql);
1828 1828
 
1829 1829
 			if ($htmlname != 'none' && !$options_only) {
1830
-				$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlid . '" name="' . $htmlname . (($num || empty($disableifempty)) ? '' : ' disabled') . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . ' ' . (!empty($moreparam) ? $moreparam : '') . '>';
1830
+				$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="'.$htmlid.'" name="'.$htmlname.(($num || empty($disableifempty)) ? '' : ' disabled').($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.(!empty($moreparam) ? $moreparam : '').'>';
1831 1831
 			}
1832 1832
 
1833 1833
 			if ($showempty && !is_numeric($showempty)) {
1834 1834
 				$textforempty = $showempty;
1835
-				$out .= '<option class="optiongrey" value="-1"' . (in_array(-1, $selected) ? ' selected' : '') . '>' . $textforempty . '</option>';
1835
+				$out .= '<option class="optiongrey" value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'>'.$textforempty.'</option>';
1836 1836
 			} else {
1837 1837
 				if (($showempty == 1 || ($showempty == 3 && $num > 1)) && !$multiple) {
1838
-					$out .= '<option value="0"' . (in_array(0, $selected) ? ' selected' : '') . '>&nbsp;</option>';
1838
+					$out .= '<option value="0"'.(in_array(0, $selected) ? ' selected' : '').'>&nbsp;</option>';
1839 1839
 				}
1840 1840
 				if ($showempty == 2) {
1841
-					$out .= '<option value="0"' . (in_array(0, $selected) ? ' selected' : '') . '>-- ' . $langs->trans("Internal") . ' --</option>';
1841
+					$out .= '<option value="0"'.(in_array(0, $selected) ? ' selected' : '').'>-- '.$langs->trans("Internal").' --</option>';
1842 1842
 				}
1843 1843
 			}
1844 1844
 
1845 1845
 			$i = 0;
1846 1846
 			if ($num) {
1847
-				include_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php';
1847
+				include_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
1848 1848
 				$contactstatic = new Contact($this->db);
1849 1849
 
1850 1850
 				while ($i < $num) {
@@ -1880,7 +1880,7 @@  discard block
 block discarded – undo
1880 1880
 						}
1881 1881
 						$extendedInfos = implode(' - ', $extendedInfos);
1882 1882
 						if (!empty($extendedInfos)) {
1883
-							$extendedInfos = ' - ' . $extendedInfos;
1883
+							$extendedInfos = ' - '.$extendedInfos;
1884 1884
 						}
1885 1885
 					}
1886 1886
 
@@ -1897,42 +1897,42 @@  discard block
 block discarded – undo
1897 1897
 								$disabled = 1;
1898 1898
 							}
1899 1899
 							if (!empty($selected) && in_array($obj->rowid, $selected)) {
1900
-								$out .= '<option value="' . $obj->rowid . '"';
1900
+								$out .= '<option value="'.$obj->rowid.'"';
1901 1901
 								if ($disabled) {
1902 1902
 									$out .= ' disabled';
1903 1903
 								}
1904 1904
 								$out .= ' selected>';
1905
-								$out .= $contactstatic->getFullName($langs) . $extendedInfos;
1905
+								$out .= $contactstatic->getFullName($langs).$extendedInfos;
1906 1906
 								if ($showfunction && $obj->poste) {
1907
-									$out .= ' (' . $obj->poste . ')';
1907
+									$out .= ' ('.$obj->poste.')';
1908 1908
 								}
1909 1909
 								if (($showsoc > 0) && $obj->company) {
1910
-									$out .= ' - (' . $obj->company . ')';
1910
+									$out .= ' - ('.$obj->company.')';
1911 1911
 								}
1912 1912
 								$out .= '</option>';
1913 1913
 							} else {
1914
-								$out .= '<option value="' . $obj->rowid . '"';
1914
+								$out .= '<option value="'.$obj->rowid.'"';
1915 1915
 								if ($disabled) {
1916 1916
 									$out .= ' disabled';
1917 1917
 								}
1918 1918
 								$out .= '>';
1919
-								$out .= $contactstatic->getFullName($langs) . $extendedInfos;
1919
+								$out .= $contactstatic->getFullName($langs).$extendedInfos;
1920 1920
 								if ($showfunction && $obj->poste) {
1921
-									$out .= ' (' . $obj->poste . ')';
1921
+									$out .= ' ('.$obj->poste.')';
1922 1922
 								}
1923 1923
 								if (($showsoc > 0) && $obj->company) {
1924
-									$out .= ' - (' . $obj->company . ')';
1924
+									$out .= ' - ('.$obj->company.')';
1925 1925
 								}
1926 1926
 								$out .= '</option>';
1927 1927
 							}
1928 1928
 						} else {
1929 1929
 							if (in_array($obj->rowid, $selected)) {
1930
-								$out .= $contactstatic->getFullName($langs) . $extendedInfos;
1930
+								$out .= $contactstatic->getFullName($langs).$extendedInfos;
1931 1931
 								if ($showfunction && $obj->poste) {
1932
-									$out .= ' (' . $obj->poste . ')';
1932
+									$out .= ' ('.$obj->poste.')';
1933 1933
 								}
1934 1934
 								if (($showsoc > 0) && $obj->company) {
1935
-									$out .= ' - (' . $obj->company . ')';
1935
+									$out .= ' - ('.$obj->company.')';
1936 1936
 								}
1937 1937
 							}
1938 1938
 						}
@@ -1941,7 +1941,7 @@  discard block
 block discarded – undo
1941 1941
 				}
1942 1942
 			} else {
1943 1943
 				$labeltoshow = ($socid != -1) ? ($langs->trans($socid ? "NoContactDefinedForThirdParty" : "NoContactDefined")) : $langs->trans('SelectAThirdPartyFirst');
1944
-				$out .= '<option class="disabled" value="-1"' . (($showempty == 2 || $multiple) ? '' : ' selected') . ' disabled="disabled">';
1944
+				$out .= '<option class="disabled" value="-1"'.(($showempty == 2 || $multiple) ? '' : ' selected').' disabled="disabled">';
1945 1945
 				$out .= $labeltoshow;
1946 1946
 				$out .= '</option>';
1947 1947
 			}
@@ -1962,7 +1962,7 @@  discard block
 block discarded – undo
1962 1962
 			}
1963 1963
 
1964 1964
 			if ($conf->use_javascript_ajax && !$forcecombo && !$options_only) {
1965
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
1965
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
1966 1966
 				$out .= ajax_combobox($htmlid, $events, getDolGlobalString("CONTACT_USE_SEARCH_TO_SELECT"));
1967 1967
 			}
1968 1968
 
@@ -2071,14 +2071,14 @@  discard block
 block discarded – undo
2071 2071
 		if ($showlabelofentity) {
2072 2072
 			$sql .= ", e.label";
2073 2073
 		}
2074
-		$sql .= " FROM " . $this->db->prefix() . "user as u";
2074
+		$sql .= " FROM ".$this->db->prefix()."user as u";
2075 2075
 		if ($showlabelofentity) {
2076
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "entity as e ON e.rowid = u.entity";
2076
+			$sql .= " LEFT JOIN ".$this->db->prefix()."entity as e ON e.rowid = u.entity";
2077 2077
 		}
2078 2078
 		// Condition here should be the same than into societe->getSalesRepresentatives().
2079 2079
 		if ($userissuperadminentityone && $force_entity != 'default') {
2080 2080
 			if (!empty($force_entity)) {
2081
-				$sql .= " WHERE u.entity IN (0, " . $this->db->sanitize($force_entity) . ")";
2081
+				$sql .= " WHERE u.entity IN (0, ".$this->db->sanitize($force_entity).")";
2082 2082
 			} else {
2083 2083
 				$sql .= " WHERE u.entity IS NOT NULL";
2084 2084
 			}
@@ -2086,18 +2086,18 @@  discard block
 block discarded – undo
2086 2086
 			if (isModEnabled('multicompany') && getDolGlobalInt('MULTICOMPANY_TRANSVERSE_MODE')) {
2087 2087
 				$sql .= " WHERE u.rowid IN (SELECT ug.fk_user FROM ".$this->db->prefix()."usergroup_user as ug WHERE ug.entity IN (".getEntity('usergroup')."))";
2088 2088
 			} else {
2089
-				$sql .= " WHERE u.entity IN (" . getEntity('user') . ")";
2089
+				$sql .= " WHERE u.entity IN (".getEntity('user').")";
2090 2090
 			}
2091 2091
 		}
2092 2092
 
2093 2093
 		if (!empty($user->socid)) {
2094
-			$sql .= " AND u.fk_soc = " . ((int) $user->socid);
2094
+			$sql .= " AND u.fk_soc = ".((int) $user->socid);
2095 2095
 		}
2096 2096
 		if (is_array($exclude) && $excludeUsers) {
2097
-			$sql .= " AND u.rowid NOT IN (" . $this->db->sanitize($excludeUsers) . ")";
2097
+			$sql .= " AND u.rowid NOT IN (".$this->db->sanitize($excludeUsers).")";
2098 2098
 		}
2099 2099
 		if ($includeUsers) {
2100
-			$sql .= " AND u.rowid IN (" . $this->db->sanitize($includeUsers) . ")";
2100
+			$sql .= " AND u.rowid IN (".$this->db->sanitize($includeUsers).")";
2101 2101
 		}
2102 2102
 		if (getDolGlobalString('USER_HIDE_INACTIVE_IN_COMBOBOX') || $notdisabled) {
2103 2103
 			$sql .= " AND u.statut <> 0";
@@ -2109,7 +2109,7 @@  discard block
 block discarded – undo
2109 2109
 			$sql .= " AND u.fk_soc IS NULL";
2110 2110
 		}
2111 2111
 		if (!empty($morefilter)) {
2112
-			$sql .= " " . $morefilter;
2112
+			$sql .= " ".$morefilter;
2113 2113
 		}
2114 2114
 
2115 2115
 		//Add hook to filter on user (for example on usergroup define in custom modules)
@@ -2124,7 +2124,7 @@  discard block
 block discarded – undo
2124 2124
 			$sql .= " ORDER BY u.statut DESC, u.lastname ASC, u.firstname ASC";
2125 2125
 		}
2126 2126
 
2127
-		dol_syslog(get_class($this) . "::select_dolusers", LOG_DEBUG);
2127
+		dol_syslog(get_class($this)."::select_dolusers", LOG_DEBUG);
2128 2128
 
2129 2129
 		$resql = $this->db->query($sql);
2130 2130
 		if ($resql) {
@@ -2132,7 +2132,7 @@  discard block
 block discarded – undo
2132 2132
 			$i = 0;
2133 2133
 			if ($num) {
2134 2134
 				// do not use maxwidthonsmartphone by default. Set it by caller so auto size to 100% will work when not defined
2135
-				$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : ' minwidth200') . '" id="' . $htmlname . '" name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . ' ' . ($disabled ? ' disabled' : '') . '>';
2135
+				$out .= '<select class="flat'.($morecss ? ' '.$morecss : ' minwidth200').'" id="'.$htmlname.'" name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.($disabled ? ' disabled' : '').'>';
2136 2136
 				if ($show_empty && !$multiple) {
2137 2137
 					$textforempty = ' ';
2138 2138
 					if (!empty($conf->use_javascript_ajax)) {
@@ -2141,10 +2141,10 @@  discard block
 block discarded – undo
2141 2141
 					if (!is_numeric($show_empty)) {
2142 2142
 						$textforempty = $show_empty;
2143 2143
 					}
2144
-					$out .= '<option class="optiongrey" value="' . ($show_empty < 0 ? $show_empty : -1) . '"' . ((empty($selected) || in_array(-1, $selected)) ? ' selected' : '') . '>' . $textforempty . '</option>' . "\n";
2144
+					$out .= '<option class="optiongrey" value="'.($show_empty < 0 ? $show_empty : -1).'"'.((empty($selected) || in_array(-1, $selected)) ? ' selected' : '').'>'.$textforempty.'</option>'."\n";
2145 2145
 				}
2146 2146
 				if ($show_every) {
2147
-					$out .= '<option value="-2"' . ((in_array(-2, $selected)) ? ' selected' : '') . '>-- ' . $langs->trans("Everybody") . ' --</option>' . "\n";
2147
+					$out .= '<option value="-2"'.((in_array(-2, $selected)) ? ' selected' : '').'>-- '.$langs->trans("Everybody").' --</option>'."\n";
2148 2148
 				}
2149 2149
 
2150 2150
 				$userstatic = new User($this->db);
@@ -2191,21 +2191,21 @@  discard block
 block discarded – undo
2191 2191
 					}
2192 2192
 					if ($showstatus >= 0) {
2193 2193
 						if ($obj->status == 1 && $showstatus == 1) {
2194
-							$moreinfo .= ($moreinfo ? ' - ' : ' (') . $langs->trans('Enabled');
2195
-							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . $langs->trans('Enabled');
2194
+							$moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans('Enabled');
2195
+							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').$langs->trans('Enabled');
2196 2196
 						}
2197 2197
 						if ($obj->status == 0 && $showstatus == 1) {
2198
-							$moreinfo .= ($moreinfo ? ' - ' : ' (') . $langs->trans('Disabled');
2199
-							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . $langs->trans('Disabled');
2198
+							$moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans('Disabled');
2199
+							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').$langs->trans('Disabled');
2200 2200
 						}
2201 2201
 					}
2202 2202
 					if ($showlabelofentity) {
2203 2203
 						if (empty($obj->entity)) {
2204
-							$moreinfo .= ($moreinfo ? ' - ' : ' (') . $langs->trans("AllEntities");
2205
-							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . $langs->trans("AllEntities");
2204
+							$moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans("AllEntities");
2205
+							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').$langs->trans("AllEntities");
2206 2206
 						} else {
2207 2207
 							if ($obj->entity != $conf->entity) {
2208
-								$moreinfo .= ($moreinfo ? ' - ' : ' (') . ($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined"));
2208
+								$moreinfo .= ($moreinfo ? ' - ' : ' (').($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined"));
2209 2209
 								$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined"));
2210 2210
 							}
2211 2211
 						}
@@ -2214,13 +2214,13 @@  discard block
 block discarded – undo
2214 2214
 					$moreinfohtml .= (!empty($moreinfohtml) ? ')</span>' : '');
2215 2215
 					if (!empty($disableline) && $disableline != '1') {
2216 2216
 						// Add text from $enableonlytext parameter
2217
-						$moreinfo .= ' - ' . $disableline;
2218
-						$moreinfohtml .= ' - ' . $disableline;
2217
+						$moreinfo .= ' - '.$disableline;
2218
+						$moreinfohtml .= ' - '.$disableline;
2219 2219
 					}
2220 2220
 					$labeltoshow .= $moreinfo;
2221 2221
 					$labeltoshowhtml .= $moreinfohtml;
2222 2222
 
2223
-					$out .= '<option value="' . $obj->rowid . '"';
2223
+					$out .= '<option value="'.$obj->rowid.'"';
2224 2224
 					if (!empty($disableline)) {
2225 2225
 						$out .= ' disabled';
2226 2226
 					}
@@ -2228,7 +2228,7 @@  discard block
 block discarded – undo
2228 2228
 						$out .= ' selected';
2229 2229
 					}
2230 2230
 					$out .= ' data-html="';
2231
-					$outhtml = $userstatic->getNomUrl(-3, '', 0, 1, 24, 1, 'login', '', 1) . ' ';
2231
+					$outhtml = $userstatic->getNomUrl(-3, '', 0, 1, 24, 1, 'login', '', 1).' ';
2232 2232
 					if ($showstatus >= 0 && $obj->status == 0) {
2233 2233
 						$outhtml .= '<strike class="opacitymediumxxx">';
2234 2234
 					}
@@ -2241,7 +2241,7 @@  discard block
 block discarded – undo
2241 2241
 					$out .= $labeltoshow;
2242 2242
 					$out .= '</option>';
2243 2243
 
2244
-					$outarray[$userstatic->id] = $userstatic->getFullName($langs, $fullNameMode, -1, $maxlength) . $moreinfo;
2244
+					$outarray[$userstatic->id] = $userstatic->getFullName($langs, $fullNameMode, -1, $maxlength).$moreinfo;
2245 2245
 					$outarray2[$userstatic->id] = array(
2246 2246
 						'id' => $userstatic->id,
2247 2247
 						'label' => $labeltoshow,
@@ -2253,14 +2253,14 @@  discard block
 block discarded – undo
2253 2253
 					$i++;
2254 2254
 				}
2255 2255
 			} else {
2256
-				$out .= '<select class="flat" id="' . $htmlname . '" name="' . $htmlname . '" disabled>';
2257
-				$out .= '<option value="">' . $langs->trans("None") . '</option>';
2256
+				$out .= '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'" disabled>';
2257
+				$out .= '<option value="">'.$langs->trans("None").'</option>';
2258 2258
 			}
2259 2259
 			$out .= '</select>';
2260 2260
 
2261 2261
 			if ($num && !$forcecombo) {
2262 2262
 				// Enhance with select2
2263
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
2263
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
2264 2264
 				$out .= ajax_combobox($htmlname);
2265 2265
 			}
2266 2266
 		} else {
@@ -2334,16 +2334,16 @@  discard block
 block discarded – undo
2334 2334
 			$out .= $userstatic->getNomUrl(-1);
2335 2335
 			if ($i == 0) {
2336 2336
 				$ownerid = $value['id'];
2337
-				$out .= ' (' . $langs->trans("Owner") . ')';
2337
+				$out .= ' ('.$langs->trans("Owner").')';
2338 2338
 			}
2339 2339
 			if ($nbassignetouser > 1 && $action != 'view') {
2340
-				$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 . '">';
2340
+				$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.'">';
2341 2341
 			}
2342 2342
 			// Show my availability
2343 2343
 			if ($showproperties) {
2344 2344
 				if ($ownerid == $value['id'] && is_array($listofuserid) && count($listofuserid) && in_array($ownerid, array_keys($listofuserid))) {
2345 2345
 					$out .= '<div class="myavailability inline-block">';
2346
-					$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>';
2346
+					$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>';
2347 2347
 					$out .= '</div>';
2348 2348
 				}
2349 2349
 			}
@@ -2360,15 +2360,15 @@  discard block
 block discarded – undo
2360 2360
 		// Method with no ajax
2361 2361
 		if ($action != 'view') {
2362 2362
 			$out .= '<input type="hidden" class="removedassignedhidden" name="removedassigned" value="">';
2363
-			$out .= '<script nonce="' . getNonce() . '" type="text/javascript">jQuery(document).ready(function () {';
2363
+			$out .= '<script nonce="'.getNonce().'" type="text/javascript">jQuery(document).ready(function () {';
2364 2364
 			$out .= 'jQuery(".removedassigned").click(function() { jQuery(".removedassignedhidden").val(jQuery(this).val()); });';
2365 2365
 			$out .= 'jQuery(".assignedtouser").change(function() { console.log(jQuery(".assignedtouser option:selected").val());';
2366
-			$out .= ' if (jQuery(".assignedtouser option:selected").val() > 0) { jQuery("#' . $action . 'assignedtouser").attr("disabled", false); }';
2367
-			$out .= ' else { jQuery("#' . $action . 'assignedtouser").attr("disabled", true); }';
2366
+			$out .= ' if (jQuery(".assignedtouser option:selected").val() > 0) { jQuery("#'.$action.'assignedtouser").attr("disabled", false); }';
2367
+			$out .= ' else { jQuery("#'.$action.'assignedtouser").attr("disabled", true); }';
2368 2368
 			$out .= '});';
2369 2369
 			$out .= '})</script>';
2370 2370
 			$out .= $this->select_dolusers('', $htmlname, $show_empty, $exclude, $disabled, $include, $enableonly, $force_entity, $maxlength, $showstatus, $morefilter);
2371
-			$out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="' . $action . 'assignedtouser" name="' . $action . 'assignedtouser" value="' . dol_escape_htmltag($langs->trans("Add")) . '">';
2371
+			$out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="'.$action.'assignedtouser" name="'.$action.'assignedtouser" value="'.dol_escape_htmltag($langs->trans("Add")).'">';
2372 2372
 			$out .= '<br>';
2373 2373
 		}
2374 2374
 
@@ -2427,13 +2427,13 @@  discard block
 block discarded – undo
2427 2427
 			$resourcestatic->fetch($value['id']);
2428 2428
 			$out .= $resourcestatic->getNomUrl(-1);
2429 2429
 			if ($nbassignetoresource > 1 && $action != 'view') {
2430
-				$out .= ' <input type="image" style="border: 0px;" src="' . img_picto($langs->trans("Remove"), 'delete', '', 0, 1) . '" value="' . $resourcestatic->id . '" class="removedassigned reposition" id="removedassignedresource_' . $resourcestatic->id . '" name="removedassignedresource_' . $resourcestatic->id . '">';
2430
+				$out .= ' <input type="image" style="border: 0px;" src="'.img_picto($langs->trans("Remove"), 'delete', '', 0, 1).'" value="'.$resourcestatic->id.'" class="removedassigned reposition" id="removedassignedresource_'.$resourcestatic->id.'" name="removedassignedresource_'.$resourcestatic->id.'">';
2431 2431
 			}
2432 2432
 			// Show my availability
2433 2433
 			if ($showproperties) {
2434 2434
 				if (is_array($listofresourceid) && count($listofresourceid)) {
2435 2435
 					$out .= '<div class="myavailability inline-block">';
2436
-					$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>';
2436
+					$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>';
2437 2437
 					$out .= '</div>';
2438 2438
 				}
2439 2439
 			}
@@ -2450,11 +2450,11 @@  discard block
 block discarded – undo
2450 2450
 		// Method with no ajax
2451 2451
 		if ($action != 'view') {
2452 2452
 			$out .= '<input type="hidden" class="removedassignedhidden" name="removedassignedresource" value="">';
2453
-			$out .= '<script nonce="' . getNonce() . '" type="text/javascript">jQuery(document).ready(function () {';
2453
+			$out .= '<script nonce="'.getNonce().'" type="text/javascript">jQuery(document).ready(function () {';
2454 2454
 			$out .= 'jQuery(".removedassignedresource").click(function() { jQuery(".removedassignedresourcehidden").val(jQuery(this).val()); });';
2455 2455
 			$out .= 'jQuery(".assignedtoresource").change(function() { console.log(jQuery(".assignedtoresource option:selected").val());';
2456
-			$out .= ' if (jQuery(".assignedtoresource option:selected").val() > 0) { jQuery("#' . $action . 'assignedtoresource").attr("disabled", false); }';
2457
-			$out .= ' else { jQuery("#' . $action . 'assignedtoresource").attr("disabled", true); }';
2456
+			$out .= ' if (jQuery(".assignedtoresource option:selected").val() > 0) { jQuery("#'.$action.'assignedtoresource").attr("disabled", false); }';
2457
+			$out .= ' else { jQuery("#'.$action.'assignedtoresource").attr("disabled", true); }';
2458 2458
 			$out .= '});';
2459 2459
 			$out .= '})</script>';
2460 2460
 
@@ -2462,7 +2462,7 @@  discard block
 block discarded – undo
2462 2462
 			$out .= img_picto('', 'resource', 'class="pictofixedwidth"');
2463 2463
 			$out .= $formresources->select_resource_list(0, $htmlname, [], 1, 1, 0, $events, array(), 2, 0);
2464 2464
 			//$out .= $this->select_dolusers('', $htmlname, $show_empty, $exclude, $disabled, $include, $enableonly, $force_entity, $maxlength, $showstatus, $morefilter);
2465
-			$out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="' . $action . 'assignedtoresource" name="' . $action . 'assignedtoresource" value="' . dol_escape_htmltag($langs->trans("Add")) . '">';
2465
+			$out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="'.$action.'assignedtoresource" name="'.$action.'assignedtoresource" value="'.dol_escape_htmltag($langs->trans("Add")).'">';
2466 2466
 			$out .= '<br>';
2467 2467
 		}
2468 2468
 
@@ -2523,7 +2523,7 @@  discard block
 block discarded – undo
2523 2523
 			$placeholder = '';
2524 2524
 
2525 2525
 			if ($selected && empty($selected_input_value)) {
2526
-				require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
2526
+				require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
2527 2527
 				$producttmpselect = new Product($this->db);
2528 2528
 				$producttmpselect->fetch($selected);
2529 2529
 				$selected_input_value = $producttmpselect->ref;
@@ -2538,17 +2538,17 @@  discard block
 block discarded – undo
2538 2538
 				}
2539 2539
 			}
2540 2540
 			// mode=1 means customers products
2541
-			$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;
2542
-			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
2541
+			$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;
2542
+			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
2543 2543
 
2544 2544
 			if (isModEnabled('variants') && is_array($selected_combinations)) {
2545 2545
 				// Code to automatically insert with javascript the select of attributes under the select of product
2546 2546
 				// when a parent of variant has been selected.
2547 2547
 				$out .= '
2548 2548
 				<!-- script to auto show attributes select tags if a variant was selected -->
2549
-				<script nonce="' . getNonce() . '">
2549
+				<script nonce="' . getNonce().'">
2550 2550
 					// auto show attributes fields
2551
-					selected = ' . json_encode($selected_combinations) . ';
2551
+					selected = ' . json_encode($selected_combinations).';
2552 2552
 					combvalues = {};
2553 2553
 
2554 2554
 					jQuery(document).ready(function () {
@@ -2559,7 +2559,7 @@  discard block
 block discarded – undo
2559 2559
 							}
2560 2560
 						});
2561 2561
 
2562
-						jQuery("input#' . $htmlname . '").change(function () {
2562
+						jQuery("input#' . $htmlname.'").change(function () {
2563 2563
 
2564 2564
 							if (!jQuery(this).val()) {
2565 2565
 								jQuery(\'div#attributes_box\').empty();
@@ -2568,7 +2568,7 @@  discard block
 block discarded – undo
2568 2568
 
2569 2569
 							console.log("A change has started. We get variants fields to inject html select");
2570 2570
 
2571
-							jQuery.getJSON("' . DOL_URL_ROOT . '/variants/ajax/getCombinations.php", {
2571
+							jQuery.getJSON("' . DOL_URL_ROOT.'/variants/ajax/getCombinations.php", {
2572 2572
 								id: jQuery(this).val()
2573 2573
 							}, function (data) {
2574 2574
 								jQuery(\'div#attributes_box\').empty();
@@ -2611,21 +2611,21 @@  discard block
 block discarded – undo
2611 2611
 							})
2612 2612
 						});
2613 2613
 
2614
-						' . ($selected ? 'jQuery("input#' . $htmlname . '").change();' : '') . '
2614
+						' . ($selected ? 'jQuery("input#'.$htmlname.'").change();' : '').'
2615 2615
 					});
2616 2616
 				</script>
2617 2617
                 ';
2618 2618
 			}
2619 2619
 
2620 2620
 			if (empty($hidelabel)) {
2621
-				$out .= $langs->trans("RefOrLabel") . ' : ';
2621
+				$out .= $langs->trans("RefOrLabel").' : ';
2622 2622
 			} elseif ($hidelabel > 1) {
2623
-				$placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"';
2623
+				$placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"';
2624 2624
 				if ($hidelabel == 2) {
2625 2625
 					$out .= img_picto($langs->trans("Search"), 'search');
2626 2626
 				}
2627 2627
 			}
2628
-			$out .= '<input type="text" class="minwidth100' . ($morecss ? ' ' . $morecss : '') . '" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />';
2628
+			$out .= '<input type="text" class="minwidth100'.($morecss ? ' '.$morecss : '').'" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />';
2629 2629
 			if ($hidelabel == 3) {
2630 2630
 				$out .= img_picto($langs->trans("Search"), 'search');
2631 2631
 			}
@@ -2662,33 +2662,33 @@  discard block
 block discarded – undo
2662 2662
 		// phpcs:enable
2663 2663
 		global $conf, $user, $langs, $db;
2664 2664
 
2665
-		require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
2665
+		require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
2666 2666
 
2667 2667
 		$error = 0;
2668 2668
 		$out = '';
2669 2669
 
2670 2670
 		if (!$forcecombo) {
2671
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
2671
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
2672 2672
 			$events = array();
2673 2673
 			$out .= ajax_combobox($htmlname, $events, getDolGlobalInt("PRODUIT_USE_SEARCH_TO_SELECT"));
2674 2674
 		}
2675 2675
 
2676
-		$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
2676
+		$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
2677 2677
 
2678 2678
 		$sql = 'SELECT b.rowid, b.ref, b.label, b.fk_product';
2679
-		$sql .= ' FROM ' . MAIN_DB_PREFIX . 'bom_bom as b';
2680
-		$sql .= ' WHERE b.entity IN (' . getEntity('bom') . ')';
2679
+		$sql .= ' FROM '.MAIN_DB_PREFIX.'bom_bom as b';
2680
+		$sql .= ' WHERE b.entity IN ('.getEntity('bom').')';
2681 2681
 		if (!empty($status)) {
2682
-			$sql .= ' AND status = ' . (int) $status;
2682
+			$sql .= ' AND status = '.(int) $status;
2683 2683
 		}
2684 2684
 		if (!empty($type)) {
2685
-			$sql .= ' AND bomtype = ' . (int) $type;
2685
+			$sql .= ' AND bomtype = '.(int) $type;
2686 2686
 		}
2687 2687
 		if (!empty($TProducts)) {
2688
-			$sql .= ' AND fk_product IN (' . $this->db->sanitize(implode(',', $TProducts)) . ')';
2688
+			$sql .= ' AND fk_product IN ('.$this->db->sanitize(implode(',', $TProducts)).')';
2689 2689
 		}
2690 2690
 		if (!empty($limit)) {
2691
-			$sql .= ' LIMIT ' . (int) $limit;
2691
+			$sql .= ' LIMIT '.(int) $limit;
2692 2692
 		}
2693 2693
 		$resql = $db->query($sql);
2694 2694
 		if ($resql) {
@@ -2702,11 +2702,11 @@  discard block
 block discarded – undo
2702 2702
 			while ($obj = $db->fetch_object($resql)) {
2703 2703
 				$product = new Product($db);
2704 2704
 				$res = $product->fetch($obj->fk_product);
2705
-				$out .= '<option value="' . $obj->rowid . '"';
2705
+				$out .= '<option value="'.$obj->rowid.'"';
2706 2706
 				if ($obj->rowid == $selected) {
2707 2707
 					$out .= 'selected';
2708 2708
 				}
2709
-				$out .= '>' . $obj->ref . ' - ' . $product->label . ' - ' . $obj->label . '</option>';
2709
+				$out .= '>'.$obj->ref.' - '.$product->label.' - '.$obj->label.'</option>';
2710 2710
 			}
2711 2711
 		} else {
2712 2712
 			$error++;
@@ -2763,7 +2763,7 @@  discard block
 block discarded – undo
2763 2763
 
2764 2764
 		$warehouseStatusArray = array();
2765 2765
 		if (!empty($warehouseStatus)) {
2766
-			require_once DOL_DOCUMENT_ROOT . '/product/stock/class/entrepot.class.php';
2766
+			require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php';
2767 2767
 			if (preg_match('/warehouseclosed/', $warehouseStatus)) {
2768 2768
 				$warehouseStatusArray[] = Entrepot::STATUS_CLOSED;
2769 2769
 			}
@@ -2777,9 +2777,9 @@  discard block
 block discarded – undo
2777 2777
 
2778 2778
 		$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";
2779 2779
 		if (count($warehouseStatusArray)) {
2780
-			$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
2780
+			$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
2781 2781
 		} else {
2782
-			$selectFieldsGrouped = ", " . $this->db->ifsql("p.stock IS NULL", 0, "p.stock") . " AS stock";
2782
+			$selectFieldsGrouped = ", ".$this->db->ifsql("p.stock IS NULL", 0, "p.stock")." AS stock";
2783 2783
 		}
2784 2784
 
2785 2785
 		$sql = "SELECT ";
@@ -2795,9 +2795,9 @@  discard block
 block discarded – undo
2795 2795
 
2796 2796
 		if (getDolGlobalString('PRODUCT_SORT_BY_CATEGORY')) {
2797 2797
 			//Product category
2798
-			$sql .= ", (SELECT " . $this->db->prefix() . "categorie_product.fk_categorie
2799
-						FROM " . $this->db->prefix() . "categorie_product
2800
-						WHERE " . $this->db->prefix() . "categorie_product.fk_product=p.rowid
2798
+			$sql .= ", (SELECT ".$this->db->prefix()."categorie_product.fk_categorie
2799
+						FROM " . $this->db->prefix()."categorie_product
2800
+						WHERE " . $this->db->prefix()."categorie_product.fk_product=p.rowid
2801 2801
 						LIMIT 1
2802 2802
 				) AS categorie_product_id ";
2803 2803
 		}
@@ -2823,15 +2823,15 @@  discard block
 block discarded – undo
2823 2823
 		}
2824 2824
 		// Price by quantity
2825 2825
 		if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) {
2826
-			$sql .= ", (SELECT pp.rowid FROM " . $this->db->prefix() . "product_price as pp WHERE pp.fk_product = p.rowid";
2826
+			$sql .= ", (SELECT pp.rowid FROM ".$this->db->prefix()."product_price as pp WHERE pp.fk_product = p.rowid";
2827 2827
 			if ($price_level >= 1 && getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) {
2828
-				$sql .= " AND price_level = " . ((int) $price_level);
2828
+				$sql .= " AND price_level = ".((int) $price_level);
2829 2829
 			}
2830 2830
 			$sql .= " ORDER BY date_price";
2831 2831
 			$sql .= " DESC LIMIT 1) as price_rowid";
2832
-			$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
2832
+			$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
2833 2833
 			if ($price_level >= 1 && getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) {
2834
-				$sql .= " AND price_level = " . ((int) $price_level);
2834
+				$sql .= " AND price_level = ".((int) $price_level);
2835 2835
 			}
2836 2836
 			$sql .= " ORDER BY date_price";
2837 2837
 			$sql .= " DESC LIMIT 1) as price_by_qty";
@@ -2840,58 +2840,58 @@  discard block
 block discarded – undo
2840 2840
 
2841 2841
 		$sql .= " FROM ".$this->db->prefix()."product as p";
2842 2842
 		// Add from (left join) from hooks
2843
-		$parameters = array();  // @phan-suppress-current-line PhanPluginRedundantAssignment
2843
+		$parameters = array(); // @phan-suppress-current-line PhanPluginRedundantAssignment
2844 2844
 		$reshook = $hookmanager->executeHooks('selectProductsListFrom', $parameters); // Note that $action and $object may have been modified by hook
2845 2845
 		$sql .= $hookmanager->resPrint;
2846 2846
 
2847 2847
 		if (count($warehouseStatusArray)) {
2848
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "product_stock as ps on ps.fk_product = p.rowid";
2849
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "entrepot as e on ps.fk_entrepot = e.rowid AND e.entity IN (" . getEntity('stock') . ")";
2850
-			$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.
2848
+			$sql .= " LEFT JOIN ".$this->db->prefix()."product_stock as ps on ps.fk_product = p.rowid";
2849
+			$sql .= " LEFT JOIN ".$this->db->prefix()."entrepot as e on ps.fk_entrepot = e.rowid AND e.entity IN (".getEntity('stock').")";
2850
+			$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.
2851 2851
 		}
2852 2852
 
2853 2853
 		// include search in supplier ref
2854 2854
 		if (getDolGlobalString('MAIN_SEARCH_PRODUCT_BY_FOURN_REF')) {
2855
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
2855
+			$sql .= " LEFT JOIN ".$this->db->prefix()."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
2856 2856
 		}
2857 2857
 
2858 2858
 		//Price by customer
2859 2859
 		if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES') && !empty($socid)) {
2860
-			$sql .= " LEFT JOIN  " . $this->db->prefix() . "product_customer_price as pcp ON pcp.fk_soc=" . ((int) $socid) . " AND pcp.fk_product=p.rowid";
2860
+			$sql .= " LEFT JOIN  ".$this->db->prefix()."product_customer_price as pcp ON pcp.fk_soc=".((int) $socid)." AND pcp.fk_product=p.rowid";
2861 2861
 		}
2862 2862
 		// Units
2863 2863
 		if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
2864
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "c_units u ON u.rowid = p.fk_unit";
2864
+			$sql .= " LEFT JOIN ".$this->db->prefix()."c_units u ON u.rowid = p.fk_unit";
2865 2865
 		}
2866 2866
 		// Multilang : we add translation
2867 2867
 		if (getDolGlobalInt('MAIN_MULTILANGS')) {
2868
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "product_lang as pl ON pl.fk_product = p.rowid ";
2868
+			$sql .= " LEFT JOIN ".$this->db->prefix()."product_lang as pl ON pl.fk_product = p.rowid ";
2869 2869
 			if (getDolGlobalString('PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE') && !empty($socid)) {
2870
-				require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
2870
+				require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
2871 2871
 				$soc = new Societe($this->db);
2872 2872
 				$result = $soc->fetch($socid);
2873 2873
 				if ($result > 0 && !empty($soc->default_lang)) {
2874
-					$sql .= " AND pl.lang = '" . $this->db->escape($soc->default_lang) . "'";
2874
+					$sql .= " AND pl.lang = '".$this->db->escape($soc->default_lang)."'";
2875 2875
 				} else {
2876
-					$sql .= " AND pl.lang = '" . $this->db->escape($langs->getDefaultLang()) . "'";
2876
+					$sql .= " AND pl.lang = '".$this->db->escape($langs->getDefaultLang())."'";
2877 2877
 				}
2878 2878
 			} else {
2879
-				$sql .= " AND pl.lang = '" . $this->db->escape($langs->getDefaultLang()) . "'";
2879
+				$sql .= " AND pl.lang = '".$this->db->escape($langs->getDefaultLang())."'";
2880 2880
 			}
2881 2881
 		}
2882 2882
 
2883 2883
 		if (getDolGlobalString('PRODUIT_ATTRIBUTES_HIDECHILD')) {
2884
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "product_attribute_combination pac ON pac.fk_product_child = p.rowid";
2884
+			$sql .= " LEFT JOIN ".$this->db->prefix()."product_attribute_combination pac ON pac.fk_product_child = p.rowid";
2885 2885
 		}
2886 2886
 
2887
-		$sql .= ' WHERE p.entity IN (' . getEntity('product') . ')';
2887
+		$sql .= ' WHERE p.entity IN ('.getEntity('product').')';
2888 2888
 
2889 2889
 		if (getDolGlobalString('PRODUIT_ATTRIBUTES_HIDECHILD')) {
2890 2890
 			$sql .= " AND pac.rowid IS NULL";
2891 2891
 		}
2892 2892
 
2893 2893
 		if ($finished == 0) {
2894
-			$sql .= " AND p.finished = " . ((int) $finished);
2894
+			$sql .= " AND p.finished = ".((int) $finished);
2895 2895
 		} elseif ($finished == 1) {
2896 2896
 			$sql .= " AND p.finished = ".((int) $finished);
2897 2897
 		}
@@ -2899,18 +2899,18 @@  discard block
 block discarded – undo
2899 2899
 			$sql .= " AND p.tosell = ".((int) $status);
2900 2900
 		}
2901 2901
 		if ($status_purchase >= 0) {
2902
-			$sql .= " AND p.tobuy = " . ((int) $status_purchase);
2902
+			$sql .= " AND p.tobuy = ".((int) $status_purchase);
2903 2903
 		}
2904 2904
 		// Filter by product type
2905 2905
 		if (strval($filtertype) != '') {
2906
-			$sql .= " AND p.fk_product_type = " . ((int) $filtertype);
2906
+			$sql .= " AND p.fk_product_type = ".((int) $filtertype);
2907 2907
 		} elseif (!isModEnabled('product')) { // when product module is disabled, show services only
2908 2908
 			$sql .= " AND p.fk_product_type = 1";
2909 2909
 		} elseif (!isModEnabled('service')) { // when service module is disabled, show products only
2910 2910
 			$sql .= " AND p.fk_product_type = 0";
2911 2911
 		}
2912 2912
 		// Add where from hooks
2913
-		$parameters = array();  // @phan-suppress-current-line PhanPluginRedundantAssignment
2913
+		$parameters = array(); // @phan-suppress-current-line PhanPluginRedundantAssignment
2914 2914
 		$reshook = $hookmanager->executeHooks('selectProductsListWhere', $parameters); // Note that $action and $object may have been modified by hook
2915 2915
 		$sql .= $hookmanager->resPrint;
2916 2916
 		// Add criteria on ref/label
@@ -2927,21 +2927,21 @@  discard block
 block discarded – undo
2927 2927
 				if ($i > 0) {
2928 2928
 					$sql .= " AND ";
2929 2929
 				}
2930
-				$sql .= "(p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%' OR p.label LIKE '" . $this->db->escape($prefix . $crit) . "%'";
2930
+				$sql .= "(p.ref LIKE '".$this->db->escape($prefix.$crit)."%' OR p.label LIKE '".$this->db->escape($prefix.$crit)."%'";
2931 2931
 				if (getDolGlobalInt('MAIN_MULTILANGS')) {
2932
-					$sql .= " OR pl.label LIKE '" . $this->db->escape($prefix . $crit) . "%'";
2932
+					$sql .= " OR pl.label LIKE '".$this->db->escape($prefix.$crit)."%'";
2933 2933
 				}
2934 2934
 				if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES') && !empty($socid)) {
2935
-					$sql .= " OR pcp.ref_customer LIKE '" . $this->db->escape($prefix . $crit) . "%'";
2935
+					$sql .= " OR pcp.ref_customer LIKE '".$this->db->escape($prefix.$crit)."%'";
2936 2936
 				}
2937 2937
 				if (getDolGlobalString('PRODUCT_AJAX_SEARCH_ON_DESCRIPTION')) {
2938
-					$sql .= " OR p.description LIKE '" . $this->db->escape($prefix . $crit) . "%'";
2938
+					$sql .= " OR p.description LIKE '".$this->db->escape($prefix.$crit)."%'";
2939 2939
 					if (getDolGlobalInt('MAIN_MULTILANGS')) {
2940
-						$sql .= " OR pl.description LIKE '" . $this->db->escape($prefix . $crit) . "%'";
2940
+						$sql .= " OR pl.description LIKE '".$this->db->escape($prefix.$crit)."%'";
2941 2941
 					}
2942 2942
 				}
2943 2943
 				if (getDolGlobalString('MAIN_SEARCH_PRODUCT_BY_FOURN_REF')) {
2944
-					$sql .= " OR pfp.ref_fourn LIKE '" . $this->db->escape($prefix . $crit) . "%'";
2944
+					$sql .= " OR pfp.ref_fourn LIKE '".$this->db->escape($prefix.$crit)."%'";
2945 2945
 				}
2946 2946
 				$sql .= ")";
2947 2947
 				$i++;
@@ -2950,12 +2950,12 @@  discard block
 block discarded – undo
2950 2950
 				$sql .= ")";
2951 2951
 			}
2952 2952
 			if (isModEnabled('barcode')) {
2953
-				$sql .= " OR p.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
2953
+				$sql .= " OR p.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'";
2954 2954
 			}
2955 2955
 			$sql .= ')';
2956 2956
 		}
2957 2957
 		if (count($warehouseStatusArray)) {
2958
-			$sql .= " GROUP BY " . $selectFields;
2958
+			$sql .= " GROUP BY ".$selectFields;
2959 2959
 		}
2960 2960
 
2961 2961
 		//Sort by category
@@ -2970,23 +2970,23 @@  discard block
 block discarded – undo
2970 2970
 		$sql .= $this->db->plimit($limit, 0);
2971 2971
 
2972 2972
 		// Build output string
2973
-		dol_syslog(get_class($this) . "::select_produits_list search products", LOG_DEBUG);
2973
+		dol_syslog(get_class($this)."::select_produits_list search products", LOG_DEBUG);
2974 2974
 		$result = $this->db->query($sql);
2975 2975
 		if ($result) {
2976
-			require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
2977
-			require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
2978
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/product.lib.php';
2976
+			require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
2977
+			require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
2978
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php';
2979 2979
 
2980 2980
 			$num = $this->db->num_rows($result);
2981 2981
 
2982 2982
 			$events = array();
2983 2983
 
2984 2984
 			if (!$forcecombo) {
2985
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
2985
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
2986 2986
 				$out .= ajax_combobox($htmlname, $events, getDolGlobalInt("PRODUIT_USE_SEARCH_TO_SELECT"));
2987 2987
 			}
2988 2988
 
2989
-			$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
2989
+			$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
2990 2990
 
2991 2991
 			$textifempty = '';
2992 2992
 			// Do not use textifempty = ' ' or '&nbsp;' here, or search on key will search on ' key'.
@@ -3003,7 +3003,7 @@  discard block
 block discarded – undo
3003 3003
 				}
3004 3004
 			}
3005 3005
 			if ($showempty) {
3006
-				$out .= '<option value="-1" selected>' . ($textifempty ? $textifempty : '&nbsp;') . '</option>';
3006
+				$out .= '<option value="-1" selected>'.($textifempty ? $textifempty : '&nbsp;').'</option>';
3007 3007
 			}
3008 3008
 
3009 3009
 			$i = 0;
@@ -3014,11 +3014,11 @@  discard block
 block discarded – undo
3014 3014
 
3015 3015
 				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
3016 3016
 					$sql = "SELECT rowid, quantity, price, unitprice, remise_percent, remise, price_base_type";
3017
-					$sql .= " FROM " . $this->db->prefix() . "product_price_by_qty";
3018
-					$sql .= " WHERE fk_product_price = " . ((int) $objp->price_rowid);
3017
+					$sql .= " FROM ".$this->db->prefix()."product_price_by_qty";
3018
+					$sql .= " WHERE fk_product_price = ".((int) $objp->price_rowid);
3019 3019
 					$sql .= " ORDER BY quantity ASC";
3020 3020
 
3021
-					dol_syslog(get_class($this) . "::select_produits_list search prices by qty", LOG_DEBUG);
3021
+					dol_syslog(get_class($this)."::select_produits_list search prices by qty", LOG_DEBUG);
3022 3022
 					$result2 = $this->db->query($sql);
3023 3023
 					if ($result2) {
3024 3024
 						$nb_prices = $this->db->num_rows($result2);
@@ -3056,7 +3056,7 @@  discard block
 block discarded – undo
3056 3056
 						$price_product = new Product($this->db);
3057 3057
 						$price_product->fetch($objp->rowid, '', '', 1);
3058 3058
 
3059
-						require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
3059
+						require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
3060 3060
 						$priceparser = new PriceParser($this->db);
3061 3061
 						$price_result = $priceparser->parseProduct($price_product);
3062 3062
 						if ($price_result >= 0) {
@@ -3140,7 +3140,7 @@  discard block
 block discarded – undo
3140 3140
 			$label = $objp->label_translated;
3141 3141
 		}
3142 3142
 		if (!empty($filterkey) && $filterkey != '') {
3143
-			$label = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $label, 1);
3143
+			$label = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $label, 1);
3144 3144
 		}
3145 3145
 
3146 3146
 		$outkey = $objp->rowid;
@@ -3161,32 +3161,32 @@  discard block
 block discarded – undo
3161 3161
 		$outdurationunit = $outtype == Product::TYPE_SERVICE ? substr($objp->duration, -1) : '';
3162 3162
 
3163 3163
 		if ($outorigin && getDolGlobalString('PRODUCT_SHOW_ORIGIN_IN_COMBO')) {
3164
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
3164
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
3165 3165
 		}
3166 3166
 
3167 3167
 		// Units
3168 3168
 		$outvalUnits = '';
3169 3169
 		if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
3170 3170
 			if (!empty($objp->unit_short)) {
3171
-				$outvalUnits .= ' - ' . $objp->unit_short;
3171
+				$outvalUnits .= ' - '.$objp->unit_short;
3172 3172
 			}
3173 3173
 		}
3174 3174
 		if (getDolGlobalString('PRODUCT_SHOW_DIMENSIONS_IN_COMBO')) {
3175 3175
 			if (!empty($objp->weight) && $objp->weight_units !== null) {
3176 3176
 				$unitToShow = showDimensionInBestUnit($objp->weight, $objp->weight_units, 'weight', $langs);
3177
-				$outvalUnits .= ' - ' . $unitToShow;
3177
+				$outvalUnits .= ' - '.$unitToShow;
3178 3178
 			}
3179 3179
 			if ((!empty($objp->length) || !empty($objp->width) || !empty($objp->height)) && $objp->length_units !== null) {
3180
-				$unitToShow = $objp->length . ' x ' . $objp->width . ' x ' . $objp->height . ' ' . measuringUnitString(0, 'size', $objp->length_units);
3181
-				$outvalUnits .= ' - ' . $unitToShow;
3180
+				$unitToShow = $objp->length.' x '.$objp->width.' x '.$objp->height.' '.measuringUnitString(0, 'size', $objp->length_units);
3181
+				$outvalUnits .= ' - '.$unitToShow;
3182 3182
 			}
3183 3183
 			if (!empty($objp->surface) && $objp->surface_units !== null) {
3184 3184
 				$unitToShow = showDimensionInBestUnit($objp->surface, $objp->surface_units, 'surface', $langs);
3185
-				$outvalUnits .= ' - ' . $unitToShow;
3185
+				$outvalUnits .= ' - '.$unitToShow;
3186 3186
 			}
3187 3187
 			if (!empty($objp->volume) && $objp->volume_units !== null) {
3188 3188
 				$unitToShow = showDimensionInBestUnit($objp->volume, $objp->volume_units, 'volume', $langs);
3189
-				$outvalUnits .= ' - ' . $unitToShow;
3189
+				$outvalUnits .= ' - '.$unitToShow;
3190 3190
 			}
3191 3191
 		}
3192 3192
 		if ($outdurationvalue && $outdurationunit) {
@@ -3198,14 +3198,14 @@  discard block
 block discarded – undo
3198 3198
 				'y' => $langs->trans('Year')
3199 3199
 			);
3200 3200
 			if (isset($da[$outdurationunit])) {
3201
-				$outvalUnits .= ' - ' . $outdurationvalue . ' ' . $langs->transnoentities($da[$outdurationunit] . ($outdurationvalue > 1 ? 's' : ''));
3201
+				$outvalUnits .= ' - '.$outdurationvalue.' '.$langs->transnoentities($da[$outdurationunit].($outdurationvalue > 1 ? 's' : ''));
3202 3202
 			}
3203 3203
 		}
3204 3204
 
3205
-		$opt = '<option value="' . $objp->rowid . '"';
3205
+		$opt = '<option value="'.$objp->rowid.'"';
3206 3206
 		$opt .= ($objp->rowid == $selected) ? ' selected' : '';
3207 3207
 		if (!empty($objp->price_by_qty_rowid) && $objp->price_by_qty_rowid > 0) {
3208
-			$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 . '"';
3208
+			$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.'"';
3209 3209
 		}
3210 3210
 		if (isModEnabled('stock') && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || getDolGlobalString('STOCK_SUPPORTS_SERVICES'))) {
3211 3211
 			if ($user->hasRight('stock', 'lire')) {
@@ -3217,36 +3217,36 @@  discard block
 block discarded – undo
3217 3217
 			}
3218 3218
 		}
3219 3219
 		if (getDolGlobalString('PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE')) {
3220
-			$opt .= ' data-labeltrans="' . $outlabel_translated . '"';
3221
-			$opt .= ' data-desctrans="' . dol_escape_htmltag($outdesc_translated) . '"';
3220
+			$opt .= ' data-labeltrans="'.$outlabel_translated.'"';
3221
+			$opt .= ' data-desctrans="'.dol_escape_htmltag($outdesc_translated).'"';
3222 3222
 		}
3223 3223
 		$opt .= '>';
3224 3224
 		$opt .= $objp->ref;
3225 3225
 		if (!empty($objp->custref)) {
3226
-			$opt .= ' (' . $objp->custref . ')';
3226
+			$opt .= ' ('.$objp->custref.')';
3227 3227
 		}
3228 3228
 		if ($outbarcode) {
3229
-			$opt .= ' (' . $outbarcode . ')';
3229
+			$opt .= ' ('.$outbarcode.')';
3230 3230
 		}
3231
-		$opt .= ' - ' . dol_trunc($label, $maxlengtharticle);
3231
+		$opt .= ' - '.dol_trunc($label, $maxlengtharticle);
3232 3232
 		if ($outorigin && getDolGlobalString('PRODUCT_SHOW_ORIGIN_IN_COMBO')) {
3233
-			$opt .= ' (' . getCountry($outorigin, 1) . ')';
3233
+			$opt .= ' ('.getCountry($outorigin, 1).')';
3234 3234
 		}
3235 3235
 
3236 3236
 		$objRef = $objp->ref;
3237 3237
 		if (!empty($objp->custref)) {
3238
-			$objRef .= ' (' . $objp->custref . ')';
3238
+			$objRef .= ' ('.$objp->custref.')';
3239 3239
 		}
3240 3240
 		if (!empty($filterkey) && $filterkey != '') {
3241
-			$objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1);
3241
+			$objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1);
3242 3242
 		}
3243 3243
 		$outval .= $objRef;
3244 3244
 		if ($outbarcode) {
3245
-			$outval .= ' (' . $outbarcode . ')';
3245
+			$outval .= ' ('.$outbarcode.')';
3246 3246
 		}
3247
-		$outval .= ' - ' . dol_trunc($label, $maxlengtharticle);
3247
+		$outval .= ' - '.dol_trunc($label, $maxlengtharticle);
3248 3248
 		if ($outorigin && getDolGlobalString('PRODUCT_SHOW_ORIGIN_IN_COMBO')) {
3249
-			$outval .= ' (' . getCountry($outorigin, 1) . ')';
3249
+			$outval .= ' ('.getCountry($outorigin, 1).')';
3250 3250
 		}
3251 3251
 
3252 3252
 		// Units
@@ -3259,35 +3259,35 @@  discard block
 block discarded – undo
3259 3259
 		// If we need a particular price level (from 1 to n)
3260 3260
 		if (empty($hidepriceinlabel) && $price_level >= 1 && (getDolGlobalString('PRODUIT_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES'))) {
3261 3261
 			$sql = "SELECT price, price_ttc, price_base_type, tva_tx, default_vat_code";
3262
-			$sql .= " FROM " . $this->db->prefix() . "product_price";
3263
-			$sql .= " WHERE fk_product = " . ((int) $objp->rowid);
3264
-			$sql .= " AND entity IN (" . getEntity('productprice') . ")";
3265
-			$sql .= " AND price_level = " . ((int) $price_level);
3262
+			$sql .= " FROM ".$this->db->prefix()."product_price";
3263
+			$sql .= " WHERE fk_product = ".((int) $objp->rowid);
3264
+			$sql .= " AND entity IN (".getEntity('productprice').")";
3265
+			$sql .= " AND price_level = ".((int) $price_level);
3266 3266
 			$sql .= " ORDER BY date_price DESC, rowid DESC"; // Warning DESC must be both on date_price and rowid.
3267 3267
 			$sql .= " LIMIT 1";
3268 3268
 
3269
-			dol_syslog(get_class($this) . '::constructProductListOption search price for product ' . $objp->rowid . ' AND level ' . $price_level, LOG_DEBUG);
3269
+			dol_syslog(get_class($this).'::constructProductListOption search price for product '.$objp->rowid.' AND level '.$price_level, LOG_DEBUG);
3270 3270
 			$result2 = $this->db->query($sql);
3271 3271
 			if ($result2) {
3272 3272
 				$objp2 = $this->db->fetch_object($result2);
3273 3273
 				if ($objp2) {
3274 3274
 					$found = 1;
3275 3275
 					if ($objp2->price_base_type == 'HT') {
3276
-						$opt .= ' - ' . price($objp2->price, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("HT");
3277
-						$outval .= ' - ' . price($objp2->price, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("HT");
3276
+						$opt .= ' - '.price($objp2->price, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT");
3277
+						$outval .= ' - '.price($objp2->price, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT");
3278 3278
 					} else {
3279
-						$opt .= ' - ' . price($objp2->price_ttc, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("TTC");
3280
-						$outval .= ' - ' . price($objp2->price_ttc, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("TTC");
3279
+						$opt .= ' - '.price($objp2->price_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC");
3280
+						$outval .= ' - '.price($objp2->price_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC");
3281 3281
 					}
3282 3282
 					$outprice_ht = price($objp2->price);
3283 3283
 					$outprice_ttc = price($objp2->price_ttc);
3284 3284
 					$outpricebasetype = $objp2->price_base_type;
3285 3285
 					if (getDolGlobalString('PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL')) {  // using this option is a bug. kept for backward compatibility
3286
-						$outtva_tx = $objp2->tva_tx;                        // We use the vat rate on line of multiprice
3287
-						$outdefault_vat_code = $objp2->default_vat_code;    // We use the vat code on line of multiprice
3286
+						$outtva_tx = $objp2->tva_tx; // We use the vat rate on line of multiprice
3287
+						$outdefault_vat_code = $objp2->default_vat_code; // We use the vat code on line of multiprice
3288 3288
 					} else {
3289
-						$outtva_tx = $objp->tva_tx;                            // We use the vat rate of product, not the one on line of multiprice
3290
-						$outdefault_vat_code = $objp->default_vat_code;        // We use the vat code or product, not the one on line of multiprice
3289
+						$outtva_tx = $objp->tva_tx; // We use the vat rate of product, not the one on line of multiprice
3290
+						$outdefault_vat_code = $objp->default_vat_code; // We use the vat code or product, not the one on line of multiprice
3291 3291
 					}
3292 3292
 				}
3293 3293
 			} else {
@@ -3301,13 +3301,13 @@  discard block
 block discarded – undo
3301 3301
 			$outqty = $objp->quantity;
3302 3302
 			$outdiscount = $objp->remise_percent;
3303 3303
 			if ($objp->quantity == 1) {
3304
-				$opt .= ' - ' . price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency) . "/";
3305
-				$outval .= ' - ' . price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency) . "/";
3304
+				$opt .= ' - '.price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency)."/";
3305
+				$outval .= ' - '.price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency)."/";
3306 3306
 				$opt .= $langs->trans("Unit"); // Do not use strtolower because it breaks utf8 encoding
3307 3307
 				$outval .= $langs->transnoentities("Unit");
3308 3308
 			} else {
3309
-				$opt .= ' - ' . price($objp->price, 1, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity;
3310
-				$outval .= ' - ' . price($objp->price, 0, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity;
3309
+				$opt .= ' - '.price($objp->price, 1, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity;
3310
+				$outval .= ' - '.price($objp->price, 0, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity;
3311 3311
 				$opt .= $langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding
3312 3312
 				$outval .= $langs->transnoentities("Units");
3313 3313
 			}
@@ -3315,16 +3315,16 @@  discard block
 block discarded – undo
3315 3315
 			$outprice_ht = price($objp->unitprice);
3316 3316
 			$outprice_ttc = price($objp->unitprice * (1 + ($objp->tva_tx / 100)));
3317 3317
 			$outpricebasetype = $objp->price_base_type;
3318
-			$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
3319
-			$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
3318
+			$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
3319
+			$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
3320 3320
 		}
3321 3321
 		if (empty($hidepriceinlabel) && !empty($objp->quantity) && $objp->quantity >= 1) {
3322
-			$opt .= " (" . price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->trans("Unit") . ")"; // Do not use strtolower because it breaks utf8 encoding
3323
-			$outval .= " (" . price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->transnoentities("Unit") . ")"; // Do not use strtolower because it breaks utf8 encoding
3322
+			$opt .= " (".price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency)."/".$langs->trans("Unit").")"; // Do not use strtolower because it breaks utf8 encoding
3323
+			$outval .= " (".price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency)."/".$langs->transnoentities("Unit").")"; // Do not use strtolower because it breaks utf8 encoding
3324 3324
 		}
3325 3325
 		if (empty($hidepriceinlabel) && !empty($objp->remise_percent) && $objp->remise_percent >= 1) {
3326
-			$opt .= " - " . $langs->trans("Discount") . " : " . vatrate($objp->remise_percent) . ' %';
3327
-			$outval .= " - " . $langs->transnoentities("Discount") . " : " . vatrate($objp->remise_percent) . ' %';
3326
+			$opt .= " - ".$langs->trans("Discount")." : ".vatrate($objp->remise_percent).' %';
3327
+			$outval .= " - ".$langs->transnoentities("Discount")." : ".vatrate($objp->remise_percent).' %';
3328 3328
 		}
3329 3329
 
3330 3330
 		// Price by customer
@@ -3333,11 +3333,11 @@  discard block
 block discarded – undo
3333 3333
 				$found = 1;
3334 3334
 
3335 3335
 				if ($objp->custprice_base_type == 'HT') {
3336
-					$opt .= ' - ' . price($objp->custprice, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("HT");
3337
-					$outval .= ' - ' . price($objp->custprice, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("HT");
3336
+					$opt .= ' - '.price($objp->custprice, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT");
3337
+					$outval .= ' - '.price($objp->custprice, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT");
3338 3338
 				} else {
3339
-					$opt .= ' - ' . price($objp->custprice_ttc, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("TTC");
3340
-					$outval .= ' - ' . price($objp->custprice_ttc, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("TTC");
3339
+					$opt .= ' - '.price($objp->custprice_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC");
3340
+					$outval .= ' - '.price($objp->custprice_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC");
3341 3341
 				}
3342 3342
 
3343 3343
 				$outprice_ht = price($objp->custprice);
@@ -3351,11 +3351,11 @@  discard block
 block discarded – undo
3351 3351
 		// If level no defined or multiprice not found, we used the default price
3352 3352
 		if (empty($hidepriceinlabel) && !$found) {
3353 3353
 			if ($objp->price_base_type == 'HT') {
3354
-				$opt .= ' - ' . price($objp->price, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("HT");
3355
-				$outval .= ' - ' . price($objp->price, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("HT");
3354
+				$opt .= ' - '.price($objp->price, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT");
3355
+				$outval .= ' - '.price($objp->price, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT");
3356 3356
 			} else {
3357
-				$opt .= ' - ' . price($objp->price_ttc, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("TTC");
3358
-				$outval .= ' - ' . price($objp->price_ttc, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("TTC");
3357
+				$opt .= ' - '.price($objp->price_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC");
3358
+				$outval .= ' - '.price($objp->price_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC");
3359 3359
 			}
3360 3360
 			$outprice_ht = price($objp->price);
3361 3361
 			$outprice_ttc = price($objp->price_ttc);
@@ -3366,14 +3366,14 @@  discard block
 block discarded – undo
3366 3366
 
3367 3367
 		if (isModEnabled('stock') && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || getDolGlobalString('STOCK_SUPPORTS_SERVICES'))) {
3368 3368
 			if ($user->hasRight('stock', 'lire')) {
3369
-				$opt .= ' - ' . $langs->trans("Stock") . ': ' . price(price2num($objp->stock, 'MS'));
3369
+				$opt .= ' - '.$langs->trans("Stock").': '.price(price2num($objp->stock, 'MS'));
3370 3370
 
3371 3371
 				if ($objp->stock > 0) {
3372 3372
 					$outval .= ' - <span class="product_line_stock_ok">';
3373 3373
 				} elseif ($objp->stock <= 0) {
3374 3374
 					$outval .= ' - <span class="product_line_stock_too_low">';
3375 3375
 				}
3376
-				$outval .= $langs->transnoentities("Stock") . ': ' . price(price2num($objp->stock, 'MS'));
3376
+				$outval .= $langs->transnoentities("Stock").': '.price(price2num($objp->stock, 'MS'));
3377 3377
 				$outval .= '</span>';
3378 3378
 				if (empty($novirtualstock) && getDolGlobalString('STOCK_SHOW_VIRTUAL_STOCK_IN_PRODUCTS_COMBO')) {  // Warning, this option may slow down combo list generation
3379 3379
 					$langs->load("stocks");
@@ -3383,9 +3383,9 @@  discard block
 block discarded – undo
3383 3383
 					$tmpproduct->load_virtual_stock();
3384 3384
 					$virtualstock = $tmpproduct->stock_theorique;
3385 3385
 
3386
-					$opt .= ' - ' . $langs->trans("VirtualStock") . ':' . $virtualstock;
3386
+					$opt .= ' - '.$langs->trans("VirtualStock").':'.$virtualstock;
3387 3387
 
3388
-					$outval .= ' - ' . $langs->transnoentities("VirtualStock") . ':';
3388
+					$outval .= ' - '.$langs->transnoentities("VirtualStock").':';
3389 3389
 					if ($virtualstock > 0) {
3390 3390
 						$outval .= '<span class="product_line_stock_ok">';
3391 3391
 					} elseif ($virtualstock <= 0) {
@@ -3463,7 +3463,7 @@  discard block
 block discarded – undo
3463 3463
 		$selected_input_value = '';
3464 3464
 		if (!empty($conf->use_javascript_ajax) && getDolGlobalString('PRODUIT_USE_SEARCH_TO_SELECT')) {
3465 3465
 			if ($selected > 0) {
3466
-				require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
3466
+				require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
3467 3467
 				$producttmpselect = new Product($this->db);
3468 3468
 				$producttmpselect->fetch($selected);
3469 3469
 				$selected_input_value = $producttmpselect->ref;
@@ -3471,10 +3471,10 @@  discard block
 block discarded – undo
3471 3471
 			}
3472 3472
 
3473 3473
 			// mode=2 means suppliers products
3474
-			$urloption = ($socid > 0 ? 'socid=' . $socid . '&' : '') . 'htmlname=' . $htmlname . '&outjson=1&price_level=' . $price_level . '&type=' . $filtertype . '&mode=2&status=' . $status . '&finished=' . $finished . '&alsoproductwithnosupplierprice=' . $alsoproductwithnosupplierprice;
3475
-			print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 0, $ajaxoptions);
3474
+			$urloption = ($socid > 0 ? 'socid='.$socid.'&' : '').'htmlname='.$htmlname.'&outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=2&status='.$status.'&finished='.$finished.'&alsoproductwithnosupplierprice='.$alsoproductwithnosupplierprice;
3475
+			print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 0, $ajaxoptions);
3476 3476
 
3477
-			print($hidelabel ? '' : $langs->trans("RefOrLabel") . ' : ') . '<input type="text" class="minwidth300" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . ($placeholder ? ' placeholder="' . $placeholder . '"' : '') . '>';
3477
+			print($hidelabel ? '' : $langs->trans("RefOrLabel").' : ').'<input type="text" class="minwidth300" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.($placeholder ? ' placeholder="'.$placeholder.'"' : '').'>';
3478 3478
 		} else {
3479 3479
 			print $this->select_produits_fournisseurs_list($socid, $selected, $htmlname, $filtertype, $filtre, '', $status, 0, 0, $alsoproductwithnosupplierprice, $morecss, 0, $placeholder);
3480 3480
 		}
@@ -3534,25 +3534,25 @@  discard block
 block discarded – undo
3534 3534
 		if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
3535 3535
 			$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";
3536 3536
 		}
3537
-		$sql .= " FROM " . $this->db->prefix() . "product as p";
3538
-		$sql .= " LEFT JOIN " . $this->db->prefix() . "product_fournisseur_price as pfp ON ( p.rowid = pfp.fk_product AND pfp.entity IN (" . getEntity('product') . ") )";
3537
+		$sql .= " FROM ".$this->db->prefix()."product as p";
3538
+		$sql .= " LEFT JOIN ".$this->db->prefix()."product_fournisseur_price as pfp ON ( p.rowid = pfp.fk_product AND pfp.entity IN (".getEntity('product').") )";
3539 3539
 		if ($socid > 0) {
3540
-			$sql .= " AND pfp.fk_soc = " . ((int) $socid);
3540
+			$sql .= " AND pfp.fk_soc = ".((int) $socid);
3541 3541
 		}
3542
-		$sql .= " LEFT JOIN " . $this->db->prefix() . "societe as s ON pfp.fk_soc = s.rowid";
3542
+		$sql .= " LEFT JOIN ".$this->db->prefix()."societe as s ON pfp.fk_soc = s.rowid";
3543 3543
 		// Units
3544 3544
 		if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
3545
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "c_units u ON u.rowid = p.fk_unit";
3545
+			$sql .= " LEFT JOIN ".$this->db->prefix()."c_units u ON u.rowid = p.fk_unit";
3546 3546
 		}
3547
-		$sql .= " WHERE p.entity IN (" . getEntity('product') . ")";
3547
+		$sql .= " WHERE p.entity IN (".getEntity('product').")";
3548 3548
 		if ($statut != -1) {
3549
-			$sql .= " AND p.tobuy = " . ((int) $statut);
3549
+			$sql .= " AND p.tobuy = ".((int) $statut);
3550 3550
 		}
3551 3551
 		if (strval($filtertype) != '') {
3552
-			$sql .= " AND p.fk_product_type = " . ((int) $filtertype);
3552
+			$sql .= " AND p.fk_product_type = ".((int) $filtertype);
3553 3553
 		}
3554 3554
 		if (!empty($filtre)) {
3555
-			$sql .= " " . $filtre;
3555
+			$sql .= " ".$filtre;
3556 3556
 		}
3557 3557
 		// Add where from hooks
3558 3558
 		$parameters = array();
@@ -3572,9 +3572,9 @@  discard block
 block discarded – undo
3572 3572
 				if ($i > 0) {
3573 3573
 					$sql .= " AND ";
3574 3574
 				}
3575
-				$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) . "%'";
3575
+				$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)."%'";
3576 3576
 				if (getDolGlobalString('PRODUIT_FOURN_TEXTS')) {
3577
-					$sql .= " OR pfp.desc_fourn LIKE '" . $this->db->escape($prefix . $crit) . "%'";
3577
+					$sql .= " OR pfp.desc_fourn LIKE '".$this->db->escape($prefix.$crit)."%'";
3578 3578
 				}
3579 3579
 				$sql .= ")";
3580 3580
 				$i++;
@@ -3583,8 +3583,8 @@  discard block
 block discarded – undo
3583 3583
 				$sql .= ")";
3584 3584
 			}
3585 3585
 			if (isModEnabled('barcode')) {
3586
-				$sql .= " OR p.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
3587
-				$sql .= " OR pfp.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
3586
+				$sql .= " OR p.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'";
3587
+				$sql .= " OR pfp.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'";
3588 3588
 			}
3589 3589
 			$sql .= ')';
3590 3590
 		}
@@ -3593,20 +3593,20 @@  discard block
 block discarded – undo
3593 3593
 
3594 3594
 		// Build output string
3595 3595
 
3596
-		dol_syslog(get_class($this) . "::select_produits_fournisseurs_list", LOG_DEBUG);
3596
+		dol_syslog(get_class($this)."::select_produits_fournisseurs_list", LOG_DEBUG);
3597 3597
 		$result = $this->db->query($sql);
3598 3598
 		if ($result) {
3599
-			require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
3600
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/product.lib.php';
3599
+			require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
3600
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php';
3601 3601
 
3602 3602
 			$num = $this->db->num_rows($result);
3603 3603
 
3604 3604
 			//$out.='<select class="flat" id="select'.$htmlname.'" name="'.$htmlname.'">';	// remove select to have id same with combo and ajax
3605
-			$out .= '<select class="flat ' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . '">';
3605
+			$out .= '<select class="flat '.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.'">';
3606 3606
 			if (!$selected) {
3607
-				$out .= '<option value="-1" selected>' . ($placeholder ? $placeholder : '&nbsp;') . '</option>';
3607
+				$out .= '<option value="-1" selected>'.($placeholder ? $placeholder : '&nbsp;').'</option>';
3608 3608
 			} else {
3609
-				$out .= '<option value="-1">' . ($placeholder ? $placeholder : '&nbsp;') . '</option>';
3609
+				$out .= '<option value="-1">'.($placeholder ? $placeholder : '&nbsp;').'</option>';
3610 3610
 			}
3611 3611
 
3612 3612
 			$i = 0;
@@ -3621,7 +3621,7 @@  discard block
 block discarded – undo
3621 3621
 
3622 3622
 				$outkey = $objp->idprodfournprice; // id in table of price
3623 3623
 				if (!$outkey && $alsoproductwithnosupplierprice) {
3624
-					$outkey = 'idprod_' . $objp->rowid; // id of product
3624
+					$outkey = 'idprod_'.$objp->rowid; // id of product
3625 3625
 				}
3626 3626
 
3627 3627
 				$outref = $objp->ref;
@@ -3636,23 +3636,23 @@  discard block
 block discarded – undo
3636 3636
 				$outvalUnits = '';
3637 3637
 				if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
3638 3638
 					if (!empty($objp->unit_short)) {
3639
-						$outvalUnits .= ' - ' . $objp->unit_short;
3639
+						$outvalUnits .= ' - '.$objp->unit_short;
3640 3640
 					}
3641 3641
 					if (!empty($objp->weight) && $objp->weight_units !== null) {
3642 3642
 						$unitToShow = showDimensionInBestUnit($objp->weight, $objp->weight_units, 'weight', $langs);
3643
-						$outvalUnits .= ' - ' . $unitToShow;
3643
+						$outvalUnits .= ' - '.$unitToShow;
3644 3644
 					}
3645 3645
 					if ((!empty($objp->length) || !empty($objp->width) || !empty($objp->height)) && $objp->length_units !== null) {
3646
-						$unitToShow = $objp->length . ' x ' . $objp->width . ' x ' . $objp->height . ' ' . measuringUnitString(0, 'size', $objp->length_units);
3647
-						$outvalUnits .= ' - ' . $unitToShow;
3646
+						$unitToShow = $objp->length.' x '.$objp->width.' x '.$objp->height.' '.measuringUnitString(0, 'size', $objp->length_units);
3647
+						$outvalUnits .= ' - '.$unitToShow;
3648 3648
 					}
3649 3649
 					if (!empty($objp->surface) && $objp->surface_units !== null) {
3650 3650
 						$unitToShow = showDimensionInBestUnit($objp->surface, $objp->surface_units, 'surface', $langs);
3651
-						$outvalUnits .= ' - ' . $unitToShow;
3651
+						$outvalUnits .= ' - '.$unitToShow;
3652 3652
 					}
3653 3653
 					if (!empty($objp->volume) && $objp->volume_units !== null) {
3654 3654
 						$unitToShow = showDimensionInBestUnit($objp->volume, $objp->volume_units, 'volume', $langs);
3655
-						$outvalUnits .= ' - ' . $unitToShow;
3655
+						$outvalUnits .= ' - '.$unitToShow;
3656 3656
 					}
3657 3657
 					if ($outdurationvalue && $outdurationunit) {
3658 3658
 						$da = array(
@@ -3663,22 +3663,22 @@  discard block
 block discarded – undo
3663 3663
 							'y' => $langs->trans('Year')
3664 3664
 						);
3665 3665
 						if (isset($da[$outdurationunit])) {
3666
-							$outvalUnits .= ' - ' . $outdurationvalue . ' ' . $langs->transnoentities($da[$outdurationunit] . ($outdurationvalue > 1 ? 's' : ''));
3666
+							$outvalUnits .= ' - '.$outdurationvalue.' '.$langs->transnoentities($da[$outdurationunit].($outdurationvalue > 1 ? 's' : ''));
3667 3667
 						}
3668 3668
 					}
3669 3669
 				}
3670 3670
 
3671 3671
 				$objRef = $objp->ref;
3672 3672
 				if ($filterkey && $filterkey != '') {
3673
-					$objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1);
3673
+					$objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1);
3674 3674
 				}
3675 3675
 				$objRefFourn = $objp->ref_fourn;
3676 3676
 				if ($filterkey && $filterkey != '') {
3677
-					$objRefFourn = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRefFourn, 1);
3677
+					$objRefFourn = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRefFourn, 1);
3678 3678
 				}
3679 3679
 				$label = $objp->label;
3680 3680
 				if ($filterkey && $filterkey != '') {
3681
-					$label = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $label, 1);
3681
+					$label = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $label, 1);
3682 3682
 				}
3683 3683
 
3684 3684
 				switch ($objp->fk_product_type) {
@@ -3701,21 +3701,21 @@  discard block
 block discarded – undo
3701 3701
 
3702 3702
 				$optlabel .= $objp->ref;
3703 3703
 				if (!empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) {
3704
-					$optlabel .= ' <span class="opacitymedium">(' . $objp->ref_fourn . ')</span>';
3704
+					$optlabel .= ' <span class="opacitymedium">('.$objp->ref_fourn.')</span>';
3705 3705
 				}
3706 3706
 				if (isModEnabled('barcode') && !empty($objp->barcode)) {
3707
-					$optlabel .= ' (' . $outbarcode . ')';
3707
+					$optlabel .= ' ('.$outbarcode.')';
3708 3708
 				}
3709
-				$optlabel .= ' - ' . dol_trunc($label, $maxlengtharticle);
3709
+				$optlabel .= ' - '.dol_trunc($label, $maxlengtharticle);
3710 3710
 
3711 3711
 				$outvallabel = $objRef;
3712 3712
 				if (!empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) {
3713
-					$outvallabel .= ' (' . $objRefFourn . ')';
3713
+					$outvallabel .= ' ('.$objRefFourn.')';
3714 3714
 				}
3715 3715
 				if (isModEnabled('barcode') && !empty($objp->barcode)) {
3716
-					$outvallabel .= ' (' . $outbarcode . ')';
3716
+					$outvallabel .= ' ('.$outbarcode.')';
3717 3717
 				}
3718
-				$outvallabel .= ' - ' . dol_trunc($label, $maxlengtharticle);
3718
+				$outvallabel .= ' - '.dol_trunc($label, $maxlengtharticle);
3719 3719
 
3720 3720
 				// Units
3721 3721
 				$optlabel .= $outvalUnits;
@@ -3732,7 +3732,7 @@  discard block
 block discarded – undo
3732 3732
 						$prod_supplier->fourn_tva_tx = $objp->tva_tx;
3733 3733
 						$prod_supplier->fk_supplier_price_expression = $objp->fk_supplier_price_expression;
3734 3734
 
3735
-						require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
3735
+						require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
3736 3736
 						$priceparser = new PriceParser($this->db);
3737 3737
 						$price_result = $priceparser->parseProductSupplier($prod_supplier);
3738 3738
 						if ($price_result >= 0) {
@@ -3743,57 +3743,57 @@  discard block
 block discarded – undo
3743 3743
 						}
3744 3744
 					}
3745 3745
 					if ($objp->quantity == 1) {
3746
-						$optlabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/";
3747
-						$outvallabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency) . "/";
3746
+						$optlabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/";
3747
+						$outvallabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency)."/";
3748 3748
 						$optlabel .= $langs->trans("Unit"); // Do not use strtolower because it breaks utf8 encoding
3749 3749
 						$outvallabel .= $langs->transnoentities("Unit");
3750 3750
 					} else {
3751
-						$optlabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity;
3752
-						$outvallabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity;
3753
-						$optlabel .= ' ' . $langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding
3754
-						$outvallabel .= ' ' . $langs->transnoentities("Units");
3751
+						$optlabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity;
3752
+						$outvallabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity;
3753
+						$optlabel .= ' '.$langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding
3754
+						$outvallabel .= ' '.$langs->transnoentities("Units");
3755 3755
 					}
3756 3756
 
3757 3757
 					if ($objp->quantity > 1) {
3758
-						$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
3759
-						$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
3758
+						$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
3759
+						$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
3760 3760
 					}
3761 3761
 					if ($objp->remise_percent >= 1) {
3762
-						$optlabel .= " - " . $langs->trans("Discount") . " : " . vatrate($objp->remise_percent) . ' %';
3763
-						$outvallabel .= " - " . $langs->transnoentities("Discount") . " : " . vatrate($objp->remise_percent) . ' %';
3762
+						$optlabel .= " - ".$langs->trans("Discount")." : ".vatrate($objp->remise_percent).' %';
3763
+						$outvallabel .= " - ".$langs->transnoentities("Discount")." : ".vatrate($objp->remise_percent).' %';
3764 3764
 					}
3765 3765
 					if ($objp->duration) {
3766
-						$optlabel .= " - " . $objp->duration;
3767
-						$outvallabel .= " - " . $objp->duration;
3766
+						$optlabel .= " - ".$objp->duration;
3767
+						$outvallabel .= " - ".$objp->duration;
3768 3768
 					}
3769 3769
 					if (!$socid) {
3770
-						$optlabel .= " - " . dol_trunc($objp->name, 8);
3771
-						$outvallabel .= " - " . dol_trunc($objp->name, 8);
3770
+						$optlabel .= " - ".dol_trunc($objp->name, 8);
3771
+						$outvallabel .= " - ".dol_trunc($objp->name, 8);
3772 3772
 					}
3773 3773
 					if ($objp->supplier_reputation) {
3774 3774
 						//TODO dictionary
3775 3775
 						$reputations = array('' => $langs->trans('Standard'), 'FAVORITE' => $langs->trans('Favorite'), 'NOTTHGOOD' => $langs->trans('NotTheGoodQualitySupplier'), 'DONOTORDER' => $langs->trans('DoNotOrderThisProductToThisSupplier'));
3776 3776
 
3777
-						$optlabel .= " - " . $reputations[$objp->supplier_reputation];
3778
-						$outvallabel .= " - " . $reputations[$objp->supplier_reputation];
3777
+						$optlabel .= " - ".$reputations[$objp->supplier_reputation];
3778
+						$outvallabel .= " - ".$reputations[$objp->supplier_reputation];
3779 3779
 					}
3780 3780
 				} else {
3781
-					$optlabel .= " - <span class='opacitymedium'>" . $langs->trans("NoPriceDefinedForThisSupplier") . '</span>';
3782
-					$outvallabel .= ' - ' . $langs->transnoentities("NoPriceDefinedForThisSupplier");
3781
+					$optlabel .= " - <span class='opacitymedium'>".$langs->trans("NoPriceDefinedForThisSupplier").'</span>';
3782
+					$outvallabel .= ' - '.$langs->transnoentities("NoPriceDefinedForThisSupplier");
3783 3783
 				}
3784 3784
 
3785 3785
 				if (isModEnabled('stock') && $showstockinlist && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || getDolGlobalString('STOCK_SUPPORTS_SERVICES'))) {
3786 3786
 					$novirtualstock = ($showstockinlist == 2);
3787 3787
 
3788 3788
 					if ($user->hasRight('stock', 'lire')) {
3789
-						$outvallabel .= ' - ' . $langs->trans("Stock") . ': ' . price(price2num($objp->stock, 'MS'));
3789
+						$outvallabel .= ' - '.$langs->trans("Stock").': '.price(price2num($objp->stock, 'MS'));
3790 3790
 
3791 3791
 						if ($objp->stock > 0) {
3792 3792
 							$optlabel .= ' - <span class="product_line_stock_ok">';
3793 3793
 						} elseif ($objp->stock <= 0) {
3794 3794
 							$optlabel .= ' - <span class="product_line_stock_too_low">';
3795 3795
 						}
3796
-						$optlabel .= $langs->transnoentities("Stock") . ':' . price(price2num($objp->stock, 'MS'));
3796
+						$optlabel .= $langs->transnoentities("Stock").':'.price(price2num($objp->stock, 'MS'));
3797 3797
 						$optlabel .= '</span>';
3798 3798
 						if (empty($novirtualstock) && getDolGlobalString('STOCK_SHOW_VIRTUAL_STOCK_IN_PRODUCTS_COMBO')) {  // Warning, this option may slow down combo list generation
3799 3799
 							$langs->load("stocks");
@@ -3803,9 +3803,9 @@  discard block
 block discarded – undo
3803 3803
 							$tmpproduct->load_virtual_stock();
3804 3804
 							$virtualstock = $tmpproduct->stock_theorique;
3805 3805
 
3806
-							$outvallabel .= ' - ' . $langs->trans("VirtualStock") . ':' . $virtualstock;
3806
+							$outvallabel .= ' - '.$langs->trans("VirtualStock").':'.$virtualstock;
3807 3807
 
3808
-							$optlabel .= ' - ' . $langs->transnoentities("VirtualStock") . ':';
3808
+							$optlabel .= ' - '.$langs->transnoentities("VirtualStock").':';
3809 3809
 							if ($virtualstock > 0) {
3810 3810
 								$optlabel .= '<span class="product_line_stock_ok">';
3811 3811
 							} elseif ($virtualstock <= 0) {
@@ -3819,7 +3819,7 @@  discard block
 block discarded – undo
3819 3819
 					}
3820 3820
 				}
3821 3821
 
3822
-				$optstart = '<option value="' . $outkey . '"';
3822
+				$optstart = '<option value="'.$outkey.'"';
3823 3823
 				if ($selected && $selected == $objp->idprodfournprice) {
3824 3824
 					$optstart .= ' selected';
3825 3825
 				}
@@ -3828,31 +3828,31 @@  discard block
 block discarded – undo
3828 3828
 				}
3829 3829
 
3830 3830
 				if (!empty($objp->idprodfournprice) && $objp->idprodfournprice > 0) {
3831
-					$optstart .= ' data-product-id="' . dol_escape_htmltag($objp->rowid) . '"';
3832
-					$optstart .= ' data-price-id="' . dol_escape_htmltag($objp->idprodfournprice) . '"';
3833
-					$optstart .= ' data-qty="' . dol_escape_htmltag($objp->quantity) . '"';
3834
-					$optstart .= ' data-up="' . dol_escape_htmltag(price2num($objp->unitprice)) . '"';
3835
-					$optstart .= ' data-up-locale="' . dol_escape_htmltag(price($objp->unitprice)) . '"';
3836
-					$optstart .= ' data-discount="' . dol_escape_htmltag($outdiscount) . '"';
3837
-					$optstart .= ' data-tvatx="' . dol_escape_htmltag(price2num($objp->tva_tx)) . '"';
3838
-					$optstart .= ' data-tvatx-formated="' . dol_escape_htmltag(price($objp->tva_tx, 0, $langs, 1, -1, 2)) . '"';
3839
-					$optstart .= ' data-default-vat-code="' . dol_escape_htmltag($objp->default_vat_code) . '"';
3840
-					$optstart .= ' data-supplier-ref="' . dol_escape_htmltag($objp->ref_fourn) . '"';
3831
+					$optstart .= ' data-product-id="'.dol_escape_htmltag($objp->rowid).'"';
3832
+					$optstart .= ' data-price-id="'.dol_escape_htmltag($objp->idprodfournprice).'"';
3833
+					$optstart .= ' data-qty="'.dol_escape_htmltag($objp->quantity).'"';
3834
+					$optstart .= ' data-up="'.dol_escape_htmltag(price2num($objp->unitprice)).'"';
3835
+					$optstart .= ' data-up-locale="'.dol_escape_htmltag(price($objp->unitprice)).'"';
3836
+					$optstart .= ' data-discount="'.dol_escape_htmltag($outdiscount).'"';
3837
+					$optstart .= ' data-tvatx="'.dol_escape_htmltag(price2num($objp->tva_tx)).'"';
3838
+					$optstart .= ' data-tvatx-formated="'.dol_escape_htmltag(price($objp->tva_tx, 0, $langs, 1, -1, 2)).'"';
3839
+					$optstart .= ' data-default-vat-code="'.dol_escape_htmltag($objp->default_vat_code).'"';
3840
+					$optstart .= ' data-supplier-ref="'.dol_escape_htmltag($objp->ref_fourn).'"';
3841 3841
 					if (isModEnabled('multicurrency')) {
3842
-						$optstart .= ' data-multicurrency-code="' . dol_escape_htmltag($objp->multicurrency_code) . '"';
3843
-						$optstart .= ' data-multicurrency-up="' . dol_escape_htmltag($objp->multicurrency_unitprice) . '"';
3842
+						$optstart .= ' data-multicurrency-code="'.dol_escape_htmltag($objp->multicurrency_code).'"';
3843
+						$optstart .= ' data-multicurrency-up="'.dol_escape_htmltag($objp->multicurrency_unitprice).'"';
3844 3844
 					}
3845 3845
 				}
3846
-				$optstart .= ' data-description="' . dol_escape_htmltag($objp->description, 0, 1) . '"';
3846
+				$optstart .= ' data-description="'.dol_escape_htmltag($objp->description, 0, 1).'"';
3847 3847
 
3848 3848
 				$outarrayentry = array(
3849 3849
 					'key' => $outkey,
3850 3850
 					'value' => $outref,
3851 3851
 					'label' => $outvallabel,
3852 3852
 					'qty' => $outqty,
3853
-					'price_qty_ht' => price2num($objp->fprice, 'MU'),    // Keep higher resolution for price for the min qty
3854
-					'price_unit_ht' => price2num($objp->unitprice, 'MU'),    // This is used to fill the Unit Price
3855
-					'price_ht' => price2num($objp->unitprice, 'MU'),        // This is used to fill the Unit Price (for compatibility)
3853
+					'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty
3854
+					'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price
3855
+					'price_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility)
3856 3856
 					'tva_tx_formated' => price($objp->tva_tx, 0, $langs, 1, -1, 2),
3857 3857
 					'tva_tx' => price2num($objp->tva_tx),
3858 3858
 					'default_vat_code' => $objp->default_vat_code,
@@ -3881,17 +3881,17 @@  discard block
 block discarded – undo
3881 3881
 				// Add new entry
3882 3882
 				// "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
3883 3883
 				// "label" value of json key array is used by jQuery automatically as text for combo box
3884
-				$out .= $optstart . ' data-html="' . dol_escape_htmltag($optlabel) . '">' . $optlabel . "</option>\n";
3884
+				$out .= $optstart.' data-html="'.dol_escape_htmltag($optlabel).'">'.$optlabel."</option>\n";
3885 3885
 				$outarraypush = array(
3886 3886
 					'key' => $outkey,
3887 3887
 					'value' => $outref,
3888 3888
 					'label' => $outvallabel,
3889 3889
 					'qty' => $outqty,
3890
-					'price_qty_ht' => price2num($objp->fprice, 'MU'),        // Keep higher resolution for price for the min qty
3890
+					'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty
3891 3891
 					'price_qty_ht_locale' => price($objp->fprice),
3892
-					'price_unit_ht' => price2num($objp->unitprice, 'MU'),    // This is used to fill the Unit Price
3892
+					'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price
3893 3893
 					'price_unit_ht_locale' => price($objp->unitprice),
3894
-					'price_ht' => price2num($objp->unitprice, 'MU'),        // This is used to fill the Unit Price (for compatibility)
3894
+					'price_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility)
3895 3895
 					'tva_tx_formated' => price($objp->tva_tx),
3896 3896
 					'tva_tx' => price2num($objp->tva_tx),
3897 3897
 					'default_vat_code' => $objp->default_vat_code,
@@ -3923,7 +3923,7 @@  discard block
 block discarded – undo
3923 3923
 
3924 3924
 			$this->db->free($result);
3925 3925
 
3926
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
3926
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
3927 3927
 			$out .= ajax_combobox($htmlname);
3928 3928
 		} else {
3929 3929
 			dol_print_error($this->db);
@@ -3955,43 +3955,43 @@  discard block
 block discarded – undo
3955 3955
 		$sql = "SELECT p.rowid, p.ref, p.label, p.price, p.duration, pfp.fk_soc,";
3956 3956
 		$sql .= " pfp.ref_fourn, pfp.rowid as idprodfournprice, pfp.price as fprice, pfp.remise_percent, pfp.quantity, pfp.unitprice,";
3957 3957
 		$sql .= " pfp.fk_supplier_price_expression, pfp.fk_product, pfp.tva_tx, s.nom as name";
3958
-		$sql .= " FROM " . $this->db->prefix() . "product as p";
3959
-		$sql .= " LEFT JOIN " . $this->db->prefix() . "product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
3960
-		$sql .= " LEFT JOIN " . $this->db->prefix() . "societe as s ON pfp.fk_soc = s.rowid";
3961
-		$sql .= " WHERE pfp.entity IN (" . getEntity('productsupplierprice') . ")";
3958
+		$sql .= " FROM ".$this->db->prefix()."product as p";
3959
+		$sql .= " LEFT JOIN ".$this->db->prefix()."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
3960
+		$sql .= " LEFT JOIN ".$this->db->prefix()."societe as s ON pfp.fk_soc = s.rowid";
3961
+		$sql .= " WHERE pfp.entity IN (".getEntity('productsupplierprice').")";
3962 3962
 		$sql .= " AND p.tobuy = 1";
3963 3963
 		$sql .= " AND s.fournisseur = 1";
3964
-		$sql .= " AND p.rowid = " . ((int) $productid);
3964
+		$sql .= " AND p.rowid = ".((int) $productid);
3965 3965
 		if (!getDolGlobalString('PRODUCT_BEST_SUPPLIER_PRICE_PRESELECTED')) {
3966 3966
 			$sql .= " ORDER BY s.nom, pfp.ref_fourn DESC";
3967 3967
 		} else {
3968 3968
 			$sql .= " ORDER BY pfp.unitprice ASC";
3969 3969
 		}
3970 3970
 
3971
-		dol_syslog(get_class($this) . "::select_product_fourn_price", LOG_DEBUG);
3971
+		dol_syslog(get_class($this)."::select_product_fourn_price", LOG_DEBUG);
3972 3972
 		$result = $this->db->query($sql);
3973 3973
 
3974 3974
 		if ($result) {
3975 3975
 			$num = $this->db->num_rows($result);
3976 3976
 
3977
-			$form = '<select class="flat" id="select_' . $htmlname . '" name="' . $htmlname . '">';
3977
+			$form = '<select class="flat" id="select_'.$htmlname.'" name="'.$htmlname.'">';
3978 3978
 
3979 3979
 			if (!$num) {
3980
-				$form .= '<option value="0">-- ' . $langs->trans("NoSupplierPriceDefinedForThisProduct") . ' --</option>';
3980
+				$form .= '<option value="0">-- '.$langs->trans("NoSupplierPriceDefinedForThisProduct").' --</option>';
3981 3981
 			} else {
3982
-				require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
3982
+				require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
3983 3983
 				$form .= '<option value="0">&nbsp;</option>';
3984 3984
 
3985 3985
 				$i = 0;
3986 3986
 				while ($i < $num) {
3987 3987
 					$objp = $this->db->fetch_object($result);
3988 3988
 
3989
-					$opt = '<option value="' . $objp->idprodfournprice . '"';
3989
+					$opt = '<option value="'.$objp->idprodfournprice.'"';
3990 3990
 					//if there is only one supplier, preselect it
3991 3991
 					if ($num == 1 || ($selected_supplier > 0 && $objp->fk_soc == $selected_supplier) || ($i == 0 && getDolGlobalString('PRODUCT_BEST_SUPPLIER_PRICE_PRESELECTED'))) {
3992 3992
 						$opt .= ' selected';
3993 3993
 					}
3994
-					$opt .= '>' . $objp->name . ' - ' . $objp->ref_fourn . ' - ';
3994
+					$opt .= '>'.$objp->name.' - '.$objp->ref_fourn.' - ';
3995 3995
 
3996 3996
 					if (isModEnabled('dynamicprices') && !empty($objp->fk_supplier_price_expression)) {
3997 3997
 						$prod_supplier = new ProductFournisseur($this->db);
@@ -4001,7 +4001,7 @@  discard block
 block discarded – undo
4001 4001
 						$prod_supplier->fourn_tva_tx = $objp->tva_tx;
4002 4002
 						$prod_supplier->fk_supplier_price_expression = $objp->fk_supplier_price_expression;
4003 4003
 
4004
-						require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
4004
+						require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
4005 4005
 						$priceparser = new PriceParser($this->db);
4006 4006
 						$price_result = $priceparser->parseProductSupplier($prod_supplier);
4007 4007
 						if ($price_result >= 0) {
@@ -4012,10 +4012,10 @@  discard block
 block discarded – undo
4012 4012
 						}
4013 4013
 					}
4014 4014
 					if ($objp->quantity == 1) {
4015
-						$opt .= price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/";
4015
+						$opt .= price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/";
4016 4016
 					}
4017 4017
 
4018
-					$opt .= $objp->quantity . ' ';
4018
+					$opt .= $objp->quantity.' ';
4019 4019
 
4020 4020
 					if ($objp->quantity == 1) {
4021 4021
 						$opt .= $langs->trans("Unit");
@@ -4024,10 +4024,10 @@  discard block
 block discarded – undo
4024 4024
 					}
4025 4025
 					if ($objp->quantity > 1) {
4026 4026
 						$opt .= " - ";
4027
-						$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");
4027
+						$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");
4028 4028
 					}
4029 4029
 					if ($objp->duration) {
4030
-						$opt .= " - " . $objp->duration;
4030
+						$opt .= " - ".$objp->duration;
4031 4031
 					}
4032 4032
 					$opt .= "</option>\n";
4033 4033
 
@@ -4065,8 +4065,8 @@  discard block
 block discarded – undo
4065 4065
 		dol_syslog(__METHOD__, LOG_DEBUG);
4066 4066
 
4067 4067
 		$sql = "SELECT rowid, code, libelle as label, deposit_percent";
4068
-		$sql .= " FROM " . $this->db->prefix() . 'c_payment_term';
4069
-		$sql .= " WHERE entity IN (" . getEntity('c_payment_term') . ")";
4068
+		$sql .= " FROM ".$this->db->prefix().'c_payment_term';
4069
+		$sql .= " WHERE entity IN (".getEntity('c_payment_term').")";
4070 4070
 		$sql .= " AND active > 0";
4071 4071
 		$sql .= " ORDER BY sortorder";
4072 4072
 
@@ -4078,7 +4078,7 @@  discard block
 block discarded – undo
4078 4078
 				$obj = $this->db->fetch_object($resql);
4079 4079
 
4080 4080
 				// Si traduction existe, on l'utilise, sinon on prend le libelle par default
4081
-				$label = ($langs->trans("PaymentConditionShort" . $obj->code) != "PaymentConditionShort" . $obj->code ? $langs->trans("PaymentConditionShort" . $obj->code) : ($obj->label != '-' ? $obj->label : ''));
4081
+				$label = ($langs->trans("PaymentConditionShort".$obj->code) != "PaymentConditionShort".$obj->code ? $langs->trans("PaymentConditionShort".$obj->code) : ($obj->label != '-' ? $obj->label : ''));
4082 4082
 				$this->cache_conditions_paiements[$obj->rowid]['code'] = $obj->code;
4083 4083
 				$this->cache_conditions_paiements[$obj->rowid]['label'] = $label;
4084 4084
 				$this->cache_conditions_paiements[$obj->rowid]['deposit_percent'] = $obj->deposit_percent;
@@ -4106,7 +4106,7 @@  discard block
 block discarded – undo
4106 4106
 		// phpcs:enable
4107 4107
 		global $langs;
4108 4108
 
4109
-		$num = count($this->cache_availability);    // TODO Use $conf->cache['availability'] instead of $this->cache_availability
4109
+		$num = count($this->cache_availability); // TODO Use $conf->cache['availability'] instead of $this->cache_availability
4110 4110
 		if ($num > 0) {
4111 4111
 			return 0; // Cache already loaded
4112 4112
 		}
@@ -4116,7 +4116,7 @@  discard block
 block discarded – undo
4116 4116
 		$langs->load('propal');
4117 4117
 
4118 4118
 		$sql = "SELECT rowid, code, label, position";
4119
-		$sql .= " FROM " . $this->db->prefix() . 'c_availability';
4119
+		$sql .= " FROM ".$this->db->prefix().'c_availability';
4120 4120
 		$sql .= " WHERE active > 0";
4121 4121
 
4122 4122
 		$resql = $this->db->query($sql);
@@ -4127,7 +4127,7 @@  discard block
 block discarded – undo
4127 4127
 				$obj = $this->db->fetch_object($resql);
4128 4128
 
4129 4129
 				// Si traduction existe, on l'utilise, sinon on prend le libelle par default
4130
-				$label = ($langs->trans("AvailabilityType" . $obj->code) != "AvailabilityType" . $obj->code ? $langs->trans("AvailabilityType" . $obj->code) : ($obj->label != '-' ? $obj->label : ''));
4130
+				$label = ($langs->trans("AvailabilityType".$obj->code) != "AvailabilityType".$obj->code ? $langs->trans("AvailabilityType".$obj->code) : ($obj->label != '-' ? $obj->label : ''));
4131 4131
 				$this->cache_availability[$obj->rowid]['code'] = $obj->code;
4132 4132
 				$this->cache_availability[$obj->rowid]['label'] = $label;
4133 4133
 				$this->cache_availability[$obj->rowid]['position'] = $obj->position;
@@ -4159,17 +4159,17 @@  discard block
 block discarded – undo
4159 4159
 
4160 4160
 		$this->load_cache_availability();
4161 4161
 
4162
-		dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG);
4162
+		dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG);
4163 4163
 
4164
-		print '<select id="' . $htmlname . '" class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">';
4164
+		print '<select id="'.$htmlname.'" class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
4165 4165
 		if ($addempty) {
4166 4166
 			print '<option value="0">&nbsp;</option>';
4167 4167
 		}
4168 4168
 		foreach ($this->cache_availability as $id => $arrayavailability) {
4169 4169
 			if ($selected == $id) {
4170
-				print '<option value="' . $id . '" selected>';
4170
+				print '<option value="'.$id.'" selected>';
4171 4171
 			} else {
4172
-				print '<option value="' . $id . '">';
4172
+				print '<option value="'.$id.'">';
4173 4173
 			}
4174 4174
 			print dol_escape_htmltag($arrayavailability['label']);
4175 4175
 			print '</option>';
@@ -4190,13 +4190,13 @@  discard block
 block discarded – undo
4190 4190
 	{
4191 4191
 		global $langs;
4192 4192
 
4193
-		$num = count($this->cache_demand_reason);    // TODO Use $conf->cache['input_reason'] instead of $this->cache_demand_reason
4193
+		$num = count($this->cache_demand_reason); // TODO Use $conf->cache['input_reason'] instead of $this->cache_demand_reason
4194 4194
 		if ($num > 0) {
4195 4195
 			return 0; // Cache already loaded
4196 4196
 		}
4197 4197
 
4198 4198
 		$sql = "SELECT rowid, code, label";
4199
-		$sql .= " FROM " . $this->db->prefix() . 'c_input_reason';
4199
+		$sql .= " FROM ".$this->db->prefix().'c_input_reason';
4200 4200
 		$sql .= " WHERE active > 0";
4201 4201
 
4202 4202
 		$resql = $this->db->query($sql);
@@ -4209,8 +4209,8 @@  discard block
 block discarded – undo
4209 4209
 
4210 4210
 				// Si traduction existe, on l'utilise, sinon on prend le libelle par default
4211 4211
 				$label = ($obj->label != '-' ? $obj->label : '');
4212
-				if ($langs->trans("DemandReasonType" . $obj->code) != "DemandReasonType" . $obj->code) {
4213
-					$label = $langs->trans("DemandReasonType" . $obj->code); // So translation key DemandReasonTypeSRC_XXX will work
4212
+				if ($langs->trans("DemandReasonType".$obj->code) != "DemandReasonType".$obj->code) {
4213
+					$label = $langs->trans("DemandReasonType".$obj->code); // So translation key DemandReasonTypeSRC_XXX will work
4214 4214
 				}
4215 4215
 				if ($langs->trans($obj->code) != $obj->code) {
4216 4216
 					$label = $langs->trans($obj->code); // So translation key SRC_XXX will work
@@ -4250,9 +4250,9 @@  discard block
 block discarded – undo
4250 4250
 
4251 4251
 		$this->loadCacheInputReason();
4252 4252
 
4253
-		print '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="select_' . $htmlname . '" name="' . $htmlname . '">';
4253
+		print '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="select_'.$htmlname.'" name="'.$htmlname.'">';
4254 4254
 		if ($addempty) {
4255
-			print '<option value="0"' . (empty($selected) ? ' selected' : '') . '>&nbsp;</option>';
4255
+			print '<option value="0"'.(empty($selected) ? ' selected' : '').'>&nbsp;</option>';
4256 4256
 		}
4257 4257
 		foreach ($this->cache_demand_reason as $id => $arraydemandreason) {
4258 4258
 			if ($arraydemandreason['code'] == $exclude) {
@@ -4260,9 +4260,9 @@  discard block
 block discarded – undo
4260 4260
 			}
4261 4261
 
4262 4262
 			if ($selected && ($selected == $arraydemandreason['id'] || $selected == $arraydemandreason['code'])) {
4263
-				print '<option value="' . $arraydemandreason['id'] . '" selected>';
4263
+				print '<option value="'.$arraydemandreason['id'].'" selected>';
4264 4264
 			} else {
4265
-				print '<option value="' . $arraydemandreason['id'] . '">';
4265
+				print '<option value="'.$arraydemandreason['id'].'">';
4266 4266
 			}
4267 4267
 			$label = $arraydemandreason['label']; // Translation of label was already done into the ->loadCacheInputReason
4268 4268
 			print $langs->trans($label);
@@ -4272,7 +4272,7 @@  discard block
 block discarded – undo
4272 4272
 		if ($user->admin && empty($notooltip)) {
4273 4273
 			print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
4274 4274
 		}
4275
-		print ajax_combobox('select_' . $htmlname);
4275
+		print ajax_combobox('select_'.$htmlname);
4276 4276
 	}
4277 4277
 
4278 4278
 	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
@@ -4287,7 +4287,7 @@  discard block
 block discarded – undo
4287 4287
 		// phpcs:enable
4288 4288
 		global $langs;
4289 4289
 
4290
-		$num = count($this->cache_types_paiements);        // TODO Use $conf->cache['payment_mode'] instead of $this->cache_types_paiements
4290
+		$num = count($this->cache_types_paiements); // TODO Use $conf->cache['payment_mode'] instead of $this->cache_types_paiements
4291 4291
 		if ($num > 0) {
4292 4292
 			return $num; // Cache already loaded
4293 4293
 		}
@@ -4297,8 +4297,8 @@  discard block
 block discarded – undo
4297 4297
 		$this->cache_types_paiements = array();
4298 4298
 
4299 4299
 		$sql = "SELECT id, code, libelle as label, type, active";
4300
-		$sql .= " FROM " . $this->db->prefix() . "c_paiement";
4301
-		$sql .= " WHERE entity IN (" . getEntity('c_paiement') . ")";
4300
+		$sql .= " FROM ".$this->db->prefix()."c_paiement";
4301
+		$sql .= " WHERE entity IN (".getEntity('c_paiement').")";
4302 4302
 
4303 4303
 		$resql = $this->db->query($sql);
4304 4304
 		if ($resql) {
@@ -4308,7 +4308,7 @@  discard block
 block discarded – undo
4308 4308
 				$obj = $this->db->fetch_object($resql);
4309 4309
 
4310 4310
 				// Si traduction existe, on l'utilise, sinon on prend le libelle par default
4311
-				$label = ($langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) != "PaymentTypeShort" . $obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) : ($obj->label != '-' ? $obj->label : ''));
4311
+				$label = ($langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) != "PaymentTypeShort".$obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) : ($obj->label != '-' ? $obj->label : ''));
4312 4312
 				$this->cache_types_paiements[$obj->id]['id'] = $obj->id;
4313 4313
 				$this->cache_types_paiements[$obj->id]['code'] = $obj->code;
4314 4314
 				$this->cache_types_paiements[$obj->id]['label'] = $label;
@@ -4380,17 +4380,17 @@  discard block
 block discarded – undo
4380 4380
 		global $langs, $user, $conf;
4381 4381
 
4382 4382
 		$out = '';
4383
-		dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG);
4383
+		dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG);
4384 4384
 
4385 4385
 		$this->load_cache_conditions_paiements();
4386 4386
 
4387 4387
 		// Set default value if not already set by caller
4388 4388
 		if (empty($selected) && getDolGlobalString('MAIN_DEFAULT_PAYMENT_TERM_ID')) {
4389
-			dol_syslog(__METHOD__ . "Using deprecated option MAIN_DEFAULT_PAYMENT_TERM_ID", LOG_NOTICE);
4389
+			dol_syslog(__METHOD__."Using deprecated option MAIN_DEFAULT_PAYMENT_TERM_ID", LOG_NOTICE);
4390 4390
 			$selected = getDolGlobalString('MAIN_DEFAULT_PAYMENT_TERM_ID');
4391 4391
 		}
4392 4392
 
4393
-		$out .= '<select id="' . $htmlname . '" class="flat selectpaymentterms' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">';
4393
+		$out .= '<select id="'.$htmlname.'" class="flat selectpaymentterms'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
4394 4394
 		if ($addempty) {
4395 4395
 			$out .= '<option value="0">&nbsp;</option>';
4396 4396
 		}
@@ -4404,9 +4404,9 @@  discard block
 block discarded – undo
4404 4404
 
4405 4405
 			if ($selected == $id) {
4406 4406
 				$selectedDepositPercent = $deposit_percent > 0 ? $deposit_percent : $arrayconditions['deposit_percent'];
4407
-				$out .= '<option value="' . $id . '" data-deposit_percent="' . $arrayconditions['deposit_percent'] . '" selected>';
4407
+				$out .= '<option value="'.$id.'" data-deposit_percent="'.$arrayconditions['deposit_percent'].'" selected>';
4408 4408
 			} else {
4409
-				$out .= '<option value="' . $id . '" data-deposit_percent="' . $arrayconditions['deposit_percent'] . '">';
4409
+				$out .= '<option value="'.$id.'" data-deposit_percent="'.$arrayconditions['deposit_percent'].'">';
4410 4410
 			}
4411 4411
 			$label = $arrayconditions['label'];
4412 4412
 
@@ -4424,21 +4424,21 @@  discard block
 block discarded – undo
4424 4424
 		$out .= ajax_combobox($htmlname);
4425 4425
 
4426 4426
 		if ($deposit_percent >= 0) {
4427
-			$out .= ' <span id="' . $htmlname . '_deposit_percent_container"' . (empty($selectedDepositPercent) ? ' style="display: none"' : '') . '>';
4428
-			$out .= $langs->trans('DepositPercent') . ' : ';
4429
-			$out .= '<input id="' . $htmlname . '_deposit_percent" name="' . $htmlname . '_deposit_percent" class="maxwidth50" value="' . $deposit_percent . '" />';
4427
+			$out .= ' <span id="'.$htmlname.'_deposit_percent_container"'.(empty($selectedDepositPercent) ? ' style="display: none"' : '').'>';
4428
+			$out .= $langs->trans('DepositPercent').' : ';
4429
+			$out .= '<input id="'.$htmlname.'_deposit_percent" name="'.$htmlname.'_deposit_percent" class="maxwidth50" value="'.$deposit_percent.'" />';
4430 4430
 			$out .= '</span>';
4431 4431
 			$out .= '
4432
-				<script nonce="' . getNonce() . '">
4432
+				<script nonce="' . getNonce().'">
4433 4433
 					$(document).ready(function () {
4434
-						$("#' . $htmlname . '").change(function () {
4434
+						$("#' . $htmlname.'").change(function () {
4435 4435
 							let $selected = $(this).find("option:selected");
4436 4436
 							let depositPercent = $selected.attr("data-deposit_percent");
4437 4437
 
4438 4438
 							if (depositPercent.length > 0) {
4439
-								$("#' . $htmlname . '_deposit_percent_container").show().find("#' . $htmlname . '_deposit_percent").val(depositPercent);
4439
+								$("#' . $htmlname.'_deposit_percent_container").show().find("#'.$htmlname.'_deposit_percent").val(depositPercent);
4440 4440
 							} else {
4441
-								$("#' . $htmlname . '_deposit_percent_container").hide();
4441
+								$("#' . $htmlname.'_deposit_percent_container").hide();
4442 4442
 							}
4443 4443
 
4444 4444
 							return true;
@@ -4476,7 +4476,7 @@  discard block
 block discarded – undo
4476 4476
 
4477 4477
 		$out = '';
4478 4478
 
4479
-		dol_syslog(__METHOD__ . " " . $selected . ", " . $htmlname . ", " . $filtertype . ", " . $format, LOG_DEBUG);
4479
+		dol_syslog(__METHOD__." ".$selected.", ".$htmlname.", ".$filtertype.", ".$format, LOG_DEBUG);
4480 4480
 
4481 4481
 		$filterarray = array();
4482 4482
 		if ($filtertype == 'CRDT') {
@@ -4491,11 +4491,11 @@  discard block
 block discarded – undo
4491 4491
 
4492 4492
 		// Set default value if not already set by caller
4493 4493
 		if (empty($selected) && getDolGlobalString('MAIN_DEFAULT_PAYMENT_TYPE_ID')) {
4494
-			dol_syslog(__METHOD__ . "Using deprecated option MAIN_DEFAULT_PAYMENT_TYPE_ID", LOG_NOTICE);
4494
+			dol_syslog(__METHOD__."Using deprecated option MAIN_DEFAULT_PAYMENT_TYPE_ID", LOG_NOTICE);
4495 4495
 			$selected = getDolGlobalString('MAIN_DEFAULT_PAYMENT_TYPE_ID');
4496 4496
 		}
4497 4497
 
4498
-		$out .= '<select id="select' . $htmlname . '" class="flat selectpaymenttypes' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">';
4498
+		$out .= '<select id="select'.$htmlname.'" class="flat selectpaymenttypes'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
4499 4499
 		if ($empty) {
4500 4500
 			$out .= '<option value="">&nbsp;</option>';
4501 4501
 		}
@@ -4516,13 +4516,13 @@  discard block
 block discarded – undo
4516 4516
 			}
4517 4517
 
4518 4518
 			if ($format == 0) {
4519
-				$out .= '<option value="' . $id . '"';
4519
+				$out .= '<option value="'.$id.'"';
4520 4520
 			} elseif ($format == 1) {
4521
-				$out .= '<option value="' . $arraytypes['code'] . '"';
4521
+				$out .= '<option value="'.$arraytypes['code'].'"';
4522 4522
 			} elseif ($format == 2) {
4523
-				$out .= '<option value="' . $arraytypes['code'] . '"';
4523
+				$out .= '<option value="'.$arraytypes['code'].'"';
4524 4524
 			} elseif ($format == 3) {
4525
-				$out .= '<option value="' . $id . '"';
4525
+				$out .= '<option value="'.$id.'"';
4526 4526
 			}
4527 4527
 			// Print attribute selected or not
4528 4528
 			if ($format == 1 || $format == 2) {
@@ -4552,7 +4552,7 @@  discard block
 block discarded – undo
4552 4552
 		if ($user->admin && !$noadmininfo) {
4553 4553
 			$out .= info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
4554 4554
 		}
4555
-		$out .= ajax_combobox('select' . $htmlname);
4555
+		$out .= ajax_combobox('select'.$htmlname);
4556 4556
 
4557 4557
 		if (empty($nooutput)) {
4558 4558
 			print $out;
@@ -4574,22 +4574,22 @@  discard block
 block discarded – undo
4574 4574
 	{
4575 4575
 		global $langs;
4576 4576
 
4577
-		$return = '<select class="flat maxwidth100" id="select_' . $htmlname . '" name="' . $htmlname . '">';
4577
+		$return = '<select class="flat maxwidth100" id="select_'.$htmlname.'" name="'.$htmlname.'">';
4578 4578
 		$options = array(
4579 4579
 			'HT' => $langs->trans("HT"),
4580 4580
 			'TTC' => $langs->trans("TTC")
4581 4581
 		);
4582 4582
 		foreach ($options as $id => $value) {
4583 4583
 			if ($selected == $id) {
4584
-				$return .= '<option value="' . $id . '" selected>' . $value;
4584
+				$return .= '<option value="'.$id.'" selected>'.$value;
4585 4585
 			} else {
4586
-				$return .= '<option value="' . $id . '">' . $value;
4586
+				$return .= '<option value="'.$id.'">'.$value;
4587 4587
 			}
4588 4588
 			$return .= '</option>';
4589 4589
 		}
4590 4590
 		$return .= '</select>';
4591 4591
 		if ($addjscombo) {
4592
-			$return .= ajax_combobox('select_' . $htmlname);
4592
+			$return .= ajax_combobox('select_'.$htmlname);
4593 4593
 		}
4594 4594
 
4595 4595
 		return $return;
@@ -4607,7 +4607,7 @@  discard block
 block discarded – undo
4607 4607
 		// phpcs:enable
4608 4608
 		global $langs;
4609 4609
 
4610
-		$num = count($this->cache_transport_mode);        // TODO Use $conf->cache['payment_mode'] instead of $this->cache_transport_mode
4610
+		$num = count($this->cache_transport_mode); // TODO Use $conf->cache['payment_mode'] instead of $this->cache_transport_mode
4611 4611
 		if ($num > 0) {
4612 4612
 			return $num; // Cache already loaded
4613 4613
 		}
@@ -4617,8 +4617,8 @@  discard block
 block discarded – undo
4617 4617
 		$this->cache_transport_mode = array();
4618 4618
 
4619 4619
 		$sql = "SELECT rowid, code, label, active";
4620
-		$sql .= " FROM " . $this->db->prefix() . "c_transport_mode";
4621
-		$sql .= " WHERE entity IN (" . getEntity('c_transport_mode') . ")";
4620
+		$sql .= " FROM ".$this->db->prefix()."c_transport_mode";
4621
+		$sql .= " WHERE entity IN (".getEntity('c_transport_mode').")";
4622 4622
 
4623 4623
 		$resql = $this->db->query($sql);
4624 4624
 		if ($resql) {
@@ -4628,7 +4628,7 @@  discard block
 block discarded – undo
4628 4628
 				$obj = $this->db->fetch_object($resql);
4629 4629
 
4630 4630
 				// If traduction exist, we use it else we take the default label
4631
-				$label = ($langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) != "PaymentTypeShort" . $obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) : ($obj->label != '-' ? $obj->label : ''));
4631
+				$label = ($langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) != "PaymentTypeShort".$obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) : ($obj->label != '-' ? $obj->label : ''));
4632 4632
 				$this->cache_transport_mode[$obj->rowid]['rowid'] = $obj->rowid;
4633 4633
 				$this->cache_transport_mode[$obj->rowid]['code'] = $obj->code;
4634 4634
 				$this->cache_transport_mode[$obj->rowid]['label'] = $label;
@@ -4662,11 +4662,11 @@  discard block
 block discarded – undo
4662 4662
 	{
4663 4663
 		global $langs, $user;
4664 4664
 
4665
-		dol_syslog(__METHOD__ . " " . $selected . ", " . $htmlname . ", " . $format, LOG_DEBUG);
4665
+		dol_syslog(__METHOD__." ".$selected.", ".$htmlname.", ".$format, LOG_DEBUG);
4666 4666
 
4667 4667
 		$this->load_cache_transport_mode();
4668 4668
 
4669
-		print '<select id="select' . $htmlname . '" class="flat selectmodetransport' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">';
4669
+		print '<select id="select'.$htmlname.'" class="flat selectmodetransport'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
4670 4670
 		if ($empty) {
4671 4671
 			print '<option value="">&nbsp;</option>';
4672 4672
 		}
@@ -4682,13 +4682,13 @@  discard block
 block discarded – undo
4682 4682
 			}
4683 4683
 
4684 4684
 			if ($format == 0) {
4685
-				print '<option value="' . $id . '"';
4685
+				print '<option value="'.$id.'"';
4686 4686
 			} elseif ($format == 1) {
4687
-				print '<option value="' . $arraytypes['code'] . '"';
4687
+				print '<option value="'.$arraytypes['code'].'"';
4688 4688
 			} elseif ($format == 2) {
4689
-				print '<option value="' . $arraytypes['code'] . '"';
4689
+				print '<option value="'.$arraytypes['code'].'"';
4690 4690
 			} elseif ($format == 3) {
4691
-				print '<option value="' . $id . '"';
4691
+				print '<option value="'.$id.'"';
4692 4692
 			}
4693 4693
 			// If text is selected, we compare with code, else with id
4694 4694
 			if (preg_match('/[a-z]/i', $selected) && $selected == $arraytypes['code']) {
@@ -4736,31 +4736,31 @@  discard block
 block discarded – undo
4736 4736
 		$langs->load("deliveries");
4737 4737
 
4738 4738
 		$sql = "SELECT rowid, code, libelle as label";
4739
-		$sql .= " FROM " . $this->db->prefix() . "c_shipment_mode";
4739
+		$sql .= " FROM ".$this->db->prefix()."c_shipment_mode";
4740 4740
 		$sql .= " WHERE active > 0";
4741 4741
 		if ($filtre) {
4742
-			$sql .= " AND " . $filtre;
4742
+			$sql .= " AND ".$filtre;
4743 4743
 		}
4744 4744
 		$sql .= " ORDER BY libelle ASC";
4745 4745
 
4746
-		dol_syslog(get_class($this) . "::selectShippingMode", LOG_DEBUG);
4746
+		dol_syslog(get_class($this)."::selectShippingMode", LOG_DEBUG);
4747 4747
 		$result = $this->db->query($sql);
4748 4748
 		if ($result) {
4749 4749
 			$num = $this->db->num_rows($result);
4750 4750
 			$i = 0;
4751 4751
 			if ($num) {
4752
-				print '<select id="select' . $htmlname . '" class="flat selectshippingmethod' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>';
4752
+				print '<select id="select'.$htmlname.'" class="flat selectshippingmethod'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>';
4753 4753
 				if ($useempty == 1 || ($useempty == 2 && $num > 1)) {
4754 4754
 					print '<option value="-1">&nbsp;</option>';
4755 4755
 				}
4756 4756
 				while ($i < $num) {
4757 4757
 					$obj = $this->db->fetch_object($result);
4758 4758
 					if ($selected == $obj->rowid) {
4759
-						print '<option value="' . $obj->rowid . '" selected>';
4759
+						print '<option value="'.$obj->rowid.'" selected>';
4760 4760
 					} else {
4761
-						print '<option value="' . $obj->rowid . '">';
4761
+						print '<option value="'.$obj->rowid.'">';
4762 4762
 					}
4763
-					print ($langs->trans("SendingMethod" . strtoupper($obj->code)) != "SendingMethod" . strtoupper($obj->code)) ? $langs->trans("SendingMethod" . strtoupper($obj->code)) : $obj->label;
4763
+					print ($langs->trans("SendingMethod".strtoupper($obj->code)) != "SendingMethod".strtoupper($obj->code)) ? $langs->trans("SendingMethod".strtoupper($obj->code)) : $obj->label;
4764 4764
 					print '</option>';
4765 4765
 					$i++;
4766 4766
 				}
@@ -4769,7 +4769,7 @@  discard block
 block discarded – undo
4769 4769
 					print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
4770 4770
 				}
4771 4771
 
4772
-				print ajax_combobox('select' . $htmlname);
4772
+				print ajax_combobox('select'.$htmlname);
4773 4773
 			} else {
4774 4774
 				print $langs->trans("NoShippingMethodDefined");
4775 4775
 			}
@@ -4794,16 +4794,16 @@  discard block
 block discarded – undo
4794 4794
 		$langs->load("deliveries");
4795 4795
 
4796 4796
 		if ($htmlname != "none") {
4797
-			print '<form method="POST" action="' . $page . '">';
4797
+			print '<form method="POST" action="'.$page.'">';
4798 4798
 			print '<input type="hidden" name="action" value="setshippingmethod">';
4799
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
4799
+			print '<input type="hidden" name="token" value="'.newToken().'">';
4800 4800
 			$this->selectShippingMethod($selected, $htmlname, '', $addempty);
4801
-			print '<input type="submit" class="button valignmiddle" value="' . $langs->trans("Modify") . '">';
4801
+			print '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
4802 4802
 			print '</form>';
4803 4803
 		} else {
4804 4804
 			if ($selected) {
4805 4805
 				$code = $langs->getLabelFromKey($this->db, $selected, 'c_shipment_mode', 'rowid', 'code');
4806
-				print $langs->trans("SendingMethod" . strtoupper($code));
4806
+				print $langs->trans("SendingMethod".strtoupper($code));
4807 4807
 			} else {
4808 4808
 				print "&nbsp;";
4809 4809
 			}
@@ -4826,10 +4826,10 @@  discard block
 block discarded – undo
4826 4826
 
4827 4827
 		$opt = '<option value="" selected></option>';
4828 4828
 		$sql = "SELECT rowid, ref, situation_cycle_ref, situation_counter, situation_final, fk_soc";
4829
-		$sql .= ' FROM ' . $this->db->prefix() . 'facture';
4830
-		$sql .= ' WHERE entity IN (' . getEntity('invoice') . ')';
4829
+		$sql .= ' FROM '.$this->db->prefix().'facture';
4830
+		$sql .= ' WHERE entity IN ('.getEntity('invoice').')';
4831 4831
 		$sql .= ' AND situation_counter >= 1';
4832
-		$sql .= ' AND fk_soc = ' . (int) $socid;
4832
+		$sql .= ' AND fk_soc = '.(int) $socid;
4833 4833
 		$sql .= ' AND type <> 2';
4834 4834
 		$sql .= ' ORDER by situation_cycle_ref, situation_counter desc';
4835 4835
 		$resql = $this->db->query($sql);
@@ -4847,19 +4847,19 @@  discard block
 block discarded – undo
4847 4847
 						//Not prov?
4848 4848
 						if (substr($obj->ref, 1, 4) != 'PROV') {
4849 4849
 							if ($selected == $obj->rowid) {
4850
-								$opt .= '<option value="' . $obj->rowid . '" selected>' . $obj->ref . '</option>';
4850
+								$opt .= '<option value="'.$obj->rowid.'" selected>'.$obj->ref.'</option>';
4851 4851
 							} else {
4852
-								$opt .= '<option value="' . $obj->rowid . '">' . $obj->ref . '</option>';
4852
+								$opt .= '<option value="'.$obj->rowid.'">'.$obj->ref.'</option>';
4853 4853
 							}
4854 4854
 						}
4855 4855
 					}
4856 4856
 				}
4857 4857
 			}
4858 4858
 		} else {
4859
-			dol_syslog("Error sql=" . $sql . ", error=" . $this->error, LOG_ERR);
4859
+			dol_syslog("Error sql=".$sql.", error=".$this->error, LOG_ERR);
4860 4860
 		}
4861 4861
 		if ($opt == '<option value ="" selected></option>') {
4862
-			$opt = '<option value ="0" selected>' . $langs->trans('NoSituations') . '</option>';
4862
+			$opt = '<option value ="0" selected>'.$langs->trans('NoSituations').'</option>';
4863 4863
 		}
4864 4864
 		return $opt;
4865 4865
 	}
@@ -4879,12 +4879,12 @@  discard block
 block discarded – undo
4879 4879
 
4880 4880
 		$langs->load('products');
4881 4881
 
4882
-		$return = '<select class="flat" id="' . $htmlname . '" name="' . $htmlname . '">';
4882
+		$return = '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'">';
4883 4883
 
4884
-		$sql = "SELECT rowid, label, code FROM " . $this->db->prefix() . "c_units";
4884
+		$sql = "SELECT rowid, label, code FROM ".$this->db->prefix()."c_units";
4885 4885
 		$sql .= ' WHERE active > 0';
4886 4886
 		if (!empty($unit_type)) {
4887
-			$sql .= " AND unit_type = '" . $this->db->escape($unit_type) . "'";
4887
+			$sql .= " AND unit_type = '".$this->db->escape($unit_type)."'";
4888 4888
 		}
4889 4889
 		$sql .= " ORDER BY sortorder";
4890 4890
 
@@ -4896,14 +4896,14 @@  discard block
 block discarded – undo
4896 4896
 
4897 4897
 			while ($res = $this->db->fetch_object($resql)) {
4898 4898
 				$unitLabel = $res->label;
4899
-				if (!empty($langs->tab_translate['unit' . $res->code])) {    // check if Translation is available before
4900
-					$unitLabel = $langs->trans('unit' . $res->code) != $res->label ? $langs->trans('unit' . $res->code) : $res->label;
4899
+				if (!empty($langs->tab_translate['unit'.$res->code])) {    // check if Translation is available before
4900
+					$unitLabel = $langs->trans('unit'.$res->code) != $res->label ? $langs->trans('unit'.$res->code) : $res->label;
4901 4901
 				}
4902 4902
 
4903 4903
 				if ($selected == $res->rowid) {
4904
-					$return .= '<option value="' . $res->rowid . '" selected>' . $unitLabel . '</option>';
4904
+					$return .= '<option value="'.$res->rowid.'" selected>'.$unitLabel.'</option>';
4905 4905
 				} else {
4906
-					$return .= '<option value="' . $res->rowid . '">' . $unitLabel . '</option>';
4906
+					$return .= '<option value="'.$res->rowid.'">'.$unitLabel.'</option>';
4907 4907
 				}
4908 4908
 			}
4909 4909
 			$return .= '</select>';
@@ -4938,23 +4938,23 @@  discard block
 block discarded – undo
4938 4938
 		$num = 0;
4939 4939
 
4940 4940
 		$sql = "SELECT rowid, label, bank, clos as status, currency_code";
4941
-		$sql .= " FROM " . $this->db->prefix() . "bank_account";
4942
-		$sql .= " WHERE entity IN (" . getEntity('bank_account') . ")";
4941
+		$sql .= " FROM ".$this->db->prefix()."bank_account";
4942
+		$sql .= " WHERE entity IN (".getEntity('bank_account').")";
4943 4943
 		if ($status != 2) {
4944
-			$sql .= " AND clos = " . (int) $status;
4944
+			$sql .= " AND clos = ".(int) $status;
4945 4945
 		}
4946 4946
 		if ($filtre) {	// TODO Support USF
4947
-			$sql .= " AND " . $filtre;
4947
+			$sql .= " AND ".$filtre;
4948 4948
 		}
4949 4949
 		$sql .= " ORDER BY label";
4950 4950
 
4951
-		dol_syslog(get_class($this) . "::select_comptes", LOG_DEBUG);
4951
+		dol_syslog(get_class($this)."::select_comptes", LOG_DEBUG);
4952 4952
 		$result = $this->db->query($sql);
4953 4953
 		if ($result) {
4954 4954
 			$num = $this->db->num_rows($result);
4955 4955
 			$i = 0;
4956 4956
 			if ($num) {
4957
-				$out .= '<select id="select' . $htmlname . '" class="flat selectbankaccount' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>';
4957
+				$out .= '<select id="select'.$htmlname.'" class="flat selectbankaccount'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>';
4958 4958
 				if ($useempty == 1 || ($useempty == 2 && $num > 1)) {
4959 4959
 					$out .= '<option value="-1">&nbsp;</option>';
4960 4960
 				}
@@ -4962,27 +4962,27 @@  discard block
 block discarded – undo
4962 4962
 				while ($i < $num) {
4963 4963
 					$obj = $this->db->fetch_object($result);
4964 4964
 					if ($selected == $obj->rowid || ($useempty == 2 && $num == 1 && empty($selected))) {
4965
-						$out .= '<option value="' . $obj->rowid . '" data-currency-code="' . $obj->currency_code . '" selected>';
4965
+						$out .= '<option value="'.$obj->rowid.'" data-currency-code="'.$obj->currency_code.'" selected>';
4966 4966
 					} else {
4967
-						$out .= '<option value="' . $obj->rowid . '" data-currency-code="' . $obj->currency_code . '">';
4967
+						$out .= '<option value="'.$obj->rowid.'" data-currency-code="'.$obj->currency_code.'">';
4968 4968
 					}
4969 4969
 					$out .= trim($obj->label);
4970 4970
 					if ($showcurrency) {
4971
-						$out .= ' (' . $obj->currency_code . ')';
4971
+						$out .= ' ('.$obj->currency_code.')';
4972 4972
 					}
4973 4973
 					if ($status == 2 && $obj->status == 1) {
4974
-						$out .= ' (' . $langs->trans("Closed") . ')';
4974
+						$out .= ' ('.$langs->trans("Closed").')';
4975 4975
 					}
4976 4976
 					$out .= '</option>';
4977 4977
 					$i++;
4978 4978
 				}
4979 4979
 				$out .= "</select>";
4980
-				$out .= ajax_combobox('select' . $htmlname);
4980
+				$out .= ajax_combobox('select'.$htmlname);
4981 4981
 			} else {
4982 4982
 				if ($status == 0) {
4983
-					$out .= '<span class="opacitymedium">' . $langs->trans("NoActiveBankAccountDefined") . '</span>';
4983
+					$out .= '<span class="opacitymedium">'.$langs->trans("NoActiveBankAccountDefined").'</span>';
4984 4984
 				} else {
4985
-					$out .= '<span class="opacitymedium">' . $langs->trans("NoBankAccountFound") . '</span>';
4985
+					$out .= '<span class="opacitymedium">'.$langs->trans("NoBankAccountFound").'</span>';
4986 4986
 				}
4987 4987
 			}
4988 4988
 		} else {
@@ -5018,23 +5018,23 @@  discard block
 block discarded – undo
5018 5018
 		$num = 0;
5019 5019
 
5020 5020
 		$sql = "SELECT rowid, name, fk_country, status, entity";
5021
-		$sql .= " FROM " . $this->db->prefix() . "establishment";
5021
+		$sql .= " FROM ".$this->db->prefix()."establishment";
5022 5022
 		$sql .= " WHERE 1=1";
5023 5023
 		if ($status != 2) {
5024
-			$sql .= " AND status = " . (int) $status;
5024
+			$sql .= " AND status = ".(int) $status;
5025 5025
 		}
5026 5026
 		if ($filtre) {	// TODO Support USF
5027
-			$sql .= " AND " . $filtre;
5027
+			$sql .= " AND ".$filtre;
5028 5028
 		}
5029 5029
 		$sql .= " ORDER BY name";
5030 5030
 
5031
-		dol_syslog(get_class($this) . "::select_establishment", LOG_DEBUG);
5031
+		dol_syslog(get_class($this)."::select_establishment", LOG_DEBUG);
5032 5032
 		$result = $this->db->query($sql);
5033 5033
 		if ($result) {
5034 5034
 			$num = $this->db->num_rows($result);
5035 5035
 			$i = 0;
5036 5036
 			if ($num) {
5037
-				print '<select id="select' . $htmlname . '" class="flat selectestablishment" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>';
5037
+				print '<select id="select'.$htmlname.'" class="flat selectestablishment" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>';
5038 5038
 				if ($useempty == 1 || ($useempty == 2 && $num > 1)) {
5039 5039
 					print '<option value="-1">&nbsp;</option>';
5040 5040
 				}
@@ -5042,13 +5042,13 @@  discard block
 block discarded – undo
5042 5042
 				while ($i < $num) {
5043 5043
 					$obj = $this->db->fetch_object($result);
5044 5044
 					if ($selected == $obj->rowid) {
5045
-						print '<option value="' . $obj->rowid . '" selected>';
5045
+						print '<option value="'.$obj->rowid.'" selected>';
5046 5046
 					} else {
5047
-						print '<option value="' . $obj->rowid . '">';
5047
+						print '<option value="'.$obj->rowid.'">';
5048 5048
 					}
5049 5049
 					print trim($obj->name);
5050 5050
 					if ($status == 2 && $obj->status == 1) {
5051
-						print ' (' . $langs->trans("Closed") . ')';
5051
+						print ' ('.$langs->trans("Closed").')';
5052 5052
 					}
5053 5053
 					print '</option>';
5054 5054
 					$i++;
@@ -5056,9 +5056,9 @@  discard block
 block discarded – undo
5056 5056
 				print "</select>";
5057 5057
 			} else {
5058 5058
 				if ($status == 0) {
5059
-					print '<span class="opacitymedium">' . $langs->trans("NoActiveEstablishmentDefined") . '</span>';
5059
+					print '<span class="opacitymedium">'.$langs->trans("NoActiveEstablishmentDefined").'</span>';
5060 5060
 				} else {
5061
-					print '<span class="opacitymedium">' . $langs->trans("NoEstablishmentFound") . '</span>';
5061
+					print '<span class="opacitymedium">'.$langs->trans("NoEstablishmentFound").'</span>';
5062 5062
 				}
5063 5063
 			}
5064 5064
 
@@ -5082,20 +5082,20 @@  discard block
 block discarded – undo
5082 5082
 	{
5083 5083
 		global $langs;
5084 5084
 		if ($htmlname != "none") {
5085
-			print '<form method="POST" action="' . $page . '">';
5085
+			print '<form method="POST" action="'.$page.'">';
5086 5086
 			print '<input type="hidden" name="action" value="setbankaccount">';
5087
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
5087
+			print '<input type="hidden" name="token" value="'.newToken().'">';
5088 5088
 			print img_picto('', 'bank_account', 'class="pictofixedwidth"');
5089 5089
 			$nbaccountfound = $this->select_comptes($selected, $htmlname, 0, '', $addempty);
5090 5090
 			if ($nbaccountfound > 0) {
5091
-				print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
5091
+				print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
5092 5092
 			}
5093 5093
 			print '</form>';
5094 5094
 		} else {
5095 5095
 			$langs->load('banks');
5096 5096
 
5097 5097
 			if ($selected) {
5098
-				require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php';
5098
+				require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
5099 5099
 				$bankstatic = new Account($this->db);
5100 5100
 				$result = $bankstatic->fetch($selected);
5101 5101
 				if ($result) {
@@ -5134,19 +5134,19 @@  discard block
 block discarded – undo
5134 5134
 		global $conf, $langs;
5135 5135
 		$langs->load("categories");
5136 5136
 
5137
-		include_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
5137
+		include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
5138 5138
 
5139 5139
 		// For backward compatibility
5140 5140
 		if (is_numeric($type)) {
5141
-			dol_syslog(__METHOD__ . ': using numeric value for parameter type is deprecated. Use string code instead.', LOG_WARNING);
5141
+			dol_syslog(__METHOD__.': using numeric value for parameter type is deprecated. Use string code instead.', LOG_WARNING);
5142 5142
 		}
5143 5143
 
5144 5144
 		if ($type === Categorie::TYPE_BANK_LINE) {
5145 5145
 			// TODO Move this into common category feature
5146 5146
 			$cate_arbo = array();
5147 5147
 			$sql = "SELECT c.label, c.rowid";
5148
-			$sql .= " FROM " . $this->db->prefix() . "bank_categ as c";
5149
-			$sql .= " WHERE entity = " . $conf->entity;
5148
+			$sql .= " FROM ".$this->db->prefix()."bank_categ as c";
5149
+			$sql .= " WHERE entity = ".$conf->entity;
5150 5150
 			$sql .= " ORDER BY c.label";
5151 5151
 			$result = $this->db->query($sql);
5152 5152
 			if ($result) {
@@ -5172,12 +5172,12 @@  discard block
 block discarded – undo
5172 5172
 		$outarrayrichhtml = array();
5173 5173
 
5174 5174
 
5175
-		$output = '<select class="flat minwidth100' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
5175
+		$output = '<select class="flat minwidth100'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
5176 5176
 		if (is_array($cate_arbo)) {
5177 5177
 			$num = count($cate_arbo);
5178 5178
 
5179 5179
 			if (!$num) {
5180
-				$output .= '<option value="-1" disabled>' . $langs->trans("NoCategoriesDefined") . '</option>';
5180
+				$output .= '<option value="-1" disabled>'.$langs->trans("NoCategoriesDefined").'</option>';
5181 5181
 			} else {
5182 5182
 				if ($useempty == 1 || ($useempty == 2 && $num > 1)) {
5183 5183
 					$output .= '<option value="-1">&nbsp;</option>';
@@ -5189,15 +5189,15 @@  discard block
 block discarded – undo
5189 5189
 						$add = '';
5190 5190
 					}
5191 5191
 
5192
-					$labeltoshow = img_picto('', 'category', 'class="pictofixedwidth" style="color: #' . $cate_arbo[$key]['color'] . '"');
5192
+					$labeltoshow = img_picto('', 'category', 'class="pictofixedwidth" style="color: #'.$cate_arbo[$key]['color'].'"');
5193 5193
 					$labeltoshow .= dol_trunc($cate_arbo[$key]['fulllabel'], $maxlength, 'middle');
5194 5194
 
5195 5195
 					$outarray[$cate_arbo[$key]['id']] = $cate_arbo[$key]['fulllabel'];
5196 5196
 
5197 5197
 					$outarrayrichhtml[$cate_arbo[$key]['id']] = $labeltoshow;
5198 5198
 
5199
-					$output .= '<option ' . $add . 'value="' . $cate_arbo[$key]['id'] . '"';
5200
-					$output .= ' data-html="' . dol_escape_htmltag($labeltoshow) . '"';
5199
+					$output .= '<option '.$add.'value="'.$cate_arbo[$key]['id'].'"';
5200
+					$output .= ' data-html="'.dol_escape_htmltag($labeltoshow).'"';
5201 5201
 					$output .= '>';
5202 5202
 					$output .= dol_trunc($cate_arbo[$key]['fulllabel'], $maxlength, 'middle');
5203 5203
 					$output .= '</option>';
@@ -5239,7 +5239,7 @@  discard block
 block discarded – undo
5239 5239
 	public function form_confirm($page, $title, $question, $action, $formquestion = array(), $selectedchoice = "", $useajax = 0, $height = 170, $width = 500)
5240 5240
 	{
5241 5241
 		// phpcs:enable
5242
-		dol_syslog(__METHOD__ . ': using form_confirm is deprecated. Use formconfim instead.', LOG_WARNING);
5242
+		dol_syslog(__METHOD__.': using form_confirm is deprecated. Use formconfim instead.', LOG_WARNING);
5243 5243
 		print $this->formconfirm($page, $title, $question, $action, $formquestion, $selectedchoice, $useajax, $height, $width);
5244 5244
 	}
5245 5245
 
@@ -5274,7 +5274,7 @@  discard block
 block discarded – undo
5274 5274
 	{
5275 5275
 		global $langs, $conf;
5276 5276
 
5277
-		$more = '<!-- formconfirm - before call, page=' . dol_escape_htmltag($page) . ' -->';
5277
+		$more = '<!-- formconfirm - before call, page='.dol_escape_htmltag($page).' -->';
5278 5278
 		$formconfirm = '';
5279 5279
 		$inputok = array();
5280 5280
 		$inputko = array();
@@ -5298,27 +5298,27 @@  discard block
 block discarded – undo
5298 5298
 			foreach ($formquestion as $key => $input) {
5299 5299
 				if (is_array($input) && !empty($input)) {
5300 5300
 					if ($input['type'] == 'hidden') {
5301
-						$moreattr = (!empty($input['moreattr']) ? ' ' . $input['moreattr'] : '');
5302
-						$morecss = (!empty($input['morecss']) ? ' ' . $input['morecss'] : '');
5301
+						$moreattr = (!empty($input['moreattr']) ? ' '.$input['moreattr'] : '');
5302
+						$morecss = (!empty($input['morecss']) ? ' '.$input['morecss'] : '');
5303 5303
 
5304
-						$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";
5304
+						$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";
5305 5305
 					}
5306 5306
 				}
5307 5307
 			}
5308 5308
 
5309 5309
 			// Now add questions
5310 5310
 			$moreonecolumn = '';
5311
-			$more .= '<div class="tagtable paddingtopbottomonly centpercent noborderspacing">' . "\n";
5311
+			$more .= '<div class="tagtable paddingtopbottomonly centpercent noborderspacing">'."\n";
5312 5312
 			foreach ($formquestion as $key => $input) {
5313 5313
 				if (is_array($input) && !empty($input)) {
5314
-					$size = (!empty($input['size']) ? ' size="' . $input['size'] . '"' : '');    // deprecated. Use morecss instead.
5315
-					$moreattr = (!empty($input['moreattr']) ? ' ' . $input['moreattr'] : '');
5316
-					$morecss = (!empty($input['morecss']) ? ' ' . $input['morecss'] : '');
5314
+					$size = (!empty($input['size']) ? ' size="'.$input['size'].'"' : ''); // deprecated. Use morecss instead.
5315
+					$moreattr = (!empty($input['moreattr']) ? ' '.$input['moreattr'] : '');
5316
+					$morecss = (!empty($input['morecss']) ? ' '.$input['morecss'] : '');
5317 5317
 
5318 5318
 					if ($input['type'] == 'text') {
5319
-						$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";
5319
+						$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";
5320 5320
 					} elseif ($input['type'] == 'password') {
5321
-						$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";
5321
+						$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";
5322 5322
 					} elseif ($input['type'] == 'textarea') {
5323 5323
 						/*$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div><div class="tagtd">';
5324 5324
 						$more .= '<textarea name="'.$input['name'].'" class="'.$morecss.'"'.$moreattr.'>';
@@ -5326,8 +5326,8 @@  discard block
 block discarded – undo
5326 5326
 						$more .= '</textarea>';
5327 5327
 						$more .= '</div></div>'."\n";*/
5328 5328
 						$moreonecolumn .= '<div class="margintoponly">';
5329
-						$moreonecolumn .= $input['label'] . '<br>';
5330
-						$moreonecolumn .= '<textarea name="' . dol_escape_htmltag($input['name']) . '" id="' . dol_escape_htmltag($input['name']) . '" class="' . $morecss . '"' . $moreattr . '>';
5329
+						$moreonecolumn .= $input['label'].'<br>';
5330
+						$moreonecolumn .= '<textarea name="'.dol_escape_htmltag($input['name']).'" id="'.dol_escape_htmltag($input['name']).'" class="'.$morecss.'"'.$moreattr.'>';
5331 5331
 						$moreonecolumn .= $input['value'];
5332 5332
 						$moreonecolumn .= '</textarea>';
5333 5333
 						$moreonecolumn .= '</div>';
@@ -5344,20 +5344,20 @@  discard block
 block discarded – undo
5344 5344
 						$disabled = isset($input['select_disabled']) ? $input['select_disabled'] : 0;
5345 5345
 						$sort = isset($input['select_sort']) ? $input['select_sort'] : '';
5346 5346
 
5347
-						$more .= '<div class="tagtr"><div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '">';
5347
+						$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">';
5348 5348
 						if (!empty($input['label'])) {
5349
-							$more .= $input['label'] . '</div><div class="tagtd left">';
5349
+							$more .= $input['label'].'</div><div class="tagtd left">';
5350 5350
 						}
5351 5351
 						if ($input['type'] == 'select') {
5352 5352
 							$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);
5353 5353
 						} else {
5354 5354
 							$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);
5355 5355
 						}
5356
-						$more .= '</div></div>' . "\n";
5356
+						$more .= '</div></div>'."\n";
5357 5357
 					} elseif ($input['type'] == 'checkbox') {
5358 5358
 						$more .= '<div class="tagtr">';
5359
-						$more .= '<div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '"><label for="' . dol_escape_htmltag($input['name']) . '">' . $input['label'] . '</label></div><div class="tagtd">';
5360
-						$more .= '<input type="checkbox" class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . dol_escape_htmltag($input['name']) . '" name="' . dol_escape_htmltag($input['name']) . '"' . $moreattr;
5359
+						$more .= '<div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'"><label for="'.dol_escape_htmltag($input['name']).'">'.$input['label'].'</label></div><div class="tagtd">';
5360
+						$more .= '<input type="checkbox" class="flat'.($morecss ? ' '.$morecss : '').'" id="'.dol_escape_htmltag($input['name']).'" name="'.dol_escape_htmltag($input['name']).'"'.$moreattr;
5361 5361
 						if (!is_bool($input['value']) && $input['value'] != 'false' && $input['value'] != '0' && $input['value'] != '') {
5362 5362
 							$more .= ' checked';
5363 5363
 						}
@@ -5368,19 +5368,19 @@  discard block
 block discarded – undo
5368 5368
 							$more .= ' disabled';
5369 5369
 						}
5370 5370
 						$more .= ' /></div>';
5371
-						$more .= '</div>' . "\n";
5371
+						$more .= '</div>'."\n";
5372 5372
 					} elseif ($input['type'] == 'radio') {
5373 5373
 						$i = 0;
5374 5374
 						foreach ($input['values'] as $selkey => $selval) {
5375 5375
 							$more .= '<div class="tagtr">';
5376 5376
 							if (isset($input['label'])) {
5377 5377
 								if ($i == 0) {
5378
-									$more .= '<div class="tagtd' . (empty($input['tdclass']) ? ' tdtop' : (' tdtop ' . $input['tdclass'])) . '">' . $input['label'] . '</div>';
5378
+									$more .= '<div class="tagtd'.(empty($input['tdclass']) ? ' tdtop' : (' tdtop '.$input['tdclass'])).'">'.$input['label'].'</div>';
5379 5379
 								} else {
5380
-									$more .= '<div class="tagtd' . (empty($input['tdclass']) ? '' : (' "' . $input['tdclass'])) . '">&nbsp;</div>';
5380
+									$more .= '<div class="tagtd'.(empty($input['tdclass']) ? '' : (' "'.$input['tdclass'])).'">&nbsp;</div>';
5381 5381
 								}
5382 5382
 							}
5383
-							$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;
5383
+							$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;
5384 5384
 							if (!empty($input['disabled'])) {
5385 5385
 								$more .= ' disabled';
5386 5386
 							}
@@ -5388,12 +5388,12 @@  discard block
 block discarded – undo
5388 5388
 								$more .= ' checked="checked"';
5389 5389
 							}
5390 5390
 							$more .= ' /> ';
5391
-							$more .= '<label for="' . dol_escape_htmltag($input['name'] . $selkey) . '" class="valignmiddle">' . $selval . '</label>';
5392
-							$more .= '</div></div>' . "\n";
5391
+							$more .= '<label for="'.dol_escape_htmltag($input['name'].$selkey).'" class="valignmiddle">'.$selval.'</label>';
5392
+							$more .= '</div></div>'."\n";
5393 5393
 							$i++;
5394 5394
 						}
5395 5395
 					} elseif ($input['type'] == 'date' || $input['type'] == 'datetime') {
5396
-						$more .= '<div class="tagtr"><div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '">' . $input['label'] . '</div>';
5396
+						$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div>';
5397 5397
 						$more .= '<div class="tagtd">';
5398 5398
 						$addnowlink = (empty($input['datenow']) ? 0 : 1);
5399 5399
 						$h = $m = 0;
@@ -5411,24 +5411,24 @@  discard block
 block discarded – undo
5411 5411
 					} elseif ($input['type'] == 'other') { // can be 1 column or 2 depending if label is set or not
5412 5412
 						$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">';
5413 5413
 						if (!empty($input['label'])) {
5414
-							$more .= $input['label'] . '</div><div class="tagtd">';
5414
+							$more .= $input['label'].'</div><div class="tagtd">';
5415 5415
 						}
5416 5416
 						$more .= $input['value'];
5417
-						$more .= '</div></div>' . "\n";
5417
+						$more .= '</div></div>'."\n";
5418 5418
 					} elseif ($input['type'] == 'onecolumn') {
5419 5419
 						$moreonecolumn .= '<div class="margintoponly">';
5420 5420
 						$moreonecolumn .= $input['value'];
5421
-						$moreonecolumn .= '</div>' . "\n";
5421
+						$moreonecolumn .= '</div>'."\n";
5422 5422
 					} elseif ($input['type'] == 'hidden') {
5423 5423
 						// Do nothing more, already added by a previous loop
5424 5424
 					} elseif ($input['type'] == 'separator') {
5425 5425
 						$more .= '<br>';
5426 5426
 					} else {
5427
-						$more .= 'Error type ' . $input['type'] . ' for the confirm box is not a supported type';
5427
+						$more .= 'Error type '.$input['type'].' for the confirm box is not a supported type';
5428 5428
 					}
5429 5429
 				}
5430 5430
 			}
5431
-			$more .= '</div>' . "\n";
5431
+			$more .= '</div>'."\n";
5432 5432
 			$more .= $moreonecolumn;
5433 5433
 		}
5434 5434
 
@@ -5450,10 +5450,10 @@  discard block
 block discarded – undo
5450 5450
 				$button = $useajax;
5451 5451
 				$useajax = 1;
5452 5452
 				$autoOpen = false;
5453
-				$dialogconfirm .= '-' . $button;
5453
+				$dialogconfirm .= '-'.$button;
5454 5454
 			}
5455
-			$pageyes = $page . (preg_match('/\?/', $page) ? '&' : '?') . 'action=' . urlencode($action) . '&confirm=yes';
5456
-			$pageno = ($useajax == 2 ? $page . (preg_match('/\?/', $page) ? '&' : '?') . 'action=' . urlencode($action) . '&confirm=no' : '');
5455
+			$pageyes = $page.(preg_match('/\?/', $page) ? '&' : '?').'action='.urlencode($action).'&confirm=yes';
5456
+			$pageno = ($useajax == 2 ? $page.(preg_match('/\?/', $page) ? '&' : '?').'action='.urlencode($action).'&confirm=no' : '');
5457 5457
 
5458 5458
 			// Add input fields into list of fields to read during submit (inputok and inputko)
5459 5459
 			if (is_array($formquestion)) {
@@ -5476,24 +5476,24 @@  discard block
 block discarded – undo
5476 5476
 			}
5477 5477
 
5478 5478
 			// Show JQuery confirm box.
5479
-			$formconfirm .= '<div id="' . $dialogconfirm . '" title="' . dol_escape_htmltag($title) . '" style="display: none;">';
5479
+			$formconfirm .= '<div id="'.$dialogconfirm.'" title="'.dol_escape_htmltag($title).'" style="display: none;">';
5480 5480
 			if (is_array($formquestion) && array_key_exists('text', $formquestion) && !empty($formquestion['text'])) {
5481
-				$formconfirm .= '<div class="confirmtext">' . $formquestion['text'] . '</div>' . "\n";
5481
+				$formconfirm .= '<div class="confirmtext">'.$formquestion['text'].'</div>'."\n";
5482 5482
 			}
5483 5483
 			if (!empty($more)) {
5484
-				$formconfirm .= '<div class="confirmquestions">' . $more . '</div>' . "\n";
5484
+				$formconfirm .= '<div class="confirmquestions">'.$more.'</div>'."\n";
5485 5485
 			}
5486
-			$formconfirm .= ($question ? '<div class="confirmmessage">' . img_help(0, '') . ' ' . $question . '</div>' : '');
5487
-			$formconfirm .= '</div>' . "\n";
5486
+			$formconfirm .= ($question ? '<div class="confirmmessage">'.img_help(0, '').' '.$question.'</div>' : '');
5487
+			$formconfirm .= '</div>'."\n";
5488 5488
 
5489
-			$formconfirm .= "\n<!-- begin code of popup for formconfirm page=" . $page . " -->\n";
5490
-			$formconfirm .= '<script nonce="' . getNonce() . '" type="text/javascript">' . "\n";
5489
+			$formconfirm .= "\n<!-- begin code of popup for formconfirm page=".$page." -->\n";
5490
+			$formconfirm .= '<script nonce="'.getNonce().'" type="text/javascript">'."\n";
5491 5491
 			$formconfirm .= "/* Code for the jQuery('#dialogforpopup').dialog() */\n";
5492 5492
 			$formconfirm .= 'jQuery(document).ready(function() {
5493 5493
             $(function() {
5494
-            	$( "#' . $dialogconfirm . '" ).dialog(
5494
+            	$( "#' . $dialogconfirm.'" ).dialog(
5495 5495
             	{
5496
-                    autoOpen: ' . ($autoOpen ? "true" : "false") . ',';
5496
+                    autoOpen: ' . ($autoOpen ? "true" : "false").',';
5497 5497
 			if ($newselectedchoice == 'no') {
5498 5498
 				$formconfirm .= '
5499 5499
 						open: function() {
@@ -5503,24 +5503,24 @@  discard block
 block discarded – undo
5503 5503
 
5504 5504
 			$jsforcursor = '';
5505 5505
 			if ($useajax == 1) {
5506
-				$jsforcursor = '// The call to urljump can be slow, so we set the wait cursor' . "\n";
5507
-				$jsforcursor .= 'jQuery("html,body,#id-container").addClass("cursorwait");' . "\n";
5506
+				$jsforcursor = '// The call to urljump can be slow, so we set the wait cursor'."\n";
5507
+				$jsforcursor .= 'jQuery("html,body,#id-container").addClass("cursorwait");'."\n";
5508 5508
 			}
5509 5509
 
5510 5510
 			$postconfirmas = 'GET';
5511 5511
 
5512 5512
 			$formconfirm .= '
5513 5513
                     resizable: false,
5514
-                    height: "' . $height . '",
5515
-                    width: "' . $width . '",
5514
+                    height: "' . $height.'",
5515
+                    width: "' . $width.'",
5516 5516
                     modal: true,
5517 5517
                     closeOnEscape: false,
5518 5518
                     buttons: {
5519
-                        "' . dol_escape_js($langs->transnoentities($labelbuttonyes)) . '": function() {
5520
-							var options = "token=' . urlencode(newToken()) . '";
5521
-                        	var inputok = ' . json_encode($inputok) . ';	/* List of fields into form */
5522
-							var page = "' . dol_escape_js(!empty($page) ? $page : '') . '";
5523
-                         	var pageyes = "' . dol_escape_js(!empty($pageyes) ? $pageyes : '') . '";
5519
+                        "' . dol_escape_js($langs->transnoentities($labelbuttonyes)).'": function() {
5520
+							var options = "token=' . urlencode(newToken()).'";
5521
+                        	var inputok = ' . json_encode($inputok).';	/* List of fields into form */
5522
+							var page = "' . dol_escape_js(!empty($page) ? $page : '').'";
5523
+                         	var pageyes = "' . dol_escape_js(!empty($pageyes) ? $pageyes : '').'";
5524 5524
 
5525 5525
                          	if (inputok.length > 0) {
5526 5526
                          		$.each(inputok, function(i, inputname) {
@@ -5554,11 +5554,11 @@  discard block
 block discarded – undo
5554 5554
 							}
5555 5555
 	                        $(this).dialog("close");
5556 5556
                         },
5557
-                        "' . dol_escape_js($langs->transnoentities($labelbuttonno)) . '": function() {
5558
-                        	var options = "token=' . urlencode(newToken()) . '";
5559
-                         	var inputko = ' . json_encode($inputko) . ';	/* List of fields into form */
5560
-							var page = "' . dol_escape_js(!empty($page) ? $page : '') . '";
5561
-                         	var pageno="' . dol_escape_js(!empty($pageno) ? $pageno : '') . '";
5557
+                        "' . dol_escape_js($langs->transnoentities($labelbuttonno)).'": function() {
5558
+                        	var options = "token=' . urlencode(newToken()).'";
5559
+                         	var inputko = ' . json_encode($inputko).';	/* List of fields into form */
5560
+							var page = "' . dol_escape_js(!empty($page) ? $page : '').'";
5561
+                         	var pageno="' . dol_escape_js(!empty($pageno) ? $pageno : '').'";
5562 5562
                          	if (inputko.length > 0) {
5563 5563
                          		$.each(inputko, function(i, inputname) {
5564 5564
                          			var more = "";
@@ -5590,10 +5590,10 @@  discard block
 block discarded – undo
5590 5590
                 }
5591 5591
                 );
5592 5592
 
5593
-            	var button = "' . $button . '";
5593
+            	var button = "' . $button.'";
5594 5594
             	if (button.length > 0) {
5595 5595
                 	$( "#" + button ).click(function() {
5596
-                		$("#' . $dialogconfirm . '").dialog("open");
5596
+                		$("#' . $dialogconfirm.'").dialog("open");
5597 5597
         			});
5598 5598
                 }
5599 5599
             });
@@ -5601,44 +5601,44 @@  discard block
 block discarded – undo
5601 5601
             </script>';
5602 5602
 			$formconfirm .= "<!-- end ajax formconfirm -->\n";
5603 5603
 		} else {
5604
-			$formconfirm .= "\n<!-- begin formconfirm page=" . dol_escape_htmltag($page) . " -->\n";
5604
+			$formconfirm .= "\n<!-- begin formconfirm page=".dol_escape_htmltag($page)." -->\n";
5605 5605
 
5606 5606
 			if (empty($disableformtag)) {
5607
-				$formconfirm .= '<form method="POST" action="' . $page . '" class="notoptoleftroright">' . "\n";
5607
+				$formconfirm .= '<form method="POST" action="'.$page.'" class="notoptoleftroright">'."\n";
5608 5608
 			}
5609 5609
 
5610
-			$formconfirm .= '<input type="hidden" name="action" value="' . $action . '">' . "\n";
5611
-			$formconfirm .= '<input type="hidden" name="token" value="' . newToken() . '">' . "\n";
5610
+			$formconfirm .= '<input type="hidden" name="action" value="'.$action.'">'."\n";
5611
+			$formconfirm .= '<input type="hidden" name="token" value="'.newToken().'">'."\n";
5612 5612
 
5613
-			$formconfirm .= '<table class="valid centpercent">' . "\n";
5613
+			$formconfirm .= '<table class="valid centpercent">'."\n";
5614 5614
 
5615 5615
 			// Line title
5616 5616
 			$formconfirm .= '<tr class="validtitre"><td class="validtitre" colspan="2">';
5617
-			$formconfirm .= img_picto('', 'pictoconfirm') . ' ' . $title;
5618
-			$formconfirm .= '</td></tr>' . "\n";
5617
+			$formconfirm .= img_picto('', 'pictoconfirm').' '.$title;
5618
+			$formconfirm .= '</td></tr>'."\n";
5619 5619
 
5620 5620
 			// Line text
5621 5621
 			if (is_array($formquestion) && array_key_exists('text', $formquestion) && !empty($formquestion['text'])) {
5622
-				$formconfirm .= '<tr class="valid"><td class="valid" colspan="2">' . $formquestion['text'] . '</td></tr>' . "\n";
5622
+				$formconfirm .= '<tr class="valid"><td class="valid" colspan="2">'.$formquestion['text'].'</td></tr>'."\n";
5623 5623
 			}
5624 5624
 
5625 5625
 			// Line form fields
5626 5626
 			if ($more) {
5627
-				$formconfirm .= '<tr class="valid"><td class="valid" colspan="2">' . "\n";
5627
+				$formconfirm .= '<tr class="valid"><td class="valid" colspan="2">'."\n";
5628 5628
 				$formconfirm .= $more;
5629
-				$formconfirm .= '</td></tr>' . "\n";
5629
+				$formconfirm .= '</td></tr>'."\n";
5630 5630
 			}
5631 5631
 
5632 5632
 			// Line with question
5633 5633
 			$formconfirm .= '<tr class="valid">';
5634
-			$formconfirm .= '<td class="valid">' . $question . '</td>';
5634
+			$formconfirm .= '<td class="valid">'.$question.'</td>';
5635 5635
 			$formconfirm .= '<td class="valid center">';
5636 5636
 			$formconfirm .= $this->selectyesno("confirm", $newselectedchoice, 0, false, 0, 0, 'marginleftonly marginrightonly', $labelbuttonyes, $labelbuttonno);
5637
-			$formconfirm .= '<input class="button valignmiddle confirmvalidatebutton small" type="submit" value="' . $langs->trans("Validate") . '">';
5637
+			$formconfirm .= '<input class="button valignmiddle confirmvalidatebutton small" type="submit" value="'.$langs->trans("Validate").'">';
5638 5638
 			$formconfirm .= '</td>';
5639
-			$formconfirm .= '</tr>' . "\n";
5639
+			$formconfirm .= '</tr>'."\n";
5640 5640
 
5641
-			$formconfirm .= '</table>' . "\n";
5641
+			$formconfirm .= '</table>'."\n";
5642 5642
 
5643 5643
 			if (empty($disableformtag)) {
5644 5644
 				$formconfirm .= "</form>\n";
@@ -5647,7 +5647,7 @@  discard block
 block discarded – undo
5647 5647
 
5648 5648
 			if (!empty($conf->use_javascript_ajax)) {
5649 5649
 				$formconfirm .= '<!-- code to disable button to avoid double clic -->';
5650
-				$formconfirm .= '<script nonce="' . getNonce() . '" type="text/javascript">' . "\n";
5650
+				$formconfirm .= '<script nonce="'.getNonce().'" type="text/javascript">'."\n";
5651 5651
 				$formconfirm .= '
5652 5652
 				$(document).ready(function () {
5653 5653
 					$(".confirmvalidatebutton").on("click", function() {
@@ -5659,7 +5659,7 @@  discard block
 block discarded – undo
5659 5659
 					});
5660 5660
 				});
5661 5661
 				';
5662
-				$formconfirm .= '</script>' . "\n";
5662
+				$formconfirm .= '</script>'."\n";
5663 5663
 			}
5664 5664
 
5665 5665
 			$formconfirm .= "<!-- end formconfirm -->\n";
@@ -5691,8 +5691,8 @@  discard block
 block discarded – undo
5691 5691
 		// phpcs:enable
5692 5692
 		global $langs;
5693 5693
 
5694
-		require_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php';
5695
-		require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php';
5694
+		require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
5695
+		require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
5696 5696
 
5697 5697
 		$out = '';
5698 5698
 
@@ -5700,11 +5700,11 @@  discard block
 block discarded – undo
5700 5700
 
5701 5701
 		$langs->load("project");
5702 5702
 		if ($htmlname != "none") {
5703
-			$out .= '<form method="post" action="' . $page . '">';
5703
+			$out .= '<form method="post" action="'.$page.'">';
5704 5704
 			$out .= '<input type="hidden" name="action" value="classin">';
5705
-			$out .= '<input type="hidden" name="token" value="' . newToken() . '">';
5705
+			$out .= '<input type="hidden" name="token" value="'.newToken().'">';
5706 5706
 			$out .= $formproject->select_projects($socid, $selected, $htmlname, $maxlength, 0, 1, $discard_closed, $forcefocus, 0, 0, '', 1, 0, $morecss);
5707
-			$out .= '<input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '">';
5707
+			$out .= '<input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">';
5708 5708
 			$out .= '</form>';
5709 5709
 		} else {
5710 5710
 			$out .= '<span class="project_head_block">';
@@ -5713,7 +5713,7 @@  discard block
 block discarded – undo
5713 5713
 				$projet->fetch($selected);
5714 5714
 				$out .= $projet->getNomUrl(0, '', 1);
5715 5715
 			} else {
5716
-				$out .= '<span class="opacitymedium">' . $textifnoproject . '</span>';
5716
+				$out .= '<span class="opacitymedium">'.$textifnoproject.'</span>';
5717 5717
 			}
5718 5718
 			$out .= '</span>';
5719 5719
 		}
@@ -5750,14 +5750,14 @@  discard block
 block discarded – undo
5750 5750
 		$out = '';
5751 5751
 
5752 5752
 		if ($htmlname != "none") {
5753
-			$out .= '<form method="POST" action="' . $page . '">';
5753
+			$out .= '<form method="POST" action="'.$page.'">';
5754 5754
 			$out .= '<input type="hidden" name="action" value="setconditions">';
5755
-			$out .= '<input type="hidden" name="token" value="' . newToken() . '">';
5755
+			$out .= '<input type="hidden" name="token" value="'.newToken().'">';
5756 5756
 			if ($type) {
5757
-				$out .= '<input type="hidden" name="type" value="' . dol_escape_htmltag($type) . '">';
5757
+				$out .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">';
5758 5758
 			}
5759 5759
 			$out .= $this->getSelectConditionsPaiements($selected, $htmlname, $filtertype, $addempty, 0, '', $deposit_percent);
5760
-			$out .= '<input type="submit" class="button valignmiddle smallpaddingimp" value="' . $langs->trans("Modify") . '">';
5760
+			$out .= '<input type="submit" class="button valignmiddle smallpaddingimp" value="'.$langs->trans("Modify").'">';
5761 5761
 			$out .= '</form>';
5762 5762
 		} else {
5763 5763
 			if ($selected) {
@@ -5802,12 +5802,12 @@  discard block
 block discarded – undo
5802 5802
 		// phpcs:enable
5803 5803
 		global $langs;
5804 5804
 		if ($htmlname != "none") {
5805
-			print '<form method="post" action="' . $page . '">';
5805
+			print '<form method="post" action="'.$page.'">';
5806 5806
 			print '<input type="hidden" name="action" value="setavailability">';
5807
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
5807
+			print '<input type="hidden" name="token" value="'.newToken().'">';
5808 5808
 			$this->selectAvailabilityDelay($selected, $htmlname, -1, $addempty);
5809
-			print '<input type="submit" name="modify" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '">';
5810
-			print '<input type="submit" name="cancel" class="button smallpaddingimp" value="' . $langs->trans("Cancel") . '">';
5809
+			print '<input type="submit" name="modify" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">';
5810
+			print '<input type="submit" name="cancel" class="button smallpaddingimp" value="'.$langs->trans("Cancel").'">';
5811 5811
 			print '</form>';
5812 5812
 		} else {
5813 5813
 			if ($selected) {
@@ -5833,11 +5833,11 @@  discard block
 block discarded – undo
5833 5833
 	{
5834 5834
 		global $langs;
5835 5835
 		if ($htmlname != "none") {
5836
-			print '<form method="post" action="' . $page . '">';
5836
+			print '<form method="post" action="'.$page.'">';
5837 5837
 			print '<input type="hidden" name="action" value="setdemandreason">';
5838
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
5838
+			print '<input type="hidden" name="token" value="'.newToken().'">';
5839 5839
 			$this->selectInputReason($selected, $htmlname, -1, $addempty);
5840
-			print '<input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '">';
5840
+			print '<input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">';
5841 5841
 			print '</form>';
5842 5842
 		} else {
5843 5843
 			if ($selected) {
@@ -5877,17 +5877,17 @@  discard block
 block discarded – undo
5877 5877
 		$ret = '';
5878 5878
 
5879 5879
 		if ($htmlname != "none") {
5880
-			$ret .= '<form method="POST" action="' . $page . '" name="form' . $htmlname . '">';
5881
-			$ret .= '<input type="hidden" name="action" value="set' . $htmlname . '">';
5882
-			$ret .= '<input type="hidden" name="token" value="' . newToken() . '">';
5880
+			$ret .= '<form method="POST" action="'.$page.'" name="form'.$htmlname.'">';
5881
+			$ret .= '<input type="hidden" name="action" value="set'.$htmlname.'">';
5882
+			$ret .= '<input type="hidden" name="token" value="'.newToken().'">';
5883 5883
 			if ($type) {
5884
-				$ret .= '<input type="hidden" name="type" value="' . dol_escape_htmltag($type) . '">';
5884
+				$ret .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">';
5885 5885
 			}
5886 5886
 			$ret .= '<table class="nobordernopadding">';
5887 5887
 			$ret .= '<tr><td>';
5888
-			$ret .= $this->selectDate($selected, $htmlname, $displayhour, $displaymin, 1, 'form' . $htmlname, 1, 0);
5888
+			$ret .= $this->selectDate($selected, $htmlname, $displayhour, $displaymin, 1, 'form'.$htmlname, 1, 0);
5889 5889
 			$ret .= '</td>';
5890
-			$ret .= '<td class="left"><input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '"></td>';
5890
+			$ret .= '<td class="left"><input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'"></td>';
5891 5891
 			$ret .= '</tr></table></form>';
5892 5892
 		} else {
5893 5893
 			if ($displayhour) {
@@ -5922,15 +5922,15 @@  discard block
 block discarded – undo
5922 5922
 		global $langs;
5923 5923
 
5924 5924
 		if ($htmlname != "none") {
5925
-			print '<form method="POST" action="' . $page . '" name="form' . $htmlname . '">';
5926
-			print '<input type="hidden" name="action" value="set' . $htmlname . '">';
5927
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
5925
+			print '<form method="POST" action="'.$page.'" name="form'.$htmlname.'">';
5926
+			print '<input type="hidden" name="action" value="set'.$htmlname.'">';
5927
+			print '<input type="hidden" name="token" value="'.newToken().'">';
5928 5928
 			print $this->select_dolusers($selected, $htmlname, 1, $exclude, 0, $include);
5929
-			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
5929
+			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
5930 5930
 			print '</form>';
5931 5931
 		} else {
5932 5932
 			if ($selected) {
5933
-				require_once DOL_DOCUMENT_ROOT . '/user/class/user.class.php';
5933
+				require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
5934 5934
 				$theuser = new User($this->db);
5935 5935
 				$theuser->fetch($selected);
5936 5936
 				print $theuser->getNomUrl(1);
@@ -5963,14 +5963,14 @@  discard block
 block discarded – undo
5963 5963
 
5964 5964
 		$out = '';
5965 5965
 		if ($htmlname != "none") {
5966
-			$out .= '<form method="POST" action="' . $page . '">';
5966
+			$out .= '<form method="POST" action="'.$page.'">';
5967 5967
 			$out .= '<input type="hidden" name="action" value="setmode">';
5968
-			$out .= '<input type="hidden" name="token" value="' . newToken() . '">';
5968
+			$out .= '<input type="hidden" name="token" value="'.newToken().'">';
5969 5969
 			if ($type) {
5970
-				$out .= '<input type="hidden" name="type" value="' . dol_escape_htmltag($type) . '">';
5970
+				$out .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">';
5971 5971
 			}
5972 5972
 			$out .= $this->select_types_paiements($selected, $htmlname, $filtertype, 0, $addempty, 0, 0, $active, '', 1);
5973
-			$out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
5973
+			$out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
5974 5974
 			$out .= '</form>';
5975 5975
 		} else {
5976 5976
 			if ($selected) {
@@ -6003,11 +6003,11 @@  discard block
 block discarded – undo
6003 6003
 	{
6004 6004
 		global $langs;
6005 6005
 		if ($htmlname != "none") {
6006
-			print '<form method="POST" action="' . $page . '">';
6006
+			print '<form method="POST" action="'.$page.'">';
6007 6007
 			print '<input type="hidden" name="action" value="settransportmode">';
6008
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
6008
+			print '<input type="hidden" name="token" value="'.newToken().'">';
6009 6009
 			$this->selectTransportMode($selected, $htmlname, 0, $addempty, 0, 0, $active);
6010
-			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
6010
+			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
6011 6011
 			print '</form>';
6012 6012
 		} else {
6013 6013
 			if ($selected) {
@@ -6034,14 +6034,14 @@  discard block
 block discarded – undo
6034 6034
 		// phpcs:enable
6035 6035
 		global $langs;
6036 6036
 		if ($htmlname != "none") {
6037
-			print '<form method="POST" action="' . $page . '">';
6037
+			print '<form method="POST" action="'.$page.'">';
6038 6038
 			print '<input type="hidden" name="action" value="setmulticurrencycode">';
6039
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
6039
+			print '<input type="hidden" name="token" value="'.newToken().'">';
6040 6040
 			print $this->selectMultiCurrency($selected, $htmlname, 0);
6041
-			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
6041
+			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
6042 6042
 			print '</form>';
6043 6043
 		} else {
6044
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
6044
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
6045 6045
 			print !empty($selected) ? currency_name($selected, 1) : '&nbsp;';
6046 6046
 		}
6047 6047
 	}
@@ -6063,21 +6063,21 @@  discard block
 block discarded – undo
6063 6063
 		global $langs, $mysoc, $conf;
6064 6064
 
6065 6065
 		if ($htmlname != "none") {
6066
-			print '<form method="POST" action="' . $page . '">';
6066
+			print '<form method="POST" action="'.$page.'">';
6067 6067
 			print '<input type="hidden" name="action" value="setmulticurrencyrate">';
6068
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
6069
-			print '<input type="text" class="maxwidth100" name="' . $htmlname . '" value="' . (!empty($rate) ? price(price2num($rate, 'CU')) : 1) . '" /> ';
6068
+			print '<input type="hidden" name="token" value="'.newToken().'">';
6069
+			print '<input type="text" class="maxwidth100" name="'.$htmlname.'" value="'.(!empty($rate) ? price(price2num($rate, 'CU')) : 1).'" /> ';
6070 6070
 			print '<select name="calculation_mode">';
6071
-			print '<option value="1">Change ' . $langs->trans("PriceUHT") . ' of lines</option>';
6072
-			print '<option value="2">Change ' . $langs->trans("PriceUHTCurrency") . ' of lines</option>';
6071
+			print '<option value="1">Change '.$langs->trans("PriceUHT").' of lines</option>';
6072
+			print '<option value="2">Change '.$langs->trans("PriceUHTCurrency").' of lines</option>';
6073 6073
 			print '</select> ';
6074
-			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
6074
+			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
6075 6075
 			print '</form>';
6076 6076
 		} else {
6077 6077
 			if (!empty($rate)) {
6078 6078
 				print price($rate, 1, $langs, 0, 0);
6079 6079
 				if ($currency && $rate != 1) {
6080
-					print ' &nbsp; (' . price($rate, 1, $langs, 0, 0) . ' ' . $currency . ' = 1 ' . $conf->currency . ')';
6080
+					print ' &nbsp; ('.price($rate, 1, $langs, 0, 0).' '.$currency.' = 1 '.$conf->currency.')';
6081 6081
 				}
6082 6082
 			} else {
6083 6083
 				print 1;
@@ -6108,9 +6108,9 @@  discard block
 block discarded – undo
6108 6108
 		// phpcs:enable
6109 6109
 		global $conf, $langs;
6110 6110
 		if ($htmlname != "none") {
6111
-			print '<form method="post" action="' . $page . '">';
6111
+			print '<form method="post" action="'.$page.'">';
6112 6112
 			print '<input type="hidden" name="action" value="setabsolutediscount">';
6113
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
6113
+			print '<input type="hidden" name="token" value="'.newToken().'">';
6114 6114
 			print '<div class="inline-block">';
6115 6115
 			if (!empty($discount_type)) {
6116 6116
 				if (getDolGlobalString('FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS')) {
@@ -6148,24 +6148,24 @@  discard block
 block discarded – undo
6148 6148
 			print '</div>';
6149 6149
 			if (empty($hidelist)) {
6150 6150
 				print '<div class="inline-block" style="padding-right: 10px">';
6151
-				$newfilter = 'discount_type=' . intval($discount_type);
6151
+				$newfilter = 'discount_type='.intval($discount_type);
6152 6152
 				if (!empty($discount_type)) {
6153 6153
 					$newfilter .= ' AND fk_invoice_supplier IS NULL AND fk_invoice_supplier_line IS NULL'; // Supplier discounts available
6154 6154
 				} else {
6155 6155
 					$newfilter .= ' AND fk_facture IS NULL AND fk_facture_line IS NULL'; // Customer discounts available
6156 6156
 				}
6157 6157
 				if ($filter) {
6158
-					$newfilter .= ' AND (' . $filter . ')';
6158
+					$newfilter .= ' AND ('.$filter.')';
6159 6159
 				}
6160 6160
 				// output the combo of discounts
6161 6161
 				$nbqualifiedlines = $this->select_remises($selected, $htmlname, $newfilter, $socid, $maxvalue);
6162 6162
 				if ($nbqualifiedlines > 0) {
6163
-					print ' &nbsp; <input type="submit" class="button smallpaddingimp" value="' . dol_escape_htmltag($langs->trans("UseLine")) . '"';
6163
+					print ' &nbsp; <input type="submit" class="button smallpaddingimp" value="'.dol_escape_htmltag($langs->trans("UseLine")).'"';
6164 6164
 					if (!empty($discount_type) && $filter && $filter != "fk_invoice_supplier_source IS NULL OR (description LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS PAID)%')") {
6165
-						print ' title="' . $langs->trans("UseCreditNoteInInvoicePayment") . '"';
6165
+						print ' title="'.$langs->trans("UseCreditNoteInInvoicePayment").'"';
6166 6166
 					}
6167 6167
 					if (empty($discount_type) && $filter && $filter != "fk_facture_source IS NULL OR (description LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS RECEIVED)%')") {
6168
-						print ' title="' . $langs->trans("UseCreditNoteInInvoicePayment") . '"';
6168
+						print ' title="'.$langs->trans("UseCreditNoteInInvoicePayment").'"';
6169 6169
 					}
6170 6170
 
6171 6171
 					print '>';
@@ -6205,23 +6205,23 @@  discard block
 block discarded – undo
6205 6205
 		global $langs, $conf;
6206 6206
 
6207 6207
 		if ($htmlname != "none") {
6208
-			print '<form method="post" action="' . $page . '">';
6208
+			print '<form method="post" action="'.$page.'">';
6209 6209
 			print '<input type="hidden" name="action" value="set_contact">';
6210
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
6210
+			print '<input type="hidden" name="token" value="'.newToken().'">';
6211 6211
 			print '<table class="nobordernopadding">';
6212 6212
 			print '<tr><td>';
6213 6213
 			print $this->selectcontacts($societe->id, $selected, $htmlname);
6214 6214
 			$num = $this->num;
6215 6215
 			if ($num == 0) {
6216 6216
 				$addcontact = (getDolGlobalString('SOCIETE_ADDRESSES_MANAGEMENT') ? $langs->trans("AddContact") : $langs->trans("AddContactAddress"));
6217
-				print '<a href="' . DOL_URL_ROOT . '/contact/card.php?socid=' . $societe->id . '&amp;action=create&amp;backtoreferer=1">' . $addcontact . '</a>';
6217
+				print '<a href="'.DOL_URL_ROOT.'/contact/card.php?socid='.$societe->id.'&amp;action=create&amp;backtoreferer=1">'.$addcontact.'</a>';
6218 6218
 			}
6219 6219
 			print '</td>';
6220
-			print '<td class="left"><input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '"></td>';
6220
+			print '<td class="left"><input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'"></td>';
6221 6221
 			print '</tr></table></form>';
6222 6222
 		} else {
6223 6223
 			if ($selected) {
6224
-				require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php';
6224
+				require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
6225 6225
 				$contact = new Contact($this->db);
6226 6226
 				$contact->fetch($selected);
6227 6227
 				print $contact->getFullName($langs);
@@ -6256,20 +6256,20 @@  discard block
 block discarded – undo
6256 6256
 
6257 6257
 		$out = '';
6258 6258
 		if ($htmlname != "none") {
6259
-			$out .= '<form method="post" action="' . $page . '">';
6259
+			$out .= '<form method="post" action="'.$page.'">';
6260 6260
 			$out .= '<input type="hidden" name="action" value="set_thirdparty">';
6261
-			$out .= '<input type="hidden" name="token" value="' . newToken() . '">';
6261
+			$out .= '<input type="hidden" name="token" value="'.newToken().'">';
6262 6262
 			$out .= $this->select_company($selected, $htmlname, $filter, $showempty, $showtype, $forcecombo, $events, 0, 'minwidth100', '', '', 1, array(), false, $excludeids);
6263
-			$out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
6263
+			$out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
6264 6264
 			$out .= '</form>';
6265 6265
 		} else {
6266 6266
 			if ($selected) {
6267
-				require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
6267
+				require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
6268 6268
 				$soc = new Societe($this->db);
6269 6269
 				$soc->fetch($selected);
6270 6270
 				$out .= $soc->getNomUrl(0, '');
6271 6271
 			} else {
6272
-				$out .= '<span class="opacitymedium">' . $textifnothirdparty . '</span>';
6272
+				$out .= '<span class="opacitymedium">'.$textifnothirdparty.'</span>';
6273 6273
 			}
6274 6274
 		}
6275 6275
 
@@ -6319,22 +6319,22 @@  discard block
 block discarded – undo
6319 6319
 			$selected = 'EUR'; // Pour compatibilite
6320 6320
 		}
6321 6321
 
6322
-		$out .= '<select class="flat maxwidth200onsmartphone minwidth300" name="' . $htmlname . '" id="' . $htmlname . '">';
6322
+		$out .= '<select class="flat maxwidth200onsmartphone minwidth300" name="'.$htmlname.'" id="'.$htmlname.'">';
6323 6323
 		if ($useempty) {
6324 6324
 			$out .= '<option value="-1" selected></option>';
6325 6325
 		}
6326 6326
 		foreach ($langs->cache_currencies as $code_iso => $currency) {
6327 6327
 			$labeltoshow = $currency['label'];
6328 6328
 			if ($mode == 1) {
6329
-				$labeltoshow .= ' <span class="opacitymedium">(' . $code_iso . ')</span>';
6329
+				$labeltoshow .= ' <span class="opacitymedium">('.$code_iso.')</span>';
6330 6330
 			} else {
6331
-				$labeltoshow .= ' <span class="opacitymedium">(' . $langs->getCurrencySymbol($code_iso) . ')</span>';
6331
+				$labeltoshow .= ' <span class="opacitymedium">('.$langs->getCurrencySymbol($code_iso).')</span>';
6332 6332
 			}
6333 6333
 
6334 6334
 			if ($selected && $selected == $code_iso) {
6335
-				$out .= '<option value="' . $code_iso . '" selected data-html="' . dol_escape_htmltag($labeltoshow) . '">';
6335
+				$out .= '<option value="'.$code_iso.'" selected data-html="'.dol_escape_htmltag($labeltoshow).'">';
6336 6336
 			} else {
6337
-				$out .= '<option value="' . $code_iso . '" data-html="' . dol_escape_htmltag($labeltoshow) . '">';
6337
+				$out .= '<option value="'.$code_iso.'" data-html="'.dol_escape_htmltag($labeltoshow).'">';
6338 6338
 			}
6339 6339
 			$out .= $labeltoshow;
6340 6340
 			$out .= '</option>';
@@ -6345,7 +6345,7 @@  discard block
 block discarded – undo
6345 6345
 		}
6346 6346
 
6347 6347
 		// Make select dynamic
6348
-		include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
6348
+		include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
6349 6349
 		$out .= ajax_combobox($htmlname);
6350 6350
 
6351 6351
 		return $out;
@@ -6371,10 +6371,10 @@  discard block
 block discarded – undo
6371 6371
 
6372 6372
 		$TCurrency = array();
6373 6373
 
6374
-		$sql = "SELECT code FROM " . $this->db->prefix() . "multicurrency";
6375
-		$sql .= " WHERE entity IN ('" . getEntity('mutlicurrency') . "')";
6374
+		$sql = "SELECT code FROM ".$this->db->prefix()."multicurrency";
6375
+		$sql .= " WHERE entity IN ('".getEntity('mutlicurrency')."')";
6376 6376
 		if ($filter) {
6377
-			$sql .= " AND " . $filter;
6377
+			$sql .= " AND ".$filter;
6378 6378
 		}
6379 6379
 		$resql = $this->db->query($sql);
6380 6380
 		if ($resql) {
@@ -6384,7 +6384,7 @@  discard block
 block discarded – undo
6384 6384
 		}
6385 6385
 
6386 6386
 		$out = '';
6387
-		$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
6387
+		$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
6388 6388
 		if ($useempty) {
6389 6389
 			$out .= '<option value="">&nbsp;</option>';
6390 6390
 		}
@@ -6396,13 +6396,13 @@  discard block
 block discarded – undo
6396 6396
 			foreach ($langs->cache_currencies as $code_iso => $currency) {
6397 6397
 				if (isset($TCurrency[$code_iso])) {
6398 6398
 					if (!empty($selected) && $selected == $code_iso) {
6399
-						$out .= '<option value="' . $code_iso . '" selected="selected">';
6399
+						$out .= '<option value="'.$code_iso.'" selected="selected">';
6400 6400
 					} else {
6401
-						$out .= '<option value="' . $code_iso . '">';
6401
+						$out .= '<option value="'.$code_iso.'">';
6402 6402
 					}
6403 6403
 
6404 6404
 					$out .= $currency['label'];
6405
-					$out .= ' (' . $langs->getCurrencySymbol($code_iso) . ')';
6405
+					$out .= ' ('.$langs->getCurrencySymbol($code_iso).')';
6406 6406
 					$out .= '</option>';
6407 6407
 				}
6408 6408
 			}
@@ -6411,7 +6411,7 @@  discard block
 block discarded – undo
6411 6411
 		$out .= '</select>';
6412 6412
 
6413 6413
 		// Make select dynamic
6414
-		include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
6414
+		include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
6415 6415
 		$out .= ajax_combobox($htmlname);
6416 6416
 
6417 6417
 		return $out;
@@ -6442,7 +6442,7 @@  discard block
 block discarded – undo
6442 6442
 		$sql .= " WHERE t.fk_pays = c.rowid";
6443 6443
 		$sql .= " AND t.active > 0";
6444 6444
 		$sql .= " AND t.entity IN (".getEntity('c_tva').")";
6445
-		$sql .= " AND c.code IN (" . $this->db->sanitize($country_code, 1) . ")";
6445
+		$sql .= " AND c.code IN (".$this->db->sanitize($country_code, 1).")";
6446 6446
 		$sql .= " ORDER BY t.code ASC, t.taux ASC, t.recuperableonly ASC";
6447 6447
 
6448 6448
 		$resql = $this->db->query($sql);
@@ -6454,30 +6454,30 @@  discard block
 block discarded – undo
6454 6454
 
6455 6455
 					$tmparray = array();
6456 6456
 					$tmparray['rowid']			= $obj->rowid;
6457
-					$tmparray['type_vat']		= $obj->type_vat;
6458
-					$tmparray['code']			= $obj->code;
6457
+					$tmparray['type_vat'] = $obj->type_vat;
6458
+					$tmparray['code'] = $obj->code;
6459 6459
 					$tmparray['txtva']			= $obj->taux;
6460
-					$tmparray['nprtva']			= $obj->recuperableonly;
6460
+					$tmparray['nprtva'] = $obj->recuperableonly;
6461 6461
 					$tmparray['localtax1']	    = $obj->localtax1;
6462 6462
 					$tmparray['localtax1_type']	= $obj->localtax1_type;
6463 6463
 					$tmparray['localtax2']	    = $obj->localtax2;
6464 6464
 					$tmparray['localtax2_type']	= $obj->localtax1_type;
6465
-					$tmparray['label']			= $obj->taux . '%' . ($obj->code ? ' (' . $obj->code . ')' : ''); // Label must contains only 0-9 , . % or *
6466
-					$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
6465
+					$tmparray['label'] = $obj->taux.'%'.($obj->code ? ' ('.$obj->code.')' : ''); // Label must contains only 0-9 , . % or *
6466
+					$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
6467 6467
 					$positiverates = '';
6468 6468
 					if ($obj->taux) {
6469
-						$positiverates .= ($positiverates ? '/' : '') . $obj->taux;
6469
+						$positiverates .= ($positiverates ? '/' : '').$obj->taux;
6470 6470
 					}
6471 6471
 					if ($obj->localtax1) {
6472
-						$positiverates .= ($positiverates ? '/' : '') . $obj->localtax1;
6472
+						$positiverates .= ($positiverates ? '/' : '').$obj->localtax1;
6473 6473
 					}
6474 6474
 					if ($obj->localtax2) {
6475
-						$positiverates .= ($positiverates ? '/' : '') . $obj->localtax2;
6475
+						$positiverates .= ($positiverates ? '/' : '').$obj->localtax2;
6476 6476
 					}
6477 6477
 					if (empty($positiverates)) {
6478 6478
 						$positiverates = '0';
6479 6479
 					}
6480
-					$tmparray['labelpositiverates'] = $positiverates . ($obj->code ? ' (' . $obj->code . ')' : ''); // Must never be used as key, only label
6480
+					$tmparray['labelpositiverates'] = $positiverates.($obj->code ? ' ('.$obj->code.')' : ''); // Must never be used as key, only label
6481 6481
 
6482 6482
 					$this->cache_vatrates[$obj->rowid] = $tmparray;
6483 6483
 				}
@@ -6497,7 +6497,7 @@  discard block
 block discarded – undo
6497 6497
 				return -1;
6498 6498
 			}
6499 6499
 		} else {
6500
-			$this->error = '<span class="error">' . $this->db->error() . '</span>';
6500
+			$this->error = '<span class="error">'.$this->db->error().'</span>';
6501 6501
 			return -2;
6502 6502
 		}
6503 6503
 	}
@@ -6550,9 +6550,9 @@  discard block
 block discarded – undo
6550 6550
 		// Check parameters
6551 6551
 		if (is_object($societe_vendeuse) && !$societe_vendeuse->country_code) {
6552 6552
 			if ($societe_vendeuse->id == $mysoc->id) {
6553
-				$return .= '<span class="error">' . $langs->trans("ErrorYourCountryIsNotDefined") . '</span>';
6553
+				$return .= '<span class="error">'.$langs->trans("ErrorYourCountryIsNotDefined").'</span>';
6554 6554
 			} else {
6555
-				$return .= '<span class="error">' . $langs->trans("ErrorSupplierCountryIsNotDefined") . '</span>';
6555
+				$return .= '<span class="error">'.$langs->trans("ErrorSupplierCountryIsNotDefined").'</span>';
6556 6556
 			}
6557 6557
 			return $return;
6558 6558
 		}
@@ -6564,12 +6564,12 @@  discard block
 block discarded – undo
6564 6564
 		// Define list of countries to use to search VAT rates to show
6565 6565
 		// First we defined code_country to use to find list
6566 6566
 		if (is_object($societe_vendeuse)) {
6567
-			$code_country = "'" . $societe_vendeuse->country_code . "'";
6567
+			$code_country = "'".$societe_vendeuse->country_code."'";
6568 6568
 		} else {
6569
-			$code_country = "'" . $mysoc->country_code . "'"; // Pour compatibilite ascendente
6569
+			$code_country = "'".$mysoc->country_code."'"; // Pour compatibilite ascendente
6570 6570
 		}
6571 6571
 		if (getDolGlobalString('SERVICE_ARE_ECOMMERCE_200238EC')) {    // If option to have vat for end customer for services is on
6572
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
6572
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
6573 6573
 			// If SERVICE_ARE_ECOMMERCE_200238EC=1 combo list vat rate of purchaser and seller countries
6574 6574
 			// If SERVICE_ARE_ECOMMERCE_200238EC=2 combo list only the vat rate of the purchaser country
6575 6575
 			$selectVatComboMode = getDolGlobalString('SERVICE_ARE_ECOMMERCE_200238EC');
@@ -6579,27 +6579,27 @@  discard block
 block discarded – undo
6579 6579
 					if ($type == 1) { // We know product is a service
6580 6580
 						switch ($selectVatComboMode) {
6581 6581
 							case '1':
6582
-								$code_country .= ",'" . $societe_acheteuse->country_code . "'";
6582
+								$code_country .= ",'".$societe_acheteuse->country_code."'";
6583 6583
 								break;
6584 6584
 							case '2':
6585
-								$code_country = "'" . $societe_acheteuse->country_code . "'";
6585
+								$code_country = "'".$societe_acheteuse->country_code."'";
6586 6586
 								break;
6587 6587
 						}
6588 6588
 					}
6589 6589
 				} elseif (!$idprod) {  // We don't know type of product
6590 6590
 					switch ($selectVatComboMode) {
6591 6591
 						case '1':
6592
-							$code_country .= ",'" . $societe_acheteuse->country_code . "'";
6592
+							$code_country .= ",'".$societe_acheteuse->country_code."'";
6593 6593
 							break;
6594 6594
 						case '2':
6595
-							$code_country = "'" . $societe_acheteuse->country_code . "'";
6595
+							$code_country = "'".$societe_acheteuse->country_code."'";
6596 6596
 							break;
6597 6597
 					}
6598 6598
 				} else {
6599 6599
 					$prodstatic = new Product($this->db);
6600 6600
 					$prodstatic->fetch($idprod);
6601 6601
 					if ($prodstatic->type == Product::TYPE_SERVICE) {   // We know product is a service
6602
-						$code_country .= ",'" . $societe_acheteuse->country_code . "'";
6602
+						$code_country .= ",'".$societe_acheteuse->country_code."'";
6603 6603
 					}
6604 6604
 				}
6605 6605
 			}
@@ -6661,13 +6661,13 @@  discard block
 block discarded – undo
6661 6661
 				// Override/enable VAT for expense report regardless of global setting - needed if expense report used for business expenses instead
6662 6662
 				// of using supplier invoices (this is a very bad idea !)
6663 6663
 				if (!getDolGlobalString('EXPENSEREPORT_OVERRIDE_VAT')) {
6664
-					$title = ' title="' . dol_escape_htmltag($langs->trans('VATIsNotUsed')) . '"';
6664
+					$title = ' title="'.dol_escape_htmltag($langs->trans('VATIsNotUsed')).'"';
6665 6665
 					$disabled = true;
6666 6666
 				}
6667 6667
 			}
6668 6668
 
6669 6669
 			if (!$options_only) {
6670
-				$return .= '<select class="flat minwidth75imp maxwidth100 right" id="' . $htmlname . '" name="' . $htmlname . '"' . ($disabled ? ' disabled' : '') . $title . '>';
6670
+				$return .= '<select class="flat minwidth75imp maxwidth100 right" id="'.$htmlname.'" name="'.$htmlname.'"'.($disabled ? ' disabled' : '').$title.'>';
6671 6671
 			}
6672 6672
 
6673 6673
 			$selectedfound = false;
@@ -6681,13 +6681,13 @@  discard block
 block discarded – undo
6681 6681
 				$key = $rate['txtva'];
6682 6682
 				$key .= $rate['nprtva'] ? '*' : '';
6683 6683
 				if ($mode > 0 && $rate['code']) {
6684
-					$key .= ' (' . $rate['code'] . ')';
6684
+					$key .= ' ('.$rate['code'].')';
6685 6685
 				}
6686 6686
 				if ($mode < 0) {
6687 6687
 					$key = $rate['rowid'];
6688 6688
 				}
6689 6689
 
6690
-				$return .= '<option value="' . $key . '"';
6690
+				$return .= '<option value="'.$key.'"';
6691 6691
 				if (!$selectedfound) {
6692 6692
 					if ($defaultcode) { // If defaultcode is defined, we used it in priority to select combo option instead of using rate+npr flag
6693 6693
 						if ($defaultcode == $rate['code']) {
@@ -6758,7 +6758,7 @@  discard block
 block discarded – undo
6758 6758
 	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 = '')
6759 6759
 	{
6760 6760
 		// phpcs:enable
6761
-		dol_syslog(__METHOD__ . ': using select_date is deprecated. Use selectDate instead.', LOG_WARNING);
6761
+		dol_syslog(__METHOD__.': using select_date is deprecated. Use selectDate instead.', LOG_WARNING);
6762 6762
 		$retstring = $this->selectDate($set_time, $prefix, $h, $m, $empty, $form_name, $d, $addnowlink, $disabled, $fullday, $addplusone, $adddateof);
6763 6763
 		if (!empty($nooutput)) {
6764 6764
 			return $retstring;
@@ -6787,11 +6787,11 @@  discard block
 block discarded – undo
6787 6787
 	{
6788 6788
 		global $langs;
6789 6789
 
6790
-		$ret = $this->selectDate($set_time, $prefix . '_start', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("from"), 'tzuserrel');
6790
+		$ret = $this->selectDate($set_time, $prefix.'_start', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("from"), 'tzuserrel');
6791 6791
 		if ($forcenewline) {
6792 6792
 			$ret .= '<br>';
6793 6793
 		}
6794
-		$ret .= $this->selectDate($set_time_end, $prefix . '_end', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"), 'tzuserrel');
6794
+		$ret .= $this->selectDate($set_time_end, $prefix.'_end', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"), 'tzuserrel');
6795 6795
 		return $ret;
6796 6796
 	}
6797 6797
 
@@ -6857,7 +6857,7 @@  discard block
 block discarded – undo
6857 6857
 		$orig_set_time = $set_time;
6858 6858
 
6859 6859
 		if ($set_time === '' && $emptydate == 0) {
6860
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
6860
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
6861 6861
 			if ($gm == 'tzuser' || $gm == 'tzuserrel') {
6862 6862
 				$set_time = dol_now($gm);
6863 6863
 			} else {
@@ -6929,38 +6929,38 @@  discard block
 block discarded – undo
6929 6929
 				// Calendrier popup version eldy
6930 6930
 				if ($usecalendar == "eldy") {
6931 6931
 					// Input area to enter date manually
6932
-					$retstring .= '<input id="' . $prefix . '" name="' . $prefix . '" type="text" class="maxwidthdate" maxlength="11" value="' . $formated_date . '"';
6932
+					$retstring .= '<input id="'.$prefix.'" name="'.$prefix.'" type="text" class="maxwidthdate" maxlength="11" value="'.$formated_date.'"';
6933 6933
 					$retstring .= ($disabled ? ' disabled' : '');
6934
-					$retstring .= ' onChange="dpChangeDay(\'' . $prefix . '\',\'' . $langs->trans("FormatDateShortJavaInput") . '\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript
6934
+					$retstring .= ' onChange="dpChangeDay(\''.$prefix.'\',\''.$langs->trans("FormatDateShortJavaInput").'\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript
6935 6935
 					$retstring .= ' autocomplete="off">';
6936 6936
 
6937 6937
 					// Icon calendar
6938 6938
 					$retstringbuttom = '';
6939 6939
 					if (!$disabled) {
6940
-						$retstringbuttom = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons"';
6941
-						$base = DOL_URL_ROOT . '/core/';
6942
-						$retstringbuttom .= ' onClick="showDP(\'' . $base . '\',\'' . $prefix . '\',\'' . $langs->trans("FormatDateShortJavaInput") . '\',\'' . $langs->defaultlang . '\');"';
6943
-						$retstringbuttom .= '>' . img_object($langs->trans("SelectDate"), 'calendarday', 'class="datecallink"') . '</button>';
6940
+						$retstringbuttom = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons"';
6941
+						$base = DOL_URL_ROOT.'/core/';
6942
+						$retstringbuttom .= ' onClick="showDP(\''.$base.'\',\''.$prefix.'\',\''.$langs->trans("FormatDateShortJavaInput").'\',\''.$langs->defaultlang.'\');"';
6943
+						$retstringbuttom .= '>'.img_object($langs->trans("SelectDate"), 'calendarday', 'class="datecallink"').'</button>';
6944 6944
 					} else {
6945
-						$retstringbuttom = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons">' . img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"') . '</button>';
6945
+						$retstringbuttom = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons">'.img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"').'</button>';
6946 6946
 					}
6947
-					$retstring = $retstringbuttom . $retstring;
6947
+					$retstring = $retstringbuttom.$retstring;
6948 6948
 
6949
-					$retstring .= '<input type="hidden" id="' . $prefix . 'day"   name="' . $prefix . 'day"   value="' . $sday . '">' . "\n";
6950
-					$retstring .= '<input type="hidden" id="' . $prefix . 'month" name="' . $prefix . 'month" value="' . $smonth . '">' . "\n";
6951
-					$retstring .= '<input type="hidden" id="' . $prefix . 'year"  name="' . $prefix . 'year"  value="' . $syear . '">' . "\n";
6949
+					$retstring .= '<input type="hidden" id="'.$prefix.'day"   name="'.$prefix.'day"   value="'.$sday.'">'."\n";
6950
+					$retstring .= '<input type="hidden" id="'.$prefix.'month" name="'.$prefix.'month" value="'.$smonth.'">'."\n";
6951
+					$retstring .= '<input type="hidden" id="'.$prefix.'year"  name="'.$prefix.'year"  value="'.$syear.'">'."\n";
6952 6952
 				} elseif ($usecalendar == 'jquery' || $usecalendar == 'html') {
6953 6953
 					if (!$disabled && $usecalendar != 'html') {
6954 6954
 						// Output javascript for datepicker
6955 6955
 						$minYear = getDolGlobalInt('MIN_YEAR_SELECT_DATE', (idate('Y') - 100));
6956 6956
 						$maxYear = getDolGlobalInt('MAX_YEAR_SELECT_DATE', (idate('Y') + 100));
6957 6957
 
6958
-						$retstring .= '<script nonce="' . getNonce() . '" type="text/javascript">';
6959
-						$retstring .= "$(function(){ $('#" . $prefix . "').datepicker({
6960
-							dateFormat: '" . $langs->trans("FormatDateShortJQueryInput") . "',
6958
+						$retstring .= '<script nonce="'.getNonce().'" type="text/javascript">';
6959
+						$retstring .= "$(function(){ $('#".$prefix."').datepicker({
6960
+							dateFormat: '" . $langs->trans("FormatDateShortJQueryInput")."',
6961 6961
 							autoclose: true,
6962 6962
 							todayHighlight: true,
6963
-							yearRange: '" . $minYear . ":" . $maxYear . "',";
6963
+							yearRange: '" . $minYear.":".$maxYear."',";
6964 6964
 						if (!empty($conf->dol_use_jmobile)) {
6965 6965
 							$retstring .= "
6966 6966
 								beforeShow: function (input, datePicker) {
@@ -6975,7 +6975,7 @@  discard block
 block discarded – undo
6975 6975
 						if (!getDolGlobalString('MAIN_POPUP_CALENDAR_ON_FOCUS')) {
6976 6976
 							$retstring .= "
6977 6977
 								showOn: 'button',	/* both has problem with autocompletion */
6978
-								buttonImage: '" . DOL_URL_ROOT . "/theme/" . dol_escape_js($conf->theme) . "/img/object_calendarday.png',
6978
+								buttonImage: '" . DOL_URL_ROOT."/theme/".dol_escape_js($conf->theme)."/img/object_calendarday.png',
6979 6979
 								buttonImageOnly: true";
6980 6980
 						}
6981 6981
 						$retstring .= "
@@ -6987,46 +6987,46 @@  discard block
 block discarded – undo
6987 6987
 					$retstring .= '<div class="nowraponall inline-block divfordateinput">';
6988 6988
 					$retstring .= '<input id="'.$prefix.'" name="'.$prefix.'" type="text" class="maxwidthdate" maxlength="11" value="'.$formated_date.'"';
6989 6989
 					$retstring .= ($disabled ? ' disabled' : '');
6990
-					$retstring .= ($placeholder ? ' placeholder="' . dol_escape_htmltag($placeholder) . '"' : '');
6991
-					$retstring .= ' onChange="dpChangeDay(\'' . dol_escape_js($prefix) . '\',\'' . dol_escape_js($langs->trans("FormatDateShortJavaInput")) . '\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript
6990
+					$retstring .= ($placeholder ? ' placeholder="'.dol_escape_htmltag($placeholder).'"' : '');
6991
+					$retstring .= ' onChange="dpChangeDay(\''.dol_escape_js($prefix).'\',\''.dol_escape_js($langs->trans("FormatDateShortJavaInput")).'\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript
6992 6992
 					$retstring .= ' autocomplete="off">';
6993 6993
 
6994 6994
 					// Icone calendrier
6995 6995
 					if ($disabled) {
6996
-						$retstringbutton = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons">' . img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"') . '</button>';
6997
-						$retstring = $retstringbutton . $retstring;
6996
+						$retstringbutton = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons">'.img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"').'</button>';
6997
+						$retstring = $retstringbutton.$retstring;
6998 6998
 					}
6999 6999
 
7000 7000
 					$retstring .= '</div>';
7001
-					$retstring .= '<input type="hidden" id="' . $prefix . 'day"   name="' . $prefix . 'day"   value="' . $sday . '">' . "\n";
7002
-					$retstring .= '<input type="hidden" id="' . $prefix . 'month" name="' . $prefix . 'month" value="' . $smonth . '">' . "\n";
7003
-					$retstring .= '<input type="hidden" id="' . $prefix . 'year"  name="' . $prefix . 'year"  value="' . $syear . '">' . "\n";
7001
+					$retstring .= '<input type="hidden" id="'.$prefix.'day"   name="'.$prefix.'day"   value="'.$sday.'">'."\n";
7002
+					$retstring .= '<input type="hidden" id="'.$prefix.'month" name="'.$prefix.'month" value="'.$smonth.'">'."\n";
7003
+					$retstring .= '<input type="hidden" id="'.$prefix.'year"  name="'.$prefix.'year"  value="'.$syear.'">'."\n";
7004 7004
 				} else {
7005 7005
 					$retstring .= "Bad value of MAIN_POPUP_CALENDAR";
7006 7006
 				}
7007 7007
 			} else {
7008 7008
 				// Show date with combo selects
7009 7009
 				// Day
7010
-				$retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth50imp" id="' . $prefix . 'day" name="' . $prefix . 'day">';
7010
+				$retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50imp" id="'.$prefix.'day" name="'.$prefix.'day">';
7011 7011
 
7012 7012
 				if ($emptydate || $set_time == -1) {
7013 7013
 					$retstring .= '<option value="0" selected>&nbsp;</option>';
7014 7014
 				}
7015 7015
 
7016 7016
 				for ($day = 1; $day <= 31; $day++) {
7017
-					$retstring .= '<option value="' . $day . '"' . ($day == $sday ? ' selected' : '') . '>' . $day . '</option>';
7017
+					$retstring .= '<option value="'.$day.'"'.($day == $sday ? ' selected' : '').'>'.$day.'</option>';
7018 7018
 				}
7019 7019
 
7020 7020
 				$retstring .= "</select>";
7021 7021
 
7022
-				$retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth75imp" id="' . $prefix . 'month" name="' . $prefix . 'month">';
7022
+				$retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth75imp" id="'.$prefix.'month" name="'.$prefix.'month">';
7023 7023
 				if ($emptydate || $set_time == -1) {
7024 7024
 					$retstring .= '<option value="0" selected>&nbsp;</option>';
7025 7025
 				}
7026 7026
 
7027 7027
 				// Month
7028 7028
 				for ($month = 1; $month <= 12; $month++) {
7029
-					$retstring .= '<option value="' . $month . '"' . ($month == $smonth ? ' selected' : '') . '>';
7029
+					$retstring .= '<option value="'.$month.'"'.($month == $smonth ? ' selected' : '').'>';
7030 7030
 					$retstring .= dol_print_date(mktime(12, 0, 0, $month, 1, 2000), "%b");
7031 7031
 					$retstring .= "</option>";
7032 7032
 				}
@@ -7034,13 +7034,13 @@  discard block
 block discarded – undo
7034 7034
 
7035 7035
 				// Year
7036 7036
 				if ($emptydate || $set_time == -1) {
7037
-					$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 . '">';
7037
+					$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.'">';
7038 7038
 				} else {
7039
-					$retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth75imp" id="' . $prefix . 'year" name="' . $prefix . 'year">';
7039
+					$retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth75imp" id="'.$prefix.'year" name="'.$prefix.'year">';
7040 7040
 
7041 7041
 					$syear = (int) $syear;
7042 7042
 					for ($year = $syear - 10; $year < (int) $syear + 10; $year++) {
7043
-						$retstring .= '<option value="' . $year . '"' . ($year == $syear ? ' selected' : '') . '>' . $year . '</option>';
7043
+						$retstring .= '<option value="'.$year.'"'.($year == $syear ? ' selected' : '').'>'.$year.'</option>';
7044 7044
 					}
7045 7045
 					$retstring .= "</select>\n";
7046 7046
 				}
@@ -7064,15 +7064,15 @@  discard block
 block discarded – undo
7064 7064
 				}
7065 7065
 			}
7066 7066
 			// Show hour
7067
-			$retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth50 ' . ($fullday ? $fullday . 'hour' : '') . '" id="' . $prefix . 'hour" name="' . $prefix . 'hour">';
7067
+			$retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50 '.($fullday ? $fullday.'hour' : '').'" id="'.$prefix.'hour" name="'.$prefix.'hour">';
7068 7068
 			if ($emptyhours) {
7069 7069
 				$retstring .= '<option value="-1">&nbsp;</option>';
7070 7070
 			}
7071 7071
 			for ($hour = $hourstart; $hour < $hourend; $hour++) {
7072 7072
 				if (strlen($hour) < 2) {
7073
-					$hour = "0" . $hour;
7073
+					$hour = "0".$hour;
7074 7074
 				}
7075
-				$retstring .= '<option value="' . $hour . '"' . (($hour == $shour) ? ' selected' : '') . '>' . $hour;
7075
+				$retstring .= '<option value="'.$hour.'"'.(($hour == $shour) ? ' selected' : '').'>'.$hour;
7076 7076
 				//$retstring .= (empty($conf->dol_optimize_smallscreen) ? '' : 'H');
7077 7077
 				$retstring .= '</option>';
7078 7078
 			}
@@ -7085,17 +7085,17 @@  discard block
 block discarded – undo
7085 7085
 
7086 7086
 		if ($m) {
7087 7087
 			// Show minutes
7088
-			$retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth50 ' . ($fullday ? $fullday . 'min' : '') . '" id="' . $prefix . 'min" name="' . $prefix . 'min">';
7088
+			$retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50 '.($fullday ? $fullday.'min' : '').'" id="'.$prefix.'min" name="'.$prefix.'min">';
7089 7089
 			if ($emptyhours) {
7090 7090
 				$retstring .= '<option value="-1">&nbsp;</option>';
7091 7091
 			}
7092 7092
 			for ($min = 0; $min < 60; $min += $stepminutes) {
7093 7093
 				$min_str = sprintf("%02d", $min);
7094
-				$retstring .= '<option value="' . $min_str . '"' . (($min_str == $smin) ? ' selected' : '') . '>' . $min_str . '</option>';
7094
+				$retstring .= '<option value="'.$min_str.'"'.(($min_str == $smin) ? ' selected' : '').'>'.$min_str.'</option>';
7095 7095
 			}
7096 7096
 			$retstring .= '</select>';
7097 7097
 
7098
-			$retstring .= '<input type="hidden" name="' . $prefix . 'sec" value="' . $ssec . '">';
7098
+			$retstring .= '<input type="hidden" name="'.$prefix.'sec" value="'.$ssec.'">';
7099 7099
 		}
7100 7100
 
7101 7101
 		if ($d && $h) {
@@ -7118,10 +7118,10 @@  discard block
 block discarded – undo
7118 7118
 
7119 7119
 			// Generate the date part, depending on the use or not of the javascript calendar
7120 7120
 			if ($addnowlink == 1) { // server time expressed in user time setup
7121
-				$reset_scripts .= 'jQuery(\'#' . $prefix . '\').val(\'' . dol_print_date($nowgmt, 'day', 'tzuserrel') . '\');';
7122
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'day\').val(\'' . dol_print_date($nowgmt, '%d', 'tzuserrel') . '\');';
7123
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'month\').val(\'' . dol_print_date($nowgmt, '%m', 'tzuserrel') . '\');';
7124
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'year\').val(\'' . dol_print_date($nowgmt, '%Y', 'tzuserrel') . '\');';
7121
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'day', 'tzuserrel').'\');';
7122
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');';
7123
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');';
7124
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');';
7125 7125
 			} elseif ($addnowlink == 2) {
7126 7126
 				/* Disabled because the output does not use the string format defined by FormatDateShort key to forge the value into #prefix.
7127 7127
 				 * This break application for foreign languages.
@@ -7130,10 +7130,10 @@  discard block
 block discarded – undo
7130 7130
 				$reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(parseInt(d.getMonth().pad()) + 1);';
7131 7131
 				$reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(d.getFullYear());';
7132 7132
 				*/
7133
-				$reset_scripts .= 'jQuery(\'#' . $prefix . '\').val(\'' . dol_print_date($nowgmt, 'day', 'tzuserrel') . '\');';
7134
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'day\').val(\'' . dol_print_date($nowgmt, '%d', 'tzuserrel') . '\');';
7135
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'month\').val(\'' . dol_print_date($nowgmt, '%m', 'tzuserrel') . '\');';
7136
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'year\').val(\'' . dol_print_date($nowgmt, '%Y', 'tzuserrel') . '\');';
7133
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'day', 'tzuserrel').'\');';
7134
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');';
7135
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');';
7136
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');';
7137 7137
 			}
7138 7138
 			/*if ($usecalendar == "eldy")
7139 7139
 			{
@@ -7153,11 +7153,11 @@  discard block
 block discarded – undo
7153 7153
 				}
7154 7154
 				//$reset_scripts .= 'this.form.elements[\''.$prefix.'hour\'].value=formatDate(new Date(), \'HH\'); ';
7155 7155
 				if ($addnowlink == 1) {
7156
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').val(\'' . dol_print_date($nowgmt, '%H', 'tzuserrel') . '\');';
7157
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').change();';
7156
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(\''.dol_print_date($nowgmt, '%H', 'tzuserrel').'\');';
7157
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').change();';
7158 7158
 				} elseif ($addnowlink == 2) {
7159
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').val(d.getHours().pad());';
7160
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').change();';
7159
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(d.getHours().pad());';
7160
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').change();';
7161 7161
 				}
7162 7162
 
7163 7163
 				if ($fullday) {
@@ -7171,11 +7171,11 @@  discard block
 block discarded – undo
7171 7171
 				}
7172 7172
 				//$reset_scripts .= 'this.form.elements[\''.$prefix.'min\'].value=formatDate(new Date(), \'mm\'); ';
7173 7173
 				if ($addnowlink == 1) {
7174
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').val(\'' . dol_print_date($nowgmt, '%M', 'tzuserrel') . '\');';
7175
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').change();';
7174
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(\''.dol_print_date($nowgmt, '%M', 'tzuserrel').'\');';
7175
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').change();';
7176 7176
 				} elseif ($addnowlink == 2) {
7177
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').val(d.getMinutes().pad());';
7178
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').change();';
7177
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(d.getMinutes().pad());';
7178
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').change();';
7179 7179
 				}
7180 7180
 				if ($fullday) {
7181 7181
 					$reset_scripts .= ' } ';
@@ -7183,7 +7183,7 @@  discard block
 block discarded – undo
7183 7183
 			}
7184 7184
 			// If reset_scripts is not empty, print the link with the reset_scripts in the onClick
7185 7185
 			if ($reset_scripts && !getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
7186
-				$retstring .= ' <button class="dpInvisibleButtons datenowlink" id="' . $prefix . 'ButtonNow" type="button" name="_useless" value="now" onClick="' . $reset_scripts . '">';
7186
+				$retstring .= ' <button class="dpInvisibleButtons datenowlink" id="'.$prefix.'ButtonNow" type="button" name="_useless" value="now" onClick="'.$reset_scripts.'">';
7187 7187
 				$retstring .= $langs->trans("Now");
7188 7188
 				$retstring .= '</button> ';
7189 7189
 			}
@@ -7195,16 +7195,16 @@  discard block
 block discarded – undo
7195 7195
 			$reset_scripts = "";
7196 7196
 
7197 7197
 			// Generate the date part, depending on the use or not of the javascript calendar
7198
-			$reset_scripts .= 'jQuery(\'#' . $prefix . '\').val(\'' . dol_print_date($nowgmt, 'dayinputnoreduce', 'tzuserrel') . '\');';
7199
-			$reset_scripts .= 'jQuery(\'#' . $prefix . 'day\').val(\'' . dol_print_date($nowgmt, '%d', 'tzuserrel') . '\');';
7200
-			$reset_scripts .= 'jQuery(\'#' . $prefix . 'month\').val(\'' . dol_print_date($nowgmt, '%m', 'tzuserrel') . '\');';
7201
-			$reset_scripts .= 'jQuery(\'#' . $prefix . 'year\').val(\'' . dol_print_date($nowgmt, '%Y', 'tzuserrel') . '\');';
7198
+			$reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'dayinputnoreduce', 'tzuserrel').'\');';
7199
+			$reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');';
7200
+			$reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');';
7201
+			$reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');';
7202 7202
 			// Update the hour part
7203 7203
 			if ($h) {
7204 7204
 				if ($fullday) {
7205 7205
 					$reset_scripts .= " if (jQuery('#fullday:checked').val() == null) {";
7206 7206
 				}
7207
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').val(\'' . dol_print_date($nowgmt, '%H', 'tzuserrel') . '\');';
7207
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(\''.dol_print_date($nowgmt, '%H', 'tzuserrel').'\');';
7208 7208
 				if ($fullday) {
7209 7209
 					$reset_scripts .= ' } ';
7210 7210
 				}
@@ -7214,14 +7214,14 @@  discard block
 block discarded – undo
7214 7214
 				if ($fullday) {
7215 7215
 					$reset_scripts .= " if (jQuery('#fullday:checked').val() == null) {";
7216 7216
 				}
7217
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').val(\'' . dol_print_date($nowgmt, '%M', 'tzuserrel') . '\');';
7217
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(\''.dol_print_date($nowgmt, '%M', 'tzuserrel').'\');';
7218 7218
 				if ($fullday) {
7219 7219
 					$reset_scripts .= ' } ';
7220 7220
 				}
7221 7221
 			}
7222 7222
 			// If reset_scripts is not empty, print the link with the reset_scripts in the onClick
7223 7223
 			if ($reset_scripts && empty($conf->dol_optimize_smallscreen)) {
7224
-				$retstring .= ' <button class="dpInvisibleButtons datenowlink" id="' . $prefix . 'ButtonPlusOne" type="button" name="_useless2" value="plusone" onClick="' . $reset_scripts . '">';
7224
+				$retstring .= ' <button class="dpInvisibleButtons datenowlink" id="'.$prefix.'ButtonPlusOne" type="button" name="_useless2" value="plusone" onClick="'.$reset_scripts.'">';
7225 7225
 				$retstring .= $langs->trans("DateStartPlusOne");
7226 7226
 				$retstring .= '</button> ';
7227 7227
 			}
@@ -7279,17 +7279,17 @@  discard block
 block discarded – undo
7279 7279
 			unset($TDurationTypes[$value]);
7280 7280
 		}
7281 7281
 
7282
-		$retstring = '<select class="flat minwidth75 maxwidth100" id="select_' . $prefix . 'type_duration" name="' . $prefix . 'type_duration">';
7282
+		$retstring = '<select class="flat minwidth75 maxwidth100" id="select_'.$prefix.'type_duration" name="'.$prefix.'type_duration">';
7283 7283
 		foreach ($TDurationTypes as $key => $typeduration) {
7284
-			$retstring .= '<option value="' . $key . '"';
7284
+			$retstring .= '<option value="'.$key.'"';
7285 7285
 			if ($key == $selected) {
7286 7286
 				$retstring .= " selected";
7287 7287
 			}
7288
-			$retstring .= ">" . $typeduration . "</option>";
7288
+			$retstring .= ">".$typeduration."</option>";
7289 7289
 		}
7290 7290
 		$retstring .= "</select>";
7291 7291
 
7292
-		$retstring .= ajax_combobox('select_' . $prefix . 'type_duration');
7292
+		$retstring .= ajax_combobox('select_'.$prefix.'type_duration');
7293 7293
 
7294 7294
 		return $retstring;
7295 7295
 	}
@@ -7321,30 +7321,30 @@  discard block
 block discarded – undo
7321 7321
 
7322 7322
 		// Hours
7323 7323
 		if ($iSecond != '') {
7324
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
7324
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
7325 7325
 
7326 7326
 			$hourSelected = convertSecondToTime($iSecond, 'allhour');
7327 7327
 			$minSelected = convertSecondToTime($iSecond, 'min');
7328 7328
 		}
7329 7329
 
7330 7330
 		if ($typehour == 'select') {
7331
-			$retstring .= '<select class="flat" id="select_' . $prefix . 'hour" name="' . $prefix . 'hour"' . ($disabled ? ' disabled' : '') . '>';
7331
+			$retstring .= '<select class="flat" id="select_'.$prefix.'hour" name="'.$prefix.'hour"'.($disabled ? ' disabled' : '').'>';
7332 7332
 			for ($hour = 0; $hour < 25; $hour++) {    // For a duration, we allow 24 hours
7333
-				$retstring .= '<option value="' . $hour . '"';
7333
+				$retstring .= '<option value="'.$hour.'"';
7334 7334
 				if (is_numeric($hourSelected) && $hourSelected == $hour) {
7335 7335
 					$retstring .= " selected";
7336 7336
 				}
7337
-				$retstring .= ">" . $hour . "</option>";
7337
+				$retstring .= ">".$hour."</option>";
7338 7338
 			}
7339 7339
 			$retstring .= "</select>";
7340 7340
 		} elseif ($typehour == 'text' || $typehour == 'textselect') {
7341
-			$retstring .= '<input placeholder="' . $langs->trans('HourShort') . '" type="number" min="0" name="' . $prefix . 'hour"' . ($disabled ? ' disabled' : '') . ' class="flat maxwidth50 inputhour right" value="' . (($hourSelected != '') ? ((int) $hourSelected) : '') . '">';
7341
+			$retstring .= '<input placeholder="'.$langs->trans('HourShort').'" type="number" min="0" name="'.$prefix.'hour"'.($disabled ? ' disabled' : '').' class="flat maxwidth50 inputhour right" value="'.(($hourSelected != '') ? ((int) $hourSelected) : '').'">';
7342 7342
 		} else {
7343 7343
 			return 'BadValueForParameterTypeHour';
7344 7344
 		}
7345 7345
 
7346 7346
 		if ($typehour != 'text') {
7347
-			$retstring .= ' ' . $langs->trans('HourShort');
7347
+			$retstring .= ' '.$langs->trans('HourShort');
7348 7348
 		} else {
7349 7349
 			$retstring .= '<span class="">:</span>';
7350 7350
 		}
@@ -7359,21 +7359,21 @@  discard block
 block discarded – undo
7359 7359
 		}
7360 7360
 
7361 7361
 		if ($typehour == 'select' || $typehour == 'textselect') {
7362
-			$retstring .= '<select class="flat" id="select_' . $prefix . 'min" name="' . $prefix . 'min"' . ($disabled ? ' disabled' : '') . '>';
7362
+			$retstring .= '<select class="flat" id="select_'.$prefix.'min" name="'.$prefix.'min"'.($disabled ? ' disabled' : '').'>';
7363 7363
 			for ($min = 0; $min <= 55; $min += 5) {
7364
-				$retstring .= '<option value="' . $min . '"';
7364
+				$retstring .= '<option value="'.$min.'"';
7365 7365
 				if (is_numeric($minSelected) && $minSelected == $min) {
7366 7366
 					$retstring .= ' selected';
7367 7367
 				}
7368
-				$retstring .= '>' . $min . '</option>';
7368
+				$retstring .= '>'.$min.'</option>';
7369 7369
 			}
7370 7370
 			$retstring .= "</select>";
7371 7371
 		} elseif ($typehour == 'text') {
7372
-			$retstring .= '<input placeholder="' . $langs->trans('MinuteShort') . '" type="number" min="0" name="' . $prefix . 'min"' . ($disabled ? ' disabled' : '') . ' class="flat maxwidth50 inputminute right" value="' . (($minSelected != '') ? ((int) $minSelected) : '') . '">';
7372
+			$retstring .= '<input placeholder="'.$langs->trans('MinuteShort').'" type="number" min="0" name="'.$prefix.'min"'.($disabled ? ' disabled' : '').' class="flat maxwidth50 inputminute right" value="'.(($minSelected != '') ? ((int) $minSelected) : '').'">';
7373 7373
 		}
7374 7374
 
7375 7375
 		if ($typehour != 'text') {
7376
-			$retstring .= ' ' . $langs->trans('MinuteShort');
7376
+			$retstring .= ' '.$langs->trans('MinuteShort');
7377 7377
 		}
7378 7378
 
7379 7379
 		$retstring .= "</span>";
@@ -7421,7 +7421,7 @@  discard block
 block discarded – undo
7421 7421
 			$placeholder = '';
7422 7422
 
7423 7423
 			if ($selected && empty($selected_input_value)) {
7424
-				require_once DOL_DOCUMENT_ROOT . '/ticket/class/ticket.class.php';
7424
+				require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php';
7425 7425
 				$tickettmpselect = new Ticket($this->db);
7426 7426
 				$tickettmpselect->fetch($selected);
7427 7427
 				$selected_input_value = $tickettmpselect->ref;
@@ -7429,17 +7429,17 @@  discard block
 block discarded – undo
7429 7429
 			}
7430 7430
 
7431 7431
 			$urloption = '';
7432
-			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/ticket/ajax/tickets.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
7432
+			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/ticket/ajax/tickets.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
7433 7433
 
7434 7434
 			if (empty($hidelabel)) {
7435
-				$out .= $langs->trans("RefOrLabel") . ' : ';
7435
+				$out .= $langs->trans("RefOrLabel").' : ';
7436 7436
 			} elseif ($hidelabel > 1) {
7437
-				$placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"';
7437
+				$placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"';
7438 7438
 				if ($hidelabel == 2) {
7439 7439
 					$out .= img_picto($langs->trans("Search"), 'search');
7440 7440
 				}
7441 7441
 			}
7442
-			$out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />';
7442
+			$out .= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />';
7443 7443
 			if ($hidelabel == 3) {
7444 7444
 				$out .= img_picto($langs->trans("Search"), 'search');
7445 7445
 			}
@@ -7483,8 +7483,8 @@  discard block
 block discarded – undo
7483 7483
 
7484 7484
 		$sql = "SELECT ";
7485 7485
 		$sql .= $selectFields;
7486
-		$sql .= " FROM " . $this->db->prefix() . "ticket as p";
7487
-		$sql .= ' WHERE p.entity IN (' . getEntity('ticket') . ')';
7486
+		$sql .= " FROM ".$this->db->prefix()."ticket as p";
7487
+		$sql .= ' WHERE p.entity IN ('.getEntity('ticket').')';
7488 7488
 
7489 7489
 		// Add criteria on ref/label
7490 7490
 		if ($filterkey != '') {
@@ -7500,7 +7500,7 @@  discard block
 block discarded – undo
7500 7500
 				if ($i > 0) {
7501 7501
 					$sql .= " AND ";
7502 7502
 				}
7503
-				$sql .= "(p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%' OR p.subject LIKE '" . $this->db->escape($prefix . $crit) . "%'";
7503
+				$sql .= "(p.ref LIKE '".$this->db->escape($prefix.$crit)."%' OR p.subject LIKE '".$this->db->escape($prefix.$crit)."%'";
7504 7504
 				$sql .= ")";
7505 7505
 				$i++;
7506 7506
 			}
@@ -7513,22 +7513,22 @@  discard block
 block discarded – undo
7513 7513
 		$sql .= $this->db->plimit($limit, 0);
7514 7514
 
7515 7515
 		// Build output string
7516
-		dol_syslog(get_class($this) . "::selectTicketsList search tickets", LOG_DEBUG);
7516
+		dol_syslog(get_class($this)."::selectTicketsList search tickets", LOG_DEBUG);
7517 7517
 		$result = $this->db->query($sql);
7518 7518
 		if ($result) {
7519
-			require_once DOL_DOCUMENT_ROOT . '/ticket/class/ticket.class.php';
7520
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/ticket.lib.php';
7519
+			require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php';
7520
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/ticket.lib.php';
7521 7521
 
7522 7522
 			$num = $this->db->num_rows($result);
7523 7523
 
7524 7524
 			$events = array();
7525 7525
 
7526 7526
 			if (!$forcecombo) {
7527
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
7527
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
7528 7528
 				$out .= ajax_combobox($htmlname, $events, $conf->global->TICKET_USE_SEARCH_TO_SELECT);
7529 7529
 			}
7530 7530
 
7531
-			$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
7531
+			$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
7532 7532
 
7533 7533
 			$textifempty = '';
7534 7534
 			// Do not use textifempty = ' ' or '&nbsp;' here, or search on key will search on ' key'.
@@ -7545,7 +7545,7 @@  discard block
 block discarded – undo
7545 7545
 				}
7546 7546
 			}
7547 7547
 			if ($showempty) {
7548
-				$out .= '<option value="0" selected>' . $textifempty . '</option>';
7548
+				$out .= '<option value="0" selected>'.$textifempty.'</option>';
7549 7549
 			}
7550 7550
 
7551 7551
 			$i = 0;
@@ -7600,13 +7600,13 @@  discard block
 block discarded – undo
7600 7600
 		$outref = $objp->ref;
7601 7601
 		$outtype = $objp->fk_product_type;
7602 7602
 
7603
-		$opt = '<option value="' . $objp->rowid . '"';
7603
+		$opt = '<option value="'.$objp->rowid.'"';
7604 7604
 		$opt .= ($objp->rowid == $selected) ? ' selected' : '';
7605 7605
 		$opt .= '>';
7606 7606
 		$opt .= $objp->ref;
7607 7607
 		$objRef = $objp->ref;
7608 7608
 		if (!empty($filterkey) && $filterkey != '') {
7609
-			$objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1);
7609
+			$objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1);
7610 7610
 		}
7611 7611
 
7612 7612
 		$opt .= "</option>\n";
@@ -7647,7 +7647,7 @@  discard block
 block discarded – undo
7647 7647
 			$placeholder = '';
7648 7648
 
7649 7649
 			if ($selected && empty($selected_input_value)) {
7650
-				require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
7650
+				require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
7651 7651
 				$projecttmpselect = new Project($this->db);
7652 7652
 				$projecttmpselect->fetch($selected);
7653 7653
 				$selected_input_value = $projecttmpselect->ref;
@@ -7655,17 +7655,17 @@  discard block
 block discarded – undo
7655 7655
 			}
7656 7656
 
7657 7657
 			$urloption = '';
7658
-			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/projet/ajax/projects.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
7658
+			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/projet/ajax/projects.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
7659 7659
 
7660 7660
 			if (empty($hidelabel)) {
7661
-				$out .= $langs->trans("RefOrLabel") . ' : ';
7661
+				$out .= $langs->trans("RefOrLabel").' : ';
7662 7662
 			} elseif ($hidelabel > 1) {
7663
-				$placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"';
7663
+				$placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"';
7664 7664
 				if ($hidelabel == 2) {
7665 7665
 					$out .= img_picto($langs->trans("Search"), 'search');
7666 7666
 				}
7667 7667
 			}
7668
-			$out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />';
7668
+			$out .= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />';
7669 7669
 			if ($hidelabel == 3) {
7670 7670
 				$out .= img_picto($langs->trans("Search"), 'search');
7671 7671
 			}
@@ -7708,8 +7708,8 @@  discard block
 block discarded – undo
7708 7708
 
7709 7709
 		$sql = "SELECT ";
7710 7710
 		$sql .= $selectFields;
7711
-		$sql .= " FROM " . $this->db->prefix() . "projet as p";
7712
-		$sql .= ' WHERE p.entity IN (' . getEntity('project') . ')';
7711
+		$sql .= " FROM ".$this->db->prefix()."projet as p";
7712
+		$sql .= ' WHERE p.entity IN ('.getEntity('project').')';
7713 7713
 
7714 7714
 		// Add criteria on ref/label
7715 7715
 		if ($filterkey != '') {
@@ -7725,7 +7725,7 @@  discard block
 block discarded – undo
7725 7725
 				if ($i > 0) {
7726 7726
 					$sql .= " AND ";
7727 7727
 				}
7728
-				$sql .= "p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%'";
7728
+				$sql .= "p.ref LIKE '".$this->db->escape($prefix.$crit)."%'";
7729 7729
 				$sql .= "";
7730 7730
 				$i++;
7731 7731
 			}
@@ -7738,22 +7738,22 @@  discard block
 block discarded – undo
7738 7738
 		$sql .= $this->db->plimit($limit, 0);
7739 7739
 
7740 7740
 		// Build output string
7741
-		dol_syslog(get_class($this) . "::selectProjectsList search projects", LOG_DEBUG);
7741
+		dol_syslog(get_class($this)."::selectProjectsList search projects", LOG_DEBUG);
7742 7742
 		$result = $this->db->query($sql);
7743 7743
 		if ($result) {
7744
-			require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
7745
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php';
7744
+			require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
7745
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
7746 7746
 
7747 7747
 			$num = $this->db->num_rows($result);
7748 7748
 
7749 7749
 			$events = array();
7750 7750
 
7751 7751
 			if (!$forcecombo) {
7752
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
7752
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
7753 7753
 				$out .= ajax_combobox($htmlname, $events, $conf->global->PROJECT_USE_SEARCH_TO_SELECT);
7754 7754
 			}
7755 7755
 
7756
-			$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
7756
+			$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
7757 7757
 
7758 7758
 			$textifempty = '';
7759 7759
 			// Do not use textifempty = ' ' or '&nbsp;' here, or search on key will search on ' key'.
@@ -7770,7 +7770,7 @@  discard block
 block discarded – undo
7770 7770
 				}
7771 7771
 			}
7772 7772
 			if ($showempty) {
7773
-				$out .= '<option value="0" selected>' . $textifempty . '</option>';
7773
+				$out .= '<option value="0" selected>'.$textifempty.'</option>';
7774 7774
 			}
7775 7775
 
7776 7776
 			$i = 0;
@@ -7828,13 +7828,13 @@  discard block
 block discarded – undo
7828 7828
 		$outlabel = $objp->label;
7829 7829
 		$outtype = $objp->fk_product_type;
7830 7830
 
7831
-		$opt = '<option value="' . $objp->rowid . '"';
7831
+		$opt = '<option value="'.$objp->rowid.'"';
7832 7832
 		$opt .= ($objp->rowid == $selected) ? ' selected' : '';
7833 7833
 		$opt .= '>';
7834 7834
 		$opt .= $objp->ref;
7835 7835
 		$objRef = $objp->ref;
7836 7836
 		if (!empty($filterkey) && $filterkey != '') {
7837
-			$objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1);
7837
+			$objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1);
7838 7838
 		}
7839 7839
 
7840 7840
 		$opt .= "</option>\n";
@@ -7876,7 +7876,7 @@  discard block
 block discarded – undo
7876 7876
 			$placeholder = '';
7877 7877
 
7878 7878
 			if ($selected && empty($selected_input_value)) {
7879
-				require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php';
7879
+				require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
7880 7880
 				$adherenttmpselect = new Adherent($this->db);
7881 7881
 				$adherenttmpselect->fetch($selected);
7882 7882
 				$selected_input_value = $adherenttmpselect->ref;
@@ -7885,17 +7885,17 @@  discard block
 block discarded – undo
7885 7885
 
7886 7886
 			$urloption = '';
7887 7887
 
7888
-			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/adherents/ajax/adherents.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
7888
+			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/adherents/ajax/adherents.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
7889 7889
 
7890 7890
 			if (empty($hidelabel)) {
7891
-				$out .= $langs->trans("RefOrLabel") . ' : ';
7891
+				$out .= $langs->trans("RefOrLabel").' : ';
7892 7892
 			} elseif ($hidelabel > 1) {
7893
-				$placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"';
7893
+				$placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"';
7894 7894
 				if ($hidelabel == 2) {
7895 7895
 					$out .= img_picto($langs->trans("Search"), 'search');
7896 7896
 				}
7897 7897
 			}
7898
-			$out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />';
7898
+			$out .= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />';
7899 7899
 			if ($hidelabel == 3) {
7900 7900
 				$out .= img_picto($langs->trans("Search"), 'search');
7901 7901
 			}
@@ -7940,8 +7940,8 @@  discard block
 block discarded – undo
7940 7940
 
7941 7941
 		$sql = "SELECT ";
7942 7942
 		$sql .= $selectFields;
7943
-		$sql .= " FROM " . $this->db->prefix() . "adherent as p";
7944
-		$sql .= ' WHERE p.entity IN (' . getEntity('adherent') . ')';
7943
+		$sql .= " FROM ".$this->db->prefix()."adherent as p";
7944
+		$sql .= ' WHERE p.entity IN ('.getEntity('adherent').')';
7945 7945
 
7946 7946
 		// Add criteria on ref/label
7947 7947
 		if ($filterkey != '') {
@@ -7957,8 +7957,8 @@  discard block
 block discarded – undo
7957 7957
 				if ($i > 0) {
7958 7958
 					$sql .= " AND ";
7959 7959
 				}
7960
-				$sql .= "(p.firstname LIKE '" . $this->db->escape($prefix . $crit) . "%'";
7961
-				$sql .= " OR p.lastname LIKE '" . $this->db->escape($prefix . $crit) . "%')";
7960
+				$sql .= "(p.firstname LIKE '".$this->db->escape($prefix.$crit)."%'";
7961
+				$sql .= " OR p.lastname LIKE '".$this->db->escape($prefix.$crit)."%')";
7962 7962
 				$i++;
7963 7963
 			}
7964 7964
 			if (count($search_crit) > 1) {
@@ -7967,27 +7967,27 @@  discard block
 block discarded – undo
7967 7967
 			$sql .= ')';
7968 7968
 		}
7969 7969
 		if ($status != -1) {
7970
-			$sql .= ' AND statut = ' . ((int) $status);
7970
+			$sql .= ' AND statut = '.((int) $status);
7971 7971
 		}
7972 7972
 		$sql .= $this->db->plimit($limit, 0);
7973 7973
 
7974 7974
 		// Build output string
7975
-		dol_syslog(get_class($this) . "::selectMembersList search adherents", LOG_DEBUG);
7975
+		dol_syslog(get_class($this)."::selectMembersList search adherents", LOG_DEBUG);
7976 7976
 		$result = $this->db->query($sql);
7977 7977
 		if ($result) {
7978
-			require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php';
7979
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/member.lib.php';
7978
+			require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
7979
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
7980 7980
 
7981 7981
 			$num = $this->db->num_rows($result);
7982 7982
 
7983 7983
 			$events = array();
7984 7984
 
7985 7985
 			if (!$forcecombo) {
7986
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
7986
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
7987 7987
 				$out .= ajax_combobox($htmlname, $events, getDolGlobalString('PROJECT_USE_SEARCH_TO_SELECT') ? $conf->global->PROJECT_USE_SEARCH_TO_SELECT : '');
7988 7988
 			}
7989 7989
 
7990
-			$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
7990
+			$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
7991 7991
 
7992 7992
 			$textifempty = '';
7993 7993
 			// Do not use textifempty = ' ' or '&nbsp;' here, or search on key will search on ' key'.
@@ -8004,7 +8004,7 @@  discard block
 block discarded – undo
8004 8004
 				}
8005 8005
 			}
8006 8006
 			if ($showempty) {
8007
-				$out .= '<option value="-1" selected>' . $textifempty . '</option>';
8007
+				$out .= '<option value="-1" selected>'.$textifempty.'</option>';
8008 8008
 			}
8009 8009
 
8010 8010
 			$i = 0;
@@ -8060,11 +8060,11 @@  discard block
 block discarded – undo
8060 8060
 		$outlabel = dolGetFirstLastname($objp->firstname, $objp->lastname);
8061 8061
 		$outtype = $objp->fk_adherent_type;
8062 8062
 
8063
-		$opt = '<option value="' . $objp->rowid . '"';
8063
+		$opt = '<option value="'.$objp->rowid.'"';
8064 8064
 		$opt .= ($objp->rowid == $selected) ? ' selected' : '';
8065 8065
 		$opt .= '>';
8066 8066
 		if (!empty($filterkey) && $filterkey != '') {
8067
-			$outlabel = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $outlabel, 1);
8067
+			$outlabel = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $outlabel, 1);
8068 8068
 		}
8069 8069
 		$opt .= $outlabel;
8070 8070
 		$opt .= "</option>\n";
@@ -8099,8 +8099,8 @@  discard block
 block discarded – undo
8099 8099
 		$objectdescorig = $objectdesc;
8100 8100
 		$objecttmp = null;
8101 8101
 		$InfoFieldList = array();
8102
-		$filter = '';  // Ensure filter has value (for static analysis)
8103
-		$sortfield = '';  // Ensure filter has value (for static analysis)
8102
+		$filter = ''; // Ensure filter has value (for static analysis)
8103
+		$sortfield = ''; // Ensure filter has value (for static analysis)
8104 8104
 
8105 8105
 		if ($objectfield) {	// We must retrieve the objectdesc from the field or extrafield
8106 8106
 			// Example: $objectfield = 'product:options_package'
@@ -8141,9 +8141,9 @@  discard block
 block discarded – undo
8141 8141
 			$vartmp = (empty($InfoFieldList[3]) ? '' : $InfoFieldList[3]);
8142 8142
 			$reg = array();
8143 8143
 			if (preg_match('/^.*:(\w*)$/', $vartmp, $reg)) {
8144
-				$InfoFieldList[4] = $reg[1];    // take the sort field
8144
+				$InfoFieldList[4] = $reg[1]; // take the sort field
8145 8145
 			}
8146
-			$InfoFieldList[3] = preg_replace('/:\w*$/', '', $vartmp);    // take the filter field
8146
+			$InfoFieldList[3] = preg_replace('/:\w*$/', '', $vartmp); // take the filter field
8147 8147
 
8148 8148
 			$classname = $InfoFieldList[0];
8149 8149
 			$classpath = $InfoFieldList[1];
@@ -8174,8 +8174,8 @@  discard block
 block discarded – undo
8174 8174
 		);
8175 8175
 
8176 8176
 		if (!is_object($objecttmp)) {
8177
-			dol_syslog('selectForForms: Error bad setup of field objectdescorig=' . $objectdescorig.', objectfield='.$objectfield.', objectdesc='.$objectdesc, LOG_WARNING);
8178
-			return 'selectForForms: Error bad setup of field objectdescorig=' . $objectdescorig.', objectfield='.$objectfield.', objectdesc='.$objectdesc;
8177
+			dol_syslog('selectForForms: Error bad setup of field objectdescorig='.$objectdescorig.', objectfield='.$objectfield.', objectdesc='.$objectdesc, LOG_WARNING);
8178
+			return 'selectForForms: Error bad setup of field objectdescorig='.$objectdescorig.', objectfield='.$objectfield.', objectdesc='.$objectdesc;
8179 8179
 		}
8180 8180
 		'@phan-var-force CommonObject $objecttmp';
8181 8181
 
@@ -8187,9 +8187,9 @@  discard block
 block discarded – undo
8187 8187
 		if ($prefixforautocompletemode == 'product') {
8188 8188
 			$prefixforautocompletemode = 'produit';
8189 8189
 		}
8190
-		$confkeyforautocompletemode = strtoupper($prefixforautocompletemode) . '_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT
8190
+		$confkeyforautocompletemode = strtoupper($prefixforautocompletemode).'_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT
8191 8191
 
8192
-		dol_syslog(get_class($this) . "::selectForForms filter=" . $filter, LOG_DEBUG);
8192
+		dol_syslog(get_class($this)."::selectForForms filter=".$filter, LOG_DEBUG);
8193 8193
 
8194 8194
 		// Generate the combo HTML component
8195 8195
 		$out = '';
@@ -8218,13 +8218,13 @@  discard block
 block discarded – undo
8218 8218
 			}
8219 8219
 
8220 8220
 			// Set url and param to call to get json of the search results
8221
-			$urlforajaxcall = DOL_URL_ROOT . '/core/ajax/selectobject.php';
8222
-			$urloption = 'htmlname=' . urlencode($htmlname) . '&outjson=1&objectdesc=' . urlencode($objectdescorig) . '&objectfield='.urlencode($objectfield) . ($sortfield ? '&sortfield=' . urlencode($sortfield) : '');
8221
+			$urlforajaxcall = DOL_URL_ROOT.'/core/ajax/selectobject.php';
8222
+			$urloption = 'htmlname='.urlencode($htmlname).'&outjson=1&objectdesc='.urlencode($objectdescorig).'&objectfield='.urlencode($objectfield).($sortfield ? '&sortfield='.urlencode($sortfield) : '');
8223 8223
 
8224 8224
 			// Activate the auto complete using ajax call.
8225 8225
 			$out .= ajax_autocompleter($preSelectedValue, $htmlname, $urlforajaxcall, $urloption, getDolGlobalString($confkeyforautocompletemode), 0);
8226 8226
 			$out .= '<!-- force css to be higher than dialog popup --><style type="text/css">.ui-autocomplete { z-index: 1010; }</style>';
8227
-			$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) . '"' : '') . ' />';
8227
+			$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).'"' : '').' />';
8228 8228
 		} else {
8229 8229
 			// Immediate load of table record.
8230 8230
 			$out .= $this->selectForFormsList($objecttmp, $htmlname, $preSelectedValue, $showempty, $searchkey, $placeholder, $morecss, $moreparams, $forcecombo, 0, $disabled, $sortfield, $filter);
@@ -8264,16 +8264,16 @@  discard block
 block discarded – undo
8264 8264
 		if ($prefixforautocompletemode == 'societe') {
8265 8265
 			$prefixforautocompletemode = 'company';
8266 8266
 		}
8267
-		$confkeyforautocompletemode = strtoupper($prefixforautocompletemode) . '_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT
8267
+		$confkeyforautocompletemode = strtoupper($prefixforautocompletemode).'_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT
8268 8268
 
8269 8269
 		if (!empty($objecttmp->fields)) {    // For object that declare it, it is better to use declared fields (like societe, contact, ...)
8270 8270
 			$tmpfieldstoshow = '';
8271 8271
 			foreach ($objecttmp->fields as $key => $val) {
8272
-				if (! (int) dol_eval($val['enabled'], 1, 1, '1')) {
8272
+				if (!(int) dol_eval($val['enabled'], 1, 1, '1')) {
8273 8273
 					continue;
8274 8274
 				}
8275 8275
 				if (!empty($val['showoncombobox'])) {
8276
-					$tmpfieldstoshow .= ($tmpfieldstoshow ? ',' : '') . 't.' . $key;
8276
+					$tmpfieldstoshow .= ($tmpfieldstoshow ? ',' : '').'t.'.$key;
8277 8277
 				}
8278 8278
 			}
8279 8279
 			if ($tmpfieldstoshow) {
@@ -8301,18 +8301,18 @@  discard block
 block discarded – undo
8301 8301
 		$num = 0;
8302 8302
 
8303 8303
 		// Search data
8304
-		$sql = "SELECT t.rowid, " . $fieldstoshow . " FROM " . $this->db->prefix() . $objecttmp->table_element . " as t";
8304
+		$sql = "SELECT t.rowid, ".$fieldstoshow." FROM ".$this->db->prefix().$objecttmp->table_element." as t";
8305 8305
 		if (!empty($objecttmp->isextrafieldmanaged)) {
8306
-			$sql .= " LEFT JOIN " . $this->db->prefix() . $objecttmp->table_element . "_extrafields as e ON t.rowid=e.fk_object";
8306
+			$sql .= " LEFT JOIN ".$this->db->prefix().$objecttmp->table_element."_extrafields as e ON t.rowid=e.fk_object";
8307 8307
 		}
8308 8308
 		if (isset($objecttmp->ismultientitymanaged)) {
8309 8309
 			if (!is_numeric($objecttmp->ismultientitymanaged)) {
8310 8310
 				$tmparray = explode('@', $objecttmp->ismultientitymanaged);
8311
-				$sql .= " INNER JOIN " . $this->db->prefix() . $tmparray[1] . " as parenttable ON parenttable.rowid = t." . $tmparray[0];
8311
+				$sql .= " INNER JOIN ".$this->db->prefix().$tmparray[1]." as parenttable ON parenttable.rowid = t.".$tmparray[0];
8312 8312
 			}
8313 8313
 			if ($objecttmp->ismultientitymanaged === 'fk_soc@societe') {
8314 8314
 				if (!$user->hasRight('societe', 'client', 'voir')) {
8315
-					$sql .= ", " . $this->db->prefix() . "societe_commerciaux as sc";
8315
+					$sql .= ", ".$this->db->prefix()."societe_commerciaux as sc";
8316 8316
 				}
8317 8317
 			}
8318 8318
 		}
@@ -8332,21 +8332,21 @@  discard block
 block discarded – undo
8332 8332
 			$sql .= " WHERE 1=1";
8333 8333
 			if (isset($objecttmp->ismultientitymanaged)) {
8334 8334
 				if ($objecttmp->ismultientitymanaged == 1) {
8335
-					$sql .= " AND t.entity IN (" . getEntity($objecttmp->table_element) . ")";
8335
+					$sql .= " AND t.entity IN (".getEntity($objecttmp->table_element).")";
8336 8336
 				}
8337 8337
 				if (!is_numeric($objecttmp->ismultientitymanaged)) {
8338
-					$sql .= " AND parenttable.entity = t." . $tmparray[0];
8338
+					$sql .= " AND parenttable.entity = t.".$tmparray[0];
8339 8339
 				}
8340 8340
 				if ($objecttmp->ismultientitymanaged == 1 && !empty($user->socid)) {
8341 8341
 					if ($objecttmp->element == 'societe') {
8342
-						$sql .= " AND t.rowid = " . ((int) $user->socid);
8342
+						$sql .= " AND t.rowid = ".((int) $user->socid);
8343 8343
 					} else {
8344
-						$sql .= " AND t.fk_soc = " . ((int) $user->socid);
8344
+						$sql .= " AND t.fk_soc = ".((int) $user->socid);
8345 8345
 					}
8346 8346
 				}
8347 8347
 				if ($objecttmp->ismultientitymanaged === 'fk_soc@societe') {
8348 8348
 					if (!$user->hasRight('societe', 'client', 'voir')) {
8349
-						$sql .= " AND t.rowid = sc.fk_soc AND sc.fk_user = " . ((int) $user->id);
8349
+						$sql .= " AND t.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
8350 8350
 					}
8351 8351
 				}
8352 8352
 			}
@@ -8358,7 +8358,7 @@  discard block
 block discarded – undo
8358 8358
 				$errormessage = '';
8359 8359
 				$sql .= forgeSQLFromUniversalSearchCriteria($filter, $errormessage);
8360 8360
 				if ($errormessage) {
8361
-					return 'Error forging a SQL request from an universal criteria: ' . $errormessage;
8361
+					return 'Error forging a SQL request from an universal criteria: '.$errormessage;
8362 8362
 				}
8363 8363
 			}
8364 8364
 		}
@@ -8370,7 +8370,7 @@  discard block
 block discarded – undo
8370 8370
 		$resql = $this->db->query($sql);
8371 8371
 		if ($resql) {
8372 8372
 			// Construct $out and $outarray
8373
-			$out .= '<select id="' . $htmlname . '" class="flat minwidth100' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ($moreparams ? ' ' . $moreparams : '') . ' name="' . $htmlname . '">' . "\n";
8373
+			$out .= '<select id="'.$htmlname.'" class="flat minwidth100'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').($moreparams ? ' '.$moreparams : '').' name="'.$htmlname.'">'."\n";
8374 8374
 
8375 8375
 			// 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
8376 8376
 			$textifempty = '&nbsp;';
@@ -8384,7 +8384,7 @@  discard block
 block discarded – undo
8384 8384
 				}
8385 8385
 			}
8386 8386
 			if ($showempty) {
8387
-				$out .= '<option value="-1">' . $textifempty . '</option>' . "\n";
8387
+				$out .= '<option value="-1">'.$textifempty.'</option>'."\n";
8388 8388
 			}
8389 8389
 
8390 8390
 			$num = $this->db->num_rows($resql);
@@ -8407,9 +8407,9 @@  discard block
 block discarded – undo
8407 8407
 					}
8408 8408
 					if (empty($outputmode)) {
8409 8409
 						if ($preselectedvalue > 0 && $preselectedvalue == $obj->rowid) {
8410
-							$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>';
8410
+							$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>';
8411 8411
 						} else {
8412
-							$out .= '<option value="' . $obj->rowid . '" data-html="' . dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1) . '">' . dol_escape_htmltag($label, 0, 0, '', 0, 1) . '</option>';
8412
+							$out .= '<option value="'.$obj->rowid.'" data-html="'.dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1).'">'.dol_escape_htmltag($label, 0, 0, '', 0, 1).'</option>';
8413 8413
 						}
8414 8414
 					} else {
8415 8415
 						array_push($outarray, array('key' => $obj->rowid, 'value' => $label, 'label' => $label));
@@ -8422,10 +8422,10 @@  discard block
 block discarded – undo
8422 8422
 				}
8423 8423
 			}
8424 8424
 
8425
-			$out .= '</select>' . "\n";
8425
+			$out .= '</select>'."\n";
8426 8426
 
8427 8427
 			if (!$forcecombo) {
8428
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
8428
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
8429 8429
 				$out .= ajax_combobox($htmlname, array(), getDolGlobalInt($confkeyforautocompletemode, 0));
8430 8430
 			}
8431 8431
 		} else {
@@ -8489,8 +8489,8 @@  discard block
 block discarded – undo
8489 8489
 			}
8490 8490
 		}
8491 8491
 		$idname = str_replace(array('[', ']'), array('', ''), $htmlname);
8492
-		$out .= '<select id="' . preg_replace('/^\./', '', $idname) . '" ' . ($disabled ? 'disabled="disabled" ' : '') . 'class="flat ' . (preg_replace('/^\./', '', $htmlname)) . ($morecss ? ' ' . $morecss : '') . ' selectformat"';
8493
-		$out .= ' name="' . preg_replace('/^\./', '', $htmlname) . '" ' . ($moreparam ? $moreparam : '');
8492
+		$out .= '<select id="'.preg_replace('/^\./', '', $idname).'" '.($disabled ? 'disabled="disabled" ' : '').'class="flat '.(preg_replace('/^\./', '', $htmlname)).($morecss ? ' '.$morecss : '').' selectformat"';
8493
+		$out .= ' name="'.preg_replace('/^\./', '', $htmlname).'" '.($moreparam ? $moreparam : '');
8494 8494
 		$out .= '>'."\n";
8495 8495
 
8496 8496
 		if ($show_empty) {
@@ -8501,7 +8501,7 @@  discard block
 block discarded – undo
8501 8501
 			if (!is_numeric($show_empty)) {
8502 8502
 				$textforempty = $show_empty;
8503 8503
 			}
8504
-			$out .= '<option class="optiongrey" ' . ($moreparamonempty ? $moreparamonempty . ' ' : '') . 'value="' . (((int) $show_empty) < 0 ? $show_empty : -1) . '"' . ($id == $show_empty ? ' selected' : '') . '>' . $textforempty . '</option>' . "\n";
8504
+			$out .= '<option class="optiongrey" '.($moreparamonempty ? $moreparamonempty.' ' : '').'value="'.(((int) $show_empty) < 0 ? $show_empty : -1).'"'.($id == $show_empty ? ' selected' : '').'>'.$textforempty.'</option>'."\n";
8505 8505
 		}
8506 8506
 		if (is_array($array)) {
8507 8507
 			// Translate
@@ -8526,7 +8526,7 @@  discard block
 block discarded – undo
8526 8526
 					$value = $tmpvalue['label'];
8527 8527
 					//$valuehtml = empty($tmpvalue['data-html']) ? $value : $tmpvalue['data-html'];
8528 8528
 					$disabled = empty($tmpvalue['disabled']) ? '' : ' disabled';
8529
-					$style = empty($tmpvalue['css']) ? '' : ' class="' . $tmpvalue['css'] . '"';
8529
+					$style = empty($tmpvalue['css']) ? '' : ' class="'.$tmpvalue['css'].'"';
8530 8530
 				} else {
8531 8531
 					$value = $tmpvalue;
8532 8532
 					//$valuehtml = $tmpvalue;
@@ -8542,9 +8542,9 @@  discard block
 block discarded – undo
8542 8542
 				}
8543 8543
 				if ($key_in_label) {
8544 8544
 					if (empty($nohtmlescape)) {
8545
-						$selectOptionValue = dol_escape_htmltag($key . ' - ' . ($maxlen ? dol_trunc($value, $maxlen) : $value));
8545
+						$selectOptionValue = dol_escape_htmltag($key.' - '.($maxlen ? dol_trunc($value, $maxlen) : $value));
8546 8546
 					} else {
8547
-						$selectOptionValue = $key . ' - ' . ($maxlen ? dol_trunc($value, $maxlen) : $value);
8547
+						$selectOptionValue = $key.' - '.($maxlen ? dol_trunc($value, $maxlen) : $value);
8548 8548
 					}
8549 8549
 				} else {
8550 8550
 					if (empty($nohtmlescape)) {
@@ -8556,8 +8556,8 @@  discard block
 block discarded – undo
8556 8556
 						$selectOptionValue = '&nbsp;';
8557 8557
 					}
8558 8558
 				}
8559
-				$out .= '<option value="' . $key . '"';
8560
-				$out .= $style . $disabled;
8559
+				$out .= '<option value="'.$key.'"';
8560
+				$out .= $style.$disabled;
8561 8561
 				if (is_array($id)) {
8562 8562
 					if (in_array($key, $id) && !$disabled) {
8563 8563
 						$out .= ' selected'; // To preselect a value
@@ -8569,7 +8569,7 @@  discard block
 block discarded – undo
8569 8569
 					}
8570 8570
 				}
8571 8571
 				if (!empty($nohtmlescape)) {	// deprecated. Use instead the key 'data-html' into input $array, managed at next step to use HTML content.
8572
-					$out .= ' data-html="' . dol_escape_htmltag($selectOptionValue) . '"';
8572
+					$out .= ' data-html="'.dol_escape_htmltag($selectOptionValue).'"';
8573 8573
 				}
8574 8574
 
8575 8575
 				if (is_array($tmpvalue)) {
@@ -8588,7 +8588,7 @@  discard block
 block discarded – undo
8588 8588
 		// Add code for jquery to use multiselect
8589 8589
 		if ($addjscombo && $jsbeautify) {
8590 8590
 			// Enhance with select2
8591
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
8591
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
8592 8592
 			$out .= ajax_combobox($idname, array(), 0, 0, 'resolve', (((int) $show_empty) < 0 ? (string) $show_empty : '-1'), $morecss);
8593 8593
 		}
8594 8594
 
@@ -8616,28 +8616,28 @@  discard block
 block discarded – undo
8616 8616
 	public static function selectArrayAjax($htmlname, $url, $id = '', $moreparam = '', $moreparamtourl = '', $disabled = 0, $minimumInputLength = 1, $morecss = '', $callurlonselect = 0, $placeholder = '', $acceptdelayedhtml = 0)
8617 8617
 	{
8618 8618
 		global $conf, $langs;
8619
-		global $delayedhtmlcontent;    // Will be used later outside of this function
8619
+		global $delayedhtmlcontent; // Will be used later outside of this function
8620 8620
 
8621 8621
 		// TODO Use an internal dolibarr component instead of select2
8622 8622
 		if (!getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') && !defined('REQUIRE_JQUERY_MULTISELECT')) {
8623 8623
 			return '';
8624 8624
 		}
8625 8625
 
8626
-		$out = '<select type="text" class="' . $htmlname . ($morecss ? ' ' . $morecss : '') . '" ' . ($moreparam ? $moreparam . ' ' : '') . 'name="' . $htmlname . '"></select>';
8626
+		$out = '<select type="text" class="'.$htmlname.($morecss ? ' '.$morecss : '').'" '.($moreparam ? $moreparam.' ' : '').'name="'.$htmlname.'"></select>';
8627 8627
 
8628 8628
 		$outdelayed = '';
8629 8629
 		if (!empty($conf->use_javascript_ajax)) {
8630 8630
 			$tmpplugin = 'select2';
8631
-			$outdelayed = "\n" . '<!-- JS CODE TO ENABLE ' . $tmpplugin . ' for id ' . $htmlname . ' -->
8632
-		    	<script nonce="' . getNonce() . '">
8631
+			$outdelayed = "\n".'<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' -->
8632
+		    	<script nonce="' . getNonce().'">
8633 8633
 		    	$(document).ready(function () {
8634 8634
 
8635
-	    	        ' . ($callurlonselect ? 'var saveRemoteData = [];' : '') . '
8635
+	    	        ' . ($callurlonselect ? 'var saveRemoteData = [];' : '').'
8636 8636
 
8637
-	                $(".' . $htmlname . '").select2({
8637
+	                $(".' . $htmlname.'").select2({
8638 8638
 				    	ajax: {
8639 8639
 					    	dir: "ltr",
8640
-					    	url: "' . $url . '",
8640
+					    	url: "' . $url.'",
8641 8641
 					    	dataType: \'json\',
8642 8642
 					    	delay: 250,
8643 8643
 					    	data: function (params) {
@@ -8664,9 +8664,9 @@  discard block
 block discarded – undo
8664 8664
 				    	},
8665 8665
 		 				language: select2arrayoflanguage,
8666 8666
 						containerCssClass: \':all:\',					/* Line to add class of origin SELECT propagated to the new <span class="select2-selection...> tag */
8667
-					    placeholder: "' . dol_escape_js($placeholder) . '",
8667
+					    placeholder: "' . dol_escape_js($placeholder).'",
8668 8668
 				    	escapeMarkup: function (markup) { return markup; }, 	// let our custom formatter work
8669
-				    	minimumInputLength: ' . ((int) $minimumInputLength) . ',
8669
+				    	minimumInputLength: ' . ((int) $minimumInputLength).',
8670 8670
 				        formatResult: function (result, container, query, escapeMarkup) {
8671 8671
 	                        return escapeMarkup(result.text);
8672 8672
 	                    },
@@ -8674,10 +8674,10 @@  discard block
 block discarded – undo
8674 8674
 
8675 8675
 	                ' . ($callurlonselect ? '
8676 8676
 	                /* Code to execute a GET when we select a value */
8677
-	                $(".' . $htmlname . '").change(function() {
8678
-				    	var selected = $(".' . $htmlname . '").val();
8677
+	                $(".' . $htmlname.'").change(function() {
8678
+				    	var selected = $(".' . $htmlname.'").val();
8679 8679
 	                	console.log("We select in selectArrayAjax the entry "+selected)
8680
-				        $(".' . $htmlname . '").val("");  /* reset visible combo value */
8680
+				        $(".' . $htmlname.'").val("");  /* reset visible combo value */
8681 8681
 	    			    $.each( saveRemoteData, function( key, value ) {
8682 8682
 	    				        if (key == selected)
8683 8683
 	    			            {
@@ -8685,7 +8685,7 @@  discard block
 block discarded – undo
8685 8685
 	    			                 location.assign(value.url);
8686 8686
 	    			            }
8687 8687
 	                    });
8688
-	    			});' : '') . '
8688
+	    			});' : '').'
8689 8689
 
8690 8690
 	    	   });
8691 8691
 		       </script>';
@@ -8721,14 +8721,14 @@  discard block
 block discarded – undo
8721 8721
 	public static function selectArrayFilter($htmlname, $array, $id = '', $moreparam = '', $disableFiltering = 0, $disabled = 0, $minimumInputLength = 1, $morecss = '', $callurlonselect = 0, $placeholder = '', $acceptdelayedhtml = 0, $textfortitle = '')
8722 8722
 	{
8723 8723
 		global $conf, $langs;
8724
-		global $delayedhtmlcontent;    // Will be used later outside of this function
8724
+		global $delayedhtmlcontent; // Will be used later outside of this function
8725 8725
 
8726 8726
 		// TODO Use an internal dolibarr component instead of select2
8727 8727
 		if (!getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') && !defined('REQUIRE_JQUERY_MULTISELECT')) {
8728 8728
 			return '';
8729 8729
 		}
8730 8730
 
8731
-		$out = '<select type="text"'.($textfortitle ? ' title="'.dol_escape_htmltag($textfortitle).'"' : '').' id="'.$htmlname.'" class="'.$htmlname.($morecss ? ' ' . $morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.'"><option></option></select>';
8731
+		$out = '<select type="text"'.($textfortitle ? ' title="'.dol_escape_htmltag($textfortitle).'"' : '').' id="'.$htmlname.'" class="'.$htmlname.($morecss ? ' '.$morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.'"><option></option></select>';
8732 8732
 
8733 8733
 		$formattedarrayresult = array();
8734 8734
 
@@ -8743,20 +8743,20 @@  discard block
 block discarded – undo
8743 8743
 		$outdelayed = '';
8744 8744
 		if (!empty($conf->use_javascript_ajax)) {
8745 8745
 			$tmpplugin = 'select2';
8746
-			$outdelayed = "\n" . '<!-- JS CODE TO ENABLE ' . $tmpplugin . ' for id ' . $htmlname . ' -->
8747
-				<script nonce="' . getNonce() . '">
8746
+			$outdelayed = "\n".'<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' -->
8747
+				<script nonce="' . getNonce().'">
8748 8748
 				$(document).ready(function () {
8749
-					var data = ' . json_encode($formattedarrayresult) . ';
8749
+					var data = ' . json_encode($formattedarrayresult).';
8750 8750
 
8751
-					' . ($callurlonselect ? 'var saveRemoteData = ' . json_encode($array) . ';' : '') . '
8751
+					' . ($callurlonselect ? 'var saveRemoteData = '.json_encode($array).';' : '').'
8752 8752
 
8753
-					$(".' . $htmlname . '").select2({
8753
+					$(".' . $htmlname.'").select2({
8754 8754
 						data: data,
8755 8755
 						language: select2arrayoflanguage,
8756 8756
 						containerCssClass: \':all:\',					/* Line to add class of origin SELECT propagated to the new <span class="select2-selection...> tag */
8757
-						placeholder: "' . dol_escape_js($placeholder) . '",
8757
+						placeholder: "' . dol_escape_js($placeholder).'",
8758 8758
 						escapeMarkup: function (markup) { return markup; }, 	// let our custom formatter work
8759
-						minimumInputLength: ' . $minimumInputLength . ',
8759
+						minimumInputLength: ' . $minimumInputLength.',
8760 8760
 						formatResult: function (result, container, query, escapeMarkup) {
8761 8761
 							return escapeMarkup(result.text);
8762 8762
 						},
@@ -8795,11 +8795,11 @@  discard block
 block discarded – undo
8795 8795
 
8796 8796
 					' . ($callurlonselect ? '
8797 8797
 					/* Code to execute a GET when we select a value */
8798
-					$(".' . $htmlname . '").change(function() {
8799
-						var selected = $(".' . $htmlname . '").val();
8798
+					$(".' . $htmlname.'").change(function() {
8799
+						var selected = $(".' . $htmlname.'").val();
8800 8800
 						console.log("We select "+selected)
8801 8801
 
8802
-						$(".' . $htmlname . '").val("");  /* reset visible combo value */
8802
+						$(".' . $htmlname.'").val("");  /* reset visible combo value */
8803 8803
 						$.each( saveRemoteData, function( key, value ) {
8804 8804
 							if (key == selected)
8805 8805
 							{
@@ -8807,7 +8807,7 @@  discard block
 block discarded – undo
8807 8807
 								location.assign(value.url);
8808 8808
 							}
8809 8809
 						});
8810
-					});' : '') . '
8810
+					});' : '').'
8811 8811
 
8812 8812
 				});
8813 8813
 				</script>';
@@ -8856,7 +8856,7 @@  discard block
 block discarded – undo
8856 8856
 		$useenhancedmultiselect = 0;
8857 8857
 		if (!empty($conf->use_javascript_ajax) && !defined('MAIN_DO_NOT_USE_JQUERY_MULTISELECT') && (getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') || defined('REQUIRE_JQUERY_MULTISELECT'))) {
8858 8858
 			if ($addjscombo) {
8859
-				$useenhancedmultiselect = 1;	// Use the js multiselect in one line. Possible only if $addjscombo not 0.
8859
+				$useenhancedmultiselect = 1; // Use the js multiselect in one line. Possible only if $addjscombo not 0.
8860 8860
 			}
8861 8861
 		}
8862 8862
 
@@ -8865,7 +8865,7 @@  discard block
 block discarded – undo
8865 8865
 		// submitted to nothing.
8866 8866
 		$out .= '<input type="hidden" name="'.$htmlname.'_multiselect" value="1">';
8867 8867
 		// Output select component
8868
-		$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";
8868
+		$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";
8869 8869
 		if (is_array($array) && !empty($array)) {
8870 8870
 			if ($value_as_key) {
8871 8871
 				$array = array_combine($array, $array);
@@ -8886,33 +8886,33 @@  discard block
 block discarded – undo
8886 8886
 						$tmplabelhtml = empty($value['labelhtml']) ? '' : $value['labelhtml'];
8887 8887
 					}
8888 8888
 					$newval = ($translate ? $langs->trans($tmpvalue) : $tmpvalue);
8889
-					$newval = ($key_in_label ? $tmpkey . ' - ' . $newval : $newval);
8889
+					$newval = ($key_in_label ? $tmpkey.' - '.$newval : $newval);
8890 8890
 
8891
-					$out .= '<option value="' . $tmpkey . '"';
8891
+					$out .= '<option value="'.$tmpkey.'"';
8892 8892
 					if (is_array($selected) && !empty($selected) && in_array((string) $tmpkey, $selected) && ((string) $tmpkey != '')) {
8893 8893
 						$out .= ' selected';
8894 8894
 					}
8895 8895
 					if (!empty($tmplabelhtml)) {
8896
-						$out .= ' data-html="' . dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1) . '"';
8896
+						$out .= ' data-html="'.dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1).'"';
8897 8897
 					} else {
8898
-						$tmplabelhtml = ($tmppicto ? img_picto('', $tmppicto, 'class="pictofixedwidth" style="color: #' . $tmpcolor . '"') : '') . $newval;
8899
-						$out .= ' data-html="' . dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1) . '"';
8898
+						$tmplabelhtml = ($tmppicto ? img_picto('', $tmppicto, 'class="pictofixedwidth" style="color: #'.$tmpcolor.'"') : '').$newval;
8899
+						$out .= ' data-html="'.dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1).'"';
8900 8900
 					}
8901 8901
 					$out .= '>';
8902 8902
 					$out .= dol_htmlentitiesbr($newval);
8903
-					$out .= '</option>' . "\n";
8903
+					$out .= '</option>'."\n";
8904 8904
 				}
8905 8905
 			}
8906 8906
 		}
8907
-		$out .= '</select>' . "\n";
8907
+		$out .= '</select>'."\n";
8908 8908
 
8909 8909
 		// Add code for jquery to use multiselect
8910 8910
 		if (!empty($conf->use_javascript_ajax) && getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') || defined('REQUIRE_JQUERY_MULTISELECT')) {
8911
-			$out .= "\n" . '<!-- JS CODE TO ENABLE select for id ' . $htmlname . ', addjscombo=' . $addjscombo . ' -->';
8912
-			$out .= "\n" . '<script nonce="' . getNonce() . '">' . "\n";
8911
+			$out .= "\n".'<!-- JS CODE TO ENABLE select for id '.$htmlname.', addjscombo='.$addjscombo.' -->';
8912
+			$out .= "\n".'<script nonce="'.getNonce().'">'."\n";
8913 8913
 			if ($addjscombo == 1) {
8914 8914
 				$tmpplugin = !getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') ? constant('REQUIRE_JQUERY_MULTISELECT') : $conf->global->MAIN_USE_JQUERY_MULTISELECT;
8915
-				$out .= 'function formatResult(record, container) {' . "\n";
8915
+				$out .= 'function formatResult(record, container) {'."\n";
8916 8916
 				// If property data-html set, we decode html entities and use this.
8917 8917
 				// Note that HTML content must have been sanitized from js with dol_escape_htmltag(xxx, 0, 0, '', 0, 1) when building the select option.
8918 8918
 				$out .= '	if ($(record.element).attr("data-html") != undefined && typeof htmlEntityDecodeJs === "function") {';
@@ -8920,26 +8920,26 @@  discard block
 block discarded – undo
8920 8920
 				$out .= '		return htmlEntityDecodeJs($(record.element).attr("data-html"));';
8921 8921
 				$out .= '	}'."\n";
8922 8922
 				$out .= '	return record.text;';
8923
-				$out .= '}' . "\n";
8924
-				$out .= 'function formatSelection(record) {' . "\n";
8923
+				$out .= '}'."\n";
8924
+				$out .= 'function formatSelection(record) {'."\n";
8925 8925
 				if ($elemtype == 'category') {
8926
-					$out .= 'return \'<span><img src="' . DOL_URL_ROOT . '/theme/eldy/img/object_category.png"> \'+record.text+\'</span>\';';
8926
+					$out .= 'return \'<span><img src="'.DOL_URL_ROOT.'/theme/eldy/img/object_category.png"> \'+record.text+\'</span>\';';
8927 8927
 				} else {
8928 8928
 					$out .= 'return record.text;';
8929 8929
 				}
8930
-				$out .= '}' . "\n";
8930
+				$out .= '}'."\n";
8931 8931
 				$out .= '$(document).ready(function () {
8932
-							$(\'#' . $htmlname . '\').' . $tmpplugin . '({';
8932
+							$(\'#' . $htmlname.'\').'.$tmpplugin.'({';
8933 8933
 				if ($placeholder) {
8934 8934
 					$out .= '
8935 8935
 								placeholder: {
8936 8936
 								    id: \'-1\',
8937
-								    text: \'' . dol_escape_js($placeholder) . '\'
8937
+								    text: \'' . dol_escape_js($placeholder).'\'
8938 8938
 								  },';
8939 8939
 				}
8940 8940
 				$out .= '		dir: \'ltr\',
8941 8941
 								containerCssClass: \':all:\',					/* Line to add class of origin SELECT propagated to the new <span class="select2-selection...> tag (ko with multiselect) */
8942
-								dropdownCssClass: \'' . $morecss . '\',				/* Line to add class on the new <span class="select2-selection...> tag (ok with multiselect). Need full version of select2. */
8942
+								dropdownCssClass: \'' . $morecss.'\',				/* Line to add class on the new <span class="select2-selection...> tag (ok with multiselect). Need full version of select2. */
8943 8943
 								// Specify format function for dropdown item
8944 8944
 								formatResult: formatResult,
8945 8945
 							 	templateResult: formatResult,		/* For 4.0 */
@@ -8951,21 +8951,21 @@  discard block
 block discarded – undo
8951 8951
 
8952 8952
 							/* Add also morecss to the css .select2 that is after the #htmlname, for component that are show dynamically after load, because select2 set
8953 8953
 								 the size only if component is not hidden by default on load */
8954
-							$(\'#' . $htmlname . ' + .select2\').addClass(\'' . $morecss . '\');
8954
+							$(\'#' . $htmlname.' + .select2\').addClass(\''.$morecss.'\');
8955 8955
 						});' . "\n";
8956 8956
 			} elseif ($addjscombo == 2 && !defined('DISABLE_MULTISELECT')) {
8957 8957
 				// Add other js lib
8958 8958
 				// TODO external lib multiselect/jquery.multi-select.js must have been loaded to use this multiselect plugin
8959 8959
 				// ...
8960
-				$out .= 'console.log(\'addjscombo=2 for htmlname=' . $htmlname . '\');';
8960
+				$out .= 'console.log(\'addjscombo=2 for htmlname='.$htmlname.'\');';
8961 8961
 				$out .= '$(document).ready(function () {
8962
-							$(\'#' . $htmlname . '\').multiSelect({
8962
+							$(\'#' . $htmlname.'\').multiSelect({
8963 8963
 								containerHTML: \'<div class="multi-select-container">\',
8964 8964
 								menuHTML: \'<div class="multi-select-menu">\',
8965
-								buttonHTML: \'<span class="multi-select-button ' . $morecss . '">\',
8965
+								buttonHTML: \'<span class="multi-select-button ' . $morecss.'">\',
8966 8966
 								menuItemHTML: \'<label class="multi-select-menuitem">\',
8967 8967
 								activeClass: \'multi-select-container--open\',
8968
-								noneText: \'' . $placeholder . '\'
8968
+								noneText: \'' . $placeholder.'\'
8969 8969
 							});
8970 8970
 						})';
8971 8971
 			}
@@ -8997,7 +8997,7 @@  discard block
 block discarded – undo
8997 8997
 			return '';
8998 8998
 		}
8999 8999
 
9000
-		$tmpvar = "MAIN_SELECTEDFIELDS_" . $varpage; // To get list of saved selected fields to show
9000
+		$tmpvar = "MAIN_SELECTEDFIELDS_".$varpage; // To get list of saved selected fields to show
9001 9001
 
9002 9002
 		if (!empty($user->conf->$tmpvar)) {        // A list of fields was already customized for user
9003 9003
 			$tmparray = explode(',', $user->conf->$tmpvar);
@@ -9040,19 +9040,19 @@  discard block
 block discarded – undo
9040 9040
 				}
9041 9041
 
9042 9042
 				// Note: $val['checked'] <> 0 means we must show the field into the combo list  @phan-suppress-next-line PhanTypePossiblyInvalidDimOffset
9043
-				$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>';
9044
-				$listcheckedstring .= (empty($val['checked']) ? '' : $key . ',');
9043
+				$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>';
9044
+				$listcheckedstring .= (empty($val['checked']) ? '' : $key.',');
9045 9045
 			}
9046 9046
 		}
9047 9047
 
9048
-		$out = '<!-- Component multiSelectArrayWithCheckbox ' . $htmlname . ' -->
9048
+		$out = '<!-- Component multiSelectArrayWithCheckbox '.$htmlname.' -->
9049 9049
 
9050 9050
         <dl class="dropdown">
9051 9051
             <dt>
9052
-            <a href="#' . $htmlname . '">
9053
-              ' . img_picto('', 'list') . '
9052
+            <a href="#' . $htmlname.'">
9053
+              ' . img_picto('', 'list').'
9054 9054
             </a>
9055
-            <input type="hidden" class="' . $htmlname . '" name="' . $htmlname . '" value="' . $listcheckedstring . '">
9055
+            <input type="hidden" class="' . $htmlname.'" name="'.$htmlname.'" value="'.$listcheckedstring.'">
9056 9056
             </dt>
9057 9057
             <dd class="dropdowndd">
9058 9058
                 <div class="multiselectcheckbox'.$htmlname.'">
@@ -9064,19 +9064,19 @@  discard block
 block discarded – undo
9064 9064
             </dd>
9065 9065
         </dl>
9066 9066
 
9067
-        <script nonce="' . getNonce() . '" type="text/javascript">
9067
+        <script nonce="' . getNonce().'" type="text/javascript">
9068 9068
           jQuery(document).ready(function () {
9069
-              $(\'.multiselectcheckbox' . $htmlname . ' input[type="checkbox"]\').on(\'click\', function () {
9069
+              $(\'.multiselectcheckbox' . $htmlname.' input[type="checkbox"]\').on(\'click\', function () {
9070 9070
                   console.log("A new field was added/removed, we edit field input[name=formfilteraction]");
9071 9071
 
9072 9072
                   $("input:hidden[name=formfilteraction]").val(\'listafterchangingselectedfields\');	// Update field so we know we changed something on selected fields after POST
9073 9073
 
9074 9074
                   var title = $(this).val() + ",";
9075 9075
                   if ($(this).is(\':checked\')) {
9076
-                      $(\'.' . $htmlname . '\').val(title + $(\'.' . $htmlname . '\').val());
9076
+                      $(\'.' . $htmlname.'\').val(title + $(\'.'.$htmlname.'\').val());
9077 9077
                   }
9078 9078
                   else {
9079
-                      $(\'.' . $htmlname . '\').val( $(\'.' . $htmlname . '\').val().replace(title, \'\') )
9079
+                      $(\'.' . $htmlname.'\').val( $(\'.'.$htmlname.'\').val().replace(title, \'\') )
9080 9080
                   }
9081 9081
                   // Now, we submit page
9082 9082
                   //$(this).parents(\'form:first\').submit();
@@ -9107,7 +9107,7 @@  discard block
 block discarded – undo
9107 9107
 	 */
9108 9108
 	public function showCategories($id, $type, $rendermode = 0, $nolink = 0)
9109 9109
 	{
9110
-		include_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
9110
+		include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
9111 9111
 
9112 9112
 		$cat = new Categorie($this->db);
9113 9113
 		$categories = $cat->containing($id, $type);
@@ -9117,10 +9117,10 @@  discard block
 block discarded – undo
9117 9117
 			foreach ($categories as $c) {
9118 9118
 				$ways = $c->print_all_ways(' &gt;&gt; ', ($nolink ? 'none' : ''), 0, 1); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text
9119 9119
 				foreach ($ways as $way) {
9120
-					$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #bbb"') . '>' . $way . '</li>';
9120
+					$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #bbb"').'>'.$way.'</li>';
9121 9121
 				}
9122 9122
 			}
9123
-			return '<div class="select2-container-multi-dolibarr"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>';
9123
+			return '<div class="select2-container-multi-dolibarr"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
9124 9124
 		}
9125 9125
 
9126 9126
 		if ($rendermode == 0) {
@@ -9168,15 +9168,15 @@  discard block
 block discarded – undo
9168 9168
 
9169 9169
 
9170 9170
 			print '<div class="div-table-responsive-no-min">';
9171
-			print '<table class="noborder allwidth" data-block="showLinkedObject" data-element="' . $object->element . '"  data-elementid="' . $object->id . '"   >';
9171
+			print '<table class="noborder allwidth" data-block="showLinkedObject" data-element="'.$object->element.'"  data-elementid="'.$object->id.'"   >';
9172 9172
 
9173 9173
 			print '<tr class="liste_titre">';
9174
-			print '<td>' . $langs->trans("Type") . '</td>';
9175
-			print '<td>' . $langs->trans("Ref") . '</td>';
9174
+			print '<td>'.$langs->trans("Type").'</td>';
9175
+			print '<td>'.$langs->trans("Ref").'</td>';
9176 9176
 			print '<td class="center"></td>';
9177
-			print '<td class="center">' . $langs->trans("Date") . '</td>';
9178
-			print '<td class="right">' . $langs->trans("AmountHTShort") . '</td>';
9179
-			print '<td class="right">' . $langs->trans("Status") . '</td>';
9177
+			print '<td class="center">'.$langs->trans("Date").'</td>';
9178
+			print '<td class="right">'.$langs->trans("AmountHTShort").'</td>';
9179
+			print '<td class="right">'.$langs->trans("Status").'</td>';
9180 9180
 			print '<td></td>';
9181 9181
 			print '</tr>';
9182 9182
 
@@ -9195,13 +9195,13 @@  discard block
 block discarded – undo
9195 9195
 				if ($objecttype != 'supplier_proposal' && preg_match('/^([^_]+)_([^_]+)/i', $objecttype, $regs)) {
9196 9196
 					$element = $regs[1];
9197 9197
 					$subelement = $regs[2];
9198
-					$tplpath = $element . '/' . $subelement;
9198
+					$tplpath = $element.'/'.$subelement;
9199 9199
 				}
9200 9200
 				$tplname = 'linkedobjectblock';
9201 9201
 
9202 9202
 				// To work with non standard path
9203 9203
 				if ($objecttype == 'facture') {
9204
-					$tplpath = 'compta/' . $element;
9204
+					$tplpath = 'compta/'.$element;
9205 9205
 					if (!isModEnabled('invoice')) {
9206 9206
 						continue; // Do not show if module disabled
9207 9207
 					}
@@ -9212,7 +9212,7 @@  discard block
 block discarded – undo
9212 9212
 						continue; // Do not show if module disabled
9213 9213
 					}
9214 9214
 				} elseif ($objecttype == 'propal') {
9215
-					$tplpath = 'comm/' . $element;
9215
+					$tplpath = 'comm/'.$element;
9216 9216
 					if (!isModEnabled('propal')) {
9217 9217
 						continue; // Do not show if module disabled
9218 9218
 					}
@@ -9263,7 +9263,7 @@  discard block
 block discarded – undo
9263 9263
 				$linkedObjectBlock = $objects;
9264 9264
 
9265 9265
 				// Output template part (modules that overwrite templates must declare this into descriptor)
9266
-				$dirtpls = array_merge($conf->modules_parts['tpl'], array('/' . $tplpath . '/tpl'));
9266
+				$dirtpls = array_merge($conf->modules_parts['tpl'], array('/'.$tplpath.'/tpl'));
9267 9267
 				foreach ($dirtpls as $reldir) {
9268 9268
 					$reldir = rtrim($reldir, '/');
9269 9269
 					if ($nboftypesoutput == ($nbofdifferenttypes - 1)) {    // No more type to show after
@@ -9271,7 +9271,7 @@  discard block
 block discarded – undo
9271 9271
 						$noMoreLinkedObjectBlockAfter = 1;
9272 9272
 					}
9273 9273
 
9274
-					$res = @include dol_buildpath($reldir . '/' . $tplname . '.tpl.php');
9274
+					$res = @include dol_buildpath($reldir.'/'.$tplname.'.tpl.php');
9275 9275
 					if ($res) {
9276 9276
 						$nboftypesoutput++;
9277 9277
 						break;
@@ -9280,7 +9280,7 @@  discard block
 block discarded – undo
9280 9280
 			}
9281 9281
 
9282 9282
 			if (!$nboftypesoutput) {
9283
-				print '<tr><td class="impair" colspan="7"><span class="opacitymedium">' . $langs->trans("None") . '</span></td></tr>';
9283
+				print '<tr><td class="impair" colspan="7"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
9284 9284
 			}
9285 9285
 
9286 9286
 			print '</table>';
@@ -9320,14 +9320,14 @@  discard block
 block discarded – undo
9320 9320
 		if (is_object($object->thirdparty) && !empty($object->thirdparty->id) && $object->thirdparty->id > 0) {
9321 9321
 			$listofidcompanytoscan = $object->thirdparty->id;
9322 9322
 			if (($object->thirdparty->parent > 0) && getDolGlobalString('THIRDPARTY_INCLUDE_PARENT_IN_LINKTO')) {
9323
-				$listofidcompanytoscan .= ',' . $object->thirdparty->parent;
9323
+				$listofidcompanytoscan .= ','.$object->thirdparty->parent;
9324 9324
 			}
9325 9325
 			if (($object->fk_project > 0) && getDolGlobalString('THIRDPARTY_INCLUDE_PROJECT_THIRDPARY_IN_LINKTO')) {
9326
-				include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
9326
+				include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
9327 9327
 				$tmpproject = new Project($this->db);
9328 9328
 				$tmpproject->fetch($object->fk_project);
9329 9329
 				if ($tmpproject->socid > 0 && ($tmpproject->socid != $object->thirdparty->id)) {
9330
-					$listofidcompanytoscan .= ',' . $tmpproject->socid;
9330
+					$listofidcompanytoscan .= ','.$tmpproject->socid;
9331 9331
 				}
9332 9332
 				unset($tmpproject);
9333 9333
 			}
@@ -9337,63 +9337,63 @@  discard block
 block discarded – undo
9337 9337
 					'enabled' => isModEnabled('propal'),
9338 9338
 					'perms' => 1,
9339 9339
 					'label' => 'LinkToProposal',
9340
-					'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') . ')'),
9340
+					'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').')'),
9341 9341
 				'shipping' => array(
9342 9342
 					'enabled' => isModEnabled('shipping'),
9343 9343
 					'perms' => 1,
9344 9344
 					'label' => 'LinkToExpedition',
9345
-					'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') . ')'),
9345
+					'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').')'),
9346 9346
 				'order' => array(
9347 9347
 					'enabled' => isModEnabled('order'),
9348 9348
 					'perms' => 1,
9349 9349
 					'label' => 'LinkToOrder',
9350
-					'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') . ')'),
9350
+					'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').')'),
9351 9351
 				'invoice' => array(
9352 9352
 					'enabled' => isModEnabled('invoice'),
9353 9353
 					'perms' => 1,
9354 9354
 					'label' => 'LinkToInvoice',
9355
-					'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') . ')'),
9355
+					'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').')'),
9356 9356
 				'invoice_template' => array(
9357 9357
 					'enabled' => isModEnabled('invoice'),
9358 9358
 					'perms' => 1,
9359 9359
 					'label' => 'LinkToTemplateInvoice',
9360
-					'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') . ')'),
9360
+					'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').')'),
9361 9361
 				'contrat' => array(
9362 9362
 					'enabled' => isModEnabled('contract'),
9363 9363
 					'perms' => 1,
9364 9364
 					'label' => 'LinkToContract',
9365 9365
 					'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
9366
-							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'
9366
+							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'
9367 9367
 				),
9368 9368
 				'fichinter' => array(
9369 9369
 					'enabled' => isModEnabled('intervention'),
9370 9370
 					'perms' => 1,
9371 9371
 					'label' => 'LinkToIntervention',
9372
-					'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') . ')'),
9372
+					'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').')'),
9373 9373
 				'supplier_proposal' => array(
9374 9374
 					'enabled' => isModEnabled('supplier_proposal'),
9375 9375
 					'perms' => 1,
9376 9376
 					'label' => 'LinkToSupplierProposal',
9377
-					'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') . ')'),
9377
+					'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').')'),
9378 9378
 				'order_supplier' => array(
9379 9379
 					'enabled' => isModEnabled("supplier_order"),
9380 9380
 					'perms' => 1,
9381 9381
 					'label' => 'LinkToSupplierOrder',
9382
-					'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') . ')'),
9382
+					'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').')'),
9383 9383
 				'invoice_supplier' => array(
9384 9384
 					'enabled' => isModEnabled("supplier_invoice"),
9385 9385
 					'perms' => 1, 'label' => 'LinkToSupplierInvoice',
9386
-					'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') . ')'),
9386
+					'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').')'),
9387 9387
 				'ticket' => array(
9388 9388
 					'enabled' => isModEnabled('ticket'),
9389 9389
 					'perms' => 1,
9390 9390
 					'label' => 'LinkToTicket',
9391
-					'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') . ')'),
9391
+					'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').')'),
9392 9392
 				'mo' => array(
9393 9393
 					'enabled' => isModEnabled('mrp'),
9394 9394
 					'perms' => 1,
9395 9395
 					'label' => 'LinkToMo',
9396
-					'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') . ')')
9396
+					'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').')')
9397 9397
 			);
9398 9398
 		}
9399 9399
 
@@ -9429,22 +9429,22 @@  discard block
 block discarded – undo
9429 9429
 			}
9430 9430
 
9431 9431
 			if (!empty($possiblelink['perms']) && (empty($restrictlinksto) || in_array($key, $restrictlinksto)) && (empty($excludelinksto) || !in_array($key, $excludelinksto))) {
9432
-				print '<div id="' . $key . 'list"' . (empty($conf->use_javascript_ajax) ? '' : ' style="display:none"') . '>';
9432
+				print '<div id="'.$key.'list"'.(empty($conf->use_javascript_ajax) ? '' : ' style="display:none"').'>';
9433 9433
 
9434 9434
 				if (getDolGlobalString('MAIN_LINK_BY_REF_IN_LINKTO')) {
9435 9435
 					print '<br>'."\n";
9436 9436
 					print '<!-- form to add a link from anywhere -->'."\n";
9437
-					print '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST" name="formlinkedbyref' . $key . '">';
9438
-					print '<input type="hidden" name="id" value="' . $object->id . '">';
9437
+					print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" name="formlinkedbyref'.$key.'">';
9438
+					print '<input type="hidden" name="id" value="'.$object->id.'">';
9439 9439
 					print '<input type="hidden" name="action" value="addlinkbyref">';
9440
-					print '<input type="hidden" name="token" value="' . newToken() . '">';
9441
-					print '<input type="hidden" name="addlink" value="' . $key . '">';
9440
+					print '<input type="hidden" name="token" value="'.newToken().'">';
9441
+					print '<input type="hidden" name="addlink" value="'.$key.'">';
9442 9442
 					print '<table class="noborder">';
9443 9443
 					print '<tr>';
9444 9444
 					//print '<td>' . $langs->trans("Ref") . '</td>';
9445
-					print '<td class="center"><input type="text" placeholder="'.dol_escape_htmltag($langs->trans("Ref")).'" name="reftolinkto" value="' . dol_escape_htmltag(GETPOST('reftolinkto', 'alpha')) . '">&nbsp;';
9446
-					print '<input type="submit" class="button small valignmiddle" value="' . $langs->trans('ToLink') . '">&nbsp;';
9447
-					print '<input type="submit" class="button small" name="cancel" value="' . $langs->trans('Cancel') . '"></td>';
9445
+					print '<td class="center"><input type="text" placeholder="'.dol_escape_htmltag($langs->trans("Ref")).'" name="reftolinkto" value="'.dol_escape_htmltag(GETPOST('reftolinkto', 'alpha')).'">&nbsp;';
9446
+					print '<input type="submit" class="button small valignmiddle" value="'.$langs->trans('ToLink').'">&nbsp;';
9447
+					print '<input type="submit" class="button small" name="cancel" value="'.$langs->trans('Cancel').'"></td>';
9448 9448
 					print '</tr>';
9449 9449
 					print '</table>';
9450 9450
 					print '</form>';
@@ -9459,48 +9459,48 @@  discard block
 block discarded – undo
9459 9459
 
9460 9460
 					print '<br>';
9461 9461
 					print '<!-- form to add a link from object to same thirdparty -->'."\n";
9462
-					print '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST" name="formlinked' . $key . '">';
9462
+					print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" name="formlinked'.$key.'">';
9463 9463
 					print '<input type="hidden" name="action" value="addlink">';
9464
-					print '<input type="hidden" name="token" value="' . newToken() . '">';
9465
-					print '<input type="hidden" name="id" value="' . $object->id . '">';
9466
-					print '<input type="hidden" name="addlink" value="' . $key . '">';
9464
+					print '<input type="hidden" name="token" value="'.newToken().'">';
9465
+					print '<input type="hidden" name="id" value="'.$object->id.'">';
9466
+					print '<input type="hidden" name="addlink" value="'.$key.'">';
9467 9467
 					print '<table class="noborder">';
9468 9468
 					print '<tr class="liste_titre">';
9469 9469
 					print '<td class="nowrap"></td>';
9470
-					print '<td class="center">' . $langs->trans("Ref") . '</td>';
9471
-					print '<td class="left">' . $langs->trans("RefCustomer") . '</td>';
9472
-					print '<td class="right">' . $langs->trans("AmountHTShort") . '</td>';
9473
-					print '<td class="left">' . $langs->trans("Company") . '</td>';
9470
+					print '<td class="center">'.$langs->trans("Ref").'</td>';
9471
+					print '<td class="left">'.$langs->trans("RefCustomer").'</td>';
9472
+					print '<td class="right">'.$langs->trans("AmountHTShort").'</td>';
9473
+					print '<td class="left">'.$langs->trans("Company").'</td>';
9474 9474
 					print '</tr>';
9475 9475
 					while ($i < $num) {
9476 9476
 						$objp = $this->db->fetch_object($resqllist);
9477 9477
 
9478 9478
 						print '<tr class="oddeven">';
9479 9479
 						print '<td class="left">';
9480
-						print '<input type="radio" name="idtolinkto" id="' . $key . '_' . $objp->rowid . '" value="' . $objp->rowid . '">';
9480
+						print '<input type="radio" name="idtolinkto" id="'.$key.'_'.$objp->rowid.'" value="'.$objp->rowid.'">';
9481 9481
 						print '</td>';
9482
-						print '<td class="center"><label for="' . $key . '_' . $objp->rowid . '">' . $objp->ref . '</label></td>';
9483
-						print '<td>' . (!empty($objp->ref_client) ? $objp->ref_client : (!empty($objp->ref_supplier) ? $objp->ref_supplier : '')) . '</td>';
9482
+						print '<td class="center"><label for="'.$key.'_'.$objp->rowid.'">'.$objp->ref.'</label></td>';
9483
+						print '<td>'.(!empty($objp->ref_client) ? $objp->ref_client : (!empty($objp->ref_supplier) ? $objp->ref_supplier : '')).'</td>';
9484 9484
 						print '<td class="right">';
9485 9485
 						if ($possiblelink['label'] == 'LinkToContract') {
9486 9486
 							$form = new Form($this->db);
9487
-							print $form->textwithpicto('', $langs->trans("InformationOnLinkToContract")) . ' ';
9487
+							print $form->textwithpicto('', $langs->trans("InformationOnLinkToContract")).' ';
9488 9488
 						}
9489
-						print '<span class="amount">' . (isset($objp->total_ht) ? price($objp->total_ht) : '') . '</span>';
9489
+						print '<span class="amount">'.(isset($objp->total_ht) ? price($objp->total_ht) : '').'</span>';
9490 9490
 						print '</td>';
9491
-						print '<td>' . $objp->name . '</td>';
9491
+						print '<td>'.$objp->name.'</td>';
9492 9492
 						print '</tr>';
9493 9493
 						$i++;
9494 9494
 					}
9495 9495
 					print '</table>';
9496 9496
 					print '<div class="center">';
9497 9497
 					if ($num) {
9498
-						print '<input type="submit" class="button valignmiddle marginleftonly marginrightonly small" value="' . $langs->trans('ToLink') . '">';
9498
+						print '<input type="submit" class="button valignmiddle marginleftonly marginrightonly small" value="'.$langs->trans('ToLink').'">';
9499 9499
 					}
9500 9500
 					if (empty($conf->use_javascript_ajax)) {
9501
-						print '<input type="submit" class="button button-cancel marginleftonly marginrightonly small" name="cancel" value="' . $langs->trans("Cancel") . '"></div>';
9501
+						print '<input type="submit" class="button button-cancel marginleftonly marginrightonly small" name="cancel" value="'.$langs->trans("Cancel").'"></div>';
9502 9502
 					} else {
9503
-						print '<input type="submit" onclick="jQuery(\'#' . $key . 'list\').toggle(); return false;" class="button button-cancel marginleftonly marginrightonly small" name="cancel" value="' . $langs->trans("Cancel") . '"></div>';
9503
+						print '<input type="submit" onclick="jQuery(\'#'.$key.'list\').toggle(); return false;" class="button button-cancel marginleftonly marginrightonly small" name="cancel" value="'.$langs->trans("Cancel").'"></div>';
9504 9504
 					}
9505 9505
 					print '</form>';
9506 9506
 					$this->db->free($resqllist);
@@ -9511,10 +9511,10 @@  discard block
 block discarded – undo
9511 9511
 
9512 9512
 				//$linktoelem.=($linktoelem?' &nbsp; ':'');
9513 9513
 				if ($num > 0 || getDolGlobalString('MAIN_LINK_BY_REF_IN_LINKTO')) {
9514
-					$linktoelemlist .= '<li><a href="#linkto' . $key . '" class="linkto dropdowncloseonclick" rel="' . $key . '">' . $langs->trans($possiblelink['label']) . ' (' . $num . ')</a></li>';
9514
+					$linktoelemlist .= '<li><a href="#linkto'.$key.'" class="linkto dropdowncloseonclick" rel="'.$key.'">'.$langs->trans($possiblelink['label']).' ('.$num.')</a></li>';
9515 9515
 					// } else $linktoelem.=$langs->trans($possiblelink['label']);
9516 9516
 				} else {
9517
-					$linktoelemlist .= '<li><span class="linktodisabled">' . $langs->trans($possiblelink['label']) . ' (0)</span></li>';
9517
+					$linktoelemlist .= '<li><span class="linktodisabled">'.$langs->trans($possiblelink['label']).' (0)</span></li>';
9518 9518
 				}
9519 9519
 			}
9520 9520
 		}
@@ -9524,22 +9524,22 @@  discard block
 block discarded – undo
9524 9524
     		<dl class="dropdown" id="linktoobjectname">
9525 9525
     		';
9526 9526
 			if (!empty($conf->use_javascript_ajax)) {
9527
-				$linktoelem .= '<dt><a href="#linktoobjectname"><span class="fas fa-link paddingrightonly"></span>' . $langs->trans("LinkTo") . '...</a></dt>';
9527
+				$linktoelem .= '<dt><a href="#linktoobjectname"><span class="fas fa-link paddingrightonly"></span>'.$langs->trans("LinkTo").'...</a></dt>';
9528 9528
 			}
9529 9529
 			$linktoelem .= '<dd>
9530 9530
     		<div class="multiselectlinkto">
9531
-    		<ul class="ulselectedfields">' . $linktoelemlist . '
9531
+    		<ul class="ulselectedfields">' . $linktoelemlist.'
9532 9532
     		</ul>
9533 9533
     		</div>
9534 9534
     		</dd>
9535 9535
     		</dl>';
9536 9536
 		} else {
9537
-			$linktoelem = '';  // @phan-suppress-current-line PhanPluginRedundantAssignment
9537
+			$linktoelem = ''; // @phan-suppress-current-line PhanPluginRedundantAssignment
9538 9538
 		}
9539 9539
 
9540 9540
 		if (!empty($conf->use_javascript_ajax)) {
9541 9541
 			print '<!-- Add js to show linkto box -->
9542
-				<script nonce="' . getNonce() . '">
9542
+				<script nonce="' . getNonce().'">
9543 9543
 				jQuery(document).ready(function() {
9544 9544
 					jQuery(".linkto").click(function() {
9545 9545
 						console.log("We choose to show/hide links for rel="+jQuery(this).attr(\'rel\')+" so #"+jQuery(this).attr(\'rel\')+"list");
@@ -9580,19 +9580,19 @@  discard block
 block discarded – undo
9580 9580
 
9581 9581
 		$disabled = ($disabled ? ' disabled' : '');
9582 9582
 
9583
-		$resultyesno = '<select class="flat width75' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . '"' . $disabled . '>' . "\n";
9583
+		$resultyesno = '<select class="flat width75'.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.'"'.$disabled.'>'."\n";
9584 9584
 		if ($useempty) {
9585
-			$resultyesno .= '<option value="-1"' . (($value < 0) ? ' selected' : '') . '>&nbsp;</option>' . "\n";
9585
+			$resultyesno .= '<option value="-1"'.(($value < 0) ? ' selected' : '').'>&nbsp;</option>'."\n";
9586 9586
 		}
9587 9587
 		if (("$value" == 'yes') || ($value == 1)) {
9588
-			$resultyesno .= '<option value="' . $yes . '" selected>' . $langs->trans($labelyes) . '</option>' . "\n";
9589
-			$resultyesno .= '<option value="' . $no . '">' . $langs->trans($labelno) . '</option>' . "\n";
9588
+			$resultyesno .= '<option value="'.$yes.'" selected>'.$langs->trans($labelyes).'</option>'."\n";
9589
+			$resultyesno .= '<option value="'.$no.'">'.$langs->trans($labelno).'</option>'."\n";
9590 9590
 		} else {
9591 9591
 			$selected = (($useempty && $value != '0' && $value != 'no') ? '' : ' selected');
9592
-			$resultyesno .= '<option value="' . $yes . '">' . $langs->trans($labelyes) . '</option>' . "\n";
9593
-			$resultyesno .= '<option value="' . $no . '"' . $selected . '>' . $langs->trans($labelno) . '</option>' . "\n";
9592
+			$resultyesno .= '<option value="'.$yes.'">'.$langs->trans($labelyes).'</option>'."\n";
9593
+			$resultyesno .= '<option value="'.$no.'"'.$selected.'>'.$langs->trans($labelno).'</option>'."\n";
9594 9594
 		}
9595
-		$resultyesno .= '</select>' . "\n";
9595
+		$resultyesno .= '</select>'."\n";
9596 9596
 
9597 9597
 		if ($addjscombo) {
9598 9598
 			$resultyesno .= ajax_combobox($htmlname, array(), 0, 0, 'resolve', ($useempty < 0 ? (string) $useempty : '-1'), $morecss);
@@ -9616,12 +9616,12 @@  discard block
 block discarded – undo
9616 9616
 	{
9617 9617
 		// phpcs:enable
9618 9618
 		$sql = "SELECT rowid, label";
9619
-		$sql .= " FROM " . $this->db->prefix() . "export_model";
9620
-		$sql .= " WHERE type = '" . $this->db->escape($type) . "'";
9619
+		$sql .= " FROM ".$this->db->prefix()."export_model";
9620
+		$sql .= " WHERE type = '".$this->db->escape($type)."'";
9621 9621
 		$sql .= " ORDER BY rowid";
9622 9622
 		$result = $this->db->query($sql);
9623 9623
 		if ($result) {
9624
-			print '<select class="flat" id="select_' . $htmlname . '" name="' . $htmlname . '">';
9624
+			print '<select class="flat" id="select_'.$htmlname.'" name="'.$htmlname.'">';
9625 9625
 			if ($useempty) {
9626 9626
 				print '<option value="-1">&nbsp;</option>';
9627 9627
 			}
@@ -9631,9 +9631,9 @@  discard block
 block discarded – undo
9631 9631
 			while ($i < $num) {
9632 9632
 				$obj = $this->db->fetch_object($result);
9633 9633
 				if ($selected == $obj->rowid) {
9634
-					print '<option value="' . $obj->rowid . '" selected>';
9634
+					print '<option value="'.$obj->rowid.'" selected>';
9635 9635
 				} else {
9636
-					print '<option value="' . $obj->rowid . '">';
9636
+					print '<option value="'.$obj->rowid.'">';
9637 9637
 				}
9638 9638
 				print $obj->label;
9639 9639
 				print '</option>';
@@ -9724,8 +9724,8 @@  discard block
 block discarded – undo
9724 9724
 				$stringforfirstkey .= ' CTL +';
9725 9725
 			}
9726 9726
 
9727
-			$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>';
9728
-			$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>';
9727
+			$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>';
9728
+			$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>';
9729 9729
 		}
9730 9730
 
9731 9731
 		//print "xx".$previous_ref."x".$next_ref;
@@ -9733,18 +9733,18 @@  discard block
 block discarded – undo
9733 9733
 
9734 9734
 		// Right part of banner
9735 9735
 		if ($morehtmlright) {
9736
-			$ret .= '<div class="inline-block floatleft">' . $morehtmlright . '</div>';
9736
+			$ret .= '<div class="inline-block floatleft">'.$morehtmlright.'</div>';
9737 9737
 		}
9738 9738
 
9739 9739
 		if ($previous_ref || $next_ref || $morehtml) {
9740 9740
 			$ret .= '<div class="pagination paginationref"><ul class="right">';
9741 9741
 		}
9742 9742
 		if ($morehtml && getDolGlobalInt('MAIN_OPTIMIZEFORTEXTBROWSER') < 2) {
9743
-			$ret .= '<!-- morehtml --><li class="noborder litext' . (($shownav && $previous_ref && $next_ref) ? ' clearbothonsmartphone' : '') . '">' . $morehtml . '</li>';
9743
+			$ret .= '<!-- morehtml --><li class="noborder litext'.(($shownav && $previous_ref && $next_ref) ? ' clearbothonsmartphone' : '').'">'.$morehtml.'</li>';
9744 9744
 		}
9745 9745
 		if ($shownav && ($previous_ref || $next_ref)) {
9746
-			$ret .= '<li class="pagination">' . $previous_ref . '</li>';
9747
-			$ret .= '<li class="pagination">' . $next_ref . '</li>';
9746
+			$ret .= '<li class="pagination">'.$previous_ref.'</li>';
9747
+			$ret .= '<li class="pagination">'.$next_ref.'</li>';
9748 9748
 		}
9749 9749
 		if ($previous_ref || $next_ref || $morehtml) {
9750 9750
 			$ret .= '</ul></div>';
@@ -9759,7 +9759,7 @@  discard block
 block discarded – undo
9759 9759
 			$morehtmlstatus = $hookmanager->resPrint;
9760 9760
 		}
9761 9761
 		if ($morehtmlstatus) {
9762
-			$ret .= '<div class="statusref">' . $morehtmlstatus . '</div>';
9762
+			$ret .= '<div class="statusref">'.$morehtmlstatus.'</div>';
9763 9763
 		}
9764 9764
 
9765 9765
 		$parameters = array();
@@ -9773,14 +9773,14 @@  discard block
 block discarded – undo
9773 9773
 		// Left part of banner
9774 9774
 		if ($morehtmlleft) {
9775 9775
 			if ($conf->browser->layout == 'phone') {
9776
-				$ret .= '<!-- morehtmlleft --><div class="floatleft">' . $morehtmlleft . '</div>';
9776
+				$ret .= '<!-- morehtmlleft --><div class="floatleft">'.$morehtmlleft.'</div>';
9777 9777
 			} else {
9778
-				$ret .= '<!-- morehtmlleft --><div class="inline-block floatleft">' . $morehtmlleft . '</div>';
9778
+				$ret .= '<!-- morehtmlleft --><div class="inline-block floatleft">'.$morehtmlleft.'</div>';
9779 9779
 			}
9780 9780
 		}
9781 9781
 
9782 9782
 		//if ($conf->browser->layout == 'phone') $ret.='<div class="clearboth"></div>';
9783
-		$ret .= '<div class="inline-block floatleft valignmiddle maxwidth750 marginbottomonly refid' . (($shownav && ($previous_ref || $next_ref)) ? ' refidpadding' : '') . '">';
9783
+		$ret .= '<div class="inline-block floatleft valignmiddle maxwidth750 marginbottomonly refid'.(($shownav && ($previous_ref || $next_ref)) ? ' refidpadding' : '').'">';
9784 9784
 
9785 9785
 		// For thirdparty, contact, user, member, the ref is the id, so we show something else
9786 9786
 		if ($object->element == 'societe') {
@@ -9794,7 +9794,7 @@  discard block
 block discarded – undo
9794 9794
 
9795 9795
 			if (is_array($arrayoflangcode) && count($arrayoflangcode)) {
9796 9796
 				if (!is_object($extralanguages)) {
9797
-					include_once DOL_DOCUMENT_ROOT . '/core/class/extralanguages.class.php';
9797
+					include_once DOL_DOCUMENT_ROOT.'/core/class/extralanguages.class.php';
9798 9798
 					$extralanguages = new ExtraLanguages($this->db);
9799 9799
 				}
9800 9800
 				$extralanguages->fetch_name_extralanguages('societe');
@@ -9809,29 +9809,29 @@  discard block
 block discarded – undo
9809 9809
 						if ($object->array_languages['name'][$extralangcode]) {
9810 9810
 							$htmltext .= $object->array_languages['name'][$extralangcode];
9811 9811
 						} else {
9812
-							$htmltext .= '<span class="opacitymedium">' . $langs->trans("SwitchInEditModeToAddTranslation") . '</span>';
9812
+							$htmltext .= '<span class="opacitymedium">'.$langs->trans("SwitchInEditModeToAddTranslation").'</span>';
9813 9813
 						}
9814 9814
 					}
9815
-					$ret .= '<!-- Show translations of name -->' . "\n";
9815
+					$ret .= '<!-- Show translations of name -->'."\n";
9816 9816
 					$ret .= $this->textwithpicto('', $htmltext, -1, 'language', 'opacitymedium paddingleft');
9817 9817
 				}
9818 9818
 			}
9819 9819
 		} elseif ($object->element == 'member') {
9820 9820
 			'@phan-var-force Adherent $object';
9821
-			$ret .= $object->ref . '<br>';
9821
+			$ret .= $object->ref.'<br>';
9822 9822
 			$fullname = $object->getFullName($langs);
9823 9823
 			if ($object->morphy == 'mor' && $object->societe) {
9824
-				$ret .= dol_htmlentities($object->societe) . ((!empty($fullname) && $object->societe != $fullname) ? ' (' . dol_htmlentities($fullname) . $addgendertxt . ')' : '');
9824
+				$ret .= dol_htmlentities($object->societe).((!empty($fullname) && $object->societe != $fullname) ? ' ('.dol_htmlentities($fullname).$addgendertxt.')' : '');
9825 9825
 			} else {
9826
-				$ret .= dol_htmlentities($fullname) . $addgendertxt . ((!empty($object->societe) && $object->societe != $fullname) ? ' (' . dol_htmlentities($object->societe) . ')' : '');
9826
+				$ret .= dol_htmlentities($fullname).$addgendertxt.((!empty($object->societe) && $object->societe != $fullname) ? ' ('.dol_htmlentities($object->societe).')' : '');
9827 9827
 			}
9828 9828
 		} elseif (in_array($object->element, array('contact', 'user'))) {
9829
-			$ret .= dol_htmlentities($object->getFullName($langs)) . $addgendertxt;
9829
+			$ret .= dol_htmlentities($object->getFullName($langs)).$addgendertxt;
9830 9830
 		} elseif ($object->element == 'usergroup') {
9831 9831
 			$ret .= dol_htmlentities($object->name);
9832 9832
 		} elseif (in_array($object->element, array('action', 'agenda'))) {
9833 9833
 			'@phan-var-force ActionComm $object';
9834
-			$ret .= $object->ref . '<br>' . $object->label;
9834
+			$ret .= $object->ref.'<br>'.$object->label;
9835 9835
 		} elseif (in_array($object->element, array('adherent_type'))) {
9836 9836
 			$ret .= $object->label;
9837 9837
 		} elseif ($object->element == 'ecm_directories') {
@@ -9884,9 +9884,9 @@  discard block
 block discarded – undo
9884 9884
 		}
9885 9885
 
9886 9886
 		// Barcode image  @phan-suppress-next-line PhanUndeclaredProperty
9887
-		$url = DOL_URL_ROOT . '/viewimage.php?modulepart=barcode&generator=' . urlencode($object->barcode_type_coder) . '&code=' . urlencode($object->barcode) . '&encoding=' . urlencode($object->barcode_type_code);
9888
-		$out = '<!-- url barcode = ' . $url . ' -->';
9889
-		$out .= '<img src="' . $url . '"' . ($morecss ? ' class="' . $morecss . '"' : '') . '>';
9887
+		$url = DOL_URL_ROOT.'/viewimage.php?modulepart=barcode&generator='.urlencode($object->barcode_type_coder).'&code='.urlencode($object->barcode).'&encoding='.urlencode($object->barcode_type_code);
9888
+		$out = '<!-- url barcode = '.$url.' -->';
9889
+		$out .= '<img src="'.$url.'"'.($morecss ? ' class="'.$morecss.'"' : '').'>';
9890 9890
 
9891 9891
 		return $out;
9892 9892
 	}
@@ -9913,7 +9913,7 @@  discard block
 block discarded – undo
9913 9913
 		global $conf, $langs;
9914 9914
 
9915 9915
 		$entity = (empty($object->entity) ? $conf->entity : $object->entity);
9916
-		$id = (empty($object->id) ? $object->rowid : $object->id);  // @phan-suppress-current-line PhanUndeclaredProperty (->rowid)
9916
+		$id = (empty($object->id) ? $object->rowid : $object->id); // @phan-suppress-current-line PhanUndeclaredProperty (->rowid)
9917 9917
 
9918 9918
 		$dir = '';
9919 9919
 		$file = '';
@@ -9926,28 +9926,28 @@  discard block
 block discarded – undo
9926 9926
 			if (!empty($object->logo)) {
9927 9927
 				if (dolIsAllowedForPreview($object->logo)) {
9928 9928
 					if ((string) $imagesize == 'mini') {
9929
-						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . getImageFileNameForSize($object->logo, '_mini'); // getImageFileNameForSize include the thumbs
9929
+						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.getImageFileNameForSize($object->logo, '_mini'); // getImageFileNameForSize include the thumbs
9930 9930
 					} elseif ((string) $imagesize == 'small') {
9931
-						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . getImageFileNameForSize($object->logo, '_small');
9931
+						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.getImageFileNameForSize($object->logo, '_small');
9932 9932
 					} else {
9933
-						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . $object->logo;
9933
+						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.$object->logo;
9934 9934
 					}
9935
-					$originalfile = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . $object->logo;
9935
+					$originalfile = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.$object->logo;
9936 9936
 				}
9937 9937
 			}
9938 9938
 			$email = $object->email;
9939 9939
 		} elseif ($modulepart == 'contact') {
9940
-			$dir = $conf->societe->multidir_output[$entity] . '/contact';
9940
+			$dir = $conf->societe->multidir_output[$entity].'/contact';
9941 9941
 			if (!empty($object->photo)) {
9942 9942
 				if (dolIsAllowedForPreview($object->photo)) {
9943 9943
 					if ((string) $imagesize == 'mini') {
9944
-						$file = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . getImageFileNameForSize($object->photo, '_mini');
9944
+						$file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.getImageFileNameForSize($object->photo, '_mini');
9945 9945
 					} elseif ((string) $imagesize == 'small') {
9946
-						$file = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . getImageFileNameForSize($object->photo, '_small');
9946
+						$file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.getImageFileNameForSize($object->photo, '_small');
9947 9947
 					} else {
9948
-						$file = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . $object->photo;
9948
+						$file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.$object->photo;
9949 9949
 					}
9950
-					$originalfile = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . $object->photo;
9950
+					$originalfile = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.$object->photo;
9951 9951
 				}
9952 9952
 			}
9953 9953
 			$email = $object->email;
@@ -9957,17 +9957,17 @@  discard block
 block discarded – undo
9957 9957
 			if (!empty($object->photo)) {
9958 9958
 				if (dolIsAllowedForPreview($object->photo)) {
9959 9959
 					if ((string) $imagesize == 'mini') {
9960
-						$file = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . getImageFileNameForSize($object->photo, '_mini');
9960
+						$file = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.getImageFileNameForSize($object->photo, '_mini');
9961 9961
 					} elseif ((string) $imagesize == 'small') {
9962
-						$file = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . getImageFileNameForSize($object->photo, '_small');
9962
+						$file = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.getImageFileNameForSize($object->photo, '_small');
9963 9963
 					} else {
9964
-						$file = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . $object->photo;
9964
+						$file = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.$object->photo;
9965 9965
 					}
9966
-					$originalfile = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . $object->photo;
9966
+					$originalfile = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.$object->photo;
9967 9967
 				}
9968 9968
 			}
9969 9969
 			if (getDolGlobalString('MAIN_OLD_IMAGE_LINKS')) {
9970
-				$altfile = $object->id . ".jpg"; // For backward compatibility
9970
+				$altfile = $object->id.".jpg"; // For backward compatibility
9971 9971
 			}
9972 9972
 			$email = $object->email;
9973 9973
 			$capture = 'user';
@@ -9976,17 +9976,17 @@  discard block
 block discarded – undo
9976 9976
 			if (!empty($object->photo)) {
9977 9977
 				if (dolIsAllowedForPreview($object->photo)) {
9978 9978
 					if ((string) $imagesize == 'mini') {
9979
-						$file = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . getImageFileNameForSize($object->photo, '_mini');
9979
+						$file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_mini');
9980 9980
 					} elseif ((string) $imagesize == 'small') {
9981
-						$file = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . getImageFileNameForSize($object->photo, '_small');
9981
+						$file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_small');
9982 9982
 					} else {
9983
-						$file = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . $object->photo;
9983
+						$file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.$object->photo;
9984 9984
 					}
9985
-					$originalfile = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . $object->photo;
9985
+					$originalfile = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.$object->photo;
9986 9986
 				}
9987 9987
 			}
9988 9988
 			if (getDolGlobalString('MAIN_OLD_IMAGE_LINKS')) {
9989
-				$altfile = $object->id . ".jpg"; // For backward compatibility
9989
+				$altfile = $object->id.".jpg"; // For backward compatibility
9990 9990
 			}
9991 9991
 			$email = $object->email;
9992 9992
 			$capture = 'user';
@@ -10012,35 +10012,35 @@  discard block
 block discarded – undo
10012 10012
 		$ret = '';
10013 10013
 
10014 10014
 		if ($dir) {
10015
-			if ($file && file_exists($dir . "/" . $file)) {
10015
+			if ($file && file_exists($dir."/".$file)) {
10016 10016
 				if ($addlinktofullsize) {
10017
-					$urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity=' . $entity);
10017
+					$urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity='.$entity);
10018 10018
 					if ($urladvanced) {
10019
-						$ret .= '<a href="' . $urladvanced . '">';
10019
+						$ret .= '<a href="'.$urladvanced.'">';
10020 10020
 					} else {
10021
-						$ret .= '<a href="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($originalfile) . '&cache=' . $cache . '">';
10021
+						$ret .= '<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($originalfile).'&cache='.$cache.'">';
10022 10022
 					}
10023 10023
 				}
10024
-				$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 . '">';
10024
+				$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.'">';
10025 10025
 				if ($addlinktofullsize) {
10026 10026
 					$ret .= '</a>';
10027 10027
 				}
10028
-			} elseif ($altfile && file_exists($dir . "/" . $altfile)) {
10028
+			} elseif ($altfile && file_exists($dir."/".$altfile)) {
10029 10029
 				if ($addlinktofullsize) {
10030
-					$urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity=' . $entity);
10030
+					$urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity='.$entity);
10031 10031
 					if ($urladvanced) {
10032
-						$ret .= '<a href="' . $urladvanced . '">';
10032
+						$ret .= '<a href="'.$urladvanced.'">';
10033 10033
 					} else {
10034
-						$ret .= '<a href="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($originalfile) . '&cache=' . $cache . '">';
10034
+						$ret .= '<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($originalfile).'&cache='.$cache.'">';
10035 10035
 					}
10036 10036
 				}
10037
-				$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 . '">';
10037
+				$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.'">';
10038 10038
 				if ($addlinktofullsize) {
10039 10039
 					$ret .= '</a>';
10040 10040
 				}
10041 10041
 			} else {
10042 10042
 				$nophoto = '/public/theme/common/nophoto.png';
10043
-				$defaultimg = 'identicon';        // For gravatar
10043
+				$defaultimg = 'identicon'; // For gravatar
10044 10044
 				if (in_array($modulepart, array('societe', 'userphoto', 'contact', 'memberphoto'))) {    // For modules that need a special image when photo not found
10045 10045
 					if ($modulepart == 'societe' || ($modulepart == 'memberphoto' && !empty($object->morphy) && strpos($object->morphy, 'mor') !== false)) {
10046 10046
 						$nophoto = 'company';
@@ -10058,13 +10058,13 @@  discard block
 block discarded – undo
10058 10058
 				if (isModEnabled('gravatar') && $email && empty($noexternsourceoverwrite)) {
10059 10059
 					// see https://gravatar.com/site/implement/images/php/
10060 10060
 					$ret .= '<!-- Put link to gravatar -->';
10061
-					$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
10061
+					$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
10062 10062
 				} else {
10063 10063
 					if ($nophoto == 'company') {
10064
-						$ret .= '<div class="divforspanimg valignmiddle center photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . '>' . img_picto('', 'company') . '</div>';
10064
+						$ret .= '<div class="divforspanimg valignmiddle center photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').'>'.img_picto('', 'company').'</div>';
10065 10065
 						//$ret .= '<div class="difforspanimgright"></div>';
10066 10066
 					} else {
10067
-						$ret .= '<img class="photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . ' src="' . DOL_URL_ROOT . $nophoto . '">';
10067
+						$ret .= '<img class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').' src="'.DOL_URL_ROOT.$nophoto.'">';
10068 10068
 					}
10069 10069
 				}
10070 10070
 			}
@@ -10075,15 +10075,15 @@  discard block
 block discarded – undo
10075 10075
 				}
10076 10076
 				$ret .= '<table class="nobordernopadding centpercent">';
10077 10077
 				if ($object->photo) {
10078
-					$ret .= '<tr><td><input type="checkbox" class="flat photodelete" name="deletephoto" id="photodelete"> <label for="photodelete">' . $langs->trans("Delete") . '</label><br><br></td></tr>';
10078
+					$ret .= '<tr><td><input type="checkbox" class="flat photodelete" name="deletephoto" id="photodelete"> <label for="photodelete">'.$langs->trans("Delete").'</label><br><br></td></tr>';
10079 10079
 				}
10080 10080
 				$ret .= '<tr><td class="tdoverflow">';
10081 10081
 				$maxfilesizearray = getMaxFileSizeArray();
10082 10082
 				$maxmin = $maxfilesizearray['maxmin'];
10083 10083
 				if ($maxmin > 0) {
10084
-					$ret .= '<input type="hidden" name="MAX_FILE_SIZE" value="' . ($maxmin * 1024) . '">';    // MAX_FILE_SIZE must precede the field type=file
10084
+					$ret .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file
10085 10085
 				}
10086
-				$ret .= '<input type="file" class="flat maxwidth200onsmartphone" name="photo" id="photoinput" accept="image/*"' . ($capture ? ' capture="' . $capture . '"' : '') . '>';
10086
+				$ret .= '<input type="file" class="flat maxwidth200onsmartphone" name="photo" id="photoinput" accept="image/*"'.($capture ? ' capture="'.$capture.'"' : '').'>';
10087 10087
 				$ret .= '</td></tr>';
10088 10088
 				$ret .= '</table>';
10089 10089
 			}
@@ -10137,38 +10137,38 @@  discard block
 block discarded – undo
10137 10137
 		if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) {
10138 10138
 			$sql .= ", e.label";
10139 10139
 		}
10140
-		$sql .= " FROM " . $this->db->prefix() . "usergroup as ug ";
10140
+		$sql .= " FROM ".$this->db->prefix()."usergroup as ug ";
10141 10141
 		if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) {
10142
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "entity as e ON e.rowid=ug.entity";
10142
+			$sql .= " LEFT JOIN ".$this->db->prefix()."entity as e ON e.rowid=ug.entity";
10143 10143
 			if ($force_entity) {
10144
-				$sql .= " WHERE ug.entity IN (0, " . $force_entity . ")";
10144
+				$sql .= " WHERE ug.entity IN (0, ".$force_entity.")";
10145 10145
 			} else {
10146 10146
 				$sql .= " WHERE ug.entity IS NOT NULL";
10147 10147
 			}
10148 10148
 		} else {
10149
-			$sql .= " WHERE ug.entity IN (0, " . $conf->entity . ")";
10149
+			$sql .= " WHERE ug.entity IN (0, ".$conf->entity.")";
10150 10150
 		}
10151 10151
 		if (is_array($exclude) && $excludeGroups) {
10152
-			$sql .= " AND ug.rowid NOT IN (" . $this->db->sanitize($excludeGroups) . ")";
10152
+			$sql .= " AND ug.rowid NOT IN (".$this->db->sanitize($excludeGroups).")";
10153 10153
 		}
10154 10154
 		if (is_array($include) && $includeGroups) {
10155
-			$sql .= " AND ug.rowid IN (" . $this->db->sanitize($includeGroups) . ")";
10155
+			$sql .= " AND ug.rowid IN (".$this->db->sanitize($includeGroups).")";
10156 10156
 		}
10157 10157
 		$sql .= " ORDER BY ug.nom ASC";
10158 10158
 
10159
-		dol_syslog(get_class($this) . "::select_dolgroups", LOG_DEBUG);
10159
+		dol_syslog(get_class($this)."::select_dolgroups", LOG_DEBUG);
10160 10160
 		$resql = $this->db->query($sql);
10161 10161
 		if ($resql) {
10162 10162
 			// Enhance with select2
10163
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
10163
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
10164 10164
 
10165
-			$out .= '<select class="flat minwidth200' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . ' ' . ($disabled ? ' disabled' : '') . '>';
10165
+			$out .= '<select class="flat minwidth200'.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.($disabled ? ' disabled' : '').'>';
10166 10166
 
10167 10167
 			$num = $this->db->num_rows($resql);
10168 10168
 			$i = 0;
10169 10169
 			if ($num) {
10170 10170
 				if ($show_empty && !$multiple) {
10171
-					$out .= '<option value="-1"' . (in_array(-1, $selected) ? ' selected' : '') . '>&nbsp;</option>' . "\n";
10171
+					$out .= '<option value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'>&nbsp;</option>'."\n";
10172 10172
 				}
10173 10173
 
10174 10174
 				while ($i < $num) {
@@ -10181,11 +10181,11 @@  discard block
 block discarded – undo
10181 10181
 					$label = $obj->name;
10182 10182
 					$labelhtml = $obj->name;
10183 10183
 					if (isModEnabled('multicompany') && !getDolGlobalInt('MULTICOMPANY_TRANSVERSE_MODE') && $conf->entity == 1) {
10184
-						$label .= " (" . $obj->label . ")";
10185
-						$labelhtml .= ' <span class="opacitymedium">(' . $obj->label . ')</span>';
10184
+						$label .= " (".$obj->label.")";
10185
+						$labelhtml .= ' <span class="opacitymedium">('.$obj->label.')</span>';
10186 10186
 					}
10187 10187
 
10188
-					$out .= '<option value="' . $obj->rowid . '"';
10188
+					$out .= '<option value="'.$obj->rowid.'"';
10189 10189
 					if ($disableline) {
10190 10190
 						$out .= ' disabled';
10191 10191
 					}
@@ -10201,9 +10201,9 @@  discard block
 block discarded – undo
10201 10201
 				}
10202 10202
 			} else {
10203 10203
 				if ($show_empty) {
10204
-					$out .= '<option value="-1"' . (in_array(-1, $selected) ? ' selected' : '') . '></option>' . "\n";
10204
+					$out .= '<option value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'></option>'."\n";
10205 10205
 				}
10206
-				$out .= '<option value="" disabled>' . $langs->trans("NoUserGroupDefined") . '</option>';
10206
+				$out .= '<option value="" disabled>'.$langs->trans("NoUserGroupDefined").'</option>';
10207 10207
 			}
10208 10208
 			$out .= '</select>';
10209 10209
 
@@ -10247,25 +10247,25 @@  discard block
 block discarded – undo
10247 10247
 		$out = '';
10248 10248
 
10249 10249
 		if (!empty($conf->use_javascript_ajax)) {
10250
-			$out .= '<div class="inline-block checkallactions"><input type="checkbox" id="' . $cssclass . 's" name="' . $cssclass . 's" class="checkallactions"></div>';
10250
+			$out .= '<div class="inline-block checkallactions"><input type="checkbox" id="'.$cssclass.'s" name="'.$cssclass.'s" class="checkallactions"></div>';
10251 10251
 		}
10252
-		$out .= '<script nonce="' . getNonce() . '">
10252
+		$out .= '<script nonce="'.getNonce().'">
10253 10253
             $(document).ready(function() {
10254
-                $("#' . $cssclass . 's").click(function() {
10254
+                $("#' . $cssclass.'s").click(function() {
10255 10255
                     if($(this).is(\':checked\')){
10256
-                        console.log("We check all ' . $cssclass . ' and trigger the change method");
10257
-                		$(".' . $cssclass . '").prop(\'checked\', true).trigger(\'change\');
10256
+                        console.log("We check all ' . $cssclass.' and trigger the change method");
10257
+                		$(".' . $cssclass.'").prop(\'checked\', true).trigger(\'change\');
10258 10258
                     }
10259 10259
                     else
10260 10260
                     {
10261 10261
                         console.log("We uncheck all");
10262
-                		$(".' . $cssclass . '").prop(\'checked\', false).trigger(\'change\');
10262
+                		$(".' . $cssclass.'").prop(\'checked\', false).trigger(\'change\');
10263 10263
                     }' . "\n";
10264 10264
 		if ($calljsfunction) {
10265
-			$out .= 'if (typeof initCheckForSelect == \'function\') { initCheckForSelect(0, "' . $massactionname . '", "' . $cssclass . '"); } else { console.log("No function initCheckForSelect found. Call won\'t be done."); }';
10265
+			$out .= 'if (typeof initCheckForSelect == \'function\') { initCheckForSelect(0, "'.$massactionname.'", "'.$cssclass.'"); } else { console.log("No function initCheckForSelect found. Call won\'t be done."); }';
10266 10266
 		}
10267 10267
 		$out .= '         });
10268
-        	        $(".' . $cssclass . '").change(function() {
10268
+        	        $(".' . $cssclass.'").change(function() {
10269 10269
 					$(this).closest("tr").toggleClass("highlight", this.checked);
10270 10270
 				});
10271 10271
 		 	});
@@ -10310,67 +10310,67 @@  discard block
 block discarded – undo
10310 10310
 		global $langs, $user;
10311 10311
 
10312 10312
 		$out = '';
10313
-		$sql = "SELECT rowid, label FROM " . $this->db->prefix() . "c_exp_tax_cat WHERE active = 1";
10314
-		$sql .= " AND entity IN (0," . getEntity('exp_tax_cat') . ")";
10313
+		$sql = "SELECT rowid, label FROM ".$this->db->prefix()."c_exp_tax_cat WHERE active = 1";
10314
+		$sql .= " AND entity IN (0,".getEntity('exp_tax_cat').")";
10315 10315
 		if (!empty($excludeid)) {
10316
-			$sql .= " AND rowid NOT IN (" . $this->db->sanitize(implode(',', $excludeid)) . ")";
10316
+			$sql .= " AND rowid NOT IN (".$this->db->sanitize(implode(',', $excludeid)).")";
10317 10317
 		}
10318 10318
 		$sql .= " ORDER BY label";
10319 10319
 
10320 10320
 		$resql = $this->db->query($sql);
10321 10321
 		if ($resql) {
10322
-			$out = '<select id="select_' . $htmlname . '" name="' . $htmlname . '" class="' . $htmlname . ' flat minwidth75imp maxwidth200">';
10322
+			$out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp maxwidth200">';
10323 10323
 			if ($useempty) {
10324 10324
 				$out .= '<option value="0">&nbsp;</option>';
10325 10325
 			}
10326 10326
 
10327 10327
 			while ($obj = $this->db->fetch_object($resql)) {
10328
-				$out .= '<option ' . ($selected == $obj->rowid ? 'selected="selected"' : '') . ' value="' . $obj->rowid . '">' . $langs->trans($obj->label) . '</option>';
10328
+				$out .= '<option '.($selected == $obj->rowid ? 'selected="selected"' : '').' value="'.$obj->rowid.'">'.$langs->trans($obj->label).'</option>';
10329 10329
 			}
10330 10330
 			$out .= '</select>';
10331
-			$out .= ajax_combobox('select_' . $htmlname);
10331
+			$out .= ajax_combobox('select_'.$htmlname);
10332 10332
 
10333 10333
 			if (!empty($htmlname) && $user->admin && $info_admin) {
10334
-				$out .= ' ' . info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
10334
+				$out .= ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
10335 10335
 			}
10336 10336
 
10337 10337
 			if (!empty($target)) {
10338
-				$sql = "SELECT c.id FROM " . $this->db->prefix() . "c_type_fees as c WHERE c.code = 'EX_KME' AND c.active = 1";
10338
+				$sql = "SELECT c.id FROM ".$this->db->prefix()."c_type_fees as c WHERE c.code = 'EX_KME' AND c.active = 1";
10339 10339
 				$resql = $this->db->query($sql);
10340 10340
 				if ($resql) {
10341 10341
 					if ($this->db->num_rows($resql) > 0) {
10342 10342
 						$obj = $this->db->fetch_object($resql);
10343
-						$out .= '<script nonce="' . getNonce() . '">
10343
+						$out .= '<script nonce="'.getNonce().'">
10344 10344
 							$(function() {
10345
-								$("select[name=' . $target . ']").on("change", function() {
10345
+								$("select[name=' . $target.']").on("change", function() {
10346 10346
 									var current_val = $(this).val();
10347
-									if (current_val == ' . $obj->id . ') {';
10347
+									if (current_val == ' . $obj->id.') {';
10348 10348
 						if (!empty($default_selected) || !empty($selected)) {
10349
-							$out .= '$("select[name=' . $htmlname . ']").val("' . ($default_selected > 0 ? $default_selected : $selected) . '");';
10349
+							$out .= '$("select[name='.$htmlname.']").val("'.($default_selected > 0 ? $default_selected : $selected).'");';
10350 10350
 						}
10351 10351
 
10352 10352
 						$out .= '
10353
-										$("select[name=' . $htmlname . ']").change();
10353
+										$("select[name=' . $htmlname.']").change();
10354 10354
 									}
10355 10355
 								});
10356 10356
 
10357
-								$("select[name=' . $htmlname . ']").change(function() {
10357
+								$("select[name=' . $htmlname.']").change(function() {
10358 10358
 
10359
-									if ($("select[name=' . $target . ']").val() == ' . $obj->id . ') {
10359
+									if ($("select[name=' . $target.']").val() == '.$obj->id.') {
10360 10360
 										// get price of kilometer to fill the unit price
10361 10361
 										$.ajax({
10362 10362
 											method: "POST",
10363 10363
 											dataType: "json",
10364
-											data: { fk_c_exp_tax_cat: $(this).val(), token: \'' . currentToken() . '\' },
10365
-											url: "' . (DOL_URL_ROOT . '/expensereport/ajax/ajaxik.php?' . implode('&', $params)) . '",
10364
+											data: { fk_c_exp_tax_cat: $(this).val(), token: \'' . currentToken().'\' },
10365
+											url: "' . (DOL_URL_ROOT.'/expensereport/ajax/ajaxik.php?'.implode('&', $params)).'",
10366 10366
 										}).done(function( data, textStatus, jqXHR ) {
10367 10367
 											console.log(data);
10368 10368
 											if (typeof data.up != "undefined") {
10369 10369
 												$("input[name=value_unit]").val(data.up);
10370
-												$("select[name=' . $htmlname . ']").attr("title", data.title);
10370
+												$("select[name=' . $htmlname.']").attr("title", data.title);
10371 10371
 											} else {
10372 10372
 												$("input[name=value_unit]").val("");
10373
-												$("select[name=' . $htmlname . ']").attr("title", "");
10373
+												$("select[name=' . $htmlname.']").attr("title", "");
10374 10374
 											}
10375 10375
 										});
10376 10376
 									}
@@ -10400,18 +10400,18 @@  discard block
 block discarded – undo
10400 10400
 		global $conf, $langs;
10401 10401
 
10402 10402
 		$out = '';
10403
-		$sql = "SELECT rowid, range_ik FROM " . $this->db->prefix() . "c_exp_tax_range";
10404
-		$sql .= " WHERE entity = " . $conf->entity . " AND active = 1";
10403
+		$sql = "SELECT rowid, range_ik FROM ".$this->db->prefix()."c_exp_tax_range";
10404
+		$sql .= " WHERE entity = ".$conf->entity." AND active = 1";
10405 10405
 
10406 10406
 		$resql = $this->db->query($sql);
10407 10407
 		if ($resql) {
10408
-			$out = '<select id="select_' . $htmlname . '" name="' . $htmlname . '" class="' . $htmlname . ' flat minwidth75imp">';
10408
+			$out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp">';
10409 10409
 			if ($useempty) {
10410 10410
 				$out .= '<option value="0"></option>';
10411 10411
 			}
10412 10412
 
10413 10413
 			while ($obj = $this->db->fetch_object($resql)) {
10414
-				$out .= '<option ' . ($selected == $obj->rowid ? 'selected="selected"' : '') . ' value="' . $obj->rowid . '">' . price($obj->range_ik, 0, $langs, 1, 0) . '</option>';
10414
+				$out .= '<option '.($selected == $obj->rowid ? 'selected="selected"' : '').' value="'.$obj->rowid.'">'.price($obj->range_ik, 0, $langs, 1, 0).'</option>';
10415 10415
 			}
10416 10416
 			$out .= '</select>';
10417 10417
 		} else {
@@ -10442,12 +10442,12 @@  discard block
 block discarded – undo
10442 10442
 
10443 10443
 		$resql = $this->db->query($sql);
10444 10444
 		if ($resql) {
10445
-			$out = '<select id="select_' . $htmlname . '" name="' . $htmlname . '" class="' . $htmlname . ' flat minwidth75imp">';
10445
+			$out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp">';
10446 10446
 			if ($useempty) {
10447 10447
 				$out .= '<option value="0"></option>';
10448 10448
 			}
10449 10449
 			if ($allchoice) {
10450
-				$out .= '<option value="-1">' . $langs->trans('AllExpenseReport') . '</option>';
10450
+				$out .= '<option value="-1">'.$langs->trans('AllExpenseReport').'</option>';
10451 10451
 			}
10452 10452
 
10453 10453
 			$field = 'code';
@@ -10457,7 +10457,7 @@  discard block
 block discarded – undo
10457 10457
 
10458 10458
 			while ($obj = $this->db->fetch_object($resql)) {
10459 10459
 				$key = $langs->trans($obj->code);
10460
-				$out .= '<option ' . ($selected == $obj->{$field} ? 'selected="selected"' : '') . ' value="' . $obj->{$field} . '">' . ($key != $obj->code ? $key : $obj->label) . '</option>';
10460
+				$out .= '<option '.($selected == $obj->{$field} ? 'selected="selected"' : '').' value="'.$obj->{$field}.'">'.($key != $obj->code ? $key : $obj->label).'</option>';
10461 10461
 			}
10462 10462
 			$out .= '</select>';
10463 10463
 
@@ -10491,7 +10491,7 @@  discard block
 block discarded – undo
10491 10491
 	{
10492 10492
 		global $user, $conf, $langs;
10493 10493
 
10494
-		require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
10494
+		require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
10495 10495
 
10496 10496
 		if (is_null($usertofilter)) {
10497 10497
 			$usertofilter = $user;
@@ -10515,10 +10515,10 @@  discard block
 block discarded – undo
10515 10515
 		$sql = "SELECT f.rowid, f.ref as fref, 'nolabel' as flabel, p.rowid as pid, f.ref,
10516 10516
             p.title, p.fk_soc, p.fk_statut, p.public,";
10517 10517
 		$sql .= ' s.nom as name';
10518
-		$sql .= ' FROM ' . $this->db->prefix() . 'projet as p';
10519
-		$sql .= ' LEFT JOIN ' . $this->db->prefix() . 'societe as s ON s.rowid = p.fk_soc,';
10520
-		$sql .= ' ' . $this->db->prefix() . 'facture as f';
10521
-		$sql .= " WHERE p.entity IN (" . getEntity('project') . ")";
10518
+		$sql .= ' FROM '.$this->db->prefix().'projet as p';
10519
+		$sql .= ' LEFT JOIN '.$this->db->prefix().'societe as s ON s.rowid = p.fk_soc,';
10520
+		$sql .= ' '.$this->db->prefix().'facture as f';
10521
+		$sql .= " WHERE p.entity IN (".getEntity('project').")";
10522 10522
 		$sql .= " AND f.fk_projet = p.rowid AND f.fk_statut=0"; //Brouillons seulement
10523 10523
 		//if ($projectsListId) $sql.= " AND p.rowid IN (".$this->db->sanitize($projectsListId).")";
10524 10524
 		//if ($socid == 0) $sql.= " AND (p.fk_soc=0 OR p.fk_soc IS NULL)";
@@ -10529,14 +10529,14 @@  discard block
 block discarded – undo
10529 10529
 		if ($resql) {
10530 10530
 			// Use select2 selector
10531 10531
 			if (!empty($conf->use_javascript_ajax)) {
10532
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
10532
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
10533 10533
 				$comboenhancement = ajax_combobox($htmlname, array(), 0, $forcefocus);
10534 10534
 				$out .= $comboenhancement;
10535 10535
 				$morecss = 'minwidth200imp maxwidth500';
10536 10536
 			}
10537 10537
 
10538 10538
 			if (empty($option_only)) {
10539
-				$out .= '<select class="valignmiddle flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ' id="' . $htmlname . '" name="' . $htmlname . '">';
10539
+				$out .= '<select class="valignmiddle flat'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').' id="'.$htmlname.'" name="'.$htmlname.'">';
10540 10540
 			}
10541 10541
 			if (!empty($show_empty)) {
10542 10542
 				$out .= '<option value="0" class="optiongrey">';
@@ -10566,33 +10566,33 @@  discard block
 block discarded – undo
10566 10566
 						if ($showproject == 'all') {
10567 10567
 							$labeltoshow .= dol_trunc($obj->ref, 18); // Invoice ref
10568 10568
 							if ($obj->name) {
10569
-								$labeltoshow .= ' - ' . $obj->name; // Soc name
10569
+								$labeltoshow .= ' - '.$obj->name; // Soc name
10570 10570
 							}
10571 10571
 
10572 10572
 							$disabled = 0;
10573 10573
 							if ($obj->fk_statut == Project::STATUS_DRAFT) {
10574 10574
 								$disabled = 1;
10575
-								$labeltoshow .= ' - ' . $langs->trans("Draft");
10575
+								$labeltoshow .= ' - '.$langs->trans("Draft");
10576 10576
 							} elseif ($obj->fk_statut == Project::STATUS_CLOSED) {
10577 10577
 								if ($discard_closed == 2) {
10578 10578
 									$disabled = 1;
10579 10579
 								}
10580
-								$labeltoshow .= ' - ' . $langs->trans("Closed");
10580
+								$labeltoshow .= ' - '.$langs->trans("Closed");
10581 10581
 							} elseif ($socid > 0 && (!empty($obj->fk_soc) && $obj->fk_soc != $socid)) {
10582 10582
 								$disabled = 1;
10583
-								$labeltoshow .= ' - ' . $langs->trans("LinkedToAnotherCompany");
10583
+								$labeltoshow .= ' - '.$langs->trans("LinkedToAnotherCompany");
10584 10584
 							}
10585 10585
 						}
10586 10586
 
10587 10587
 						if (!empty($selected) && $selected == $obj->rowid) {
10588
-							$out .= '<option value="' . $obj->rowid . '" selected';
10588
+							$out .= '<option value="'.$obj->rowid.'" selected';
10589 10589
 							//if ($disabled) $out.=' disabled';						// with select2, field can't be preselected if disabled
10590
-							$out .= '>' . $labeltoshow . '</option>';
10590
+							$out .= '>'.$labeltoshow.'</option>';
10591 10591
 						} else {
10592 10592
 							if ($hideunselectables && $disabled && ($selected != $obj->rowid)) {
10593 10593
 								$resultat = '';
10594 10594
 							} else {
10595
-								$resultat = '<option value="' . $obj->rowid . '"';
10595
+								$resultat = '<option value="'.$obj->rowid.'"';
10596 10596
 								if ($disabled) {
10597 10597
 									$resultat .= ' disabled';
10598 10598
 								}
@@ -10644,22 +10644,22 @@  discard block
 block discarded – undo
10644 10644
 
10645 10645
 		$sql = 'SELECT f.rowid, f.entity, f.titre as title, f.suspended, f.fk_soc';
10646 10646
 		//$sql.= ', el.fk_source';
10647
-		$sql .= ' FROM ' . MAIN_DB_PREFIX . 'facture_rec as f';
10648
-		$sql .= " WHERE f.entity IN (" . getEntity('invoice') . ")";
10647
+		$sql .= ' FROM '.MAIN_DB_PREFIX.'facture_rec as f';
10648
+		$sql .= " WHERE f.entity IN (".getEntity('invoice').")";
10649 10649
 		$sql .= " ORDER BY f.titre ASC";
10650 10650
 
10651 10651
 		$resql = $this->db->query($sql);
10652 10652
 		if ($resql) {
10653 10653
 			// Use select2 selector
10654 10654
 			if (!empty($conf->use_javascript_ajax)) {
10655
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
10655
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
10656 10656
 				$comboenhancement = ajax_combobox($htmlname, array(), 0, $forcefocus);
10657 10657
 				$out .= $comboenhancement;
10658 10658
 				$morecss = 'minwidth200imp maxwidth500';
10659 10659
 			}
10660 10660
 
10661 10661
 			if (empty($option_only)) {
10662
-				$out .= '<select class="valignmiddle flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ' id="' . $htmlname . '" name="' . $htmlname . '">';
10662
+				$out .= '<select class="valignmiddle flat'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').' id="'.$htmlname.'" name="'.$htmlname.'">';
10663 10663
 			}
10664 10664
 			if (!empty($show_empty)) {
10665 10665
 				$out .= '<option value="0" class="optiongrey">';
@@ -10678,19 +10678,19 @@  discard block
 block discarded – undo
10678 10678
 					$disabled = 0;
10679 10679
 					if (!empty($obj->suspended)) {
10680 10680
 						$disabled = 1;
10681
-						$labeltoshow .= ' - ' . $langs->trans("Closed");
10681
+						$labeltoshow .= ' - '.$langs->trans("Closed");
10682 10682
 					}
10683 10683
 
10684 10684
 
10685 10685
 					if (!empty($selected) && $selected == $obj->rowid) {
10686
-						$out .= '<option value="' . $obj->rowid . '" selected';
10686
+						$out .= '<option value="'.$obj->rowid.'" selected';
10687 10687
 						//if ($disabled) $out.=' disabled';						// with select2, field can't be preselected if disabled
10688
-						$out .= '>' . $labeltoshow . '</option>';
10688
+						$out .= '>'.$labeltoshow.'</option>';
10689 10689
 					} else {
10690 10690
 						if ($disabled && ($selected != $obj->rowid)) {
10691 10691
 							$resultat = '';
10692 10692
 						} else {
10693
-							$resultat = '<option value="' . $obj->rowid . '"';
10693
+							$resultat = '<option value="'.$obj->rowid.'"';
10694 10694
 							if ($disabled) {
10695 10695
 								$resultat .= ' disabled';
10696 10696
 							}
@@ -10730,14 +10730,14 @@  discard block
 block discarded – undo
10730 10730
 		global $langs;
10731 10731
 
10732 10732
 		if ($search_component_params_hidden != '' && !preg_match('/^\(.*\)$/', $search_component_params_hidden)) {    // If $search_component_params_hidden does not start and end with ()
10733
-			$search_component_params_hidden = '(' . $search_component_params_hidden . ')';
10733
+			$search_component_params_hidden = '('.$search_component_params_hidden.')';
10734 10734
 		}
10735 10735
 
10736 10736
 		$ret = '';
10737 10737
 
10738 10738
 		$ret .= '<div class="divadvancedsearchfieldcomp centpercent inline-block">';
10739 10739
 		$ret .= '<a href="#" class="dropdownsearch-toggle unsetcolor">';
10740
-		$ret .= '<span class="fas fa-filter linkobject boxfilter paddingright pictofixedwidth hideonsmartphone" title="' . dol_escape_htmltag($langs->trans("Filters")) . '" id="idsubimgproductdistribution"></span>';
10740
+		$ret .= '<span class="fas fa-filter linkobject boxfilter paddingright pictofixedwidth hideonsmartphone" title="'.dol_escape_htmltag($langs->trans("Filters")).'" id="idsubimgproductdistribution"></span>';
10741 10741
 		$ret .= '</a>';
10742 10742
 
10743 10743
 		$ret .= '<div class="divadvancedsearchfieldcompinput inline-block minwidth500 maxwidth300onsmartphone">';
@@ -10781,29 +10781,29 @@  discard block
 block discarded – undo
10781 10781
 			$ret .= '<input type="hidden" name="show_search_component_params_hidden" value="1">';
10782 10782
 		}
10783 10783
 		$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%')) -->";
10784
-		$ret .= '<input type="hidden" id="search_component_params_hidden" name="search_component_params_hidden" value="' . dol_escape_htmltag($search_component_params_hidden) . '">';
10784
+		$ret .= '<input type="hidden" id="search_component_params_hidden" name="search_component_params_hidden" value="'.dol_escape_htmltag($search_component_params_hidden).'">';
10785 10785
 		// $ret .= "<!-- sql= ".forgeSQLFromUniversalSearchCriteria($search_component_params_hidden, $errormessage)." -->";
10786 10786
 
10787 10787
 		// For compatibility with forms that show themself the search criteria in addition of this component, we output these fields
10788 10788
 		foreach ($arrayofcriterias as $criteria) {
10789 10789
 			foreach ($criteria as $criteriafamilykey => $criteriafamilyval) {
10790
-				if (in_array('search_' . $criteriafamilykey, $arrayofinputfieldsalreadyoutput)) {
10790
+				if (in_array('search_'.$criteriafamilykey, $arrayofinputfieldsalreadyoutput)) {
10791 10791
 					continue;
10792 10792
 				}
10793 10793
 				if (in_array($criteriafamilykey, array('rowid', 'ref_ext', 'entity', 'extraparams'))) {
10794 10794
 					continue;
10795 10795
 				}
10796 10796
 				if (in_array($criteriafamilyval['type'], array('date', 'datetime', 'timestamp'))) {
10797
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_start">';
10798
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_startyear">';
10799
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_startmonth">';
10800
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_startday">';
10801
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_end">';
10802
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_endyear">';
10803
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_endmonth">';
10804
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_endday">';
10797
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_start">';
10798
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_startyear">';
10799
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_startmonth">';
10800
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_startday">';
10801
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_end">';
10802
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_endyear">';
10803
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_endmonth">';
10804
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_endday">';
10805 10805
 				} else {
10806
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '">';
10806
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'">';
10807 10807
 				}
10808 10808
 			}
10809 10809
 		}
@@ -10811,7 +10811,7 @@  discard block
 block discarded – undo
10811 10811
 		$ret .= '</div>';
10812 10812
 
10813 10813
 		$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";
10814
-		$ret .= '<input type="text" placeholder="' . $langs->trans("Filters") . '" id="search_component_params_input" name="search_component_params_input" class="noborderbottom search_component_input" value="">';
10814
+		$ret .= '<input type="text" placeholder="'.$langs->trans("Filters").'" id="search_component_params_input" name="search_component_params_input" class="noborderbottom search_component_input" value="">';
10815 10815
 
10816 10816
 		$ret .= '</div>';
10817 10817
 		$ret .= '</div>';
@@ -10885,7 +10885,7 @@  discard block
 block discarded – undo
10885 10885
 
10886 10886
 		$TModels = array();
10887 10887
 
10888
-		include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php';
10888
+		include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
10889 10889
 		$formmail = new FormMail($this->db);
10890 10890
 		$result = $formmail->fetchAllEMailTemplate($modelType, $user, $langs);
10891 10891
 
@@ -10898,17 +10898,17 @@  discard block
 block discarded – undo
10898 10898
 			}
10899 10899
 		}
10900 10900
 
10901
-		$retstring .= '<select class="flat" id="select_' . $prefix . 'model_mail" name="' . $prefix . 'model_mail">';
10901
+		$retstring .= '<select class="flat" id="select_'.$prefix.'model_mail" name="'.$prefix.'model_mail">';
10902 10902
 
10903 10903
 		foreach ($TModels as $id_model => $label_model) {
10904
-			$retstring .= '<option value="' . $id_model . '"';
10905
-			$retstring .= ">" . $label_model . "</option>";
10904
+			$retstring .= '<option value="'.$id_model.'"';
10905
+			$retstring .= ">".$label_model."</option>";
10906 10906
 		}
10907 10907
 
10908 10908
 		$retstring .= "</select>";
10909 10909
 
10910 10910
 		if ($addjscombo) {
10911
-			$retstring .= ajax_combobox('select_' . $prefix . 'model_mail');
10911
+			$retstring .= ajax_combobox('select_'.$prefix.'model_mail');
10912 10912
 		}
10913 10913
 
10914 10914
 		return $retstring;
@@ -10959,16 +10959,16 @@  discard block
 block discarded – undo
10959 10959
 
10960 10960
 		foreach ($buttons as $button) {
10961 10961
 			$addclass = empty($button['addclass']) ? '' : $button['addclass'];
10962
-			$retstring .= '<input type="submit" class="button button-' . $button['name'] . ($morecss ? ' ' . $morecss : '') . ' ' . $addclass . '" name="' . $button['name'] . '" value="' . dol_escape_htmltag($langs->trans($button['label_key'])) . '">';
10962
+			$retstring .= '<input type="submit" class="button button-'.$button['name'].($morecss ? ' '.$morecss : '').' '.$addclass.'" name="'.$button['name'].'" value="'.dol_escape_htmltag($langs->trans($button['label_key'])).'">';
10963 10963
 		}
10964 10964
 		$retstring .= $withoutdiv ? '' : '</div>';
10965 10965
 
10966 10966
 		if ($dol_openinpopup) {
10967
-			$retstring .= '<!-- buttons are shown into a $dol_openinpopup=' . $dol_openinpopup . ' context, so we enable the close of dialog on cancel -->' . "\n";
10968
-			$retstring .= '<script nonce="' . getNonce() . '">';
10967
+			$retstring .= '<!-- buttons are shown into a $dol_openinpopup='.$dol_openinpopup.' context, so we enable the close of dialog on cancel -->'."\n";
10968
+			$retstring .= '<script nonce="'.getNonce().'">';
10969 10969
 			$retstring .= 'jQuery(".button-cancel").click(function(e) {
10970
-				e.preventDefault(); console.log(\'We click on cancel in iframe popup ' . $dol_openinpopup . '\');
10971
-				window.parent.jQuery(\'#idfordialog' . $dol_openinpopup . '\').dialog(\'close\');
10970
+				e.preventDefault(); console.log(\'We click on cancel in iframe popup ' . $dol_openinpopup.'\');
10971
+				window.parent.jQuery(\'#idfordialog' . $dol_openinpopup.'\').dialog(\'close\');
10972 10972
 				 });';
10973 10973
 			$retstring .= '</script>';
10974 10974
 		}
@@ -10997,7 +10997,7 @@  discard block
 block discarded – undo
10997 10997
 		dol_syslog(__METHOD__, LOG_DEBUG);
10998 10998
 
10999 10999
 		$sql = "SELECT rowid, code, label as label";
11000
-		$sql .= " FROM " . MAIN_DB_PREFIX . 'c_invoice_subtype';
11000
+		$sql .= " FROM ".MAIN_DB_PREFIX.'c_invoice_subtype';
11001 11001
 		$sql .= " WHERE active = 1";
11002 11002
 
11003 11003
 		$resql = $this->db->query($sql);
@@ -11008,7 +11008,7 @@  discard block
 block discarded – undo
11008 11008
 				$obj = $this->db->fetch_object($resql);
11009 11009
 
11010 11010
 				// If translation exists, we use it, otherwise we take the default wording
11011
-				$label = ($langs->trans("InvoiceSubtype" . $obj->rowid) != "InvoiceSubtype" . $obj->rowid) ? $langs->trans("InvoiceSubtype" . $obj->rowid) : (($obj->label != '-') ? $obj->label : '');
11011
+				$label = ($langs->trans("InvoiceSubtype".$obj->rowid) != "InvoiceSubtype".$obj->rowid) ? $langs->trans("InvoiceSubtype".$obj->rowid) : (($obj->label != '-') ? $obj->label : '');
11012 11012
 				$this->cache_invoice_subtype[$obj->rowid]['rowid'] = $obj->rowid;
11013 11013
 				$this->cache_invoice_subtype[$obj->rowid]['code'] = $obj->code;
11014 11014
 				$this->cache_invoice_subtype[$obj->rowid]['label'] = $label;
@@ -11040,18 +11040,18 @@  discard block
 block discarded – undo
11040 11040
 		global $langs, $user;
11041 11041
 
11042 11042
 		$out = '';
11043
-		dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG);
11043
+		dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG);
11044 11044
 
11045 11045
 		$this->load_cache_invoice_subtype();
11046 11046
 
11047
-		$out .= '<select id="' . $htmlname . '" class="flat selectsubtype' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">';
11047
+		$out .= '<select id="'.$htmlname.'" class="flat selectsubtype'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
11048 11048
 		if ($addempty) {
11049 11049
 			$out .= '<option value="0">&nbsp;</option>';
11050 11050
 		}
11051 11051
 
11052 11052
 		foreach ($this->cache_invoice_subtype as $rowid => $subtype) {
11053 11053
 			$label = $subtype['label'];
11054
-			$out .= '<option value="' . $subtype['rowid'] . '"';
11054
+			$out .= '<option value="'.$subtype['rowid'].'"';
11055 11055
 			if ($selected == $subtype['rowid']) {
11056 11056
 				$out .= ' selected="selected"';
11057 11057
 			}
Please login to merge, or discard this patch.
htdocs/core/class/commonobject.class.php 1 patch
Spacing   +132 added lines, -132 removed lines patch added patch discarded remove patch
@@ -473,11 +473,11 @@  discard block
 block discarded – undo
473 473
 	 *
474 474
 	 * Note: cond_reglement can not be aliased to cond_reglement!!!
475 475
 	 */
476
-	private $cond_reglement;  // Private to call DolDeprecationHandler
476
+	private $cond_reglement; // Private to call DolDeprecationHandler
477 477
 	/**
478 478
 	 * @var int|string Internal to detect deprecated access
479 479
 	 */
480
-	protected $depr_cond_reglement;  // Internal value for deprecation
480
+	protected $depr_cond_reglement; // Internal value for deprecation
481 481
 
482 482
 	/**
483 483
 	 * @var int 		Delivery address ID
@@ -534,12 +534,12 @@  discard block
 block discarded – undo
534 534
 	/**
535 535
 	 * @var float Multicurrency total localta1
536 536
 	 */
537
-	public $multicurrency_total_localtax1;	// not in database
537
+	public $multicurrency_total_localtax1; // not in database
538 538
 
539 539
 	/**
540 540
 	 * @var float Multicurrency total localtax2
541 541
 	 */
542
-	public $multicurrency_total_localtax2;	// not in database
542
+	public $multicurrency_total_localtax2; // not in database
543 543
 
544 544
 	/**
545 545
 	 * @var string
@@ -1012,17 +1012,17 @@  discard block
 block discarded – undo
1012 1012
 				}
1013 1013
 				$labelextra = $langs->trans((string) $extrafields->attributes[$this->table_element]['label'][$key]);
1014 1014
 				if ($extrafields->attributes[$this->table_element]['type'][$key] == 'separate') {
1015
-					$data[$key] = '<br><b><u>'. $labelextra . '</u></b>';
1015
+					$data[$key] = '<br><b><u>'.$labelextra.'</u></b>';
1016 1016
 				} else {
1017
-					$value = (empty($this->array_options['options_' . $key]) ? '' : $this->array_options['options_' . $key]);
1018
-					$data[$key] = '<br><b>'. $labelextra . ':</b> ' . $extrafields->showOutputField($key, $value, '', $this->table_element);
1017
+					$value = (empty($this->array_options['options_'.$key]) ? '' : $this->array_options['options_'.$key]);
1018
+					$data[$key] = '<br><b>'.$labelextra.':</b> '.$extrafields->showOutputField($key, $value, '', $this->table_element);
1019 1019
 					$count++;
1020 1020
 				}
1021 1021
 			}
1022 1022
 			$data['closedivextra'] = '</div>';
1023 1023
 		}
1024 1024
 
1025
-		$hookmanager->initHooks(array($this->element . 'dao'));
1025
+		$hookmanager->initHooks(array($this->element.'dao'));
1026 1026
 		$parameters = array(
1027 1027
 			'tooltipcontentarray' => &$data,
1028 1028
 			'params' => $params,
@@ -1513,7 +1513,7 @@  discard block
 block discarded – undo
1513 1513
 		if ($source == 'external' || $source == 'thirdparty') {
1514 1514
 			$sql .= " AND tc.source = 'external'";
1515 1515
 			if ($status >= 0) {
1516
-				$sql .= " AND t.statut = ".((int) $status);	// t is llx_socpeople
1516
+				$sql .= " AND t.statut = ".((int) $status); // t is llx_socpeople
1517 1517
 			}
1518 1518
 		}
1519 1519
 		$sql .= " AND tc.active = 1";
@@ -1895,7 +1895,7 @@  discard block
 block discarded – undo
1895 1895
 		}
1896 1896
 
1897 1897
 		$sql = "SELECT rowid FROM ".$this->db->prefix().$this->table_element;
1898
-		$sql .= " WHERE ".$this->table_ref_field." LIKE '".$this->db->escape($ref)."'";	// no escapeforlike here
1898
+		$sql .= " WHERE ".$this->table_ref_field." LIKE '".$this->db->escape($ref)."'"; // no escapeforlike here
1899 1899
 		$sql .= " LIMIT 1";
1900 1900
 
1901 1901
 		$query = $this->db->query($sql);
@@ -2185,9 +2185,9 @@  discard block
 block discarded – undo
2185 2185
 		if ($trigkey) {
2186 2186
 			$oldvalue = null;
2187 2187
 
2188
-			$sql = "SELECT " . $field;
2189
-			$sql .= " FROM " . MAIN_DB_PREFIX . $table;
2190
-			$sql .= " WHERE " . $id_field . " = " . ((int) $id);
2188
+			$sql = "SELECT ".$field;
2189
+			$sql .= " FROM ".MAIN_DB_PREFIX.$table;
2190
+			$sql .= " WHERE ".$id_field." = ".((int) $id);
2191 2191
 
2192 2192
 			$resql = $this->db->query($sql);
2193 2193
 			if ($resql) {
@@ -2566,7 +2566,7 @@  discard block
 block discarded – undo
2566 2566
 		// Triggers
2567 2567
 		if (!$error && !$notrigger) {
2568 2568
 			// Call triggers
2569
-			$result = $this->call_trigger(strtoupper($this->element) . '_MODIFY', $user);
2569
+			$result = $this->call_trigger(strtoupper($this->element).'_MODIFY', $user);
2570 2570
 			if ($result < 0) {
2571 2571
 				$error++;
2572 2572
 			} //Do also here what you must do to rollback action if trigger fail
@@ -2932,7 +2932,7 @@  discard block
 block discarded – undo
2932 2932
 			$sql = 'UPDATE '.$this->db->prefix().$this->table_element;
2933 2933
 			$sql .= " SET ".$fieldname." = ".(($id > 0 || $id == '0') ? ((int) $id) : 'NULL');
2934 2934
 			if (in_array($this->table_element, array('propal', 'commande', 'societe'))) {
2935
-				$sql .= " , deposit_percent = " . (empty($deposit_percent) ? 'NULL' : "'".$this->db->escape($deposit_percent)."'");
2935
+				$sql .= " , deposit_percent = ".(empty($deposit_percent) ? 'NULL' : "'".$this->db->escape($deposit_percent)."'");
2936 2936
 			}
2937 2937
 			$sql .= ' WHERE rowid='.((int) $this->id);
2938 2938
 
@@ -3280,10 +3280,10 @@  discard block
 block discarded – undo
3280 3280
 		$sql = "SELECT count(rowid) FROM ".$this->db->prefix().$this->table_element_line;
3281 3281
 		$sql .= " WHERE ".$this->fk_element." = ".((int) $this->id);
3282 3282
 		if (!$renum) {
3283
-			$sql .= " AND " . $fieldposition . " = 0";
3283
+			$sql .= " AND ".$fieldposition." = 0";
3284 3284
 		}
3285 3285
 		if ($renum) {
3286
-			$sql .= " AND " . $fieldposition . " <> 0";
3286
+			$sql .= " AND ".$fieldposition." <> 0";
3287 3287
 		}
3288 3288
 
3289 3289
 		dol_syslog(get_class($this)."::line_order", LOG_DEBUG);
@@ -3304,7 +3304,7 @@  discard block
 block discarded – undo
3304 3304
 			if ($fk_parent_line) {
3305 3305
 				$sql .= ' AND fk_parent_line IS NULL';
3306 3306
 			}
3307
-			$sql .= " ORDER BY " . $fieldposition . " ASC, rowid " . $rowidorder;
3307
+			$sql .= " ORDER BY ".$fieldposition." ASC, rowid ".$rowidorder;
3308 3308
 
3309 3309
 			dol_syslog(get_class($this)."::line_order search all parent lines", LOG_DEBUG);
3310 3310
 			$resql = $this->db->query($sql);
@@ -3355,7 +3355,7 @@  discard block
 block discarded – undo
3355 3355
 		$sql = "SELECT rowid FROM ".$this->db->prefix().$this->table_element_line;
3356 3356
 		$sql .= " WHERE ".$this->fk_element." = ".((int) $this->id);
3357 3357
 		$sql .= ' AND fk_parent_line = '.((int) $id);
3358
-		$sql .= " ORDER BY " . $fieldposition . " ASC";
3358
+		$sql .= " ORDER BY ".$fieldposition." ASC";
3359 3359
 
3360 3360
 		dol_syslog(get_class($this)."::getChildrenOfLine search children lines for line ".$id, LOG_DEBUG);
3361 3361
 		$resql = $this->db->query($sql);
@@ -3478,7 +3478,7 @@  discard block
 block discarded – undo
3478 3478
 
3479 3479
 			$sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) $rang);
3480 3480
 			$sql .= " WHERE ".$this->fk_element." = ".((int) $this->id);
3481
-			$sql .= " AND " . $fieldposition . " = " . ((int) ($rang - 1));
3481
+			$sql .= " AND ".$fieldposition." = ".((int) ($rang - 1));
3482 3482
 			if ($this->db->query($sql)) {
3483 3483
 				$sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) ($rang - 1));
3484 3484
 				$sql .= ' WHERE rowid = '.((int) $rowid);
@@ -3509,7 +3509,7 @@  discard block
 block discarded – undo
3509 3509
 
3510 3510
 			$sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) $rang);
3511 3511
 			$sql .= " WHERE ".$this->fk_element." = ".((int) $this->id);
3512
-			$sql .= " AND " . $fieldposition . " = " . ((int) ($rang + 1));
3512
+			$sql .= " AND ".$fieldposition." = ".((int) ($rang + 1));
3513 3513
 			if ($this->db->query($sql)) {
3514 3514
 				$sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) ($rang + 1));
3515 3515
 				$sql .= ' WHERE rowid = '.((int) $rowid);
@@ -3535,7 +3535,7 @@  discard block
 block discarded – undo
3535 3535
 			$fieldposition = 'position';
3536 3536
 		}
3537 3537
 
3538
-		$sql = "SELECT " . $fieldposition . " FROM ".$this->db->prefix().$this->table_element_line;
3538
+		$sql = "SELECT ".$fieldposition." FROM ".$this->db->prefix().$this->table_element_line;
3539 3539
 		$sql .= " WHERE rowid = ".((int) $rowid);
3540 3540
 
3541 3541
 		dol_syslog(get_class($this)."::getRangOfLine", LOG_DEBUG);
@@ -3563,7 +3563,7 @@  discard block
 block discarded – undo
3563 3563
 
3564 3564
 		$sql = "SELECT rowid FROM ".$this->db->prefix().$this->table_element_line;
3565 3565
 		$sql .= " WHERE ".$this->fk_element." = ".((int) $this->id);
3566
-		$sql .= " AND " . $fieldposition . " = ".((int) $rang);
3566
+		$sql .= " AND ".$fieldposition." = ".((int) $rang);
3567 3567
 		$resql = $this->db->query($sql);
3568 3568
 		if ($resql) {
3569 3569
 			$row = $this->db->fetch_row($resql);
@@ -3681,7 +3681,7 @@  discard block
 block discarded – undo
3681 3681
 			$newsuffix = '';
3682 3682
 		}
3683 3683
 		if (in_array($this->table_element, array('actioncomm', 'adherent', 'advtargetemailing', 'cronjob', 'establishment'))) {
3684
-			$fieldusermod =  "fk_user_mod";
3684
+			$fieldusermod = "fk_user_mod";
3685 3685
 		} elseif ($this->table_element == 'ecm_files') {
3686 3686
 			$fieldusermod = "fk_user_m";
3687 3687
 		} else {
@@ -3723,7 +3723,7 @@  discard block
 block discarded – undo
3723 3723
 						$trigger_name = 'EXPENSE_REPORT_MODIFY';
3724 3724
 						break;
3725 3725
 					default:
3726
-						$trigger_name = strtoupper($this->element) . '_MODIFY';
3726
+						$trigger_name = strtoupper($this->element).'_MODIFY';
3727 3727
 				}
3728 3728
 				$ret = $this->call_trigger($trigger_name, $user);
3729 3729
 				if ($ret < 0) {
@@ -4100,19 +4100,19 @@  discard block
 block discarded – undo
4100 4100
 		$this->db->begin();
4101 4101
 		$error = 0;
4102 4102
 
4103
-		$sql = "INSERT INTO " . $this->db->prefix() . "element_element (";
4103
+		$sql = "INSERT INTO ".$this->db->prefix()."element_element (";
4104 4104
 		$sql .= "fk_source";
4105 4105
 		$sql .= ", sourcetype";
4106 4106
 		$sql .= ", fk_target";
4107 4107
 		$sql .= ", targettype";
4108 4108
 		$sql .= ") VALUES (";
4109 4109
 		$sql .= ((int) $origin_id);
4110
-		$sql .= ", '" . $this->db->escape($origin) . "'";
4111
-		$sql .= ", " . ((int) $this->id);
4112
-		$sql .= ", '" . $this->db->escape($targettype) . "'";
4110
+		$sql .= ", '".$this->db->escape($origin)."'";
4111
+		$sql .= ", ".((int) $this->id);
4112
+		$sql .= ", '".$this->db->escape($targettype)."'";
4113 4113
 		$sql .= ")";
4114 4114
 
4115
-		dol_syslog(get_class($this) . "::add_object_linked", LOG_DEBUG);
4115
+		dol_syslog(get_class($this)."::add_object_linked", LOG_DEBUG);
4116 4116
 		if ($this->db->query($sql)) {
4117 4117
 			if (!$notrigger) {
4118 4118
 				// Call trigger
@@ -4364,20 +4364,20 @@  discard block
 block discarded – undo
4364 4364
 		$this->db->begin();
4365 4365
 		$error = 0;
4366 4366
 
4367
-		$sql = "UPDATE " . $this->db->prefix() . "element_element SET ";
4367
+		$sql = "UPDATE ".$this->db->prefix()."element_element SET ";
4368 4368
 		if ($updatesource) {
4369
-			$sql .= "fk_source = " . ((int) $sourceid);
4370
-			$sql .= ", sourcetype = '" . $this->db->escape($sourcetype) . "'";
4371
-			$sql .= " WHERE fk_target = " . ((int) $this->id);
4372
-			$sql .= " AND targettype = '" . $this->db->escape($this->element) . "'";
4369
+			$sql .= "fk_source = ".((int) $sourceid);
4370
+			$sql .= ", sourcetype = '".$this->db->escape($sourcetype)."'";
4371
+			$sql .= " WHERE fk_target = ".((int) $this->id);
4372
+			$sql .= " AND targettype = '".$this->db->escape($this->element)."'";
4373 4373
 		} elseif ($updatetarget) {
4374
-			$sql .= "fk_target = " . ((int) $targetid);
4375
-			$sql .= ", targettype = '" . $this->db->escape($targettype) . "'";
4376
-			$sql .= " WHERE fk_source = " . ((int) $this->id);
4377
-			$sql .= " AND sourcetype = '" . $this->db->escape($this->element) . "'";
4374
+			$sql .= "fk_target = ".((int) $targetid);
4375
+			$sql .= ", targettype = '".$this->db->escape($targettype)."'";
4376
+			$sql .= " WHERE fk_source = ".((int) $this->id);
4377
+			$sql .= " AND sourcetype = '".$this->db->escape($this->element)."'";
4378 4378
 		}
4379 4379
 
4380
-		dol_syslog(get_class($this) . "::updateObjectLinked", LOG_DEBUG);
4380
+		dol_syslog(get_class($this)."::updateObjectLinked", LOG_DEBUG);
4381 4381
 		if ($this->db->query($sql)) {
4382 4382
 			if (!$notrigger) {
4383 4383
 				// Call trigger
@@ -4453,25 +4453,25 @@  discard block
 block discarded – undo
4453 4453
 		}
4454 4454
 
4455 4455
 		if (!$error) {
4456
-			$sql = "DELETE FROM " . $this->db->prefix() . "element_element";
4456
+			$sql = "DELETE FROM ".$this->db->prefix()."element_element";
4457 4457
 			$sql .= " WHERE";
4458 4458
 			if ($rowid > 0) {
4459
-				$sql .= " rowid = " . ((int) $rowid);
4459
+				$sql .= " rowid = ".((int) $rowid);
4460 4460
 			} else {
4461 4461
 				if ($deletesource) {
4462
-					$sql .= " fk_source = " . ((int) $sourceid) . " AND sourcetype = '" . $this->db->escape($sourcetype) . "'";
4463
-					$sql .= " AND fk_target = " . ((int) $this->id) . " AND targettype = '" . $this->db->escape($this->element) . "'";
4462
+					$sql .= " fk_source = ".((int) $sourceid)." AND sourcetype = '".$this->db->escape($sourcetype)."'";
4463
+					$sql .= " AND fk_target = ".((int) $this->id)." AND targettype = '".$this->db->escape($this->element)."'";
4464 4464
 				} elseif ($deletetarget) {
4465
-					$sql .= " fk_target = " . ((int) $targetid) . " AND targettype = '" . $this->db->escape($targettype) . "'";
4466
-					$sql .= " AND fk_source = " . ((int) $this->id) . " AND sourcetype = '" . $this->db->escape($this->element) . "'";
4465
+					$sql .= " fk_target = ".((int) $targetid)." AND targettype = '".$this->db->escape($targettype)."'";
4466
+					$sql .= " AND fk_source = ".((int) $this->id)." AND sourcetype = '".$this->db->escape($this->element)."'";
4467 4467
 				} else {
4468
-					$sql .= " (fk_source = " . ((int) $this->id) . " AND sourcetype = '" . $this->db->escape($this->element) . "')";
4468
+					$sql .= " (fk_source = ".((int) $this->id)." AND sourcetype = '".$this->db->escape($this->element)."')";
4469 4469
 					$sql .= " OR";
4470
-					$sql .= " (fk_target = " . ((int) $this->id) . " AND targettype = '" . $this->db->escape($this->element) . "')";
4470
+					$sql .= " (fk_target = ".((int) $this->id)." AND targettype = '".$this->db->escape($this->element)."')";
4471 4471
 				}
4472 4472
 			}
4473 4473
 
4474
-			dol_syslog(get_class($this) . "::deleteObjectLinked", LOG_DEBUG);
4474
+			dol_syslog(get_class($this)."::deleteObjectLinked", LOG_DEBUG);
4475 4475
 			if (!$this->db->query($sql)) {
4476 4476
 				$this->error = $this->db->lasterror();
4477 4477
 				$this->errors[] = $this->error;
@@ -4636,14 +4636,14 @@  discard block
 block discarded – undo
4636 4636
 			$sql .= ", date_validation = '".$this->db->idate(dol_now())."'";
4637 4637
 		}
4638 4638
 		$sql .= " WHERE rowid = ".((int) $elementId);
4639
-		$sql .= " AND ".$fieldstatus." <> ".((int) $status);	// We avoid update if status already correct
4639
+		$sql .= " AND ".$fieldstatus." <> ".((int) $status); // We avoid update if status already correct
4640 4640
 
4641 4641
 		dol_syslog(get_class($this)."::setStatut", LOG_DEBUG);
4642 4642
 		$resql = $this->db->query($sql);
4643 4643
 		if ($resql) {
4644 4644
 			$error = 0;
4645 4645
 
4646
-			$nb_rows_affected = $this->db->affected_rows($resql);	// should be 1 or 0 if status was already correct
4646
+			$nb_rows_affected = $this->db->affected_rows($resql); // should be 1 or 0 if status was already correct
4647 4647
 
4648 4648
 			if ($nb_rows_affected > 0) {
4649 4649
 				if (empty($trigkey)) {
@@ -4688,7 +4688,7 @@  discard block
 block discarded – undo
4688 4688
 					if ($fieldstatus == 'tosell') {
4689 4689
 						$this->status = $status;
4690 4690
 					} elseif ($fieldstatus == 'tobuy') {
4691
-						$this->status_buy = $status;	// @phpstan-ignore-line
4691
+						$this->status_buy = $status; // @phpstan-ignore-line
4692 4692
 					} else {
4693 4693
 						$this->status = $status;
4694 4694
 					}
@@ -4796,7 +4796,7 @@  discard block
 block discarded – undo
4796 4796
 			return -1;
4797 4797
 		}
4798 4798
 
4799
-		$arraytoscan = $this->childtables;		// array('tablename'=>array('fk_element'=>'parentfield'), ...) or array('tablename'=>array('parent'=>table_parent, 'parentkey'=>'nameoffieldforparentfkkey'), ...)
4799
+		$arraytoscan = $this->childtables; // array('tablename'=>array('fk_element'=>'parentfield'), ...) or array('tablename'=>array('parent'=>table_parent, 'parentkey'=>'nameoffieldforparentfkkey'), ...)
4800 4800
 		// For backward compatibility, we check if array is old format array('tablename1', 'tablename2', ...)
4801 4801
 		$tmparray = array_keys($this->childtables);
4802 4802
 		if (is_numeric($tmparray[0])) {
@@ -5865,7 +5865,7 @@  discard block
 block discarded – undo
5865 5865
 			$setsharekey = false;
5866 5866
 			if ($this->element == 'propal' || $this->element == 'proposal') {
5867 5867
 				if (getDolGlobalInt("PROPOSAL_ALLOW_ONLINESIGN")) {
5868
-					$setsharekey = true;	// feature to make online signature is not set or set to on (default)
5868
+					$setsharekey = true; // feature to make online signature is not set or set to on (default)
5869 5869
 				}
5870 5870
 				if (getDolGlobalInt("PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD")) {
5871 5871
 					$setsharekey = true;
@@ -5923,7 +5923,7 @@  discard block
 block discarded – undo
5923 5923
 				$ecmfile->gen_or_uploaded = 'generated';
5924 5924
 				$ecmfile->description = ''; // indexed content
5925 5925
 				$ecmfile->keywords = ''; // keyword content
5926
-				$ecmfile->src_object_type = $this->table_element;	// $this->table_name is 'myobject' or 'mymodule_myobject'.
5926
+				$ecmfile->src_object_type = $this->table_element; // $this->table_name is 'myobject' or 'mymodule_myobject'.
5927 5927
 				$ecmfile->src_object_id   = $this->id;
5928 5928
 
5929 5929
 				$result = $ecmfile->create($user);
@@ -5975,7 +5975,7 @@  discard block
 block discarded – undo
5975 5975
 			$maxwidthmini = $tmparraysize['maxwidthmini'];
5976 5976
 			$maxheightmini = $tmparraysize['maxheightmini'];
5977 5977
 			//$quality = $tmparraysize['quality'];
5978
-			$quality = 50;	// For thumbs, we force quality to 50
5978
+			$quality = 50; // For thumbs, we force quality to 50
5979 5979
 
5980 5980
 			// Create small thumbs for company (Ratio is near 16/9)
5981 5981
 			// Used on logon for example
@@ -6075,8 +6075,8 @@  discard block
 block discarded – undo
6075 6075
 		// phpcs:enable
6076 6076
 		global $langs, $conf;
6077 6077
 
6078
-		if (!empty(self::TRIGGER_PREFIX) && strpos($triggerName, self::TRIGGER_PREFIX . '_') !== 0) {
6079
-			dol_print_error(null, 'The trigger "' . $triggerName . '" does not start with "' . self::TRIGGER_PREFIX . '_" as required.');
6078
+		if (!empty(self::TRIGGER_PREFIX) && strpos($triggerName, self::TRIGGER_PREFIX.'_') !== 0) {
6079
+			dol_print_error(null, 'The trigger "'.$triggerName.'" does not start with "'.self::TRIGGER_PREFIX.'_" as required.');
6080 6080
 			exit;
6081 6081
 		}
6082 6082
 		if (!is_object($langs)) {	// If lang was not defined, we set it. It is required by run_triggers().
@@ -6268,7 +6268,7 @@  discard block
 block discarded – undo
6268 6268
 		$savDisableCompute = $conf->disable_compute;
6269 6269
 		$conf->disable_compute = 1;
6270 6270
 
6271
-		$ret = $this->fetch($id);	/* @phpstan-ignore-line */
6271
+		$ret = $this->fetch($id); /* @phpstan-ignore-line */
6272 6272
 
6273 6273
 		$conf->disable_compute = $savDisableCompute;
6274 6274
 
@@ -6372,9 +6372,9 @@  discard block
 block discarded – undo
6372 6372
 						if (!empty($extrafields->attributes[$this->table_element]) && !empty($extrafields->attributes[$this->table_element]['computed'][$key])) {
6373 6373
 							//var_dump($conf->disable_compute);
6374 6374
 							if (empty($conf->disable_compute)) {
6375
-								global $objectoffield;        // We set a global variable to $objectoffield so
6376
-								$objectoffield = $this;        // we can use it inside computed formula
6377
-								$this->array_options['options_' . $key] = dol_eval($extrafields->attributes[$this->table_element]['computed'][$key], 1, 0, '2');
6375
+								global $objectoffield; // We set a global variable to $objectoffield so
6376
+								$objectoffield = $this; // we can use it inside computed formula
6377
+								$this->array_options['options_'.$key] = dol_eval($extrafields->attributes[$this->table_element]['computed'][$key], 1, 0, '2');
6378 6378
 							}
6379 6379
 						}
6380 6380
 					}
@@ -6555,7 +6555,7 @@  discard block
 block discarded – undo
6555 6555
 										// If old value encrypted in database is same than submitted new value, it means we don't change it, so we don't update.
6556 6556
 										if ($algo == 'dolcrypt') {	// dolibarr reversible encryption
6557 6557
 											if (!preg_match('/^dolcrypt:/', $this->array_options[$key])) {
6558
-												$new_array_options[$key] = dolEncrypt($this->array_options[$key]);	// warning, must be called when on the master
6558
+												$new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master
6559 6559
 											} else {
6560 6560
 												$new_array_options[$key] = $this->array_options[$key]; // Value is kept
6561 6561
 											}
@@ -6566,7 +6566,7 @@  discard block
 block discarded – undo
6566 6566
 										// If value has changed
6567 6567
 										if ($algo == 'dolcrypt') {	// dolibarr reversible encryption
6568 6568
 											if (!preg_match('/^dolcrypt:/', $this->array_options[$key])) {
6569
-												$new_array_options[$key] = dolEncrypt($this->array_options[$key]);	// warning, must be called when on the master
6569
+												$new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master
6570 6570
 											} else {
6571 6571
 												$new_array_options[$key] = $this->array_options[$key]; // Value is kept
6572 6572
 											}
@@ -6578,7 +6578,7 @@  discard block
 block discarded – undo
6578 6578
 									//var_dump('jjj'.$algo.' '.$this->oldcopy->array_options[$key].' -> '.$this->array_options[$key]);
6579 6579
 									// If this->oldcopy is not defined, we can't know if we change attribute or not, so we must keep value
6580 6580
 									if ($algo == 'dolcrypt' && !preg_match('/^dolcrypt:/', $this->array_options[$key])) {	// dolibarr reversible encryption
6581
-										$new_array_options[$key] = dolEncrypt($this->array_options[$key]);	// warning, must be called when on the master
6581
+										$new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master
6582 6582
 									} else {
6583 6583
 										$new_array_options[$key] = $this->array_options[$key]; // Value is kept
6584 6584
 									}
@@ -6975,7 +6975,7 @@  discard block
 block discarded – undo
6975 6975
 								if (isset($this->oldcopy->array_options["options_".$key]) && $this->array_options["options_".$key] == $this->oldcopy->array_options["options_".$key]) {	// If old value encrypted in database is same than submitted new value, it means we don't change it, so we don't update.
6976 6976
 									if ($algo == 'dolcrypt') {	// dolibarr reversible encryption
6977 6977
 										if (!preg_match('/^dolcrypt:/', $this->array_options["options_".$key])) {
6978
-											$new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]);	// warning, must be called when on the master
6978
+											$new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]); // warning, must be called when on the master
6979 6979
 										} else {
6980 6980
 											$new_array_options["options_".$key] = $this->array_options["options_".$key]; // Value is kept
6981 6981
 										}
@@ -6995,7 +6995,7 @@  discard block
 block discarded – undo
6995 6995
 								}
6996 6996
 							} else {
6997 6997
 								if ($algo == 'dolcrypt' && !preg_match('/^dolcrypt:/', $this->array_options["options_".$key])) {	// dolibarr reversible encryption
6998
-									$new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]);	// warning, must be called when on the master
6998
+									$new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]); // warning, must be called when on the master
6999 6999
 								} else {
7000 7000
 									$new_array_options["options_".$key] = $this->array_options["options_".$key]; // Value is kept
7001 7001
 								}
@@ -7379,7 +7379,7 @@  discard block
 block discarded – undo
7379 7379
 			}
7380 7380
 			$out = '<input type="text" class="flat '.$morecss.' maxwidthonsmartphone" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" value="'.$value.'" '.($moreparam ? $moreparam : '').'> ';
7381 7381
 		} elseif ($type == 'select') {	// combo list
7382
-			$out = '';  // @phan-suppress-current-line PhanPluginRedundantAssignment
7382
+			$out = ''; // @phan-suppress-current-line PhanPluginRedundantAssignment
7383 7383
 			if (!empty($conf->use_javascript_ajax) && !getDolGlobalString('MAIN_EXTRAFIELDS_DISABLE_SELECT2')) {
7384 7384
 				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
7385 7385
 				$out .= ajax_combobox($keyprefix.$key.$keysuffix, array(), 0);
@@ -7411,7 +7411,7 @@  discard block
 block discarded – undo
7411 7411
 			$out .= $tmpselect;
7412 7412
 			$out .= '</select>';
7413 7413
 		} elseif ($type == 'sellist') {
7414
-			$out = '';  // @phan-suppress-current-line PhanPluginRedundantAssignment
7414
+			$out = ''; // @phan-suppress-current-line PhanPluginRedundantAssignment
7415 7415
 			if (!empty($conf->use_javascript_ajax) && !getDolGlobalString('MAIN_EXTRAFIELDS_DISABLE_SELECT2')) {
7416 7416
 				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
7417 7417
 				$out .= ajax_combobox($keyprefix.$key.$keysuffix, array(), 0);
@@ -7421,7 +7421,7 @@  discard block
 block discarded – undo
7421 7421
 			if (is_array($param['options'])) {
7422 7422
 				$param_list = array_keys($param['options']);
7423 7423
 				$InfoFieldList = explode(":", $param_list[0], 5);
7424
-				if (! empty($InfoFieldList[4])) {
7424
+				if (!empty($InfoFieldList[4])) {
7425 7425
 					$pos = 0;
7426 7426
 					$parenthesisopen = 0;
7427 7427
 					while (substr($InfoFieldList[4], $pos, 1) !== '' && ($parenthesisopen || $pos == 0 || substr($InfoFieldList[4], $pos, 1) != ':')) {
@@ -7482,8 +7482,8 @@  discard block
 block discarded – undo
7482 7482
 					}
7483 7483
 
7484 7484
 					$sqlwhere = '';
7485
-					$sql = "SELECT " . $keyList;
7486
-					$sql .= " FROM " . $this->db->prefix() . $InfoFieldList[0];
7485
+					$sql = "SELECT ".$keyList;
7486
+					$sql .= " FROM ".$this->db->prefix().$InfoFieldList[0];
7487 7487
 					if (!empty($InfoFieldList[4])) {
7488 7488
 						// can use SELECT request
7489 7489
 						if (strpos($InfoFieldList[4], '$SEL$') !== false) {
@@ -7500,18 +7500,18 @@  discard block
 block discarded – undo
7500 7500
 						// We have to join on extrafield table
7501 7501
 						$errstr = '';
7502 7502
 						if (strpos($InfoFieldList[4], 'extra') !== false) {
7503
-							$sql .= " as main, " . $this->db->prefix() . $InfoFieldList[0] . "_extrafields as extra";
7504
-							$sqlwhere .= " WHERE extra.fk_object=main." . $InfoFieldList[2];
7505
-							$sqlwhere .= " AND " . forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1);
7503
+							$sql .= " as main, ".$this->db->prefix().$InfoFieldList[0]."_extrafields as extra";
7504
+							$sqlwhere .= " WHERE extra.fk_object=main.".$InfoFieldList[2];
7505
+							$sqlwhere .= " AND ".forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1);
7506 7506
 						} else {
7507
-							$sqlwhere .= " WHERE " . forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1);
7507
+							$sqlwhere .= " WHERE ".forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1);
7508 7508
 						}
7509 7509
 					} else {
7510 7510
 						$sqlwhere .= ' WHERE 1=1';
7511 7511
 					}
7512 7512
 					// Some tables may have field, some other not. For the moment we disable it.
7513 7513
 					if (in_array($InfoFieldList[0], array('tablewithentity'))) {
7514
-						$sqlwhere .= " AND entity = " . ((int) $conf->entity);
7514
+						$sqlwhere .= " AND entity = ".((int) $conf->entity);
7515 7515
 					}
7516 7516
 					$sql .= $sqlwhere;
7517 7517
 					//print $sql;
@@ -7523,7 +7523,7 @@  discard block
 block discarded – undo
7523 7523
 						$sql .= " ORDER BY ".$this->db->sanitize(implode(', ', $fields_label));
7524 7524
 					}
7525 7525
 
7526
-					dol_syslog(get_class($this) . '::showInputField type=sellist', LOG_DEBUG);
7526
+					dol_syslog(get_class($this).'::showInputField type=sellist', LOG_DEBUG);
7527 7527
 					$resql = $this->db->query($sql);
7528 7528
 					if ($resql) {
7529 7529
 						$out .= '<option value="0">&nbsp;</option>';
@@ -7539,7 +7539,7 @@  discard block
 block discarded – undo
7539 7539
 							if (count($fields_label) > 1) {
7540 7540
 								$notrans = true;
7541 7541
 								foreach ($fields_label as $field_toshow) {
7542
-									$labeltoshow .= $obj->$field_toshow . ' ';
7542
+									$labeltoshow .= $obj->$field_toshow.' ';
7543 7543
 								}
7544 7544
 							} else {
7545 7545
 								$labeltoshow = $obj->{$InfoFieldList[1]};
@@ -7550,12 +7550,12 @@  discard block
 block discarded – undo
7550 7550
 								foreach ($fields_label as $field_toshow) {
7551 7551
 									$translabel = $langs->trans($obj->$field_toshow);
7552 7552
 									if ($translabel != $obj->$field_toshow) {
7553
-										$labeltoshow = dol_trunc($translabel) . ' ';
7553
+										$labeltoshow = dol_trunc($translabel).' ';
7554 7554
 									} else {
7555
-										$labeltoshow = dol_trunc($obj->$field_toshow) . ' ';
7555
+										$labeltoshow = dol_trunc($obj->$field_toshow).' ';
7556 7556
 									}
7557 7557
 								}
7558
-								$out .= '<option value="' . $obj->rowid . '" selected>' . $labeltoshow . '</option>';
7558
+								$out .= '<option value="'.$obj->rowid.'" selected>'.$labeltoshow.'</option>';
7559 7559
 							} else {
7560 7560
 								if (!$notrans) {
7561 7561
 									$translabel = $langs->trans($obj->{$InfoFieldList[1]});
@@ -7569,34 +7569,34 @@  discard block
 block discarded – undo
7569 7569
 									$labeltoshow = '(not defined)';
7570 7570
 								}
7571 7571
 								if ($value == $obj->rowid) {
7572
-									$out .= '<option value="' . $obj->rowid . '" selected>' . $labeltoshow . '</option>';
7572
+									$out .= '<option value="'.$obj->rowid.'" selected>'.$labeltoshow.'</option>';
7573 7573
 								}
7574 7574
 
7575 7575
 								if (!empty($InfoFieldList[3]) && $parentField) {
7576
-									$parent = $parentName . ':' . $obj->{$parentField};
7576
+									$parent = $parentName.':'.$obj->{$parentField};
7577 7577
 									$isDependList = 1;
7578 7578
 								}
7579 7579
 
7580
-								$out .= '<option value="' . $obj->rowid . '"';
7580
+								$out .= '<option value="'.$obj->rowid.'"';
7581 7581
 								$out .= ($value == $obj->rowid ? ' selected' : '');
7582
-								$out .= (!empty($parent) ? ' parent="' . $parent . '"' : '');
7583
-								$out .= '>' . $labeltoshow . '</option>';
7582
+								$out .= (!empty($parent) ? ' parent="'.$parent.'"' : '');
7583
+								$out .= '>'.$labeltoshow.'</option>';
7584 7584
 							}
7585 7585
 
7586 7586
 							$i++;
7587 7587
 						}
7588 7588
 						$this->db->free($resql);
7589 7589
 					} else {
7590
-						print 'Error in request ' . $sql . ' ' . $this->db->lasterror() . '. Check setup of extra parameters.<br>';
7590
+						print 'Error in request '.$sql.' '.$this->db->lasterror().'. Check setup of extra parameters.<br>';
7591 7591
 					}
7592 7592
 				} else {
7593 7593
 					require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
7594 7594
 					$data = $form->select_all_categories(Categorie::$MAP_ID_TO_CODE[$InfoFieldList[5]], '', 'parent', 64, $InfoFieldList[6], 1, 1);
7595 7595
 					$out .= '<option value="0">&nbsp;</option>';
7596 7596
 					foreach ($data as $data_key => $data_value) {
7597
-						$out .= '<option value="' . $data_key . '"';
7597
+						$out .= '<option value="'.$data_key.'"';
7598 7598
 						$out .= ($value == $data_key ? ' selected' : '');
7599
-						$out .= '>' . $data_value . '</option>';
7599
+						$out .= '>'.$data_value.'</option>';
7600 7600
 					}
7601 7601
 				}
7602 7602
 			}
@@ -7605,7 +7605,7 @@  discard block
 block discarded – undo
7605 7605
 			$value_arr = explode(',', $value);
7606 7606
 			$out = $form->multiselectarray($keyprefix.$key.$keysuffix, (empty($param['options']) ? null : $param['options']), $value_arr, '', 0, $morecss, 0, '100%');
7607 7607
 		} elseif ($type == 'radio') {
7608
-			$out = '';  // @phan-suppress-current-line PhanPluginRedundantAssignment
7608
+			$out = ''; // @phan-suppress-current-line PhanPluginRedundantAssignment
7609 7609
 			foreach ($param['options'] as $keyopt => $valopt) {
7610 7610
 				$out .= '<input class="flat '.$morecss.'" type="radio" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" '.($moreparam ? $moreparam : '');
7611 7611
 				$out .= ' value="'.$keyopt.'"';
@@ -7661,8 +7661,8 @@  discard block
 block discarded – undo
7661 7661
 					}
7662 7662
 
7663 7663
 					$sqlwhere = '';
7664
-					$sql = "SELECT " . $keyList;
7665
-					$sql .= ' FROM ' . $this->db->prefix() . $InfoFieldList[0];
7664
+					$sql = "SELECT ".$keyList;
7665
+					$sql .= ' FROM '.$this->db->prefix().$InfoFieldList[0];
7666 7666
 					if (!empty($InfoFieldList[4])) {
7667 7667
 						// can use SELECT request
7668 7668
 						if (strpos($InfoFieldList[4], '$SEL$') !== false) {
@@ -7678,23 +7678,23 @@  discard block
 block discarded – undo
7678 7678
 
7679 7679
 						// We have to join on extrafield table
7680 7680
 						if (strpos($InfoFieldList[4], 'extra') !== false) {
7681
-							$sql .= ' as main, ' . $this->db->prefix() . $InfoFieldList[0] . '_extrafields as extra';
7682
-							$sqlwhere .= " WHERE extra.fk_object=main." . $InfoFieldList[2] . " AND " . $InfoFieldList[4];
7681
+							$sql .= ' as main, '.$this->db->prefix().$InfoFieldList[0].'_extrafields as extra';
7682
+							$sqlwhere .= " WHERE extra.fk_object=main.".$InfoFieldList[2]." AND ".$InfoFieldList[4];
7683 7683
 						} else {
7684
-							$sqlwhere .= " WHERE " . $InfoFieldList[4];
7684
+							$sqlwhere .= " WHERE ".$InfoFieldList[4];
7685 7685
 						}
7686 7686
 					} else {
7687 7687
 						$sqlwhere .= ' WHERE 1=1';
7688 7688
 					}
7689 7689
 					// Some tables may have field, some other not. For the moment we disable it.
7690 7690
 					if (in_array($InfoFieldList[0], array('tablewithentity'))) {
7691
-						$sqlwhere .= " AND entity = " . ((int) $conf->entity);
7691
+						$sqlwhere .= " AND entity = ".((int) $conf->entity);
7692 7692
 					}
7693 7693
 					// $sql.=preg_replace('/^ AND /','',$sqlwhere);
7694 7694
 					// print $sql;
7695 7695
 
7696 7696
 					$sql .= $sqlwhere;
7697
-					dol_syslog(get_class($this) . '::showInputField type=chkbxlst', LOG_DEBUG);
7697
+					dol_syslog(get_class($this).'::showInputField type=chkbxlst', LOG_DEBUG);
7698 7698
 					$resql = $this->db->query($sql);
7699 7699
 					if ($resql) {
7700 7700
 						$num = $this->db->num_rows($resql);
@@ -7712,7 +7712,7 @@  discard block
 block discarded – undo
7712 7712
 							if (count($fields_label) > 1) {
7713 7713
 								$notrans = true;
7714 7714
 								foreach ($fields_label as $field_toshow) {
7715
-									$labeltoshow .= $obj->$field_toshow . ' ';
7715
+									$labeltoshow .= $obj->$field_toshow.' ';
7716 7716
 								}
7717 7717
 							} else {
7718 7718
 								$labeltoshow = $obj->{$InfoFieldList[1]};
@@ -7723,9 +7723,9 @@  discard block
 block discarded – undo
7723 7723
 								foreach ($fields_label as $field_toshow) {
7724 7724
 									$translabel = $langs->trans($obj->$field_toshow);
7725 7725
 									if ($translabel != $obj->$field_toshow) {
7726
-										$labeltoshow = dol_trunc($translabel, 18) . ' ';
7726
+										$labeltoshow = dol_trunc($translabel, 18).' ';
7727 7727
 									} else {
7728
-										$labeltoshow = dol_trunc($obj->$field_toshow, 18) . ' ';
7728
+										$labeltoshow = dol_trunc($obj->$field_toshow, 18).' ';
7729 7729
 									}
7730 7730
 								}
7731 7731
 
@@ -7748,7 +7748,7 @@  discard block
 block discarded – undo
7748 7748
 								}
7749 7749
 
7750 7750
 								if (!empty($InfoFieldList[3]) && $parentField) {
7751
-									$parent = $parentName . ':' . $obj->{$parentField};
7751
+									$parent = $parentName.':'.$obj->{$parentField};
7752 7752
 									$isDependList = 1;
7753 7753
 								}
7754 7754
 
@@ -7759,14 +7759,14 @@  discard block
 block discarded – undo
7759 7759
 						}
7760 7760
 						$this->db->free($resql);
7761 7761
 
7762
-						$out = $form->multiselectarray($keyprefix . $key . $keysuffix, $data, $value_arr, '', 0, $morecss, 0, '100%');
7762
+						$out = $form->multiselectarray($keyprefix.$key.$keysuffix, $data, $value_arr, '', 0, $morecss, 0, '100%');
7763 7763
 					} else {
7764
-						print 'Error in request ' . $sql . ' ' . $this->db->lasterror() . '. Check setup of extra parameters.<br>';
7764
+						print 'Error in request '.$sql.' '.$this->db->lasterror().'. Check setup of extra parameters.<br>';
7765 7765
 					}
7766 7766
 				} else {
7767 7767
 					require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
7768 7768
 					$data = $form->select_all_categories(Categorie::$MAP_ID_TO_CODE[$InfoFieldList[5]], '', 'parent', 64, $InfoFieldList[6], 1, 1);
7769
-					$out = $form->multiselectarray($keyprefix . $key . $keysuffix, $data, $value_arr, '', 0, $morecss, 0, '100%');
7769
+					$out = $form->multiselectarray($keyprefix.$key.$keysuffix, $data, $value_arr, '', 0, $morecss, 0, '100%');
7770 7770
 				}
7771 7771
 			}
7772 7772
 		} elseif ($type == 'link') {
@@ -7824,7 +7824,7 @@  discard block
 block discarded – undo
7824 7824
 			$newval = $val;
7825 7825
 			$newval['type'] = 'varchar(256)';
7826 7826
 
7827
-			$out = '';  // @phan-suppress-current-line PhanPluginRedundantAssignment
7827
+			$out = ''; // @phan-suppress-current-line PhanPluginRedundantAssignment
7828 7828
 			if (!empty($value)) {
7829 7829
 				foreach ($value as $option) {
7830 7830
 					$out .= '<span><a class="'.dol_escape_htmltag($keyprefix.$key.$keysuffix).'_del" href="javascript:;"><span class="fa fa-minus-circle valignmiddle"></span></a> ';
@@ -7991,7 +7991,7 @@  discard block
 block discarded – undo
7991 7991
 			$value = $this->getLibStatut(3);
7992 7992
 		} elseif ($type == 'date') {
7993 7993
 			if (!empty($value)) {
7994
-				$value = dol_print_date($value, 'day');	// We suppose dates without time are always gmt (storage of course + output)
7994
+				$value = dol_print_date($value, 'day'); // We suppose dates without time are always gmt (storage of course + output)
7995 7995
 			} else {
7996 7996
 				$value = '';
7997 7997
 			}
@@ -8036,7 +8036,7 @@  discard block
 block discarded – undo
8036 8036
 			$value = isset($param['options'][$value]) ? $param['options'][$value] : '';
8037 8037
 			if (strpos($value, "|") !== false) {
8038 8038
 				$value = $langs->trans(explode('|', $value)[0]);
8039
-			} elseif (! is_numeric($value)) {
8039
+			} elseif (!is_numeric($value)) {
8040 8040
 				$value = $langs->trans($value);
8041 8041
 			}
8042 8042
 		} elseif ($type == 'sellist') {
@@ -8098,9 +8098,9 @@  discard block
 block discarded – undo
8098 8098
 									$translabel = $langs->trans($obj->$field_toshow);
8099 8099
 								}
8100 8100
 								if ($translabel != $field_toshow) {
8101
-									$value .= dol_trunc($translabel, 18) . ' ';
8101
+									$value .= dol_trunc($translabel, 18).' ';
8102 8102
 								} else {
8103
-									$value .= $obj->$field_toshow . ' ';
8103
+									$value .= $obj->$field_toshow.' ';
8104 8104
 								}
8105 8105
 							}
8106 8106
 						} else {
@@ -8116,7 +8116,7 @@  discard block
 block discarded – undo
8116 8116
 						}
8117 8117
 					}
8118 8118
 				} else {
8119
-					require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
8119
+					require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
8120 8120
 
8121 8121
 					$toprint = array();
8122 8122
 					$obj = $this->db->fetch_object($resql);
@@ -8124,7 +8124,7 @@  discard block
 block discarded – undo
8124 8124
 					$c->fetch($obj->rowid);
8125 8125
 					$ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text
8126 8126
 					foreach ($ways as $way) {
8127
-						$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #aaa"') . '>' . img_object('', 'category') . ' ' . $way . '</li>';
8127
+						$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #aaa"').'>'.img_object('', 'category').' '.$way.'</li>';
8128 8128
 					}
8129 8129
 					$value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
8130 8130
 				}
@@ -8140,11 +8140,11 @@  discard block
 block discarded – undo
8140 8140
 				$toprint = array();
8141 8141
 				foreach ($value_arr as $keyval => $valueval) {
8142 8142
 					if (!empty($valueval)) {
8143
-						$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . $param['options'][$valueval] . '</li>';
8143
+						$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$param['options'][$valueval].'</li>';
8144 8144
 					}
8145 8145
 				}
8146 8146
 				if (!empty($toprint)) {
8147
-					$value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>';
8147
+					$value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
8148 8148
 				}
8149 8149
 			}
8150 8150
 		} elseif ($type == 'chkbxlst') {
@@ -8199,9 +8199,9 @@  discard block
 block discarded – undo
8199 8199
 										$translabel = $langs->trans($obj->$field_toshow);
8200 8200
 									}
8201 8201
 									if ($translabel != $field_toshow) {
8202
-										$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . dol_trunc($translabel, 18) . '</li>';
8202
+										$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.dol_trunc($translabel, 18).'</li>';
8203 8203
 									} else {
8204
-										$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . $obj->$field_toshow . '</li>';
8204
+										$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$obj->$field_toshow.'</li>';
8205 8205
 									}
8206 8206
 								}
8207 8207
 							} else {
@@ -8210,15 +8210,15 @@  discard block
 block discarded – undo
8210 8210
 									$translabel = $langs->trans($obj->{$InfoFieldList[1]});
8211 8211
 								}
8212 8212
 								if ($translabel != $obj->{$InfoFieldList[1]}) {
8213
-									$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . dol_trunc($translabel, 18) . '</li>';
8213
+									$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.dol_trunc($translabel, 18).'</li>';
8214 8214
 								} else {
8215
-									$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . $obj->{$InfoFieldList[1]} . '</li>';
8215
+									$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$obj->{$InfoFieldList[1]}.'</li>';
8216 8216
 								}
8217 8217
 							}
8218 8218
 						}
8219 8219
 					}
8220 8220
 				} else {
8221
-					require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
8221
+					require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
8222 8222
 
8223 8223
 					$toprint = array();
8224 8224
 					while ($obj = $this->db->fetch_object($resql)) {
@@ -8227,7 +8227,7 @@  discard block
 block discarded – undo
8227 8227
 							$c->fetch($obj->rowid);
8228 8228
 							$ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text
8229 8229
 							foreach ($ways as $way) {
8230
-								$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #aaa"') . '>' . img_object('', 'category') . ' ' . $way . '</li>';
8230
+								$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #aaa"').'>'.img_object('', 'category').' '.$way.'</li>';
8231 8231
 							}
8232 8232
 						}
8233 8233
 					}
@@ -8380,7 +8380,7 @@  discard block
 block discarded – undo
8380 8380
 		global $langs;
8381 8381
 
8382 8382
 		if (!class_exists('Validate')) {
8383
-			require_once DOL_DOCUMENT_ROOT . '/core/class/validate.class.php';
8383
+			require_once DOL_DOCUMENT_ROOT.'/core/class/validate.class.php';
8384 8384
 		}
8385 8385
 
8386 8386
 		$this->clearFieldError($fieldKey);
@@ -8612,7 +8612,7 @@  discard block
 block discarded – undo
8612 8612
 				$out .= "\n";
8613 8613
 
8614 8614
 				$nbofextrafieldsshown = 0;
8615
-				$e = 0;	// var to manage the modulo (odd/even)
8615
+				$e = 0; // var to manage the modulo (odd/even)
8616 8616
 
8617 8617
 				$lastseparatorkeyfound = '';
8618 8618
 				$extrafields_collapse_num = '';
@@ -9130,13 +9130,13 @@  discard block
 block discarded – undo
9130 9130
 		if (!empty($this->photo)) {
9131 9131
 			if (dolIsAllowedForPreview($this->photo)) {
9132 9132
 				if ((string) $imagesize == 'mini') {
9133
-					$file = get_exdir(0, 0, 0, 0, $this, $newmodulepart) . 'photos/' . dol_sanitizeFileName(getImageFileNameForSize($this->photo, '_mini'));
9133
+					$file = get_exdir(0, 0, 0, 0, $this, $newmodulepart).'photos/'.dol_sanitizeFileName(getImageFileNameForSize($this->photo, '_mini'));
9134 9134
 				} elseif ((string) $imagesize == 'small') {
9135
-					$file = get_exdir(0, 0, 0, 0, $this, $newmodulepart) . 'photos/' . dol_sanitizeFileName(getImageFileNameForSize($this->photo, '_small'));
9135
+					$file = get_exdir(0, 0, 0, 0, $this, $newmodulepart).'photos/'.dol_sanitizeFileName(getImageFileNameForSize($this->photo, '_small'));
9136 9136
 				} else {
9137
-					$file = get_exdir(0, 0, 0, 0, $this, $newmodulepart) . 'photos/' . dol_sanitizeFileName($this->photo);
9137
+					$file = get_exdir(0, 0, 0, 0, $this, $newmodulepart).'photos/'.dol_sanitizeFileName($this->photo);
9138 9138
 				}
9139
-				$originalfile = get_exdir(0, 0, 0, 0, $this, $newmodulepart) . 'photos/' . dol_sanitizeFileName($this->photo);
9139
+				$originalfile = get_exdir(0, 0, 0, 0, $this, $newmodulepart).'photos/'.dol_sanitizeFileName($this->photo);
9140 9140
 			}
9141 9141
 		}
9142 9142
 
@@ -9712,7 +9712,7 @@  discard block
 block discarded – undo
9712 9712
 						continue;
9713 9713
 					}
9714 9714
 				}
9715
-				$keys_with_alias[] = $alias . '.' . $fieldname;
9715
+				$keys_with_alias[] = $alias.'.'.$fieldname;
9716 9716
 			}
9717 9717
 			return implode(',', $keys_with_alias);
9718 9718
 		} else {
@@ -9841,7 +9841,7 @@  discard block
 block discarded – undo
9841 9841
 		if (!$error) {
9842 9842
 			$sql = "INSERT INTO ".$this->db->prefix().$this->table_element;
9843 9843
 			$sql .= " (".implode(", ", $keys).')';
9844
-			$sql .= " VALUES (".implode(", ", $values).")";		// $values can contains 'abc' or 123
9844
+			$sql .= " VALUES (".implode(", ", $values).")"; // $values can contains 'abc' or 123
9845 9845
 
9846 9846
 			$res = $this->db->query($sql);
9847 9847
 			if (!$res) {
@@ -10134,7 +10134,7 @@  discard block
 block discarded – undo
10134 10134
 
10135 10135
 		// Update extrafield
10136 10136
 		if (!$error) {
10137
-			$result = $this->insertExtraFields();	// This delete and reinsert extrafields
10137
+			$result = $this->insertExtraFields(); // This delete and reinsert extrafields
10138 10138
 			if ($result < 0) {
10139 10139
 				$error++;
10140 10140
 			}
@@ -10335,12 +10335,12 @@  discard block
 block discarded – undo
10335 10335
 				$error++;
10336 10336
 			} else {
10337 10337
 				while ($obj = $this->db->fetch_object($resql)) {
10338
-					$result = $this->fetch($obj->rowid);	// @phpstan-ignore-line
10338
+					$result = $this->fetch($obj->rowid); // @phpstan-ignore-line
10339 10339
 					if ($result < 0) {
10340 10340
 						$error++;
10341 10341
 						$this->errors[] = $this->error;
10342 10342
 					} else {
10343
-						$result = $this->delete($user);	// @phpstan-ignore-line
10343
+						$result = $this->delete($user); // @phpstan-ignore-line
10344 10344
 						if ($result < 0) {
10345 10345
 							$error++;
10346 10346
 							$this->errors[] = $this->error;
@@ -10555,7 +10555,7 @@  discard block
 block discarded – undo
10555 10555
 		);
10556 10556
 		foreach ($fields as $key => $value) {
10557 10557
 			if (array_key_exists($key, $this->fields)) {
10558
-				$this->{$key} = $value;		// @phpstan-ignore-line
10558
+				$this->{$key} = $value; // @phpstan-ignore-line
10559 10559
 			}
10560 10560
 		}
10561 10561
 
Please login to merge, or discard this patch.
htdocs/don/paiement/list.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'sclist';
42 42
 $mode = GETPOST('mode', 'alpha');
43 43
 
44
-$paiementid				= GETPOSTINT('paiementid');
44
+$paiementid = GETPOSTINT('paiementid');
45 45
 
46 46
 $search_ref = GETPOST("search_ref", "alpha");
47 47
 $search_date_startday = GETPOSTINT('search_date_startday');
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 	'pd.amount'			=> array('label' => "Amount", 'checked' => 1, 'position' => 80),
98 98
 );
99 99
 $arrayfields = dol_sort_array($arrayfields, 'position');
100
-'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields';  // dol_sort_array looses type for Phan
100
+'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan
101 101
 
102 102
 $optioncss = GETPOST('optioncss', 'alpha');
103 103
 $moreforfilter = GETPOST('moreforfilter', 'alpha');
@@ -187,10 +187,10 @@  discard block
 block discarded – undo
187 187
 	$sql .= natural_search('pd.rowid', $search_ref);
188 188
 }
189 189
 if ($search_date_start) {
190
-	$sql .= " AND pd.datep >= '" . $db->idate($search_date_start) . "'";
190
+	$sql .= " AND pd.datep >= '".$db->idate($search_date_start)."'";
191 191
 }
192 192
 if ($search_date_end) {
193
-	$sql .= " AND pd.datep <= '" . $db->idate($search_date_end) . "'";
193
+	$sql .= " AND pd.datep <= '".$db->idate($search_date_end)."'";
194 194
 }
195 195
 if ($search_account > 0) {
196 196
 	$sql .= " AND b.fk_account=".((int) $search_account);
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
 // Output page
257 257
 // --------------------------------------------------------------------
258 258
 
259
-llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'bodyforlist');	// Can use also classforhorizontalscrolloftabs instead of bodyforlist for no horizontal scroll
259
+llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'bodyforlist'); // Can use also classforhorizontalscrolloftabs instead of bodyforlist for no horizontal scroll
260 260
 
261 261
 $param = '';
262 262
 if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
@@ -532,7 +532,7 @@  discard block
 block discarded – undo
532 532
 
533 533
 	// Ref
534 534
 	if (!empty($arrayfields['pd.rowid']['checked'])) {
535
-		print '<td><a href="' . DOL_URL_ROOT . '/don/payment/card.php?id=' . $obj->payment_id . '">' . img_object($langs->trans("Payment"), "payment") . ' ' . $obj->payment_id . '</a></td>';
535
+		print '<td><a href="'.DOL_URL_ROOT.'/don/payment/card.php?id='.$obj->payment_id.'">'.img_object($langs->trans("Payment"), "payment").' '.$obj->payment_id.'</a></td>';
536 536
 		if (!$i) {
537 537
 			$totalarray['nbfield']++;
538 538
 		}
@@ -613,7 +613,7 @@  discard block
 block discarded – undo
613 613
 
614 614
 	// Amount
615 615
 	if (!empty($arrayfields['pd.amount']['checked'])) {
616
-		print '<td ><span class="amount">' . price($obj->amount) . '</span></td>';
616
+		print '<td ><span class="amount">'.price($obj->amount).'</span></td>';
617 617
 		if (!$i) {
618 618
 			$totalarray['nbfield']++;
619 619
 			$totalarray['pos'][$totalarray['nbfield']] = 'amount';
Please login to merge, or discard this patch.
htdocs/compta/tva/list.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -46,20 +46,20 @@  discard block
 block discarded – undo
46 46
 $confirm    = GETPOST('confirm', 'alpha'); // Result of a confirmation
47 47
 $cancel     = GETPOST('cancel', 'alpha'); // We click on a Cancel button
48 48
 $toselect   = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list
49
-$contextpage				= GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'salestaxeslist';
49
+$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'salestaxeslist';
50 50
 $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page
51 51
 $optioncss = GETPOST('optioncss', 'alpha');
52 52
 $optioncss  = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
53 53
 $mode       = GETPOST('mode', 'aZ'); // The output mode ('list', 'kanban', 'hierarchy', 'calendar', ...)
54 54
 
55
-$search_ref					= GETPOST('search_ref', 'alpha');
55
+$search_ref = GETPOST('search_ref', 'alpha');
56 56
 $search_label = GETPOST('search_label', 'alpha');
57 57
 $search_dateend_start = dol_mktime(0, 0, 0, GETPOSTINT('search_dateend_startmonth'), GETPOSTINT('search_dateend_startday'), GETPOSTINT('search_dateend_startyear'));
58 58
 $search_dateend_end = dol_mktime(23, 59, 59, GETPOSTINT('search_dateend_endmonth'), GETPOSTINT('search_dateend_endday'), GETPOSTINT('search_dateend_endyear'));
59 59
 $search_datepayment_start = dol_mktime(0, 0, 0, GETPOSTINT('search_datepayment_startmonth'), GETPOSTINT('search_datepayment_startday'), GETPOSTINT('search_datepayment_startyear'));
60 60
 $search_datepayment_end = dol_mktime(23, 59, 59, GETPOSTINT('search_datepayment_endmonth'), GETPOSTINT('search_datepayment_endday'), GETPOSTINT('search_datepayment_endyear'));
61 61
 $search_type = GETPOST('search_type', 'intcomma');
62
-$search_account	= GETPOST('search_account', 'alpha');
62
+$search_account = GETPOST('search_account', 'alpha');
63 63
 $search_amount = GETPOST('search_amount', 'alpha');
64 64
 $search_status = GETPOST('search_status', 'intcomma');
65 65
 
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 }
97 97
 
98 98
 $arrayfields = dol_sort_array($arrayfields, 'position');
99
-'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields';  // dol_sort_array looses type for Phan
99
+'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan
100 100
 
101 101
 // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
102 102
 $hookmanager->initHooks(array('salestaxeslist'));
@@ -713,7 +713,7 @@  discard block
 block discarded – undo
713 713
 
714 714
 		// Amount
715 715
 		if (!empty($arrayfields['t.amount']['checked'])) {
716
-			print '<td class="nowrap right"><span class="amount">' . price($obj->amount) . '</span></td>';
716
+			print '<td class="nowrap right"><span class="amount">'.price($obj->amount).'</span></td>';
717 717
 			if (!$i) {
718 718
 				$totalarray['nbfield']++;
719 719
 			}
@@ -726,7 +726,7 @@  discard block
 block discarded – undo
726 726
 		}
727 727
 
728 728
 		if (!empty($arrayfields['t.status']['checked'])) {
729
-			print '<td class="nowrap right">' . $tva_static->getLibStatut(5, $obj->alreadypayed) . '</td>';
729
+			print '<td class="nowrap right">'.$tva_static->getLibStatut(5, $obj->alreadypayed).'</td>';
730 730
 			if (!$i) {
731 731
 				$totalarray['nbfield']++;
732 732
 			}
Please login to merge, or discard this patch.