Completed
Branch develop (9ce9ea)
by
unknown
18:48
created
htdocs/takepos/invoice.php 1 patch
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -132,13 +132,13 @@  discard block
 block discarded – undo
132 132
 if ($invoiceid > 0) {
133 133
 	$ret = $invoice->fetch($invoiceid);
134 134
 } else {
135
-	$ret = $invoice->fetch('', '(PROV-POS'. (isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : '') .'-'.$place.')');
135
+	$ret = $invoice->fetch('', '(PROV-POS'.(isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : '').'-'.$place.')');
136 136
 }
137 137
 if ($ret > 0) {
138 138
 	$placeid = $invoice->id;
139 139
 }
140 140
 
141
-$constforcompanyid = 'CASHDESK_ID_THIRDPARTY'. (isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : '');
141
+$constforcompanyid = 'CASHDESK_ID_THIRDPARTY'.(isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : '');
142 142
 
143 143
 $soc = new Societe($db);
144 144
 if ($invoice->socid > 0) {
@@ -159,8 +159,8 @@  discard block
 block discarded – undo
159 159
  * Actions
160 160
  */
161 161
 
162
-$parameters=array();
163
-$reshook=$hookmanager->executeHooks('doActions', $parameters, $invoice, $action);    // Note that $action and $object may have been modified by some hooks
162
+$parameters = array();
163
+$reshook = $hookmanager->executeHooks('doActions', $parameters, $invoice, $action); // Note that $action and $object may have been modified by some hooks
164 164
 if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
165 165
 
166 166
 if (empty($reshook)) {
@@ -173,9 +173,9 @@  discard block
 block discarded – undo
173 173
 			$bankaccount = GETPOST('accountid', 'int');
174 174
 		} else {
175 175
 			if ($pay == 'LIQ') {
176
-				$bankaccount = getDolGlobalString('CASHDESK_ID_BANKACCOUNT_CASH'.$_SESSION["takeposterminal"]);            // For backward compatibility
176
+				$bankaccount = getDolGlobalString('CASHDESK_ID_BANKACCOUNT_CASH'.$_SESSION["takeposterminal"]); // For backward compatibility
177 177
 			} elseif ($pay == "CHQ") {
178
-				$bankaccount = getDolGlobalString('CASHDESK_ID_BANKACCOUNT_CHEQUE'.$_SESSION["takeposterminal"]);    // For backward compatibility
178
+				$bankaccount = getDolGlobalString('CASHDESK_ID_BANKACCOUNT_CHEQUE'.$_SESSION["takeposterminal"]); // For backward compatibility
179 179
 			} else {
180 180
 				$accountname = "CASHDESK_ID_BANKACCOUNT_".$pay.$_SESSION["takeposterminal"];
181 181
 				$bankaccount = getDolGlobalString($accountname);
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
 			if ($res < 0) {
251 251
 				$error++;
252 252
 				$langs->load("admin");
253
-				dol_htmloutput_errors($invoice->error == 'NotConfigured' ? $langs->trans("NotConfigured").' (TakePos numbering module)': $invoice->error, $invoice->errors, 1);
253
+				dol_htmloutput_errors($invoice->error == 'NotConfigured' ? $langs->trans("NotConfigured").' (TakePos numbering module)' : $invoice->error, $invoice->errors, 1);
254 254
 			}
255 255
 		}
256 256
 
@@ -311,7 +311,7 @@  discard block
 block discarded – undo
311 311
 		$creditnote->socid = $invoice->socid;
312 312
 		$creditnote->date = dol_now();
313 313
 		$creditnote->module_source = 'takepos';
314
-		$creditnote->pos_source =  isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : '' ;
314
+		$creditnote->pos_source = isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : '';
315 315
 		$creditnote->type = Facture::TYPE_CREDIT_NOTE;
316 316
 		$creditnote->fk_facture_source = $placeid;
317 317
 		$creditnote->remise_absolue = $invoice->remise_absolue;
@@ -462,9 +462,9 @@  discard block
 block discarded – undo
462 462
 	// If we add a line and no invoice yet, we create the invoice
463 463
 	if (($action == "addline" || $action == "freezone") && $placeid == 0) {
464 464
 		$invoice->socid = getDolGlobalString($constforcompanyid);
465
-		$invoice->date = dol_now('tzuserrel');		// We use the local date, only the day will be saved.
465
+		$invoice->date = dol_now('tzuserrel'); // We use the local date, only the day will be saved.
466 466
 		$invoice->module_source = 'takepos';
467
-		$invoice->pos_source =  isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : '' ;
467
+		$invoice->pos_source = isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : '';
468 468
 		$invoice->entity = !empty($_SESSION["takeposinvoiceentity"]) ? $_SESSION["takeposinvoiceentity"] : $conf->entity;
469 469
 
470 470
 		if ($invoice->socid <= 0) {
@@ -524,7 +524,7 @@  discard block
 block discarded – undo
524 524
 		if (!empty($conf->global->TAKEPOS_GROUP_SAME_PRODUCT)) {
525 525
 			foreach ($invoice->lines as $line) {
526 526
 				if ($line->product_ref == $prod->ref) {
527
-					if ($line->special_code==4) continue; // If this line is sended to printer create new line
527
+					if ($line->special_code == 4) continue; // If this line is sended to printer create new line
528 528
 					$result = $invoice->updateline($line->id, $line->desc, $line->subprice, $line->qty + $qty, $line->remise_percent, $line->date_start, $line->date_end, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, 'HT', $line->info_bits, $line->product_type, $line->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->special_code, $line->array_options, $line->situation_percent, $line->fk_unit);
529 529
 					if ($result < 0) {
530 530
 						dol_htmloutput_errors($invoice->error, $invoice->errors, 1);
@@ -564,7 +564,7 @@  discard block
 block discarded – undo
564 564
 
565 565
 			// complete line by hook
566 566
 			$parameters = array('prod' => $prod, 'line' => $line);
567
-			$reshook=$hookmanager->executeHooks('completeTakePosAddLine', $parameters, $invoice, $action);    // Note that $action and $line may have been modified by some hooks
567
+			$reshook = $hookmanager->executeHooks('completeTakePosAddLine', $parameters, $invoice, $action); // Note that $action and $line may have been modified by some hooks
568 568
 			if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
569 569
 
570 570
 
@@ -608,7 +608,7 @@  discard block
 block discarded – undo
608 608
 
609 609
 	if ($action == "addnote") {
610 610
 		$desc = GETPOST('addnote', 'alpha');
611
-		if ($idline==0) {
611
+		if ($idline == 0) {
612 612
 			$invoice->update_note($desc, '_public');
613 613
 		} else foreach ($invoice->lines as $line) {
614 614
 			if ($line->id == $idline) {
@@ -708,7 +708,7 @@  discard block
 block discarded – undo
708 708
 				} else {
709 709
 					if (empty($user->rights->takepos->editlines) || (empty($user->rights->takepos->editorderedlines) && $line->special_code == "4")) {
710 710
 						dol_htmloutput_errors($langs->trans("NotEnoughPermissions", "TakePos"), null, 1);
711
-					} elseif (getDolGlobalInt('TAKEPOS_CHANGE_PRICE_HT')  == 1) {
711
+					} elseif (getDolGlobalInt('TAKEPOS_CHANGE_PRICE_HT') == 1) {
712 712
 						$result = $invoice->updateline($line->id, $line->desc, $number, $line->qty, $line->remise_percent, $line->date_start, $line->date_end, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, 'HT', $line->info_bits, $line->product_type, $line->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->special_code, $line->array_options, $line->situation_percent, $line->fk_unit);
713 713
 					} else {
714 714
 						$result = $invoice->updateline($line->id, $line->desc, $number, $line->qty, $line->remise_percent, $line->date_start, $line->date_end, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, 'TTC', $line->info_bits, $line->product_type, $line->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->special_code, $line->array_options, $line->situation_percent, $line->fk_unit);
@@ -903,7 +903,7 @@  discard block
 block discarded – undo
903 903
 		}
904 904
 		$sectionwithinvoicelink .= '</span><br>';
905 905
 		if (getDolGlobalInt('TAKEPOS_PRINT_INVOICE_DOC_INSTEAD_OF_RECEIPT')) {
906
-			$sectionwithinvoicelink .= ' <a target="_blank" class="button" href="' . DOL_URL_ROOT . '/document.php?token=' . newToken() . '&modulepart=facture&file=' . $invoice->ref . '/' . $invoice->ref . '.pdf">Invoice</a>';
906
+			$sectionwithinvoicelink .= ' <a target="_blank" class="button" href="'.DOL_URL_ROOT.'/document.php?token='.newToken().'&modulepart=facture&file='.$invoice->ref.'/'.$invoice->ref.'.pdf">Invoice</a>';
907 907
 		} elseif (getDolGlobalString('TAKEPOS_PRINT_METHOD') == "takeposconnector") {
908 908
 			if (getDolGlobalString('TAKEPOS_PRINT_SERVER') && filter_var($conf->global->TAKEPOS_PRINT_SERVER, FILTER_VALIDATE_URL) == true) {
909 909
 				$sectionwithinvoicelink .= ' <button id="buttonprint" type="button" onclick="TakeposConnector('.$placeid.')">'.$langs->trans('PrintTicket').'</button>';
@@ -965,7 +965,7 @@  discard block
 block discarded – undo
965 965
 <script type="text/javascript">
966 966
 var selectedline=0;
967 967
 var selectedtext="";
968
-<?php if ($action=="valid") echo "var place=0;";?> // Set to default place after close sale
968
+<?php if ($action == "valid") echo "var place=0;"; ?> // Set to default place after close sale
969 969
 var placeid=<?php echo ($placeid > 0 ? $placeid : 0); ?>;
970 970
 $(document).ready(function() {
971 971
 	var idoflineadded = <?php echo (empty($idoflineadded) ? 0 : $idoflineadded); ?>;
@@ -1203,10 +1203,10 @@  discard block
 block discarded – undo
1203 1203
 	$s = '';
1204 1204
 
1205 1205
 	$idwarehouse = 0;
1206
-	$constantforkey = 'CASHDESK_NO_DECREASE_STOCK'. (isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : '');
1206
+	$constantforkey = 'CASHDESK_NO_DECREASE_STOCK'.(isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : '');
1207 1207
 	if (isModEnabled('stock')) {
1208 1208
 		if (getDolGlobalString("$constantforkey") != "1") {
1209
-			$constantforkey = 'CASHDESK_ID_WAREHOUSE'. (isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : '');
1209
+			$constantforkey = 'CASHDESK_ID_WAREHOUSE'.(isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : '');
1210 1210
 			$idwarehouse = getDolGlobalString($constantforkey);
1211 1211
 			if ($idwarehouse > 0) {
1212 1212
 				$s = '<span class="small">';
@@ -1249,7 +1249,7 @@  discard block
 block discarded – undo
1249 1249
 		$result = $adh->fetch('', '', $invoice->socid);
1250 1250
 		if ($result > 0) {
1251 1251
 			$adh->ref = $adh->getFullName($langs);
1252
-			if (empty($adh->statut) || $adh->statut == Adherent::STATUS_EXCLUDED ) {
1252
+			if (empty($adh->statut) || $adh->statut == Adherent::STATUS_EXCLUDED) {
1253 1253
 				$s .= "<s>";
1254 1254
 			}
1255 1255
 			$s .= $adh->getFullName($langs);
@@ -1305,7 +1305,7 @@  discard block
 block discarded – undo
1305 1305
 	print '<script src="'.DOL_URL_ROOT.'/core/js/lib_foot.js.php?lang='.$langs->defaultlang.'"></script>'."\n";
1306 1306
 }
1307 1307
 
1308
-print '<!-- invoice.php place='.(int) $place.' invoice='.$invoice->ref.' mobilepage='.(empty($mobilepage) ? '' : $mobilepage).' $_SESSION["basiclayout"]='.(empty($_SESSION["basiclayout"])?'':$_SESSION["basiclayout"]).' conf->global->TAKEPOS_BAR_RESTAURANT='.getDolGlobalString('TAKEPOS_BAR_RESTAURANT').' -->'."\n";
1308
+print '<!-- invoice.php place='.(int) $place.' invoice='.$invoice->ref.' mobilepage='.(empty($mobilepage) ? '' : $mobilepage).' $_SESSION["basiclayout"]='.(empty($_SESSION["basiclayout"]) ? '' : $_SESSION["basiclayout"]).' conf->global->TAKEPOS_BAR_RESTAURANT='.getDolGlobalString('TAKEPOS_BAR_RESTAURANT').' -->'."\n";
1309 1309
 print '<div class="div-table-responsive-no-min invoice">';
1310 1310
 print '<table id="tablelines" class="noborder noshadow postablelines centpercent">';
1311 1311
 if ($sectionwithinvoicelink && ($mobilepage == "invoice" || $mobilepage == "")) {
@@ -1347,8 +1347,8 @@  discard block
 block discarded – undo
1347 1347
 print '</td>';
1348 1348
 
1349 1349
 // complete header by hook
1350
-$parameters=array();
1351
-$reshook=$hookmanager->executeHooks('completeTakePosInvoiceHeader', $parameters, $invoice, $action);    // Note that $action and $object may have been modified by some hooks
1350
+$parameters = array();
1351
+$reshook = $hookmanager->executeHooks('completeTakePosInvoiceHeader', $parameters, $invoice, $action); // Note that $action and $object may have been modified by some hooks
1352 1352
 if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
1353 1353
 print $hookmanager->resPrint;
1354 1354
 
@@ -1357,16 +1357,16 @@  discard block
 block discarded – undo
1357 1357
 	print '<td class="linecolqty right">'.$langs->trans('Qty').'</td>';
1358 1358
 	if (getDolGlobalString('TAKEPOS_SHOW_HT')) {
1359 1359
 		print '<td class="linecolht right nowraponall">';
1360
-		print '<span class="opacitymedium small">' . $langs->trans('TotalHTShort') . '</span><br>';
1360
+		print '<span class="opacitymedium small">'.$langs->trans('TotalHTShort').'</span><br>';
1361 1361
 		// In phone version only show when it is invoice page
1362 1362
 		if (empty($mobilepage) || $mobilepage == "invoice") {
1363
-			print '<span id="linecolht-span-total" style="font-size:1.3em; font-weight: bold;">' . price($invoice->total_ht, 1, '', 1, -1, -1, $conf->currency) . '</span>';
1363
+			print '<span id="linecolht-span-total" style="font-size:1.3em; font-weight: bold;">'.price($invoice->total_ht, 1, '', 1, -1, -1, $conf->currency).'</span>';
1364 1364
 			if (isModEnabled('multicurrency') && $_SESSION["takeposcustomercurrency"] != "" && $conf->currency != $_SESSION["takeposcustomercurrency"]) {
1365 1365
 				//Only show customer currency if multicurrency module is enabled, if currency selected and if this currency selected is not the same as main currency
1366
-				include_once DOL_DOCUMENT_ROOT . '/multicurrency/class/multicurrency.class.php';
1366
+				include_once DOL_DOCUMENT_ROOT.'/multicurrency/class/multicurrency.class.php';
1367 1367
 				$multicurrency = new MultiCurrency($db);
1368 1368
 				$multicurrency->fetch(0, $_SESSION["takeposcustomercurrency"]);
1369
-				print '<br><span id="linecolht-span-total" style="font-size:0.9em; font-style:italic;">(' . price($invoice->total_ht * $multicurrency->rate->rate) . ' ' . $_SESSION["takeposcustomercurrency"] . ')</span>';
1369
+				print '<br><span id="linecolht-span-total" style="font-size:0.9em; font-style:italic;">('.price($invoice->total_ht * $multicurrency->rate->rate).' '.$_SESSION["takeposcustomercurrency"].')</span>';
1370 1370
 			}
1371 1371
 			print '</td>';
1372 1372
 		}
@@ -1511,8 +1511,8 @@  discard block
 block discarded – undo
1511 1511
 				$htmlsupplements[$line->fk_parent_line] .= '</td>';
1512 1512
 
1513 1513
 				// complete line by hook
1514
-				$parameters=array('line' => $line);
1515
-				$reshook=$hookmanager->executeHooks('completeTakePosInvoiceParentLine', $parameters, $invoice, $action);    // Note that $action and $object may have been modified by some hooks
1514
+				$parameters = array('line' => $line);
1515
+				$reshook = $hookmanager->executeHooks('completeTakePosInvoiceParentLine', $parameters, $invoice, $action); // Note that $action and $object may have been modified by some hooks
1516 1516
 				if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
1517 1517
 				$htmlsupplements[$line->fk_parent_line] .= $hookmanager->resPrint;
1518 1518
 
@@ -1559,7 +1559,7 @@  discard block
 block discarded – undo
1559 1559
 					}
1560 1560
 				}
1561 1561
 				if (getDolGlobalInt('TAKEPOS_SHOW_PRODUCT_REFERENCE') == 1) {
1562
-					$htmlforlines .= $form->textwithpicto($line->product_label ? '<b>' . $line->product_ref . '</b> - ' . $line->product_label : dolGetFirstLineOfText($line->desc, 1), $tooltiptext);
1562
+					$htmlforlines .= $form->textwithpicto($line->product_label ? '<b>'.$line->product_ref.'</b> - '.$line->product_label : dolGetFirstLineOfText($line->desc, 1), $tooltiptext);
1563 1563
 				} elseif (getDolGlobalInt('TAKEPOS_SHOW_PRODUCT_REFERENCE') == 2) {
1564 1564
 					$htmlforlines .= $form->textwithpicto($line->product_ref ? '<b>'.$line->product_ref.'<b>' : dolGetFirstLineOfText($line->desc, 1), $tooltiptext);
1565 1565
 				} else {
@@ -1605,8 +1605,8 @@  discard block
 block discarded – undo
1605 1605
 				$htmlforlines .= '</td>';
1606 1606
 
1607 1607
 				// complete line by hook
1608
-				$parameters=array('line' => $line);
1609
-				$reshook=$hookmanager->executeHooks('completeTakePosInvoiceLine', $parameters, $invoice, $action);    // Note that $action and $object may have been modified by some hooks
1608
+				$parameters = array('line' => $line);
1609
+				$reshook = $hookmanager->executeHooks('completeTakePosInvoiceLine', $parameters, $invoice, $action); // Note that $action and $object may have been modified by some hooks
1610 1610
 				if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
1611 1611
 				$htmlforlines .= $hookmanager->resPrint;
1612 1612
 
@@ -1695,7 +1695,7 @@  discard block
 block discarded – undo
1695 1695
 if (($action == "valid" || $action == "history") && $invoice->type != Facture::TYPE_CREDIT_NOTE && empty($conf->global->TAKEPOS_NO_CREDITNOTE)) {
1696 1696
 	print '<button id="buttonprint" type="button" onclick="ModalBox(\'ModalCreditNote\')">'.$langs->trans('CreateCreditNote').'</button>';
1697 1697
 	if (getDolGlobalInt('TAKEPOS_PRINT_INVOICE_DOC_INSTEAD_OF_RECEIPT')) {
1698
-		print ' <a target="_blank" class="button" href="' . DOL_URL_ROOT . '/document.php?token=' . newToken() . '&modulepart=facture&file=' . $invoice->ref . '/' . $invoice->ref . '.pdf">Invoice</a>';
1698
+		print ' <a target="_blank" class="button" href="'.DOL_URL_ROOT.'/document.php?token='.newToken().'&modulepart=facture&file='.$invoice->ref.'/'.$invoice->ref.'.pdf">Invoice</a>';
1699 1699
 	}
1700 1700
 }
1701 1701
 
Please login to merge, or discard this patch.
htdocs/core/menus/standard/eldy.lib.php 1 patch
Spacing   +363 added lines, -363 removed lines patch added patch discarded remove patch
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 	// Members
97 97
 	$tmpentry = array(
98 98
 		'enabled' => isModEnabled('adherent'),
99
-		'perms' => $user->hasRight('adherent',  'lire'),
99
+		'perms' => $user->hasRight('adherent', 'lire'),
100 100
 		'module' => 'adherent'
101 101
 	);
102 102
 	$menu_arr[] = array(
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
 			)
126 126
 			|| (isModEnabled('supplier_proposal') || isModEnabled('supplier_order') || isModEnabled('supplier_invoice'))
127 127
 			),
128
-		'perms'=> ($user->hasRight('societe',  'lire') || $user->hasRight('fournisseur',  'lire') || $user->hasRight('supplier_order',  'lire') || $user->hasRight('supplier_invoice',  'lire') || $user->hasRight('supplier_proposal',  'lire')),
128
+		'perms'=> ($user->hasRight('societe', 'lire') || $user->hasRight('fournisseur', 'lire') || $user->hasRight('supplier_order', 'lire') || $user->hasRight('supplier_invoice', 'lire') || $user->hasRight('supplier_proposal', 'lire')),
129 129
 		'module'=>'societe|fournisseur'
130 130
 	);
131 131
 	$menu_arr[] = array(
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
 	// Products-Services
151 151
 	$tmpentry = array(
152 152
 		'enabled'=> (isModEnabled('product') || isModEnabled('service') || isModEnabled('expedition')),
153
-		'perms'=> ($user->hasRight('product',  'read') || $user->hasRight('service',  'read') || $user->hasRight('expedition',  'lire')),
153
+		'perms'=> ($user->hasRight('product', 'read') || $user->hasRight('service', 'read') || $user->hasRight('expedition', 'lire')),
154 154
 		'module'=>'product|service'
155 155
 	);
156 156
 	$menu_arr[] = array(
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
 	// MRP - GPAO
178 178
 	$tmpentry = array(
179 179
 		'enabled'=>(isModEnabled('bom') || isModEnabled('mrp')),
180
-		'perms'=>($user->hasRight('bom',  'read') || $user->hasRight('mrp',  'read')),
180
+		'perms'=>($user->hasRight('bom', 'read') || $user->hasRight('mrp', 'read')),
181 181
 		'module'=>'bom|mrp'
182 182
 	);
183 183
 	$menu_arr[] = array(
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
 	// Projects
203 203
 	$tmpentry = array(
204 204
 		'enabled'=> (isModEnabled('projet') ? 1 : 0),
205
-		'perms'=> ($user->hasRight('projet',  'lire') ? 1 : 0),
205
+		'perms'=> ($user->hasRight('projet', 'lire') ? 1 : 0),
206 206
 		'module'=>'projet'
207 207
 	);
208 208
 
@@ -247,25 +247,25 @@  discard block
 block discarded – undo
247 247
 			|| isModEnabled('contrat')
248 248
 			|| isModEnabled('ficheinter')
249 249
 			) ? 1 : 0,
250
-		'perms'=>($user->hasRight('propal',  'read')
251
-			|| $user->hasRight('commande',  'lire')
252
-			|| $user->hasRight('supplier_proposal',  'lire')
253
-			|| $user->hasRight('fournisseur',  'lire')
254
-			|| $user->hasRight('fournisseur',  'commande', 'lire')
255
-			|| $user->hasRight('supplier_order',  'lire')
256
-			|| $user->hasRight('contrat',  'lire')
257
-			|| $user->hasRight('ficheinter',  'lire')
250
+		'perms'=>($user->hasRight('propal', 'read')
251
+			|| $user->hasRight('commande', 'lire')
252
+			|| $user->hasRight('supplier_proposal', 'lire')
253
+			|| $user->hasRight('fournisseur', 'lire')
254
+			|| $user->hasRight('fournisseur', 'commande', 'lire')
255
+			|| $user->hasRight('supplier_order', 'lire')
256
+			|| $user->hasRight('contrat', 'lire')
257
+			|| $user->hasRight('ficheinter', 'lire')
258 258
 			),
259 259
 		'module'=>'propal|commande|supplier_proposal|supplier_order|contrat|ficheinter'
260 260
 	);
261 261
 
262
-	$onlysupplierorder = $user->hasRight('fournisseur',  'commande', 'lire') &&
263
-	!$user->hasRight('propal',  'lire') &&
264
-	!$user->hasRight('commande',  'lire') &&
265
-	!$user->hasRight('supplier_order',  'lire') &&
266
-	!$user->hasRight('supplier_proposal',  'lire') &&
267
-	!$user->hasRight('contrat',  'lire') &&
268
-	!$user->hasRight('ficheinter',  'lire');
262
+	$onlysupplierorder = $user->hasRight('fournisseur', 'commande', 'lire') &&
263
+	!$user->hasRight('propal', 'lire') &&
264
+	!$user->hasRight('commande', 'lire') &&
265
+	!$user->hasRight('supplier_order', 'lire') &&
266
+	!$user->hasRight('supplier_proposal', 'lire') &&
267
+	!$user->hasRight('contrat', 'lire') &&
268
+	!$user->hasRight('ficheinter', 'lire');
269 269
 
270 270
 	$menu_arr[] = array(
271 271
 		'name' => 'Commercial',
@@ -296,9 +296,9 @@  discard block
 block discarded – undo
296 296
 			isModEnabled('loan') ||
297 297
 			isModEnabled('margins')
298 298
 			) ? 1 : 0,
299
-		'perms'=>($user->hasRight('facture',  'lire') || $user->hasRight('don',  'contact', 'lire')
300
-			|| $user->hasRight('tax',  'charges', 'lire') || $user->hasRight('salaries',  'read')
301
-			|| $user->hasRight('fournisseur',  'facture', 'lire') || $user->hasRight('loan',  'read') || $user->hasRight('margins',  'liretous')),
299
+		'perms'=>($user->hasRight('facture', 'lire') || $user->hasRight('don', 'contact', 'lire')
300
+			|| $user->hasRight('tax', 'charges', 'lire') || $user->hasRight('salaries', 'read')
301
+			|| $user->hasRight('fournisseur', 'facture', 'lire') || $user->hasRight('loan', 'read') || $user->hasRight('margins', 'liretous')),
302 302
 		'module'=>'facture|supplier_invoice|don|tax|salaries|loan'
303 303
 	);
304 304
 	$menu_arr[] = array(
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
 	// Bank
324 324
 	$tmpentry = array(
325 325
 		'enabled'=>(isModEnabled('banque') || isModEnabled('prelevement')),
326
-		'perms'=>($user->hasRight('banque',  'lire') || $user->hasRight('prelevement',  'lire') || $user->hasRight('paymentbybanktransfer',  'read')),
326
+		'perms'=>($user->hasRight('banque', 'lire') || $user->hasRight('prelevement', 'lire') || $user->hasRight('paymentbybanktransfer', 'read')),
327 327
 		'module'=>'banque|prelevement|paymentbybanktransfer'
328 328
 	);
329 329
 	$menu_arr[] = array(
@@ -348,7 +348,7 @@  discard block
 block discarded – undo
348 348
 	// Accounting
349 349
 	$tmpentry = array(
350 350
 		'enabled'=>(isModEnabled('comptabilite') || isModEnabled('accounting') || isModEnabled('asset') || isModEnabled('intracommreport')),
351
-		'perms'=>($user->hasRight('compta',  'resultat', 'lire') || $user->hasRight('accounting',  'comptarapport', 'lire') || $user->hasRight('accounting',  'mouvements', 'lire') || $user->hasRight('asset',  'read') || $user->hasRight('intracommreport',  'read')),
351
+		'perms'=>($user->hasRight('compta', 'resultat', 'lire') || $user->hasRight('accounting', 'comptarapport', 'lire') || $user->hasRight('accounting', 'mouvements', 'lire') || $user->hasRight('asset', 'read') || $user->hasRight('intracommreport', 'read')),
352 352
 		'module'=>'comptabilite|accounting|asset|intracommreport'
353 353
 	);
354 354
 	$menu_arr[] = array(
@@ -373,7 +373,7 @@  discard block
 block discarded – undo
373 373
 	// HRM
374 374
 	$tmpentry = array(
375 375
 		'enabled'=>(isModEnabled('hrm') || (isModEnabled('holiday')) || isModEnabled('deplacement') || isModEnabled('expensereport') || isModEnabled('recruitment')),
376
-		'perms'=>($user->hasRight('user',  'user', 'lire') || $user->hasRight('holiday',  'read') || $user->hasRight('deplacement',  'lire') || $user->hasRight('expensereport',  'lire') || $user->hasRight('recruitment',  'recruitmentjobposition', 'read')),
376
+		'perms'=>($user->hasRight('user', 'user', 'lire') || $user->hasRight('holiday', 'read') || $user->hasRight('deplacement', 'lire') || $user->hasRight('expensereport', 'lire') || $user->hasRight('recruitment', 'recruitmentjobposition', 'read')),
377 377
 		'module'=>'hrm|holiday|deplacement|expensereport|recruitment'
378 378
 	);
379 379
 
@@ -399,7 +399,7 @@  discard block
 block discarded – undo
399 399
 	// Tickets and Knowledge base
400 400
 	$tmpentry = array(
401 401
 		'enabled'=>(isModEnabled('ticket') || isModEnabled('knowledgemanagement')),
402
-		'perms'=>($user->hasRight('ticket',  'read') || $user->hasRight('knowledgemanagement',  'knowledgerecord', 'read')),
402
+		'perms'=>($user->hasRight('ticket', 'read') || $user->hasRight('knowledgemanagement', 'knowledgerecord', 'read')),
403 403
 		'module'=>'ticket|knowledgemanagement'
404 404
 	);
405 405
 	$link = '';
@@ -1182,17 +1182,17 @@  discard block
 block discarded – undo
1182 1182
 		$newmenu->add("/user/home.php?leftmenu=users", $langs->trans("MenuUsersAndGroups"), 0, $user->hasRight('user', 'user', 'read'), '', $mainmenu, 'users', 0, '', '', '', img_picto('', 'user', 'class="paddingright pictofixedwidth"'));
1183 1183
 		if ($user->hasRight('user', 'user', 'read')) {
1184 1184
 			if ($usemenuhider || empty($leftmenu) || $leftmenu == "users") {
1185
-				$newmenu->add("", $langs->trans("Users"), 1, $user->hasRight('user',  'user', 'lire') || $user->admin);
1185
+				$newmenu->add("", $langs->trans("Users"), 1, $user->hasRight('user', 'user', 'lire') || $user->admin);
1186 1186
 				$newmenu->add("/user/card.php?leftmenu=users&action=create", $langs->trans("NewUser"), 2, ($user->hasRight("user", "user", "write") || $user->admin) && !(isModEnabled('multicompany') && $conf->entity > 1 && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)), '', 'home');
1187
-				$newmenu->add("/user/list.php?leftmenu=users", $langs->trans("ListOfUsers"), 2, $user->hasRight('user',  'user', 'lire') || $user->admin);
1188
-				$newmenu->add("/user/hierarchy.php?leftmenu=users", $langs->trans("HierarchicView"), 2, $user->hasRight('user',  'user', 'lire') || $user->admin);
1187
+				$newmenu->add("/user/list.php?leftmenu=users", $langs->trans("ListOfUsers"), 2, $user->hasRight('user', 'user', 'lire') || $user->admin);
1188
+				$newmenu->add("/user/hierarchy.php?leftmenu=users", $langs->trans("HierarchicView"), 2, $user->hasRight('user', 'user', 'lire') || $user->admin);
1189 1189
 				if (isModEnabled('categorie')) {
1190 1190
 					$langs->load("categories");
1191
-					$newmenu->add("/categories/index.php?leftmenu=users&type=7", $langs->trans("UsersCategoriesShort"), 2, $user->hasRight('categorie',  'lire'), '', $mainmenu, 'cat');
1191
+					$newmenu->add("/categories/index.php?leftmenu=users&type=7", $langs->trans("UsersCategoriesShort"), 2, $user->hasRight('categorie', 'lire'), '', $mainmenu, 'cat');
1192 1192
 				}
1193
-				$newmenu->add("", $langs->trans("Groups"), 1, ($user->hasRight('user',  'user', 'lire') || $user->admin) && !(isModEnabled('multicompany') && $conf->entity > 1 && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)));
1193
+				$newmenu->add("", $langs->trans("Groups"), 1, ($user->hasRight('user', 'user', 'lire') || $user->admin) && !(isModEnabled('multicompany') && $conf->entity > 1 && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)));
1194 1194
 				$newmenu->add("/user/group/card.php?leftmenu=users&action=create", $langs->trans("NewGroup"), 2, ((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) ? $user->hasRight("user", "group_advance", "create") : $user->hasRight("user", "user", "create")) || $user->admin) && !(isModEnabled('multicompany') && $conf->entity > 1 && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)));
1195
-				$newmenu->add("/user/group/list.php?leftmenu=users", $langs->trans("ListOfGroups"), 2, ((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) ? $user->hasRight('user',  'group_advance', 'read') : $user->hasRight('user',  'user', 'lire')) || $user->admin) && !(isModEnabled('multicompany') && $conf->entity > 1 && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)));
1195
+				$newmenu->add("/user/group/list.php?leftmenu=users", $langs->trans("ListOfGroups"), 2, ((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) ? $user->hasRight('user', 'group_advance', 'read') : $user->hasRight('user', 'user', 'lire')) || $user->admin) && !(isModEnabled('multicompany') && $conf->entity > 1 && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)));
1196 1196
 			}
1197 1197
 		}
1198 1198
 	}
@@ -1216,9 +1216,9 @@  discard block
 block discarded – undo
1216 1216
 		// Societes
1217 1217
 		if (isModEnabled('societe')) {
1218 1218
 			$langs->load("companies");
1219
-			$newmenu->add("/societe/index.php?leftmenu=thirdparties", $langs->trans("ThirdParty"), 0, $user->hasRight('societe',  'lire'), '', $mainmenu, 'thirdparties', 0, '', '', '', img_picto('', 'company', 'class="paddingright pictofixedwidth"'));
1219
+			$newmenu->add("/societe/index.php?leftmenu=thirdparties", $langs->trans("ThirdParty"), 0, $user->hasRight('societe', 'lire'), '', $mainmenu, 'thirdparties', 0, '', '', '', img_picto('', 'company', 'class="paddingright pictofixedwidth"'));
1220 1220
 
1221
-			if ($user->hasRight('societe',  'creer')) {
1221
+			if ($user->hasRight('societe', 'creer')) {
1222 1222
 				$newmenu->add("/societe/card.php?action=create", $langs->trans("MenuNewThirdParty"), 1);
1223 1223
 				if (!$conf->use_javascript_ajax) {
1224 1224
 					$newmenu->add("/societe/card.php?action=create&amp;private=1", $langs->trans("MenuNewPrivateIndividual"), 1);
@@ -1231,7 +1231,7 @@  discard block
 block discarded – undo
1231 1231
 		// Prospects
1232 1232
 		if (isModEnabled('societe') && empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) {
1233 1233
 			$langs->load("commercial");
1234
-			$newmenu->add("/societe/list.php?type=p&amp;leftmenu=prospects", $langs->trans("ListProspectsShort"), 2, $user->hasRight('societe',  'lire'), '', $mainmenu, 'prospects');
1234
+			$newmenu->add("/societe/list.php?type=p&amp;leftmenu=prospects", $langs->trans("ListProspectsShort"), 2, $user->hasRight('societe', 'lire'), '', $mainmenu, 'prospects');
1235 1235
 			/* no more required, there is a filter that can do more
1236 1236
 			 if ($usemenuhider || empty($leftmenu) || $leftmenu=="prospects") $newmenu->add("/societe/list.php?type=p&amp;sortfield=s.datec&amp;sortorder=desc&amp;begin=&amp;search_stcomm=-1", $langs->trans("LastProspectDoNotContact"), 2, $user->hasRight('societe',  'lire'));
1237 1237
 			 if ($usemenuhider || empty($leftmenu) || $leftmenu=="prospects") $newmenu->add("/societe/list.php?type=p&amp;sortfield=s.datec&amp;sortorder=desc&amp;begin=&amp;search_stcomm=0", $langs->trans("LastProspectNeverContacted"), 2, $user->hasRight('societe',  'lire'));
@@ -1239,22 +1239,22 @@  discard block
 block discarded – undo
1239 1239
 			 if ($usemenuhider || empty($leftmenu) || $leftmenu=="prospects") $newmenu->add("/societe/list.php?type=p&amp;sortfield=s.datec&amp;sortorder=desc&amp;begin=&amp;search_stcomm=2", $langs->trans("LastProspectContactInProcess"), 2, $user->hasRight('societe',  'lire'));
1240 1240
 			 if ($usemenuhider || empty($leftmenu) || $leftmenu=="prospects") $newmenu->add("/societe/list.php?type=p&amp;sortfield=s.datec&amp;sortorder=desc&amp;begin=&amp;search_stcomm=3", $langs->trans("LastProspectContactDone"), 2, $user->hasRight('societe',  'lire'));
1241 1241
 			 */
1242
-			$newmenu->add("/societe/card.php?leftmenu=prospects&amp;action=create&amp;type=p", $langs->trans("MenuNewProspect"), 3, $user->hasRight('societe',  'creer'));
1242
+			$newmenu->add("/societe/card.php?leftmenu=prospects&amp;action=create&amp;type=p", $langs->trans("MenuNewProspect"), 3, $user->hasRight('societe', 'creer'));
1243 1243
 		}
1244 1244
 
1245 1245
 		// Customers/Prospects
1246 1246
 		if (isModEnabled('societe') && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) {
1247 1247
 			$langs->load("commercial");
1248
-			$newmenu->add("/societe/list.php?type=c&amp;leftmenu=customers", $langs->trans("ListCustomersShort"), 2, $user->hasRight('societe',  'lire'), '', $mainmenu, 'customers');
1248
+			$newmenu->add("/societe/list.php?type=c&amp;leftmenu=customers", $langs->trans("ListCustomersShort"), 2, $user->hasRight('societe', 'lire'), '', $mainmenu, 'customers');
1249 1249
 
1250
-			$newmenu->add("/societe/card.php?leftmenu=customers&amp;action=create&amp;type=c", $langs->trans("MenuNewCustomer"), 3, $user->hasRight('societe',  'creer'));
1250
+			$newmenu->add("/societe/card.php?leftmenu=customers&amp;action=create&amp;type=c", $langs->trans("MenuNewCustomer"), 3, $user->hasRight('societe', 'creer'));
1251 1251
 		}
1252 1252
 
1253 1253
 		// Suppliers
1254 1254
 		if (isModEnabled('societe') && (isModEnabled('supplier_order') || isModEnabled('supplier_invoice') || isModEnabled('supplier_proposal'))) {
1255 1255
 			$langs->load("suppliers");
1256
-			$newmenu->add("/societe/list.php?type=f&amp;leftmenu=suppliers", $langs->trans("ListSuppliersShort"), 2, ($user->hasRight('fournisseur',  'lire') || $user->hasRight('supplier_order',  'lire') || $user->hasRight('supplier_invoice',  'lire') || $user->hasRight('supplier_proposal',  'lire')), '', $mainmenu, 'suppliers');
1257
-			$newmenu->add("/societe/card.php?leftmenu=suppliers&amp;action=create&amp;type=f", $langs->trans("MenuNewSupplier"), 3, $user->hasRight('societe',  'creer') && ($user->hasRight('fournisseur',  'lire') || $user->hasRight('supplier_order',  'lire') || $user->hasRight('supplier_invoice',  'lire') || $user->hasRight('supplier_proposal',  'lire')));
1256
+			$newmenu->add("/societe/list.php?type=f&amp;leftmenu=suppliers", $langs->trans("ListSuppliersShort"), 2, ($user->hasRight('fournisseur', 'lire') || $user->hasRight('supplier_order', 'lire') || $user->hasRight('supplier_invoice', 'lire') || $user->hasRight('supplier_proposal', 'lire')), '', $mainmenu, 'suppliers');
1257
+			$newmenu->add("/societe/card.php?leftmenu=suppliers&amp;action=create&amp;type=f", $langs->trans("MenuNewSupplier"), 3, $user->hasRight('societe', 'creer') && ($user->hasRight('fournisseur', 'lire') || $user->hasRight('supplier_order', 'lire') || $user->hasRight('supplier_invoice', 'lire') || $user->hasRight('supplier_proposal', 'lire')));
1258 1258
 		}
1259 1259
 
1260 1260
 		// Categories
@@ -1269,36 +1269,36 @@  discard block
 block discarded – undo
1269 1269
 				if (!empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) {
1270 1270
 					$menutoshow = $langs->trans("ProspectsCategoriesShort");
1271 1271
 				}
1272
-				$newmenu->add("/categories/index.php?leftmenu=cat&amp;type=2", $menutoshow, 1, $user->hasRight('categorie',  'lire'), '', $mainmenu, 'cat');
1272
+				$newmenu->add("/categories/index.php?leftmenu=cat&amp;type=2", $menutoshow, 1, $user->hasRight('categorie', 'lire'), '', $mainmenu, 'cat');
1273 1273
 			}
1274 1274
 			// Categories suppliers
1275 1275
 			if (isModEnabled('supplier_proposal') || isModEnabled('supplier_order') || isModEnabled('supplier_invoice')) {
1276
-				$newmenu->add("/categories/index.php?leftmenu=catfournish&amp;type=1", $langs->trans("SuppliersCategoriesShort"), 1, $user->hasRight('categorie',  'lire'));
1276
+				$newmenu->add("/categories/index.php?leftmenu=catfournish&amp;type=1", $langs->trans("SuppliersCategoriesShort"), 1, $user->hasRight('categorie', 'lire'));
1277 1277
 			}
1278 1278
 		}
1279 1279
 
1280 1280
 		// Contacts
1281
-		$newmenu->add("/societe/index.php?leftmenu=thirdparties", (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses")), 0, $user->hasRight('societe',  'contact', 'lire'), '', $mainmenu, 'contacts', 0, '', '', '', img_picto('', 'contact', 'class="paddingright pictofixedwidth"'));
1281
+		$newmenu->add("/societe/index.php?leftmenu=thirdparties", (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses")), 0, $user->hasRight('societe', 'contact', 'lire'), '', $mainmenu, 'contacts', 0, '', '', '', img_picto('', 'contact', 'class="paddingright pictofixedwidth"'));
1282 1282
 
1283
-		$newmenu->add("/contact/card.php?leftmenu=contacts&amp;action=create", (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("NewContact") : $langs->trans("NewContactAddress")), 1, $user->hasRight('societe',  'contact', 'creer'));
1284
-		$newmenu->add("/contact/list.php?leftmenu=contacts", $langs->trans("List"), 1, $user->hasRight('societe',  'contact', 'lire'));
1283
+		$newmenu->add("/contact/card.php?leftmenu=contacts&amp;action=create", (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("NewContact") : $langs->trans("NewContactAddress")), 1, $user->hasRight('societe', 'contact', 'creer'));
1284
+		$newmenu->add("/contact/list.php?leftmenu=contacts", $langs->trans("List"), 1, $user->hasRight('societe', 'contact', 'lire'));
1285 1285
 		if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) {
1286
-			$newmenu->add("/contact/list.php?leftmenu=contacts&type=p", $langs->trans("Prospects"), 2, $user->hasRight('societe',  'contact', 'lire'));
1286
+			$newmenu->add("/contact/list.php?leftmenu=contacts&type=p", $langs->trans("Prospects"), 2, $user->hasRight('societe', 'contact', 'lire'));
1287 1287
 		}
1288 1288
 		if (empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) {
1289
-			$newmenu->add("/contact/list.php?leftmenu=contacts&type=c", $langs->trans("Customers"), 2, $user->hasRight('societe',  'contact', 'lire'));
1289
+			$newmenu->add("/contact/list.php?leftmenu=contacts&type=c", $langs->trans("Customers"), 2, $user->hasRight('societe', 'contact', 'lire'));
1290 1290
 		}
1291 1291
 		if (isModEnabled('supplier_proposal') || isModEnabled('supplier_order') || isModEnabled('supplier_invoice')) {
1292
-			$newmenu->add("/contact/list.php?leftmenu=contacts&type=f", $langs->trans("Suppliers"), 2, $user->hasRight('fournisseur',  'lire'));
1292
+			$newmenu->add("/contact/list.php?leftmenu=contacts&type=f", $langs->trans("Suppliers"), 2, $user->hasRight('fournisseur', 'lire'));
1293 1293
 		}
1294
-		$newmenu->add("/contact/list.php?leftmenu=contacts&type=o", $langs->trans("ContactOthers"), 2, $user->hasRight('societe',  'contact', 'lire'));
1294
+		$newmenu->add("/contact/list.php?leftmenu=contacts&type=o", $langs->trans("ContactOthers"), 2, $user->hasRight('societe', 'contact', 'lire'));
1295 1295
 		//$newmenu->add("/contact/list.php?userid=$user->id", $langs->trans("MyContacts"), 1, $user->hasRight('societe',  'contact', 'lire'));
1296 1296
 
1297 1297
 		// Categories
1298 1298
 		if (isModEnabled('categorie')) {
1299 1299
 			$langs->load("categories");
1300 1300
 			// Categories Contact
1301
-			$newmenu->add("/categories/index.php?leftmenu=catcontact&amp;type=4", $langs->trans("ContactCategoriesShort"), 1, $user->hasRight('categorie',  'lire'), '', $mainmenu, 'cat');
1301
+			$newmenu->add("/categories/index.php?leftmenu=catcontact&amp;type=4", $langs->trans("ContactCategoriesShort"), 1, $user->hasRight('categorie', 'lire'), '', $mainmenu, 'cat');
1302 1302
 		}
1303 1303
 	}
1304 1304
 }
@@ -1323,101 +1323,101 @@  discard block
 block discarded – undo
1323 1323
 		// Customer proposal
1324 1324
 		if (isModEnabled('propal')) {
1325 1325
 			$langs->load("propal");
1326
-			$newmenu->add("/comm/propal/index.php?leftmenu=propals", $langs->trans("Proposals"), 0, $user->hasRight('propal',  'read'), '', $mainmenu, 'propals', 100, '', '', '', img_picto('', 'propal', 'class="paddingright pictofixedwidth"'));
1327
-			$newmenu->add("/comm/propal/card.php?action=create&amp;leftmenu=propals", $langs->trans("NewPropal"), 1, $user->hasRight('propal',  'write'));
1328
-			$newmenu->add("/comm/propal/list.php?leftmenu=propals", $langs->trans("List"), 1, $user->hasRight('propal',  'read'));
1326
+			$newmenu->add("/comm/propal/index.php?leftmenu=propals", $langs->trans("Proposals"), 0, $user->hasRight('propal', 'read'), '', $mainmenu, 'propals', 100, '', '', '', img_picto('', 'propal', 'class="paddingright pictofixedwidth"'));
1327
+			$newmenu->add("/comm/propal/card.php?action=create&amp;leftmenu=propals", $langs->trans("NewPropal"), 1, $user->hasRight('propal', 'write'));
1328
+			$newmenu->add("/comm/propal/list.php?leftmenu=propals", $langs->trans("List"), 1, $user->hasRight('propal', 'read'));
1329 1329
 			if ($usemenuhider || empty($leftmenu) || $leftmenu == "propals") {
1330
-				$newmenu->add("/comm/propal/list.php?leftmenu=propals&search_status=0", $langs->trans("PropalsDraft"), 2, $user->hasRight('propal',  'read'));
1331
-				$newmenu->add("/comm/propal/list.php?leftmenu=propals&search_status=1", $langs->trans("PropalsOpened"), 2, $user->hasRight('propal',  'read'));
1332
-				$newmenu->add("/comm/propal/list.php?leftmenu=propals&search_status=2", $langs->trans("PropalStatusSigned"), 2, $user->hasRight('propal',  'read'));
1333
-				$newmenu->add("/comm/propal/list.php?leftmenu=propals&search_status=3", $langs->trans("PropalStatusNotSigned"), 2, $user->hasRight('propal',  'read'));
1334
-				$newmenu->add("/comm/propal/list.php?leftmenu=propals&search_status=4", $langs->trans("PropalStatusBilled"), 2, $user->hasRight('propal',  'read'));
1330
+				$newmenu->add("/comm/propal/list.php?leftmenu=propals&search_status=0", $langs->trans("PropalsDraft"), 2, $user->hasRight('propal', 'read'));
1331
+				$newmenu->add("/comm/propal/list.php?leftmenu=propals&search_status=1", $langs->trans("PropalsOpened"), 2, $user->hasRight('propal', 'read'));
1332
+				$newmenu->add("/comm/propal/list.php?leftmenu=propals&search_status=2", $langs->trans("PropalStatusSigned"), 2, $user->hasRight('propal', 'read'));
1333
+				$newmenu->add("/comm/propal/list.php?leftmenu=propals&search_status=3", $langs->trans("PropalStatusNotSigned"), 2, $user->hasRight('propal', 'read'));
1334
+				$newmenu->add("/comm/propal/list.php?leftmenu=propals&search_status=4", $langs->trans("PropalStatusBilled"), 2, $user->hasRight('propal', 'read'));
1335 1335
 				//$newmenu->add("/comm/propal/list.php?leftmenu=propals&search_status=2,3,4", $langs->trans("PropalStatusClosedShort"), 2, $user->hasRight('propal',  'read'));
1336 1336
 			}
1337
-			$newmenu->add("/comm/propal/stats/index.php?leftmenu=propals", $langs->trans("Statistics"), 1, $user->hasRight('propal',  'read'));
1337
+			$newmenu->add("/comm/propal/stats/index.php?leftmenu=propals", $langs->trans("Statistics"), 1, $user->hasRight('propal', 'read'));
1338 1338
 		}
1339 1339
 
1340 1340
 		// Customers orders
1341 1341
 		if (isModEnabled('commande')) {
1342 1342
 			$langs->load("orders");
1343
-			$newmenu->add("/commande/index.php?leftmenu=orders", $langs->trans("CustomersOrders"), 0, $user->hasRight('commande',  'lire'), '', $mainmenu, 'orders', 200, '', '', '', img_picto('', 'order', 'class="paddingright pictofixedwidth"'));
1344
-			$newmenu->add("/commande/card.php?action=create&amp;leftmenu=orders", $langs->trans("NewOrder"), 1, $user->hasRight('commande',  'creer'));
1345
-			$newmenu->add("/commande/list.php?leftmenu=orders", $langs->trans("List"), 1, $user->hasRight('commande',  'lire'));
1343
+			$newmenu->add("/commande/index.php?leftmenu=orders", $langs->trans("CustomersOrders"), 0, $user->hasRight('commande', 'lire'), '', $mainmenu, 'orders', 200, '', '', '', img_picto('', 'order', 'class="paddingright pictofixedwidth"'));
1344
+			$newmenu->add("/commande/card.php?action=create&amp;leftmenu=orders", $langs->trans("NewOrder"), 1, $user->hasRight('commande', 'creer'));
1345
+			$newmenu->add("/commande/list.php?leftmenu=orders", $langs->trans("List"), 1, $user->hasRight('commande', 'lire'));
1346 1346
 			if ($usemenuhider || empty($leftmenu) || $leftmenu == "orders") {
1347
-				$newmenu->add("/commande/list.php?leftmenu=orders&search_status=0", $langs->trans("StatusOrderDraftShort"), 2, $user->hasRight('commande',  'lire'));
1348
-				$newmenu->add("/commande/list.php?leftmenu=orders&search_status=1", $langs->trans("StatusOrderValidated"), 2, $user->hasRight('commande',  'lire'));
1347
+				$newmenu->add("/commande/list.php?leftmenu=orders&search_status=0", $langs->trans("StatusOrderDraftShort"), 2, $user->hasRight('commande', 'lire'));
1348
+				$newmenu->add("/commande/list.php?leftmenu=orders&search_status=1", $langs->trans("StatusOrderValidated"), 2, $user->hasRight('commande', 'lire'));
1349 1349
 				if (isModEnabled('expedition')) {
1350
-					$newmenu->add("/commande/list.php?leftmenu=orders&search_status=2", $langs->trans("StatusOrderSentShort"), 2, $user->hasRight('commande',  'lire'));
1350
+					$newmenu->add("/commande/list.php?leftmenu=orders&search_status=2", $langs->trans("StatusOrderSentShort"), 2, $user->hasRight('commande', 'lire'));
1351 1351
 				}
1352
-				$newmenu->add("/commande/list.php?leftmenu=orders&search_status=3", $langs->trans("StatusOrderDelivered"), 2, $user->hasRight('commande',  'lire'));
1352
+				$newmenu->add("/commande/list.php?leftmenu=orders&search_status=3", $langs->trans("StatusOrderDelivered"), 2, $user->hasRight('commande', 'lire'));
1353 1353
 				//$newmenu->add("/commande/list.php?leftmenu=orders&search_status=4", $langs->trans("StatusOrderProcessed"), 2, $user->hasRight('commande',  'lire'));
1354
-				$newmenu->add("/commande/list.php?leftmenu=orders&search_status=-1", $langs->trans("StatusOrderCanceledShort"), 2, $user->hasRight('commande',  'lire'));
1354
+				$newmenu->add("/commande/list.php?leftmenu=orders&search_status=-1", $langs->trans("StatusOrderCanceledShort"), 2, $user->hasRight('commande', 'lire'));
1355 1355
 			}
1356 1356
 			if ($conf->global->MAIN_FEATURES_LEVEL >= 2 && empty($user->socid)) {
1357
-				$newmenu->add("/commande/list_det.php?leftmenu=orders", $langs->trans("ListOrderLigne"), 1, $user->hasRight('commande',  'lire'));
1357
+				$newmenu->add("/commande/list_det.php?leftmenu=orders", $langs->trans("ListOrderLigne"), 1, $user->hasRight('commande', 'lire'));
1358 1358
 			}
1359
-			$newmenu->add("/commande/stats/index.php?leftmenu=orders", $langs->trans("Statistics"), 1, $user->hasRight('commande',  'lire'));
1359
+			$newmenu->add("/commande/stats/index.php?leftmenu=orders", $langs->trans("Statistics"), 1, $user->hasRight('commande', 'lire'));
1360 1360
 		}
1361 1361
 
1362 1362
 		// Supplier proposal
1363 1363
 		if (isModEnabled('supplier_proposal')) {
1364 1364
 			$langs->load("supplier_proposal");
1365
-			$newmenu->add("/supplier_proposal/index.php?leftmenu=propals_supplier", $langs->trans("SupplierProposalsShort"), 0, $user->hasRight('supplier_proposal',  'lire'), '', $mainmenu, 'propals_supplier', 300, '', '', '', img_picto('', 'supplier_proposal', 'class="paddingright pictofixedwidth"'));
1366
-			$newmenu->add("/supplier_proposal/card.php?action=create&amp;leftmenu=supplier_proposals", $langs->trans("SupplierProposalNew"), 1, $user->hasRight('supplier_proposal',  'creer'));
1367
-			$newmenu->add("/supplier_proposal/list.php?leftmenu=supplier_proposals", $langs->trans("List"), 1, $user->hasRight('supplier_proposal',  'lire'));
1368
-			$newmenu->add("/comm/propal/stats/index.php?leftmenu=supplier_proposals&amp;mode=supplier", $langs->trans("Statistics"), 1, $user->hasRight('supplier_proposal',  'lire'));
1365
+			$newmenu->add("/supplier_proposal/index.php?leftmenu=propals_supplier", $langs->trans("SupplierProposalsShort"), 0, $user->hasRight('supplier_proposal', 'lire'), '', $mainmenu, 'propals_supplier', 300, '', '', '', img_picto('', 'supplier_proposal', 'class="paddingright pictofixedwidth"'));
1366
+			$newmenu->add("/supplier_proposal/card.php?action=create&amp;leftmenu=supplier_proposals", $langs->trans("SupplierProposalNew"), 1, $user->hasRight('supplier_proposal', 'creer'));
1367
+			$newmenu->add("/supplier_proposal/list.php?leftmenu=supplier_proposals", $langs->trans("List"), 1, $user->hasRight('supplier_proposal', 'lire'));
1368
+			$newmenu->add("/comm/propal/stats/index.php?leftmenu=supplier_proposals&amp;mode=supplier", $langs->trans("Statistics"), 1, $user->hasRight('supplier_proposal', 'lire'));
1369 1369
 		}
1370 1370
 
1371 1371
 		// Suppliers orders
1372 1372
 		if (isModEnabled('supplier_order')) {
1373 1373
 			$langs->load("orders");
1374
-			$newmenu->add("/fourn/commande/index.php?leftmenu=orders_suppliers", $langs->trans("SuppliersOrders"), 0, $user->hasRight('fournisseur',  'commande', 'lire'), '', $mainmenu, 'orders_suppliers', 400, '', '', '', img_picto('', 'supplier_order', 'class="paddingright pictofixedwidth"'));
1375
-			$newmenu->add("/fourn/commande/card.php?action=create&amp;leftmenu=orders_suppliers", $langs->trans("NewSupplierOrderShort"), 1, $user->hasRight('fournisseur',  'commande', 'creer'));
1376
-			$newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers", $langs->trans("List"), 1, $user->hasRight('fournisseur',  'commande', 'lire'));
1374
+			$newmenu->add("/fourn/commande/index.php?leftmenu=orders_suppliers", $langs->trans("SuppliersOrders"), 0, $user->hasRight('fournisseur', 'commande', 'lire'), '', $mainmenu, 'orders_suppliers', 400, '', '', '', img_picto('', 'supplier_order', 'class="paddingright pictofixedwidth"'));
1375
+			$newmenu->add("/fourn/commande/card.php?action=create&amp;leftmenu=orders_suppliers", $langs->trans("NewSupplierOrderShort"), 1, $user->hasRight('fournisseur', 'commande', 'creer'));
1376
+			$newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers", $langs->trans("List"), 1, $user->hasRight('fournisseur', 'commande', 'lire'));
1377 1377
 
1378 1378
 			if ($usemenuhider || empty($leftmenu) || $leftmenu == "orders_suppliers") {
1379
-				$newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=0", $langs->trans("StatusSupplierOrderDraftShort"), 2, $user->hasRight('fournisseur',  'commande', 'lire'));
1379
+				$newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=0", $langs->trans("StatusSupplierOrderDraftShort"), 2, $user->hasRight('fournisseur', 'commande', 'lire'));
1380 1380
 				if (empty($conf->global->SUPPLIER_ORDER_HIDE_VALIDATED)) {
1381
-					$newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=1", $langs->trans("StatusSupplierOrderValidated"), 2, $user->hasRight('fournisseur',  'commande', 'lire'));
1381
+					$newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=1", $langs->trans("StatusSupplierOrderValidated"), 2, $user->hasRight('fournisseur', 'commande', 'lire'));
1382 1382
 				}
1383
-				$newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=2", $langs->trans("StatusSupplierOrderApprovedShort"), 2, $user->hasRight('fournisseur',  'commande', 'lire'));
1384
-				$newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=3", $langs->trans("StatusSupplierOrderOnProcessShort"), 2, $user->hasRight('fournisseur',  'commande', 'lire'));
1385
-				$newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=4", $langs->trans("StatusSupplierOrderReceivedPartiallyShort"), 2, $user->hasRight('fournisseur',  'commande', 'lire'));
1386
-				$newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=5", $langs->trans("StatusSupplierOrderReceivedAll"), 2, $user->hasRight('fournisseur',  'commande', 'lire'));
1387
-				$newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=6,7", $langs->trans("StatusSupplierOrderCanceled"), 2, $user->hasRight('fournisseur',  'commande', 'lire'));
1388
-				$newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=9", $langs->trans("StatusSupplierOrderRefused"), 2, $user->hasRight('fournisseur',  'commande', 'lire'));
1383
+				$newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=2", $langs->trans("StatusSupplierOrderApprovedShort"), 2, $user->hasRight('fournisseur', 'commande', 'lire'));
1384
+				$newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=3", $langs->trans("StatusSupplierOrderOnProcessShort"), 2, $user->hasRight('fournisseur', 'commande', 'lire'));
1385
+				$newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=4", $langs->trans("StatusSupplierOrderReceivedPartiallyShort"), 2, $user->hasRight('fournisseur', 'commande', 'lire'));
1386
+				$newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=5", $langs->trans("StatusSupplierOrderReceivedAll"), 2, $user->hasRight('fournisseur', 'commande', 'lire'));
1387
+				$newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=6,7", $langs->trans("StatusSupplierOrderCanceled"), 2, $user->hasRight('fournisseur', 'commande', 'lire'));
1388
+				$newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=9", $langs->trans("StatusSupplierOrderRefused"), 2, $user->hasRight('fournisseur', 'commande', 'lire'));
1389 1389
 			}
1390 1390
 			// Billed is another field. We should add instead a dedicated filter on list. if ($usemenuhider || empty($leftmenu) || $leftmenu=="orders_suppliers") $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&billed=1", $langs->trans("Billed"), 2, $user->hasRight('fournisseur',  'commande', 'lire'));
1391 1391
 
1392 1392
 
1393
-			$newmenu->add("/commande/stats/index.php?leftmenu=orders_suppliers&amp;mode=supplier", $langs->trans("Statistics"), 1, $user->hasRight('fournisseur',  'commande', 'lire'));
1393
+			$newmenu->add("/commande/stats/index.php?leftmenu=orders_suppliers&amp;mode=supplier", $langs->trans("Statistics"), 1, $user->hasRight('fournisseur', 'commande', 'lire'));
1394 1394
 		}
1395 1395
 
1396 1396
 		// Contrat
1397 1397
 		if (isModEnabled('contrat')) {
1398 1398
 			$langs->load("contracts");
1399
-			$newmenu->add("/contrat/index.php?leftmenu=contracts", $langs->trans("ContractsSubscriptions"), 0, $user->hasRight('contrat',  'lire'), '', $mainmenu, 'contracts', 2000, '', '', '', img_picto('', 'contract', 'class="paddingright pictofixedwidth"'));
1400
-			$newmenu->add("/contrat/card.php?action=create&amp;leftmenu=contracts", $langs->trans("NewContractSubscription"), 1, $user->hasRight('contrat',  'creer'));
1401
-			$newmenu->add("/contrat/list.php?leftmenu=contracts", $langs->trans("List"), 1, $user->hasRight('contrat',  'lire'));
1402
-			$newmenu->add("/contrat/services_list.php?leftmenu=contracts", $langs->trans("MenuServices"), 1, $user->hasRight('contrat',  'lire'));
1399
+			$newmenu->add("/contrat/index.php?leftmenu=contracts", $langs->trans("ContractsSubscriptions"), 0, $user->hasRight('contrat', 'lire'), '', $mainmenu, 'contracts', 2000, '', '', '', img_picto('', 'contract', 'class="paddingright pictofixedwidth"'));
1400
+			$newmenu->add("/contrat/card.php?action=create&amp;leftmenu=contracts", $langs->trans("NewContractSubscription"), 1, $user->hasRight('contrat', 'creer'));
1401
+			$newmenu->add("/contrat/list.php?leftmenu=contracts", $langs->trans("List"), 1, $user->hasRight('contrat', 'lire'));
1402
+			$newmenu->add("/contrat/services_list.php?leftmenu=contracts", $langs->trans("MenuServices"), 1, $user->hasRight('contrat', 'lire'));
1403 1403
 			if ($usemenuhider || empty($leftmenu) || $leftmenu == "contracts") {
1404
-				$newmenu->add("/contrat/services_list.php?leftmenu=contracts&amp;search_status=0", $langs->trans("MenuInactiveServices"), 2, $user->hasRight('contrat',  'lire'));
1405
-				$newmenu->add("/contrat/services_list.php?leftmenu=contracts&amp;search_status=4", $langs->trans("MenuRunningServices"), 2, $user->hasRight('contrat',  'lire'));
1406
-				$newmenu->add("/contrat/services_list.php?leftmenu=contracts&amp;search_status=4&amp;filter=expired", $langs->trans("MenuExpiredServices"), 2, $user->hasRight('contrat',  'lire'));
1407
-				$newmenu->add("/contrat/services_list.php?leftmenu=contracts&amp;search_status=5", $langs->trans("MenuClosedServices"), 2, $user->hasRight('contrat',  'lire'));
1404
+				$newmenu->add("/contrat/services_list.php?leftmenu=contracts&amp;search_status=0", $langs->trans("MenuInactiveServices"), 2, $user->hasRight('contrat', 'lire'));
1405
+				$newmenu->add("/contrat/services_list.php?leftmenu=contracts&amp;search_status=4", $langs->trans("MenuRunningServices"), 2, $user->hasRight('contrat', 'lire'));
1406
+				$newmenu->add("/contrat/services_list.php?leftmenu=contracts&amp;search_status=4&amp;filter=expired", $langs->trans("MenuExpiredServices"), 2, $user->hasRight('contrat', 'lire'));
1407
+				$newmenu->add("/contrat/services_list.php?leftmenu=contracts&amp;search_status=5", $langs->trans("MenuClosedServices"), 2, $user->hasRight('contrat', 'lire'));
1408 1408
 			}
1409 1409
 		}
1410 1410
 
1411 1411
 		// Interventions
1412 1412
 		if (isModEnabled('ficheinter')) {
1413 1413
 			$langs->load("interventions");
1414
-			$newmenu->add("/fichinter/index.php?leftmenu=ficheinter", $langs->trans("Interventions"), 0, $user->hasRight('ficheinter',  'lire'), '', $mainmenu, 'ficheinter', 2200, '', '', '', img_picto('', 'intervention', 'class="paddingright pictofixedwidth"'));
1415
-			$newmenu->add("/fichinter/card.php?action=create&amp;leftmenu=ficheinter", $langs->trans("NewIntervention"), 1, $user->hasRight('ficheinter',  'creer'), '', '', '', 201);
1416
-			$newmenu->add("/fichinter/list.php?leftmenu=ficheinter", $langs->trans("List"), 1, $user->hasRight('ficheinter',  'lire'), '', '', '', 202);
1414
+			$newmenu->add("/fichinter/index.php?leftmenu=ficheinter", $langs->trans("Interventions"), 0, $user->hasRight('ficheinter', 'lire'), '', $mainmenu, 'ficheinter', 2200, '', '', '', img_picto('', 'intervention', 'class="paddingright pictofixedwidth"'));
1415
+			$newmenu->add("/fichinter/card.php?action=create&amp;leftmenu=ficheinter", $langs->trans("NewIntervention"), 1, $user->hasRight('ficheinter', 'creer'), '', '', '', 201);
1416
+			$newmenu->add("/fichinter/list.php?leftmenu=ficheinter", $langs->trans("List"), 1, $user->hasRight('ficheinter', 'lire'), '', '', '', 202);
1417 1417
 			if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
1418
-				$newmenu->add("/fichinter/card-rec.php?leftmenu=ficheinter", $langs->trans("ListOfTemplates"), 1, $user->hasRight('ficheinter',  'lire'), '', '', '', 203);
1418
+				$newmenu->add("/fichinter/card-rec.php?leftmenu=ficheinter", $langs->trans("ListOfTemplates"), 1, $user->hasRight('ficheinter', 'lire'), '', '', '', 203);
1419 1419
 			}
1420
-			$newmenu->add("/fichinter/stats/index.php?leftmenu=ficheinter", $langs->trans("Statistics"), 1, $user->hasRight('ficheinter',  'lire'));
1420
+			$newmenu->add("/fichinter/stats/index.php?leftmenu=ficheinter", $langs->trans("Statistics"), 1, $user->hasRight('ficheinter', 'lire'));
1421 1421
 		}
1422 1422
 	}
1423 1423
 }
@@ -1442,59 +1442,59 @@  discard block
 block discarded – undo
1442 1442
 		// Customers invoices
1443 1443
 		if (isModEnabled('facture')) {
1444 1444
 			$langs->load("bills");
1445
-			$newmenu->add("/compta/facture/index.php?leftmenu=customers_bills", $langs->trans("BillsCustomers"), 0, $user->hasRight('facture',  'lire'), '', $mainmenu, 'customers_bills', 0, '', '', '', img_picto('', 'bill', 'class="paddingright pictofixedwidth"'));
1446
-			$newmenu->add("/compta/facture/card.php?action=create", $langs->trans("NewBill"), 1, $user->hasRight('facture',  'creer'));
1447
-			$newmenu->add("/compta/facture/list.php?leftmenu=customers_bills", $langs->trans("List"), 1, $user->hasRight('facture',  'lire'), '', $mainmenu, 'customers_bills_list');
1445
+			$newmenu->add("/compta/facture/index.php?leftmenu=customers_bills", $langs->trans("BillsCustomers"), 0, $user->hasRight('facture', 'lire'), '', $mainmenu, 'customers_bills', 0, '', '', '', img_picto('', 'bill', 'class="paddingright pictofixedwidth"'));
1446
+			$newmenu->add("/compta/facture/card.php?action=create", $langs->trans("NewBill"), 1, $user->hasRight('facture', 'creer'));
1447
+			$newmenu->add("/compta/facture/list.php?leftmenu=customers_bills", $langs->trans("List"), 1, $user->hasRight('facture', 'lire'), '', $mainmenu, 'customers_bills_list');
1448 1448
 
1449 1449
 			if ($usemenuhider || empty($leftmenu) || preg_match('/customers_bills(|_draft|_notpaid|_paid|_canceled)$/', $leftmenu)) {
1450
-				$newmenu->add("/compta/facture/list.php?leftmenu=customers_bills_draft&amp;search_status=0", $langs->trans("BillShortStatusDraft"), 2, $user->hasRight('facture',  'lire'));
1451
-				$newmenu->add("/compta/facture/list.php?leftmenu=customers_bills_notpaid&amp;search_status=1", $langs->trans("BillShortStatusNotPaid"), 2, $user->hasRight('facture',  'lire'));
1452
-				$newmenu->add("/compta/facture/list.php?leftmenu=customers_bills_paid&amp;search_status=2", $langs->trans("BillShortStatusPaid"), 2, $user->hasRight('facture',  'lire'));
1453
-				$newmenu->add("/compta/facture/list.php?leftmenu=customers_bills_canceled&amp;search_status=3", $langs->trans("BillShortStatusCanceled"), 2, $user->hasRight('facture',  'lire'));
1450
+				$newmenu->add("/compta/facture/list.php?leftmenu=customers_bills_draft&amp;search_status=0", $langs->trans("BillShortStatusDraft"), 2, $user->hasRight('facture', 'lire'));
1451
+				$newmenu->add("/compta/facture/list.php?leftmenu=customers_bills_notpaid&amp;search_status=1", $langs->trans("BillShortStatusNotPaid"), 2, $user->hasRight('facture', 'lire'));
1452
+				$newmenu->add("/compta/facture/list.php?leftmenu=customers_bills_paid&amp;search_status=2", $langs->trans("BillShortStatusPaid"), 2, $user->hasRight('facture', 'lire'));
1453
+				$newmenu->add("/compta/facture/list.php?leftmenu=customers_bills_canceled&amp;search_status=3", $langs->trans("BillShortStatusCanceled"), 2, $user->hasRight('facture', 'lire'));
1454 1454
 			}
1455
-			$newmenu->add("/compta/facture/invoicetemplate_list.php?leftmenu=customers_bills_templates", $langs->trans("ListOfTemplates"), 1, $user->hasRight('facture',  'creer'), '', $mainmenu, 'customers_bills_templates'); // No need to see recurring invoices, if user has no permission to create invoice.
1455
+			$newmenu->add("/compta/facture/invoicetemplate_list.php?leftmenu=customers_bills_templates", $langs->trans("ListOfTemplates"), 1, $user->hasRight('facture', 'creer'), '', $mainmenu, 'customers_bills_templates'); // No need to see recurring invoices, if user has no permission to create invoice.
1456 1456
 
1457
-			$newmenu->add("/compta/paiement/list.php?leftmenu=customers_bills_payment", $langs->trans("Payments"), 1, $user->hasRight('facture',  'lire'), '', $mainmenu, 'customers_bills_payment');
1457
+			$newmenu->add("/compta/paiement/list.php?leftmenu=customers_bills_payment", $langs->trans("Payments"), 1, $user->hasRight('facture', 'lire'), '', $mainmenu, 'customers_bills_payment');
1458 1458
 
1459 1459
 			if (!empty($conf->global->BILL_ADD_PAYMENT_VALIDATION)) {
1460
-				$newmenu->add("/compta/paiement/tovalidate.php?leftmenu=customers_bills_tovalid", $langs->trans("MenuToValid"), 2, $user->hasRight('facture',  'lire'), '', $mainmenu, 'customer_bills_tovalid');
1460
+				$newmenu->add("/compta/paiement/tovalidate.php?leftmenu=customers_bills_tovalid", $langs->trans("MenuToValid"), 2, $user->hasRight('facture', 'lire'), '', $mainmenu, 'customer_bills_tovalid');
1461 1461
 			}
1462 1462
 			if ($usemenuhider || empty($leftmenu) || preg_match('/customers_bills/', $leftmenu)) {
1463
-				$newmenu->add("/compta/paiement/rapport.php?leftmenu=customers_bills_payment_report", $langs->trans("Reportings"), 2, $user->hasRight('facture',  'lire'), '', $mainmenu, 'customers_bills_payment_report');
1463
+				$newmenu->add("/compta/paiement/rapport.php?leftmenu=customers_bills_payment_report", $langs->trans("Reportings"), 2, $user->hasRight('facture', 'lire'), '', $mainmenu, 'customers_bills_payment_report');
1464 1464
 			}
1465 1465
 
1466
-			$newmenu->add("/compta/facture/stats/index.php?leftmenu=customers_bills_stats", $langs->trans("Statistics"), 1, $user->hasRight('facture',  'lire'), '', $mainmenu, 'customers_bills_stats');
1466
+			$newmenu->add("/compta/facture/stats/index.php?leftmenu=customers_bills_stats", $langs->trans("Statistics"), 1, $user->hasRight('facture', 'lire'), '', $mainmenu, 'customers_bills_stats');
1467 1467
 		}
1468 1468
 
1469 1469
 		// Suppliers invoices
1470 1470
 		if (isModEnabled('societe') && isModEnabled('supplier_invoice')) {
1471 1471
 			$langs->load("bills");
1472
-			$newmenu->add("/fourn/facture/index.php?leftmenu=suppliers_bills", $langs->trans("BillsSuppliers"), 0, $user->hasRight('fournisseur',  'facture', 'lire'), '', $mainmenu, 'suppliers_bills', 0, '', '', '', img_picto('', 'supplier_invoice', 'class="paddingright pictofixedwidth"'));
1473
-			$newmenu->add("/fourn/facture/card.php?leftmenu=suppliers_bills&amp;action=create", $langs->trans("NewBill"), 1, ($user->hasRight('fournisseur',  'facture', 'creer') || $user->hasRight('supplier_invoice',  'creer')), '', $mainmenu, 'suppliers_bills_create');
1474
-			$newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills", $langs->trans("List"), 1, $user->hasRight('fournisseur',  'facture', 'lire'), '', $mainmenu, 'suppliers_bills_list');
1472
+			$newmenu->add("/fourn/facture/index.php?leftmenu=suppliers_bills", $langs->trans("BillsSuppliers"), 0, $user->hasRight('fournisseur', 'facture', 'lire'), '', $mainmenu, 'suppliers_bills', 0, '', '', '', img_picto('', 'supplier_invoice', 'class="paddingright pictofixedwidth"'));
1473
+			$newmenu->add("/fourn/facture/card.php?leftmenu=suppliers_bills&amp;action=create", $langs->trans("NewBill"), 1, ($user->hasRight('fournisseur', 'facture', 'creer') || $user->hasRight('supplier_invoice', 'creer')), '', $mainmenu, 'suppliers_bills_create');
1474
+			$newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills", $langs->trans("List"), 1, $user->hasRight('fournisseur', 'facture', 'lire'), '', $mainmenu, 'suppliers_bills_list');
1475 1475
 
1476 1476
 			if ($usemenuhider || empty($leftmenu) || preg_match('/suppliers_bills/', $leftmenu)) {
1477
-				$newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills_draft&amp;search_status=0", $langs->trans("BillShortStatusDraft"), 2, $user->hasRight('fournisseur',  'facture', 'lire'), '', $mainmenu, 'suppliers_bills_draft');
1478
-				$newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills_notpaid&amp;search_status=1", $langs->trans("BillShortStatusNotPaid"), 2, $user->hasRight('fournisseur',  'facture', 'lire'), '', $mainmenu, 'suppliers_bills_notpaid');
1479
-				$newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills_paid&amp;search_status=2", $langs->trans("BillShortStatusPaid"), 2, $user->hasRight('fournisseur',  'facture', 'lire'), '', $mainmenu, 'suppliers_bills_paid');
1477
+				$newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills_draft&amp;search_status=0", $langs->trans("BillShortStatusDraft"), 2, $user->hasRight('fournisseur', 'facture', 'lire'), '', $mainmenu, 'suppliers_bills_draft');
1478
+				$newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills_notpaid&amp;search_status=1", $langs->trans("BillShortStatusNotPaid"), 2, $user->hasRight('fournisseur', 'facture', 'lire'), '', $mainmenu, 'suppliers_bills_notpaid');
1479
+				$newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills_paid&amp;search_status=2", $langs->trans("BillShortStatusPaid"), 2, $user->hasRight('fournisseur', 'facture', 'lire'), '', $mainmenu, 'suppliers_bills_paid');
1480 1480
 			}
1481 1481
 
1482
-			$newmenu->add("/fourn/facture/list-rec.php?leftmenu=supplierinvoicestemplate_list", $langs->trans("ListOfTemplates"), 1, $user->hasRight('fournisseur',  'facture', 'lire'), '', $mainmenu, 'supplierinvoicestemplate_list');
1482
+			$newmenu->add("/fourn/facture/list-rec.php?leftmenu=supplierinvoicestemplate_list", $langs->trans("ListOfTemplates"), 1, $user->hasRight('fournisseur', 'facture', 'lire'), '', $mainmenu, 'supplierinvoicestemplate_list');
1483 1483
 
1484
-			$newmenu->add("/fourn/paiement/list.php?leftmenu=suppliers_bills_payment", $langs->trans("Payments"), 1, $user->hasRight('fournisseur',  'facture', 'lire'), '', $mainmenu, 'suppliers_bills_payment');
1484
+			$newmenu->add("/fourn/paiement/list.php?leftmenu=suppliers_bills_payment", $langs->trans("Payments"), 1, $user->hasRight('fournisseur', 'facture', 'lire'), '', $mainmenu, 'suppliers_bills_payment');
1485 1485
 
1486 1486
 			if ($usemenuhider || empty($leftmenu) || preg_match('/suppliers_bills/', $leftmenu)) {
1487
-				$newmenu->add("/fourn/facture/rapport.php?leftmenu=suppliers_bills_payment_report", $langs->trans("Reportings"), 2, $user->hasRight('fournisseur',  'facture', 'lire'), '', $mainmenu, 'suppliers_bills_payment_report');
1487
+				$newmenu->add("/fourn/facture/rapport.php?leftmenu=suppliers_bills_payment_report", $langs->trans("Reportings"), 2, $user->hasRight('fournisseur', 'facture', 'lire'), '', $mainmenu, 'suppliers_bills_payment_report');
1488 1488
 			}
1489 1489
 
1490
-			$newmenu->add("/compta/facture/stats/index.php?mode=supplier&amp;leftmenu=suppliers_bills_stats", $langs->trans("Statistics"), 1, $user->hasRight('fournisseur',  'facture', 'lire'), '', $mainmenu, 'suppliers_bills_stats');
1490
+			$newmenu->add("/compta/facture/stats/index.php?mode=supplier&amp;leftmenu=suppliers_bills_stats", $langs->trans("Statistics"), 1, $user->hasRight('fournisseur', 'facture', 'lire'), '', $mainmenu, 'suppliers_bills_stats');
1491 1491
 		}
1492 1492
 
1493 1493
 		// Orders
1494 1494
 		if (isModEnabled('commande')) {
1495 1495
 			$langs->load("orders");
1496 1496
 			if (isModEnabled('facture')) {
1497
-				$newmenu->add("/commande/list.php?leftmenu=orders&amp;search_status=-3&amp;billed=0&amp;contextpage=billableorders", $langs->trans("MenuOrdersToBill2"), 0, $user->hasRight('commande',  'lire'), '', $mainmenu, 'orders', 0, '', '', '', img_picto('', 'order', 'class="paddingright pictofixedwidth"'));
1497
+				$newmenu->add("/commande/list.php?leftmenu=orders&amp;search_status=-3&amp;billed=0&amp;contextpage=billableorders", $langs->trans("MenuOrdersToBill2"), 0, $user->hasRight('commande', 'lire'), '', $mainmenu, 'orders', 0, '', '', '', img_picto('', 'order', 'class="paddingright pictofixedwidth"'));
1498 1498
 			}
1499 1499
 			//if ($usemenuhider || empty($leftmenu) || $leftmenu=="orders") $newmenu->add("/commande/", $langs->trans("StatusOrderToBill"), 1, $user->hasRight('commande',  'lire'));
1500 1500
 		}
@@ -1503,7 +1503,7 @@  discard block
 block discarded – undo
1503 1503
 		if (isModEnabled('supplier_invoice')) {
1504 1504
 			if (!empty($conf->global->SUPPLIER_MENU_ORDER_RECEIVED_INTO_INVOICE)) {
1505 1505
 				$langs->load("supplier");
1506
-				$newmenu->add("/fourn/commande/list.php?leftmenu=orders&amp;search_status=5&amp;billed=0", $langs->trans("MenuOrdersSupplierToBill"), 0, $user->hasRight('commande',  'lire'), '', $mainmenu, 'orders', 0, '', '', '', img_picto('', 'supplier_order', 'class="paddingright pictofixedwidth"'));
1506
+				$newmenu->add("/fourn/commande/list.php?leftmenu=orders&amp;search_status=5&amp;billed=0", $langs->trans("MenuOrdersSupplierToBill"), 0, $user->hasRight('commande', 'lire'), '', $mainmenu, 'orders', 0, '', '', '', img_picto('', 'supplier_order', 'class="paddingright pictofixedwidth"'));
1507 1507
 				//if ($usemenuhider || empty($leftmenu) || $leftmenu=="orders") $newmenu->add("/commande/", $langs->trans("StatusOrderToBill"), 1, $user->hasRight('commande',  'lire'));
1508 1508
 			}
1509 1509
 		}
@@ -1512,58 +1512,58 @@  discard block
 block discarded – undo
1512 1512
 		// Donations
1513 1513
 		if (isModEnabled('don')) {
1514 1514
 			$langs->load("donations");
1515
-			$newmenu->add("/don/index.php?leftmenu=donations&amp;mainmenu=billing", $langs->trans("Donations"), 0, $user->hasRight('don',  'lire'), '', $mainmenu, 'donations', 0, '', '', '', img_picto('', 'donation', 'class="paddingright pictofixedwidth"'));
1515
+			$newmenu->add("/don/index.php?leftmenu=donations&amp;mainmenu=billing", $langs->trans("Donations"), 0, $user->hasRight('don', 'lire'), '', $mainmenu, 'donations', 0, '', '', '', img_picto('', 'donation', 'class="paddingright pictofixedwidth"'));
1516 1516
 			if ($usemenuhider || empty($leftmenu) || $leftmenu == "donations") {
1517
-				$newmenu->add("/don/card.php?leftmenu=donations&amp;action=create", $langs->trans("NewDonation"), 1, $user->hasRight('don',  'creer'));
1518
-				$newmenu->add("/don/list.php?leftmenu=donations", $langs->trans("List"), 1, $user->hasRight('don',  'lire'));
1517
+				$newmenu->add("/don/card.php?leftmenu=donations&amp;action=create", $langs->trans("NewDonation"), 1, $user->hasRight('don', 'creer'));
1518
+				$newmenu->add("/don/list.php?leftmenu=donations", $langs->trans("List"), 1, $user->hasRight('don', 'lire'));
1519 1519
 			}
1520 1520
 			// if ($leftmenu=="donations") $newmenu->add("/don/stats/index.php",$langs->trans("Statistics"), 1, $user->hasRight('don',  'lire'));
1521 1521
 		}
1522 1522
 
1523 1523
 		// Taxes and social contributions
1524 1524
 		if (isModEnabled('tax')) {
1525
-			$newmenu->add("/compta/charges/index.php?leftmenu=tax&amp;mainmenu=billing", $langs->trans("MenuTaxesAndSpecialExpenses"), 0, $user->hasRight('tax',  'charges', 'lire'), '', $mainmenu, 'tax', 0, '', '', '', img_picto('', 'payment', 'class="paddingright pictofixedwidth"'));
1525
+			$newmenu->add("/compta/charges/index.php?leftmenu=tax&amp;mainmenu=billing", $langs->trans("MenuTaxesAndSpecialExpenses"), 0, $user->hasRight('tax', 'charges', 'lire'), '', $mainmenu, 'tax', 0, '', '', '', img_picto('', 'payment', 'class="paddingright pictofixedwidth"'));
1526 1526
 
1527
-			$newmenu->add("/compta/sociales/list.php?leftmenu=tax_social", $langs->trans("MenuSocialContributions"), 1, $user->hasRight('tax',  'charges', 'lire'));
1527
+			$newmenu->add("/compta/sociales/list.php?leftmenu=tax_social", $langs->trans("MenuSocialContributions"), 1, $user->hasRight('tax', 'charges', 'lire'));
1528 1528
 			if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_social/i', $leftmenu)) {
1529
-				$newmenu->add("/compta/sociales/card.php?leftmenu=tax_social&action=create", $langs->trans("MenuNewSocialContribution"), 2, $user->hasRight('tax',  'charges', 'creer'));
1530
-				$newmenu->add("/compta/sociales/list.php?leftmenu=tax_social", $langs->trans("List"), 2, $user->hasRight('tax',  'charges', 'lire'));
1531
-				$newmenu->add("/compta/sociales/payments.php?leftmenu=tax_social&amp;mainmenu=billing", $langs->trans("Payments"), 2, $user->hasRight('tax',  'charges', 'lire'));
1529
+				$newmenu->add("/compta/sociales/card.php?leftmenu=tax_social&action=create", $langs->trans("MenuNewSocialContribution"), 2, $user->hasRight('tax', 'charges', 'creer'));
1530
+				$newmenu->add("/compta/sociales/list.php?leftmenu=tax_social", $langs->trans("List"), 2, $user->hasRight('tax', 'charges', 'lire'));
1531
+				$newmenu->add("/compta/sociales/payments.php?leftmenu=tax_social&amp;mainmenu=billing", $langs->trans("Payments"), 2, $user->hasRight('tax', 'charges', 'lire'));
1532 1532
 			}
1533 1533
 			// VAT
1534 1534
 			if (empty($conf->global->TAX_DISABLE_VAT_MENUS)) {
1535 1535
 				global $mysoc;
1536 1536
 
1537
-				$newmenu->add("/compta/tva/list.php?leftmenu=tax_vat&amp;mainmenu=billing", $langs->transcountry("VAT", $mysoc->country_code), 1, $user->hasRight('tax',  'charges', 'lire'), '', $mainmenu, 'tax_vat');
1537
+				$newmenu->add("/compta/tva/list.php?leftmenu=tax_vat&amp;mainmenu=billing", $langs->transcountry("VAT", $mysoc->country_code), 1, $user->hasRight('tax', 'charges', 'lire'), '', $mainmenu, 'tax_vat');
1538 1538
 				if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_vat/i', $leftmenu)) {
1539
-					$newmenu->add("/compta/tva/card.php?leftmenu=tax_vat&action=create", $langs->trans("New"), 2, $user->hasRight('tax',  'charges', 'creer'));
1540
-					$newmenu->add("/compta/tva/list.php?leftmenu=tax_vat", $langs->trans("List"), 2, $user->hasRight('tax',  'charges', 'lire'));
1541
-					$newmenu->add("/compta/tva/payments.php?mode=tvaonly&amp;leftmenu=tax_vat", $langs->trans("Payments"), 2, $user->hasRight('tax',  'charges', 'lire'));
1542
-					$newmenu->add("/compta/tva/index.php?leftmenu=tax_vat", $langs->trans("ReportByMonth"), 2, $user->hasRight('tax',  'charges', 'lire'));
1543
-					$newmenu->add("/compta/tva/clients.php?leftmenu=tax_vat", $langs->trans("ReportByThirdparties"), 2, $user->hasRight('tax',  'charges', 'lire'));
1544
-					$newmenu->add("/compta/tva/quadri_detail.php?leftmenu=tax_vat", $langs->trans("ReportByQuarter"), 2, $user->hasRight('tax',  'charges', 'lire'));
1539
+					$newmenu->add("/compta/tva/card.php?leftmenu=tax_vat&action=create", $langs->trans("New"), 2, $user->hasRight('tax', 'charges', 'creer'));
1540
+					$newmenu->add("/compta/tva/list.php?leftmenu=tax_vat", $langs->trans("List"), 2, $user->hasRight('tax', 'charges', 'lire'));
1541
+					$newmenu->add("/compta/tva/payments.php?mode=tvaonly&amp;leftmenu=tax_vat", $langs->trans("Payments"), 2, $user->hasRight('tax', 'charges', 'lire'));
1542
+					$newmenu->add("/compta/tva/index.php?leftmenu=tax_vat", $langs->trans("ReportByMonth"), 2, $user->hasRight('tax', 'charges', 'lire'));
1543
+					$newmenu->add("/compta/tva/clients.php?leftmenu=tax_vat", $langs->trans("ReportByThirdparties"), 2, $user->hasRight('tax', 'charges', 'lire'));
1544
+					$newmenu->add("/compta/tva/quadri_detail.php?leftmenu=tax_vat", $langs->trans("ReportByQuarter"), 2, $user->hasRight('tax', 'charges', 'lire'));
1545 1545
 				}
1546 1546
 
1547 1547
 				//Local Taxes 1
1548 1548
 				if ($mysoc->useLocalTax(1) && (isset($mysoc->localtax1_assuj) && $mysoc->localtax1_assuj == "1")) {
1549
-					$newmenu->add("/compta/localtax/list.php?leftmenu=tax_1_vat&amp;mainmenu=billing&amp;localTaxType=1", $langs->transcountry("LT1", $mysoc->country_code), 1, $user->hasRight('tax',  'charges', 'lire'));
1549
+					$newmenu->add("/compta/localtax/list.php?leftmenu=tax_1_vat&amp;mainmenu=billing&amp;localTaxType=1", $langs->transcountry("LT1", $mysoc->country_code), 1, $user->hasRight('tax', 'charges', 'lire'));
1550 1550
 					if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_1_vat/i', $leftmenu)) {
1551
-						$newmenu->add("/compta/localtax/card.php?leftmenu=tax_1_vat&action=create&amp;localTaxType=1", $langs->trans("New"), 2, $user->hasRight('tax',  'charges', 'creer'));
1552
-						$newmenu->add("/compta/localtax/list.php?leftmenu=tax_1_vat&amp;localTaxType=1", $langs->trans("List"), 2, $user->hasRight('tax',  'charges', 'lire'));
1553
-						$newmenu->add("/compta/localtax/index.php?leftmenu=tax_1_vat&amp;localTaxType=1", $langs->trans("ReportByMonth"), 2, $user->hasRight('tax',  'charges', 'lire'));
1554
-						$newmenu->add("/compta/localtax/clients.php?leftmenu=tax_1_vat&amp;localTaxType=1", $langs->trans("ReportByThirdparties"), 2, $user->hasRight('tax',  'charges', 'lire'));
1555
-						$newmenu->add("/compta/localtax/quadri_detail.php?leftmenu=tax_1_vat&amp;localTaxType=1", $langs->trans("ReportByQuarter"), 2, $user->hasRight('tax',  'charges', 'lire'));
1551
+						$newmenu->add("/compta/localtax/card.php?leftmenu=tax_1_vat&action=create&amp;localTaxType=1", $langs->trans("New"), 2, $user->hasRight('tax', 'charges', 'creer'));
1552
+						$newmenu->add("/compta/localtax/list.php?leftmenu=tax_1_vat&amp;localTaxType=1", $langs->trans("List"), 2, $user->hasRight('tax', 'charges', 'lire'));
1553
+						$newmenu->add("/compta/localtax/index.php?leftmenu=tax_1_vat&amp;localTaxType=1", $langs->trans("ReportByMonth"), 2, $user->hasRight('tax', 'charges', 'lire'));
1554
+						$newmenu->add("/compta/localtax/clients.php?leftmenu=tax_1_vat&amp;localTaxType=1", $langs->trans("ReportByThirdparties"), 2, $user->hasRight('tax', 'charges', 'lire'));
1555
+						$newmenu->add("/compta/localtax/quadri_detail.php?leftmenu=tax_1_vat&amp;localTaxType=1", $langs->trans("ReportByQuarter"), 2, $user->hasRight('tax', 'charges', 'lire'));
1556 1556
 					}
1557 1557
 				}
1558 1558
 				//Local Taxes 2
1559 1559
 				if ($mysoc->useLocalTax(2) && (isset($mysoc->localtax2_assuj) && $mysoc->localtax2_assuj == "1")) {
1560
-					$newmenu->add("/compta/localtax/list.php?leftmenu=tax_2_vat&amp;mainmenu=billing&amp;localTaxType=2", $langs->transcountry("LT2", $mysoc->country_code), 1, $user->hasRight('tax',  'charges', 'lire'));
1560
+					$newmenu->add("/compta/localtax/list.php?leftmenu=tax_2_vat&amp;mainmenu=billing&amp;localTaxType=2", $langs->transcountry("LT2", $mysoc->country_code), 1, $user->hasRight('tax', 'charges', 'lire'));
1561 1561
 					if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_2_vat/i', $leftmenu)) {
1562
-						$newmenu->add("/compta/localtax/card.php?leftmenu=tax_2_vat&action=create&amp;localTaxType=2", $langs->trans("New"), 2, $user->hasRight('tax',  'charges', 'creer'));
1563
-						$newmenu->add("/compta/localtax/list.php?leftmenu=tax_2_vat&amp;localTaxType=2", $langs->trans("List"), 2, $user->hasRight('tax',  'charges', 'lire'));
1564
-						$newmenu->add("/compta/localtax/index.php?leftmenu=tax_2_vat&amp;localTaxType=2", $langs->trans("ReportByMonth"), 2, $user->hasRight('tax',  'charges', 'lire'));
1565
-						$newmenu->add("/compta/localtax/clients.php?leftmenu=tax_2_vat&amp;localTaxType=2", $langs->trans("ReportByThirdparties"), 2, $user->hasRight('tax',  'charges', 'lire'));
1566
-						$newmenu->add("/compta/localtax/quadri_detail.php?leftmenu=tax_2_vat&amp;localTaxType=2", $langs->trans("ReportByQuarter"), 2, $user->hasRight('tax',  'charges', 'lire'));
1562
+						$newmenu->add("/compta/localtax/card.php?leftmenu=tax_2_vat&action=create&amp;localTaxType=2", $langs->trans("New"), 2, $user->hasRight('tax', 'charges', 'creer'));
1563
+						$newmenu->add("/compta/localtax/list.php?leftmenu=tax_2_vat&amp;localTaxType=2", $langs->trans("List"), 2, $user->hasRight('tax', 'charges', 'lire'));
1564
+						$newmenu->add("/compta/localtax/index.php?leftmenu=tax_2_vat&amp;localTaxType=2", $langs->trans("ReportByMonth"), 2, $user->hasRight('tax', 'charges', 'lire'));
1565
+						$newmenu->add("/compta/localtax/clients.php?leftmenu=tax_2_vat&amp;localTaxType=2", $langs->trans("ReportByThirdparties"), 2, $user->hasRight('tax', 'charges', 'lire'));
1566
+						$newmenu->add("/compta/localtax/quadri_detail.php?leftmenu=tax_2_vat&amp;localTaxType=2", $langs->trans("ReportByQuarter"), 2, $user->hasRight('tax', 'charges', 'lire'));
1567 1567
 					}
1568 1568
 				}
1569 1569
 			}
@@ -1572,21 +1572,21 @@  discard block
 block discarded – undo
1572 1572
 		// Salaries
1573 1573
 		if (isModEnabled('salaries')) {
1574 1574
 			$langs->load("salaries");
1575
-			$newmenu->add("/salaries/list.php?leftmenu=tax_salary&amp;mainmenu=billing", $langs->trans("Salaries"), 0, $user->hasRight('salaries',  'read'), '', $mainmenu, 'tax_salary', 0, '', '', '', img_picto('', 'salary', 'class="paddingright pictofixedwidth"'));
1575
+			$newmenu->add("/salaries/list.php?leftmenu=tax_salary&amp;mainmenu=billing", $langs->trans("Salaries"), 0, $user->hasRight('salaries', 'read'), '', $mainmenu, 'tax_salary', 0, '', '', '', img_picto('', 'salary', 'class="paddingright pictofixedwidth"'));
1576 1576
 			if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_salary/i', $leftmenu)) {
1577
-				$newmenu->add("/salaries/card.php?leftmenu=tax_salary&action=create", $langs->trans("New"), 1, $user->hasRight('salaries',  'write'));
1578
-				$newmenu->add("/salaries/list.php?leftmenu=tax_salary", $langs->trans("List"), 1, $user->hasRight('salaries',  'read'));
1579
-				$newmenu->add("/salaries/payments.php?leftmenu=tax_salary", $langs->trans("Payments"), 1, $user->hasRight('salaries',  'read'));
1580
-				$newmenu->add("/salaries/stats/index.php?leftmenu=tax_salary", $langs->trans("Statistics"), 1, $user->hasRight('salaries',  'read'));
1577
+				$newmenu->add("/salaries/card.php?leftmenu=tax_salary&action=create", $langs->trans("New"), 1, $user->hasRight('salaries', 'write'));
1578
+				$newmenu->add("/salaries/list.php?leftmenu=tax_salary", $langs->trans("List"), 1, $user->hasRight('salaries', 'read'));
1579
+				$newmenu->add("/salaries/payments.php?leftmenu=tax_salary", $langs->trans("Payments"), 1, $user->hasRight('salaries', 'read'));
1580
+				$newmenu->add("/salaries/stats/index.php?leftmenu=tax_salary", $langs->trans("Statistics"), 1, $user->hasRight('salaries', 'read'));
1581 1581
 			}
1582 1582
 		}
1583 1583
 
1584 1584
 		// Loan
1585 1585
 		if (isModEnabled('loan')) {
1586 1586
 			$langs->load("loan");
1587
-			$newmenu->add("/loan/list.php?leftmenu=tax_loan&amp;mainmenu=billing", $langs->trans("Loans"), 0, $user->hasRight('loan',  'read'), '', $mainmenu, 'tax_loan', 0, '', '', '', img_picto('', 'loan', 'class="paddingright pictofixedwidth"'));
1587
+			$newmenu->add("/loan/list.php?leftmenu=tax_loan&amp;mainmenu=billing", $langs->trans("Loans"), 0, $user->hasRight('loan', 'read'), '', $mainmenu, 'tax_loan', 0, '', '', '', img_picto('', 'loan', 'class="paddingright pictofixedwidth"'));
1588 1588
 			if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_loan/i', $leftmenu)) {
1589
-				$newmenu->add("/loan/card.php?leftmenu=tax_loan&action=create", $langs->trans("NewLoan"), 1, $user->hasRight('loan',  'write'));
1589
+				$newmenu->add("/loan/card.php?leftmenu=tax_loan&action=create", $langs->trans("NewLoan"), 1, $user->hasRight('loan', 'write'));
1590 1590
 				//$newmenu->add("/loan/payment/list.php?leftmenu=tax_loan",$langs->trans("Payments"),2,$user->hasRight('loan',  'read'));
1591 1591
 			}
1592 1592
 		}
@@ -1594,10 +1594,10 @@  discard block
 block discarded – undo
1594 1594
 		// Various payment
1595 1595
 		if (isModEnabled('banque') && empty($conf->global->BANK_USE_OLD_VARIOUS_PAYMENT)) {
1596 1596
 			$langs->load("banks");
1597
-			$newmenu->add("/compta/bank/various_payment/list.php?leftmenu=tax_various&amp;mainmenu=billing", $langs->trans("MenuVariousPayment"), 0, $user->hasRight('banque',  'lire'), '', $mainmenu, 'tax_various', 0, '', '', '', img_picto('', 'payment', 'class="paddingright pictofixedwidth"'));
1597
+			$newmenu->add("/compta/bank/various_payment/list.php?leftmenu=tax_various&amp;mainmenu=billing", $langs->trans("MenuVariousPayment"), 0, $user->hasRight('banque', 'lire'), '', $mainmenu, 'tax_various', 0, '', '', '', img_picto('', 'payment', 'class="paddingright pictofixedwidth"'));
1598 1598
 			if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_various/i', $leftmenu)) {
1599
-				$newmenu->add("/compta/bank/various_payment/card.php?leftmenu=tax_various&action=create", $langs->trans("New"), 1, $user->hasRight('banque',  'modifier'));
1600
-				$newmenu->add("/compta/bank/various_payment/list.php?leftmenu=tax_various", $langs->trans("List"), 1, $user->hasRight('banque',  'lire'));
1599
+				$newmenu->add("/compta/bank/various_payment/card.php?leftmenu=tax_various&action=create", $langs->trans("New"), 1, $user->hasRight('banque', 'modifier'));
1600
+				$newmenu->add("/compta/bank/various_payment/list.php?leftmenu=tax_various", $langs->trans("List"), 1, $user->hasRight('banque', 'lire'));
1601 1601
 			}
1602 1602
 		}
1603 1603
 	}
@@ -1627,71 +1627,71 @@  discard block
 block discarded – undo
1627 1627
 			//$newmenu->add("/accountancy/index.php?leftmenu=accountancy", $langs->trans("MenuAccountancy"), 0, $permtoshowmenu, '', $mainmenu, 'accountancy');
1628 1628
 
1629 1629
 			// Configuration
1630
-			$newmenu->add("/accountancy/index.php?leftmenu=accountancy_admin", $langs->trans("Setup"), 0, $user->hasRight('accounting',  'chartofaccount'), '', $mainmenu, 'accountancy_admin', 1, '', '', '', img_picto('', 'technic', 'class="paddingright pictofixedwidth"'));
1630
+			$newmenu->add("/accountancy/index.php?leftmenu=accountancy_admin", $langs->trans("Setup"), 0, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin', 1, '', '', '', img_picto('', 'technic', 'class="paddingright pictofixedwidth"'));
1631 1631
 			if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/', $leftmenu)) {
1632 1632
 				global $mysoc;
1633
-				$newmenu->add("/accountancy/admin/index.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("General"), 1, $user->hasRight('accounting',  'chartofaccount'), '', $mainmenu, 'accountancy_admin_general', 10);
1633
+				$newmenu->add("/accountancy/admin/index.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("General"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_general', 10);
1634 1634
 
1635 1635
 				// Fiscal year - Not really yet used. In a future will lock some periods.
1636 1636
 				if ($conf->global->MAIN_FEATURES_LEVEL > 1) {
1637
-					$newmenu->add("/accountancy/admin/fiscalyear.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("FiscalPeriod"), 1, $user->hasRight('accounting',  'fiscalyear', 'write'), '', $mainmenu, 'fiscalyear', 20);
1637
+					$newmenu->add("/accountancy/admin/fiscalyear.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("FiscalPeriod"), 1, $user->hasRight('accounting', 'fiscalyear', 'write'), '', $mainmenu, 'fiscalyear', 20);
1638 1638
 				}
1639 1639
 
1640
-				$newmenu->add("/accountancy/admin/journals_list.php?id=35&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("AccountingJournals"), 1, $user->hasRight('accounting',  'chartofaccount'), '', $mainmenu, 'accountancy_admin_journal', 30);
1641
-				$newmenu->add("/accountancy/admin/accountmodel.php?id=31&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("Pcg_version"), 1, $user->hasRight('accounting',  'chartofaccount'), '', $mainmenu, 'accountancy_admin_chartmodel', 40);
1642
-				$newmenu->add("/accountancy/admin/account.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("Chartofaccounts"), 1, $user->hasRight('accounting',  'chartofaccount'), '', $mainmenu, 'accountancy_admin_chart', 41);
1643
-				$newmenu->add("/accountancy/admin/subaccount.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("ChartOfSubaccounts"), 1, $user->hasRight('accounting',  'chartofaccount'), '', $mainmenu, 'accountancy_admin_chart', 41);
1644
-				$newmenu->add("/accountancy/admin/defaultaccounts.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuDefaultAccounts"), 1, $user->hasRight('accounting',  'chartofaccount'), '', $mainmenu, 'accountancy_admin_default', 60);
1640
+				$newmenu->add("/accountancy/admin/journals_list.php?id=35&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("AccountingJournals"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_journal', 30);
1641
+				$newmenu->add("/accountancy/admin/accountmodel.php?id=31&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("Pcg_version"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_chartmodel', 40);
1642
+				$newmenu->add("/accountancy/admin/account.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("Chartofaccounts"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_chart', 41);
1643
+				$newmenu->add("/accountancy/admin/subaccount.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("ChartOfSubaccounts"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_chart', 41);
1644
+				$newmenu->add("/accountancy/admin/defaultaccounts.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuDefaultAccounts"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_default', 60);
1645 1645
 				if (isModEnabled('banque')) {
1646
-					$newmenu->add("/compta/bank/list.php?mainmenu=accountancy&leftmenu=accountancy_admin&search_status=-1", $langs->trans("MenuBankAccounts"), 1, $user->hasRight('accounting',  'chartofaccount'), '', $mainmenu, 'accountancy_admin_bank', 70);
1646
+					$newmenu->add("/compta/bank/list.php?mainmenu=accountancy&leftmenu=accountancy_admin&search_status=-1", $langs->trans("MenuBankAccounts"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_bank', 70);
1647 1647
 				}
1648 1648
 				if (isModEnabled('facture') || isModEnabled('supplier_invoice')) {
1649
-					$newmenu->add("/admin/dict.php?id=10&from=accountancy&search_country_id=".$mysoc->country_id."&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuVatAccounts"), 1, $user->hasRight('accounting',  'chartofaccount'), '', $mainmenu, 'accountancy_admin_default', 80);
1649
+					$newmenu->add("/admin/dict.php?id=10&from=accountancy&search_country_id=".$mysoc->country_id."&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuVatAccounts"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_default', 80);
1650 1650
 				}
1651 1651
 				if (isModEnabled('tax')) {
1652
-					$newmenu->add("/admin/dict.php?id=7&from=accountancy&search_country_id=".$mysoc->country_id."&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuTaxAccounts"), 1, $user->hasRight('accounting',  'chartofaccount'), '', $mainmenu, 'accountancy_admin_default', 90);
1652
+					$newmenu->add("/admin/dict.php?id=7&from=accountancy&search_country_id=".$mysoc->country_id."&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuTaxAccounts"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_default', 90);
1653 1653
 				}
1654 1654
 				if (isModEnabled('expensereport')) {
1655
-					$newmenu->add("/admin/dict.php?id=17&from=accountancy&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuExpenseReportAccounts"), 1, $user->hasRight('accounting',  'chartofaccount'), '', $mainmenu, 'accountancy_admin_default', 100);
1655
+					$newmenu->add("/admin/dict.php?id=17&from=accountancy&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuExpenseReportAccounts"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_default', 100);
1656 1656
 				}
1657
-				$newmenu->add("/accountancy/admin/productaccount.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuProductsAccounts"), 1, $user->hasRight('accounting',  'chartofaccount'), '', $mainmenu, 'accountancy_admin_product', 110);
1657
+				$newmenu->add("/accountancy/admin/productaccount.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuProductsAccounts"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_product', 110);
1658 1658
 				if ($conf->global->MAIN_FEATURES_LEVEL > 1) {
1659
-					$newmenu->add("/accountancy/admin/closure.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuClosureAccounts"), 1, $user->hasRight('accounting',  'chartofaccount'), '', $mainmenu, 'accountancy_admin_closure', 120);
1659
+					$newmenu->add("/accountancy/admin/closure.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuClosureAccounts"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_closure', 120);
1660 1660
 				}
1661
-				$newmenu->add("/accountancy/admin/categories_list.php?id=32&search_country_id=".$mysoc->country_id."&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("AccountingCategory"), 1, $user->hasRight('accounting',  'chartofaccount'), '', $mainmenu, 'accountancy_admin_chart', 125);
1662
-				$newmenu->add("/accountancy/admin/export.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("ExportOptions"), 1, $user->hasRight('accounting',  'chartofaccount'), '', $mainmenu, 'accountancy_admin_export', 130);
1661
+				$newmenu->add("/accountancy/admin/categories_list.php?id=32&search_country_id=".$mysoc->country_id."&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("AccountingCategory"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_chart', 125);
1662
+				$newmenu->add("/accountancy/admin/export.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("ExportOptions"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_export', 130);
1663 1663
 			}
1664 1664
 
1665 1665
 			// Transfer in accounting
1666
-			$newmenu->add("/accountancy/index.php?leftmenu=accountancy_transfer", $langs->trans("TransferInAccounting"), 0, $user->hasRight('accounting',  'bind', 'write'), '', $mainmenu, 'transfer', 1, '', '', '', img_picto('', 'long-arrow-alt-right', 'class="paddingright pictofixedwidth"'));
1666
+			$newmenu->add("/accountancy/index.php?leftmenu=accountancy_transfer", $langs->trans("TransferInAccounting"), 0, $user->hasRight('accounting', 'bind', 'write'), '', $mainmenu, 'transfer', 1, '', '', '', img_picto('', 'long-arrow-alt-right', 'class="paddingright pictofixedwidth"'));
1667 1667
 
1668 1668
 			// Binding
1669 1669
 			// $newmenu->add("", $langs->trans("Binding"), 0, $user->hasRight('accounting',  'bind', 'write'), '', $mainmenu, 'dispatch');
1670 1670
 			if (isModEnabled('facture') && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_SALES)) {
1671
-				$newmenu->add("/accountancy/customer/index.php?leftmenu=accountancy_dispatch_customer&amp;mainmenu=accountancy", $langs->trans("CustomersVentilation"), 1, $user->hasRight('accounting',  'bind', 'write'), '', $mainmenu, 'dispatch_customer');
1671
+				$newmenu->add("/accountancy/customer/index.php?leftmenu=accountancy_dispatch_customer&amp;mainmenu=accountancy", $langs->trans("CustomersVentilation"), 1, $user->hasRight('accounting', 'bind', 'write'), '', $mainmenu, 'dispatch_customer');
1672 1672
 				if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_dispatch_customer/', $leftmenu)) {
1673
-					$newmenu->add("/accountancy/customer/list.php?mainmenu=accountancy&amp;leftmenu=accountancy_dispatch_customer", $langs->trans("ToBind"), 2, $user->hasRight('accounting',  'bind', 'write'));
1674
-					$newmenu->add("/accountancy/customer/lines.php?mainmenu=accountancy&amp;leftmenu=accountancy_dispatch_customer", $langs->trans("Binded"), 2, $user->hasRight('accounting',  'bind', 'write'));
1673
+					$newmenu->add("/accountancy/customer/list.php?mainmenu=accountancy&amp;leftmenu=accountancy_dispatch_customer", $langs->trans("ToBind"), 2, $user->hasRight('accounting', 'bind', 'write'));
1674
+					$newmenu->add("/accountancy/customer/lines.php?mainmenu=accountancy&amp;leftmenu=accountancy_dispatch_customer", $langs->trans("Binded"), 2, $user->hasRight('accounting', 'bind', 'write'));
1675 1675
 				}
1676 1676
 			}
1677 1677
 			if (isModEnabled('supplier_invoice') && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_PURCHASES)) {
1678
-				$newmenu->add("/accountancy/supplier/index.php?leftmenu=accountancy_dispatch_supplier&amp;mainmenu=accountancy", $langs->trans("SuppliersVentilation"), 1, $user->hasRight('accounting',  'bind', 'write'), '', $mainmenu, 'dispatch_supplier');
1678
+				$newmenu->add("/accountancy/supplier/index.php?leftmenu=accountancy_dispatch_supplier&amp;mainmenu=accountancy", $langs->trans("SuppliersVentilation"), 1, $user->hasRight('accounting', 'bind', 'write'), '', $mainmenu, 'dispatch_supplier');
1679 1679
 				if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_dispatch_supplier/', $leftmenu)) {
1680
-					$newmenu->add("/accountancy/supplier/list.php?mainmenu=accountancy&amp;leftmenu=accountancy_dispatch_supplier", $langs->trans("ToBind"), 2, $user->hasRight('accounting',  'bind', 'write'));
1681
-					$newmenu->add("/accountancy/supplier/lines.php?mainmenu=accountancy&amp;leftmenu=accountancy_dispatch_supplier", $langs->trans("Binded"), 2, $user->hasRight('accounting',  'bind', 'write'));
1680
+					$newmenu->add("/accountancy/supplier/list.php?mainmenu=accountancy&amp;leftmenu=accountancy_dispatch_supplier", $langs->trans("ToBind"), 2, $user->hasRight('accounting', 'bind', 'write'));
1681
+					$newmenu->add("/accountancy/supplier/lines.php?mainmenu=accountancy&amp;leftmenu=accountancy_dispatch_supplier", $langs->trans("Binded"), 2, $user->hasRight('accounting', 'bind', 'write'));
1682 1682
 				}
1683 1683
 			}
1684 1684
 			if (isModEnabled('expensereport') && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS)) {
1685
-				$newmenu->add("/accountancy/expensereport/index.php?leftmenu=accountancy_dispatch_expensereport&amp;mainmenu=accountancy", $langs->trans("ExpenseReportsVentilation"), 1, $user->hasRight('accounting',  'bind', 'write'), '', $mainmenu, 'dispatch_expensereport');
1685
+				$newmenu->add("/accountancy/expensereport/index.php?leftmenu=accountancy_dispatch_expensereport&amp;mainmenu=accountancy", $langs->trans("ExpenseReportsVentilation"), 1, $user->hasRight('accounting', 'bind', 'write'), '', $mainmenu, 'dispatch_expensereport');
1686 1686
 				if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_dispatch_expensereport/', $leftmenu)) {
1687
-					$newmenu->add("/accountancy/expensereport/list.php?mainmenu=accountancy&amp;leftmenu=accountancy_dispatch_expensereport", $langs->trans("ToBind"), 2, $user->hasRight('accounting',  'bind', 'write'));
1688
-					$newmenu->add("/accountancy/expensereport/lines.php?mainmenu=accountancy&amp;leftmenu=accountancy_dispatch_expensereport", $langs->trans("Binded"), 2, $user->hasRight('accounting',  'bind', 'write'));
1687
+					$newmenu->add("/accountancy/expensereport/list.php?mainmenu=accountancy&amp;leftmenu=accountancy_dispatch_expensereport", $langs->trans("ToBind"), 2, $user->hasRight('accounting', 'bind', 'write'));
1688
+					$newmenu->add("/accountancy/expensereport/lines.php?mainmenu=accountancy&amp;leftmenu=accountancy_dispatch_expensereport", $langs->trans("Binded"), 2, $user->hasRight('accounting', 'bind', 'write'));
1689 1689
 				}
1690 1690
 			}
1691 1691
 
1692 1692
 			// Journals
1693
-			if (isModEnabled('accounting') && $user->hasRight('accounting',  'comptarapport', 'lire') && $mainmenu == 'accountancy') {
1694
-				$newmenu->add('', $langs->trans("RegistrationInAccounting"), 1, $user->hasRight('accounting',  'comptarapport', 'lire'), '', $mainmenu, 'accountancy_journal');
1693
+			if (isModEnabled('accounting') && $user->hasRight('accounting', 'comptarapport', 'lire') && $mainmenu == 'accountancy') {
1694
+				$newmenu->add('', $langs->trans("RegistrationInAccounting"), 1, $user->hasRight('accounting', 'comptarapport', 'lire'), '', $mainmenu, 'accountancy_journal');
1695 1695
 
1696 1696
 				// Multi journal
1697 1697
 				$sql = "SELECT rowid, code, label, nature";
@@ -1727,7 +1727,7 @@  discard block
 block discarded – undo
1727 1727
 								$nature = "expensereports";
1728 1728
 							}
1729 1729
 							if ($objp->nature == 1 && isModEnabled('asset')) {
1730
-								$nature = "various";	// Warning: The page /accountancy/journal/variousjournal.php is bugged. It read tables that does not exists.
1730
+								$nature = "various"; // Warning: The page /accountancy/journal/variousjournal.php is bugged. It read tables that does not exists.
1731 1731
 							}
1732 1732
 							if ($objp->nature == 8) {
1733 1733
 								$nature = "inventory";
@@ -1751,16 +1751,16 @@  discard block
 block discarded – undo
1751 1751
 									$journallabel = '<span class="opacitymedium">('.$langs->trans($objp->label).')</span>'; // Label of bank account in llx_accounting_journal
1752 1752
 								}
1753 1753
 
1754
-								$key = $langs->trans("AccountingJournalType".$objp->nature);	// $objp->nature is 1, 2, 3 ...
1755
-								$transferlabel = (($objp->nature && $key != "AccountingJournalType".$objp->nature) ? $key.($journallabelwithoutspan != $key ? ' '.$journallabel : ''): $journallabel);
1754
+								$key = $langs->trans("AccountingJournalType".$objp->nature); // $objp->nature is 1, 2, 3 ...
1755
+								$transferlabel = (($objp->nature && $key != "AccountingJournalType".$objp->nature) ? $key.($journallabelwithoutspan != $key ? ' '.$journallabel : '') : $journallabel);
1756 1756
 
1757
-								$newmenu->add('/accountancy/journal/'.$nature.'journal.php?mainmenu=accountancy&leftmenu=accountancy_journal&id_journal='.$objp->rowid, $transferlabel, 2, $user->hasRight('accounting',  'comptarapport', 'lire'));
1757
+								$newmenu->add('/accountancy/journal/'.$nature.'journal.php?mainmenu=accountancy&leftmenu=accountancy_journal&id_journal='.$objp->rowid, $transferlabel, 2, $user->hasRight('accounting', 'comptarapport', 'lire'));
1758 1758
 							}
1759 1759
 							$i++;
1760 1760
 						}
1761 1761
 					} else {
1762 1762
 						// Should not happend. Entries are added
1763
-						$newmenu->add('', $langs->trans("NoJournalDefined"), 2, $user->hasRight('accounting',  'comptarapport', 'lire'));
1763
+						$newmenu->add('', $langs->trans("NoJournalDefined"), 2, $user->hasRight('accounting', 'comptarapport', 'lire'));
1764 1764
 					}
1765 1765
 				} else {
1766 1766
 					dol_print_error($db);
@@ -1770,48 +1770,48 @@  discard block
 block discarded – undo
1770 1770
 
1771 1771
 			// Files
1772 1772
 			if (empty($conf->global->ACCOUNTANCY_HIDE_EXPORT_FILES_MENU)) {
1773
-				$newmenu->add("/compta/accounting-files.php?mainmenu=accountancy&amp;leftmenu=accountancy_files", $langs->trans("AccountantFiles"), 1, $user->hasRight('accounting',  'mouvements', 'lire'));
1773
+				$newmenu->add("/compta/accounting-files.php?mainmenu=accountancy&amp;leftmenu=accountancy_files", $langs->trans("AccountantFiles"), 1, $user->hasRight('accounting', 'mouvements', 'lire'));
1774 1774
 			}
1775 1775
 
1776 1776
 
1777 1777
 			// Accounting
1778
-			$newmenu->add("/accountancy/index.php?leftmenu=accountancy_accountancy", $langs->trans("MenuAccountancy"), 0, $user->hasRight('accounting',  'mouvements', 'lire') || $user->hasRight('accounting',  'comptarapport', 'lire'), '', $mainmenu, 'accountancy', 1, '', '', '', img_picto('', 'accountancy', 'class="paddingright pictofixedwidth"'));
1778
+			$newmenu->add("/accountancy/index.php?leftmenu=accountancy_accountancy", $langs->trans("MenuAccountancy"), 0, $user->hasRight('accounting', 'mouvements', 'lire') || $user->hasRight('accounting', 'comptarapport', 'lire'), '', $mainmenu, 'accountancy', 1, '', '', '', img_picto('', 'accountancy', 'class="paddingright pictofixedwidth"'));
1779 1779
 
1780 1780
 			// General Ledger
1781
-			$newmenu->add("/accountancy/bookkeeping/listbyaccount.php?mainmenu=accountancy&amp;leftmenu=accountancy_accountancy", $langs->trans("Bookkeeping"), 1, $user->hasRight('accounting',  'mouvements', 'lire'));
1781
+			$newmenu->add("/accountancy/bookkeeping/listbyaccount.php?mainmenu=accountancy&amp;leftmenu=accountancy_accountancy", $langs->trans("Bookkeeping"), 1, $user->hasRight('accounting', 'mouvements', 'lire'));
1782 1782
 
1783 1783
 			// Journals
1784
-			$newmenu->add("/accountancy/bookkeeping/list.php?mainmenu=accountancy&amp;leftmenu=accountancy_accountancy", $langs->trans("Journals"), 1, $user->hasRight('accounting',  'mouvements', 'lire'));
1784
+			$newmenu->add("/accountancy/bookkeeping/list.php?mainmenu=accountancy&amp;leftmenu=accountancy_accountancy", $langs->trans("Journals"), 1, $user->hasRight('accounting', 'mouvements', 'lire'));
1785 1785
 
1786 1786
 			// Account Balance
1787
-			$newmenu->add("/accountancy/bookkeeping/balance.php?mainmenu=accountancy&amp;leftmenu=accountancy_accountancy", $langs->trans("AccountBalance"), 1, $user->hasRight('accounting',  'mouvements', 'lire'));
1787
+			$newmenu->add("/accountancy/bookkeeping/balance.php?mainmenu=accountancy&amp;leftmenu=accountancy_accountancy", $langs->trans("AccountBalance"), 1, $user->hasRight('accounting', 'mouvements', 'lire'));
1788 1788
 
1789 1789
 			// Export accountancy
1790
-			$newmenu->add("/accountancy/bookkeeping/export.php?mainmenu=accountancy&amp;leftmenu=accountancy_accountancy", $langs->trans("MenuExportAccountancy"), 1, $user->hasRight('accounting',  'mouvements', 'lire'));
1790
+			$newmenu->add("/accountancy/bookkeeping/export.php?mainmenu=accountancy&amp;leftmenu=accountancy_accountancy", $langs->trans("MenuExportAccountancy"), 1, $user->hasRight('accounting', 'mouvements', 'lire'));
1791 1791
 
1792 1792
 			// Closure
1793
-			$newmenu->add("/accountancy/closure/index.php?mainmenu=accountancy&amp;leftmenu=accountancy_closure", $langs->trans("MenuAccountancyClosure"), 1, $user->hasRight('accounting',  'fiscalyear', 'write'), '', $mainmenu, 'closure');
1793
+			$newmenu->add("/accountancy/closure/index.php?mainmenu=accountancy&amp;leftmenu=accountancy_closure", $langs->trans("MenuAccountancyClosure"), 1, $user->hasRight('accounting', 'fiscalyear', 'write'), '', $mainmenu, 'closure');
1794 1794
 
1795 1795
 			// Reports
1796
-			$newmenu->add("/accountancy/index.php?leftmenu=accountancy_report", $langs->trans("Reportings"), 1, $user->hasRight('accounting',  'comptarapport', 'lire'), '', $mainmenu, 'ca');
1796
+			$newmenu->add("/accountancy/index.php?leftmenu=accountancy_report", $langs->trans("Reportings"), 1, $user->hasRight('accounting', 'comptarapport', 'lire'), '', $mainmenu, 'ca');
1797 1797
 
1798 1798
 			if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/', $leftmenu)) {
1799
-				$newmenu->add("/compta/resultat/index.php?leftmenu=accountancy_report", $langs->trans("MenuReportInOut"), 2, $user->hasRight('accounting',  'comptarapport', 'lire'));
1800
-				$newmenu->add("/compta/resultat/clientfourn.php?leftmenu=accountancy_report", $langs->trans("ByPredefinedAccountGroups"), 3, $user->hasRight('accounting',  'comptarapport', 'lire'));
1801
-				$newmenu->add("/compta/resultat/result.php?leftmenu=accountancy_report", $langs->trans("ByPersonalizedAccountGroups"), 3, $user->hasRight('accounting',  'comptarapport', 'lire'));
1799
+				$newmenu->add("/compta/resultat/index.php?leftmenu=accountancy_report", $langs->trans("MenuReportInOut"), 2, $user->hasRight('accounting', 'comptarapport', 'lire'));
1800
+				$newmenu->add("/compta/resultat/clientfourn.php?leftmenu=accountancy_report", $langs->trans("ByPredefinedAccountGroups"), 3, $user->hasRight('accounting', 'comptarapport', 'lire'));
1801
+				$newmenu->add("/compta/resultat/result.php?leftmenu=accountancy_report", $langs->trans("ByPersonalizedAccountGroups"), 3, $user->hasRight('accounting', 'comptarapport', 'lire'));
1802 1802
 			}
1803 1803
 
1804 1804
 			$modecompta = 'CREANCES-DETTES';
1805
-			if (isModEnabled('accounting') && $user->hasRight('accounting',  'comptarapport', 'lire') && $mainmenu == 'accountancy') {
1805
+			if (isModEnabled('accounting') && $user->hasRight('accounting', 'comptarapport', 'lire') && $mainmenu == 'accountancy') {
1806 1806
 				$modecompta = 'BOOKKEEPING'; // Not yet implemented. Should be BOOKKEEPINGCOLLECTED
1807 1807
 			}
1808 1808
 			if ($modecompta) {
1809 1809
 				if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/', $leftmenu)) {
1810
-					$newmenu->add("/compta/stats/index.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ReportTurnover"), 2, $user->hasRight('accounting',  'comptarapport', 'lire'));
1811
-					$newmenu->add("/compta/stats/casoc.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 3, $user->hasRight('accounting',  'comptarapport', 'lire'));
1812
-					$newmenu->add("/compta/stats/cabyuser.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByUsers"), 3, $user->hasRight('accounting',  'comptarapport', 'lire'));
1813
-					$newmenu->add("/compta/stats/cabyprodserv.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByProductsAndServices"), 3, $user->hasRight('accounting',  'comptarapport', 'lire'));
1814
-					$newmenu->add("/compta/stats/byratecountry.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByVatRate"), 3, $user->hasRight('accounting',  'comptarapport', 'lire'));
1810
+					$newmenu->add("/compta/stats/index.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ReportTurnover"), 2, $user->hasRight('accounting', 'comptarapport', 'lire'));
1811
+					$newmenu->add("/compta/stats/casoc.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 3, $user->hasRight('accounting', 'comptarapport', 'lire'));
1812
+					$newmenu->add("/compta/stats/cabyuser.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByUsers"), 3, $user->hasRight('accounting', 'comptarapport', 'lire'));
1813
+					$newmenu->add("/compta/stats/cabyprodserv.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByProductsAndServices"), 3, $user->hasRight('accounting', 'comptarapport', 'lire'));
1814
+					$newmenu->add("/compta/stats/byratecountry.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByVatRate"), 3, $user->hasRight('accounting', 'comptarapport', 'lire'));
1815 1815
 				}
1816 1816
 			}
1817 1817
 
@@ -1819,34 +1819,34 @@  discard block
 block discarded – undo
1819 1819
 			//if (isModEnabled('accounting') && $user->hasRight('accounting',  'comptarapport', 'lire') && $mainmenu == 'accountancy') $modecompta='';	// Not yet implemented. Should be BOOKKEEPINGCOLLECTED
1820 1820
 			if ($modecompta) {
1821 1821
 				if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/', $leftmenu)) {
1822
-					$newmenu->add("/compta/stats/index.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ReportTurnoverCollected"), 2, $user->hasRight('accounting',  'comptarapport', 'lire'));
1823
-					$newmenu->add("/compta/stats/casoc.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 3, $user->hasRight('accounting',  'comptarapport', 'lire'));
1824
-					$newmenu->add("/compta/stats/cabyuser.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByUsers"), 3, $user->hasRight('accounting',  'comptarapport', 'lire'));
1822
+					$newmenu->add("/compta/stats/index.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ReportTurnoverCollected"), 2, $user->hasRight('accounting', 'comptarapport', 'lire'));
1823
+					$newmenu->add("/compta/stats/casoc.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 3, $user->hasRight('accounting', 'comptarapport', 'lire'));
1824
+					$newmenu->add("/compta/stats/cabyuser.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByUsers"), 3, $user->hasRight('accounting', 'comptarapport', 'lire'));
1825 1825
 					//$newmenu->add("/compta/stats/cabyprodserv.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByProductsAndServices"),3,$user->hasRight('accounting',  'comptarapport', 'lire'));
1826 1826
 					//$newmenu->add("/compta/stats/byratecountry.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByVatRate"),3,$user->hasRight('accounting',  'comptarapport', 'lire'));
1827 1827
 				}
1828 1828
 			}
1829 1829
 
1830 1830
 			$modecompta = 'CREANCES-DETTES';
1831
-			if (isModEnabled('accounting') && $user->hasRight('accounting',  'comptarapport', 'lire') && $mainmenu == 'accountancy') {
1831
+			if (isModEnabled('accounting') && $user->hasRight('accounting', 'comptarapport', 'lire') && $mainmenu == 'accountancy') {
1832 1832
 				$modecompta = 'BOOKKEEPING'; // Not yet implemented.
1833 1833
 			}
1834 1834
 			if ($modecompta && isModEnabled('supplier_invoice')) {
1835 1835
 				if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/', $leftmenu)) {
1836
-					$newmenu->add("/compta/stats/supplier_turnover.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ReportPurchaseTurnover"), 2, $user->hasRight('accounting',  'comptarapport', 'lire'));
1837
-					$newmenu->add("/compta/stats/supplier_turnover_by_thirdparty.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 3, $user->hasRight('accounting',  'comptarapport', 'lire'));
1838
-					$newmenu->add("/compta/stats/supplier_turnover_by_prodserv.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByProductsAndServices"), 3, $user->hasRight('accounting',  'comptarapport', 'lire'));
1836
+					$newmenu->add("/compta/stats/supplier_turnover.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ReportPurchaseTurnover"), 2, $user->hasRight('accounting', 'comptarapport', 'lire'));
1837
+					$newmenu->add("/compta/stats/supplier_turnover_by_thirdparty.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 3, $user->hasRight('accounting', 'comptarapport', 'lire'));
1838
+					$newmenu->add("/compta/stats/supplier_turnover_by_prodserv.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByProductsAndServices"), 3, $user->hasRight('accounting', 'comptarapport', 'lire'));
1839 1839
 				}
1840 1840
 			}
1841 1841
 
1842 1842
 			$modecompta = 'RECETTES-DEPENSES';
1843
-			if (isModEnabled('accounting') && $user->hasRight('accounting',  'comptarapport', 'lire') && $mainmenu == 'accountancy') {
1843
+			if (isModEnabled('accounting') && $user->hasRight('accounting', 'comptarapport', 'lire') && $mainmenu == 'accountancy') {
1844 1844
 				$modecompta = 'BOOKKEEPINGCOLLECTED'; // Not yet implemented.
1845 1845
 			}
1846 1846
 			if ($modecompta && ((isModEnabled('fournisseur') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled('supplier_invoice'))) {
1847 1847
 				if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/', $leftmenu)) {
1848
-					$newmenu->add("/compta/stats/supplier_turnover.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ReportPurchaseTurnoverCollected"), 2, $user->hasRight('accounting',  'comptarapport', 'lire'));
1849
-					$newmenu->add("/compta/stats/supplier_turnover_by_thirdparty.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 3, $user->hasRight('accounting',  'comptarapport', 'lire'));
1848
+					$newmenu->add("/compta/stats/supplier_turnover.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ReportPurchaseTurnoverCollected"), 2, $user->hasRight('accounting', 'comptarapport', 'lire'));
1849
+					$newmenu->add("/compta/stats/supplier_turnover_by_thirdparty.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 3, $user->hasRight('accounting', 'comptarapport', 'lire'));
1850 1850
 				}
1851 1851
 			}
1852 1852
 		}
@@ -1855,15 +1855,15 @@  discard block
 block discarded – undo
1855 1855
 		if (isModEnabled('comptabilite')) {
1856 1856
 			// Files
1857 1857
 			if (empty($conf->global->ACCOUNTANCY_HIDE_EXPORT_FILES_MENU)) {
1858
-				$newmenu->add("/compta/accounting-files.php?mainmenu=accountancy&leftmenu=accountancy_files", $langs->trans("AccountantFiles"), 0, $user->hasRight('compta',  'resultat', 'lire'), '', $mainmenu, 'files', 0, '', '', '', img_picto('', 'accountancy', 'class="paddingright pictofixedwidth"'));
1858
+				$newmenu->add("/compta/accounting-files.php?mainmenu=accountancy&leftmenu=accountancy_files", $langs->trans("AccountantFiles"), 0, $user->hasRight('compta', 'resultat', 'lire'), '', $mainmenu, 'files', 0, '', '', '', img_picto('', 'accountancy', 'class="paddingright pictofixedwidth"'));
1859 1859
 			}
1860 1860
 
1861 1861
 			// Bilan, resultats
1862
-			$newmenu->add("/compta/resultat/index.php?leftmenu=report&mainmenu=accountancy", $langs->trans("Reportings"), 0, $user->hasRight('compta',  'resultat', 'lire'), '', $mainmenu, 'ca', 0, '', '', '', img_picto('', 'accountancy', 'class="paddingright pictofixedwidth"'));
1862
+			$newmenu->add("/compta/resultat/index.php?leftmenu=report&mainmenu=accountancy", $langs->trans("Reportings"), 0, $user->hasRight('compta', 'resultat', 'lire'), '', $mainmenu, 'ca', 0, '', '', '', img_picto('', 'accountancy', 'class="paddingright pictofixedwidth"'));
1863 1863
 
1864 1864
 			if ($usemenuhider || empty($leftmenu) || preg_match('/report/', $leftmenu)) {
1865
-				$newmenu->add("/compta/resultat/index.php?leftmenu=report", $langs->trans("MenuReportInOut"), 1, $user->hasRight('compta',  'resultat', 'lire'));
1866
-				$newmenu->add("/compta/resultat/clientfourn.php?leftmenu=report", $langs->trans("ByCompanies"), 2, $user->hasRight('compta',  'resultat', 'lire'));
1865
+				$newmenu->add("/compta/resultat/index.php?leftmenu=report", $langs->trans("MenuReportInOut"), 1, $user->hasRight('compta', 'resultat', 'lire'));
1866
+				$newmenu->add("/compta/resultat/clientfourn.php?leftmenu=report", $langs->trans("ByCompanies"), 2, $user->hasRight('compta', 'resultat', 'lire'));
1867 1867
 				/* On verra ca avec module compabilite expert
1868 1868
 				 $newmenu->add("/compta/resultat/compteres.php?leftmenu=report","Compte de resultat",2,$user->hasRight('compta',  'resultat', 'lire'));
1869 1869
 				 $newmenu->add("/compta/resultat/bilan.php?leftmenu=report","Bilan",2,$user->hasRight('compta',  'resultat', 'lire'));
@@ -1878,22 +1878,22 @@  discard block
 block discarded – undo
1878 1878
 				 */
1879 1879
 
1880 1880
 				$modecompta = 'CREANCES-DETTES';
1881
-				$newmenu->add("/compta/stats/index.php?leftmenu=report&modecompta=".$modecompta, $langs->trans("ReportTurnover"), 1, $user->hasRight('compta',  'resultat', 'lire'));
1882
-				$newmenu->add("/compta/stats/casoc.php?leftmenu=report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 2, $user->hasRight('compta',  'resultat', 'lire'));
1883
-				$newmenu->add("/compta/stats/cabyuser.php?leftmenu=report&modecompta=".$modecompta, $langs->trans("ByUsers"), 2, $user->hasRight('compta',  'resultat', 'lire'));
1884
-				$newmenu->add("/compta/stats/cabyprodserv.php?leftmenu=report&modecompta=".$modecompta, $langs->trans("ByProductsAndServices"), 2, $user->hasRight('compta',  'resultat', 'lire'));
1885
-				$newmenu->add("/compta/stats/byratecountry.php?leftmenu=report&modecompta=".$modecompta, $langs->trans("ByVatRate"), 2, $user->hasRight('compta',  'resultat', 'lire'));
1881
+				$newmenu->add("/compta/stats/index.php?leftmenu=report&modecompta=".$modecompta, $langs->trans("ReportTurnover"), 1, $user->hasRight('compta', 'resultat', 'lire'));
1882
+				$newmenu->add("/compta/stats/casoc.php?leftmenu=report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 2, $user->hasRight('compta', 'resultat', 'lire'));
1883
+				$newmenu->add("/compta/stats/cabyuser.php?leftmenu=report&modecompta=".$modecompta, $langs->trans("ByUsers"), 2, $user->hasRight('compta', 'resultat', 'lire'));
1884
+				$newmenu->add("/compta/stats/cabyprodserv.php?leftmenu=report&modecompta=".$modecompta, $langs->trans("ByProductsAndServices"), 2, $user->hasRight('compta', 'resultat', 'lire'));
1885
+				$newmenu->add("/compta/stats/byratecountry.php?leftmenu=report&modecompta=".$modecompta, $langs->trans("ByVatRate"), 2, $user->hasRight('compta', 'resultat', 'lire'));
1886 1886
 
1887 1887
 				$modecompta = 'RECETTES-DEPENSES';
1888
-				$newmenu->add("/compta/stats/index.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ReportTurnoverCollected"), 1, $user->hasRight('compta',  'resultat', 'lire'));
1889
-				$newmenu->add("/compta/stats/casoc.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 2, $user->hasRight('compta',  'resultat', 'lire'));
1890
-				$newmenu->add("/compta/stats/cabyuser.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByUsers"), 2, $user->hasRight('compta',  'resultat', 'lire'));
1888
+				$newmenu->add("/compta/stats/index.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ReportTurnoverCollected"), 1, $user->hasRight('compta', 'resultat', 'lire'));
1889
+				$newmenu->add("/compta/stats/casoc.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 2, $user->hasRight('compta', 'resultat', 'lire'));
1890
+				$newmenu->add("/compta/stats/cabyuser.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByUsers"), 2, $user->hasRight('compta', 'resultat', 'lire'));
1891 1891
 
1892 1892
 				//Achats
1893 1893
 				$modecompta = 'CREANCES-DETTES';
1894
-				$newmenu->add("/compta/stats/supplier_turnover.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ReportPurchaseTurnover"), 1, $user->hasRight('compta',  'resultat', 'lire'));
1895
-				$newmenu->add("/compta/stats/supplier_turnover_by_thirdparty.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 2, $user->hasRight('compta',  'resultat', 'lire'));
1896
-				$newmenu->add("/compta/stats/supplier_turnover_by_prodserv.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByProductsAndServices"), 2, $user->hasRight('compta',  'resultat', 'lire'));
1894
+				$newmenu->add("/compta/stats/supplier_turnover.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ReportPurchaseTurnover"), 1, $user->hasRight('compta', 'resultat', 'lire'));
1895
+				$newmenu->add("/compta/stats/supplier_turnover_by_thirdparty.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 2, $user->hasRight('compta', 'resultat', 'lire'));
1896
+				$newmenu->add("/compta/stats/supplier_turnover_by_prodserv.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByProductsAndServices"), 2, $user->hasRight('compta', 'resultat', 'lire'));
1897 1897
 
1898 1898
 				/*
1899 1899
 				 $modecompta = 'RECETTES-DEPENSES';
@@ -1903,31 +1903,31 @@  discard block
 block discarded – undo
1903 1903
 				 */
1904 1904
 
1905 1905
 				// Journals
1906
-				$newmenu->add("/compta/journal/sellsjournal.php?leftmenu=report", $langs->trans("SellsJournal"), 1, $user->hasRight('compta',  'resultat', 'lire'), '', '', '', 50);
1907
-				$newmenu->add("/compta/journal/purchasesjournal.php?leftmenu=report", $langs->trans("PurchasesJournal"), 1, $user->hasRight('compta',  'resultat', 'lire'), '', '', '', 51);
1906
+				$newmenu->add("/compta/journal/sellsjournal.php?leftmenu=report", $langs->trans("SellsJournal"), 1, $user->hasRight('compta', 'resultat', 'lire'), '', '', '', 50);
1907
+				$newmenu->add("/compta/journal/purchasesjournal.php?leftmenu=report", $langs->trans("PurchasesJournal"), 1, $user->hasRight('compta', 'resultat', 'lire'), '', '', '', 51);
1908 1908
 			}
1909 1909
 			//if ($leftmenu=="ca") $newmenu->add("/compta/journaux/index.php?leftmenu=ca",$langs->trans("Journals"),1,$user->hasRight('compta',  'resultat', 'lire')||$user->hasRight('accounting',  'comptarapport', 'lire'));
1910 1910
 		}
1911 1911
 
1912 1912
 		// Intracomm report
1913 1913
 		if (isModEnabled('intracommreport')) {
1914
-			$newmenu->add("/intracommreport/list.php?leftmenu=intracommreport", $langs->trans("MenuIntracommReport"), 0, $user->hasRight('intracommreport',  'read'), '', $mainmenu, 'intracommreport', 60, '', '', '', img_picto('', 'intracommreport', 'class="paddingright pictofixedwidth"'));
1914
+			$newmenu->add("/intracommreport/list.php?leftmenu=intracommreport", $langs->trans("MenuIntracommReport"), 0, $user->hasRight('intracommreport', 'read'), '', $mainmenu, 'intracommreport', 60, '', '', '', img_picto('', 'intracommreport', 'class="paddingright pictofixedwidth"'));
1915 1915
 			if ($usemenuhider || empty($leftmenu) || preg_match('/intracommreport/', $leftmenu)) {
1916 1916
 				// DEB / DES
1917
-				$newmenu->add("/intracommreport/card.php?action=create&leftmenu=intracommreport", $langs->trans("MenuIntracommReportNew"), 1, $user->hasRight('intracommreport',  'write'), '', $mainmenu, 'intracommreport', 1);
1918
-				$newmenu->add("/intracommreport/list.php?leftmenu=intracommreport", $langs->trans("MenuIntracommReportList"), 1, $user->hasRight('intracommreport',  'read'), '', $mainmenu, 'intracommreport', 1);
1917
+				$newmenu->add("/intracommreport/card.php?action=create&leftmenu=intracommreport", $langs->trans("MenuIntracommReportNew"), 1, $user->hasRight('intracommreport', 'write'), '', $mainmenu, 'intracommreport', 1);
1918
+				$newmenu->add("/intracommreport/list.php?leftmenu=intracommreport", $langs->trans("MenuIntracommReportList"), 1, $user->hasRight('intracommreport', 'read'), '', $mainmenu, 'intracommreport', 1);
1919 1919
 			}
1920 1920
 		}
1921 1921
 
1922 1922
 		// Assets
1923 1923
 		if (isModEnabled('asset')) {
1924
-			$newmenu->add("/asset/list.php?leftmenu=asset&amp;mainmenu=accountancy", $langs->trans("MenuAssets"), 0, $user->hasRight('asset',  'read'), '', $mainmenu, 'asset', 100, '', '', '', img_picto('', 'payment', 'class="paddingright pictofixedwidth"'));
1925
-			$newmenu->add("/asset/card.php?leftmenu=asset&amp;action=create", $langs->trans("MenuNewAsset"), 1, $user->hasRight('asset',  'write'));
1926
-			$newmenu->add("/asset/list.php?leftmenu=asset&amp;mainmenu=accountancy", $langs->trans("MenuListAssets"), 1, $user->hasRight('asset',  'read'));
1927
-			$newmenu->add("/asset/model/list.php?leftmenu=asset_model", $langs->trans("MenuAssetModels"), 1, (empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('asset',  'read')) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('asset',  'model_advance', 'read')), '', $mainmenu, 'asset_model');
1924
+			$newmenu->add("/asset/list.php?leftmenu=asset&amp;mainmenu=accountancy", $langs->trans("MenuAssets"), 0, $user->hasRight('asset', 'read'), '', $mainmenu, 'asset', 100, '', '', '', img_picto('', 'payment', 'class="paddingright pictofixedwidth"'));
1925
+			$newmenu->add("/asset/card.php?leftmenu=asset&amp;action=create", $langs->trans("MenuNewAsset"), 1, $user->hasRight('asset', 'write'));
1926
+			$newmenu->add("/asset/list.php?leftmenu=asset&amp;mainmenu=accountancy", $langs->trans("MenuListAssets"), 1, $user->hasRight('asset', 'read'));
1927
+			$newmenu->add("/asset/model/list.php?leftmenu=asset_model", $langs->trans("MenuAssetModels"), 1, (empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('asset', 'read')) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('asset', 'model_advance', 'read')), '', $mainmenu, 'asset_model');
1928 1928
 			if ($usemenuhider || empty($leftmenu) || preg_match('/asset_model/', $leftmenu)) {
1929
-				$newmenu->add("/asset/model/card.php?leftmenu=asset_model&amp;action=create", $langs->trans("MenuNewAssetModel"), 2, (empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('asset',  'write')) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('asset',  'model_advance', 'write')));
1930
-				$newmenu->add("/asset/model/list.php?leftmenu=asset_model", $langs->trans("MenuListAssetModels"), 2, (empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('asset',  'read')) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('asset',  'model_advance', 'read')));
1929
+				$newmenu->add("/asset/model/card.php?leftmenu=asset_model&amp;action=create", $langs->trans("MenuNewAssetModel"), 2, (empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('asset', 'write')) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('asset', 'model_advance', 'write')));
1930
+				$newmenu->add("/asset/model/list.php?leftmenu=asset_model", $langs->trans("MenuListAssetModels"), 2, (empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('asset', 'read')) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('asset', 'model_advance', 'read')));
1931 1931
 			}
1932 1932
 		}
1933 1933
 	}
@@ -1953,62 +1953,62 @@  discard block
 block discarded – undo
1953 1953
 
1954 1954
 		// Bank-Cash account
1955 1955
 		if (isModEnabled('banque')) {
1956
-			$newmenu->add("/compta/bank/list.php?leftmenu=bank&amp;mainmenu=bank", $langs->trans("MenuBankCash"), 0, $user->hasRight('banque',  'lire'), '', $mainmenu, 'bank', 0, '', '', '', img_picto('', 'bank_account', 'class="paddingright pictofixedwidth"'));
1956
+			$newmenu->add("/compta/bank/list.php?leftmenu=bank&amp;mainmenu=bank", $langs->trans("MenuBankCash"), 0, $user->hasRight('banque', 'lire'), '', $mainmenu, 'bank', 0, '', '', '', img_picto('', 'bank_account', 'class="paddingright pictofixedwidth"'));
1957 1957
 
1958
-			$newmenu->add("/compta/bank/card.php?action=create", $langs->trans("MenuNewFinancialAccount"), 1, $user->hasRight('banque',  'configurer'));
1959
-			$newmenu->add("/compta/bank/list.php?leftmenu=bank&amp;mainmenu=bank", $langs->trans("List"), 1, $user->hasRight('banque',  'lire'), '', $mainmenu, 'bank');
1960
-			$newmenu->add("/compta/bank/bankentries_list.php", $langs->trans("ListTransactions"), 1, $user->hasRight('banque',  'lire'));
1961
-			$newmenu->add("/compta/bank/budget.php", $langs->trans("ListTransactionsByCategory"), 1, $user->hasRight('banque',  'lire'));
1958
+			$newmenu->add("/compta/bank/card.php?action=create", $langs->trans("MenuNewFinancialAccount"), 1, $user->hasRight('banque', 'configurer'));
1959
+			$newmenu->add("/compta/bank/list.php?leftmenu=bank&amp;mainmenu=bank", $langs->trans("List"), 1, $user->hasRight('banque', 'lire'), '', $mainmenu, 'bank');
1960
+			$newmenu->add("/compta/bank/bankentries_list.php", $langs->trans("ListTransactions"), 1, $user->hasRight('banque', 'lire'));
1961
+			$newmenu->add("/compta/bank/budget.php", $langs->trans("ListTransactionsByCategory"), 1, $user->hasRight('banque', 'lire'));
1962 1962
 
1963
-			$newmenu->add("/compta/bank/transfer.php", $langs->trans("MenuBankInternalTransfer"), 1, $user->hasRight('banque',  'transfer'));
1963
+			$newmenu->add("/compta/bank/transfer.php", $langs->trans("MenuBankInternalTransfer"), 1, $user->hasRight('banque', 'transfer'));
1964 1964
 		}
1965 1965
 
1966 1966
 		if (isModEnabled('categorie')) {
1967 1967
 			$langs->load("categories");
1968
-			$newmenu->add("/categories/index.php?type=5", $langs->trans("Rubriques"), 1, $user->hasRight('categorie',  'creer'), '', $mainmenu, 'tags');
1969
-			$newmenu->add("/compta/bank/categ.php", $langs->trans("RubriquesTransactions"), 1, $user->hasRight('banque',  'configurer'), '', $mainmenu, 'tags');
1968
+			$newmenu->add("/categories/index.php?type=5", $langs->trans("Rubriques"), 1, $user->hasRight('categorie', 'creer'), '', $mainmenu, 'tags');
1969
+			$newmenu->add("/compta/bank/categ.php", $langs->trans("RubriquesTransactions"), 1, $user->hasRight('banque', 'configurer'), '', $mainmenu, 'tags');
1970 1970
 		}
1971 1971
 
1972 1972
 		// Direct debit order
1973 1973
 		if (isModEnabled('prelevement')) {
1974
-			$newmenu->add("/compta/prelevement/index.php?leftmenu=withdraw&amp;mainmenu=bank", $langs->trans("PaymentByDirectDebit"), 0, $user->hasRight('prelevement',  'bons', 'lire'), '', $mainmenu, 'withdraw', 0, '', '', '', img_picto('', 'payment', 'class="paddingright pictofixedwidth"'));
1974
+			$newmenu->add("/compta/prelevement/index.php?leftmenu=withdraw&amp;mainmenu=bank", $langs->trans("PaymentByDirectDebit"), 0, $user->hasRight('prelevement', 'bons', 'lire'), '', $mainmenu, 'withdraw', 0, '', '', '', img_picto('', 'payment', 'class="paddingright pictofixedwidth"'));
1975 1975
 
1976 1976
 			if ($usemenuhider || empty($leftmenu) || $leftmenu == "withdraw") {
1977
-				$newmenu->add("/compta/prelevement/create.php?mainmenu=bank", $langs->trans("NewStandingOrder"), 1, $user->hasRight('prelevement',  'bons', 'creer'));
1977
+				$newmenu->add("/compta/prelevement/create.php?mainmenu=bank", $langs->trans("NewStandingOrder"), 1, $user->hasRight('prelevement', 'bons', 'creer'));
1978 1978
 
1979
-				$newmenu->add("/compta/prelevement/orders_list.php?mainmenu=bank", $langs->trans("WithdrawalsReceipts"), 1, $user->hasRight('prelevement',  'bons', 'lire'));
1980
-				$newmenu->add("/compta/prelevement/list.php?mainmenu=bank", $langs->trans("WithdrawalsLines"), 1, $user->hasRight('prelevement',  'bons', 'lire'));
1981
-				$newmenu->add("/compta/prelevement/rejets.php?mainmenu=bank", $langs->trans("Rejects"), 1, $user->hasRight('prelevement',  'bons', 'lire'));
1982
-				$newmenu->add("/compta/prelevement/stats.php?mainmenu=bank", $langs->trans("Statistics"), 1, $user->hasRight('prelevement',  'bons', 'lire'));
1979
+				$newmenu->add("/compta/prelevement/orders_list.php?mainmenu=bank", $langs->trans("WithdrawalsReceipts"), 1, $user->hasRight('prelevement', 'bons', 'lire'));
1980
+				$newmenu->add("/compta/prelevement/list.php?mainmenu=bank", $langs->trans("WithdrawalsLines"), 1, $user->hasRight('prelevement', 'bons', 'lire'));
1981
+				$newmenu->add("/compta/prelevement/rejets.php?mainmenu=bank", $langs->trans("Rejects"), 1, $user->hasRight('prelevement', 'bons', 'lire'));
1982
+				$newmenu->add("/compta/prelevement/stats.php?mainmenu=bank", $langs->trans("Statistics"), 1, $user->hasRight('prelevement', 'bons', 'lire'));
1983 1983
 			}
1984 1984
 		}
1985 1985
 
1986 1986
 		// Bank transfer order
1987 1987
 		if (isModEnabled('paymentbybanktransfer')) {
1988
-			$newmenu->add("/compta/paymentbybanktransfer/index.php?leftmenu=banktransfer&amp;mainmenu=bank", $langs->trans("PaymentByBankTransfer"), 0, $user->hasRight('paymentbybanktransfer',  'read'), '', $mainmenu, 'banktransfer', 0, '', '', '', img_picto('', 'payment', 'class="paddingright pictofixedwidth"'));
1988
+			$newmenu->add("/compta/paymentbybanktransfer/index.php?leftmenu=banktransfer&amp;mainmenu=bank", $langs->trans("PaymentByBankTransfer"), 0, $user->hasRight('paymentbybanktransfer', 'read'), '', $mainmenu, 'banktransfer', 0, '', '', '', img_picto('', 'payment', 'class="paddingright pictofixedwidth"'));
1989 1989
 
1990 1990
 			if ($usemenuhider || empty($leftmenu) || $leftmenu == "banktransfer") {
1991
-				$newmenu->add("/compta/prelevement/create.php?type=bank-transfer&mainmenu=bank", $langs->trans("NewPaymentByBankTransfer"), 1, $user->hasRight('paymentbybanktransfer',  'create'));
1991
+				$newmenu->add("/compta/prelevement/create.php?type=bank-transfer&mainmenu=bank", $langs->trans("NewPaymentByBankTransfer"), 1, $user->hasRight('paymentbybanktransfer', 'create'));
1992 1992
 
1993
-				$newmenu->add("/compta/prelevement/orders_list.php?type=bank-transfer&mainmenu=bank", $langs->trans("PaymentByBankTransferReceipts"), 1, $user->hasRight('paymentbybanktransfer',  'read'));
1994
-				$newmenu->add("/compta/prelevement/list.php?type=bank-transfer&mainmenu=bank", $langs->trans("PaymentByBankTransferLines"), 1, $user->hasRight('paymentbybanktransfer',  'read'));
1995
-				$newmenu->add("/compta/prelevement/rejets.php?type=bank-transfer&mainmenu=bank", $langs->trans("Rejects"), 1, $user->hasRight('paymentbybanktransfer',  'read'));
1996
-				$newmenu->add("/compta/prelevement/stats.php?type=bank-transfer&mainmenu=bank", $langs->trans("Statistics"), 1, $user->hasRight('paymentbybanktransfer',  'read'));
1993
+				$newmenu->add("/compta/prelevement/orders_list.php?type=bank-transfer&mainmenu=bank", $langs->trans("PaymentByBankTransferReceipts"), 1, $user->hasRight('paymentbybanktransfer', 'read'));
1994
+				$newmenu->add("/compta/prelevement/list.php?type=bank-transfer&mainmenu=bank", $langs->trans("PaymentByBankTransferLines"), 1, $user->hasRight('paymentbybanktransfer', 'read'));
1995
+				$newmenu->add("/compta/prelevement/rejets.php?type=bank-transfer&mainmenu=bank", $langs->trans("Rejects"), 1, $user->hasRight('paymentbybanktransfer', 'read'));
1996
+				$newmenu->add("/compta/prelevement/stats.php?type=bank-transfer&mainmenu=bank", $langs->trans("Statistics"), 1, $user->hasRight('paymentbybanktransfer', 'read'));
1997 1997
 			}
1998 1998
 		}
1999 1999
 
2000 2000
 		// Management of checks
2001 2001
 		if (empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT) && isModEnabled('banque') && (isModEnabled('facture') || !empty($conf->global->MAIN_MENU_CHEQUE_DEPOSIT_ON))) {
2002
-			$newmenu->add("/compta/paiement/cheque/index.php?leftmenu=checks&amp;mainmenu=bank", $langs->trans("MenuChequeDeposits"), 0, $user->hasRight('banque',  'cheque'), '', $mainmenu, 'checks', 0, '', '', '', img_picto('', 'payment', 'class="paddingright pictofixedwidth"'));
2002
+			$newmenu->add("/compta/paiement/cheque/index.php?leftmenu=checks&amp;mainmenu=bank", $langs->trans("MenuChequeDeposits"), 0, $user->hasRight('banque', 'cheque'), '', $mainmenu, 'checks', 0, '', '', '', img_picto('', 'payment', 'class="paddingright pictofixedwidth"'));
2003 2003
 			if (preg_match('/checks/', $leftmenu)) {
2004
-				$newmenu->add("/compta/paiement/cheque/card.php?leftmenu=checks_bis&amp;action=new&amp;mainmenu=bank", $langs->trans("NewChequeDeposit"), 1, $user->hasRight('banque',  'cheque'));
2005
-				$newmenu->add("/compta/paiement/cheque/list.php?leftmenu=checks_bis&amp;mainmenu=bank", $langs->trans("List"), 1, $user->hasRight('banque',  'cheque'));
2004
+				$newmenu->add("/compta/paiement/cheque/card.php?leftmenu=checks_bis&amp;action=new&amp;mainmenu=bank", $langs->trans("NewChequeDeposit"), 1, $user->hasRight('banque', 'cheque'));
2005
+				$newmenu->add("/compta/paiement/cheque/list.php?leftmenu=checks_bis&amp;mainmenu=bank", $langs->trans("List"), 1, $user->hasRight('banque', 'cheque'));
2006 2006
 			}
2007 2007
 		}
2008 2008
 
2009 2009
 		// Cash Control
2010 2010
 		if (isModEnabled('takepos') || isModEnabled('cashdesk')) {
2011
-			$permtomakecashfence = ($user->hasRight('cashdesk', 'run')|| $user->hasRight('takepos', 'run'));
2011
+			$permtomakecashfence = ($user->hasRight('cashdesk', 'run') || $user->hasRight('takepos', 'run'));
2012 2012
 			$newmenu->add("/compta/cashcontrol/cashcontrol_list.php?action=list", $langs->trans("POS"), 0, $permtomakecashfence, '', $mainmenu, 'cashcontrol', 0, '', '', '', img_picto('', 'pos', 'class="pictofixedwidth"'));
2013 2013
 			$newmenu->add("/compta/cashcontrol/cashcontrol_card.php?action=create", $langs->trans("NewCashFence"), 1, $permtomakecashfence);
2014 2014
 			$newmenu->add("/compta/cashcontrol/cashcontrol_list.php?action=list", $langs->trans("List"), 1, $permtomakecashfence);
@@ -2033,44 +2033,44 @@  discard block
 block discarded – undo
2033 2033
 	if ($mainmenu == 'products') {
2034 2034
 		// Products
2035 2035
 		if (isModEnabled('product')) {
2036
-			$newmenu->add("/product/index.php?leftmenu=product&amp;type=0", $langs->trans("Products"), 0, $user->hasRight('product',  'read'), '', $mainmenu, 'product', 0, '', '', '', img_picto('', 'product', 'class="pictofixedwidth"'));
2037
-			$newmenu->add("/product/card.php?leftmenu=product&amp;action=create&amp;type=0", $langs->trans("NewProduct"), 1, $user->hasRight('product',  'creer'));
2038
-			$newmenu->add("/product/list.php?leftmenu=product&amp;type=0", $langs->trans("List"), 1, $user->hasRight('product',  'read'));
2036
+			$newmenu->add("/product/index.php?leftmenu=product&amp;type=0", $langs->trans("Products"), 0, $user->hasRight('product', 'read'), '', $mainmenu, 'product', 0, '', '', '', img_picto('', 'product', 'class="pictofixedwidth"'));
2037
+			$newmenu->add("/product/card.php?leftmenu=product&amp;action=create&amp;type=0", $langs->trans("NewProduct"), 1, $user->hasRight('product', 'creer'));
2038
+			$newmenu->add("/product/list.php?leftmenu=product&amp;type=0", $langs->trans("List"), 1, $user->hasRight('product', 'read'));
2039 2039
 			if (isModEnabled('stock')) {
2040
-				$newmenu->add("/product/reassort.php?type=0", $langs->trans("MenuStocks"), 1, $user->hasRight('product',  'read') && $user->hasRight('stock',  'lire'));
2040
+				$newmenu->add("/product/reassort.php?type=0", $langs->trans("MenuStocks"), 1, $user->hasRight('product', 'read') && $user->hasRight('stock', 'lire'));
2041 2041
 			}
2042 2042
 			if (isModEnabled('productbatch')) {
2043 2043
 				$langs->load("stocks");
2044
-				$newmenu->add("/product/reassortlot.php?type=0&search_subjecttolotserial=1", $langs->trans("StocksByLotSerial"), 1, $user->hasRight('product',  'read') && $user->hasRight('stock',  'lire'));
2045
-				$newmenu->add("/product/stock/productlot_list.php", $langs->trans("LotSerial"), 1, $user->hasRight('product',  'read') && $user->hasRight('stock',  'lire'));
2044
+				$newmenu->add("/product/reassortlot.php?type=0&search_subjecttolotserial=1", $langs->trans("StocksByLotSerial"), 1, $user->hasRight('product', 'read') && $user->hasRight('stock', 'lire'));
2045
+				$newmenu->add("/product/stock/productlot_list.php", $langs->trans("LotSerial"), 1, $user->hasRight('product', 'read') && $user->hasRight('stock', 'lire'));
2046 2046
 			}
2047 2047
 			if (isModEnabled('variants')) {
2048
-				$newmenu->add("/variants/list.php", $langs->trans("VariantAttributes"), 1, $user->hasRight('product',  'read'));
2048
+				$newmenu->add("/variants/list.php", $langs->trans("VariantAttributes"), 1, $user->hasRight('product', 'read'));
2049 2049
 			}
2050 2050
 			if (isModEnabled('propal') || isModEnabled('commande') || isModEnabled('facture') || isModEnabled('supplier_proposal') || isModEnabled('supplier_order') || isModEnabled('supplier_invoice')) {
2051
-				$newmenu->add("/product/stats/card.php?id=all&leftmenu=stats&type=0", $langs->trans("Statistics"), 1, $user->hasRight('product',  'read'));
2051
+				$newmenu->add("/product/stats/card.php?id=all&leftmenu=stats&type=0", $langs->trans("Statistics"), 1, $user->hasRight('product', 'read'));
2052 2052
 			}
2053 2053
 
2054 2054
 			// Categories
2055 2055
 			if (isModEnabled('categorie')) {
2056 2056
 				$langs->load("categories");
2057
-				$newmenu->add("/categories/index.php?leftmenu=cat&amp;type=0", $langs->trans("Categories"), 1, $user->hasRight('categorie',  'lire'), '', $mainmenu, 'cat');
2057
+				$newmenu->add("/categories/index.php?leftmenu=cat&amp;type=0", $langs->trans("Categories"), 1, $user->hasRight('categorie', 'lire'), '', $mainmenu, 'cat');
2058 2058
 				//if ($usemenuhider || empty($leftmenu) || $leftmenu=="cat") $newmenu->add("/categories/list.php", $langs->trans("List"), 1, $user->hasRight('categorie',  'lire'));
2059 2059
 			}
2060 2060
 		}
2061 2061
 
2062 2062
 		// Services
2063 2063
 		if (isModEnabled('service')) {
2064
-			$newmenu->add("/product/index.php?leftmenu=service&amp;type=1", $langs->trans("Services"), 0, $user->hasRight('service',  'read'), '', $mainmenu, 'service', 0, '', '', '', img_picto('', 'service', 'class="pictofixedwidth"'));
2065
-			$newmenu->add("/product/card.php?leftmenu=service&amp;action=create&amp;type=1", $langs->trans("NewService"), 1, $user->hasRight('service',  'creer'));
2066
-			$newmenu->add("/product/list.php?leftmenu=service&amp;type=1", $langs->trans("List"), 1, $user->hasRight('service',  'read'));
2064
+			$newmenu->add("/product/index.php?leftmenu=service&amp;type=1", $langs->trans("Services"), 0, $user->hasRight('service', 'read'), '', $mainmenu, 'service', 0, '', '', '', img_picto('', 'service', 'class="pictofixedwidth"'));
2065
+			$newmenu->add("/product/card.php?leftmenu=service&amp;action=create&amp;type=1", $langs->trans("NewService"), 1, $user->hasRight('service', 'creer'));
2066
+			$newmenu->add("/product/list.php?leftmenu=service&amp;type=1", $langs->trans("List"), 1, $user->hasRight('service', 'read'));
2067 2067
 			if (isModEnabled('propal') || isModEnabled('commande') || isModEnabled('facture') || isModEnabled('supplier_proposal') || isModEnabled('supplier_order') || isModEnabled('supplier_invoice')) {
2068
-				$newmenu->add("/product/stats/card.php?id=all&leftmenu=stats&type=1", $langs->trans("Statistics"), 1, $user->hasRight('service',  'read'));
2068
+				$newmenu->add("/product/stats/card.php?id=all&leftmenu=stats&type=1", $langs->trans("Statistics"), 1, $user->hasRight('service', 'read'));
2069 2069
 			}
2070 2070
 			// Categories
2071 2071
 			if (isModEnabled('categorie')) {
2072 2072
 				$langs->load("categories");
2073
-				$newmenu->add("/categories/index.php?leftmenu=cat&amp;type=0", $langs->trans("Categories"), 1, $user->hasRight('categorie',  'lire'), '', $mainmenu, 'cat');
2073
+				$newmenu->add("/categories/index.php?leftmenu=cat&amp;type=0", $langs->trans("Categories"), 1, $user->hasRight('categorie', 'lire'), '', $mainmenu, 'cat');
2074 2074
 				//if ($usemenuhider || empty($leftmenu) || $leftmenu=="cat") $newmenu->add("/categories/list.php", $langs->trans("List"), 1, $user->hasRight('categorie',  'lire'));
2075 2075
 			}
2076 2076
 		}
@@ -2080,41 +2080,41 @@  discard block
 block discarded – undo
2080 2080
 			$langs->load("stocks");
2081 2081
 			$newmenu->add("/product/stock/index.php?leftmenu=stock", $langs->trans("Warehouses"), 0, $user->hasRight('stock', 'lire'), '', $mainmenu, 'stock', 0, '', '', '', img_picto('', 'stock', 'class="pictofixedwidth"'));
2082 2082
 			$newmenu->add("/product/stock/card.php?action=create", $langs->trans("MenuNewWarehouse"), 1, $user->hasRight('stock', 'creer'));
2083
-			$newmenu->add("/product/stock/list.php", $langs->trans("List"), 1, $user->hasRight('stock',  'lire'));
2083
+			$newmenu->add("/product/stock/list.php", $langs->trans("List"), 1, $user->hasRight('stock', 'lire'));
2084 2084
 			$newmenu->add("/product/stock/movement_list.php", $langs->trans("Movements"), 1, $user->hasRight('stock', 'mouvement', 'lire'));
2085 2085
 
2086 2086
 			$newmenu->add("/product/stock/massstockmove.php?init=1", $langs->trans("MassStockTransferShort"), 1, $user->hasRight('stock', 'mouvement', 'creer'));
2087 2087
 			if (isModEnabled('supplier_order')) {
2088
-				$newmenu->add("/product/stock/replenish.php", $langs->trans("Replenishment"), 1, $user->hasRight('stock', 'mouvement', 'creer') && $user->hasRight('fournisseur',  'lire'));
2088
+				$newmenu->add("/product/stock/replenish.php", $langs->trans("Replenishment"), 1, $user->hasRight('stock', 'mouvement', 'creer') && $user->hasRight('fournisseur', 'lire'));
2089 2089
 			}
2090 2090
 			$newmenu->add("/product/stock/stockatdate.php", $langs->trans("StockAtDate"), 1, $user->hasRight('product', 'read') && $user->hasRight('stock', 'lire'));
2091 2091
 
2092 2092
 			// Categories for warehouses
2093 2093
 			if (isModEnabled('categorie')) {
2094
-				$newmenu->add("/categories/index.php?leftmenu=stock&amp;type=9", $langs->trans("Categories"), 1, $user->hasRight('categorie',  'lire'), '', $mainmenu, 'cat');
2094
+				$newmenu->add("/categories/index.php?leftmenu=stock&amp;type=9", $langs->trans("Categories"), 1, $user->hasRight('categorie', 'lire'), '', $mainmenu, 'cat');
2095 2095
 			}
2096 2096
 		}
2097 2097
 
2098 2098
 		if (isModEnabled('stocktransfer')) {
2099
-			$newmenu->add('/product/stock/stocktransfer/stocktransfer_list.php', $langs->trans("ModuleStockTransferName"), 0, $user->hasRight('stocktransfer',  'stocktransfer', 'read'), '', $mainmenu, 'stocktransfer', 0, '', '', '', img_picto('', 'stock', 'class="pictofixedwidth"'));
2100
-			$newmenu->add('/product/stock/stocktransfer/stocktransfer_card.php?action=create', $langs->trans('StockTransferNew'), 1, $user->hasRight('stocktransfer',  'stocktransfer', 'write'));
2101
-			$newmenu->add('/product/stock/stocktransfer/stocktransfer_list.php', $langs->trans('List'), 1, $user->hasRight('stocktransfer',  'stocktransfer', 'read'));
2099
+			$newmenu->add('/product/stock/stocktransfer/stocktransfer_list.php', $langs->trans("ModuleStockTransferName"), 0, $user->hasRight('stocktransfer', 'stocktransfer', 'read'), '', $mainmenu, 'stocktransfer', 0, '', '', '', img_picto('', 'stock', 'class="pictofixedwidth"'));
2100
+			$newmenu->add('/product/stock/stocktransfer/stocktransfer_card.php?action=create', $langs->trans('StockTransferNew'), 1, $user->hasRight('stocktransfer', 'stocktransfer', 'write'));
2101
+			$newmenu->add('/product/stock/stocktransfer/stocktransfer_list.php', $langs->trans('List'), 1, $user->hasRight('stocktransfer', 'stocktransfer', 'read'));
2102 2102
 		}
2103 2103
 
2104 2104
 		// Inventory
2105 2105
 		if (isModEnabled('stock')) {
2106 2106
 			$langs->load("stocks");
2107 2107
 			if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) {
2108
-				$newmenu->add("/product/inventory/list.php?leftmenu=stock_inventories", $langs->trans("Inventories"), 0, $user->hasRight('stock',  'lire'), '', $mainmenu, 'stock', 0, '', '', '', img_picto('', 'inventory', 'class="pictofixedwidth"'));
2108
+				$newmenu->add("/product/inventory/list.php?leftmenu=stock_inventories", $langs->trans("Inventories"), 0, $user->hasRight('stock', 'lire'), '', $mainmenu, 'stock', 0, '', '', '', img_picto('', 'inventory', 'class="pictofixedwidth"'));
2109 2109
 				if ($usemenuhider || empty($leftmenu) || $leftmenu == "stock_inventories") {
2110
-					$newmenu->add("/product/inventory/card.php?action=create&leftmenu=stock_inventories", $langs->trans("NewInventory"), 1, $user->hasRight('stock',  'creer'));
2111
-					$newmenu->add("/product/inventory/list.php?leftmenu=stock_inventories", $langs->trans("List"), 1, $user->hasRight('stock',  'lire'));
2110
+					$newmenu->add("/product/inventory/card.php?action=create&leftmenu=stock_inventories", $langs->trans("NewInventory"), 1, $user->hasRight('stock', 'creer'));
2111
+					$newmenu->add("/product/inventory/list.php?leftmenu=stock_inventories", $langs->trans("List"), 1, $user->hasRight('stock', 'lire'));
2112 2112
 				}
2113 2113
 			} else {
2114
-				$newmenu->add("/product/inventory/list.php?leftmenu=stock_inventories", $langs->trans("Inventories"), 0, $user->hasRight('stock',  'inventory_advance', 'read'), '', $mainmenu, 'stock', 0, '', '', '', img_picto('', 'inventory', 'class="pictofixedwidth"'));
2114
+				$newmenu->add("/product/inventory/list.php?leftmenu=stock_inventories", $langs->trans("Inventories"), 0, $user->hasRight('stock', 'inventory_advance', 'read'), '', $mainmenu, 'stock', 0, '', '', '', img_picto('', 'inventory', 'class="pictofixedwidth"'));
2115 2115
 				if ($usemenuhider || empty($leftmenu) || $leftmenu == "stock_inventories") {
2116
-					$newmenu->add("/product/inventory/card.php?action=create&leftmenu=stock_inventories", $langs->trans("NewInventory"), 1, $user->hasRight('stock',  'inventory_advance', 'write'));
2117
-					$newmenu->add("/product/inventory/list.php?leftmenu=stock_inventories", $langs->trans("List"), 1, $user->hasRight('stock',  'inventory_advance', 'read'));
2116
+					$newmenu->add("/product/inventory/card.php?action=create&leftmenu=stock_inventories", $langs->trans("NewInventory"), 1, $user->hasRight('stock', 'inventory_advance', 'write'));
2117
+					$newmenu->add("/product/inventory/list.php?leftmenu=stock_inventories", $langs->trans("List"), 1, $user->hasRight('stock', 'inventory_advance', 'read'));
2118 2118
 				}
2119 2119
 			}
2120 2120
 		}
@@ -2122,33 +2122,33 @@  discard block
 block discarded – undo
2122 2122
 		// Shipments
2123 2123
 		if (isModEnabled('expedition')) {
2124 2124
 			$langs->load("sendings");
2125
-			$newmenu->add("/expedition/index.php?leftmenu=sendings", $langs->trans("Shipments"), 0, $user->hasRight('expedition',  'lire'), '', $mainmenu, 'sendings', 0, '', '', '', img_picto('', 'shipment', 'class="pictofixedwidth"'));
2126
-			$newmenu->add("/expedition/card.php?action=create2&amp;leftmenu=sendings", $langs->trans("NewSending"), 1, $user->hasRight('expedition',  'creer'));
2127
-			$newmenu->add("/expedition/list.php?leftmenu=sendings", $langs->trans("List"), 1, $user->hasRight('expedition',  'lire'));
2125
+			$newmenu->add("/expedition/index.php?leftmenu=sendings", $langs->trans("Shipments"), 0, $user->hasRight('expedition', 'lire'), '', $mainmenu, 'sendings', 0, '', '', '', img_picto('', 'shipment', 'class="pictofixedwidth"'));
2126
+			$newmenu->add("/expedition/card.php?action=create2&amp;leftmenu=sendings", $langs->trans("NewSending"), 1, $user->hasRight('expedition', 'creer'));
2127
+			$newmenu->add("/expedition/list.php?leftmenu=sendings", $langs->trans("List"), 1, $user->hasRight('expedition', 'lire'));
2128 2128
 			if ($usemenuhider || empty($leftmenu) || $leftmenu == "sendings") {
2129
-				$newmenu->add("/expedition/list.php?leftmenu=sendings&search_status=0", $langs->trans("StatusSendingDraftShort"), 2, $user->hasRight('expedition',  'lire'));
2130
-				$newmenu->add("/expedition/list.php?leftmenu=sendings&search_status=1", $langs->trans("StatusSendingValidatedShort"), 2, $user->hasRight('expedition',  'lire'));
2131
-				$newmenu->add("/expedition/list.php?leftmenu=sendings&search_status=2", $langs->trans("StatusSendingProcessedShort"), 2, $user->hasRight('expedition',  'lire'));
2129
+				$newmenu->add("/expedition/list.php?leftmenu=sendings&search_status=0", $langs->trans("StatusSendingDraftShort"), 2, $user->hasRight('expedition', 'lire'));
2130
+				$newmenu->add("/expedition/list.php?leftmenu=sendings&search_status=1", $langs->trans("StatusSendingValidatedShort"), 2, $user->hasRight('expedition', 'lire'));
2131
+				$newmenu->add("/expedition/list.php?leftmenu=sendings&search_status=2", $langs->trans("StatusSendingProcessedShort"), 2, $user->hasRight('expedition', 'lire'));
2132 2132
 			}
2133
-			$newmenu->add("/expedition/stats/index.php?leftmenu=sendings", $langs->trans("Statistics"), 1, $user->hasRight('expedition',  'lire'));
2133
+			$newmenu->add("/expedition/stats/index.php?leftmenu=sendings", $langs->trans("Statistics"), 1, $user->hasRight('expedition', 'lire'));
2134 2134
 		}
2135 2135
 
2136 2136
 		// Receptions
2137 2137
 		if (isModEnabled('reception')) {
2138 2138
 			$langs->load("receptions");
2139
-			$newmenu->add("/reception/index.php?leftmenu=receptions", $langs->trans("Receptions"), 0, $user->hasRight('reception',  'lire'), '', $mainmenu, 'receptions', 0, '', '', '', img_picto('', 'dollyrevert', 'class="pictofixedwidth"'));
2140
-			$newmenu->add("/reception/card.php?action=create2&amp;leftmenu=receptions", $langs->trans("NewReception"), 1, $user->hasRight('reception',  'creer'));
2141
-			$newmenu->add("/reception/list.php?leftmenu=receptions", $langs->trans("List"), 1, $user->hasRight('reception',  'lire'));
2139
+			$newmenu->add("/reception/index.php?leftmenu=receptions", $langs->trans("Receptions"), 0, $user->hasRight('reception', 'lire'), '', $mainmenu, 'receptions', 0, '', '', '', img_picto('', 'dollyrevert', 'class="pictofixedwidth"'));
2140
+			$newmenu->add("/reception/card.php?action=create2&amp;leftmenu=receptions", $langs->trans("NewReception"), 1, $user->hasRight('reception', 'creer'));
2141
+			$newmenu->add("/reception/list.php?leftmenu=receptions", $langs->trans("List"), 1, $user->hasRight('reception', 'lire'));
2142 2142
 			if ($usemenuhider || empty($leftmenu) || $leftmenu == "receptions") {
2143
-				$newmenu->add("/reception/list.php?leftmenu=receptions&search_status=0", $langs->trans("StatusReceptionDraftShort"), 2, $user->hasRight('reception',  'lire'));
2143
+				$newmenu->add("/reception/list.php?leftmenu=receptions&search_status=0", $langs->trans("StatusReceptionDraftShort"), 2, $user->hasRight('reception', 'lire'));
2144 2144
 			}
2145 2145
 			if ($usemenuhider || empty($leftmenu) || $leftmenu == "receptions") {
2146
-				$newmenu->add("/reception/list.php?leftmenu=receptions&search_status=1", $langs->trans("StatusReceptionValidatedShort"), 2, $user->hasRight('reception',  'lire'));
2146
+				$newmenu->add("/reception/list.php?leftmenu=receptions&search_status=1", $langs->trans("StatusReceptionValidatedShort"), 2, $user->hasRight('reception', 'lire'));
2147 2147
 			}
2148 2148
 			if ($usemenuhider || empty($leftmenu) || $leftmenu == "receptions") {
2149
-				$newmenu->add("/reception/list.php?leftmenu=receptions&search_status=2", $langs->trans("StatusReceptionProcessedShort"), 2, $user->hasRight('reception',  'lire'));
2149
+				$newmenu->add("/reception/list.php?leftmenu=receptions&search_status=2", $langs->trans("StatusReceptionProcessedShort"), 2, $user->hasRight('reception', 'lire'));
2150 2150
 			}
2151
-			$newmenu->add("/reception/stats/index.php?leftmenu=receptions", $langs->trans("Statistics"), 1, $user->hasRight('reception',  'lire'));
2151
+			$newmenu->add("/reception/stats/index.php?leftmenu=receptions", $langs->trans("Statistics"), 1, $user->hasRight('reception', 'lire'));
2152 2152
 		}
2153 2153
 	}
2154 2154
 }
@@ -2172,17 +2172,17 @@  discard block
 block discarded – undo
2172 2172
 		if (isModEnabled('bom') || isModEnabled('mrp')) {
2173 2173
 			$langs->load("mrp");
2174 2174
 
2175
-			$newmenu->add("", $langs->trans("MenuBOM"), 0, $user->hasRight('bom',  'read'), '', $mainmenu, 'bom', 0, '', '', '', img_picto('', 'bom', 'class="paddingright pictofixedwidth"'));
2176
-			$newmenu->add("/bom/bom_card.php?leftmenu=bom&amp;action=create", $langs->trans("NewBOM"), 1, $user->hasRight('bom',  'write'), '', $mainmenu, 'bom');
2177
-			$newmenu->add("/bom/bom_list.php?leftmenu=bom", $langs->trans("List"), 1, $user->hasRight('bom',  'read'), '', $mainmenu, 'bom');
2175
+			$newmenu->add("", $langs->trans("MenuBOM"), 0, $user->hasRight('bom', 'read'), '', $mainmenu, 'bom', 0, '', '', '', img_picto('', 'bom', 'class="paddingright pictofixedwidth"'));
2176
+			$newmenu->add("/bom/bom_card.php?leftmenu=bom&amp;action=create", $langs->trans("NewBOM"), 1, $user->hasRight('bom', 'write'), '', $mainmenu, 'bom');
2177
+			$newmenu->add("/bom/bom_list.php?leftmenu=bom", $langs->trans("List"), 1, $user->hasRight('bom', 'read'), '', $mainmenu, 'bom');
2178 2178
 		}
2179 2179
 
2180 2180
 		if (isModEnabled('mrp')) {
2181 2181
 			$langs->load("mrp");
2182 2182
 
2183
-			$newmenu->add("", $langs->trans("MenuMRP"), 0, $user->hasRight('mrp',  'read'), '', $mainmenu, 'mrp', 0, '', '', '', img_picto('', 'mrp', 'class="paddingright pictofixedwidth"'));
2184
-			$newmenu->add("/mrp/mo_card.php?leftmenu=mo&amp;action=create", $langs->trans("NewMO"), 1, $user->hasRight('mrp',  'write'), '', $mainmenu, '');
2185
-			$newmenu->add("/mrp/mo_list.php?leftmenu=mo", $langs->trans("List"), 1, $user->hasRight('mrp',  'read'), '', $mainmenu, '');
2183
+			$newmenu->add("", $langs->trans("MenuMRP"), 0, $user->hasRight('mrp', 'read'), '', $mainmenu, 'mrp', 0, '', '', '', img_picto('', 'mrp', 'class="paddingright pictofixedwidth"'));
2184
+			$newmenu->add("/mrp/mo_card.php?leftmenu=mo&amp;action=create", $langs->trans("NewMO"), 1, $user->hasRight('mrp', 'write'), '', $mainmenu, '');
2185
+			$newmenu->add("/mrp/mo_list.php?leftmenu=mo", $langs->trans("List"), 1, $user->hasRight('mrp', 'read'), '', $mainmenu, '');
2186 2186
 		}
2187 2187
 	}
2188 2188
 }
@@ -2209,7 +2209,7 @@  discard block
 block discarded – undo
2209 2209
 
2210 2210
 			$tmpentry = array(
2211 2211
 				'enabled'=>isModEnabled('projet'),
2212
-				'perms'=>$user->hasRight('projet',  'lire'),
2212
+				'perms'=>$user->hasRight('projet', 'lire'),
2213 2213
 				'module'=>'projet'
2214 2214
 			);
2215 2215
 			$listofmodulesforexternal = explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL);
@@ -2227,8 +2227,8 @@  discard block
 block discarded – undo
2227 2227
 			}
2228 2228
 
2229 2229
 			// Project assigned to user
2230
-			$newmenu->add("/projet/index.php?leftmenu=projects".($search_project_user ? '&search_project_user='.$search_project_user : ''), $titleboth, 0, $user->hasRight('projet',  'lire'), '', $mainmenu, 'projects', 0, '', '', '', img_picto('', 'project', 'class="paddingright pictofixedwidth"'));
2231
-			$newmenu->add("/projet/card.php?leftmenu=projects&action=create".($search_project_user ? '&search_project_user='.$search_project_user : ''), $titlenew, 1, $user->hasRight('projet',  'creer'));
2230
+			$newmenu->add("/projet/index.php?leftmenu=projects".($search_project_user ? '&search_project_user='.$search_project_user : ''), $titleboth, 0, $user->hasRight('projet', 'lire'), '', $mainmenu, 'projects', 0, '', '', '', img_picto('', 'project', 'class="paddingright pictofixedwidth"'));
2231
+			$newmenu->add("/projet/card.php?leftmenu=projects&action=create".($search_project_user ? '&search_project_user='.$search_project_user : ''), $titlenew, 1, $user->hasRight('projet', 'creer'));
2232 2232
 
2233 2233
 			if (empty($conf->global->PROJECT_USE_OPPORTUNITIES)) {
2234 2234
 				$newmenu->add("/projet/list.php?leftmenu=projets".($search_project_user ? '&search_project_user='.$search_project_user : '').'&search_status=99', $langs->trans("List"), 1, $showmode, '', 'project', 'list');
@@ -2240,23 +2240,23 @@  discard block
 block discarded – undo
2240 2240
 				$newmenu->add('/projet/list.php?mainmenu=project&amp;leftmenu=list&search_usage_opportunity=1&search_status=99', $langs->trans("List"), 2, $showmode);
2241 2241
 			}
2242 2242
 
2243
-			$newmenu->add("/projet/stats/index.php?leftmenu=projects", $langs->trans("Statistics"), 1, $user->hasRight('projet',  'lire'));
2243
+			$newmenu->add("/projet/stats/index.php?leftmenu=projects", $langs->trans("Statistics"), 1, $user->hasRight('projet', 'lire'));
2244 2244
 
2245 2245
 			// Categories
2246 2246
 			if (isModEnabled('categorie')) {
2247 2247
 				$langs->load("categories");
2248
-				$newmenu->add("/categories/index.php?leftmenu=cat&amp;type=6", $langs->trans("Categories"), 1, $user->hasRight('categorie',  'lire'), '', $mainmenu, 'cat');
2248
+				$newmenu->add("/categories/index.php?leftmenu=cat&amp;type=6", $langs->trans("Categories"), 1, $user->hasRight('categorie', 'lire'), '', $mainmenu, 'cat');
2249 2249
 			}
2250 2250
 
2251 2251
 			if (empty($conf->global->PROJECT_HIDE_TASKS)) {
2252 2252
 				// Project affected to user
2253
-				$newmenu->add("/projet/activity/index.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("Activities"), 0, $user->hasRight('projet',  'lire'), '', 'project', 'tasks', 0, '', '', '', img_picto('', 'projecttask', 'class="paddingright pictofixedwidth"'));
2254
-				$newmenu->add("/projet/tasks.php?leftmenu=tasks&action=create", $langs->trans("NewTask"), 1, $user->hasRight('projet',  'creer'));
2255
-				$newmenu->add("/projet/tasks/list.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("List"), 1, $user->hasRight('projet',  'lire'));
2256
-				$newmenu->add("/projet/tasks/stats/index.php?leftmenu=projects", $langs->trans("Statistics"), 1, $user->hasRight('projet',  'lire'));
2253
+				$newmenu->add("/projet/activity/index.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("Activities"), 0, $user->hasRight('projet', 'lire'), '', 'project', 'tasks', 0, '', '', '', img_picto('', 'projecttask', 'class="paddingright pictofixedwidth"'));
2254
+				$newmenu->add("/projet/tasks.php?leftmenu=tasks&action=create", $langs->trans("NewTask"), 1, $user->hasRight('projet', 'creer'));
2255
+				$newmenu->add("/projet/tasks/list.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("List"), 1, $user->hasRight('projet', 'lire'));
2256
+				$newmenu->add("/projet/tasks/stats/index.php?leftmenu=projects", $langs->trans("Statistics"), 1, $user->hasRight('projet', 'lire'));
2257 2257
 
2258
-				$newmenu->add("/projet/activity/perweek.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("NewTimeSpent"), 0, $user->hasRight('projet',  'lire'), '', 'project', 'timespent', 0, '', '', '', img_picto('', 'timespent', 'class="paddingright pictofixedwidth"'));
2259
-				$newmenu->add("/projet/tasks/time.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("List"), 1, $user->hasRight('projet',  'lire'));
2258
+				$newmenu->add("/projet/activity/perweek.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("NewTimeSpent"), 0, $user->hasRight('projet', 'lire'), '', 'project', 'timespent', 0, '', '', '', img_picto('', 'timespent', 'class="paddingright pictofixedwidth"'));
2259
+				$newmenu->add("/projet/tasks/time.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("List"), 1, $user->hasRight('projet', 'lire'));
2260 2260
 			}
2261 2261
 		}
2262 2262
 	}
@@ -2314,47 +2314,47 @@  discard block
 block discarded – undo
2314 2314
 			// Load translation files required by the page
2315 2315
 			$langs->loadLangs(array("holiday", "trips"));
2316 2316
 
2317
-			$newmenu->add("/holiday/list.php?mainmenu=hrm&leftmenu=holiday", $langs->trans("CPTitreMenu"), 0, $user->hasRight('holiday',  'read'), '', $mainmenu, 'holiday', 0, '', '', '', img_picto('', 'holiday', 'class="paddingright pictofixedwidth"'));
2318
-			$newmenu->add("/holiday/card.php?mainmenu=hrm&leftmenu=holiday&action=create", $langs->trans("New"), 1, $user->hasRight('holiday',  'write'), '', $mainmenu);
2319
-			$newmenu->add("/holiday/card_group.php?mainmenu=hrm&leftmenu=holiday&action=create", $langs->trans("NewHolidayForGroup"), 1, ($user->hasRight('holiday',  'writeall') && $user->hasRight('holiday',  'readall')), '', $mainmenu, 'holiday_sm');
2320
-			$newmenu->add("/holiday/list.php?mainmenu=hrm&leftmenu=holiday", $langs->trans("List"), 1, $user->hasRight('holiday',  'read'), '', $mainmenu);
2317
+			$newmenu->add("/holiday/list.php?mainmenu=hrm&leftmenu=holiday", $langs->trans("CPTitreMenu"), 0, $user->hasRight('holiday', 'read'), '', $mainmenu, 'holiday', 0, '', '', '', img_picto('', 'holiday', 'class="paddingright pictofixedwidth"'));
2318
+			$newmenu->add("/holiday/card.php?mainmenu=hrm&leftmenu=holiday&action=create", $langs->trans("New"), 1, $user->hasRight('holiday', 'write'), '', $mainmenu);
2319
+			$newmenu->add("/holiday/card_group.php?mainmenu=hrm&leftmenu=holiday&action=create", $langs->trans("NewHolidayForGroup"), 1, ($user->hasRight('holiday', 'writeall') && $user->hasRight('holiday', 'readall')), '', $mainmenu, 'holiday_sm');
2320
+			$newmenu->add("/holiday/list.php?mainmenu=hrm&leftmenu=holiday", $langs->trans("List"), 1, $user->hasRight('holiday', 'read'), '', $mainmenu);
2321 2321
 			if ($usemenuhider || empty($leftmenu) || $leftmenu == "holiday") {
2322
-				$newmenu->add("/holiday/list.php?search_status=1&mainmenu=hrm&leftmenu=holiday", $langs->trans("DraftCP"), 2, $user->hasRight('holiday',  'read'), '', $mainmenu, 'holiday_sm');
2323
-				$newmenu->add("/holiday/list.php?search_status=2&mainmenu=hrm&leftmenu=holiday", $langs->trans("ToReviewCP"), 2, $user->hasRight('holiday',  'read'), '', $mainmenu, 'holiday_sm');
2324
-				$newmenu->add("/holiday/list.php?search_status=3&mainmenu=hrm&leftmenu=holiday", $langs->trans("ApprovedCP"), 2, $user->hasRight('holiday',  'read'), '', $mainmenu, 'holiday_sm');
2325
-				$newmenu->add("/holiday/list.php?search_status=4&mainmenu=hrm&leftmenu=holiday", $langs->trans("CancelCP"), 2, $user->hasRight('holiday',  'read'), '', $mainmenu, 'holiday_sm');
2326
-				$newmenu->add("/holiday/list.php?search_status=5&mainmenu=hrm&leftmenu=holiday", $langs->trans("RefuseCP"), 2, $user->hasRight('holiday',  'read'), '', $mainmenu, 'holiday_sm');
2322
+				$newmenu->add("/holiday/list.php?search_status=1&mainmenu=hrm&leftmenu=holiday", $langs->trans("DraftCP"), 2, $user->hasRight('holiday', 'read'), '', $mainmenu, 'holiday_sm');
2323
+				$newmenu->add("/holiday/list.php?search_status=2&mainmenu=hrm&leftmenu=holiday", $langs->trans("ToReviewCP"), 2, $user->hasRight('holiday', 'read'), '', $mainmenu, 'holiday_sm');
2324
+				$newmenu->add("/holiday/list.php?search_status=3&mainmenu=hrm&leftmenu=holiday", $langs->trans("ApprovedCP"), 2, $user->hasRight('holiday', 'read'), '', $mainmenu, 'holiday_sm');
2325
+				$newmenu->add("/holiday/list.php?search_status=4&mainmenu=hrm&leftmenu=holiday", $langs->trans("CancelCP"), 2, $user->hasRight('holiday', 'read'), '', $mainmenu, 'holiday_sm');
2326
+				$newmenu->add("/holiday/list.php?search_status=5&mainmenu=hrm&leftmenu=holiday", $langs->trans("RefuseCP"), 2, $user->hasRight('holiday', 'read'), '', $mainmenu, 'holiday_sm');
2327 2327
 			}
2328
-			$newmenu->add("/holiday/define_holiday.php?mainmenu=hrm", $langs->trans("MenuConfCP"), 1, $user->hasRight('holiday',  'read'), '', $mainmenu, 'holiday_sm');
2329
-			$newmenu->add("/holiday/month_report.php?mainmenu=hrm&leftmenu=holiday", $langs->trans("MenuReportMonth"), 1, $user->hasRight('holiday',  'readall'), '', $mainmenu, 'holiday_sm');
2330
-			$newmenu->add("/holiday/view_log.php?mainmenu=hrm&leftmenu=holiday", $langs->trans("MenuLogCP"), 1, $user->hasRight('holiday',  'define_holiday'), '', $mainmenu, 'holiday_sm');
2328
+			$newmenu->add("/holiday/define_holiday.php?mainmenu=hrm", $langs->trans("MenuConfCP"), 1, $user->hasRight('holiday', 'read'), '', $mainmenu, 'holiday_sm');
2329
+			$newmenu->add("/holiday/month_report.php?mainmenu=hrm&leftmenu=holiday", $langs->trans("MenuReportMonth"), 1, $user->hasRight('holiday', 'readall'), '', $mainmenu, 'holiday_sm');
2330
+			$newmenu->add("/holiday/view_log.php?mainmenu=hrm&leftmenu=holiday", $langs->trans("MenuLogCP"), 1, $user->hasRight('holiday', 'define_holiday'), '', $mainmenu, 'holiday_sm');
2331 2331
 		}
2332 2332
 
2333 2333
 		// Trips and expenses (old module)
2334 2334
 		if (isModEnabled('deplacement')) {
2335 2335
 			$langs->load("trips");
2336
-			$newmenu->add("/compta/deplacement/index.php?leftmenu=tripsandexpenses&amp;mainmenu=hrm", $langs->trans("TripsAndExpenses"), 0, $user->hasRight('deplacement',  'lire'), '', $mainmenu, 'tripsandexpenses', 0, '', '', '', img_picto('', 'trip', 'class="paddingright pictofixedwidth"'));
2337
-			$newmenu->add("/compta/deplacement/card.php?action=create&amp;leftmenu=tripsandexpenses&amp;mainmenu=hrm", $langs->trans("New"), 1, $user->hasRight('deplacement',  'creer'));
2338
-			$newmenu->add("/compta/deplacement/list.php?leftmenu=tripsandexpenses&amp;mainmenu=hrm", $langs->trans("List"), 1, $user->hasRight('deplacement',  'lire'));
2339
-			$newmenu->add("/compta/deplacement/stats/index.php?leftmenu=tripsandexpenses&amp;mainmenu=hrm", $langs->trans("Statistics"), 1, $user->hasRight('deplacement',  'lire'));
2336
+			$newmenu->add("/compta/deplacement/index.php?leftmenu=tripsandexpenses&amp;mainmenu=hrm", $langs->trans("TripsAndExpenses"), 0, $user->hasRight('deplacement', 'lire'), '', $mainmenu, 'tripsandexpenses', 0, '', '', '', img_picto('', 'trip', 'class="paddingright pictofixedwidth"'));
2337
+			$newmenu->add("/compta/deplacement/card.php?action=create&amp;leftmenu=tripsandexpenses&amp;mainmenu=hrm", $langs->trans("New"), 1, $user->hasRight('deplacement', 'creer'));
2338
+			$newmenu->add("/compta/deplacement/list.php?leftmenu=tripsandexpenses&amp;mainmenu=hrm", $langs->trans("List"), 1, $user->hasRight('deplacement', 'lire'));
2339
+			$newmenu->add("/compta/deplacement/stats/index.php?leftmenu=tripsandexpenses&amp;mainmenu=hrm", $langs->trans("Statistics"), 1, $user->hasRight('deplacement', 'lire'));
2340 2340
 		}
2341 2341
 
2342 2342
 		// Expense report
2343 2343
 		if (isModEnabled('expensereport')) {
2344 2344
 			$langs->loadLangs(array("trips", "bills"));
2345
-			$newmenu->add("/expensereport/index.php?leftmenu=expensereport&amp;mainmenu=hrm", $langs->trans("TripsAndExpenses"), 0, $user->hasRight('expensereport',  'lire'), '', $mainmenu, 'expensereport', 0, '', '', '', img_picto('', 'trip', 'class="paddingright pictofixedwidth"'));
2346
-			$newmenu->add("/expensereport/card.php?action=create&amp;leftmenu=expensereport&amp;mainmenu=hrm", $langs->trans("New"), 1, $user->hasRight('expensereport',  'creer'));
2347
-			$newmenu->add("/expensereport/list.php?leftmenu=expensereport&amp;mainmenu=hrm", $langs->trans("List"), 1, $user->hasRight('expensereport',  'lire'));
2345
+			$newmenu->add("/expensereport/index.php?leftmenu=expensereport&amp;mainmenu=hrm", $langs->trans("TripsAndExpenses"), 0, $user->hasRight('expensereport', 'lire'), '', $mainmenu, 'expensereport', 0, '', '', '', img_picto('', 'trip', 'class="paddingright pictofixedwidth"'));
2346
+			$newmenu->add("/expensereport/card.php?action=create&amp;leftmenu=expensereport&amp;mainmenu=hrm", $langs->trans("New"), 1, $user->hasRight('expensereport', 'creer'));
2347
+			$newmenu->add("/expensereport/list.php?leftmenu=expensereport&amp;mainmenu=hrm", $langs->trans("List"), 1, $user->hasRight('expensereport', 'lire'));
2348 2348
 			if ($usemenuhider || empty($leftmenu) || $leftmenu == "expensereport") {
2349
-				$newmenu->add("/expensereport/list.php?search_status=0&amp;leftmenu=expensereport&amp;mainmenu=hrm", $langs->trans("Draft"), 2, $user->hasRight('expensereport',  'lire'));
2350
-				$newmenu->add("/expensereport/list.php?search_status=2&amp;leftmenu=expensereport&amp;mainmenu=hrm", $langs->trans("Validated"), 2, $user->hasRight('expensereport',  'lire'));
2351
-				$newmenu->add("/expensereport/list.php?search_status=5&amp;leftmenu=expensereport&amp;mainmenu=hrm", $langs->trans("Approved"), 2, $user->hasRight('expensereport',  'lire'));
2352
-				$newmenu->add("/expensereport/list.php?search_status=6&amp;leftmenu=expensereport&amp;mainmenu=hrm", $langs->trans("Paid"), 2, $user->hasRight('expensereport',  'lire'));
2353
-				$newmenu->add("/expensereport/list.php?search_status=4&amp;leftmenu=expensereport&amp;mainmenu=hrm", $langs->trans("Canceled"), 2, $user->hasRight('expensereport',  'lire'));
2354
-				$newmenu->add("/expensereport/list.php?search_status=99&amp;leftmenu=expensereport&amp;mainmenu=hrm", $langs->trans("Refused"), 2, $user->hasRight('expensereport',  'lire'));
2349
+				$newmenu->add("/expensereport/list.php?search_status=0&amp;leftmenu=expensereport&amp;mainmenu=hrm", $langs->trans("Draft"), 2, $user->hasRight('expensereport', 'lire'));
2350
+				$newmenu->add("/expensereport/list.php?search_status=2&amp;leftmenu=expensereport&amp;mainmenu=hrm", $langs->trans("Validated"), 2, $user->hasRight('expensereport', 'lire'));
2351
+				$newmenu->add("/expensereport/list.php?search_status=5&amp;leftmenu=expensereport&amp;mainmenu=hrm", $langs->trans("Approved"), 2, $user->hasRight('expensereport', 'lire'));
2352
+				$newmenu->add("/expensereport/list.php?search_status=6&amp;leftmenu=expensereport&amp;mainmenu=hrm", $langs->trans("Paid"), 2, $user->hasRight('expensereport', 'lire'));
2353
+				$newmenu->add("/expensereport/list.php?search_status=4&amp;leftmenu=expensereport&amp;mainmenu=hrm", $langs->trans("Canceled"), 2, $user->hasRight('expensereport', 'lire'));
2354
+				$newmenu->add("/expensereport/list.php?search_status=99&amp;leftmenu=expensereport&amp;mainmenu=hrm", $langs->trans("Refused"), 2, $user->hasRight('expensereport', 'lire'));
2355 2355
 			}
2356
-			$newmenu->add("/expensereport/payment/list.php?leftmenu=expensereport_payments&amp;mainmenu=hrm", $langs->trans("Payments"), 1, $user->hasRight('expensereport',  'lire'));
2357
-			$newmenu->add("/expensereport/stats/index.php?leftmenu=expensereport&amp;mainmenu=hrm", $langs->trans("Statistics"), 1, $user->hasRight('expensereport',  'lire'));
2356
+			$newmenu->add("/expensereport/payment/list.php?leftmenu=expensereport_payments&amp;mainmenu=hrm", $langs->trans("Payments"), 1, $user->hasRight('expensereport', 'lire'));
2357
+			$newmenu->add("/expensereport/stats/index.php?leftmenu=expensereport&amp;mainmenu=hrm", $langs->trans("Statistics"), 1, $user->hasRight('expensereport', 'lire'));
2358 2358
 		}
2359 2359
 
2360 2360
 		if (isModEnabled('projet')) {
@@ -2363,7 +2363,7 @@  discard block
 block discarded – undo
2363 2363
 
2364 2364
 				$search_project_user = GETPOST('search_project_user', 'int');
2365 2365
 
2366
-				$newmenu->add("/projet/activity/perweek.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("NewTimeSpent"), 0, $user->hasRight('projet',  'lire'), '', $mainmenu, 'timespent', 0, '', '', '', img_picto('', 'timespent', 'class="paddingright pictofixedwidth"'));
2366
+				$newmenu->add("/projet/activity/perweek.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("NewTimeSpent"), 0, $user->hasRight('projet', 'lire'), '', $mainmenu, 'timespent', 0, '', '', '', img_picto('', 'timespent', 'class="paddingright pictofixedwidth"'));
2367 2367
 			}
2368 2368
 		}
2369 2369
 	}
@@ -2391,22 +2391,22 @@  discard block
 block discarded – undo
2391 2391
 		}
2392 2392
 
2393 2393
 		if (isModEnabled('mailing')) {
2394
-			$newmenu->add("/comm/mailing/index.php?leftmenu=mailing", $langs->trans("EMailings"), 0, $user->hasRight('mailing',  'lire'), '', $mainmenu, 'mailing', 0, '', '', '', img_picto('', 'email', 'class="paddingright pictofixedwidth"'));
2395
-			$newmenu->add("/comm/mailing/card.php?leftmenu=mailing&amp;action=create", $langs->trans("NewMailing"), 1, $user->hasRight('mailing',  'creer'));
2396
-			$newmenu->add("/comm/mailing/list.php?leftmenu=mailing", $langs->trans("List"), 1, $user->hasRight('mailing',  'lire'));
2394
+			$newmenu->add("/comm/mailing/index.php?leftmenu=mailing", $langs->trans("EMailings"), 0, $user->hasRight('mailing', 'lire'), '', $mainmenu, 'mailing', 0, '', '', '', img_picto('', 'email', 'class="paddingright pictofixedwidth"'));
2395
+			$newmenu->add("/comm/mailing/card.php?leftmenu=mailing&amp;action=create", $langs->trans("NewMailing"), 1, $user->hasRight('mailing', 'creer'));
2396
+			$newmenu->add("/comm/mailing/list.php?leftmenu=mailing", $langs->trans("List"), 1, $user->hasRight('mailing', 'lire'));
2397 2397
 		}
2398 2398
 
2399 2399
 		if (isModEnabled('export')) {
2400 2400
 			$langs->load("exports");
2401
-			$newmenu->add("/exports/index.php?leftmenu=export", $langs->trans("FormatedExport"), 0, $user->hasRight('export',  'lire'), '', $mainmenu, 'export', 0, '', '', '', img_picto('', 'technic', 'class="paddingright pictofixedwidth"'));
2402
-			$newmenu->add("/exports/export.php?leftmenu=export", $langs->trans("NewExport"), 1, $user->hasRight('export',  'creer'));
2401
+			$newmenu->add("/exports/index.php?leftmenu=export", $langs->trans("FormatedExport"), 0, $user->hasRight('export', 'lire'), '', $mainmenu, 'export', 0, '', '', '', img_picto('', 'technic', 'class="paddingright pictofixedwidth"'));
2402
+			$newmenu->add("/exports/export.php?leftmenu=export", $langs->trans("NewExport"), 1, $user->hasRight('export', 'creer'));
2403 2403
 			//$newmenu->add("/exports/export.php?leftmenu=export",$langs->trans("List"),1, $user->hasRight('export',  'lire'));
2404 2404
 		}
2405 2405
 
2406 2406
 		if (isModEnabled('import')) {
2407 2407
 			$langs->load("exports");
2408
-			$newmenu->add("/imports/index.php?leftmenu=import", $langs->trans("FormatedImport"), 0, $user->hasRight('import',  'run'), '', $mainmenu, 'import', 0, '', '', '', img_picto('', 'technic', 'class="paddingright pictofixedwidth"'));
2409
-			$newmenu->add("/imports/import.php?leftmenu=import", $langs->trans("NewImport"), 1, $user->hasRight('import',  'run'));
2408
+			$newmenu->add("/imports/index.php?leftmenu=import", $langs->trans("FormatedImport"), 0, $user->hasRight('import', 'run'), '', $mainmenu, 'import', 0, '', '', '', img_picto('', 'technic', 'class="paddingright pictofixedwidth"'));
2409
+			$newmenu->add("/imports/import.php?leftmenu=import", $langs->trans("NewImport"), 1, $user->hasRight('import', 'run'));
2410 2410
 		}
2411 2411
 	}
2412 2412
 }
@@ -2444,7 +2444,7 @@  discard block
 block discarded – undo
2444 2444
 
2445 2445
 			$newmenu->add("/adherents/cartes/carte.php?leftmenu=export", $langs->trans("MembersCards"), 1, $user->hasRight('adherent', 'export'));
2446 2446
 			if (!empty($conf->global->MEMBER_LINK_TO_HTPASSWDFILE) && ($usemenuhider || empty($leftmenu) || $leftmenu == 'none' || $leftmenu == "members" || $leftmenu == "export")) {
2447
-				$newmenu->add("/adherents/htpasswd.php?leftmenu=export", $langs->trans("Filehtpasswd"), 1, $user->hasRight('adherent',  'export'));
2447
+				$newmenu->add("/adherents/htpasswd.php?leftmenu=export", $langs->trans("Filehtpasswd"), 1, $user->hasRight('adherent', 'export'));
2448 2448
 			}
2449 2449
 
2450 2450
 			if (isModEnabled('categorie')) {
Please login to merge, or discard this patch.
htdocs/hrm/skill_card.php 2 patches
Spacing   +101 added lines, -101 removed lines patch added patch discarded remove patch
@@ -29,15 +29,15 @@  discard block
 block discarded – undo
29 29
 
30 30
 // Load Dolibarr environment
31 31
 require '../main.inc.php';
32
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php';
33
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php';
34
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php';
35
-require_once DOL_DOCUMENT_ROOT . '/hrm/class/skill.class.php';
36
-require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_skill.lib.php';
32
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
33
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
34
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
35
+require_once DOL_DOCUMENT_ROOT.'/hrm/class/skill.class.php';
36
+require_once DOL_DOCUMENT_ROOT.'/hrm/lib/hrm_skill.lib.php';
37 37
 
38 38
 
39 39
 // Load translation files required by the page
40
-$langs->loadLangs(array('hrm', 'other', 'products'));  // why products?
40
+$langs->loadLangs(array('hrm', 'other', 'products')); // why products?
41 41
 
42 42
 // Get parameters
43 43
 $id = GETPOST('id', 'int');
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'skillcard'; // To manage different context of search
49 49
 $backtopage = GETPOST('backtopage', 'alpha');
50 50
 $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');
51
-$lineid   = GETPOST('lineid', 'int');
51
+$lineid = GETPOST('lineid', 'int');
52 52
 
53 53
 // Initialize technical objects
54 54
 $object = new Skill($db);
@@ -66,8 +66,8 @@  discard block
 block discarded – undo
66 66
 $search_all = GETPOST("search_all", 'alpha');
67 67
 $search = array();
68 68
 foreach ($object->fields as $key => $val) {
69
-	if (GETPOST('search_' . $key, 'alpha')) {
70
-		$search[$key] = GETPOST('search_' . $key, 'alpha');
69
+	if (GETPOST('search_'.$key, 'alpha')) {
70
+		$search[$key] = GETPOST('search_'.$key, 'alpha');
71 71
 	}
72 72
 }
73 73
 
@@ -76,13 +76,13 @@  discard block
 block discarded – undo
76 76
 }
77 77
 
78 78
 // Load object
79
-include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
79
+include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
80 80
 
81 81
 // Permissions
82 82
 $permissiontoread   = $user->rights->hrm->all->read;
83 83
 $permissiontoadd    = $user->rights->hrm->all->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
84 84
 $permissiontodelete = $user->rights->hrm->all->delete;
85
-$upload_dir = $conf->hrm->multidir_output[isset($object->entity) ? $object->entity : 1] . '/skill';
85
+$upload_dir = $conf->hrm->multidir_output[isset($object->entity) ? $object->entity : 1].'/skill';
86 86
 
87 87
 // Security check (enable the most restrictive one)
88 88
 //if ($user->socid > 0) accessforbidden();
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 			if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) {
120 120
 				$backtopage = $backurlforlist;
121 121
 			} else {
122
-				$backtopage = DOL_URL_ROOT.'/hrm/skill_card.php?id=' . ($id > 0 ? $id : '__ID__');
122
+				$backtopage = DOL_URL_ROOT.'/hrm/skill_card.php?id='.($id > 0 ? $id : '__ID__');
123 123
 			}
124 124
 		}
125 125
 	}
@@ -152,16 +152,16 @@  discard block
 block discarded – undo
152 152
 
153 153
 
154 154
 	// Actions when linking object each other
155
-	include DOL_DOCUMENT_ROOT . '/core/actions_dellink.inc.php';
155
+	include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php';
156 156
 
157 157
 	// Actions when printing a doc from card
158
-	include DOL_DOCUMENT_ROOT . '/core/actions_printing.inc.php';
158
+	include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
159 159
 
160 160
 	// Action to move up and down lines of object
161 161
 	//include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php';
162 162
 
163 163
 	// Action to build doc
164
-	include DOL_DOCUMENT_ROOT . '/core/actions_builddoc.inc.php';
164
+	include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
165 165
 
166 166
 	if ($action == 'set_thirdparty' && $permissiontoadd) {
167 167
 		$object->setValueFrom('fk_soc', GETPOST('fk_soc', 'int'), '', '', 'date', '', $user, $triggermodname);
@@ -173,8 +173,8 @@  discard block
 block discarded – undo
173 173
 	// Actions to send emails
174 174
 	$triggersendname = 'HRM_SKILL_SENTBYMAIL';
175 175
 	$autocopy = 'MAIN_MAIL_AUTOCOPY_SKILL_TO';
176
-	$trackid = 'skill' . $object->id;
177
-	include DOL_DOCUMENT_ROOT . '/core/actions_sendmails.inc.php';
176
+	$trackid = 'skill'.$object->id;
177
+	include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
178 178
 }
179 179
 
180 180
 
@@ -193,25 +193,25 @@  discard block
 block discarded – undo
193 193
 
194 194
 // Part to create
195 195
 if ($action == 'create') {
196
-	print load_fiche_titre($langs->trans("NewSkill"), '', 'object_' . $object->picto);
196
+	print load_fiche_titre($langs->trans("NewSkill"), '', 'object_'.$object->picto);
197 197
 
198
-	print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">';
199
-	print '<input type="hidden" name="token" value="' . newToken() . '">';
198
+	print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
199
+	print '<input type="hidden" name="token" value="'.newToken().'">';
200 200
 	print '<input type="hidden" name="action" value="add">';
201
-	$backtopage .= (strpos($backtopage, '?') > 0 ? '&' : '?' ) ."objecttype=job";
201
+	$backtopage .= (strpos($backtopage, '?') > 0 ? '&' : '?')."objecttype=job";
202 202
 	if ($backtopage) {
203
-		print '<input type="hidden" name="backtopage" value="' . $backtopage . '">';
203
+		print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
204 204
 	}
205 205
 	if ($backtopageforcancel) {
206
-		print '<input type="hidden" name="backtopageforcancel" value="' . $backtopageforcancel . '">';
206
+		print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">';
207 207
 	}
208 208
 
209 209
 	print dol_get_fiche_head(array(), '');
210 210
 
211
-	print '<table class="border centpercent tableforfieldcreate">' . "\n";
211
+	print '<table class="border centpercent tableforfieldcreate">'."\n";
212 212
 
213 213
 	// Common attributes
214
-	include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_add.tpl.php';
214
+	include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_add.tpl.php';
215 215
 
216 216
 	// Other attributes
217 217
 	include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php';
@@ -221,15 +221,15 @@  discard block
 block discarded – undo
221 221
 	//@todo je stop ici ... à continuer  (affichage des 5 skilled input pour create action
222 222
 	//print $object->showInputField($val, $key, $value, '', '['']', '', 0);
223 223
 
224
-	print '</table>' . "\n";
224
+	print '</table>'."\n";
225 225
 
226 226
 	print dol_get_fiche_end();
227 227
 
228 228
 	print '<div class="center">';
229
-	print '<input type="submit" class="button" name="add" value="' . dol_escape_htmltag($langs->trans("Create")) . '">';
229
+	print '<input type="submit" class="button" name="add" value="'.dol_escape_htmltag($langs->trans("Create")).'">';
230 230
 	print '&nbsp; ';
231 231
 
232
-	print '<input type="' . ($backtopage ? "submit" : "button") . '" class="button button-cancel" name="cancel" value="' . dol_escape_htmltag($langs->trans("Cancel")) . '"' . ($backtopage ? '' : ' onclick="history.go(-1)"') . '>'; // Cancel for create does not post form if we don't know the backtopage
232
+	print '<input type="'.($backtopage ? "submit" : "button").'" class="button button-cancel" name="cancel" value="'.dol_escape_htmltag($langs->trans("Cancel")).'"'.($backtopage ? '' : ' onclick="history.go(-1)"').'>'; // Cancel for create does not post form if we don't know the backtopage
233 233
 	print '</div>';
234 234
 
235 235
 	print '</form>';
@@ -240,25 +240,25 @@  discard block
 block discarded – undo
240 240
 // Part to edit record
241 241
 // and skilldet edition
242 242
 if (($id || $ref) && $action == 'edit') {
243
-	print load_fiche_titre($langs->trans("Skill"), '', 'object_' . $object->picto);
243
+	print load_fiche_titre($langs->trans("Skill"), '', 'object_'.$object->picto);
244 244
 
245
-	print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">';
246
-	print '<input type="hidden" name="token" value="' . newToken() . '">';
245
+	print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
246
+	print '<input type="hidden" name="token" value="'.newToken().'">';
247 247
 	print '<input type="hidden" name="action" value="update">';
248
-	print '<input type="hidden" name="id" value="' . $object->id . '">';
248
+	print '<input type="hidden" name="id" value="'.$object->id.'">';
249 249
 	if ($backtopage) {
250
-		print '<input type="hidden" name="backtopage" value="' . $backtopage . '">';
250
+		print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
251 251
 	}
252 252
 	if ($backtopageforcancel) {
253
-		print '<input type="hidden" name="backtopageforcancel" value="' . $backtopageforcancel . '">';
253
+		print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">';
254 254
 	}
255 255
 
256 256
 	print dol_get_fiche_head();
257 257
 
258
-	print '<table class="border centpercent tableforfieldedit">' . "\n";
258
+	print '<table class="border centpercent tableforfieldedit">'."\n";
259 259
 
260 260
 	// Common attributes
261
-	include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_edit.tpl.php';
261
+	include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_edit.tpl.php';
262 262
 
263 263
 	// Other attributes
264 264
 	include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_edit.tpl.php';
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
 				continue;
282 282
 			}
283 283
 
284
-			print '<table class="border centpercent =">' . "\n";
284
+			print '<table class="border centpercent =">'."\n";
285 285
 			$sk->fields = dol_sort_array($sk->fields, 'position');
286 286
 			foreach ($sk->fields as $key => $val) {
287 287
 				if (abs($val['visible']) != 1 && abs($val['visible']) != 3 && abs($val['visible']) != 4) {
@@ -292,7 +292,7 @@  discard block
 block discarded – undo
292 292
 					continue; // We don't want this field
293 293
 				}
294 294
 
295
-				print '<tr class="field_' . $key . '"><td';
295
+				print '<tr class="field_'.$key.'"><td';
296 296
 				print ' class="titlefieldcreate';
297 297
 				if (isset($val['notnull']) && $val['notnull'] > 0) {
298 298
 					print ' fieldrequired';
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
 				if (empty($skilldetArray)) {
328 328
 					$value = GETPOSTISSET($key) ? GETPOST($key, $check) : $sk->$key;
329 329
 				} else {
330
-					$value=$skilldetArray[$sk->id];
330
+					$value = $skilldetArray[$sk->id];
331 331
 				}
332 332
 				//
333 333
 				//              } elseif ($val['type'] == 'price') {
@@ -340,7 +340,7 @@  discard block
 block discarded – undo
340 340
 					print $sk->showOutputField($val, $key, $value, '', '', '', 0);
341 341
 				} else {
342 342
 					/** @var Skilldet $sk */
343
-					print $sk->showInputField($val, $key, $value, "", "line[" . $sk->id . "]", "", "");
343
+					print $sk->showInputField($val, $key, $value, "", "line[".$sk->id."]", "", "");
344 344
 				}
345 345
 				print '</td>';
346 346
 				print '</tr>';
@@ -352,8 +352,8 @@  discard block
 block discarded – undo
352 352
 
353 353
 	print dol_get_fiche_end();
354 354
 
355
-	print '<div class="center"><input type="submit" class="button button-save" name="save" value="' . $langs->trans("Save") . '">';
356
-	print ' &nbsp; <input type="submit" class="button button-cancel" name="cancel" value="' . $langs->trans("Cancel") . '">';
355
+	print '<div class="center"><input type="submit" class="button button-save" name="save" value="'.$langs->trans("Save").'">';
356
+	print ' &nbsp; <input type="submit" class="button button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">';
357 357
 	print '</div>';
358 358
 
359 359
 	print '</form>';
@@ -371,17 +371,17 @@  discard block
 block discarded – undo
371 371
 
372 372
 	// Confirmation to delete
373 373
 	if ($action == 'delete') {
374
-		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteSkill'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1);
374
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteSkill'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1);
375 375
 	}
376 376
 	// Confirmation to delete line
377 377
 	if ($action == 'deleteline') {
378
-		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&lineid=' . $lineid, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteline', '', 0, 1);
378
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteline', '', 0, 1);
379 379
 	}
380 380
 	// Clone confirmation
381 381
 	if ($action == 'clone') {
382 382
 		// Create an array for form
383 383
 		$formquestion = array();
384
-		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneAsk', $object->ref), 'confirm_clone', $formquestion, 'yes', 1);
384
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneAsk', $object->ref), 'confirm_clone', $formquestion, 'yes', 1);
385 385
 	}
386 386
 
387 387
 	// Confirmation of action xxxx
@@ -397,7 +397,7 @@  discard block
 block discarded – undo
397 397
 			// array('type' => 'other',    'name' => 'idwarehouse',   'label' => $langs->trans("SelectWarehouseForStockDecrease"), 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone', 'idwarehouse', '', 1, 0, 0, '', 0, $forcecombo))
398 398
 		);
399 399
 		*/
400
-		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('XXX'), $text, 'confirm_xxx', $formquestion, 0, 1, 220);
400
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('XXX'), $text, 'confirm_xxx', $formquestion, 0, 1, 220);
401 401
 	}
402 402
 
403 403
 	// Call Hook formConfirm
@@ -415,11 +415,11 @@  discard block
 block discarded – undo
415 415
 
416 416
 	// Object card
417 417
 	// ------------------------------------------------------------
418
-	$linkback = '<a href="' . DOL_URL_ROOT.'/hrm/skill_list.php?restore_lastsearch_values=1' . (!empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
418
+	$linkback = '<a href="'.DOL_URL_ROOT.'/hrm/skill_list.php?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
419 419
 
420 420
 
421 421
 	$morehtmlref = '<div class="refid">';
422
-	$morehtmlref.= $object->label;
422
+	$morehtmlref .= $object->label;
423 423
 	$morehtmlref .= '</div>';
424 424
 	dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'rowid', $morehtmlref);
425 425
 
@@ -427,10 +427,10 @@  discard block
 block discarded – undo
427 427
 	print '<div class="fichecenter">';
428 428
 	print '<div class="fichehalfleft">';
429 429
 	print '<div class="underbanner clearboth"></div>';
430
-	print '<table class="border centpercent tableforfield">' . "\n";
430
+	print '<table class="border centpercent tableforfield">'."\n";
431 431
 
432
-	$object->fields['label']['visible']=0; // Already in banner
433
-	include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_view.tpl.php';
432
+	$object->fields['label']['visible'] = 0; // Already in banner
433
+	include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php';
434 434
 
435 435
 	// Other attributes. Fields from hook formObjectOptions and Extrafields.
436 436
 	include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
@@ -450,7 +450,7 @@  discard block
 block discarded – undo
450 450
 	// Buttons for actions
451 451
 
452 452
 	if ($action != 'presend' && $action != 'editline') {
453
-		print '<div class="tabsAction">' . "\n";
453
+		print '<div class="tabsAction">'."\n";
454 454
 		$parameters = array();
455 455
 		$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
456 456
 		if ($reshook < 0) {
@@ -460,15 +460,15 @@  discard block
 block discarded – undo
460 460
 		if (empty($reshook)) {
461 461
 			// Back to draft
462 462
 			if ($object->status == $object::STATUS_VALIDATED) {
463
-				print dolGetButtonAction($langs->trans('SetToDraft'), '', 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=confirm_setdraft&confirm=yes&token=' . newToken(), '', $permissiontoadd);
463
+				print dolGetButtonAction($langs->trans('SetToDraft'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=confirm_setdraft&confirm=yes&token='.newToken(), '', $permissiontoadd);
464 464
 			}
465 465
 
466
-			print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=edit&token=' . newToken(), '', $permissiontoadd);
466
+			print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit&token='.newToken(), '', $permissiontoadd);
467 467
 
468 468
 			// Delete (need delete permission, or if draft, just need create/modify permission)
469
-			print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=delete&token=' . newToken(), '', $permissiontodelete);
469
+			print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=delete&token='.newToken(), '', $permissiontodelete);
470 470
 		}
471
-		print '</div>' . "\n";
471
+		print '</div>'."\n";
472 472
 	}
473 473
 }
474 474
 
@@ -476,12 +476,12 @@  discard block
 block discarded – undo
476 476
 //*---------------------------------------------------------------------------
477 477
 
478 478
 if ($action != "create" && $action != "edit") {
479
-	require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php';
480
-	require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
481
-	require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
479
+	require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
480
+	require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
481
+	require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
482 482
 
483 483
 	// load hrm libraries
484
-	require_once __DIR__ . '/class/skilldet.class.php';
484
+	require_once __DIR__.'/class/skilldet.class.php';
485 485
 
486 486
 	// for other modules
487 487
 	//dol_include_once('/othermodule/class/otherobject.class.php');
@@ -518,8 +518,8 @@  discard block
 block discarded – undo
518 518
 
519 519
 	// Default sort order (if not yet defined by previous GETPOST)
520 520
 	if (!$sortfield) {
521
-		reset($objectline->fields);                    // Reset is required to avoid key() to return null.
522
-		$sortfield = "t." . key($objectline->fields); // Set here default search field. By default 1st field in definition.
521
+		reset($objectline->fields); // Reset is required to avoid key() to return null.
522
+		$sortfield = "t.".key($objectline->fields); // Set here default search field. By default 1st field in definition.
523 523
 	}
524 524
 	if (!$sortorder) {
525 525
 		$sortorder = "ASC";
@@ -529,12 +529,12 @@  discard block
 block discarded – undo
529 529
 	$search_all = GETPOST('search_all', 'alphanohtml') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml');
530 530
 	$search = array();
531 531
 	foreach ($objectline->fields as $key => $val) {
532
-		if (GETPOST('search_' . $key, 'alpha') !== '') {
533
-			$search[$key] = GETPOST('search_' . $key, 'alpha');
532
+		if (GETPOST('search_'.$key, 'alpha') !== '') {
533
+			$search[$key] = GETPOST('search_'.$key, 'alpha');
534 534
 		}
535 535
 		if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
536
-			$search[$key . '_dtstart'] = dol_mktime(0, 0, 0, GETPOST('search_' . $key . '_dtstartmonth', 'int'), GETPOST('search_' . $key . '_dtstartday', 'int'), GETPOST('search_' . $key . '_dtstartyear', 'int'));
537
-			$search[$key . '_dtend'] = dol_mktime(23, 59, 59, GETPOST('search_' . $key . '_dtendmonth', 'int'), GETPOST('search_' . $key . '_dtendday', 'int'), GETPOST('search_' . $key . '_dtendyear', 'int'));
536
+			$search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOST('search_'.$key.'_dtstartmonth', 'int'), GETPOST('search_'.$key.'_dtstartday', 'int'), GETPOST('search_'.$key.'_dtstartyear', 'int'));
537
+			$search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOST('search_'.$key.'_dtendmonth', 'int'), GETPOST('search_'.$key.'_dtendday', 'int'), GETPOST('search_'.$key.'_dtendyear', 'int'));
538 538
 		}
539 539
 	}
540 540
 
@@ -542,7 +542,7 @@  discard block
 block discarded – undo
542 542
 	$fieldstosearchall = array();
543 543
 	foreach ($objectline->fields as $key => $val) {
544 544
 		if (!empty($val['searchall'])) {
545
-			$fieldstosearchall['t.' . $key] = $val['label'];
545
+			$fieldstosearchall['t.'.$key] = $val['label'];
546 546
 		}
547 547
 	}
548 548
 
@@ -552,7 +552,7 @@  discard block
 block discarded – undo
552 552
 		// If $val['visible']==0, then we never show the field
553 553
 		if (!empty($val['visible'])) {
554 554
 			$visible = (int) dol_eval($val['visible'], 1, 1, '1');
555
-			$arrayfields['t.' . $key] = array(
555
+			$arrayfields['t.'.$key] = array(
556 556
 				'label' => $val['label'],
557 557
 				'checked' => (($visible < 0) ? 0 : 1),
558 558
 				'enabled' => ($visible != 3 && dol_eval($val['enabled'], 1, 1, '1')),
@@ -584,9 +584,9 @@  discard block
 block discarded – undo
584 584
 	// --------------------------------------------------------------------
585 585
 	$sql = 'SELECT ';
586 586
 	$sql .= $objectline->getFieldList('t');
587
-	$sql .= " FROM " . MAIN_DB_PREFIX . $objectline->table_element . " as t";
587
+	$sql .= " FROM ".MAIN_DB_PREFIX.$objectline->table_element." as t";
588 588
 	if ($objectline->ismultientitymanaged == 1) {
589
-		$sql .= " WHERE t.entity IN (" . getEntity($objectline->element) . ")";
589
+		$sql .= " WHERE t.entity IN (".getEntity($objectline->element).")";
590 590
 	} else {
591 591
 		$sql .= " WHERE 1 = 1 ";
592 592
 	}
@@ -596,41 +596,41 @@  discard block
 block discarded – undo
596 596
 	$nbtotalofrecords = $db->num_rows($resql);
597 597
 	$num = $db->num_rows($resql);
598 598
 
599
-	print '<form method="POST" id="searchFormList" action="' . $_SERVER["PHP_SELF"] . '">' . "\n";
599
+	print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
600 600
 	if ($optioncss != '') {
601
-		print '<input type="hidden" name="optioncss" value="' . $optioncss . '">';
601
+		print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
602 602
 	}
603
-	print '<input type="hidden" name="token" value="' . newToken() . '">';
603
+	print '<input type="hidden" name="token" value="'.newToken().'">';
604 604
 	print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
605 605
 	print '<input type="hidden" name="action" value="list">';
606
-	print '<input type="hidden" name="sortfield" value="' . $sortfield . '">';
607
-	print '<input type="hidden" name="sortorder" value="' . $sortorder . '">';
608
-	print '<input type="hidden" name="page" value="' . $page . '">';
609
-	print '<input type="hidden" name="contextpage" value="' . $contextpage . '">';
606
+	print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
607
+	print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
608
+	print '<input type="hidden" name="page" value="'.$page.'">';
609
+	print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
610 610
 	if (!empty($id)) {
611
-		print '<input type="hidden" name="id" value="' . $id . '">';
611
+		print '<input type="hidden" name="id" value="'.$id.'">';
612 612
 	}
613 613
 
614
-	$param_fk = "&fk_skill=" . $id . "&fk_user_creat=" . (!empty($user->rowid) ? $user->rowid :0);
615
-	$backtopage = dol_buildpath('/hrm/skill_card.php', 1) . '?id=' . $id;
614
+	$param_fk = "&fk_skill=".$id."&fk_user_creat=".(!empty($user->rowid) ? $user->rowid : 0);
615
+	$backtopage = dol_buildpath('/hrm/skill_card.php', 1).'?id='.$id;
616 616
 	$param = "";
617 617
 	$massactionbutton = "";
618 618
 	//$newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', dol_buildpath('/hrm/skilldet_card.php', 1) . '?action=create&backtopage=' . urlencode($_SERVER['PHP_SELF']) . $param_fk . '&backtopage=' . $backtopage, '', $permissiontoadd);
619 619
 
620
-	print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'object_' . $object->picto, 0, "", '', '', 0, 0, 1);
620
+	print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'object_'.$object->picto, 0, "", '', '', 0, 0, 1);
621 621
 
622 622
 	// Add code for pre mass action (confirmation or email presend form)
623 623
 	$topicmail = "SendSkilldetRef";
624 624
 	$modelmail = "skilldet";
625 625
 	$objecttmp = new Skilldet($db);
626
-	$trackid = 'xxxx' . $object->id;
626
+	$trackid = 'xxxx'.$object->id;
627 627
 	//include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
628 628
 
629 629
 	if ($search_all) {
630 630
 		foreach ($fieldstosearchall as $key => $val) {
631 631
 			$fieldstosearchall[$key] = $langs->trans($val);
632 632
 		}
633
-		print '<div class="divsearchfieldfilter">' . $langs->trans("FilterOnInto", $search_all) . join(', ', $fieldstosearchall) . '</div>';
633
+		print '<div class="divsearchfieldfilter">'.$langs->trans("FilterOnInto", $search_all).join(', ', $fieldstosearchall).'</div>';
634 634
 	}
635 635
 
636 636
 	$moreforfilter = '';
@@ -657,7 +657,7 @@  discard block
 block discarded – undo
657 657
 	//  $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
658 658
 
659 659
 	print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
660
-	print '<table class="tagtable nobottomiftotal liste' . ($moreforfilter ? " listwithfilterbefore" : "") . '">' . "\n";
660
+	print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
661 661
 
662 662
 
663 663
 	// Fields title label
@@ -674,13 +674,13 @@  discard block
 block discarded – undo
674 674
 		//      } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) {
675 675
 		//          $cssforfield .= ($cssforfield ? ' ' : '') . 'right';
676 676
 		//      }
677
-		if (!empty($arrayfields['t.' . $key]['checked'])) {
678
-			print getTitleFieldOfList($arrayfields['t.' . $key]['label'], 0, $_SERVER['PHP_SELF'], 't.' . $key, '', $param, (!empty($cssforfield) ? 'class="' . $cssforfield . '"' : ''), $sortfield, $sortorder, (!empty($cssforfield) ? $cssforfield . ' ' : '')) . "\n";
677
+		if (!empty($arrayfields['t.'.$key]['checked'])) {
678
+			print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, (!empty($cssforfield) ? 'class="'.$cssforfield.'"' : ''), $sortfield, $sortorder, (!empty($cssforfield) ? $cssforfield.' ' : ''))."\n";
679 679
 		}
680 680
 	}
681 681
 	print '<td></td>';
682 682
 	print '<td></td>';
683
-	print '</tr>' . "\n";
683
+	print '</tr>'."\n";
684 684
 
685 685
 
686 686
 	// Display all ranks of skill
@@ -723,14 +723,14 @@  discard block
 block discarded – undo
723 723
 			//          }
724 724
 			//if (in_array($key, array('fk_soc', 'fk_user', 'fk_warehouse'))) $cssforfield = 'tdoverflowmax100';
725 725
 
726
-			if (!empty($arrayfields['t.' . $key]['checked'])) {
727
-				print '<td' . ($cssforfield ? ' class="' . $cssforfield . '"' : '') . '>';
726
+			if (!empty($arrayfields['t.'.$key]['checked'])) {
727
+				print '<td'.($cssforfield ? ' class="'.$cssforfield.'"' : '').'>';
728 728
 				if ($key == 'status') {
729 729
 					print $objectline->getLibStatut(5);
730 730
 				} elseif ($key == 'rowid') {
731 731
 					print $objectline->showOutputField($val, $key, $objectline->id, '');
732 732
 					// ajout pencil
733
-					print '<a class="timeline-btn" href="' . DOL_MAIN_URL_ROOT . '/comm/action/skilldet_card.php?action=edit&id=' . $objectline->id . '"><i class="fa fa-pencil" title="' . $langs->trans("Modify") . '" ></i></a>';
733
+					print '<a class="timeline-btn" href="'.DOL_MAIN_URL_ROOT.'/comm/action/skilldet_card.php?action=edit&id='.$objectline->id.'"><i class="fa fa-pencil" title="'.$langs->trans("Modify").'" ></i></a>';
734 734
 				} else {
735 735
 					print $objectline->showOutputField($val, $key, $objectline->$key, '');
736 736
 				}
@@ -742,15 +742,15 @@  discard block
 block discarded – undo
742 742
 				}
743 743
 				if (!empty($val['isameasure']) && $val['isameasure'] == 1) {
744 744
 					if (!$i) {
745
-						$totalarray['pos'][$totalarray['nbfield']] = 't.' . $key;
745
+						$totalarray['pos'][$totalarray['nbfield']] = 't.'.$key;
746 746
 					}
747 747
 					if (!isset($totalarray['val'])) {
748 748
 						$totalarray['val'] = array();
749 749
 					}
750
-					if (!isset($totalarray['val']['t.' . $key])) {
751
-						$totalarray['val']['t.' . $key] = 0;
750
+					if (!isset($totalarray['val']['t.'.$key])) {
751
+						$totalarray['val']['t.'.$key] = 0;
752 752
 					}
753
-					$totalarray['val']['t.' . $key] += $objectline->$key;
753
+					$totalarray['val']['t.'.$key] += $objectline->$key;
754 754
 				}
755 755
 			}
756 756
 		}
@@ -783,7 +783,7 @@  discard block
 block discarded – undo
783 783
 			$totalarray['nbfield']++;
784 784
 		}
785 785
 
786
-		print '</tr>' . "\n";
786
+		print '</tr>'."\n";
787 787
 
788 788
 		$i++;
789 789
 	}
@@ -798,7 +798,7 @@  discard block
 block discarded – undo
798 798
 				$colspan++;
799 799
 			}
800 800
 		}
801
-		print '<tr><td colspan="' . $colspan . '"><span class="opacitymedium">' . $langs->trans("NoRecordFound") . '</span></td></tr>';
801
+		print '<tr><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>';
802 802
 	}
803 803
 
804 804
 	if (!empty($resql)) $db->free($resql);
@@ -807,10 +807,10 @@  discard block
 block discarded – undo
807 807
 	$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $objectline); // Note that $action and $objectline may have been modified by hook
808 808
 	print $hookmanager->resPrint;
809 809
 
810
-	print '</table>' . "\n";
811
-	print '</div>' . "\n";
810
+	print '</table>'."\n";
811
+	print '</div>'."\n";
812 812
 
813
-	print '</form>' . "\n";
813
+	print '</form>'."\n";
814 814
 
815 815
 	//  if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) {
816 816
 	//      $hidegeneratedfilelistifempty = 1;
@@ -845,9 +845,9 @@  discard block
 block discarded – undo
845 845
 	$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/hrm/skill_agenda.php?id='.$object->id);
846 846
 
847 847
 	// List of actions on element
848
-	include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
848
+	include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
849 849
 	$formactions = new FormActions($db);
850
-	$somethingshown = $formactions->showactions($object, $object->element . '@' . $object->module, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlcenter);
850
+	$somethingshown = $formactions->showactions($object, $object->element.'@'.$object->module, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlcenter);
851 851
 
852 852
 	print '</div></div>';
853 853
 }
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -801,7 +801,9 @@
 block discarded – undo
801 801
 		print '<tr><td colspan="' . $colspan . '"><span class="opacitymedium">' . $langs->trans("NoRecordFound") . '</span></td></tr>';
802 802
 	}
803 803
 
804
-	if (!empty($resql)) $db->free($resql);
804
+	if (!empty($resql)) {
805
+		$db->free($resql);
806
+	}
805 807
 
806 808
 	$parameters = array('arrayfields' => $arrayfields, 'sql' => $sql);
807 809
 	$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $objectline); // Note that $action and $objectline may have been modified by hook
Please login to merge, or discard this patch.
htdocs/contact/list.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -447,7 +447,7 @@  discard block
 block discarded – undo
447 447
 
448 448
 // Add fields from hooks - ListFrom
449 449
 $parameters = array();
450
-$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object, $action);    // Note that $action and $object may have been modified by hook
450
+$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
451 451
 $sql .= $hookmanager->resPrint;
452 452
 $sql .= ' WHERE p.entity IN ('.getEntity('contact').')';
453 453
 if (empty($user->rights->societe->client->voir) && !$socid) { //restriction
@@ -490,7 +490,7 @@  discard block
 block discarded – undo
490 490
 			if ($searchCategoryContactOperator == 0) {
491 491
 				$searchCategoryContactSqlList[] = " EXISTS (SELECT ck.fk_socpeople FROM ".MAIN_DB_PREFIX."categorie_contact as ck WHERE p.rowid = ck.fk_socpeople AND ck.fk_categorie = ".((int) $searchCategoryContact).")";
492 492
 			} else {
493
-				$listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryContact);
493
+				$listofcategoryid .= ($listofcategoryid ? ', ' : '').((int) $searchCategoryContact);
494 494
 			}
495 495
 		}
496 496
 	}
@@ -522,7 +522,7 @@  discard block
 block discarded – undo
522 522
 			if ($searchCategoryCustomerOperator == 0) {
523 523
 				$searchCategoryCustomerSqlList[] = " EXISTS (SELECT ck.fk_soc FROM ".MAIN_DB_PREFIX."categorie_societe as ck WHERE s.rowid = ck.fk_soc AND ck.fk_categorie = ".((int) $searchCategoryCustomer).")";
524 524
 			} else {
525
-				$listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryCustomer);
525
+				$listofcategoryid .= ($listofcategoryid ? ', ' : '').((int) $searchCategoryCustomer);
526 526
 			}
527 527
 		}
528 528
 	}
@@ -554,7 +554,7 @@  discard block
 block discarded – undo
554 554
 			if ($searchCategorySupplierOperator == 0) {
555 555
 				$searchCategorySupplierSqlList[] = " EXISTS (SELECT ck.fk_soc FROM ".MAIN_DB_PREFIX."categorie_fournisseur as ck WHERE s.rowid = ck.fk_soc AND ck.fk_categorie = ".((int) $searchCategorySupplier).")";
556 556
 			} else {
557
-				$listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategorySupplier);
557
+				$listofcategoryid .= ($listofcategoryid ? ', ' : '').((int) $searchCategorySupplier);
558 558
 			}
559 559
 		}
560 560
 	}
@@ -844,7 +844,7 @@  discard block
 block discarded – undo
844 844
 if (count($search_roles) > 0) {
845 845
 	$param .= implode('&search_roles[]=', $search_roles);
846 846
 }
847
-if ($search_birthday_start)	{
847
+if ($search_birthday_start) {
848 848
 	$param .= '&search_birthday_start='.urlencode(dol_print_date($search_birthday_start, '%d')).'&search_birthday_startmonth='.urlencode(dol_print_date($search_birthday_start, '%m')).'&search_birthday_startyear='.urlencode(dol_print_date($search_birthday_start, '%Y'));
849 849
 }
850 850
 if ($search_birthday_end) {
@@ -865,7 +865,7 @@  discard block
 block discarded – undo
865 865
 if (isModEnabled('category') && $user->hasRight('societe', 'creer')) {
866 866
 	$arrayofmassactions['preaffecttag'] = img_picto('', 'category', 'class="pictofixedwidth"').$langs->trans("AffectTag");
867 867
 }
868
-if (in_array($massaction, array('presend', 'predelete','preaffecttag'))) {
868
+if (in_array($massaction, array('presend', 'predelete', 'preaffecttag'))) {
869 869
 	$arrayofmassactions = array();
870 870
 }
871 871
 $massactionbutton = $form->selectMassAction('', $arrayofmassactions);
Please login to merge, or discard this patch.
htdocs/core/modules/mailings/modules_mailings.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@
 block discarded – undo
72 72
 	public $sql;
73 73
 
74 74
 
75
-	public $evenunsubscribe = 0;		// Set this to 1 if you want to flag you also want to include email in target that has opt-out.
75
+	public $evenunsubscribe = 0; // Set this to 1 if you want to flag you also want to include email in target that has opt-out.
76 76
 
77 77
 
78 78
 	/**
Please login to merge, or discard this patch.
htdocs/core/class/html.formfile.class.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
 			$maxphptoshow = $maxfilesizearray['maxphptoshow'];
156 156
 			$maxphptoshowparam = $maxfilesizearray['maxphptoshowparam'];
157 157
 			if ($maxmin > 0) {
158
-				$out .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">';	// MAX_FILE_SIZE must precede the field type=file
158
+				$out .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file
159 159
 			}
160 160
 			$out .= '<input class="flat minwidth400 maxwidth200onsmartphone" type="file"';
161 161
 			$out .= ((!empty($conf->global->MAIN_DISABLE_MULTIPLE_FILEUPLOAD) || $disablemulti) ? ' name="userfile"' : ' name="userfile[]" multiple');
@@ -747,7 +747,7 @@  discard block
 block discarded – undo
747 747
 										separator = ",";
748 748
 									}
749 749
 								});
750
-								if ("' . $conf->global->EXPORT_CSV_SEPARATOR_TO_USE . '" == ";") {
750
+								if ("' . $conf->global->EXPORT_CSV_SEPARATOR_TO_USE.'" == ";") {
751 751
 									$("#semicolon").prop("checked", true);
752 752
 								} else {
753 753
 									$("#comma").prop("checked", true);
Please login to merge, or discard this patch.
htdocs/core/class/html.form.class.php 1 patch
Spacing   +1221 added lines, -1221 removed lines patch added patch discarded remove patch
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 		if (!empty($conf->global->MAIN_USE_JQUERY_JEDITABLE) && !preg_match('/^select;/', $typeofdata)) {
118 118
 			if (!empty($perm)) {
119 119
 				$tmp = explode(':', $typeofdata);
120
-				$ret .= '<div class="editkey_' . $tmp[0] . (!empty($tmp[1]) ? ' ' . $tmp[1] : '') . '" id="' . $htmlname . '">';
120
+				$ret .= '<div class="editkey_'.$tmp[0].(!empty($tmp[1]) ? ' '.$tmp[1] : '').'" id="'.$htmlname.'">';
121 121
 				if ($fieldrequired) {
122 122
 					$ret .= '<span class="fieldrequired">';
123 123
 				}
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
 				if ($fieldrequired) {
130 130
 					$ret .= '</span>';
131 131
 				}
132
-				$ret .= '</div>' . "\n";
132
+				$ret .= '</div>'."\n";
133 133
 			} else {
134 134
 				if ($fieldrequired) {
135 135
 					$ret .= '<span class="fieldrequired">';
@@ -167,8 +167,8 @@  discard block
 block discarded – undo
167 167
 			if (empty($notabletag) && $perm) {
168 168
 				$ret .= '<td class="right">';
169 169
 			}
170
-			if ($htmlname && GETPOST('action', 'aZ09') != 'edit' . $htmlname && $perm) {
171
-				$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>';
170
+			if ($htmlname && GETPOST('action', 'aZ09') != 'edit'.$htmlname && $perm) {
171
+				$ret .= '<a class="editfielda reposition" href="'.$_SERVER["PHP_SELF"].'?action=edit'.$htmlname.'&token='.newToken().'&'.$paramid.'='.$object->id.$moreparam.'">'.img_edit($langs->trans('Edit'), ($notabletag ? 0 : 1)).'</a>';
172 172
 			}
173 173
 			if (!empty($notabletag) && $notabletag == 1) {
174 174
 				if ($text) {
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
 			} elseif ($reg[1] == 'int') {
236 236
 				$typeofdata = 'numeric';
237 237
 			} else {
238
-				return 'ErrorBadParameter ' . $typeofdata;
238
+				return 'ErrorBadParameter '.$typeofdata;
239 239
 			}
240 240
 		}
241 241
 
@@ -246,13 +246,13 @@  discard block
 block discarded – undo
246 246
 			if ($editaction == '') {
247 247
 				$editaction = GETPOST('action', 'aZ09');
248 248
 			}
249
-			$editmode = ($editaction == 'edit' . $htmlname);
249
+			$editmode = ($editaction == 'edit'.$htmlname);
250 250
 			if ($editmode) {	// edit mode
251 251
 				$ret .= "\n";
252
-				$ret .= '<form method="post" action="' . $_SERVER["PHP_SELF"] . ($moreparam ? '?' . $moreparam : '') . '">';
253
-				$ret .= '<input type="hidden" name="action" value="set' . $htmlname . '">';
254
-				$ret .= '<input type="hidden" name="token" value="' . newToken() . '">';
255
-				$ret .= '<input type="hidden" name="' . $paramid . '" value="' . $object->id . '">';
252
+				$ret .= '<form method="post" action="'.$_SERVER["PHP_SELF"].($moreparam ? '?'.$moreparam : '').'">';
253
+				$ret .= '<input type="hidden" name="action" value="set'.$htmlname.'">';
254
+				$ret .= '<input type="hidden" name="token" value="'.newToken().'">';
255
+				$ret .= '<input type="hidden" name="'.$paramid.'" value="'.$object->id.'">';
256 256
 				if (empty($notabletag)) {
257 257
 					$ret .= '<table class="nobordernopadding centpercent">';
258 258
 				}
@@ -261,28 +261,28 @@  discard block
 block discarded – undo
261 261
 				}
262 262
 				if (preg_match('/^(string|safehtmlstring|email|phone|url)/', $typeofdata)) {
263 263
 					$tmp = explode(':', $typeofdata);
264
-					$ret .= '<input type="text" id="' . $htmlname . '" name="' . $htmlname . '" value="' . ($editvalue ? $editvalue : $value) . '"' . (empty($tmp[1]) ? '' : ' size="' . $tmp[1] . '"') . ' autofocus>';
264
+					$ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($editvalue ? $editvalue : $value).'"'.(empty($tmp[1]) ? '' : ' size="'.$tmp[1].'"').' autofocus>';
265 265
 				} elseif (preg_match('/^(integer)/', $typeofdata)) {
266 266
 					$tmp = explode(':', $typeofdata);
267 267
 					$valuetoshow = price2num($editvalue ? $editvalue : $value, 0);
268
-					$ret .= '<input type="text" id="' . $htmlname . '" name="' . $htmlname . '" value="' . $valuetoshow . '"' . (empty($tmp[1]) ? '' : ' size="' . $tmp[1] . '"') . ' autofocus>';
268
+					$ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.$valuetoshow.'"'.(empty($tmp[1]) ? '' : ' size="'.$tmp[1].'"').' autofocus>';
269 269
 				} elseif (preg_match('/^(numeric|amount)/', $typeofdata)) {
270 270
 					$tmp = explode(':', $typeofdata);
271 271
 					$valuetoshow = price2num($editvalue ? $editvalue : $value);
272
-					$ret .= '<input type="text" id="' . $htmlname . '" name="' . $htmlname . '" value="' . ($valuetoshow != '' ? price($valuetoshow) : '') . '"' . (empty($tmp[1]) ? '' : ' size="' . $tmp[1] . '"') . ' autofocus>';
272
+					$ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($valuetoshow != '' ? price($valuetoshow) : '').'"'.(empty($tmp[1]) ? '' : ' size="'.$tmp[1].'"').' autofocus>';
273 273
 				} elseif (preg_match('/^(checkbox)/', $typeofdata)) {
274 274
 					$tmp = explode(':', $typeofdata);
275
-					$ret .= '<input type="checkbox" id="' . $htmlname . '" name="' . $htmlname . '" value="' . ($value ? $value : 'on') . '"' . ($value ? ' checked' : '') . (empty($tmp[1]) ? '' : $tmp[1]) . '/>';
275
+					$ret .= '<input type="checkbox" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($value ? $value : 'on').'"'.($value ? ' checked' : '').(empty($tmp[1]) ? '' : $tmp[1]).'/>';
276 276
 				} elseif (preg_match('/^text/', $typeofdata) || preg_match('/^note/', $typeofdata)) {    // if wysiwyg is enabled $typeofdata = 'ckeditor'
277 277
 					$tmp = explode(':', $typeofdata);
278 278
 					$cols = (empty($tmp[2]) ? '' : $tmp[2]);
279 279
 					$morealt = '';
280 280
 					if (preg_match('/%/', $cols)) {
281
-						$morealt = ' style="width: ' . $cols . '"';
281
+						$morealt = ' style="width: '.$cols.'"';
282 282
 						$cols = '';
283 283
 					}
284 284
 					$valuetoshow = ($editvalue ? $editvalue : $value);
285
-					$ret .= '<textarea id="' . $htmlname . '" name="' . $htmlname . '" wrap="soft" rows="' . (empty($tmp[1]) ? '20' : $tmp[1]) . '"' . ($cols ? ' cols="' . $cols . '"' : 'class="quatrevingtpercent"') . $morealt . '" autofocus>';
285
+					$ret .= '<textarea id="'.$htmlname.'" name="'.$htmlname.'" wrap="soft" rows="'.(empty($tmp[1]) ? '20' : $tmp[1]).'"'.($cols ? ' cols="'.$cols.'"' : 'class="quatrevingtpercent"').$morealt.'" autofocus>';
286 286
 					// textarea convert automatically entities chars into simple chars.
287 287
 					// 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.
288 288
 					$valuetoshow = str_replace('&', '&amp;', $valuetoshow);
@@ -292,12 +292,12 @@  discard block
 block discarded – undo
292 292
 					$addnowlink = empty($moreoptions['addnowlink']) ? 0 : $moreoptions['addnowlink'];
293 293
 					$adddateof = empty($moreoptions['adddateof']) ? '' : $moreoptions['adddateof'];
294 294
 					$labeladddateof = empty($moreoptions['labeladddateof']) ? '' : $moreoptions['labeladddateof'];
295
-					$ret .= $this->selectDate($value, $htmlname, 0, 0, 1, 'form' . $htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm);
295
+					$ret .= $this->selectDate($value, $htmlname, 0, 0, 1, 'form'.$htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm);
296 296
 				} elseif ($typeofdata == 'dayhour' || $typeofdata == 'datehourpicker') {
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, 1, 1, 1, 'form' . $htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm);
300
+					$ret .= $this->selectDate($value, $htmlname, 1, 1, 1, 'form'.$htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm);
301 301
 				} elseif (preg_match('/^select;/', $typeofdata)) {
302 302
 					$arraydata = explode(',', preg_replace('/^select;/', '', $typeofdata));
303 303
 					$arraylist = array();
@@ -311,7 +311,7 @@  discard block
 block discarded – undo
311 311
 					// TODO Not yet implemented. See code for extrafields
312 312
 				} elseif (preg_match('/^ckeditor/', $typeofdata)) {
313 313
 					$tmp = explode(':', $typeofdata); // Example: ckeditor:dolibarr_zzz:width:height:savemethod:toolbarstartexpanded:rows:cols:uselocalbrowser
314
-					require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';
314
+					require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
315 315
 					$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]));
316 316
 					$ret .= $doleditor->Create(1);
317 317
 				} elseif ($typeofdata == 'asis') {
@@ -326,19 +326,19 @@  discard block
 block discarded – undo
326 326
 					$ret .= '<td>';
327 327
 				}
328 328
 				//else $ret.='<div class="clearboth"></div>';
329
-				$ret .= '<input type="submit" class="smallpaddingimp button' . (empty($notabletag) ? '' : ' ') . '" name="modify" value="' . $langs->trans("Modify") . '">';
329
+				$ret .= '<input type="submit" class="smallpaddingimp button'.(empty($notabletag) ? '' : ' ').'" name="modify" value="'.$langs->trans("Modify").'">';
330 330
 				if (preg_match('/ckeditor|textarea/', $typeofdata) && empty($notabletag)) {
331
-					$ret .= '<br>' . "\n";
331
+					$ret .= '<br>'."\n";
332 332
 				}
333
-				$ret .= '<input type="submit" class="smallpaddingimp button button-cancel' . (empty($notabletag) ? '' : ' ') . '" name="cancel" value="' . $langs->trans("Cancel") . '">';
333
+				$ret .= '<input type="submit" class="smallpaddingimp button button-cancel'.(empty($notabletag) ? '' : ' ').'" name="cancel" value="'.$langs->trans("Cancel").'">';
334 334
 				if (empty($notabletag)) {
335 335
 					$ret .= '</td>';
336 336
 				}
337 337
 
338 338
 				if (empty($notabletag)) {
339
-					$ret .= '</tr></table>' . "\n";
339
+					$ret .= '</tr></table>'."\n";
340 340
 				}
341
-				$ret .= '</form>' . "\n";
341
+				$ret .= '</form>'."\n";
342 342
 			} else {		// view mode
343 343
 				if (preg_match('/^email/', $typeofdata)) {
344 344
 					$ret .= dol_print_email($value, 0, 0, 0, 0, 1);
@@ -350,15 +350,15 @@  discard block
 block discarded – undo
350 350
 					$ret .= ($value != '' ? price($value, '', $langs, 0, -1, -1, $conf->currency) : '');
351 351
 				} elseif (preg_match('/^checkbox/', $typeofdata)) {
352 352
 					$tmp = explode(':', $typeofdata);
353
-					$ret .= '<input type="checkbox" disabled id="' . $htmlname . '" name="' . $htmlname . '" value="' . $value . '"' . ($value ? ' checked' : '') . ($tmp[1] ? $tmp[1] : '') . '/>';
353
+					$ret .= '<input type="checkbox" disabled id="'.$htmlname.'" name="'.$htmlname.'" value="'.$value.'"'.($value ? ' checked' : '').($tmp[1] ? $tmp[1] : '').'/>';
354 354
 				} elseif (preg_match('/^text/', $typeofdata) || preg_match('/^note/', $typeofdata)) {
355 355
 					$ret .= dol_htmlwithnojs(dol_string_onlythesehtmltags(dol_htmlentitiesbr($value), 1, 1, 1));
356 356
 				} elseif (preg_match('/^(safehtmlstring|restricthtml)/', $typeofdata)) {	// 'restricthtml' is not an allowed type for editfieldval. Value is 'safehtmlstring'
357 357
 					$ret .= dol_htmlwithnojs(dol_string_onlythesehtmltags($value));
358 358
 				} elseif ($typeofdata == 'day' || $typeofdata == 'datepicker') {
359
-					$ret .= '<span class="valuedate">' . dol_print_date($value, 'day', $gm) . '</span>';
359
+					$ret .= '<span class="valuedate">'.dol_print_date($value, 'day', $gm).'</span>';
360 360
 				} elseif ($typeofdata == 'dayhour' || $typeofdata == 'datehourpicker') {
361
-					$ret .= '<span class="valuedate">' . dol_print_date($value, 'dayhour', $gm) . '</span>';
361
+					$ret .= '<span class="valuedate">'.dol_print_date($value, 'dayhour', $gm).'</span>';
362 362
 				} elseif (preg_match('/^select;/', $typeofdata)) {
363 363
 					$arraydata = explode(',', preg_replace('/^select;/', '', $typeofdata));
364 364
 					$arraylist = array();
@@ -369,9 +369,9 @@  discard block
 block discarded – undo
369 369
 					$ret .= $arraylist[$value];
370 370
 					if ($htmlname == 'fk_product_type') {
371 371
 						if ($value == 0) {
372
-							$ret = img_picto($langs->trans("Product"), 'product', 'class="paddingleftonly paddingrightonly colorgrey"') . $ret;
372
+							$ret = img_picto($langs->trans("Product"), 'product', 'class="paddingleftonly paddingrightonly colorgrey"').$ret;
373 373
 						} else {
374
-							$ret = img_picto($langs->trans("Service"), 'service', 'class="paddingleftonly paddingrightonly colorgrey"') . $ret;
374
+							$ret = img_picto($langs->trans("Service"), 'service', 'class="paddingleftonly paddingrightonly colorgrey"').$ret;
375 375
 						}
376 376
 					}
377 377
 				} elseif (preg_match('/^ckeditor/', $typeofdata)) {
@@ -379,7 +379,7 @@  discard block
 block discarded – undo
379 379
 					if (!empty($conf->global->MAIN_DISABLE_NOTES_TAB)) {
380 380
 						$firstline = preg_replace('/<br>.*/', '', $tmpcontent);
381 381
 						$firstline = preg_replace('/[\n\r].*/', '', $firstline);
382
-						$tmpcontent = $firstline . ((strlen($firstline) != strlen($tmpcontent)) ? '...' : '');
382
+						$tmpcontent = $firstline.((strlen($firstline) != strlen($tmpcontent)) ? '...' : '');
383 383
 					}
384 384
 					// We dont use dol_escape_htmltag to get the html formating active, but this need we must also
385 385
 					// clean data from some dangerous html
@@ -388,7 +388,7 @@  discard block
 block discarded – undo
388 388
 					if (empty($moreoptions['valuealreadyhtmlescaped'])) {
389 389
 						$ret .= dol_escape_htmltag($value);
390 390
 					} else {
391
-						$ret .= $value;        // $value must be already html escaped.
391
+						$ret .= $value; // $value must be already html escaped.
392 392
 					}
393 393
 				}
394 394
 
@@ -426,7 +426,7 @@  discard block
 block discarded – undo
426 426
 
427 427
 		if (is_array($arrayoflangcode) && count($arrayoflangcode)) {
428 428
 			if (!is_object($extralanguages)) {
429
-				include_once DOL_DOCUMENT_ROOT . '/core/class/extralanguages.class.php';
429
+				include_once DOL_DOCUMENT_ROOT.'/core/class/extralanguages.class.php';
430 430
 				$extralanguages = new ExtraLanguages($this->db);
431 431
 			}
432 432
 			$extralanguages->fetch_name_extralanguages('societe');
@@ -435,17 +435,17 @@  discard block
 block discarded – undo
435 435
 				return ''; // No extralang field to show
436 436
 			}
437 437
 
438
-			$result .= '<!-- Widget for translation -->' . "\n";
439
-			$result .= '<div class="inline-block paddingleft image-' . $object->element . '-' . $fieldname . '">';
438
+			$result .= '<!-- Widget for translation -->'."\n";
439
+			$result .= '<div class="inline-block paddingleft image-'.$object->element.'-'.$fieldname.'">';
440 440
 			$s = img_picto($langs->trans("ShowOtherLanguages"), 'language', '', false, 0, 0, '', 'fa-15 editfieldlang');
441 441
 			$result .= $s;
442 442
 			$result .= '</div>';
443 443
 
444
-			$result .= '<div class="inline-block hidden field-' . $object->element . '-' . $fieldname . '">';
444
+			$result .= '<div class="inline-block hidden field-'.$object->element.'-'.$fieldname.'">';
445 445
 
446 446
 			$resultforextrlang = '';
447 447
 			foreach ($arrayoflangcode as $langcode) {
448
-				$valuetoshow = GETPOSTISSET('field-' . $object->element . "-" . $fieldname . "-" . $langcode) ? GETPOST('field-' . $object->element . '-' . $fieldname . "-" . $langcode, $check) : '';
448
+				$valuetoshow = GETPOSTISSET('field-'.$object->element."-".$fieldname."-".$langcode) ? GETPOST('field-'.$object->element.'-'.$fieldname."-".$langcode, $check) : '';
449 449
 				if (empty($valuetoshow)) {
450 450
 					$object->fetchValuesForExtraLanguages();
451 451
 					//var_dump($object->array_languages);
@@ -457,17 +457,17 @@  discard block
 block discarded – undo
457 457
 
458 458
 				// TODO Use the showInputField() method of ExtraLanguages object
459 459
 				if ($typeofdata == 'textarea') {
460
-					$resultforextrlang .= '<textarea name="field-' . $object->element . "-" . $fieldname . "-" . $langcode . '" id="' . $fieldname . "-" . $langcode . '" class="' . $morecss . '" rows="' . ROWS_2 . '" wrap="soft">';
460
+					$resultforextrlang .= '<textarea name="field-'.$object->element."-".$fieldname."-".$langcode.'" id="'.$fieldname."-".$langcode.'" class="'.$morecss.'" rows="'.ROWS_2.'" wrap="soft">';
461 461
 					$resultforextrlang .= $valuetoshow;
462 462
 					$resultforextrlang .= '</textarea>';
463 463
 				} else {
464
-					$resultforextrlang .= '<input type="text" class="inputfieldforlang ' . ($morecss ? ' ' . $morecss : '') . '" name="field-' . $object->element . '-' . $fieldname . '-' . $langcode . '" value="' . $valuetoshow . '">';
464
+					$resultforextrlang .= '<input type="text" class="inputfieldforlang '.($morecss ? ' '.$morecss : '').'" name="field-'.$object->element.'-'.$fieldname.'-'.$langcode.'" value="'.$valuetoshow.'">';
465 465
 				}
466 466
 			}
467 467
 			$result .= $resultforextrlang;
468 468
 
469 469
 			$result .= '</div>';
470
-			$result .= '<script nonce="' . getNonce() . '">$(".image-' . $object->element . '-' . $fieldname . '").click(function() { console.log("Toggle lang widget"); jQuery(".field-' . $object->element . '-' . $fieldname . '").toggle(); });</script>';
470
+			$result .= '<script nonce="'.getNonce().'">$(".image-'.$object->element.'-'.$fieldname.'").click(function() { console.log("Toggle lang widget"); jQuery(".field-'.$object->element.'-'.$fieldname.'").toggle(); });</script>';
471 471
 		}
472 472
 
473 473
 		return $result;
@@ -532,7 +532,7 @@  discard block
 block discarded – undo
532 532
 				if (!empty($tmp[2])) {
533 533
 					$savemethod = $tmp[2];
534 534
 				}
535
-				$out .= '<input id="width_' . $htmlname . '" value="' . $inputOption . '" type="hidden"/>' . "\n";
535
+				$out .= '<input id="width_'.$htmlname.'" value="'.$inputOption.'" type="hidden"/>'."\n";
536 536
 			} elseif ((preg_match('/^day$/', $inputType)) || (preg_match('/^datepicker/', $inputType)) || (preg_match('/^datehourpicker/', $inputType))) {
537 537
 				$tmp = explode(':', $inputType);
538 538
 				$inputType = $tmp[0];
@@ -543,7 +543,7 @@  discard block
 block discarded – undo
543 543
 					$savemethod = $tmp[2];
544 544
 				}
545 545
 
546
-				$out .= '<input id="timestamp" type="hidden"/>' . "\n"; // Use for timestamp format
546
+				$out .= '<input id="timestamp" type="hidden"/>'."\n"; // Use for timestamp format
547 547
 			} elseif (preg_match('/^(select|autocomplete)/', $inputType)) {
548 548
 				$tmp = explode(':', $inputType);
549 549
 				$inputType = $tmp[0];
@@ -574,40 +574,40 @@  discard block
 block discarded – undo
574 574
 				}
575 575
 
576 576
 				if (isModEnabled('fckeditor')) {
577
-					$out .= '<input id="ckeditor_toolbar" value="' . $toolbar . '" type="hidden"/>' . "\n";
577
+					$out .= '<input id="ckeditor_toolbar" value="'.$toolbar.'" type="hidden"/>'."\n";
578 578
 				} else {
579 579
 					$inputType = 'textarea';
580 580
 				}
581 581
 			}
582 582
 
583
-			$out .= '<input id="element_' . $htmlname . '" value="' . $element . '" type="hidden"/>' . "\n";
584
-			$out .= '<input id="table_element_' . $htmlname . '" value="' . $table_element . '" type="hidden"/>' . "\n";
585
-			$out .= '<input id="fk_element_' . $htmlname . '" value="' . $fk_element . '" type="hidden"/>' . "\n";
586
-			$out .= '<input id="loadmethod_' . $htmlname . '" value="' . $loadmethod . '" type="hidden"/>' . "\n";
583
+			$out .= '<input id="element_'.$htmlname.'" value="'.$element.'" type="hidden"/>'."\n";
584
+			$out .= '<input id="table_element_'.$htmlname.'" value="'.$table_element.'" type="hidden"/>'."\n";
585
+			$out .= '<input id="fk_element_'.$htmlname.'" value="'.$fk_element.'" type="hidden"/>'."\n";
586
+			$out .= '<input id="loadmethod_'.$htmlname.'" value="'.$loadmethod.'" type="hidden"/>'."\n";
587 587
 			if (!empty($savemethod)) {
588
-				$out .= '<input id="savemethod_' . $htmlname . '" value="' . $savemethod . '" type="hidden"/>' . "\n";
588
+				$out .= '<input id="savemethod_'.$htmlname.'" value="'.$savemethod.'" type="hidden"/>'."\n";
589 589
 			}
590 590
 			if (!empty($ext_element)) {
591
-				$out .= '<input id="ext_element_' . $htmlname . '" value="' . $ext_element . '" type="hidden"/>' . "\n";
591
+				$out .= '<input id="ext_element_'.$htmlname.'" value="'.$ext_element.'" type="hidden"/>'."\n";
592 592
 			}
593 593
 			if (!empty($custommsg)) {
594 594
 				if (is_array($custommsg)) {
595 595
 					if (!empty($custommsg['success'])) {
596
-						$out .= '<input id="successmsg_' . $htmlname . '" value="' . $custommsg['success'] . '" type="hidden"/>' . "\n";
596
+						$out .= '<input id="successmsg_'.$htmlname.'" value="'.$custommsg['success'].'" type="hidden"/>'."\n";
597 597
 					}
598 598
 					if (!empty($custommsg['error'])) {
599
-						$out .= '<input id="errormsg_' . $htmlname . '" value="' . $custommsg['error'] . '" type="hidden"/>' . "\n";
599
+						$out .= '<input id="errormsg_'.$htmlname.'" value="'.$custommsg['error'].'" type="hidden"/>'."\n";
600 600
 					}
601 601
 				} else {
602
-					$out .= '<input id="successmsg_' . $htmlname . '" value="' . $custommsg . '" type="hidden"/>' . "\n";
602
+					$out .= '<input id="successmsg_'.$htmlname.'" value="'.$custommsg.'" type="hidden"/>'."\n";
603 603
 				}
604 604
 			}
605 605
 			if ($inputType == 'textarea') {
606
-				$out .= '<input id="textarea_' . $htmlname . '_rows" value="' . $rows . '" type="hidden"/>' . "\n";
607
-				$out .= '<input id="textarea_' . $htmlname . '_cols" value="' . $cols . '" type="hidden"/>' . "\n";
606
+				$out .= '<input id="textarea_'.$htmlname.'_rows" value="'.$rows.'" type="hidden"/>'."\n";
607
+				$out .= '<input id="textarea_'.$htmlname.'_cols" value="'.$cols.'" type="hidden"/>'."\n";
608 608
 			}
609
-			$out .= '<span id="viewval_' . $htmlname . '" class="viewval_' . $inputType . ($button_only ? ' inactive' : ' active') . '">' . $value . '</span>' . "\n";
610
-			$out .= '<span id="editval_' . $htmlname . '" class="editval_' . $inputType . ($button_only ? ' inactive' : ' active') . ' hideobject">' . (!empty($editvalue) ? $editvalue : $value) . '</span>' . "\n";
609
+			$out .= '<span id="viewval_'.$htmlname.'" class="viewval_'.$inputType.($button_only ? ' inactive' : ' active').'">'.$value.'</span>'."\n";
610
+			$out .= '<span id="editval_'.$htmlname.'" class="editval_'.$inputType.($button_only ? ' inactive' : ' active').' hideobject">'.(!empty($editvalue) ? $editvalue : $value).'</span>'."\n";
611 611
 		} else {
612 612
 			$out = $value;
613 613
 		}
@@ -636,12 +636,12 @@  discard block
 block discarded – undo
636 636
 	public function textwithtooltip($text, $htmltext, $tooltipon = 1, $direction = 0, $img = '', $extracss = '', $notabs = 3, $incbefore = '', $noencodehtmltext = 0, $tooltiptrigger = '', $forcenowrap = 0)
637 637
 	{
638 638
 		if ($incbefore) {
639
-			$text = $incbefore . $text;
639
+			$text = $incbefore.$text;
640 640
 		}
641 641
 		if (!$htmltext) {
642 642
 			return $text;
643 643
 		}
644
-		$direction = (int) $direction;    // For backward compatibility when $direction was set to '' instead of 0
644
+		$direction = (int) $direction; // For backward compatibility when $direction was set to '' instead of 0
645 645
 
646 646
 		$tag = 'td';
647 647
 		if ($notabs == 2) {
@@ -655,11 +655,11 @@  discard block
 block discarded – undo
655 655
 
656 656
 		$extrastyle = '';
657 657
 		if ($direction < 0) {
658
-			$extracss = ($extracss ? $extracss . ' ' : '') . ($notabs != 3 ? 'inline-block' : '');
658
+			$extracss = ($extracss ? $extracss.' ' : '').($notabs != 3 ? 'inline-block' : '');
659 659
 			$extrastyle = 'padding: 0px; padding-left: 3px;';
660 660
 		}
661 661
 		if ($direction > 0) {
662
-			$extracss = ($extracss ? $extracss . ' ' : '') . ($notabs != 3 ? 'inline-block' : '');
662
+			$extracss = ($extracss ? $extracss.' ' : '').($notabs != 3 ? 'inline-block' : '');
663 663
 			$extrastyle = 'padding: 0px; padding-right: 3px;';
664 664
 		}
665 665
 
@@ -672,53 +672,53 @@  discard block
 block discarded – undo
672 672
 			$htmltext = str_replace('"', '&quot;', $htmltext);
673 673
 		} else {
674 674
 			$classfortooltip = 'classfortooltiponclick';
675
-			$textfordialog .= '<div style="display: none;" id="idfortooltiponclick_' . $tooltiptrigger . '" class="classfortooltiponclicktext">' . $htmltext . '</div>';
675
+			$textfordialog .= '<div style="display: none;" id="idfortooltiponclick_'.$tooltiptrigger.'" class="classfortooltiponclicktext">'.$htmltext.'</div>';
676 676
 		}
677 677
 		if ($tooltipon == 2 || $tooltipon == 3) {
678
-			$paramfortooltipimg = ' class="' . $classfortooltip . ($notabs != 3 ? ' inline-block' : '') . ($extracss ? ' ' . $extracss : '') . '" style="padding: 0px;' . ($extrastyle ? ' ' . $extrastyle : '') . '"';
678
+			$paramfortooltipimg = ' class="'.$classfortooltip.($notabs != 3 ? ' inline-block' : '').($extracss ? ' '.$extracss : '').'" style="padding: 0px;'.($extrastyle ? ' '.$extrastyle : '').'"';
679 679
 			if ($tooltiptrigger == '') {
680
-				$paramfortooltipimg .= ' title="' . ($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)) . '"'; // Attribut to put on img tag to store tooltip
680
+				$paramfortooltipimg .= ' title="'.($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)).'"'; // Attribut to put on img tag to store tooltip
681 681
 			} else {
682
-				$paramfortooltipimg .= ' dolid="' . $tooltiptrigger . '"';
682
+				$paramfortooltipimg .= ' dolid="'.$tooltiptrigger.'"';
683 683
 			}
684 684
 		} else {
685
-			$paramfortooltipimg = ($extracss ? ' class="' . $extracss . '"' : '') . ($extrastyle ? ' style="' . $extrastyle . '"' : ''); // Attribut to put on td text tag
685
+			$paramfortooltipimg = ($extracss ? ' class="'.$extracss.'"' : '').($extrastyle ? ' style="'.$extrastyle.'"' : ''); // Attribut to put on td text tag
686 686
 		}
687 687
 		if ($tooltipon == 1 || $tooltipon == 3) {
688
-			$paramfortooltiptd = ' class="' . ($tooltipon == 3 ? 'cursorpointer ' : '') . $classfortooltip . ' inline-block' . ($extracss ? ' ' . $extracss : '') . '" style="padding: 0px;' . ($extrastyle ? ' ' . $extrastyle : '') . '" ';
688
+			$paramfortooltiptd = ' class="'.($tooltipon == 3 ? 'cursorpointer ' : '').$classfortooltip.' inline-block'.($extracss ? ' '.$extracss : '').'" style="padding: 0px;'.($extrastyle ? ' '.$extrastyle : '').'" ';
689 689
 			if ($tooltiptrigger == '') {
690
-				$paramfortooltiptd .= ' title="' . ($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)) . '"'; // Attribut to put on td tag to store tooltip
690
+				$paramfortooltiptd .= ' title="'.($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)).'"'; // Attribut to put on td tag to store tooltip
691 691
 			} else {
692
-				$paramfortooltiptd .= ' dolid="' . $tooltiptrigger . '"';
692
+				$paramfortooltiptd .= ' dolid="'.$tooltiptrigger.'"';
693 693
 			}
694 694
 		} else {
695
-			$paramfortooltiptd = ($extracss ? ' class="' . $extracss . '"' : '') . ($extrastyle ? ' style="' . $extrastyle . '"' : ''); // Attribut to put on td text tag
695
+			$paramfortooltiptd = ($extracss ? ' class="'.$extracss.'"' : '').($extrastyle ? ' style="'.$extrastyle.'"' : ''); // Attribut to put on td text tag
696 696
 		}
697 697
 		if (empty($notabs)) {
698 698
 			$s .= '<table class="nobordernopadding"><tr style="height: auto;">';
699 699
 		} elseif ($notabs == 2) {
700
-			$s .= '<div class="inline-block' . ($forcenowrap ? ' nowrap' : '') . '">';
700
+			$s .= '<div class="inline-block'.($forcenowrap ? ' nowrap' : '').'">';
701 701
 		}
702 702
 		// Define value if value is before
703 703
 		if ($direction < 0) {
704
-			$s .= '<' . $tag . $paramfortooltipimg;
704
+			$s .= '<'.$tag.$paramfortooltipimg;
705 705
 			if ($tag == 'td') {
706 706
 				$s .= ' class="valigntop" width="14"';
707 707
 			}
708
-			$s .= '>' . $textfordialog . $img . '</' . $tag . '>';
708
+			$s .= '>'.$textfordialog.$img.'</'.$tag.'>';
709 709
 		}
710 710
 		// Use another method to help avoid having a space in value in order to use this value with jquery
711 711
 		// Define label
712 712
 		if ((string) $text != '') {
713
-			$s .= '<' . $tag . $paramfortooltiptd . '>' . $text . '</' . $tag . '>';
713
+			$s .= '<'.$tag.$paramfortooltiptd.'>'.$text.'</'.$tag.'>';
714 714
 		}
715 715
 		// Define value if value is after
716 716
 		if ($direction > 0) {
717
-			$s .= '<' . $tag . $paramfortooltipimg;
717
+			$s .= '<'.$tag.$paramfortooltipimg;
718 718
 			if ($tag == 'td') {
719 719
 				$s .= ' class="valignmiddle" width="14"';
720 720
 			}
721
-			$s .= '>' . $textfordialog . $img . '</' . $tag . '>';
721
+			$s .= '>'.$textfordialog.$img.'</'.$tag.'>';
722 722
 		}
723 723
 		if (empty($notabs)) {
724 724
 			$s .= '</tr></table>';
@@ -823,7 +823,7 @@  discard block
 block discarded – undo
823 823
 
824 824
 		$disabled = 0;
825 825
 		$ret = '<div class="centpercent center">';
826
-		$ret .= '<select class="flat' . (empty($conf->use_javascript_ajax) ? '' : ' hideobject') . ' ' . $name . ' ' . $name . 'select valignmiddle alignstart" id="' . $name . '" name="' . $name . '"' . ($disabled ? ' disabled="disabled"' : '') . '>';
826
+		$ret .= '<select class="flat'.(empty($conf->use_javascript_ajax) ? '' : ' hideobject').' '.$name.' '.$name.'select valignmiddle alignstart" id="'.$name.'" name="'.$name.'"'.($disabled ? ' disabled="disabled"' : '').'>';
827 827
 
828 828
 		// 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.
829 829
 		$parameters = array();
@@ -833,9 +833,9 @@  discard block
 block discarded – undo
833 833
 			return;
834 834
 		}
835 835
 		if (empty($reshook)) {
836
-			$ret .= '<option value="0"' . ($disabled ? ' disabled="disabled"' : '') . '>-- ' . $langs->trans("SelectAction") . ' --</option>';
836
+			$ret .= '<option value="0"'.($disabled ? ' disabled="disabled"' : '').'>-- '.$langs->trans("SelectAction").' --</option>';
837 837
 			foreach ($arrayofaction as $code => $label) {
838
-				$ret .= '<option value="' . $code . '"' . ($disabled ? ' disabled="disabled"' : '') . ' data-html="' . dol_escape_htmltag($label) . '">' . $label . '</option>';
838
+				$ret .= '<option value="'.$code.'"'.($disabled ? ' disabled="disabled"' : '').' data-html="'.dol_escape_htmltag($label).'">'.$label.'</option>';
839 839
 			}
840 840
 		}
841 841
 		$ret .= $hookmanager->resPrint;
@@ -843,17 +843,17 @@  discard block
 block discarded – undo
843 843
 		$ret .= '</select>';
844 844
 
845 845
 		if (empty($conf->dol_optimize_smallscreen)) {
846
-			$ret .= ajax_combobox('.' . $name . 'select');
846
+			$ret .= ajax_combobox('.'.$name.'select');
847 847
 		}
848 848
 
849 849
 		// 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
850 850
 		$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.
851
-		$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")) . '">';
851
+		$ret .= '<input type="submit" disabled name="confirmmassaction"'.(empty($conf->use_javascript_ajax) ? '' : ' style="display: none"').' class="reposition button smallpaddingimp'.(empty($conf->use_javascript_ajax) ? '' : ' hideobject').' '.$name.' '.$name.'confirmed" value="'.dol_escape_htmltag($langs->trans("Confirm")).'">';
852 852
 		$ret .= '</div>';
853 853
 
854 854
 		if (!empty($conf->use_javascript_ajax)) {
855 855
 			$ret .= '<!-- JS CODE TO ENABLE mass action select -->
856
-    		<script nonce="' . getNonce() . '">
856
+    		<script nonce="' . getNonce().'">
857 857
                         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 */
858 858
         		{
859 859
         			atleastoneselected=0;
@@ -864,11 +864,11 @@  discard block
 block discarded – undo
864 864
 
865 865
 					console.log("initCheckForSelect mode="+mode+" name="+name+" cssclass="+cssclass+" atleastoneselected="+atleastoneselected);
866 866
 
867
-    	  			if (atleastoneselected || ' . $alwaysvisible . ')
867
+    	  			if (atleastoneselected || ' . $alwaysvisible.')
868 868
     	  			{
869 869
                                     jQuery("."+name).show();
870
-        			    ' . ($selected ? 'if (atleastoneselected) { jQuery("."+name+"select").val("' . $selected . '").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', false); }' : '') . '
871
-        			    ' . ($selected ? 'if (! atleastoneselected) { jQuery("."+name+"select").val("0").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', true); } ' : '') . '
870
+        			    ' . ($selected ? 'if (atleastoneselected) { jQuery("."+name+"select").val("'.$selected.'").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', false); }' : '').'
871
+        			    ' . ($selected ? 'if (! atleastoneselected) { jQuery("."+name+"select").val("0").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', true); } ' : '').'
872 872
     	  			}
873 873
     	  			else
874 874
     	  			{
@@ -878,11 +878,11 @@  discard block
 block discarded – undo
878 878
         		}
879 879
 
880 880
         	jQuery(document).ready(function () {
881
-                    initCheckForSelect(0, "' . $name . '", "' . $cssclass . '");
882
-                    jQuery(".' . $cssclass . '").click(function() {
883
-                        initCheckForSelect(1, "' . $name . '", "' . $cssclass . '");
881
+                    initCheckForSelect(0, "' . $name.'", "'.$cssclass.'");
882
+                    jQuery(".' . $cssclass.'").click(function() {
883
+                        initCheckForSelect(1, "' . $name.'", "'.$cssclass.'");
884 884
                     });
885
-                        jQuery(".' . $name . 'select").change(function() {
885
+                        jQuery(".' . $name.'select").change(function() {
886 886
         			var massaction = $( this ).val();
887 887
         			var urlform = $( this ).closest("form").attr("action").replace("#show_files","");
888 888
         			if (massaction == "builddoc")
@@ -890,18 +890,18 @@  discard block
 block discarded – undo
890 890
                         urlform = urlform + "#show_files";
891 891
     	            }
892 892
         			$( this ).closest("form").attr("action", urlform);
893
-                    console.log("we select a mass action name=' . $name . ' massaction="+massaction+" - "+urlform);
893
+                    console.log("we select a mass action name=' . $name.' massaction="+massaction+" - "+urlform);
894 894
         	        /* Warning: if you set submit button to disabled, post using Enter will no more work if there is no other button */
895 895
         			if ($(this).val() != \'0\')
896 896
     	  			{
897
-                                        jQuery(".' . $name . 'confirmed").prop(\'disabled\', false);
898
-										jQuery(".' . $name . 'other").hide();	/* To disable if another div was open */
899
-                                        jQuery(".' . $name . '"+massaction).show();
897
+                                        jQuery(".' . $name.'confirmed").prop(\'disabled\', false);
898
+										jQuery(".' . $name.'other").hide();	/* To disable if another div was open */
899
+                                        jQuery(".' . $name.'"+massaction).show();
900 900
     	  			}
901 901
     	  			else
902 902
     	  			{
903
-                                        jQuery(".' . $name . 'confirmed").prop(\'disabled\', true);
904
-										jQuery(".' . $name . 'other").hide();	/* To disable any div open */
903
+                                        jQuery(".' . $name.'confirmed").prop(\'disabled\', true);
904
+										jQuery(".' . $name.'other").hide();	/* To disable any div open */
905 905
     	  			}
906 906
     	        });
907 907
         	});
@@ -944,14 +944,14 @@  discard block
 block discarded – undo
944 944
 		$atleastonefavorite = 0;
945 945
 
946 946
 		$sql = "SELECT rowid, code as code_iso, code_iso as code_iso3, label, favorite, eec";
947
-		$sql .= " FROM " . $this->db->prefix() . "c_country";
947
+		$sql .= " FROM ".$this->db->prefix()."c_country";
948 948
 		$sql .= " WHERE active > 0";
949 949
 		//$sql.= " ORDER BY code ASC";
950 950
 
951
-		dol_syslog(get_class($this) . "::select_country", LOG_DEBUG);
951
+		dol_syslog(get_class($this)."::select_country", LOG_DEBUG);
952 952
 		$resql = $this->db->query($sql);
953 953
 		if ($resql) {
954
-			$out .= '<select id="select' . $htmlname . '" class="flat maxwidth200onsmartphone selectcountry' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" ' . $htmloption . '>';
954
+			$out .= '<select id="select'.$htmlname.'" class="flat maxwidth200onsmartphone selectcountry'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" '.$htmloption.'>';
955 955
 			$num = $this->db->num_rows($resql);
956 956
 			$i = 0;
957 957
 			if ($num) {
@@ -961,7 +961,7 @@  discard block
 block discarded – undo
961 961
 					$countryArray[$i]['rowid'] = $obj->rowid;
962 962
 					$countryArray[$i]['code_iso'] = $obj->code_iso;
963 963
 					$countryArray[$i]['code_iso3'] = $obj->code_iso3;
964
-					$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 : ''));
964
+					$countryArray[$i]['label'] = ($obj->code_iso && $langs->transnoentitiesnoconv("Country".$obj->code_iso) != "Country".$obj->code_iso ? $langs->transnoentitiesnoconv("Country".$obj->code_iso) : ($obj->label != '-' ? $obj->label : ''));
965 965
 					$countryArray[$i]['favorite'] = $obj->favorite;
966 966
 					$countryArray[$i]['eec'] = $obj->eec;
967 967
 					$favorite[$i] = $obj->favorite;
@@ -979,20 +979,20 @@  discard block
 block discarded – undo
979 979
 
980 980
 				if ($showempty) {
981 981
 					if (is_numeric($showempty)) {
982
-						$out .= '<option value="">&nbsp;</option>' . "\n";
982
+						$out .= '<option value="">&nbsp;</option>'."\n";
983 983
 					} else {
984
-						$out .= '<option value="-1">' . $langs->trans($showempty) . '</option>' . "\n";
984
+						$out .= '<option value="-1">'.$langs->trans($showempty).'</option>'."\n";
985 985
 					}
986 986
 				}
987 987
 
988 988
 				if ($addspecialentries) {    // Add dedicated entries for groups of countries
989 989
 					//if ($showempty) $out.= '<option value="" disabled class="selectoptiondisabledwhite">--------------</option>';
990
-					$out .= '<option value="special_allnotme"' . ($selected == 'special_allnotme' ? ' selected' : '') . '>' . $langs->trans("CountriesExceptMe", $langs->transnoentitiesnoconv("Country" . $mysoc->country_code)) . '</option>';
991
-					$out .= '<option value="special_eec"' . ($selected == 'special_eec' ? ' selected' : '') . '>' . $langs->trans("CountriesInEEC") . '</option>';
990
+					$out .= '<option value="special_allnotme"'.($selected == 'special_allnotme' ? ' selected' : '').'>'.$langs->trans("CountriesExceptMe", $langs->transnoentitiesnoconv("Country".$mysoc->country_code)).'</option>';
991
+					$out .= '<option value="special_eec"'.($selected == 'special_eec' ? ' selected' : '').'>'.$langs->trans("CountriesInEEC").'</option>';
992 992
 					if ($mysoc->isInEEC()) {
993
-						$out .= '<option value="special_eecnotme"' . ($selected == 'special_eecnotme' ? ' selected' : '') . '>' . $langs->trans("CountriesInEECExceptMe", $langs->transnoentitiesnoconv("Country" . $mysoc->country_code)) . '</option>';
993
+						$out .= '<option value="special_eecnotme"'.($selected == 'special_eecnotme' ? ' selected' : '').'>'.$langs->trans("CountriesInEECExceptMe", $langs->transnoentitiesnoconv("Country".$mysoc->country_code)).'</option>';
994 994
 					}
995
-					$out .= '<option value="special_noteec"' . ($selected == 'special_noteec' ? ' selected' : '') . '>' . $langs->trans("CountriesNotInEEC") . '</option>';
995
+					$out .= '<option value="special_noteec"'.($selected == 'special_noteec' ? ' selected' : '').'>'.$langs->trans("CountriesNotInEEC").'</option>';
996 996
 					$out .= '<option value="" disabled class="selectoptiondisabledwhite">------------</option>';
997 997
 				}
998 998
 
@@ -1020,20 +1020,20 @@  discard block
 block discarded – undo
1020 1020
 						$labeltoshow .= '&nbsp;';
1021 1021
 					}
1022 1022
 					if ($row['code_iso']) {
1023
-						$labeltoshow .= ' <span class="opacitymedium">(' . $row['code_iso'] . ')</span>';
1023
+						$labeltoshow .= ' <span class="opacitymedium">('.$row['code_iso'].')</span>';
1024 1024
 						if (empty($hideflags)) {
1025 1025
 							$tmpflag = picto_from_langcode($row['code_iso'], 'class="saturatemedium paddingrightonly"', 1);
1026
-							$labeltoshow = $tmpflag . ' ' . $labeltoshow;
1026
+							$labeltoshow = $tmpflag.' '.$labeltoshow;
1027 1027
 						}
1028 1028
 					}
1029 1029
 
1030 1030
 					if ($selected && $selected != '-1' && ($selected == $row['rowid'] || $selected == $row['code_iso'] || $selected == $row['code_iso3'] || $selected == $row['label'])) {
1031
-						$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']) . '">';
1031
+						$out .= '<option value="'.($usecodeaskey ? ($usecodeaskey == 'code2' ? $row['code_iso'] : $row['code_iso3']) : $row['rowid']).'" selected data-html="'.dol_escape_htmltag($labeltoshow).'" data-eec="'.((int) $row['eec']).'">';
1032 1032
 					} else {
1033
-						$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']) . '">';
1033
+						$out .= '<option value="'.($usecodeaskey ? ($usecodeaskey == 'code2' ? $row['code_iso'] : $row['code_iso3']) : $row['rowid']).'" data-html="'.dol_escape_htmltag($labeltoshow).'" data-eec="'.((int) $row['eec']).'">';
1034 1034
 					}
1035 1035
 					$out .= $labeltoshow;
1036
-					$out .= '</option>' . "\n";
1036
+					$out .= '</option>'."\n";
1037 1037
 				}
1038 1038
 			}
1039 1039
 			$out .= '</select>';
@@ -1042,8 +1042,8 @@  discard block
 block discarded – undo
1042 1042
 		}
1043 1043
 
1044 1044
 		// Make select dynamic
1045
-		include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
1046
-		$out .= ajax_combobox('select' . $htmlname, array(), 0, 0, 'resolve');
1045
+		include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
1046
+		$out .= ajax_combobox('select'.$htmlname, array(), 0, 0, 'resolve');
1047 1047
 
1048 1048
 		return $out;
1049 1049
 	}
@@ -1075,25 +1075,25 @@  discard block
 block discarded – undo
1075 1075
 		$incotermArray = array();
1076 1076
 
1077 1077
 		$sql = "SELECT rowid, code";
1078
-		$sql .= " FROM " . $this->db->prefix() . "c_incoterms";
1078
+		$sql .= " FROM ".$this->db->prefix()."c_incoterms";
1079 1079
 		$sql .= " WHERE active > 0";
1080 1080
 		$sql .= " ORDER BY code ASC";
1081 1081
 
1082
-		dol_syslog(get_class($this) . "::select_incoterm", LOG_DEBUG);
1082
+		dol_syslog(get_class($this)."::select_incoterm", LOG_DEBUG);
1083 1083
 		$resql = $this->db->query($sql);
1084 1084
 		if ($resql) {
1085 1085
 			if ($conf->use_javascript_ajax && !$forcecombo) {
1086
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
1086
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
1087 1087
 				$out .= ajax_combobox($htmlname, $events);
1088 1088
 			}
1089 1089
 
1090 1090
 			if (!empty($page)) {
1091
-				$out .= '<form method="post" action="' . $page . '">';
1091
+				$out .= '<form method="post" action="'.$page.'">';
1092 1092
 				$out .= '<input type="hidden" name="action" value="set_incoterms">';
1093
-				$out .= '<input type="hidden" name="token" value="' . newToken() . '">';
1093
+				$out .= '<input type="hidden" name="token" value="'.newToken().'">';
1094 1094
 			}
1095 1095
 
1096
-			$out .= '<select id="' . $htmlname . '" class="flat selectincoterm width75" name="' . $htmlname . '" ' . $htmloption . '>';
1096
+			$out .= '<select id="'.$htmlname.'" class="flat selectincoterm width75" name="'.$htmlname.'" '.$htmloption.'>';
1097 1097
 			$out .= '<option value="0">&nbsp;</option>';
1098 1098
 			$num = $this->db->num_rows($resql);
1099 1099
 			$i = 0;
@@ -1107,9 +1107,9 @@  discard block
 block discarded – undo
1107 1107
 
1108 1108
 				foreach ($incotermArray as $row) {
1109 1109
 					if ($selected && ($selected == $row['rowid'] || $selected == $row['code'])) {
1110
-						$out .= '<option value="' . $row['rowid'] . '" selected>';
1110
+						$out .= '<option value="'.$row['rowid'].'" selected>';
1111 1111
 					} else {
1112
-						$out .= '<option value="' . $row['rowid'] . '">';
1112
+						$out .= '<option value="'.$row['rowid'].'">';
1113 1113
 					}
1114 1114
 
1115 1115
 					if ($row['code']) {
@@ -1122,13 +1122,13 @@  discard block
 block discarded – undo
1122 1122
 			$out .= '</select>';
1123 1123
 
1124 1124
 			if ($conf->use_javascript_ajax && empty($disableautocomplete)) {
1125
-				$out .= ajax_multiautocompleter('location_incoterms', array(), DOL_URL_ROOT . '/core/ajax/locationincoterms.php') . "\n";
1125
+				$out .= ajax_multiautocompleter('location_incoterms', array(), DOL_URL_ROOT.'/core/ajax/locationincoterms.php')."\n";
1126 1126
 				$moreattrib .= ' autocomplete="off"';
1127 1127
 			}
1128
-			$out .= '<input id="location_incoterms" class="maxwidthonsmartphone type="text" name="location_incoterms" value="' . $location_incoterms . '">' . "\n";
1128
+			$out .= '<input id="location_incoterms" class="maxwidthonsmartphone type="text" name="location_incoterms" value="'.$location_incoterms.'">'."\n";
1129 1129
 
1130 1130
 			if (!empty($page)) {
1131
-				$out .= '<input type="submit" class="button valignmiddle smallpaddingimp nomargintop nomarginbottom" value="' . $langs->trans("Modify") . '"></form>';
1131
+				$out .= '<input type="submit" class="button valignmiddle smallpaddingimp nomargintop nomarginbottom" value="'.$langs->trans("Modify").'"></form>';
1132 1132
 			}
1133 1133
 		} else {
1134 1134
 			dol_print_error($this->db);
@@ -1159,9 +1159,9 @@  discard block
 block discarded – undo
1159 1159
 		if ($forceall == 1 || (empty($forceall) && isModEnabled("product") && isModEnabled("service"))
1160 1160
 			|| (empty($forceall) && !isModEnabled('product') && !isModEnabled('service'))) {
1161 1161
 			if (empty($hidetext)) {
1162
-				print $langs->trans("Type") . ': ';
1162
+				print $langs->trans("Type").': ';
1163 1163
 			}
1164
-			print '<select class="flat" id="select_' . $htmlname . '" name="' . $htmlname . '">';
1164
+			print '<select class="flat" id="select_'.$htmlname.'" name="'.$htmlname.'">';
1165 1165
 			if ($showempty) {
1166 1166
 				print '<option value="-1"';
1167 1167
 				if ($selected == -1) {
@@ -1174,28 +1174,28 @@  discard block
 block discarded – undo
1174 1174
 			if (0 == $selected || ($selected == -1 && getDolGlobalString('MAIN_FREE_PRODUCT_CHECKED_BY_DEFAULT') == 'product')) {
1175 1175
 				print ' selected';
1176 1176
 			}
1177
-			print '>' . $langs->trans("Product");
1177
+			print '>'.$langs->trans("Product");
1178 1178
 
1179 1179
 			print '<option value="1"';
1180 1180
 			if (1 == $selected || ($selected == -1 && getDolGlobalString('MAIN_FREE_PRODUCT_CHECKED_BY_DEFAULT') == 'service')) {
1181 1181
 				print ' selected';
1182 1182
 			}
1183
-			print '>' . $langs->trans("Service");
1183
+			print '>'.$langs->trans("Service");
1184 1184
 
1185 1185
 			print '</select>';
1186
-			print ajax_combobox('select_' . $htmlname);
1186
+			print ajax_combobox('select_'.$htmlname);
1187 1187
 			//if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1);
1188 1188
 		}
1189 1189
 		if ((empty($forceall) && !isModEnabled('product') && isModEnabled("service")) || $forceall == 3) {
1190 1190
 			print $langs->trans("Service");
1191
-			print '<input type="hidden" name="' . $htmlname . '" value="1">';
1191
+			print '<input type="hidden" name="'.$htmlname.'" value="1">';
1192 1192
 		}
1193 1193
 		if ((empty($forceall) && isModEnabled("product") && !isModEnabled('service')) || $forceall == 2) {
1194 1194
 			print $langs->trans("Product");
1195
-			print '<input type="hidden" name="' . $htmlname . '" value="0">';
1195
+			print '<input type="hidden" name="'.$htmlname.'" value="0">';
1196 1196
 		}
1197 1197
 		if ($forceall < 0) {    // This should happened only for contracts when both predefined product and service are disabled.
1198
-			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
1198
+			print '<input type="hidden" name="'.$htmlname.'" value="1">'; // By default we set on service for contract. If CONTRACT_SUPPORT_PRODUCTS is set, forceall should be 1 not -1
1199 1199
 		}
1200 1200
 	}
1201 1201
 
@@ -1221,7 +1221,7 @@  discard block
 block discarded – undo
1221 1221
 		$langs->load("trips");
1222 1222
 
1223 1223
 		$sql = "SELECT c.code, c.label";
1224
-		$sql .= " FROM " . $this->db->prefix() . "c_type_fees as c";
1224
+		$sql .= " FROM ".$this->db->prefix()."c_type_fees as c";
1225 1225
 		$sql .= " WHERE active > 0";
1226 1226
 
1227 1227
 		$resql = $this->db->query($sql);
@@ -1262,11 +1262,11 @@  discard block
 block discarded – undo
1262 1262
 		// phpcs:enable
1263 1263
 		global $user, $langs;
1264 1264
 
1265
-		dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG);
1265
+		dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG);
1266 1266
 
1267 1267
 		$this->load_cache_types_fees();
1268 1268
 
1269
-		print '<select id="select_' . $htmlname . '" class="flat" name="' . $htmlname . '">';
1269
+		print '<select id="select_'.$htmlname.'" class="flat" name="'.$htmlname.'">';
1270 1270
 		if ($showempty) {
1271 1271
 			print '<option value="-1"';
1272 1272
 			if ($selected == -1) {
@@ -1276,7 +1276,7 @@  discard block
 block discarded – undo
1276 1276
 		}
1277 1277
 
1278 1278
 		foreach ($this->cache_types_fees as $key => $value) {
1279
-			print '<option value="' . $key . '"';
1279
+			print '<option value="'.$key.'"';
1280 1280
 			if ($key == $selected) {
1281 1281
 				print ' selected';
1282 1282
 			}
@@ -1327,12 +1327,12 @@  discard block
 block discarded – undo
1327 1327
 				$ajaxoptions = array();
1328 1328
 			}
1329 1329
 
1330
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
1330
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
1331 1331
 
1332 1332
 			// No immediate load of all database
1333 1333
 			$placeholder = '';
1334 1334
 			if ($selected && empty($selected_input_value)) {
1335
-				require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
1335
+				require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
1336 1336
 				$societetmp = new Societe($this->db);
1337 1337
 				$societetmp->fetch($selected);
1338 1338
 				$selected_input_value = $societetmp->name;
@@ -1340,25 +1340,25 @@  discard block
 block discarded – undo
1340 1340
 			}
1341 1341
 
1342 1342
 			// mode 1
1343
-			$urloption = 'htmlname=' . urlencode(str_replace('.', '_', $htmlname)) . '&outjson=1&filter=' . urlencode($filter) . (empty($excludeids) ? '' : '&excludeids=' . join(',', $excludeids)) . ($showtype ? '&showtype=' . urlencode($showtype) : '') . ($showcode ? '&showcode=' . urlencode($showcode) : '');
1343
+			$urloption = 'htmlname='.urlencode(str_replace('.', '_', $htmlname)).'&outjson=1&filter='.urlencode($filter).(empty($excludeids) ? '' : '&excludeids='.join(',', $excludeids)).($showtype ? '&showtype='.urlencode($showtype) : '').($showcode ? '&showcode='.urlencode($showcode) : '');
1344 1344
 
1345 1345
 			$out .= '<!-- force css to be higher than dialog popup --><style type="text/css">.ui-autocomplete { z-index: 1010; }</style>';
1346 1346
 			if (empty($hidelabel)) {
1347
-				print $langs->trans("RefOrLabel") . ' : ';
1347
+				print $langs->trans("RefOrLabel").' : ';
1348 1348
 			} elseif ($hidelabel > 1) {
1349 1349
 				$placeholder = $langs->trans("RefOrLabel");
1350 1350
 				if ($hidelabel == 2) {
1351 1351
 					$out .= img_picto($langs->trans("Search"), 'search');
1352 1352
 				}
1353 1353
 			}
1354
-			$out .= '<input type="text" class="' . $morecss . '" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . ($placeholder ? ' placeholder="' . dol_escape_htmltag($placeholder) . '"' : '') . ' ' . (!empty($conf->global->THIRDPARTY_SEARCH_AUTOFOCUS) ? 'autofocus' : '') . ' />';
1354
+			$out .= '<input type="text" class="'.$morecss.'" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.($placeholder ? ' placeholder="'.dol_escape_htmltag($placeholder).'"' : '').' '.(!empty($conf->global->THIRDPARTY_SEARCH_AUTOFOCUS) ? 'autofocus' : '').' />';
1355 1355
 			if ($hidelabel == 3) {
1356 1356
 				$out .= img_picto($langs->trans("Search"), 'search');
1357 1357
 			}
1358 1358
 
1359 1359
 			$out .= ajax_event($htmlname, $events);
1360 1360
 
1361
-			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/societe/ajax/company.php', $urloption, $conf->global->COMPANY_USE_SEARCH_TO_SELECT, 0, $ajaxoptions);
1361
+			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/societe/ajax/company.php', $urloption, $conf->global->COMPANY_USE_SEARCH_TO_SELECT, 0, $ajaxoptions);
1362 1362
 		} else {
1363 1363
 			// Immediate load of all database
1364 1364
 			$out .= $this->select_thirdparty_list($selected, $htmlname, $filter, $showempty, $showtype, $forcecombo, $events, '', 0, $limit, $morecss, $moreparam, $multiple, $excludeids, $showcode);
@@ -1442,30 +1442,30 @@  discard block
 block discarded – undo
1442 1442
 			$sql .= ", s.address, s.zip, s.town";
1443 1443
 			$sql .= ", dictp.code as country_code";
1444 1444
 		}
1445
-		$sql .= " FROM " . $this->db->prefix() . "societe as s";
1445
+		$sql .= " FROM ".$this->db->prefix()."societe as s";
1446 1446
 		if (!empty($conf->global->COMPANY_SHOW_ADDRESS_SELECTLIST)) {
1447
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "c_country as dictp ON dictp.rowid = s.fk_pays";
1447
+			$sql .= " LEFT JOIN ".$this->db->prefix()."c_country as dictp ON dictp.rowid = s.fk_pays";
1448 1448
 		}
1449 1449
 		if (empty($user->rights->societe->client->voir) && !$user->socid) {
1450
-			$sql .= ", " . $this->db->prefix() . "societe_commerciaux as sc";
1450
+			$sql .= ", ".$this->db->prefix()."societe_commerciaux as sc";
1451 1451
 		}
1452
-		$sql .= " WHERE s.entity IN (" . getEntity('societe') . ")";
1452
+		$sql .= " WHERE s.entity IN (".getEntity('societe').")";
1453 1453
 		if (!empty($user->socid)) {
1454
-			$sql .= " AND s.rowid = " . ((int) $user->socid);
1454
+			$sql .= " AND s.rowid = ".((int) $user->socid);
1455 1455
 		}
1456 1456
 		if ($filter) {
1457 1457
 			// $filter is safe because, if it contains '(' or ')', it has been sanitized by testSqlAndScriptInject() and forgeSQLFromUniversalSearchCriteria()
1458 1458
 			// if not, by testSqlAndScriptInject() only.
1459
-			$sql .= " AND (" . $filter . ")";
1459
+			$sql .= " AND (".$filter.")";
1460 1460
 		}
1461 1461
 		if (empty($user->rights->societe->client->voir) && !$user->socid) {
1462
-			$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " . ((int) $user->id);
1462
+			$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
1463 1463
 		}
1464 1464
 		if (!empty($conf->global->COMPANY_HIDE_INACTIVE_IN_COMBOBOX)) {
1465 1465
 			$sql .= " AND s.status <> 0";
1466 1466
 		}
1467 1467
 		if (!empty($excludeids)) {
1468
-			$sql .= " AND s.rowid NOT IN (" . $this->db->sanitize(join(',', $excludeids)) . ")";
1468
+			$sql .= " AND s.rowid NOT IN (".$this->db->sanitize(join(',', $excludeids)).")";
1469 1469
 		}
1470 1470
 		// Add where from hooks
1471 1471
 		$parameters = array();
@@ -1485,17 +1485,17 @@  discard block
 block discarded – undo
1485 1485
 				if ($i > 0) {
1486 1486
 					$sql .= " AND ";
1487 1487
 				}
1488
-				$sql .= "(s.nom LIKE '" . $this->db->escape($prefix . $crit) . "%')";
1488
+				$sql .= "(s.nom LIKE '".$this->db->escape($prefix.$crit)."%')";
1489 1489
 				$i++;
1490 1490
 			}
1491 1491
 			if (count($scrit) > 1) {
1492 1492
 				$sql .= ")";
1493 1493
 			}
1494 1494
 			if (isModEnabled('barcode')) {
1495
-				$sql .= " OR s.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
1495
+				$sql .= " OR s.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'";
1496 1496
 			}
1497
-			$sql .= " OR s.code_client LIKE '" . $this->db->escape($prefix . $filterkey) . "%' OR s.code_fournisseur LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
1498
-			$sql .= " OR s.name_alias LIKE '" . $this->db->escape($prefix . $filterkey) . "%' OR s.tva_intra LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
1497
+			$sql .= " OR s.code_client LIKE '".$this->db->escape($prefix.$filterkey)."%' OR s.code_fournisseur LIKE '".$this->db->escape($prefix.$filterkey)."%'";
1498
+			$sql .= " OR s.name_alias LIKE '".$this->db->escape($prefix.$filterkey)."%' OR s.tva_intra LIKE '".$this->db->escape($prefix.$filterkey)."%'";
1499 1499
 			$sql .= ")";
1500 1500
 		}
1501 1501
 		$sql .= $this->db->order("nom", "ASC");
@@ -1506,12 +1506,12 @@  discard block
 block discarded – undo
1506 1506
 		$resql = $this->db->query($sql);
1507 1507
 		if ($resql) {
1508 1508
 			if (!$forcecombo) {
1509
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
1509
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
1510 1510
 				$out .= ajax_combobox($htmlname, $events, getDolGlobalString("COMPANY_USE_SEARCH_TO_SELECT"));
1511 1511
 			}
1512 1512
 
1513 1513
 			// Construct $out and $outarray
1514
-			$out .= '<select id="' . $htmlname . '" class="flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($moreparam ? ' ' . $moreparam : '') . ' name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . '>' . "\n";
1514
+			$out .= '<select id="'.$htmlname.'" class="flat'.($morecss ? ' '.$morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').'>'."\n";
1515 1515
 
1516 1516
 			$textifempty = (($showempty && !is_numeric($showempty)) ? $langs->trans($showempty) : '');
1517 1517
 			if (!empty($conf->global->COMPANY_USE_SEARCH_TO_SELECT)) {
@@ -1524,7 +1524,7 @@  discard block
 block discarded – undo
1524 1524
 				}
1525 1525
 			}
1526 1526
 			if ($showempty) {
1527
-				$out .= '<option value="-1" data-html="' . dol_escape_htmltag('<span class="opacitymedium">' . ($textifempty ? $textifempty : '&nbsp;') . '</span>') . '">' . $textifempty . '</option>' . "\n";
1527
+				$out .= '<option value="-1" data-html="'.dol_escape_htmltag('<span class="opacitymedium">'.($textifempty ? $textifempty : '&nbsp;').'</span>').'">'.$textifempty.'</option>'."\n";
1528 1528
 			}
1529 1529
 
1530 1530
 			$companytemp = new Societe($this->db);
@@ -1537,18 +1537,18 @@  discard block
 block discarded – undo
1537 1537
 					$label = '';
1538 1538
 					if ($showcode || !empty($conf->global->SOCIETE_ADD_REF_IN_LIST)) {
1539 1539
 						if (($obj->client) && (!empty($obj->code_client))) {
1540
-							$label = $obj->code_client . ' - ';
1540
+							$label = $obj->code_client.' - ';
1541 1541
 						}
1542 1542
 						if (($obj->fournisseur) && (!empty($obj->code_fournisseur))) {
1543
-							$label .= $obj->code_fournisseur . ' - ';
1543
+							$label .= $obj->code_fournisseur.' - ';
1544 1544
 						}
1545
-						$label .= ' ' . $obj->name;
1545
+						$label .= ' '.$obj->name;
1546 1546
 					} else {
1547 1547
 						$label = $obj->name;
1548 1548
 					}
1549 1549
 
1550 1550
 					if (!empty($obj->name_alias)) {
1551
-						$label .= ' (' . $obj->name_alias . ')';
1551
+						$label .= ' ('.$obj->name_alias.')';
1552 1552
 					}
1553 1553
 
1554 1554
 					if (!empty($conf->global->SOCIETE_SHOW_VAT_IN_LIST) && !empty($obj->tva_intra)) {
@@ -1563,7 +1563,7 @@  discard block
 block discarded – undo
1563 1563
 						$companytemp->fournisseur = $obj->fournisseur;
1564 1564
 						$tmptype = $companytemp->getTypeUrl(1, '', 0, 'span');
1565 1565
 						if ($tmptype) {
1566
-							$labelhtml .= ' ' . $tmptype;
1566
+							$labelhtml .= ' '.$tmptype;
1567 1567
 						}
1568 1568
 
1569 1569
 						if ($obj->client || $obj->fournisseur) {
@@ -1573,10 +1573,10 @@  discard block
 block discarded – undo
1573 1573
 							$label .= $langs->trans("Customer");
1574 1574
 						}
1575 1575
 						if ($obj->client == 2 || $obj->client == 3) {
1576
-							$label .= ($obj->client == 3 ? ', ' : '') . $langs->trans("Prospect");
1576
+							$label .= ($obj->client == 3 ? ', ' : '').$langs->trans("Prospect");
1577 1577
 						}
1578 1578
 						if ($obj->fournisseur) {
1579
-							$label .= ($obj->client ? ', ' : '') . $langs->trans("Supplier");
1579
+							$label .= ($obj->client ? ', ' : '').$langs->trans("Supplier");
1580 1580
 						}
1581 1581
 						if ($obj->client || $obj->fournisseur) {
1582 1582
 							$label .= ')';
@@ -1584,9 +1584,9 @@  discard block
 block discarded – undo
1584 1584
 					}
1585 1585
 
1586 1586
 					if (!empty($conf->global->COMPANY_SHOW_ADDRESS_SELECTLIST)) {
1587
-						$s = ($obj->address ? ' - ' . $obj->address : '') . ($obj->zip ? ' - ' . $obj->zip : '') . ($obj->town ? ' ' . $obj->town : '');
1587
+						$s = ($obj->address ? ' - '.$obj->address : '').($obj->zip ? ' - '.$obj->zip : '').($obj->town ? ' '.$obj->town : '');
1588 1588
 						if (!empty($obj->country_code)) {
1589
-							$s .= ', ' . $langs->trans('Country' . $obj->country_code);
1589
+							$s .= ', '.$langs->trans('Country'.$obj->country_code);
1590 1590
 						}
1591 1591
 						$label .= $s;
1592 1592
 						$labelhtml .= $s;
@@ -1594,9 +1594,9 @@  discard block
 block discarded – undo
1594 1594
 
1595 1595
 					if (empty($outputmode)) {
1596 1596
 						if (in_array($obj->rowid, $selected)) {
1597
-							$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>';
1597
+							$out .= '<option value="'.$obj->rowid.'" selected data-html="'.dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1).'">'.dol_escape_htmltag($label, 0, 0, '', 0, 1).'</option>';
1598 1598
 						} else {
1599
-							$out .= '<option value="' . $obj->rowid . '" data-html="' . dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1) . '">' . dol_escape_htmltag($label, 0, 0, '', 0, 1) . '</option>';
1599
+							$out .= '<option value="'.$obj->rowid.'" data-html="'.dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1).'">'.dol_escape_htmltag($label, 0, 0, '', 0, 1).'</option>';
1600 1600
 						}
1601 1601
 					} else {
1602 1602
 						array_push($outarray, array('key' => $obj->rowid, 'value' => $label, 'label' => $label, 'labelhtml' => $labelhtml));
@@ -1608,7 +1608,7 @@  discard block
 block discarded – undo
1608 1608
 					}
1609 1609
 				}
1610 1610
 			}
1611
-			$out .= '</select>' . "\n";
1611
+			$out .= '</select>'."\n";
1612 1612
 		} else {
1613 1613
 			dol_print_error($this->db);
1614 1614
 		}
@@ -1642,18 +1642,18 @@  discard block
 block discarded – undo
1642 1642
 		// On recherche les remises
1643 1643
 		$sql = "SELECT re.rowid, re.amount_ht, re.amount_tva, re.amount_ttc,";
1644 1644
 		$sql .= " re.description, re.fk_facture_source";
1645
-		$sql .= " FROM " . $this->db->prefix() . "societe_remise_except as re";
1646
-		$sql .= " WHERE re.fk_soc = " . (int) $socid;
1647
-		$sql .= " AND re.entity = " . $conf->entity;
1645
+		$sql .= " FROM ".$this->db->prefix()."societe_remise_except as re";
1646
+		$sql .= " WHERE re.fk_soc = ".(int) $socid;
1647
+		$sql .= " AND re.entity = ".$conf->entity;
1648 1648
 		if ($filter) {
1649
-			$sql .= " AND " . $filter;
1649
+			$sql .= " AND ".$filter;
1650 1650
 		}
1651 1651
 		$sql .= " ORDER BY re.description ASC";
1652 1652
 
1653
-		dol_syslog(get_class($this) . "::select_remises", LOG_DEBUG);
1653
+		dol_syslog(get_class($this)."::select_remises", LOG_DEBUG);
1654 1654
 		$resql = $this->db->query($sql);
1655 1655
 		if ($resql) {
1656
-			print '<select id="select_' . $htmlname . '" class="flat maxwidthonsmartphone" name="' . $htmlname . '">';
1656
+			print '<select id="select_'.$htmlname.'" class="flat maxwidthonsmartphone" name="'.$htmlname.'">';
1657 1657
 			$num = $this->db->num_rows($resql);
1658 1658
 
1659 1659
 			$qualifiedlines = $num;
@@ -1691,16 +1691,16 @@  discard block
 block discarded – undo
1691 1691
 					if (!empty($conf->global->MAIN_SHOW_FACNUMBER_IN_DISCOUNT_LIST) && !empty($obj->fk_facture_source)) {
1692 1692
 						$tmpfac = new Facture($this->db);
1693 1693
 						if ($tmpfac->fetch($obj->fk_facture_source) > 0) {
1694
-							$desc = $desc . ' - ' . $tmpfac->ref;
1694
+							$desc = $desc.' - '.$tmpfac->ref;
1695 1695
 						}
1696 1696
 					}
1697 1697
 
1698
-					print '<option value="' . $obj->rowid . '"' . $selectstring . $disabled . '>' . $desc . ' (' . price($obj->amount_ht) . ' ' . $langs->trans("HT") . ' - ' . price($obj->amount_ttc) . ' ' . $langs->trans("TTC") . ')</option>';
1698
+					print '<option value="'.$obj->rowid.'"'.$selectstring.$disabled.'>'.$desc.' ('.price($obj->amount_ht).' '.$langs->trans("HT").' - '.price($obj->amount_ttc).' '.$langs->trans("TTC").')</option>';
1699 1699
 					$i++;
1700 1700
 				}
1701 1701
 			}
1702 1702
 			print '</select>';
1703
-			print ajax_combobox('select_' . $htmlname);
1703
+			print ajax_combobox('select_'.$htmlname);
1704 1704
 
1705 1705
 			return $qualifiedlines;
1706 1706
 		} else {
@@ -1781,7 +1781,7 @@  discard block
 block discarded – undo
1781 1781
 		$out = '';
1782 1782
 
1783 1783
 		if (!is_object($hookmanager)) {
1784
-			include_once DOL_DOCUMENT_ROOT . '/core/class/hookmanager.class.php';
1784
+			include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
1785 1785
 			$hookmanager = new HookManager($this->db);
1786 1786
 		}
1787 1787
 
@@ -1790,13 +1790,13 @@  discard block
 block discarded – undo
1790 1790
 		if ($showsoc > 0 || !empty($conf->global->CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST)) {
1791 1791
 			$sql .= ", s.nom as company, s.town AS company_town";
1792 1792
 		}
1793
-		$sql .= " FROM " . $this->db->prefix() . "socpeople as sp";
1793
+		$sql .= " FROM ".$this->db->prefix()."socpeople as sp";
1794 1794
 		if ($showsoc > 0 || !empty($conf->global->CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST)) {
1795
-			$sql .= " LEFT OUTER JOIN  " . $this->db->prefix() . "societe as s ON s.rowid=sp.fk_soc";
1795
+			$sql .= " LEFT OUTER JOIN  ".$this->db->prefix()."societe as s ON s.rowid=sp.fk_soc";
1796 1796
 		}
1797
-		$sql .= " WHERE sp.entity IN (" . getEntity('contact') . ")";
1797
+		$sql .= " WHERE sp.entity IN (".getEntity('contact').")";
1798 1798
 		if ($socid > 0 || $socid == -1) {
1799
-			$sql .= " AND sp.fk_soc = " . ((int) $socid);
1799
+			$sql .= " AND sp.fk_soc = ".((int) $socid);
1800 1800
 		}
1801 1801
 		if (!empty($conf->global->CONTACT_HIDE_INACTIVE_IN_COMBOBOX)) {
1802 1802
 			$sql .= " AND sp.statut <> 0";
@@ -1807,30 +1807,30 @@  discard block
 block discarded – undo
1807 1807
 		$sql .= $hookmanager->resPrint;
1808 1808
 		$sql .= " ORDER BY sp.lastname ASC";
1809 1809
 
1810
-		dol_syslog(get_class($this) . "::selectcontacts", LOG_DEBUG);
1810
+		dol_syslog(get_class($this)."::selectcontacts", LOG_DEBUG);
1811 1811
 		$resql = $this->db->query($sql);
1812 1812
 		if ($resql) {
1813 1813
 			$num = $this->db->num_rows($resql);
1814 1814
 
1815 1815
 			if ($htmlname != 'none' && !$options_only) {
1816
-				$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlid . '" name="' . $htmlname . (($num || empty($disableifempty)) ? '' : ' disabled') . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . ' ' . (!empty($moreparam) ? $moreparam : '') . '>';
1816
+				$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="'.$htmlid.'" name="'.$htmlname.(($num || empty($disableifempty)) ? '' : ' disabled').($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.(!empty($moreparam) ? $moreparam : '').'>';
1817 1817
 			}
1818 1818
 
1819 1819
 			if ($showempty && !is_numeric($showempty)) {
1820 1820
 				$textforempty = $showempty;
1821
-				$out .= '<option class="optiongrey" value="-1"' . (in_array(-1, $selected) ? ' selected' : '') . '>' . $textforempty . '</option>';
1821
+				$out .= '<option class="optiongrey" value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'>'.$textforempty.'</option>';
1822 1822
 			} else {
1823 1823
 				if (($showempty == 1 || ($showempty == 3 && $num > 1)) && !$multiple) {
1824
-					$out .= '<option value="0"' . (in_array(0, $selected) ? ' selected' : '') . '>&nbsp;</option>';
1824
+					$out .= '<option value="0"'.(in_array(0, $selected) ? ' selected' : '').'>&nbsp;</option>';
1825 1825
 				}
1826 1826
 				if ($showempty == 2) {
1827
-					$out .= '<option value="0"' . (in_array(0, $selected) ? ' selected' : '') . '>-- ' . $langs->trans("Internal") . ' --</option>';
1827
+					$out .= '<option value="0"'.(in_array(0, $selected) ? ' selected' : '').'>-- '.$langs->trans("Internal").' --</option>';
1828 1828
 				}
1829 1829
 			}
1830 1830
 
1831 1831
 			$i = 0;
1832 1832
 			if ($num) {
1833
-				include_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php';
1833
+				include_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
1834 1834
 				$contactstatic = new Contact($this->db);
1835 1835
 
1836 1836
 				while ($i < $num) {
@@ -1866,7 +1866,7 @@  discard block
 block discarded – undo
1866 1866
 						}
1867 1867
 						$extendedInfos = implode(' - ', $extendedInfos);
1868 1868
 						if (!empty($extendedInfos)) {
1869
-							$extendedInfos = ' - ' . $extendedInfos;
1869
+							$extendedInfos = ' - '.$extendedInfos;
1870 1870
 						}
1871 1871
 					}
1872 1872
 
@@ -1883,42 +1883,42 @@  discard block
 block discarded – undo
1883 1883
 								$disabled = 1;
1884 1884
 							}
1885 1885
 							if (!empty($selected) && in_array($obj->rowid, $selected)) {
1886
-								$out .= '<option value="' . $obj->rowid . '"';
1886
+								$out .= '<option value="'.$obj->rowid.'"';
1887 1887
 								if ($disabled) {
1888 1888
 									$out .= ' disabled';
1889 1889
 								}
1890 1890
 								$out .= ' selected>';
1891
-								$out .= $contactstatic->getFullName($langs) . $extendedInfos;
1891
+								$out .= $contactstatic->getFullName($langs).$extendedInfos;
1892 1892
 								if ($showfunction && $obj->poste) {
1893
-									$out .= ' (' . $obj->poste . ')';
1893
+									$out .= ' ('.$obj->poste.')';
1894 1894
 								}
1895 1895
 								if (($showsoc > 0) && $obj->company) {
1896
-									$out .= ' - (' . $obj->company . ')';
1896
+									$out .= ' - ('.$obj->company.')';
1897 1897
 								}
1898 1898
 								$out .= '</option>';
1899 1899
 							} else {
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 .= '>';
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
 							}
1914 1914
 						} else {
1915 1915
 							if (in_array($obj->rowid, $selected)) {
1916
-								$out .= $contactstatic->getFullName($langs) . $extendedInfos;
1916
+								$out .= $contactstatic->getFullName($langs).$extendedInfos;
1917 1917
 								if ($showfunction && $obj->poste) {
1918
-									$out .= ' (' . $obj->poste . ')';
1918
+									$out .= ' ('.$obj->poste.')';
1919 1919
 								}
1920 1920
 								if (($showsoc > 0) && $obj->company) {
1921
-									$out .= ' - (' . $obj->company . ')';
1921
+									$out .= ' - ('.$obj->company.')';
1922 1922
 								}
1923 1923
 							}
1924 1924
 						}
@@ -1927,7 +1927,7 @@  discard block
 block discarded – undo
1927 1927
 				}
1928 1928
 			} else {
1929 1929
 				$labeltoshow = ($socid != -1) ? ($langs->trans($socid ? "NoContactDefinedForThirdParty" : "NoContactDefined")) : $langs->trans('SelectAThirdPartyFirst');
1930
-				$out .= '<option class="disabled" value="-1"' . (($showempty == 2 || $multiple) ? '' : ' selected') . ' disabled="disabled">';
1930
+				$out .= '<option class="disabled" value="-1"'.(($showempty == 2 || $multiple) ? '' : ' selected').' disabled="disabled">';
1931 1931
 				$out .= $labeltoshow;
1932 1932
 				$out .= '</option>';
1933 1933
 			}
@@ -1948,7 +1948,7 @@  discard block
 block discarded – undo
1948 1948
 			}
1949 1949
 
1950 1950
 			if ($conf->use_javascript_ajax && !$forcecombo && !$options_only) {
1951
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
1951
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
1952 1952
 				$out .= ajax_combobox($htmlid, $events, getDolGlobalString("CONTACT_USE_SEARCH_TO_SELECT"));
1953 1953
 			}
1954 1954
 
@@ -2053,37 +2053,37 @@  discard block
 block discarded – undo
2053 2053
 		if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) {
2054 2054
 			$sql .= ", e.label";
2055 2055
 		}
2056
-		$sql .= " FROM " . $this->db->prefix() . "user as u";
2056
+		$sql .= " FROM ".$this->db->prefix()."user as u";
2057 2057
 		if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) {
2058
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "entity as e ON e.rowid = u.entity";
2058
+			$sql .= " LEFT JOIN ".$this->db->prefix()."entity as e ON e.rowid = u.entity";
2059 2059
 			if ($force_entity) {
2060
-				$sql .= " WHERE u.entity IN (0, " . $this->db->sanitize($force_entity) . ")";
2060
+				$sql .= " WHERE u.entity IN (0, ".$this->db->sanitize($force_entity).")";
2061 2061
 			} else {
2062 2062
 				$sql .= " WHERE u.entity IS NOT NULL";
2063 2063
 			}
2064 2064
 		} else {
2065 2065
 			if (isModEnabled('multicompany') && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) {
2066
-				$sql .= " LEFT JOIN " . $this->db->prefix() . "usergroup_user as ug";
2066
+				$sql .= " LEFT JOIN ".$this->db->prefix()."usergroup_user as ug";
2067 2067
 				$sql .= " ON ug.fk_user = u.rowid";
2068
-				$sql .= " WHERE ug.entity = " . (int) $conf->entity;
2068
+				$sql .= " WHERE ug.entity = ".(int) $conf->entity;
2069 2069
 			} else {
2070
-				$sql .= " WHERE u.entity IN (0, " . ((int) $conf->entity) . ")";
2070
+				$sql .= " WHERE u.entity IN (0, ".((int) $conf->entity).")";
2071 2071
 			}
2072 2072
 		}
2073 2073
 		if (!empty($user->socid)) {
2074
-			$sql .= " AND u.fk_soc = " . ((int) $user->socid);
2074
+			$sql .= " AND u.fk_soc = ".((int) $user->socid);
2075 2075
 		}
2076 2076
 		if (is_array($exclude) && $excludeUsers) {
2077
-			$sql .= " AND u.rowid NOT IN (" . $this->db->sanitize($excludeUsers) . ")";
2077
+			$sql .= " AND u.rowid NOT IN (".$this->db->sanitize($excludeUsers).")";
2078 2078
 		}
2079 2079
 		if ($includeUsers) {
2080
-			$sql .= " AND u.rowid IN (" . $this->db->sanitize($includeUsers) . ")";
2080
+			$sql .= " AND u.rowid IN (".$this->db->sanitize($includeUsers).")";
2081 2081
 		}
2082 2082
 		if (!empty($conf->global->USER_HIDE_INACTIVE_IN_COMBOBOX) || $notdisabled) {
2083 2083
 			$sql .= " AND u.statut <> 0";
2084 2084
 		}
2085 2085
 		if (!empty($morefilter)) {
2086
-			$sql .= " " . $morefilter;
2086
+			$sql .= " ".$morefilter;
2087 2087
 		}
2088 2088
 
2089 2089
 		//Add hook to filter on user (for exemple on usergroup define in custom modules)
@@ -2098,7 +2098,7 @@  discard block
 block discarded – undo
2098 2098
 			$sql .= " ORDER BY u.statut DESC, u.lastname ASC, u.firstname ASC";
2099 2099
 		}
2100 2100
 
2101
-		dol_syslog(get_class($this) . "::select_dolusers", LOG_DEBUG);
2101
+		dol_syslog(get_class($this)."::select_dolusers", LOG_DEBUG);
2102 2102
 
2103 2103
 		$resql = $this->db->query($sql);
2104 2104
 		if ($resql) {
@@ -2106,7 +2106,7 @@  discard block
 block discarded – undo
2106 2106
 			$i = 0;
2107 2107
 			if ($num) {
2108 2108
 				// do not use maxwidthonsmartphone by default. Set it by caller so auto size to 100% will work when not defined
2109
-				$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : ' minwidth200') . '" id="' . $htmlname . '" name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . ' ' . ($disabled ? ' disabled' : '') . '>';
2109
+				$out .= '<select class="flat'.($morecss ? ' '.$morecss : ' minwidth200').'" id="'.$htmlname.'" name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.($disabled ? ' disabled' : '').'>';
2110 2110
 				if ($show_empty && !$multiple) {
2111 2111
 					$textforempty = ' ';
2112 2112
 					if (!empty($conf->use_javascript_ajax)) {
@@ -2115,10 +2115,10 @@  discard block
 block discarded – undo
2115 2115
 					if (!is_numeric($show_empty)) {
2116 2116
 						$textforempty = $show_empty;
2117 2117
 					}
2118
-					$out .= '<option class="optiongrey" value="' . ($show_empty < 0 ? $show_empty : -1) . '"' . ((empty($selected) || in_array(-1, $selected)) ? ' selected' : '') . '>' . $textforempty . '</option>' . "\n";
2118
+					$out .= '<option class="optiongrey" value="'.($show_empty < 0 ? $show_empty : -1).'"'.((empty($selected) || in_array(-1, $selected)) ? ' selected' : '').'>'.$textforempty.'</option>'."\n";
2119 2119
 				}
2120 2120
 				if ($show_every) {
2121
-					$out .= '<option value="-2"' . ((in_array(-2, $selected)) ? ' selected' : '') . '>-- ' . $langs->trans("Everybody") . ' --</option>' . "\n";
2121
+					$out .= '<option value="-2"'.((in_array(-2, $selected)) ? ' selected' : '').'>-- '.$langs->trans("Everybody").' --</option>'."\n";
2122 2122
 				}
2123 2123
 
2124 2124
 				$userstatic = new User($this->db);
@@ -2165,22 +2165,22 @@  discard block
 block discarded – undo
2165 2165
 					}
2166 2166
 					if ($showstatus >= 0) {
2167 2167
 						if ($obj->status == 1 && $showstatus == 1) {
2168
-							$moreinfo .= ($moreinfo ? ' - ' : ' (') . $langs->trans('Enabled');
2169
-							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . $langs->trans('Enabled');
2168
+							$moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans('Enabled');
2169
+							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').$langs->trans('Enabled');
2170 2170
 						}
2171 2171
 						if ($obj->status == 0 && $showstatus == 1) {
2172
-							$moreinfo .= ($moreinfo ? ' - ' : ' (') . $langs->trans('Disabled');
2173
-							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . $langs->trans('Disabled');
2172
+							$moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans('Disabled');
2173
+							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').$langs->trans('Disabled');
2174 2174
 						}
2175 2175
 					}
2176 2176
 					if (isModEnabled('multicompany') && empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) && $conf->entity == 1 && $user->admin && !$user->entity) {
2177 2177
 						if (!$obj->entity) {
2178
-							$moreinfo .= ($moreinfo ? ' - ' : ' (') . $langs->trans("AllEntities");
2179
-							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . $langs->trans("AllEntities");
2178
+							$moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans("AllEntities");
2179
+							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').$langs->trans("AllEntities");
2180 2180
 						} else {
2181 2181
 							if ($obj->entity != $conf->entity) {
2182
-								$moreinfo .= ($moreinfo ? ' - ' : ' (') . ($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined"));
2183
-								$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . ($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined"));
2182
+								$moreinfo .= ($moreinfo ? ' - ' : ' (').($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined"));
2183
+								$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined"));
2184 2184
 							}
2185 2185
 						}
2186 2186
 					}
@@ -2188,13 +2188,13 @@  discard block
 block discarded – undo
2188 2188
 					$moreinfohtml .= ($moreinfohtml ? ')</span>' : '');
2189 2189
 					if ($disableline && $disableline != '1') {
2190 2190
 						// Add text from $enableonlytext parameter
2191
-						$moreinfo .= ' - ' . $disableline;
2192
-						$moreinfohtml .= ' - ' . $disableline;
2191
+						$moreinfo .= ' - '.$disableline;
2192
+						$moreinfohtml .= ' - '.$disableline;
2193 2193
 					}
2194 2194
 					$labeltoshow .= $moreinfo;
2195 2195
 					$labeltoshowhtml .= $moreinfohtml;
2196 2196
 
2197
-					$out .= '<option value="' . $obj->rowid . '"';
2197
+					$out .= '<option value="'.$obj->rowid.'"';
2198 2198
 					if ($disableline) {
2199 2199
 						$out .= ' disabled';
2200 2200
 					}
@@ -2202,7 +2202,7 @@  discard block
 block discarded – undo
2202 2202
 						$out .= ' selected';
2203 2203
 					}
2204 2204
 					$out .= ' data-html="';
2205
-					$outhtml = $userstatic->getNomUrl(-3, '', 0, 1, 24, 1, 'login', '', 1) . ' ';
2205
+					$outhtml = $userstatic->getNomUrl(-3, '', 0, 1, 24, 1, 'login', '', 1).' ';
2206 2206
 					if ($showstatus >= 0 && $obj->status == 0) {
2207 2207
 						$outhtml .= '<strike class="opacitymediumxxx">';
2208 2208
 					}
@@ -2215,7 +2215,7 @@  discard block
 block discarded – undo
2215 2215
 					$out .= $labeltoshow;
2216 2216
 					$out .= '</option>';
2217 2217
 
2218
-					$outarray[$userstatic->id] = $userstatic->getFullName($langs, $fullNameMode, -1, $maxlength) . $moreinfo;
2218
+					$outarray[$userstatic->id] = $userstatic->getFullName($langs, $fullNameMode, -1, $maxlength).$moreinfo;
2219 2219
 					$outarray2[$userstatic->id] = array(
2220 2220
 						'id'=>$userstatic->id,
2221 2221
 						'label'=>$labeltoshow,
@@ -2227,14 +2227,14 @@  discard block
 block discarded – undo
2227 2227
 					$i++;
2228 2228
 				}
2229 2229
 			} else {
2230
-				$out .= '<select class="flat" id="' . $htmlname . '" name="' . $htmlname . '" disabled>';
2231
-				$out .= '<option value="">' . $langs->trans("None") . '</option>';
2230
+				$out .= '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'" disabled>';
2231
+				$out .= '<option value="">'.$langs->trans("None").'</option>';
2232 2232
 			}
2233 2233
 			$out .= '</select>';
2234 2234
 
2235 2235
 			if ($num && !$forcecombo) {
2236 2236
 				// Enhance with select2
2237
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
2237
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
2238 2238
 				$out .= ajax_combobox($htmlname);
2239 2239
 			}
2240 2240
 		} else {
@@ -2306,16 +2306,16 @@  discard block
 block discarded – undo
2306 2306
 			$out .= $userstatic->getNomUrl(-1);
2307 2307
 			if ($i == 0) {
2308 2308
 				$ownerid = $value['id'];
2309
-				$out .= ' (' . $langs->trans("Owner") . ')';
2309
+				$out .= ' ('.$langs->trans("Owner").')';
2310 2310
 			}
2311 2311
 			if ($nbassignetouser > 1 && $action != 'view') {
2312
-				$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 . '">';
2312
+				$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.'">';
2313 2313
 			}
2314 2314
 			// Show my availability
2315 2315
 			if ($showproperties) {
2316 2316
 				if ($ownerid == $value['id'] && is_array($listofuserid) && count($listofuserid) && in_array($ownerid, array_keys($listofuserid))) {
2317 2317
 					$out .= '<div class="myavailability inline-block">';
2318
-					$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>';
2318
+					$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>';
2319 2319
 					$out .= '</div>';
2320 2320
 				}
2321 2321
 			}
@@ -2332,15 +2332,15 @@  discard block
 block discarded – undo
2332 2332
 		// Method with no ajax
2333 2333
 		if ($action != 'view') {
2334 2334
 			$out .= '<input type="hidden" class="removedassignedhidden" name="removedassigned" value="">';
2335
-			$out .= '<script nonce="' . getNonce() . '" type="text/javascript">jQuery(document).ready(function () {';
2335
+			$out .= '<script nonce="'.getNonce().'" type="text/javascript">jQuery(document).ready(function () {';
2336 2336
 			$out .= 'jQuery(".removedassigned").click(function() { jQuery(".removedassignedhidden").val(jQuery(this).val()); });';
2337 2337
 			$out .= 'jQuery(".assignedtouser").change(function() { console.log(jQuery(".assignedtouser option:selected").val());';
2338
-			$out .= ' if (jQuery(".assignedtouser option:selected").val() > 0) { jQuery("#' . $action . 'assignedtouser").attr("disabled", false); }';
2339
-			$out .= ' else { jQuery("#' . $action . 'assignedtouser").attr("disabled", true); }';
2338
+			$out .= ' if (jQuery(".assignedtouser option:selected").val() > 0) { jQuery("#'.$action.'assignedtouser").attr("disabled", false); }';
2339
+			$out .= ' else { jQuery("#'.$action.'assignedtouser").attr("disabled", true); }';
2340 2340
 			$out .= '});';
2341 2341
 			$out .= '})</script>';
2342 2342
 			$out .= $this->select_dolusers('', $htmlname, $show_empty, $exclude, $disabled, $include, $enableonly, $force_entity, $maxlength, $showstatus, $morefilter);
2343
-			$out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="' . $action . 'assignedtouser" name="' . $action . 'assignedtouser" value="' . dol_escape_htmltag($langs->trans("Add")) . '">';
2343
+			$out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="'.$action.'assignedtouser" name="'.$action.'assignedtouser" value="'.dol_escape_htmltag($langs->trans("Add")).'">';
2344 2344
 			$out .= '<br>';
2345 2345
 		}
2346 2346
 
@@ -2402,7 +2402,7 @@  discard block
 block discarded – undo
2402 2402
 			$placeholder = '';
2403 2403
 
2404 2404
 			if ($selected && empty($selected_input_value)) {
2405
-				require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
2405
+				require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
2406 2406
 				$producttmpselect = new Product($this->db);
2407 2407
 				$producttmpselect->fetch($selected);
2408 2408
 				$selected_input_value = $producttmpselect->ref;
@@ -2417,17 +2417,17 @@  discard block
 block discarded – undo
2417 2417
 				}
2418 2418
 			}
2419 2419
 			// mode=1 means customers products
2420
-			$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;
2421
-			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
2420
+			$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;
2421
+			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
2422 2422
 
2423 2423
 			if (isModEnabled('variants') && is_array($selected_combinations)) {
2424 2424
 				// Code to automatically insert with javascript the select of attributes under the select of product
2425 2425
 				// when a parent of variant has been selected.
2426 2426
 				$out .= '
2427 2427
 				<!-- script to auto show attributes select tags if a variant was selected -->
2428
-				<script nonce="' . getNonce() . '">
2428
+				<script nonce="' . getNonce().'">
2429 2429
 					// auto show attributes fields
2430
-					selected = ' . json_encode($selected_combinations) . ';
2430
+					selected = ' . json_encode($selected_combinations).';
2431 2431
 					combvalues = {};
2432 2432
 
2433 2433
 					jQuery(document).ready(function () {
@@ -2438,7 +2438,7 @@  discard block
 block discarded – undo
2438 2438
 							}
2439 2439
 						});
2440 2440
 
2441
-						jQuery("input#' . $htmlname . '").change(function () {
2441
+						jQuery("input#' . $htmlname.'").change(function () {
2442 2442
 
2443 2443
 							if (!jQuery(this).val()) {
2444 2444
 								jQuery(\'div#attributes_box\').empty();
@@ -2447,7 +2447,7 @@  discard block
 block discarded – undo
2447 2447
 
2448 2448
 							console.log("A change has started. We get variants fields to inject html select");
2449 2449
 
2450
-							jQuery.getJSON("' . DOL_URL_ROOT . '/variants/ajax/getCombinations.php", {
2450
+							jQuery.getJSON("' . DOL_URL_ROOT.'/variants/ajax/getCombinations.php", {
2451 2451
 								id: jQuery(this).val()
2452 2452
 							}, function (data) {
2453 2453
 								jQuery(\'div#attributes_box\').empty();
@@ -2490,21 +2490,21 @@  discard block
 block discarded – undo
2490 2490
 							})
2491 2491
 						});
2492 2492
 
2493
-						' . ($selected ? 'jQuery("input#' . $htmlname . '").change();' : '') . '
2493
+						' . ($selected ? 'jQuery("input#'.$htmlname.'").change();' : '').'
2494 2494
 					});
2495 2495
 				</script>
2496 2496
                 ';
2497 2497
 			}
2498 2498
 
2499 2499
 			if (empty($hidelabel)) {
2500
-				$out .= $langs->trans("RefOrLabel") . ' : ';
2500
+				$out .= $langs->trans("RefOrLabel").' : ';
2501 2501
 			} elseif ($hidelabel > 1) {
2502
-				$placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"';
2502
+				$placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"';
2503 2503
 				if ($hidelabel == 2) {
2504 2504
 					$out .= img_picto($langs->trans("Search"), 'search');
2505 2505
 				}
2506 2506
 			}
2507
-			$out .= '<input type="text" class="minwidth100' . ($morecss ? ' ' . $morecss : '') . '" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (!empty($conf->global->PRODUCT_SEARCH_AUTOFOCUS) ? 'autofocus' : '') . ' />';
2507
+			$out .= '<input type="text" class="minwidth100'.($morecss ? ' '.$morecss : '').'" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(!empty($conf->global->PRODUCT_SEARCH_AUTOFOCUS) ? 'autofocus' : '').' />';
2508 2508
 			if ($hidelabel == 3) {
2509 2509
 				$out .= img_picto($langs->trans("Search"), 'search');
2510 2510
 			}
@@ -2541,26 +2541,26 @@  discard block
 block discarded – undo
2541 2541
 		// phpcs:enable
2542 2542
 		global $conf, $user, $langs, $db;
2543 2543
 
2544
-		require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
2544
+		require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
2545 2545
 
2546 2546
 		$error = 0;
2547 2547
 		$out = '';
2548 2548
 
2549 2549
 		if (!$forcecombo) {
2550
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
2550
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
2551 2551
 			$events = array();
2552 2552
 			$out .= ajax_combobox($htmlname, $events, getDolGlobalInt("PRODUIT_USE_SEARCH_TO_SELECT"));
2553 2553
 		}
2554 2554
 
2555
-		$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
2555
+		$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
2556 2556
 
2557 2557
 		$sql = 'SELECT b.rowid, b.ref, b.label, b.fk_product';
2558
-		$sql .= ' FROM ' . MAIN_DB_PREFIX . 'bom_bom as b';
2559
-		$sql .= ' WHERE b.entity IN (' . getEntity('bom') . ')';
2560
-		if (!empty($status)) $sql .= ' AND status = ' . (int) $status;
2561
-		if (!empty($type)) $sql .= ' AND bomtype = ' . (int) $type;
2562
-		if (!empty($TProducts)) $sql .= ' AND fk_product IN (' . $this->db->sanitize(implode(',', $TProducts)) . ')';
2563
-		if (!empty($limit)) $sql .= ' LIMIT ' . (int) $limit;
2558
+		$sql .= ' FROM '.MAIN_DB_PREFIX.'bom_bom as b';
2559
+		$sql .= ' WHERE b.entity IN ('.getEntity('bom').')';
2560
+		if (!empty($status)) $sql .= ' AND status = '.(int) $status;
2561
+		if (!empty($type)) $sql .= ' AND bomtype = '.(int) $type;
2562
+		if (!empty($TProducts)) $sql .= ' AND fk_product IN ('.$this->db->sanitize(implode(',', $TProducts)).')';
2563
+		if (!empty($limit)) $sql .= ' LIMIT '.(int) $limit;
2564 2564
 		$resql = $db->query($sql);
2565 2565
 		if ($resql) {
2566 2566
 			if ($showempty) {
@@ -2571,9 +2571,9 @@  discard block
 block discarded – undo
2571 2571
 			while ($obj = $db->fetch_object($resql)) {
2572 2572
 				$product = new Product($db);
2573 2573
 				$res = $product->fetch($obj->fk_product);
2574
-				$out .= '<option value="' . $obj->rowid . '"';
2574
+				$out .= '<option value="'.$obj->rowid.'"';
2575 2575
 				if ($obj->rowid == $selected) $out .= 'selected';
2576
-				$out .= '>' . $obj->ref . ' - ' . $product->label . ' - ' . $obj->label . '</option>';
2576
+				$out .= '>'.$obj->ref.' - '.$product->label.' - '.$obj->label.'</option>';
2577 2577
 			}
2578 2578
 		} else {
2579 2579
 			$error++;
@@ -2630,7 +2630,7 @@  discard block
 block discarded – undo
2630 2630
 
2631 2631
 		$warehouseStatusArray = array();
2632 2632
 		if (!empty($warehouseStatus)) {
2633
-			require_once DOL_DOCUMENT_ROOT . '/product/stock/class/entrepot.class.php';
2633
+			require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php';
2634 2634
 			if (preg_match('/warehouseclosed/', $warehouseStatus)) {
2635 2635
 				$warehouseStatusArray[] = Entrepot::STATUS_CLOSED;
2636 2636
 			}
@@ -2644,9 +2644,9 @@  discard block
 block discarded – undo
2644 2644
 
2645 2645
 		$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";
2646 2646
 		if (count($warehouseStatusArray)) {
2647
-			$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
2647
+			$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
2648 2648
 		} else {
2649
-			$selectFieldsGrouped = ", " . $this->db->ifsql("p.stock IS NULL", 0, "p.stock") . " AS stock";
2649
+			$selectFieldsGrouped = ", ".$this->db->ifsql("p.stock IS NULL", 0, "p.stock")." AS stock";
2650 2650
 		}
2651 2651
 
2652 2652
 		$sql = "SELECT ";
@@ -2662,9 +2662,9 @@  discard block
 block discarded – undo
2662 2662
 
2663 2663
 		if (!empty($conf->global->PRODUCT_SORT_BY_CATEGORY)) {
2664 2664
 			//Product category
2665
-			$sql .= ", (SELECT " . $this->db->prefix() . "categorie_product.fk_categorie
2666
-						FROM " . $this->db->prefix() . "categorie_product
2667
-						WHERE " . $this->db->prefix() . "categorie_product.fk_product=p.rowid
2665
+			$sql .= ", (SELECT ".$this->db->prefix()."categorie_product.fk_categorie
2666
+						FROM " . $this->db->prefix()."categorie_product
2667
+						WHERE " . $this->db->prefix()."categorie_product.fk_product=p.rowid
2668 2668
 						LIMIT 1
2669 2669
 				) AS categorie_product_id ";
2670 2670
 		}
@@ -2690,15 +2690,15 @@  discard block
 block discarded – undo
2690 2690
 		}
2691 2691
 		// Price by quantity
2692 2692
 		if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) {
2693
-			$sql .= ", (SELECT pp.rowid FROM " . $this->db->prefix() . "product_price as pp WHERE pp.fk_product = p.rowid";
2693
+			$sql .= ", (SELECT pp.rowid FROM ".$this->db->prefix()."product_price as pp WHERE pp.fk_product = p.rowid";
2694 2694
 			if ($price_level >= 1 && !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) {
2695
-				$sql .= " AND price_level = " . ((int) $price_level);
2695
+				$sql .= " AND price_level = ".((int) $price_level);
2696 2696
 			}
2697 2697
 			$sql .= " ORDER BY date_price";
2698 2698
 			$sql .= " DESC LIMIT 1) as price_rowid";
2699
-			$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
2699
+			$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
2700 2700
 			if ($price_level >= 1 && !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) {
2701
-				$sql .= " AND price_level = " . ((int) $price_level);
2701
+				$sql .= " AND price_level = ".((int) $price_level);
2702 2702
 			}
2703 2703
 			$sql .= " ORDER BY date_price";
2704 2704
 			$sql .= " DESC LIMIT 1) as price_by_qty";
@@ -2712,67 +2712,67 @@  discard block
 block discarded – undo
2712 2712
 		$sql .= $hookmanager->resPrint;
2713 2713
 
2714 2714
 		if (count($warehouseStatusArray)) {
2715
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "product_stock as ps on ps.fk_product = p.rowid";
2716
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "entrepot as e on ps.fk_entrepot = e.rowid AND e.entity IN (" . getEntity('stock') . ")";
2717
-			$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.
2715
+			$sql .= " LEFT JOIN ".$this->db->prefix()."product_stock as ps on ps.fk_product = p.rowid";
2716
+			$sql .= " LEFT JOIN ".$this->db->prefix()."entrepot as e on ps.fk_entrepot = e.rowid AND e.entity IN (".getEntity('stock').")";
2717
+			$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.
2718 2718
 		}
2719 2719
 
2720 2720
 		// include search in supplier ref
2721 2721
 		if (!empty($conf->global->MAIN_SEARCH_PRODUCT_BY_FOURN_REF)) {
2722
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
2722
+			$sql .= " LEFT JOIN ".$this->db->prefix()."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
2723 2723
 		}
2724 2724
 
2725 2725
 		//Price by customer
2726 2726
 		if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES) && !empty($socid)) {
2727
-			$sql .= " LEFT JOIN  " . $this->db->prefix() . "product_customer_price as pcp ON pcp.fk_soc=" . ((int) $socid) . " AND pcp.fk_product=p.rowid";
2727
+			$sql .= " LEFT JOIN  ".$this->db->prefix()."product_customer_price as pcp ON pcp.fk_soc=".((int) $socid)." AND pcp.fk_product=p.rowid";
2728 2728
 		}
2729 2729
 		// Units
2730 2730
 		if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
2731
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "c_units u ON u.rowid = p.fk_unit";
2731
+			$sql .= " LEFT JOIN ".$this->db->prefix()."c_units u ON u.rowid = p.fk_unit";
2732 2732
 		}
2733 2733
 		// Multilang : we add translation
2734 2734
 		if (getDolGlobalInt('MAIN_MULTILANGS')) {
2735
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "product_lang as pl ON pl.fk_product = p.rowid ";
2735
+			$sql .= " LEFT JOIN ".$this->db->prefix()."product_lang as pl ON pl.fk_product = p.rowid ";
2736 2736
 			if (!empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE) && !empty($socid)) {
2737
-				require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
2737
+				require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
2738 2738
 				$soc = new Societe($this->db);
2739 2739
 				$result = $soc->fetch($socid);
2740 2740
 				if ($result > 0 && !empty($soc->default_lang)) {
2741
-					$sql .= " AND pl.lang = '" . $this->db->escape($soc->default_lang) . "'";
2741
+					$sql .= " AND pl.lang = '".$this->db->escape($soc->default_lang)."'";
2742 2742
 				} else {
2743
-					$sql .= " AND pl.lang = '" . $this->db->escape($langs->getDefaultLang()) . "'";
2743
+					$sql .= " AND pl.lang = '".$this->db->escape($langs->getDefaultLang())."'";
2744 2744
 				}
2745 2745
 			} else {
2746
-				$sql .= " AND pl.lang = '" . $this->db->escape($langs->getDefaultLang()) . "'";
2746
+				$sql .= " AND pl.lang = '".$this->db->escape($langs->getDefaultLang())."'";
2747 2747
 			}
2748 2748
 		}
2749 2749
 
2750 2750
 		if (!empty($conf->global->PRODUIT_ATTRIBUTES_HIDECHILD)) {
2751
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "product_attribute_combination pac ON pac.fk_product_child = p.rowid";
2751
+			$sql .= " LEFT JOIN ".$this->db->prefix()."product_attribute_combination pac ON pac.fk_product_child = p.rowid";
2752 2752
 		}
2753 2753
 
2754
-		$sql .= ' WHERE p.entity IN (' . getEntity('product') . ')';
2754
+		$sql .= ' WHERE p.entity IN ('.getEntity('product').')';
2755 2755
 
2756 2756
 		if (!empty($conf->global->PRODUIT_ATTRIBUTES_HIDECHILD)) {
2757 2757
 			$sql .= " AND pac.rowid IS NULL";
2758 2758
 		}
2759 2759
 
2760 2760
 		if ($finished == 0) {
2761
-			$sql .= " AND p.finished = " . ((int) $finished);
2761
+			$sql .= " AND p.finished = ".((int) $finished);
2762 2762
 		} elseif ($finished == 1) {
2763
-			$sql .= " AND p.finished = " . ((int) $finished);
2763
+			$sql .= " AND p.finished = ".((int) $finished);
2764 2764
 			if ($status >= 0) {
2765
-				$sql .= " AND p.tosell = " . ((int) $status);
2765
+				$sql .= " AND p.tosell = ".((int) $status);
2766 2766
 			}
2767 2767
 		} elseif ($status >= 0) {
2768
-			$sql .= " AND p.tosell = " . ((int) $status);
2768
+			$sql .= " AND p.tosell = ".((int) $status);
2769 2769
 		}
2770 2770
 		if ($status_purchase >= 0) {
2771
-			$sql .= " AND p.tobuy = " . ((int) $status_purchase);
2771
+			$sql .= " AND p.tobuy = ".((int) $status_purchase);
2772 2772
 		}
2773 2773
 		// Filter by product type
2774 2774
 		if (strval($filtertype) != '') {
2775
-			$sql .= " AND p.fk_product_type = " . ((int) $filtertype);
2775
+			$sql .= " AND p.fk_product_type = ".((int) $filtertype);
2776 2776
 		} elseif (!isModEnabled('product')) { // when product module is disabled, show services only
2777 2777
 			$sql .= " AND p.fk_product_type = 1";
2778 2778
 		} elseif (!isModEnabled('service')) { // when service module is disabled, show products only
@@ -2796,21 +2796,21 @@  discard block
 block discarded – undo
2796 2796
 				if ($i > 0) {
2797 2797
 					$sql .= " AND ";
2798 2798
 				}
2799
-				$sql .= "(p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%' OR p.label LIKE '" . $this->db->escape($prefix . $crit) . "%'";
2799
+				$sql .= "(p.ref LIKE '".$this->db->escape($prefix.$crit)."%' OR p.label LIKE '".$this->db->escape($prefix.$crit)."%'";
2800 2800
 				if (getDolGlobalInt('MAIN_MULTILANGS')) {
2801
-					$sql .= " OR pl.label LIKE '" . $this->db->escape($prefix . $crit) . "%'";
2801
+					$sql .= " OR pl.label LIKE '".$this->db->escape($prefix.$crit)."%'";
2802 2802
 				}
2803 2803
 				if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES) && !empty($socid)) {
2804
-					$sql .= " OR pcp.ref_customer LIKE '" . $this->db->escape($prefix . $crit) . "%'";
2804
+					$sql .= " OR pcp.ref_customer LIKE '".$this->db->escape($prefix.$crit)."%'";
2805 2805
 				}
2806 2806
 				if (!empty($conf->global->PRODUCT_AJAX_SEARCH_ON_DESCRIPTION)) {
2807
-					$sql .= " OR p.description LIKE '" . $this->db->escape($prefix . $crit) . "%'";
2807
+					$sql .= " OR p.description LIKE '".$this->db->escape($prefix.$crit)."%'";
2808 2808
 					if (getDolGlobalInt('MAIN_MULTILANGS')) {
2809
-						$sql .= " OR pl.description LIKE '" . $this->db->escape($prefix . $crit) . "%'";
2809
+						$sql .= " OR pl.description LIKE '".$this->db->escape($prefix.$crit)."%'";
2810 2810
 					}
2811 2811
 				}
2812 2812
 				if (!empty($conf->global->MAIN_SEARCH_PRODUCT_BY_FOURN_REF)) {
2813
-					$sql .= " OR pfp.ref_fourn LIKE '" . $this->db->escape($prefix . $crit) . "%'";
2813
+					$sql .= " OR pfp.ref_fourn LIKE '".$this->db->escape($prefix.$crit)."%'";
2814 2814
 				}
2815 2815
 				$sql .= ")";
2816 2816
 				$i++;
@@ -2819,12 +2819,12 @@  discard block
 block discarded – undo
2819 2819
 				$sql .= ")";
2820 2820
 			}
2821 2821
 			if (isModEnabled('barcode')) {
2822
-				$sql .= " OR p.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
2822
+				$sql .= " OR p.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'";
2823 2823
 			}
2824 2824
 			$sql .= ')';
2825 2825
 		}
2826 2826
 		if (count($warehouseStatusArray)) {
2827
-			$sql .= " GROUP BY " . $selectFields;
2827
+			$sql .= " GROUP BY ".$selectFields;
2828 2828
 		}
2829 2829
 
2830 2830
 		//Sort by category
@@ -2839,23 +2839,23 @@  discard block
 block discarded – undo
2839 2839
 		$sql .= $this->db->plimit($limit, 0);
2840 2840
 
2841 2841
 		// Build output string
2842
-		dol_syslog(get_class($this) . "::select_produits_list search products", LOG_DEBUG);
2842
+		dol_syslog(get_class($this)."::select_produits_list search products", LOG_DEBUG);
2843 2843
 		$result = $this->db->query($sql);
2844 2844
 		if ($result) {
2845
-			require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
2846
-			require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
2847
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/product.lib.php';
2845
+			require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
2846
+			require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
2847
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php';
2848 2848
 
2849 2849
 			$num = $this->db->num_rows($result);
2850 2850
 
2851 2851
 			$events = null;
2852 2852
 
2853 2853
 			if (!$forcecombo) {
2854
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
2854
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
2855 2855
 				$out .= ajax_combobox($htmlname, $events, getDolGlobalInt("PRODUIT_USE_SEARCH_TO_SELECT"));
2856 2856
 			}
2857 2857
 
2858
-			$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
2858
+			$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
2859 2859
 
2860 2860
 			$textifempty = '';
2861 2861
 			// Do not use textifempty = ' ' or '&nbsp;' here, or search on key will search on ' key'.
@@ -2872,7 +2872,7 @@  discard block
 block discarded – undo
2872 2872
 				}
2873 2873
 			}
2874 2874
 			if ($showempty) {
2875
-				$out .= '<option value="-1" selected>' . ($textifempty ? $textifempty : '&nbsp;') . '</option>';
2875
+				$out .= '<option value="-1" selected>'.($textifempty ? $textifempty : '&nbsp;').'</option>';
2876 2876
 			}
2877 2877
 
2878 2878
 			$i = 0;
@@ -2883,11 +2883,11 @@  discard block
 block discarded – undo
2883 2883
 
2884 2884
 				if ((!empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY) || !empty($conf->global->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
2885 2885
 					$sql = "SELECT rowid, quantity, price, unitprice, remise_percent, remise, price_base_type";
2886
-					$sql .= " FROM " . $this->db->prefix() . "product_price_by_qty";
2887
-					$sql .= " WHERE fk_product_price = " . ((int) $objp->price_rowid);
2886
+					$sql .= " FROM ".$this->db->prefix()."product_price_by_qty";
2887
+					$sql .= " WHERE fk_product_price = ".((int) $objp->price_rowid);
2888 2888
 					$sql .= " ORDER BY quantity ASC";
2889 2889
 
2890
-					dol_syslog(get_class($this) . "::select_produits_list search prices by qty", LOG_DEBUG);
2890
+					dol_syslog(get_class($this)."::select_produits_list search prices by qty", LOG_DEBUG);
2891 2891
 					$result2 = $this->db->query($sql);
2892 2892
 					if ($result2) {
2893 2893
 						$nb_prices = $this->db->num_rows($result2);
@@ -2925,7 +2925,7 @@  discard block
 block discarded – undo
2925 2925
 						$price_product = new Product($this->db);
2926 2926
 						$price_product->fetch($objp->rowid, '', '', 1);
2927 2927
 
2928
-						require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
2928
+						require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
2929 2929
 						$priceparser = new PriceParser($this->db);
2930 2930
 						$price_result = $priceparser->parseProduct($price_product);
2931 2931
 						if ($price_result >= 0) {
@@ -3009,7 +3009,7 @@  discard block
 block discarded – undo
3009 3009
 			$label = $objp->label_translated;
3010 3010
 		}
3011 3011
 		if (!empty($filterkey) && $filterkey != '') {
3012
-			$label = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $label, 1);
3012
+			$label = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $label, 1);
3013 3013
 		}
3014 3014
 
3015 3015
 		$outkey = $objp->rowid;
@@ -3030,32 +3030,32 @@  discard block
 block discarded – undo
3030 3030
 		$outdurationunit = $outtype == Product::TYPE_SERVICE ? substr($objp->duration, -1) : '';
3031 3031
 
3032 3032
 		if ($outorigin && !empty($conf->global->PRODUCT_SHOW_ORIGIN_IN_COMBO)) {
3033
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
3033
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
3034 3034
 		}
3035 3035
 
3036 3036
 		// Units
3037 3037
 		$outvalUnits = '';
3038 3038
 		if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
3039 3039
 			if (!empty($objp->unit_short)) {
3040
-				$outvalUnits .= ' - ' . $objp->unit_short;
3040
+				$outvalUnits .= ' - '.$objp->unit_short;
3041 3041
 			}
3042 3042
 		}
3043 3043
 		if (!empty($conf->global->PRODUCT_SHOW_DIMENSIONS_IN_COMBO)) {
3044 3044
 			if (!empty($objp->weight) && $objp->weight_units !== null) {
3045 3045
 				$unitToShow = showDimensionInBestUnit($objp->weight, $objp->weight_units, 'weight', $langs);
3046
-				$outvalUnits .= ' - ' . $unitToShow;
3046
+				$outvalUnits .= ' - '.$unitToShow;
3047 3047
 			}
3048 3048
 			if ((!empty($objp->length) || !empty($objp->width) || !empty($objp->height)) && $objp->length_units !== null) {
3049
-				$unitToShow = $objp->length . ' x ' . $objp->width . ' x ' . $objp->height . ' ' . measuringUnitString(0, 'size', $objp->length_units);
3050
-				$outvalUnits .= ' - ' . $unitToShow;
3049
+				$unitToShow = $objp->length.' x '.$objp->width.' x '.$objp->height.' '.measuringUnitString(0, 'size', $objp->length_units);
3050
+				$outvalUnits .= ' - '.$unitToShow;
3051 3051
 			}
3052 3052
 			if (!empty($objp->surface) && $objp->surface_units !== null) {
3053 3053
 				$unitToShow = showDimensionInBestUnit($objp->surface, $objp->surface_units, 'surface', $langs);
3054
-				$outvalUnits .= ' - ' . $unitToShow;
3054
+				$outvalUnits .= ' - '.$unitToShow;
3055 3055
 			}
3056 3056
 			if (!empty($objp->volume) && $objp->volume_units !== null) {
3057 3057
 				$unitToShow = showDimensionInBestUnit($objp->volume, $objp->volume_units, 'volume', $langs);
3058
-				$outvalUnits .= ' - ' . $unitToShow;
3058
+				$outvalUnits .= ' - '.$unitToShow;
3059 3059
 			}
3060 3060
 		}
3061 3061
 		if ($outdurationvalue && $outdurationunit) {
@@ -3067,14 +3067,14 @@  discard block
 block discarded – undo
3067 3067
 				'y' => $langs->trans('Year')
3068 3068
 			);
3069 3069
 			if (isset($da[$outdurationunit])) {
3070
-				$outvalUnits .= ' - ' . $outdurationvalue . ' ' . $langs->transnoentities($da[$outdurationunit] . ($outdurationvalue > 1 ? 's' : ''));
3070
+				$outvalUnits .= ' - '.$outdurationvalue.' '.$langs->transnoentities($da[$outdurationunit].($outdurationvalue > 1 ? 's' : ''));
3071 3071
 			}
3072 3072
 		}
3073 3073
 
3074
-		$opt = '<option value="' . $objp->rowid . '"';
3074
+		$opt = '<option value="'.$objp->rowid.'"';
3075 3075
 		$opt .= ($objp->rowid == $selected) ? ' selected' : '';
3076 3076
 		if (!empty($objp->price_by_qty_rowid) && $objp->price_by_qty_rowid > 0) {
3077
-			$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 . '"';
3077
+			$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.'"';
3078 3078
 		}
3079 3079
 		if (isModEnabled('stock') && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES))) {
3080 3080
 			if (!empty($user->rights->stock->lire)) {
@@ -3086,36 +3086,36 @@  discard block
 block discarded – undo
3086 3086
 			}
3087 3087
 		}
3088 3088
 		if (!empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) {
3089
-			$opt .= ' data-labeltrans="' . $outlabel_translated . '"';
3090
-			$opt .= ' data-desctrans="' . dol_escape_htmltag($outdesc_translated) . '"';
3089
+			$opt .= ' data-labeltrans="'.$outlabel_translated.'"';
3090
+			$opt .= ' data-desctrans="'.dol_escape_htmltag($outdesc_translated).'"';
3091 3091
 		}
3092 3092
 		$opt .= '>';
3093 3093
 		$opt .= $objp->ref;
3094 3094
 		if (!empty($objp->custref)) {
3095
-			$opt .= ' (' . $objp->custref . ')';
3095
+			$opt .= ' ('.$objp->custref.')';
3096 3096
 		}
3097 3097
 		if ($outbarcode) {
3098
-			$opt .= ' (' . $outbarcode . ')';
3098
+			$opt .= ' ('.$outbarcode.')';
3099 3099
 		}
3100
-		$opt .= ' - ' . dol_trunc($label, $maxlengtharticle);
3100
+		$opt .= ' - '.dol_trunc($label, $maxlengtharticle);
3101 3101
 		if ($outorigin && !empty($conf->global->PRODUCT_SHOW_ORIGIN_IN_COMBO)) {
3102
-			$opt .= ' (' . getCountry($outorigin, 1) . ')';
3102
+			$opt .= ' ('.getCountry($outorigin, 1).')';
3103 3103
 		}
3104 3104
 
3105 3105
 		$objRef = $objp->ref;
3106 3106
 		if (!empty($objp->custref)) {
3107
-			$objRef .= ' (' . $objp->custref . ')';
3107
+			$objRef .= ' ('.$objp->custref.')';
3108 3108
 		}
3109 3109
 		if (!empty($filterkey) && $filterkey != '') {
3110
-			$objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1);
3110
+			$objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1);
3111 3111
 		}
3112 3112
 		$outval .= $objRef;
3113 3113
 		if ($outbarcode) {
3114
-			$outval .= ' (' . $outbarcode . ')';
3114
+			$outval .= ' ('.$outbarcode.')';
3115 3115
 		}
3116
-		$outval .= ' - ' . dol_trunc($label, $maxlengtharticle);
3116
+		$outval .= ' - '.dol_trunc($label, $maxlengtharticle);
3117 3117
 		if ($outorigin && !empty($conf->global->PRODUCT_SHOW_ORIGIN_IN_COMBO)) {
3118
-			$outval .= ' (' . getCountry($outorigin, 1) . ')';
3118
+			$outval .= ' ('.getCountry($outorigin, 1).')';
3119 3119
 		}
3120 3120
 
3121 3121
 		// Units
@@ -3128,35 +3128,35 @@  discard block
 block discarded – undo
3128 3128
 		// If we need a particular price level (from 1 to n)
3129 3129
 		if (empty($hidepriceinlabel) && $price_level >= 1 && (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES))) {
3130 3130
 			$sql = "SELECT price, price_ttc, price_base_type, tva_tx, default_vat_code";
3131
-			$sql .= " FROM " . $this->db->prefix() . "product_price";
3132
-			$sql .= " WHERE fk_product = " . ((int) $objp->rowid);
3133
-			$sql .= " AND entity IN (" . getEntity('productprice') . ")";
3134
-			$sql .= " AND price_level = " . ((int) $price_level);
3131
+			$sql .= " FROM ".$this->db->prefix()."product_price";
3132
+			$sql .= " WHERE fk_product = ".((int) $objp->rowid);
3133
+			$sql .= " AND entity IN (".getEntity('productprice').")";
3134
+			$sql .= " AND price_level = ".((int) $price_level);
3135 3135
 			$sql .= " ORDER BY date_price DESC, rowid DESC"; // Warning DESC must be both on date_price and rowid.
3136 3136
 			$sql .= " LIMIT 1";
3137 3137
 
3138
-			dol_syslog(get_class($this) . '::constructProductListOption search price for product ' . $objp->rowid . ' AND level ' . $price_level, LOG_DEBUG);
3138
+			dol_syslog(get_class($this).'::constructProductListOption search price for product '.$objp->rowid.' AND level '.$price_level, LOG_DEBUG);
3139 3139
 			$result2 = $this->db->query($sql);
3140 3140
 			if ($result2) {
3141 3141
 				$objp2 = $this->db->fetch_object($result2);
3142 3142
 				if ($objp2) {
3143 3143
 					$found = 1;
3144 3144
 					if ($objp2->price_base_type == 'HT') {
3145
-						$opt .= ' - ' . price($objp2->price, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("HT");
3146
-						$outval .= ' - ' . price($objp2->price, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("HT");
3145
+						$opt .= ' - '.price($objp2->price, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT");
3146
+						$outval .= ' - '.price($objp2->price, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT");
3147 3147
 					} else {
3148
-						$opt .= ' - ' . price($objp2->price_ttc, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("TTC");
3149
-						$outval .= ' - ' . price($objp2->price_ttc, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("TTC");
3148
+						$opt .= ' - '.price($objp2->price_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC");
3149
+						$outval .= ' - '.price($objp2->price_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC");
3150 3150
 					}
3151 3151
 					$outprice_ht = price($objp2->price);
3152 3152
 					$outprice_ttc = price($objp2->price_ttc);
3153 3153
 					$outpricebasetype = $objp2->price_base_type;
3154 3154
 					if (!empty($conf->global->PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL)) {  // using this option is a bug. kept for backward compatibility
3155
-						$outtva_tx = $objp2->tva_tx;                        // We use the vat rate on line of multiprice
3156
-						$outdefault_vat_code = $objp2->default_vat_code;    // We use the vat code on line of multiprice
3155
+						$outtva_tx = $objp2->tva_tx; // We use the vat rate on line of multiprice
3156
+						$outdefault_vat_code = $objp2->default_vat_code; // We use the vat code on line of multiprice
3157 3157
 					} else {
3158
-						$outtva_tx = $objp->tva_tx;                            // We use the vat rate of product, not the one on line of multiprice
3159
-						$outdefault_vat_code = $objp->default_vat_code;        // We use the vat code or product, not the one on line of multiprice
3158
+						$outtva_tx = $objp->tva_tx; // We use the vat rate of product, not the one on line of multiprice
3159
+						$outdefault_vat_code = $objp->default_vat_code; // We use the vat code or product, not the one on line of multiprice
3160 3160
 					}
3161 3161
 				}
3162 3162
 			} else {
@@ -3170,13 +3170,13 @@  discard block
 block discarded – undo
3170 3170
 			$outqty = $objp->quantity;
3171 3171
 			$outdiscount = $objp->remise_percent;
3172 3172
 			if ($objp->quantity == 1) {
3173
-				$opt .= ' - ' . price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency) . "/";
3174
-				$outval .= ' - ' . price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency) . "/";
3173
+				$opt .= ' - '.price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency)."/";
3174
+				$outval .= ' - '.price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency)."/";
3175 3175
 				$opt .= $langs->trans("Unit"); // Do not use strtolower because it breaks utf8 encoding
3176 3176
 				$outval .= $langs->transnoentities("Unit");
3177 3177
 			} else {
3178
-				$opt .= ' - ' . price($objp->price, 1, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity;
3179
-				$outval .= ' - ' . price($objp->price, 0, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity;
3178
+				$opt .= ' - '.price($objp->price, 1, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity;
3179
+				$outval .= ' - '.price($objp->price, 0, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity;
3180 3180
 				$opt .= $langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding
3181 3181
 				$outval .= $langs->transnoentities("Units");
3182 3182
 			}
@@ -3184,16 +3184,16 @@  discard block
 block discarded – undo
3184 3184
 			$outprice_ht = price($objp->unitprice);
3185 3185
 			$outprice_ttc = price($objp->unitprice * (1 + ($objp->tva_tx / 100)));
3186 3186
 			$outpricebasetype = $objp->price_base_type;
3187
-			$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
3188
-			$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
3187
+			$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
3188
+			$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
3189 3189
 		}
3190 3190
 		if (empty($hidepriceinlabel) && !empty($objp->quantity) && $objp->quantity >= 1) {
3191
-			$opt .= " (" . price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->trans("Unit") . ")"; // Do not use strtolower because it breaks utf8 encoding
3192
-			$outval .= " (" . price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->transnoentities("Unit") . ")"; // Do not use strtolower because it breaks utf8 encoding
3191
+			$opt .= " (".price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency)."/".$langs->trans("Unit").")"; // Do not use strtolower because it breaks utf8 encoding
3192
+			$outval .= " (".price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency)."/".$langs->transnoentities("Unit").")"; // Do not use strtolower because it breaks utf8 encoding
3193 3193
 		}
3194 3194
 		if (empty($hidepriceinlabel) && !empty($objp->remise_percent) && $objp->remise_percent >= 1) {
3195
-			$opt .= " - " . $langs->trans("Discount") . " : " . vatrate($objp->remise_percent) . ' %';
3196
-			$outval .= " - " . $langs->transnoentities("Discount") . " : " . vatrate($objp->remise_percent) . ' %';
3195
+			$opt .= " - ".$langs->trans("Discount")." : ".vatrate($objp->remise_percent).' %';
3196
+			$outval .= " - ".$langs->transnoentities("Discount")." : ".vatrate($objp->remise_percent).' %';
3197 3197
 		}
3198 3198
 
3199 3199
 		// Price by customer
@@ -3202,11 +3202,11 @@  discard block
 block discarded – undo
3202 3202
 				$found = 1;
3203 3203
 
3204 3204
 				if ($objp->custprice_base_type == 'HT') {
3205
-					$opt .= ' - ' . price($objp->custprice, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("HT");
3206
-					$outval .= ' - ' . price($objp->custprice, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("HT");
3205
+					$opt .= ' - '.price($objp->custprice, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT");
3206
+					$outval .= ' - '.price($objp->custprice, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT");
3207 3207
 				} else {
3208
-					$opt .= ' - ' . price($objp->custprice_ttc, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("TTC");
3209
-					$outval .= ' - ' . price($objp->custprice_ttc, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("TTC");
3208
+					$opt .= ' - '.price($objp->custprice_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC");
3209
+					$outval .= ' - '.price($objp->custprice_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC");
3210 3210
 				}
3211 3211
 
3212 3212
 				$outprice_ht = price($objp->custprice);
@@ -3220,11 +3220,11 @@  discard block
 block discarded – undo
3220 3220
 		// If level no defined or multiprice not found, we used the default price
3221 3221
 		if (empty($hidepriceinlabel) && !$found) {
3222 3222
 			if ($objp->price_base_type == 'HT') {
3223
-				$opt .= ' - ' . price($objp->price, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("HT");
3224
-				$outval .= ' - ' . price($objp->price, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("HT");
3223
+				$opt .= ' - '.price($objp->price, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT");
3224
+				$outval .= ' - '.price($objp->price, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT");
3225 3225
 			} else {
3226
-				$opt .= ' - ' . price($objp->price_ttc, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("TTC");
3227
-				$outval .= ' - ' . price($objp->price_ttc, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("TTC");
3226
+				$opt .= ' - '.price($objp->price_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC");
3227
+				$outval .= ' - '.price($objp->price_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC");
3228 3228
 			}
3229 3229
 			$outprice_ht = price($objp->price);
3230 3230
 			$outprice_ttc = price($objp->price_ttc);
@@ -3235,14 +3235,14 @@  discard block
 block discarded – undo
3235 3235
 
3236 3236
 		if (isModEnabled('stock') && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES))) {
3237 3237
 			if (!empty($user->rights->stock->lire)) {
3238
-				$opt .= ' - ' . $langs->trans("Stock") . ': ' . price(price2num($objp->stock, 'MS'));
3238
+				$opt .= ' - '.$langs->trans("Stock").': '.price(price2num($objp->stock, 'MS'));
3239 3239
 
3240 3240
 				if ($objp->stock > 0) {
3241 3241
 					$outval .= ' - <span class="product_line_stock_ok">';
3242 3242
 				} elseif ($objp->stock <= 0) {
3243 3243
 					$outval .= ' - <span class="product_line_stock_too_low">';
3244 3244
 				}
3245
-				$outval .= $langs->transnoentities("Stock") . ': ' . price(price2num($objp->stock, 'MS'));
3245
+				$outval .= $langs->transnoentities("Stock").': '.price(price2num($objp->stock, 'MS'));
3246 3246
 				$outval .= '</span>';
3247 3247
 				if (empty($novirtualstock) && !empty($conf->global->STOCK_SHOW_VIRTUAL_STOCK_IN_PRODUCTS_COMBO)) {  // Warning, this option may slow down combo list generation
3248 3248
 					$langs->load("stocks");
@@ -3252,9 +3252,9 @@  discard block
 block discarded – undo
3252 3252
 					$tmpproduct->load_virtual_stock();
3253 3253
 					$virtualstock = $tmpproduct->stock_theorique;
3254 3254
 
3255
-					$opt .= ' - ' . $langs->trans("VirtualStock") . ':' . $virtualstock;
3255
+					$opt .= ' - '.$langs->trans("VirtualStock").':'.$virtualstock;
3256 3256
 
3257
-					$outval .= ' - ' . $langs->transnoentities("VirtualStock") . ':';
3257
+					$outval .= ' - '.$langs->transnoentities("VirtualStock").':';
3258 3258
 					if ($virtualstock > 0) {
3259 3259
 						$outval .= '<span class="product_line_stock_ok">';
3260 3260
 					} elseif ($virtualstock <= 0) {
@@ -3332,7 +3332,7 @@  discard block
 block discarded – undo
3332 3332
 		$selected_input_value = '';
3333 3333
 		if (!empty($conf->use_javascript_ajax) && !empty($conf->global->PRODUIT_USE_SEARCH_TO_SELECT)) {
3334 3334
 			if ($selected > 0) {
3335
-				require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
3335
+				require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
3336 3336
 				$producttmpselect = new Product($this->db);
3337 3337
 				$producttmpselect->fetch($selected);
3338 3338
 				$selected_input_value = $producttmpselect->ref;
@@ -3340,10 +3340,10 @@  discard block
 block discarded – undo
3340 3340
 			}
3341 3341
 
3342 3342
 			// mode=2 means suppliers products
3343
-			$urloption = ($socid > 0 ? 'socid=' . $socid . '&' : '') . 'htmlname=' . $htmlname . '&outjson=1&price_level=' . $price_level . '&type=' . $filtertype . '&mode=2&status=' . $status . '&finished=' . $finished . '&alsoproductwithnosupplierprice=' . $alsoproductwithnosupplierprice;
3344
-			print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 0, $ajaxoptions);
3343
+			$urloption = ($socid > 0 ? 'socid='.$socid.'&' : '').'htmlname='.$htmlname.'&outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=2&status='.$status.'&finished='.$finished.'&alsoproductwithnosupplierprice='.$alsoproductwithnosupplierprice;
3344
+			print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 0, $ajaxoptions);
3345 3345
 
3346
-			print ($hidelabel ? '' : $langs->trans("RefOrLabel") . ' : ') . '<input type="text" class="minwidth300" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . ($placeholder ? ' placeholder="' . $placeholder . '"' : '') . '>';
3346
+			print ($hidelabel ? '' : $langs->trans("RefOrLabel").' : ').'<input type="text" class="minwidth300" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.($placeholder ? ' placeholder="'.$placeholder.'"' : '').'>';
3347 3347
 		} else {
3348 3348
 			print $this->select_produits_fournisseurs_list($socid, $selected, $htmlname, $filtertype, $filtre, '', $status, 0, 0, $alsoproductwithnosupplierprice, $morecss, 0, $placeholder);
3349 3349
 		}
@@ -3403,25 +3403,25 @@  discard block
 block discarded – undo
3403 3403
 		if (isModEnabled('barcode')) {
3404 3404
 			$sql .= ", pfp.barcode";
3405 3405
 		}
3406
-		$sql .= " FROM " . $this->db->prefix() . "product as p";
3407
-		$sql .= " LEFT JOIN " . $this->db->prefix() . "product_fournisseur_price as pfp ON ( p.rowid = pfp.fk_product AND pfp.entity IN (" . getEntity('product') . ") )";
3406
+		$sql .= " FROM ".$this->db->prefix()."product as p";
3407
+		$sql .= " LEFT JOIN ".$this->db->prefix()."product_fournisseur_price as pfp ON ( p.rowid = pfp.fk_product AND pfp.entity IN (".getEntity('product').") )";
3408 3408
 		if ($socid > 0) {
3409
-			$sql .= " AND pfp.fk_soc = " . ((int) $socid);
3409
+			$sql .= " AND pfp.fk_soc = ".((int) $socid);
3410 3410
 		}
3411
-		$sql .= " LEFT JOIN " . $this->db->prefix() . "societe as s ON pfp.fk_soc = s.rowid";
3411
+		$sql .= " LEFT JOIN ".$this->db->prefix()."societe as s ON pfp.fk_soc = s.rowid";
3412 3412
 		// Units
3413 3413
 		if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
3414
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "c_units u ON u.rowid = p.fk_unit";
3414
+			$sql .= " LEFT JOIN ".$this->db->prefix()."c_units u ON u.rowid = p.fk_unit";
3415 3415
 		}
3416
-		$sql .= " WHERE p.entity IN (" . getEntity('product') . ")";
3416
+		$sql .= " WHERE p.entity IN (".getEntity('product').")";
3417 3417
 		if ($statut != -1) {
3418
-			$sql .= " AND p.tobuy = " . ((int) $statut);
3418
+			$sql .= " AND p.tobuy = ".((int) $statut);
3419 3419
 		}
3420 3420
 		if (strval($filtertype) != '') {
3421
-			$sql .= " AND p.fk_product_type = " . ((int) $filtertype);
3421
+			$sql .= " AND p.fk_product_type = ".((int) $filtertype);
3422 3422
 		}
3423 3423
 		if (!empty($filtre)) {
3424
-			$sql .= " " . $filtre;
3424
+			$sql .= " ".$filtre;
3425 3425
 		}
3426 3426
 		// Add where from hooks
3427 3427
 		$parameters = array();
@@ -3441,9 +3441,9 @@  discard block
 block discarded – undo
3441 3441
 				if ($i > 0) {
3442 3442
 					$sql .= " AND ";
3443 3443
 				}
3444
-				$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) . "%'";
3444
+				$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)."%'";
3445 3445
 				if (!empty($conf->global->PRODUIT_FOURN_TEXTS)) {
3446
-					$sql .= " OR pfp.desc_fourn LIKE '" . $this->db->escape($prefix . $crit) . "%'";
3446
+					$sql .= " OR pfp.desc_fourn LIKE '".$this->db->escape($prefix.$crit)."%'";
3447 3447
 				}
3448 3448
 				$sql .= ")";
3449 3449
 				$i++;
@@ -3452,8 +3452,8 @@  discard block
 block discarded – undo
3452 3452
 				$sql .= ")";
3453 3453
 			}
3454 3454
 			if (isModEnabled('barcode')) {
3455
-				$sql .= " OR p.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
3456
-				$sql .= " OR pfp.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
3455
+				$sql .= " OR p.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'";
3456
+				$sql .= " OR pfp.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'";
3457 3457
 			}
3458 3458
 			$sql .= ')';
3459 3459
 		}
@@ -3462,20 +3462,20 @@  discard block
 block discarded – undo
3462 3462
 
3463 3463
 		// Build output string
3464 3464
 
3465
-		dol_syslog(get_class($this) . "::select_produits_fournisseurs_list", LOG_DEBUG);
3465
+		dol_syslog(get_class($this)."::select_produits_fournisseurs_list", LOG_DEBUG);
3466 3466
 		$result = $this->db->query($sql);
3467 3467
 		if ($result) {
3468
-			require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
3469
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/product.lib.php';
3468
+			require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
3469
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php';
3470 3470
 
3471 3471
 			$num = $this->db->num_rows($result);
3472 3472
 
3473 3473
 			//$out.='<select class="flat" id="select'.$htmlname.'" name="'.$htmlname.'">';	// remove select to have id same with combo and ajax
3474
-			$out .= '<select class="flat ' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . '">';
3474
+			$out .= '<select class="flat '.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.'">';
3475 3475
 			if (!$selected) {
3476
-				$out .= '<option value="-1" selected>' . ($placeholder ? $placeholder : '&nbsp;') . '</option>';
3476
+				$out .= '<option value="-1" selected>'.($placeholder ? $placeholder : '&nbsp;').'</option>';
3477 3477
 			} else {
3478
-				$out .= '<option value="-1">' . ($placeholder ? $placeholder : '&nbsp;') . '</option>';
3478
+				$out .= '<option value="-1">'.($placeholder ? $placeholder : '&nbsp;').'</option>';
3479 3479
 			}
3480 3480
 
3481 3481
 			$i = 0;
@@ -3490,7 +3490,7 @@  discard block
 block discarded – undo
3490 3490
 
3491 3491
 				$outkey = $objp->idprodfournprice; // id in table of price
3492 3492
 				if (!$outkey && $alsoproductwithnosupplierprice) {
3493
-					$outkey = 'idprod_' . $objp->rowid; // id of product
3493
+					$outkey = 'idprod_'.$objp->rowid; // id of product
3494 3494
 				}
3495 3495
 
3496 3496
 				$outref = $objp->ref;
@@ -3505,23 +3505,23 @@  discard block
 block discarded – undo
3505 3505
 				$outvalUnits = '';
3506 3506
 				if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
3507 3507
 					if (!empty($objp->unit_short)) {
3508
-						$outvalUnits .= ' - ' . $objp->unit_short;
3508
+						$outvalUnits .= ' - '.$objp->unit_short;
3509 3509
 					}
3510 3510
 					if (!empty($objp->weight) && $objp->weight_units !== null) {
3511 3511
 						$unitToShow = showDimensionInBestUnit($objp->weight, $objp->weight_units, 'weight', $langs);
3512
-						$outvalUnits .= ' - ' . $unitToShow;
3512
+						$outvalUnits .= ' - '.$unitToShow;
3513 3513
 					}
3514 3514
 					if ((!empty($objp->length) || !empty($objp->width) || !empty($objp->height)) && $objp->length_units !== null) {
3515
-						$unitToShow = $objp->length . ' x ' . $objp->width . ' x ' . $objp->height . ' ' . measuringUnitString(0, 'size', $objp->length_units);
3516
-						$outvalUnits .= ' - ' . $unitToShow;
3515
+						$unitToShow = $objp->length.' x '.$objp->width.' x '.$objp->height.' '.measuringUnitString(0, 'size', $objp->length_units);
3516
+						$outvalUnits .= ' - '.$unitToShow;
3517 3517
 					}
3518 3518
 					if (!empty($objp->surface) && $objp->surface_units !== null) {
3519 3519
 						$unitToShow = showDimensionInBestUnit($objp->surface, $objp->surface_units, 'surface', $langs);
3520
-						$outvalUnits .= ' - ' . $unitToShow;
3520
+						$outvalUnits .= ' - '.$unitToShow;
3521 3521
 					}
3522 3522
 					if (!empty($objp->volume) && $objp->volume_units !== null) {
3523 3523
 						$unitToShow = showDimensionInBestUnit($objp->volume, $objp->volume_units, 'volume', $langs);
3524
-						$outvalUnits .= ' - ' . $unitToShow;
3524
+						$outvalUnits .= ' - '.$unitToShow;
3525 3525
 					}
3526 3526
 					if ($outdurationvalue && $outdurationunit) {
3527 3527
 						$da = array(
@@ -3532,22 +3532,22 @@  discard block
 block discarded – undo
3532 3532
 							'y' => $langs->trans('Year')
3533 3533
 						);
3534 3534
 						if (isset($da[$outdurationunit])) {
3535
-							$outvalUnits .= ' - ' . $outdurationvalue . ' ' . $langs->transnoentities($da[$outdurationunit] . ($outdurationvalue > 1 ? 's' : ''));
3535
+							$outvalUnits .= ' - '.$outdurationvalue.' '.$langs->transnoentities($da[$outdurationunit].($outdurationvalue > 1 ? 's' : ''));
3536 3536
 						}
3537 3537
 					}
3538 3538
 				}
3539 3539
 
3540 3540
 				$objRef = $objp->ref;
3541 3541
 				if ($filterkey && $filterkey != '') {
3542
-					$objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1);
3542
+					$objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1);
3543 3543
 				}
3544 3544
 				$objRefFourn = $objp->ref_fourn;
3545 3545
 				if ($filterkey && $filterkey != '') {
3546
-					$objRefFourn = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRefFourn, 1);
3546
+					$objRefFourn = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRefFourn, 1);
3547 3547
 				}
3548 3548
 				$label = $objp->label;
3549 3549
 				if ($filterkey && $filterkey != '') {
3550
-					$label = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $label, 1);
3550
+					$label = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $label, 1);
3551 3551
 				}
3552 3552
 
3553 3553
 				switch ($objp->fk_product_type) {
@@ -3570,21 +3570,21 @@  discard block
 block discarded – undo
3570 3570
 
3571 3571
 				$optlabel .= $objp->ref;
3572 3572
 				if (!empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) {
3573
-					$optlabel .= ' <span class="opacitymedium">(' . $objp->ref_fourn . ')</span>';
3573
+					$optlabel .= ' <span class="opacitymedium">('.$objp->ref_fourn.')</span>';
3574 3574
 				}
3575 3575
 				if (isModEnabled('barcode') && !empty($objp->barcode)) {
3576
-					$optlabel .= ' (' . $outbarcode . ')';
3576
+					$optlabel .= ' ('.$outbarcode.')';
3577 3577
 				}
3578
-				$optlabel .= ' - ' . dol_trunc($label, $maxlengtharticle);
3578
+				$optlabel .= ' - '.dol_trunc($label, $maxlengtharticle);
3579 3579
 
3580 3580
 				$outvallabel = $objRef;
3581 3581
 				if (!empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) {
3582
-					$outvallabel .= ' (' . $objRefFourn . ')';
3582
+					$outvallabel .= ' ('.$objRefFourn.')';
3583 3583
 				}
3584 3584
 				if (isModEnabled('barcode') && !empty($objp->barcode)) {
3585
-					$outvallabel .= ' (' . $outbarcode . ')';
3585
+					$outvallabel .= ' ('.$outbarcode.')';
3586 3586
 				}
3587
-				$outvallabel .= ' - ' . dol_trunc($label, $maxlengtharticle);
3587
+				$outvallabel .= ' - '.dol_trunc($label, $maxlengtharticle);
3588 3588
 
3589 3589
 				// Units
3590 3590
 				$optlabel .= $outvalUnits;
@@ -3601,7 +3601,7 @@  discard block
 block discarded – undo
3601 3601
 						$prod_supplier->fourn_tva_tx = $objp->tva_tx;
3602 3602
 						$prod_supplier->fk_supplier_price_expression = $objp->fk_supplier_price_expression;
3603 3603
 
3604
-						require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
3604
+						require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
3605 3605
 						$priceparser = new PriceParser($this->db);
3606 3606
 						$price_result = $priceparser->parseProductSupplier($prod_supplier);
3607 3607
 						if ($price_result >= 0) {
@@ -3612,48 +3612,48 @@  discard block
 block discarded – undo
3612 3612
 						}
3613 3613
 					}
3614 3614
 					if ($objp->quantity == 1) {
3615
-						$optlabel .= ' - ' . price($objp->fprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE) ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/";
3616
-						$outvallabel .= ' - ' . price($objp->fprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE) ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency) . "/";
3615
+						$optlabel .= ' - '.price($objp->fprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE) ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/";
3616
+						$outvallabel .= ' - '.price($objp->fprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE) ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency)."/";
3617 3617
 						$optlabel .= $langs->trans("Unit"); // Do not use strtolower because it breaks utf8 encoding
3618 3618
 						$outvallabel .= $langs->transnoentities("Unit");
3619 3619
 					} else {
3620
-						$optlabel .= ' - ' . price($objp->fprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE) ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity;
3621
-						$outvallabel .= ' - ' . price($objp->fprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE) ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity;
3622
-						$optlabel .= ' ' . $langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding
3623
-						$outvallabel .= ' ' . $langs->transnoentities("Units");
3620
+						$optlabel .= ' - '.price($objp->fprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE) ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity;
3621
+						$outvallabel .= ' - '.price($objp->fprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE) ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity;
3622
+						$optlabel .= ' '.$langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding
3623
+						$outvallabel .= ' '.$langs->transnoentities("Units");
3624 3624
 					}
3625 3625
 
3626 3626
 					if ($objp->quantity > 1) {
3627
-						$optlabel .= " (" . price($objp->unitprice * (!empty($conf->global->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
3628
-						$outvallabel .= " (" . price($objp->unitprice * (!empty($conf->global->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
3627
+						$optlabel .= " (".price($objp->unitprice * (!empty($conf->global->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
3628
+						$outvallabel .= " (".price($objp->unitprice * (!empty($conf->global->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
3629 3629
 					}
3630 3630
 					if ($objp->remise_percent >= 1) {
3631
-						$optlabel .= " - " . $langs->trans("Discount") . " : " . vatrate($objp->remise_percent) . ' %';
3632
-						$outvallabel .= " - " . $langs->transnoentities("Discount") . " : " . vatrate($objp->remise_percent) . ' %';
3631
+						$optlabel .= " - ".$langs->trans("Discount")." : ".vatrate($objp->remise_percent).' %';
3632
+						$outvallabel .= " - ".$langs->transnoentities("Discount")." : ".vatrate($objp->remise_percent).' %';
3633 3633
 					}
3634 3634
 					if ($objp->duration) {
3635
-						$optlabel .= " - " . $objp->duration;
3636
-						$outvallabel .= " - " . $objp->duration;
3635
+						$optlabel .= " - ".$objp->duration;
3636
+						$outvallabel .= " - ".$objp->duration;
3637 3637
 					}
3638 3638
 					if (!$socid) {
3639
-						$optlabel .= " - " . dol_trunc($objp->name, 8);
3640
-						$outvallabel .= " - " . dol_trunc($objp->name, 8);
3639
+						$optlabel .= " - ".dol_trunc($objp->name, 8);
3640
+						$outvallabel .= " - ".dol_trunc($objp->name, 8);
3641 3641
 					}
3642 3642
 					if ($objp->supplier_reputation) {
3643 3643
 						//TODO dictionary
3644 3644
 						$reputations = array('' => $langs->trans('Standard'), 'FAVORITE' => $langs->trans('Favorite'), 'NOTTHGOOD' => $langs->trans('NotTheGoodQualitySupplier'), 'DONOTORDER' => $langs->trans('DoNotOrderThisProductToThisSupplier'));
3645 3645
 
3646
-						$optlabel .= " - " . $reputations[$objp->supplier_reputation];
3647
-						$outvallabel .= " - " . $reputations[$objp->supplier_reputation];
3646
+						$optlabel .= " - ".$reputations[$objp->supplier_reputation];
3647
+						$outvallabel .= " - ".$reputations[$objp->supplier_reputation];
3648 3648
 					}
3649 3649
 				} else {
3650 3650
 					if (empty($alsoproductwithnosupplierprice)) {     // No supplier price defined for couple product/supplier
3651
-						$optlabel .= " - <span class='opacitymedium'>" . $langs->trans("NoPriceDefinedForThisSupplier") . '</span>';
3652
-						$outvallabel .= ' - ' . $langs->transnoentities("NoPriceDefinedForThisSupplier");
3651
+						$optlabel .= " - <span class='opacitymedium'>".$langs->trans("NoPriceDefinedForThisSupplier").'</span>';
3652
+						$outvallabel .= ' - '.$langs->transnoentities("NoPriceDefinedForThisSupplier");
3653 3653
 					} else // No supplier price defined for product, even on other suppliers
3654 3654
 					{
3655
-						$optlabel .= " - <span class='opacitymedium'>" . $langs->trans("NoPriceDefinedForThisSupplier") . '</span>';
3656
-						$outvallabel .= ' - ' . $langs->transnoentities("NoPriceDefinedForThisSupplier");
3655
+						$optlabel .= " - <span class='opacitymedium'>".$langs->trans("NoPriceDefinedForThisSupplier").'</span>';
3656
+						$outvallabel .= ' - '.$langs->transnoentities("NoPriceDefinedForThisSupplier");
3657 3657
 					}
3658 3658
 				}
3659 3659
 
@@ -3661,14 +3661,14 @@  discard block
 block discarded – undo
3661 3661
 					$novirtualstock = ($showstockinlist == 2);
3662 3662
 
3663 3663
 					if (!empty($user->rights->stock->lire)) {
3664
-						$outvallabel .= ' - ' . $langs->trans("Stock") . ': ' . price(price2num($objp->stock, 'MS'));
3664
+						$outvallabel .= ' - '.$langs->trans("Stock").': '.price(price2num($objp->stock, 'MS'));
3665 3665
 
3666 3666
 						if ($objp->stock > 0) {
3667 3667
 							$optlabel .= ' - <span class="product_line_stock_ok">';
3668 3668
 						} elseif ($objp->stock <= 0) {
3669 3669
 							$optlabel .= ' - <span class="product_line_stock_too_low">';
3670 3670
 						}
3671
-						$optlabel .= $langs->transnoentities("Stock") . ':' . price(price2num($objp->stock, 'MS'));
3671
+						$optlabel .= $langs->transnoentities("Stock").':'.price(price2num($objp->stock, 'MS'));
3672 3672
 						$optlabel .= '</span>';
3673 3673
 						if (empty($novirtualstock) && !empty($conf->global->STOCK_SHOW_VIRTUAL_STOCK_IN_PRODUCTS_COMBO)) {  // Warning, this option may slow down combo list generation
3674 3674
 							$langs->load("stocks");
@@ -3678,9 +3678,9 @@  discard block
 block discarded – undo
3678 3678
 							$tmpproduct->load_virtual_stock();
3679 3679
 							$virtualstock = $tmpproduct->stock_theorique;
3680 3680
 
3681
-							$outvallabel .= ' - ' . $langs->trans("VirtualStock") . ':' . $virtualstock;
3681
+							$outvallabel .= ' - '.$langs->trans("VirtualStock").':'.$virtualstock;
3682 3682
 
3683
-							$optlabel .= ' - ' . $langs->transnoentities("VirtualStock") . ':';
3683
+							$optlabel .= ' - '.$langs->transnoentities("VirtualStock").':';
3684 3684
 							if ($virtualstock > 0) {
3685 3685
 								$optlabel .= '<span class="product_line_stock_ok">';
3686 3686
 							} elseif ($virtualstock <= 0) {
@@ -3694,7 +3694,7 @@  discard block
 block discarded – undo
3694 3694
 					}
3695 3695
 				}
3696 3696
 
3697
-				$optstart = '<option value="' . $outkey . '"';
3697
+				$optstart = '<option value="'.$outkey.'"';
3698 3698
 				if ($selected && $selected == $objp->idprodfournprice) {
3699 3699
 					$optstart .= ' selected';
3700 3700
 				}
@@ -3703,26 +3703,26 @@  discard block
 block discarded – undo
3703 3703
 				}
3704 3704
 
3705 3705
 				if (!empty($objp->idprodfournprice) && $objp->idprodfournprice > 0) {
3706
-					$optstart .= ' data-product-id="' . dol_escape_htmltag($objp->rowid) . '"';
3707
-					$optstart .= ' data-price-id="' . dol_escape_htmltag($objp->idprodfournprice) . '"';
3708
-					$optstart .= ' data-qty="' . dol_escape_htmltag($objp->quantity) . '"';
3709
-					$optstart .= ' data-up="' . dol_escape_htmltag(price2num($objp->unitprice)) . '"';
3710
-					$optstart .= ' data-up-locale="' . dol_escape_htmltag(price($objp->unitprice)) . '"';
3711
-					$optstart .= ' data-discount="' . dol_escape_htmltag($outdiscount) . '"';
3712
-					$optstart .= ' data-tvatx="' . dol_escape_htmltag(price2num($objp->tva_tx)) . '"';
3713
-					$optstart .= ' data-tvatx-formated="' . dol_escape_htmltag(price($objp->tva_tx, 0, $langs, 1, -1, 2)) . '"';
3714
-					$optstart .= ' data-default-vat-code="' . dol_escape_htmltag($objp->default_vat_code) . '"';
3715
-				}
3716
-				$optstart .= ' data-description="' . dol_escape_htmltag($objp->description, 0, 1) . '"';
3706
+					$optstart .= ' data-product-id="'.dol_escape_htmltag($objp->rowid).'"';
3707
+					$optstart .= ' data-price-id="'.dol_escape_htmltag($objp->idprodfournprice).'"';
3708
+					$optstart .= ' data-qty="'.dol_escape_htmltag($objp->quantity).'"';
3709
+					$optstart .= ' data-up="'.dol_escape_htmltag(price2num($objp->unitprice)).'"';
3710
+					$optstart .= ' data-up-locale="'.dol_escape_htmltag(price($objp->unitprice)).'"';
3711
+					$optstart .= ' data-discount="'.dol_escape_htmltag($outdiscount).'"';
3712
+					$optstart .= ' data-tvatx="'.dol_escape_htmltag(price2num($objp->tva_tx)).'"';
3713
+					$optstart .= ' data-tvatx-formated="'.dol_escape_htmltag(price($objp->tva_tx, 0, $langs, 1, -1, 2)).'"';
3714
+					$optstart .= ' data-default-vat-code="'.dol_escape_htmltag($objp->default_vat_code).'"';
3715
+				}
3716
+				$optstart .= ' data-description="'.dol_escape_htmltag($objp->description, 0, 1).'"';
3717 3717
 
3718 3718
 				$outarrayentry = array(
3719 3719
 					'key' => $outkey,
3720 3720
 					'value' => $outref,
3721 3721
 					'label' => $outvallabel,
3722 3722
 					'qty' => $outqty,
3723
-					'price_qty_ht' => price2num($objp->fprice, 'MU'),    // Keep higher resolution for price for the min qty
3724
-					'price_unit_ht' => price2num($objp->unitprice, 'MU'),    // This is used to fill the Unit Price
3725
-					'price_ht' => price2num($objp->unitprice, 'MU'),        // This is used to fill the Unit Price (for compatibility)
3723
+					'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty
3724
+					'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price
3725
+					'price_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility)
3726 3726
 					'tva_tx_formated' => price($objp->tva_tx, 0, $langs, 1, -1, 2),
3727 3727
 					'tva_tx' => price2num($objp->tva_tx),
3728 3728
 					'default_vat_code' => $objp->default_vat_code,
@@ -3747,18 +3747,18 @@  discard block
 block discarded – undo
3747 3747
 				// Add new entry
3748 3748
 				// "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
3749 3749
 				// "label" value of json key array is used by jQuery automatically as text for combo box
3750
-				$out .= $optstart . ' data-html="' . dol_escape_htmltag($optlabel) . '">' . $optlabel . "</option>\n";
3750
+				$out .= $optstart.' data-html="'.dol_escape_htmltag($optlabel).'">'.$optlabel."</option>\n";
3751 3751
 				array_push(
3752 3752
 					$outarray,
3753 3753
 					array('key' => $outkey,
3754 3754
 						'value' => $outref,
3755 3755
 						'label' => $outvallabel,
3756 3756
 						'qty' => $outqty,
3757
-						'price_qty_ht' => price2num($objp->fprice, 'MU'),        // Keep higher resolution for price for the min qty
3757
+						'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty
3758 3758
 						'price_qty_ht_locale' => price($objp->fprice),
3759
-						'price_unit_ht' => price2num($objp->unitprice, 'MU'),    // This is used to fill the Unit Price
3759
+						'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price
3760 3760
 						'price_unit_ht_locale' => price($objp->unitprice),
3761
-						'price_ht' => price2num($objp->unitprice, 'MU'),        // This is used to fill the Unit Price (for compatibility)
3761
+						'price_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility)
3762 3762
 						'tva_tx_formated' => price($objp->tva_tx),
3763 3763
 						'tva_tx' => price2num($objp->tva_tx),
3764 3764
 						'default_vat_code' => $objp->default_vat_code,
@@ -3785,7 +3785,7 @@  discard block
 block discarded – undo
3785 3785
 
3786 3786
 			$this->db->free($result);
3787 3787
 
3788
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
3788
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
3789 3789
 			$out .= ajax_combobox($htmlname);
3790 3790
 		} else {
3791 3791
 			dol_print_error($this->db);
@@ -3817,43 +3817,43 @@  discard block
 block discarded – undo
3817 3817
 		$sql = "SELECT p.rowid, p.ref, p.label, p.price, p.duration, pfp.fk_soc,";
3818 3818
 		$sql .= " pfp.ref_fourn, pfp.rowid as idprodfournprice, pfp.price as fprice, pfp.remise_percent, pfp.quantity, pfp.unitprice,";
3819 3819
 		$sql .= " pfp.fk_supplier_price_expression, pfp.fk_product, pfp.tva_tx, s.nom as name";
3820
-		$sql .= " FROM " . $this->db->prefix() . "product as p";
3821
-		$sql .= " LEFT JOIN " . $this->db->prefix() . "product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
3822
-		$sql .= " LEFT JOIN " . $this->db->prefix() . "societe as s ON pfp.fk_soc = s.rowid";
3823
-		$sql .= " WHERE pfp.entity IN (" . getEntity('productsupplierprice') . ")";
3820
+		$sql .= " FROM ".$this->db->prefix()."product as p";
3821
+		$sql .= " LEFT JOIN ".$this->db->prefix()."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
3822
+		$sql .= " LEFT JOIN ".$this->db->prefix()."societe as s ON pfp.fk_soc = s.rowid";
3823
+		$sql .= " WHERE pfp.entity IN (".getEntity('productsupplierprice').")";
3824 3824
 		$sql .= " AND p.tobuy = 1";
3825 3825
 		$sql .= " AND s.fournisseur = 1";
3826
-		$sql .= " AND p.rowid = " . ((int) $productid);
3826
+		$sql .= " AND p.rowid = ".((int) $productid);
3827 3827
 		if (empty($conf->global->PRODUCT_BEST_SUPPLIER_PRICE_PRESELECTED)) {
3828 3828
 			$sql .= " ORDER BY s.nom, pfp.ref_fourn DESC";
3829 3829
 		} else {
3830 3830
 			$sql .= " ORDER BY pfp.unitprice ASC";
3831 3831
 		}
3832 3832
 
3833
-		dol_syslog(get_class($this) . "::select_product_fourn_price", LOG_DEBUG);
3833
+		dol_syslog(get_class($this)."::select_product_fourn_price", LOG_DEBUG);
3834 3834
 		$result = $this->db->query($sql);
3835 3835
 
3836 3836
 		if ($result) {
3837 3837
 			$num = $this->db->num_rows($result);
3838 3838
 
3839
-			$form = '<select class="flat" id="select_' . $htmlname . '" name="' . $htmlname . '">';
3839
+			$form = '<select class="flat" id="select_'.$htmlname.'" name="'.$htmlname.'">';
3840 3840
 
3841 3841
 			if (!$num) {
3842
-				$form .= '<option value="0">-- ' . $langs->trans("NoSupplierPriceDefinedForThisProduct") . ' --</option>';
3842
+				$form .= '<option value="0">-- '.$langs->trans("NoSupplierPriceDefinedForThisProduct").' --</option>';
3843 3843
 			} else {
3844
-				require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
3844
+				require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
3845 3845
 				$form .= '<option value="0">&nbsp;</option>';
3846 3846
 
3847 3847
 				$i = 0;
3848 3848
 				while ($i < $num) {
3849 3849
 					$objp = $this->db->fetch_object($result);
3850 3850
 
3851
-					$opt = '<option value="' . $objp->idprodfournprice . '"';
3851
+					$opt = '<option value="'.$objp->idprodfournprice.'"';
3852 3852
 					//if there is only one supplier, preselect it
3853 3853
 					if ($num == 1 || ($selected_supplier > 0 && $objp->fk_soc == $selected_supplier) || ($i == 0 && !empty($conf->global->PRODUCT_BEST_SUPPLIER_PRICE_PRESELECTED))) {
3854 3854
 						$opt .= ' selected';
3855 3855
 					}
3856
-					$opt .= '>' . $objp->name . ' - ' . $objp->ref_fourn . ' - ';
3856
+					$opt .= '>'.$objp->name.' - '.$objp->ref_fourn.' - ';
3857 3857
 
3858 3858
 					if (isModEnabled('dynamicprices') && !empty($objp->fk_supplier_price_expression)) {
3859 3859
 						$prod_supplier = new ProductFournisseur($this->db);
@@ -3863,7 +3863,7 @@  discard block
 block discarded – undo
3863 3863
 						$prod_supplier->fourn_tva_tx = $objp->tva_tx;
3864 3864
 						$prod_supplier->fk_supplier_price_expression = $objp->fk_supplier_price_expression;
3865 3865
 
3866
-						require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
3866
+						require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
3867 3867
 						$priceparser = new PriceParser($this->db);
3868 3868
 						$price_result = $priceparser->parseProductSupplier($prod_supplier);
3869 3869
 						if ($price_result >= 0) {
@@ -3874,10 +3874,10 @@  discard block
 block discarded – undo
3874 3874
 						}
3875 3875
 					}
3876 3876
 					if ($objp->quantity == 1) {
3877
-						$opt .= price($objp->fprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE) ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/";
3877
+						$opt .= price($objp->fprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE) ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/";
3878 3878
 					}
3879 3879
 
3880
-					$opt .= $objp->quantity . ' ';
3880
+					$opt .= $objp->quantity.' ';
3881 3881
 
3882 3882
 					if ($objp->quantity == 1) {
3883 3883
 						$opt .= $langs->trans("Unit");
@@ -3886,10 +3886,10 @@  discard block
 block discarded – undo
3886 3886
 					}
3887 3887
 					if ($objp->quantity > 1) {
3888 3888
 						$opt .= " - ";
3889
-						$opt .= price($objp->unitprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE) ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->trans("Unit");
3889
+						$opt .= price($objp->unitprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE) ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/".$langs->trans("Unit");
3890 3890
 					}
3891 3891
 					if ($objp->duration) {
3892
-						$opt .= " - " . $objp->duration;
3892
+						$opt .= " - ".$objp->duration;
3893 3893
 					}
3894 3894
 					$opt .= "</option>\n";
3895 3895
 
@@ -3923,14 +3923,14 @@  discard block
 block discarded – undo
3923 3923
 		// phpcs:enable
3924 3924
 		// looking for users
3925 3925
 		$sql = "SELECT a.rowid, a.label";
3926
-		$sql .= " FROM " . $this->db->prefix() . "societe_address as a";
3927
-		$sql .= " WHERE a.fk_soc = " . ((int) $socid);
3926
+		$sql .= " FROM ".$this->db->prefix()."societe_address as a";
3927
+		$sql .= " WHERE a.fk_soc = ".((int) $socid);
3928 3928
 		$sql .= " ORDER BY a.label ASC";
3929 3929
 
3930
-		dol_syslog(get_class($this) . "::select_address", LOG_DEBUG);
3930
+		dol_syslog(get_class($this)."::select_address", LOG_DEBUG);
3931 3931
 		$resql = $this->db->query($sql);
3932 3932
 		if ($resql) {
3933
-			print '<select class="flat" id="select_' . $htmlname . '" name="' . $htmlname . '">';
3933
+			print '<select class="flat" id="select_'.$htmlname.'" name="'.$htmlname.'">';
3934 3934
 			if ($showempty) {
3935 3935
 				print '<option value="0">&nbsp;</option>';
3936 3936
 			}
@@ -3941,9 +3941,9 @@  discard block
 block discarded – undo
3941 3941
 					$obj = $this->db->fetch_object($resql);
3942 3942
 
3943 3943
 					if ($selected && $selected == $obj->rowid) {
3944
-						print '<option value="' . $obj->rowid . '" selected>' . $obj->label . '</option>';
3944
+						print '<option value="'.$obj->rowid.'" selected>'.$obj->label.'</option>';
3945 3945
 					} else {
3946
-						print '<option value="' . $obj->rowid . '">' . $obj->label . '</option>';
3946
+						print '<option value="'.$obj->rowid.'">'.$obj->label.'</option>';
3947 3947
 					}
3948 3948
 					$i++;
3949 3949
 				}
@@ -3976,8 +3976,8 @@  discard block
 block discarded – undo
3976 3976
 		dol_syslog(__METHOD__, LOG_DEBUG);
3977 3977
 
3978 3978
 		$sql = "SELECT rowid, code, libelle as label, deposit_percent";
3979
-		$sql .= " FROM " . $this->db->prefix() . 'c_payment_term';
3980
-		$sql .= " WHERE entity IN (" . getEntity('c_payment_term') . ")";
3979
+		$sql .= " FROM ".$this->db->prefix().'c_payment_term';
3980
+		$sql .= " WHERE entity IN (".getEntity('c_payment_term').")";
3981 3981
 		$sql .= " AND active > 0";
3982 3982
 		$sql .= " ORDER BY sortorder";
3983 3983
 
@@ -3989,7 +3989,7 @@  discard block
 block discarded – undo
3989 3989
 				$obj = $this->db->fetch_object($resql);
3990 3990
 
3991 3991
 				// Si traduction existe, on l'utilise, sinon on prend le libelle par defaut
3992
-				$label = ($langs->trans("PaymentConditionShort" . $obj->code) != ("PaymentConditionShort" . $obj->code) ? $langs->trans("PaymentConditionShort" . $obj->code) : ($obj->label != '-' ? $obj->label : ''));
3992
+				$label = ($langs->trans("PaymentConditionShort".$obj->code) != ("PaymentConditionShort".$obj->code) ? $langs->trans("PaymentConditionShort".$obj->code) : ($obj->label != '-' ? $obj->label : ''));
3993 3993
 				$this->cache_conditions_paiements[$obj->rowid]['code'] = $obj->code;
3994 3994
 				$this->cache_conditions_paiements[$obj->rowid]['label'] = $label;
3995 3995
 				$this->cache_conditions_paiements[$obj->rowid]['deposit_percent'] = $obj->deposit_percent;
@@ -4017,7 +4017,7 @@  discard block
 block discarded – undo
4017 4017
 		// phpcs:enable
4018 4018
 		global $langs;
4019 4019
 
4020
-		$num = count($this->cache_availability);    // TODO Use $conf->cache['availability'] instead of $this->cache_availability
4020
+		$num = count($this->cache_availability); // TODO Use $conf->cache['availability'] instead of $this->cache_availability
4021 4021
 		if ($num > 0) {
4022 4022
 			return 0; // Cache already loaded
4023 4023
 		}
@@ -4027,7 +4027,7 @@  discard block
 block discarded – undo
4027 4027
 		$langs->load('propal');
4028 4028
 
4029 4029
 		$sql = "SELECT rowid, code, label, position";
4030
-		$sql .= " FROM " . $this->db->prefix() . 'c_availability';
4030
+		$sql .= " FROM ".$this->db->prefix().'c_availability';
4031 4031
 		$sql .= " WHERE active > 0";
4032 4032
 
4033 4033
 		$resql = $this->db->query($sql);
@@ -4038,7 +4038,7 @@  discard block
 block discarded – undo
4038 4038
 				$obj = $this->db->fetch_object($resql);
4039 4039
 
4040 4040
 				// Si traduction existe, on l'utilise, sinon on prend le libelle par defaut
4041
-				$label = ($langs->trans("AvailabilityType" . $obj->code) != ("AvailabilityType" . $obj->code) ? $langs->trans("AvailabilityType" . $obj->code) : ($obj->label != '-' ? $obj->label : ''));
4041
+				$label = ($langs->trans("AvailabilityType".$obj->code) != ("AvailabilityType".$obj->code) ? $langs->trans("AvailabilityType".$obj->code) : ($obj->label != '-' ? $obj->label : ''));
4042 4042
 				$this->cache_availability[$obj->rowid]['code'] = $obj->code;
4043 4043
 				$this->cache_availability[$obj->rowid]['label'] = $label;
4044 4044
 				$this->cache_availability[$obj->rowid]['position'] = $obj->position;
@@ -4070,17 +4070,17 @@  discard block
 block discarded – undo
4070 4070
 
4071 4071
 		$this->load_cache_availability();
4072 4072
 
4073
-		dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG);
4073
+		dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG);
4074 4074
 
4075
-		print '<select id="' . $htmlname . '" class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">';
4075
+		print '<select id="'.$htmlname.'" class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
4076 4076
 		if ($addempty) {
4077 4077
 			print '<option value="0">&nbsp;</option>';
4078 4078
 		}
4079 4079
 		foreach ($this->cache_availability as $id => $arrayavailability) {
4080 4080
 			if ($selected == $id) {
4081
-				print '<option value="' . $id . '" selected>';
4081
+				print '<option value="'.$id.'" selected>';
4082 4082
 			} else {
4083
-				print '<option value="' . $id . '">';
4083
+				print '<option value="'.$id.'">';
4084 4084
 			}
4085 4085
 			print dol_escape_htmltag($arrayavailability['label']);
4086 4086
 			print '</option>';
@@ -4101,13 +4101,13 @@  discard block
 block discarded – undo
4101 4101
 	{
4102 4102
 		global $langs;
4103 4103
 
4104
-		$num = count($this->cache_demand_reason);    // TODO Use $conf->cache['input_reason'] instead of $this->cache_demand_reason
4104
+		$num = count($this->cache_demand_reason); // TODO Use $conf->cache['input_reason'] instead of $this->cache_demand_reason
4105 4105
 		if ($num > 0) {
4106 4106
 			return 0; // Cache already loaded
4107 4107
 		}
4108 4108
 
4109 4109
 		$sql = "SELECT rowid, code, label";
4110
-		$sql .= " FROM " . $this->db->prefix() . 'c_input_reason';
4110
+		$sql .= " FROM ".$this->db->prefix().'c_input_reason';
4111 4111
 		$sql .= " WHERE active > 0";
4112 4112
 
4113 4113
 		$resql = $this->db->query($sql);
@@ -4120,8 +4120,8 @@  discard block
 block discarded – undo
4120 4120
 
4121 4121
 				// Si traduction existe, on l'utilise, sinon on prend le libelle par defaut
4122 4122
 				$label = ($obj->label != '-' ? $obj->label : '');
4123
-				if ($langs->trans("DemandReasonType" . $obj->code) != ("DemandReasonType" . $obj->code)) {
4124
-					$label = $langs->trans("DemandReasonType" . $obj->code); // So translation key DemandReasonTypeSRC_XXX will work
4123
+				if ($langs->trans("DemandReasonType".$obj->code) != ("DemandReasonType".$obj->code)) {
4124
+					$label = $langs->trans("DemandReasonType".$obj->code); // So translation key DemandReasonTypeSRC_XXX will work
4125 4125
 				}
4126 4126
 				if ($langs->trans($obj->code) != $obj->code) {
4127 4127
 					$label = $langs->trans($obj->code); // So translation key SRC_XXX will work
@@ -4161,9 +4161,9 @@  discard block
 block discarded – undo
4161 4161
 
4162 4162
 		$this->loadCacheInputReason();
4163 4163
 
4164
-		print '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="select_' . $htmlname . '" name="' . $htmlname . '">';
4164
+		print '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="select_'.$htmlname.'" name="'.$htmlname.'">';
4165 4165
 		if ($addempty) {
4166
-			print '<option value="0"' . (empty($selected) ? ' selected' : '') . '>&nbsp;</option>';
4166
+			print '<option value="0"'.(empty($selected) ? ' selected' : '').'>&nbsp;</option>';
4167 4167
 		}
4168 4168
 		foreach ($this->cache_demand_reason as $id => $arraydemandreason) {
4169 4169
 			if ($arraydemandreason['code'] == $exclude) {
@@ -4171,9 +4171,9 @@  discard block
 block discarded – undo
4171 4171
 			}
4172 4172
 
4173 4173
 			if ($selected && ($selected == $arraydemandreason['id'] || $selected == $arraydemandreason['code'])) {
4174
-				print '<option value="' . $arraydemandreason['id'] . '" selected>';
4174
+				print '<option value="'.$arraydemandreason['id'].'" selected>';
4175 4175
 			} else {
4176
-				print '<option value="' . $arraydemandreason['id'] . '">';
4176
+				print '<option value="'.$arraydemandreason['id'].'">';
4177 4177
 			}
4178 4178
 			$label = $arraydemandreason['label']; // Translation of label was already done into the ->loadCacheInputReason
4179 4179
 			print $langs->trans($label);
@@ -4183,7 +4183,7 @@  discard block
 block discarded – undo
4183 4183
 		if ($user->admin && empty($notooltip)) {
4184 4184
 			print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
4185 4185
 		}
4186
-		print ajax_combobox('select_' . $htmlname);
4186
+		print ajax_combobox('select_'.$htmlname);
4187 4187
 	}
4188 4188
 
4189 4189
 	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
@@ -4198,7 +4198,7 @@  discard block
 block discarded – undo
4198 4198
 		// phpcs:enable
4199 4199
 		global $langs;
4200 4200
 
4201
-		$num = count($this->cache_types_paiements);        // TODO Use $conf->cache['payment_mode'] instead of $this->cache_types_paiements
4201
+		$num = count($this->cache_types_paiements); // TODO Use $conf->cache['payment_mode'] instead of $this->cache_types_paiements
4202 4202
 		if ($num > 0) {
4203 4203
 			return $num; // Cache already loaded
4204 4204
 		}
@@ -4208,8 +4208,8 @@  discard block
 block discarded – undo
4208 4208
 		$this->cache_types_paiements = array();
4209 4209
 
4210 4210
 		$sql = "SELECT id, code, libelle as label, type, active";
4211
-		$sql .= " FROM " . $this->db->prefix() . "c_paiement";
4212
-		$sql .= " WHERE entity IN (" . getEntity('c_paiement') . ")";
4211
+		$sql .= " FROM ".$this->db->prefix()."c_paiement";
4212
+		$sql .= " WHERE entity IN (".getEntity('c_paiement').")";
4213 4213
 
4214 4214
 		$resql = $this->db->query($sql);
4215 4215
 		if ($resql) {
@@ -4219,7 +4219,7 @@  discard block
 block discarded – undo
4219 4219
 				$obj = $this->db->fetch_object($resql);
4220 4220
 
4221 4221
 				// Si traduction existe, on l'utilise, sinon on prend le libelle par defaut
4222
-				$label = ($langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) != ("PaymentTypeShort" . $obj->code) ? $langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) : ($obj->label != '-' ? $obj->label : ''));
4222
+				$label = ($langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) != ("PaymentTypeShort".$obj->code) ? $langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) : ($obj->label != '-' ? $obj->label : ''));
4223 4223
 				$this->cache_types_paiements[$obj->id]['id'] = $obj->id;
4224 4224
 				$this->cache_types_paiements[$obj->id]['code'] = $obj->code;
4225 4225
 				$this->cache_types_paiements[$obj->id]['label'] = $label;
@@ -4285,17 +4285,17 @@  discard block
 block discarded – undo
4285 4285
 		global $langs, $user, $conf;
4286 4286
 
4287 4287
 		$out = '';
4288
-		dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG);
4288
+		dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG);
4289 4289
 
4290 4290
 		$this->load_cache_conditions_paiements();
4291 4291
 
4292 4292
 		// Set default value if not already set by caller
4293 4293
 		if (empty($selected) && !empty($conf->global->MAIN_DEFAULT_PAYMENT_TERM_ID)) {
4294
-			dol_syslog(__METHOD__ . "Using deprecated option MAIN_DEFAULT_PAYMENT_TERM_ID", LOG_NOTICE);
4294
+			dol_syslog(__METHOD__."Using deprecated option MAIN_DEFAULT_PAYMENT_TERM_ID", LOG_NOTICE);
4295 4295
 			$selected = $conf->global->MAIN_DEFAULT_PAYMENT_TERM_ID;
4296 4296
 		}
4297 4297
 
4298
-		$out .= '<select id="' . $htmlname . '" class="flat selectpaymentterms' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">';
4298
+		$out .= '<select id="'.$htmlname.'" class="flat selectpaymentterms'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
4299 4299
 		if ($addempty) {
4300 4300
 			$out .= '<option value="0">&nbsp;</option>';
4301 4301
 		}
@@ -4309,9 +4309,9 @@  discard block
 block discarded – undo
4309 4309
 
4310 4310
 			if ($selected == $id) {
4311 4311
 				$selectedDepositPercent = $deposit_percent > 0 ? $deposit_percent : $arrayconditions['deposit_percent'];
4312
-				$out .= '<option value="' . $id . '" data-deposit_percent="' . $arrayconditions['deposit_percent'] . '" selected>';
4312
+				$out .= '<option value="'.$id.'" data-deposit_percent="'.$arrayconditions['deposit_percent'].'" selected>';
4313 4313
 			} else {
4314
-				$out .= '<option value="' . $id . '" data-deposit_percent="' . $arrayconditions['deposit_percent'] . '">';
4314
+				$out .= '<option value="'.$id.'" data-deposit_percent="'.$arrayconditions['deposit_percent'].'">';
4315 4315
 			}
4316 4316
 			$label = $arrayconditions['label'];
4317 4317
 
@@ -4329,21 +4329,21 @@  discard block
 block discarded – undo
4329 4329
 		$out .= ajax_combobox($htmlname);
4330 4330
 
4331 4331
 		if ($deposit_percent >= 0) {
4332
-			$out .= ' <span id="' . $htmlname . '_deposit_percent_container"' . (empty($selectedDepositPercent) ? ' style="display: none"' : '') . '>';
4333
-			$out .= $langs->trans('DepositPercent') . ' : ';
4334
-			$out .= '<input id="' . $htmlname . '_deposit_percent" name="' . $htmlname . '_deposit_percent" class="maxwidth50" value="' . $deposit_percent . '" />';
4332
+			$out .= ' <span id="'.$htmlname.'_deposit_percent_container"'.(empty($selectedDepositPercent) ? ' style="display: none"' : '').'>';
4333
+			$out .= $langs->trans('DepositPercent').' : ';
4334
+			$out .= '<input id="'.$htmlname.'_deposit_percent" name="'.$htmlname.'_deposit_percent" class="maxwidth50" value="'.$deposit_percent.'" />';
4335 4335
 			$out .= '</span>';
4336 4336
 			$out .= '
4337
-				<script nonce="' . getNonce() . '">
4337
+				<script nonce="' . getNonce().'">
4338 4338
 					$(document).ready(function () {
4339
-						$("#' . $htmlname . '").change(function () {
4339
+						$("#' . $htmlname.'").change(function () {
4340 4340
 							let $selected = $(this).find("option:selected");
4341 4341
 							let depositPercent = $selected.attr("data-deposit_percent");
4342 4342
 
4343 4343
 							if (depositPercent.length > 0) {
4344
-								$("#' . $htmlname . '_deposit_percent_container").show().find("#' . $htmlname . '_deposit_percent").val(depositPercent);
4344
+								$("#' . $htmlname.'_deposit_percent_container").show().find("#'.$htmlname.'_deposit_percent").val(depositPercent);
4345 4345
 							} else {
4346
-								$("#' . $htmlname . '_deposit_percent_container").hide();
4346
+								$("#' . $htmlname.'_deposit_percent_container").hide();
4347 4347
 							}
4348 4348
 
4349 4349
 							return true;
@@ -4381,7 +4381,7 @@  discard block
 block discarded – undo
4381 4381
 
4382 4382
 		$out = '';
4383 4383
 
4384
-		dol_syslog(__METHOD__ . " " . $selected . ", " . $htmlname . ", " . $filtertype . ", " . $format, LOG_DEBUG);
4384
+		dol_syslog(__METHOD__." ".$selected.", ".$htmlname.", ".$filtertype.", ".$format, LOG_DEBUG);
4385 4385
 
4386 4386
 		$filterarray = array();
4387 4387
 		if ($filtertype == 'CRDT') {
@@ -4396,11 +4396,11 @@  discard block
 block discarded – undo
4396 4396
 
4397 4397
 		// Set default value if not already set by caller
4398 4398
 		if (empty($selected) && !empty($conf->global->MAIN_DEFAULT_PAYMENT_TYPE_ID)) {
4399
-			dol_syslog(__METHOD__ . "Using deprecated option MAIN_DEFAULT_PAYMENT_TYPE_ID", LOG_NOTICE);
4399
+			dol_syslog(__METHOD__."Using deprecated option MAIN_DEFAULT_PAYMENT_TYPE_ID", LOG_NOTICE);
4400 4400
 			$selected = $conf->global->MAIN_DEFAULT_PAYMENT_TYPE_ID;
4401 4401
 		}
4402 4402
 
4403
-		$out .= '<select id="select' . $htmlname . '" class="flat selectpaymenttypes' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">';
4403
+		$out .= '<select id="select'.$htmlname.'" class="flat selectpaymenttypes'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
4404 4404
 		if ($empty) {
4405 4405
 			$out .= '<option value="">&nbsp;</option>';
4406 4406
 		}
@@ -4421,13 +4421,13 @@  discard block
 block discarded – undo
4421 4421
 			}
4422 4422
 
4423 4423
 			if ($format == 0) {
4424
-				$out .= '<option value="' . $id . '"';
4424
+				$out .= '<option value="'.$id.'"';
4425 4425
 			} elseif ($format == 1) {
4426
-				$out .= '<option value="' . $arraytypes['code'] . '"';
4426
+				$out .= '<option value="'.$arraytypes['code'].'"';
4427 4427
 			} elseif ($format == 2) {
4428
-				$out .= '<option value="' . $arraytypes['code'] . '"';
4428
+				$out .= '<option value="'.$arraytypes['code'].'"';
4429 4429
 			} elseif ($format == 3) {
4430
-				$out .= '<option value="' . $id . '"';
4430
+				$out .= '<option value="'.$id.'"';
4431 4431
 			}
4432 4432
 			// Print attribute selected or not
4433 4433
 			if ($format == 1 || $format == 2) {
@@ -4457,7 +4457,7 @@  discard block
 block discarded – undo
4457 4457
 		if ($user->admin && !$noadmininfo) {
4458 4458
 			$out .= info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
4459 4459
 		}
4460
-		$out .= ajax_combobox('select' . $htmlname);
4460
+		$out .= ajax_combobox('select'.$htmlname);
4461 4461
 
4462 4462
 		if (empty($nooutput)) {
4463 4463
 			print $out;
@@ -4479,22 +4479,22 @@  discard block
 block discarded – undo
4479 4479
 	{
4480 4480
 		global $langs;
4481 4481
 
4482
-		$return = '<select class="flat maxwidth100" id="select_' . $htmlname . '" name="' . $htmlname . '">';
4482
+		$return = '<select class="flat maxwidth100" id="select_'.$htmlname.'" name="'.$htmlname.'">';
4483 4483
 		$options = array(
4484 4484
 			'HT' => $langs->trans("HT"),
4485 4485
 			'TTC' => $langs->trans("TTC")
4486 4486
 		);
4487 4487
 		foreach ($options as $id => $value) {
4488 4488
 			if ($selected == $id) {
4489
-				$return .= '<option value="' . $id . '" selected>' . $value;
4489
+				$return .= '<option value="'.$id.'" selected>'.$value;
4490 4490
 			} else {
4491
-				$return .= '<option value="' . $id . '">' . $value;
4491
+				$return .= '<option value="'.$id.'">'.$value;
4492 4492
 			}
4493 4493
 			$return .= '</option>';
4494 4494
 		}
4495 4495
 		$return .= '</select>';
4496 4496
 		if ($addjscombo) {
4497
-			$return .= ajax_combobox('select_' . $htmlname);
4497
+			$return .= ajax_combobox('select_'.$htmlname);
4498 4498
 		}
4499 4499
 
4500 4500
 		return $return;
@@ -4512,7 +4512,7 @@  discard block
 block discarded – undo
4512 4512
 		// phpcs:enable
4513 4513
 		global $langs;
4514 4514
 
4515
-		$num = count($this->cache_transport_mode);        // TODO Use $conf->cache['payment_mode'] instead of $this->cache_transport_mode
4515
+		$num = count($this->cache_transport_mode); // TODO Use $conf->cache['payment_mode'] instead of $this->cache_transport_mode
4516 4516
 		if ($num > 0) {
4517 4517
 			return $num; // Cache already loaded
4518 4518
 		}
@@ -4522,8 +4522,8 @@  discard block
 block discarded – undo
4522 4522
 		$this->cache_transport_mode = array();
4523 4523
 
4524 4524
 		$sql = "SELECT rowid, code, label, active";
4525
-		$sql .= " FROM " . $this->db->prefix() . "c_transport_mode";
4526
-		$sql .= " WHERE entity IN (" . getEntity('c_transport_mode') . ")";
4525
+		$sql .= " FROM ".$this->db->prefix()."c_transport_mode";
4526
+		$sql .= " WHERE entity IN (".getEntity('c_transport_mode').")";
4527 4527
 
4528 4528
 		$resql = $this->db->query($sql);
4529 4529
 		if ($resql) {
@@ -4533,7 +4533,7 @@  discard block
 block discarded – undo
4533 4533
 				$obj = $this->db->fetch_object($resql);
4534 4534
 
4535 4535
 				// If traduction exist, we use it else we take the default label
4536
-				$label = ($langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) != ("PaymentTypeShort" . $obj->code) ? $langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) : ($obj->label != '-' ? $obj->label : ''));
4536
+				$label = ($langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) != ("PaymentTypeShort".$obj->code) ? $langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) : ($obj->label != '-' ? $obj->label : ''));
4537 4537
 				$this->cache_transport_mode[$obj->rowid]['rowid'] = $obj->rowid;
4538 4538
 				$this->cache_transport_mode[$obj->rowid]['code'] = $obj->code;
4539 4539
 				$this->cache_transport_mode[$obj->rowid]['label'] = $label;
@@ -4567,11 +4567,11 @@  discard block
 block discarded – undo
4567 4567
 	{
4568 4568
 		global $langs, $user;
4569 4569
 
4570
-		dol_syslog(__METHOD__ . " " . $selected . ", " . $htmlname . ", " . $format, LOG_DEBUG);
4570
+		dol_syslog(__METHOD__." ".$selected.", ".$htmlname.", ".$format, LOG_DEBUG);
4571 4571
 
4572 4572
 		$this->load_cache_transport_mode();
4573 4573
 
4574
-		print '<select id="select' . $htmlname . '" class="flat selectmodetransport' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">';
4574
+		print '<select id="select'.$htmlname.'" class="flat selectmodetransport'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
4575 4575
 		if ($empty) {
4576 4576
 			print '<option value="">&nbsp;</option>';
4577 4577
 		}
@@ -4587,13 +4587,13 @@  discard block
 block discarded – undo
4587 4587
 			}
4588 4588
 
4589 4589
 			if ($format == 0) {
4590
-				print '<option value="' . $id . '"';
4590
+				print '<option value="'.$id.'"';
4591 4591
 			} elseif ($format == 1) {
4592
-				print '<option value="' . $arraytypes['code'] . '"';
4592
+				print '<option value="'.$arraytypes['code'].'"';
4593 4593
 			} elseif ($format == 2) {
4594
-				print '<option value="' . $arraytypes['code'] . '"';
4594
+				print '<option value="'.$arraytypes['code'].'"';
4595 4595
 			} elseif ($format == 3) {
4596
-				print '<option value="' . $id . '"';
4596
+				print '<option value="'.$id.'"';
4597 4597
 			}
4598 4598
 			// If text is selected, we compare with code, else with id
4599 4599
 			if (preg_match('/[a-z]/i', $selected) && $selected == $arraytypes['code']) {
@@ -4641,31 +4641,31 @@  discard block
 block discarded – undo
4641 4641
 		$langs->load("deliveries");
4642 4642
 
4643 4643
 		$sql = "SELECT rowid, code, libelle as label";
4644
-		$sql .= " FROM " . $this->db->prefix() . "c_shipment_mode";
4644
+		$sql .= " FROM ".$this->db->prefix()."c_shipment_mode";
4645 4645
 		$sql .= " WHERE active > 0";
4646 4646
 		if ($filtre) {
4647
-			$sql .= " AND " . $filtre;
4647
+			$sql .= " AND ".$filtre;
4648 4648
 		}
4649 4649
 		$sql .= " ORDER BY libelle ASC";
4650 4650
 
4651
-		dol_syslog(get_class($this) . "::selectShippingMode", LOG_DEBUG);
4651
+		dol_syslog(get_class($this)."::selectShippingMode", LOG_DEBUG);
4652 4652
 		$result = $this->db->query($sql);
4653 4653
 		if ($result) {
4654 4654
 			$num = $this->db->num_rows($result);
4655 4655
 			$i = 0;
4656 4656
 			if ($num) {
4657
-				print '<select id="select' . $htmlname . '" class="flat selectshippingmethod' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>';
4657
+				print '<select id="select'.$htmlname.'" class="flat selectshippingmethod'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>';
4658 4658
 				if ($useempty == 1 || ($useempty == 2 && $num > 1)) {
4659 4659
 					print '<option value="-1">&nbsp;</option>';
4660 4660
 				}
4661 4661
 				while ($i < $num) {
4662 4662
 					$obj = $this->db->fetch_object($result);
4663 4663
 					if ($selected == $obj->rowid) {
4664
-						print '<option value="' . $obj->rowid . '" selected>';
4664
+						print '<option value="'.$obj->rowid.'" selected>';
4665 4665
 					} else {
4666
-						print '<option value="' . $obj->rowid . '">';
4666
+						print '<option value="'.$obj->rowid.'">';
4667 4667
 					}
4668
-					print ($langs->trans("SendingMethod" . strtoupper($obj->code)) != "SendingMethod" . strtoupper($obj->code)) ? $langs->trans("SendingMethod" . strtoupper($obj->code)) : $obj->label;
4668
+					print ($langs->trans("SendingMethod".strtoupper($obj->code)) != "SendingMethod".strtoupper($obj->code)) ? $langs->trans("SendingMethod".strtoupper($obj->code)) : $obj->label;
4669 4669
 					print '</option>';
4670 4670
 					$i++;
4671 4671
 				}
@@ -4674,7 +4674,7 @@  discard block
 block discarded – undo
4674 4674
 					print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
4675 4675
 				}
4676 4676
 
4677
-				print ajax_combobox('select' . $htmlname);
4677
+				print ajax_combobox('select'.$htmlname);
4678 4678
 			} else {
4679 4679
 				print $langs->trans("NoShippingMethodDefined");
4680 4680
 			}
@@ -4699,16 +4699,16 @@  discard block
 block discarded – undo
4699 4699
 		$langs->load("deliveries");
4700 4700
 
4701 4701
 		if ($htmlname != "none") {
4702
-			print '<form method="POST" action="' . $page . '">';
4702
+			print '<form method="POST" action="'.$page.'">';
4703 4703
 			print '<input type="hidden" name="action" value="setshippingmethod">';
4704
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
4704
+			print '<input type="hidden" name="token" value="'.newToken().'">';
4705 4705
 			$this->selectShippingMethod($selected, $htmlname, '', $addempty);
4706
-			print '<input type="submit" class="button valignmiddle" value="' . $langs->trans("Modify") . '">';
4706
+			print '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
4707 4707
 			print '</form>';
4708 4708
 		} else {
4709 4709
 			if ($selected) {
4710 4710
 				$code = $langs->getLabelFromKey($this->db, $selected, 'c_shipment_mode', 'rowid', 'code');
4711
-				print $langs->trans("SendingMethod" . strtoupper($code));
4711
+				print $langs->trans("SendingMethod".strtoupper($code));
4712 4712
 			} else {
4713 4713
 				print "&nbsp;";
4714 4714
 			}
@@ -4731,10 +4731,10 @@  discard block
 block discarded – undo
4731 4731
 
4732 4732
 		$opt = '<option value="" selected></option>';
4733 4733
 		$sql = "SELECT rowid, ref, situation_cycle_ref, situation_counter, situation_final, fk_soc";
4734
-		$sql .= ' FROM ' . $this->db->prefix() . 'facture';
4735
-		$sql .= ' WHERE entity IN (' . getEntity('invoice') . ')';
4734
+		$sql .= ' FROM '.$this->db->prefix().'facture';
4735
+		$sql .= ' WHERE entity IN ('.getEntity('invoice').')';
4736 4736
 		$sql .= ' AND situation_counter >= 1';
4737
-		$sql .= ' AND fk_soc = ' . (int) $socid;
4737
+		$sql .= ' AND fk_soc = '.(int) $socid;
4738 4738
 		$sql .= ' AND type <> 2';
4739 4739
 		$sql .= ' ORDER by situation_cycle_ref, situation_counter desc';
4740 4740
 		$resql = $this->db->query($sql);
@@ -4752,19 +4752,19 @@  discard block
 block discarded – undo
4752 4752
 						//Not prov?
4753 4753
 						if (substr($obj->ref, 1, 4) != 'PROV') {
4754 4754
 							if ($selected == $obj->rowid) {
4755
-								$opt .= '<option value="' . $obj->rowid . '" selected>' . $obj->ref . '</option>';
4755
+								$opt .= '<option value="'.$obj->rowid.'" selected>'.$obj->ref.'</option>';
4756 4756
 							} else {
4757
-								$opt .= '<option value="' . $obj->rowid . '">' . $obj->ref . '</option>';
4757
+								$opt .= '<option value="'.$obj->rowid.'">'.$obj->ref.'</option>';
4758 4758
 							}
4759 4759
 						}
4760 4760
 					}
4761 4761
 				}
4762 4762
 			}
4763 4763
 		} else {
4764
-			dol_syslog("Error sql=" . $sql . ", error=" . $this->error, LOG_ERR);
4764
+			dol_syslog("Error sql=".$sql.", error=".$this->error, LOG_ERR);
4765 4765
 		}
4766 4766
 		if ($opt == '<option value ="" selected></option>') {
4767
-			$opt = '<option value ="0" selected>' . $langs->trans('NoSituations') . '</option>';
4767
+			$opt = '<option value ="0" selected>'.$langs->trans('NoSituations').'</option>';
4768 4768
 		}
4769 4769
 		return $opt;
4770 4770
 	}
@@ -4784,12 +4784,12 @@  discard block
 block discarded – undo
4784 4784
 
4785 4785
 		$langs->load('products');
4786 4786
 
4787
-		$return = '<select class="flat" id="' . $htmlname . '" name="' . $htmlname . '">';
4787
+		$return = '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'">';
4788 4788
 
4789
-		$sql = "SELECT rowid, label, code FROM " . $this->db->prefix() . "c_units";
4789
+		$sql = "SELECT rowid, label, code FROM ".$this->db->prefix()."c_units";
4790 4790
 		$sql .= ' WHERE active > 0';
4791 4791
 		if (!empty($unit_type)) {
4792
-			$sql .= " AND unit_type = '" . $this->db->escape($unit_type) . "'";
4792
+			$sql .= " AND unit_type = '".$this->db->escape($unit_type)."'";
4793 4793
 		}
4794 4794
 		$sql .= " ORDER BY sortorder";
4795 4795
 
@@ -4801,14 +4801,14 @@  discard block
 block discarded – undo
4801 4801
 
4802 4802
 			while ($res = $this->db->fetch_object($resql)) {
4803 4803
 				$unitLabel = $res->label;
4804
-				if (!empty($langs->tab_translate['unit' . $res->code])) {    // check if Translation is available before
4805
-					$unitLabel = $langs->trans('unit' . $res->code) != $res->label ? $langs->trans('unit' . $res->code) : $res->label;
4804
+				if (!empty($langs->tab_translate['unit'.$res->code])) {    // check if Translation is available before
4805
+					$unitLabel = $langs->trans('unit'.$res->code) != $res->label ? $langs->trans('unit'.$res->code) : $res->label;
4806 4806
 				}
4807 4807
 
4808 4808
 				if ($selected == $res->rowid) {
4809
-					$return .= '<option value="' . $res->rowid . '" selected>' . $unitLabel . '</option>';
4809
+					$return .= '<option value="'.$res->rowid.'" selected>'.$unitLabel.'</option>';
4810 4810
 				} else {
4811
-					$return .= '<option value="' . $res->rowid . '">' . $unitLabel . '</option>';
4811
+					$return .= '<option value="'.$res->rowid.'">'.$unitLabel.'</option>';
4812 4812
 				}
4813 4813
 			}
4814 4814
 			$return .= '</select>';
@@ -4843,23 +4843,23 @@  discard block
 block discarded – undo
4843 4843
 		$num = 0;
4844 4844
 
4845 4845
 		$sql = "SELECT rowid, label, bank, clos as status, currency_code";
4846
-		$sql .= " FROM " . $this->db->prefix() . "bank_account";
4847
-		$sql .= " WHERE entity IN (" . getEntity('bank_account') . ")";
4846
+		$sql .= " FROM ".$this->db->prefix()."bank_account";
4847
+		$sql .= " WHERE entity IN (".getEntity('bank_account').")";
4848 4848
 		if ($status != 2) {
4849
-			$sql .= " AND clos = " . (int) $status;
4849
+			$sql .= " AND clos = ".(int) $status;
4850 4850
 		}
4851 4851
 		if ($filtre) {
4852
-			$sql .= " AND " . $filtre;
4852
+			$sql .= " AND ".$filtre;
4853 4853
 		}
4854 4854
 		$sql .= " ORDER BY label";
4855 4855
 
4856
-		dol_syslog(get_class($this) . "::select_comptes", LOG_DEBUG);
4856
+		dol_syslog(get_class($this)."::select_comptes", LOG_DEBUG);
4857 4857
 		$result = $this->db->query($sql);
4858 4858
 		if ($result) {
4859 4859
 			$num = $this->db->num_rows($result);
4860 4860
 			$i = 0;
4861 4861
 			if ($num) {
4862
-				$out .= '<select id="select' . $htmlname . '" class="flat selectbankaccount' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>';
4862
+				$out .= '<select id="select'.$htmlname.'" class="flat selectbankaccount'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>';
4863 4863
 				if ($useempty == 1 || ($useempty == 2 && $num > 1)) {
4864 4864
 					$out .= '<option value="-1">&nbsp;</option>';
4865 4865
 				}
@@ -4867,27 +4867,27 @@  discard block
 block discarded – undo
4867 4867
 				while ($i < $num) {
4868 4868
 					$obj = $this->db->fetch_object($result);
4869 4869
 					if ($selected == $obj->rowid || ($useempty == 2 && $num == 1 && empty($selected))) {
4870
-						$out .= '<option value="' . $obj->rowid . '" data-currency-code="' . $obj->currency_code . '" selected>';
4870
+						$out .= '<option value="'.$obj->rowid.'" data-currency-code="'.$obj->currency_code.'" selected>';
4871 4871
 					} else {
4872
-						$out .= '<option value="' . $obj->rowid . '" data-currency-code="' . $obj->currency_code . '">';
4872
+						$out .= '<option value="'.$obj->rowid.'" data-currency-code="'.$obj->currency_code.'">';
4873 4873
 					}
4874 4874
 					$out .= trim($obj->label);
4875 4875
 					if ($showcurrency) {
4876
-						$out .= ' (' . $obj->currency_code . ')';
4876
+						$out .= ' ('.$obj->currency_code.')';
4877 4877
 					}
4878 4878
 					if ($status == 2 && $obj->status == 1) {
4879
-						$out .= ' (' . $langs->trans("Closed") . ')';
4879
+						$out .= ' ('.$langs->trans("Closed").')';
4880 4880
 					}
4881 4881
 					$out .= '</option>';
4882 4882
 					$i++;
4883 4883
 				}
4884 4884
 				$out .= "</select>";
4885
-				$out .= ajax_combobox('select' . $htmlname);
4885
+				$out .= ajax_combobox('select'.$htmlname);
4886 4886
 			} else {
4887 4887
 				if ($status == 0) {
4888
-					$out .= '<span class="opacitymedium">' . $langs->trans("NoActiveBankAccountDefined") . '</span>';
4888
+					$out .= '<span class="opacitymedium">'.$langs->trans("NoActiveBankAccountDefined").'</span>';
4889 4889
 				} else {
4890
-					$out .= '<span class="opacitymedium">' . $langs->trans("NoBankAccountFound") . '</span>';
4890
+					$out .= '<span class="opacitymedium">'.$langs->trans("NoBankAccountFound").'</span>';
4891 4891
 				}
4892 4892
 			}
4893 4893
 		} else {
@@ -4923,23 +4923,23 @@  discard block
 block discarded – undo
4923 4923
 		$num = 0;
4924 4924
 
4925 4925
 		$sql = "SELECT rowid, name, fk_country, status, entity";
4926
-		$sql .= " FROM " . $this->db->prefix() . "establishment";
4926
+		$sql .= " FROM ".$this->db->prefix()."establishment";
4927 4927
 		$sql .= " WHERE 1=1";
4928 4928
 		if ($status != 2) {
4929
-			$sql .= " AND status = " . (int) $status;
4929
+			$sql .= " AND status = ".(int) $status;
4930 4930
 		}
4931 4931
 		if ($filtre) {
4932
-			$sql .= " AND " . $filtre;
4932
+			$sql .= " AND ".$filtre;
4933 4933
 		}
4934 4934
 		$sql .= " ORDER BY name";
4935 4935
 
4936
-		dol_syslog(get_class($this) . "::select_establishment", LOG_DEBUG);
4936
+		dol_syslog(get_class($this)."::select_establishment", LOG_DEBUG);
4937 4937
 		$result = $this->db->query($sql);
4938 4938
 		if ($result) {
4939 4939
 			$num = $this->db->num_rows($result);
4940 4940
 			$i = 0;
4941 4941
 			if ($num) {
4942
-				print '<select id="select' . $htmlname . '" class="flat selectestablishment" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>';
4942
+				print '<select id="select'.$htmlname.'" class="flat selectestablishment" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>';
4943 4943
 				if ($useempty == 1 || ($useempty == 2 && $num > 1)) {
4944 4944
 					print '<option value="-1">&nbsp;</option>';
4945 4945
 				}
@@ -4947,13 +4947,13 @@  discard block
 block discarded – undo
4947 4947
 				while ($i < $num) {
4948 4948
 					$obj = $this->db->fetch_object($result);
4949 4949
 					if ($selected == $obj->rowid) {
4950
-						print '<option value="' . $obj->rowid . '" selected>';
4950
+						print '<option value="'.$obj->rowid.'" selected>';
4951 4951
 					} else {
4952
-						print '<option value="' . $obj->rowid . '">';
4952
+						print '<option value="'.$obj->rowid.'">';
4953 4953
 					}
4954 4954
 					print trim($obj->name);
4955 4955
 					if ($status == 2 && $obj->status == 1) {
4956
-						print ' (' . $langs->trans("Closed") . ')';
4956
+						print ' ('.$langs->trans("Closed").')';
4957 4957
 					}
4958 4958
 					print '</option>';
4959 4959
 					$i++;
@@ -4961,9 +4961,9 @@  discard block
 block discarded – undo
4961 4961
 				print "</select>";
4962 4962
 			} else {
4963 4963
 				if ($status == 0) {
4964
-					print '<span class="opacitymedium">' . $langs->trans("NoActiveEstablishmentDefined") . '</span>';
4964
+					print '<span class="opacitymedium">'.$langs->trans("NoActiveEstablishmentDefined").'</span>';
4965 4965
 				} else {
4966
-					print '<span class="opacitymedium">' . $langs->trans("NoEstablishmentFound") . '</span>';
4966
+					print '<span class="opacitymedium">'.$langs->trans("NoEstablishmentFound").'</span>';
4967 4967
 				}
4968 4968
 			}
4969 4969
 
@@ -4987,20 +4987,20 @@  discard block
 block discarded – undo
4987 4987
 	{
4988 4988
 		global $langs;
4989 4989
 		if ($htmlname != "none") {
4990
-			print '<form method="POST" action="' . $page . '">';
4990
+			print '<form method="POST" action="'.$page.'">';
4991 4991
 			print '<input type="hidden" name="action" value="setbankaccount">';
4992
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
4992
+			print '<input type="hidden" name="token" value="'.newToken().'">';
4993 4993
 			print img_picto('', 'bank_account', 'class="pictofixedwidth"');
4994 4994
 			$nbaccountfound = $this->select_comptes($selected, $htmlname, 0, '', $addempty);
4995 4995
 			if ($nbaccountfound > 0) {
4996
-				print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
4996
+				print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
4997 4997
 			}
4998 4998
 			print '</form>';
4999 4999
 		} else {
5000 5000
 			$langs->load('banks');
5001 5001
 
5002 5002
 			if ($selected) {
5003
-				require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php';
5003
+				require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
5004 5004
 				$bankstatic = new Account($this->db);
5005 5005
 				$result = $bankstatic->fetch($selected);
5006 5006
 				if ($result) {
@@ -5038,19 +5038,19 @@  discard block
 block discarded – undo
5038 5038
 		global $conf, $langs;
5039 5039
 		$langs->load("categories");
5040 5040
 
5041
-		include_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
5041
+		include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
5042 5042
 
5043 5043
 		// For backward compatibility
5044 5044
 		if (is_numeric($type)) {
5045
-			dol_syslog(__METHOD__ . ': using numeric value for parameter type is deprecated. Use string code instead.', LOG_WARNING);
5045
+			dol_syslog(__METHOD__.': using numeric value for parameter type is deprecated. Use string code instead.', LOG_WARNING);
5046 5046
 		}
5047 5047
 
5048 5048
 		if ($type === Categorie::TYPE_BANK_LINE) {
5049 5049
 			// TODO Move this into common category feature
5050 5050
 			$cate_arbo = array();
5051 5051
 			$sql = "SELECT c.label, c.rowid";
5052
-			$sql .= " FROM " . $this->db->prefix() . "bank_categ as c";
5053
-			$sql .= " WHERE entity = " . $conf->entity;
5052
+			$sql .= " FROM ".$this->db->prefix()."bank_categ as c";
5053
+			$sql .= " WHERE entity = ".$conf->entity;
5054 5054
 			$sql .= " ORDER BY c.label";
5055 5055
 			$result = $this->db->query($sql);
5056 5056
 			if ($result) {
@@ -5074,10 +5074,10 @@  discard block
 block discarded – undo
5074 5074
 
5075 5075
 		$outarray = array();
5076 5076
 
5077
-		$output = '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
5077
+		$output = '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
5078 5078
 		if (is_array($cate_arbo)) {
5079 5079
 			if (!count($cate_arbo)) {
5080
-				$output .= '<option value="-1" disabled>' . $langs->trans("NoCategoriesDefined") . '</option>';
5080
+				$output .= '<option value="-1" disabled>'.$langs->trans("NoCategoriesDefined").'</option>';
5081 5081
 			} else {
5082 5082
 				$output .= '<option value="-1">&nbsp;</option>';
5083 5083
 				foreach ($cate_arbo as $key => $value) {
@@ -5086,8 +5086,8 @@  discard block
 block discarded – undo
5086 5086
 					} else {
5087 5087
 						$add = '';
5088 5088
 					}
5089
-					$output .= '<option ' . $add . 'value="' . $cate_arbo[$key]['id'] . '"';
5090
-					$output .= ' data-html="' . dol_escape_htmltag(img_picto('', 'category', 'class="pictofixedwidth" style="color: #' . $cate_arbo[$key]['color'] . '"') . dol_trunc($cate_arbo[$key]['fulllabel'], $maxlength, 'middle')) . '"';
5089
+					$output .= '<option '.$add.'value="'.$cate_arbo[$key]['id'].'"';
5090
+					$output .= ' data-html="'.dol_escape_htmltag(img_picto('', 'category', 'class="pictofixedwidth" style="color: #'.$cate_arbo[$key]['color'].'"').dol_trunc($cate_arbo[$key]['fulllabel'], $maxlength, 'middle')).'"';
5091 5091
 					$output .= '>';
5092 5092
 					$output .= dol_trunc($cate_arbo[$key]['fulllabel'], $maxlength, 'middle');
5093 5093
 					$output .= '</option>';
@@ -5128,7 +5128,7 @@  discard block
 block discarded – undo
5128 5128
 	public function form_confirm($page, $title, $question, $action, $formquestion = '', $selectedchoice = "", $useajax = 0, $height = 170, $width = 500)
5129 5129
 	{
5130 5130
 		// phpcs:enable
5131
-		dol_syslog(__METHOD__ . ': using form_confirm is deprecated. Use formconfim instead.', LOG_WARNING);
5131
+		dol_syslog(__METHOD__.': using form_confirm is deprecated. Use formconfim instead.', LOG_WARNING);
5132 5132
 		print $this->formconfirm($page, $title, $question, $action, $formquestion, $selectedchoice, $useajax, $height, $width);
5133 5133
 	}
5134 5134
 
@@ -5163,7 +5163,7 @@  discard block
 block discarded – undo
5163 5163
 	{
5164 5164
 		global $langs, $conf;
5165 5165
 
5166
-		$more = '<!-- formconfirm - before call, page=' . dol_escape_htmltag($page) . ' -->';
5166
+		$more = '<!-- formconfirm - before call, page='.dol_escape_htmltag($page).' -->';
5167 5167
 		$formconfirm = '';
5168 5168
 		$inputok = array();
5169 5169
 		$inputko = array();
@@ -5187,27 +5187,27 @@  discard block
 block discarded – undo
5187 5187
 			foreach ($formquestion as $key => $input) {
5188 5188
 				if (is_array($input) && !empty($input)) {
5189 5189
 					if ($input['type'] == 'hidden') {
5190
-						$moreattr = (!empty($input['moreattr']) ? ' ' . $input['moreattr'] : '');
5191
-						$morecss = (!empty($input['morecss']) ? ' ' . $input['morecss'] : '');
5190
+						$moreattr = (!empty($input['moreattr']) ? ' '.$input['moreattr'] : '');
5191
+						$morecss = (!empty($input['morecss']) ? ' '.$input['morecss'] : '');
5192 5192
 
5193
-						$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";
5193
+						$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";
5194 5194
 					}
5195 5195
 				}
5196 5196
 			}
5197 5197
 
5198 5198
 			// Now add questions
5199 5199
 			$moreonecolumn = '';
5200
-			$more .= '<div class="tagtable paddingtopbottomonly centpercent noborderspacing">' . "\n";
5200
+			$more .= '<div class="tagtable paddingtopbottomonly centpercent noborderspacing">'."\n";
5201 5201
 			foreach ($formquestion as $key => $input) {
5202 5202
 				if (is_array($input) && !empty($input)) {
5203
-					$size = (!empty($input['size']) ? ' size="' . $input['size'] . '"' : '');    // deprecated. Use morecss instead.
5204
-					$moreattr = (!empty($input['moreattr']) ? ' ' . $input['moreattr'] : '');
5205
-					$morecss = (!empty($input['morecss']) ? ' ' . $input['morecss'] : '');
5203
+					$size = (!empty($input['size']) ? ' size="'.$input['size'].'"' : ''); // deprecated. Use morecss instead.
5204
+					$moreattr = (!empty($input['moreattr']) ? ' '.$input['moreattr'] : '');
5205
+					$morecss = (!empty($input['morecss']) ? ' '.$input['morecss'] : '');
5206 5206
 
5207 5207
 					if ($input['type'] == 'text') {
5208
-						$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";
5208
+						$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";
5209 5209
 					} elseif ($input['type'] == 'password') {
5210
-						$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";
5210
+						$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";
5211 5211
 					} elseif ($input['type'] == 'textarea') {
5212 5212
 						/*$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div><div class="tagtd">';
5213 5213
 						$more .= '<textarea name="'.$input['name'].'" class="'.$morecss.'"'.$moreattr.'>';
@@ -5215,8 +5215,8 @@  discard block
 block discarded – undo
5215 5215
 						$more .= '</textarea>';
5216 5216
 						$more .= '</div></div>'."\n";*/
5217 5217
 						$moreonecolumn .= '<div class="margintoponly">';
5218
-						$moreonecolumn .= $input['label'] . '<br>';
5219
-						$moreonecolumn .= '<textarea name="' . dol_escape_htmltag($input['name']) . '" id="' . dol_escape_htmltag($input['name']) . '" class="' . $morecss . '"' . $moreattr . '>';
5218
+						$moreonecolumn .= $input['label'].'<br>';
5219
+						$moreonecolumn .= '<textarea name="'.dol_escape_htmltag($input['name']).'" id="'.dol_escape_htmltag($input['name']).'" class="'.$morecss.'"'.$moreattr.'>';
5220 5220
 						$moreonecolumn .= $input['value'];
5221 5221
 						$moreonecolumn .= '</textarea>';
5222 5222
 						$moreonecolumn .= '</div>';
@@ -5233,20 +5233,20 @@  discard block
 block discarded – undo
5233 5233
 						$disabled = isset($input['select_disabled']) ? $input['select_disabled'] : 0;
5234 5234
 						$sort = isset($input['select_sort']) ? $input['select_sort'] : '';
5235 5235
 
5236
-						$more .= '<div class="tagtr"><div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '">';
5236
+						$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">';
5237 5237
 						if (!empty($input['label'])) {
5238
-							$more .= $input['label'] . '</div><div class="tagtd left">';
5238
+							$more .= $input['label'].'</div><div class="tagtd left">';
5239 5239
 						}
5240 5240
 						if ($input['type'] == 'select') {
5241 5241
 							$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);
5242 5242
 						} else {
5243 5243
 							$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);
5244 5244
 						}
5245
-						$more .= '</div></div>' . "\n";
5245
+						$more .= '</div></div>'."\n";
5246 5246
 					} elseif ($input['type'] == 'checkbox') {
5247 5247
 						$more .= '<div class="tagtr">';
5248
-						$more .= '<div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '"><label for="' . dol_escape_htmltag($input['name']) . '">' . $input['label'] . '</label></div><div class="tagtd">';
5249
-						$more .= '<input type="checkbox" class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . dol_escape_htmltag($input['name']) . '" name="' . dol_escape_htmltag($input['name']) . '"' . $moreattr;
5248
+						$more .= '<div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'"><label for="'.dol_escape_htmltag($input['name']).'">'.$input['label'].'</label></div><div class="tagtd">';
5249
+						$more .= '<input type="checkbox" class="flat'.($morecss ? ' '.$morecss : '').'" id="'.dol_escape_htmltag($input['name']).'" name="'.dol_escape_htmltag($input['name']).'"'.$moreattr;
5250 5250
 						if (!is_bool($input['value']) && $input['value'] != 'false' && $input['value'] != '0' && $input['value'] != '') {
5251 5251
 							$more .= ' checked';
5252 5252
 						}
@@ -5257,19 +5257,19 @@  discard block
 block discarded – undo
5257 5257
 							$more .= ' disabled';
5258 5258
 						}
5259 5259
 						$more .= ' /></div>';
5260
-						$more .= '</div>' . "\n";
5260
+						$more .= '</div>'."\n";
5261 5261
 					} elseif ($input['type'] == 'radio') {
5262 5262
 						$i = 0;
5263 5263
 						foreach ($input['values'] as $selkey => $selval) {
5264 5264
 							$more .= '<div class="tagtr">';
5265 5265
 							if (isset($input['label'])) {
5266 5266
 								if ($i == 0) {
5267
-									$more .= '<div class="tagtd' . (empty($input['tdclass']) ? ' tdtop' : (' tdtop ' . $input['tdclass'])) . '">' . $input['label'] . '</div>';
5267
+									$more .= '<div class="tagtd'.(empty($input['tdclass']) ? ' tdtop' : (' tdtop '.$input['tdclass'])).'">'.$input['label'].'</div>';
5268 5268
 								} else {
5269
-									$more .= '<div clas="tagtd' . (empty($input['tdclass']) ? '' : (' "' . $input['tdclass'])) . '">&nbsp;</div>';
5269
+									$more .= '<div clas="tagtd'.(empty($input['tdclass']) ? '' : (' "'.$input['tdclass'])).'">&nbsp;</div>';
5270 5270
 								}
5271 5271
 							}
5272
-							$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;
5272
+							$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;
5273 5273
 							if (!empty($input['disabled'])) {
5274 5274
 								$more .= ' disabled';
5275 5275
 							}
@@ -5277,12 +5277,12 @@  discard block
 block discarded – undo
5277 5277
 								$more .= ' checked="checked"';
5278 5278
 							}
5279 5279
 							$more .= ' /> ';
5280
-							$more .= '<label for="' . dol_escape_htmltag($input['name'] . $selkey) . '" class="valignmiddle">' . $selval . '</label>';
5281
-							$more .= '</div></div>' . "\n";
5280
+							$more .= '<label for="'.dol_escape_htmltag($input['name'].$selkey).'" class="valignmiddle">'.$selval.'</label>';
5281
+							$more .= '</div></div>'."\n";
5282 5282
 							$i++;
5283 5283
 						}
5284 5284
 					} elseif ($input['type'] == 'date' || $input['type'] == 'datetime') {
5285
-						$more .= '<div class="tagtr"><div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '">' . $input['label'] . '</div>';
5285
+						$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div>';
5286 5286
 						$more .= '<div class="tagtd">';
5287 5287
 						$addnowlink = (empty($input['datenow']) ? 0 : 1);
5288 5288
 						$h = $m = 0;
@@ -5300,24 +5300,24 @@  discard block
 block discarded – undo
5300 5300
 					} elseif ($input['type'] == 'other') { // can be 1 column or 2 depending if label is set or not
5301 5301
 						$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">';
5302 5302
 						if (!empty($input['label'])) {
5303
-							$more .= $input['label'] . '</div><div class="tagtd">';
5303
+							$more .= $input['label'].'</div><div class="tagtd">';
5304 5304
 						}
5305 5305
 						$more .= $input['value'];
5306
-						$more .= '</div></div>' . "\n";
5306
+						$more .= '</div></div>'."\n";
5307 5307
 					} elseif ($input['type'] == 'onecolumn') {
5308 5308
 						$moreonecolumn .= '<div class="margintoponly">';
5309 5309
 						$moreonecolumn .= $input['value'];
5310
-						$moreonecolumn .= '</div>' . "\n";
5310
+						$moreonecolumn .= '</div>'."\n";
5311 5311
 					} elseif ($input['type'] == 'hidden') {
5312 5312
 						// Do nothing more, already added by a previous loop
5313 5313
 					} elseif ($input['type'] == 'separator') {
5314 5314
 						$more .= '<br>';
5315 5315
 					} else {
5316
-						$more .= 'Error type ' . $input['type'] . ' for the confirm box is not a supported type';
5316
+						$more .= 'Error type '.$input['type'].' for the confirm box is not a supported type';
5317 5317
 					}
5318 5318
 				}
5319 5319
 			}
5320
-			$more .= '</div>' . "\n";
5320
+			$more .= '</div>'."\n";
5321 5321
 			$more .= $moreonecolumn;
5322 5322
 		}
5323 5323
 
@@ -5339,10 +5339,10 @@  discard block
 block discarded – undo
5339 5339
 				$button = $useajax;
5340 5340
 				$useajax = 1;
5341 5341
 				$autoOpen = false;
5342
-				$dialogconfirm .= '-' . $button;
5342
+				$dialogconfirm .= '-'.$button;
5343 5343
 			}
5344
-			$pageyes = $page . (preg_match('/\?/', $page) ? '&' : '?') . 'action=' . urlencode($action) . '&confirm=yes';
5345
-			$pageno = ($useajax == 2 ? $page . (preg_match('/\?/', $page) ? '&' : '?') . 'action=' . urlencode($action) . '&confirm=no' : '');
5344
+			$pageyes = $page.(preg_match('/\?/', $page) ? '&' : '?').'action='.urlencode($action).'&confirm=yes';
5345
+			$pageno = ($useajax == 2 ? $page.(preg_match('/\?/', $page) ? '&' : '?').'action='.urlencode($action).'&confirm=no' : '');
5346 5346
 
5347 5347
 			// Add input fields into list of fields to read during submit (inputok and inputko)
5348 5348
 			if (is_array($formquestion)) {
@@ -5364,24 +5364,24 @@  discard block
 block discarded – undo
5364 5364
 			}
5365 5365
 
5366 5366
 			// Show JQuery confirm box.
5367
-			$formconfirm .= '<div id="' . $dialogconfirm . '" title="' . dol_escape_htmltag($title) . '" style="display: none;">';
5367
+			$formconfirm .= '<div id="'.$dialogconfirm.'" title="'.dol_escape_htmltag($title).'" style="display: none;">';
5368 5368
 			if (is_array($formquestion) && !empty($formquestion['text'])) {
5369
-				$formconfirm .= '<div class="confirmtext">' . $formquestion['text'] . '</div>' . "\n";
5369
+				$formconfirm .= '<div class="confirmtext">'.$formquestion['text'].'</div>'."\n";
5370 5370
 			}
5371 5371
 			if (!empty($more)) {
5372
-				$formconfirm .= '<div class="confirmquestions">' . $more . '</div>' . "\n";
5372
+				$formconfirm .= '<div class="confirmquestions">'.$more.'</div>'."\n";
5373 5373
 			}
5374
-			$formconfirm .= ($question ? '<div class="confirmmessage">' . img_help('', '') . ' ' . $question . '</div>' : '');
5375
-			$formconfirm .= '</div>' . "\n";
5374
+			$formconfirm .= ($question ? '<div class="confirmmessage">'.img_help('', '').' '.$question.'</div>' : '');
5375
+			$formconfirm .= '</div>'."\n";
5376 5376
 
5377
-			$formconfirm .= "\n<!-- begin code of popup for formconfirm page=" . $page . " -->\n";
5378
-			$formconfirm .= '<script nonce="' . getNonce() . '" type="text/javascript">' . "\n";
5377
+			$formconfirm .= "\n<!-- begin code of popup for formconfirm page=".$page." -->\n";
5378
+			$formconfirm .= '<script nonce="'.getNonce().'" type="text/javascript">'."\n";
5379 5379
 			$formconfirm .= "/* Code for the jQuery('#dialogforpopup').dialog() */\n";
5380 5380
 			$formconfirm .= 'jQuery(document).ready(function() {
5381 5381
             $(function() {
5382
-            	$( "#' . $dialogconfirm . '" ).dialog(
5382
+            	$( "#' . $dialogconfirm.'" ).dialog(
5383 5383
             	{
5384
-                    autoOpen: ' . ($autoOpen ? "true" : "false") . ',';
5384
+                    autoOpen: ' . ($autoOpen ? "true" : "false").',';
5385 5385
 			if ($newselectedchoice == 'no') {
5386 5386
 				$formconfirm .= '
5387 5387
 						open: function() {
@@ -5391,24 +5391,24 @@  discard block
 block discarded – undo
5391 5391
 
5392 5392
 			$jsforcursor = '';
5393 5393
 			if ($useajax == 1) {
5394
-				$jsforcursor = '// The call to urljump can be slow, so we set the wait cursor' . "\n";
5395
-				$jsforcursor .= 'jQuery("html,body,#id-container").addClass("cursorwait");' . "\n";
5394
+				$jsforcursor = '// The call to urljump can be slow, so we set the wait cursor'."\n";
5395
+				$jsforcursor .= 'jQuery("html,body,#id-container").addClass("cursorwait");'."\n";
5396 5396
 			}
5397 5397
 
5398 5398
 			$postconfirmas = 'GET';
5399 5399
 
5400 5400
 			$formconfirm .= '
5401 5401
                     resizable: false,
5402
-                    height: "' . $height . '",
5403
-                    width: "' . $width . '",
5402
+                    height: "' . $height.'",
5403
+                    width: "' . $width.'",
5404 5404
                     modal: true,
5405 5405
                     closeOnEscape: false,
5406 5406
                     buttons: {
5407
-                        "' . dol_escape_js($langs->transnoentities($labelbuttonyes)) . '": function() {
5408
-							var options = "token=' . urlencode(newToken()) . '";
5409
-                        	var inputok = ' . json_encode($inputok) . ';	/* List of fields into form */
5410
-							var page = "' . dol_escape_js(!empty($page) ? $page : '') . '";
5411
-                         	var pageyes = "' . dol_escape_js(!empty($pageyes) ? $pageyes : '') . '";
5407
+                        "' . dol_escape_js($langs->transnoentities($labelbuttonyes)).'": function() {
5408
+							var options = "token=' . urlencode(newToken()).'";
5409
+                        	var inputok = ' . json_encode($inputok).';	/* List of fields into form */
5410
+							var page = "' . dol_escape_js(!empty($page) ? $page : '').'";
5411
+                         	var pageyes = "' . dol_escape_js(!empty($pageyes) ? $pageyes : '').'";
5412 5412
 
5413 5413
                          	if (inputok.length > 0) {
5414 5414
                          		$.each(inputok, function(i, inputname) {
@@ -5442,11 +5442,11 @@  discard block
 block discarded – undo
5442 5442
 							}
5443 5443
 	                        $(this).dialog("close");
5444 5444
                         },
5445
-                        "' . dol_escape_js($langs->transnoentities($labelbuttonno)) . '": function() {
5446
-                        	var options = "token=' . urlencode(newToken()) . '";
5447
-                         	var inputko = ' . json_encode($inputko) . ';	/* List of fields into form */
5448
-							var page = "' . dol_escape_js(!empty($page) ? $page : '') . '";
5449
-                         	var pageno="' . dol_escape_js(!empty($pageno) ? $pageno : '') . '";
5445
+                        "' . dol_escape_js($langs->transnoentities($labelbuttonno)).'": function() {
5446
+                        	var options = "token=' . urlencode(newToken()).'";
5447
+                         	var inputko = ' . json_encode($inputko).';	/* List of fields into form */
5448
+							var page = "' . dol_escape_js(!empty($page) ? $page : '').'";
5449
+                         	var pageno="' . dol_escape_js(!empty($pageno) ? $pageno : '').'";
5450 5450
                          	if (inputko.length > 0) {
5451 5451
                          		$.each(inputko, function(i, inputname) {
5452 5452
                          			var more = "";
@@ -5478,10 +5478,10 @@  discard block
 block discarded – undo
5478 5478
                 }
5479 5479
                 );
5480 5480
 
5481
-            	var button = "' . $button . '";
5481
+            	var button = "' . $button.'";
5482 5482
             	if (button.length > 0) {
5483 5483
                 	$( "#" + button ).click(function() {
5484
-                		$("#' . $dialogconfirm . '").dialog("open");
5484
+                		$("#' . $dialogconfirm.'").dialog("open");
5485 5485
         			});
5486 5486
                 }
5487 5487
             });
@@ -5489,44 +5489,44 @@  discard block
 block discarded – undo
5489 5489
             </script>';
5490 5490
 			$formconfirm .= "<!-- end ajax formconfirm -->\n";
5491 5491
 		} else {
5492
-			$formconfirm .= "\n<!-- begin formconfirm page=" . dol_escape_htmltag($page) . " -->\n";
5492
+			$formconfirm .= "\n<!-- begin formconfirm page=".dol_escape_htmltag($page)." -->\n";
5493 5493
 
5494 5494
 			if (empty($disableformtag)) {
5495
-				$formconfirm .= '<form method="POST" action="' . $page . '" class="notoptoleftroright">' . "\n";
5495
+				$formconfirm .= '<form method="POST" action="'.$page.'" class="notoptoleftroright">'."\n";
5496 5496
 			}
5497 5497
 
5498
-			$formconfirm .= '<input type="hidden" name="action" value="' . $action . '">' . "\n";
5499
-			$formconfirm .= '<input type="hidden" name="token" value="' . newToken() . '">' . "\n";
5498
+			$formconfirm .= '<input type="hidden" name="action" value="'.$action.'">'."\n";
5499
+			$formconfirm .= '<input type="hidden" name="token" value="'.newToken().'">'."\n";
5500 5500
 
5501
-			$formconfirm .= '<table class="valid centpercent">' . "\n";
5501
+			$formconfirm .= '<table class="valid centpercent">'."\n";
5502 5502
 
5503 5503
 			// Line title
5504 5504
 			$formconfirm .= '<tr class="validtitre"><td class="validtitre" colspan="2">';
5505
-			$formconfirm .= img_picto('', 'pictoconfirm') . ' ' . $title;
5506
-			$formconfirm .= '</td></tr>' . "\n";
5505
+			$formconfirm .= img_picto('', 'pictoconfirm').' '.$title;
5506
+			$formconfirm .= '</td></tr>'."\n";
5507 5507
 
5508 5508
 			// Line text
5509 5509
 			if (is_array($formquestion) && !empty($formquestion['text'])) {
5510
-				$formconfirm .= '<tr class="valid"><td class="valid" colspan="2">' . $formquestion['text'] . '</td></tr>' . "\n";
5510
+				$formconfirm .= '<tr class="valid"><td class="valid" colspan="2">'.$formquestion['text'].'</td></tr>'."\n";
5511 5511
 			}
5512 5512
 
5513 5513
 			// Line form fields
5514 5514
 			if ($more) {
5515
-				$formconfirm .= '<tr class="valid"><td class="valid" colspan="2">' . "\n";
5515
+				$formconfirm .= '<tr class="valid"><td class="valid" colspan="2">'."\n";
5516 5516
 				$formconfirm .= $more;
5517
-				$formconfirm .= '</td></tr>' . "\n";
5517
+				$formconfirm .= '</td></tr>'."\n";
5518 5518
 			}
5519 5519
 
5520 5520
 			// Line with question
5521 5521
 			$formconfirm .= '<tr class="valid">';
5522
-			$formconfirm .= '<td class="valid">' . $question . '</td>';
5522
+			$formconfirm .= '<td class="valid">'.$question.'</td>';
5523 5523
 			$formconfirm .= '<td class="valid center">';
5524 5524
 			$formconfirm .= $this->selectyesno("confirm", $newselectedchoice, 0, false, 0, 0, 'marginleftonly marginrightonly', $labelbuttonyes, $labelbuttonno);
5525
-			$formconfirm .= '<input class="button valignmiddle confirmvalidatebutton small" type="submit" value="' . $langs->trans("Validate") . '">';
5525
+			$formconfirm .= '<input class="button valignmiddle confirmvalidatebutton small" type="submit" value="'.$langs->trans("Validate").'">';
5526 5526
 			$formconfirm .= '</td>';
5527
-			$formconfirm .= '</tr>' . "\n";
5527
+			$formconfirm .= '</tr>'."\n";
5528 5528
 
5529
-			$formconfirm .= '</table>' . "\n";
5529
+			$formconfirm .= '</table>'."\n";
5530 5530
 
5531 5531
 			if (empty($disableformtag)) {
5532 5532
 				$formconfirm .= "</form>\n";
@@ -5535,7 +5535,7 @@  discard block
 block discarded – undo
5535 5535
 
5536 5536
 			if (!empty($conf->use_javascript_ajax)) {
5537 5537
 				$formconfirm .= '<!-- code to disable button to avoid double clic -->';
5538
-				$formconfirm .= '<script nonce="' . getNonce() . '" type="text/javascript">' . "\n";
5538
+				$formconfirm .= '<script nonce="'.getNonce().'" type="text/javascript">'."\n";
5539 5539
 				$formconfirm .= '
5540 5540
 				$(document).ready(function () {
5541 5541
 					$(".confirmvalidatebutton").on("click", function() {
@@ -5547,7 +5547,7 @@  discard block
 block discarded – undo
5547 5547
 					});
5548 5548
 				});
5549 5549
 				';
5550
-				$formconfirm .= '</script>' . "\n";
5550
+				$formconfirm .= '</script>'."\n";
5551 5551
 			}
5552 5552
 
5553 5553
 			$formconfirm .= "<!-- end formconfirm -->\n";
@@ -5579,8 +5579,8 @@  discard block
 block discarded – undo
5579 5579
 		// phpcs:enable
5580 5580
 		global $langs;
5581 5581
 
5582
-		require_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php';
5583
-		require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php';
5582
+		require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
5583
+		require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
5584 5584
 
5585 5585
 		$out = '';
5586 5586
 
@@ -5588,11 +5588,11 @@  discard block
 block discarded – undo
5588 5588
 
5589 5589
 		$langs->load("project");
5590 5590
 		if ($htmlname != "none") {
5591
-			$out .= '<form method="post" action="' . $page . '">';
5591
+			$out .= '<form method="post" action="'.$page.'">';
5592 5592
 			$out .= '<input type="hidden" name="action" value="classin">';
5593
-			$out .= '<input type="hidden" name="token" value="' . newToken() . '">';
5593
+			$out .= '<input type="hidden" name="token" value="'.newToken().'">';
5594 5594
 			$out .= $formproject->select_projects($socid, $selected, $htmlname, $maxlength, 0, 1, $discard_closed, $forcefocus, 0, 0, '', 1, 0, $morecss);
5595
-			$out .= '<input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '">';
5595
+			$out .= '<input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">';
5596 5596
 			$out .= '</form>';
5597 5597
 		} else {
5598 5598
 			$out .= '<span class="project_head_block">';
@@ -5601,7 +5601,7 @@  discard block
 block discarded – undo
5601 5601
 				$projet->fetch($selected);
5602 5602
 				$out .= $projet->getNomUrl(0, '', 1);
5603 5603
 			} else {
5604
-				$out .= '<span class="opacitymedium">' . $textifnoproject . '</span>';
5604
+				$out .= '<span class="opacitymedium">'.$textifnoproject.'</span>';
5605 5605
 			}
5606 5606
 			$out .= '</span>';
5607 5607
 		}
@@ -5638,14 +5638,14 @@  discard block
 block discarded – undo
5638 5638
 		$out = '';
5639 5639
 
5640 5640
 		if ($htmlname != "none") {
5641
-			$out .= '<form method="POST" action="' . $page . '">';
5641
+			$out .= '<form method="POST" action="'.$page.'">';
5642 5642
 			$out .= '<input type="hidden" name="action" value="setconditions">';
5643
-			$out .= '<input type="hidden" name="token" value="' . newToken() . '">';
5643
+			$out .= '<input type="hidden" name="token" value="'.newToken().'">';
5644 5644
 			if ($type) {
5645
-				$out .= '<input type="hidden" name="type" value="' . dol_escape_htmltag($type) . '">';
5645
+				$out .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">';
5646 5646
 			}
5647 5647
 			$out .= $this->getSelectConditionsPaiements($selected, $htmlname, $filtertype, $addempty, 0, '', $deposit_percent);
5648
-			$out .= '<input type="submit" class="button valignmiddle smallpaddingimp" value="' . $langs->trans("Modify") . '">';
5648
+			$out .= '<input type="submit" class="button valignmiddle smallpaddingimp" value="'.$langs->trans("Modify").'">';
5649 5649
 			$out .= '</form>';
5650 5650
 		} else {
5651 5651
 			if ($selected) {
@@ -5690,12 +5690,12 @@  discard block
 block discarded – undo
5690 5690
 		// phpcs:enable
5691 5691
 		global $langs;
5692 5692
 		if ($htmlname != "none") {
5693
-			print '<form method="post" action="' . $page . '">';
5693
+			print '<form method="post" action="'.$page.'">';
5694 5694
 			print '<input type="hidden" name="action" value="setavailability">';
5695
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
5695
+			print '<input type="hidden" name="token" value="'.newToken().'">';
5696 5696
 			$this->selectAvailabilityDelay($selected, $htmlname, -1, $addempty);
5697
-			print '<input type="submit" name="modify" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '">';
5698
-			print '<input type="submit" name="cancel" class="button smallpaddingimp" value="' . $langs->trans("Cancel") . '">';
5697
+			print '<input type="submit" name="modify" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">';
5698
+			print '<input type="submit" name="cancel" class="button smallpaddingimp" value="'.$langs->trans("Cancel").'">';
5699 5699
 			print '</form>';
5700 5700
 		} else {
5701 5701
 			if ($selected) {
@@ -5721,11 +5721,11 @@  discard block
 block discarded – undo
5721 5721
 	{
5722 5722
 		global $langs;
5723 5723
 		if ($htmlname != "none") {
5724
-			print '<form method="post" action="' . $page . '">';
5724
+			print '<form method="post" action="'.$page.'">';
5725 5725
 			print '<input type="hidden" name="action" value="setdemandreason">';
5726
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
5726
+			print '<input type="hidden" name="token" value="'.newToken().'">';
5727 5727
 			$this->selectInputReason($selected, $htmlname, -1, $addempty);
5728
-			print '<input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '">';
5728
+			print '<input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">';
5729 5729
 			print '</form>';
5730 5730
 		} else {
5731 5731
 			if ($selected) {
@@ -5765,17 +5765,17 @@  discard block
 block discarded – undo
5765 5765
 		$ret = '';
5766 5766
 
5767 5767
 		if ($htmlname != "none") {
5768
-			$ret .= '<form method="POST" action="' . $page . '" name="form' . $htmlname . '">';
5769
-			$ret .= '<input type="hidden" name="action" value="set' . $htmlname . '">';
5770
-			$ret .= '<input type="hidden" name="token" value="' . newToken() . '">';
5768
+			$ret .= '<form method="POST" action="'.$page.'" name="form'.$htmlname.'">';
5769
+			$ret .= '<input type="hidden" name="action" value="set'.$htmlname.'">';
5770
+			$ret .= '<input type="hidden" name="token" value="'.newToken().'">';
5771 5771
 			if ($type) {
5772
-				$ret .= '<input type="hidden" name="type" value="' . dol_escape_htmltag($type) . '">';
5772
+				$ret .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">';
5773 5773
 			}
5774 5774
 			$ret .= '<table class="nobordernopadding">';
5775 5775
 			$ret .= '<tr><td>';
5776
-			$ret .= $this->selectDate($selected, $htmlname, $displayhour, $displaymin, 1, 'form' . $htmlname, 1, 0);
5776
+			$ret .= $this->selectDate($selected, $htmlname, $displayhour, $displaymin, 1, 'form'.$htmlname, 1, 0);
5777 5777
 			$ret .= '</td>';
5778
-			$ret .= '<td class="left"><input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '"></td>';
5778
+			$ret .= '<td class="left"><input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'"></td>';
5779 5779
 			$ret .= '</tr></table></form>';
5780 5780
 		} else {
5781 5781
 			if ($displayhour) {
@@ -5810,15 +5810,15 @@  discard block
 block discarded – undo
5810 5810
 		global $langs;
5811 5811
 
5812 5812
 		if ($htmlname != "none") {
5813
-			print '<form method="POST" action="' . $page . '" name="form' . $htmlname . '">';
5814
-			print '<input type="hidden" name="action" value="set' . $htmlname . '">';
5815
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
5813
+			print '<form method="POST" action="'.$page.'" name="form'.$htmlname.'">';
5814
+			print '<input type="hidden" name="action" value="set'.$htmlname.'">';
5815
+			print '<input type="hidden" name="token" value="'.newToken().'">';
5816 5816
 			print $this->select_dolusers($selected, $htmlname, 1, $exclude, 0, $include);
5817
-			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
5817
+			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
5818 5818
 			print '</form>';
5819 5819
 		} else {
5820 5820
 			if ($selected) {
5821
-				require_once DOL_DOCUMENT_ROOT . '/user/class/user.class.php';
5821
+				require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
5822 5822
 				$theuser = new User($this->db);
5823 5823
 				$theuser->fetch($selected);
5824 5824
 				print $theuser->getNomUrl(1);
@@ -5851,14 +5851,14 @@  discard block
 block discarded – undo
5851 5851
 
5852 5852
 		$out = '';
5853 5853
 		if ($htmlname != "none") {
5854
-			$out .= '<form method="POST" action="' . $page . '">';
5854
+			$out .= '<form method="POST" action="'.$page.'">';
5855 5855
 			$out .= '<input type="hidden" name="action" value="setmode">';
5856
-			$out .= '<input type="hidden" name="token" value="' . newToken() . '">';
5856
+			$out .= '<input type="hidden" name="token" value="'.newToken().'">';
5857 5857
 			if ($type) {
5858
-				$out .= '<input type="hidden" name="type" value="' . dol_escape_htmltag($type) . '">';
5858
+				$out .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">';
5859 5859
 			}
5860 5860
 			$out .= $this->select_types_paiements($selected, $htmlname, $filtertype, 0, $addempty, 0, 0, $active, '', 1);
5861
-			$out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
5861
+			$out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
5862 5862
 			$out .= '</form>';
5863 5863
 		} else {
5864 5864
 			if ($selected) {
@@ -5891,11 +5891,11 @@  discard block
 block discarded – undo
5891 5891
 	{
5892 5892
 		global $langs;
5893 5893
 		if ($htmlname != "none") {
5894
-			print '<form method="POST" action="' . $page . '">';
5894
+			print '<form method="POST" action="'.$page.'">';
5895 5895
 			print '<input type="hidden" name="action" value="settransportmode">';
5896
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
5896
+			print '<input type="hidden" name="token" value="'.newToken().'">';
5897 5897
 			$this->selectTransportMode($selected, $htmlname, 0, $addempty, 0, 0, $active);
5898
-			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
5898
+			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
5899 5899
 			print '</form>';
5900 5900
 		} else {
5901 5901
 			if ($selected) {
@@ -5922,11 +5922,11 @@  discard block
 block discarded – undo
5922 5922
 		// phpcs:enable
5923 5923
 		global $langs;
5924 5924
 		if ($htmlname != "none") {
5925
-			print '<form method="POST" action="' . $page . '">';
5925
+			print '<form method="POST" action="'.$page.'">';
5926 5926
 			print '<input type="hidden" name="action" value="setmulticurrencycode">';
5927
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
5927
+			print '<input type="hidden" name="token" value="'.newToken().'">';
5928 5928
 			print $this->selectMultiCurrency($selected, $htmlname, 0);
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
 			dol_include_once('/core/lib/company.lib.php');
@@ -5951,21 +5951,21 @@  discard block
 block discarded – undo
5951 5951
 		global $langs, $mysoc, $conf;
5952 5952
 
5953 5953
 		if ($htmlname != "none") {
5954
-			print '<form method="POST" action="' . $page . '">';
5954
+			print '<form method="POST" action="'.$page.'">';
5955 5955
 			print '<input type="hidden" name="action" value="setmulticurrencyrate">';
5956
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
5957
-			print '<input type="text" class="maxwidth100" name="' . $htmlname . '" value="' . (!empty($rate) ? price(price2num($rate, 'CU')) : 1) . '" /> ';
5956
+			print '<input type="hidden" name="token" value="'.newToken().'">';
5957
+			print '<input type="text" class="maxwidth100" name="'.$htmlname.'" value="'.(!empty($rate) ? price(price2num($rate, 'CU')) : 1).'" /> ';
5958 5958
 			print '<select name="calculation_mode">';
5959
-			print '<option value="1">Change ' . $langs->trans("PriceUHT") . ' of lines</option>';
5960
-			print '<option value="2">Change ' . $langs->trans("PriceUHTCurrency") . ' of lines</option>';
5959
+			print '<option value="1">Change '.$langs->trans("PriceUHT").' of lines</option>';
5960
+			print '<option value="2">Change '.$langs->trans("PriceUHTCurrency").' of lines</option>';
5961 5961
 			print '</select> ';
5962
-			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
5962
+			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
5963 5963
 			print '</form>';
5964 5964
 		} else {
5965 5965
 			if (!empty($rate)) {
5966 5966
 				print price($rate, 1, $langs, 1, 0);
5967 5967
 				if ($currency && $rate != 1) {
5968
-					print ' &nbsp; (' . price($rate, 1, $langs, 1, 0) . ' ' . $currency . ' = 1 ' . $conf->currency . ')';
5968
+					print ' &nbsp; ('.price($rate, 1, $langs, 1, 0).' '.$currency.' = 1 '.$conf->currency.')';
5969 5969
 				}
5970 5970
 			} else {
5971 5971
 				print 1;
@@ -5996,9 +5996,9 @@  discard block
 block discarded – undo
5996 5996
 		// phpcs:enable
5997 5997
 		global $conf, $langs;
5998 5998
 		if ($htmlname != "none") {
5999
-			print '<form method="post" action="' . $page . '">';
5999
+			print '<form method="post" action="'.$page.'">';
6000 6000
 			print '<input type="hidden" name="action" value="setabsolutediscount">';
6001
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
6001
+			print '<input type="hidden" name="token" value="'.newToken().'">';
6002 6002
 			print '<div class="inline-block">';
6003 6003
 			if (!empty($discount_type)) {
6004 6004
 				if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) {
@@ -6036,24 +6036,24 @@  discard block
 block discarded – undo
6036 6036
 			print '</div>';
6037 6037
 			if (empty($hidelist)) {
6038 6038
 				print '<div class="inline-block" style="padding-right: 10px">';
6039
-				$newfilter = 'discount_type=' . intval($discount_type);
6039
+				$newfilter = 'discount_type='.intval($discount_type);
6040 6040
 				if (!empty($discount_type)) {
6041 6041
 					$newfilter .= ' AND fk_invoice_supplier IS NULL AND fk_invoice_supplier_line IS NULL'; // Supplier discounts available
6042 6042
 				} else {
6043 6043
 					$newfilter .= ' AND fk_facture IS NULL AND fk_facture_line IS NULL'; // Customer discounts available
6044 6044
 				}
6045 6045
 				if ($filter) {
6046
-					$newfilter .= ' AND (' . $filter . ')';
6046
+					$newfilter .= ' AND ('.$filter.')';
6047 6047
 				}
6048 6048
 				// output the combo of discounts
6049 6049
 				$nbqualifiedlines = $this->select_remises($selected, $htmlname, $newfilter, $socid, $maxvalue);
6050 6050
 				if ($nbqualifiedlines > 0) {
6051
-					print ' &nbsp; <input type="submit" class="button smallpaddingimp" value="' . dol_escape_htmltag($langs->trans("UseLine")) . '"';
6051
+					print ' &nbsp; <input type="submit" class="button smallpaddingimp" value="'.dol_escape_htmltag($langs->trans("UseLine")).'"';
6052 6052
 					if (!empty($discount_type) && $filter && $filter != "fk_invoice_supplier_source IS NULL OR (description LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS PAID)%')") {
6053
-						print ' title="' . $langs->trans("UseCreditNoteInInvoicePayment") . '"';
6053
+						print ' title="'.$langs->trans("UseCreditNoteInInvoicePayment").'"';
6054 6054
 					}
6055 6055
 					if (empty($discount_type) && $filter && $filter != "fk_facture_source IS NULL OR (description LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS RECEIVED)%')") {
6056
-						print ' title="' . $langs->trans("UseCreditNoteInInvoicePayment") . '"';
6056
+						print ' title="'.$langs->trans("UseCreditNoteInInvoicePayment").'"';
6057 6057
 					}
6058 6058
 
6059 6059
 					print '>';
@@ -6093,23 +6093,23 @@  discard block
 block discarded – undo
6093 6093
 		global $langs, $conf;
6094 6094
 
6095 6095
 		if ($htmlname != "none") {
6096
-			print '<form method="post" action="' . $page . '">';
6096
+			print '<form method="post" action="'.$page.'">';
6097 6097
 			print '<input type="hidden" name="action" value="set_contact">';
6098
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
6098
+			print '<input type="hidden" name="token" value="'.newToken().'">';
6099 6099
 			print '<table class="nobordernopadding">';
6100 6100
 			print '<tr><td>';
6101 6101
 			print $this->selectcontacts($societe->id, $selected, $htmlname);
6102 6102
 			$num = $this->num;
6103 6103
 			if ($num == 0) {
6104 6104
 				$addcontact = (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("AddContact") : $langs->trans("AddContactAddress"));
6105
-				print '<a href="' . DOL_URL_ROOT . '/contact/card.php?socid=' . $societe->id . '&amp;action=create&amp;backtoreferer=1">' . $addcontact . '</a>';
6105
+				print '<a href="'.DOL_URL_ROOT.'/contact/card.php?socid='.$societe->id.'&amp;action=create&amp;backtoreferer=1">'.$addcontact.'</a>';
6106 6106
 			}
6107 6107
 			print '</td>';
6108
-			print '<td class="left"><input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '"></td>';
6108
+			print '<td class="left"><input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'"></td>';
6109 6109
 			print '</tr></table></form>';
6110 6110
 		} else {
6111 6111
 			if ($selected) {
6112
-				require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php';
6112
+				require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
6113 6113
 				$contact = new Contact($this->db);
6114 6114
 				$contact->fetch($selected);
6115 6115
 				print $contact->getFullName($langs);
@@ -6144,20 +6144,20 @@  discard block
 block discarded – undo
6144 6144
 
6145 6145
 		$out = '';
6146 6146
 		if ($htmlname != "none") {
6147
-			$out .= '<form method="post" action="' . $page . '">';
6147
+			$out .= '<form method="post" action="'.$page.'">';
6148 6148
 			$out .= '<input type="hidden" name="action" value="set_thirdparty">';
6149
-			$out .= '<input type="hidden" name="token" value="' . newToken() . '">';
6149
+			$out .= '<input type="hidden" name="token" value="'.newToken().'">';
6150 6150
 			$out .= $this->select_company($selected, $htmlname, $filter, $showempty, $showtype, $forcecombo, $events, 0, 'minwidth100', '', '', 1, array(), false, $excludeids);
6151
-			$out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
6151
+			$out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
6152 6152
 			$out .= '</form>';
6153 6153
 		} else {
6154 6154
 			if ($selected) {
6155
-				require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
6155
+				require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
6156 6156
 				$soc = new Societe($this->db);
6157 6157
 				$soc->fetch($selected);
6158 6158
 				$out .= $soc->getNomUrl(0, '');
6159 6159
 			} else {
6160
-				$out .= '<span class="opacitymedium">' . $textifnothirdparty . '</span>';
6160
+				$out .= '<span class="opacitymedium">'.$textifnothirdparty.'</span>';
6161 6161
 			}
6162 6162
 		}
6163 6163
 
@@ -6207,22 +6207,22 @@  discard block
 block discarded – undo
6207 6207
 			$selected = 'EUR'; // Pour compatibilite
6208 6208
 		}
6209 6209
 
6210
-		$out .= '<select class="flat maxwidth200onsmartphone minwidth300" name="' . $htmlname . '" id="' . $htmlname . '">';
6210
+		$out .= '<select class="flat maxwidth200onsmartphone minwidth300" name="'.$htmlname.'" id="'.$htmlname.'">';
6211 6211
 		if ($useempty) {
6212 6212
 			$out .= '<option value="-1" selected></option>';
6213 6213
 		}
6214 6214
 		foreach ($langs->cache_currencies as $code_iso => $currency) {
6215 6215
 			$labeltoshow = $currency['label'];
6216 6216
 			if ($mode == 1) {
6217
-				$labeltoshow .= ' <span class="opacitymedium">(' . $code_iso . ')</span>';
6217
+				$labeltoshow .= ' <span class="opacitymedium">('.$code_iso.')</span>';
6218 6218
 			} else {
6219
-				$labeltoshow .= ' <span class="opacitymedium">(' . $langs->getCurrencySymbol($code_iso) . ')</span>';
6219
+				$labeltoshow .= ' <span class="opacitymedium">('.$langs->getCurrencySymbol($code_iso).')</span>';
6220 6220
 			}
6221 6221
 
6222 6222
 			if ($selected && $selected == $code_iso) {
6223
-				$out .= '<option value="' . $code_iso . '" selected data-html="' . dol_escape_htmltag($labeltoshow) . '">';
6223
+				$out .= '<option value="'.$code_iso.'" selected data-html="'.dol_escape_htmltag($labeltoshow).'">';
6224 6224
 			} else {
6225
-				$out .= '<option value="' . $code_iso . '" data-html="' . dol_escape_htmltag($labeltoshow) . '">';
6225
+				$out .= '<option value="'.$code_iso.'" data-html="'.dol_escape_htmltag($labeltoshow).'">';
6226 6226
 			}
6227 6227
 			$out .= $labeltoshow;
6228 6228
 			$out .= '</option>';
@@ -6233,7 +6233,7 @@  discard block
 block discarded – undo
6233 6233
 		}
6234 6234
 
6235 6235
 		// Make select dynamic
6236
-		include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
6236
+		include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
6237 6237
 		$out .= ajax_combobox($htmlname);
6238 6238
 
6239 6239
 		return $out;
@@ -6259,10 +6259,10 @@  discard block
 block discarded – undo
6259 6259
 
6260 6260
 		$TCurrency = array();
6261 6261
 
6262
-		$sql = "SELECT code FROM " . $this->db->prefix() . "multicurrency";
6263
-		$sql .= " WHERE entity IN ('" . getEntity('mutlicurrency') . "')";
6262
+		$sql = "SELECT code FROM ".$this->db->prefix()."multicurrency";
6263
+		$sql .= " WHERE entity IN ('".getEntity('mutlicurrency')."')";
6264 6264
 		if ($filter) {
6265
-			$sql .= " AND " . $filter;
6265
+			$sql .= " AND ".$filter;
6266 6266
 		}
6267 6267
 		$resql = $this->db->query($sql);
6268 6268
 		if ($resql) {
@@ -6272,7 +6272,7 @@  discard block
 block discarded – undo
6272 6272
 		}
6273 6273
 
6274 6274
 		$out = '';
6275
-		$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
6275
+		$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
6276 6276
 		if ($useempty) {
6277 6277
 			$out .= '<option value="">&nbsp;</option>';
6278 6278
 		}
@@ -6284,13 +6284,13 @@  discard block
 block discarded – undo
6284 6284
 			foreach ($langs->cache_currencies as $code_iso => $currency) {
6285 6285
 				if (isset($TCurrency[$code_iso])) {
6286 6286
 					if (!empty($selected) && $selected == $code_iso) {
6287
-						$out .= '<option value="' . $code_iso . '" selected="selected">';
6287
+						$out .= '<option value="'.$code_iso.'" selected="selected">';
6288 6288
 					} else {
6289
-						$out .= '<option value="' . $code_iso . '">';
6289
+						$out .= '<option value="'.$code_iso.'">';
6290 6290
 					}
6291 6291
 
6292 6292
 					$out .= $currency['label'];
6293
-					$out .= ' (' . $langs->getCurrencySymbol($code_iso) . ')';
6293
+					$out .= ' ('.$langs->getCurrencySymbol($code_iso).')';
6294 6294
 					$out .= '</option>';
6295 6295
 				}
6296 6296
 			}
@@ -6299,7 +6299,7 @@  discard block
 block discarded – undo
6299 6299
 		$out .= '</select>';
6300 6300
 
6301 6301
 		// Make select dynamic
6302
-		include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
6302
+		include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
6303 6303
 		$out .= ajax_combobox($htmlname);
6304 6304
 
6305 6305
 		return $out;
@@ -6326,11 +6326,11 @@  discard block
 block discarded – undo
6326 6326
 		dol_syslog(__METHOD__, LOG_DEBUG);
6327 6327
 
6328 6328
 		$sql = "SELECT DISTINCT t.rowid, t.code, t.taux, t.localtax1, t.localtax1_type, t.localtax2, t.localtax2_type, t.recuperableonly";
6329
-		$sql .= " FROM " . $this->db->prefix() . "c_tva as t, " . $this->db->prefix() . "c_country as c";
6329
+		$sql .= " FROM ".$this->db->prefix()."c_tva as t, ".$this->db->prefix()."c_country as c";
6330 6330
 		$sql .= " WHERE t.fk_pays = c.rowid";
6331 6331
 		$sql .= " AND t.active > 0";
6332 6332
 		$sql .= " AND t.entity IN (".getEntity('c_tva').")";
6333
-		$sql .= " AND c.code IN (" . $this->db->sanitize($country_code, 1) . ")";
6333
+		$sql .= " AND c.code IN (".$this->db->sanitize($country_code, 1).")";
6334 6334
 		$sql .= " ORDER BY t.code ASC, t.taux ASC, t.recuperableonly ASC";
6335 6335
 
6336 6336
 		$resql = $this->db->query($sql);
@@ -6348,22 +6348,22 @@  discard block
 block discarded – undo
6348 6348
 					$this->cache_vatrates[$i]['localtax2'] = $obj->localtax2;
6349 6349
 					$this->cache_vatrates[$i]['localtax2_type'] = $obj->localtax1_type;
6350 6350
 
6351
-					$this->cache_vatrates[$i]['label'] = $obj->taux . '%' . ($obj->code ? ' (' . $obj->code . ')' : ''); // Label must contains only 0-9 , . % or *
6352
-					$this->cache_vatrates[$i]['labelallrates'] = $obj->taux . '/' . ($obj->localtax1 ? $obj->localtax1 : '0') . '/' . ($obj->localtax2 ? $obj->localtax2 : '0') . ($obj->code ? ' (' . $obj->code . ')' : ''); // Must never be used as key, only label
6351
+					$this->cache_vatrates[$i]['label'] = $obj->taux.'%'.($obj->code ? ' ('.$obj->code.')' : ''); // Label must contains only 0-9 , . % or *
6352
+					$this->cache_vatrates[$i]['labelallrates'] = $obj->taux.'/'.($obj->localtax1 ? $obj->localtax1 : '0').'/'.($obj->localtax2 ? $obj->localtax2 : '0').($obj->code ? ' ('.$obj->code.')' : ''); // Must never be used as key, only label
6353 6353
 					$positiverates = '';
6354 6354
 					if ($obj->taux) {
6355
-						$positiverates .= ($positiverates ? '/' : '') . $obj->taux;
6355
+						$positiverates .= ($positiverates ? '/' : '').$obj->taux;
6356 6356
 					}
6357 6357
 					if ($obj->localtax1) {
6358
-						$positiverates .= ($positiverates ? '/' : '') . $obj->localtax1;
6358
+						$positiverates .= ($positiverates ? '/' : '').$obj->localtax1;
6359 6359
 					}
6360 6360
 					if ($obj->localtax2) {
6361
-						$positiverates .= ($positiverates ? '/' : '') . $obj->localtax2;
6361
+						$positiverates .= ($positiverates ? '/' : '').$obj->localtax2;
6362 6362
 					}
6363 6363
 					if (empty($positiverates)) {
6364 6364
 						$positiverates = '0';
6365 6365
 					}
6366
-					$this->cache_vatrates[$i]['labelpositiverates'] = $positiverates . ($obj->code ? ' (' . $obj->code . ')' : ''); // Must never be used as key, only label
6366
+					$this->cache_vatrates[$i]['labelpositiverates'] = $positiverates.($obj->code ? ' ('.$obj->code.')' : ''); // Must never be used as key, only label
6367 6367
 				}
6368 6368
 
6369 6369
 				return $num;
@@ -6381,7 +6381,7 @@  discard block
 block discarded – undo
6381 6381
 				return -1;
6382 6382
 			}
6383 6383
 		} else {
6384
-			$this->error = '<span class="error">' . $this->db->error() . '</span>';
6384
+			$this->error = '<span class="error">'.$this->db->error().'</span>';
6385 6385
 			return -2;
6386 6386
 		}
6387 6387
 	}
@@ -6433,9 +6433,9 @@  discard block
 block discarded – undo
6433 6433
 		// Check parameters
6434 6434
 		if (is_object($societe_vendeuse) && !$societe_vendeuse->country_code) {
6435 6435
 			if ($societe_vendeuse->id == $mysoc->id) {
6436
-				$return .= '<span class="error">' . $langs->trans("ErrorYourCountryIsNotDefined") . '</span>';
6436
+				$return .= '<span class="error">'.$langs->trans("ErrorYourCountryIsNotDefined").'</span>';
6437 6437
 			} else {
6438
-				$return .= '<span class="error">' . $langs->trans("ErrorSupplierCountryIsNotDefined") . '</span>';
6438
+				$return .= '<span class="error">'.$langs->trans("ErrorSupplierCountryIsNotDefined").'</span>';
6439 6439
 			}
6440 6440
 			return $return;
6441 6441
 		}
@@ -6447,25 +6447,25 @@  discard block
 block discarded – undo
6447 6447
 		// Define list of countries to use to search VAT rates to show
6448 6448
 		// First we defined code_country to use to find list
6449 6449
 		if (is_object($societe_vendeuse)) {
6450
-			$code_country = "'" . $societe_vendeuse->country_code . "'";
6450
+			$code_country = "'".$societe_vendeuse->country_code."'";
6451 6451
 		} else {
6452
-			$code_country = "'" . $mysoc->country_code . "'"; // Pour compatibilite ascendente
6452
+			$code_country = "'".$mysoc->country_code."'"; // Pour compatibilite ascendente
6453 6453
 		}
6454 6454
 		if (!empty($conf->global->SERVICE_ARE_ECOMMERCE_200238EC)) {    // If option to have vat for end customer for services is on
6455
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
6455
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
6456 6456
 			if (!isInEEC($societe_vendeuse) && (!is_object($societe_acheteuse) || (isInEEC($societe_acheteuse) && !$societe_acheteuse->isACompany()))) {
6457 6457
 				// We also add the buyer country code
6458 6458
 				if (is_numeric($type)) {
6459 6459
 					if ($type == 1) { // We know product is a service
6460
-						$code_country .= ",'" . $societe_acheteuse->country_code . "'";
6460
+						$code_country .= ",'".$societe_acheteuse->country_code."'";
6461 6461
 					}
6462 6462
 				} elseif (!$idprod) {  // We don't know type of product
6463
-					$code_country .= ",'" . $societe_acheteuse->country_code . "'";
6463
+					$code_country .= ",'".$societe_acheteuse->country_code."'";
6464 6464
 				} else {
6465 6465
 					$prodstatic = new Product($this->db);
6466 6466
 					$prodstatic->fetch($idprod);
6467 6467
 					if ($prodstatic->type == Product::TYPE_SERVICE) {   // We know product is a service
6468
-						$code_country .= ",'" . $societe_acheteuse->country_code . "'";
6468
+						$code_country .= ",'".$societe_acheteuse->country_code."'";
6469 6469
 					}
6470 6470
 				}
6471 6471
 			}
@@ -6517,13 +6517,13 @@  discard block
 block discarded – undo
6517 6517
 				// Override/enable VAT for expense report regardless of global setting - needed if expense report used for business expenses instead
6518 6518
 				// of using supplier invoices (this is a very bad idea !)
6519 6519
 				if (empty($conf->global->EXPENSEREPORT_OVERRIDE_VAT)) {
6520
-					$title = ' title="' . dol_escape_htmltag($langs->trans('VATIsNotUsed')) . '"';
6520
+					$title = ' title="'.dol_escape_htmltag($langs->trans('VATIsNotUsed')).'"';
6521 6521
 					$disabled = true;
6522 6522
 				}
6523 6523
 			}
6524 6524
 
6525 6525
 			if (!$options_only) {
6526
-				$return .= '<select class="flat minwidth50imp maxwidth100" id="' . $htmlname . '" name="' . $htmlname . '"' . ($disabled ? ' disabled' : '') . $title . '>';
6526
+				$return .= '<select class="flat minwidth50imp maxwidth100" id="'.$htmlname.'" name="'.$htmlname.'"'.($disabled ? ' disabled' : '').$title.'>';
6527 6527
 			}
6528 6528
 
6529 6529
 			$selectedfound = false;
@@ -6537,13 +6537,13 @@  discard block
 block discarded – undo
6537 6537
 				$key = $rate['txtva'];
6538 6538
 				$key .= $rate['nprtva'] ? '*' : '';
6539 6539
 				if ($mode > 0 && $rate['code']) {
6540
-					$key .= ' (' . $rate['code'] . ')';
6540
+					$key .= ' ('.$rate['code'].')';
6541 6541
 				}
6542 6542
 				if ($mode < 0) {
6543 6543
 					$key = $rate['rowid'];
6544 6544
 				}
6545 6545
 
6546
-				$return .= '<option value="' . $key . '"';
6546
+				$return .= '<option value="'.$key.'"';
6547 6547
 				if (!$selectedfound) {
6548 6548
 					if ($defaultcode) { // If defaultcode is defined, we used it in priority to select combo option instead of using rate+npr flag
6549 6549
 						if ($defaultcode == $rate['code']) {
@@ -6642,11 +6642,11 @@  discard block
 block discarded – undo
6642 6642
 	{
6643 6643
 		global $langs;
6644 6644
 
6645
-		$ret = $this->selectDate($set_time, $prefix . '_start', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("from"), 'tzuserrel');
6645
+		$ret = $this->selectDate($set_time, $prefix.'_start', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("from"), 'tzuserrel');
6646 6646
 		if ($forcenewline) {
6647 6647
 			$ret .= '<br>';
6648 6648
 		}
6649
-		$ret .= $this->selectDate($set_time_end, $prefix . '_end', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"), 'tzuserrel');
6649
+		$ret .= $this->selectDate($set_time_end, $prefix.'_end', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"), 'tzuserrel');
6650 6650
 		return $ret;
6651 6651
 	}
6652 6652
 
@@ -6712,7 +6712,7 @@  discard block
 block discarded – undo
6712 6712
 		$orig_set_time = $set_time;
6713 6713
 
6714 6714
 		if ($set_time === '' && $emptydate == 0) {
6715
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
6715
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
6716 6716
 			if ($gm == 'tzuser' || $gm == 'tzuserrel') {
6717 6717
 				$set_time = dol_now($gm);
6718 6718
 			} else {
@@ -6780,38 +6780,38 @@  discard block
 block discarded – undo
6780 6780
 				// Calendrier popup version eldy
6781 6781
 				if ($usecalendar == "eldy") {
6782 6782
 					// Input area to enter date manually
6783
-					$retstring .= '<input id="' . $prefix . '" name="' . $prefix . '" type="text" class="maxwidthdate" maxlength="11" value="' . $formated_date . '"';
6783
+					$retstring .= '<input id="'.$prefix.'" name="'.$prefix.'" type="text" class="maxwidthdate" maxlength="11" value="'.$formated_date.'"';
6784 6784
 					$retstring .= ($disabled ? ' disabled' : '');
6785
-					$retstring .= ' onChange="dpChangeDay(\'' . $prefix . '\',\'' . $langs->trans("FormatDateShortJavaInput") . '\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript
6785
+					$retstring .= ' onChange="dpChangeDay(\''.$prefix.'\',\''.$langs->trans("FormatDateShortJavaInput").'\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript
6786 6786
 					$retstring .= '>';
6787 6787
 
6788 6788
 					// Icon calendar
6789 6789
 					$retstringbuttom = '';
6790 6790
 					if (!$disabled) {
6791
-						$retstringbuttom = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons"';
6792
-						$base = DOL_URL_ROOT . '/core/';
6793
-						$retstringbuttom .= ' onClick="showDP(\'' . $base . '\',\'' . $prefix . '\',\'' . $langs->trans("FormatDateShortJavaInput") . '\',\'' . $langs->defaultlang . '\');"';
6794
-						$retstringbuttom .= '>' . img_object($langs->trans("SelectDate"), 'calendarday', 'class="datecallink"') . '</button>';
6791
+						$retstringbuttom = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons"';
6792
+						$base = DOL_URL_ROOT.'/core/';
6793
+						$retstringbuttom .= ' onClick="showDP(\''.$base.'\',\''.$prefix.'\',\''.$langs->trans("FormatDateShortJavaInput").'\',\''.$langs->defaultlang.'\');"';
6794
+						$retstringbuttom .= '>'.img_object($langs->trans("SelectDate"), 'calendarday', 'class="datecallink"').'</button>';
6795 6795
 					} else {
6796
-						$retstringbuttom = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons">' . img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"') . '</button>';
6796
+						$retstringbuttom = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons">'.img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"').'</button>';
6797 6797
 					}
6798
-					$retstring = $retstringbuttom . $retstring;
6798
+					$retstring = $retstringbuttom.$retstring;
6799 6799
 
6800
-					$retstring .= '<input type="hidden" id="' . $prefix . 'day"   name="' . $prefix . 'day"   value="' . $sday . '">' . "\n";
6801
-					$retstring .= '<input type="hidden" id="' . $prefix . 'month" name="' . $prefix . 'month" value="' . $smonth . '">' . "\n";
6802
-					$retstring .= '<input type="hidden" id="' . $prefix . 'year"  name="' . $prefix . 'year"  value="' . $syear . '">' . "\n";
6800
+					$retstring .= '<input type="hidden" id="'.$prefix.'day"   name="'.$prefix.'day"   value="'.$sday.'">'."\n";
6801
+					$retstring .= '<input type="hidden" id="'.$prefix.'month" name="'.$prefix.'month" value="'.$smonth.'">'."\n";
6802
+					$retstring .= '<input type="hidden" id="'.$prefix.'year"  name="'.$prefix.'year"  value="'.$syear.'">'."\n";
6803 6803
 				} elseif ($usecalendar == 'jquery') {
6804 6804
 					if (!$disabled) {
6805 6805
 						// Output javascript for datepicker
6806 6806
 						$minYear = getDolGlobalInt('MIN_YEAR_SELECT_DATE', (date('Y') - 100));
6807 6807
 						$maxYear = getDolGlobalInt('MAX_YEAR_SELECT_DATE', (date('Y') + 100));
6808 6808
 
6809
-						$retstring .= '<script nonce="' . getNonce() . '" type="text/javascript">';
6810
-						$retstring .= "$(function(){ $('#" . $prefix . "').datepicker({
6811
-							dateFormat: '" . $langs->trans("FormatDateShortJQueryInput") . "',
6809
+						$retstring .= '<script nonce="'.getNonce().'" type="text/javascript">';
6810
+						$retstring .= "$(function(){ $('#".$prefix."').datepicker({
6811
+							dateFormat: '" . $langs->trans("FormatDateShortJQueryInput")."',
6812 6812
 							autoclose: true,
6813 6813
 							todayHighlight: true,
6814
-							yearRange: '" . $minYear . ":" . $maxYear . "',";
6814
+							yearRange: '" . $minYear.":".$maxYear."',";
6815 6815
 						if (!empty($conf->dol_use_jmobile)) {
6816 6816
 							$retstring .= "
6817 6817
 								beforeShow: function (input, datePicker) {
@@ -6826,7 +6826,7 @@  discard block
 block discarded – undo
6826 6826
 						if (empty($conf->global->MAIN_POPUP_CALENDAR_ON_FOCUS)) {
6827 6827
 							$retstring .= "
6828 6828
 								showOn: 'button',	/* both has problem with autocompletion */
6829
-								buttonImage: '" . DOL_URL_ROOT . "/theme/" . dol_escape_js($conf->theme) . "/img/object_calendarday.png',
6829
+								buttonImage: '" . DOL_URL_ROOT."/theme/".dol_escape_js($conf->theme)."/img/object_calendarday.png',
6830 6830
 								buttonImageOnly: true";
6831 6831
 						}
6832 6832
 						$retstring .= "
@@ -6838,8 +6838,8 @@  discard block
 block discarded – undo
6838 6838
 					$retstring .= '<div class="nowraponall inline-block divfordateinput">';
6839 6839
 					$retstring .= '<input id="'.$prefix.'" name="'.$prefix.'" type="text" class="maxwidthdate" maxlength="11" value="'.$formated_date.'"';
6840 6840
 					$retstring .= ($disabled ? ' disabled' : '');
6841
-					$retstring .= ($placeholder ? ' placeholder="' . dol_escape_htmltag($placeholder) . '"' : '');
6842
-					$retstring .= ' onChange="dpChangeDay(\'' . dol_escape_js($prefix) . '\',\'' . dol_escape_js($langs->trans("FormatDateShortJavaInput")) . '\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript
6841
+					$retstring .= ($placeholder ? ' placeholder="'.dol_escape_htmltag($placeholder).'"' : '');
6842
+					$retstring .= ' onChange="dpChangeDay(\''.dol_escape_js($prefix).'\',\''.dol_escape_js($langs->trans("FormatDateShortJavaInput")).'\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript
6843 6843
 					$retstring .= '>';
6844 6844
 
6845 6845
 					// Icone calendrier
@@ -6854,40 +6854,40 @@  discard block
 block discarded – undo
6854 6854
 						$retstring.='});';
6855 6855
 						$retstring.="</script>";*/
6856 6856
 					} else {
6857
-						$retstringbutton = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons">' . img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"') . '</button>';
6858
-						$retsring = $retstringbutton . $retstring;
6857
+						$retstringbutton = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons">'.img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"').'</button>';
6858
+						$retsring = $retstringbutton.$retstring;
6859 6859
 					}
6860 6860
 
6861 6861
 					$retstring .= '</div>';
6862
-					$retstring .= '<input type="hidden" id="' . $prefix . 'day"   name="' . $prefix . 'day"   value="' . $sday . '">' . "\n";
6863
-					$retstring .= '<input type="hidden" id="' . $prefix . 'month" name="' . $prefix . 'month" value="' . $smonth . '">' . "\n";
6864
-					$retstring .= '<input type="hidden" id="' . $prefix . 'year"  name="' . $prefix . 'year"  value="' . $syear . '">' . "\n";
6862
+					$retstring .= '<input type="hidden" id="'.$prefix.'day"   name="'.$prefix.'day"   value="'.$sday.'">'."\n";
6863
+					$retstring .= '<input type="hidden" id="'.$prefix.'month" name="'.$prefix.'month" value="'.$smonth.'">'."\n";
6864
+					$retstring .= '<input type="hidden" id="'.$prefix.'year"  name="'.$prefix.'year"  value="'.$syear.'">'."\n";
6865 6865
 				} else {
6866 6866
 					$retstring .= "Bad value of MAIN_POPUP_CALENDAR";
6867 6867
 				}
6868 6868
 			} else {
6869 6869
 				// Show date with combo selects
6870 6870
 				// Day
6871
-				$retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth50imp" id="' . $prefix . 'day" name="' . $prefix . 'day">';
6871
+				$retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50imp" id="'.$prefix.'day" name="'.$prefix.'day">';
6872 6872
 
6873 6873
 				if ($emptydate || $set_time == -1) {
6874 6874
 					$retstring .= '<option value="0" selected>&nbsp;</option>';
6875 6875
 				}
6876 6876
 
6877 6877
 				for ($day = 1; $day <= 31; $day++) {
6878
-					$retstring .= '<option value="' . $day . '"' . ($day == $sday ? ' selected' : '') . '>' . $day . '</option>';
6878
+					$retstring .= '<option value="'.$day.'"'.($day == $sday ? ' selected' : '').'>'.$day.'</option>';
6879 6879
 				}
6880 6880
 
6881 6881
 				$retstring .= "</select>";
6882 6882
 
6883
-				$retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth75imp" id="' . $prefix . 'month" name="' . $prefix . 'month">';
6883
+				$retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth75imp" id="'.$prefix.'month" name="'.$prefix.'month">';
6884 6884
 				if ($emptydate || $set_time == -1) {
6885 6885
 					$retstring .= '<option value="0" selected>&nbsp;</option>';
6886 6886
 				}
6887 6887
 
6888 6888
 				// Month
6889 6889
 				for ($month = 1; $month <= 12; $month++) {
6890
-					$retstring .= '<option value="' . $month . '"' . ($month == $smonth ? ' selected' : '') . '>';
6890
+					$retstring .= '<option value="'.$month.'"'.($month == $smonth ? ' selected' : '').'>';
6891 6891
 					$retstring .= dol_print_date(mktime(12, 0, 0, $month, 1, 2000), "%b");
6892 6892
 					$retstring .= "</option>";
6893 6893
 				}
@@ -6895,12 +6895,12 @@  discard block
 block discarded – undo
6895 6895
 
6896 6896
 				// Year
6897 6897
 				if ($emptydate || $set_time == -1) {
6898
-					$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 . '">';
6898
+					$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.'">';
6899 6899
 				} else {
6900
-					$retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth75imp" id="' . $prefix . 'year" name="' . $prefix . 'year">';
6900
+					$retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth75imp" id="'.$prefix.'year" name="'.$prefix.'year">';
6901 6901
 
6902 6902
 					for ($year = $syear - 10; $year < $syear + 10; $year++) {
6903
-						$retstring .= '<option value="' . $year . '"' . ($year == $syear ? ' selected' : '') . '>' . $year . '</option>';
6903
+						$retstring .= '<option value="'.$year.'"'.($year == $syear ? ' selected' : '').'>'.$year.'</option>';
6904 6904
 					}
6905 6905
 					$retstring .= "</select>\n";
6906 6906
 				}
@@ -6924,15 +6924,15 @@  discard block
 block discarded – undo
6924 6924
 				}
6925 6925
 			}
6926 6926
 			// Show hour
6927
-			$retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth50 ' . ($fullday ? $fullday . 'hour' : '') . '" id="' . $prefix . 'hour" name="' . $prefix . 'hour">';
6927
+			$retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50 '.($fullday ? $fullday.'hour' : '').'" id="'.$prefix.'hour" name="'.$prefix.'hour">';
6928 6928
 			if ($emptyhours) {
6929 6929
 				$retstring .= '<option value="-1">&nbsp;</option>';
6930 6930
 			}
6931 6931
 			for ($hour = $hourstart; $hour < $hourend; $hour++) {
6932 6932
 				if (strlen($hour) < 2) {
6933
-					$hour = "0" . $hour;
6933
+					$hour = "0".$hour;
6934 6934
 				}
6935
-				$retstring .= '<option value="' . $hour . '"' . (($hour == $shour) ? ' selected' : '') . '>' . $hour;
6935
+				$retstring .= '<option value="'.$hour.'"'.(($hour == $shour) ? ' selected' : '').'>'.$hour;
6936 6936
 				//$retstring .= (empty($conf->dol_optimize_smallscreen) ? '' : 'H');
6937 6937
 				$retstring .= '</option>';
6938 6938
 			}
@@ -6945,19 +6945,19 @@  discard block
 block discarded – undo
6945 6945
 
6946 6946
 		if ($m) {
6947 6947
 			// Show minutes
6948
-			$retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth50 ' . ($fullday ? $fullday . 'min' : '') . '" id="' . $prefix . 'min" name="' . $prefix . 'min">';
6948
+			$retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50 '.($fullday ? $fullday.'min' : '').'" id="'.$prefix.'min" name="'.$prefix.'min">';
6949 6949
 			if ($emptyhours) {
6950 6950
 				$retstring .= '<option value="-1">&nbsp;</option>';
6951 6951
 			}
6952 6952
 			for ($min = 0; $min < 60; $min += $stepminutes) {
6953 6953
 				if (strlen($min) < 2) {
6954
-					$min = "0" . $min;
6954
+					$min = "0".$min;
6955 6955
 				}
6956
-				$retstring .= '<option value="' . $min . '"' . (($min == $smin) ? ' selected' : '') . '>' . $min . (empty($conf->dol_optimize_smallscreen) ? '' : '') . '</option>';
6956
+				$retstring .= '<option value="'.$min.'"'.(($min == $smin) ? ' selected' : '').'>'.$min.(empty($conf->dol_optimize_smallscreen) ? '' : '').'</option>';
6957 6957
 			}
6958 6958
 			$retstring .= '</select>';
6959 6959
 
6960
-			$retstring .= '<input type="hidden" name="' . $prefix . 'sec" value="' . $ssec . '">';
6960
+			$retstring .= '<input type="hidden" name="'.$prefix.'sec" value="'.$ssec.'">';
6961 6961
 		}
6962 6962
 
6963 6963
 		if ($d && $h) {
@@ -6980,10 +6980,10 @@  discard block
 block discarded – undo
6980 6980
 
6981 6981
 			// Generate the date part, depending on the use or not of the javascript calendar
6982 6982
 			if ($addnowlink == 1) { // server time expressed in user time setup
6983
-				$reset_scripts .= 'jQuery(\'#' . $prefix . '\').val(\'' . dol_print_date($nowgmt, 'day', 'tzuserrel') . '\');';
6984
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'day\').val(\'' . dol_print_date($nowgmt, '%d', 'tzuserrel') . '\');';
6985
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'month\').val(\'' . dol_print_date($nowgmt, '%m', 'tzuserrel') . '\');';
6986
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'year\').val(\'' . dol_print_date($nowgmt, '%Y', 'tzuserrel') . '\');';
6983
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'day', 'tzuserrel').'\');';
6984
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');';
6985
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');';
6986
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');';
6987 6987
 			} elseif ($addnowlink == 2) {
6988 6988
 				/* Disabled because the output does not use the string format defined by FormatDateShort key to forge the value into #prefix.
6989 6989
 				 * This break application for foreign languages.
@@ -6992,10 +6992,10 @@  discard block
 block discarded – undo
6992 6992
 				$reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(parseInt(d.getMonth().pad()) + 1);';
6993 6993
 				$reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(d.getFullYear());';
6994 6994
 				*/
6995
-				$reset_scripts .= 'jQuery(\'#' . $prefix . '\').val(\'' . dol_print_date($nowgmt, 'day', 'tzuserrel') . '\');';
6996
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'day\').val(\'' . dol_print_date($nowgmt, '%d', 'tzuserrel') . '\');';
6997
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'month\').val(\'' . dol_print_date($nowgmt, '%m', 'tzuserrel') . '\');';
6998
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'year\').val(\'' . dol_print_date($nowgmt, '%Y', 'tzuserrel') . '\');';
6995
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'day', 'tzuserrel').'\');';
6996
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');';
6997
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');';
6998
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');';
6999 6999
 			}
7000 7000
 			/*if ($usecalendar == "eldy")
7001 7001
 			{
@@ -7015,11 +7015,11 @@  discard block
 block discarded – undo
7015 7015
 				}
7016 7016
 				//$reset_scripts .= 'this.form.elements[\''.$prefix.'hour\'].value=formatDate(new Date(), \'HH\'); ';
7017 7017
 				if ($addnowlink == 1) {
7018
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').val(\'' . dol_print_date($nowgmt, '%H', 'tzuserrel') . '\');';
7019
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').change();';
7018
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(\''.dol_print_date($nowgmt, '%H', 'tzuserrel').'\');';
7019
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').change();';
7020 7020
 				} elseif ($addnowlink == 2) {
7021
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').val(d.getHours().pad());';
7022
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').change();';
7021
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(d.getHours().pad());';
7022
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').change();';
7023 7023
 				}
7024 7024
 
7025 7025
 				if ($fullday) {
@@ -7033,11 +7033,11 @@  discard block
 block discarded – undo
7033 7033
 				}
7034 7034
 				//$reset_scripts .= 'this.form.elements[\''.$prefix.'min\'].value=formatDate(new Date(), \'mm\'); ';
7035 7035
 				if ($addnowlink == 1) {
7036
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').val(\'' . dol_print_date($nowgmt, '%M', 'tzuserrel') . '\');';
7037
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').change();';
7036
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(\''.dol_print_date($nowgmt, '%M', 'tzuserrel').'\');';
7037
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').change();';
7038 7038
 				} elseif ($addnowlink == 2) {
7039
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').val(d.getMinutes().pad());';
7040
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').change();';
7039
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(d.getMinutes().pad());';
7040
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').change();';
7041 7041
 				}
7042 7042
 				if ($fullday) {
7043 7043
 					$reset_scripts .= ' } ';
@@ -7045,7 +7045,7 @@  discard block
 block discarded – undo
7045 7045
 			}
7046 7046
 			// If reset_scripts is not empty, print the link with the reset_scripts in the onClick
7047 7047
 			if ($reset_scripts && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
7048
-				$retstring .= ' <button class="dpInvisibleButtons datenowlink" id="' . $prefix . 'ButtonNow" type="button" name="_useless" value="now" onClick="' . $reset_scripts . '">';
7048
+				$retstring .= ' <button class="dpInvisibleButtons datenowlink" id="'.$prefix.'ButtonNow" type="button" name="_useless" value="now" onClick="'.$reset_scripts.'">';
7049 7049
 				$retstring .= $langs->trans("Now");
7050 7050
 				$retstring .= '</button> ';
7051 7051
 			}
@@ -7057,16 +7057,16 @@  discard block
 block discarded – undo
7057 7057
 			$reset_scripts = "";
7058 7058
 
7059 7059
 			// Generate the date part, depending on the use or not of the javascript calendar
7060
-			$reset_scripts .= 'jQuery(\'#' . $prefix . '\').val(\'' . dol_print_date($nowgmt, 'dayinputnoreduce', 'tzuserrel') . '\');';
7061
-			$reset_scripts .= 'jQuery(\'#' . $prefix . 'day\').val(\'' . dol_print_date($nowgmt, '%d', 'tzuserrel') . '\');';
7062
-			$reset_scripts .= 'jQuery(\'#' . $prefix . 'month\').val(\'' . dol_print_date($nowgmt, '%m', 'tzuserrel') . '\');';
7063
-			$reset_scripts .= 'jQuery(\'#' . $prefix . 'year\').val(\'' . dol_print_date($nowgmt, '%Y', 'tzuserrel') . '\');';
7060
+			$reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'dayinputnoreduce', 'tzuserrel').'\');';
7061
+			$reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');';
7062
+			$reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');';
7063
+			$reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');';
7064 7064
 			// Update the hour part
7065 7065
 			if ($h) {
7066 7066
 				if ($fullday) {
7067 7067
 					$reset_scripts .= " if (jQuery('#fullday:checked').val() == null) {";
7068 7068
 				}
7069
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').val(\'' . dol_print_date($nowgmt, '%H', 'tzuserrel') . '\');';
7069
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(\''.dol_print_date($nowgmt, '%H', 'tzuserrel').'\');';
7070 7070
 				if ($fullday) {
7071 7071
 					$reset_scripts .= ' } ';
7072 7072
 				}
@@ -7076,14 +7076,14 @@  discard block
 block discarded – undo
7076 7076
 				if ($fullday) {
7077 7077
 					$reset_scripts .= " if (jQuery('#fullday:checked').val() == null) {";
7078 7078
 				}
7079
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').val(\'' . dol_print_date($nowgmt, '%M', 'tzuserrel') . '\');';
7079
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(\''.dol_print_date($nowgmt, '%M', 'tzuserrel').'\');';
7080 7080
 				if ($fullday) {
7081 7081
 					$reset_scripts .= ' } ';
7082 7082
 				}
7083 7083
 			}
7084 7084
 			// If reset_scripts is not empty, print the link with the reset_scripts in the onClick
7085 7085
 			if ($reset_scripts && empty($conf->dol_optimize_smallscreen)) {
7086
-				$retstring .= ' <button class="dpInvisibleButtons datenowlink" id="' . $prefix . 'ButtonPlusOne" type="button" name="_useless2" value="plusone" onClick="' . $reset_scripts . '">';
7086
+				$retstring .= ' <button class="dpInvisibleButtons datenowlink" id="'.$prefix.'ButtonPlusOne" type="button" name="_useless2" value="plusone" onClick="'.$reset_scripts.'">';
7087 7087
 				$retstring .= $langs->trans("DateStartPlusOne");
7088 7088
 				$retstring .= '</button> ';
7089 7089
 			}
@@ -7141,17 +7141,17 @@  discard block
 block discarded – undo
7141 7141
 			unset($TDurationTypes[$value]);
7142 7142
 		}
7143 7143
 
7144
-		$retstring = '<select class="flat minwidth75 maxwidth100" id="select_' . $prefix . 'type_duration" name="' . $prefix . 'type_duration">';
7144
+		$retstring = '<select class="flat minwidth75 maxwidth100" id="select_'.$prefix.'type_duration" name="'.$prefix.'type_duration">';
7145 7145
 		foreach ($TDurationTypes as $key => $typeduration) {
7146
-			$retstring .= '<option value="' . $key . '"';
7146
+			$retstring .= '<option value="'.$key.'"';
7147 7147
 			if ($key == $selected) {
7148 7148
 				$retstring .= " selected";
7149 7149
 			}
7150
-			$retstring .= ">" . $typeduration . "</option>";
7150
+			$retstring .= ">".$typeduration."</option>";
7151 7151
 		}
7152 7152
 		$retstring .= "</select>";
7153 7153
 
7154
-		$retstring .= ajax_combobox('select_' . $prefix . 'type_duration');
7154
+		$retstring .= ajax_combobox('select_'.$prefix.'type_duration');
7155 7155
 
7156 7156
 		return $retstring;
7157 7157
 	}
@@ -7183,30 +7183,30 @@  discard block
 block discarded – undo
7183 7183
 
7184 7184
 		// Hours
7185 7185
 		if ($iSecond != '') {
7186
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
7186
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
7187 7187
 
7188 7188
 			$hourSelected = convertSecondToTime($iSecond, 'allhour');
7189 7189
 			$minSelected = convertSecondToTime($iSecond, 'min');
7190 7190
 		}
7191 7191
 
7192 7192
 		if ($typehour == 'select') {
7193
-			$retstring .= '<select class="flat" id="select_' . $prefix . 'hour" name="' . $prefix . 'hour"' . ($disabled ? ' disabled' : '') . '>';
7193
+			$retstring .= '<select class="flat" id="select_'.$prefix.'hour" name="'.$prefix.'hour"'.($disabled ? ' disabled' : '').'>';
7194 7194
 			for ($hour = 0; $hour < 25; $hour++) {    // For a duration, we allow 24 hours
7195
-				$retstring .= '<option value="' . $hour . '"';
7195
+				$retstring .= '<option value="'.$hour.'"';
7196 7196
 				if (is_numeric($hourSelected) && $hourSelected == $hour) {
7197 7197
 					$retstring .= " selected";
7198 7198
 				}
7199
-				$retstring .= ">" . $hour . "</option>";
7199
+				$retstring .= ">".$hour."</option>";
7200 7200
 			}
7201 7201
 			$retstring .= "</select>";
7202 7202
 		} elseif ($typehour == 'text' || $typehour == 'textselect') {
7203
-			$retstring .= '<input placeholder="' . $langs->trans('HourShort') . '" type="number" min="0" name="' . $prefix . 'hour"' . ($disabled ? ' disabled' : '') . ' class="flat maxwidth50 inputhour right" value="' . (($hourSelected != '') ? ((int) $hourSelected) : '') . '">';
7203
+			$retstring .= '<input placeholder="'.$langs->trans('HourShort').'" type="number" min="0" name="'.$prefix.'hour"'.($disabled ? ' disabled' : '').' class="flat maxwidth50 inputhour right" value="'.(($hourSelected != '') ? ((int) $hourSelected) : '').'">';
7204 7204
 		} else {
7205 7205
 			return 'BadValueForParameterTypeHour';
7206 7206
 		}
7207 7207
 
7208 7208
 		if ($typehour != 'text') {
7209
-			$retstring .= ' ' . $langs->trans('HourShort');
7209
+			$retstring .= ' '.$langs->trans('HourShort');
7210 7210
 		} else {
7211 7211
 			$retstring .= '<span class="">:</span>';
7212 7212
 		}
@@ -7221,21 +7221,21 @@  discard block
 block discarded – undo
7221 7221
 		}
7222 7222
 
7223 7223
 		if ($typehour == 'select' || $typehour == 'textselect') {
7224
-			$retstring .= '<select class="flat" id="select_' . $prefix . 'min" name="' . $prefix . 'min"' . ($disabled ? ' disabled' : '') . '>';
7224
+			$retstring .= '<select class="flat" id="select_'.$prefix.'min" name="'.$prefix.'min"'.($disabled ? ' disabled' : '').'>';
7225 7225
 			for ($min = 0; $min <= 55; $min = $min + 5) {
7226
-				$retstring .= '<option value="' . $min . '"';
7226
+				$retstring .= '<option value="'.$min.'"';
7227 7227
 				if (is_numeric($minSelected) && $minSelected == $min) {
7228 7228
 					$retstring .= ' selected';
7229 7229
 				}
7230
-				$retstring .= '>' . $min . '</option>';
7230
+				$retstring .= '>'.$min.'</option>';
7231 7231
 			}
7232 7232
 			$retstring .= "</select>";
7233 7233
 		} elseif ($typehour == 'text') {
7234
-			$retstring .= '<input placeholder="' . $langs->trans('MinuteShort') . '" type="number" min="0" name="' . $prefix . 'min"' . ($disabled ? ' disabled' : '') . ' class="flat maxwidth50 inputminute right" value="' . (($minSelected != '') ? ((int) $minSelected) : '') . '">';
7234
+			$retstring .= '<input placeholder="'.$langs->trans('MinuteShort').'" type="number" min="0" name="'.$prefix.'min"'.($disabled ? ' disabled' : '').' class="flat maxwidth50 inputminute right" value="'.(($minSelected != '') ? ((int) $minSelected) : '').'">';
7235 7235
 		}
7236 7236
 
7237 7237
 		if ($typehour != 'text') {
7238
-			$retstring .= ' ' . $langs->trans('MinuteShort');
7238
+			$retstring .= ' '.$langs->trans('MinuteShort');
7239 7239
 		}
7240 7240
 
7241 7241
 		$retstring .= "</span>";
@@ -7281,7 +7281,7 @@  discard block
 block discarded – undo
7281 7281
 			$placeholder = '';
7282 7282
 
7283 7283
 			if ($selected && empty($selected_input_value)) {
7284
-				require_once DOL_DOCUMENT_ROOT . '/ticket/class/ticket.class.php';
7284
+				require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php';
7285 7285
 				$tickettmpselect = new Ticket($this->db);
7286 7286
 				$tickettmpselect->fetch($selected);
7287 7287
 				$selected_input_value = $tickettmpselect->ref;
@@ -7289,16 +7289,16 @@  discard block
 block discarded – undo
7289 7289
 			}
7290 7290
 
7291 7291
 			$urloption = '';
7292
-			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/ticket/ajax/tickets.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
7292
+			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/ticket/ajax/tickets.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
7293 7293
 
7294
-			if (empty($hidelabel)) $out .= $langs->trans("RefOrLabel") . ' : ';
7294
+			if (empty($hidelabel)) $out .= $langs->trans("RefOrLabel").' : ';
7295 7295
 			elseif ($hidelabel > 1) {
7296
-				$placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"';
7296
+				$placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"';
7297 7297
 				if ($hidelabel == 2) {
7298 7298
 					$out .= img_picto($langs->trans("Search"), 'search');
7299 7299
 				}
7300 7300
 			}
7301
-			$out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (!empty($conf->global->PRODUCT_SEARCH_AUTOFOCUS) ? 'autofocus' : '') . ' />';
7301
+			$out .= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(!empty($conf->global->PRODUCT_SEARCH_AUTOFOCUS) ? 'autofocus' : '').' />';
7302 7302
 			if ($hidelabel == 3) {
7303 7303
 				$out .= img_picto($langs->trans("Search"), 'search');
7304 7304
 			}
@@ -7342,8 +7342,8 @@  discard block
 block discarded – undo
7342 7342
 
7343 7343
 		$sql = "SELECT ";
7344 7344
 		$sql .= $selectFields;
7345
-		$sql .= " FROM " . $this->db->prefix() . "ticket as p";
7346
-		$sql .= ' WHERE p.entity IN (' . getEntity('ticket') . ')';
7345
+		$sql .= " FROM ".$this->db->prefix()."ticket as p";
7346
+		$sql .= ' WHERE p.entity IN ('.getEntity('ticket').')';
7347 7347
 
7348 7348
 		// Add criteria on ref/label
7349 7349
 		if ($filterkey != '') {
@@ -7355,7 +7355,7 @@  discard block
 block discarded – undo
7355 7355
 			if (count($scrit) > 1) $sql .= "(";
7356 7356
 			foreach ($scrit as $crit) {
7357 7357
 				if ($i > 0) $sql .= " AND ";
7358
-				$sql .= "(p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%' OR p.subject LIKE '" . $this->db->escape($prefix . $crit) . "%'";
7358
+				$sql .= "(p.ref LIKE '".$this->db->escape($prefix.$crit)."%' OR p.subject LIKE '".$this->db->escape($prefix.$crit)."%'";
7359 7359
 				$sql .= ")";
7360 7360
 				$i++;
7361 7361
 			}
@@ -7366,22 +7366,22 @@  discard block
 block discarded – undo
7366 7366
 		$sql .= $this->db->plimit($limit, 0);
7367 7367
 
7368 7368
 		// Build output string
7369
-		dol_syslog(get_class($this) . "::selectTicketsList search tickets", LOG_DEBUG);
7369
+		dol_syslog(get_class($this)."::selectTicketsList search tickets", LOG_DEBUG);
7370 7370
 		$result = $this->db->query($sql);
7371 7371
 		if ($result) {
7372
-			require_once DOL_DOCUMENT_ROOT . '/ticket/class/ticket.class.php';
7373
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/ticket.lib.php';
7372
+			require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php';
7373
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/ticket.lib.php';
7374 7374
 
7375 7375
 			$num = $this->db->num_rows($result);
7376 7376
 
7377 7377
 			$events = null;
7378 7378
 
7379 7379
 			if (!$forcecombo) {
7380
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
7380
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
7381 7381
 				$out .= ajax_combobox($htmlname, $events, $conf->global->TICKET_USE_SEARCH_TO_SELECT);
7382 7382
 			}
7383 7383
 
7384
-			$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
7384
+			$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
7385 7385
 
7386 7386
 			$textifempty = '';
7387 7387
 			// Do not use textifempty = ' ' or '&nbsp;' here, or search on key will search on ' key'.
@@ -7392,7 +7392,7 @@  discard block
 block discarded – undo
7392 7392
 			} else {
7393 7393
 				if ($showempty && !is_numeric($showempty)) $textifempty = $langs->trans($showempty);
7394 7394
 			}
7395
-			if ($showempty) $out .= '<option value="0" selected>' . $textifempty . '</option>';
7395
+			if ($showempty) $out .= '<option value="0" selected>'.$textifempty.'</option>';
7396 7396
 
7397 7397
 			$i = 0;
7398 7398
 			while ($num && $i < $num) {
@@ -7446,12 +7446,12 @@  discard block
 block discarded – undo
7446 7446
 		$outref = $objp->ref;
7447 7447
 		$outtype = $objp->fk_product_type;
7448 7448
 
7449
-		$opt = '<option value="' . $objp->rowid . '"';
7449
+		$opt = '<option value="'.$objp->rowid.'"';
7450 7450
 		$opt .= ($objp->rowid == $selected) ? ' selected' : '';
7451 7451
 		$opt .= '>';
7452 7452
 		$opt .= $objp->ref;
7453 7453
 		$objRef = $objp->ref;
7454
-		if (!empty($filterkey) && $filterkey != '') $objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1);
7454
+		if (!empty($filterkey) && $filterkey != '') $objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1);
7455 7455
 
7456 7456
 		$opt .= "</option>\n";
7457 7457
 		$optJson = array('key' => $outkey, 'value' => $outref, 'type' => $outtype);
@@ -7489,7 +7489,7 @@  discard block
 block discarded – undo
7489 7489
 			$placeholder = '';
7490 7490
 
7491 7491
 			if ($selected && empty($selected_input_value)) {
7492
-				require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
7492
+				require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
7493 7493
 				$projecttmpselect = new Project($this->db);
7494 7494
 				$projecttmpselect->fetch($selected);
7495 7495
 				$selected_input_value = $projecttmpselect->ref;
@@ -7497,16 +7497,16 @@  discard block
 block discarded – undo
7497 7497
 			}
7498 7498
 
7499 7499
 			$urloption = '';
7500
-			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/projet/ajax/projects.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
7500
+			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/projet/ajax/projects.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
7501 7501
 
7502
-			if (empty($hidelabel)) $out .= $langs->trans("RefOrLabel") . ' : ';
7502
+			if (empty($hidelabel)) $out .= $langs->trans("RefOrLabel").' : ';
7503 7503
 			elseif ($hidelabel > 1) {
7504
-				$placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"';
7504
+				$placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"';
7505 7505
 				if ($hidelabel == 2) {
7506 7506
 					$out .= img_picto($langs->trans("Search"), 'search');
7507 7507
 				}
7508 7508
 			}
7509
-			$out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (!empty($conf->global->PRODUCT_SEARCH_AUTOFOCUS) ? 'autofocus' : '') . ' />';
7509
+			$out .= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(!empty($conf->global->PRODUCT_SEARCH_AUTOFOCUS) ? 'autofocus' : '').' />';
7510 7510
 			if ($hidelabel == 3) {
7511 7511
 				$out .= img_picto($langs->trans("Search"), 'search');
7512 7512
 			}
@@ -7549,8 +7549,8 @@  discard block
 block discarded – undo
7549 7549
 
7550 7550
 		$sql = "SELECT ";
7551 7551
 		$sql .= $selectFields;
7552
-		$sql .= " FROM " . $this->db->prefix() . "projet as p";
7553
-		$sql .= ' WHERE p.entity IN (' . getEntity('project') . ')';
7552
+		$sql .= " FROM ".$this->db->prefix()."projet as p";
7553
+		$sql .= ' WHERE p.entity IN ('.getEntity('project').')';
7554 7554
 
7555 7555
 		// Add criteria on ref/label
7556 7556
 		if ($filterkey != '') {
@@ -7562,7 +7562,7 @@  discard block
 block discarded – undo
7562 7562
 			if (count($scrit) > 1) $sql .= "(";
7563 7563
 			foreach ($scrit as $crit) {
7564 7564
 				if ($i > 0) $sql .= " AND ";
7565
-				$sql .= "p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%'";
7565
+				$sql .= "p.ref LIKE '".$this->db->escape($prefix.$crit)."%'";
7566 7566
 				$sql .= "";
7567 7567
 				$i++;
7568 7568
 			}
@@ -7573,22 +7573,22 @@  discard block
 block discarded – undo
7573 7573
 		$sql .= $this->db->plimit($limit, 0);
7574 7574
 
7575 7575
 		// Build output string
7576
-		dol_syslog(get_class($this) . "::selectProjectsList search projects", LOG_DEBUG);
7576
+		dol_syslog(get_class($this)."::selectProjectsList search projects", LOG_DEBUG);
7577 7577
 		$result = $this->db->query($sql);
7578 7578
 		if ($result) {
7579
-			require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
7580
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php';
7579
+			require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
7580
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
7581 7581
 
7582 7582
 			$num = $this->db->num_rows($result);
7583 7583
 
7584 7584
 			$events = null;
7585 7585
 
7586 7586
 			if (!$forcecombo) {
7587
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
7587
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
7588 7588
 				$out .= ajax_combobox($htmlname, $events, $conf->global->PROJECT_USE_SEARCH_TO_SELECT);
7589 7589
 			}
7590 7590
 
7591
-			$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
7591
+			$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
7592 7592
 
7593 7593
 			$textifempty = '';
7594 7594
 			// Do not use textifempty = ' ' or '&nbsp;' here, or search on key will search on ' key'.
@@ -7599,7 +7599,7 @@  discard block
 block discarded – undo
7599 7599
 			} else {
7600 7600
 				if ($showempty && !is_numeric($showempty)) $textifempty = $langs->trans($showempty);
7601 7601
 			}
7602
-			if ($showempty) $out .= '<option value="0" selected>' . $textifempty . '</option>';
7602
+			if ($showempty) $out .= '<option value="0" selected>'.$textifempty.'</option>';
7603 7603
 
7604 7604
 			$i = 0;
7605 7605
 			while ($num && $i < $num) {
@@ -7656,12 +7656,12 @@  discard block
 block discarded – undo
7656 7656
 		$outlabel = $objp->label;
7657 7657
 		$outtype = $objp->fk_product_type;
7658 7658
 
7659
-		$opt = '<option value="' . $objp->rowid . '"';
7659
+		$opt = '<option value="'.$objp->rowid.'"';
7660 7660
 		$opt .= ($objp->rowid == $selected) ? ' selected' : '';
7661 7661
 		$opt .= '>';
7662 7662
 		$opt .= $objp->ref;
7663 7663
 		$objRef = $objp->ref;
7664
-		if (!empty($filterkey) && $filterkey != '') $objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1);
7664
+		if (!empty($filterkey) && $filterkey != '') $objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1);
7665 7665
 
7666 7666
 		$opt .= "</option>\n";
7667 7667
 		$optJson = array('key' => $outkey, 'value' => $outref, 'type' => $outtype);
@@ -7701,7 +7701,7 @@  discard block
 block discarded – undo
7701 7701
 			$urloption = '';
7702 7702
 
7703 7703
 			if ($selected && empty($selected_input_value)) {
7704
-				require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php';
7704
+				require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
7705 7705
 				$adherenttmpselect = new Adherent($this->db);
7706 7706
 				$adherenttmpselect->fetch($selected);
7707 7707
 				$selected_input_value = $adherenttmpselect->ref;
@@ -7710,16 +7710,16 @@  discard block
 block discarded – undo
7710 7710
 
7711 7711
 			$urloption = '';
7712 7712
 
7713
-			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/adherents/ajax/adherents.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
7713
+			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/adherents/ajax/adherents.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
7714 7714
 
7715
-			if (empty($hidelabel)) $out .= $langs->trans("RefOrLabel") . ' : ';
7715
+			if (empty($hidelabel)) $out .= $langs->trans("RefOrLabel").' : ';
7716 7716
 			elseif ($hidelabel > 1) {
7717
-				$placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"';
7717
+				$placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"';
7718 7718
 				if ($hidelabel == 2) {
7719 7719
 					$out .= img_picto($langs->trans("Search"), 'search');
7720 7720
 				}
7721 7721
 			}
7722
-			$out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (!empty($conf->global->PRODUCT_SEARCH_AUTOFOCUS) ? 'autofocus' : '') . ' />';
7722
+			$out .= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(!empty($conf->global->PRODUCT_SEARCH_AUTOFOCUS) ? 'autofocus' : '').' />';
7723 7723
 			if ($hidelabel == 3) {
7724 7724
 				$out .= img_picto($langs->trans("Search"), 'search');
7725 7725
 			}
@@ -7764,8 +7764,8 @@  discard block
 block discarded – undo
7764 7764
 
7765 7765
 		$sql = "SELECT ";
7766 7766
 		$sql .= $selectFields;
7767
-		$sql .= " FROM " . $this->db->prefix() . "adherent as p";
7768
-		$sql .= ' WHERE p.entity IN (' . getEntity('adherent') . ')';
7767
+		$sql .= " FROM ".$this->db->prefix()."adherent as p";
7768
+		$sql .= ' WHERE p.entity IN ('.getEntity('adherent').')';
7769 7769
 
7770 7770
 		// Add criteria on ref/label
7771 7771
 		if ($filterkey != '') {
@@ -7777,35 +7777,35 @@  discard block
 block discarded – undo
7777 7777
 			if (count($scrit) > 1) $sql .= "(";
7778 7778
 			foreach ($scrit as $crit) {
7779 7779
 				if ($i > 0) $sql .= " AND ";
7780
-				$sql .= "(p.firstname LIKE '" . $this->db->escape($prefix . $crit) . "%'";
7781
-				$sql .= " OR p.lastname LIKE '" . $this->db->escape($prefix . $crit) . "%')";
7780
+				$sql .= "(p.firstname LIKE '".$this->db->escape($prefix.$crit)."%'";
7781
+				$sql .= " OR p.lastname LIKE '".$this->db->escape($prefix.$crit)."%')";
7782 7782
 				$i++;
7783 7783
 			}
7784 7784
 			if (count($scrit) > 1) $sql .= ")";
7785 7785
 			$sql .= ')';
7786 7786
 		}
7787 7787
 		if ($status != -1) {
7788
-			$sql .= ' AND statut = ' . ((int) $status);
7788
+			$sql .= ' AND statut = '.((int) $status);
7789 7789
 		}
7790 7790
 		$sql .= $this->db->plimit($limit, 0);
7791 7791
 
7792 7792
 		// Build output string
7793
-		dol_syslog(get_class($this) . "::selectMembersList search adherents", LOG_DEBUG);
7793
+		dol_syslog(get_class($this)."::selectMembersList search adherents", LOG_DEBUG);
7794 7794
 		$result = $this->db->query($sql);
7795 7795
 		if ($result) {
7796
-			require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php';
7797
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/member.lib.php';
7796
+			require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
7797
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
7798 7798
 
7799 7799
 			$num = $this->db->num_rows($result);
7800 7800
 
7801 7801
 			$events = null;
7802 7802
 
7803 7803
 			if (!$forcecombo) {
7804
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
7804
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
7805 7805
 				$out .= ajax_combobox($htmlname, $events, !empty($conf->global->PROJECT_USE_SEARCH_TO_SELECT) ? $conf->global->PROJECT_USE_SEARCH_TO_SELECT : '');
7806 7806
 			}
7807 7807
 
7808
-			$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
7808
+			$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
7809 7809
 
7810 7810
 			$textifempty = '';
7811 7811
 			// Do not use textifempty = ' ' or '&nbsp;' here, or search on key will search on ' key'.
@@ -7817,7 +7817,7 @@  discard block
 block discarded – undo
7817 7817
 				if ($showempty && !is_numeric($showempty)) $textifempty = $langs->trans($showempty);
7818 7818
 			}
7819 7819
 			if ($showempty) {
7820
-				$out .= '<option value="-1" selected>' . $textifempty . '</option>';
7820
+				$out .= '<option value="-1" selected>'.$textifempty.'</option>';
7821 7821
 			}
7822 7822
 
7823 7823
 			$i = 0;
@@ -7873,11 +7873,11 @@  discard block
 block discarded – undo
7873 7873
 		$outlabel = dolGetFirstLastname($objp->firstname, $objp->lastname);
7874 7874
 		$outtype = $objp->fk_adherent_type;
7875 7875
 
7876
-		$opt = '<option value="' . $objp->rowid . '"';
7876
+		$opt = '<option value="'.$objp->rowid.'"';
7877 7877
 		$opt .= ($objp->rowid == $selected) ? ' selected' : '';
7878 7878
 		$opt .= '>';
7879 7879
 		if (!empty($filterkey) && $filterkey != '') {
7880
-			$outlabel = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $outlabel, 1);
7880
+			$outlabel = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $outlabel, 1);
7881 7881
 		}
7882 7882
 		$opt .= $outlabel;
7883 7883
 		$opt .= "</option>\n";
@@ -7918,9 +7918,9 @@  discard block
 block discarded – undo
7918 7918
 		$vartmp = (empty($InfoFieldList[3]) ? '' : $InfoFieldList[3]);
7919 7919
 		$reg = array();
7920 7920
 		if (preg_match('/^.*:(\w*)$/', $vartmp, $reg)) {
7921
-			$InfoFieldList[4] = $reg[1];    // take the sort field
7921
+			$InfoFieldList[4] = $reg[1]; // take the sort field
7922 7922
 		}
7923
-		$InfoFieldList[3] = preg_replace('/:\w*$/', '', $vartmp);    // take the filter field
7923
+		$InfoFieldList[3] = preg_replace('/:\w*$/', '', $vartmp); // take the filter field
7924 7924
 
7925 7925
 		$classname = $InfoFieldList[0];
7926 7926
 		$classpath = $InfoFieldList[1];
@@ -7944,8 +7944,8 @@  discard block
 block discarded – undo
7944 7944
 			}
7945 7945
 		}
7946 7946
 		if (!is_object($objecttmp)) {
7947
-			dol_syslog('Error bad setup of type for field ' . join(',', $InfoFieldList), LOG_WARNING);
7948
-			return 'Error bad setup of type for field ' . join(',', $InfoFieldList);
7947
+			dol_syslog('Error bad setup of type for field '.join(',', $InfoFieldList), LOG_WARNING);
7948
+			return 'Error bad setup of type for field '.join(',', $InfoFieldList);
7949 7949
 		}
7950 7950
 
7951 7951
 		//var_dump($filter);
@@ -7956,9 +7956,9 @@  discard block
 block discarded – undo
7956 7956
 		if ($prefixforautocompletemode == 'product') {
7957 7957
 			$prefixforautocompletemode = 'produit';
7958 7958
 		}
7959
-		$confkeyforautocompletemode = strtoupper($prefixforautocompletemode) . '_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT
7959
+		$confkeyforautocompletemode = strtoupper($prefixforautocompletemode).'_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT
7960 7960
 
7961
-		dol_syslog(get_class($this) . "::selectForForms filter=" . $filter, LOG_DEBUG);
7961
+		dol_syslog(get_class($this)."::selectForForms filter=".$filter, LOG_DEBUG);
7962 7962
 		$out = '';
7963 7963
 		if (!empty($conf->use_javascript_ajax) && getDolGlobalString($confkeyforautocompletemode) && !$forcecombo) {
7964 7964
 			// No immediate load of all database
@@ -7969,15 +7969,15 @@  discard block
 block discarded – undo
7969 7969
 				//unset($objecttmp);
7970 7970
 			}
7971 7971
 
7972
-			$objectdesc = $classname . ':' . $classpath . ':' . $addcreatebuttonornot . ':' . $filter;
7973
-			$urlforajaxcall = DOL_URL_ROOT . '/core/ajax/selectobject.php';
7972
+			$objectdesc = $classname.':'.$classpath.':'.$addcreatebuttonornot.':'.$filter;
7973
+			$urlforajaxcall = DOL_URL_ROOT.'/core/ajax/selectobject.php';
7974 7974
 
7975 7975
 			// No immediate load of all database
7976
-			$urloption = 'htmlname=' . urlencode($htmlname) . '&outjson=1&objectdesc=' . urlencode($objectdesc) . '&filter=' . urlencode($filter) . ($sortfield ? '&sortfield=' . urlencode($sortfield) : '');
7976
+			$urloption = 'htmlname='.urlencode($htmlname).'&outjson=1&objectdesc='.urlencode($objectdesc).'&filter='.urlencode($filter).($sortfield ? '&sortfield='.urlencode($sortfield) : '');
7977 7977
 			// Activate the auto complete using ajax call.
7978 7978
 			$out .= ajax_autocompleter($preselectedvalue, $htmlname, $urlforajaxcall, $urloption, $conf->global->$confkeyforautocompletemode, 0, array());
7979 7979
 			$out .= '<!-- force css to be higher than dialog popup --><style type="text/css">.ui-autocomplete { z-index: 1010; }</style>';
7980
-			$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) . '"' : '') . ' />';
7980
+			$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).'"' : '').' />';
7981 7981
 		} else {
7982 7982
 			// Immediate load of table record.
7983 7983
 			$out .= $this->selectForFormsList($objecttmp, $htmlname, $preselectedvalue, $showempty, $searchkey, $placeholder, $morecss, $moreparams, $forcecombo, 0, $disabled, $sortfield, $filter);
@@ -8017,7 +8017,7 @@  discard block
 block discarded – undo
8017 8017
 		if ($prefixforautocompletemode == 'societe') {
8018 8018
 			$prefixforautocompletemode = 'company';
8019 8019
 		}
8020
-		$confkeyforautocompletemode = strtoupper($prefixforautocompletemode) . '_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT
8020
+		$confkeyforautocompletemode = strtoupper($prefixforautocompletemode).'_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT
8021 8021
 
8022 8022
 		if (!empty($objecttmp->fields)) {    // For object that declare it, it is better to use declared fields (like societe, contact, ...)
8023 8023
 			$tmpfieldstoshow = '';
@@ -8026,7 +8026,7 @@  discard block
 block discarded – undo
8026 8026
 					continue;
8027 8027
 				}
8028 8028
 				if (!empty($val['showoncombobox'])) {
8029
-					$tmpfieldstoshow .= ($tmpfieldstoshow ? ',' : '') . 't.' . $key;
8029
+					$tmpfieldstoshow .= ($tmpfieldstoshow ? ',' : '').'t.'.$key;
8030 8030
 				}
8031 8031
 			}
8032 8032
 			if ($tmpfieldstoshow) {
@@ -8054,15 +8054,15 @@  discard block
 block discarded – undo
8054 8054
 		$num = 0;
8055 8055
 
8056 8056
 		// Search data
8057
-		$sql = "SELECT t.rowid, " . $fieldstoshow . " FROM " . $this->db->prefix() . $objecttmp->table_element . " as t";
8057
+		$sql = "SELECT t.rowid, ".$fieldstoshow." FROM ".$this->db->prefix().$objecttmp->table_element." as t";
8058 8058
 		if (isset($objecttmp->ismultientitymanaged)) {
8059 8059
 			if (!is_numeric($objecttmp->ismultientitymanaged)) {
8060 8060
 				$tmparray = explode('@', $objecttmp->ismultientitymanaged);
8061
-				$sql .= " INNER JOIN " . $this->db->prefix() . $tmparray[1] . " as parenttable ON parenttable.rowid = t." . $tmparray[0];
8061
+				$sql .= " INNER JOIN ".$this->db->prefix().$tmparray[1]." as parenttable ON parenttable.rowid = t.".$tmparray[0];
8062 8062
 			}
8063 8063
 			if ($objecttmp->ismultientitymanaged === 'fk_soc@societe') {
8064 8064
 				if (empty($user->rights->societe->client->voir) && !$user->socid) {
8065
-					$sql .= ", " . $this->db->prefix() . "societe_commerciaux as sc";
8065
+					$sql .= ", ".$this->db->prefix()."societe_commerciaux as sc";
8066 8066
 				}
8067 8067
 			}
8068 8068
 		}
@@ -8082,21 +8082,21 @@  discard block
 block discarded – undo
8082 8082
 			$sql .= " WHERE 1=1";
8083 8083
 			if (isset($objecttmp->ismultientitymanaged)) {
8084 8084
 				if ($objecttmp->ismultientitymanaged == 1) {
8085
-					$sql .= " AND t.entity IN (" . getEntity($objecttmp->table_element) . ")";
8085
+					$sql .= " AND t.entity IN (".getEntity($objecttmp->table_element).")";
8086 8086
 				}
8087 8087
 				if (!is_numeric($objecttmp->ismultientitymanaged)) {
8088
-					$sql .= " AND parenttable.entity = t." . $tmparray[0];
8088
+					$sql .= " AND parenttable.entity = t.".$tmparray[0];
8089 8089
 				}
8090 8090
 				if ($objecttmp->ismultientitymanaged == 1 && !empty($user->socid)) {
8091 8091
 					if ($objecttmp->element == 'societe') {
8092
-						$sql .= " AND t.rowid = " . ((int) $user->socid);
8092
+						$sql .= " AND t.rowid = ".((int) $user->socid);
8093 8093
 					} else {
8094
-						$sql .= " AND t.fk_soc = " . ((int) $user->socid);
8094
+						$sql .= " AND t.fk_soc = ".((int) $user->socid);
8095 8095
 					}
8096 8096
 				}
8097 8097
 				if ($objecttmp->ismultientitymanaged === 'fk_soc@societe') {
8098 8098
 					if (empty($user->rights->societe->client->voir) && !$user->socid) {
8099
-						$sql .= " AND t.rowid = sc.fk_soc AND sc.fk_user = " . ((int) $user->id);
8099
+						$sql .= " AND t.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
8100 8100
 					}
8101 8101
 				}
8102 8102
 			}
@@ -8108,7 +8108,7 @@  discard block
 block discarded – undo
8108 8108
 				$errormessage = '';
8109 8109
 				$sql .= forgeSQLFromUniversalSearchCriteria($filter, $errormessage);
8110 8110
 				if ($errormessage) {
8111
-					return 'Error forging a SQL request from an universal criteria: ' . $errormessage;
8111
+					return 'Error forging a SQL request from an universal criteria: '.$errormessage;
8112 8112
 				}
8113 8113
 			}
8114 8114
 		}
@@ -8120,7 +8120,7 @@  discard block
 block discarded – undo
8120 8120
 		$resql = $this->db->query($sql);
8121 8121
 		if ($resql) {
8122 8122
 			// Construct $out and $outarray
8123
-			$out .= '<select id="' . $htmlname . '" class="flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ($moreparams ? ' ' . $moreparams : '') . ' name="' . $htmlname . '">' . "\n";
8123
+			$out .= '<select id="'.$htmlname.'" class="flat'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').($moreparams ? ' '.$moreparams : '').' name="'.$htmlname.'">'."\n";
8124 8124
 
8125 8125
 			// 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
8126 8126
 			$textifempty = '&nbsp;';
@@ -8134,7 +8134,7 @@  discard block
 block discarded – undo
8134 8134
 				}
8135 8135
 			}
8136 8136
 			if ($showempty) {
8137
-				$out .= '<option value="-1">' . $textifempty . '</option>' . "\n";
8137
+				$out .= '<option value="-1">'.$textifempty.'</option>'."\n";
8138 8138
 			}
8139 8139
 
8140 8140
 			$num = $this->db->num_rows($resql);
@@ -8157,9 +8157,9 @@  discard block
 block discarded – undo
8157 8157
 					}
8158 8158
 					if (empty($outputmode)) {
8159 8159
 						if ($preselectedvalue > 0 && $preselectedvalue == $obj->rowid) {
8160
-							$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>';
8160
+							$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>';
8161 8161
 						} else {
8162
-							$out .= '<option value="' . $obj->rowid . '" data-html="' . dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1) . '">' . dol_escape_htmltag($label, 0, 0, '', 0, 1) . '</option>';
8162
+							$out .= '<option value="'.$obj->rowid.'" data-html="'.dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1).'">'.dol_escape_htmltag($label, 0, 0, '', 0, 1).'</option>';
8163 8163
 						}
8164 8164
 					} else {
8165 8165
 						array_push($outarray, array('key' => $obj->rowid, 'value' => $label, 'label' => $label));
@@ -8172,10 +8172,10 @@  discard block
 block discarded – undo
8172 8172
 				}
8173 8173
 			}
8174 8174
 
8175
-			$out .= '</select>' . "\n";
8175
+			$out .= '</select>'."\n";
8176 8176
 
8177 8177
 			if (!$forcecombo) {
8178
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
8178
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
8179 8179
 				$out .= ajax_combobox($htmlname, null, (!empty($conf->global->$confkeyforautocompletemode) ? $conf->global->$confkeyforautocompletemode : 0));
8180 8180
 			}
8181 8181
 		} else {
@@ -8237,8 +8237,8 @@  discard block
 block discarded – undo
8237 8237
 			}
8238 8238
 		}
8239 8239
 		$idname = str_replace(array('[', ']'), array('', ''), $htmlname);
8240
-		$out .= '<select id="' . preg_replace('/^\./', '', $idname) . '" ' . ($disabled ? 'disabled="disabled" ' : '') . 'class="flat ' . (preg_replace('/^\./', '', $htmlname)) . ($morecss ? ' ' . $morecss : '') . ' selectformat"';
8241
-		$out .= ' name="' . preg_replace('/^\./', '', $htmlname) . '" ' . ($moreparam ? $moreparam : '');
8240
+		$out .= '<select id="'.preg_replace('/^\./', '', $idname).'" '.($disabled ? 'disabled="disabled" ' : '').'class="flat '.(preg_replace('/^\./', '', $htmlname)).($morecss ? ' '.$morecss : '').' selectformat"';
8241
+		$out .= ' name="'.preg_replace('/^\./', '', $htmlname).'" '.($moreparam ? $moreparam : '');
8242 8242
 		$out .= '>'."\n";
8243 8243
 
8244 8244
 		if ($show_empty) {
@@ -8249,7 +8249,7 @@  discard block
 block discarded – undo
8249 8249
 			if (!is_numeric($show_empty)) {
8250 8250
 				$textforempty = $show_empty;
8251 8251
 			}
8252
-			$out .= '<option class="optiongrey" ' . ($moreparamonempty ? $moreparamonempty . ' ' : '') . 'value="' . ($show_empty < 0 ? $show_empty : -1) . '"' . ($id == $show_empty ? ' selected' : '') . '>' . $textforempty . '</option>' . "\n";
8252
+			$out .= '<option class="optiongrey" '.($moreparamonempty ? $moreparamonempty.' ' : '').'value="'.($show_empty < 0 ? $show_empty : -1).'"'.($id == $show_empty ? ' selected' : '').'>'.$textforempty.'</option>'."\n";
8253 8253
 		}
8254 8254
 		if (is_array($array)) {
8255 8255
 			// Translate
@@ -8272,7 +8272,7 @@  discard block
 block discarded – undo
8272 8272
 				if (is_array($tmpvalue)) {
8273 8273
 					$value = $tmpvalue['label'];
8274 8274
 					$disabled = empty($tmpvalue['disabled']) ? '' : ' disabled';
8275
-					$style = empty($tmpvalue['css']) ? '' : ' class="' . $tmpvalue['css'] . '"';
8275
+					$style = empty($tmpvalue['css']) ? '' : ' class="'.$tmpvalue['css'].'"';
8276 8276
 				} else {
8277 8277
 					$value = $tmpvalue;
8278 8278
 					$disabled = '';
@@ -8287,9 +8287,9 @@  discard block
 block discarded – undo
8287 8287
 				}
8288 8288
 				if ($key_in_label) {
8289 8289
 					if (empty($nohtmlescape)) {
8290
-						$selectOptionValue = dol_escape_htmltag($key . ' - ' . ($maxlen ? dol_trunc($value, $maxlen) : $value));
8290
+						$selectOptionValue = dol_escape_htmltag($key.' - '.($maxlen ? dol_trunc($value, $maxlen) : $value));
8291 8291
 					} else {
8292
-						$selectOptionValue = $key . ' - ' . ($maxlen ? dol_trunc($value, $maxlen) : $value);
8292
+						$selectOptionValue = $key.' - '.($maxlen ? dol_trunc($value, $maxlen) : $value);
8293 8293
 					}
8294 8294
 				} else {
8295 8295
 					if (empty($nohtmlescape)) {
@@ -8301,8 +8301,8 @@  discard block
 block discarded – undo
8301 8301
 						$selectOptionValue = '&nbsp;';
8302 8302
 					}
8303 8303
 				}
8304
-				$out .= '<option value="' . $key . '"';
8305
-				$out .= $style . $disabled;
8304
+				$out .= '<option value="'.$key.'"';
8305
+				$out .= $style.$disabled;
8306 8306
 				if (is_array($id)) {
8307 8307
 					if (in_array($key, $id) && !$disabled) {
8308 8308
 						$out .= ' selected'; // To preselect a value
@@ -8314,7 +8314,7 @@  discard block
 block discarded – undo
8314 8314
 					}
8315 8315
 				}
8316 8316
 				if ($nohtmlescape) {
8317
-					$out .= ' data-html="' . dol_escape_htmltag($selectOptionValue) . '"';
8317
+					$out .= ' data-html="'.dol_escape_htmltag($selectOptionValue).'"';
8318 8318
 				}
8319 8319
 				if (is_array($tmpvalue)) {
8320 8320
 					foreach ($tmpvalue as $keyforvalue => $valueforvalue) {
@@ -8332,7 +8332,7 @@  discard block
 block discarded – undo
8332 8332
 			// Add code for jquery to use multiselect
8333 8333
 		if ($addjscombo && $jsbeautify) {
8334 8334
 			// Enhance with select2
8335
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
8335
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
8336 8336
 			$out .= ajax_combobox($idname, array(), 0, 0, 'resolve', ($show_empty < 0 ? (string) $show_empty : '-1'), $morecss);
8337 8337
 		}
8338 8338
 
@@ -8364,28 +8364,28 @@  discard block
 block discarded – undo
8364 8364
 	public static function selectArrayAjax($htmlname, $url, $id = '', $moreparam = '', $moreparamtourl = '', $disabled = 0, $minimumInputLength = 1, $morecss = '', $callurlonselect = 0, $placeholder = '', $acceptdelayedhtml = 0)
8365 8365
 	{
8366 8366
 		global $conf, $langs;
8367
-		global $delayedhtmlcontent;    // Will be used later outside of this function
8367
+		global $delayedhtmlcontent; // Will be used later outside of this function
8368 8368
 
8369 8369
 		// TODO Use an internal dolibarr component instead of select2
8370 8370
 		if (empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) && !defined('REQUIRE_JQUERY_MULTISELECT')) {
8371 8371
 			return '';
8372 8372
 		}
8373 8373
 
8374
-		$out = '<select type="text" class="' . $htmlname . ($morecss ? ' ' . $morecss : '') . '" ' . ($moreparam ? $moreparam . ' ' : '') . 'name="' . $htmlname . '"></select>';
8374
+		$out = '<select type="text" class="'.$htmlname.($morecss ? ' '.$morecss : '').'" '.($moreparam ? $moreparam.' ' : '').'name="'.$htmlname.'"></select>';
8375 8375
 
8376 8376
 		$outdelayed = '';
8377 8377
 		if (!empty($conf->use_javascript_ajax)) {
8378 8378
 			$tmpplugin = 'select2';
8379
-			$outdelayed = "\n" . '<!-- JS CODE TO ENABLE ' . $tmpplugin . ' for id ' . $htmlname . ' -->
8380
-		    	<script nonce="' . getNonce() . '">
8379
+			$outdelayed = "\n".'<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' -->
8380
+		    	<script nonce="' . getNonce().'">
8381 8381
 		    	$(document).ready(function () {
8382 8382
 
8383
-	    	        ' . ($callurlonselect ? 'var saveRemoteData = [];' : '') . '
8383
+	    	        ' . ($callurlonselect ? 'var saveRemoteData = [];' : '').'
8384 8384
 
8385
-	                $(".' . $htmlname . '").select2({
8385
+	                $(".' . $htmlname.'").select2({
8386 8386
 				    	ajax: {
8387 8387
 					    	dir: "ltr",
8388
-					    	url: "' . $url . '",
8388
+					    	url: "' . $url.'",
8389 8389
 					    	dataType: \'json\',
8390 8390
 					    	delay: 250,
8391 8391
 					    	data: function (params) {
@@ -8412,9 +8412,9 @@  discard block
 block discarded – undo
8412 8412
 				    	},
8413 8413
 		 				language: select2arrayoflanguage,
8414 8414
 						containerCssClass: \':all:\',					/* Line to add class of origin SELECT propagated to the new <span class="select2-selection...> tag */
8415
-					    placeholder: "' . dol_escape_js($placeholder) . '",
8415
+					    placeholder: "' . dol_escape_js($placeholder).'",
8416 8416
 				    	escapeMarkup: function (markup) { return markup; }, 	// let our custom formatter work
8417
-				    	minimumInputLength: ' . ((int) $minimumInputLength) . ',
8417
+				    	minimumInputLength: ' . ((int) $minimumInputLength).',
8418 8418
 				        formatResult: function (result, container, query, escapeMarkup) {
8419 8419
 	                        return escapeMarkup(result.text);
8420 8420
 	                    },
@@ -8422,10 +8422,10 @@  discard block
 block discarded – undo
8422 8422
 
8423 8423
 	                ' . ($callurlonselect ? '
8424 8424
 	                /* Code to execute a GET when we select a value */
8425
-	                $(".' . $htmlname . '").change(function() {
8426
-				    	var selected = $(".' . $htmlname . '").val();
8425
+	                $(".' . $htmlname.'").change(function() {
8426
+				    	var selected = $(".' . $htmlname.'").val();
8427 8427
 	                	console.log("We select in selectArrayAjax the entry "+selected)
8428
-				        $(".' . $htmlname . '").val("");  /* reset visible combo value */
8428
+				        $(".' . $htmlname.'").val("");  /* reset visible combo value */
8429 8429
 	    			    $.each( saveRemoteData, function( key, value ) {
8430 8430
 	    				        if (key == selected)
8431 8431
 	    			            {
@@ -8433,7 +8433,7 @@  discard block
 block discarded – undo
8433 8433
 	    			                 location.assign(value.url);
8434 8434
 	    			            }
8435 8435
 	                    });
8436
-	    			});' : '') . '
8436
+	    			});' : '').'
8437 8437
 
8438 8438
 	    	   });
8439 8439
 		       </script>';
@@ -8469,14 +8469,14 @@  discard block
 block discarded – undo
8469 8469
 	public static function selectArrayFilter($htmlname, $array, $id = '', $moreparam = '', $disableFiltering = 0, $disabled = 0, $minimumInputLength = 1, $morecss = '', $callurlonselect = 0, $placeholder = '', $acceptdelayedhtml = 0, $textfortitle = '')
8470 8470
 	{
8471 8471
 		global $conf, $langs;
8472
-		global $delayedhtmlcontent;    // Will be used later outside of this function
8472
+		global $delayedhtmlcontent; // Will be used later outside of this function
8473 8473
 
8474 8474
 		// TODO Use an internal dolibarr component instead of select2
8475 8475
 		if (empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) && !defined('REQUIRE_JQUERY_MULTISELECT')) {
8476 8476
 			return '';
8477 8477
 		}
8478 8478
 
8479
-		$out = '<select type="text"'.($textfortitle? ' title="'.dol_escape_htmltag($textfortitle).'"' : '').' id="'.$htmlname.'" class="'.$htmlname.($morecss ? ' ' . $morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.'"><option></option></select>';
8479
+		$out = '<select type="text"'.($textfortitle ? ' title="'.dol_escape_htmltag($textfortitle).'"' : '').' id="'.$htmlname.'" class="'.$htmlname.($morecss ? ' '.$morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.'"><option></option></select>';
8480 8480
 
8481 8481
 		$formattedarrayresult = array();
8482 8482
 
@@ -8491,20 +8491,20 @@  discard block
 block discarded – undo
8491 8491
 		$outdelayed = '';
8492 8492
 		if (!empty($conf->use_javascript_ajax)) {
8493 8493
 			$tmpplugin = 'select2';
8494
-			$outdelayed = "\n" . '<!-- JS CODE TO ENABLE ' . $tmpplugin . ' for id ' . $htmlname . ' -->
8495
-				<script nonce="' . getNonce() . '">
8494
+			$outdelayed = "\n".'<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' -->
8495
+				<script nonce="' . getNonce().'">
8496 8496
 				$(document).ready(function () {
8497
-					var data = ' . json_encode($formattedarrayresult) . ';
8497
+					var data = ' . json_encode($formattedarrayresult).';
8498 8498
 
8499
-					' . ($callurlonselect ? 'var saveRemoteData = ' . json_encode($array) . ';' : '') . '
8499
+					' . ($callurlonselect ? 'var saveRemoteData = '.json_encode($array).';' : '').'
8500 8500
 
8501
-					$(".' . $htmlname . '").select2({
8501
+					$(".' . $htmlname.'").select2({
8502 8502
 						data: data,
8503 8503
 						language: select2arrayoflanguage,
8504 8504
 						containerCssClass: \':all:\',					/* Line to add class of origin SELECT propagated to the new <span class="select2-selection...> tag */
8505
-						placeholder: "' . dol_escape_js($placeholder) . '",
8505
+						placeholder: "' . dol_escape_js($placeholder).'",
8506 8506
 						escapeMarkup: function (markup) { return markup; }, 	// let our custom formatter work
8507
-						minimumInputLength: ' . $minimumInputLength . ',
8507
+						minimumInputLength: ' . $minimumInputLength.',
8508 8508
 						formatResult: function (result, container, query, escapeMarkup) {
8509 8509
 							return escapeMarkup(result.text);
8510 8510
 						},
@@ -8543,11 +8543,11 @@  discard block
 block discarded – undo
8543 8543
 
8544 8544
 					' . ($callurlonselect ? '
8545 8545
 					/* Code to execute a GET when we select a value */
8546
-					$(".' . $htmlname . '").change(function() {
8547
-						var selected = $(".' . $htmlname . '").val();
8546
+					$(".' . $htmlname.'").change(function() {
8547
+						var selected = $(".' . $htmlname.'").val();
8548 8548
 						console.log("We select "+selected)
8549 8549
 
8550
-						$(".' . $htmlname . '").val("");  /* reset visible combo value */
8550
+						$(".' . $htmlname.'").val("");  /* reset visible combo value */
8551 8551
 						$.each( saveRemoteData, function( key, value ) {
8552 8552
 							if (key == selected)
8553 8553
 							{
@@ -8555,7 +8555,7 @@  discard block
 block discarded – undo
8555 8555
 								location.assign(value.url);
8556 8556
 							}
8557 8557
 						});
8558
-					});' : '') . '
8558
+					});' : '').'
8559 8559
 
8560 8560
 				});
8561 8561
 				</script>';
@@ -8607,7 +8607,7 @@  discard block
 block discarded – undo
8607 8607
 		}
8608 8608
 
8609 8609
 		// Output select component
8610
-		$out .= '<select id="' . $htmlname . '" class="multiselect' . ($useenhancedmultiselect ? ' multiselectononeline' : '') . ($morecss ? ' ' . $morecss : '') . '" multiple name="' . $htmlname . '[]"' . ($moreattrib ? ' ' . $moreattrib : '') . ($width ? ' style="width: ' . (preg_match('/%/', $width) ? $width : $width . 'px') . '"' : '') . '>' . "\n";
8610
+		$out .= '<select id="'.$htmlname.'" class="multiselect'.($useenhancedmultiselect ? ' multiselectononeline' : '').($morecss ? ' '.$morecss : '').'" multiple name="'.$htmlname.'[]"'.($moreattrib ? ' '.$moreattrib : '').($width ? ' style="width: '.(preg_match('/%/', $width) ? $width : $width.'px').'"' : '').'>'."\n";
8611 8611
 		if (is_array($array) && !empty($array)) {
8612 8612
 			if ($value_as_key) {
8613 8613
 				$array = array_combine($array, $array);
@@ -8628,57 +8628,57 @@  discard block
 block discarded – undo
8628 8628
 						$tmplabelhtml = !empty($value['labelhtml']) ? $value['labelhtml'] : '';
8629 8629
 					}
8630 8630
 					$newval = ($translate ? $langs->trans($tmpvalue) : $tmpvalue);
8631
-					$newval = ($key_in_label ? $tmpkey . ' - ' . $newval : $newval);
8631
+					$newval = ($key_in_label ? $tmpkey.' - '.$newval : $newval);
8632 8632
 
8633
-					$out .= '<option value="' . $tmpkey . '"';
8633
+					$out .= '<option value="'.$tmpkey.'"';
8634 8634
 					if (is_array($selected) && !empty($selected) && in_array((string) $tmpkey, $selected) && ((string) $tmpkey != '')) {
8635 8635
 						$out .= ' selected';
8636 8636
 					}
8637 8637
 					if (!empty($tmplabelhtml)) {
8638
-						$out .= ' data-html="' . dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1) . '"';
8638
+						$out .= ' data-html="'.dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1).'"';
8639 8639
 					} else {
8640
-						$tmplabelhtml = ($tmppicto ? img_picto('', $tmppicto, 'class="pictofixedwidth" style="color: #' . $tmpcolor . '"') : '') . $newval;
8641
-						$out .= ' data-html="' . dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1) . '"';
8640
+						$tmplabelhtml = ($tmppicto ? img_picto('', $tmppicto, 'class="pictofixedwidth" style="color: #'.$tmpcolor.'"') : '').$newval;
8641
+						$out .= ' data-html="'.dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1).'"';
8642 8642
 					}
8643 8643
 					$out .= '>';
8644 8644
 					$out .= dol_htmlentitiesbr($newval);
8645
-					$out .= '</option>' . "\n";
8645
+					$out .= '</option>'."\n";
8646 8646
 				}
8647 8647
 			}
8648 8648
 		}
8649
-		$out .= '</select>' . "\n";
8649
+		$out .= '</select>'."\n";
8650 8650
 
8651 8651
 		// Add code for jquery to use multiselect
8652 8652
 		if (!empty($conf->use_javascript_ajax) && !empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) || defined('REQUIRE_JQUERY_MULTISELECT')) {
8653
-			$out .= "\n" . '<!-- JS CODE TO ENABLE select for id ' . $htmlname . ', addjscombo=' . $addjscombo . ' -->';
8654
-			$out .= "\n" . '<script nonce="' . getNonce() . '">' . "\n";
8653
+			$out .= "\n".'<!-- JS CODE TO ENABLE select for id '.$htmlname.', addjscombo='.$addjscombo.' -->';
8654
+			$out .= "\n".'<script nonce="'.getNonce().'">'."\n";
8655 8655
 			if ($addjscombo == 1) {
8656 8656
 				$tmpplugin = empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) ? constant('REQUIRE_JQUERY_MULTISELECT') : $conf->global->MAIN_USE_JQUERY_MULTISELECT;
8657
-				$out .= 'function formatResult(record, container) {' . "\n";
8657
+				$out .= 'function formatResult(record, container) {'."\n";
8658 8658
 				// If property html set, we decode html entities and use this.
8659 8659
 				// Note that HTML content must have been sanitized from js with dol_escape_htmltag(xxx, 0, 0, '', 0, 1) when building the select option.
8660 8660
 				$out .= '	if ($(record.element).attr("data-html") != undefined) { return htmlEntityDecodeJs($(record.element).attr("data-html")); }'."\n";
8661 8661
 				$out .= '	return record.text;';
8662
-				$out .= '}' . "\n";
8663
-				$out .= 'function formatSelection(record) {' . "\n";
8662
+				$out .= '}'."\n";
8663
+				$out .= 'function formatSelection(record) {'."\n";
8664 8664
 				if ($elemtype == 'category') {
8665
-					$out .= 'return \'<span><img src="' . DOL_URL_ROOT . '/theme/eldy/img/object_category.png"> \'+record.text+\'</span>\';';
8665
+					$out .= 'return \'<span><img src="'.DOL_URL_ROOT.'/theme/eldy/img/object_category.png"> \'+record.text+\'</span>\';';
8666 8666
 				} else {
8667 8667
 					$out .= 'return record.text;';
8668 8668
 				}
8669
-				$out .= '}' . "\n";
8669
+				$out .= '}'."\n";
8670 8670
 				$out .= '$(document).ready(function () {
8671
-							$(\'#' . $htmlname . '\').' . $tmpplugin . '({';
8671
+							$(\'#' . $htmlname.'\').'.$tmpplugin.'({';
8672 8672
 				if ($placeholder) {
8673 8673
 					$out .= '
8674 8674
 								placeholder: {
8675 8675
 								    id: \'-1\',
8676
-								    text: \'' . dol_escape_js($placeholder) . '\'
8676
+								    text: \'' . dol_escape_js($placeholder).'\'
8677 8677
 								  },';
8678 8678
 				}
8679 8679
 				$out .= '		dir: \'ltr\',
8680 8680
 								containerCssClass: \':all:\',					/* Line to add class of origin SELECT propagated to the new <span class="select2-selection...> tag (ko with multiselect) */
8681
-								dropdownCssClass: \'' . $morecss . '\',				/* Line to add class on the new <span class="select2-selection...> tag (ok with multiselect) */
8681
+								dropdownCssClass: \'' . $morecss.'\',				/* Line to add class on the new <span class="select2-selection...> tag (ok with multiselect) */
8682 8682
 								// Specify format function for dropdown item
8683 8683
 								formatResult: formatResult,
8684 8684
 							 	templateResult: formatResult,		/* For 4.0 */
@@ -8690,21 +8690,21 @@  discard block
 block discarded – undo
8690 8690
 
8691 8691
 							/* Add also morecss to the css .select2 that is after the #htmlname, for component that are show dynamically after load, because select2 set
8692 8692
 								 the size only if component is not hidden by default on load */
8693
-							$(\'#' . $htmlname . ' + .select2\').addClass(\'' . $morecss . '\');
8693
+							$(\'#' . $htmlname.' + .select2\').addClass(\''.$morecss.'\');
8694 8694
 						});' . "\n";
8695 8695
 			} elseif ($addjscombo == 2 && !defined('DISABLE_MULTISELECT')) {
8696 8696
 				// Add other js lib
8697 8697
 				// TODO external lib multiselect/jquery.multi-select.js must have been loaded to use this multiselect plugin
8698 8698
 				// ...
8699
-				$out .= 'console.log(\'addjscombo=2 for htmlname=' . $htmlname . '\');';
8699
+				$out .= 'console.log(\'addjscombo=2 for htmlname='.$htmlname.'\');';
8700 8700
 				$out .= '$(document).ready(function () {
8701
-							$(\'#' . $htmlname . '\').multiSelect({
8701
+							$(\'#' . $htmlname.'\').multiSelect({
8702 8702
 								containerHTML: \'<div class="multi-select-container">\',
8703 8703
 								menuHTML: \'<div class="multi-select-menu">\',
8704
-								buttonHTML: \'<span class="multi-select-button ' . $morecss . '">\',
8704
+								buttonHTML: \'<span class="multi-select-button ' . $morecss.'">\',
8705 8705
 								menuItemHTML: \'<label class="multi-select-menuitem">\',
8706 8706
 								activeClass: \'multi-select-container--open\',
8707
-								noneText: \'' . $placeholder . '\'
8707
+								noneText: \'' . $placeholder.'\'
8708 8708
 							});
8709 8709
 						})';
8710 8710
 			}
@@ -8736,7 +8736,7 @@  discard block
 block discarded – undo
8736 8736
 			return '';
8737 8737
 		}
8738 8738
 
8739
-		$tmpvar = "MAIN_SELECTEDFIELDS_" . $varpage; // To get list of saved selected fields to show
8739
+		$tmpvar = "MAIN_SELECTEDFIELDS_".$varpage; // To get list of saved selected fields to show
8740 8740
 
8741 8741
 		if (!empty($user->conf->$tmpvar)) {        // A list of fields was already customized for user
8742 8742
 			$tmparray = explode(',', $user->conf->$tmpvar);
@@ -8779,19 +8779,19 @@  discard block
 block discarded – undo
8779 8779
 				}
8780 8780
 
8781 8781
 				// Note: $val['checked'] <> 0 means we must show the field into the combo list
8782
-				$listoffieldsforselection .= '<li><input type="checkbox" id="checkbox' . $key . '" value="' . $key . '"' . ((empty($val['checked']) || $val['checked'] == '-1') ? '' : ' checked="checked"') . '/><label for="checkbox' . $key . '">' . dol_escape_htmltag($langs->trans($val['label'])) . '</label></li>';
8783
-				$listcheckedstring .= (empty($val['checked']) ? '' : $key . ',');
8782
+				$listoffieldsforselection .= '<li><input type="checkbox" id="checkbox'.$key.'" value="'.$key.'"'.((empty($val['checked']) || $val['checked'] == '-1') ? '' : ' checked="checked"').'/><label for="checkbox'.$key.'">'.dol_escape_htmltag($langs->trans($val['label'])).'</label></li>';
8783
+				$listcheckedstring .= (empty($val['checked']) ? '' : $key.',');
8784 8784
 			}
8785 8785
 		}
8786 8786
 
8787
-		$out = '<!-- Component multiSelectArrayWithCheckbox ' . $htmlname . ' -->
8787
+		$out = '<!-- Component multiSelectArrayWithCheckbox '.$htmlname.' -->
8788 8788
 
8789 8789
         <dl class="dropdown">
8790 8790
             <dt>
8791
-            <a href="#' . $htmlname . '">
8792
-              ' . img_picto('', 'list') . '
8791
+            <a href="#' . $htmlname.'">
8792
+              ' . img_picto('', 'list').'
8793 8793
             </a>
8794
-            <input type="hidden" class="' . $htmlname . '" name="' . $htmlname . '" value="' . $listcheckedstring . '">
8794
+            <input type="hidden" class="' . $htmlname.'" name="'.$htmlname.'" value="'.$listcheckedstring.'">
8795 8795
             </dt>
8796 8796
             <dd class="dropdowndd">
8797 8797
                 <div class="multiselectcheckbox'.$htmlname.'">
@@ -8803,19 +8803,19 @@  discard block
 block discarded – undo
8803 8803
             </dd>
8804 8804
         </dl>
8805 8805
 
8806
-        <script nonce="' . getNonce() . '" type="text/javascript">
8806
+        <script nonce="' . getNonce().'" type="text/javascript">
8807 8807
           jQuery(document).ready(function () {
8808
-              $(\'.multiselectcheckbox' . $htmlname . ' input[type="checkbox"]\').on(\'click\', function () {
8808
+              $(\'.multiselectcheckbox' . $htmlname.' input[type="checkbox"]\').on(\'click\', function () {
8809 8809
                   console.log("A new field was added/removed, we edit field input[name=formfilteraction]");
8810 8810
 
8811 8811
                   $("input:hidden[name=formfilteraction]").val(\'listafterchangingselectedfields\');	// Update field so we know we changed something on selected fields after POST
8812 8812
 
8813 8813
                   var title = $(this).val() + ",";
8814 8814
                   if ($(this).is(\':checked\')) {
8815
-                      $(\'.' . $htmlname . '\').val(title + $(\'.' . $htmlname . '\').val());
8815
+                      $(\'.' . $htmlname.'\').val(title + $(\'.'.$htmlname.'\').val());
8816 8816
                   }
8817 8817
                   else {
8818
-                      $(\'.' . $htmlname . '\').val( $(\'.' . $htmlname . '\').val().replace(title, \'\') )
8818
+                      $(\'.' . $htmlname.'\').val( $(\'.'.$htmlname.'\').val().replace(title, \'\') )
8819 8819
                   }
8820 8820
                   // Now, we submit page
8821 8821
                   //$(this).parents(\'form:first\').submit();
@@ -8846,7 +8846,7 @@  discard block
 block discarded – undo
8846 8846
 	 */
8847 8847
 	public function showCategories($id, $type, $rendermode = 0, $nolink = 0)
8848 8848
 	{
8849
-		include_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
8849
+		include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
8850 8850
 
8851 8851
 		$cat = new Categorie($this->db);
8852 8852
 		$categories = $cat->containing($id, $type);
@@ -8856,10 +8856,10 @@  discard block
 block discarded – undo
8856 8856
 			foreach ($categories as $c) {
8857 8857
 				$ways = $c->print_all_ways(' &gt;&gt; ', ($nolink ? 'none' : ''), 0, 1); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formated text
8858 8858
 				foreach ($ways as $way) {
8859
-					$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #bbb"') . '>' . $way . '</li>';
8859
+					$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #bbb"').'>'.$way.'</li>';
8860 8860
 				}
8861 8861
 			}
8862
-			return '<div class="select2-container-multi-dolibarr"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>';
8862
+			return '<div class="select2-container-multi-dolibarr"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
8863 8863
 		}
8864 8864
 
8865 8865
 		if ($rendermode == 0) {
@@ -8907,15 +8907,15 @@  discard block
 block discarded – undo
8907 8907
 
8908 8908
 
8909 8909
 			print '<div class="div-table-responsive-no-min">';
8910
-			print '<table class="noborder allwidth" data-block="showLinkedObject" data-element="' . $object->element . '"  data-elementid="' . $object->id . '"   >';
8910
+			print '<table class="noborder allwidth" data-block="showLinkedObject" data-element="'.$object->element.'"  data-elementid="'.$object->id.'"   >';
8911 8911
 
8912 8912
 			print '<tr class="liste_titre">';
8913
-			print '<td>' . $langs->trans("Type") . '</td>';
8914
-			print '<td>' . $langs->trans("Ref") . '</td>';
8913
+			print '<td>'.$langs->trans("Type").'</td>';
8914
+			print '<td>'.$langs->trans("Ref").'</td>';
8915 8915
 			print '<td class="center"></td>';
8916
-			print '<td class="center">' . $langs->trans("Date") . '</td>';
8917
-			print '<td class="right">' . $langs->trans("AmountHTShort") . '</td>';
8918
-			print '<td class="right">' . $langs->trans("Status") . '</td>';
8916
+			print '<td class="center">'.$langs->trans("Date").'</td>';
8917
+			print '<td class="right">'.$langs->trans("AmountHTShort").'</td>';
8918
+			print '<td class="right">'.$langs->trans("Status").'</td>';
8919 8919
 			print '<td></td>';
8920 8920
 			print '</tr>';
8921 8921
 
@@ -8934,13 +8934,13 @@  discard block
 block discarded – undo
8934 8934
 				if ($objecttype != 'supplier_proposal' && preg_match('/^([^_]+)_([^_]+)/i', $objecttype, $regs)) {
8935 8935
 					$element = $regs[1];
8936 8936
 					$subelement = $regs[2];
8937
-					$tplpath = $element . '/' . $subelement;
8937
+					$tplpath = $element.'/'.$subelement;
8938 8938
 				}
8939 8939
 				$tplname = 'linkedobjectblock';
8940 8940
 
8941 8941
 				// To work with non standard path
8942 8942
 				if ($objecttype == 'facture') {
8943
-					$tplpath = 'compta/' . $element;
8943
+					$tplpath = 'compta/'.$element;
8944 8944
 					if (!isModEnabled('facture')) {
8945 8945
 						continue; // Do not show if module disabled
8946 8946
 					}
@@ -8951,7 +8951,7 @@  discard block
 block discarded – undo
8951 8951
 						continue; // Do not show if module disabled
8952 8952
 					}
8953 8953
 				} elseif ($objecttype == 'propal') {
8954
-					$tplpath = 'comm/' . $element;
8954
+					$tplpath = 'comm/'.$element;
8955 8955
 					if (!isModEnabled('propal')) {
8956 8956
 						continue; // Do not show if module disabled
8957 8957
 					}
@@ -9002,14 +9002,14 @@  discard block
 block discarded – undo
9002 9002
 				$linkedObjectBlock = $objects;
9003 9003
 
9004 9004
 				// Output template part (modules that overwrite templates must declare this into descriptor)
9005
-				$dirtpls = array_merge($conf->modules_parts['tpl'], array('/' . $tplpath . '/tpl'));
9005
+				$dirtpls = array_merge($conf->modules_parts['tpl'], array('/'.$tplpath.'/tpl'));
9006 9006
 				foreach ($dirtpls as $reldir) {
9007 9007
 					if ($nboftypesoutput == ($nbofdifferenttypes - 1)) {    // No more type to show after
9008 9008
 						global $noMoreLinkedObjectBlockAfter;
9009 9009
 						$noMoreLinkedObjectBlockAfter = 1;
9010 9010
 					}
9011 9011
 
9012
-					$res = @include dol_buildpath($reldir . '/' . $tplname . '.tpl.php');
9012
+					$res = @include dol_buildpath($reldir.'/'.$tplname.'.tpl.php');
9013 9013
 					if ($res) {
9014 9014
 						$nboftypesoutput++;
9015 9015
 						break;
@@ -9018,7 +9018,7 @@  discard block
 block discarded – undo
9018 9018
 			}
9019 9019
 
9020 9020
 			if (!$nboftypesoutput) {
9021
-				print '<tr><td class="impair" colspan="7"><span class="opacitymedium">' . $langs->trans("None") . '</span></td></tr>';
9021
+				print '<tr><td class="impair" colspan="7"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
9022 9022
 			}
9023 9023
 
9024 9024
 			print '</table>';
@@ -9058,14 +9058,14 @@  discard block
 block discarded – undo
9058 9058
 		if (is_object($object->thirdparty) && !empty($object->thirdparty->id) && $object->thirdparty->id > 0) {
9059 9059
 			$listofidcompanytoscan = $object->thirdparty->id;
9060 9060
 			if (($object->thirdparty->parent > 0) && !empty($conf->global->THIRDPARTY_INCLUDE_PARENT_IN_LINKTO)) {
9061
-				$listofidcompanytoscan .= ',' . $object->thirdparty->parent;
9061
+				$listofidcompanytoscan .= ','.$object->thirdparty->parent;
9062 9062
 			}
9063 9063
 			if (($object->fk_project > 0) && !empty($conf->global->THIRDPARTY_INCLUDE_PROJECT_THIRDPARY_IN_LINKTO)) {
9064
-				include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
9064
+				include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
9065 9065
 				$tmpproject = new Project($this->db);
9066 9066
 				$tmpproject->fetch($object->fk_project);
9067 9067
 				if ($tmpproject->socid > 0 && ($tmpproject->socid != $object->thirdparty->id)) {
9068
-					$listofidcompanytoscan .= ',' . $tmpproject->socid;
9068
+					$listofidcompanytoscan .= ','.$tmpproject->socid;
9069 9069
 				}
9070 9070
 				unset($tmpproject);
9071 9071
 			}
@@ -9075,63 +9075,63 @@  discard block
 block discarded – undo
9075 9075
 					'enabled' => isModEnabled('propal'),
9076 9076
 					'perms' => 1,
9077 9077
 					'label' => 'LinkToProposal',
9078
-					'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') . ')'),
9078
+					'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').')'),
9079 9079
 				'shipping' => array(
9080 9080
 					'enabled' => isModEnabled('expedition'),
9081 9081
 					'perms' => 1,
9082 9082
 					'label' => 'LinkToExpedition',
9083
-					'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') . ')'),
9083
+					'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').')'),
9084 9084
 				'order' => array(
9085 9085
 					'enabled' => isModEnabled('commande'),
9086 9086
 					'perms' => 1,
9087 9087
 					'label' => 'LinkToOrder',
9088
-					'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') . ')'),
9088
+					'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').')'),
9089 9089
 				'invoice' => array(
9090 9090
 					'enabled' => isModEnabled('facture'),
9091 9091
 					'perms' => 1,
9092 9092
 					'label' => 'LinkToInvoice',
9093
-					'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') . ')'),
9093
+					'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').')'),
9094 9094
 				'invoice_template' => array(
9095 9095
 					'enabled' => isModEnabled('facture'),
9096 9096
 					'perms' => 1,
9097 9097
 					'label' => 'LinkToTemplateInvoice',
9098
-					'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') . ')'),
9098
+					'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').')'),
9099 9099
 				'contrat' => array(
9100 9100
 					'enabled' => isModEnabled('contrat'),
9101 9101
 					'perms' => 1,
9102 9102
 					'label' => 'LinkToContract',
9103 9103
 					'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
9104
-							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'
9104
+							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'
9105 9105
 				),
9106 9106
 				'fichinter' => array(
9107 9107
 					'enabled' => isModEnabled('ficheinter'),
9108 9108
 					'perms' => 1,
9109 9109
 					'label' => 'LinkToIntervention',
9110
-					'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') . ')'),
9110
+					'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').')'),
9111 9111
 				'supplier_proposal' => array(
9112 9112
 					'enabled' => (isModEnabled('supplier_proposal') ? $conf->supplier_proposal->enabled : 0),
9113 9113
 					'perms' => 1,
9114 9114
 					'label' => 'LinkToSupplierProposal',
9115
-					'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') . ')'),
9115
+					'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').')'),
9116 9116
 				'order_supplier' => array(
9117 9117
 					'enabled' => (isModEnabled("supplier_order") ? $conf->supplier_order->enabled : 0),
9118 9118
 					'perms' => 1,
9119 9119
 					'label' => 'LinkToSupplierOrder',
9120
-					'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') . ')'),
9120
+					'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').')'),
9121 9121
 				'invoice_supplier' => array(
9122 9122
 					'enabled' => (isModEnabled("supplier_invoice") ? $conf->supplier_invoice->enabled : 0),
9123 9123
 					'perms' => 1, 'label' => 'LinkToSupplierInvoice',
9124
-					'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') . ')'),
9124
+					'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').')'),
9125 9125
 				'ticket' => array(
9126 9126
 					'enabled' => isModEnabled('ticket'),
9127 9127
 					'perms' => 1,
9128 9128
 					'label' => 'LinkToTicket',
9129
-					'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') . ')'),
9129
+					'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').')'),
9130 9130
 				'mo' => array(
9131 9131
 					'enabled' => isModEnabled('mrp'),
9132 9132
 					'perms' => 1,
9133 9133
 					'label' => 'LinkToMo',
9134
-					'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') . ')')
9134
+					'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').')')
9135 9135
 			);
9136 9136
 		}
9137 9137
 
@@ -9166,22 +9166,22 @@  discard block
 block discarded – undo
9166 9166
 			}
9167 9167
 
9168 9168
 			if (!empty($possiblelink['perms']) && (empty($restrictlinksto) || in_array($key, $restrictlinksto)) && (empty($excludelinksto) || !in_array($key, $excludelinksto))) {
9169
-				print '<div id="' . $key . 'list"' . (empty($conf->use_javascript_ajax) ? '' : ' style="display:none"') . '>';
9169
+				print '<div id="'.$key.'list"'.(empty($conf->use_javascript_ajax) ? '' : ' style="display:none"').'>';
9170 9170
 
9171 9171
 				if (!empty($conf->global->MAIN_LINK_BY_REF_IN_LINKTO)) {
9172 9172
 					print '<br>'."\n";
9173 9173
 					print '<!-- form to add a link from anywhere -->'."\n";
9174
-					print '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST" name="formlinkedbyref' . $key . '">';
9175
-					print '<input type="hidden" name="id" value="' . $object->id . '">';
9174
+					print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" name="formlinkedbyref'.$key.'">';
9175
+					print '<input type="hidden" name="id" value="'.$object->id.'">';
9176 9176
 					print '<input type="hidden" name="action" value="addlinkbyref">';
9177
-					print '<input type="hidden" name="token" value="' . newToken() . '">';
9178
-					print '<input type="hidden" name="addlink" value="' . $key . '">';
9177
+					print '<input type="hidden" name="token" value="'.newToken().'">';
9178
+					print '<input type="hidden" name="addlink" value="'.$key.'">';
9179 9179
 					print '<table class="noborder">';
9180 9180
 					print '<tr>';
9181 9181
 					//print '<td>' . $langs->trans("Ref") . '</td>';
9182
-					print '<td class="center"><input type="text" placeholder="'.dol_escape_htmltag($langs->trans("Ref")).'" name="reftolinkto" value="' . dol_escape_htmltag(GETPOST('reftolinkto', 'alpha')) . '">&nbsp;';
9183
-					print '<input type="submit" class="button small valignmiddle" value="' . $langs->trans('ToLink') . '">&nbsp;';
9184
-					print '<input type="submit" class="button small" name="cancel" value="' . $langs->trans('Cancel') . '"></td>';
9182
+					print '<td class="center"><input type="text" placeholder="'.dol_escape_htmltag($langs->trans("Ref")).'" name="reftolinkto" value="'.dol_escape_htmltag(GETPOST('reftolinkto', 'alpha')).'">&nbsp;';
9183
+					print '<input type="submit" class="button small valignmiddle" value="'.$langs->trans('ToLink').'">&nbsp;';
9184
+					print '<input type="submit" class="button small" name="cancel" value="'.$langs->trans('Cancel').'"></td>';
9185 9185
 					print '</tr>';
9186 9186
 					print '</table>';
9187 9187
 					print '</form>';
@@ -9196,48 +9196,48 @@  discard block
 block discarded – undo
9196 9196
 
9197 9197
 					print '<br>';
9198 9198
 					print '<!-- form to add a link from object to same thirdparty -->'."\n";
9199
-					print '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST" name="formlinked' . $key . '">';
9199
+					print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" name="formlinked'.$key.'">';
9200 9200
 					print '<input type="hidden" name="action" value="addlink">';
9201
-					print '<input type="hidden" name="token" value="' . newToken() . '">';
9202
-					print '<input type="hidden" name="id" value="' . $object->id . '">';
9203
-					print '<input type="hidden" name="addlink" value="' . $key . '">';
9201
+					print '<input type="hidden" name="token" value="'.newToken().'">';
9202
+					print '<input type="hidden" name="id" value="'.$object->id.'">';
9203
+					print '<input type="hidden" name="addlink" value="'.$key.'">';
9204 9204
 					print '<table class="noborder">';
9205 9205
 					print '<tr class="liste_titre">';
9206 9206
 					print '<td class="nowrap"></td>';
9207
-					print '<td class="center">' . $langs->trans("Ref") . '</td>';
9208
-					print '<td class="left">' . $langs->trans("RefCustomer") . '</td>';
9209
-					print '<td class="right">' . $langs->trans("AmountHTShort") . '</td>';
9210
-					print '<td class="left">' . $langs->trans("Company") . '</td>';
9207
+					print '<td class="center">'.$langs->trans("Ref").'</td>';
9208
+					print '<td class="left">'.$langs->trans("RefCustomer").'</td>';
9209
+					print '<td class="right">'.$langs->trans("AmountHTShort").'</td>';
9210
+					print '<td class="left">'.$langs->trans("Company").'</td>';
9211 9211
 					print '</tr>';
9212 9212
 					while ($i < $num) {
9213 9213
 						$objp = $this->db->fetch_object($resqllist);
9214 9214
 
9215 9215
 						print '<tr class="oddeven">';
9216 9216
 						print '<td class="left">';
9217
-						print '<input type="radio" name="idtolinkto" id="' . $key . '_' . $objp->rowid . '" value="' . $objp->rowid . '">';
9217
+						print '<input type="radio" name="idtolinkto" id="'.$key.'_'.$objp->rowid.'" value="'.$objp->rowid.'">';
9218 9218
 						print '</td>';
9219
-						print '<td class="center"><label for="' . $key . '_' . $objp->rowid . '">' . $objp->ref . '</label></td>';
9220
-						print '<td>' . (!empty($objp->ref_client) ? $objp->ref_client : (!empty($objp->ref_supplier) ? $objp->ref_supplier : '')) . '</td>';
9219
+						print '<td class="center"><label for="'.$key.'_'.$objp->rowid.'">'.$objp->ref.'</label></td>';
9220
+						print '<td>'.(!empty($objp->ref_client) ? $objp->ref_client : (!empty($objp->ref_supplier) ? $objp->ref_supplier : '')).'</td>';
9221 9221
 						print '<td class="right">';
9222 9222
 						if ($possiblelink['label'] == 'LinkToContract') {
9223 9223
 							$form = new Form($this->db);
9224
-							print $form->textwithpicto('', $langs->trans("InformationOnLinkToContract")) . ' ';
9224
+							print $form->textwithpicto('', $langs->trans("InformationOnLinkToContract")).' ';
9225 9225
 						}
9226
-						print '<span class="amount">' . (isset($objp->total_ht) ? price($objp->total_ht) : '') . '</span>';
9226
+						print '<span class="amount">'.(isset($objp->total_ht) ? price($objp->total_ht) : '').'</span>';
9227 9227
 						print '</td>';
9228
-						print '<td>' . $objp->name . '</td>';
9228
+						print '<td>'.$objp->name.'</td>';
9229 9229
 						print '</tr>';
9230 9230
 						$i++;
9231 9231
 					}
9232 9232
 					print '</table>';
9233 9233
 					print '<div class="center">';
9234 9234
 					if ($num) {
9235
-						print '<input type="submit" class="button valignmiddle marginleftonly marginrightonly small" value="' . $langs->trans('ToLink') . '">';
9235
+						print '<input type="submit" class="button valignmiddle marginleftonly marginrightonly small" value="'.$langs->trans('ToLink').'">';
9236 9236
 					}
9237 9237
 					if (empty($conf->use_javascript_ajax)) {
9238
-						print '<input type="submit" class="button button-cancel marginleftonly marginrightonly small" name="cancel" value="' . $langs->trans("Cancel") . '"></div>';
9238
+						print '<input type="submit" class="button button-cancel marginleftonly marginrightonly small" name="cancel" value="'.$langs->trans("Cancel").'"></div>';
9239 9239
 					} else {
9240
-						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>';
9240
+						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>';
9241 9241
 					}
9242 9242
 					print '</form>';
9243 9243
 					$this->db->free($resqllist);
@@ -9248,10 +9248,10 @@  discard block
 block discarded – undo
9248 9248
 
9249 9249
 				//$linktoelem.=($linktoelem?' &nbsp; ':'');
9250 9250
 				if ($num > 0 || !empty($conf->global->MAIN_LINK_BY_REF_IN_LINKTO)) {
9251
-					$linktoelemlist .= '<li><a href="#linkto' . $key . '" class="linkto dropdowncloseonclick" rel="' . $key . '">' . $langs->trans($possiblelink['label']) . ' (' . $num . ')</a></li>';
9251
+					$linktoelemlist .= '<li><a href="#linkto'.$key.'" class="linkto dropdowncloseonclick" rel="'.$key.'">'.$langs->trans($possiblelink['label']).' ('.$num.')</a></li>';
9252 9252
 					// } else $linktoelem.=$langs->trans($possiblelink['label']);
9253 9253
 				} else {
9254
-					$linktoelemlist .= '<li><span class="linktodisabled">' . $langs->trans($possiblelink['label']) . ' (0)</span></li>';
9254
+					$linktoelemlist .= '<li><span class="linktodisabled">'.$langs->trans($possiblelink['label']).' (0)</span></li>';
9255 9255
 				}
9256 9256
 			}
9257 9257
 		}
@@ -9261,11 +9261,11 @@  discard block
 block discarded – undo
9261 9261
     		<dl class="dropdown" id="linktoobjectname">
9262 9262
     		';
9263 9263
 			if (!empty($conf->use_javascript_ajax)) {
9264
-				$linktoelem .= '<dt><a href="#linktoobjectname"><span class="fas fa-link paddingrightonly"></span>' . $langs->trans("LinkTo") . '...</a></dt>';
9264
+				$linktoelem .= '<dt><a href="#linktoobjectname"><span class="fas fa-link paddingrightonly"></span>'.$langs->trans("LinkTo").'...</a></dt>';
9265 9265
 			}
9266 9266
 			$linktoelem .= '<dd>
9267 9267
     		<div class="multiselectlinkto">
9268
-    		<ul class="ulselectedfields">' . $linktoelemlist . '
9268
+    		<ul class="ulselectedfields">' . $linktoelemlist.'
9269 9269
     		</ul>
9270 9270
     		</div>
9271 9271
     		</dd>
@@ -9276,7 +9276,7 @@  discard block
 block discarded – undo
9276 9276
 
9277 9277
 		if (!empty($conf->use_javascript_ajax)) {
9278 9278
 			print '<!-- Add js to show linkto box -->
9279
-				<script nonce="' . getNonce() . '">
9279
+				<script nonce="' . getNonce().'">
9280 9280
 				jQuery(document).ready(function() {
9281 9281
 					jQuery(".linkto").click(function() {
9282 9282
 						console.log("We choose to show/hide links for rel="+jQuery(this).attr(\'rel\')+" so #"+jQuery(this).attr(\'rel\')+"list");
@@ -9317,19 +9317,19 @@  discard block
 block discarded – undo
9317 9317
 
9318 9318
 		$disabled = ($disabled ? ' disabled' : '');
9319 9319
 
9320
-		$resultyesno = '<select class="flat width75' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . '"' . $disabled . '>' . "\n";
9320
+		$resultyesno = '<select class="flat width75'.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.'"'.$disabled.'>'."\n";
9321 9321
 		if ($useempty) {
9322
-			$resultyesno .= '<option value="-1"' . (($value < 0) ? ' selected' : '') . '>&nbsp;</option>' . "\n";
9322
+			$resultyesno .= '<option value="-1"'.(($value < 0) ? ' selected' : '').'>&nbsp;</option>'."\n";
9323 9323
 		}
9324 9324
 		if (("$value" == 'yes') || ($value == 1)) {
9325
-			$resultyesno .= '<option value="' . $yes . '" selected>' . $langs->trans($labelyes) . '</option>' . "\n";
9326
-			$resultyesno .= '<option value="' . $no . '">' . $langs->trans($labelno) . '</option>' . "\n";
9325
+			$resultyesno .= '<option value="'.$yes.'" selected>'.$langs->trans($labelyes).'</option>'."\n";
9326
+			$resultyesno .= '<option value="'.$no.'">'.$langs->trans($labelno).'</option>'."\n";
9327 9327
 		} else {
9328 9328
 			$selected = (($useempty && $value != '0' && $value != 'no') ? '' : ' selected');
9329
-			$resultyesno .= '<option value="' . $yes . '">' . $langs->trans($labelyes) . '</option>' . "\n";
9330
-			$resultyesno .= '<option value="' . $no . '"' . $selected . '>' . $langs->trans($labelno) . '</option>' . "\n";
9329
+			$resultyesno .= '<option value="'.$yes.'">'.$langs->trans($labelyes).'</option>'."\n";
9330
+			$resultyesno .= '<option value="'.$no.'"'.$selected.'>'.$langs->trans($labelno).'</option>'."\n";
9331 9331
 		}
9332
-		$resultyesno .= '</select>' . "\n";
9332
+		$resultyesno .= '</select>'."\n";
9333 9333
 
9334 9334
 		if ($addjscombo) {
9335 9335
 			$resultyesno .= ajax_combobox($htmlname, array(), 0, 0, 'resolve', ($useempty < 0 ? (string) $useempty : '-1'), $morecss);
@@ -9353,12 +9353,12 @@  discard block
 block discarded – undo
9353 9353
 	{
9354 9354
 		// phpcs:enable
9355 9355
 		$sql = "SELECT rowid, label";
9356
-		$sql .= " FROM " . $this->db->prefix() . "export_model";
9357
-		$sql .= " WHERE type = '" . $this->db->escape($type) . "'";
9356
+		$sql .= " FROM ".$this->db->prefix()."export_model";
9357
+		$sql .= " WHERE type = '".$this->db->escape($type)."'";
9358 9358
 		$sql .= " ORDER BY rowid";
9359 9359
 		$result = $this->db->query($sql);
9360 9360
 		if ($result) {
9361
-			print '<select class="flat" id="select_' . $htmlname . '" name="' . $htmlname . '">';
9361
+			print '<select class="flat" id="select_'.$htmlname.'" name="'.$htmlname.'">';
9362 9362
 			if ($useempty) {
9363 9363
 				print '<option value="-1">&nbsp;</option>';
9364 9364
 			}
@@ -9368,9 +9368,9 @@  discard block
 block discarded – undo
9368 9368
 			while ($i < $num) {
9369 9369
 				$obj = $this->db->fetch_object($result);
9370 9370
 				if ($selected == $obj->rowid) {
9371
-					print '<option value="' . $obj->rowid . '" selected>';
9371
+					print '<option value="'.$obj->rowid.'" selected>';
9372 9372
 				} else {
9373
-					print '<option value="' . $obj->rowid . '">';
9373
+					print '<option value="'.$obj->rowid.'">';
9374 9374
 				}
9375 9375
 				print $obj->label;
9376 9376
 				print '</option>';
@@ -9460,8 +9460,8 @@  discard block
 block discarded – undo
9460 9460
 				$stringforfirstkey .= ' CTL +';
9461 9461
 			}
9462 9462
 
9463
-			$previous_ref = $object->ref_previous ? '<a accesskey="p" title="' . $stringforfirstkey . ' p" class="classfortooltip" href="' . $navurl . '?' . $paramid . '=' . urlencode($object->ref_previous) . $moreparam . '"><i class="fa fa-chevron-left"></i></a>' : '<span class="inactive"><i class="fa fa-chevron-left opacitymedium"></i></span>';
9464
-			$next_ref = $object->ref_next ? '<a accesskey="n" title="' . $stringforfirstkey . ' n" class="classfortooltip" href="' . $navurl . '?' . $paramid . '=' . urlencode($object->ref_next) . $moreparam . '"><i class="fa fa-chevron-right"></i></a>' : '<span class="inactive"><i class="fa fa-chevron-right opacitymedium"></i></span>';
9463
+			$previous_ref = $object->ref_previous ? '<a accesskey="p" title="'.$stringforfirstkey.' p" class="classfortooltip" href="'.$navurl.'?'.$paramid.'='.urlencode($object->ref_previous).$moreparam.'"><i class="fa fa-chevron-left"></i></a>' : '<span class="inactive"><i class="fa fa-chevron-left opacitymedium"></i></span>';
9464
+			$next_ref = $object->ref_next ? '<a accesskey="n" title="'.$stringforfirstkey.' n" class="classfortooltip" href="'.$navurl.'?'.$paramid.'='.urlencode($object->ref_next).$moreparam.'"><i class="fa fa-chevron-right"></i></a>' : '<span class="inactive"><i class="fa fa-chevron-right opacitymedium"></i></span>';
9465 9465
 		}
9466 9466
 
9467 9467
 		//print "xx".$previous_ref."x".$next_ref;
@@ -9469,18 +9469,18 @@  discard block
 block discarded – undo
9469 9469
 
9470 9470
 		// Right part of banner
9471 9471
 		if ($morehtmlright) {
9472
-			$ret .= '<div class="inline-block floatleft">' . $morehtmlright . '</div>';
9472
+			$ret .= '<div class="inline-block floatleft">'.$morehtmlright.'</div>';
9473 9473
 		}
9474 9474
 
9475 9475
 		if ($previous_ref || $next_ref || $morehtml) {
9476 9476
 			$ret .= '<div class="pagination paginationref"><ul class="right">';
9477 9477
 		}
9478 9478
 		if ($morehtml) {
9479
-			$ret .= '<li class="noborder litext' . (($shownav && $previous_ref && $next_ref) ? ' clearbothonsmartphone' : '') . '">' . $morehtml . '</li>';
9479
+			$ret .= '<li class="noborder litext'.(($shownav && $previous_ref && $next_ref) ? ' clearbothonsmartphone' : '').'">'.$morehtml.'</li>';
9480 9480
 		}
9481 9481
 		if ($shownav && ($previous_ref || $next_ref)) {
9482
-			$ret .= '<li class="pagination">' . $previous_ref . '</li>';
9483
-			$ret .= '<li class="pagination">' . $next_ref . '</li>';
9482
+			$ret .= '<li class="pagination">'.$previous_ref.'</li>';
9483
+			$ret .= '<li class="pagination">'.$next_ref.'</li>';
9484 9484
 		}
9485 9485
 		if ($previous_ref || $next_ref || $morehtml) {
9486 9486
 			$ret .= '</ul></div>';
@@ -9495,7 +9495,7 @@  discard block
 block discarded – undo
9495 9495
 			$morehtmlstatus = $hookmanager->resPrint;
9496 9496
 		}
9497 9497
 		if ($morehtmlstatus) {
9498
-			$ret .= '<div class="statusref">' . $morehtmlstatus . '</div>';
9498
+			$ret .= '<div class="statusref">'.$morehtmlstatus.'</div>';
9499 9499
 		}
9500 9500
 
9501 9501
 		$parameters = array();
@@ -9509,14 +9509,14 @@  discard block
 block discarded – undo
9509 9509
 		// Left part of banner
9510 9510
 		if ($morehtmlleft) {
9511 9511
 			if ($conf->browser->layout == 'phone') {
9512
-				$ret .= '<!-- morehtmlleft --><div class="floatleft">' . $morehtmlleft . '</div>';
9512
+				$ret .= '<!-- morehtmlleft --><div class="floatleft">'.$morehtmlleft.'</div>';
9513 9513
 			} else {
9514
-				$ret .= '<!-- morehtmlleft --><div class="inline-block floatleft">' . $morehtmlleft . '</div>';
9514
+				$ret .= '<!-- morehtmlleft --><div class="inline-block floatleft">'.$morehtmlleft.'</div>';
9515 9515
 			}
9516 9516
 		}
9517 9517
 
9518 9518
 		//if ($conf->browser->layout == 'phone') $ret.='<div class="clearboth"></div>';
9519
-		$ret .= '<div class="inline-block floatleft valignmiddle maxwidth750 marginbottomonly refid' . (($shownav && ($previous_ref || $next_ref)) ? ' refidpadding' : '') . '">';
9519
+		$ret .= '<div class="inline-block floatleft valignmiddle maxwidth750 marginbottomonly refid'.(($shownav && ($previous_ref || $next_ref)) ? ' refidpadding' : '').'">';
9520 9520
 
9521 9521
 		// For thirdparty, contact, user, member, the ref is the id, so we show something else
9522 9522
 		if ($object->element == 'societe') {
@@ -9530,7 +9530,7 @@  discard block
 block discarded – undo
9530 9530
 
9531 9531
 			if (is_array($arrayoflangcode) && count($arrayoflangcode)) {
9532 9532
 				if (!is_object($extralanguages)) {
9533
-					include_once DOL_DOCUMENT_ROOT . '/core/class/extralanguages.class.php';
9533
+					include_once DOL_DOCUMENT_ROOT.'/core/class/extralanguages.class.php';
9534 9534
 					$extralanguages = new ExtraLanguages($this->db);
9535 9535
 				}
9536 9536
 				$extralanguages->fetch_name_extralanguages('societe');
@@ -9545,27 +9545,27 @@  discard block
 block discarded – undo
9545 9545
 						if ($object->array_languages['name'][$extralangcode]) {
9546 9546
 							$htmltext .= $object->array_languages['name'][$extralangcode];
9547 9547
 						} else {
9548
-							$htmltext .= '<span class="opacitymedium">' . $langs->trans("SwitchInEditModeToAddTranslation") . '</span>';
9548
+							$htmltext .= '<span class="opacitymedium">'.$langs->trans("SwitchInEditModeToAddTranslation").'</span>';
9549 9549
 						}
9550 9550
 					}
9551
-					$ret .= '<!-- Show translations of name -->' . "\n";
9551
+					$ret .= '<!-- Show translations of name -->'."\n";
9552 9552
 					$ret .= $this->textwithpicto('', $htmltext, -1, 'language', 'opacitymedium paddingleft');
9553 9553
 				}
9554 9554
 			}
9555 9555
 		} elseif ($object->element == 'member') {
9556
-			$ret .= $object->ref . '<br>';
9556
+			$ret .= $object->ref.'<br>';
9557 9557
 			$fullname = $object->getFullName($langs);
9558 9558
 			if ($object->morphy == 'mor' && $object->societe) {
9559
-				$ret .= dol_htmlentities($object->societe) . ((!empty($fullname) && $object->societe != $fullname) ? ' (' . dol_htmlentities($fullname) . $addgendertxt . ')' : '');
9559
+				$ret .= dol_htmlentities($object->societe).((!empty($fullname) && $object->societe != $fullname) ? ' ('.dol_htmlentities($fullname).$addgendertxt.')' : '');
9560 9560
 			} else {
9561
-				$ret .= dol_htmlentities($fullname) . $addgendertxt . ((!empty($object->societe) && $object->societe != $fullname) ? ' (' . dol_htmlentities($object->societe) . ')' : '');
9561
+				$ret .= dol_htmlentities($fullname).$addgendertxt.((!empty($object->societe) && $object->societe != $fullname) ? ' ('.dol_htmlentities($object->societe).')' : '');
9562 9562
 			}
9563 9563
 		} elseif (in_array($object->element, array('contact', 'user'))) {
9564
-			$ret .= dol_htmlentities($object->getFullName($langs)) . $addgendertxt;
9564
+			$ret .= dol_htmlentities($object->getFullName($langs)).$addgendertxt;
9565 9565
 		} elseif ($object->element == 'usergroup') {
9566 9566
 			$ret .= dol_htmlentities($object->name);
9567 9567
 		} elseif (in_array($object->element, array('action', 'agenda'))) {
9568
-			$ret .= $object->ref . '<br>' . $object->label;
9568
+			$ret .= $object->ref.'<br>'.$object->label;
9569 9569
 		} elseif (in_array($object->element, array('adherent_type'))) {
9570 9570
 			$ret .= $object->label;
9571 9571
 		} elseif ($object->element == 'ecm_directories') {
@@ -9617,9 +9617,9 @@  discard block
 block discarded – undo
9617 9617
 		}
9618 9618
 
9619 9619
 		// Barcode image
9620
-		$url = DOL_URL_ROOT . '/viewimage.php?modulepart=barcode&generator=' . urlencode($object->barcode_type_coder) . '&code=' . urlencode($object->barcode) . '&encoding=' . urlencode($object->barcode_type_code);
9621
-		$out = '<!-- url barcode = ' . $url . ' -->';
9622
-		$out .= '<img src="' . $url . '"' . ($morecss ? ' class="' . $morecss . '"' : '') . '>';
9620
+		$url = DOL_URL_ROOT.'/viewimage.php?modulepart=barcode&generator='.urlencode($object->barcode_type_coder).'&code='.urlencode($object->barcode).'&encoding='.urlencode($object->barcode_type_code);
9621
+		$out = '<!-- url barcode = '.$url.' -->';
9622
+		$out .= '<img src="'.$url.'"'.($morecss ? ' class="'.$morecss.'"' : '').'>';
9623 9623
 
9624 9624
 		return $out;
9625 9625
 	}
@@ -9659,28 +9659,28 @@  discard block
 block discarded – undo
9659 9659
 			if (!empty($object->logo)) {
9660 9660
 				if (dolIsAllowedForPreview($object->logo)) {
9661 9661
 					if ((string) $imagesize == 'mini') {
9662
-						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . getImageFileNameForSize($object->logo, '_mini'); // getImageFileNameForSize include the thumbs
9662
+						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.getImageFileNameForSize($object->logo, '_mini'); // getImageFileNameForSize include the thumbs
9663 9663
 					} elseif ((string) $imagesize == 'small') {
9664
-						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . getImageFileNameForSize($object->logo, '_small');
9664
+						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.getImageFileNameForSize($object->logo, '_small');
9665 9665
 					} else {
9666
-						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . $object->logo;
9666
+						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.$object->logo;
9667 9667
 					}
9668
-					$originalfile = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . $object->logo;
9668
+					$originalfile = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.$object->logo;
9669 9669
 				}
9670 9670
 			}
9671 9671
 			$email = $object->email;
9672 9672
 		} elseif ($modulepart == 'contact') {
9673
-			$dir = $conf->societe->multidir_output[$entity] . '/contact';
9673
+			$dir = $conf->societe->multidir_output[$entity].'/contact';
9674 9674
 			if (!empty($object->photo)) {
9675 9675
 				if (dolIsAllowedForPreview($object->photo)) {
9676 9676
 					if ((string) $imagesize == 'mini') {
9677
-						$file = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . getImageFileNameForSize($object->photo, '_mini');
9677
+						$file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.getImageFileNameForSize($object->photo, '_mini');
9678 9678
 					} elseif ((string) $imagesize == 'small') {
9679
-						$file = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . getImageFileNameForSize($object->photo, '_small');
9679
+						$file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.getImageFileNameForSize($object->photo, '_small');
9680 9680
 					} else {
9681
-						$file = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . $object->photo;
9681
+						$file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.$object->photo;
9682 9682
 					}
9683
-					$originalfile = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . $object->photo;
9683
+					$originalfile = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.$object->photo;
9684 9684
 				}
9685 9685
 			}
9686 9686
 			$email = $object->email;
@@ -9690,17 +9690,17 @@  discard block
 block discarded – undo
9690 9690
 			if (!empty($object->photo)) {
9691 9691
 				if (dolIsAllowedForPreview($object->photo)) {
9692 9692
 					if ((string) $imagesize == 'mini') {
9693
-						$file = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . getImageFileNameForSize($object->photo, '_mini');
9693
+						$file = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.getImageFileNameForSize($object->photo, '_mini');
9694 9694
 					} elseif ((string) $imagesize == 'small') {
9695
-						$file = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . getImageFileNameForSize($object->photo, '_small');
9695
+						$file = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.getImageFileNameForSize($object->photo, '_small');
9696 9696
 					} else {
9697
-						$file = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . $object->photo;
9697
+						$file = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.$object->photo;
9698 9698
 					}
9699
-					$originalfile = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . $object->photo;
9699
+					$originalfile = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.$object->photo;
9700 9700
 				}
9701 9701
 			}
9702 9702
 			if (!empty($conf->global->MAIN_OLD_IMAGE_LINKS)) {
9703
-				$altfile = $object->id . ".jpg"; // For backward compatibility
9703
+				$altfile = $object->id.".jpg"; // For backward compatibility
9704 9704
 			}
9705 9705
 			$email = $object->email;
9706 9706
 			$capture = 'user';
@@ -9709,17 +9709,17 @@  discard block
 block discarded – undo
9709 9709
 			if (!empty($object->photo)) {
9710 9710
 				if (dolIsAllowedForPreview($object->photo)) {
9711 9711
 					if ((string) $imagesize == 'mini') {
9712
-						$file = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . getImageFileNameForSize($object->photo, '_mini');
9712
+						$file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_mini');
9713 9713
 					} elseif ((string) $imagesize == 'small') {
9714
-						$file = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . getImageFileNameForSize($object->photo, '_small');
9714
+						$file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_small');
9715 9715
 					} else {
9716
-						$file = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . $object->photo;
9716
+						$file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.$object->photo;
9717 9717
 					}
9718
-					$originalfile = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . $object->photo;
9718
+					$originalfile = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.$object->photo;
9719 9719
 				}
9720 9720
 			}
9721 9721
 			if (!empty($conf->global->MAIN_OLD_IMAGE_LINKS)) {
9722
-				$altfile = $object->id . ".jpg"; // For backward compatibility
9722
+				$altfile = $object->id.".jpg"; // For backward compatibility
9723 9723
 			}
9724 9724
 			$email = $object->email;
9725 9725
 			$capture = 'user';
@@ -9729,17 +9729,17 @@  discard block
 block discarded – undo
9729 9729
 			if (!empty($object->photo)) {
9730 9730
 				if (dolIsAllowedForPreview($object->photo)) {
9731 9731
 					if ((string) $imagesize == 'mini') {
9732
-						$file = get_exdir($id, 2, 0, 0, $object, $modulepart) . 'photos/' . getImageFileNameForSize($object->photo, '_mini');
9732
+						$file = get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.getImageFileNameForSize($object->photo, '_mini');
9733 9733
 					} elseif ((string) $imagesize == 'small') {
9734
-						$file = get_exdir($id, 2, 0, 0, $object, $modulepart) . 'photos/' . getImageFileNameForSize($object->photo, '_small');
9734
+						$file = get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.getImageFileNameForSize($object->photo, '_small');
9735 9735
 					} else {
9736
-						$file = get_exdir($id, 2, 0, 0, $object, $modulepart) . 'photos/' . $object->photo;
9736
+						$file = get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.$object->photo;
9737 9737
 					}
9738
-					$originalfile = get_exdir($id, 2, 0, 0, $object, $modulepart) . 'photos/' . $object->photo;
9738
+					$originalfile = get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.$object->photo;
9739 9739
 				}
9740 9740
 			}
9741 9741
 			if (!empty($conf->global->MAIN_OLD_IMAGE_LINKS)) {
9742
-				$altfile = $object->id . ".jpg"; // For backward compatibility
9742
+				$altfile = $object->id.".jpg"; // For backward compatibility
9743 9743
 			}
9744 9744
 			$email = $object->email;
9745 9745
 		}
@@ -9749,35 +9749,35 @@  discard block
 block discarded – undo
9749 9749
 		}
9750 9750
 
9751 9751
 		if ($dir) {
9752
-			if ($file && file_exists($dir . "/" . $file)) {
9752
+			if ($file && file_exists($dir."/".$file)) {
9753 9753
 				if ($addlinktofullsize) {
9754
-					$urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity=' . $entity);
9754
+					$urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity='.$entity);
9755 9755
 					if ($urladvanced) {
9756
-						$ret .= '<a href="' . $urladvanced . '">';
9756
+						$ret .= '<a href="'.$urladvanced.'">';
9757 9757
 					} else {
9758
-						$ret .= '<a href="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($originalfile) . '&cache=' . $cache . '">';
9758
+						$ret .= '<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($originalfile).'&cache='.$cache.'">';
9759 9759
 					}
9760 9760
 				}
9761
-				$ret .= '<img alt="Photo" class="photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . ' photologo' . (preg_replace('/[^a-z]/i', '_', $file)) . '" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . ' src="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($file) . '&cache=' . $cache . '">';
9761
+				$ret .= '<img alt="Photo" class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').' photologo'.(preg_replace('/[^a-z]/i', '_', $file)).'" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').' src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($file).'&cache='.$cache.'">';
9762 9762
 				if ($addlinktofullsize) {
9763 9763
 					$ret .= '</a>';
9764 9764
 				}
9765
-			} elseif ($altfile && file_exists($dir . "/" . $altfile)) {
9765
+			} elseif ($altfile && file_exists($dir."/".$altfile)) {
9766 9766
 				if ($addlinktofullsize) {
9767
-					$urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity=' . $entity);
9767
+					$urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity='.$entity);
9768 9768
 					if ($urladvanced) {
9769
-						$ret .= '<a href="' . $urladvanced . '">';
9769
+						$ret .= '<a href="'.$urladvanced.'">';
9770 9770
 					} else {
9771
-						$ret .= '<a href="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($originalfile) . '&cache=' . $cache . '">';
9771
+						$ret .= '<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($originalfile).'&cache='.$cache.'">';
9772 9772
 					}
9773 9773
 				}
9774
-				$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 . '">';
9774
+				$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.'">';
9775 9775
 				if ($addlinktofullsize) {
9776 9776
 					$ret .= '</a>';
9777 9777
 				}
9778 9778
 			} else {
9779 9779
 				$nophoto = '/public/theme/common/nophoto.png';
9780
-				$defaultimg = 'identicon';        // For gravatar
9780
+				$defaultimg = 'identicon'; // For gravatar
9781 9781
 				if (in_array($modulepart, array('societe', 'userphoto', 'contact', 'memberphoto'))) {    // For modules that need a special image when photo not found
9782 9782
 					if ($modulepart == 'societe' || ($modulepart == 'memberphoto' && !empty($object->morphy) && strpos($object->morphy, 'mor')) !== false) {
9783 9783
 						$nophoto = 'company';
@@ -9795,13 +9795,13 @@  discard block
 block discarded – undo
9795 9795
 				if (isModEnabled('gravatar') && $email && empty($noexternsourceoverwrite)) {
9796 9796
 					// see https://gravatar.com/site/implement/images/php/
9797 9797
 					$ret .= '<!-- Put link to gravatar -->';
9798
-					$ret .= '<img class="photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="" title="' . $email . ' Gravatar avatar" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . ' src="https://www.gravatar.com/avatar/' . md5(strtolower(trim($email))) . '?s=' . $width . '&d=' . $defaultimg . '">'; // gravatar need md5 hash
9798
+					$ret .= '<img class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="" title="'.$email.' Gravatar avatar" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').' src="https://www.gravatar.com/avatar/'.md5(strtolower(trim($email))).'?s='.$width.'&d='.$defaultimg.'">'; // gravatar need md5 hash
9799 9799
 				} else {
9800 9800
 					if ($nophoto == 'company') {
9801
-						$ret .= '<div class="divforspanimg photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . '>' . img_picto('', 'company') . '</div>';
9801
+						$ret .= '<div class="divforspanimg photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').'>'.img_picto('', 'company').'</div>';
9802 9802
 						$ret .= '<div class="difforspanimgright"></div>';
9803 9803
 					} else {
9804
-						$ret .= '<img class="photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . ' src="' . DOL_URL_ROOT . $nophoto . '">';
9804
+						$ret .= '<img class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').' src="'.DOL_URL_ROOT.$nophoto.'">';
9805 9805
 					}
9806 9806
 				}
9807 9807
 			}
@@ -9812,20 +9812,20 @@  discard block
 block discarded – undo
9812 9812
 				}
9813 9813
 				$ret .= '<table class="nobordernopadding centpercent">';
9814 9814
 				if ($object->photo) {
9815
-					$ret .= '<tr><td><input type="checkbox" class="flat photodelete" name="deletephoto" id="photodelete"> <label for="photodelete">' . $langs->trans("Delete") . '</label><br><br></td></tr>';
9815
+					$ret .= '<tr><td><input type="checkbox" class="flat photodelete" name="deletephoto" id="photodelete"> <label for="photodelete">'.$langs->trans("Delete").'</label><br><br></td></tr>';
9816 9816
 				}
9817 9817
 				$ret .= '<tr><td class="tdoverflow">';
9818 9818
 				$maxfilesizearray = getMaxFileSizeArray();
9819 9819
 				$maxmin = $maxfilesizearray['maxmin'];
9820 9820
 				if ($maxmin > 0) {
9821
-					$ret .= '<input type="hidden" name="MAX_FILE_SIZE" value="' . ($maxmin * 1024) . '">';    // MAX_FILE_SIZE must precede the field type=file
9821
+					$ret .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file
9822 9822
 				}
9823
-				$ret .= '<input type="file" class="flat maxwidth200onsmartphone" name="photo" id="photoinput" accept="image/*"' . ($capture ? ' capture="' . $capture . '"' : '') . '>';
9823
+				$ret .= '<input type="file" class="flat maxwidth200onsmartphone" name="photo" id="photoinput" accept="image/*"'.($capture ? ' capture="'.$capture.'"' : '').'>';
9824 9824
 				$ret .= '</td></tr>';
9825 9825
 				$ret .= '</table>';
9826 9826
 			}
9827 9827
 		} else {
9828
-			dol_print_error('', 'Call of showphoto with wrong parameters modulepart=' . $modulepart);
9828
+			dol_print_error('', 'Call of showphoto with wrong parameters modulepart='.$modulepart);
9829 9829
 		}
9830 9830
 
9831 9831
 		return $ret;
@@ -9876,38 +9876,38 @@  discard block
 block discarded – undo
9876 9876
 		if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) {
9877 9877
 			$sql .= ", e.label";
9878 9878
 		}
9879
-		$sql .= " FROM " . $this->db->prefix() . "usergroup as ug ";
9879
+		$sql .= " FROM ".$this->db->prefix()."usergroup as ug ";
9880 9880
 		if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) {
9881
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "entity as e ON e.rowid=ug.entity";
9881
+			$sql .= " LEFT JOIN ".$this->db->prefix()."entity as e ON e.rowid=ug.entity";
9882 9882
 			if ($force_entity) {
9883
-				$sql .= " WHERE ug.entity IN (0, " . $force_entity . ")";
9883
+				$sql .= " WHERE ug.entity IN (0, ".$force_entity.")";
9884 9884
 			} else {
9885 9885
 				$sql .= " WHERE ug.entity IS NOT NULL";
9886 9886
 			}
9887 9887
 		} else {
9888
-			$sql .= " WHERE ug.entity IN (0, " . $conf->entity . ")";
9888
+			$sql .= " WHERE ug.entity IN (0, ".$conf->entity.")";
9889 9889
 		}
9890 9890
 		if (is_array($exclude) && $excludeGroups) {
9891
-			$sql .= " AND ug.rowid NOT IN (" . $this->db->sanitize($excludeGroups) . ")";
9891
+			$sql .= " AND ug.rowid NOT IN (".$this->db->sanitize($excludeGroups).")";
9892 9892
 		}
9893 9893
 		if (is_array($include) && $includeGroups) {
9894
-			$sql .= " AND ug.rowid IN (" . $this->db->sanitize($includeGroups) . ")";
9894
+			$sql .= " AND ug.rowid IN (".$this->db->sanitize($includeGroups).")";
9895 9895
 		}
9896 9896
 		$sql .= " ORDER BY ug.nom ASC";
9897 9897
 
9898
-		dol_syslog(get_class($this) . "::select_dolgroups", LOG_DEBUG);
9898
+		dol_syslog(get_class($this)."::select_dolgroups", LOG_DEBUG);
9899 9899
 		$resql = $this->db->query($sql);
9900 9900
 		if ($resql) {
9901 9901
 			// Enhance with select2
9902
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
9902
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
9903 9903
 
9904
-			$out .= '<select class="flat minwidth200' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . ' ' . ($disabled ? ' disabled' : '') . '>';
9904
+			$out .= '<select class="flat minwidth200'.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.($disabled ? ' disabled' : '').'>';
9905 9905
 
9906 9906
 			$num = $this->db->num_rows($resql);
9907 9907
 			$i = 0;
9908 9908
 			if ($num) {
9909 9909
 				if ($show_empty && !$multiple) {
9910
-					$out .= '<option value="-1"' . (in_array(-1, $selected) ? ' selected' : '') . '>&nbsp;</option>' . "\n";
9910
+					$out .= '<option value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'>&nbsp;</option>'."\n";
9911 9911
 				}
9912 9912
 
9913 9913
 				while ($i < $num) {
@@ -9917,7 +9917,7 @@  discard block
 block discarded – undo
9917 9917
 						$disableline = 1;
9918 9918
 					}
9919 9919
 
9920
-					$out .= '<option value="' . $obj->rowid . '"';
9920
+					$out .= '<option value="'.$obj->rowid.'"';
9921 9921
 					if ($disableline) {
9922 9922
 						$out .= ' disabled';
9923 9923
 					}
@@ -9928,7 +9928,7 @@  discard block
 block discarded – undo
9928 9928
 
9929 9929
 					$out .= $obj->name;
9930 9930
 					if (isModEnabled('multicompany') && empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) && $conf->entity == 1) {
9931
-						$out .= " (" . $obj->label . ")";
9931
+						$out .= " (".$obj->label.")";
9932 9932
 					}
9933 9933
 
9934 9934
 					$out .= '</option>';
@@ -9936,9 +9936,9 @@  discard block
 block discarded – undo
9936 9936
 				}
9937 9937
 			} else {
9938 9938
 				if ($show_empty) {
9939
-					$out .= '<option value="-1"' . (in_array(-1, $selected) ? ' selected' : '') . '></option>' . "\n";
9939
+					$out .= '<option value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'></option>'."\n";
9940 9940
 				}
9941
-				$out .= '<option value="" disabled>' . $langs->trans("NoUserGroupDefined") . '</option>';
9941
+				$out .= '<option value="" disabled>'.$langs->trans("NoUserGroupDefined").'</option>';
9942 9942
 			}
9943 9943
 			$out .= '</select>';
9944 9944
 
@@ -9987,25 +9987,25 @@  discard block
 block discarded – undo
9987 9987
 		$out = '';
9988 9988
 
9989 9989
 		if (!empty($conf->use_javascript_ajax)) {
9990
-			$out .= '<div class="inline-block checkallactions"><input type="checkbox" id="' . $cssclass . 's" name="' . $cssclass . 's" class="checkallactions"></div>';
9990
+			$out .= '<div class="inline-block checkallactions"><input type="checkbox" id="'.$cssclass.'s" name="'.$cssclass.'s" class="checkallactions"></div>';
9991 9991
 		}
9992
-		$out .= '<script nonce="' . getNonce() . '">
9992
+		$out .= '<script nonce="'.getNonce().'">
9993 9993
             $(document).ready(function() {
9994
-                $("#' . $cssclass . 's").click(function() {
9994
+                $("#' . $cssclass.'s").click(function() {
9995 9995
                     if($(this).is(\':checked\')){
9996
-                        console.log("We check all ' . $cssclass . ' and trigger the change method");
9997
-                		$(".' . $cssclass . '").prop(\'checked\', true).trigger(\'change\');
9996
+                        console.log("We check all ' . $cssclass.' and trigger the change method");
9997
+                		$(".' . $cssclass.'").prop(\'checked\', true).trigger(\'change\');
9998 9998
                     }
9999 9999
                     else
10000 10000
                     {
10001 10001
                         console.log("We uncheck all");
10002
-                		$(".' . $cssclass . '").prop(\'checked\', false).trigger(\'change\');
10002
+                		$(".' . $cssclass.'").prop(\'checked\', false).trigger(\'change\');
10003 10003
                     }' . "\n";
10004 10004
 		if ($calljsfunction) {
10005
-			$out .= 'if (typeof initCheckForSelect == \'function\') { initCheckForSelect(0, "' . $massactionname . '", "' . $cssclass . '"); } else { console.log("No function initCheckForSelect found. Call won\'t be done."); }';
10005
+			$out .= 'if (typeof initCheckForSelect == \'function\') { initCheckForSelect(0, "'.$massactionname.'", "'.$cssclass.'"); } else { console.log("No function initCheckForSelect found. Call won\'t be done."); }';
10006 10006
 		}
10007 10007
 		$out .= '         });
10008
-        	        $(".' . $cssclass . '").change(function() {
10008
+        	        $(".' . $cssclass.'").change(function() {
10009 10009
 					$(this).closest("tr").toggleClass("highlight", this.checked);
10010 10010
 				});
10011 10011
 		 	});
@@ -10050,67 +10050,67 @@  discard block
 block discarded – undo
10050 10050
 		global $langs, $user;
10051 10051
 
10052 10052
 		$out = '';
10053
-		$sql = "SELECT rowid, label FROM " . $this->db->prefix() . "c_exp_tax_cat WHERE active = 1";
10054
-		$sql .= " AND entity IN (0," . getEntity('exp_tax_cat') . ")";
10053
+		$sql = "SELECT rowid, label FROM ".$this->db->prefix()."c_exp_tax_cat WHERE active = 1";
10054
+		$sql .= " AND entity IN (0,".getEntity('exp_tax_cat').")";
10055 10055
 		if (!empty($excludeid)) {
10056
-			$sql .= " AND rowid NOT IN (" . $this->db->sanitize(implode(',', $excludeid)) . ")";
10056
+			$sql .= " AND rowid NOT IN (".$this->db->sanitize(implode(',', $excludeid)).")";
10057 10057
 		}
10058 10058
 		$sql .= " ORDER BY label";
10059 10059
 
10060 10060
 		$resql = $this->db->query($sql);
10061 10061
 		if ($resql) {
10062
-			$out = '<select id="select_' . $htmlname . '" name="' . $htmlname . '" class="' . $htmlname . ' flat minwidth75imp maxwidth200">';
10062
+			$out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp maxwidth200">';
10063 10063
 			if ($useempty) {
10064 10064
 				$out .= '<option value="0">&nbsp;</option>';
10065 10065
 			}
10066 10066
 
10067 10067
 			while ($obj = $this->db->fetch_object($resql)) {
10068
-				$out .= '<option ' . ($selected == $obj->rowid ? 'selected="selected"' : '') . ' value="' . $obj->rowid . '">' . $langs->trans($obj->label) . '</option>';
10068
+				$out .= '<option '.($selected == $obj->rowid ? 'selected="selected"' : '').' value="'.$obj->rowid.'">'.$langs->trans($obj->label).'</option>';
10069 10069
 			}
10070 10070
 			$out .= '</select>';
10071
-			$out .= ajax_combobox('select_' . $htmlname);
10071
+			$out .= ajax_combobox('select_'.$htmlname);
10072 10072
 
10073 10073
 			if (!empty($htmlname) && $user->admin && $info_admin) {
10074
-				$out .= ' ' . info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
10074
+				$out .= ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
10075 10075
 			}
10076 10076
 
10077 10077
 			if (!empty($target)) {
10078
-				$sql = "SELECT c.id FROM " . $this->db->prefix() . "c_type_fees as c WHERE c.code = 'EX_KME' AND c.active = 1";
10078
+				$sql = "SELECT c.id FROM ".$this->db->prefix()."c_type_fees as c WHERE c.code = 'EX_KME' AND c.active = 1";
10079 10079
 				$resql = $this->db->query($sql);
10080 10080
 				if ($resql) {
10081 10081
 					if ($this->db->num_rows($resql) > 0) {
10082 10082
 						$obj = $this->db->fetch_object($resql);
10083
-						$out .= '<script nonce="' . getNonce() . '">
10083
+						$out .= '<script nonce="'.getNonce().'">
10084 10084
 							$(function() {
10085
-								$("select[name=' . $target . ']").on("change", function() {
10085
+								$("select[name=' . $target.']").on("change", function() {
10086 10086
 									var current_val = $(this).val();
10087
-									if (current_val == ' . $obj->id . ') {';
10087
+									if (current_val == ' . $obj->id.') {';
10088 10088
 						if (!empty($default_selected) || !empty($selected)) {
10089
-							$out .= '$("select[name=' . $htmlname . ']").val("' . ($default_selected > 0 ? $default_selected : $selected) . '");';
10089
+							$out .= '$("select[name='.$htmlname.']").val("'.($default_selected > 0 ? $default_selected : $selected).'");';
10090 10090
 						}
10091 10091
 
10092 10092
 						$out .= '
10093
-										$("select[name=' . $htmlname . ']").change();
10093
+										$("select[name=' . $htmlname.']").change();
10094 10094
 									}
10095 10095
 								});
10096 10096
 
10097
-								$("select[name=' . $htmlname . ']").change(function() {
10097
+								$("select[name=' . $htmlname.']").change(function() {
10098 10098
 
10099
-									if ($("select[name=' . $target . ']").val() == ' . $obj->id . ') {
10099
+									if ($("select[name=' . $target.']").val() == '.$obj->id.') {
10100 10100
 										// get price of kilometer to fill the unit price
10101 10101
 										$.ajax({
10102 10102
 											method: "POST",
10103 10103
 											dataType: "json",
10104
-											data: { fk_c_exp_tax_cat: $(this).val(), token: \'' . currentToken() . '\' },
10105
-											url: "' . (DOL_URL_ROOT . '/expensereport/ajax/ajaxik.php?' . join('&', $params)) . '",
10104
+											data: { fk_c_exp_tax_cat: $(this).val(), token: \'' . currentToken().'\' },
10105
+											url: "' . (DOL_URL_ROOT.'/expensereport/ajax/ajaxik.php?'.join('&', $params)).'",
10106 10106
 										}).done(function( data, textStatus, jqXHR ) {
10107 10107
 											console.log(data);
10108 10108
 											if (typeof data.up != "undefined") {
10109 10109
 												$("input[name=value_unit]").val(data.up);
10110
-												$("select[name=' . $htmlname . ']").attr("title", data.title);
10110
+												$("select[name=' . $htmlname.']").attr("title", data.title);
10111 10111
 											} else {
10112 10112
 												$("input[name=value_unit]").val("");
10113
-												$("select[name=' . $htmlname . ']").attr("title", "");
10113
+												$("select[name=' . $htmlname.']").attr("title", "");
10114 10114
 											}
10115 10115
 										});
10116 10116
 									}
@@ -10140,18 +10140,18 @@  discard block
 block discarded – undo
10140 10140
 		global $conf, $langs;
10141 10141
 
10142 10142
 		$out = '';
10143
-		$sql = "SELECT rowid, range_ik FROM " . $this->db->prefix() . "c_exp_tax_range";
10144
-		$sql .= " WHERE entity = " . $conf->entity . " AND active = 1";
10143
+		$sql = "SELECT rowid, range_ik FROM ".$this->db->prefix()."c_exp_tax_range";
10144
+		$sql .= " WHERE entity = ".$conf->entity." AND active = 1";
10145 10145
 
10146 10146
 		$resql = $this->db->query($sql);
10147 10147
 		if ($resql) {
10148
-			$out = '<select id="select_' . $htmlname . '" name="' . $htmlname . '" class="' . $htmlname . ' flat minwidth75imp">';
10148
+			$out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp">';
10149 10149
 			if ($useempty) {
10150 10150
 				$out .= '<option value="0"></option>';
10151 10151
 			}
10152 10152
 
10153 10153
 			while ($obj = $this->db->fetch_object($resql)) {
10154
-				$out .= '<option ' . ($selected == $obj->rowid ? 'selected="selected"' : '') . ' value="' . $obj->rowid . '">' . price($obj->range_ik, 0, $langs, 1, 0) . '</option>';
10154
+				$out .= '<option '.($selected == $obj->rowid ? 'selected="selected"' : '').' value="'.$obj->rowid.'">'.price($obj->range_ik, 0, $langs, 1, 0).'</option>';
10155 10155
 			}
10156 10156
 			$out .= '</select>';
10157 10157
 		} else {
@@ -10176,17 +10176,17 @@  discard block
 block discarded – undo
10176 10176
 		global $langs;
10177 10177
 
10178 10178
 		$out = '';
10179
-		$sql = "SELECT id, code, label FROM " . $this->db->prefix() . "c_type_fees";
10179
+		$sql = "SELECT id, code, label FROM ".$this->db->prefix()."c_type_fees";
10180 10180
 		$sql .= " WHERE active = 1";
10181 10181
 
10182 10182
 		$resql = $this->db->query($sql);
10183 10183
 		if ($resql) {
10184
-			$out = '<select id="select_' . $htmlname . '" name="' . $htmlname . '" class="' . $htmlname . ' flat minwidth75imp">';
10184
+			$out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp">';
10185 10185
 			if ($useempty) {
10186 10186
 				$out .= '<option value="0"></option>';
10187 10187
 			}
10188 10188
 			if ($allchoice) {
10189
-				$out .= '<option value="-1">' . $langs->trans('AllExpenseReport') . '</option>';
10189
+				$out .= '<option value="-1">'.$langs->trans('AllExpenseReport').'</option>';
10190 10190
 			}
10191 10191
 
10192 10192
 			$field = 'code';
@@ -10196,7 +10196,7 @@  discard block
 block discarded – undo
10196 10196
 
10197 10197
 			while ($obj = $this->db->fetch_object($resql)) {
10198 10198
 				$key = $langs->trans($obj->code);
10199
-				$out .= '<option ' . ($selected == $obj->{$field} ? 'selected="selected"' : '') . ' value="' . $obj->{$field} . '">' . ($key != $obj->code ? $key : $obj->label) . '</option>';
10199
+				$out .= '<option '.($selected == $obj->{$field} ? 'selected="selected"' : '').' value="'.$obj->{$field}.'">'.($key != $obj->code ? $key : $obj->label).'</option>';
10200 10200
 			}
10201 10201
 			$out .= '</select>';
10202 10202
 		} else {
@@ -10228,7 +10228,7 @@  discard block
 block discarded – undo
10228 10228
 	{
10229 10229
 		global $user, $conf, $langs;
10230 10230
 
10231
-		require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
10231
+		require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
10232 10232
 
10233 10233
 		if (is_null($usertofilter)) {
10234 10234
 			$usertofilter = $user;
@@ -10252,10 +10252,10 @@  discard block
 block discarded – undo
10252 10252
 		$sql = "SELECT f.rowid, f.ref as fref, 'nolabel' as flabel, p.rowid as pid, f.ref,
10253 10253
             p.title, p.fk_soc, p.fk_statut, p.public,";
10254 10254
 		$sql .= ' s.nom as name';
10255
-		$sql .= ' FROM ' . $this->db->prefix() . 'projet as p';
10256
-		$sql .= ' LEFT JOIN ' . $this->db->prefix() . 'societe as s ON s.rowid = p.fk_soc,';
10257
-		$sql .= ' ' . $this->db->prefix() . 'facture as f';
10258
-		$sql .= " WHERE p.entity IN (" . getEntity('project') . ")";
10255
+		$sql .= ' FROM '.$this->db->prefix().'projet as p';
10256
+		$sql .= ' LEFT JOIN '.$this->db->prefix().'societe as s ON s.rowid = p.fk_soc,';
10257
+		$sql .= ' '.$this->db->prefix().'facture as f';
10258
+		$sql .= " WHERE p.entity IN (".getEntity('project').")";
10259 10259
 		$sql .= " AND f.fk_projet = p.rowid AND f.fk_statut=0"; //Brouillons seulement
10260 10260
 		//if ($projectsListId) $sql.= " AND p.rowid IN (".$this->db->sanitize($projectsListId).")";
10261 10261
 		//if ($socid == 0) $sql.= " AND (p.fk_soc=0 OR p.fk_soc IS NULL)";
@@ -10266,14 +10266,14 @@  discard block
 block discarded – undo
10266 10266
 		if ($resql) {
10267 10267
 			// Use select2 selector
10268 10268
 			if (!empty($conf->use_javascript_ajax)) {
10269
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
10269
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
10270 10270
 				$comboenhancement = ajax_combobox($htmlname, '', 0, $forcefocus);
10271 10271
 				$out .= $comboenhancement;
10272 10272
 				$morecss = 'minwidth200imp maxwidth500';
10273 10273
 			}
10274 10274
 
10275 10275
 			if (empty($option_only)) {
10276
-				$out .= '<select class="valignmiddle flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ' id="' . $htmlname . '" name="' . $htmlname . '">';
10276
+				$out .= '<select class="valignmiddle flat'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').' id="'.$htmlname.'" name="'.$htmlname.'">';
10277 10277
 			}
10278 10278
 			if (!empty($show_empty)) {
10279 10279
 				$out .= '<option value="0" class="optiongrey">';
@@ -10303,33 +10303,33 @@  discard block
 block discarded – undo
10303 10303
 						if ($showproject == 'all') {
10304 10304
 							$labeltoshow .= dol_trunc($obj->ref, 18); // Invoice ref
10305 10305
 							if ($obj->name) {
10306
-								$labeltoshow .= ' - ' . $obj->name; // Soc name
10306
+								$labeltoshow .= ' - '.$obj->name; // Soc name
10307 10307
 							}
10308 10308
 
10309 10309
 							$disabled = 0;
10310 10310
 							if ($obj->fk_statut == Project::STATUS_DRAFT) {
10311 10311
 								$disabled = 1;
10312
-								$labeltoshow .= ' - ' . $langs->trans("Draft");
10312
+								$labeltoshow .= ' - '.$langs->trans("Draft");
10313 10313
 							} elseif ($obj->fk_statut == Project::STATUS_CLOSED) {
10314 10314
 								if ($discard_closed == 2) {
10315 10315
 									$disabled = 1;
10316 10316
 								}
10317
-								$labeltoshow .= ' - ' . $langs->trans("Closed");
10317
+								$labeltoshow .= ' - '.$langs->trans("Closed");
10318 10318
 							} elseif ($socid > 0 && (!empty($obj->fk_soc) && $obj->fk_soc != $socid)) {
10319 10319
 								$disabled = 1;
10320
-								$labeltoshow .= ' - ' . $langs->trans("LinkedToAnotherCompany");
10320
+								$labeltoshow .= ' - '.$langs->trans("LinkedToAnotherCompany");
10321 10321
 							}
10322 10322
 						}
10323 10323
 
10324 10324
 						if (!empty($selected) && $selected == $obj->rowid) {
10325
-							$out .= '<option value="' . $obj->rowid . '" selected';
10325
+							$out .= '<option value="'.$obj->rowid.'" selected';
10326 10326
 							//if ($disabled) $out.=' disabled';						// with select2, field can't be preselected if disabled
10327
-							$out .= '>' . $labeltoshow . '</option>';
10327
+							$out .= '>'.$labeltoshow.'</option>';
10328 10328
 						} else {
10329 10329
 							if ($hideunselectables && $disabled && ($selected != $obj->rowid)) {
10330 10330
 								$resultat = '';
10331 10331
 							} else {
10332
-								$resultat = '<option value="' . $obj->rowid . '"';
10332
+								$resultat = '<option value="'.$obj->rowid.'"';
10333 10333
 								if ($disabled) {
10334 10334
 									$resultat .= ' disabled';
10335 10335
 								}
@@ -10381,22 +10381,22 @@  discard block
 block discarded – undo
10381 10381
 
10382 10382
 		$sql = 'SELECT f.rowid, f.entity, f.titre as title, f.suspended, f.fk_soc';
10383 10383
 		//$sql.= ', el.fk_source';
10384
-		$sql .= ' FROM ' . MAIN_DB_PREFIX . 'facture_rec as f';
10385
-		$sql .= " WHERE f.entity IN (" . getEntity('invoice') . ")";
10384
+		$sql .= ' FROM '.MAIN_DB_PREFIX.'facture_rec as f';
10385
+		$sql .= " WHERE f.entity IN (".getEntity('invoice').")";
10386 10386
 		$sql .= " ORDER BY f.titre ASC";
10387 10387
 
10388 10388
 		$resql = $this->db->query($sql);
10389 10389
 		if ($resql) {
10390 10390
 			// Use select2 selector
10391 10391
 			if (!empty($conf->use_javascript_ajax)) {
10392
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
10392
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
10393 10393
 				$comboenhancement = ajax_combobox($htmlname, '', 0, $forcefocus);
10394 10394
 				$out .= $comboenhancement;
10395 10395
 				$morecss = 'minwidth200imp maxwidth500';
10396 10396
 			}
10397 10397
 
10398 10398
 			if (empty($option_only)) {
10399
-				$out .= '<select class="valignmiddle flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ' id="' . $htmlname . '" name="' . $htmlname . '">';
10399
+				$out .= '<select class="valignmiddle flat'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').' id="'.$htmlname.'" name="'.$htmlname.'">';
10400 10400
 			}
10401 10401
 			if (!empty($show_empty)) {
10402 10402
 				$out .= '<option value="0" class="optiongrey">';
@@ -10415,19 +10415,19 @@  discard block
 block discarded – undo
10415 10415
 					$disabled = 0;
10416 10416
 					if (!empty($obj->suspended)) {
10417 10417
 						$disabled = 1;
10418
-						$labeltoshow .= ' - ' . $langs->trans("Closed");
10418
+						$labeltoshow .= ' - '.$langs->trans("Closed");
10419 10419
 					}
10420 10420
 
10421 10421
 
10422 10422
 					if (!empty($selected) && $selected == $obj->rowid) {
10423
-						$out .= '<option value="' . $obj->rowid . '" selected';
10423
+						$out .= '<option value="'.$obj->rowid.'" selected';
10424 10424
 						//if ($disabled) $out.=' disabled';						// with select2, field can't be preselected if disabled
10425
-						$out .= '>' . $labeltoshow . '</option>';
10425
+						$out .= '>'.$labeltoshow.'</option>';
10426 10426
 					} else {
10427 10427
 						if ($disabled && ($selected != $obj->rowid)) {
10428 10428
 							$resultat = '';
10429 10429
 						} else {
10430
-							$resultat = '<option value="' . $obj->rowid . '"';
10430
+							$resultat = '<option value="'.$obj->rowid.'"';
10431 10431
 							if ($disabled) {
10432 10432
 								$resultat .= ' disabled';
10433 10433
 							}
@@ -10467,14 +10467,14 @@  discard block
 block discarded – undo
10467 10467
 		global $langs;
10468 10468
 
10469 10469
 		if ($search_component_params_hidden != '' && !preg_match('/^\(.*\)$/', $search_component_params_hidden)) {    // If $search_component_params_hidden does not start and end with ()
10470
-			$search_component_params_hidden = '(' . $search_component_params_hidden . ')';
10470
+			$search_component_params_hidden = '('.$search_component_params_hidden.')';
10471 10471
 		}
10472 10472
 
10473 10473
 		$ret = '';
10474 10474
 
10475 10475
 		$ret .= '<div class="divadvancedsearchfieldcomp inline-block">';
10476 10476
 		$ret .= '<a href="#" class="dropdownsearch-toggle unsetcolor">';
10477
-		$ret .= '<span class="fas fa-filter linkobject boxfilter paddingright pictofixedwidth" title="' . dol_escape_htmltag($langs->trans("Filters")) . '" id="idsubimgproductdistribution"></span>';
10477
+		$ret .= '<span class="fas fa-filter linkobject boxfilter paddingright pictofixedwidth" title="'.dol_escape_htmltag($langs->trans("Filters")).'" id="idsubimgproductdistribution"></span>';
10478 10478
 		$ret .= '</a>';
10479 10479
 
10480 10480
 		$ret .= '<div class="divadvancedsearchfieldcompinput inline-block minwidth500 maxwidth300onsmartphone">';
@@ -10500,13 +10500,13 @@  discard block
 block discarded – undo
10500 10500
 				}
10501 10501
 
10502 10502
 				if ($countparenthesis == 0) {
10503
-					$char2 = dol_substr($search_component_params_hidden, $i+1, 1);
10504
-					$char3 = dol_substr($search_component_params_hidden, $i+2, 1);
10503
+					$char2 = dol_substr($search_component_params_hidden, $i + 1, 1);
10504
+					$char3 = dol_substr($search_component_params_hidden, $i + 2, 1);
10505 10505
 					if ($char == 'A' && $char2 == 'N' && $char3 == 'D') {
10506 10506
 						// We found a AND
10507 10507
 						$arrayofandtags[] = trim($s);
10508 10508
 						$s = '';
10509
-						$i+=2;
10509
+						$i += 2;
10510 10510
 					} else {
10511 10511
 						$s .= $char;
10512 10512
 					}
@@ -10530,8 +10530,8 @@  discard block
 block discarded – undo
10530 10530
 				include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
10531 10531
 				$searchtags = removeGlobalParenthesis($searchtags);
10532 10532
 
10533
-				$ret .= '<span class="marginleftonlyshort valignmiddle tagsearch" data-ufilterid="'.($tmpkey+1).'" data-ufilter="'.dol_escape_htmltag($tmpval).'">';
10534
-				$ret .= '<span class="tagsearchdelete select2-selection__choice__remove" data-ufilterid="'.($tmpkey+1).'">x</span> ';
10533
+				$ret .= '<span class="marginleftonlyshort valignmiddle tagsearch" data-ufilterid="'.($tmpkey + 1).'" data-ufilter="'.dol_escape_htmltag($tmpval).'">';
10534
+				$ret .= '<span class="tagsearchdelete select2-selection__choice__remove" data-ufilterid="'.($tmpkey + 1).'">x</span> ';
10535 10535
 				$ret .= dol_escape_htmltag($searchtags);
10536 10536
 				$ret .= '</span>';
10537 10537
 			}
@@ -10548,29 +10548,29 @@  discard block
 block discarded – undo
10548 10548
 			$ret .= '<input type="hidden" name="show_search_component_params_hidden" value="1">';
10549 10549
 		}
10550 10550
 		$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%')) -->";
10551
-		$ret .= '<input type="hidden" name="search_component_params_hidden" value="' . dol_escape_htmltag($search_component_params_hidden) . '">';
10551
+		$ret .= '<input type="hidden" name="search_component_params_hidden" value="'.dol_escape_htmltag($search_component_params_hidden).'">';
10552 10552
 		// $ret .= "<!-- sql= ".forgeSQLFromUniversalSearchCriteria($search_component_params_hidden, $errormessage)." -->";
10553 10553
 
10554 10554
 		// For compatibility with forms that show themself the search criteria in addition of this component, we output these fields
10555 10555
 		foreach ($arrayofcriterias as $criterias) {
10556 10556
 			foreach ($criterias as $criteriafamilykey => $criteriafamilyval) {
10557
-				if (in_array('search_' . $criteriafamilykey, $arrayofinputfieldsalreadyoutput)) {
10557
+				if (in_array('search_'.$criteriafamilykey, $arrayofinputfieldsalreadyoutput)) {
10558 10558
 					continue;
10559 10559
 				}
10560 10560
 				if (in_array($criteriafamilykey, array('rowid', 'ref_ext', 'entity', 'extraparams'))) {
10561 10561
 					continue;
10562 10562
 				}
10563 10563
 				if (in_array($criteriafamilyval['type'], array('date', 'datetime', 'timestamp'))) {
10564
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_start">';
10565
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_startyear">';
10566
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_startmonth">';
10567
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_startday">';
10568
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_end">';
10569
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_endyear">';
10570
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_endmonth">';
10571
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_endday">';
10564
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_start">';
10565
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_startyear">';
10566
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_startmonth">';
10567
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_startday">';
10568
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_end">';
10569
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_endyear">';
10570
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_endmonth">';
10571
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_endday">';
10572 10572
 				} else {
10573
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '">';
10573
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'">';
10574 10574
 				}
10575 10575
 			}
10576 10576
 		}
@@ -10578,7 +10578,7 @@  discard block
 block discarded – undo
10578 10578
 		$ret .= '</div>';
10579 10579
 
10580 10580
 		$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";
10581
-		$ret .= '<input type="text" placeholder="' . $langs->trans("Search") . '" name="search_component_params_input" class="noborderbottom search_component_input" value="">';
10581
+		$ret .= '<input type="text" placeholder="'.$langs->trans("Search").'" name="search_component_params_input" class="noborderbottom search_component_input" value="">';
10582 10582
 
10583 10583
 		$ret .= '</div>';
10584 10584
 		$ret .= '</div>';
@@ -10614,7 +10614,7 @@  discard block
 block discarded – undo
10614 10614
 
10615 10615
 		$TModels = array();
10616 10616
 
10617
-		include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php';
10617
+		include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
10618 10618
 		$formmail = new FormMail($this->db);
10619 10619
 		$result = $formmail->fetchAllEMailTemplate($modelType, $user, $langs);
10620 10620
 
@@ -10627,17 +10627,17 @@  discard block
 block discarded – undo
10627 10627
 			}
10628 10628
 		}
10629 10629
 
10630
-		$retstring .= '<select class="flat" id="select_' . $prefix . 'model_mail" name="' . $prefix . 'model_mail">';
10630
+		$retstring .= '<select class="flat" id="select_'.$prefix.'model_mail" name="'.$prefix.'model_mail">';
10631 10631
 
10632 10632
 		foreach ($TModels as $id_model => $label_model) {
10633
-			$retstring .= '<option value="' . $id_model . '"';
10634
-			$retstring .= ">" . $label_model . "</option>";
10633
+			$retstring .= '<option value="'.$id_model.'"';
10634
+			$retstring .= ">".$label_model."</option>";
10635 10635
 		}
10636 10636
 
10637 10637
 		$retstring .= "</select>";
10638 10638
 
10639 10639
 		if ($addjscombo) {
10640
-			$retstring .= ajax_combobox('select_' . $prefix . 'model_mail');
10640
+			$retstring .= ajax_combobox('select_'.$prefix.'model_mail');
10641 10641
 		}
10642 10642
 
10643 10643
 		return $retstring;
@@ -10688,16 +10688,16 @@  discard block
 block discarded – undo
10688 10688
 
10689 10689
 		foreach ($buttons as $button) {
10690 10690
 			$addclass = empty($button['addclass']) ? '' : $button['addclass'];
10691
-			$retstring .= '<input type="submit" class="button button-' . $button['name'] . ($morecss ? ' ' . $morecss : '') . ' ' . $addclass . '" name="' . $button['name'] . '" value="' . dol_escape_htmltag($langs->trans($button['label_key'])) . '">';
10691
+			$retstring .= '<input type="submit" class="button button-'.$button['name'].($morecss ? ' '.$morecss : '').' '.$addclass.'" name="'.$button['name'].'" value="'.dol_escape_htmltag($langs->trans($button['label_key'])).'">';
10692 10692
 		}
10693 10693
 		$retstring .= $withoutdiv ? '' : '</div>';
10694 10694
 
10695 10695
 		if ($dol_openinpopup) {
10696
-			$retstring .= '<!-- buttons are shown into a $dol_openinpopup=' . $dol_openinpopup . ' context, so we enable the close of dialog on cancel -->' . "\n";
10697
-			$retstring .= '<script nonce="' . getNonce() . '">';
10696
+			$retstring .= '<!-- buttons are shown into a $dol_openinpopup='.$dol_openinpopup.' context, so we enable the close of dialog on cancel -->'."\n";
10697
+			$retstring .= '<script nonce="'.getNonce().'">';
10698 10698
 			$retstring .= 'jQuery(".button-cancel").click(function(e) {
10699
-				e.preventDefault(); console.log(\'We click on cancel in iframe popup ' . $dol_openinpopup . '\');
10700
-				window.parent.jQuery(\'#idfordialog' . $dol_openinpopup . '\').dialog(\'close\');
10699
+				e.preventDefault(); console.log(\'We click on cancel in iframe popup ' . $dol_openinpopup.'\');
10700
+				window.parent.jQuery(\'#idfordialog' . $dol_openinpopup.'\').dialog(\'close\');
10701 10701
 				 });';
10702 10702
 			$retstring .= '</script>';
10703 10703
 		}
Please login to merge, or discard this patch.