Completed
Branch develop (18314d)
by
unknown
24:34
created
htdocs/compta/facture/class/facture.class.php 1 patch
Spacing   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -504,7 +504,7 @@  discard block
 block discarded – undo
504 504
 			$this->mode_reglement_id = 0;
505 505
 		}
506 506
 		$this->status = self::STATUS_DRAFT;
507
-		$this->statut = self::STATUS_DRAFT;	// deprecated
507
+		$this->statut = self::STATUS_DRAFT; // deprecated
508 508
 
509 509
 		if (!empty($this->multicurrency_code)) {
510 510
 			// Multicurrency (test on $this->multicurrency_tx because we should take the default rate of multicurrency_code only if not using original rate)
@@ -578,7 +578,7 @@  discard block
 block discarded – undo
578 578
 			if (!empty($_facrec->frequency)) {  // Invoice are created on same thirdparty than template when there is a recurrence, but not necessarily when there is no recurrence.
579 579
 				$this->socid = $_facrec->socid;
580 580
 			}
581
-			$this->entity            = $_facrec->entity; // Invoice created in same entity than template
581
+			$this->entity = $_facrec->entity; // Invoice created in same entity than template
582 582
 
583 583
 			// Fields coming from GUI.
584 584
 			// @TODO Value of template should be used as default value on the form on the GUI, and we should here always use the value from GUI
@@ -617,7 +617,7 @@  discard block
 block discarded – undo
617 617
 				$this->mode_reglement_id = 0;
618 618
 			}
619 619
 			$this->status = self::STATUS_DRAFT;
620
-			$this->statut = self::STATUS_DRAFT;	// deprecated
620
+			$this->statut = self::STATUS_DRAFT; // deprecated
621 621
 
622 622
 			$this->linked_objects = $_facrec->linkedObjectsIds;
623 623
 			// We do not add link to template invoice or next invoice will be linked to all generated invoices
@@ -863,7 +863,7 @@  discard block
 block discarded – undo
863 863
 
864 864
 						// Complete vat rate with code
865 865
 						$vatrate = $newinvoiceline->tva_tx;
866
-						if ($newinvoiceline->vat_src_code && ! preg_match('/\(.*\)/', (string) $vatrate)) {
866
+						if ($newinvoiceline->vat_src_code && !preg_match('/\(.*\)/', (string) $vatrate)) {
867 867
 							$vatrate .= ' ('.$newinvoiceline->vat_src_code.')';
868 868
 						}
869 869
 
@@ -1083,7 +1083,7 @@  discard block
 block discarded – undo
1083 1083
 						($_facrec->lines[$i]->date_end_fill == 1 && $previousdaynextdatewhen) ? $previousdaynextdatewhen : '',
1084 1084
 						0,
1085 1085
 						$tva_npr,
1086
-						0,  // fk_remise_except
1086
+						0, // fk_remise_except
1087 1087
 						'HT',
1088 1088
 						0,
1089 1089
 						$_facrec->lines[$i]->product_type,
@@ -1096,8 +1096,8 @@  discard block
 block discarded – undo
1096 1096
 						$buyprice,
1097 1097
 						$_facrec->lines[$i]->label,
1098 1098
 						empty($_facrec->lines[$i]->array_options) ? null : $_facrec->lines[$i]->array_options,
1099
-						100,	// situation percent is undefined on recurring invoice lines
1100
-						0,  // fk_prev_id
1099
+						100, // situation percent is undefined on recurring invoice lines
1100
+						0, // fk_prev_id
1101 1101
 						$_facrec->lines[$i]->fk_unit,
1102 1102
 						$_facrec->lines[$i]->multicurrency_subprice,
1103 1103
 						$_facrec->lines[$i]->ref_ext,
@@ -1189,7 +1189,7 @@  discard block
 block discarded – undo
1189 1189
 
1190 1190
 		$facture->fk_facture_source = $this->fk_facture_source;
1191 1191
 		$facture->type 			    = $this->type;
1192
-		$facture->subtype 			= $this->subtype;
1192
+		$facture->subtype = $this->subtype;
1193 1193
 		$facture->socid 		    = $this->socid;
1194 1194
 		$facture->date              = $this->date;
1195 1195
 		$facture->date_pointoftax   = $this->date_pointoftax;
@@ -1206,7 +1206,7 @@  discard block
 block discarded – undo
1206 1206
 
1207 1207
 		$facture->origin            = $this->origin;
1208 1208
 		$facture->origin_id         = $this->origin_id;
1209
-		$facture->fk_account         = $this->fk_account;
1209
+		$facture->fk_account = $this->fk_account;
1210 1210
 
1211 1211
 		$facture->lines = $this->lines; // Array of lines of invoice
1212 1212
 		$facture->situation_counter = $this->situation_counter;
@@ -1473,8 +1473,8 @@  discard block
 block discarded – undo
1473 1473
 		$this->fk_account = $object->fk_account;
1474 1474
 		$this->cond_reglement_id    = $object->cond_reglement_id;
1475 1475
 		$this->mode_reglement_id    = $object->mode_reglement_id;
1476
-		$this->fk_incoterms    		= $object->fk_incoterms;
1477
-		$this->location_incoterms	= $object->location_incoterms;
1476
+		$this->fk_incoterms = $object->fk_incoterms;
1477
+		$this->location_incoterms = $object->location_incoterms;
1478 1478
 		$this->availability_id      = $object->availability_id;
1479 1479
 		$this->demand_reason_id     = $object->demand_reason_id;
1480 1480
 		$this->delivery_date        = $object->delivery_date;
@@ -1682,7 +1682,7 @@  discard block
 block discarded – undo
1682 1682
 	{
1683 1683
 		global $conf, $langs, $hookmanager, $action;
1684 1684
 
1685
-		if (! in_array($origin->element, array('propal', 'commande'))) {
1685
+		if (!in_array($origin->element, array('propal', 'commande'))) {
1686 1686
 			$origin->error = 'ErrorCanOnlyAutomaticallyGenerateADepositFromProposalOrOrder';
1687 1687
 			return null;
1688 1688
 		}
@@ -1692,7 +1692,7 @@  discard block
 block discarded – undo
1692 1692
 			return null;
1693 1693
 		}
1694 1694
 
1695
-		require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
1695
+		require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
1696 1696
 
1697 1697
 		if ($date > (dol_get_last_hour(dol_now('tzuserrel')) + getDolGlobalInt('INVOICE_MAX_FUTURE_DELAY'))) {
1698 1698
 			$origin->error = 'ErrorDateIsInFuture';
@@ -1736,7 +1736,7 @@  discard block
 block discarded – undo
1736 1736
 		$deposit->pos_source = $origin->pos_source;
1737 1737
 		$deposit->model_pdf = 'crabe';
1738 1738
 
1739
-		$modelByTypeConfName = 'FACTURE_ADDON_PDF_' . $deposit->type;
1739
+		$modelByTypeConfName = 'FACTURE_ADDON_PDF_'.$deposit->type;
1740 1740
 
1741 1741
 		if (getDolGlobalString($modelByTypeConfName)) {
1742 1742
 			$deposit->model_pdf = getDolGlobalString($modelByTypeConfName);
@@ -1796,10 +1796,10 @@  discard block
 block discarded – undo
1796 1796
 					$descriptions[$key] = '';
1797 1797
 				}
1798 1798
 				$TTotalByTva[$key] += $line->total_ttc;
1799
-				$descriptions[$key] .= '<li>' . (!empty($line->product_ref) ? $line->product_ref . ' - ' : '');
1800
-				$descriptions[$key] .= (!empty($line->product_label) ? $line->product_label . ' - ' : '');
1801
-				$descriptions[$key] .= $langs->trans('Qty') . ' : ' . $line->qty;
1802
-				$descriptions[$key] .= ' - ' . $langs->trans('TotalHT') . ' : ' . price($line->total_ht) . '</li>';
1799
+				$descriptions[$key] .= '<li>'.(!empty($line->product_ref) ? $line->product_ref.' - ' : '');
1800
+				$descriptions[$key] .= (!empty($line->product_label) ? $line->product_label.' - ' : '');
1801
+				$descriptions[$key] .= $langs->trans('Qty').' : '.$line->qty;
1802
+				$descriptions[$key] .= ' - '.$langs->trans('TotalHT').' : '.price($line->total_ht).'</li>';
1803 1803
 			}
1804 1804
 
1805 1805
 			foreach ($TTotalByTva as $tva => &$total) {
@@ -1823,10 +1823,10 @@  discard block
 block discarded – undo
1823 1823
 				$totalamount += $lines[$i]->total_ht; // Fixme : is it not for the customer ? Shouldn't we take total_ttc ?
1824 1824
 				$tva_tx = $lines[$i]->tva_tx;
1825 1825
 				$amountdeposit[$tva_tx] += ((float) $lines[$i]->total_ht * (float) $origin->deposit_percent) / 100;
1826
-				$descriptions[$tva_tx] .= '<li>' . (!empty($lines[$i]->product_ref) ? $lines[$i]->product_ref . ' - ' : '');
1827
-				$descriptions[$tva_tx] .= (!empty($lines[$i]->product_label) ? $lines[$i]->product_label . ' - ' : '');
1828
-				$descriptions[$tva_tx] .= $langs->trans('Qty') . ' : ' . $lines[$i]->qty;
1829
-				$descriptions[$tva_tx] .= ' - ' . $langs->trans('TotalHT') . ' : ' . price($lines[$i]->total_ht) . '</li>';
1826
+				$descriptions[$tva_tx] .= '<li>'.(!empty($lines[$i]->product_ref) ? $lines[$i]->product_ref.' - ' : '');
1827
+				$descriptions[$tva_tx] .= (!empty($lines[$i]->product_label) ? $lines[$i]->product_label.' - ' : '');
1828
+				$descriptions[$tva_tx] .= $langs->trans('Qty').' : '.$lines[$i]->qty;
1829
+				$descriptions[$tva_tx] .= ' - '.$langs->trans('TotalHT').' : '.price($lines[$i]->total_ht).'</li>';
1830 1830
 			}
1831 1831
 
1832 1832
 			if ($totalamount == 0) {
@@ -1841,11 +1841,11 @@  discard block
 block discarded – undo
1841 1841
 				continue;
1842 1842
 			}
1843 1843
 
1844
-			$descline = '(DEPOSIT) ('. $origin->deposit_percent .'%) - '.$origin->ref;
1844
+			$descline = '(DEPOSIT) ('.$origin->deposit_percent.'%) - '.$origin->ref;
1845 1845
 
1846 1846
 			// Hidden conf
1847 1847
 			if (getDolGlobalString('INVOICE_DEPOSIT_VARIABLE_MODE_DETAIL_LINES_IN_DESCRIPTION') && !empty($descriptions[$tva])) {
1848
-				$descline .= '<ul>' . $descriptions[$tva] . '</ul>';
1848
+				$descline .= '<ul>'.$descriptions[$tva].'</ul>';
1849 1849
 			}
1850 1850
 
1851 1851
 			$addlineResult = $deposit->addline(
@@ -2225,9 +2225,9 @@  discard block
 block discarded – undo
2225 2225
 				$this->id = $obj->rowid;
2226 2226
 				$this->entity = $obj->entity;
2227 2227
 
2228
-				$this->ref					= $obj->ref;
2229
-				$this->ref_client			= $obj->ref_client;
2230
-				$this->ref_customer			= $obj->ref_client;
2228
+				$this->ref = $obj->ref;
2229
+				$this->ref_client = $obj->ref_client;
2230
+				$this->ref_customer = $obj->ref_client;
2231 2231
 				$this->ref_ext				= $obj->ref_ext;
2232 2232
 				$this->type					= $obj->type;
2233 2233
 				$this->subtype				= $obj->subtype;
@@ -2253,7 +2253,7 @@  discard block
 block discarded – undo
2253 2253
 				$this->fk_project = $obj->fk_project;
2254 2254
 				$this->project = null; // Clear if another value was already set by fetch_projet
2255 2255
 
2256
-				$this->statut = $obj->status;	// deprecated
2256
+				$this->statut = $obj->status; // deprecated
2257 2257
 				$this->status = $obj->status;
2258 2258
 
2259 2259
 				$this->date_lim_reglement = $this->db->jdate($obj->dlr);
@@ -2269,7 +2269,7 @@  discard block
 block discarded – undo
2269 2269
 				$this->fk_fac_rec_source	= $obj->fk_fac_rec_source;
2270 2270
 				$this->note = $obj->note_private; // deprecated
2271 2271
 				$this->note_private = $obj->note_private;
2272
-				$this->note_public			= $obj->note_public;
2272
+				$this->note_public = $obj->note_public;
2273 2273
 				$this->user_creation_id     = $obj->fk_user_author;
2274 2274
 				$this->user_validation_id   = $obj->fk_user_valid;
2275 2275
 				$this->user_modification_id = $obj->fk_user_modif;
@@ -2383,7 +2383,7 @@  discard block
 block discarded – undo
2383 2383
 				$line->ref              = $objp->product_ref; // Ref product
2384 2384
 				$line->product_ref      = $objp->product_ref; // Ref product
2385 2385
 				$line->libelle          = $objp->product_label; // deprecated
2386
-				$line->product_label 	= $objp->product_label; // Label product
2386
+				$line->product_label = $objp->product_label; // Label product
2387 2387
 				$line->product_barcode  = $objp->product_barcode; // Barcode number product
2388 2388
 				$line->product_desc     = $objp->product_desc; // Description product
2389 2389
 				$line->fk_product_type  = $objp->fk_product_type; // Type of product
@@ -3257,10 +3257,10 @@  discard block
 block discarded – undo
3257 3257
 		if ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && !$user->hasRight('facture', 'creer'))
3258 3258
 		|| (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && !$user->hasRight('facture', 'invoice_advance', 'validate'))) {
3259 3259
 			$this->error = 'Permission denied';
3260
-			dol_syslog(get_class($this)."::validate ".$this->error.' MAIN_USE_ADVANCED_PERMS=' . getDolGlobalString('MAIN_USE_ADVANCED_PERMS'), LOG_ERR);
3260
+			dol_syslog(get_class($this)."::validate ".$this->error.' MAIN_USE_ADVANCED_PERMS='.getDolGlobalString('MAIN_USE_ADVANCED_PERMS'), LOG_ERR);
3261 3261
 			return -1;
3262 3262
 		}
3263
-		if ((preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref)) &&	// empty should not happened, but when it occurs, the test save life
3263
+		if ((preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref)) && // empty should not happened, but when it occurs, the test save life
3264 3264
 			getDolGlobalString('FAC_FORCE_DATE_VALIDATION')						// If option enabled, we force invoice date
3265 3265
 		) {
3266 3266
 			$this->date = dol_now();
@@ -3438,7 +3438,7 @@  discard block
 block discarded – undo
3438 3438
 					for ($i = 0; $i < $cpt; $i++) {
3439 3439
 						if ($this->lines[$i]->fk_product > 0) {
3440 3440
 							$mouvP = new MouvementStock($this->db);
3441
-							$mouvP->origin = &$this;	// deprecated
3441
+							$mouvP->origin = &$this; // deprecated
3442 3442
 							$mouvP->setOrigin($this->element, $this->id);
3443 3443
 
3444 3444
 							// We decrease stock for product
@@ -3632,7 +3632,7 @@  discard block
 block discarded – undo
3632 3632
 			// Set new ref and define current status
3633 3633
 			if (!$error) {
3634 3634
 				$this->ref = $num;
3635
-				$this->statut = self::STATUS_VALIDATED;	// deprecated
3635
+				$this->statut = self::STATUS_VALIDATED; // deprecated
3636 3636
 				$this->status = self::STATUS_VALIDATED;
3637 3637
 				$this->date_validation = $now;
3638 3638
 				$i = 0;
@@ -3787,7 +3787,7 @@  discard block
 block discarded – undo
3787 3787
 
3788 3788
 			if ($error == 0) {
3789 3789
 				$old_statut = $this->status;
3790
-				$this->statut = self::STATUS_DRAFT;	// deprecated
3790
+				$this->statut = self::STATUS_DRAFT; // deprecated
3791 3791
 				$this->status = self::STATUS_DRAFT;
3792 3792
 
3793 3793
 				// Call trigger
@@ -4692,7 +4692,7 @@  discard block
 block discarded – undo
4692 4692
 		}
4693 4693
 
4694 4694
 		if (!empty($addon)) {
4695
-			dol_syslog("Call getNextNumRef with ".$addonConstName." = " . getDolGlobalString('FACTURE_ADDON').", thirdparty=".$soc->name.", type=".$soc->typent_code.", mode=".$mode, LOG_DEBUG);
4695
+			dol_syslog("Call getNextNumRef with ".$addonConstName." = ".getDolGlobalString('FACTURE_ADDON').", thirdparty=".$soc->name.", type=".$soc->typent_code.", mode=".$mode, LOG_DEBUG);
4696 4696
 
4697 4697
 			$mybool = false;
4698 4698
 
@@ -5159,7 +5159,7 @@  discard block
 block discarded – undo
5159 5159
 
5160 5160
 		if (empty($option) || $option != 'nolines') {
5161 5161
 			// Lines
5162
-			$nbp = min(1000, GETPOSTINT('nblines') ? GETPOSTINT('nblines') : 5);	// We can force the nb of lines to test from command line (but not more than 1000)
5162
+			$nbp = min(1000, GETPOSTINT('nblines') ? GETPOSTINT('nblines') : 5); // We can force the nb of lines to test from command line (but not more than 1000)
5163 5163
 			$xnbp = 0;
5164 5164
 			while ($xnbp < $nbp) {
5165 5165
 				$line = new FactureLigne($this->db);
@@ -5772,14 +5772,14 @@  discard block
 block discarded – undo
5772 5772
 		if (!empty($paymentmode) && $paymentmode != 'all') {
5773 5773
 			$sql .= ", ".MAIN_DB_PREFIX."c_paiement as cp";
5774 5774
 		}
5775
-		$sql .= " WHERE f.paye = 0";	// Only unpaid
5776
-		$sql .= " AND f.fk_statut = ".self::STATUS_VALIDATED;	// Only validated status
5775
+		$sql .= " WHERE f.paye = 0"; // Only unpaid
5776
+		$sql .= " AND f.fk_statut = ".self::STATUS_VALIDATED; // Only validated status
5777 5777
 		if ($datetouse == 'invoicedate') {
5778 5778
 			$sql .= " AND f.datef = '".$this->db->idate($tmpidate, 'gmt')."'";
5779 5779
 		} else {
5780 5780
 			$sql .= " AND f.date_lim_reglement = '".$this->db->idate($tmpidate, 'gmt')."'";
5781 5781
 		}
5782
-		$sql .= " AND f.entity IN (".getEntity('facture', 0).")";	// One batch process only one company (no sharing)
5782
+		$sql .= " AND f.entity IN (".getEntity('facture', 0).")"; // One batch process only one company (no sharing)
5783 5783
 		if (!empty($paymentmode) && $paymentmode != 'all') {
5784 5784
 			$sql .= " AND f.fk_mode_reglement = cp.id AND cp.code = '".$this->db->escape($paymentmode)."'";
5785 5785
 		}
@@ -5997,7 +5997,7 @@  discard block
 block discarded – undo
5997 5997
 								$actioncomm->create($user);
5998 5998
 							}
5999 5999
 
6000
-							$this->db->commit();	// We always commit
6000
+							$this->db->commit(); // We always commit
6001 6001
 						}
6002 6002
 
6003 6003
 						if ($errormesg) {
@@ -6039,7 +6039,7 @@  discard block
 block discarded – undo
6039 6039
 		// get date of last validated invoices of same type
6040 6040
 		$sql  = "SELECT datef";
6041 6041
 		$sql .= " FROM ".MAIN_DB_PREFIX."facture";
6042
-		$sql .= " WHERE type = " . (int) $this->type ;
6042
+		$sql .= " WHERE type = ".(int) $this->type;
6043 6043
 		$sql .= " AND date_valid IS NOT NULL";
6044 6044
 		$sql .= " AND entity IN (".getEntity('invoice').")";
6045 6045
 		$sql .= " ORDER BY datef DESC LIMIT 1";
Please login to merge, or discard this patch.
htdocs/comm/propal/class/propal.class.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -666,7 +666,7 @@  discard block
 block discarded – undo
666 666
 			}
667 667
 			$txlocaltax1 = price2num($txlocaltax1);
668 668
 			$txlocaltax2 = price2num($txlocaltax2);
669
-			$pa_ht = price2num($pa_ht);  // do not convert to float here, it breaks the functioning of $pa_ht_isemptystring
669
+			$pa_ht = price2num($pa_ht); // do not convert to float here, it breaks the functioning of $pa_ht_isemptystring
670 670
 			if ($price_base_type == 'HT') {
671 671
 				$pu = $pu_ht;
672 672
 			} else {
@@ -894,7 +894,7 @@  discard block
 block discarded – undo
894 894
 		}
895 895
 		$txlocaltax1 = price2num($txlocaltax1);
896 896
 		$txlocaltax2 = price2num($txlocaltax2);
897
-		$pa_ht = price2num($pa_ht);  // do not convert to float here, it breaks the functioning of $pa_ht_isemptystring
897
+		$pa_ht = price2num($pa_ht); // do not convert to float here, it breaks the functioning of $pa_ht_isemptystring
898 898
 		if (empty($qty) && empty($special_code)) {
899 899
 			$special_code = 3; // Set option tag
900 900
 		}
@@ -1479,7 +1479,7 @@  discard block
 block discarded – undo
1479 1479
 			if ($objsoc->id > 0 && !empty($object->lines)) {
1480 1480
 				if ($update_prices === true && getDolGlobalString('PRODUIT_CUSTOMER_PRICES')) {
1481 1481
 					// If price per customer
1482
-					require_once DOL_DOCUMENT_ROOT . '/product/class/productcustomerprice.class.php';
1482
+					require_once DOL_DOCUMENT_ROOT.'/product/class/productcustomerprice.class.php';
1483 1483
 				}
1484 1484
 
1485 1485
 				foreach ($object->lines as $line) {
@@ -1673,7 +1673,7 @@  discard block
 block discarded – undo
1673 1673
 				$this->ref_customer         = $obj->ref_client;
1674 1674
 				$this->ref_ext              = $obj->ref_ext;
1675 1675
 
1676
-				$this->total                = $obj->total_ttc;			// TODO deprecated
1676
+				$this->total                = $obj->total_ttc; // TODO deprecated
1677 1677
 				$this->total_ttc            = $obj->total_ttc;
1678 1678
 				$this->total_ht             = $obj->total_ht;
1679 1679
 				$this->total_tva            = $obj->total_tva;
@@ -2588,7 +2588,7 @@  discard block
 block discarded – undo
2588 2588
 	 */
2589 2589
 	public function closeProposal($user, $status, $note_private = '', $notrigger = 0, $note_public = '')
2590 2590
 	{
2591
-		global $langs,$conf;
2591
+		global $langs, $conf;
2592 2592
 
2593 2593
 		$error = 0;
2594 2594
 		$now = dol_now();
@@ -2623,10 +2623,10 @@  discard block
 block discarded – undo
2623 2623
 		if ($resql) {
2624 2624
 			// Status self::STATUS_REFUSED by default
2625 2625
 			$modelpdf = getDolGlobalString('PROPALE_ADDON_PDF_ODT_CLOSED', $this->model_pdf);
2626
-			$trigger_name = 'PROPAL_CLOSE_REFUSED';		// used later in call_trigger()
2626
+			$trigger_name = 'PROPAL_CLOSE_REFUSED'; // used later in call_trigger()
2627 2627
 
2628 2628
 			if ($status == self::STATUS_SIGNED) {	// Status self::STATUS_SIGNED
2629
-				$trigger_name = 'PROPAL_CLOSE_SIGNED';	// used later in call_trigger()
2629
+				$trigger_name = 'PROPAL_CLOSE_SIGNED'; // used later in call_trigger()
2630 2630
 				$modelpdf = getDolGlobalString('PROPALE_ADDON_PDF_ODT_TOBILL') ? $conf->global->PROPALE_ADDON_PDF_ODT_TOBILL : $this->model_pdf;
2631 2631
 
2632 2632
 				// The connected company is classified as a client
@@ -2793,10 +2793,10 @@  discard block
 block discarded – undo
2793 2793
 
2794 2794
 		$this->db->begin();
2795 2795
 
2796
-		$sql = "UPDATE ". MAIN_DB_PREFIX . "propal";
2797
-		$sql .= " SET fk_statut = " . self::STATUS_CANCELED . ",";
2798
-		$sql .= " fk_user_modif = " . ((int) $user->id);
2799
-		$sql .= " WHERE rowid = " . ((int) $this->id);
2796
+		$sql = "UPDATE ".MAIN_DB_PREFIX."propal";
2797
+		$sql .= " SET fk_statut = ".self::STATUS_CANCELED.",";
2798
+		$sql .= " fk_user_modif = ".((int) $user->id);
2799
+		$sql .= " WHERE rowid = ".((int) $this->id);
2800 2800
 
2801 2801
 		dol_syslog(get_class($this)."::cancel", LOG_DEBUG);
2802 2802
 		if ($this->db->query($sql)) {
@@ -3159,7 +3159,7 @@  discard block
 block discarded – undo
3159 3159
 					}
3160 3160
 				}
3161 3161
 				if (file_exists($dir)) {
3162
-					$res = @dol_delete_dir_recursive($dir);		// delete files physically + into ecm tables
3162
+					$res = @dol_delete_dir_recursive($dir); // delete files physically + into ecm tables
3163 3163
 					if (!$res) {
3164 3164
 						$this->error = 'ErrorFailToDeleteDir';
3165 3165
 						$this->errors[] = $this->error;
@@ -3563,7 +3563,7 @@  discard block
 block discarded – undo
3563 3563
 		$this->multicurrency_code = $conf->currency;
3564 3564
 
3565 3565
 		// Lines
3566
-		$nbp = min(1000, GETPOSTINT('nblines') ? GETPOSTINT('nblines') : 5);	// We can force the nb of lines to test from command line (but not more than 1000)
3566
+		$nbp = min(1000, GETPOSTINT('nblines') ? GETPOSTINT('nblines') : 5); // We can force the nb of lines to test from command line (but not more than 1000)
3567 3567
 		$xnbp = 0;
3568 3568
 		while ($xnbp < $nbp) {
3569 3569
 			$line = new PropaleLigne($this->db);
@@ -3893,7 +3893,7 @@  discard block
 block discarded – undo
3893 3893
 		}
3894 3894
 
3895 3895
 		global $action;
3896
-		$hookmanager->initHooks(array($this->element . 'dao'));
3896
+		$hookmanager->initHooks(array($this->element.'dao'));
3897 3897
 		$parameters = array('id' => $this->id, 'getnomurl' => &$result);
3898 3898
 		$reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
3899 3899
 		if ($reshook > 0) {
Please login to merge, or discard this patch.
htdocs/admin/dict.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
 
111 111
 $id = GETPOSTINT('id');
112 112
 $rowid = GETPOST('rowid', 'alpha');
113
-$entity = GETPOST('entity', 'alpha');	// Do not use GETPOSTINT here. Should be '', 0 or >0.
113
+$entity = GETPOST('entity', 'alpha'); // Do not use GETPOSTINT here. Should be '', 0 or >0.
114 114
 $code = GETPOST('code', 'alpha');
115 115
 $from = GETPOST('from', 'alpha');
116 116
 
@@ -579,7 +579,7 @@  discard block
 block discarded – undo
579 579
 $tabcond[DICT_STCOMM] = isModEnabled("societe");
580 580
 $tabcond[DICT_HOLIDAY_TYPES] = isModEnabled('holiday');
581 581
 $tabcond[DICT_LEAD_STATUS] = isModEnabled('project');
582
-$tabcond[DICT_FORMAT_CARDS] = (isModEnabled('label') || isModEnabled('barcode') || isModEnabled('member'));	// stickers format dictionary
582
+$tabcond[DICT_FORMAT_CARDS] = (isModEnabled('label') || isModEnabled('barcode') || isModEnabled('member')); // stickers format dictionary
583 583
 $tabcond[DICT_INVOICE_SUBTYPE] = ((isModEnabled('invoice') || isModEnabled('supplier_invoice')) && $mysoc->country_code == 'GR');
584 584
 $tabcond[DICT_HRM_PUBLIC_HOLIDAY] = (isModEnabled('holiday') || isModEnabled('hrm'));
585 585
 $tabcond[DICT_HRM_DEPARTMENT] = isModEnabled('hrm');
@@ -716,7 +716,7 @@  discard block
 block discarded – undo
716 716
 		'project_task' => img_picto('', 'projecttask', 'class="pictofixedwidth"').$langs->trans('Task'),
717 717
 		'propal' => img_picto('', 'propal', 'class="pictofixedwidth"').$langs->trans('Proposal'),
718 718
 		'commande' => img_picto('', 'order', 'class="pictofixedwidth"').$langs->trans('Order'),
719
-		'shipping' => img_picto('', 'dolly', 'class="pictofixedwidth"') . $langs->trans('Shipment'),
719
+		'shipping' => img_picto('', 'dolly', 'class="pictofixedwidth"').$langs->trans('Shipment'),
720 720
 		'facture' => img_picto('', 'bill', 'class="pictofixedwidth"').$langs->trans('Bill'),
721 721
 		'fichinter' => img_picto('', 'intervention', 'class="pictofixedwidth"').$langs->trans('InterventionCard'),
722 722
 		'contrat' => img_picto('', 'contract', 'class="pictofixedwidth"').$langs->trans('Contract'),
@@ -993,7 +993,7 @@  discard block
 block discarded – undo
993 993
 				if ($value == 'price' || preg_match('/^amount/i', $value)) {
994 994
 					$_POST[$keycode] = price2num(GETPOST($keycode), 'MU');
995 995
 				} elseif ($value == 'taux' || $value == 'localtax1') {
996
-					$_POST[$keycode] = price2num(GETPOST($keycode), 8);	// Note that localtax2 can be a list of rates separated by coma like X:Y:Z
996
+					$_POST[$keycode] = price2num(GETPOST($keycode), 8); // Note that localtax2 can be a list of rates separated by coma like X:Y:Z
997 997
 				} elseif ($value == 'entity') {
998 998
 					$_POST[$keycode] = getEntity($tablename);
999 999
 				}
@@ -1062,7 +1062,7 @@  discard block
 block discarded – undo
1062 1062
 				if ($field == 'price' || preg_match('/^amount/i', $field)) {
1063 1063
 					$_POST[$keycode] = price2num(GETPOST($keycode), 'MU');
1064 1064
 				} elseif ($field == 'taux' || $field == 'localtax1') {
1065
-					$_POST[$keycode] = price2num(GETPOST($keycode), 8);	// Note that localtax2 can be a list of rates separated by coma like X:Y:Z
1065
+					$_POST[$keycode] = price2num(GETPOST($keycode), 8); // Note that localtax2 can be a list of rates separated by coma like X:Y:Z
1066 1066
 				} elseif ($field == 'entity') {
1067 1067
 					$_POST[$keycode] = getEntity($tablename);
1068 1068
 				}
@@ -2572,7 +2572,7 @@  discard block
 block discarded – undo
2572 2572
 							}
2573 2573
 							// Show value for field
2574 2574
 							if ($showfield) {
2575
-								print '<!-- '. $value .' --><td class="'.$class.'"'.($titletoshow ? ' title="'.dolPrintHTMLForAttribute($titletoshow).'"' : '').'>'.$valuetoshow.'</td>';
2575
+								print '<!-- '.$value.' --><td class="'.$class.'"'.($titletoshow ? ' title="'.dolPrintHTMLForAttribute($titletoshow).'"' : '').'>'.$valuetoshow.'</td>';
2576 2576
 							}
2577 2577
 						}
2578 2578
 
@@ -2760,7 +2760,7 @@  discard block
 block discarded – undo
2760 2760
 			// Special case for c_actioncomm (field that should not be modified)
2761 2761
 			$hidden = (!empty($obj->{$value}) ? $obj->{$value} : '');
2762 2762
 			print '<td>';
2763
-			print '<input type="hidden" name="'. $value .'" value="'.$hidden.'">';
2763
+			print '<input type="hidden" name="'.$value.'" value="'.$hidden.'">';
2764 2764
 			print $langs->trans($hidden);
2765 2765
 			print '</td>';
2766 2766
 		} elseif ($value == 'country') {
@@ -2781,7 +2781,7 @@  discard block
 block discarded – undo
2781 2781
 			if (!in_array('country', $fieldlist)) {	// If there is already a field country, we don't show country_id (avoid duplicate)
2782 2782
 				$country_id = (!empty($obj->{$value}) ? $obj->{$value} : 0);
2783 2783
 				print '<td class="tdoverflowmax100">';
2784
-				print '<input type="hidden" name="'. $value .'" value="'.$country_id.'">';
2784
+				print '<input type="hidden" name="'.$value.'" value="'.$country_id.'">';
2785 2785
 				print '</td>';
2786 2786
 			}
2787 2787
 		} elseif ($value == 'region') {
@@ -2791,7 +2791,7 @@  discard block
 block discarded – undo
2791 2791
 		} elseif ($value == 'region_id') {
2792 2792
 			$region_id = (!empty($obj->{$value}) ? $obj->{$value} : 0);
2793 2793
 			print '<td>';
2794
-			print '<input type="hidden" name="'. $value .'" value="'.$region_id.'">';
2794
+			print '<input type="hidden" name="'.$value.'" value="'.$region_id.'">';
2795 2795
 			print '</td>';
2796 2796
 		} elseif ($value == 'department_buyer') {
2797 2797
 			if ($context == 'edit') {
@@ -2865,7 +2865,7 @@  discard block
 block discarded – undo
2865 2865
 				$class = "center"; // Fields aligned on right
2866 2866
 			}
2867 2867
 			print '<td class="'.$class.'">';
2868
-			print '<input type="text" class="flat" value="'.(isset($obj->{$value}) ? $obj->{$value} : '').'" size="3" name="'. $value .'">';
2868
+			print '<input type="text" class="flat" value="'.(isset($obj->{$value}) ? $obj->{$value} : '').'" size="3" name="'.$value.'">';
2869 2869
 			print '</td>';
2870 2870
 		} elseif (in_array($value, array('libelle_facture'))) {
2871 2871
 			print '<td>';
@@ -2875,7 +2875,7 @@  discard block
 block discarded – undo
2875 2875
 			if ($tabname == 'c_payment_term') {
2876 2876
 				$langs->load("bills");
2877 2877
 				if (isset($obj->code) && !empty($obj->code)) {
2878
-					$transkey = "PaymentCondition" . strtoupper($obj->code);
2878
+					$transkey = "PaymentCondition".strtoupper($obj->code);
2879 2879
 					if ($langs->trans($transkey) != $transkey) {
2880 2880
 						$transfound = 1;
2881 2881
 						print $form->textwithpicto($langs->trans($transkey), $langs->trans("GoIntoTranslationMenuToChangeThis"));
@@ -2883,21 +2883,21 @@  discard block
 block discarded – undo
2883 2883
 				}
2884 2884
 			}
2885 2885
 			if (!$transfound) {
2886
-				print '<textarea cols="30" rows="'.ROWS_2.'" class="flat" name="'. $value .'">'.(empty($obj->{$value}) ? '' : $obj->{$value}).'</textarea>';
2886
+				print '<textarea cols="30" rows="'.ROWS_2.'" class="flat" name="'.$value.'">'.(empty($obj->{$value}) ? '' : $obj->{$value}).'</textarea>';
2887 2887
 			} else {
2888
-				print '<input type="hidden" name="'. $value .'" value="'.$transkey.'">';
2888
+				print '<input type="hidden" name="'.$value.'" value="'.$transkey.'">';
2889 2889
 			}
2890 2890
 			print '</td>';
2891 2891
 		} elseif ($value == 'price' || preg_match('/^amount/i', (string) $value)) {
2892
-			print '<td><input type="text" class="flat minwidth75" value="'.price((!empty($obj->{$value}) ? $obj->{$value} : '')).'" name="'. $value .'"></td>';
2892
+			print '<td><input type="text" class="flat minwidth75" value="'.price((!empty($obj->{$value}) ? $obj->{$value} : '')).'" name="'.$value.'"></td>';
2893 2893
 		} elseif ($value == 'code' && isset($obj->{$value})) {
2894 2894
 			print '<td>';
2895 2895
 			if ($tabname == 'c_paiement' && in_array($obj->{$value}, array('LIQ', 'CB', 'CHQ', 'VIR'))) {
2896 2896
 				// Case of code that should not be modified
2897
-				print '<input type="hidden" class="flat minwidth75 maxwidth100" value="'.(empty($obj->{$value}) ? '' : $obj->{$value}).'" name="'. $value .'">';
2897
+				print '<input type="hidden" class="flat minwidth75 maxwidth100" value="'.(empty($obj->{$value}) ? '' : $obj->{$value}).'" name="'.$value.'">';
2898 2898
 				print $obj->{$value};
2899 2899
 			} else {
2900
-				print '<input type="text" class="flat minwidth75 maxwidth100" value="'.(empty($obj->{$value}) ? '' : $obj->{$value}).'" name="'. $value .'">';
2900
+				print '<input type="text" class="flat minwidth75 maxwidth100" value="'.(empty($obj->{$value}) ? '' : $obj->{$value}).'" name="'.$value.'">';
2901 2901
 			}
2902 2902
 			print '</td>';
2903 2903
 		} elseif ($value == 'unit') {
@@ -2925,10 +2925,10 @@  discard block
 block discarded – undo
2925 2925
 			if (isModEnabled('accounting')) {
2926 2926
 				$fieldname = $value;
2927 2927
 				$accountancy_account = (empty($obj->$fieldname) ? 0 : $obj->$fieldname);
2928
-				print $formaccounting->select_account($accountancy_account, '.'. $value, 1, array(), 1, 1, 'maxwidth125 maxwidthonsmartphone');
2928
+				print $formaccounting->select_account($accountancy_account, '.'.$value, 1, array(), 1, 1, 'maxwidth125 maxwidthonsmartphone');
2929 2929
 			} else {
2930 2930
 				$fieldname = $value;
2931
-				print '<input type="text" class="flat minwidth100" value="'.(isset($obj->$fieldname) ? $obj->$fieldname : '').'" name="'. $value .'">';
2931
+				print '<input type="text" class="flat minwidth100" value="'.(isset($obj->$fieldname) ? $obj->$fieldname : '').'" name="'.$value.'">';
2932 2932
 			}
2933 2933
 			print '</td>';
2934 2934
 		} elseif ($value == 'fk_tva') {
@@ -2949,7 +2949,7 @@  discard block
 block discarded – undo
2949 2949
 			print '</td>';
2950 2950
 		} elseif ($value == 'type_duration') {
2951 2951
 			print '<td>';
2952
-			print $form->selectTypeDuration('', (empty($obj->type_duration) ? '' : $obj->type_duration), array('i','h'));
2952
+			print $form->selectTypeDuration('', (empty($obj->type_duration) ? '' : $obj->type_duration), array('i', 'h'));
2953 2953
 			print '</td>';
2954 2954
 		} else {
2955 2955
 			$fieldValue = isset($obj->{$value}) ? $obj->{$value} : '';
Please login to merge, or discard this patch.
htdocs/core/class/html.form.class.php 1 patch
Spacing   +1258 added lines, -1258 removed lines patch added patch discarded remove patch
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
 		if (getDolGlobalString('MAIN_USE_JQUERY_JEDITABLE') && !preg_match('/^select;/', $typeofdata)) {
125 125
 			if (!empty($perm)) {
126 126
 				$tmp = explode(':', $typeofdata);
127
-				$ret .= '<div class="editkey_' . $tmp[0] . (!empty($tmp[1]) ? ' ' . $tmp[1] : '') . '" id="' . $htmlname . '">';
127
+				$ret .= '<div class="editkey_'.$tmp[0].(!empty($tmp[1]) ? ' '.$tmp[1] : '').'" id="'.$htmlname.'">';
128 128
 				if ($fieldrequired) {
129 129
 					$ret .= '<span class="fieldrequired">';
130 130
 				}
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
 				if ($fieldrequired) {
137 137
 					$ret .= '</span>';
138 138
 				}
139
-				$ret .= '</div>' . "\n";
139
+				$ret .= '</div>'."\n";
140 140
 			} else {
141 141
 				if ($fieldrequired) {
142 142
 					$ret .= '<span class="fieldrequired">';
@@ -174,8 +174,8 @@  discard block
 block discarded – undo
174 174
 			if (empty($notabletag) && $perm) {
175 175
 				$ret .= '<td class="right">';
176 176
 			}
177
-			if ($htmlname && GETPOST('action', 'aZ09') != 'edit' . $htmlname && $perm) {
178
-				$ret .= '<a class="editfielda reposition" href="' . $_SERVER["PHP_SELF"] . '?action=edit' . $htmlname . '&token=' . newToken() . '&' . $paramid . '=' . $object->id . $moreparam . '">' . img_edit($langs->trans('Edit'), ($notabletag ? 0 : 1)) . '</a>';
177
+			if ($htmlname && GETPOST('action', 'aZ09') != 'edit'.$htmlname && $perm) {
178
+				$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>';
179 179
 			}
180 180
 			if (!empty($notabletag) && $notabletag == 1) {
181 181
 				if ($text) {
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
 			} elseif ($reg[1] == 'int') {
243 243
 				$typeofdata = 'numeric';
244 244
 			} else {
245
-				return 'ErrorBadParameter ' . $typeofdata;
245
+				return 'ErrorBadParameter '.$typeofdata;
246 246
 			}
247 247
 		}
248 248
 
@@ -253,13 +253,13 @@  discard block
 block discarded – undo
253 253
 			if ($editaction == '') {
254 254
 				$editaction = GETPOST('action', 'aZ09');
255 255
 			}
256
-			$editmode = ($editaction == 'edit' . $htmlname);
256
+			$editmode = ($editaction == 'edit'.$htmlname);
257 257
 			if ($editmode) {	// edit mode
258 258
 				$ret .= "<!-- formeditfieldval -->\n";
259
-				$ret .= '<form method="post" action="' . $_SERVER["PHP_SELF"] . ($moreparam ? '?' . $moreparam : '') . '">';
260
-				$ret .= '<input type="hidden" name="action" value="set' . $htmlname . '">';
261
-				$ret .= '<input type="hidden" name="token" value="' . newToken() . '">';
262
-				$ret .= '<input type="hidden" name="' . $paramid . '" value="' . $object->id . '">';
259
+				$ret .= '<form method="post" action="'.$_SERVER["PHP_SELF"].($moreparam ? '?'.$moreparam : '').'">';
260
+				$ret .= '<input type="hidden" name="action" value="set'.$htmlname.'">';
261
+				$ret .= '<input type="hidden" name="token" value="'.newToken().'">';
262
+				$ret .= '<input type="hidden" name="'.$paramid.'" value="'.$object->id.'">';
263 263
 				if (empty($notabletag)) {
264 264
 					$ret .= '<table class="nobordernopadding centpercent">';
265 265
 				}
@@ -268,28 +268,28 @@  discard block
 block discarded – undo
268 268
 				}
269 269
 				if (preg_match('/^(string|safehtmlstring|email|phone|url)/', $typeofdata)) {
270 270
 					$tmp = explode(':', $typeofdata);
271
-					$ret .= '<input type="text" id="' . $htmlname . '" name="' . $htmlname . '" value="' . ($editvalue ? $editvalue : $value) . '"' . (empty($tmp[1]) ? '' : ' size="' . $tmp[1] . '"') . ' autofocus>';
271
+					$ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($editvalue ? $editvalue : $value).'"'.(empty($tmp[1]) ? '' : ' size="'.$tmp[1].'"').' autofocus>';
272 272
 				} elseif (preg_match('/^(integer)/', $typeofdata)) {
273 273
 					$tmp = explode(':', $typeofdata);
274 274
 					$valuetoshow = price2num($editvalue ? $editvalue : $value, 0);
275
-					$ret .= '<input type="text" id="' . $htmlname . '" name="' . $htmlname . '" value="' . $valuetoshow . '"' . (empty($tmp[1]) ? '' : ' size="' . $tmp[1] . '"') . ' autofocus>';
275
+					$ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.$valuetoshow.'"'.(empty($tmp[1]) ? '' : ' size="'.$tmp[1].'"').' autofocus>';
276 276
 				} elseif (preg_match('/^(numeric|amount)/', $typeofdata)) {
277 277
 					$tmp = explode(':', $typeofdata);
278 278
 					$valuetoshow = price2num($editvalue ? $editvalue : $value);
279
-					$ret .= '<input type="text" id="' . $htmlname . '" name="' . $htmlname . '" value="' . ($valuetoshow != '' ? price($valuetoshow) : '') . '"' . (empty($tmp[1]) ? '' : ' size="' . $tmp[1] . '"') . ' autofocus>';
279
+					$ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($valuetoshow != '' ? price($valuetoshow) : '').'"'.(empty($tmp[1]) ? '' : ' size="'.$tmp[1].'"').' autofocus>';
280 280
 				} elseif (preg_match('/^(checkbox)/', $typeofdata)) {
281 281
 					$tmp = explode(':', $typeofdata);
282
-					$ret .= '<input type="checkbox" id="' . $htmlname . '" name="' . $htmlname . '" value="' . ($value ? $value : 'on') . '"' . ($value ? ' checked' : '') . (empty($tmp[1]) ? '' : $tmp[1]) . '/>';
282
+					$ret .= '<input type="checkbox" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($value ? $value : 'on').'"'.($value ? ' checked' : '').(empty($tmp[1]) ? '' : $tmp[1]).'/>';
283 283
 				} elseif (preg_match('/^text/', $typeofdata) || preg_match('/^note/', $typeofdata)) {    // if wysiwyg is enabled $typeofdata = 'ckeditor'
284 284
 					$tmp = explode(':', $typeofdata);
285 285
 					$cols = (empty($tmp[2]) ? '' : $tmp[2]);
286 286
 					$morealt = '';
287 287
 					if (preg_match('/%/', $cols)) {
288
-						$morealt = ' style="width: ' . $cols . '"';
288
+						$morealt = ' style="width: '.$cols.'"';
289 289
 						$cols = '';
290 290
 					}
291 291
 					$valuetoshow = ($editvalue ? $editvalue : $value);
292
-					$ret .= '<textarea id="' . $htmlname . '" name="' . $htmlname . '" wrap="soft" rows="' . (empty($tmp[1]) ? '20' : $tmp[1]) . '"' . ($cols ? ' cols="' . $cols . '"' : 'class="quatrevingtpercent"') . $morealt . '" autofocus>';
292
+					$ret .= '<textarea id="'.$htmlname.'" name="'.$htmlname.'" wrap="soft" rows="'.(empty($tmp[1]) ? '20' : $tmp[1]).'"'.($cols ? ' cols="'.$cols.'"' : 'class="quatrevingtpercent"').$morealt.'" autofocus>';
293 293
 					// textarea convert automatically entities chars into simple chars.
294 294
 					// So we convert & into &amp; so a string like 'a &lt; <b>b</b><br>é<br>&lt;script&gt;alert('X');&lt;script&gt;' stay a correct html and is not converted by textarea component when wysiwyg is off.
295 295
 					$valuetoshow = str_replace('&', '&amp;', $valuetoshow);
@@ -299,12 +299,12 @@  discard block
 block discarded – undo
299 299
 					$addnowlink = empty($moreoptions['addnowlink']) ? 0 : $moreoptions['addnowlink'];
300 300
 					$adddateof = empty($moreoptions['adddateof']) ? '' : $moreoptions['adddateof'];
301 301
 					$labeladddateof = empty($moreoptions['labeladddateof']) ? '' : $moreoptions['labeladddateof'];
302
-					$ret .= $this->selectDate($value, $htmlname, 0, 0, 1, 'form' . $htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm);
302
+					$ret .= $this->selectDate($value, $htmlname, 0, 0, 1, 'form'.$htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm);
303 303
 				} elseif ($typeofdata == 'dayhour' || $typeofdata == 'datehourpicker') {
304 304
 					$addnowlink = empty($moreoptions['addnowlink']) ? 0 : $moreoptions['addnowlink'];
305 305
 					$adddateof = empty($moreoptions['adddateof']) ? '' : $moreoptions['adddateof'];
306 306
 					$labeladddateof = empty($moreoptions['labeladddateof']) ? '' : $moreoptions['labeladddateof'];
307
-					$ret .= $this->selectDate($value, $htmlname, 1, 1, 1, 'form' . $htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm);
307
+					$ret .= $this->selectDate($value, $htmlname, 1, 1, 1, 'form'.$htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm);
308 308
 				} elseif (preg_match('/^select;/', $typeofdata)) {
309 309
 					$arraydata = explode(',', preg_replace('/^select;/', '', $typeofdata));
310 310
 					$arraylist = array();
@@ -318,7 +318,7 @@  discard block
 block discarded – undo
318 318
 					// TODO Not yet implemented. See code for extrafields
319 319
 				} elseif (preg_match('/^ckeditor/', $typeofdata)) {
320 320
 					$tmp = explode(':', $typeofdata); // Example: ckeditor:dolibarr_zzz:width:height:savemethod:toolbarstartexpanded:rows:cols:uselocalbrowser
321
-					require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';
321
+					require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
322 322
 					$doleditor = new DolEditor($htmlname, ($editvalue ? $editvalue : $value), (empty($tmp[2]) ? '' : $tmp[2]), (empty($tmp[3]) ? 100 : (int) $tmp[3]), (empty($tmp[1]) ? 'dolibarr_notes' : $tmp[1]), 'In', (empty($tmp[5]) ? false : (bool) $tmp[5]), (isset($tmp[8]) ? ($tmp[8] ? true : false) : true), true, (empty($tmp[6]) ? 20 : (int) $tmp[6]), (empty($tmp[7]) ? '100' : $tmp[7]));
323 323
 					$ret .= $doleditor->Create(1);
324 324
 				} elseif ($typeofdata == 'asis') {
@@ -333,19 +333,19 @@  discard block
 block discarded – undo
333 333
 					$ret .= '<td>';
334 334
 				}
335 335
 				//else $ret.='<div class="clearboth"></div>';
336
-				$ret .= '<input type="submit" class="smallpaddingimp nomargingtop nomarginbottom button' . (empty($notabletag) ? '' : ' ') . '" name="modify" value="' . $langs->trans("Modify") . '">';
336
+				$ret .= '<input type="submit" class="smallpaddingimp nomargingtop nomarginbottom button'.(empty($notabletag) ? '' : ' ').'" name="modify" value="'.$langs->trans("Modify").'">';
337 337
 				if (preg_match('/ckeditor|textarea/', $typeofdata) && empty($notabletag)) {
338
-					$ret .= '<br>' . "\n";
338
+					$ret .= '<br>'."\n";
339 339
 				}
340
-				$ret .= '<input type="submit" class="smallpaddingimp nomargingtop nomarginbottom button button-cancel' . (empty($notabletag) ? '' : ' ') . '" name="cancel" value="' . $langs->trans("Cancel") . '">';
340
+				$ret .= '<input type="submit" class="smallpaddingimp nomargingtop nomarginbottom button button-cancel'.(empty($notabletag) ? '' : ' ').'" name="cancel" value="'.$langs->trans("Cancel").'">';
341 341
 				if (empty($notabletag)) {
342 342
 					$ret .= '</td>';
343 343
 				}
344 344
 
345 345
 				if (empty($notabletag)) {
346
-					$ret .= '</tr></table>' . "\n";
346
+					$ret .= '</tr></table>'."\n";
347 347
 				}
348
-				$ret .= '</form>' . "\n";
348
+				$ret .= '</form>'."\n";
349 349
 			} else {		// view mode
350 350
 				if (preg_match('/^email/', $typeofdata)) {
351 351
 					$ret .= dol_print_email($value, 0, 0, 0, 0, 1);
@@ -357,15 +357,15 @@  discard block
 block discarded – undo
357 357
 					$ret .= ($value != '' ? price($value, 0, $langs, 0, -1, -1, $conf->currency) : '');
358 358
 				} elseif (preg_match('/^checkbox/', $typeofdata)) {
359 359
 					$tmp = explode(':', $typeofdata);
360
-					$ret .= '<input type="checkbox" disabled id="' . $htmlname . '" name="' . $htmlname . '" value="' . $value . '"' . ($value ? ' checked' : '') . ($tmp[1] ? $tmp[1] : '') . '/>';
360
+					$ret .= '<input type="checkbox" disabled id="'.$htmlname.'" name="'.$htmlname.'" value="'.$value.'"'.($value ? ' checked' : '').($tmp[1] ? $tmp[1] : '').'/>';
361 361
 				} elseif (preg_match('/^text/', $typeofdata) || preg_match('/^note/', $typeofdata)) {
362 362
 					$ret .= dol_htmlwithnojs(dol_string_onlythesehtmltags(dol_htmlentitiesbr($value), 1, 1, 1));
363 363
 				} elseif (preg_match('/^(safehtmlstring|restricthtml)/', $typeofdata)) {	// 'restricthtml' is not an allowed type for editfieldval. Value is 'safehtmlstring'
364 364
 					$ret .= dol_htmlwithnojs(dol_string_onlythesehtmltags($value));
365 365
 				} elseif ($typeofdata == 'day' || $typeofdata == 'datepicker') {
366
-					$ret .= '<span class="valuedate">' . dol_print_date($value, 'day', $gm) . '</span>';
366
+					$ret .= '<span class="valuedate">'.dol_print_date($value, 'day', $gm).'</span>';
367 367
 				} elseif ($typeofdata == 'dayhour' || $typeofdata == 'datehourpicker') {
368
-					$ret .= '<span class="valuedate">' . dol_print_date($value, 'dayhour', $gm) . '</span>';
368
+					$ret .= '<span class="valuedate">'.dol_print_date($value, 'dayhour', $gm).'</span>';
369 369
 				} elseif (preg_match('/^select;/', $typeofdata)) {
370 370
 					$arraydata = explode(',', preg_replace('/^select;/', '', $typeofdata));
371 371
 					$arraylist = array();
@@ -376,9 +376,9 @@  discard block
 block discarded – undo
376 376
 					$ret .= $arraylist[$value];
377 377
 					if ($htmlname == 'fk_product_type') {
378 378
 						if ($value == 0) {
379
-							$ret = img_picto($langs->trans("Product"), 'product', 'class="paddingleftonly paddingrightonly colorgrey"') . $ret;
379
+							$ret = img_picto($langs->trans("Product"), 'product', 'class="paddingleftonly paddingrightonly colorgrey"').$ret;
380 380
 						} else {
381
-							$ret = img_picto($langs->trans("Service"), 'service', 'class="paddingleftonly paddingrightonly colorgrey"') . $ret;
381
+							$ret = img_picto($langs->trans("Service"), 'service', 'class="paddingleftonly paddingrightonly colorgrey"').$ret;
382 382
 						}
383 383
 					}
384 384
 				} elseif (preg_match('/^ckeditor/', $typeofdata)) {
@@ -386,7 +386,7 @@  discard block
 block discarded – undo
386 386
 					if (getDolGlobalString('MAIN_DISABLE_NOTES_TAB')) {
387 387
 						$firstline = preg_replace('/<br>.*/', '', $tmpcontent);
388 388
 						$firstline = preg_replace('/[\n\r].*/', '', $firstline);
389
-						$tmpcontent = $firstline . ((strlen($firstline) != strlen($tmpcontent)) ? '...' : '');
389
+						$tmpcontent = $firstline.((strlen($firstline) != strlen($tmpcontent)) ? '...' : '');
390 390
 					}
391 391
 					// We don't use dol_escape_htmltag to get the html formatting active, but this need we must also
392 392
 					// clean data from some dangerous html
@@ -395,7 +395,7 @@  discard block
 block discarded – undo
395 395
 					if (empty($moreoptions['valuealreadyhtmlescaped'])) {
396 396
 						$ret .= dol_escape_htmltag($value);
397 397
 					} else {
398
-						$ret .= $value;        // $value must be already html escaped.
398
+						$ret .= $value; // $value must be already html escaped.
399 399
 					}
400 400
 				}
401 401
 
@@ -433,7 +433,7 @@  discard block
 block discarded – undo
433 433
 
434 434
 		if (is_array($arrayoflangcode) && count($arrayoflangcode)) {
435 435
 			if (!is_object($extralanguages)) {
436
-				include_once DOL_DOCUMENT_ROOT . '/core/class/extralanguages.class.php';
436
+				include_once DOL_DOCUMENT_ROOT.'/core/class/extralanguages.class.php';
437 437
 				$extralanguages = new ExtraLanguages($this->db);
438 438
 			}
439 439
 			$extralanguages->fetch_name_extralanguages('societe');
@@ -442,17 +442,17 @@  discard block
 block discarded – undo
442 442
 				return ''; // No extralang field to show
443 443
 			}
444 444
 
445
-			$result .= '<!-- Widget for translation -->' . "\n";
446
-			$result .= '<div class="inline-block paddingleft image-' . $object->element . '-' . $fieldname . '">';
445
+			$result .= '<!-- Widget for translation -->'."\n";
446
+			$result .= '<div class="inline-block paddingleft image-'.$object->element.'-'.$fieldname.'">';
447 447
 			$s = img_picto($langs->trans("ShowOtherLanguages"), 'language', '', 0, 0, 0, '', 'fa-15 editfieldlang');
448 448
 			$result .= $s;
449 449
 			$result .= '</div>';
450 450
 
451
-			$result .= '<div class="inline-block hidden field-' . $object->element . '-' . $fieldname . '">';
451
+			$result .= '<div class="inline-block hidden field-'.$object->element.'-'.$fieldname.'">';
452 452
 
453 453
 			$resultforextrlang = '';
454 454
 			foreach ($arrayoflangcode as $langcode) {
455
-				$valuetoshow = GETPOSTISSET('field-' . $object->element . "-" . $fieldname . "-" . $langcode) ? GETPOST('field-' . $object->element . '-' . $fieldname . "-" . $langcode, $check) : '';
455
+				$valuetoshow = GETPOSTISSET('field-'.$object->element."-".$fieldname."-".$langcode) ? GETPOST('field-'.$object->element.'-'.$fieldname."-".$langcode, $check) : '';
456 456
 				if (empty($valuetoshow)) {
457 457
 					$object->fetchValuesForExtraLanguages();
458 458
 					//var_dump($object->array_languages);
@@ -464,17 +464,17 @@  discard block
 block discarded – undo
464 464
 
465 465
 				// TODO Use the showInputField() method of ExtraLanguages object
466 466
 				if ($typeofdata == 'textarea') {
467
-					$resultforextrlang .= '<textarea name="field-' . $object->element . "-" . $fieldname . "-" . $langcode . '" id="' . $fieldname . "-" . $langcode . '" class="' . $morecss . '" rows="' . ROWS_2 . '" wrap="soft">';
467
+					$resultforextrlang .= '<textarea name="field-'.$object->element."-".$fieldname."-".$langcode.'" id="'.$fieldname."-".$langcode.'" class="'.$morecss.'" rows="'.ROWS_2.'" wrap="soft">';
468 468
 					$resultforextrlang .= $valuetoshow;
469 469
 					$resultforextrlang .= '</textarea>';
470 470
 				} else {
471
-					$resultforextrlang .= '<input type="text" class="inputfieldforlang ' . ($morecss ? ' ' . $morecss : '') . '" name="field-' . $object->element . '-' . $fieldname . '-' . $langcode . '" value="' . $valuetoshow . '">';
471
+					$resultforextrlang .= '<input type="text" class="inputfieldforlang '.($morecss ? ' '.$morecss : '').'" name="field-'.$object->element.'-'.$fieldname.'-'.$langcode.'" value="'.$valuetoshow.'">';
472 472
 				}
473 473
 			}
474 474
 			$result .= $resultforextrlang;
475 475
 
476 476
 			$result .= '</div>';
477
-			$result .= '<script nonce="' . getNonce() . '">$(".image-' . $object->element . '-' . $fieldname . '").click(function() { console.log("Toggle lang widget"); jQuery(".field-' . $object->element . '-' . $fieldname . '").toggle(); });</script>';
477
+			$result .= '<script nonce="'.getNonce().'">$(".image-'.$object->element.'-'.$fieldname.'").click(function() { console.log("Toggle lang widget"); jQuery(".field-'.$object->element.'-'.$fieldname.'").toggle(); });</script>';
478 478
 		}
479 479
 
480 480
 		return $result;
@@ -537,7 +537,7 @@  discard block
 block discarded – undo
537 537
 				if (!empty($tmp[2])) {
538 538
 					$savemethod = $tmp[2];
539 539
 				}
540
-				$out .= '<input id="width_' . $htmlname . '" value="' . $inputOption . '" type="hidden"/>' . "\n";
540
+				$out .= '<input id="width_'.$htmlname.'" value="'.$inputOption.'" type="hidden"/>'."\n";
541 541
 			} elseif ((preg_match('/^day$/', $inputType)) || (preg_match('/^datepicker/', $inputType)) || (preg_match('/^datehourpicker/', $inputType))) {
542 542
 				$tmp = explode(':', $inputType);
543 543
 				$inputType = $tmp[0];
@@ -548,7 +548,7 @@  discard block
 block discarded – undo
548 548
 					$savemethod = $tmp[2];
549 549
 				}
550 550
 
551
-				$out .= '<input id="timestamp" type="hidden"/>' . "\n"; // Use for timestamp format
551
+				$out .= '<input id="timestamp" type="hidden"/>'."\n"; // Use for timestamp format
552 552
 			} elseif (preg_match('/^(select|autocomplete)/', $inputType)) {
553 553
 				$tmp = explode(':', $inputType);
554 554
 				$inputType = $tmp[0];
@@ -579,40 +579,40 @@  discard block
 block discarded – undo
579 579
 				}
580 580
 
581 581
 				if (isModEnabled('fckeditor')) {
582
-					$out .= '<input id="ckeditor_toolbar" value="' . $toolbar . '" type="hidden"/>' . "\n";
582
+					$out .= '<input id="ckeditor_toolbar" value="'.$toolbar.'" type="hidden"/>'."\n";
583 583
 				} else {
584 584
 					$inputType = 'textarea';
585 585
 				}
586 586
 			}
587 587
 
588
-			$out .= '<input id="element_' . $htmlname . '" value="' . $element . '" type="hidden"/>' . "\n";
589
-			$out .= '<input id="table_element_' . $htmlname . '" value="' . $table_element . '" type="hidden"/>' . "\n";
590
-			$out .= '<input id="fk_element_' . $htmlname . '" value="' . $fk_element . '" type="hidden"/>' . "\n";
591
-			$out .= '<input id="loadmethod_' . $htmlname . '" value="' . $loadmethod . '" type="hidden"/>' . "\n";
588
+			$out .= '<input id="element_'.$htmlname.'" value="'.$element.'" type="hidden"/>'."\n";
589
+			$out .= '<input id="table_element_'.$htmlname.'" value="'.$table_element.'" type="hidden"/>'."\n";
590
+			$out .= '<input id="fk_element_'.$htmlname.'" value="'.$fk_element.'" type="hidden"/>'."\n";
591
+			$out .= '<input id="loadmethod_'.$htmlname.'" value="'.$loadmethod.'" type="hidden"/>'."\n";
592 592
 			if (!empty($savemethod)) {
593
-				$out .= '<input id="savemethod_' . $htmlname . '" value="' . $savemethod . '" type="hidden"/>' . "\n";
593
+				$out .= '<input id="savemethod_'.$htmlname.'" value="'.$savemethod.'" type="hidden"/>'."\n";
594 594
 			}
595 595
 			if (!empty($ext_element)) {
596
-				$out .= '<input id="ext_element_' . $htmlname . '" value="' . $ext_element . '" type="hidden"/>' . "\n";
596
+				$out .= '<input id="ext_element_'.$htmlname.'" value="'.$ext_element.'" type="hidden"/>'."\n";
597 597
 			}
598 598
 			if (!empty($custommsg)) {
599 599
 				if (is_array($custommsg)) {
600 600
 					if (!empty($custommsg['success'])) {
601
-						$out .= '<input id="successmsg_' . $htmlname . '" value="' . $custommsg['success'] . '" type="hidden"/>' . "\n";
601
+						$out .= '<input id="successmsg_'.$htmlname.'" value="'.$custommsg['success'].'" type="hidden"/>'."\n";
602 602
 					}
603 603
 					if (!empty($custommsg['error'])) {
604
-						$out .= '<input id="errormsg_' . $htmlname . '" value="' . $custommsg['error'] . '" type="hidden"/>' . "\n";
604
+						$out .= '<input id="errormsg_'.$htmlname.'" value="'.$custommsg['error'].'" type="hidden"/>'."\n";
605 605
 					}
606 606
 				} else {
607
-					$out .= '<input id="successmsg_' . $htmlname . '" value="' . $custommsg . '" type="hidden"/>' . "\n";
607
+					$out .= '<input id="successmsg_'.$htmlname.'" value="'.$custommsg.'" type="hidden"/>'."\n";
608 608
 				}
609 609
 			}
610 610
 			if ($inputType == 'textarea') {
611
-				$out .= '<input id="textarea_' . $htmlname . '_rows" value="' . $rows . '" type="hidden"/>' . "\n";
612
-				$out .= '<input id="textarea_' . $htmlname . '_cols" value="' . $cols . '" type="hidden"/>' . "\n";
611
+				$out .= '<input id="textarea_'.$htmlname.'_rows" value="'.$rows.'" type="hidden"/>'."\n";
612
+				$out .= '<input id="textarea_'.$htmlname.'_cols" value="'.$cols.'" type="hidden"/>'."\n";
613 613
 			}
614
-			$out .= '<span id="viewval_' . $htmlname . '" class="viewval_' . $inputType . ($button_only ? ' inactive' : ' active') . '">' . $value . '</span>' . "\n";
615
-			$out .= '<span id="editval_' . $htmlname . '" class="editval_' . $inputType . ($button_only ? ' inactive' : ' active') . ' hideobject">' . (!empty($editvalue) ? $editvalue : $value) . '</span>' . "\n";
614
+			$out .= '<span id="viewval_'.$htmlname.'" class="viewval_'.$inputType.($button_only ? ' inactive' : ' active').'">'.$value.'</span>'."\n";
615
+			$out .= '<span id="editval_'.$htmlname.'" class="editval_'.$inputType.($button_only ? ' inactive' : ' active').' hideobject">'.(!empty($editvalue) ? $editvalue : $value).'</span>'."\n";
616 616
 		} else {
617 617
 			$out = $value;
618 618
 		}
@@ -641,12 +641,12 @@  discard block
 block discarded – undo
641 641
 	public function textwithtooltip($text, $htmltext, $tooltipon = 1, $direction = 0, $img = '', $extracss = '', $notabs = 3, $incbefore = '', $noencodehtmltext = 0, $tooltiptrigger = '', $forcenowrap = 0)
642 642
 	{
643 643
 		if ($incbefore) {
644
-			$text = $incbefore . $text;
644
+			$text = $incbefore.$text;
645 645
 		}
646 646
 		if (!$htmltext) {
647 647
 			return $text;
648 648
 		}
649
-		$direction = (int) $direction;    // For backward compatibility when $direction was set to '' instead of 0
649
+		$direction = (int) $direction; // For backward compatibility when $direction was set to '' instead of 0
650 650
 
651 651
 		$tag = 'td';
652 652
 		if ($notabs == 2) {
@@ -660,11 +660,11 @@  discard block
 block discarded – undo
660 660
 
661 661
 		$extrastyle = '';
662 662
 		if ($direction < 0) {
663
-			$extracss = ($extracss ? $extracss : '') . ($notabs != 3 ? ' inline-block' : '');
663
+			$extracss = ($extracss ? $extracss : '').($notabs != 3 ? ' inline-block' : '');
664 664
 			$extrastyle = 'padding: 0px; padding-left: 2px;';
665 665
 		}
666 666
 		if ($direction > 0) {
667
-			$extracss = ($extracss ? $extracss : '') . ($notabs != 3 ? ' inline-block' : '');
667
+			$extracss = ($extracss ? $extracss : '').($notabs != 3 ? ' inline-block' : '');
668 668
 			$extrastyle = 'padding: 0px; padding-right: 2px;';
669 669
 		}
670 670
 
@@ -677,53 +677,53 @@  discard block
 block discarded – undo
677 677
 			$htmltext = str_replace('"', '&quot;', $htmltext);
678 678
 		} else {
679 679
 			$classfortooltip = 'classfortooltiponclick';
680
-			$textfordialog .= '<div style="display: none;" id="idfortooltiponclick_' . $tooltiptrigger . '" class="classfortooltiponclicktext">' . $htmltext . '</div>';
680
+			$textfordialog .= '<div style="display: none;" id="idfortooltiponclick_'.$tooltiptrigger.'" class="classfortooltiponclicktext">'.$htmltext.'</div>';
681 681
 		}
682 682
 		if ($tooltipon == 2 || $tooltipon == 3) {
683
-			$paramfortooltipimg = ' class="' . $classfortooltip . ($notabs != 3 ? ' inline-block' : '') . ($extracss ? ' ' . $extracss : '') . '" style="padding: 0px;' . ($extrastyle ? ' ' . $extrastyle : '') . '"';
683
+			$paramfortooltipimg = ' class="'.$classfortooltip.($notabs != 3 ? ' inline-block' : '').($extracss ? ' '.$extracss : '').'" style="padding: 0px;'.($extrastyle ? ' '.$extrastyle : '').'"';
684 684
 			if ($tooltiptrigger == '') {
685
-				$paramfortooltipimg .= ' title="' . ($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)) . '"'; // Attribute to put on img tag to store tooltip
685
+				$paramfortooltipimg .= ' title="'.($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)).'"'; // Attribute to put on img tag to store tooltip
686 686
 			} else {
687
-				$paramfortooltipimg .= ' dolid="' . $tooltiptrigger . '"';
687
+				$paramfortooltipimg .= ' dolid="'.$tooltiptrigger.'"';
688 688
 			}
689 689
 		} else {
690
-			$paramfortooltipimg = ($extracss ? ' class="' . $extracss . '"' : '') . ($extrastyle ? ' style="' . $extrastyle . '"' : ''); // Attribute to put on td text tag
690
+			$paramfortooltipimg = ($extracss ? ' class="'.$extracss.'"' : '').($extrastyle ? ' style="'.$extrastyle.'"' : ''); // Attribute to put on td text tag
691 691
 		}
692 692
 		if ($tooltipon == 1 || $tooltipon == 3) {
693
-			$paramfortooltiptd = ' class="' . ($tooltipon == 3 ? 'cursorpointer ' : '') . $classfortooltip . ($tag != 'td' ? ' inline-block' : '') . ($extracss ? ' ' . $extracss : '') . '" style="padding: 0px;' . ($extrastyle ? ' ' . $extrastyle : '') . '" ';
693
+			$paramfortooltiptd = ' class="'.($tooltipon == 3 ? 'cursorpointer ' : '').$classfortooltip.($tag != 'td' ? ' inline-block' : '').($extracss ? ' '.$extracss : '').'" style="padding: 0px;'.($extrastyle ? ' '.$extrastyle : '').'" ';
694 694
 			if ($tooltiptrigger == '') {
695
-				$paramfortooltiptd .= ' title="' . ($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)) . '"'; // Attribute to put on td tag to store tooltip
695
+				$paramfortooltiptd .= ' title="'.($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)).'"'; // Attribute to put on td tag to store tooltip
696 696
 			} else {
697
-				$paramfortooltiptd .= ' dolid="' . $tooltiptrigger . '"';
697
+				$paramfortooltiptd .= ' dolid="'.$tooltiptrigger.'"';
698 698
 			}
699 699
 		} else {
700
-			$paramfortooltiptd = ($extracss ? ' class="' . $extracss . '"' : '') . ($extrastyle ? ' style="' . $extrastyle . '"' : ''); // Attribute to put on td text tag
700
+			$paramfortooltiptd = ($extracss ? ' class="'.$extracss.'"' : '').($extrastyle ? ' style="'.$extrastyle.'"' : ''); // Attribute to put on td text tag
701 701
 		}
702 702
 		if (empty($notabs)) {
703 703
 			$s .= '<table class="nobordernopadding"><tr style="height: auto;">';
704 704
 		} elseif ($notabs == 2) {
705
-			$s .= '<div class="inline-block' . ($forcenowrap ? ' nowrap' : '') . '">';
705
+			$s .= '<div class="inline-block'.($forcenowrap ? ' nowrap' : '').'">';
706 706
 		}
707 707
 		// Define value if value is before
708 708
 		if ($direction < 0) {
709
-			$s .= '<' . $tag . $paramfortooltipimg;
709
+			$s .= '<'.$tag.$paramfortooltipimg;
710 710
 			if ($tag == 'td') {
711 711
 				$s .= ' class="valigntop" width="14"';
712 712
 			}
713
-			$s .= '>' . $textfordialog . $img . '</' . $tag . '>';
713
+			$s .= '>'.$textfordialog.$img.'</'.$tag.'>';
714 714
 		}
715 715
 		// Use another method to help avoid having a space in value in order to use this value with jquery
716 716
 		// Define label
717 717
 		if ((string) $text != '') {
718
-			$s .= '<' . $tag . $paramfortooltiptd . '>' . $text . '</' . $tag . '>';
718
+			$s .= '<'.$tag.$paramfortooltiptd.'>'.$text.'</'.$tag.'>';
719 719
 		}
720 720
 		// Define value if value is after
721 721
 		if ($direction > 0) {
722
-			$s .= '<' . $tag . $paramfortooltipimg;
722
+			$s .= '<'.$tag.$paramfortooltipimg;
723 723
 			if ($tag == 'td') {
724 724
 				$s .= ' class="valignmiddle" width="14"';
725 725
 			}
726
-			$s .= '>' . $textfordialog . $img . '</' . $tag . '>';
726
+			$s .= '>'.$textfordialog.$img.'</'.$tag.'>';
727 727
 		}
728 728
 		if (empty($notabs)) {
729 729
 			$s .= '</tr></table>';
@@ -830,7 +830,7 @@  discard block
 block discarded – undo
830 830
 
831 831
 		$disabled = 0;
832 832
 		$ret = '<div class="centpercent center">';
833
-		$ret .= '<select class="flat' . (empty($conf->use_javascript_ajax) ? '' : ' hideobject') . ' ' . $name . ' ' . $name . 'select valignmiddle alignstart" id="' . $name . '" name="' . $name . '"' . ($disabled ? ' disabled="disabled"' : '') . '>';
833
+		$ret .= '<select class="flat'.(empty($conf->use_javascript_ajax) ? '' : ' hideobject').' '.$name.' '.$name.'select valignmiddle alignstart" id="'.$name.'" name="'.$name.'"'.($disabled ? ' disabled="disabled"' : '').'>';
834 834
 
835 835
 		// 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.
836 836
 		$parameters = array();
@@ -841,10 +841,10 @@  discard block
 block discarded – undo
841 841
 			return;
842 842
 		}
843 843
 		if (empty($reshook)) {
844
-			$ret .= '<option value="0"' . ($disabled ? ' disabled="disabled"' : '') . '>-- ' . $langs->trans("SelectAction") . ' --</option>';
844
+			$ret .= '<option value="0"'.($disabled ? ' disabled="disabled"' : '').'>-- '.$langs->trans("SelectAction").' --</option>';
845 845
 			if (is_array($arrayofaction)) {
846 846
 				foreach ($arrayofaction as $code => $label) {
847
-					$ret .= '<option value="' . $code . '"' . ($disabled ? ' disabled="disabled"' : '') . ' data-html="' . dol_escape_htmltag($label) . '">' . $label . '</option>';
847
+					$ret .= '<option value="'.$code.'"'.($disabled ? ' disabled="disabled"' : '').' data-html="'.dol_escape_htmltag($label).'">'.$label.'</option>';
848 848
 				}
849 849
 			}
850 850
 		}
@@ -853,17 +853,17 @@  discard block
 block discarded – undo
853 853
 		$ret .= '</select>';
854 854
 
855 855
 		if (empty($conf->dol_optimize_smallscreen)) {
856
-			$ret .= ajax_combobox('.' . $name . 'select');
856
+			$ret .= ajax_combobox('.'.$name.'select');
857 857
 		}
858 858
 
859 859
 		// 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
860 860
 		$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.
861
-		$ret .= '<input type="submit" disabled name="confirmmassaction"' . (empty($conf->use_javascript_ajax) ? '' : ' style="display: none"') . ' class="reposition button smallpaddingimp' . (empty($conf->use_javascript_ajax) ? '' : ' hideobject') . ' ' . $name . ' ' . $name . 'confirmed" value="' . dol_escape_htmltag($langs->trans("Confirm")) . '">';
861
+		$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")).'">';
862 862
 		$ret .= '</div>';
863 863
 
864 864
 		if (!empty($conf->use_javascript_ajax)) {
865 865
 			$ret .= '<!-- JS CODE TO ENABLE mass action select -->
866
-    		<script nonce="' . getNonce() . '">
866
+    		<script nonce="' . getNonce().'">
867 867
                         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 */
868 868
         		{
869 869
         			atleastoneselected=0;
@@ -874,11 +874,11 @@  discard block
 block discarded – undo
874 874
 
875 875
 					console.log("initCheckForSelect mode="+mode+" name="+name+" cssclass="+cssclass+" atleastoneselected="+atleastoneselected);
876 876
 
877
-    	  			if (atleastoneselected || ' . $alwaysvisible . ')
877
+    	  			if (atleastoneselected || ' . $alwaysvisible.')
878 878
     	  			{
879 879
                                     jQuery("."+name).show();
880
-        			    ' . ($selected ? 'if (atleastoneselected) { jQuery("."+name+"select").val("' . $selected . '").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', false); }' : '') . '
881
-        			    ' . ($selected ? 'if (! atleastoneselected) { jQuery("."+name+"select").val("0").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', true); } ' : '') . '
880
+        			    ' . ($selected ? 'if (atleastoneselected) { jQuery("."+name+"select").val("'.$selected.'").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', false); }' : '').'
881
+        			    ' . ($selected ? 'if (! atleastoneselected) { jQuery("."+name+"select").val("0").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', true); } ' : '').'
882 882
     	  			}
883 883
     	  			else
884 884
     	  			{
@@ -888,26 +888,26 @@  discard block
 block discarded – undo
888 888
         		}
889 889
 
890 890
         	jQuery(document).ready(function () {
891
-                    initCheckForSelect(0, "' . $name . '", "' . $cssclass . '");
892
-                    jQuery(".' . $cssclass . '").click(function() {
893
-                        initCheckForSelect(1, "' . $name . '", "' . $cssclass . '");
891
+                    initCheckForSelect(0, "' . $name.'", "'.$cssclass.'");
892
+                    jQuery(".' . $cssclass.'").click(function() {
893
+                        initCheckForSelect(1, "' . $name.'", "'.$cssclass.'");
894 894
                     });
895
-                    jQuery(".' . $name . 'select").change(function() {
895
+                    jQuery(".' . $name.'select").change(function() {
896 896
         				var massaction = $( this ).val();
897 897
         				var urlform = $( this ).closest("form").attr("action").replace("#show_files","");
898 898
         				if (massaction == "builddoc") {
899 899
                         	urlform = urlform + "#show_files";
900 900
     	            	}
901 901
         				$( this ).closest("form").attr("action", urlform);
902
-                    	console.log("we select a mass action name=' . $name . ' massaction="+massaction+" - "+urlform);
902
+                    	console.log("we select a mass action name=' . $name.' massaction="+massaction+" - "+urlform);
903 903
         	        	/* Warning: if you set submit button to disabled, post using Enter will no more work if there is no other button */
904 904
         				if ($(this).val() != \'0\') {
905
-                                        jQuery(".' . $name . 'confirmed").prop(\'disabled\', false);
906
-										jQuery(".' . $name . 'other").hide();	/* To disable if another div was open */
907
-                                        jQuery(".' . $name . '"+massaction).show();
905
+                                        jQuery(".' . $name.'confirmed").prop(\'disabled\', false);
906
+										jQuery(".' . $name.'other").hide();	/* To disable if another div was open */
907
+                                        jQuery(".' . $name.'"+massaction).show();
908 908
     	  				} else {
909
-                                        jQuery(".' . $name . 'confirmed").prop(\'disabled\', true);
910
-										jQuery(".' . $name . 'other").hide();	/* To disable any div open */
909
+                                        jQuery(".' . $name.'confirmed").prop(\'disabled\', true);
910
+										jQuery(".' . $name.'other").hide();	/* To disable any div open */
911 911
     	  				}
912 912
     	        });
913 913
         	});
@@ -951,14 +951,14 @@  discard block
 block discarded – undo
951 951
 		$atleastonefavorite = 0;
952 952
 
953 953
 		$sql = "SELECT rowid, code as code_iso, code_iso as code_iso3, label, favorite, eec";
954
-		$sql .= " FROM " . $this->db->prefix() . "c_country";
954
+		$sql .= " FROM ".$this->db->prefix()."c_country";
955 955
 		$sql .= " WHERE active > 0";
956 956
 		//$sql.= " ORDER BY code ASC";
957 957
 
958
-		dol_syslog(get_class($this) . "::select_country", LOG_DEBUG);
958
+		dol_syslog(get_class($this)."::select_country", LOG_DEBUG);
959 959
 		$resql = $this->db->query($sql);
960 960
 		if ($resql) {
961
-			$out .= '<select id="select' . $htmlname . '" class="flat maxwidth200onsmartphone selectcountry' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" ' . $htmloption . '>';
961
+			$out .= '<select id="select'.$htmlname.'" class="flat maxwidth200onsmartphone selectcountry'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" '.$htmloption.'>';
962 962
 			$num = $this->db->num_rows($resql);
963 963
 			$i = 0;
964 964
 			if ($num) {
@@ -968,7 +968,7 @@  discard block
 block discarded – undo
968 968
 					$countryArray[$i]['rowid'] = $obj->rowid;
969 969
 					$countryArray[$i]['code_iso'] = $obj->code_iso;
970 970
 					$countryArray[$i]['code_iso3'] = $obj->code_iso3;
971
-					$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 : ''));
971
+					$countryArray[$i]['label'] = ($obj->code_iso && $langs->transnoentitiesnoconv("Country".$obj->code_iso) != "Country".$obj->code_iso ? $langs->transnoentitiesnoconv("Country".$obj->code_iso) : ($obj->label != '-' ? $obj->label : ''));
972 972
 					$countryArray[$i]['favorite'] = $obj->favorite;
973 973
 					$countryArray[$i]['eec'] = $obj->eec;
974 974
 					$favorite[$i] = $obj->favorite;
@@ -986,20 +986,20 @@  discard block
 block discarded – undo
986 986
 
987 987
 				if ($showempty) {
988 988
 					if (is_numeric($showempty)) {
989
-						$out .= '<option value="">&nbsp;</option>' . "\n";
989
+						$out .= '<option value="">&nbsp;</option>'."\n";
990 990
 					} else {
991
-						$out .= '<option value="-1">' . $langs->trans($showempty) . '</option>' . "\n";
991
+						$out .= '<option value="-1">'.$langs->trans($showempty).'</option>'."\n";
992 992
 					}
993 993
 				}
994 994
 
995 995
 				if ($addspecialentries) {    // Add dedicated entries for groups of countries
996 996
 					//if ($showempty) $out.= '<option value="" disabled class="selectoptiondisabledwhite">--------------</option>';
997
-					$out .= '<option value="special_allnotme"' . ($selected == 'special_allnotme' ? ' selected' : '') . '>' . $langs->trans("CountriesExceptMe", $langs->transnoentitiesnoconv("Country" . $mysoc->country_code)) . '</option>';
998
-					$out .= '<option value="special_eec"' . ($selected == 'special_eec' ? ' selected' : '') . '>' . $langs->trans("CountriesInEEC") . '</option>';
997
+					$out .= '<option value="special_allnotme"'.($selected == 'special_allnotme' ? ' selected' : '').'>'.$langs->trans("CountriesExceptMe", $langs->transnoentitiesnoconv("Country".$mysoc->country_code)).'</option>';
998
+					$out .= '<option value="special_eec"'.($selected == 'special_eec' ? ' selected' : '').'>'.$langs->trans("CountriesInEEC").'</option>';
999 999
 					if ($mysoc->isInEEC()) {
1000
-						$out .= '<option value="special_eecnotme"' . ($selected == 'special_eecnotme' ? ' selected' : '') . '>' . $langs->trans("CountriesInEECExceptMe", $langs->transnoentitiesnoconv("Country" . $mysoc->country_code)) . '</option>';
1000
+						$out .= '<option value="special_eecnotme"'.($selected == 'special_eecnotme' ? ' selected' : '').'>'.$langs->trans("CountriesInEECExceptMe", $langs->transnoentitiesnoconv("Country".$mysoc->country_code)).'</option>';
1001 1001
 					}
1002
-					$out .= '<option value="special_noteec"' . ($selected == 'special_noteec' ? ' selected' : '') . '>' . $langs->trans("CountriesNotInEEC") . '</option>';
1002
+					$out .= '<option value="special_noteec"'.($selected == 'special_noteec' ? ' selected' : '').'>'.$langs->trans("CountriesNotInEEC").'</option>';
1003 1003
 					$out .= '<option value="" disabled class="selectoptiondisabledwhite">------------</option>';
1004 1004
 				}
1005 1005
 
@@ -1027,20 +1027,20 @@  discard block
 block discarded – undo
1027 1027
 						$labeltoshow .= '&nbsp;';
1028 1028
 					}
1029 1029
 					if ($row['code_iso']) {
1030
-						$labeltoshow .= ' <span class="opacitymedium">(' . $row['code_iso'] . ')</span>';
1030
+						$labeltoshow .= ' <span class="opacitymedium">('.$row['code_iso'].')</span>';
1031 1031
 						if (empty($hideflags)) {
1032 1032
 							$tmpflag = picto_from_langcode($row['code_iso'], 'class="saturatemedium paddingrightonly"', 1);
1033
-							$labeltoshow = $tmpflag . ' ' . $labeltoshow;
1033
+							$labeltoshow = $tmpflag.' '.$labeltoshow;
1034 1034
 						}
1035 1035
 					}
1036 1036
 
1037 1037
 					if ($selected && $selected != '-1' && ($selected == $row['rowid'] || $selected == $row['code_iso'] || $selected == $row['code_iso3'] || $selected == $row['label'])) {
1038
-						$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']) . '">';
1038
+						$out .= '<option value="'.($usecodeaskey ? ($usecodeaskey == 'code2' ? $row['code_iso'] : $row['code_iso3']) : $row['rowid']).'" selected data-html="'.dol_escape_htmltag($labeltoshow).'" data-eec="'.((int) $row['eec']).'">';
1039 1039
 					} else {
1040
-						$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']) . '">';
1040
+						$out .= '<option value="'.($usecodeaskey ? ($usecodeaskey == 'code2' ? $row['code_iso'] : $row['code_iso3']) : $row['rowid']).'" data-html="'.dol_escape_htmltag($labeltoshow).'" data-eec="'.((int) $row['eec']).'">';
1041 1041
 					}
1042 1042
 					$out .= dol_string_nohtmltag($labeltoshow);
1043
-					$out .= '</option>' . "\n";
1043
+					$out .= '</option>'."\n";
1044 1044
 				}
1045 1045
 			}
1046 1046
 			$out .= '</select>';
@@ -1050,8 +1050,8 @@  discard block
 block discarded – undo
1050 1050
 
1051 1051
 		// Make select dynamic
1052 1052
 		if (empty($forcecombo)) {
1053
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
1054
-			$out .= ajax_combobox('select' . $htmlname, array(), 0, 0, 'resolve');
1053
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
1054
+			$out .= ajax_combobox('select'.$htmlname, array(), 0, 0, 'resolve');
1055 1055
 		}
1056 1056
 
1057 1057
 		return $out;
@@ -1084,25 +1084,25 @@  discard block
 block discarded – undo
1084 1084
 		$incotermArray = array();
1085 1085
 
1086 1086
 		$sql = "SELECT rowid, code";
1087
-		$sql .= " FROM " . $this->db->prefix() . "c_incoterms";
1087
+		$sql .= " FROM ".$this->db->prefix()."c_incoterms";
1088 1088
 		$sql .= " WHERE active > 0";
1089 1089
 		$sql .= " ORDER BY code ASC";
1090 1090
 
1091
-		dol_syslog(get_class($this) . "::select_incoterm", LOG_DEBUG);
1091
+		dol_syslog(get_class($this)."::select_incoterm", LOG_DEBUG);
1092 1092
 		$resql = $this->db->query($sql);
1093 1093
 		if ($resql) {
1094 1094
 			if ($conf->use_javascript_ajax && !$forcecombo) {
1095
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
1095
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
1096 1096
 				$out .= ajax_combobox($htmlname, $events);
1097 1097
 			}
1098 1098
 
1099 1099
 			if (!empty($page)) {
1100
-				$out .= '<form method="post" action="' . $page . '">';
1100
+				$out .= '<form method="post" action="'.$page.'">';
1101 1101
 				$out .= '<input type="hidden" name="action" value="set_incoterms">';
1102
-				$out .= '<input type="hidden" name="token" value="' . newToken() . '">';
1102
+				$out .= '<input type="hidden" name="token" value="'.newToken().'">';
1103 1103
 			}
1104 1104
 
1105
-			$out .= '<select id="' . $htmlname . '" class="flat selectincoterm width75" name="' . $htmlname . '" ' . $htmloption . '>';
1105
+			$out .= '<select id="'.$htmlname.'" class="flat selectincoterm width75" name="'.$htmlname.'" '.$htmloption.'>';
1106 1106
 			$out .= '<option value="0">&nbsp;</option>';
1107 1107
 			$num = $this->db->num_rows($resql);
1108 1108
 			$i = 0;
@@ -1116,9 +1116,9 @@  discard block
 block discarded – undo
1116 1116
 
1117 1117
 				foreach ($incotermArray as $row) {
1118 1118
 					if ($selected && ($selected == $row['rowid'] || $selected == $row['code'])) {
1119
-						$out .= '<option value="' . $row['rowid'] . '" selected>';
1119
+						$out .= '<option value="'.$row['rowid'].'" selected>';
1120 1120
 					} else {
1121
-						$out .= '<option value="' . $row['rowid'] . '">';
1121
+						$out .= '<option value="'.$row['rowid'].'">';
1122 1122
 					}
1123 1123
 
1124 1124
 					if ($row['code']) {
@@ -1132,13 +1132,13 @@  discard block
 block discarded – undo
1132 1132
 			$out .= ajax_combobox($htmlname);
1133 1133
 
1134 1134
 			if ($conf->use_javascript_ajax && empty($disableautocomplete)) {
1135
-				$out .= ajax_multiautocompleter('location_incoterms', array(), DOL_URL_ROOT . '/core/ajax/locationincoterms.php') . "\n";
1135
+				$out .= ajax_multiautocompleter('location_incoterms', array(), DOL_URL_ROOT.'/core/ajax/locationincoterms.php')."\n";
1136 1136
 				//$moreattrib .= ' autocomplete="off"';
1137 1137
 			}
1138
-			$out .= '<input id="location_incoterms" class="maxwidthonsmartphone type="text" name="location_incoterms" value="' . $location_incoterms . '">' . "\n";
1138
+			$out .= '<input id="location_incoterms" class="maxwidthonsmartphone type="text" name="location_incoterms" value="'.$location_incoterms.'">'."\n";
1139 1139
 
1140 1140
 			if (!empty($page)) {
1141
-				$out .= '<input type="submit" class="button valignmiddle smallpaddingimp nomargintop nomarginbottom" value="' . $langs->trans("Modify") . '"></form>';
1141
+				$out .= '<input type="submit" class="button valignmiddle smallpaddingimp nomargintop nomarginbottom" value="'.$langs->trans("Modify").'"></form>';
1142 1142
 			}
1143 1143
 		} else {
1144 1144
 			dol_print_error($this->db);
@@ -1173,7 +1173,7 @@  discard block
 block discarded – undo
1173 1173
 			if (empty($hidetext)) {
1174 1174
 				print $langs->trans("Type").'...';
1175 1175
 			}
1176
-			print '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="select_' . $htmlname . '" name="' . $htmlname . '">';
1176
+			print '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="select_'.$htmlname.'" name="'.$htmlname.'">';
1177 1177
 			if ($showempty) {
1178 1178
 				print '<option value="-1" class="opacitymedium"'.($useajaxcombo ? '' : ' disabled="disabled"');
1179 1179
 				if ($selected == -1) {
@@ -1192,31 +1192,31 @@  discard block
 block discarded – undo
1192 1192
 			if (0 == $selected || ($selected == -1 && getDolGlobalString('MAIN_FREE_PRODUCT_CHECKED_BY_DEFAULT') == 'product')) {
1193 1193
 				print ' selected';
1194 1194
 			}
1195
-			print '>' . $langs->trans("Product");
1195
+			print '>'.$langs->trans("Product");
1196 1196
 
1197 1197
 			print '<option value="1"';
1198 1198
 			if (1 == $selected || ($selected == -1 && getDolGlobalString('MAIN_FREE_PRODUCT_CHECKED_BY_DEFAULT') == 'service')) {
1199 1199
 				print ' selected';
1200 1200
 			}
1201
-			print '>' . $langs->trans("Service");
1201
+			print '>'.$langs->trans("Service");
1202 1202
 
1203 1203
 			print '</select>';
1204 1204
 
1205 1205
 			if ($useajaxcombo) {
1206
-				print ajax_combobox('select_' . $htmlname);
1206
+				print ajax_combobox('select_'.$htmlname);
1207 1207
 			}
1208 1208
 			//if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1);
1209 1209
 		}
1210 1210
 		if ((empty($forceall) && !isModEnabled('product') && isModEnabled("service")) || $forceall == 3) {
1211 1211
 			print $langs->trans("Service");
1212
-			print '<input type="hidden" name="' . $htmlname . '" value="1">';
1212
+			print '<input type="hidden" name="'.$htmlname.'" value="1">';
1213 1213
 		}
1214 1214
 		if ((empty($forceall) && isModEnabled("product") && !isModEnabled('service')) || $forceall == 2) {
1215 1215
 			print $langs->trans("Product");
1216
-			print '<input type="hidden" name="' . $htmlname . '" value="0">';
1216
+			print '<input type="hidden" name="'.$htmlname.'" value="0">';
1217 1217
 		}
1218 1218
 		if ($forceall < 0) {    // This should happened only for contracts when both predefined product and service are disabled.
1219
-			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
1219
+			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
1220 1220
 		}
1221 1221
 	}
1222 1222
 
@@ -1242,7 +1242,7 @@  discard block
 block discarded – undo
1242 1242
 		$langs->load("trips");
1243 1243
 
1244 1244
 		$sql = "SELECT c.code, c.label";
1245
-		$sql .= " FROM " . $this->db->prefix() . "c_type_fees as c";
1245
+		$sql .= " FROM ".$this->db->prefix()."c_type_fees as c";
1246 1246
 		$sql .= " WHERE active > 0";
1247 1247
 
1248 1248
 		$resql = $this->db->query($sql);
@@ -1283,11 +1283,11 @@  discard block
 block discarded – undo
1283 1283
 		// phpcs:enable
1284 1284
 		global $user, $langs;
1285 1285
 
1286
-		dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG);
1286
+		dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG);
1287 1287
 
1288 1288
 		$this->load_cache_types_fees();
1289 1289
 
1290
-		print '<select id="select_' . $htmlname . '" class="flat" name="' . $htmlname . '">';
1290
+		print '<select id="select_'.$htmlname.'" class="flat" name="'.$htmlname.'">';
1291 1291
 		if ($showempty) {
1292 1292
 			print '<option value="-1"';
1293 1293
 			if ($selected == -1) {
@@ -1297,7 +1297,7 @@  discard block
 block discarded – undo
1297 1297
 		}
1298 1298
 
1299 1299
 		foreach ($this->cache_types_fees as $key => $value) {
1300
-			print '<option value="' . $key . '"';
1300
+			print '<option value="'.$key.'"';
1301 1301
 			if ($key == $selected) {
1302 1302
 				print ' selected';
1303 1303
 			}
@@ -1349,12 +1349,12 @@  discard block
 block discarded – undo
1349 1349
 				$ajaxoptions = array();
1350 1350
 			}
1351 1351
 
1352
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
1352
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
1353 1353
 
1354 1354
 			// No immediate load of all database
1355 1355
 			$placeholder = '';
1356 1356
 			if ($selected && empty($selected_input_value)) {
1357
-				require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
1357
+				require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
1358 1358
 				$societetmp = new Societe($this->db);
1359 1359
 				$societetmp->fetch($selected);
1360 1360
 				$selected_input_value = $societetmp->name;
@@ -1362,11 +1362,11 @@  discard block
 block discarded – undo
1362 1362
 			}
1363 1363
 
1364 1364
 			// mode 1
1365
-			$urloption = 'htmlname=' . urlencode((string) (str_replace('.', '_', $htmlname))) . '&outjson=1&filter=' . urlencode((string) ($filter)) . (empty($excludeids) ? '' : '&excludeids=' . implode(',', $excludeids)) . ($showtype ? '&showtype=' . urlencode((string) ($showtype)) : '') . ($showcode ? '&showcode=' . urlencode((string) ($showcode)) : '');
1365
+			$urloption = 'htmlname='.urlencode((string) (str_replace('.', '_', $htmlname))).'&outjson=1&filter='.urlencode((string) ($filter)).(empty($excludeids) ? '' : '&excludeids='.implode(',', $excludeids)).($showtype ? '&showtype='.urlencode((string) ($showtype)) : '').($showcode ? '&showcode='.urlencode((string) ($showcode)) : '');
1366 1366
 
1367 1367
 			$out .= '<!-- force css to be higher than dialog popup --><style type="text/css">.ui-autocomplete { z-index: 1010; }</style>';
1368 1368
 			if (empty($hidelabel)) {
1369
-				$out .= $langs->trans("RefOrLabel") . ' : ';
1369
+				$out .= $langs->trans("RefOrLabel").' : ';
1370 1370
 			} elseif ($hidelabel == 1 && !is_numeric($showempty)) {
1371 1371
 				$placeholder = $langs->trans($showempty);
1372 1372
 			} elseif ($hidelabel > 1) {
@@ -1375,7 +1375,7 @@  discard block
 block discarded – undo
1375 1375
 					$out .= img_picto($langs->trans("Search"), 'search');
1376 1376
 				}
1377 1377
 			}
1378
-			$out .= '<input type="text" class="' . $morecss . '" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . ($placeholder ? ' placeholder="' . dol_escape_htmltag($placeholder) . '"' : '') . ' ' . (getDolGlobalString('THIRDPARTY_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />';
1378
+			$out .= '<input type="text" class="'.$morecss.'" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.($placeholder ? ' placeholder="'.dol_escape_htmltag($placeholder).'"' : '').' '.(getDolGlobalString('THIRDPARTY_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />';
1379 1379
 			if ($hidelabel == 3) {
1380 1380
 				$out .= img_picto($langs->trans("Search"), 'search');
1381 1381
 			}
@@ -1437,12 +1437,12 @@  discard block
 block discarded – undo
1437 1437
 				$events = array();
1438 1438
 			}
1439 1439
 
1440
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
1440
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
1441 1441
 
1442 1442
 			// No immediate load of all database
1443 1443
 			$placeholder = '';
1444 1444
 			if ($selected && empty($selected_input_value)) {
1445
-				require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php';
1445
+				require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
1446 1446
 				$contacttmp = new Contact($this->db);
1447 1447
 				$contacttmp->fetch($selected);
1448 1448
 				$selected_input_value = $contacttmp->getFullName($langs);
@@ -1453,11 +1453,11 @@  discard block
 block discarded – undo
1453 1453
 			}
1454 1454
 
1455 1455
 			// mode 1
1456
-			$urloption = 'htmlname=' . urlencode((string) (str_replace('.', '_', $htmlname))) . '&outjson=1&filter=' . urlencode((string) ($filter)) . (empty($exclude) ? '' : '&exclude=' . urlencode($exclude)) . ($showsoc ? '&showsoc=' . urlencode((string) ($showsoc)) : '');
1456
+			$urloption = 'htmlname='.urlencode((string) (str_replace('.', '_', $htmlname))).'&outjson=1&filter='.urlencode((string) ($filter)).(empty($exclude) ? '' : '&exclude='.urlencode($exclude)).($showsoc ? '&showsoc='.urlencode((string) ($showsoc)) : '');
1457 1457
 
1458 1458
 			$out .= '<!-- force css to be higher than dialog popup --><style type="text/css">.ui-autocomplete { z-index: 1010; }</style>';
1459 1459
 
1460
-			$out .= '<input type="text" class="' . $morecss . '" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . ($placeholder ? ' placeholder="' . dol_escape_htmltag($placeholder) . '"' : '') . ' ' . (getDolGlobalString('CONTACT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />';
1460
+			$out .= '<input type="text" class="'.$morecss.'" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.($placeholder ? ' placeholder="'.dol_escape_htmltag($placeholder).'"' : '').' '.(getDolGlobalString('CONTACT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />';
1461 1461
 
1462 1462
 			$out .= ajax_event($htmlname, $events);
1463 1463
 
@@ -1556,30 +1556,30 @@  discard block
 block discarded – undo
1556 1556
 			$sql .= ", s.address, s.zip, s.town";
1557 1557
 			$sql .= ", dictp.code as country_code";
1558 1558
 		}
1559
-		$sql .= " FROM " . $this->db->prefix() . "societe as s";
1559
+		$sql .= " FROM ".$this->db->prefix()."societe as s";
1560 1560
 		if (getDolGlobalString('COMPANY_SHOW_ADDRESS_SELECTLIST')) {
1561
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "c_country as dictp ON dictp.rowid = s.fk_pays";
1561
+			$sql .= " LEFT JOIN ".$this->db->prefix()."c_country as dictp ON dictp.rowid = s.fk_pays";
1562 1562
 		}
1563 1563
 		if (!$user->hasRight('societe', 'client', 'voir')) {
1564
-			$sql .= ", " . $this->db->prefix() . "societe_commerciaux as sc";
1564
+			$sql .= ", ".$this->db->prefix()."societe_commerciaux as sc";
1565 1565
 		}
1566
-		$sql .= " WHERE s.entity IN (" . getEntity('societe') . ")";
1566
+		$sql .= " WHERE s.entity IN (".getEntity('societe').")";
1567 1567
 		if (!empty($user->socid)) {
1568
-			$sql .= " AND s.rowid = " . ((int) $user->socid);
1568
+			$sql .= " AND s.rowid = ".((int) $user->socid);
1569 1569
 		}
1570 1570
 		if ($filter) {
1571 1571
 			// $filter is safe because, if it contains '(' or ')', it has been sanitized by testSqlAndScriptInject() and forgeSQLFromUniversalSearchCriteria()
1572 1572
 			// if not, by testSqlAndScriptInject() only.
1573
-			$sql .= " AND (" . $filter . ")";
1573
+			$sql .= " AND (".$filter.")";
1574 1574
 		}
1575 1575
 		if (!$user->hasRight('societe', 'client', 'voir')) {
1576
-			$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " . ((int) $user->id);
1576
+			$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
1577 1577
 		}
1578 1578
 		if (getDolGlobalString('COMPANY_HIDE_INACTIVE_IN_COMBOBOX')) {
1579 1579
 			$sql .= " AND s.status <> 0";
1580 1580
 		}
1581 1581
 		if (!empty($excludeids)) {
1582
-			$sql .= " AND s.rowid NOT IN (" . $this->db->sanitize(implode(',', $excludeids)) . ")";
1582
+			$sql .= " AND s.rowid NOT IN (".$this->db->sanitize(implode(',', $excludeids)).")";
1583 1583
 		}
1584 1584
 		// Add where from hooks
1585 1585
 		$parameters = array();
@@ -1599,17 +1599,17 @@  discard block
 block discarded – undo
1599 1599
 				if ($i > 0) {
1600 1600
 					$sql .= " AND ";
1601 1601
 				}
1602
-				$sql .= "(s.nom LIKE '" . $this->db->escape($prefix . $crit) . "%')";
1602
+				$sql .= "(s.nom LIKE '".$this->db->escape($prefix.$crit)."%')";
1603 1603
 				$i++;
1604 1604
 			}
1605 1605
 			if (count($search_crit) > 1) {
1606 1606
 				$sql .= ")";
1607 1607
 			}
1608 1608
 			if (isModEnabled('barcode')) {
1609
-				$sql .= " OR s.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
1609
+				$sql .= " OR s.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'";
1610 1610
 			}
1611
-			$sql .= " OR s.code_client LIKE '" . $this->db->escape($prefix . $filterkey) . "%' OR s.code_fournisseur LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
1612
-			$sql .= " OR s.name_alias LIKE '" . $this->db->escape($prefix . $filterkey) . "%' OR s.tva_intra LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
1611
+			$sql .= " OR s.code_client LIKE '".$this->db->escape($prefix.$filterkey)."%' OR s.code_fournisseur LIKE '".$this->db->escape($prefix.$filterkey)."%'";
1612
+			$sql .= " OR s.name_alias LIKE '".$this->db->escape($prefix.$filterkey)."%' OR s.tva_intra LIKE '".$this->db->escape($prefix.$filterkey)."%'";
1613 1613
 			$sql .= ")";
1614 1614
 		}
1615 1615
 		$sql .= $this->db->order("nom", "ASC");
@@ -1620,7 +1620,7 @@  discard block
 block discarded – undo
1620 1620
 		$resql = $this->db->query($sql);
1621 1621
 		if ($resql) {
1622 1622
 			// Construct $out and $outarray
1623
-			$out .= '<select id="' . $htmlname . '" class="flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($moreparam ? ' ' . $moreparam : '') . ' name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . '>' . "\n";
1623
+			$out .= '<select id="'.$htmlname.'" class="flat'.($morecss ? ' '.$morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').'>'."\n";
1624 1624
 
1625 1625
 			$textifempty = (($showempty && !is_numeric($showempty)) ? $langs->trans($showempty) : '');
1626 1626
 			if (getDolGlobalString('COMPANY_USE_SEARCH_TO_SELECT')) {
@@ -1633,7 +1633,7 @@  discard block
 block discarded – undo
1633 1633
 				}
1634 1634
 			}
1635 1635
 			if ($showempty) {
1636
-				$out .= '<option value="-1" data-html="' . dol_escape_htmltag('<span class="opacitymedium">' . ($textifempty ? $textifempty : '&nbsp;') . '</span>') . '">' . $textifempty . '</option>' . "\n";
1636
+				$out .= '<option value="-1" data-html="'.dol_escape_htmltag('<span class="opacitymedium">'.($textifempty ? $textifempty : '&nbsp;').'</span>').'">'.$textifempty.'</option>'."\n";
1637 1637
 			}
1638 1638
 
1639 1639
 			$companytemp = new Societe($this->db);
@@ -1646,18 +1646,18 @@  discard block
 block discarded – undo
1646 1646
 					$label = '';
1647 1647
 					if ($showcode || getDolGlobalString('SOCIETE_ADD_REF_IN_LIST')) {
1648 1648
 						if (($obj->client) && (!empty($obj->code_client))) {
1649
-							$label = $obj->code_client . ' - ';
1649
+							$label = $obj->code_client.' - ';
1650 1650
 						}
1651 1651
 						if (($obj->fournisseur) && (!empty($obj->code_fournisseur))) {
1652
-							$label .= $obj->code_fournisseur . ' - ';
1652
+							$label .= $obj->code_fournisseur.' - ';
1653 1653
 						}
1654
-						$label .= ' ' . $obj->name;
1654
+						$label .= ' '.$obj->name;
1655 1655
 					} else {
1656 1656
 						$label = $obj->name;
1657 1657
 					}
1658 1658
 
1659 1659
 					if (!empty($obj->name_alias)) {
1660
-						$label .= ' (' . $obj->name_alias . ')';
1660
+						$label .= ' ('.$obj->name_alias.')';
1661 1661
 					}
1662 1662
 
1663 1663
 					if (getDolGlobalString('SOCIETE_SHOW_VAT_IN_LIST') && !empty($obj->tva_intra)) {
@@ -1672,7 +1672,7 @@  discard block
 block discarded – undo
1672 1672
 						$companytemp->fournisseur = $obj->fournisseur;
1673 1673
 						$tmptype = $companytemp->getTypeUrl(1, '', 0, 'span');
1674 1674
 						if ($tmptype) {
1675
-							$labelhtml .= ' ' . $tmptype;
1675
+							$labelhtml .= ' '.$tmptype;
1676 1676
 						}
1677 1677
 
1678 1678
 						if ($obj->client || $obj->fournisseur) {
@@ -1682,10 +1682,10 @@  discard block
 block discarded – undo
1682 1682
 							$label .= $langs->trans("Customer");
1683 1683
 						}
1684 1684
 						if ($obj->client == 2 || $obj->client == 3) {
1685
-							$label .= ($obj->client == 3 ? ', ' : '') . $langs->trans("Prospect");
1685
+							$label .= ($obj->client == 3 ? ', ' : '').$langs->trans("Prospect");
1686 1686
 						}
1687 1687
 						if ($obj->fournisseur) {
1688
-							$label .= ($obj->client ? ', ' : '') . $langs->trans("Supplier");
1688
+							$label .= ($obj->client ? ', ' : '').$langs->trans("Supplier");
1689 1689
 						}
1690 1690
 						if ($obj->client || $obj->fournisseur) {
1691 1691
 							$label .= ')';
@@ -1693,9 +1693,9 @@  discard block
 block discarded – undo
1693 1693
 					}
1694 1694
 
1695 1695
 					if (getDolGlobalString('COMPANY_SHOW_ADDRESS_SELECTLIST')) {
1696
-						$s = ($obj->address ? ' - ' . $obj->address : '') . ($obj->zip ? ' - ' . $obj->zip : '') . ($obj->town ? ' ' . $obj->town : '');
1696
+						$s = ($obj->address ? ' - '.$obj->address : '').($obj->zip ? ' - '.$obj->zip : '').($obj->town ? ' '.$obj->town : '');
1697 1697
 						if (!empty($obj->country_code)) {
1698
-							$s .= ', ' . $langs->trans('Country' . $obj->country_code);
1698
+							$s .= ', '.$langs->trans('Country'.$obj->country_code);
1699 1699
 						}
1700 1700
 						$label .= $s;
1701 1701
 						$labelhtml .= $s;
@@ -1703,9 +1703,9 @@  discard block
 block discarded – undo
1703 1703
 
1704 1704
 					if (empty($outputmode)) {
1705 1705
 						if (in_array($obj->rowid, $selected)) {
1706
-							$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>';
1706
+							$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>';
1707 1707
 						} else {
1708
-							$out .= '<option value="' . $obj->rowid . '" data-html="' . dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1) . '">' . dol_escape_htmltag($label, 0, 0, '', 0, 1) . '</option>';
1708
+							$out .= '<option value="'.$obj->rowid.'" data-html="'.dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1).'">'.dol_escape_htmltag($label, 0, 0, '', 0, 1).'</option>';
1709 1709
 						}
1710 1710
 					} else {
1711 1711
 						array_push($outarray, array('key' => $obj->rowid, 'value' => $label, 'label' => $label, 'labelhtml' => $labelhtml));
@@ -1717,9 +1717,9 @@  discard block
 block discarded – undo
1717 1717
 					}
1718 1718
 				}
1719 1719
 			}
1720
-			$out .= '</select>' . "\n";
1720
+			$out .= '</select>'."\n";
1721 1721
 			if (!$forcecombo) {
1722
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
1722
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
1723 1723
 				$out .= ajax_combobox($htmlname, $events, getDolGlobalInt("COMPANY_USE_SEARCH_TO_SELECT"));
1724 1724
 			}
1725 1725
 		} else {
@@ -1808,7 +1808,7 @@  discard block
 block discarded – undo
1808 1808
 		}
1809 1809
 
1810 1810
 		if (!is_object($hookmanager)) {
1811
-			include_once DOL_DOCUMENT_ROOT . '/core/class/hookmanager.class.php';
1811
+			include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
1812 1812
 			$hookmanager = new HookManager($this->db);
1813 1813
 		}
1814 1814
 
@@ -1817,14 +1817,14 @@  discard block
 block discarded – undo
1817 1817
 		if ($showsoc > 0 || getDolGlobalString('CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST')) {
1818 1818
 			$sql .= ", s.nom as company, s.town AS company_town";
1819 1819
 		}
1820
-		$sql .= " FROM " . $this->db->prefix() . "socpeople as sp";
1820
+		$sql .= " FROM ".$this->db->prefix()."socpeople as sp";
1821 1821
 		if ($showsoc > 0 || getDolGlobalString('CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST')) {
1822
-			$sql .= " LEFT OUTER JOIN  " . $this->db->prefix() . "societe as s ON s.rowid=sp.fk_soc";
1822
+			$sql .= " LEFT OUTER JOIN  ".$this->db->prefix()."societe as s ON s.rowid=sp.fk_soc";
1823 1823
 		}
1824
-		$sql .= " WHERE sp.entity IN (" . getEntity('contact') . ")";
1824
+		$sql .= " WHERE sp.entity IN (".getEntity('contact').")";
1825 1825
 		$sql .= " AND ((sp.fk_user_creat = ".((int) $user->id)." AND sp.priv = 1) OR sp.priv = 0)"; // check if this is a private contact
1826 1826
 		if ($socid > 0 || $socid == -1) {
1827
-			$sql .= " AND sp.fk_soc = " . ((int) $socid);
1827
+			$sql .= " AND sp.fk_soc = ".((int) $socid);
1828 1828
 		}
1829 1829
 		if (getDolGlobalString('CONTACT_HIDE_INACTIVE_IN_COMBOBOX')) {
1830 1830
 			$sql .= " AND sp.statut <> 0";
@@ -1832,7 +1832,7 @@  discard block
 block discarded – undo
1832 1832
 		if ($filter) {
1833 1833
 			// $filter is safe because, if it contains '(' or ')', it has been sanitized by testSqlAndScriptInject() and forgeSQLFromUniversalSearchCriteria()
1834 1834
 			// if not, by testSqlAndScriptInject() only.
1835
-			$sql .= " AND (" . $filter . ")";
1835
+			$sql .= " AND (".$filter.")";
1836 1836
 		}
1837 1837
 		// Add where from hooks
1838 1838
 		$parameters = array();
@@ -1840,30 +1840,30 @@  discard block
 block discarded – undo
1840 1840
 		$sql .= $hookmanager->resPrint;
1841 1841
 		$sql .= " ORDER BY sp.lastname ASC";
1842 1842
 
1843
-		dol_syslog(get_class($this) . "::selectcontacts", LOG_DEBUG);
1843
+		dol_syslog(get_class($this)."::selectcontacts", LOG_DEBUG);
1844 1844
 		$resql = $this->db->query($sql);
1845 1845
 		if ($resql) {
1846 1846
 			$num = $this->db->num_rows($resql);
1847 1847
 
1848 1848
 			if ($htmlname != 'none' && !$options_only) {
1849
-				$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlid . '" name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . (($num || empty($disableifempty)) ? '' : ' disabled') . ($multiple ? 'multiple' : '') . ' ' . (!empty($moreparam) ? $moreparam : '') . '>';
1849
+				$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="'.$htmlid.'" name="'.$htmlname.($multiple ? '[]' : '').'" '.(($num || empty($disableifempty)) ? '' : ' disabled').($multiple ? 'multiple' : '').' '.(!empty($moreparam) ? $moreparam : '').'>';
1850 1850
 			}
1851 1851
 
1852 1852
 			if ($showempty && !is_numeric($showempty)) {
1853 1853
 				$textforempty = $showempty;
1854
-				$out .= '<option class="optiongrey" value="-1"' . (in_array(-1, $selected) ? ' selected' : '') . '>' . $textforempty . '</option>';
1854
+				$out .= '<option class="optiongrey" value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'>'.$textforempty.'</option>';
1855 1855
 			} else {
1856 1856
 				if (($showempty == 1 || ($showempty == 3 && $num > 1)) && !$multiple) {
1857
-					$out .= '<option value="0"' . (in_array(0, $selected) ? ' selected' : '') . '>&nbsp;</option>';
1857
+					$out .= '<option value="0"'.(in_array(0, $selected) ? ' selected' : '').'>&nbsp;</option>';
1858 1858
 				}
1859 1859
 				if ($showempty == 2) {
1860
-					$out .= '<option value="0"' . (in_array(0, $selected) ? ' selected' : '') . '>-- ' . $langs->trans("Internal") . ' --</option>';
1860
+					$out .= '<option value="0"'.(in_array(0, $selected) ? ' selected' : '').'>-- '.$langs->trans("Internal").' --</option>';
1861 1861
 				}
1862 1862
 			}
1863 1863
 
1864 1864
 			$i = 0;
1865 1865
 			if ($num) {
1866
-				include_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php';
1866
+				include_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
1867 1867
 				$contactstatic = new Contact($this->db);
1868 1868
 
1869 1869
 				while ($i < $num) {
@@ -1899,7 +1899,7 @@  discard block
 block discarded – undo
1899 1899
 						}
1900 1900
 						$extendedInfos = implode(' - ', $extendedInfos);
1901 1901
 						if (!empty($extendedInfos)) {
1902
-							$extendedInfos = ' - ' . $extendedInfos;
1902
+							$extendedInfos = ' - '.$extendedInfos;
1903 1903
 						}
1904 1904
 					}
1905 1905
 
@@ -1917,35 +1917,35 @@  discard block
 block discarded – undo
1917 1917
 								$disabled = 1;
1918 1918
 							}
1919 1919
 							if (!empty($selected) && in_array($obj->rowid, $selected)) {
1920
-								$out .= '<option value="' . $obj->rowid . '"';
1920
+								$out .= '<option value="'.$obj->rowid.'"';
1921 1921
 								if ($disabled) {
1922 1922
 									$out .= ' disabled';
1923 1923
 								}
1924 1924
 								$out .= ' selected>';
1925 1925
 
1926
-								$tmplabel = $contactstatic->getFullName($langs) . $extendedInfos;
1926
+								$tmplabel = $contactstatic->getFullName($langs).$extendedInfos;
1927 1927
 								if ($showfunction && $obj->poste) {
1928
-									$tmplabel .= ' (' . $obj->poste . ')';
1928
+									$tmplabel .= ' ('.$obj->poste.')';
1929 1929
 								}
1930 1930
 								if (($showsoc > 0) && $obj->company) {
1931
-									$tmplabel .= ' - (' . $obj->company . ')';
1931
+									$tmplabel .= ' - ('.$obj->company.')';
1932 1932
 								}
1933 1933
 
1934 1934
 								$out .= $tmplabel;
1935 1935
 								$out .= '</option>';
1936 1936
 							} else {
1937
-								$out .= '<option value="' . $obj->rowid . '"';
1937
+								$out .= '<option value="'.$obj->rowid.'"';
1938 1938
 								if ($disabled) {
1939 1939
 									$out .= ' disabled';
1940 1940
 								}
1941 1941
 								$out .= '>';
1942 1942
 
1943
-								$tmplabel = $contactstatic->getFullName($langs) . $extendedInfos;
1943
+								$tmplabel = $contactstatic->getFullName($langs).$extendedInfos;
1944 1944
 								if ($showfunction && $obj->poste) {
1945
-									$tmplabel .= ' (' . $obj->poste . ')';
1945
+									$tmplabel .= ' ('.$obj->poste.')';
1946 1946
 								}
1947 1947
 								if (($showsoc > 0) && $obj->company) {
1948
-									$tmplabel .= ' - (' . $obj->company . ')';
1948
+									$tmplabel .= ' - ('.$obj->company.')';
1949 1949
 								}
1950 1950
 
1951 1951
 								$out .= $tmplabel;
@@ -1953,12 +1953,12 @@  discard block
 block discarded – undo
1953 1953
 							}
1954 1954
 						} else {
1955 1955
 							if (in_array($obj->rowid, $selected)) {
1956
-								$tmplabel = $contactstatic->getFullName($langs) . $extendedInfos;
1956
+								$tmplabel = $contactstatic->getFullName($langs).$extendedInfos;
1957 1957
 								if ($showfunction && $obj->poste) {
1958
-									$tmplabel .= ' (' . $obj->poste . ')';
1958
+									$tmplabel .= ' ('.$obj->poste.')';
1959 1959
 								}
1960 1960
 								if (($showsoc > 0) && $obj->company) {
1961
-									$tmplabel .= ' - (' . $obj->company . ')';
1961
+									$tmplabel .= ' - ('.$obj->company.')';
1962 1962
 								}
1963 1963
 
1964 1964
 								$out .= $tmplabel;
@@ -1973,7 +1973,7 @@  discard block
 block discarded – undo
1973 1973
 				}
1974 1974
 			} else {
1975 1975
 				$labeltoshow = ($socid != -1) ? ($langs->trans($socid ? "NoContactDefinedForThirdParty" : "NoContactDefined")) : $langs->trans('SelectAThirdPartyFirst');
1976
-				$out .= '<option class="disabled" value="-1"' . (($showempty == 2 || $multiple) ? '' : ' selected') . ' disabled="disabled">';
1976
+				$out .= '<option class="disabled" value="-1"'.(($showempty == 2 || $multiple) ? '' : ' selected').' disabled="disabled">';
1977 1977
 				$out .= $labeltoshow;
1978 1978
 				$out .= '</option>';
1979 1979
 			}
@@ -1994,7 +1994,7 @@  discard block
 block discarded – undo
1994 1994
 			}
1995 1995
 
1996 1996
 			if ($conf->use_javascript_ajax && !$forcecombo && !$options_only) {
1997
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
1997
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
1998 1998
 				$out .= ajax_combobox($htmlid, $events, getDolGlobalInt("CONTACT_USE_SEARCH_TO_SELECT"));
1999 1999
 			}
2000 2000
 
@@ -2033,18 +2033,18 @@  discard block
 block discarded – undo
2033 2033
 		// On recherche les remises
2034 2034
 		$sql = "SELECT re.rowid, re.amount_ht, re.amount_tva, re.amount_ttc,";
2035 2035
 		$sql .= " re.description, re.fk_facture_source";
2036
-		$sql .= " FROM " . $this->db->prefix() . "societe_remise_except as re";
2037
-		$sql .= " WHERE re.fk_soc = " . (int) $socid;
2038
-		$sql .= " AND re.entity = " . $conf->entity;
2036
+		$sql .= " FROM ".$this->db->prefix()."societe_remise_except as re";
2037
+		$sql .= " WHERE re.fk_soc = ".(int) $socid;
2038
+		$sql .= " AND re.entity = ".$conf->entity;
2039 2039
 		if ($filter) {
2040
-			$sql .= " AND " . $filter;
2040
+			$sql .= " AND ".$filter;
2041 2041
 		}
2042 2042
 		$sql .= " ORDER BY re.description ASC";
2043 2043
 
2044
-		dol_syslog(get_class($this) . "::select_remises", LOG_DEBUG);
2044
+		dol_syslog(get_class($this)."::select_remises", LOG_DEBUG);
2045 2045
 		$resql = $this->db->query($sql);
2046 2046
 		if ($resql) {
2047
-			print '<select id="select_' . $htmlname . '" class="flat maxwidthonsmartphone" name="' . $htmlname . '">';
2047
+			print '<select id="select_'.$htmlname.'" class="flat maxwidthonsmartphone" name="'.$htmlname.'">';
2048 2048
 			$num = $this->db->num_rows($resql);
2049 2049
 
2050 2050
 			$qualifiedlines = $num;
@@ -2082,16 +2082,16 @@  discard block
 block discarded – undo
2082 2082
 					if (getDolGlobalString('MAIN_SHOW_FACNUMBER_IN_DISCOUNT_LIST') && !empty($obj->fk_facture_source)) {
2083 2083
 						$tmpfac = new Facture($this->db);
2084 2084
 						if ($tmpfac->fetch($obj->fk_facture_source) > 0) {
2085
-							$desc = $desc . ' - ' . $tmpfac->ref;
2085
+							$desc = $desc.' - '.$tmpfac->ref;
2086 2086
 						}
2087 2087
 					}
2088 2088
 
2089
-					print '<option value="' . $obj->rowid . '"' . $selectstring . $disabled . '>' . $desc . ' (' . price($obj->amount_ht) . ' ' . $langs->trans("HT") . ' - ' . price($obj->amount_ttc) . ' ' . $langs->trans("TTC") . ')</option>';
2089
+					print '<option value="'.$obj->rowid.'"'.$selectstring.$disabled.'>'.$desc.' ('.price($obj->amount_ht).' '.$langs->trans("HT").' - '.price($obj->amount_ttc).' '.$langs->trans("TTC").')</option>';
2090 2090
 					$i++;
2091 2091
 				}
2092 2092
 			}
2093 2093
 			print '</select>';
2094
-			print ajax_combobox('select_' . $htmlname);
2094
+			print ajax_combobox('select_'.$htmlname);
2095 2095
 
2096 2096
 			return $qualifiedlines;
2097 2097
 		} else {
@@ -2200,14 +2200,14 @@  discard block
 block discarded – undo
2200 2200
 		if ($showlabelofentity) {
2201 2201
 			$sql .= ", e.label";
2202 2202
 		}
2203
-		$sql .= " FROM " . $this->db->prefix() . "user as u";
2203
+		$sql .= " FROM ".$this->db->prefix()."user as u";
2204 2204
 		if ($showlabelofentity) {
2205
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "entity as e ON e.rowid = u.entity";
2205
+			$sql .= " LEFT JOIN ".$this->db->prefix()."entity as e ON e.rowid = u.entity";
2206 2206
 		}
2207 2207
 		// Condition here should be the same than into societe->getSalesRepresentatives().
2208 2208
 		if ($userissuperadminentityone && $force_entity !== 'default') {
2209 2209
 			if (!empty($force_entity)) {
2210
-				$sql .= " WHERE u.entity IN (0, " . $this->db->sanitize($force_entity) . ")";
2210
+				$sql .= " WHERE u.entity IN (0, ".$this->db->sanitize($force_entity).")";
2211 2211
 			} else {
2212 2212
 				$sql .= " WHERE u.entity IS NOT NULL";
2213 2213
 			}
@@ -2215,18 +2215,18 @@  discard block
 block discarded – undo
2215 2215
 			if (isModEnabled('multicompany') && getDolGlobalInt('MULTICOMPANY_TRANSVERSE_MODE')) {
2216 2216
 				$sql .= " WHERE u.rowid IN (SELECT ug.fk_user FROM ".$this->db->prefix()."usergroup_user as ug WHERE ug.entity IN (".getEntity('usergroup')."))";
2217 2217
 			} else {
2218
-				$sql .= " WHERE u.entity IN (" . getEntity('user') . ")";
2218
+				$sql .= " WHERE u.entity IN (".getEntity('user').")";
2219 2219
 			}
2220 2220
 		}
2221 2221
 
2222 2222
 		if (!empty($user->socid)) {
2223
-			$sql .= " AND u.fk_soc = " . ((int) $user->socid);
2223
+			$sql .= " AND u.fk_soc = ".((int) $user->socid);
2224 2224
 		}
2225 2225
 		if (is_array($exclude) && $excludeUsers) {
2226
-			$sql .= " AND u.rowid NOT IN (" . $this->db->sanitize($excludeUsers) . ")";
2226
+			$sql .= " AND u.rowid NOT IN (".$this->db->sanitize($excludeUsers).")";
2227 2227
 		}
2228 2228
 		if ($includeUsers) {
2229
-			$sql .= " AND u.rowid IN (" . $this->db->sanitize($includeUsers) . ")";
2229
+			$sql .= " AND u.rowid IN (".$this->db->sanitize($includeUsers).")";
2230 2230
 		}
2231 2231
 		if (getDolGlobalString('USER_HIDE_INACTIVE_IN_COMBOBOX') || $notdisabled) {
2232 2232
 			$sql .= " AND u.statut <> 0";
@@ -2263,7 +2263,7 @@  discard block
 block discarded – undo
2263 2263
 			$sql .= " ORDER BY u.statut DESC, u.lastname ASC, u.firstname ASC";
2264 2264
 		}
2265 2265
 
2266
-		dol_syslog(get_class($this) . "::select_dolusers", LOG_DEBUG);
2266
+		dol_syslog(get_class($this)."::select_dolusers", LOG_DEBUG);
2267 2267
 
2268 2268
 		$resql = $this->db->query($sql);
2269 2269
 		if ($resql) {
@@ -2271,7 +2271,7 @@  discard block
 block discarded – undo
2271 2271
 			$i = 0;
2272 2272
 			if ($num) {
2273 2273
 				// do not use maxwidthonsmartphone by default. Set it by caller so auto size to 100% will work when not defined
2274
-				$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : ' minwidth200') . '" id="' . $htmlname . '" name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . ' ' . ($disabled ? ' disabled' : '') . '>';
2274
+				$out .= '<select class="flat'.($morecss ? ' '.$morecss : ' minwidth200').'" id="'.$htmlname.'" name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.($disabled ? ' disabled' : '').'>';
2275 2275
 				if ($show_empty && !$multiple) {
2276 2276
 					$textforempty = ' ';
2277 2277
 					if (!empty($conf->use_javascript_ajax)) {
@@ -2280,7 +2280,7 @@  discard block
 block discarded – undo
2280 2280
 					if (!is_numeric($show_empty)) {
2281 2281
 						$textforempty = $show_empty;
2282 2282
 					}
2283
-					$out .= '<option class="optiongrey" value="' . ($show_empty < 0 ? $show_empty : -1) . '"' . ((empty($selected) || in_array(-1, $selected)) ? ' selected' : '') . '>' . $textforempty . '</option>' . "\n";
2283
+					$out .= '<option class="optiongrey" value="'.($show_empty < 0 ? $show_empty : -1).'"'.((empty($selected) || in_array(-1, $selected)) ? ' selected' : '').'>'.$textforempty.'</option>'."\n";
2284 2284
 
2285 2285
 					$outarray[($show_empty < 0 ? $show_empty : -1)] = $textforempty;
2286 2286
 					$outarray2[($show_empty < 0 ? $show_empty : -1)] = array(
@@ -2292,13 +2292,13 @@  discard block
 block discarded – undo
2292 2292
 					);
2293 2293
 				}
2294 2294
 				if ($show_every) {
2295
-					$out .= '<option value="-2"' . ((in_array(-2, $selected)) ? ' selected' : '') . '>-- ' . $langs->trans("Everybody") . ' --</option>' . "\n";
2295
+					$out .= '<option value="-2"'.((in_array(-2, $selected)) ? ' selected' : '').'>-- '.$langs->trans("Everybody").' --</option>'."\n";
2296 2296
 
2297
-					$outarray[-2] = '-- ' . $langs->trans("Everybody") . ' --';
2297
+					$outarray[-2] = '-- '.$langs->trans("Everybody").' --';
2298 2298
 					$outarray2[-2] = array(
2299 2299
 						'id' => -2,
2300
-						'label' => '-- ' . $langs->trans("Everybody") . ' --',
2301
-						'labelhtml' => '-- ' . $langs->trans("Everybody") . ' --',
2300
+						'label' => '-- '.$langs->trans("Everybody").' --',
2301
+						'labelhtml' => '-- '.$langs->trans("Everybody").' --',
2302 2302
 						'color' => '',
2303 2303
 						'picto' => ''
2304 2304
 					);
@@ -2349,21 +2349,21 @@  discard block
 block discarded – undo
2349 2349
 					}
2350 2350
 					if ($showstatus >= 0) {
2351 2351
 						if ($obj->status == 1 && $showstatus == 1) {
2352
-							$moreinfo .= ($moreinfo ? ' - ' : ' (') . $langs->trans('Enabled');
2353
-							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . $langs->trans('Enabled');
2352
+							$moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans('Enabled');
2353
+							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').$langs->trans('Enabled');
2354 2354
 						}
2355 2355
 						if ($obj->status == 0 && $showstatus == 1) {
2356
-							$moreinfo .= ($moreinfo ? ' - ' : ' (') . $langs->trans('Disabled');
2357
-							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . $langs->trans('Disabled');
2356
+							$moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans('Disabled');
2357
+							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').$langs->trans('Disabled');
2358 2358
 						}
2359 2359
 					}
2360 2360
 					if ($showlabelofentity) {
2361 2361
 						if (empty($obj->entity)) {
2362
-							$moreinfo .= ($moreinfo ? ' - ' : ' (') . $langs->trans("AllEntities");
2363
-							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . $langs->trans("AllEntities");
2362
+							$moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans("AllEntities");
2363
+							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').$langs->trans("AllEntities");
2364 2364
 						} else {
2365 2365
 							if ($obj->entity != $conf->entity) {
2366
-								$moreinfo .= ($moreinfo ? ' - ' : ' (') . ($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined"));
2366
+								$moreinfo .= ($moreinfo ? ' - ' : ' (').($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined"));
2367 2367
 								$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined"));
2368 2368
 							}
2369 2369
 						}
@@ -2372,13 +2372,13 @@  discard block
 block discarded – undo
2372 2372
 					$moreinfohtml .= (!empty($moreinfohtml) ? ')</span>' : '');
2373 2373
 					if (!empty($disableline) && $disableline != '1') {
2374 2374
 						// Add text from $enableonlytext parameter
2375
-						$moreinfo .= ' - ' . $disableline;
2376
-						$moreinfohtml .= ' - ' . $disableline;
2375
+						$moreinfo .= ' - '.$disableline;
2376
+						$moreinfohtml .= ' - '.$disableline;
2377 2377
 					}
2378 2378
 					$labeltoshow .= $moreinfo;
2379 2379
 					$labeltoshowhtml .= $moreinfohtml;
2380 2380
 
2381
-					$out .= '<option value="' . $obj->rowid . '"';
2381
+					$out .= '<option value="'.$obj->rowid.'"';
2382 2382
 					if (!empty($disableline)) {
2383 2383
 						$out .= ' disabled';
2384 2384
 					}
@@ -2387,7 +2387,7 @@  discard block
 block discarded – undo
2387 2387
 					}
2388 2388
 					$out .= ' data-html="';
2389 2389
 
2390
-					$outhtml = $userstatic->getNomUrl(-3, '', 0, 1, 24, 1, 'login', '', 1) . ' ';
2390
+					$outhtml = $userstatic->getNomUrl(-3, '', 0, 1, 24, 1, 'login', '', 1).' ';
2391 2391
 					if ($showstatus >= 0 && $obj->status == 0) {
2392 2392
 						$outhtml .= '<strike class="opacitymediumxxx">';
2393 2393
 					}
@@ -2402,7 +2402,7 @@  discard block
 block discarded – undo
2402 2402
 					$out .= $labeltoshow;
2403 2403
 					$out .= '</option>';
2404 2404
 
2405
-					$outarray[$userstatic->id] = $userstatic->getFullName($langs, $fullNameMode, -1, $maxlength) . $moreinfo;
2405
+					$outarray[$userstatic->id] = $userstatic->getFullName($langs, $fullNameMode, -1, $maxlength).$moreinfo;
2406 2406
 					$outarray2[$userstatic->id] = array(
2407 2407
 						'id' => $userstatic->id,
2408 2408
 						'label' => $labeltoshow,
@@ -2414,14 +2414,14 @@  discard block
 block discarded – undo
2414 2414
 					$i++;
2415 2415
 				}
2416 2416
 			} else {
2417
-				$out .= '<select class="flat" id="' . $htmlname . '" name="' . $htmlname . '" disabled>';
2418
-				$out .= '<option value="">' . $langs->trans("None") . '</option>';
2417
+				$out .= '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'" disabled>';
2418
+				$out .= '<option value="">'.$langs->trans("None").'</option>';
2419 2419
 			}
2420 2420
 			$out .= '</select>';
2421 2421
 
2422 2422
 			if ($num && !$forcecombo) {
2423 2423
 				// Enhance with select2
2424
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
2424
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
2425 2425
 				$out .= ajax_combobox($htmlname);
2426 2426
 			}
2427 2427
 		} else {
@@ -2498,7 +2498,7 @@  discard block
 block discarded – undo
2498 2498
 			$out .= $userstatic->getNomUrl(-1);
2499 2499
 			if ($i == 0) {
2500 2500
 				$ownerid = $value['id'];
2501
-				$out .= ' (' . $langs->trans("Owner") . ')';
2501
+				$out .= ' ('.$langs->trans("Owner").')';
2502 2502
 			}
2503 2503
 			// Add picto to delete owner/assignee
2504 2504
 			if ($nbassignetouser > 1 && $action != 'view') {
@@ -2509,7 +2509,7 @@  discard block
 block discarded – undo
2509 2509
 						$canremoveassignee = 0;
2510 2510
 					}
2511 2511
 					if (!$user->hasRight('agenda', 'allactions', 'create')) {
2512
-						$canremoveassignee = 0;		// Can't remove the owner
2512
+						$canremoveassignee = 0; // Can't remove the owner
2513 2513
 					}
2514 2514
 				} else {
2515 2515
 					// We are not on the owner of the event but on a secondary assignee
@@ -2517,14 +2517,14 @@  discard block
 block discarded – undo
2517 2517
 				if ($canremoveassignee) {
2518 2518
 					// If user has all permission, he should be ableto remove a assignee.
2519 2519
 					// If user has not all permission, he can onlyremove assignee of other (he can't remove itself)
2520
-					$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 . '">';
2520
+					$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.'">';
2521 2521
 				}
2522 2522
 			}
2523 2523
 			// Show my availability
2524 2524
 			if ($showproperties) {
2525 2525
 				if ($ownerid == $value['id'] && is_array($listofuserid) && count($listofuserid) && in_array($ownerid, array_keys($listofuserid))) {
2526 2526
 					$out .= '<div class="myavailability inline-block">';
2527
-					$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>';
2527
+					$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>';
2528 2528
 					$out .= '</div>';
2529 2529
 				}
2530 2530
 			}
@@ -2541,15 +2541,15 @@  discard block
 block discarded – undo
2541 2541
 		// Method with no ajax
2542 2542
 		if ($action != 'view') {
2543 2543
 			$out .= '<input type="hidden" class="removedassignedhidden" name="removedassigned" value="">';
2544
-			$out .= '<script nonce="' . getNonce() . '" type="text/javascript">jQuery(document).ready(function () {';
2544
+			$out .= '<script nonce="'.getNonce().'" type="text/javascript">jQuery(document).ready(function () {';
2545 2545
 			$out .= 'jQuery(".removedassigned").click(function() { jQuery(".removedassignedhidden").val(jQuery(this).val()); });';
2546 2546
 			$out .= 'jQuery(".assignedtouser").change(function() { console.log(jQuery(".assignedtouser option:selected").val());';
2547
-			$out .= ' if (jQuery(".assignedtouser option:selected").val() > 0) { jQuery("#' . $action . 'assignedtouser").attr("disabled", false); }';
2548
-			$out .= ' else { jQuery("#' . $action . 'assignedtouser").attr("disabled", true); }';
2547
+			$out .= ' if (jQuery(".assignedtouser option:selected").val() > 0) { jQuery("#'.$action.'assignedtouser").attr("disabled", false); }';
2548
+			$out .= ' else { jQuery("#'.$action.'assignedtouser").attr("disabled", true); }';
2549 2549
 			$out .= '});';
2550 2550
 			$out .= '})</script>';
2551 2551
 			$out .= $this->select_dolusers('', $htmlname, $show_empty, $exclude, $disabled, $include, $enableonly, $force_entity, $maxlength, $showstatus, $morefilter);
2552
-			$out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="' . $action . 'assignedtouser" name="' . $action . 'assignedtouser" value="' . dol_escape_htmltag($langs->trans("Add")) . '">';
2552
+			$out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="'.$action.'assignedtouser" name="'.$action.'assignedtouser" value="'.dol_escape_htmltag($langs->trans("Add")).'">';
2553 2553
 			$out .= '<br>';
2554 2554
 		}
2555 2555
 
@@ -2608,13 +2608,13 @@  discard block
 block discarded – undo
2608 2608
 			$resourcestatic->fetch($value['id']);
2609 2609
 			$out .= $resourcestatic->getNomUrl(-1);
2610 2610
 			if ($nbassignetoresource >= 1 && $action != 'view') {
2611
-				$out .= ' <input type="image" style="border: 0px;" src="' . img_picto($langs->trans("Remove"), 'delete', '', 0, 1) . '" value="' . $resourcestatic->id . '" class="removedassignedresource reposition" id="removedassignedresource_' . $resourcestatic->id . '" name="removedassignedresource_' . $resourcestatic->id . '">';
2611
+				$out .= ' <input type="image" style="border: 0px;" src="'.img_picto($langs->trans("Remove"), 'delete', '', 0, 1).'" value="'.$resourcestatic->id.'" class="removedassignedresource reposition" id="removedassignedresource_'.$resourcestatic->id.'" name="removedassignedresource_'.$resourcestatic->id.'">';
2612 2612
 			}
2613 2613
 			// Show my availability
2614 2614
 			if ($showproperties) {
2615 2615
 				if (is_array($listofresourceid) && count($listofresourceid)) {
2616 2616
 					$out .= '<div class="myavailability inline-block">';
2617
-					$out .= '<span class="hideonsmartphone">&nbsp;-&nbsp;<span class="opacitymedium">' . $langs->trans("Availability") . ':</span>  </span><input id="transparencyresource" class="paddingrightonly" ' . ($action == 'view' ? 'disabled' : '') . ' type="checkbox" name="transparency"' . ($listofresourceid[$value['id']]['transparency'] ? ' checked' : '') . '><label for="transparency">' . $langs->trans("Busy") . '</label>';
2617
+					$out .= '<span class="hideonsmartphone">&nbsp;-&nbsp;<span class="opacitymedium">'.$langs->trans("Availability").':</span>  </span><input id="transparencyresource" class="paddingrightonly" '.($action == 'view' ? 'disabled' : '').' type="checkbox" name="transparency"'.($listofresourceid[$value['id']]['transparency'] ? ' checked' : '').'><label for="transparency">'.$langs->trans("Busy").'</label>';
2618 2618
 					$out .= '</div>';
2619 2619
 				}
2620 2620
 			}
@@ -2631,11 +2631,11 @@  discard block
 block discarded – undo
2631 2631
 		// Method with no ajax
2632 2632
 		if ($action != 'view') {
2633 2633
 			$out .= '<input type="hidden" class="removedassignedresourcehidden" name="removedassignedresource" value="">';
2634
-			$out .= '<script nonce="' . getNonce() . '" type="text/javascript">jQuery(document).ready(function () {';
2634
+			$out .= '<script nonce="'.getNonce().'" type="text/javascript">jQuery(document).ready(function () {';
2635 2635
 			$out .= 'jQuery(".removedassignedresource").click(function() { jQuery(".removedassignedresourcehidden").val(jQuery(this).val()); });';
2636 2636
 			$out .= 'jQuery(".assignedtoresource").change(function() { console.log(jQuery(".assignedtoresource option:selected").val());';
2637
-			$out .= ' if (jQuery(".assignedtoresource option:selected").val() > 0) { jQuery("#' . $action . 'assignedtoresource").attr("disabled", false); }';
2638
-			$out .= ' else { jQuery("#' . $action . 'assignedtoresource").attr("disabled", true); }';
2637
+			$out .= ' if (jQuery(".assignedtoresource option:selected").val() > 0) { jQuery("#'.$action.'assignedtoresource").attr("disabled", false); }';
2638
+			$out .= ' else { jQuery("#'.$action.'assignedtoresource").attr("disabled", true); }';
2639 2639
 			$out .= '});';
2640 2640
 			$out .= '})</script>';
2641 2641
 
@@ -2643,7 +2643,7 @@  discard block
 block discarded – undo
2643 2643
 			$out .= img_picto('', 'resource', 'class="pictofixedwidth"');
2644 2644
 			$out .= $formresources->select_resource_list(0, $htmlname, '', 1, 1, 0, $events, '', 2, 0);
2645 2645
 			//$out .= $this->select_dolusers('', $htmlname, $show_empty, $exclude, $disabled, $include, $enableonly, $force_entity, $maxlength, $showstatus, $morefilter);
2646
-			$out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="' . $action . 'assignedtoresource" name="' . $action . 'assignedtoresource" value="' . dol_escape_htmltag($langs->trans("Add")) . '">';
2646
+			$out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="'.$action.'assignedtoresource" name="'.$action.'assignedtoresource" value="'.dol_escape_htmltag($langs->trans("Add")).'">';
2647 2647
 			$out .= '<br>';
2648 2648
 		}
2649 2649
 
@@ -2706,7 +2706,7 @@  discard block
 block discarded – undo
2706 2706
 			$placeholder = (is_numeric($showempty) ? '' : 'placeholder="'.dolPrintHTML($showempty).'"');
2707 2707
 
2708 2708
 			if ($selected && empty($selected_input_value)) {
2709
-				require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
2709
+				require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
2710 2710
 				$producttmpselect = new Product($this->db);
2711 2711
 				$producttmpselect->fetch($selected);
2712 2712
 				$selected_input_value = $producttmpselect->ref;
@@ -2721,21 +2721,21 @@  discard block
 block discarded – undo
2721 2721
 				}
2722 2722
 			}
2723 2723
 			// mode=1 means customers products
2724
-			$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;
2724
+			$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;
2725 2725
 			if ((int) $warehouseId > 0) {
2726
-				$urloption .= '&warehouseid=' . (int) $warehouseId;
2726
+				$urloption .= '&warehouseid='.(int) $warehouseId;
2727 2727
 			}
2728 2728
 
2729
-			$out .= ajax_autocompleter((string) $selected, $htmlname, DOL_URL_ROOT . '/product/ajax/products.php', $urloption, getDolGlobalInt('PRODUIT_USE_SEARCH_TO_SELECT'), getDolGlobalInt('PRODUCT_SEARCH_AUTO_SELECT_IF_ONLY_ONE', 1), $ajaxoptions);
2729
+			$out .= ajax_autocompleter((string) $selected, $htmlname, DOL_URL_ROOT.'/product/ajax/products.php', $urloption, getDolGlobalInt('PRODUIT_USE_SEARCH_TO_SELECT'), getDolGlobalInt('PRODUCT_SEARCH_AUTO_SELECT_IF_ONLY_ONE', 1), $ajaxoptions);
2730 2730
 
2731 2731
 			if (isModEnabled('variants') && is_array($selected_combinations)) {
2732 2732
 				// Code to automatically insert with javascript the select of attributes under the select of product
2733 2733
 				// when a parent of variant has been selected.
2734 2734
 				$out .= '
2735 2735
 				<!-- script to auto show attributes select tags if a variant was selected -->
2736
-				<script nonce="' . getNonce() . '">
2736
+				<script nonce="' . getNonce().'">
2737 2737
 					// auto show attributes fields
2738
-					selected = ' . json_encode($selected_combinations) . ';
2738
+					selected = ' . json_encode($selected_combinations).';
2739 2739
 					combvalues = {};
2740 2740
 
2741 2741
 					jQuery(document).ready(function () {
@@ -2746,7 +2746,7 @@  discard block
 block discarded – undo
2746 2746
 							}
2747 2747
 						});
2748 2748
 
2749
-						jQuery("input#' . $htmlname . '").change(function () {
2749
+						jQuery("input#' . $htmlname.'").change(function () {
2750 2750
 
2751 2751
 							if (!jQuery(this).val()) {
2752 2752
 								jQuery(\'div#attributes_box\').empty();
@@ -2755,7 +2755,7 @@  discard block
 block discarded – undo
2755 2755
 
2756 2756
 							console.log("A change has started. We get variants fields to inject html select");
2757 2757
 
2758
-							jQuery.getJSON("' . DOL_URL_ROOT . '/variants/ajax/getCombinations.php", {
2758
+							jQuery.getJSON("' . DOL_URL_ROOT.'/variants/ajax/getCombinations.php", {
2759 2759
 								id: jQuery(this).val()
2760 2760
 							}, function (data) {
2761 2761
 								jQuery(\'div#attributes_box\').empty();
@@ -2798,22 +2798,22 @@  discard block
 block discarded – undo
2798 2798
 							})
2799 2799
 						});
2800 2800
 
2801
-						' . ($selected ? 'jQuery("input#' . $htmlname . '").change();' : '') . '
2801
+						' . ($selected ? 'jQuery("input#'.$htmlname.'").change();' : '').'
2802 2802
 					});
2803 2803
 				</script>
2804 2804
                 ';
2805 2805
 			}
2806 2806
 
2807 2807
 			if (empty($hidelabel)) {
2808
-				$placeholder = ' placeholder="' . dolPrintHTMLForAttribute($langs->trans("RefOrLabel")) . '"';
2808
+				$placeholder = ' placeholder="'.dolPrintHTMLForAttribute($langs->trans("RefOrLabel")).'"';
2809 2809
 			} elseif ($hidelabel > 1) {
2810
-				$placeholder = ' placeholder="' . dolPrintHTMLForAttribute($langs->trans("RefOrLabel")) . '"';
2810
+				$placeholder = ' placeholder="'.dolPrintHTMLForAttribute($langs->trans("RefOrLabel")).'"';
2811 2811
 				if ($hidelabel == 2) {
2812 2812
 					$out .= img_picto($langs->trans("Search"), 'search');
2813 2813
 				}
2814 2814
 			}
2815 2815
 
2816
-			$out .= '<input type="text" class="minwidth100' . ($morecss ? ' ' . $morecss : '') . '" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />';
2816
+			$out .= '<input type="text" class="minwidth100'.($morecss ? ' '.$morecss : '').'" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />';
2817 2817
 			if ($hidelabel == 3) {
2818 2818
 				$out .= img_picto($langs->trans("Search"), 'search');
2819 2819
 			}
@@ -2850,33 +2850,33 @@  discard block
 block discarded – undo
2850 2850
 		// phpcs:enable
2851 2851
 		global $db;
2852 2852
 
2853
-		require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
2853
+		require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
2854 2854
 
2855 2855
 		$error = 0;
2856 2856
 		$out = '';
2857 2857
 
2858 2858
 		if (!$forcecombo) {
2859
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
2859
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
2860 2860
 			$events = array();
2861 2861
 			$out .= ajax_combobox($htmlname, $events, getDolGlobalInt("PRODUIT_USE_SEARCH_TO_SELECT"));
2862 2862
 		}
2863 2863
 
2864
-		$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
2864
+		$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
2865 2865
 
2866 2866
 		$sql = 'SELECT b.rowid, b.ref, b.label, b.fk_product';
2867
-		$sql .= ' FROM ' . MAIN_DB_PREFIX . 'bom_bom as b';
2868
-		$sql .= ' WHERE b.entity IN (' . getEntity('bom') . ')';
2867
+		$sql .= ' FROM '.MAIN_DB_PREFIX.'bom_bom as b';
2868
+		$sql .= ' WHERE b.entity IN ('.getEntity('bom').')';
2869 2869
 		if (!empty($status)) {
2870
-			$sql .= ' AND status = ' . (int) $status;
2870
+			$sql .= ' AND status = '.(int) $status;
2871 2871
 		}
2872 2872
 		if (!empty($type)) {
2873
-			$sql .= ' AND bomtype = ' . (int) $type;
2873
+			$sql .= ' AND bomtype = '.(int) $type;
2874 2874
 		}
2875 2875
 		if (!empty($TProducts)) {
2876
-			$sql .= ' AND fk_product IN (' . $this->db->sanitize(implode(',', $TProducts)) . ')';
2876
+			$sql .= ' AND fk_product IN ('.$this->db->sanitize(implode(',', $TProducts)).')';
2877 2877
 		}
2878 2878
 		if (!empty($limit)) {
2879
-			$sql .= ' LIMIT ' . (int) $limit;
2879
+			$sql .= ' LIMIT '.(int) $limit;
2880 2880
 		}
2881 2881
 		$resql = $db->query($sql);
2882 2882
 		if ($resql) {
@@ -2890,11 +2890,11 @@  discard block
 block discarded – undo
2890 2890
 			while ($obj = $db->fetch_object($resql)) {
2891 2891
 				$product = new Product($db);
2892 2892
 				$res = $product->fetch($obj->fk_product);
2893
-				$out .= '<option value="' . $obj->rowid . '"';
2893
+				$out .= '<option value="'.$obj->rowid.'"';
2894 2894
 				if ($obj->rowid == $selected) {
2895 2895
 					$out .= 'selected';
2896 2896
 				}
2897
-				$out .= '>' . $obj->ref . ' - ' . $product->label . ' - ' . $obj->label . '</option>';
2897
+				$out .= '>'.$obj->ref.' - '.$product->label.' - '.$obj->label.'</option>';
2898 2898
 			}
2899 2899
 		} else {
2900 2900
 			$error++;
@@ -2952,7 +2952,7 @@  discard block
 block discarded – undo
2952 2952
 
2953 2953
 		$warehouseStatusArray = array();
2954 2954
 		if (!empty($warehouseStatus)) {
2955
-			require_once DOL_DOCUMENT_ROOT . '/product/stock/class/entrepot.class.php';
2955
+			require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php';
2956 2956
 			if (preg_match('/warehouseclosed/', $warehouseStatus)) {
2957 2957
 				$warehouseStatusArray[] = Entrepot::STATUS_CLOSED;
2958 2958
 			}
@@ -2966,9 +2966,9 @@  discard block
 block discarded – undo
2966 2966
 
2967 2967
 		$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";
2968 2968
 		if (count($warehouseStatusArray)) {
2969
-			$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
2969
+			$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
2970 2970
 		} else {
2971
-			$selectFieldsGrouped = ", " . $this->db->ifsql("p.stock IS NULL", 0, "p.stock") . " AS stock";
2971
+			$selectFieldsGrouped = ", ".$this->db->ifsql("p.stock IS NULL", 0, "p.stock")." AS stock";
2972 2972
 		}
2973 2973
 
2974 2974
 		$sql = "SELECT ";
@@ -2984,9 +2984,9 @@  discard block
 block discarded – undo
2984 2984
 
2985 2985
 		if (getDolGlobalString('PRODUCT_SORT_BY_CATEGORY')) {
2986 2986
 			//Product category
2987
-			$sql .= ", (SELECT " . $this->db->prefix() . "categorie_product.fk_categorie
2988
-						FROM " . $this->db->prefix() . "categorie_product
2989
-						WHERE " . $this->db->prefix() . "categorie_product.fk_product=p.rowid
2987
+			$sql .= ", (SELECT ".$this->db->prefix()."categorie_product.fk_categorie
2988
+						FROM " . $this->db->prefix()."categorie_product
2989
+						WHERE " . $this->db->prefix()."categorie_product.fk_product=p.rowid
2990 2990
 						LIMIT 1
2991 2991
 				) AS categorie_product_id ";
2992 2992
 		}
@@ -3012,15 +3012,15 @@  discard block
 block discarded – undo
3012 3012
 		}
3013 3013
 		// Price by quantity
3014 3014
 		if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) {
3015
-			$sql .= ", (SELECT pp.rowid FROM " . $this->db->prefix() . "product_price as pp WHERE pp.fk_product = p.rowid";
3015
+			$sql .= ", (SELECT pp.rowid FROM ".$this->db->prefix()."product_price as pp WHERE pp.fk_product = p.rowid";
3016 3016
 			if ($price_level >= 1 && getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) {
3017
-				$sql .= " AND price_level = " . ((int) $price_level);
3017
+				$sql .= " AND price_level = ".((int) $price_level);
3018 3018
 			}
3019 3019
 			$sql .= " ORDER BY date_price";
3020 3020
 			$sql .= " DESC LIMIT 1) as price_rowid";
3021
-			$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
3021
+			$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
3022 3022
 			if ($price_level >= 1 && getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) {
3023
-				$sql .= " AND price_level = " . ((int) $price_level);
3023
+				$sql .= " AND price_level = ".((int) $price_level);
3024 3024
 			}
3025 3025
 			$sql .= " ORDER BY date_price";
3026 3026
 			$sql .= " DESC LIMIT 1) as price_by_qty";
@@ -3030,7 +3030,7 @@  discard block
 block discarded – undo
3030 3030
 		$sql .= " FROM ".$this->db->prefix()."product as p";
3031 3031
 
3032 3032
 		if (getDolGlobalString('MAIN_SEARCH_PRODUCT_FORCE_INDEX')) {
3033
-			$sql .= " USE INDEX (" . $this->db->sanitize(getDolGlobalString('MAIN_PRODUCT_FORCE_INDEX')) . ")";
3033
+			$sql .= " USE INDEX (".$this->db->sanitize(getDolGlobalString('MAIN_PRODUCT_FORCE_INDEX')).")";
3034 3034
 		}
3035 3035
 
3036 3036
 		// Add from (left join) from hooks
@@ -3039,48 +3039,48 @@  discard block
 block discarded – undo
3039 3039
 		$sql .= $hookmanager->resPrint;
3040 3040
 
3041 3041
 		if (count($warehouseStatusArray)) {
3042
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "product_stock as ps on ps.fk_product = p.rowid";
3043
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "entrepot as e on ps.fk_entrepot = e.rowid AND e.entity IN (" . getEntity('stock') . ")";
3044
-			$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.
3042
+			$sql .= " LEFT JOIN ".$this->db->prefix()."product_stock as ps on ps.fk_product = p.rowid";
3043
+			$sql .= " LEFT JOIN ".$this->db->prefix()."entrepot as e on ps.fk_entrepot = e.rowid AND e.entity IN (".getEntity('stock').")";
3044
+			$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.
3045 3045
 		}
3046 3046
 
3047 3047
 		//Price by customer
3048 3048
 		if ((getDolGlobalString('PRODUIT_CUSTOMER_PRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) && !empty($socid)) {
3049
-			$sql .= " LEFT JOIN  " . $this->db->prefix() . "product_customer_price as pcp ON pcp.fk_soc=" . ((int) $socid) . " AND pcp.fk_product=p.rowid";
3049
+			$sql .= " LEFT JOIN  ".$this->db->prefix()."product_customer_price as pcp ON pcp.fk_soc=".((int) $socid)." AND pcp.fk_product=p.rowid";
3050 3050
 		}
3051 3051
 		// Units
3052 3052
 		if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
3053
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "c_units u ON u.rowid = p.fk_unit";
3053
+			$sql .= " LEFT JOIN ".$this->db->prefix()."c_units u ON u.rowid = p.fk_unit";
3054 3054
 		}
3055 3055
 		// Multilang : we add translation
3056 3056
 		if (getDolGlobalInt('MAIN_MULTILANGS')) {
3057
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "product_lang as pl ON pl.fk_product = p.rowid ";
3057
+			$sql .= " LEFT JOIN ".$this->db->prefix()."product_lang as pl ON pl.fk_product = p.rowid ";
3058 3058
 			if (getDolGlobalString('PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE') && !empty($socid)) {
3059
-				require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
3059
+				require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
3060 3060
 				$soc = new Societe($this->db);
3061 3061
 				$result = $soc->fetch($socid);
3062 3062
 				if ($result > 0 && !empty($soc->default_lang)) {
3063
-					$sql .= " AND pl.lang = '" . $this->db->escape($soc->default_lang) . "'";
3063
+					$sql .= " AND pl.lang = '".$this->db->escape($soc->default_lang)."'";
3064 3064
 				} else {
3065
-					$sql .= " AND pl.lang = '" . $this->db->escape($langs->getDefaultLang()) . "'";
3065
+					$sql .= " AND pl.lang = '".$this->db->escape($langs->getDefaultLang())."'";
3066 3066
 				}
3067 3067
 			} else {
3068
-				$sql .= " AND pl.lang = '" . $this->db->escape($langs->getDefaultLang()) . "'";
3068
+				$sql .= " AND pl.lang = '".$this->db->escape($langs->getDefaultLang())."'";
3069 3069
 			}
3070 3070
 		}
3071 3071
 
3072 3072
 		if (getDolGlobalString('PRODUIT_ATTRIBUTES_HIDECHILD')) {
3073
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "product_attribute_combination pac ON pac.fk_product_child = p.rowid";
3073
+			$sql .= " LEFT JOIN ".$this->db->prefix()."product_attribute_combination pac ON pac.fk_product_child = p.rowid";
3074 3074
 		}
3075 3075
 
3076
-		$sql .= ' WHERE p.entity IN (' . getEntity('product') . ')';
3076
+		$sql .= ' WHERE p.entity IN ('.getEntity('product').')';
3077 3077
 
3078 3078
 		if (getDolGlobalString('PRODUIT_ATTRIBUTES_HIDECHILD')) {
3079 3079
 			$sql .= " AND pac.rowid IS NULL";
3080 3080
 		}
3081 3081
 
3082 3082
 		if ($finished == 0) {
3083
-			$sql .= " AND p.finished = " . ((int) $finished);
3083
+			$sql .= " AND p.finished = ".((int) $finished);
3084 3084
 		} elseif ($finished == 1) {
3085 3085
 			$sql .= " AND p.finished = ".((int) $finished);
3086 3086
 		}
@@ -3088,11 +3088,11 @@  discard block
 block discarded – undo
3088 3088
 			$sql .= " AND p.tosell = ".((int) $status);
3089 3089
 		}
3090 3090
 		if ($status_purchase >= 0) {
3091
-			$sql .= " AND p.tobuy = " . ((int) $status_purchase);
3091
+			$sql .= " AND p.tobuy = ".((int) $status_purchase);
3092 3092
 		}
3093 3093
 		// Filter by product type
3094 3094
 		if (strval($filtertype) != '') {
3095
-			$sql .= " AND p.fk_product_type = " . ((int) $filtertype);
3095
+			$sql .= " AND p.fk_product_type = ".((int) $filtertype);
3096 3096
 		} elseif (!isModEnabled('product')) { // when product module is disabled, show services only
3097 3097
 			$sql .= " AND p.fk_product_type = 1";
3098 3098
 		} elseif (!isModEnabled('service')) { // when service module is disabled, show products only
@@ -3100,7 +3100,7 @@  discard block
 block discarded – undo
3100 3100
 		}
3101 3101
 
3102 3102
 		if ((int) $warehouseId > 0) {
3103
-			$sql .= " AND EXISTS (SELECT psw.fk_product FROM " . $this->db->prefix() . "product_stock as psw WHERE psw.reel>0 AND psw.fk_entrepot=".(int) $warehouseId." AND psw.fk_product = p.rowid)";
3103
+			$sql .= " AND EXISTS (SELECT psw.fk_product FROM ".$this->db->prefix()."product_stock as psw WHERE psw.reel>0 AND psw.fk_entrepot=".(int) $warehouseId." AND psw.fk_product = p.rowid)";
3104 3104
 		}
3105 3105
 
3106 3106
 		// Add where from hooks
@@ -3109,7 +3109,7 @@  discard block
 block discarded – undo
3109 3109
 		$sql .= $hookmanager->resPrint;
3110 3110
 		// Add criteria on ref/label
3111 3111
 		if ($filterkey != '') {
3112
-			$sqlSupplierSearch= '';
3112
+			$sqlSupplierSearch = '';
3113 3113
 
3114 3114
 			$sql .= ' AND (';
3115 3115
 			$prefix = !getDolGlobalString('PRODUCT_DONOTSEARCH_ANYWHERE') ? '%' : ''; // Can use index if PRODUCT_DONOTSEARCH_ANYWHERE is on
@@ -3123,24 +3123,24 @@  discard block
 block discarded – undo
3123 3123
 				if ($i > 0) {
3124 3124
 					$sql .= " AND ";
3125 3125
 				}
3126
-				$sql .= "(p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%' OR p.label LIKE '" . $this->db->escape($prefix . $crit) . "%'";
3126
+				$sql .= "(p.ref LIKE '".$this->db->escape($prefix.$crit)."%' OR p.label LIKE '".$this->db->escape($prefix.$crit)."%'";
3127 3127
 				if (getDolGlobalInt('MAIN_MULTILANGS')) {
3128
-					$sql .= " OR pl.label LIKE '" . $this->db->escape($prefix . $crit) . "%'";
3128
+					$sql .= " OR pl.label LIKE '".$this->db->escape($prefix.$crit)."%'";
3129 3129
 				}
3130 3130
 				if ((getDolGlobalString('PRODUIT_CUSTOMER_PRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) && !empty($socid)) {
3131
-					$sql .= " OR pcp.ref_customer LIKE '" . $this->db->escape($prefix . $crit) . "%'";
3131
+					$sql .= " OR pcp.ref_customer LIKE '".$this->db->escape($prefix.$crit)."%'";
3132 3132
 				}
3133 3133
 				if (getDolGlobalString('PRODUCT_AJAX_SEARCH_ON_DESCRIPTION')) {
3134
-					$sql .= " OR p.description LIKE '" . $this->db->escape($prefix . $crit) . "%'";
3134
+					$sql .= " OR p.description LIKE '".$this->db->escape($prefix.$crit)."%'";
3135 3135
 					if (getDolGlobalInt('MAIN_MULTILANGS')) {
3136
-						$sql .= " OR pl.description LIKE '" . $this->db->escape($prefix . $crit) . "%'";
3136
+						$sql .= " OR pl.description LIKE '".$this->db->escape($prefix.$crit)."%'";
3137 3137
 					}
3138 3138
 				}
3139 3139
 
3140 3140
 				// include search in supplier ref
3141 3141
 				if (getDolGlobalString('MAIN_SEARCH_PRODUCT_BY_FOURN_REF')) {
3142
-					$sqlSupplierSearch .= !empty($sqlSupplierSearch) ? ' OR ':'';
3143
-					$sqlSupplierSearch .= " pfp.ref_fourn LIKE '" . $this->db->escape($prefix . $crit) . "%'";
3142
+					$sqlSupplierSearch .= !empty($sqlSupplierSearch) ? ' OR ' : '';
3143
+					$sqlSupplierSearch .= " pfp.ref_fourn LIKE '".$this->db->escape($prefix.$crit)."%'";
3144 3144
 				}
3145 3145
 				$sql .= ")";
3146 3146
 				$i++;
@@ -3149,12 +3149,12 @@  discard block
 block discarded – undo
3149 3149
 				$sql .= ")";
3150 3150
 			}
3151 3151
 			if (isModEnabled('barcode')) {
3152
-				$sql .= " OR p.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
3152
+				$sql .= " OR p.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'";
3153 3153
 			}
3154 3154
 
3155 3155
 			// include search in supplier ref
3156 3156
 			if (getDolGlobalString('MAIN_SEARCH_PRODUCT_BY_FOURN_REF')) {
3157
-				$sql .= " OR EXISTS (SELECT pfp.fk_product FROM " . $this->db->prefix() . "product_fournisseur_price as pfp WHERE p.rowid = pfp.fk_product";
3157
+				$sql .= " OR EXISTS (SELECT pfp.fk_product FROM ".$this->db->prefix()."product_fournisseur_price as pfp WHERE p.rowid = pfp.fk_product";
3158 3158
 				$sql .= " AND (";
3159 3159
 				$sql .= $sqlSupplierSearch;
3160 3160
 				$sql .= "))";
@@ -3163,7 +3163,7 @@  discard block
 block discarded – undo
3163 3163
 			$sql .= ')';
3164 3164
 		}
3165 3165
 		if (count($warehouseStatusArray)) {
3166
-			$sql .= " GROUP BY " . $selectFields;
3166
+			$sql .= " GROUP BY ".$selectFields;
3167 3167
 		}
3168 3168
 
3169 3169
 		//Sort by category
@@ -3178,23 +3178,23 @@  discard block
 block discarded – undo
3178 3178
 		$sql .= $this->db->plimit($limit, 0);
3179 3179
 
3180 3180
 		// Build output string
3181
-		dol_syslog(get_class($this) . "::select_produits_list search products", LOG_DEBUG);
3181
+		dol_syslog(get_class($this)."::select_produits_list search products", LOG_DEBUG);
3182 3182
 		$result = $this->db->query($sql);
3183 3183
 		if ($result) {
3184
-			require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
3185
-			require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
3186
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/product.lib.php';
3184
+			require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
3185
+			require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
3186
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php';
3187 3187
 
3188 3188
 			$num = $this->db->num_rows($result);
3189 3189
 
3190 3190
 			$events = array();
3191 3191
 
3192 3192
 			if (!$forcecombo) {
3193
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
3193
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
3194 3194
 				$out .= ajax_combobox($htmlname, $events, getDolGlobalInt("PRODUIT_USE_SEARCH_TO_SELECT"));
3195 3195
 			}
3196 3196
 
3197
-			$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
3197
+			$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
3198 3198
 
3199 3199
 			$textifempty = '';
3200 3200
 			// Do not use textifempty = ' ' or '&nbsp;' here, or search on key will search on ' key'.
@@ -3211,7 +3211,7 @@  discard block
 block discarded – undo
3211 3211
 				}
3212 3212
 			}
3213 3213
 			if ($showempty) {
3214
-				$out .= '<option value="-1" selected>' . ($textifempty ? $textifempty : '&nbsp;') . '</option>';
3214
+				$out .= '<option value="-1" selected>'.($textifempty ? $textifempty : '&nbsp;').'</option>';
3215 3215
 			}
3216 3216
 
3217 3217
 			$i = 0;
@@ -3222,11 +3222,11 @@  discard block
 block discarded – undo
3222 3222
 
3223 3223
 				if ((getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) && !empty($objp->price_by_qty) && $objp->price_by_qty == 1) { // Price by quantity will return many prices for the same product
3224 3224
 					$sql = "SELECT rowid, quantity, price, unitprice, remise_percent, remise, price_base_type";
3225
-					$sql .= " FROM " . $this->db->prefix() . "product_price_by_qty";
3226
-					$sql .= " WHERE fk_product_price = " . ((int) $objp->price_rowid);
3225
+					$sql .= " FROM ".$this->db->prefix()."product_price_by_qty";
3226
+					$sql .= " WHERE fk_product_price = ".((int) $objp->price_rowid);
3227 3227
 					$sql .= " ORDER BY quantity ASC";
3228 3228
 
3229
-					dol_syslog(get_class($this) . "::select_produits_list search prices by qty", LOG_DEBUG);
3229
+					dol_syslog(get_class($this)."::select_produits_list search prices by qty", LOG_DEBUG);
3230 3230
 					$result2 = $this->db->query($sql);
3231 3231
 					if ($result2) {
3232 3232
 						$nb_prices = $this->db->num_rows($result2);
@@ -3264,7 +3264,7 @@  discard block
 block discarded – undo
3264 3264
 						$price_product = new Product($this->db);
3265 3265
 						$price_product->fetch($objp->rowid, '', '', 1);
3266 3266
 
3267
-						require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
3267
+						require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
3268 3268
 						$priceparser = new PriceParser($this->db);
3269 3269
 						$price_result = $priceparser->parseProduct($price_product);
3270 3270
 						if ($price_result >= 0) {
@@ -3350,7 +3350,7 @@  discard block
 block discarded – undo
3350 3350
 			$label = $objp->label_translated;
3351 3351
 		}
3352 3352
 		if (!empty($filterkey) && $filterkey != '') {
3353
-			$label = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $label, 1);
3353
+			$label = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $label, 1);
3354 3354
 		}
3355 3355
 
3356 3356
 		$outkey = $objp->rowid;
@@ -3371,32 +3371,32 @@  discard block
 block discarded – undo
3371 3371
 		$outdurationunit = $outtype == Product::TYPE_SERVICE ? substr($objp->duration, -1) : '';
3372 3372
 
3373 3373
 		if ($outorigin && getDolGlobalString('PRODUCT_SHOW_ORIGIN_IN_COMBO')) {
3374
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
3374
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
3375 3375
 		}
3376 3376
 
3377 3377
 		// Units
3378 3378
 		$outvalUnits = '';
3379 3379
 		if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
3380 3380
 			if (!empty($objp->unit_short)) {
3381
-				$outvalUnits .= ' - ' . $objp->unit_short;
3381
+				$outvalUnits .= ' - '.$objp->unit_short;
3382 3382
 			}
3383 3383
 		}
3384 3384
 		if (getDolGlobalString('PRODUCT_SHOW_DIMENSIONS_IN_COMBO')) {
3385 3385
 			if (!empty($objp->weight) && $objp->weight_units !== null) {
3386 3386
 				$unitToShow = showDimensionInBestUnit($objp->weight, $objp->weight_units, 'weight', $langs);
3387
-				$outvalUnits .= ' - ' . $unitToShow;
3387
+				$outvalUnits .= ' - '.$unitToShow;
3388 3388
 			}
3389 3389
 			if ((!empty($objp->length) || !empty($objp->width) || !empty($objp->height)) && $objp->length_units !== null) {
3390
-				$unitToShow = $objp->length . ' x ' . $objp->width . ' x ' . $objp->height . ' ' . measuringUnitString(0, 'size', $objp->length_units);
3391
-				$outvalUnits .= ' - ' . $unitToShow;
3390
+				$unitToShow = $objp->length.' x '.$objp->width.' x '.$objp->height.' '.measuringUnitString(0, 'size', $objp->length_units);
3391
+				$outvalUnits .= ' - '.$unitToShow;
3392 3392
 			}
3393 3393
 			if (!empty($objp->surface) && $objp->surface_units !== null) {
3394 3394
 				$unitToShow = showDimensionInBestUnit($objp->surface, $objp->surface_units, 'surface', $langs);
3395
-				$outvalUnits .= ' - ' . $unitToShow;
3395
+				$outvalUnits .= ' - '.$unitToShow;
3396 3396
 			}
3397 3397
 			if (!empty($objp->volume) && $objp->volume_units !== null) {
3398 3398
 				$unitToShow = showDimensionInBestUnit($objp->volume, $objp->volume_units, 'volume', $langs);
3399
-				$outvalUnits .= ' - ' . $unitToShow;
3399
+				$outvalUnits .= ' - '.$unitToShow;
3400 3400
 			}
3401 3401
 		}
3402 3402
 		if ($outdurationvalue && $outdurationunit) {
@@ -3408,7 +3408,7 @@  discard block
 block discarded – undo
3408 3408
 				'y' => $langs->trans('Year')
3409 3409
 			);
3410 3410
 			if (isset($da[$outdurationunit])) {
3411
-				$outvalUnits .= ' - ' . $outdurationvalue . ' ' . $langs->transnoentities($da[$outdurationunit] . ($outdurationvalue > 1 ? 's' : ''));
3411
+				$outvalUnits .= ' - '.$outdurationvalue.' '.$langs->transnoentities($da[$outdurationunit].($outdurationvalue > 1 ? 's' : ''));
3412 3412
 			}
3413 3413
 		}
3414 3414
 
@@ -3428,31 +3428,31 @@  discard block
 block discarded – undo
3428 3428
 		$labeltoshow = '';
3429 3429
 		$labeltoshow .= $objp->ref;
3430 3430
 		if (!empty($objp->custref)) {
3431
-			$labeltoshow .= ' (' . $objp->custref . ')';
3431
+			$labeltoshow .= ' ('.$objp->custref.')';
3432 3432
 		}
3433 3433
 		if ($outbarcode) {
3434
-			$labeltoshow .= ' (' . $outbarcode . ')';
3434
+			$labeltoshow .= ' ('.$outbarcode.')';
3435 3435
 		}
3436
-		$labeltoshow .= ' - ' . dol_trunc($label, $maxlengtharticle);
3436
+		$labeltoshow .= ' - '.dol_trunc($label, $maxlengtharticle);
3437 3437
 		if ($outorigin && getDolGlobalString('PRODUCT_SHOW_ORIGIN_IN_COMBO')) {
3438
-			$labeltoshow .= ' (' . getCountry($outorigin, '1') . ')';
3438
+			$labeltoshow .= ' ('.getCountry($outorigin, '1').')';
3439 3439
 		}
3440 3440
 
3441 3441
 		// Set $labltoshowhtml
3442 3442
 		$labeltoshowhtml = '';
3443 3443
 		$labeltoshowhtml .= $objp->ref;
3444 3444
 		if (!empty($objp->custref)) {
3445
-			$labeltoshowhtml .= ' (' . $objp->custref . ')';
3445
+			$labeltoshowhtml .= ' ('.$objp->custref.')';
3446 3446
 		}
3447 3447
 		if (!empty($filterkey) && $filterkey != '') {
3448
-			$labeltoshowhtml = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $labeltoshowhtml, 1);
3448
+			$labeltoshowhtml = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $labeltoshowhtml, 1);
3449 3449
 		}
3450 3450
 		if ($outbarcode) {
3451
-			$labeltoshowhtml .= ' (' . $outbarcode . ')';
3451
+			$labeltoshowhtml .= ' ('.$outbarcode.')';
3452 3452
 		}
3453
-		$labeltoshowhtml .= ' - ' . dol_trunc($label, $maxlengtharticle);
3453
+		$labeltoshowhtml .= ' - '.dol_trunc($label, $maxlengtharticle);
3454 3454
 		if ($outorigin && getDolGlobalString('PRODUCT_SHOW_ORIGIN_IN_COMBO')) {
3455
-			$labeltoshowhtml .= ' (' . getCountry($outorigin, '1') . ')';
3455
+			$labeltoshowhtml .= ' ('.getCountry($outorigin, '1').')';
3456 3456
 		}
3457 3457
 
3458 3458
 		// Stock
@@ -3460,14 +3460,14 @@  discard block
 block discarded – undo
3460 3460
 		$labeltoshowhtmlstock = '';
3461 3461
 		if (isModEnabled('stock') && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || getDolGlobalString('STOCK_SUPPORTS_SERVICES'))) {
3462 3462
 			if ($user->hasRight('stock', 'lire')) {
3463
-				$labeltoshowstock .= ' - ' . $langs->trans("Stock") . ': ' . price(price2num($objp->stock, 'MS'), 0, $langs, 0, 0);
3463
+				$labeltoshowstock .= ' - '.$langs->trans("Stock").': '.price(price2num($objp->stock, 'MS'), 0, $langs, 0, 0);
3464 3464
 
3465 3465
 				if ($objp->stock > 0) {
3466 3466
 					$labeltoshowhtmlstock .= ' - <span class="product_line_stock_ok">';
3467 3467
 				} elseif ($objp->stock <= 0) {
3468 3468
 					$labeltoshowhtmlstock .= ' - <span class="product_line_stock_too_low">';
3469 3469
 				}
3470
-				$labeltoshowhtmlstock .= $langs->transnoentities("Stock") . ': ' . price(price2num($objp->stock, 'MS'), 0, $langs, 0, 0);
3470
+				$labeltoshowhtmlstock .= $langs->transnoentities("Stock").': '.price(price2num($objp->stock, 'MS'), 0, $langs, 0, 0);
3471 3471
 				$labeltoshowhtmlstock .= '</span>';
3472 3472
 
3473 3473
 				if (empty($novirtualstock) && getDolGlobalString('STOCK_SHOW_VIRTUAL_STOCK_IN_PRODUCTS_COMBO')) {  // Warning, this option may slow down combo list generation
@@ -3478,9 +3478,9 @@  discard block
 block discarded – undo
3478 3478
 					$tmpproduct->load_virtual_stock();
3479 3479
 					$virtualstock = $tmpproduct->stock_theorique;
3480 3480
 
3481
-					$labeltoshowstock .= ' - ' . $langs->trans("VirtualStock") . ':' . $virtualstock;
3481
+					$labeltoshowstock .= ' - '.$langs->trans("VirtualStock").':'.$virtualstock;
3482 3482
 
3483
-					$labeltoshowhtmlstock .= ' - ' . $langs->transnoentities("VirtualStock") . ':';
3483
+					$labeltoshowhtmlstock .= ' - '.$langs->transnoentities("VirtualStock").':';
3484 3484
 					if ($virtualstock > 0) {
3485 3485
 						$labeltoshowhtmlstock .= '<span class="product_line_stock_ok">';
3486 3486
 					} elseif ($virtualstock <= 0) {
@@ -3501,35 +3501,35 @@  discard block
 block discarded – undo
3501 3501
 		// If we need a particular price level (from 1 to n)
3502 3502
 		if (empty($hidepriceinlabel) && $price_level >= 1 && (getDolGlobalString('PRODUIT_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES'))) {
3503 3503
 			$sql = "SELECT price, price_ttc, price_base_type, tva_tx, default_vat_code";
3504
-			$sql .= " FROM " . $this->db->prefix() . "product_price";
3505
-			$sql .= " WHERE fk_product = " . ((int) $objp->rowid);
3506
-			$sql .= " AND entity IN (" . getEntity('productprice') . ")";
3507
-			$sql .= " AND price_level = " . ((int) $price_level);
3504
+			$sql .= " FROM ".$this->db->prefix()."product_price";
3505
+			$sql .= " WHERE fk_product = ".((int) $objp->rowid);
3506
+			$sql .= " AND entity IN (".getEntity('productprice').")";
3507
+			$sql .= " AND price_level = ".((int) $price_level);
3508 3508
 			$sql .= " ORDER BY date_price DESC, rowid DESC"; // Warning DESC must be both on date_price and rowid.
3509 3509
 			$sql .= " LIMIT 1";
3510 3510
 
3511
-			dol_syslog(get_class($this) . '::constructProductListOption search price for product ' . $objp->rowid . ' AND level ' . $price_level, LOG_DEBUG);
3511
+			dol_syslog(get_class($this).'::constructProductListOption search price for product '.$objp->rowid.' AND level '.$price_level, LOG_DEBUG);
3512 3512
 			$result2 = $this->db->query($sql);
3513 3513
 			if ($result2) {
3514 3514
 				$objp2 = $this->db->fetch_object($result2);
3515 3515
 				if ($objp2) {
3516 3516
 					$found = 1;
3517 3517
 					if ($objp2->price_base_type == 'HT') {
3518
-						$labeltoshowprice .= ' - ' . price($objp2->price, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("HT");
3519
-						$labeltoshowhtmlprice .= ' - ' . price($objp2->price, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("HT");
3518
+						$labeltoshowprice .= ' - '.price($objp2->price, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT");
3519
+						$labeltoshowhtmlprice .= ' - '.price($objp2->price, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT");
3520 3520
 					} else {
3521
-						$labeltoshowprice .= ' - ' . price($objp2->price_ttc, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("TTC");
3522
-						$labeltoshowhtmlprice .= ' - ' . price($objp2->price_ttc, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("TTC");
3521
+						$labeltoshowprice .= ' - '.price($objp2->price_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC");
3522
+						$labeltoshowhtmlprice .= ' - '.price($objp2->price_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC");
3523 3523
 					}
3524 3524
 					$outprice_ht = price($objp2->price);
3525 3525
 					$outprice_ttc = price($objp2->price_ttc);
3526 3526
 					$outpricebasetype = $objp2->price_base_type;
3527 3527
 					if (getDolGlobalString('PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL')) {  // using this option is a bug. kept for backward compatibility
3528
-						$outtva_tx = $objp2->tva_tx;                        // We use the vat rate on line of multiprice
3529
-						$outdefault_vat_code = $objp2->default_vat_code;    // We use the vat code on line of multiprice
3528
+						$outtva_tx = $objp2->tva_tx; // We use the vat rate on line of multiprice
3529
+						$outdefault_vat_code = $objp2->default_vat_code; // We use the vat code on line of multiprice
3530 3530
 					} else {
3531
-						$outtva_tx = $objp->tva_tx;                            // We use the vat rate of product, not the one on line of multiprice
3532
-						$outdefault_vat_code = $objp->default_vat_code;        // We use the vat code or product, not the one on line of multiprice
3531
+						$outtva_tx = $objp->tva_tx; // We use the vat rate of product, not the one on line of multiprice
3532
+						$outdefault_vat_code = $objp->default_vat_code; // We use the vat code or product, not the one on line of multiprice
3533 3533
 					}
3534 3534
 				}
3535 3535
 			} else {
@@ -3543,13 +3543,13 @@  discard block
 block discarded – undo
3543 3543
 			$outqty = $objp->quantity;
3544 3544
 			$outdiscount = $objp->remise_percent;
3545 3545
 			if ($objp->quantity == 1) {
3546
-				$labeltoshowprice .= ' - ' . price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency) . "/";
3547
-				$labeltoshowhtmlprice .= ' - ' . price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency) . "/";
3546
+				$labeltoshowprice .= ' - '.price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency)."/";
3547
+				$labeltoshowhtmlprice .= ' - '.price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency)."/";
3548 3548
 				$labeltoshowprice .= $langs->trans("Unit"); // Do not use strtolower because it breaks utf8 encoding
3549 3549
 				$labeltoshowhtmlprice .= $langs->transnoentities("Unit");
3550 3550
 			} else {
3551
-				$labeltoshowprice .= ' - ' . price($objp->price, 1, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity;
3552
-				$labeltoshowhtmlprice .= ' - ' . price($objp->price, 0, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity;
3551
+				$labeltoshowprice .= ' - '.price($objp->price, 1, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity;
3552
+				$labeltoshowhtmlprice .= ' - '.price($objp->price, 0, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity;
3553 3553
 				$labeltoshowprice .= $langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding
3554 3554
 				$labeltoshowhtmlprice .= $langs->transnoentities("Units");
3555 3555
 			}
@@ -3557,16 +3557,16 @@  discard block
 block discarded – undo
3557 3557
 			$outprice_ht = price($objp->unitprice);
3558 3558
 			$outprice_ttc = price($objp->unitprice * (1 + ($objp->tva_tx / 100)));
3559 3559
 			$outpricebasetype = $objp->price_base_type;
3560
-			$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
3561
-			$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
3560
+			$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
3561
+			$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
3562 3562
 		}
3563 3563
 		if (empty($hidepriceinlabel) && !empty($objp->quantity) && $objp->quantity >= 1) {
3564
-			$labeltoshowprice .= " (" . price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->trans("Unit") . ")"; // Do not use strtolower because it breaks utf8 encoding
3565
-			$labeltoshowhtmlprice .= " (" . price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->transnoentities("Unit") . ")"; // Do not use strtolower because it breaks utf8 encoding
3564
+			$labeltoshowprice .= " (".price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency)."/".$langs->trans("Unit").")"; // Do not use strtolower because it breaks utf8 encoding
3565
+			$labeltoshowhtmlprice .= " (".price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency)."/".$langs->transnoentities("Unit").")"; // Do not use strtolower because it breaks utf8 encoding
3566 3566
 		}
3567 3567
 		if (empty($hidepriceinlabel) && !empty($objp->remise_percent) && $objp->remise_percent >= 1) {
3568
-			$labeltoshowprice .= " - " . $langs->trans("Discount") . " : " . vatrate($objp->remise_percent) . ' %';
3569
-			$labeltoshowhtmlprice .= " - " . $langs->transnoentities("Discount") . " : " . vatrate($objp->remise_percent) . ' %';
3568
+			$labeltoshowprice .= " - ".$langs->trans("Discount")." : ".vatrate($objp->remise_percent).' %';
3569
+			$labeltoshowhtmlprice .= " - ".$langs->transnoentities("Discount")." : ".vatrate($objp->remise_percent).' %';
3570 3570
 		}
3571 3571
 
3572 3572
 		// Price by customer
@@ -3575,11 +3575,11 @@  discard block
 block discarded – undo
3575 3575
 				$found = 1;
3576 3576
 
3577 3577
 				if ($objp->custprice_base_type == 'HT') {
3578
-					$labeltoshowprice .= ' - ' . price($objp->custprice, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("HT");
3579
-					$labeltoshowhtmlprice .= ' - ' . price($objp->custprice, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("HT");
3578
+					$labeltoshowprice .= ' - '.price($objp->custprice, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT");
3579
+					$labeltoshowhtmlprice .= ' - '.price($objp->custprice, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT");
3580 3580
 				} else {
3581
-					$labeltoshowprice .= ' - ' . price($objp->custprice_ttc, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("TTC");
3582
-					$labeltoshowhtmlprice .= ' - ' . price($objp->custprice_ttc, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("TTC");
3581
+					$labeltoshowprice .= ' - '.price($objp->custprice_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC");
3582
+					$labeltoshowhtmlprice .= ' - '.price($objp->custprice_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC");
3583 3583
 				}
3584 3584
 
3585 3585
 				$outprice_ht = price($objp->custprice);
@@ -3593,11 +3593,11 @@  discard block
 block discarded – undo
3593 3593
 		// If level no defined or multiprice not found, we used the default price
3594 3594
 		if (empty($hidepriceinlabel) && !$found) {
3595 3595
 			if ($objp->price_base_type == 'HT') {
3596
-				$labeltoshowprice .= ' - ' . price($objp->price, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("HT");
3597
-				$labeltoshowhtmlprice .= ' - ' . price($objp->price, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("HT");
3596
+				$labeltoshowprice .= ' - '.price($objp->price, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT");
3597
+				$labeltoshowhtmlprice .= ' - '.price($objp->price, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT");
3598 3598
 			} else {
3599
-				$labeltoshowprice .= ' - ' . price($objp->price_ttc, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("TTC");
3600
-				$labeltoshowhtmlprice .= ' - ' . price($objp->price_ttc, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("TTC");
3599
+				$labeltoshowprice .= ' - '.price($objp->price_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC");
3600
+				$labeltoshowhtmlprice .= ' - '.price($objp->price_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC");
3601 3601
 			}
3602 3602
 			$outprice_ht = price($objp->price);
3603 3603
 			$outprice_ttc = price($objp->price_ttc);
@@ -3607,14 +3607,14 @@  discard block
 block discarded – undo
3607 3607
 		}
3608 3608
 
3609 3609
 		// Build options
3610
-		$opt = '<option value="' . $objp->rowid . '"';
3610
+		$opt = '<option value="'.$objp->rowid.'"';
3611 3611
 		$opt .= ($objp->rowid == $selected) ? ' selected' : '';
3612 3612
 		if (!empty($objp->price_by_qty_rowid) && $objp->price_by_qty_rowid > 0) {
3613
-			$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 . '"';
3613
+			$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.'"';
3614 3614
 		}
3615 3615
 		if (getDolGlobalString('PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE')) {
3616
-			$opt .= ' data-labeltrans="' . $outlabel_translated . '"';
3617
-			$opt .= ' data-desctrans="' . dol_escape_htmltag($outdesc_translated) . '"';
3616
+			$opt .= ' data-labeltrans="'.$outlabel_translated.'"';
3617
+			$opt .= ' data-desctrans="'.dol_escape_htmltag($outdesc_translated).'"';
3618 3618
 		}
3619 3619
 
3620 3620
 		if ($stocktag == 1) {
@@ -3709,7 +3709,7 @@  discard block
 block discarded – undo
3709 3709
 		$selected_input_value = '';
3710 3710
 		if (!empty($conf->use_javascript_ajax) && getDolGlobalString('PRODUIT_USE_SEARCH_TO_SELECT')) {
3711 3711
 			if ($selected > 0) {
3712
-				require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
3712
+				require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
3713 3713
 				$producttmpselect = new Product($this->db);
3714 3714
 				$producttmpselect->fetch($selected);
3715 3715
 				$selected_input_value = $producttmpselect->ref;
@@ -3717,10 +3717,10 @@  discard block
 block discarded – undo
3717 3717
 			}
3718 3718
 
3719 3719
 			// mode=2 means suppliers products
3720
-			$urloption = ($socid > 0 ? 'socid=' . $socid . '&' : '') . 'htmlname=' . $htmlname . '&outjson=1&price_level=' . $price_level . '&type=' . $filtertype . '&mode=2&status=' . $status . '&finished=' . $finished . '&alsoproductwithnosupplierprice=' . $alsoproductwithnosupplierprice;
3721
-			print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/product/ajax/products.php', $urloption, getDolGlobalInt('PRODUIT_USE_SEARCH_TO_SELECT'), 0, $ajaxoptions);
3720
+			$urloption = ($socid > 0 ? 'socid='.$socid.'&' : '').'htmlname='.$htmlname.'&outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=2&status='.$status.'&finished='.$finished.'&alsoproductwithnosupplierprice='.$alsoproductwithnosupplierprice;
3721
+			print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajax/products.php', $urloption, getDolGlobalInt('PRODUIT_USE_SEARCH_TO_SELECT'), 0, $ajaxoptions);
3722 3722
 
3723
-			print($hidelabel ? '' : $langs->trans("RefOrLabel") . ' : ') . '<input type="text" class="'.$morecss.'" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . ($placeholder ? ' placeholder="' . $placeholder . '"' : '') . '>';
3723
+			print($hidelabel ? '' : $langs->trans("RefOrLabel").' : ').'<input type="text" class="'.$morecss.'" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.($placeholder ? ' placeholder="'.$placeholder.'"' : '').'>';
3724 3724
 		} else {
3725 3725
 			print $this->select_produits_fournisseurs_list($socid, $selected, $htmlname, $filtertype, $filtre, '', $status, 0, 0, $alsoproductwithnosupplierprice, $morecss, 0, $placeholder);
3726 3726
 		}
@@ -3778,25 +3778,25 @@  discard block
 block discarded – undo
3778 3778
 		if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
3779 3779
 			$sql .= ", u.label as unit_long, u.short_label as unit_short, p.weight, p.weight_units, p.length, p.length_units, p.width, p.width_units, p.height, p.height_units, p.surface, p.surface_units, p.volume, p.volume_units";
3780 3780
 		}
3781
-		$sql .= " FROM " . $this->db->prefix() . "product as p";
3782
-		$sql .= " LEFT JOIN " . $this->db->prefix() . "product_fournisseur_price as pfp ON ( p.rowid = pfp.fk_product AND pfp.entity IN (" . getEntity('product') . ") )";
3781
+		$sql .= " FROM ".$this->db->prefix()."product as p";
3782
+		$sql .= " LEFT JOIN ".$this->db->prefix()."product_fournisseur_price as pfp ON ( p.rowid = pfp.fk_product AND pfp.entity IN (".getEntity('product').") )";
3783 3783
 		if ($socid > 0) {
3784
-			$sql .= " AND pfp.fk_soc = " . ((int) $socid);
3784
+			$sql .= " AND pfp.fk_soc = ".((int) $socid);
3785 3785
 		}
3786
-		$sql .= " LEFT JOIN " . $this->db->prefix() . "societe as s ON pfp.fk_soc = s.rowid";
3786
+		$sql .= " LEFT JOIN ".$this->db->prefix()."societe as s ON pfp.fk_soc = s.rowid";
3787 3787
 		// Units
3788 3788
 		if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
3789
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "c_units u ON u.rowid = p.fk_unit";
3789
+			$sql .= " LEFT JOIN ".$this->db->prefix()."c_units u ON u.rowid = p.fk_unit";
3790 3790
 		}
3791
-		$sql .= " WHERE p.entity IN (" . getEntity('product') . ")";
3791
+		$sql .= " WHERE p.entity IN (".getEntity('product').")";
3792 3792
 		if ($statut != -1) {
3793
-			$sql .= " AND p.tobuy = " . ((int) $statut);
3793
+			$sql .= " AND p.tobuy = ".((int) $statut);
3794 3794
 		}
3795 3795
 		if (strval($filtertype) != '') {
3796
-			$sql .= " AND p.fk_product_type = " . ((int) $filtertype);
3796
+			$sql .= " AND p.fk_product_type = ".((int) $filtertype);
3797 3797
 		}
3798 3798
 		if (!empty($filtre)) {
3799
-			$sql .= " " . $filtre;
3799
+			$sql .= " ".$filtre;
3800 3800
 		}
3801 3801
 		// Add where from hooks
3802 3802
 		$parameters = array();
@@ -3816,9 +3816,9 @@  discard block
 block discarded – undo
3816 3816
 				if ($i > 0) {
3817 3817
 					$sql .= " AND ";
3818 3818
 				}
3819
-				$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) . "%'";
3819
+				$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)."%'";
3820 3820
 				if (getDolGlobalString('PRODUIT_FOURN_TEXTS')) {
3821
-					$sql .= " OR pfp.desc_fourn LIKE '" . $this->db->escape($prefix . $crit) . "%'";
3821
+					$sql .= " OR pfp.desc_fourn LIKE '".$this->db->escape($prefix.$crit)."%'";
3822 3822
 				}
3823 3823
 				$sql .= ")";
3824 3824
 				$i++;
@@ -3827,8 +3827,8 @@  discard block
 block discarded – undo
3827 3827
 				$sql .= ")";
3828 3828
 			}
3829 3829
 			if (isModEnabled('barcode')) {
3830
-				$sql .= " OR p.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
3831
-				$sql .= " OR pfp.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
3830
+				$sql .= " OR p.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'";
3831
+				$sql .= " OR pfp.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'";
3832 3832
 			}
3833 3833
 			$sql .= ')';
3834 3834
 		}
@@ -3837,20 +3837,20 @@  discard block
 block discarded – undo
3837 3837
 
3838 3838
 		// Build output string
3839 3839
 
3840
-		dol_syslog(get_class($this) . "::select_produits_fournisseurs_list", LOG_DEBUG);
3840
+		dol_syslog(get_class($this)."::select_produits_fournisseurs_list", LOG_DEBUG);
3841 3841
 		$result = $this->db->query($sql);
3842 3842
 		if ($result) {
3843
-			require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
3844
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/product.lib.php';
3843
+			require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
3844
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php';
3845 3845
 
3846 3846
 			$num = $this->db->num_rows($result);
3847 3847
 
3848 3848
 			//$out.='<select class="flat" id="select'.$htmlname.'" name="'.$htmlname.'">';	// remove select to have id same with combo and ajax
3849
-			$out .= '<select class="flat ' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . '">';
3849
+			$out .= '<select class="flat '.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.'">';
3850 3850
 			if (!$selected) {
3851
-				$out .= '<option value="-1" selected>' . ($placeholder ? $placeholder : '&nbsp;') . '</option>';
3851
+				$out .= '<option value="-1" selected>'.($placeholder ? $placeholder : '&nbsp;').'</option>';
3852 3852
 			} else {
3853
-				$out .= '<option value="-1">' . ($placeholder ? $placeholder : '&nbsp;') . '</option>';
3853
+				$out .= '<option value="-1">'.($placeholder ? $placeholder : '&nbsp;').'</option>';
3854 3854
 			}
3855 3855
 
3856 3856
 			$i = 0;
@@ -3865,7 +3865,7 @@  discard block
 block discarded – undo
3865 3865
 
3866 3866
 				$outkey = $objp->idprodfournprice; // id in table of price
3867 3867
 				if (!$outkey && $alsoproductwithnosupplierprice) {
3868
-					$outkey = 'idprod_' . $objp->rowid; // id of product
3868
+					$outkey = 'idprod_'.$objp->rowid; // id of product
3869 3869
 				}
3870 3870
 
3871 3871
 				$outref = $objp->ref;
@@ -3880,23 +3880,23 @@  discard block
 block discarded – undo
3880 3880
 				$outvalUnits = '';
3881 3881
 				if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
3882 3882
 					if (!empty($objp->unit_short)) {
3883
-						$outvalUnits .= ' - ' . $objp->unit_short;
3883
+						$outvalUnits .= ' - '.$objp->unit_short;
3884 3884
 					}
3885 3885
 					if (!empty($objp->weight) && $objp->weight_units !== null) {
3886 3886
 						$unitToShow = showDimensionInBestUnit($objp->weight, $objp->weight_units, 'weight', $langs);
3887
-						$outvalUnits .= ' - ' . $unitToShow;
3887
+						$outvalUnits .= ' - '.$unitToShow;
3888 3888
 					}
3889 3889
 					if ((!empty($objp->length) || !empty($objp->width) || !empty($objp->height)) && $objp->length_units !== null) {
3890
-						$unitToShow = $objp->length . ' x ' . $objp->width . ' x ' . $objp->height . ' ' . measuringUnitString(0, 'size', $objp->length_units);
3891
-						$outvalUnits .= ' - ' . $unitToShow;
3890
+						$unitToShow = $objp->length.' x '.$objp->width.' x '.$objp->height.' '.measuringUnitString(0, 'size', $objp->length_units);
3891
+						$outvalUnits .= ' - '.$unitToShow;
3892 3892
 					}
3893 3893
 					if (!empty($objp->surface) && $objp->surface_units !== null) {
3894 3894
 						$unitToShow = showDimensionInBestUnit($objp->surface, $objp->surface_units, 'surface', $langs);
3895
-						$outvalUnits .= ' - ' . $unitToShow;
3895
+						$outvalUnits .= ' - '.$unitToShow;
3896 3896
 					}
3897 3897
 					if (!empty($objp->volume) && $objp->volume_units !== null) {
3898 3898
 						$unitToShow = showDimensionInBestUnit($objp->volume, $objp->volume_units, 'volume', $langs);
3899
-						$outvalUnits .= ' - ' . $unitToShow;
3899
+						$outvalUnits .= ' - '.$unitToShow;
3900 3900
 					}
3901 3901
 					if ($outdurationvalue && $outdurationunit) {
3902 3902
 						$da = array(
@@ -3907,22 +3907,22 @@  discard block
 block discarded – undo
3907 3907
 							'y' => $langs->trans('Year')
3908 3908
 						);
3909 3909
 						if (isset($da[$outdurationunit])) {
3910
-							$outvalUnits .= ' - ' . $outdurationvalue . ' ' . $langs->transnoentities($da[$outdurationunit] . ($outdurationvalue > 1 ? 's' : ''));
3910
+							$outvalUnits .= ' - '.$outdurationvalue.' '.$langs->transnoentities($da[$outdurationunit].($outdurationvalue > 1 ? 's' : ''));
3911 3911
 						}
3912 3912
 					}
3913 3913
 				}
3914 3914
 
3915 3915
 				$objRef = $objp->ref;
3916 3916
 				if ($filterkey && $filterkey != '') {
3917
-					$objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1);
3917
+					$objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1);
3918 3918
 				}
3919 3919
 				$objRefFourn = $objp->ref_fourn;
3920 3920
 				if ($filterkey && $filterkey != '') {
3921
-					$objRefFourn = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRefFourn, 1);
3921
+					$objRefFourn = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRefFourn, 1);
3922 3922
 				}
3923 3923
 				$label = $objp->label;
3924 3924
 				if ($filterkey && $filterkey != '') {
3925
-					$label = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $label, 1);
3925
+					$label = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $label, 1);
3926 3926
 				}
3927 3927
 
3928 3928
 				switch ($objp->fk_product_type) {
@@ -3945,21 +3945,21 @@  discard block
 block discarded – undo
3945 3945
 
3946 3946
 				$optlabel .= $objp->ref;
3947 3947
 				if (!empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) {
3948
-					$optlabel .= ' <span class="opacitymedium">(' . $objp->ref_fourn . ')</span>';
3948
+					$optlabel .= ' <span class="opacitymedium">('.$objp->ref_fourn.')</span>';
3949 3949
 				}
3950 3950
 				if (isModEnabled('barcode') && !empty($objp->barcode)) {
3951
-					$optlabel .= ' (' . $outbarcode . ')';
3951
+					$optlabel .= ' ('.$outbarcode.')';
3952 3952
 				}
3953
-				$optlabel .= ' - ' . dol_trunc($label, $maxlengtharticle);
3953
+				$optlabel .= ' - '.dol_trunc($label, $maxlengtharticle);
3954 3954
 
3955 3955
 				$outvallabel = $objRef;
3956 3956
 				if (!empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) {
3957
-					$outvallabel .= ' (' . $objRefFourn . ')';
3957
+					$outvallabel .= ' ('.$objRefFourn.')';
3958 3958
 				}
3959 3959
 				if (isModEnabled('barcode') && !empty($objp->barcode)) {
3960
-					$outvallabel .= ' (' . $outbarcode . ')';
3960
+					$outvallabel .= ' ('.$outbarcode.')';
3961 3961
 				}
3962
-				$outvallabel .= ' - ' . dol_trunc($label, $maxlengtharticle);
3962
+				$outvallabel .= ' - '.dol_trunc($label, $maxlengtharticle);
3963 3963
 
3964 3964
 				// Units
3965 3965
 				$optlabel .= $outvalUnits;
@@ -3976,7 +3976,7 @@  discard block
 block discarded – undo
3976 3976
 						$prod_supplier->fourn_tva_tx = $objp->tva_tx;
3977 3977
 						$prod_supplier->fk_supplier_price_expression = $objp->fk_supplier_price_expression;
3978 3978
 
3979
-						require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
3979
+						require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
3980 3980
 						$priceparser = new PriceParser($this->db);
3981 3981
 						$price_result = $priceparser->parseProductSupplier($prod_supplier);
3982 3982
 						if ($price_result >= 0) {
@@ -3987,57 +3987,57 @@  discard block
 block discarded – undo
3987 3987
 						}
3988 3988
 					}
3989 3989
 					if ($objp->quantity == 1) {
3990
-						$optlabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/";
3991
-						$outvallabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency) . "/";
3990
+						$optlabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/";
3991
+						$outvallabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency)."/";
3992 3992
 						$optlabel .= $langs->trans("Unit"); // Do not use strtolower because it breaks utf8 encoding
3993 3993
 						$outvallabel .= $langs->transnoentities("Unit");
3994 3994
 					} else {
3995
-						$optlabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity;
3996
-						$outvallabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity;
3997
-						$optlabel .= ' ' . $langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding
3998
-						$outvallabel .= ' ' . $langs->transnoentities("Units");
3995
+						$optlabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity;
3996
+						$outvallabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity;
3997
+						$optlabel .= ' '.$langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding
3998
+						$outvallabel .= ' '.$langs->transnoentities("Units");
3999 3999
 					}
4000 4000
 
4001 4001
 					if ($objp->quantity > 1) {
4002
-						$optlabel .= " (" . price($objp->unitprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->trans("Unit") . ")"; // Do not use strtolower because it breaks utf8 encoding
4003
-						$outvallabel .= " (" . price($objp->unitprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->transnoentities("Unit") . ")"; // Do not use strtolower because it breaks utf8 encoding
4002
+						$optlabel .= " (".price($objp->unitprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/".$langs->trans("Unit").")"; // Do not use strtolower because it breaks utf8 encoding
4003
+						$outvallabel .= " (".price($objp->unitprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency)."/".$langs->transnoentities("Unit").")"; // Do not use strtolower because it breaks utf8 encoding
4004 4004
 					}
4005 4005
 					if ($objp->remise_percent >= 1) {
4006
-						$optlabel .= " - " . $langs->trans("Discount") . " : " . vatrate($objp->remise_percent) . ' %';
4007
-						$outvallabel .= " - " . $langs->transnoentities("Discount") . " : " . vatrate($objp->remise_percent) . ' %';
4006
+						$optlabel .= " - ".$langs->trans("Discount")." : ".vatrate($objp->remise_percent).' %';
4007
+						$outvallabel .= " - ".$langs->transnoentities("Discount")." : ".vatrate($objp->remise_percent).' %';
4008 4008
 					}
4009 4009
 					if ($objp->duration) {
4010
-						$optlabel .= " - " . $objp->duration;
4011
-						$outvallabel .= " - " . $objp->duration;
4010
+						$optlabel .= " - ".$objp->duration;
4011
+						$outvallabel .= " - ".$objp->duration;
4012 4012
 					}
4013 4013
 					if (!$socid) {
4014
-						$optlabel .= " - " . dol_trunc($objp->name, 8);
4015
-						$outvallabel .= " - " . dol_trunc($objp->name, 8);
4014
+						$optlabel .= " - ".dol_trunc($objp->name, 8);
4015
+						$outvallabel .= " - ".dol_trunc($objp->name, 8);
4016 4016
 					}
4017 4017
 					if ($objp->supplier_reputation) {
4018 4018
 						//TODO dictionary
4019 4019
 						$reputations = array('' => $langs->trans('Standard'), 'FAVORITE' => $langs->trans('Favorite'), 'NOTTHGOOD' => $langs->trans('NotTheGoodQualitySupplier'), 'DONOTORDER' => $langs->trans('DoNotOrderThisProductToThisSupplier'));
4020 4020
 
4021
-						$optlabel .= " - " . $reputations[$objp->supplier_reputation];
4022
-						$outvallabel .= " - " . $reputations[$objp->supplier_reputation];
4021
+						$optlabel .= " - ".$reputations[$objp->supplier_reputation];
4022
+						$outvallabel .= " - ".$reputations[$objp->supplier_reputation];
4023 4023
 					}
4024 4024
 				} else {
4025
-					$optlabel .= " - <span class='opacitymedium'>" . $langs->trans("NoPriceDefinedForThisSupplier") . '</span>';
4026
-					$outvallabel .= ' - ' . $langs->transnoentities("NoPriceDefinedForThisSupplier");
4025
+					$optlabel .= " - <span class='opacitymedium'>".$langs->trans("NoPriceDefinedForThisSupplier").'</span>';
4026
+					$outvallabel .= ' - '.$langs->transnoentities("NoPriceDefinedForThisSupplier");
4027 4027
 				}
4028 4028
 
4029 4029
 				if (isModEnabled('stock') && $showstockinlist && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || getDolGlobalString('STOCK_SUPPORTS_SERVICES'))) {
4030 4030
 					$novirtualstock = ($showstockinlist == 2);
4031 4031
 
4032 4032
 					if ($user->hasRight('stock', 'lire')) {
4033
-						$outvallabel .= ' - ' . $langs->trans("Stock") . ': ' . price(price2num($objp->stock, 'MS'), 0, $langs, 0, 0);
4033
+						$outvallabel .= ' - '.$langs->trans("Stock").': '.price(price2num($objp->stock, 'MS'), 0, $langs, 0, 0);
4034 4034
 
4035 4035
 						if ($objp->stock > 0) {
4036 4036
 							$optlabel .= ' - <span class="product_line_stock_ok">';
4037 4037
 						} elseif ($objp->stock <= 0) {
4038 4038
 							$optlabel .= ' - <span class="product_line_stock_too_low">';
4039 4039
 						}
4040
-						$optlabel .= $langs->transnoentities("Stock") . ':' . price(price2num($objp->stock, 'MS'));
4040
+						$optlabel .= $langs->transnoentities("Stock").':'.price(price2num($objp->stock, 'MS'));
4041 4041
 						$optlabel .= '</span>';
4042 4042
 						if (empty($novirtualstock) && getDolGlobalString('STOCK_SHOW_VIRTUAL_STOCK_IN_PRODUCTS_COMBO')) {  // Warning, this option may slow down combo list generation
4043 4043
 							$langs->load("stocks");
@@ -4047,9 +4047,9 @@  discard block
 block discarded – undo
4047 4047
 							$tmpproduct->load_virtual_stock();
4048 4048
 							$virtualstock = $tmpproduct->stock_theorique;
4049 4049
 
4050
-							$outvallabel .= ' - ' . $langs->trans("VirtualStock") . ':' . $virtualstock;
4050
+							$outvallabel .= ' - '.$langs->trans("VirtualStock").':'.$virtualstock;
4051 4051
 
4052
-							$optlabel .= ' - ' . $langs->transnoentities("VirtualStock") . ':';
4052
+							$optlabel .= ' - '.$langs->transnoentities("VirtualStock").':';
4053 4053
 							if ($virtualstock > 0) {
4054 4054
 								$optlabel .= '<span class="product_line_stock_ok">';
4055 4055
 							} elseif ($virtualstock <= 0) {
@@ -4063,7 +4063,7 @@  discard block
 block discarded – undo
4063 4063
 					}
4064 4064
 				}
4065 4065
 
4066
-				$optstart = '<option value="' . $outkey . '"';
4066
+				$optstart = '<option value="'.$outkey.'"';
4067 4067
 				if ($selected && $selected == $objp->idprodfournprice) {
4068 4068
 					$optstart .= ' selected';
4069 4069
 				}
@@ -4072,22 +4072,22 @@  discard block
 block discarded – undo
4072 4072
 				}
4073 4073
 
4074 4074
 				if (!empty($objp->idprodfournprice) && $objp->idprodfournprice > 0) {
4075
-					$optstart .= ' data-product-id="' . dol_escape_htmltag($objp->rowid) . '"';
4076
-					$optstart .= ' data-price-id="' . dol_escape_htmltag($objp->idprodfournprice) . '"';
4077
-					$optstart .= ' data-qty="' . dol_escape_htmltag($objp->quantity) . '"';
4078
-					$optstart .= ' data-up="' . dol_escape_htmltag(price2num($objp->unitprice)) . '"';		// the price with numeric international format
4079
-					$optstart .= ' data-up-locale="' . dol_escape_htmltag(price($objp->unitprice)) . '"';	// the price formatted in user language
4080
-					$optstart .= ' data-discount="' . dol_escape_htmltag($outdiscount) . '"';
4081
-					$optstart .= ' data-tvatx="' . dol_escape_htmltag(price2num($objp->tva_tx)) . '"';		// the rate with numeric international format
4082
-					$optstart .= ' data-tvatx-formated="' . dol_escape_htmltag(price($objp->tva_tx, 0, $langs, 1, -1, 2)) . '"';	// the rate formatted in user language
4083
-					$optstart .= ' data-default-vat-code="' . dol_escape_htmltag($objp->default_vat_code) . '"';
4084
-					$optstart .= ' data-supplier-ref="' . dol_escape_htmltag($objp->ref_fourn) . '"';
4075
+					$optstart .= ' data-product-id="'.dol_escape_htmltag($objp->rowid).'"';
4076
+					$optstart .= ' data-price-id="'.dol_escape_htmltag($objp->idprodfournprice).'"';
4077
+					$optstart .= ' data-qty="'.dol_escape_htmltag($objp->quantity).'"';
4078
+					$optstart .= ' data-up="'.dol_escape_htmltag(price2num($objp->unitprice)).'"'; // the price with numeric international format
4079
+					$optstart .= ' data-up-locale="'.dol_escape_htmltag(price($objp->unitprice)).'"'; // the price formatted in user language
4080
+					$optstart .= ' data-discount="'.dol_escape_htmltag($outdiscount).'"';
4081
+					$optstart .= ' data-tvatx="'.dol_escape_htmltag(price2num($objp->tva_tx)).'"'; // the rate with numeric international format
4082
+					$optstart .= ' data-tvatx-formated="'.dol_escape_htmltag(price($objp->tva_tx, 0, $langs, 1, -1, 2)).'"'; // the rate formatted in user language
4083
+					$optstart .= ' data-default-vat-code="'.dol_escape_htmltag($objp->default_vat_code).'"';
4084
+					$optstart .= ' data-supplier-ref="'.dol_escape_htmltag($objp->ref_fourn).'"';
4085 4085
 					if (isModEnabled('multicurrency')) {
4086
-						$optstart .= ' data-multicurrency-code="' . dol_escape_htmltag($objp->multicurrency_code) . '"';
4087
-						$optstart .= ' data-multicurrency-unitprice="' . dol_escape_htmltag(price2num($objp->multicurrency_unitprice)) . '"';	// the price with numeric international format
4086
+						$optstart .= ' data-multicurrency-code="'.dol_escape_htmltag($objp->multicurrency_code).'"';
4087
+						$optstart .= ' data-multicurrency-unitprice="'.dol_escape_htmltag(price2num($objp->multicurrency_unitprice)).'"'; // the price with numeric international format
4088 4088
 					}
4089 4089
 				}
4090
-				$optstart .= ' data-description="' . dol_escape_htmltag($objp->description, 0, 1) . '"';
4090
+				$optstart .= ' data-description="'.dol_escape_htmltag($objp->description, 0, 1).'"';
4091 4091
 
4092 4092
 				// set $parameters to call hook
4093 4093
 				$outarrayentry = array(
@@ -4096,9 +4096,9 @@  discard block
 block discarded – undo
4096 4096
 					'label' => $outvallabel,
4097 4097
 					'labelhtml' => $optlabel,
4098 4098
 					'qty' => $outqty,
4099
-					'price_qty_ht' => price2num($objp->fprice, 'MU'),    // Keep higher resolution for price for the min qty
4100
-					'price_unit_ht' => price2num($objp->unitprice, 'MU'),    // This is used to fill the Unit Price
4101
-					'price_ht' => price2num($objp->unitprice, 'MU'),        // This is used to fill the Unit Price (for compatibility)
4099
+					'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty
4100
+					'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price
4101
+					'price_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility)
4102 4102
 					'tva_tx_formated' => price($objp->tva_tx, 0, $langs, 1, -1, 2),
4103 4103
 					'tva_tx' => price2num($objp->tva_tx),
4104 4104
 					'default_vat_code' => $objp->default_vat_code,
@@ -4128,18 +4128,18 @@  discard block
 block discarded – undo
4128 4128
 				// Add new entry
4129 4129
 				// "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
4130 4130
 				// "label" value of json key array is used by jQuery automatically as text for combo box
4131
-				$out .= $optstart . ' data-html="' . dol_escape_htmltag($optlabel) . '">' . $optlabel . "</option>\n";
4131
+				$out .= $optstart.' data-html="'.dol_escape_htmltag($optlabel).'">'.$optlabel."</option>\n";
4132 4132
 				$outarraypush = array(
4133 4133
 					'key' => $outkey,
4134 4134
 					'value' => $outref,
4135 4135
 					'label' => $outvallabel,
4136 4136
 					'labelhtml' => $optlabel,
4137 4137
 					'qty' => $outqty,
4138
-					'price_qty_ht' => price2num($objp->fprice, 'MU'),        // Keep higher resolution for price for the min qty
4138
+					'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty
4139 4139
 					'price_qty_ht_locale' => price($objp->fprice),
4140
-					'price_unit_ht' => price2num($objp->unitprice, 'MU'),    // This is used to fill the Unit Price
4140
+					'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price
4141 4141
 					'price_unit_ht_locale' => price($objp->unitprice),
4142
-					'price_ht' => price2num($objp->unitprice, 'MU'),        // This is used to fill the Unit Price (for compatibility)
4142
+					'price_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility)
4143 4143
 					'tva_tx_formated' => price($objp->tva_tx),
4144 4144
 					'tva_tx' => price2num($objp->tva_tx),
4145 4145
 					'default_vat_code' => $objp->default_vat_code,
@@ -4172,7 +4172,7 @@  discard block
 block discarded – undo
4172 4172
 
4173 4173
 			$this->db->free($result);
4174 4174
 
4175
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
4175
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
4176 4176
 			$out .= ajax_combobox($htmlname);
4177 4177
 		} else {
4178 4178
 			dol_print_error($this->db);
@@ -4204,43 +4204,43 @@  discard block
 block discarded – undo
4204 4204
 		$sql = "SELECT p.rowid, p.ref, p.label, p.price, p.duration, pfp.fk_soc,";
4205 4205
 		$sql .= " pfp.ref_fourn, pfp.rowid as idprodfournprice, pfp.price as fprice, pfp.remise_percent, pfp.quantity, pfp.unitprice,";
4206 4206
 		$sql .= " pfp.fk_supplier_price_expression, pfp.fk_product, pfp.tva_tx, s.nom as name";
4207
-		$sql .= " FROM " . $this->db->prefix() . "product as p";
4208
-		$sql .= " LEFT JOIN " . $this->db->prefix() . "product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
4209
-		$sql .= " LEFT JOIN " . $this->db->prefix() . "societe as s ON pfp.fk_soc = s.rowid";
4210
-		$sql .= " WHERE pfp.entity IN (" . getEntity('productsupplierprice') . ")";
4207
+		$sql .= " FROM ".$this->db->prefix()."product as p";
4208
+		$sql .= " LEFT JOIN ".$this->db->prefix()."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
4209
+		$sql .= " LEFT JOIN ".$this->db->prefix()."societe as s ON pfp.fk_soc = s.rowid";
4210
+		$sql .= " WHERE pfp.entity IN (".getEntity('productsupplierprice').")";
4211 4211
 		$sql .= " AND p.tobuy = 1";
4212 4212
 		$sql .= " AND s.fournisseur = 1";
4213
-		$sql .= " AND p.rowid = " . ((int) $productid);
4213
+		$sql .= " AND p.rowid = ".((int) $productid);
4214 4214
 		if (!getDolGlobalString('PRODUCT_BEST_SUPPLIER_PRICE_PRESELECTED')) {
4215 4215
 			$sql .= " ORDER BY s.nom, pfp.ref_fourn DESC";
4216 4216
 		} else {
4217 4217
 			$sql .= " ORDER BY pfp.unitprice ASC";
4218 4218
 		}
4219 4219
 
4220
-		dol_syslog(get_class($this) . "::select_product_fourn_price", LOG_DEBUG);
4220
+		dol_syslog(get_class($this)."::select_product_fourn_price", LOG_DEBUG);
4221 4221
 		$result = $this->db->query($sql);
4222 4222
 
4223 4223
 		if ($result) {
4224 4224
 			$num = $this->db->num_rows($result);
4225 4225
 
4226
-			$form = '<select class="flat" id="select_' . $htmlname . '" name="' . $htmlname . '">';
4226
+			$form = '<select class="flat" id="select_'.$htmlname.'" name="'.$htmlname.'">';
4227 4227
 
4228 4228
 			if (!$num) {
4229
-				$form .= '<option value="0">-- ' . $langs->trans("NoSupplierPriceDefinedForThisProduct") . ' --</option>';
4229
+				$form .= '<option value="0">-- '.$langs->trans("NoSupplierPriceDefinedForThisProduct").' --</option>';
4230 4230
 			} else {
4231
-				require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
4231
+				require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
4232 4232
 				$form .= '<option value="0">&nbsp;</option>';
4233 4233
 
4234 4234
 				$i = 0;
4235 4235
 				while ($i < $num) {
4236 4236
 					$objp = $this->db->fetch_object($result);
4237 4237
 
4238
-					$opt = '<option value="' . $objp->idprodfournprice . '"';
4238
+					$opt = '<option value="'.$objp->idprodfournprice.'"';
4239 4239
 					//if there is only one supplier, preselect it
4240 4240
 					if ($num == 1 || ($selected_supplier > 0 && $objp->fk_soc == $selected_supplier) || ($i == 0 && getDolGlobalString('PRODUCT_BEST_SUPPLIER_PRICE_PRESELECTED'))) {
4241 4241
 						$opt .= ' selected';
4242 4242
 					}
4243
-					$opt .= '>' . $objp->name . ' - ' . $objp->ref_fourn . ' - ';
4243
+					$opt .= '>'.$objp->name.' - '.$objp->ref_fourn.' - ';
4244 4244
 
4245 4245
 					if (isModEnabled('dynamicprices') && !empty($objp->fk_supplier_price_expression)) {
4246 4246
 						$prod_supplier = new ProductFournisseur($this->db);
@@ -4250,7 +4250,7 @@  discard block
 block discarded – undo
4250 4250
 						$prod_supplier->fourn_tva_tx = $objp->tva_tx;
4251 4251
 						$prod_supplier->fk_supplier_price_expression = $objp->fk_supplier_price_expression;
4252 4252
 
4253
-						require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
4253
+						require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
4254 4254
 						$priceparser = new PriceParser($this->db);
4255 4255
 						$price_result = $priceparser->parseProductSupplier($prod_supplier);
4256 4256
 						if ($price_result >= 0) {
@@ -4261,10 +4261,10 @@  discard block
 block discarded – undo
4261 4261
 						}
4262 4262
 					}
4263 4263
 					if ($objp->quantity == 1) {
4264
-						$opt .= price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/";
4264
+						$opt .= price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/";
4265 4265
 					}
4266 4266
 
4267
-					$opt .= $objp->quantity . ' ';
4267
+					$opt .= $objp->quantity.' ';
4268 4268
 
4269 4269
 					if ($objp->quantity == 1) {
4270 4270
 						$opt .= $langs->trans("Unit");
@@ -4273,10 +4273,10 @@  discard block
 block discarded – undo
4273 4273
 					}
4274 4274
 					if ($objp->quantity > 1) {
4275 4275
 						$opt .= " - ";
4276
-						$opt .= price($objp->unitprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->trans("Unit");
4276
+						$opt .= price($objp->unitprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/".$langs->trans("Unit");
4277 4277
 					}
4278 4278
 					if ($objp->duration) {
4279
-						$opt .= " - " . $objp->duration;
4279
+						$opt .= " - ".$objp->duration;
4280 4280
 					}
4281 4281
 					$opt .= "</option>\n";
4282 4282
 
@@ -4314,8 +4314,8 @@  discard block
 block discarded – undo
4314 4314
 		dol_syslog(__METHOD__, LOG_DEBUG);
4315 4315
 
4316 4316
 		$sql = "SELECT rowid, code, libelle as label, deposit_percent";
4317
-		$sql .= " FROM " . $this->db->prefix() . 'c_payment_term';
4318
-		$sql .= " WHERE entity IN (" . getEntity('c_payment_term') . ")";
4317
+		$sql .= " FROM ".$this->db->prefix().'c_payment_term';
4318
+		$sql .= " WHERE entity IN (".getEntity('c_payment_term').")";
4319 4319
 		$sql .= " AND active > 0";
4320 4320
 		$sql .= " ORDER BY sortorder";
4321 4321
 
@@ -4327,7 +4327,7 @@  discard block
 block discarded – undo
4327 4327
 				$obj = $this->db->fetch_object($resql);
4328 4328
 
4329 4329
 				// Si traduction existe, on l'utilise, sinon on prend le libelle par default
4330
-				$label = ($langs->trans("PaymentConditionShort" . $obj->code) != "PaymentConditionShort" . $obj->code ? $langs->trans("PaymentConditionShort" . $obj->code) : ($obj->label != '-' ? $obj->label : ''));
4330
+				$label = ($langs->trans("PaymentConditionShort".$obj->code) != "PaymentConditionShort".$obj->code ? $langs->trans("PaymentConditionShort".$obj->code) : ($obj->label != '-' ? $obj->label : ''));
4331 4331
 				$this->cache_conditions_paiements[$obj->rowid]['code'] = $obj->code;
4332 4332
 				$this->cache_conditions_paiements[$obj->rowid]['label'] = $label;
4333 4333
 				$this->cache_conditions_paiements[$obj->rowid]['deposit_percent'] = $obj->deposit_percent;
@@ -4355,7 +4355,7 @@  discard block
 block discarded – undo
4355 4355
 		// phpcs:enable
4356 4356
 		global $langs;
4357 4357
 
4358
-		$num = count($this->cache_availability);    // TODO Use $conf->cache['availability'] instead of $this->cache_availability
4358
+		$num = count($this->cache_availability); // TODO Use $conf->cache['availability'] instead of $this->cache_availability
4359 4359
 		if ($num > 0) {
4360 4360
 			return 0; // Cache already loaded
4361 4361
 		}
@@ -4365,7 +4365,7 @@  discard block
 block discarded – undo
4365 4365
 		$langs->load('propal');
4366 4366
 
4367 4367
 		$sql = "SELECT rowid, code, label, position";
4368
-		$sql .= " FROM " . $this->db->prefix() . 'c_availability';
4368
+		$sql .= " FROM ".$this->db->prefix().'c_availability';
4369 4369
 		$sql .= " WHERE active > 0";
4370 4370
 
4371 4371
 		$resql = $this->db->query($sql);
@@ -4376,7 +4376,7 @@  discard block
 block discarded – undo
4376 4376
 				$obj = $this->db->fetch_object($resql);
4377 4377
 
4378 4378
 				// Si traduction existe, on l'utilise, sinon on prend le libelle par default
4379
-				$label = ($langs->trans("AvailabilityType" . $obj->code) != "AvailabilityType" . $obj->code ? $langs->trans("AvailabilityType" . $obj->code) : ($obj->label != '-' ? $obj->label : ''));
4379
+				$label = ($langs->trans("AvailabilityType".$obj->code) != "AvailabilityType".$obj->code ? $langs->trans("AvailabilityType".$obj->code) : ($obj->label != '-' ? $obj->label : ''));
4380 4380
 				$this->cache_availability[$obj->rowid]['code'] = $obj->code;
4381 4381
 				$this->cache_availability[$obj->rowid]['label'] = $label;
4382 4382
 				$this->cache_availability[$obj->rowid]['position'] = $obj->position;
@@ -4408,17 +4408,17 @@  discard block
 block discarded – undo
4408 4408
 
4409 4409
 		$this->load_cache_availability();
4410 4410
 
4411
-		dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG);
4411
+		dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG);
4412 4412
 
4413
-		print '<select id="' . $htmlname . '" class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">';
4413
+		print '<select id="'.$htmlname.'" class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
4414 4414
 		if ($addempty) {
4415 4415
 			print '<option value="0">&nbsp;</option>';
4416 4416
 		}
4417 4417
 		foreach ($this->cache_availability as $id => $arrayavailability) {
4418 4418
 			if ($selected == $id) {
4419
-				print '<option value="' . $id . '" selected>';
4419
+				print '<option value="'.$id.'" selected>';
4420 4420
 			} else {
4421
-				print '<option value="' . $id . '">';
4421
+				print '<option value="'.$id.'">';
4422 4422
 			}
4423 4423
 			print dol_escape_htmltag($arrayavailability['label']);
4424 4424
 			print '</option>';
@@ -4439,13 +4439,13 @@  discard block
 block discarded – undo
4439 4439
 	{
4440 4440
 		global $langs;
4441 4441
 
4442
-		$num = count($this->cache_demand_reason);    // TODO Use $conf->cache['input_reason'] instead of $this->cache_demand_reason
4442
+		$num = count($this->cache_demand_reason); // TODO Use $conf->cache['input_reason'] instead of $this->cache_demand_reason
4443 4443
 		if ($num > 0) {
4444 4444
 			return 0; // Cache already loaded
4445 4445
 		}
4446 4446
 
4447 4447
 		$sql = "SELECT rowid, code, label";
4448
-		$sql .= " FROM " . $this->db->prefix() . 'c_input_reason';
4448
+		$sql .= " FROM ".$this->db->prefix().'c_input_reason';
4449 4449
 		$sql .= " WHERE active > 0";
4450 4450
 
4451 4451
 		$resql = $this->db->query($sql);
@@ -4458,8 +4458,8 @@  discard block
 block discarded – undo
4458 4458
 
4459 4459
 				// Si traduction existe, on l'utilise, sinon on prend le libelle par default
4460 4460
 				$label = ($obj->label != '-' ? $obj->label : '');
4461
-				if ($langs->trans("DemandReasonType" . $obj->code) != "DemandReasonType" . $obj->code) {
4462
-					$label = $langs->trans("DemandReasonType" . $obj->code); // So translation key DemandReasonTypeSRC_XXX will work
4461
+				if ($langs->trans("DemandReasonType".$obj->code) != "DemandReasonType".$obj->code) {
4462
+					$label = $langs->trans("DemandReasonType".$obj->code); // So translation key DemandReasonTypeSRC_XXX will work
4463 4463
 				}
4464 4464
 				if ($langs->trans($obj->code) != $obj->code) {
4465 4465
 					$label = $langs->trans($obj->code); // So translation key SRC_XXX will work
@@ -4499,9 +4499,9 @@  discard block
 block discarded – undo
4499 4499
 
4500 4500
 		$this->loadCacheInputReason();
4501 4501
 
4502
-		print '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="select_' . $htmlname . '" name="' . $htmlname . '">';
4502
+		print '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="select_'.$htmlname.'" name="'.$htmlname.'">';
4503 4503
 		if ($addempty) {
4504
-			print '<option value="0"' . (empty($selected) ? ' selected' : '') . '>&nbsp;</option>';
4504
+			print '<option value="0"'.(empty($selected) ? ' selected' : '').'>&nbsp;</option>';
4505 4505
 		}
4506 4506
 		foreach ($this->cache_demand_reason as $id => $arraydemandreason) {
4507 4507
 			if ($arraydemandreason['code'] == $exclude) {
@@ -4509,9 +4509,9 @@  discard block
 block discarded – undo
4509 4509
 			}
4510 4510
 
4511 4511
 			if ($selected && ($selected == $arraydemandreason['id'] || $selected == $arraydemandreason['code'])) {
4512
-				print '<option value="' . $arraydemandreason['id'] . '" selected>';
4512
+				print '<option value="'.$arraydemandreason['id'].'" selected>';
4513 4513
 			} else {
4514
-				print '<option value="' . $arraydemandreason['id'] . '">';
4514
+				print '<option value="'.$arraydemandreason['id'].'">';
4515 4515
 			}
4516 4516
 			$label = $arraydemandreason['label']; // Translation of label was already done into the ->loadCacheInputReason
4517 4517
 			print $langs->trans($label);
@@ -4521,7 +4521,7 @@  discard block
 block discarded – undo
4521 4521
 		if ($user->admin && empty($notooltip)) {
4522 4522
 			print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
4523 4523
 		}
4524
-		print ajax_combobox('select_' . $htmlname);
4524
+		print ajax_combobox('select_'.$htmlname);
4525 4525
 	}
4526 4526
 
4527 4527
 	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
@@ -4536,7 +4536,7 @@  discard block
 block discarded – undo
4536 4536
 		// phpcs:enable
4537 4537
 		global $langs;
4538 4538
 
4539
-		$num = count($this->cache_types_paiements);        // TODO Use $conf->cache['payment_mode'] instead of $this->cache_types_paiements
4539
+		$num = count($this->cache_types_paiements); // TODO Use $conf->cache['payment_mode'] instead of $this->cache_types_paiements
4540 4540
 		if ($num > 0) {
4541 4541
 			return $num; // Cache already loaded
4542 4542
 		}
@@ -4546,8 +4546,8 @@  discard block
 block discarded – undo
4546 4546
 		$this->cache_types_paiements = array();
4547 4547
 
4548 4548
 		$sql = "SELECT id, code, libelle as label, type, active";
4549
-		$sql .= " FROM " . $this->db->prefix() . "c_paiement";
4550
-		$sql .= " WHERE entity IN (" . getEntity('c_paiement') . ")";
4549
+		$sql .= " FROM ".$this->db->prefix()."c_paiement";
4550
+		$sql .= " WHERE entity IN (".getEntity('c_paiement').")";
4551 4551
 
4552 4552
 		$resql = $this->db->query($sql);
4553 4553
 		if ($resql) {
@@ -4557,7 +4557,7 @@  discard block
 block discarded – undo
4557 4557
 				$obj = $this->db->fetch_object($resql);
4558 4558
 
4559 4559
 				// Si traduction existe, on l'utilise, sinon on prend le libelle par default
4560
-				$label = ($langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) != "PaymentTypeShort" . $obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) : ($obj->label != '-' ? $obj->label : ''));
4560
+				$label = ($langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) != "PaymentTypeShort".$obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) : ($obj->label != '-' ? $obj->label : ''));
4561 4561
 				$this->cache_types_paiements[$obj->id]['id'] = $obj->id;
4562 4562
 				$this->cache_types_paiements[$obj->id]['code'] = $obj->code;
4563 4563
 				$this->cache_types_paiements[$obj->id]['label'] = $label;
@@ -4629,17 +4629,17 @@  discard block
 block discarded – undo
4629 4629
 		global $langs, $user, $conf;
4630 4630
 
4631 4631
 		$out = '';
4632
-		dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG);
4632
+		dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG);
4633 4633
 
4634 4634
 		$this->load_cache_conditions_paiements();
4635 4635
 
4636 4636
 		// Set default value if not already set by caller
4637 4637
 		if (empty($selected) && getDolGlobalString('MAIN_DEFAULT_PAYMENT_TERM_ID')) {
4638
-			dol_syslog(__METHOD__ . "Using deprecated option MAIN_DEFAULT_PAYMENT_TERM_ID", LOG_NOTICE);
4638
+			dol_syslog(__METHOD__."Using deprecated option MAIN_DEFAULT_PAYMENT_TERM_ID", LOG_NOTICE);
4639 4639
 			$selected = getDolGlobalString('MAIN_DEFAULT_PAYMENT_TERM_ID');
4640 4640
 		}
4641 4641
 
4642
-		$out .= '<select id="' . $htmlname . '" class="flat selectpaymentterms' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">';
4642
+		$out .= '<select id="'.$htmlname.'" class="flat selectpaymentterms'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
4643 4643
 		if ($addempty) {
4644 4644
 			$out .= '<option value="0">&nbsp;</option>';
4645 4645
 		}
@@ -4653,9 +4653,9 @@  discard block
 block discarded – undo
4653 4653
 
4654 4654
 			if ($selected == $id) {
4655 4655
 				$selectedDepositPercent = $deposit_percent > 0 ? $deposit_percent : $arrayconditions['deposit_percent'];
4656
-				$out .= '<option value="' . $id . '" data-deposit_percent="' . $arrayconditions['deposit_percent'] . '" selected>';
4656
+				$out .= '<option value="'.$id.'" data-deposit_percent="'.$arrayconditions['deposit_percent'].'" selected>';
4657 4657
 			} else {
4658
-				$out .= '<option value="' . $id . '" data-deposit_percent="' . $arrayconditions['deposit_percent'] . '">';
4658
+				$out .= '<option value="'.$id.'" data-deposit_percent="'.$arrayconditions['deposit_percent'].'">';
4659 4659
 			}
4660 4660
 			$label = $arrayconditions['label'];
4661 4661
 
@@ -4673,21 +4673,21 @@  discard block
 block discarded – undo
4673 4673
 		$out .= ajax_combobox($htmlname);
4674 4674
 
4675 4675
 		if ($deposit_percent >= 0) {
4676
-			$out .= ' <span id="' . $htmlname . '_deposit_percent_container"' . (empty($selectedDepositPercent) ? ' style="display: none"' : '') . '>';
4677
-			$out .= $langs->trans('DepositPercent') . ' : ';
4678
-			$out .= '<input id="' . $htmlname . '_deposit_percent" name="' . $htmlname . '_deposit_percent" class="maxwidth50" value="' . $deposit_percent . '" />';
4676
+			$out .= ' <span id="'.$htmlname.'_deposit_percent_container"'.(empty($selectedDepositPercent) ? ' style="display: none"' : '').'>';
4677
+			$out .= $langs->trans('DepositPercent').' : ';
4678
+			$out .= '<input id="'.$htmlname.'_deposit_percent" name="'.$htmlname.'_deposit_percent" class="maxwidth50" value="'.$deposit_percent.'" />';
4679 4679
 			$out .= '</span>';
4680 4680
 			$out .= '
4681
-				<script nonce="' . getNonce() . '">
4681
+				<script nonce="' . getNonce().'">
4682 4682
 					$(document).ready(function () {
4683
-						$("#' . $htmlname . '").change(function () {
4683
+						$("#' . $htmlname.'").change(function () {
4684 4684
 							let $selected = $(this).find("option:selected");
4685 4685
 							let depositPercent = $selected.attr("data-deposit_percent");
4686 4686
 
4687 4687
 							if (depositPercent.length > 0) {
4688
-								$("#' . $htmlname . '_deposit_percent_container").show().find("#' . $htmlname . '_deposit_percent").val(depositPercent);
4688
+								$("#' . $htmlname.'_deposit_percent_container").show().find("#'.$htmlname.'_deposit_percent").val(depositPercent);
4689 4689
 							} else {
4690
-								$("#' . $htmlname . '_deposit_percent_container").hide();
4690
+								$("#' . $htmlname.'_deposit_percent_container").hide();
4691 4691
 							}
4692 4692
 
4693 4693
 							return true;
@@ -4725,7 +4725,7 @@  discard block
 block discarded – undo
4725 4725
 
4726 4726
 		$out = '';
4727 4727
 
4728
-		dol_syslog(__METHOD__ . " " . $selected . ", " . $htmlname . ", " . $filtertype . ", " . $format, LOG_DEBUG);
4728
+		dol_syslog(__METHOD__." ".$selected.", ".$htmlname.", ".$filtertype.", ".$format, LOG_DEBUG);
4729 4729
 
4730 4730
 		$filterarray = array();
4731 4731
 		if ($filtertype == 'CRDT') {
@@ -4740,11 +4740,11 @@  discard block
 block discarded – undo
4740 4740
 
4741 4741
 		// Set default value if not already set by caller
4742 4742
 		if (empty($selected) && getDolGlobalString('MAIN_DEFAULT_PAYMENT_TYPE_ID')) {
4743
-			dol_syslog(__METHOD__ . "Using deprecated option MAIN_DEFAULT_PAYMENT_TYPE_ID", LOG_NOTICE);
4743
+			dol_syslog(__METHOD__."Using deprecated option MAIN_DEFAULT_PAYMENT_TYPE_ID", LOG_NOTICE);
4744 4744
 			$selected = getDolGlobalString('MAIN_DEFAULT_PAYMENT_TYPE_ID');
4745 4745
 		}
4746 4746
 
4747
-		$out .= '<select id="select' . $htmlname . '" class="flat selectpaymenttypes' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">';
4747
+		$out .= '<select id="select'.$htmlname.'" class="flat selectpaymenttypes'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
4748 4748
 		if ($empty) {
4749 4749
 			$out .= '<option value="">&nbsp;</option>';
4750 4750
 		}
@@ -4765,13 +4765,13 @@  discard block
 block discarded – undo
4765 4765
 			}
4766 4766
 
4767 4767
 			if ($format == 0) {
4768
-				$out .= '<option value="' . $id . '" data-code="'.$arraytypes['code'].'"';
4768
+				$out .= '<option value="'.$id.'" data-code="'.$arraytypes['code'].'"';
4769 4769
 			} elseif ($format == 1) {
4770
-				$out .= '<option value="' . $arraytypes['code'] . '"';
4770
+				$out .= '<option value="'.$arraytypes['code'].'"';
4771 4771
 			} elseif ($format == 2) {
4772
-				$out .= '<option value="' . $arraytypes['code'] . '"';
4772
+				$out .= '<option value="'.$arraytypes['code'].'"';
4773 4773
 			} elseif ($format == 3) {
4774
-				$out .= '<option value="' . $id . '"';
4774
+				$out .= '<option value="'.$id.'"';
4775 4775
 			}
4776 4776
 			// Print attribute selected or not
4777 4777
 			if ($format == 1 || $format == 2) {
@@ -4801,7 +4801,7 @@  discard block
 block discarded – undo
4801 4801
 		if ($user->admin && !$noadmininfo) {
4802 4802
 			$out .= info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
4803 4803
 		}
4804
-		$out .= ajax_combobox('select' . $htmlname);
4804
+		$out .= ajax_combobox('select'.$htmlname);
4805 4805
 
4806 4806
 		if (empty($nooutput)) {
4807 4807
 			print $out;
@@ -4823,22 +4823,22 @@  discard block
 block discarded – undo
4823 4823
 	{
4824 4824
 		global $langs;
4825 4825
 
4826
-		$return = '<select class="flat maxwidth100" id="select_' . $htmlname . '" name="' . $htmlname . '">';
4826
+		$return = '<select class="flat maxwidth100" id="select_'.$htmlname.'" name="'.$htmlname.'">';
4827 4827
 		$options = array(
4828 4828
 			'HT' => $langs->trans("HT"),
4829 4829
 			'TTC' => $langs->trans("TTC")
4830 4830
 		);
4831 4831
 		foreach ($options as $id => $value) {
4832 4832
 			if ($selected == $id) {
4833
-				$return .= '<option value="' . $id . '" selected>' . $value;
4833
+				$return .= '<option value="'.$id.'" selected>'.$value;
4834 4834
 			} else {
4835
-				$return .= '<option value="' . $id . '">' . $value;
4835
+				$return .= '<option value="'.$id.'">'.$value;
4836 4836
 			}
4837 4837
 			$return .= '</option>';
4838 4838
 		}
4839 4839
 		$return .= '</select>';
4840 4840
 		if ($addjscombo) {
4841
-			$return .= ajax_combobox('select_' . $htmlname);
4841
+			$return .= ajax_combobox('select_'.$htmlname);
4842 4842
 		}
4843 4843
 
4844 4844
 		return $return;
@@ -4856,7 +4856,7 @@  discard block
 block discarded – undo
4856 4856
 		// phpcs:enable
4857 4857
 		global $langs;
4858 4858
 
4859
-		$num = count($this->cache_transport_mode);        // TODO Use $conf->cache['payment_mode'] instead of $this->cache_transport_mode
4859
+		$num = count($this->cache_transport_mode); // TODO Use $conf->cache['payment_mode'] instead of $this->cache_transport_mode
4860 4860
 		if ($num > 0) {
4861 4861
 			return $num; // Cache already loaded
4862 4862
 		}
@@ -4866,8 +4866,8 @@  discard block
 block discarded – undo
4866 4866
 		$this->cache_transport_mode = array();
4867 4867
 
4868 4868
 		$sql = "SELECT rowid, code, label, active";
4869
-		$sql .= " FROM " . $this->db->prefix() . "c_transport_mode";
4870
-		$sql .= " WHERE entity IN (" . getEntity('c_transport_mode') . ")";
4869
+		$sql .= " FROM ".$this->db->prefix()."c_transport_mode";
4870
+		$sql .= " WHERE entity IN (".getEntity('c_transport_mode').")";
4871 4871
 
4872 4872
 		$resql = $this->db->query($sql);
4873 4873
 		if ($resql) {
@@ -4877,7 +4877,7 @@  discard block
 block discarded – undo
4877 4877
 				$obj = $this->db->fetch_object($resql);
4878 4878
 
4879 4879
 				// If traduction exist, we use it else we take the default label
4880
-				$label = ($langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) != "PaymentTypeShort" . $obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) : ($obj->label != '-' ? $obj->label : ''));
4880
+				$label = ($langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) != "PaymentTypeShort".$obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) : ($obj->label != '-' ? $obj->label : ''));
4881 4881
 				$this->cache_transport_mode[$obj->rowid]['rowid'] = $obj->rowid;
4882 4882
 				$this->cache_transport_mode[$obj->rowid]['code'] = $obj->code;
4883 4883
 				$this->cache_transport_mode[$obj->rowid]['label'] = $label;
@@ -4911,11 +4911,11 @@  discard block
 block discarded – undo
4911 4911
 	{
4912 4912
 		global $langs, $user;
4913 4913
 
4914
-		dol_syslog(__METHOD__ . " " . $selected . ", " . $htmlname . ", " . $format, LOG_DEBUG);
4914
+		dol_syslog(__METHOD__." ".$selected.", ".$htmlname.", ".$format, LOG_DEBUG);
4915 4915
 
4916 4916
 		$this->load_cache_transport_mode();
4917 4917
 
4918
-		print '<select id="select' . $htmlname . '" class="flat selectmodetransport' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">';
4918
+		print '<select id="select'.$htmlname.'" class="flat selectmodetransport'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
4919 4919
 		if ($empty) {
4920 4920
 			print '<option value="">&nbsp;</option>';
4921 4921
 		}
@@ -4931,13 +4931,13 @@  discard block
 block discarded – undo
4931 4931
 			}
4932 4932
 
4933 4933
 			if ($format == 0) {
4934
-				print '<option value="' . $id . '"';
4934
+				print '<option value="'.$id.'"';
4935 4935
 			} elseif ($format == 1) {
4936
-				print '<option value="' . $arraytypes['code'] . '"';
4936
+				print '<option value="'.$arraytypes['code'].'"';
4937 4937
 			} elseif ($format == 2) {
4938
-				print '<option value="' . $arraytypes['code'] . '"';
4938
+				print '<option value="'.$arraytypes['code'].'"';
4939 4939
 			} elseif ($format == 3) {
4940
-				print '<option value="' . $id . '"';
4940
+				print '<option value="'.$id.'"';
4941 4941
 			}
4942 4942
 			// If text is selected, we compare with code, else with id
4943 4943
 			if (preg_match('/[a-z]/i', $selected) && $selected == $arraytypes['code']) {
@@ -4988,31 +4988,31 @@  discard block
 block discarded – undo
4988 4988
 		$langs->load("deliveries");
4989 4989
 
4990 4990
 		$sql = "SELECT rowid, code, libelle as label";
4991
-		$sql .= " FROM " . $this->db->prefix() . "c_shipment_mode";
4991
+		$sql .= " FROM ".$this->db->prefix()."c_shipment_mode";
4992 4992
 		$sql .= " WHERE active > 0";
4993 4993
 		if ($filtre) {
4994
-			$sql .= " AND " . $filtre;
4994
+			$sql .= " AND ".$filtre;
4995 4995
 		}
4996 4996
 		$sql .= " ORDER BY libelle ASC";
4997 4997
 
4998
-		dol_syslog(get_class($this) . "::selectShippingMode", LOG_DEBUG);
4998
+		dol_syslog(get_class($this)."::selectShippingMode", LOG_DEBUG);
4999 4999
 		$result = $this->db->query($sql);
5000 5000
 		if ($result) {
5001 5001
 			$num = $this->db->num_rows($result);
5002 5002
 			$i = 0;
5003 5003
 			if ($num) {
5004
-				print '<select id="select' . $htmlname . '" class="flat selectshippingmethod' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>';
5004
+				print '<select id="select'.$htmlname.'" class="flat selectshippingmethod'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>';
5005 5005
 				if ($useempty == 1 || ($useempty == 2 && $num > 1)) {
5006 5006
 					print '<option value="-1">&nbsp;</option>';
5007 5007
 				}
5008 5008
 				while ($i < $num) {
5009 5009
 					$obj = $this->db->fetch_object($result);
5010 5010
 					if ($selected == $obj->rowid) {
5011
-						print '<option value="' . $obj->rowid . '" selected>';
5011
+						print '<option value="'.$obj->rowid.'" selected>';
5012 5012
 					} else {
5013
-						print '<option value="' . $obj->rowid . '">';
5013
+						print '<option value="'.$obj->rowid.'">';
5014 5014
 					}
5015
-					print ($langs->trans("SendingMethod" . strtoupper($obj->code)) != "SendingMethod" . strtoupper($obj->code)) ? $langs->trans("SendingMethod" . strtoupper($obj->code)) : $obj->label;
5015
+					print ($langs->trans("SendingMethod".strtoupper($obj->code)) != "SendingMethod".strtoupper($obj->code)) ? $langs->trans("SendingMethod".strtoupper($obj->code)) : $obj->label;
5016 5016
 					print '</option>';
5017 5017
 					$i++;
5018 5018
 				}
@@ -5021,7 +5021,7 @@  discard block
 block discarded – undo
5021 5021
 					print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
5022 5022
 				}
5023 5023
 
5024
-				print ajax_combobox('select' . $htmlname);
5024
+				print ajax_combobox('select'.$htmlname);
5025 5025
 			} else {
5026 5026
 				print $langs->trans("NoShippingMethodDefined");
5027 5027
 			}
@@ -5046,16 +5046,16 @@  discard block
 block discarded – undo
5046 5046
 		$langs->load("deliveries");
5047 5047
 
5048 5048
 		if ($htmlname != "none") {
5049
-			print '<form method="POST" action="' . $page . '">';
5049
+			print '<form method="POST" action="'.$page.'">';
5050 5050
 			print '<input type="hidden" name="action" value="setshippingmethod">';
5051
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
5051
+			print '<input type="hidden" name="token" value="'.newToken().'">';
5052 5052
 			$this->selectShippingMethod($selected, $htmlname, '', $addempty);
5053
-			print '<input type="submit" class="button valignmiddle" value="' . $langs->trans("Modify") . '">';
5053
+			print '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
5054 5054
 			print '</form>';
5055 5055
 		} else {
5056 5056
 			if ($selected) {
5057 5057
 				$code = $langs->getLabelFromKey($this->db, $selected, 'c_shipment_mode', 'rowid', 'code');
5058
-				print $langs->trans("SendingMethod" . strtoupper($code));
5058
+				print $langs->trans("SendingMethod".strtoupper($code));
5059 5059
 			} else {
5060 5060
 				print "&nbsp;";
5061 5061
 			}
@@ -5078,10 +5078,10 @@  discard block
 block discarded – undo
5078 5078
 
5079 5079
 		$opt = '<option value="" selected></option>';
5080 5080
 		$sql = "SELECT rowid, ref, situation_cycle_ref, situation_counter, situation_final, fk_soc";
5081
-		$sql .= ' FROM ' . $this->db->prefix() . 'facture';
5082
-		$sql .= ' WHERE entity IN (' . getEntity('invoice') . ')';
5081
+		$sql .= ' FROM '.$this->db->prefix().'facture';
5082
+		$sql .= ' WHERE entity IN ('.getEntity('invoice').')';
5083 5083
 		$sql .= ' AND situation_counter >= 1';
5084
-		$sql .= ' AND fk_soc = ' . (int) $socid;
5084
+		$sql .= ' AND fk_soc = '.(int) $socid;
5085 5085
 		$sql .= ' AND type <> 2';
5086 5086
 		$sql .= ' ORDER by situation_cycle_ref, situation_counter desc';
5087 5087
 		$resql = $this->db->query($sql);
@@ -5099,19 +5099,19 @@  discard block
 block discarded – undo
5099 5099
 						//Not prov?
5100 5100
 						if (substr($obj->ref, 1, 4) != 'PROV') {
5101 5101
 							if ($selected == $obj->rowid) {
5102
-								$opt .= '<option value="' . $obj->rowid . '" selected>' . $obj->ref . '</option>';
5102
+								$opt .= '<option value="'.$obj->rowid.'" selected>'.$obj->ref.'</option>';
5103 5103
 							} else {
5104
-								$opt .= '<option value="' . $obj->rowid . '">' . $obj->ref . '</option>';
5104
+								$opt .= '<option value="'.$obj->rowid.'">'.$obj->ref.'</option>';
5105 5105
 							}
5106 5106
 						}
5107 5107
 					}
5108 5108
 				}
5109 5109
 			}
5110 5110
 		} else {
5111
-			dol_syslog("Error sql=" . $sql . ", error=" . $this->error, LOG_ERR);
5111
+			dol_syslog("Error sql=".$sql.", error=".$this->error, LOG_ERR);
5112 5112
 		}
5113 5113
 		if ($opt == '<option value ="" selected></option>') {
5114
-			$opt = '<option value ="0" selected>' . $langs->trans('NoSituations') . '</option>';
5114
+			$opt = '<option value ="0" selected>'.$langs->trans('NoSituations').'</option>';
5115 5115
 		}
5116 5116
 		return $opt;
5117 5117
 	}
@@ -5131,12 +5131,12 @@  discard block
 block discarded – undo
5131 5131
 
5132 5132
 		$langs->load('products');
5133 5133
 
5134
-		$return = '<select class="flat" id="' . $htmlname . '" name="' . $htmlname . '">';
5134
+		$return = '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'">';
5135 5135
 
5136
-		$sql = "SELECT rowid, label, code FROM " . $this->db->prefix() . "c_units";
5136
+		$sql = "SELECT rowid, label, code FROM ".$this->db->prefix()."c_units";
5137 5137
 		$sql .= ' WHERE active > 0';
5138 5138
 		if (!empty($unit_type)) {
5139
-			$sql .= " AND unit_type = '" . $this->db->escape($unit_type) . "'";
5139
+			$sql .= " AND unit_type = '".$this->db->escape($unit_type)."'";
5140 5140
 		}
5141 5141
 		$sql .= " ORDER BY sortorder";
5142 5142
 
@@ -5148,14 +5148,14 @@  discard block
 block discarded – undo
5148 5148
 
5149 5149
 			while ($res = $this->db->fetch_object($resql)) {
5150 5150
 				$unitLabel = $res->label;
5151
-				if (!empty($langs->tab_translate['unit' . $res->code])) {    // check if Translation is available before
5152
-					$unitLabel = $langs->trans('unit' . $res->code) != $res->label ? $langs->trans('unit' . $res->code) : $res->label;
5151
+				if (!empty($langs->tab_translate['unit'.$res->code])) {    // check if Translation is available before
5152
+					$unitLabel = $langs->trans('unit'.$res->code) != $res->label ? $langs->trans('unit'.$res->code) : $res->label;
5153 5153
 				}
5154 5154
 
5155 5155
 				if ($selected == $res->rowid) {
5156
-					$return .= '<option value="' . $res->rowid . '" selected>' . $unitLabel . '</option>';
5156
+					$return .= '<option value="'.$res->rowid.'" selected>'.$unitLabel.'</option>';
5157 5157
 				} else {
5158
-					$return .= '<option value="' . $res->rowid . '">' . $unitLabel . '</option>';
5158
+					$return .= '<option value="'.$res->rowid.'">'.$unitLabel.'</option>';
5159 5159
 				}
5160 5160
 			}
5161 5161
 			$return .= '</select>';
@@ -5192,29 +5192,29 @@  discard block
 block discarded – undo
5192 5192
 		$num = 0;
5193 5193
 
5194 5194
 		$sql = "SELECT rowid, label, bank, clos as status, currency_code";
5195
-		$sql .= " FROM " . $this->db->prefix() . "bank_account";
5196
-		$sql .= " WHERE entity IN (" . getEntity('bank_account') . ")";
5195
+		$sql .= " FROM ".$this->db->prefix()."bank_account";
5196
+		$sql .= " WHERE entity IN (".getEntity('bank_account').")";
5197 5197
 		if ($status != 2) {
5198
-			$sql .= " AND clos = " . (int) $status;
5198
+			$sql .= " AND clos = ".(int) $status;
5199 5199
 		}
5200 5200
 		if ($filtre) {	// TODO Support USF
5201
-			$sql .= " AND " . $filtre;
5201
+			$sql .= " AND ".$filtre;
5202 5202
 		}
5203 5203
 		$sql .= " ORDER BY label";
5204 5204
 
5205
-		dol_syslog(get_class($this) . "::select_comptes", LOG_DEBUG);
5205
+		dol_syslog(get_class($this)."::select_comptes", LOG_DEBUG);
5206 5206
 		$result = $this->db->query($sql);
5207 5207
 		if ($result) {
5208 5208
 			$num = $this->db->num_rows($result);
5209 5209
 			$i = 0;
5210 5210
 
5211
-			$out .= '<select id="select' . $htmlname . '" class="flat selectbankaccount' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>';
5211
+			$out .= '<select id="select'.$htmlname.'" class="flat selectbankaccount'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>';
5212 5212
 
5213 5213
 			if ($num == 0) {
5214 5214
 				if ($status == 0) {
5215
-					$out .= '<option class="opacitymedium" value="-1">' . $langs->trans("NoActiveBankAccountDefined") . '</span>';
5215
+					$out .= '<option class="opacitymedium" value="-1">'.$langs->trans("NoActiveBankAccountDefined").'</span>';
5216 5216
 				} else {
5217
-					$out .= '<option class="opacitymedium" value="-1">' . $langs->trans("NoBankAccountDefined") . '</span>';
5217
+					$out .= '<option class="opacitymedium" value="-1">'.$langs->trans("NoBankAccountDefined").'</span>';
5218 5218
 				}
5219 5219
 			} else {
5220 5220
 				if (!empty($useempty) && !is_numeric($useempty)) {
@@ -5230,25 +5230,25 @@  discard block
 block discarded – undo
5230 5230
 				$labeltoshow = trim($obj->label);
5231 5231
 				$labeltoshowhtml = trim($obj->label);
5232 5232
 				if ($showcurrency) {
5233
-					$labeltoshow .= ' (' . $obj->currency_code . ')';
5234
-					$labeltoshowhtml .= ' <span class="opacitymedium">(' . $obj->currency_code . ')</span>';
5233
+					$labeltoshow .= ' ('.$obj->currency_code.')';
5234
+					$labeltoshowhtml .= ' <span class="opacitymedium">('.$obj->currency_code.')</span>';
5235 5235
 				}
5236 5236
 				if ($status == 2 && $obj->status == 1) {
5237
-					$labeltoshow .= ' (' . $langs->trans("Closed") . ')';
5238
-					$labeltoshowhtml .= ' <span class="opacitymedium">(' . $langs->trans("Closed") . ')</span>';
5237
+					$labeltoshow .= ' ('.$langs->trans("Closed").')';
5238
+					$labeltoshowhtml .= ' <span class="opacitymedium">('.$langs->trans("Closed").')</span>';
5239 5239
 				}
5240 5240
 
5241 5241
 				if ($selected == $obj->rowid || ($useempty == 2 && $num == 1 && empty($selected))) {
5242
-					$out .= '<option value="' . $obj->rowid . '" data-currency-code="' . $obj->currency_code . '" data-html="'.dolPrintHTMLForAttribute($labeltoshowhtml).'" selected>';
5242
+					$out .= '<option value="'.$obj->rowid.'" data-currency-code="'.$obj->currency_code.'" data-html="'.dolPrintHTMLForAttribute($labeltoshowhtml).'" selected>';
5243 5243
 				} else {
5244
-					$out .= '<option value="' . $obj->rowid . '" data-currency-code="' . $obj->currency_code . '" data-html="'.dolPrintHTMLForAttribute($labeltoshowhtml).'">';
5244
+					$out .= '<option value="'.$obj->rowid.'" data-currency-code="'.$obj->currency_code.'" data-html="'.dolPrintHTMLForAttribute($labeltoshowhtml).'">';
5245 5245
 				}
5246 5246
 				$out .= $labeltoshow;
5247 5247
 				$out .= '</option>';
5248 5248
 				$i++;
5249 5249
 			}
5250 5250
 			$out .= "</select>";
5251
-			$out .= ajax_combobox('select' . $htmlname);
5251
+			$out .= ajax_combobox('select'.$htmlname);
5252 5252
 		} else {
5253 5253
 			dol_print_error($this->db);
5254 5254
 		}
@@ -5287,22 +5287,22 @@  discard block
 block discarded – undo
5287 5287
 		$num = 0;
5288 5288
 
5289 5289
 		$sql = "SELECT rowid, label, bank, status, iban_prefix, bic";
5290
-		$sql .= " FROM " . $this->db->prefix() . "societe_rib";
5291
-		$sql .=  " WHERE type = 'ban'";
5290
+		$sql .= " FROM ".$this->db->prefix()."societe_rib";
5291
+		$sql .= " WHERE type = 'ban'";
5292 5292
 		if ($filtre) {	// TODO Support USF
5293
-			$sql .= " AND " . $filtre;
5293
+			$sql .= " AND ".$filtre;
5294 5294
 		}
5295 5295
 		$sql .= " ORDER BY label";
5296
-		dol_syslog(get_class($this) . "::select_comptes", LOG_DEBUG);
5296
+		dol_syslog(get_class($this)."::select_comptes", LOG_DEBUG);
5297 5297
 		$result = $this->db->query($sql);
5298 5298
 		if ($result) {
5299 5299
 			$num = $this->db->num_rows($result);
5300 5300
 			$i = 0;
5301 5301
 
5302
-			$out .= '<select id="select' . $htmlname . '" class="flat selectbankaccount' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>';
5302
+			$out .= '<select id="select'.$htmlname.'" class="flat selectbankaccount'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>';
5303 5303
 
5304 5304
 			if ($num == 0) {
5305
-				$out .= '<option class="opacitymedium" value="-1">' . $langs->trans("NoBankAccountDefined") . '</span>';
5305
+				$out .= '<option class="opacitymedium" value="-1">'.$langs->trans("NoBankAccountDefined").'</span>';
5306 5306
 			} else {
5307 5307
 				if (!empty($useempty) && !is_numeric($useempty)) {
5308 5308
 					$out .= '<option value="-1">'.$langs->trans($useempty).'</option>';
@@ -5315,19 +5315,19 @@  discard block
 block discarded – undo
5315 5315
 				$obj = $this->db->fetch_object($result);
5316 5316
 				$iban = dolDecrypt($obj->iban_prefix);
5317 5317
 				if ($selected == $obj->rowid || ($useempty == 2 && $num == 1 && empty($selected))) {
5318
-					$out .= '<option value="' . $obj->rowid . '" data-iban-prefix="' . $iban . ' data-bic="' . $obj->bic . '" selected>';
5318
+					$out .= '<option value="'.$obj->rowid.'" data-iban-prefix="'.$iban.' data-bic="'.$obj->bic.'" selected>';
5319 5319
 				} else {
5320
-					$out .= '<option value="' . $obj->rowid . '" data-iban-prefix="' . $iban . ' data-bic="' . $obj->bic . '">';
5320
+					$out .= '<option value="'.$obj->rowid.'" data-iban-prefix="'.$iban.' data-bic="'.$obj->bic.'">';
5321 5321
 				}
5322 5322
 				$out .= trim($obj->label);
5323 5323
 				if ($showibanbic) {
5324
-					$out .= ' (' . $iban . '/' .$obj->bic. ')';
5324
+					$out .= ' ('.$iban.'/'.$obj->bic.')';
5325 5325
 				}
5326 5326
 				$out .= '</option>';
5327 5327
 				$i++;
5328 5328
 			}
5329 5329
 			$out .= "</select>";
5330
-			$out .= ajax_combobox('select' . $htmlname);
5330
+			$out .= ajax_combobox('select'.$htmlname);
5331 5331
 		} else {
5332 5332
 			dol_print_error($this->db);
5333 5333
 		}
@@ -5361,23 +5361,23 @@  discard block
 block discarded – undo
5361 5361
 		$num = 0;
5362 5362
 
5363 5363
 		$sql = "SELECT rowid, name, fk_country, status, entity";
5364
-		$sql .= " FROM " . $this->db->prefix() . "establishment";
5364
+		$sql .= " FROM ".$this->db->prefix()."establishment";
5365 5365
 		$sql .= " WHERE 1=1";
5366 5366
 		if ($status != 2) {
5367
-			$sql .= " AND status = " . (int) $status;
5367
+			$sql .= " AND status = ".(int) $status;
5368 5368
 		}
5369 5369
 		if ($filtre) {	// TODO Support USF
5370
-			$sql .= " AND " . $filtre;
5370
+			$sql .= " AND ".$filtre;
5371 5371
 		}
5372 5372
 		$sql .= " ORDER BY name";
5373 5373
 
5374
-		dol_syslog(get_class($this) . "::select_establishment", LOG_DEBUG);
5374
+		dol_syslog(get_class($this)."::select_establishment", LOG_DEBUG);
5375 5375
 		$result = $this->db->query($sql);
5376 5376
 		if ($result) {
5377 5377
 			$num = $this->db->num_rows($result);
5378 5378
 			$i = 0;
5379 5379
 			if ($num) {
5380
-				print '<select id="select' . $htmlname . '" class="flat selectestablishment" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>';
5380
+				print '<select id="select'.$htmlname.'" class="flat selectestablishment" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>';
5381 5381
 				if ($useempty == 1 || ($useempty == 2 && $num > 1)) {
5382 5382
 					print '<option value="-1">&nbsp;</option>';
5383 5383
 				}
@@ -5385,13 +5385,13 @@  discard block
 block discarded – undo
5385 5385
 				while ($i < $num) {
5386 5386
 					$obj = $this->db->fetch_object($result);
5387 5387
 					if ($selected == $obj->rowid) {
5388
-						print '<option value="' . $obj->rowid . '" selected>';
5388
+						print '<option value="'.$obj->rowid.'" selected>';
5389 5389
 					} else {
5390
-						print '<option value="' . $obj->rowid . '">';
5390
+						print '<option value="'.$obj->rowid.'">';
5391 5391
 					}
5392 5392
 					print trim($obj->name);
5393 5393
 					if ($status == 2 && $obj->status == 1) {
5394
-						print ' (' . $langs->trans("Closed") . ')';
5394
+						print ' ('.$langs->trans("Closed").')';
5395 5395
 					}
5396 5396
 					print '</option>';
5397 5397
 					$i++;
@@ -5399,9 +5399,9 @@  discard block
 block discarded – undo
5399 5399
 				print "</select>";
5400 5400
 			} else {
5401 5401
 				if ($status == 0) {
5402
-					print '<span class="opacitymedium">' . $langs->trans("NoActiveEstablishmentDefined") . '</span>';
5402
+					print '<span class="opacitymedium">'.$langs->trans("NoActiveEstablishmentDefined").'</span>';
5403 5403
 				} else {
5404
-					print '<span class="opacitymedium">' . $langs->trans("NoEstablishmentFound") . '</span>';
5404
+					print '<span class="opacitymedium">'.$langs->trans("NoEstablishmentFound").'</span>';
5405 5405
 				}
5406 5406
 			}
5407 5407
 
@@ -5425,20 +5425,20 @@  discard block
 block discarded – undo
5425 5425
 	{
5426 5426
 		global $langs;
5427 5427
 		if ($htmlname != "none") {
5428
-			print '<form method="POST" action="' . $page . '">';
5428
+			print '<form method="POST" action="'.$page.'">';
5429 5429
 			print '<input type="hidden" name="action" value="setbankaccount">';
5430
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
5430
+			print '<input type="hidden" name="token" value="'.newToken().'">';
5431 5431
 			print img_picto('', 'bank_account', 'class="pictofixedwidth"');
5432 5432
 			$nbaccountfound = $this->select_comptes($selected, $htmlname, 0, '', $addempty);
5433 5433
 			if ($nbaccountfound > 0) {
5434
-				print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
5434
+				print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
5435 5435
 			}
5436 5436
 			print '</form>';
5437 5437
 		} else {
5438 5438
 			$langs->load('banks');
5439 5439
 
5440 5440
 			if ($selected) {
5441
-				require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php';
5441
+				require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
5442 5442
 				$bankstatic = new Account($this->db);
5443 5443
 				$result = $bankstatic->fetch($selected);
5444 5444
 				if ($result) {
@@ -5465,25 +5465,25 @@  discard block
 block discarded – undo
5465 5465
 	{
5466 5466
 		global $langs;
5467 5467
 		if ($htmlname != "none") {
5468
-			print '<form method="POST" action="' . $page . '">';
5468
+			print '<form method="POST" action="'.$page.'">';
5469 5469
 			print '<input type="hidden" name="action" value="setbankaccountcustomer">';
5470
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
5470
+			print '<input type="hidden" name="token" value="'.newToken().'">';
5471 5471
 			$nbaccountfound = $this->selectRib($selected, $htmlname, $filtre, $addempty, '', $showibanbic);
5472 5472
 			if ($nbaccountfound > 0) {
5473
-				print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
5473
+				print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
5474 5474
 			}
5475 5475
 			print '</form>';
5476 5476
 		} else {
5477 5477
 			$langs->load('banks');
5478 5478
 
5479 5479
 			if ($selected) {
5480
-				require_once DOL_DOCUMENT_ROOT . '/societe/class/companybankaccount.class.php';
5480
+				require_once DOL_DOCUMENT_ROOT.'/societe/class/companybankaccount.class.php';
5481 5481
 				$bankstatic = new CompanyBankAccount($this->db);
5482 5482
 				$result = $bankstatic->fetch($selected);
5483 5483
 				if ($result) {
5484 5484
 					print $bankstatic->label;
5485 5485
 					if ($showibanbic) {
5486
-						print ' (' . $bankstatic->iban . '/' .$bankstatic->bic. ')';
5486
+						print ' ('.$bankstatic->iban.'/'.$bankstatic->bic.')';
5487 5487
 					}
5488 5488
 				}
5489 5489
 			} else {
@@ -5519,11 +5519,11 @@  discard block
 block discarded – undo
5519 5519
 		global $conf, $langs;
5520 5520
 		$langs->load("categories");
5521 5521
 
5522
-		include_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
5522
+		include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
5523 5523
 
5524 5524
 		// For backward compatibility
5525 5525
 		if (is_numeric($type)) {
5526
-			dol_syslog(__METHOD__ . ': using numeric value for parameter type is deprecated. Use string code instead.', LOG_WARNING);
5526
+			dol_syslog(__METHOD__.': using numeric value for parameter type is deprecated. Use string code instead.', LOG_WARNING);
5527 5527
 		}
5528 5528
 
5529 5529
 		if ($type === Categorie::TYPE_BANK_LINE) {
@@ -5531,8 +5531,8 @@  discard block
 block discarded – undo
5531 5531
 			$cat = new Categorie($this->db);
5532 5532
 			$cate_arbo = array();
5533 5533
 			$sql = "SELECT c.label, c.rowid";
5534
-			$sql .= " FROM " . $this->db->prefix() . "categorie as c";
5535
-			$sql .= " WHERE entity = " . $conf->entity . " AND type = " . ((int) $cat->getMapId()[$type]);
5534
+			$sql .= " FROM ".$this->db->prefix()."categorie as c";
5535
+			$sql .= " WHERE entity = ".$conf->entity." AND type = ".((int) $cat->getMapId()[$type]);
5536 5536
 			$sql .= " ORDER BY c.label";
5537 5537
 			$result = $this->db->query($sql);
5538 5538
 			if ($result) {
@@ -5558,12 +5558,12 @@  discard block
 block discarded – undo
5558 5558
 		$outarrayrichhtml = array();
5559 5559
 
5560 5560
 
5561
-		$output = '<select class="flat minwidth100' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
5561
+		$output = '<select class="flat minwidth100'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
5562 5562
 		if (is_array($cate_arbo)) {
5563 5563
 			$num = count($cate_arbo);
5564 5564
 
5565 5565
 			if (!$num) {
5566
-				$output .= '<option value="-1" disabled>' . $langs->trans("NoCategoriesDefined") . '</option>';
5566
+				$output .= '<option value="-1" disabled>'.$langs->trans("NoCategoriesDefined").'</option>';
5567 5567
 			} else {
5568 5568
 				if ($useempty == 1 || ($useempty == 2 && $num > 1)) {
5569 5569
 					$output .= '<option value="-1">&nbsp;</option>';
@@ -5575,15 +5575,15 @@  discard block
 block discarded – undo
5575 5575
 						$add = '';
5576 5576
 					}
5577 5577
 
5578
-					$labeltoshow = img_picto('', 'category', 'class="pictofixedwidth" style="color: #' . $cate_arbo[$key]['color'] . '"');
5578
+					$labeltoshow = img_picto('', 'category', 'class="pictofixedwidth" style="color: #'.$cate_arbo[$key]['color'].'"');
5579 5579
 					$labeltoshow .= dol_trunc($cate_arbo[$key]['fulllabel'], $maxlength, 'middle');
5580 5580
 
5581 5581
 					$outarray[$cate_arbo[$key]['id']] = $cate_arbo[$key]['fulllabel'];
5582 5582
 
5583 5583
 					$outarrayrichhtml[$cate_arbo[$key]['id']] = $labeltoshow;
5584 5584
 
5585
-					$output .= '<option ' . $add . 'value="' . $cate_arbo[$key]['id'] . '"';
5586
-					$output .= ' data-html="' . dol_escape_htmltag($labeltoshow) . '"';
5585
+					$output .= '<option '.$add.'value="'.$cate_arbo[$key]['id'].'"';
5586
+					$output .= ' data-html="'.dol_escape_htmltag($labeltoshow).'"';
5587 5587
 					$output .= '>';
5588 5588
 					$output .= dol_trunc($cate_arbo[$key]['fulllabel'], $maxlength, 'middle');
5589 5589
 					$output .= '</option>';
@@ -5629,7 +5629,7 @@  discard block
 block discarded – undo
5629 5629
 	public function form_confirm($page, $title, $question, $action, $formquestion = array(), $selectedchoice = "", $useajax = 0, $height = 170, $width = 500)
5630 5630
 	{
5631 5631
 		// phpcs:enable
5632
-		dol_syslog(__METHOD__ . ': using form_confirm is deprecated. Use formconfim instead.', LOG_WARNING);
5632
+		dol_syslog(__METHOD__.': using form_confirm is deprecated. Use formconfim instead.', LOG_WARNING);
5633 5633
 		print $this->formconfirm($page, $title, $question, $action, $formquestion, $selectedchoice, $useajax, $height, $width);
5634 5634
 	}
5635 5635
 
@@ -5664,7 +5664,7 @@  discard block
 block discarded – undo
5664 5664
 	{
5665 5665
 		global $langs, $conf;
5666 5666
 
5667
-		$more = '<!-- formconfirm - before call, page=' . dol_escape_htmltag($page) . ' -->';
5667
+		$more = '<!-- formconfirm - before call, page='.dol_escape_htmltag($page).' -->';
5668 5668
 		$formconfirm = '';
5669 5669
 		$inputok = array();
5670 5670
 		$inputko = array();
@@ -5688,27 +5688,27 @@  discard block
 block discarded – undo
5688 5688
 			foreach ($formquestion as $key => $input) {
5689 5689
 				if (is_array($input) && !empty($input)) {
5690 5690
 					if ($input['type'] == 'hidden') {
5691
-						$moreattr = (!empty($input['moreattr']) ? ' ' . $input['moreattr'] : '');
5692
-						$morecss = (!empty($input['morecss']) ? ' ' . $input['morecss'] : '');
5691
+						$moreattr = (!empty($input['moreattr']) ? ' '.$input['moreattr'] : '');
5692
+						$morecss = (!empty($input['morecss']) ? ' '.$input['morecss'] : '');
5693 5693
 
5694
-						$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";
5694
+						$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";
5695 5695
 					}
5696 5696
 				}
5697 5697
 			}
5698 5698
 
5699 5699
 			// Now add questions
5700 5700
 			$moreonecolumn = '';
5701
-			$more .= '<div class="tagtable paddingtopbottomonly centpercent noborderspacing">' . "\n";
5701
+			$more .= '<div class="tagtable paddingtopbottomonly centpercent noborderspacing">'."\n";
5702 5702
 			foreach ($formquestion as $key => $input) {
5703 5703
 				if (is_array($input) && !empty($input)) {
5704
-					$size = (!empty($input['size']) ? ' size="' . $input['size'] . '"' : '');    // deprecated. Use morecss instead.
5705
-					$moreattr = (!empty($input['moreattr']) ? ' ' . $input['moreattr'] : '');
5706
-					$morecss = (!empty($input['morecss']) ? ' ' . $input['morecss'] : '');
5704
+					$size = (!empty($input['size']) ? ' size="'.$input['size'].'"' : ''); // deprecated. Use morecss instead.
5705
+					$moreattr = (!empty($input['moreattr']) ? ' '.$input['moreattr'] : '');
5706
+					$morecss = (!empty($input['morecss']) ? ' '.$input['morecss'] : '');
5707 5707
 
5708 5708
 					if ($input['type'] == 'text') {
5709
-						$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";
5709
+						$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";
5710 5710
 					} elseif ($input['type'] == 'password') {
5711
-						$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";
5711
+						$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";
5712 5712
 					} elseif ($input['type'] == 'textarea') {
5713 5713
 						/*$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div><div class="tagtd">';
5714 5714
 						$more .= '<textarea name="'.$input['name'].'" class="'.$morecss.'"'.$moreattr.'>';
@@ -5716,8 +5716,8 @@  discard block
 block discarded – undo
5716 5716
 						$more .= '</textarea>';
5717 5717
 						$more .= '</div></div>'."\n";*/
5718 5718
 						$moreonecolumn .= '<div class="margintoponly">';
5719
-						$moreonecolumn .= $input['label'] . '<br>';
5720
-						$moreonecolumn .= '<textarea name="' . dol_escape_htmltag($input['name']) . '" id="' . dol_escape_htmltag($input['name']) . '" class="' . $morecss . '"' . $moreattr . '>';
5719
+						$moreonecolumn .= $input['label'].'<br>';
5720
+						$moreonecolumn .= '<textarea name="'.dol_escape_htmltag($input['name']).'" id="'.dol_escape_htmltag($input['name']).'" class="'.$morecss.'"'.$moreattr.'>';
5721 5721
 						$moreonecolumn .= $input['value'];
5722 5722
 						$moreonecolumn .= '</textarea>';
5723 5723
 						$moreonecolumn .= '</div>';
@@ -5734,20 +5734,20 @@  discard block
 block discarded – undo
5734 5734
 						$disabled = isset($input['select_disabled']) ? $input['select_disabled'] : 0;
5735 5735
 						$sort = isset($input['select_sort']) ? $input['select_sort'] : '';
5736 5736
 
5737
-						$more .= '<div class="tagtr"><div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '">';
5737
+						$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">';
5738 5738
 						if (!empty($input['label'])) {
5739
-							$more .= $input['label'] . '</div><div class="tagtd left">';
5739
+							$more .= $input['label'].'</div><div class="tagtd left">';
5740 5740
 						}
5741 5741
 						if ($input['type'] == 'select') {
5742 5742
 							$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);
5743 5743
 						} else {
5744 5744
 							$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);
5745 5745
 						}
5746
-						$more .= '</div></div>' . "\n";
5746
+						$more .= '</div></div>'."\n";
5747 5747
 					} elseif ($input['type'] == 'checkbox') {
5748 5748
 						$more .= '<div class="tagtr">';
5749
-						$more .= '<div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '"><label for="' . dol_escape_htmltag($input['name']) . '">' . $input['label'] . '</label></div><div class="tagtd">';
5750
-						$more .= '<input type="checkbox" class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . dol_escape_htmltag($input['name']) . '" name="' . dol_escape_htmltag($input['name']) . '"' . $moreattr;
5749
+						$more .= '<div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'"><label for="'.dol_escape_htmltag($input['name']).'">'.$input['label'].'</label></div><div class="tagtd">';
5750
+						$more .= '<input type="checkbox" class="flat'.($morecss ? ' '.$morecss : '').'" id="'.dol_escape_htmltag($input['name']).'" name="'.dol_escape_htmltag($input['name']).'"'.$moreattr;
5751 5751
 						if (!is_bool($input['value']) && $input['value'] != 'false' && $input['value'] != '0' && $input['value'] != '') {
5752 5752
 							$more .= ' checked';
5753 5753
 						}
@@ -5758,19 +5758,19 @@  discard block
 block discarded – undo
5758 5758
 							$more .= ' disabled';
5759 5759
 						}
5760 5760
 						$more .= ' /></div>';
5761
-						$more .= '</div>' . "\n";
5761
+						$more .= '</div>'."\n";
5762 5762
 					} elseif ($input['type'] == 'radio') {
5763 5763
 						$i = 0;
5764 5764
 						foreach ($input['values'] as $selkey => $selval) {
5765 5765
 							$more .= '<div class="tagtr">';
5766 5766
 							if (isset($input['label'])) {
5767 5767
 								if ($i == 0) {
5768
-									$more .= '<div class="tagtd' . (empty($input['tdclass']) ? ' tdtop' : (' tdtop ' . $input['tdclass'])) . '">' . $input['label'] . '</div>';
5768
+									$more .= '<div class="tagtd'.(empty($input['tdclass']) ? ' tdtop' : (' tdtop '.$input['tdclass'])).'">'.$input['label'].'</div>';
5769 5769
 								} else {
5770
-									$more .= '<div class="tagtd' . (empty($input['tdclass']) ? '' : (' "' . $input['tdclass'])) . '">&nbsp;</div>';
5770
+									$more .= '<div class="tagtd'.(empty($input['tdclass']) ? '' : (' "'.$input['tdclass'])).'">&nbsp;</div>';
5771 5771
 								}
5772 5772
 							}
5773
-							$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;
5773
+							$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;
5774 5774
 							if (!empty($input['disabled'])) {
5775 5775
 								$more .= ' disabled';
5776 5776
 							}
@@ -5778,12 +5778,12 @@  discard block
 block discarded – undo
5778 5778
 								$more .= ' checked="checked"';
5779 5779
 							}
5780 5780
 							$more .= ' /> ';
5781
-							$more .= '<label for="' . dol_escape_htmltag($input['name'] . $selkey) . '" class="valignmiddle">' . $selval . '</label>';
5782
-							$more .= '</div></div>' . "\n";
5781
+							$more .= '<label for="'.dol_escape_htmltag($input['name'].$selkey).'" class="valignmiddle">'.$selval.'</label>';
5782
+							$more .= '</div></div>'."\n";
5783 5783
 							$i++;
5784 5784
 						}
5785 5785
 					} elseif ($input['type'] == 'date' || $input['type'] == 'datetime') {
5786
-						$more .= '<div class="tagtr"><div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '">' . $input['label'] . '</div>';
5786
+						$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div>';
5787 5787
 						$more .= '<div class="tagtd">';
5788 5788
 						$addnowlink = (empty($input['datenow']) ? 0 : 1);
5789 5789
 						$h = $m = 0;
@@ -5801,24 +5801,24 @@  discard block
 block discarded – undo
5801 5801
 					} elseif ($input['type'] == 'other') { // can be 1 column or 2 depending if label is set or not
5802 5802
 						$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">';
5803 5803
 						if (!empty($input['label'])) {
5804
-							$more .= $input['label'] . '</div><div class="tagtd">';
5804
+							$more .= $input['label'].'</div><div class="tagtd">';
5805 5805
 						}
5806 5806
 						$more .= $input['value'];
5807
-						$more .= '</div></div>' . "\n";
5807
+						$more .= '</div></div>'."\n";
5808 5808
 					} elseif ($input['type'] == 'onecolumn') {
5809 5809
 						$moreonecolumn .= '<div class="margintoponly">';
5810 5810
 						$moreonecolumn .= $input['value'];
5811
-						$moreonecolumn .= '</div>' . "\n";
5811
+						$moreonecolumn .= '</div>'."\n";
5812 5812
 					} elseif ($input['type'] == 'hidden') {
5813 5813
 						// Do nothing more, already added by a previous loop
5814 5814
 					} elseif ($input['type'] == 'separator') {
5815 5815
 						$more .= '<br>';
5816 5816
 					} else {
5817
-						$more .= 'Error type ' . $input['type'] . ' for the confirm box is not a supported type';
5817
+						$more .= 'Error type '.$input['type'].' for the confirm box is not a supported type';
5818 5818
 					}
5819 5819
 				}
5820 5820
 			}
5821
-			$more .= '</div>' . "\n";
5821
+			$more .= '</div>'."\n";
5822 5822
 			$more .= $moreonecolumn;
5823 5823
 		}
5824 5824
 
@@ -5840,10 +5840,10 @@  discard block
 block discarded – undo
5840 5840
 				$button = $useajax;
5841 5841
 				$useajax = 1;
5842 5842
 				$autoOpen = false;
5843
-				$dialogconfirm .= '-' . $button;
5843
+				$dialogconfirm .= '-'.$button;
5844 5844
 			}
5845
-			$pageyes = $page . (preg_match('/\?/', $page) ? '&' : '?') . 'action=' . urlencode($action) . '&confirm=yes';
5846
-			$pageno = ($useajax == 2 ? $page . (preg_match('/\?/', $page) ? '&' : '?') . 'action=' . urlencode($action) . '&confirm=no' : '');
5845
+			$pageyes = $page.(preg_match('/\?/', $page) ? '&' : '?').'action='.urlencode($action).'&confirm=yes';
5846
+			$pageno = ($useajax == 2 ? $page.(preg_match('/\?/', $page) ? '&' : '?').'action='.urlencode($action).'&confirm=no' : '');
5847 5847
 
5848 5848
 			// Add input fields into list of fields to read during submit (inputok and inputko)
5849 5849
 			if (is_array($formquestion)) {
@@ -5866,24 +5866,24 @@  discard block
 block discarded – undo
5866 5866
 			}
5867 5867
 
5868 5868
 			// Show JQuery confirm box.
5869
-			$formconfirm .= '<div id="' . $dialogconfirm . '" title="' . dol_escape_htmltag($title) . '" style="display: none;">';
5869
+			$formconfirm .= '<div id="'.$dialogconfirm.'" title="'.dol_escape_htmltag($title).'" style="display: none;">';
5870 5870
 			if (is_array($formquestion) && array_key_exists('text', $formquestion) && !empty($formquestion['text'])) {
5871
-				$formconfirm .= '<div class="confirmtext">' . $formquestion['text'] . '</div>' . "\n";
5871
+				$formconfirm .= '<div class="confirmtext">'.$formquestion['text'].'</div>'."\n";
5872 5872
 			}
5873 5873
 			if (!empty($more)) {
5874
-				$formconfirm .= '<div class="confirmquestions">' . $more . '</div>' . "\n";
5874
+				$formconfirm .= '<div class="confirmquestions">'.$more.'</div>'."\n";
5875 5875
 			}
5876
-			$formconfirm .= ($question ? '<div class="confirmmessage">' . img_help(0, '') . ' ' . $question . '</div>' : '');
5877
-			$formconfirm .= '</div>' . "\n";
5876
+			$formconfirm .= ($question ? '<div class="confirmmessage">'.img_help(0, '').' '.$question.'</div>' : '');
5877
+			$formconfirm .= '</div>'."\n";
5878 5878
 
5879
-			$formconfirm .= "\n<!-- begin code of popup for formconfirm page=" . $page . " -->\n";
5880
-			$formconfirm .= '<script nonce="' . getNonce() . '" type="text/javascript">' . "\n";
5879
+			$formconfirm .= "\n<!-- begin code of popup for formconfirm page=".$page." -->\n";
5880
+			$formconfirm .= '<script nonce="'.getNonce().'" type="text/javascript">'."\n";
5881 5881
 			$formconfirm .= "/* Code for the jQuery('#dialogforpopup').dialog() */\n";
5882 5882
 			$formconfirm .= 'jQuery(document).ready(function() {
5883 5883
             $(function() {
5884
-            	$( "#' . $dialogconfirm . '" ).dialog(
5884
+            	$( "#' . $dialogconfirm.'" ).dialog(
5885 5885
             	{
5886
-                    autoOpen: ' . ($autoOpen ? "true" : "false") . ',';
5886
+                    autoOpen: ' . ($autoOpen ? "true" : "false").',';
5887 5887
 			if ($newselectedchoice == 'no') {
5888 5888
 				$formconfirm .= '
5889 5889
 						open: function() {
@@ -5893,24 +5893,24 @@  discard block
 block discarded – undo
5893 5893
 
5894 5894
 			$jsforcursor = '';
5895 5895
 			if ($useajax == 1) {
5896
-				$jsforcursor = '// The call to urljump can be slow, so we set the wait cursor' . "\n";
5897
-				$jsforcursor .= 'jQuery("html,body,#id-container").addClass("cursorwait");' . "\n";
5896
+				$jsforcursor = '// The call to urljump can be slow, so we set the wait cursor'."\n";
5897
+				$jsforcursor .= 'jQuery("html,body,#id-container").addClass("cursorwait");'."\n";
5898 5898
 			}
5899 5899
 
5900 5900
 			$postconfirmas = 'GET';
5901 5901
 
5902 5902
 			$formconfirm .= '
5903 5903
                     resizable: false,
5904
-                    height: "' . $height . '",
5905
-                    width: "' . $width . '",
5904
+                    height: "' . $height.'",
5905
+                    width: "' . $width.'",
5906 5906
                     modal: true,
5907 5907
                     closeOnEscape: false,
5908 5908
                     buttons: {
5909
-                        "' . dol_escape_js($langs->transnoentities($labelbuttonyes)) . '": function() {
5910
-							var options = "token=' . urlencode(newToken()) . '";
5911
-                        	var inputok = ' . json_encode($inputok) . ';	/* List of fields into form */
5912
-							var page = "' . dol_escape_js(!empty($page) ? $page : '') . '";
5913
-                         	var pageyes = "' . dol_escape_js(!empty($pageyes) ? $pageyes : '') . '";
5909
+                        "' . dol_escape_js($langs->transnoentities($labelbuttonyes)).'": function() {
5910
+							var options = "token=' . urlencode(newToken()).'";
5911
+                        	var inputok = ' . json_encode($inputok).';	/* List of fields into form */
5912
+							var page = "' . dol_escape_js(!empty($page) ? $page : '').'";
5913
+                         	var pageyes = "' . dol_escape_js(!empty($pageyes) ? $pageyes : '').'";
5914 5914
 
5915 5915
                          	if (inputok.length > 0) {
5916 5916
                          		$.each(inputok, function(i, inputname) {
@@ -5944,11 +5944,11 @@  discard block
 block discarded – undo
5944 5944
 							}
5945 5945
 	                        $(this).dialog("close");
5946 5946
                         },
5947
-                        "' . dol_escape_js($langs->transnoentities($labelbuttonno)) . '": function() {
5948
-                        	var options = "token=' . urlencode(newToken()) . '";
5949
-                         	var inputko = ' . json_encode($inputko) . ';	/* List of fields into form */
5950
-							var page = "' . dol_escape_js(!empty($page) ? $page : '') . '";
5951
-                         	var pageno="' . dol_escape_js(!empty($pageno) ? $pageno : '') . '";
5947
+                        "' . dol_escape_js($langs->transnoentities($labelbuttonno)).'": function() {
5948
+                        	var options = "token=' . urlencode(newToken()).'";
5949
+                         	var inputko = ' . json_encode($inputko).';	/* List of fields into form */
5950
+							var page = "' . dol_escape_js(!empty($page) ? $page : '').'";
5951
+                         	var pageno="' . dol_escape_js(!empty($pageno) ? $pageno : '').'";
5952 5952
                          	if (inputko.length > 0) {
5953 5953
                          		$.each(inputko, function(i, inputname) {
5954 5954
                          			var more = "";
@@ -5980,10 +5980,10 @@  discard block
 block discarded – undo
5980 5980
                 }
5981 5981
                 );
5982 5982
 
5983
-            	var button = "' . $button . '";
5983
+            	var button = "' . $button.'";
5984 5984
             	if (button.length > 0) {
5985 5985
                 	$( "#" + button ).click(function() {
5986
-                		$("#' . $dialogconfirm . '").dialog("open");
5986
+                		$("#' . $dialogconfirm.'").dialog("open");
5987 5987
         			});
5988 5988
                 }
5989 5989
             });
@@ -5991,44 +5991,44 @@  discard block
 block discarded – undo
5991 5991
             </script>';
5992 5992
 			$formconfirm .= "<!-- end ajax formconfirm -->\n";
5993 5993
 		} else {
5994
-			$formconfirm .= "\n<!-- begin formconfirm page=" . dol_escape_htmltag($page) . " -->\n";
5994
+			$formconfirm .= "\n<!-- begin formconfirm page=".dol_escape_htmltag($page)." -->\n";
5995 5995
 
5996 5996
 			if (empty($disableformtag)) {
5997
-				$formconfirm .= '<form method="POST" action="' . $page . '" class="notoptoleftnoright">' . "\n";
5997
+				$formconfirm .= '<form method="POST" action="'.$page.'" class="notoptoleftnoright">'."\n";
5998 5998
 			}
5999 5999
 
6000
-			$formconfirm .= '<input type="hidden" name="action" value="' . $action . '">' . "\n";
6001
-			$formconfirm .= '<input type="hidden" name="token" value="' . newToken() . '">' . "\n";
6000
+			$formconfirm .= '<input type="hidden" name="action" value="'.$action.'">'."\n";
6001
+			$formconfirm .= '<input type="hidden" name="token" value="'.newToken().'">'."\n";
6002 6002
 
6003
-			$formconfirm .= '<table class="valid centpercent">' . "\n";
6003
+			$formconfirm .= '<table class="valid centpercent">'."\n";
6004 6004
 
6005 6005
 			// Line title
6006 6006
 			$formconfirm .= '<tr class="validtitre"><td class="validtitre" colspan="2">';
6007
-			$formconfirm .= img_picto('', 'pictoconfirm') . ' ' . $title;
6008
-			$formconfirm .= '</td></tr>' . "\n";
6007
+			$formconfirm .= img_picto('', 'pictoconfirm').' '.$title;
6008
+			$formconfirm .= '</td></tr>'."\n";
6009 6009
 
6010 6010
 			// Line text
6011 6011
 			if (is_array($formquestion) && array_key_exists('text', $formquestion) && !empty($formquestion['text'])) {
6012
-				$formconfirm .= '<tr class="valid"><td class="valid" colspan="2">' . $formquestion['text'] . '</td></tr>' . "\n";
6012
+				$formconfirm .= '<tr class="valid"><td class="valid" colspan="2">'.$formquestion['text'].'</td></tr>'."\n";
6013 6013
 			}
6014 6014
 
6015 6015
 			// Line form fields
6016 6016
 			if ($more) {
6017
-				$formconfirm .= '<tr class="valid"><td class="valid" colspan="2">' . "\n";
6017
+				$formconfirm .= '<tr class="valid"><td class="valid" colspan="2">'."\n";
6018 6018
 				$formconfirm .= $more;
6019
-				$formconfirm .= '</td></tr>' . "\n";
6019
+				$formconfirm .= '</td></tr>'."\n";
6020 6020
 			}
6021 6021
 
6022 6022
 			// Line with question
6023 6023
 			$formconfirm .= '<tr class="valid">';
6024
-			$formconfirm .= '<td class="valid">' . $question . '</td>';
6024
+			$formconfirm .= '<td class="valid">'.$question.'</td>';
6025 6025
 			$formconfirm .= '<td class="valid center">';
6026 6026
 			$formconfirm .= $this->selectyesno("confirm", $newselectedchoice, 0, false, 0, 0, 'marginleftonly marginrightonly', $labelbuttonyes, $labelbuttonno);
6027
-			$formconfirm .= '<input class="button valignmiddle confirmvalidatebutton small" type="submit" value="' . $langs->trans("Validate") . '">';
6027
+			$formconfirm .= '<input class="button valignmiddle confirmvalidatebutton small" type="submit" value="'.$langs->trans("Validate").'">';
6028 6028
 			$formconfirm .= '</td>';
6029
-			$formconfirm .= '</tr>' . "\n";
6029
+			$formconfirm .= '</tr>'."\n";
6030 6030
 
6031
-			$formconfirm .= '</table>' . "\n";
6031
+			$formconfirm .= '</table>'."\n";
6032 6032
 
6033 6033
 			if (empty($disableformtag)) {
6034 6034
 				$formconfirm .= "</form>\n";
@@ -6037,7 +6037,7 @@  discard block
 block discarded – undo
6037 6037
 
6038 6038
 			if (!empty($conf->use_javascript_ajax)) {
6039 6039
 				$formconfirm .= '<!-- code to disable button to avoid double clic -->';
6040
-				$formconfirm .= '<script nonce="' . getNonce() . '" type="text/javascript">' . "\n";
6040
+				$formconfirm .= '<script nonce="'.getNonce().'" type="text/javascript">'."\n";
6041 6041
 				$formconfirm .= '
6042 6042
 				$(document).ready(function () {
6043 6043
 					$(".confirmvalidatebutton").on("click", function() {
@@ -6049,7 +6049,7 @@  discard block
 block discarded – undo
6049 6049
 					});
6050 6050
 				});
6051 6051
 				';
6052
-				$formconfirm .= '</script>' . "\n";
6052
+				$formconfirm .= '</script>'."\n";
6053 6053
 			}
6054 6054
 
6055 6055
 			$formconfirm .= "<!-- end formconfirm -->\n";
@@ -6081,8 +6081,8 @@  discard block
 block discarded – undo
6081 6081
 		// phpcs:enable
6082 6082
 		global $langs;
6083 6083
 
6084
-		require_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php';
6085
-		require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php';
6084
+		require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
6085
+		require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
6086 6086
 
6087 6087
 		$out = '';
6088 6088
 
@@ -6090,11 +6090,11 @@  discard block
 block discarded – undo
6090 6090
 
6091 6091
 		$langs->load("project");
6092 6092
 		if ($htmlname != "none") {
6093
-			$out .= '<form method="post" action="' . $page . '">';
6093
+			$out .= '<form method="post" action="'.$page.'">';
6094 6094
 			$out .= '<input type="hidden" name="action" value="classin">';
6095
-			$out .= '<input type="hidden" name="token" value="' . newToken() . '">';
6095
+			$out .= '<input type="hidden" name="token" value="'.newToken().'">';
6096 6096
 			$out .= $formproject->select_projects($socid, $selected, $htmlname, $maxlength, 0, 1, $discard_closed, $forcefocus, 0, 0, '', 1, 0, $morecss);
6097
-			$out .= '<input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '">';
6097
+			$out .= '<input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">';
6098 6098
 			$out .= '</form>';
6099 6099
 		} else {
6100 6100
 			$out .= '<span class="project_head_block">';
@@ -6103,7 +6103,7 @@  discard block
 block discarded – undo
6103 6103
 				$projet->fetch($selected);
6104 6104
 				$out .= $projet->getNomUrl(0, '', 1);
6105 6105
 			} else {
6106
-				$out .= '<span class="opacitymedium">' . $textifnoproject . '</span>';
6106
+				$out .= '<span class="opacitymedium">'.$textifnoproject.'</span>';
6107 6107
 			}
6108 6108
 			$out .= '</span>';
6109 6109
 		}
@@ -6140,14 +6140,14 @@  discard block
 block discarded – undo
6140 6140
 		$out = '';
6141 6141
 
6142 6142
 		if ($htmlname != "none") {
6143
-			$out .= '<form method="POST" action="' . $page . '">';
6143
+			$out .= '<form method="POST" action="'.$page.'">';
6144 6144
 			$out .= '<input type="hidden" name="action" value="setconditions">';
6145
-			$out .= '<input type="hidden" name="token" value="' . newToken() . '">';
6145
+			$out .= '<input type="hidden" name="token" value="'.newToken().'">';
6146 6146
 			if ($type) {
6147
-				$out .= '<input type="hidden" name="type" value="' . dol_escape_htmltag($type) . '">';
6147
+				$out .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">';
6148 6148
 			}
6149 6149
 			$out .= $this->getSelectConditionsPaiements($selected, $htmlname, $filtertype, $addempty, 0, '', $deposit_percent);
6150
-			$out .= '<input type="submit" class="button valignmiddle smallpaddingimp" value="' . $langs->trans("Modify") . '">';
6150
+			$out .= '<input type="submit" class="button valignmiddle smallpaddingimp" value="'.$langs->trans("Modify").'">';
6151 6151
 			$out .= '</form>';
6152 6152
 		} else {
6153 6153
 			if ($selected) {
@@ -6192,12 +6192,12 @@  discard block
 block discarded – undo
6192 6192
 		// phpcs:enable
6193 6193
 		global $langs;
6194 6194
 		if ($htmlname != "none") {
6195
-			print '<form method="post" action="' . $page . '">';
6195
+			print '<form method="post" action="'.$page.'">';
6196 6196
 			print '<input type="hidden" name="action" value="setavailability">';
6197
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
6197
+			print '<input type="hidden" name="token" value="'.newToken().'">';
6198 6198
 			$this->selectAvailabilityDelay($selected, $htmlname, '', $addempty);
6199
-			print '<input type="submit" name="modify" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '">';
6200
-			print '<input type="submit" name="cancel" class="button smallpaddingimp" value="' . $langs->trans("Cancel") . '">';
6199
+			print '<input type="submit" name="modify" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">';
6200
+			print '<input type="submit" name="cancel" class="button smallpaddingimp" value="'.$langs->trans("Cancel").'">';
6201 6201
 			print '</form>';
6202 6202
 		} else {
6203 6203
 			if ($selected) {
@@ -6223,11 +6223,11 @@  discard block
 block discarded – undo
6223 6223
 	{
6224 6224
 		global $langs;
6225 6225
 		if ($htmlname != "none") {
6226
-			print '<form method="post" action="' . $page . '">';
6226
+			print '<form method="post" action="'.$page.'">';
6227 6227
 			print '<input type="hidden" name="action" value="setdemandreason">';
6228
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
6228
+			print '<input type="hidden" name="token" value="'.newToken().'">';
6229 6229
 			$this->selectInputReason($selected, $htmlname, '-1', $addempty);
6230
-			print '<input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '">';
6230
+			print '<input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">';
6231 6231
 			print '</form>';
6232 6232
 		} else {
6233 6233
 			if ($selected) {
@@ -6267,17 +6267,17 @@  discard block
 block discarded – undo
6267 6267
 		$ret = '';
6268 6268
 
6269 6269
 		if ($htmlname != "none") {
6270
-			$ret .= '<form method="POST" action="' . $page . '" name="form' . $htmlname . '">';
6271
-			$ret .= '<input type="hidden" name="action" value="set' . $htmlname . '">';
6272
-			$ret .= '<input type="hidden" name="token" value="' . newToken() . '">';
6270
+			$ret .= '<form method="POST" action="'.$page.'" name="form'.$htmlname.'">';
6271
+			$ret .= '<input type="hidden" name="action" value="set'.$htmlname.'">';
6272
+			$ret .= '<input type="hidden" name="token" value="'.newToken().'">';
6273 6273
 			if ($type) {
6274
-				$ret .= '<input type="hidden" name="type" value="' . dol_escape_htmltag($type) . '">';
6274
+				$ret .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">';
6275 6275
 			}
6276 6276
 			$ret .= '<table class="nobordernopadding">';
6277 6277
 			$ret .= '<tr><td>';
6278
-			$ret .= $this->selectDate($selected, $htmlname, $displayhour, $displaymin, 1, 'form' . $htmlname, 1, 0);
6278
+			$ret .= $this->selectDate($selected, $htmlname, $displayhour, $displaymin, 1, 'form'.$htmlname, 1, 0);
6279 6279
 			$ret .= '</td>';
6280
-			$ret .= '<td class="left"><input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '"></td>';
6280
+			$ret .= '<td class="left"><input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'"></td>';
6281 6281
 			$ret .= '</tr></table></form>';
6282 6282
 		} else {
6283 6283
 			if ($displayhour) {
@@ -6312,15 +6312,15 @@  discard block
 block discarded – undo
6312 6312
 		global $langs;
6313 6313
 
6314 6314
 		if ($htmlname != "none") {
6315
-			print '<form method="POST" action="' . $page . '" name="form' . $htmlname . '">';
6316
-			print '<input type="hidden" name="action" value="set' . $htmlname . '">';
6317
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
6315
+			print '<form method="POST" action="'.$page.'" name="form'.$htmlname.'">';
6316
+			print '<input type="hidden" name="action" value="set'.$htmlname.'">';
6317
+			print '<input type="hidden" name="token" value="'.newToken().'">';
6318 6318
 			print $this->select_dolusers($selected, $htmlname, 1, $exclude, 0, $include);
6319
-			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
6319
+			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
6320 6320
 			print '</form>';
6321 6321
 		} else {
6322 6322
 			if ($selected) {
6323
-				require_once DOL_DOCUMENT_ROOT . '/user/class/user.class.php';
6323
+				require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
6324 6324
 				$theuser = new User($this->db);
6325 6325
 				$theuser->fetch($selected);
6326 6326
 				print $theuser->getNomUrl(1);
@@ -6353,14 +6353,14 @@  discard block
 block discarded – undo
6353 6353
 
6354 6354
 		$out = '';
6355 6355
 		if ($htmlname != "none") {
6356
-			$out .= '<form method="POST" action="' . $page . '">';
6356
+			$out .= '<form method="POST" action="'.$page.'">';
6357 6357
 			$out .= '<input type="hidden" name="action" value="setmode">';
6358
-			$out .= '<input type="hidden" name="token" value="' . newToken() . '">';
6358
+			$out .= '<input type="hidden" name="token" value="'.newToken().'">';
6359 6359
 			if ($type) {
6360
-				$out .= '<input type="hidden" name="type" value="' . dol_escape_htmltag($type) . '">';
6360
+				$out .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">';
6361 6361
 			}
6362 6362
 			$out .= $this->select_types_paiements($selected, $htmlname, $filtertype, 0, $addempty, 0, 0, $active, '', 1);
6363
-			$out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
6363
+			$out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
6364 6364
 			$out .= '</form>';
6365 6365
 		} else {
6366 6366
 			if ($selected) {
@@ -6393,11 +6393,11 @@  discard block
 block discarded – undo
6393 6393
 	{
6394 6394
 		global $langs;
6395 6395
 		if ($htmlname != "none") {
6396
-			print '<form method="POST" action="' . $page . '">';
6396
+			print '<form method="POST" action="'.$page.'">';
6397 6397
 			print '<input type="hidden" name="action" value="settransportmode">';
6398
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
6398
+			print '<input type="hidden" name="token" value="'.newToken().'">';
6399 6399
 			$this->selectTransportMode($selected, $htmlname, 0, $addempty, 0, 0, $active);
6400
-			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
6400
+			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
6401 6401
 			print '</form>';
6402 6402
 		} else {
6403 6403
 			if ($selected) {
@@ -6424,14 +6424,14 @@  discard block
 block discarded – undo
6424 6424
 		// phpcs:enable
6425 6425
 		global $langs;
6426 6426
 		if ($htmlname != "none") {
6427
-			print '<form method="POST" action="' . $page . '">';
6427
+			print '<form method="POST" action="'.$page.'">';
6428 6428
 			print '<input type="hidden" name="action" value="setmulticurrencycode">';
6429
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
6429
+			print '<input type="hidden" name="token" value="'.newToken().'">';
6430 6430
 			print $this->selectMultiCurrency($selected, $htmlname, 0);
6431
-			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
6431
+			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
6432 6432
 			print '</form>';
6433 6433
 		} else {
6434
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
6434
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
6435 6435
 			print !empty($selected) ? currency_name($selected, 1) : '&nbsp;';
6436 6436
 		}
6437 6437
 	}
@@ -6453,22 +6453,22 @@  discard block
 block discarded – undo
6453 6453
 		global $langs, $mysoc, $conf;
6454 6454
 
6455 6455
 		if ($htmlname != "none") {
6456
-			print '<form method="POST" action="' . $page . '">';
6456
+			print '<form method="POST" action="'.$page.'">';
6457 6457
 			print '<input type="hidden" name="action" value="setmulticurrencyrate">';
6458
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
6459
-			print '<input type="text" class="maxwidth75" name="' . $htmlname . '" value="' . (!empty($rate) ? price(price2num($rate, 'CU')) : 1) . '" /> ';
6458
+			print '<input type="hidden" name="token" value="'.newToken().'">';
6459
+			print '<input type="text" class="maxwidth75" name="'.$htmlname.'" value="'.(!empty($rate) ? price(price2num($rate, 'CU')) : 1).'" /> ';
6460 6460
 			print '<select name="calculation_mode" id="calculation_mode">';
6461
-			print '<option value="1">Change ' . $langs->trans("PriceUHT") . ' of lines</option>';
6462
-			print '<option value="2">Change ' . $langs->trans("PriceUHTCurrency") . ' of lines</option>';
6461
+			print '<option value="1">Change '.$langs->trans("PriceUHT").' of lines</option>';
6462
+			print '<option value="2">Change '.$langs->trans("PriceUHTCurrency").' of lines</option>';
6463 6463
 			print '</select> ';
6464 6464
 			print ajax_combobox("calculation_mode");
6465
-			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
6465
+			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
6466 6466
 			print '</form>';
6467 6467
 		} else {
6468 6468
 			if (!empty($rate)) {
6469 6469
 				print price($rate, 1, $langs, 0, 0);
6470 6470
 				if ($currency && $rate != 1) {
6471
-					print ' &nbsp; <span class="opacitymedium">(' . price($rate, 1, $langs, 0, 0) . ' ' . $currency . ' = 1 ' . $conf->currency . ')</span>';
6471
+					print ' &nbsp; <span class="opacitymedium">('.price($rate, 1, $langs, 0, 0).' '.$currency.' = 1 '.$conf->currency.')</span>';
6472 6472
 				}
6473 6473
 			} else {
6474 6474
 				print 1;
@@ -6498,9 +6498,9 @@  discard block
 block discarded – undo
6498 6498
 		// phpcs:enable
6499 6499
 		global $conf, $langs;
6500 6500
 		if ($htmlname != "none") {
6501
-			print '<form method="post" action="' . $page . '">';
6501
+			print '<form method="post" action="'.$page.'">';
6502 6502
 			print '<input type="hidden" name="action" value="setabsolutediscount">';
6503
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
6503
+			print '<input type="hidden" name="token" value="'.newToken().'">';
6504 6504
 			print '<div class="inline-block">';
6505 6505
 			if (!empty($discount_type)) {
6506 6506
 				if (getDolGlobalString('FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS')) {
@@ -6538,24 +6538,24 @@  discard block
 block discarded – undo
6538 6538
 			print '</div>';
6539 6539
 			if (empty($hidelist)) {
6540 6540
 				print '<div class="inline-block" style="padding-right: 10px">';
6541
-				$newfilter = 'discount_type=' . intval($discount_type);
6541
+				$newfilter = 'discount_type='.intval($discount_type);
6542 6542
 				if (!empty($discount_type)) {
6543 6543
 					$newfilter .= ' AND fk_invoice_supplier IS NULL AND fk_invoice_supplier_line IS NULL'; // Supplier discounts available
6544 6544
 				} else {
6545 6545
 					$newfilter .= ' AND fk_facture IS NULL AND fk_facture_line IS NULL'; // Customer discounts available
6546 6546
 				}
6547 6547
 				if ($filter) {
6548
-					$newfilter .= ' AND (' . $filter . ')';
6548
+					$newfilter .= ' AND ('.$filter.')';
6549 6549
 				}
6550 6550
 				// output the combo of discounts
6551 6551
 				$nbqualifiedlines = $this->select_remises((string) $selected, $htmlname, $newfilter, $socid, $maxvalue);
6552 6552
 				if ($nbqualifiedlines > 0) {
6553
-					print ' &nbsp; <input type="submit" class="button smallpaddingimp" value="' . dol_escape_htmltag($langs->trans("UseLine")) . '"';
6553
+					print ' &nbsp; <input type="submit" class="button smallpaddingimp" value="'.dol_escape_htmltag($langs->trans("UseLine")).'"';
6554 6554
 					if (!empty($discount_type) && $filter && $filter != "fk_invoice_supplier_source IS NULL OR (description LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS PAID)%')") {
6555
-						print ' title="' . $langs->trans("UseCreditNoteInInvoicePayment") . '"';
6555
+						print ' title="'.$langs->trans("UseCreditNoteInInvoicePayment").'"';
6556 6556
 					}
6557 6557
 					if (empty($discount_type) && $filter && $filter != "fk_facture_source IS NULL OR (description LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS RECEIVED)%')") {
6558
-						print ' title="' . $langs->trans("UseCreditNoteInInvoicePayment") . '"';
6558
+						print ' title="'.$langs->trans("UseCreditNoteInInvoicePayment").'"';
6559 6559
 					}
6560 6560
 
6561 6561
 					print '>';
@@ -6595,23 +6595,23 @@  discard block
 block discarded – undo
6595 6595
 		global $langs;
6596 6596
 
6597 6597
 		if ($htmlname != "none") {
6598
-			print '<form method="post" action="' . $page . '">';
6598
+			print '<form method="post" action="'.$page.'">';
6599 6599
 			print '<input type="hidden" name="action" value="set_contact">';
6600
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
6600
+			print '<input type="hidden" name="token" value="'.newToken().'">';
6601 6601
 			print '<table class="nobordernopadding">';
6602 6602
 			print '<tr><td>';
6603 6603
 			print $this->selectcontacts($societe->id, $selected, $htmlname);
6604 6604
 			$num = $this->num;
6605 6605
 			if ($num == 0) {
6606 6606
 				$addcontact = (getDolGlobalString('SOCIETE_ADDRESSES_MANAGEMENT') ? $langs->trans("AddContact") : $langs->trans("AddContactAddress"));
6607
-				print '<a href="' . DOL_URL_ROOT . '/contact/card.php?socid=' . $societe->id . '&action=create&backtoreferer=1">' . $addcontact . '</a>';
6607
+				print '<a href="'.DOL_URL_ROOT.'/contact/card.php?socid='.$societe->id.'&action=create&backtoreferer=1">'.$addcontact.'</a>';
6608 6608
 			}
6609 6609
 			print '</td>';
6610
-			print '<td class="left"><input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '"></td>';
6610
+			print '<td class="left"><input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'"></td>';
6611 6611
 			print '</tr></table></form>';
6612 6612
 		} else {
6613 6613
 			if ($selected) {
6614
-				require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php';
6614
+				require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
6615 6615
 				$contact = new Contact($this->db);
6616 6616
 				$contact->fetch($selected);
6617 6617
 				print $contact->getFullName($langs);
@@ -6646,20 +6646,20 @@  discard block
 block discarded – undo
6646 6646
 
6647 6647
 		$out = '';
6648 6648
 		if ($htmlname != "none") {
6649
-			$out .= '<form method="post" action="' . $page . '">';
6649
+			$out .= '<form method="post" action="'.$page.'">';
6650 6650
 			$out .= '<input type="hidden" name="action" value="set_thirdparty">';
6651
-			$out .= '<input type="hidden" name="token" value="' . newToken() . '">';
6651
+			$out .= '<input type="hidden" name="token" value="'.newToken().'">';
6652 6652
 			$out .= $this->select_company($selected, $htmlname, $filter, $showempty, $showtype, $forcecombo, $events, 0, 'minwidth100', '', '', 1, array(), false, $excludeids);
6653
-			$out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
6653
+			$out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
6654 6654
 			$out .= '</form>';
6655 6655
 		} else {
6656 6656
 			if ($selected) {
6657
-				require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
6657
+				require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
6658 6658
 				$soc = new Societe($this->db);
6659 6659
 				$soc->fetch($selected);
6660 6660
 				$out .= $soc->getNomUrl(0, '');
6661 6661
 			} else {
6662
-				$out .= '<span class="opacitymedium">' . $textifnothirdparty . '</span>';
6662
+				$out .= '<span class="opacitymedium">'.$textifnothirdparty.'</span>';
6663 6663
 			}
6664 6664
 		}
6665 6665
 
@@ -6709,22 +6709,22 @@  discard block
 block discarded – undo
6709 6709
 			$selected = 'EUR'; // Pour compatibilite
6710 6710
 		}
6711 6711
 
6712
-		$out .= '<select class="flat maxwidth200onsmartphone minwidth300" name="' . $htmlname . '" id="' . $htmlname . '">';
6712
+		$out .= '<select class="flat maxwidth200onsmartphone minwidth300" name="'.$htmlname.'" id="'.$htmlname.'">';
6713 6713
 		if ($useempty) {
6714 6714
 			$out .= '<option value="-1" selected></option>';
6715 6715
 		}
6716 6716
 		foreach ($langs->cache_currencies as $code_iso => $currency) {
6717 6717
 			$labeltoshow = $currency['label'];
6718 6718
 			if ($mode == 1) {
6719
-				$labeltoshow .= ' <span class="opacitymedium">(' . $code_iso . ')</span>';
6719
+				$labeltoshow .= ' <span class="opacitymedium">('.$code_iso.')</span>';
6720 6720
 			} else {
6721
-				$labeltoshow .= ' <span class="opacitymedium">(' . $langs->getCurrencySymbol($code_iso) . ')</span>';
6721
+				$labeltoshow .= ' <span class="opacitymedium">('.$langs->getCurrencySymbol($code_iso).')</span>';
6722 6722
 			}
6723 6723
 
6724 6724
 			if ($selected && $selected == $code_iso) {
6725
-				$out .= '<option value="' . $code_iso . '" selected data-html="' . dol_escape_htmltag($labeltoshow) . '">';
6725
+				$out .= '<option value="'.$code_iso.'" selected data-html="'.dol_escape_htmltag($labeltoshow).'">';
6726 6726
 			} else {
6727
-				$out .= '<option value="' . $code_iso . '" data-html="' . dol_escape_htmltag($labeltoshow) . '">';
6727
+				$out .= '<option value="'.$code_iso.'" data-html="'.dol_escape_htmltag($labeltoshow).'">';
6728 6728
 			}
6729 6729
 			$out .= dol_string_nohtmltag($labeltoshow);
6730 6730
 			$out .= '</option>';
@@ -6735,7 +6735,7 @@  discard block
 block discarded – undo
6735 6735
 		}
6736 6736
 
6737 6737
 		// Make select dynamic
6738
-		include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
6738
+		include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
6739 6739
 		$out .= ajax_combobox($htmlname);
6740 6740
 
6741 6741
 		return $out;
@@ -6761,10 +6761,10 @@  discard block
 block discarded – undo
6761 6761
 
6762 6762
 		$TCurrency = array();
6763 6763
 
6764
-		$sql = "SELECT code FROM " . $this->db->prefix() . "multicurrency";
6765
-		$sql .= " WHERE entity IN ('" . getEntity('mutlicurrency') . "')";
6764
+		$sql = "SELECT code FROM ".$this->db->prefix()."multicurrency";
6765
+		$sql .= " WHERE entity IN ('".getEntity('mutlicurrency')."')";
6766 6766
 		if ($filter) {
6767
-			$sql .= " AND " . $filter;
6767
+			$sql .= " AND ".$filter;
6768 6768
 		}
6769 6769
 		$resql = $this->db->query($sql);
6770 6770
 		if ($resql) {
@@ -6774,7 +6774,7 @@  discard block
 block discarded – undo
6774 6774
 		}
6775 6775
 
6776 6776
 		$out = '';
6777
-		$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
6777
+		$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
6778 6778
 		if ($useempty) {
6779 6779
 			$out .= '<option value="">&nbsp;</option>';
6780 6780
 		}
@@ -6786,13 +6786,13 @@  discard block
 block discarded – undo
6786 6786
 			foreach ($langs->cache_currencies as $code_iso => $currency) {
6787 6787
 				if (isset($TCurrency[$code_iso])) {
6788 6788
 					if (!empty($selected) && $selected == $code_iso) {
6789
-						$out .= '<option value="' . $code_iso . '" selected="selected">';
6789
+						$out .= '<option value="'.$code_iso.'" selected="selected">';
6790 6790
 					} else {
6791
-						$out .= '<option value="' . $code_iso . '">';
6791
+						$out .= '<option value="'.$code_iso.'">';
6792 6792
 					}
6793 6793
 
6794 6794
 					$out .= $currency['label'];
6795
-					$out .= ' (' . $langs->getCurrencySymbol($code_iso) . ')';
6795
+					$out .= ' ('.$langs->getCurrencySymbol($code_iso).')';
6796 6796
 					$out .= '</option>';
6797 6797
 				}
6798 6798
 			}
@@ -6801,7 +6801,7 @@  discard block
 block discarded – undo
6801 6801
 		$out .= '</select>';
6802 6802
 
6803 6803
 		// Make select dynamic
6804
-		include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
6804
+		include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
6805 6805
 		$out .= ajax_combobox($htmlname);
6806 6806
 
6807 6807
 		return $out;
@@ -6832,7 +6832,7 @@  discard block
 block discarded – undo
6832 6832
 		$sql .= " WHERE t.fk_pays = c.rowid";
6833 6833
 		$sql .= " AND t.active > 0";
6834 6834
 		$sql .= " AND t.entity IN (".getEntity('c_tva').")";
6835
-		$sql .= " AND c.code IN (" . $this->db->sanitize($country_code, 1) . ")";
6835
+		$sql .= " AND c.code IN (".$this->db->sanitize($country_code, 1).")";
6836 6836
 		$sql .= " ORDER BY t.code ASC, t.taux ASC, t.recuperableonly ASC";
6837 6837
 
6838 6838
 		$resql = $this->db->query($sql);
@@ -6844,30 +6844,30 @@  discard block
 block discarded – undo
6844 6844
 
6845 6845
 					$tmparray = array();
6846 6846
 					$tmparray['rowid']			= $obj->rowid;
6847
-					$tmparray['type_vat']		= $obj->type_vat;
6848
-					$tmparray['code']			= $obj->code;
6847
+					$tmparray['type_vat'] = $obj->type_vat;
6848
+					$tmparray['code'] = $obj->code;
6849 6849
 					$tmparray['txtva']			= $obj->taux;
6850
-					$tmparray['nprtva']			= $obj->recuperableonly;
6850
+					$tmparray['nprtva'] = $obj->recuperableonly;
6851 6851
 					$tmparray['localtax1']	    = $obj->localtax1;
6852 6852
 					$tmparray['localtax1_type']	= $obj->localtax1_type;
6853 6853
 					$tmparray['localtax2']	    = $obj->localtax2;
6854 6854
 					$tmparray['localtax2_type']	= $obj->localtax1_type;
6855
-					$tmparray['label']			= $obj->taux . '%' . ($obj->code ? ' (' . $obj->code . ')' : ''); // Label must contains only 0-9 , . % or *
6856
-					$tmparray['labelallrates']	= $obj->taux . '/' . ($obj->localtax1 ? $obj->localtax1 : '0') . '/' . ($obj->localtax2 ? $obj->localtax2 : '0') . ($obj->code ? ' (' . $obj->code . ')' : ''); // Must never be used as key, only label
6855
+					$tmparray['label'] = $obj->taux.'%'.($obj->code ? ' ('.$obj->code.')' : ''); // Label must contains only 0-9 , . % or *
6856
+					$tmparray['labelallrates']	= $obj->taux.'/'.($obj->localtax1 ? $obj->localtax1 : '0').'/'.($obj->localtax2 ? $obj->localtax2 : '0').($obj->code ? ' ('.$obj->code.')' : ''); // Must never be used as key, only label
6857 6857
 					$positiverates = '';
6858 6858
 					if ($obj->taux) {
6859
-						$positiverates .= ($positiverates ? '/' : '') . $obj->taux;
6859
+						$positiverates .= ($positiverates ? '/' : '').$obj->taux;
6860 6860
 					}
6861 6861
 					if ($obj->localtax1) {
6862
-						$positiverates .= ($positiverates ? '/' : '') . $obj->localtax1;
6862
+						$positiverates .= ($positiverates ? '/' : '').$obj->localtax1;
6863 6863
 					}
6864 6864
 					if ($obj->localtax2) {
6865
-						$positiverates .= ($positiverates ? '/' : '') . $obj->localtax2;
6865
+						$positiverates .= ($positiverates ? '/' : '').$obj->localtax2;
6866 6866
 					}
6867 6867
 					if (empty($positiverates)) {
6868 6868
 						$positiverates = '0';
6869 6869
 					}
6870
-					$tmparray['labelpositiverates'] = $positiverates . ($obj->code ? ' (' . $obj->code . ')' : ''); // Must never be used as key, only label
6870
+					$tmparray['labelpositiverates'] = $positiverates.($obj->code ? ' ('.$obj->code.')' : ''); // Must never be used as key, only label
6871 6871
 
6872 6872
 					$this->cache_vatrates[$obj->rowid] = $tmparray;
6873 6873
 				}
@@ -6887,7 +6887,7 @@  discard block
 block discarded – undo
6887 6887
 				return -1;
6888 6888
 			}
6889 6889
 		} else {
6890
-			$this->error = '<span class="error">' . $this->db->error() . '</span>';
6890
+			$this->error = '<span class="error">'.$this->db->error().'</span>';
6891 6891
 			return -2;
6892 6892
 		}
6893 6893
 	}
@@ -6959,9 +6959,9 @@  discard block
 block discarded – undo
6959 6959
 		// Check parameters
6960 6960
 		if (is_object($societe_vendeuse) && !$societe_vendeuse->country_code) {
6961 6961
 			if ($societe_vendeuse->id == $mysoc->id) {
6962
-				$return .= '<span class="error">' . $langs->trans("ErrorYourCountryIsNotDefined") . '</span>';
6962
+				$return .= '<span class="error">'.$langs->trans("ErrorYourCountryIsNotDefined").'</span>';
6963 6963
 			} else {
6964
-				$return .= '<span class="error">' . $langs->trans("ErrorSupplierCountryIsNotDefined") . '</span>';
6964
+				$return .= '<span class="error">'.$langs->trans("ErrorSupplierCountryIsNotDefined").'</span>';
6965 6965
 			}
6966 6966
 			return $return;
6967 6967
 		}
@@ -6973,12 +6973,12 @@  discard block
 block discarded – undo
6973 6973
 		// Define list of countries to use to search VAT rates to show
6974 6974
 		// First we defined code_country to use to find list
6975 6975
 		if (is_object($societe_vendeuse)) {
6976
-			$code_country = "'" . $societe_vendeuse->country_code . "'";
6976
+			$code_country = "'".$societe_vendeuse->country_code."'";
6977 6977
 		} else {
6978
-			$code_country = "'" . $mysoc->country_code . "'"; // Pour compatibilite ascendente
6978
+			$code_country = "'".$mysoc->country_code."'"; // Pour compatibilite ascendente
6979 6979
 		}
6980 6980
 		if (getDolGlobalString('SERVICE_ARE_ECOMMERCE_200238EC')) {    // If option to have vat for end customer for services is on
6981
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
6981
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
6982 6982
 			// If SERVICE_ARE_ECOMMERCE_200238EC=1 combo list vat rate of purchaser and seller countries
6983 6983
 			// If SERVICE_ARE_ECOMMERCE_200238EC=2 combo list only the vat rate of the purchaser country
6984 6984
 			$selectVatComboMode = getDolGlobalString('SERVICE_ARE_ECOMMERCE_200238EC');
@@ -6988,27 +6988,27 @@  discard block
 block discarded – undo
6988 6988
 					if ($type == 1) { // We know product is a service
6989 6989
 						switch ($selectVatComboMode) {
6990 6990
 							case '1':
6991
-								$code_country .= ",'" . $societe_acheteuse->country_code . "'";
6991
+								$code_country .= ",'".$societe_acheteuse->country_code."'";
6992 6992
 								break;
6993 6993
 							case '2':
6994
-								$code_country = "'" . $societe_acheteuse->country_code . "'";
6994
+								$code_country = "'".$societe_acheteuse->country_code."'";
6995 6995
 								break;
6996 6996
 						}
6997 6997
 					}
6998 6998
 				} elseif (!$idprod) {  // We don't know type of product
6999 6999
 					switch ($selectVatComboMode) {
7000 7000
 						case '1':
7001
-							$code_country .= ",'" . $societe_acheteuse->country_code . "'";
7001
+							$code_country .= ",'".$societe_acheteuse->country_code."'";
7002 7002
 							break;
7003 7003
 						case '2':
7004
-							$code_country = "'" . $societe_acheteuse->country_code . "'";
7004
+							$code_country = "'".$societe_acheteuse->country_code."'";
7005 7005
 							break;
7006 7006
 					}
7007 7007
 				} else {
7008 7008
 					$prodstatic = new Product($this->db);
7009 7009
 					$prodstatic->fetch($idprod);
7010 7010
 					if ($prodstatic->type == Product::TYPE_SERVICE) {   // We know product is a service
7011
-						$code_country .= ",'" . $societe_acheteuse->country_code . "'";
7011
+						$code_country .= ",'".$societe_acheteuse->country_code."'";
7012 7012
 					}
7013 7013
 				}
7014 7014
 			}
@@ -7070,13 +7070,13 @@  discard block
 block discarded – undo
7070 7070
 				// Override/enable VAT for expense report regardless of global setting - needed if expense report used for business expenses instead
7071 7071
 				// of using supplier invoices (this is a very bad idea !)
7072 7072
 				if (!getDolGlobalString('EXPENSEREPORT_OVERRIDE_VAT')) {
7073
-					$title = ' title="' . dol_escape_htmltag($langs->trans('VATIsNotUsed')) . '"';
7073
+					$title = ' title="'.dol_escape_htmltag($langs->trans('VATIsNotUsed')).'"';
7074 7074
 					$disabled = true;
7075 7075
 				}
7076 7076
 			}
7077 7077
 
7078 7078
 			if (!$options_only) {
7079
-				$return .= '<select class="flat minwidth75imp maxwidth100 right" id="' . $htmlname . '" name="' . $htmlname . '"' . ($disabled ? ' disabled' : '') . $title . '>';
7079
+				$return .= '<select class="flat minwidth75imp maxwidth100 right" id="'.$htmlname.'" name="'.$htmlname.'"'.($disabled ? ' disabled' : '').$title.'>';
7080 7080
 			}
7081 7081
 
7082 7082
 			$selectedfound = false;
@@ -7090,13 +7090,13 @@  discard block
 block discarded – undo
7090 7090
 				$key = $rate['txtva'];
7091 7091
 				$key .= $rate['nprtva'] ? '*' : '';
7092 7092
 				if ($mode > 0 && $rate['code']) {
7093
-					$key .= ' (' . $rate['code'] . ')';
7093
+					$key .= ' ('.$rate['code'].')';
7094 7094
 				}
7095 7095
 				if ($mode < 0) {
7096 7096
 					$key = $rate['rowid'];
7097 7097
 				}
7098 7098
 
7099
-				$return .= '<option value="' . $key . '"';
7099
+				$return .= '<option value="'.$key.'"';
7100 7100
 				if (!$selectedfound) {
7101 7101
 					if ($defaultcode) { // If defaultcode is defined, we used it in priority to select combo option instead of using rate+npr flag
7102 7102
 						if ($defaultcode == $rate['code']) {
@@ -7167,7 +7167,7 @@  discard block
 block discarded – undo
7167 7167
 	public function select_date($set_time = '', $prefix = 're', $h = 0, $m = 0, $empty = 0, $form_name = "", $d = 1, $addnowlink = 0, $nooutput = 0, $disabled = 0, $fullday = 0, $addplusone = '', $adddateof = '')
7168 7168
 	{
7169 7169
 		// phpcs:enable
7170
-		dol_syslog(__METHOD__ . ': using select_date is deprecated. Use selectDate instead.', LOG_WARNING);
7170
+		dol_syslog(__METHOD__.': using select_date is deprecated. Use selectDate instead.', LOG_WARNING);
7171 7171
 		$retstring = $this->selectDate($set_time, $prefix, $h, $m, $empty, $form_name, $d, $addnowlink, $disabled, $fullday, $addplusone, $adddateof);
7172 7172
 		if (!empty($nooutput)) {
7173 7173
 			return $retstring;
@@ -7196,11 +7196,11 @@  discard block
 block discarded – undo
7196 7196
 	{
7197 7197
 		global $langs;
7198 7198
 
7199
-		$ret = $this->selectDate($set_time, $prefix . '_start', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("from"), 'tzuserrel');
7199
+		$ret = $this->selectDate($set_time, $prefix.'_start', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("from"), 'tzuserrel');
7200 7200
 		if ($forcenewline) {
7201 7201
 			$ret .= '<br>';
7202 7202
 		}
7203
-		$ret .= $this->selectDate($set_time_end, $prefix . '_end', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"), 'tzuserrel');
7203
+		$ret .= $this->selectDate($set_time_end, $prefix.'_end', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"), 'tzuserrel');
7204 7204
 		return $ret;
7205 7205
 	}
7206 7206
 
@@ -7267,7 +7267,7 @@  discard block
 block discarded – undo
7267 7267
 		$orig_set_time = $set_time;
7268 7268
 
7269 7269
 		if ($set_time === '' && $emptydate == 0) {
7270
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
7270
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
7271 7271
 			if ($gm == 'tzuser' || $gm == 'tzuserrel') {
7272 7272
 				$set_time = dol_now($gm);
7273 7273
 			} else {
@@ -7339,38 +7339,38 @@  discard block
 block discarded – undo
7339 7339
 				// Calendrier popup version eldy
7340 7340
 				if ($usecalendar == "eldy") {
7341 7341
 					// Input area to enter date manually
7342
-					$retstring .= '<input id="' . $prefix . '" name="' . $prefix . '" type="text" class="maxwidthdate center" maxlength="11" value="' . $formatted_date . '"';
7342
+					$retstring .= '<input id="'.$prefix.'" name="'.$prefix.'" type="text" class="maxwidthdate center" maxlength="11" value="'.$formatted_date.'"';
7343 7343
 					$retstring .= ($disabled ? ' disabled' : '');
7344
-					$retstring .= ' onChange="dpChangeDay(\'' . dol_escape_js($prefix) . '\',\'' . dol_escape_js($langs->trans("FormatDateShortJavaInput")) . '\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript
7344
+					$retstring .= ' onChange="dpChangeDay(\''.dol_escape_js($prefix).'\',\''.dol_escape_js($langs->trans("FormatDateShortJavaInput")).'\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript
7345 7345
 					$retstring .= ' autocomplete="off">';
7346 7346
 
7347 7347
 					// Icon calendar
7348 7348
 					$retstringbuttom = '';
7349 7349
 					if (!$disabled) {
7350
-						$retstringbuttom = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons"';
7351
-						$base = DOL_URL_ROOT . '/core/';
7352
-						$retstringbuttom .= ' onClick="showDP(\'' . dol_escape_js($base) . '\',\'' . dol_escape_js($prefix) . '\',\'' . dol_escape_js($langs->trans("FormatDateShortJavaInput")) . '\',\'' . dol_escape_js($langs->defaultlang) . '\');"';
7353
-						$retstringbuttom .= '>' . img_object($langs->trans("SelectDate"), 'calendarday', 'class="datecallink"') . '</button>';
7350
+						$retstringbuttom = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons"';
7351
+						$base = DOL_URL_ROOT.'/core/';
7352
+						$retstringbuttom .= ' onClick="showDP(\''.dol_escape_js($base).'\',\''.dol_escape_js($prefix).'\',\''.dol_escape_js($langs->trans("FormatDateShortJavaInput")).'\',\''.dol_escape_js($langs->defaultlang).'\');"';
7353
+						$retstringbuttom .= '>'.img_object($langs->trans("SelectDate"), 'calendarday', 'class="datecallink"').'</button>';
7354 7354
 					} else {
7355
-						$retstringbuttom = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons">' . img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"') . '</button>';
7355
+						$retstringbuttom = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons">'.img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"').'</button>';
7356 7356
 					}
7357
-					$retstring = $retstringbuttom . $retstring;
7357
+					$retstring = $retstringbuttom.$retstring;
7358 7358
 
7359
-					$retstring .= '<input type="hidden" id="' . $prefix . 'day"   name="' . $prefix . 'day"   value="' . $sday . '">' . "\n";
7360
-					$retstring .= '<input type="hidden" id="' . $prefix . 'month" name="' . $prefix . 'month" value="' . $smonth . '">' . "\n";
7361
-					$retstring .= '<input type="hidden" id="' . $prefix . 'year"  name="' . $prefix . 'year"  value="' . $syear . '">' . "\n";
7359
+					$retstring .= '<input type="hidden" id="'.$prefix.'day"   name="'.$prefix.'day"   value="'.$sday.'">'."\n";
7360
+					$retstring .= '<input type="hidden" id="'.$prefix.'month" name="'.$prefix.'month" value="'.$smonth.'">'."\n";
7361
+					$retstring .= '<input type="hidden" id="'.$prefix.'year"  name="'.$prefix.'year"  value="'.$syear.'">'."\n";
7362 7362
 				} elseif ($usecalendar == 'jquery' || $usecalendar == 'html') {
7363 7363
 					if (!$disabled && $usecalendar != 'html') {
7364 7364
 						// Output javascript for datepicker
7365 7365
 						$minYear = getDolGlobalInt('MIN_YEAR_SELECT_DATE', (idate('Y') - 100));
7366 7366
 						$maxYear = getDolGlobalInt('MAX_YEAR_SELECT_DATE', (idate('Y') + 100));
7367 7367
 
7368
-						$retstring .= '<script nonce="' . getNonce() . '" type="text/javascript">';
7369
-						$retstring .= "$(function(){ $('#" . $prefix . "').datepicker({
7370
-							dateFormat: '" . $langs->trans("FormatDateShortJQueryInput") . "',
7368
+						$retstring .= '<script nonce="'.getNonce().'" type="text/javascript">';
7369
+						$retstring .= "$(function(){ $('#".$prefix."').datepicker({
7370
+							dateFormat: '" . $langs->trans("FormatDateShortJQueryInput")."',
7371 7371
 							autoclose: true,
7372 7372
 							todayHighlight: true,
7373
-							yearRange: '" . $minYear . ":" . $maxYear . "',";
7373
+							yearRange: '" . $minYear.":".$maxYear."',";
7374 7374
 						if (!empty($conf->dol_use_jmobile)) {
7375 7375
 							$retstring .= "
7376 7376
 								beforeShow: function (input, datePicker) {
@@ -7383,10 +7383,10 @@  discard block
 block discarded – undo
7383 7383
 						}
7384 7384
 						// Note: We don't need monthNames, monthNamesShort, dayNames, dayNamesShort, dayNamesMin, they are set globally on datepicker component in lib_head.js.php
7385 7385
 						if (!getDolGlobalString('MAIN_POPUP_CALENDAR_ON_FOCUS')) {
7386
-							$buttonImage = $calendarpicto ?: DOL_URL_ROOT . "/theme/" . dol_escape_js($conf->theme) . "/img/object_calendarday.png";
7386
+							$buttonImage = $calendarpicto ?: DOL_URL_ROOT."/theme/".dol_escape_js($conf->theme)."/img/object_calendarday.png";
7387 7387
 							$retstring .= "
7388 7388
 								showOn: 'button',	/* both has problem with autocompletion */
7389
-								buttonImage: '" . $buttonImage . "',
7389
+								buttonImage: '" . $buttonImage."',
7390 7390
 								buttonImageOnly: true";
7391 7391
 						}
7392 7392
 						$retstring .= "
@@ -7398,46 +7398,46 @@  discard block
 block discarded – undo
7398 7398
 					$retstring .= '<div class="nowraponall inline-block divfordateinput">';
7399 7399
 					$retstring .= '<input id="'.$prefix.'" name="'.$prefix.'" type="'.($usecalendar == 'html' ? "date" : "text").'" class="maxwidthdate center" maxlength="11" value="'.$formatted_date.'"';
7400 7400
 					$retstring .= ($disabled ? ' disabled' : '');
7401
-					$retstring .= ($placeholder ? ' placeholder="' . dol_escape_htmltag($placeholder) . '"' : '');
7402
-					$retstring .= ' onChange="dpChangeDay(\'' . dol_escape_js($prefix) . '\',\'' . dol_escape_js($langs->trans("FormatDateShortJavaInput")) . '\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript
7401
+					$retstring .= ($placeholder ? ' placeholder="'.dol_escape_htmltag($placeholder).'"' : '');
7402
+					$retstring .= ' onChange="dpChangeDay(\''.dol_escape_js($prefix).'\',\''.dol_escape_js($langs->trans("FormatDateShortJavaInput")).'\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript
7403 7403
 					$retstring .= ' autocomplete="off">';
7404 7404
 
7405 7405
 					// Icone calendrier
7406 7406
 					if ($disabled) {
7407
-						$retstringbutton = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons">' . img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"') . '</button>';
7408
-						$retstring = $retstringbutton . $retstring;
7407
+						$retstringbutton = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons">'.img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"').'</button>';
7408
+						$retstring = $retstringbutton.$retstring;
7409 7409
 					}
7410 7410
 
7411 7411
 					$retstring .= '</div>';
7412
-					$retstring .= '<input type="hidden" id="' . $prefix . 'day"   name="' . $prefix . 'day"   value="' . $sday . '">' . "\n";
7413
-					$retstring .= '<input type="hidden" id="' . $prefix . 'month" name="' . $prefix . 'month" value="' . $smonth . '">' . "\n";
7414
-					$retstring .= '<input type="hidden" id="' . $prefix . 'year"  name="' . $prefix . 'year"  value="' . $syear . '">' . "\n";
7412
+					$retstring .= '<input type="hidden" id="'.$prefix.'day"   name="'.$prefix.'day"   value="'.$sday.'">'."\n";
7413
+					$retstring .= '<input type="hidden" id="'.$prefix.'month" name="'.$prefix.'month" value="'.$smonth.'">'."\n";
7414
+					$retstring .= '<input type="hidden" id="'.$prefix.'year"  name="'.$prefix.'year"  value="'.$syear.'">'."\n";
7415 7415
 				} else {
7416 7416
 					$retstring .= "Bad value of MAIN_POPUP_CALENDAR";
7417 7417
 				}
7418 7418
 			} else {
7419 7419
 				// Show date with combo selects
7420 7420
 				// Day
7421
-				$retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth50imp" id="' . $prefix . 'day" name="' . $prefix . 'day">';
7421
+				$retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50imp" id="'.$prefix.'day" name="'.$prefix.'day">';
7422 7422
 
7423 7423
 				if ($emptydate || $set_time == -1) {
7424 7424
 					$retstring .= '<option value="0" selected>&nbsp;</option>';
7425 7425
 				}
7426 7426
 
7427 7427
 				for ($day = 1; $day <= 31; $day++) {
7428
-					$retstring .= '<option value="' . $day . '"' . ($day == $sday ? ' selected' : '') . '>' . $day . '</option>';
7428
+					$retstring .= '<option value="'.$day.'"'.($day == $sday ? ' selected' : '').'>'.$day.'</option>';
7429 7429
 				}
7430 7430
 
7431 7431
 				$retstring .= "</select>";
7432 7432
 
7433
-				$retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth75imp" id="' . $prefix . 'month" name="' . $prefix . 'month">';
7433
+				$retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth75imp" id="'.$prefix.'month" name="'.$prefix.'month">';
7434 7434
 				if ($emptydate || $set_time == -1) {
7435 7435
 					$retstring .= '<option value="0" selected>&nbsp;</option>';
7436 7436
 				}
7437 7437
 
7438 7438
 				// Month
7439 7439
 				for ($month = 1; $month <= 12; $month++) {
7440
-					$retstring .= '<option value="' . $month . '"' . ($month == $smonth ? ' selected' : '') . '>';
7440
+					$retstring .= '<option value="'.$month.'"'.($month == $smonth ? ' selected' : '').'>';
7441 7441
 					$retstring .= dol_print_date(mktime(12, 0, 0, $month, 1, 2000), "%b");
7442 7442
 					$retstring .= "</option>";
7443 7443
 				}
@@ -7445,13 +7445,13 @@  discard block
 block discarded – undo
7445 7445
 
7446 7446
 				// Year
7447 7447
 				if ($emptydate || $set_time == -1) {
7448
-					$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 . '">';
7448
+					$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.'">';
7449 7449
 				} else {
7450
-					$retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth75imp" id="' . $prefix . 'year" name="' . $prefix . 'year">';
7450
+					$retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth75imp" id="'.$prefix.'year" name="'.$prefix.'year">';
7451 7451
 
7452 7452
 					$syear = (int) $syear;
7453 7453
 					for ($year = $syear - 10; $year < (int) $syear + 10; $year++) {
7454
-						$retstring .= '<option value="' . $year . '"' . ($year == $syear ? ' selected' : '') . '>' . $year . '</option>';
7454
+						$retstring .= '<option value="'.$year.'"'.($year == $syear ? ' selected' : '').'>'.$year.'</option>';
7455 7455
 					}
7456 7456
 					$retstring .= "</select>\n";
7457 7457
 				}
@@ -7476,15 +7476,15 @@  discard block
 block discarded – undo
7476 7476
 			}
7477 7477
 
7478 7478
 			// Show hour
7479
-			$retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth50 ' . ($fullday ? $fullday . 'hour' : '') . '" id="' . $prefix . 'hour" name="' . $prefix . 'hour">';
7479
+			$retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50 '.($fullday ? $fullday.'hour' : '').'" id="'.$prefix.'hour" name="'.$prefix.'hour">';
7480 7480
 			if ($emptyhours) {
7481 7481
 				$retstring .= '<option value="-1">&nbsp;</option>';
7482 7482
 			}
7483 7483
 			for ($hour = $hourstart; $hour < $hourend; $hour++) {
7484 7484
 				if (strlen($hour) < 2) {
7485
-					$hour = "0" . $hour;
7485
+					$hour = "0".$hour;
7486 7486
 				}
7487
-				$retstring .= '<option value="' . $hour . '"' . (($hour == $shour) ? ' selected' : '') . '>' . $hour;
7487
+				$retstring .= '<option value="'.$hour.'"'.(($hour == $shour) ? ' selected' : '').'>'.$hour;
7488 7488
 				//$retstring .= (empty($conf->dol_optimize_smallscreen) ? '' : 'H');
7489 7489
 				$retstring .= '</option>';
7490 7490
 			}
@@ -7497,17 +7497,17 @@  discard block
 block discarded – undo
7497 7497
 
7498 7498
 		if ($m) {
7499 7499
 			// Show minutes
7500
-			$retstring .= '<select ' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth50 ' . ($fullday ? $fullday . 'min' : '') . '" id="' . $prefix . 'min" name="' . $prefix . 'min">';
7500
+			$retstring .= '<select '.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50 '.($fullday ? $fullday.'min' : '').'" id="'.$prefix.'min" name="'.$prefix.'min">';
7501 7501
 			if ($emptyhours) {
7502 7502
 				$retstring .= '<option value="-1">&nbsp;</option>';
7503 7503
 			}
7504 7504
 			for ($min = 0; $min < 60; $min += $stepminutes) {
7505 7505
 				$min_str = sprintf("%02d", $min);
7506
-				$retstring .= '<option value="' . $min_str . '"' . (($min_str == $smin) ? ' selected' : '') . '>' . $min_str . '</option>';
7506
+				$retstring .= '<option value="'.$min_str.'"'.(($min_str == $smin) ? ' selected' : '').'>'.$min_str.'</option>';
7507 7507
 			}
7508 7508
 			$retstring .= '</select>';
7509 7509
 
7510
-			$retstring .= '<input type="hidden" name="' . $prefix . 'sec" value="' . $ssec . '">';
7510
+			$retstring .= '<input type="hidden" name="'.$prefix.'sec" value="'.$ssec.'">';
7511 7511
 		}
7512 7512
 
7513 7513
 		if ($d && $h) {
@@ -7530,10 +7530,10 @@  discard block
 block discarded – undo
7530 7530
 
7531 7531
 			// Generate the date part, depending on the use or not of the javascript calendar
7532 7532
 			if ($addnowlink == 1) { // server time expressed in user time setup
7533
-				$reset_scripts .= 'jQuery(\'#' . $prefix . '\').val(\'' . dol_print_date($nowgmt, 'day', 'tzuserrel') . '\');';
7534
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'day\').val(\'' . dol_print_date($nowgmt, '%d', 'tzuserrel') . '\');';
7535
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'month\').val(\'' . dol_print_date($nowgmt, '%m', 'tzuserrel') . '\');';
7536
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'year\').val(\'' . dol_print_date($nowgmt, '%Y', 'tzuserrel') . '\');';
7533
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'day', 'tzuserrel').'\');';
7534
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');';
7535
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');';
7536
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');';
7537 7537
 			} elseif ($addnowlink == 2) {
7538 7538
 				/* Disabled because the output does not use the string format defined by FormatDateShort key to forge the value into #prefix.
7539 7539
 				 * This break application for foreign languages.
@@ -7542,10 +7542,10 @@  discard block
 block discarded – undo
7542 7542
 				$reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(parseInt(d.getMonth().pad()) + 1);';
7543 7543
 				$reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(d.getFullYear());';
7544 7544
 				*/
7545
-				$reset_scripts .= 'jQuery(\'#' . $prefix . '\').val(\'' . dol_print_date($nowgmt, 'day', 'tzuserrel') . '\');';
7546
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'day\').val(\'' . dol_print_date($nowgmt, '%d', 'tzuserrel') . '\');';
7547
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'month\').val(\'' . dol_print_date($nowgmt, '%m', 'tzuserrel') . '\');';
7548
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'year\').val(\'' . dol_print_date($nowgmt, '%Y', 'tzuserrel') . '\');';
7545
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'day', 'tzuserrel').'\');';
7546
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');';
7547
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');';
7548
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');';
7549 7549
 			}
7550 7550
 			/*if ($usecalendar == "eldy")
7551 7551
 			{
@@ -7565,11 +7565,11 @@  discard block
 block discarded – undo
7565 7565
 				}
7566 7566
 				//$reset_scripts .= 'this.form.elements[\''.$prefix.'hour\'].value=formatDate(new Date(), \'HH\'); ';
7567 7567
 				if ($addnowlink == 1) {
7568
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').val(\'' . dol_print_date($nowgmt, '%H', 'tzuserrel') . '\');';
7569
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').change();';
7568
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(\''.dol_print_date($nowgmt, '%H', 'tzuserrel').'\');';
7569
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').change();';
7570 7570
 				} elseif ($addnowlink == 2) {
7571
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').val(d.getHours().pad());';
7572
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').change();';
7571
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(d.getHours().pad());';
7572
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').change();';
7573 7573
 				}
7574 7574
 
7575 7575
 				if ($fullday) {
@@ -7583,11 +7583,11 @@  discard block
 block discarded – undo
7583 7583
 				}
7584 7584
 				//$reset_scripts .= 'this.form.elements[\''.$prefix.'min\'].value=formatDate(new Date(), \'mm\'); ';
7585 7585
 				if ($addnowlink == 1) {
7586
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').val(\'' . dol_print_date($nowgmt, '%M', 'tzuserrel') . '\');';
7587
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').change();';
7586
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(\''.dol_print_date($nowgmt, '%M', 'tzuserrel').'\');';
7587
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').change();';
7588 7588
 				} elseif ($addnowlink == 2) {
7589
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').val(d.getMinutes().pad());';
7590
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').change();';
7589
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(d.getMinutes().pad());';
7590
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').change();';
7591 7591
 				}
7592 7592
 				if ($fullday) {
7593 7593
 					$reset_scripts .= ' } ';
@@ -7595,7 +7595,7 @@  discard block
 block discarded – undo
7595 7595
 			}
7596 7596
 			// If reset_scripts is not empty, print the link with the reset_scripts in the onClick
7597 7597
 			if ($reset_scripts && !getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
7598
-				$retstring .= ' <button class="dpInvisibleButtons datenowlink" id="' . $prefix . 'ButtonNow" type="button" name="_useless" value="now" onClick="' . $reset_scripts . '">';
7598
+				$retstring .= ' <button class="dpInvisibleButtons datenowlink" id="'.$prefix.'ButtonNow" type="button" name="_useless" value="now" onClick="'.$reset_scripts.'">';
7599 7599
 				$retstring .= $langs->trans("Now");
7600 7600
 				$retstring .= '</button> ';
7601 7601
 			}
@@ -7607,16 +7607,16 @@  discard block
 block discarded – undo
7607 7607
 			$reset_scripts = "";
7608 7608
 
7609 7609
 			// Generate the date part, depending on the use or not of the javascript calendar
7610
-			$reset_scripts .= 'jQuery(\'#' . $prefix . '\').val(\'' . dol_print_date($nowgmt, 'dayinputnoreduce', 'tzuserrel') . '\');';
7611
-			$reset_scripts .= 'jQuery(\'#' . $prefix . 'day\').val(\'' . dol_print_date($nowgmt, '%d', 'tzuserrel') . '\');';
7612
-			$reset_scripts .= 'jQuery(\'#' . $prefix . 'month\').val(\'' . dol_print_date($nowgmt, '%m', 'tzuserrel') . '\');';
7613
-			$reset_scripts .= 'jQuery(\'#' . $prefix . 'year\').val(\'' . dol_print_date($nowgmt, '%Y', 'tzuserrel') . '\');';
7610
+			$reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'dayinputnoreduce', 'tzuserrel').'\');';
7611
+			$reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');';
7612
+			$reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');';
7613
+			$reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');';
7614 7614
 			// Update the hour part
7615 7615
 			if ($h) {
7616 7616
 				if ($fullday) {
7617 7617
 					$reset_scripts .= " if (jQuery('#fullday:checked').val() == null) {";
7618 7618
 				}
7619
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').val(\'' . dol_print_date($nowgmt, '%H', 'tzuserrel') . '\');';
7619
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(\''.dol_print_date($nowgmt, '%H', 'tzuserrel').'\');';
7620 7620
 				if ($fullday) {
7621 7621
 					$reset_scripts .= ' } ';
7622 7622
 				}
@@ -7626,14 +7626,14 @@  discard block
 block discarded – undo
7626 7626
 				if ($fullday) {
7627 7627
 					$reset_scripts .= " if (jQuery('#fullday:checked').val() == null) {";
7628 7628
 				}
7629
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').val(\'' . dol_print_date($nowgmt, '%M', 'tzuserrel') . '\');';
7629
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(\''.dol_print_date($nowgmt, '%M', 'tzuserrel').'\');';
7630 7630
 				if ($fullday) {
7631 7631
 					$reset_scripts .= ' } ';
7632 7632
 				}
7633 7633
 			}
7634 7634
 			// If reset_scripts is not empty, print the link with the reset_scripts in the onClick
7635 7635
 			if ($reset_scripts && empty($conf->dol_optimize_smallscreen)) {
7636
-				$retstring .= ' <button class="dpInvisibleButtons datenowlink" id="' . $prefix . 'ButtonPlusOne" type="button" name="_useless2" value="plusone" onClick="' . $reset_scripts . '">';
7636
+				$retstring .= ' <button class="dpInvisibleButtons datenowlink" id="'.$prefix.'ButtonPlusOne" type="button" name="_useless2" value="plusone" onClick="'.$reset_scripts.'">';
7637 7637
 				$retstring .= $langs->trans("DateStartPlusOne");
7638 7638
 				$retstring .= '</button> ';
7639 7639
 			}
@@ -7691,17 +7691,17 @@  discard block
 block discarded – undo
7691 7691
 			unset($TDurationTypes[$value]);
7692 7692
 		}
7693 7693
 
7694
-		$retstring = '<select class="flat minwidth75 maxwidth100" id="select_' . $prefix . 'type_duration" name="' . $prefix . 'type_duration">';
7694
+		$retstring = '<select class="flat minwidth75 maxwidth100" id="select_'.$prefix.'type_duration" name="'.$prefix.'type_duration">';
7695 7695
 		foreach ($TDurationTypes as $key => $typeduration) {
7696
-			$retstring .= '<option value="' . $key . '"';
7696
+			$retstring .= '<option value="'.$key.'"';
7697 7697
 			if ($key == $selected) {
7698 7698
 				$retstring .= " selected";
7699 7699
 			}
7700
-			$retstring .= ">" . $typeduration . "</option>";
7700
+			$retstring .= ">".$typeduration."</option>";
7701 7701
 		}
7702 7702
 		$retstring .= "</select>";
7703 7703
 
7704
-		$retstring .= ajax_combobox('select_' . $prefix . 'type_duration');
7704
+		$retstring .= ajax_combobox('select_'.$prefix.'type_duration');
7705 7705
 
7706 7706
 		return $retstring;
7707 7707
 	}
@@ -7733,30 +7733,30 @@  discard block
 block discarded – undo
7733 7733
 
7734 7734
 		// Hours
7735 7735
 		if ($iSecond != '') {
7736
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
7736
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
7737 7737
 
7738 7738
 			$hourSelected = convertSecondToTime($iSecond, 'allhour');
7739 7739
 			$minSelected = convertSecondToTime($iSecond, 'min');
7740 7740
 		}
7741 7741
 
7742 7742
 		if ($typehour == 'select') {
7743
-			$retstring .= '<select class="flat" id="select_' . $prefix . 'hour" name="' . $prefix . 'hour"' . ($disabled ? ' disabled' : '') . '>';
7743
+			$retstring .= '<select class="flat" id="select_'.$prefix.'hour" name="'.$prefix.'hour"'.($disabled ? ' disabled' : '').'>';
7744 7744
 			for ($hour = 0; $hour < 25; $hour++) {    // For a duration, we allow 24 hours
7745
-				$retstring .= '<option value="' . $hour . '"';
7745
+				$retstring .= '<option value="'.$hour.'"';
7746 7746
 				if (is_numeric($hourSelected) && $hourSelected == $hour) {
7747 7747
 					$retstring .= " selected";
7748 7748
 				}
7749
-				$retstring .= ">" . $hour . "</option>";
7749
+				$retstring .= ">".$hour."</option>";
7750 7750
 			}
7751 7751
 			$retstring .= "</select>";
7752 7752
 		} elseif ($typehour == 'text' || $typehour == 'textselect') {
7753
-			$retstring .= '<input placeholder="' . $langs->trans('HourShort') . '" type="number" min="0" name="' . $prefix . 'hour"' . ($disabled ? ' disabled' : '') . ' class="flat maxwidth50 inputhour right" value="' . (($hourSelected != '') ? ((int) $hourSelected) : '') . '">';
7753
+			$retstring .= '<input placeholder="'.$langs->trans('HourShort').'" type="number" min="0" name="'.$prefix.'hour"'.($disabled ? ' disabled' : '').' class="flat maxwidth50 inputhour right" value="'.(($hourSelected != '') ? ((int) $hourSelected) : '').'">';
7754 7754
 		} else {
7755 7755
 			return 'BadValueForParameterTypeHour';
7756 7756
 		}
7757 7757
 
7758 7758
 		if ($typehour != 'text') {
7759
-			$retstring .= ' ' . $langs->trans('HourShort');
7759
+			$retstring .= ' '.$langs->trans('HourShort');
7760 7760
 		} else {
7761 7761
 			$retstring .= '<span class="">:</span>';
7762 7762
 		}
@@ -7771,21 +7771,21 @@  discard block
 block discarded – undo
7771 7771
 		}
7772 7772
 
7773 7773
 		if ($typehour == 'select' || $typehour == 'textselect') {
7774
-			$retstring .= '<select class="flat" id="select_' . $prefix . 'min" name="' . $prefix . 'min"' . ($disabled ? ' disabled' : '') . '>';
7774
+			$retstring .= '<select class="flat" id="select_'.$prefix.'min" name="'.$prefix.'min"'.($disabled ? ' disabled' : '').'>';
7775 7775
 			for ($min = 0; $min <= 55; $min += 5) {
7776
-				$retstring .= '<option value="' . $min . '"';
7776
+				$retstring .= '<option value="'.$min.'"';
7777 7777
 				if (is_numeric($minSelected) && $minSelected == $min) {
7778 7778
 					$retstring .= ' selected';
7779 7779
 				}
7780
-				$retstring .= '>' . $min . '</option>';
7780
+				$retstring .= '>'.$min.'</option>';
7781 7781
 			}
7782 7782
 			$retstring .= "</select>";
7783 7783
 		} elseif ($typehour == 'text') {
7784
-			$retstring .= '<input placeholder="' . $langs->trans('MinuteShort') . '" type="number" min="0" name="' . $prefix . 'min"' . ($disabled ? ' disabled' : '') . ' class="flat maxwidth50 inputminute right" value="' . (($minSelected != '') ? ((int) $minSelected) : '') . '">';
7784
+			$retstring .= '<input placeholder="'.$langs->trans('MinuteShort').'" type="number" min="0" name="'.$prefix.'min"'.($disabled ? ' disabled' : '').' class="flat maxwidth50 inputminute right" value="'.(($minSelected != '') ? ((int) $minSelected) : '').'">';
7785 7785
 		}
7786 7786
 
7787 7787
 		if ($typehour != 'text') {
7788
-			$retstring .= ' ' . $langs->trans('MinuteShort');
7788
+			$retstring .= ' '.$langs->trans('MinuteShort');
7789 7789
 		}
7790 7790
 
7791 7791
 		$retstring .= "</span>";
@@ -7833,7 +7833,7 @@  discard block
 block discarded – undo
7833 7833
 			$placeholder = '';
7834 7834
 
7835 7835
 			if ($selected && empty($selected_input_value)) {
7836
-				require_once DOL_DOCUMENT_ROOT . '/ticket/class/ticket.class.php';
7836
+				require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php';
7837 7837
 				$tickettmpselect = new Ticket($this->db);
7838 7838
 				$tickettmpselect->fetch($selected);
7839 7839
 				$selected_input_value = $tickettmpselect->ref;
@@ -7841,17 +7841,17 @@  discard block
 block discarded – undo
7841 7841
 			}
7842 7842
 
7843 7843
 			$urloption = '';
7844
-			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/ticket/ajax/tickets.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
7844
+			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/ticket/ajax/tickets.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
7845 7845
 
7846 7846
 			if (empty($hidelabel)) {
7847
-				$out .= $langs->trans("RefOrLabel") . ' : ';
7847
+				$out .= $langs->trans("RefOrLabel").' : ';
7848 7848
 			} elseif ($hidelabel > 1) {
7849
-				$placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"';
7849
+				$placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"';
7850 7850
 				if ($hidelabel == 2) {
7851 7851
 					$out .= img_picto($langs->trans("Search"), 'search');
7852 7852
 				}
7853 7853
 			}
7854
-			$out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />';
7854
+			$out .= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />';
7855 7855
 			if ($hidelabel == 3) {
7856 7856
 				$out .= img_picto($langs->trans("Search"), 'search');
7857 7857
 			}
@@ -7895,8 +7895,8 @@  discard block
 block discarded – undo
7895 7895
 
7896 7896
 		$sql = "SELECT ";
7897 7897
 		$sql .= $selectFields;
7898
-		$sql .= " FROM " . $this->db->prefix() . "ticket as p";
7899
-		$sql .= ' WHERE p.entity IN (' . getEntity('ticket') . ')';
7898
+		$sql .= " FROM ".$this->db->prefix()."ticket as p";
7899
+		$sql .= ' WHERE p.entity IN ('.getEntity('ticket').')';
7900 7900
 
7901 7901
 		// Add criteria on ref/label
7902 7902
 		if ($filterkey != '') {
@@ -7912,7 +7912,7 @@  discard block
 block discarded – undo
7912 7912
 				if ($i > 0) {
7913 7913
 					$sql .= " AND ";
7914 7914
 				}
7915
-				$sql .= "(p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%' OR p.subject LIKE '" . $this->db->escape($prefix . $crit) . "%'";
7915
+				$sql .= "(p.ref LIKE '".$this->db->escape($prefix.$crit)."%' OR p.subject LIKE '".$this->db->escape($prefix.$crit)."%'";
7916 7916
 				$sql .= ")";
7917 7917
 				$i++;
7918 7918
 			}
@@ -7925,22 +7925,22 @@  discard block
 block discarded – undo
7925 7925
 		$sql .= $this->db->plimit($limit, 0);
7926 7926
 
7927 7927
 		// Build output string
7928
-		dol_syslog(get_class($this) . "::selectTicketsList search tickets", LOG_DEBUG);
7928
+		dol_syslog(get_class($this)."::selectTicketsList search tickets", LOG_DEBUG);
7929 7929
 		$result = $this->db->query($sql);
7930 7930
 		if ($result) {
7931
-			require_once DOL_DOCUMENT_ROOT . '/ticket/class/ticket.class.php';
7932
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/ticket.lib.php';
7931
+			require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php';
7932
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/ticket.lib.php';
7933 7933
 
7934 7934
 			$num = $this->db->num_rows($result);
7935 7935
 
7936 7936
 			$events = array();
7937 7937
 
7938 7938
 			if (!$forcecombo) {
7939
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
7939
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
7940 7940
 				$out .= ajax_combobox($htmlname, $events, getDolGlobalInt('TICKET_USE_SEARCH_TO_SELECT'));
7941 7941
 			}
7942 7942
 
7943
-			$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
7943
+			$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
7944 7944
 
7945 7945
 			$textifempty = '';
7946 7946
 			// Do not use textifempty = ' ' or '&nbsp;' here, or search on key will search on ' key'.
@@ -7957,7 +7957,7 @@  discard block
 block discarded – undo
7957 7957
 				}
7958 7958
 			}
7959 7959
 			if ($showempty) {
7960
-				$out .= '<option value="0" selected>' . $textifempty . '</option>';
7960
+				$out .= '<option value="0" selected>'.$textifempty.'</option>';
7961 7961
 			}
7962 7962
 
7963 7963
 			$i = 0;
@@ -8012,13 +8012,13 @@  discard block
 block discarded – undo
8012 8012
 		$outkey = $objp->rowid;
8013 8013
 		$outref = $objp->ref;
8014 8014
 
8015
-		$opt = '<option value="' . $objp->rowid . '"';
8015
+		$opt = '<option value="'.$objp->rowid.'"';
8016 8016
 		$opt .= ($objp->rowid == $selected) ? ' selected' : '';
8017 8017
 		$opt .= '>';
8018 8018
 		$opt .= $objp->ref;
8019 8019
 		$objRef = $objp->ref;
8020 8020
 		if (!empty($filterkey) && $filterkey != '') {
8021
-			$objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1);
8021
+			$objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1);
8022 8022
 		}
8023 8023
 
8024 8024
 		$opt .= "</option>\n";
@@ -8059,7 +8059,7 @@  discard block
 block discarded – undo
8059 8059
 			$placeholder = '';
8060 8060
 
8061 8061
 			if ($selected && empty($selected_input_value)) {
8062
-				require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
8062
+				require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
8063 8063
 				$projecttmpselect = new Project($this->db);
8064 8064
 				$projecttmpselect->fetch($selected);
8065 8065
 				$selected_input_value = $projecttmpselect->ref;
@@ -8067,17 +8067,17 @@  discard block
 block discarded – undo
8067 8067
 			}
8068 8068
 
8069 8069
 			$urloption = '';
8070
-			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/projet/ajax/projects.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
8070
+			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/projet/ajax/projects.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
8071 8071
 
8072 8072
 			if (empty($hidelabel)) {
8073
-				$out .= $langs->trans("RefOrLabel") . ' : ';
8073
+				$out .= $langs->trans("RefOrLabel").' : ';
8074 8074
 			} elseif ($hidelabel > 1) {
8075
-				$placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"';
8075
+				$placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"';
8076 8076
 				if ($hidelabel == 2) {
8077 8077
 					$out .= img_picto($langs->trans("Search"), 'search');
8078 8078
 				}
8079 8079
 			}
8080
-			$out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />';
8080
+			$out .= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />';
8081 8081
 			if ($hidelabel == 3) {
8082 8082
 				$out .= img_picto($langs->trans("Search"), 'search');
8083 8083
 			}
@@ -8120,8 +8120,8 @@  discard block
 block discarded – undo
8120 8120
 
8121 8121
 		$sql = "SELECT ";
8122 8122
 		$sql .= $selectFields;
8123
-		$sql .= " FROM " . $this->db->prefix() . "projet as p";
8124
-		$sql .= ' WHERE p.entity IN (' . getEntity('project') . ')';
8123
+		$sql .= " FROM ".$this->db->prefix()."projet as p";
8124
+		$sql .= ' WHERE p.entity IN ('.getEntity('project').')';
8125 8125
 
8126 8126
 		// Add criteria on ref/label
8127 8127
 		if ($filterkey != '') {
@@ -8137,7 +8137,7 @@  discard block
 block discarded – undo
8137 8137
 				if ($i > 0) {
8138 8138
 					$sql .= " AND ";
8139 8139
 				}
8140
-				$sql .= "p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%'";
8140
+				$sql .= "p.ref LIKE '".$this->db->escape($prefix.$crit)."%'";
8141 8141
 				$sql .= "";
8142 8142
 				$i++;
8143 8143
 			}
@@ -8150,22 +8150,22 @@  discard block
 block discarded – undo
8150 8150
 		$sql .= $this->db->plimit($limit, 0);
8151 8151
 
8152 8152
 		// Build output string
8153
-		dol_syslog(get_class($this) . "::selectProjectsList search projects", LOG_DEBUG);
8153
+		dol_syslog(get_class($this)."::selectProjectsList search projects", LOG_DEBUG);
8154 8154
 		$result = $this->db->query($sql);
8155 8155
 		if ($result) {
8156
-			require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
8157
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php';
8156
+			require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
8157
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
8158 8158
 
8159 8159
 			$num = $this->db->num_rows($result);
8160 8160
 
8161 8161
 			$events = array();
8162 8162
 
8163 8163
 			if (!$forcecombo) {
8164
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
8164
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
8165 8165
 				$out .= ajax_combobox($htmlname, $events, getDolGlobalInt('PROJECT_USE_SEARCH_TO_SELECT'));
8166 8166
 			}
8167 8167
 
8168
-			$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
8168
+			$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
8169 8169
 
8170 8170
 			$textifempty = '';
8171 8171
 			// Do not use textifempty = ' ' or '&nbsp;' here, or search on key will search on ' key'.
@@ -8182,7 +8182,7 @@  discard block
 block discarded – undo
8182 8182
 				}
8183 8183
 			}
8184 8184
 			if ($showempty) {
8185
-				$out .= '<option value="0" selected>' . $textifempty . '</option>';
8185
+				$out .= '<option value="0" selected>'.$textifempty.'</option>';
8186 8186
 			}
8187 8187
 
8188 8188
 			$i = 0;
@@ -8240,13 +8240,13 @@  discard block
 block discarded – undo
8240 8240
 		$outlabel = $objp->label;
8241 8241
 		$outtype = $objp->fk_product_type;
8242 8242
 
8243
-		$opt = '<option value="' . $objp->rowid . '"';
8243
+		$opt = '<option value="'.$objp->rowid.'"';
8244 8244
 		$opt .= ($objp->rowid == $selected) ? ' selected' : '';
8245 8245
 		$opt .= '>';
8246 8246
 		$opt .= $objp->ref;
8247 8247
 		$objRef = $objp->ref;
8248 8248
 		if (!empty($filterkey) && $filterkey != '') {
8249
-			$objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1);
8249
+			$objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1);
8250 8250
 		}
8251 8251
 
8252 8252
 		$opt .= "</option>\n";
@@ -8288,7 +8288,7 @@  discard block
 block discarded – undo
8288 8288
 			$placeholder = '';
8289 8289
 
8290 8290
 			if ($selected && empty($selected_input_value)) {
8291
-				require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php';
8291
+				require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
8292 8292
 				$adherenttmpselect = new Adherent($this->db);
8293 8293
 				$adherenttmpselect->fetch($selected);
8294 8294
 				$selected_input_value = $adherenttmpselect->ref;
@@ -8297,17 +8297,17 @@  discard block
 block discarded – undo
8297 8297
 
8298 8298
 			$urloption = '';
8299 8299
 
8300
-			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/adherents/ajax/adherents.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
8300
+			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/adherents/ajax/adherents.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
8301 8301
 
8302 8302
 			if (empty($hidelabel)) {
8303
-				$out .= $langs->trans("RefOrLabel") . ' : ';
8303
+				$out .= $langs->trans("RefOrLabel").' : ';
8304 8304
 			} elseif ($hidelabel > 1) {
8305
-				$placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"';
8305
+				$placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"';
8306 8306
 				if ($hidelabel == 2) {
8307 8307
 					$out .= img_picto($langs->trans("Search"), 'search');
8308 8308
 				}
8309 8309
 			}
8310
-			$out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />';
8310
+			$out .= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />';
8311 8311
 			if ($hidelabel == 3) {
8312 8312
 				$out .= img_picto($langs->trans("Search"), 'search');
8313 8313
 			}
@@ -8352,8 +8352,8 @@  discard block
 block discarded – undo
8352 8352
 
8353 8353
 		$sql = "SELECT ";
8354 8354
 		$sql .= $selectFields;
8355
-		$sql .= " FROM " . $this->db->prefix() . "adherent as p";
8356
-		$sql .= ' WHERE p.entity IN (' . getEntity('adherent') . ')';
8355
+		$sql .= " FROM ".$this->db->prefix()."adherent as p";
8356
+		$sql .= ' WHERE p.entity IN ('.getEntity('adherent').')';
8357 8357
 
8358 8358
 		// Add criteria on ref/label
8359 8359
 		if ($filterkey != '') {
@@ -8369,8 +8369,8 @@  discard block
 block discarded – undo
8369 8369
 				if ($i > 0) {
8370 8370
 					$sql .= " AND ";
8371 8371
 				}
8372
-				$sql .= "(p.firstname LIKE '" . $this->db->escape($prefix . $crit) . "%'";
8373
-				$sql .= " OR p.lastname LIKE '" . $this->db->escape($prefix . $crit) . "%')";
8372
+				$sql .= "(p.firstname LIKE '".$this->db->escape($prefix.$crit)."%'";
8373
+				$sql .= " OR p.lastname LIKE '".$this->db->escape($prefix.$crit)."%')";
8374 8374
 				$i++;
8375 8375
 			}
8376 8376
 			if (count($search_crit) > 1) {
@@ -8379,27 +8379,27 @@  discard block
 block discarded – undo
8379 8379
 			$sql .= ')';
8380 8380
 		}
8381 8381
 		if ($status != -1) {
8382
-			$sql .= ' AND statut = ' . ((int) $status);
8382
+			$sql .= ' AND statut = '.((int) $status);
8383 8383
 		}
8384 8384
 		$sql .= $this->db->plimit($limit, 0);
8385 8385
 
8386 8386
 		// Build output string
8387
-		dol_syslog(get_class($this) . "::selectMembersList search adherents", LOG_DEBUG);
8387
+		dol_syslog(get_class($this)."::selectMembersList search adherents", LOG_DEBUG);
8388 8388
 		$result = $this->db->query($sql);
8389 8389
 		if ($result) {
8390
-			require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php';
8391
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/member.lib.php';
8390
+			require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
8391
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
8392 8392
 
8393 8393
 			$num = $this->db->num_rows($result);
8394 8394
 
8395 8395
 			$events = array();
8396 8396
 
8397 8397
 			if (!$forcecombo) {
8398
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
8398
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
8399 8399
 				$out .= ajax_combobox($htmlname, $events, getDolGlobalString('PROJECT_USE_SEARCH_TO_SELECT') ? $conf->global->PROJECT_USE_SEARCH_TO_SELECT : '');
8400 8400
 			}
8401 8401
 
8402
-			$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
8402
+			$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
8403 8403
 
8404 8404
 			$textifempty = '';
8405 8405
 			// Do not use textifempty = ' ' or '&nbsp;' here, or search on key will search on ' key'.
@@ -8416,7 +8416,7 @@  discard block
 block discarded – undo
8416 8416
 				}
8417 8417
 			}
8418 8418
 			if ($showempty) {
8419
-				$out .= '<option value="-1" selected>' . $textifempty . '</option>';
8419
+				$out .= '<option value="-1" selected>'.$textifempty.'</option>';
8420 8420
 			}
8421 8421
 
8422 8422
 			$i = 0;
@@ -8472,11 +8472,11 @@  discard block
 block discarded – undo
8472 8472
 		$outlabel = dolGetFirstLastname($objp->firstname, $objp->lastname);
8473 8473
 		$outtype = $objp->fk_adherent_type;
8474 8474
 
8475
-		$opt = '<option value="' . $objp->rowid . '"';
8475
+		$opt = '<option value="'.$objp->rowid.'"';
8476 8476
 		$opt .= ($objp->rowid == $selected) ? ' selected' : '';
8477 8477
 		$opt .= '>';
8478 8478
 		if (!empty($filterkey) && $filterkey != '') {
8479
-			$outlabel = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $outlabel, 1);
8479
+			$outlabel = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $outlabel, 1);
8480 8480
 		}
8481 8481
 		$opt .= $outlabel;
8482 8482
 		$opt .= "</option>\n";
@@ -8531,8 +8531,8 @@  discard block
 block discarded – undo
8531 8531
 		$objecttmp = null;
8532 8532
 		$InfoFieldList = array();
8533 8533
 		$classname = '';
8534
-		$filter = '';  // Ensure filter has value (for static analysis)
8535
-		$sortfield = '';  // Ensure filter has value (for static analysis)
8534
+		$filter = ''; // Ensure filter has value (for static analysis)
8535
+		$sortfield = ''; // Ensure filter has value (for static analysis)
8536 8536
 
8537 8537
 		if ($objectfield) {	// We must retrieve the objectdesc from the field or extrafield
8538 8538
 			// Example: $objectfield = 'product:options_package' or 'myobject@mymodule:options_myfield'
@@ -8576,9 +8576,9 @@  discard block
 block discarded – undo
8576 8576
 			$vartmp = (empty($InfoFieldList[3]) ? '' : $InfoFieldList[3]);
8577 8577
 			$reg = array();
8578 8578
 			if (preg_match('/^.*:(\w*)$/', $vartmp, $reg)) {
8579
-				$InfoFieldList[4] = $reg[1];    // take the sort field
8579
+				$InfoFieldList[4] = $reg[1]; // take the sort field
8580 8580
 			}
8581
-			$InfoFieldList[3] = preg_replace('/:\w*$/', '', $vartmp);    // take the filter field
8581
+			$InfoFieldList[3] = preg_replace('/:\w*$/', '', $vartmp); // take the filter field
8582 8582
 
8583 8583
 			$classname = $InfoFieldList[0];
8584 8584
 			$classpath = empty($InfoFieldList[1]) ? '' : $InfoFieldList[1];
@@ -8609,8 +8609,8 @@  discard block
 block discarded – undo
8609 8609
 		);
8610 8610
 
8611 8611
 		if (!is_object($objecttmp)) {
8612
-			dol_syslog('selectForForms: Error bad setup of field objectdescorig=' . $objectdescorig.', objectfield='.$objectfield.', objectdesc='.$objectdesc, LOG_WARNING);
8613
-			return 'selectForForms: Error bad setup of field objectdescorig=' . $objectdescorig.', objectfield='.$objectfield.', objectdesc='.$objectdesc;
8612
+			dol_syslog('selectForForms: Error bad setup of field objectdescorig='.$objectdescorig.', objectfield='.$objectfield.', objectdesc='.$objectdesc, LOG_WARNING);
8613
+			return 'selectForForms: Error bad setup of field objectdescorig='.$objectdescorig.', objectfield='.$objectfield.', objectdesc='.$objectdesc;
8614 8614
 		}
8615 8615
 		'@phan-var-force CommonObject $objecttmp';
8616 8616
 		/** @var CommonObject $objecttmp */
@@ -8622,9 +8622,9 @@  discard block
 block discarded – undo
8622 8622
 		if ($prefixforautocompletemode == 'product') {
8623 8623
 			$prefixforautocompletemode = 'produit';
8624 8624
 		}
8625
-		$confkeyforautocompletemode = strtoupper($prefixforautocompletemode) . '_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT
8625
+		$confkeyforautocompletemode = strtoupper($prefixforautocompletemode).'_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT
8626 8626
 
8627
-		dol_syslog(get_class($this) . "::selectForForms filter=" . $filter, LOG_DEBUG);
8627
+		dol_syslog(get_class($this)."::selectForForms filter=".$filter, LOG_DEBUG);
8628 8628
 
8629 8629
 		// Generate the combo HTML component
8630 8630
 		$out = '';
@@ -8653,13 +8653,13 @@  discard block
 block discarded – undo
8653 8653
 			}
8654 8654
 
8655 8655
 			// Set url and param to call to get json of the search results
8656
-			$urlforajaxcall = DOL_URL_ROOT . '/core/ajax/selectobject.php';
8657
-			$urloption = 'htmlname=' . urlencode($htmlname) . '&outjson=1&objectdesc=' . urlencode($objectdescorig) . '&objectfield='.urlencode($objectfield) . ($sortfield ? '&sortfield=' . urlencode($sortfield) : '');
8656
+			$urlforajaxcall = DOL_URL_ROOT.'/core/ajax/selectobject.php';
8657
+			$urloption = 'htmlname='.urlencode($htmlname).'&outjson=1&objectdesc='.urlencode($objectdescorig).'&objectfield='.urlencode($objectfield).($sortfield ? '&sortfield='.urlencode($sortfield) : '');
8658 8658
 
8659 8659
 			// Activate the auto complete using ajax call.
8660 8660
 			$out .= ajax_autocompleter((string) $preSelectedValue, $htmlname, $urlforajaxcall, $urloption, getDolGlobalInt($confkeyforautocompletemode), 0);
8661 8661
 			$out .= '<!-- force css to be higher than dialog popup --><style type="text/css">.ui-autocomplete { z-index: 1010; }</style>';
8662
-			$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) . '"' : '') . ' />';
8662
+			$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).'"' : '').' />';
8663 8663
 		} else {
8664 8664
 			// Immediate load of table record.
8665 8665
 			$out .= $this->selectForFormsList($objecttmp, $htmlname, $preSelectedValue, $showempty, $searchkey, $placeholder, $morecss, $moreparams, $forcecombo, 0, $disabled, $sortfield, $filter);
@@ -8699,16 +8699,16 @@  discard block
 block discarded – undo
8699 8699
 		if ($prefixforautocompletemode == 'societe') {
8700 8700
 			$prefixforautocompletemode = 'company';
8701 8701
 		}
8702
-		$confkeyforautocompletemode = strtoupper($prefixforautocompletemode) . '_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT
8702
+		$confkeyforautocompletemode = strtoupper($prefixforautocompletemode).'_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT
8703 8703
 
8704 8704
 		if (!empty($objecttmp->fields)) {    // For object that declare it, it is better to use declared fields (like societe, contact, ...)
8705 8705
 			$tmpfieldstoshow = '';
8706 8706
 			foreach ($objecttmp->fields as $key => $val) {
8707
-				if (! (int) dol_eval($val['enabled'], 1, 1, '1')) {
8707
+				if (!(int) dol_eval($val['enabled'], 1, 1, '1')) {
8708 8708
 					continue;
8709 8709
 				}
8710 8710
 				if (!empty($val['showoncombobox'])) {
8711
-					$tmpfieldstoshow .= ($tmpfieldstoshow ? ',' : '') . 't.' . $key;
8711
+					$tmpfieldstoshow .= ($tmpfieldstoshow ? ',' : '').'t.'.$key;
8712 8712
 				}
8713 8713
 			}
8714 8714
 			if ($tmpfieldstoshow) {
@@ -8745,25 +8745,25 @@  discard block
 block discarded – undo
8745 8745
 		$num = 0;
8746 8746
 
8747 8747
 		// Search data
8748
-		$sql = "SELECT t.rowid, " . $fieldstoshow . " FROM " . $this->db->prefix() . $this->db->sanitize($objecttmp->table_element) . " as t";
8748
+		$sql = "SELECT t.rowid, ".$fieldstoshow." FROM ".$this->db->prefix().$this->db->sanitize($objecttmp->table_element)." as t";
8749 8749
 		if (!empty($objecttmp->isextrafieldmanaged)) {
8750
-			$sql .= " LEFT JOIN " . $this->db->prefix() . $this->db->sanitize($objecttmp->table_element) . "_extrafields as e ON t.rowid = e.fk_object";
8750
+			$sql .= " LEFT JOIN ".$this->db->prefix().$this->db->sanitize($objecttmp->table_element)."_extrafields as e ON t.rowid = e.fk_object";
8751 8751
 		}
8752 8752
 		if (!empty($objecttmp->parent_element)) {
8753 8753
 			$parent_properties = getElementProperties($objecttmp->parent_element);
8754
-			$sql .= " INNER JOIN " . $this->db->prefix() . $this->db->sanitize($parent_properties['table_element']) . " as o ON o.rowid = t.".$objecttmp->fk_parent_attribute;
8754
+			$sql .= " INNER JOIN ".$this->db->prefix().$this->db->sanitize($parent_properties['table_element'])." as o ON o.rowid = t.".$objecttmp->fk_parent_attribute;
8755 8755
 		}
8756 8756
 		if (in_array($objecttmp->parent_element, ['commande', 'propal', 'facture', 'expedition'])) {
8757
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "product as p ON p.rowid = t.fk_product";
8757
+			$sql .= " LEFT JOIN ".$this->db->prefix()."product as p ON p.rowid = t.fk_product";
8758 8758
 		}
8759 8759
 		if (isset($objecttmp->ismultientitymanaged)) {
8760 8760
 			if (!is_numeric($objecttmp->ismultientitymanaged)) {
8761 8761
 				$tmparray = explode('@', $objecttmp->ismultientitymanaged);
8762
-				$sql .= " INNER JOIN " . $this->db->prefix() . $this->db->sanitize($tmparray[1]) . " as parenttable ON parenttable.rowid = t." . $this->db->sanitize($tmparray[0]);
8762
+				$sql .= " INNER JOIN ".$this->db->prefix().$this->db->sanitize($tmparray[1])." as parenttable ON parenttable.rowid = t.".$this->db->sanitize($tmparray[0]);
8763 8763
 			}
8764 8764
 			if ($objecttmp->ismultientitymanaged === 'fk_soc@societe') {
8765 8765
 				if (!$user->hasRight('societe', 'client', 'voir')) {
8766
-					$sql .= ", " . $this->db->prefix() . "societe_commerciaux as sc";
8766
+					$sql .= ", ".$this->db->prefix()."societe_commerciaux as sc";
8767 8767
 				}
8768 8768
 			}
8769 8769
 		}
@@ -8783,21 +8783,21 @@  discard block
 block discarded – undo
8783 8783
 			$sql .= " WHERE 1=1";
8784 8784
 			if (isset($objecttmp->ismultientitymanaged)) {
8785 8785
 				if ($objecttmp->ismultientitymanaged == 1) {
8786
-					$sql .= " AND t.entity IN (" . getEntity($objecttmp->table_element) . ")";
8786
+					$sql .= " AND t.entity IN (".getEntity($objecttmp->table_element).")";
8787 8787
 				}
8788 8788
 				if (!is_numeric($objecttmp->ismultientitymanaged)) {
8789
-					$sql .= " AND parenttable.entity = t." . $this->db->sanitize($tmparray[0]);
8789
+					$sql .= " AND parenttable.entity = t.".$this->db->sanitize($tmparray[0]);
8790 8790
 				}
8791 8791
 				if ($objecttmp->ismultientitymanaged == 1 && !empty($user->socid)) {
8792 8792
 					if ($objecttmp->element == 'societe') {
8793
-						$sql .= " AND t.rowid = " . ((int) $user->socid);
8793
+						$sql .= " AND t.rowid = ".((int) $user->socid);
8794 8794
 					} else {
8795
-						$sql .= " AND t.fk_soc = " . ((int) $user->socid);
8795
+						$sql .= " AND t.fk_soc = ".((int) $user->socid);
8796 8796
 					}
8797 8797
 				}
8798 8798
 				if ($objecttmp->ismultientitymanaged === 'fk_soc@societe') {
8799 8799
 					if (!$user->hasRight('societe', 'client', 'voir')) {
8800
-						$sql .= " AND t.rowid = sc.fk_soc AND sc.fk_user = " . ((int) $user->id);
8800
+						$sql .= " AND t.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
8801 8801
 					}
8802 8802
 				}
8803 8803
 			}
@@ -8815,7 +8815,7 @@  discard block
 block discarded – undo
8815 8815
 				$errormessage = '';
8816 8816
 				$sql .= forgeSQLFromUniversalSearchCriteria($filter, $errormessage);
8817 8817
 				if ($errormessage) {
8818
-					return 'Error forging a SQL request from an universal criteria: ' . $errormessage;
8818
+					return 'Error forging a SQL request from an universal criteria: '.$errormessage;
8819 8819
 				}
8820 8820
 			}
8821 8821
 		}
@@ -8827,7 +8827,7 @@  discard block
 block discarded – undo
8827 8827
 		$resql = $this->db->query($sql);
8828 8828
 		if ($resql) {
8829 8829
 			// Construct $out and $outarray
8830
-			$out .= '<select id="' . $htmlname . '" class="flat minwidth100' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ($moreparams ? ' ' . $moreparams : '') . ' name="' . $htmlname . '">' . "\n";
8830
+			$out .= '<select id="'.$htmlname.'" class="flat minwidth100'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').($moreparams ? ' '.$moreparams : '').' name="'.$htmlname.'">'."\n";
8831 8831
 
8832 8832
 			// 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
8833 8833
 			$textifempty = '&nbsp;';
@@ -8841,7 +8841,7 @@  discard block
 block discarded – undo
8841 8841
 				}
8842 8842
 			}
8843 8843
 			if ($showempty) {
8844
-				$out .= '<option value="-1">' . $textifempty . '</option>' . "\n";
8844
+				$out .= '<option value="-1">'.$textifempty.'</option>'."\n";
8845 8845
 			}
8846 8846
 
8847 8847
 			$num = $this->db->num_rows($resql);
@@ -8864,9 +8864,9 @@  discard block
 block discarded – undo
8864 8864
 					}
8865 8865
 					if (empty($outputmode)) {
8866 8866
 						if ($preselectedvalue > 0 && $preselectedvalue == $obj->rowid) {
8867
-							$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>';
8867
+							$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>';
8868 8868
 						} else {
8869
-							$out .= '<option value="' . $obj->rowid . '" data-html="' . dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1) . '">' . dol_escape_htmltag($label, 0, 0, '', 0, 1) . '</option>';
8869
+							$out .= '<option value="'.$obj->rowid.'" data-html="'.dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1).'">'.dol_escape_htmltag($label, 0, 0, '', 0, 1).'</option>';
8870 8870
 						}
8871 8871
 					} else {
8872 8872
 						array_push($outarray, array('key' => $obj->rowid, 'value' => $label, 'label' => $label));
@@ -8879,10 +8879,10 @@  discard block
 block discarded – undo
8879 8879
 				}
8880 8880
 			}
8881 8881
 
8882
-			$out .= '</select>' . "\n";
8882
+			$out .= '</select>'."\n";
8883 8883
 
8884 8884
 			if (!$forcecombo) {
8885
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
8885
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
8886 8886
 				$out .= ajax_combobox($htmlname, array(), getDolGlobalInt($confkeyforautocompletemode, 0));
8887 8887
 			}
8888 8888
 		} else {
@@ -8946,8 +8946,8 @@  discard block
 block discarded – undo
8946 8946
 			}
8947 8947
 		}
8948 8948
 		$idname = str_replace(array('[', ']'), array('', ''), $htmlname);
8949
-		$out .= '<select id="' . preg_replace('/^\./', '', $idname) . '" ' . ($disabled ? 'disabled="disabled" ' : '') . 'class="flat ' . (preg_replace('/^\./', '', $htmlname)) . ($morecss ? ' ' . $morecss : '') . ' selectformat"';
8950
-		$out .= ' name="' . preg_replace('/^\./', '', $htmlname) . '" ' . ($moreparam ? $moreparam : '');
8949
+		$out .= '<select id="'.preg_replace('/^\./', '', $idname).'" '.($disabled ? 'disabled="disabled" ' : '').'class="flat '.(preg_replace('/^\./', '', $htmlname)).($morecss ? ' '.$morecss : '').' selectformat"';
8950
+		$out .= ' name="'.preg_replace('/^\./', '', $htmlname).'" '.($moreparam ? $moreparam : '');
8951 8951
 		$out .= '>'."\n";
8952 8952
 
8953 8953
 		if ($show_empty) {
@@ -8958,7 +8958,7 @@  discard block
 block discarded – undo
8958 8958
 			if (!is_numeric($show_empty)) {
8959 8959
 				$textforempty = $show_empty;
8960 8960
 			}
8961
-			$out .= '<option class="optiongrey" ' . ($moreparamonempty ? $moreparamonempty . ' ' : '') . 'value="' . (((int) $show_empty) < 0 ? $show_empty : -1) . '"' . ($id == $show_empty ? ' selected' : '') . '>' . $textforempty . '</option>' . "\n";
8961
+			$out .= '<option class="optiongrey" '.($moreparamonempty ? $moreparamonempty.' ' : '').'value="'.(((int) $show_empty) < 0 ? $show_empty : -1).'"'.($id == $show_empty ? ' selected' : '').'>'.$textforempty.'</option>'."\n";
8962 8962
 		}
8963 8963
 		if (is_array($array)) {
8964 8964
 			// Translate
@@ -8983,7 +8983,7 @@  discard block
 block discarded – undo
8983 8983
 					$value = $tmpvalue['label'];
8984 8984
 					//$valuehtml = empty($tmpvalue['data-html']) ? $value : $tmpvalue['data-html'];
8985 8985
 					$disabled = empty($tmpvalue['disabled']) ? '' : ' disabled';
8986
-					$style = empty($tmpvalue['css']) ? '' : ' class="' . $tmpvalue['css'] . '"';
8986
+					$style = empty($tmpvalue['css']) ? '' : ' class="'.$tmpvalue['css'].'"';
8987 8987
 				} else {
8988 8988
 					$value = $tmpvalue;
8989 8989
 					//$valuehtml = $tmpvalue;
@@ -8999,9 +8999,9 @@  discard block
 block discarded – undo
8999 8999
 				}
9000 9000
 				if ($key_in_label) {
9001 9001
 					if (empty($nohtmlescape)) {
9002
-						$selectOptionValue = dol_escape_htmltag($key . ' - ' . ($maxlen ? dol_trunc($value, $maxlen) : $value));
9002
+						$selectOptionValue = dol_escape_htmltag($key.' - '.($maxlen ? dol_trunc($value, $maxlen) : $value));
9003 9003
 					} else {
9004
-						$selectOptionValue = $key . ' - ' . ($maxlen ? dol_trunc($value, $maxlen) : $value);
9004
+						$selectOptionValue = $key.' - '.($maxlen ? dol_trunc($value, $maxlen) : $value);
9005 9005
 					}
9006 9006
 				} else {
9007 9007
 					if (empty($nohtmlescape)) {
@@ -9013,8 +9013,8 @@  discard block
 block discarded – undo
9013 9013
 						$selectOptionValue = '&nbsp;';
9014 9014
 					}
9015 9015
 				}
9016
-				$out .= '<option value="' . $key . '"';
9017
-				$out .= $style . $disabled;
9016
+				$out .= '<option value="'.$key.'"';
9017
+				$out .= $style.$disabled;
9018 9018
 				if (is_array($id)) {
9019 9019
 					if (in_array($key, $id) && !$disabled) {
9020 9020
 						$out .= ' selected'; // To preselect a value
@@ -9026,7 +9026,7 @@  discard block
 block discarded – undo
9026 9026
 					}
9027 9027
 				}
9028 9028
 				if (!empty($nohtmlescape)) {	// deprecated. Use instead the key 'data-html' into input $array, managed at next step to use HTML content.
9029
-					$out .= ' data-html="' . dol_escape_htmltag($selectOptionValue) . '"';
9029
+					$out .= ' data-html="'.dol_escape_htmltag($selectOptionValue).'"';
9030 9030
 				}
9031 9031
 
9032 9032
 				if (is_array($tmpvalue)) {
@@ -9049,7 +9049,7 @@  discard block
 block discarded – undo
9049 9049
 		// Add code for jquery to use multiselect
9050 9050
 		if ($addjscombo && $jsbeautify) {
9051 9051
 			// Enhance with select2
9052
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
9052
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
9053 9053
 			$out .= ajax_combobox($idname, array(), 0, 0, 'resolve', (((int) $show_empty) < 0 ? (string) $show_empty : '-1'), $morecss);
9054 9054
 		}
9055 9055
 
@@ -9077,28 +9077,28 @@  discard block
 block discarded – undo
9077 9077
 	public static function selectArrayAjax($htmlname, $url, $id = '', $moreparam = '', $moreparamtourl = '', $disabled = 0, $minimumInputLength = 1, $morecss = '', $callurlonselect = 0, $placeholder = '', $acceptdelayedhtml = 0)
9078 9078
 	{
9079 9079
 		global $conf;
9080
-		global $delayedhtmlcontent;    // Will be used later outside of this function
9080
+		global $delayedhtmlcontent; // Will be used later outside of this function
9081 9081
 
9082 9082
 		// TODO Use an internal dolibarr component instead of select2
9083 9083
 		if (!getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') && !defined('REQUIRE_JQUERY_MULTISELECT')) {
9084 9084
 			return '';
9085 9085
 		}
9086 9086
 
9087
-		$out = '<select type="text" class="' . $htmlname . ($morecss ? ' ' . $morecss : '') . '" ' . ($moreparam ? $moreparam . ' ' : '') . 'name="' . $htmlname . '"></select>';
9087
+		$out = '<select type="text" class="'.$htmlname.($morecss ? ' '.$morecss : '').'" '.($moreparam ? $moreparam.' ' : '').'name="'.$htmlname.'"></select>';
9088 9088
 
9089 9089
 		$outdelayed = '';
9090 9090
 		if (!empty($conf->use_javascript_ajax)) {
9091 9091
 			$tmpplugin = 'select2';
9092
-			$outdelayed = "\n" . '<!-- JS CODE TO ENABLE ' . $tmpplugin . ' for id ' . $htmlname . ' -->
9093
-		    	<script nonce="' . getNonce() . '">
9092
+			$outdelayed = "\n".'<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' -->
9093
+		    	<script nonce="' . getNonce().'">
9094 9094
 		    	$(document).ready(function () {
9095 9095
 
9096
-	    	        ' . ($callurlonselect ? 'var saveRemoteData = [];' : '') . '
9096
+	    	        ' . ($callurlonselect ? 'var saveRemoteData = [];' : '').'
9097 9097
 
9098
-	                $(".' . $htmlname . '").select2({
9098
+	                $(".' . $htmlname.'").select2({
9099 9099
 				    	ajax: {
9100 9100
 					    	dir: "ltr",
9101
-					    	url: "' . $url . '",
9101
+					    	url: "' . $url.'",
9102 9102
 					    	dataType: \'json\',
9103 9103
 					    	delay: 250,
9104 9104
 					    	data: function (params) {
@@ -9125,9 +9125,9 @@  discard block
 block discarded – undo
9125 9125
 				    	},
9126 9126
 		 				language: (typeof select2arrayoflanguage === \'undefined\') ? \'en\' : select2arrayoflanguage,
9127 9127
 						containerCssClass: \':all:\',					/* Line to add class from the original SELECT propagated to the new <span class="select2-selection...> tag */
9128
-					    placeholder: \'' . dol_escape_js($placeholder) . '\',
9128
+					    placeholder: \'' . dol_escape_js($placeholder).'\',
9129 9129
 				    	escapeMarkup: function (markup) { return markup; }, 	// let our custom formatter work
9130
-				    	minimumInputLength: ' . ((int) $minimumInputLength) . ',
9130
+				    	minimumInputLength: ' . ((int) $minimumInputLength).',
9131 9131
 				        formatResult: function (result, container, query, escapeMarkup) {
9132 9132
 	                        return escapeMarkup(result.text);
9133 9133
 	                    },
@@ -9135,10 +9135,10 @@  discard block
 block discarded – undo
9135 9135
 
9136 9136
 	                ' . ($callurlonselect ? '
9137 9137
 	                /* Code to execute a GET when we select a value */
9138
-	                $(".' . $htmlname . '").change(function() {
9139
-				    	var selected = $(\'.' . dol_escape_js($htmlname) . '\').val();
9138
+	                $(".' . $htmlname.'").change(function() {
9139
+				    	var selected = $(\'.' . dol_escape_js($htmlname).'\').val();
9140 9140
 	                	console.log("We select in selectArrayAjax the entry "+selected)
9141
-				        $(\'.' . dol_escape_js($htmlname) . '\').val("");  /* reset visible combo value */
9141
+				        $(\'.' . dol_escape_js($htmlname).'\').val("");  /* reset visible combo value */
9142 9142
 	    			    $.each( saveRemoteData, function( key, value ) {
9143 9143
 	    				        if (key == selected)
9144 9144
 	    			            {
@@ -9146,7 +9146,7 @@  discard block
 block discarded – undo
9146 9146
 	    			                 location.assign(value.url);
9147 9147
 	    			            }
9148 9148
 	                    });
9149
-	    			});' : '') . '
9149
+	    			});' : '').'
9150 9150
 
9151 9151
 	    	   });
9152 9152
 		       </script>';
@@ -9182,14 +9182,14 @@  discard block
 block discarded – undo
9182 9182
 	public static function selectArrayFilter($htmlname, $array, $id = '', $moreparam = '', $disableFiltering = 0, $disabled = 0, $minimumInputLength = 1, $morecss = '', $callurlonselect = 0, $placeholder = '', $acceptdelayedhtml = 0, $textfortitle = '')
9183 9183
 	{
9184 9184
 		global $conf;
9185
-		global $delayedhtmlcontent;    // Will be used later outside of this function
9185
+		global $delayedhtmlcontent; // Will be used later outside of this function
9186 9186
 
9187 9187
 		// TODO Use an internal dolibarr component instead of select2
9188 9188
 		if (!getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') && !defined('REQUIRE_JQUERY_MULTISELECT')) {
9189 9189
 			return '';
9190 9190
 		}
9191 9191
 
9192
-		$out = '<select type="text"'.($textfortitle ? ' title="'.dol_escape_htmltag($textfortitle).'"' : '').' id="'.$htmlname.'" class="'.$htmlname.($morecss ? ' ' . $morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.'"><option></option></select>';
9192
+		$out = '<select type="text"'.($textfortitle ? ' title="'.dol_escape_htmltag($textfortitle).'"' : '').' id="'.$htmlname.'" class="'.$htmlname.($morecss ? ' '.$morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.'"><option></option></select>';
9193 9193
 
9194 9194
 		$formattedarrayresult = array();
9195 9195
 
@@ -9204,20 +9204,20 @@  discard block
 block discarded – undo
9204 9204
 		$outdelayed = '';
9205 9205
 		if (!empty($conf->use_javascript_ajax)) {
9206 9206
 			$tmpplugin = 'select2';
9207
-			$outdelayed = "\n" . '<!-- JS CODE TO ENABLE ' . $tmpplugin . ' for id ' . $htmlname . ' -->
9208
-				<script nonce="' . getNonce() . '">
9207
+			$outdelayed = "\n".'<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' -->
9208
+				<script nonce="' . getNonce().'">
9209 9209
 				$(document).ready(function () {
9210
-					var data = ' . json_encode($formattedarrayresult) . ';
9210
+					var data = ' . json_encode($formattedarrayresult).';
9211 9211
 
9212
-					' . ($callurlonselect ? 'var saveRemoteData = ' . json_encode($array) . ';' : '') . '
9212
+					' . ($callurlonselect ? 'var saveRemoteData = '.json_encode($array).';' : '').'
9213 9213
 
9214
-					$(\'.' . dol_escape_js($htmlname) . '\').select2({
9214
+					$(\'.' . dol_escape_js($htmlname).'\').select2({
9215 9215
 						data: data,
9216 9216
 						language: (typeof select2arrayoflanguage === \'undefined\') ? \'en\' : select2arrayoflanguage,
9217 9217
 						containerCssClass: \':all:\',					/* Line to add class from the original SELECT propagated to the new <span class="select2-selection...> tag */
9218
-						placeholder: \'' . dol_escape_js($placeholder) . '\',
9218
+						placeholder: \'' . dol_escape_js($placeholder).'\',
9219 9219
 						escapeMarkup: function (markup) { return markup; }, 	// let our custom formatter work
9220
-						minimumInputLength: ' . ((int) $minimumInputLength) . ',
9220
+						minimumInputLength: ' . ((int) $minimumInputLength).',
9221 9221
 						formatResult: function (result, container, query, escapeMarkup) {
9222 9222
 							return escapeMarkup(result.text);
9223 9223
 						},
@@ -9256,11 +9256,11 @@  discard block
 block discarded – undo
9256 9256
 
9257 9257
 					' . ($callurlonselect ? '
9258 9258
 					/* Code to execute a GET when we select a value */
9259
-					$(\'.' . dol_escape_js($htmlname) . '\').change(function() {
9260
-						var selected = $(\'.' . dol_escape_js($htmlname) . '\').val();
9259
+					$(\'.' . dol_escape_js($htmlname).'\').change(function() {
9260
+						var selected = $(\'.' . dol_escape_js($htmlname).'\').val();
9261 9261
 						console.log("We select "+selected)
9262 9262
 
9263
-						$(\'.' . dol_escape_js($htmlname) . '\').val("");  /* reset visible combo value */
9263
+						$(\'.' . dol_escape_js($htmlname).'\').val("");  /* reset visible combo value */
9264 9264
 						$.each( saveRemoteData, function( key, value ) {
9265 9265
 							if (key == selected)
9266 9266
 							{
@@ -9268,7 +9268,7 @@  discard block
 block discarded – undo
9268 9268
 								location.assign(value.url);
9269 9269
 							}
9270 9270
 						});
9271
-					});' : '') . '
9271
+					});' : '').'
9272 9272
 
9273 9273
 				});
9274 9274
 				</script>';
@@ -9316,7 +9316,7 @@  discard block
 block discarded – undo
9316 9316
 		$useenhancedmultiselect = 0;
9317 9317
 		if (!empty($conf->use_javascript_ajax) && !defined('MAIN_DO_NOT_USE_JQUERY_MULTISELECT') && (getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') || defined('REQUIRE_JQUERY_MULTISELECT'))) {
9318 9318
 			if ($addjscombo) {
9319
-				$useenhancedmultiselect = 1;	// Use the js multiselect in one line. Possible only if $addjscombo not 0.
9319
+				$useenhancedmultiselect = 1; // Use the js multiselect in one line. Possible only if $addjscombo not 0.
9320 9320
 			}
9321 9321
 		}
9322 9322
 
@@ -9325,7 +9325,7 @@  discard block
 block discarded – undo
9325 9325
 		// submitted to nothing.
9326 9326
 		$out .= '<input type="hidden" name="'.$htmlname.'_multiselect" value="1">';
9327 9327
 		// Output select component
9328
-		$out .= '<select id="' . $htmlname . '" class="multiselect' . ($useenhancedmultiselect ? ' multiselectononeline' : '') . ($morecss ? ' ' . $morecss : '') . '" multiple name="' . $htmlname . '[]"' . ($moreattrib ? ' ' . $moreattrib : '') . ($width ? ' style="width: ' . (preg_match('/%/', (string) $width) ? $width : $width . 'px') . '"' : '') . '>' . "\n";
9328
+		$out .= '<select id="'.$htmlname.'" class="multiselect'.($useenhancedmultiselect ? ' multiselectononeline' : '').($morecss ? ' '.$morecss : '').'" multiple name="'.$htmlname.'[]"'.($moreattrib ? ' '.$moreattrib : '').($width ? ' style="width: '.(preg_match('/%/', (string) $width) ? $width : $width.'px').'"' : '').'>'."\n";
9329 9329
 		if (is_array($array) && !empty($array)) {
9330 9330
 			if ($value_as_key) {
9331 9331
 				$array = array_combine($array, $array);
@@ -9346,33 +9346,33 @@  discard block
 block discarded – undo
9346 9346
 						$tmplabelhtml = empty($value['labelhtml']) ? (empty($value['data-html']) ? '' : $value['data-html']) : $value['labelhtml'];
9347 9347
 					}
9348 9348
 					$newval = ($translate ? $langs->trans($tmpvalue) : $tmpvalue);
9349
-					$newval = ($key_in_label ? $tmpkey . ' - ' . $newval : $newval);
9349
+					$newval = ($key_in_label ? $tmpkey.' - '.$newval : $newval);
9350 9350
 
9351
-					$out .= '<option value="' . $tmpkey . '"';
9351
+					$out .= '<option value="'.$tmpkey.'"';
9352 9352
 					if (is_array($selected) && !empty($selected) && in_array((string) $tmpkey, $selected) && ((string) $tmpkey != '')) {
9353 9353
 						$out .= ' selected';
9354 9354
 					}
9355 9355
 					if (!empty($tmplabelhtml)) {
9356
-						$out .= ' data-html="' . dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1) . '"';
9356
+						$out .= ' data-html="'.dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1).'"';
9357 9357
 					} else {
9358
-						$tmplabelhtml = ($tmppicto ? img_picto('', $tmppicto, 'class="pictofixedwidth" style="color: #' . $tmpcolor . '"') : '') . $newval;
9359
-						$out .= ' data-html="' . dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1) . '"';
9358
+						$tmplabelhtml = ($tmppicto ? img_picto('', $tmppicto, 'class="pictofixedwidth" style="color: #'.$tmpcolor.'"') : '').$newval;
9359
+						$out .= ' data-html="'.dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1).'"';
9360 9360
 					}
9361 9361
 					$out .= '>';
9362 9362
 					$out .= dol_htmlentitiesbr($newval);
9363
-					$out .= '</option>' . "\n";
9363
+					$out .= '</option>'."\n";
9364 9364
 				}
9365 9365
 			}
9366 9366
 		}
9367
-		$out .= '</select>' . "\n";
9367
+		$out .= '</select>'."\n";
9368 9368
 
9369 9369
 		// Add code for jquery to use multiselect
9370 9370
 		if (!empty($conf->use_javascript_ajax) && getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') || defined('REQUIRE_JQUERY_MULTISELECT')) {
9371
-			$out .= "\n" . '<!-- JS CODE TO ENABLE select for id ' . $htmlname . ', addjscombo=' . $addjscombo . ' -->';
9372
-			$out .= "\n" . '<script nonce="' . getNonce() . '">' . "\n";
9371
+			$out .= "\n".'<!-- JS CODE TO ENABLE select for id '.$htmlname.', addjscombo='.$addjscombo.' -->';
9372
+			$out .= "\n".'<script nonce="'.getNonce().'">'."\n";
9373 9373
 			if ($addjscombo == 1) {
9374 9374
 				$tmpplugin = !getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') ? constant('REQUIRE_JQUERY_MULTISELECT') : $conf->global->MAIN_USE_JQUERY_MULTISELECT;
9375
-				$out .= 'function formatResult(record, container) {' . "\n";
9375
+				$out .= 'function formatResult(record, container) {'."\n";
9376 9376
 				// If property data-html set, we decode html entities and use this.
9377 9377
 				// Note that HTML content must have been sanitized from js with dol_escape_htmltag(xxx, 0, 0, '', 0, 1) when building the select option.
9378 9378
 				$out .= '	if ($(record.element).attr("data-html") != undefined && typeof htmlEntityDecodeJs === "function") {';
@@ -9380,26 +9380,26 @@  discard block
 block discarded – undo
9380 9380
 				$out .= '		return htmlEntityDecodeJs($(record.element).attr("data-html"));';
9381 9381
 				$out .= '	}'."\n";
9382 9382
 				$out .= '	return record.text;';
9383
-				$out .= '}' . "\n";
9384
-				$out .= 'function formatSelection(record) {' . "\n";
9383
+				$out .= '}'."\n";
9384
+				$out .= 'function formatSelection(record) {'."\n";
9385 9385
 				if ($elemtype == 'category') {
9386
-					$out .= 'return \'<span><img src="' . DOL_URL_ROOT . '/theme/eldy/img/object_category.png"> \'+record.text+\'</span>\';';
9386
+					$out .= 'return \'<span><img src="'.DOL_URL_ROOT.'/theme/eldy/img/object_category.png"> \'+record.text+\'</span>\';';
9387 9387
 				} else {
9388 9388
 					$out .= 'return record.text;';
9389 9389
 				}
9390
-				$out .= '}' . "\n";
9390
+				$out .= '}'."\n";
9391 9391
 				$out .= '$(document).ready(function () {
9392
-							$(\'#' . dol_escape_js($htmlname) . '\').' . $tmpplugin . '({';
9392
+							$(\'#' . dol_escape_js($htmlname).'\').'.$tmpplugin.'({';
9393 9393
 				if ($placeholder) {
9394 9394
 					$out .= '
9395 9395
 								placeholder: {
9396 9396
 								    id: \'-1\',
9397
-								    text: \'' . dol_escape_js($placeholder) . '\'
9397
+								    text: \'' . dol_escape_js($placeholder).'\'
9398 9398
 								  },';
9399 9399
 				}
9400 9400
 				$out .= '		dir: \'ltr\',
9401 9401
 								containerCssClass: \':all:\',					/* Line to add class of origin SELECT propagated to the new <span class="select2-selection...> tag (ko with multiselect) */
9402
-								dropdownCssClass: \'' . dol_escape_js($morecss) . '\',				/* Line to add class on the new <span class="select2-selection...> tag (ok with multiselect). Need full version of select2. */
9402
+								dropdownCssClass: \'' . dol_escape_js($morecss).'\',				/* Line to add class on the new <span class="select2-selection...> tag (ok with multiselect). Need full version of select2. */
9403 9403
 								// Specify format function for dropdown item
9404 9404
 								formatResult: formatResult,
9405 9405
 							 	templateResult: formatResult,		/* For 4.0 */
@@ -9412,21 +9412,21 @@  discard block
 block discarded – undo
9412 9412
 
9413 9413
 							/* Add also morecss to the css .select2 that is after the #htmlname, for component that are show dynamically after load, because select2 set
9414 9414
 								 the size only if component is not hidden by default on load */
9415
-							$(\'#' . dol_escape_js($htmlname) . ' + .select2\').addClass(\'' . dol_escape_js($morecss) . '\');
9415
+							$(\'#' . dol_escape_js($htmlname).' + .select2\').addClass(\''.dol_escape_js($morecss).'\');
9416 9416
 						});' . "\n";
9417 9417
 			} elseif ($addjscombo == 2 && !defined('DISABLE_MULTISELECT')) {
9418 9418
 				// Add other js lib
9419 9419
 				// TODO external lib multiselect/jquery.multi-select.js must have been loaded to use this multiselect plugin
9420 9420
 				// ...
9421
-				$out .= 'console.log(\'addjscombo=2 for htmlname=' . dol_escape_js($htmlname) . '\');';
9421
+				$out .= 'console.log(\'addjscombo=2 for htmlname='.dol_escape_js($htmlname).'\');';
9422 9422
 				$out .= '$(document).ready(function () {
9423
-							$(\'#' . dol_escape_js($htmlname) . '\').multiSelect({
9423
+							$(\'#' . dol_escape_js($htmlname).'\').multiSelect({
9424 9424
 								containerHTML: \'<div class="multi-select-container">\',
9425 9425
 								menuHTML: \'<div class="multi-select-menu">\',
9426
-								buttonHTML: \'<span class="multi-select-button ' . dol_escape_js($morecss) . '">\',
9426
+								buttonHTML: \'<span class="multi-select-button ' . dol_escape_js($morecss).'">\',
9427 9427
 								menuItemHTML: \'<label class="multi-select-menuitem">\',
9428 9428
 								activeClass: \'multi-select-container--open\',
9429
-								noneText: \'' . dol_escape_js($placeholder) . '\'
9429
+								noneText: \'' . dol_escape_js($placeholder).'\'
9430 9430
 							});
9431 9431
 						})';
9432 9432
 			}
@@ -9459,7 +9459,7 @@  discard block
 block discarded – undo
9459 9459
 			return '';
9460 9460
 		}
9461 9461
 
9462
-		$tmpvar = "MAIN_SELECTEDFIELDS_" . $varpage; // To get list of saved selected fields to show
9462
+		$tmpvar = "MAIN_SELECTEDFIELDS_".$varpage; // To get list of saved selected fields to show
9463 9463
 
9464 9464
 		if (!empty($user->conf->$tmpvar)) {        // A list of fields was already customized for user
9465 9465
 			$tmparray = explode(',', $user->conf->$tmpvar);
@@ -9502,19 +9502,19 @@  discard block
 block discarded – undo
9502 9502
 				}
9503 9503
 
9504 9504
 				// Note: $val['checked'] <> 0 means we must show the field into the combo list  @phan-suppress-next-line PhanTypePossiblyInvalidDimOffset
9505
-				$listoffieldsforselection .= '<li><input type="checkbox" id="checkbox' . $key . '" value="' . $key . '"' . ((!array_key_exists('checked', $val) || empty($val['checked']) || $val['checked'] == '-1') ? '' : ' checked="checked"') . ' data-position="'.(empty($val['position']) ? '' : $val['position']).'" /><label for="checkbox' . $key . '">' . dol_escape_htmltag($langs->trans($val['label'])) . '</label></li>';
9506
-				$listcheckedstring .= (empty($val['checked']) ? '' : $key . ',');
9505
+				$listoffieldsforselection .= '<li><input type="checkbox" id="checkbox'.$key.'" value="'.$key.'"'.((!array_key_exists('checked', $val) || empty($val['checked']) || $val['checked'] == '-1') ? '' : ' checked="checked"').' data-position="'.(empty($val['position']) ? '' : $val['position']).'" /><label for="checkbox'.$key.'">'.dol_escape_htmltag($langs->trans($val['label'])).'</label></li>';
9506
+				$listcheckedstring .= (empty($val['checked']) ? '' : $key.',');
9507 9507
 			}
9508 9508
 		}
9509 9509
 
9510
-		$out = '<!-- Component multiSelectArrayWithCheckbox ' . $htmlname . ' -->
9510
+		$out = '<!-- Component multiSelectArrayWithCheckbox '.$htmlname.' -->
9511 9511
 
9512 9512
         <dl class="dropdown">
9513 9513
             <dt>
9514
-            <a href="#' . $htmlname . '">
9515
-              ' . img_picto('', 'list') . '
9514
+            <a href="#' . $htmlname.'">
9515
+              ' . img_picto('', 'list').'
9516 9516
             </a>
9517
-            <input type="hidden" class="' . $htmlname . '" name="' . $htmlname . '" value="' . $listcheckedstring . '">
9517
+            <input type="hidden" class="' . $htmlname.'" name="'.$htmlname.'" value="'.$listcheckedstring.'">
9518 9518
             </dt>
9519 9519
             <dd class="dropdowndd">
9520 9520
                 <div class="multiselectcheckbox'.$htmlname.'">
@@ -9526,19 +9526,19 @@  discard block
 block discarded – undo
9526 9526
             </dd>
9527 9527
         </dl>
9528 9528
 
9529
-        <script nonce="' . getNonce() . '" type="text/javascript">
9529
+        <script nonce="' . getNonce().'" type="text/javascript">
9530 9530
           jQuery(document).ready(function () {
9531
-              $(\'.multiselectcheckbox' . $htmlname . ' input[type="checkbox"]\').on(\'click\', function () {
9531
+              $(\'.multiselectcheckbox' . $htmlname.' input[type="checkbox"]\').on(\'click\', function () {
9532 9532
                   console.log("A new field was added/removed, we edit field input[name=formfilteraction]");
9533 9533
 
9534 9534
                   $("input:hidden[name=formfilteraction]").val(\'listafterchangingselectedfields\');	// Update field so we know we changed something on selected fields after POST
9535 9535
 
9536 9536
                   var title = $(this).val() + ",";
9537 9537
                   if ($(this).is(\':checked\')) {
9538
-                      $(\'.' . $htmlname . '\').val(title + $(\'.' . $htmlname . '\').val());
9538
+                      $(\'.' . $htmlname.'\').val(title + $(\'.'.$htmlname.'\').val());
9539 9539
                   }
9540 9540
                   else {
9541
-                      $(\'.' . $htmlname . '\').val( $(\'.' . $htmlname . '\').val().replace(title, \'\') )
9541
+                      $(\'.' . $htmlname.'\').val( $(\'.'.$htmlname.'\').val().replace(title, \'\') )
9542 9542
                   }
9543 9543
                   // Now, we submit page
9544 9544
                   //$(this).parents(\'form:first\').submit();
@@ -9569,7 +9569,7 @@  discard block
 block discarded – undo
9569 9569
 	 */
9570 9570
 	public function showCategories($id, $type, $rendermode = 0, $nolink = 0)
9571 9571
 	{
9572
-		include_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
9572
+		include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
9573 9573
 
9574 9574
 		$cat = new Categorie($this->db);
9575 9575
 		$categories = $cat->containing($id, $type);
@@ -9579,13 +9579,13 @@  discard block
 block discarded – undo
9579 9579
 			foreach ($categories as $c) {
9580 9580
 				$ways = $c->print_all_ways(' &gt;&gt; ', ($nolink ? 'none' : ''), 0, 1); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text
9581 9581
 				foreach ($ways as $way) {
9582
-					$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #bbb"') . '>' . $way . '</li>';
9582
+					$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #bbb"').'>'.$way.'</li>';
9583 9583
 				}
9584 9584
 			}
9585 9585
 			if (empty($toprint)) {
9586 9586
 				return '';
9587 9587
 			} else {
9588
-				return '<div class="select2-container-multi-dolibarr"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>';
9588
+				return '<div class="select2-container-multi-dolibarr"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
9589 9589
 			}
9590 9590
 		}
9591 9591
 
@@ -9634,15 +9634,15 @@  discard block
 block discarded – undo
9634 9634
 
9635 9635
 
9636 9636
 			print '<div class="div-table-responsive-no-min">';
9637
-			print '<table class="noborder allwidth" data-block="showLinkedObject" data-element="' . $object->element . '"  data-elementid="' . $object->id . '"   >';
9637
+			print '<table class="noborder allwidth" data-block="showLinkedObject" data-element="'.$object->element.'"  data-elementid="'.$object->id.'"   >';
9638 9638
 
9639 9639
 			print '<tr class="liste_titre">';
9640
-			print '<td>' . $langs->trans("Type") . '</td>';
9641
-			print '<td>' . $langs->trans("Ref") . '</td>';
9640
+			print '<td>'.$langs->trans("Type").'</td>';
9641
+			print '<td>'.$langs->trans("Ref").'</td>';
9642 9642
 			print '<td class="center"></td>';
9643
-			print '<td class="center">' . $langs->trans("Date") . '</td>';
9644
-			print '<td class="right">' . $langs->trans("AmountHTShort") . '</td>';
9645
-			print '<td class="right">' . $langs->trans("Status") . '</td>';
9643
+			print '<td class="center">'.$langs->trans("Date").'</td>';
9644
+			print '<td class="right">'.$langs->trans("AmountHTShort").'</td>';
9645
+			print '<td class="right">'.$langs->trans("Status").'</td>';
9646 9646
 			print '<td></td>';
9647 9647
 			print '</tr>';
9648 9648
 
@@ -9661,13 +9661,13 @@  discard block
 block discarded – undo
9661 9661
 				if ($objecttype != 'supplier_proposal' && preg_match('/^([^_]+)_([^_]+)/i', $objecttype, $regs)) {
9662 9662
 					$element = $regs[1];
9663 9663
 					$subelement = $regs[2];
9664
-					$tplpath = $element . '/' . $subelement;
9664
+					$tplpath = $element.'/'.$subelement;
9665 9665
 				}
9666 9666
 				$tplname = 'linkedobjectblock';
9667 9667
 
9668 9668
 				// To work with non standard path
9669 9669
 				if ($objecttype == 'facture') {
9670
-					$tplpath = 'compta/' . $element;
9670
+					$tplpath = 'compta/'.$element;
9671 9671
 					if (!isModEnabled('invoice')) {
9672 9672
 						continue; // Do not show if module disabled
9673 9673
 					}
@@ -9678,7 +9678,7 @@  discard block
 block discarded – undo
9678 9678
 						continue; // Do not show if module disabled
9679 9679
 					}
9680 9680
 				} elseif ($objecttype == 'propal') {
9681
-					$tplpath = 'comm/' . $element;
9681
+					$tplpath = 'comm/'.$element;
9682 9682
 					if (!isModEnabled('propal')) {
9683 9683
 						continue; // Do not show if module disabled
9684 9684
 					}
@@ -9731,7 +9731,7 @@  discard block
 block discarded – undo
9731 9731
 				$linkedObjectBlock = $objects;
9732 9732
 
9733 9733
 				// Output template part (modules that overwrite templates must declare this into descriptor)
9734
-				$dirtpls = array_merge($conf->modules_parts['tpl'], array('/' . $tplpath . '/tpl'));
9734
+				$dirtpls = array_merge($conf->modules_parts['tpl'], array('/'.$tplpath.'/tpl'));
9735 9735
 				foreach ($dirtpls as $reldir) {
9736 9736
 					$reldir = rtrim($reldir, '/');
9737 9737
 					if ($nboftypesoutput == ($nbofdifferenttypes - 1)) {    // No more type to show after
@@ -9739,7 +9739,7 @@  discard block
 block discarded – undo
9739 9739
 						$noMoreLinkedObjectBlockAfter = 1;
9740 9740
 					}
9741 9741
 
9742
-					$res = @include dol_buildpath($reldir . '/' . $tplname . '.tpl.php');
9742
+					$res = @include dol_buildpath($reldir.'/'.$tplname.'.tpl.php');
9743 9743
 					if ($res) {
9744 9744
 						$nboftypesoutput++;
9745 9745
 						break;
@@ -9748,7 +9748,7 @@  discard block
 block discarded – undo
9748 9748
 			}
9749 9749
 
9750 9750
 			if (!$nboftypesoutput) {
9751
-				print '<tr><td colspan="7"><span class="opacitymedium">' . $langs->trans("None") . '</span></td></tr>';
9751
+				print '<tr><td colspan="7"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
9752 9752
 			}
9753 9753
 
9754 9754
 			print '</table>';
@@ -9796,14 +9796,14 @@  discard block
 block discarded – undo
9796 9796
 		if (is_object($object->thirdparty) && !empty($object->thirdparty->id) && $object->thirdparty->id > 0) {
9797 9797
 			$listofidcompanytoscan = (int) $object->thirdparty->id;
9798 9798
 			if (($object->thirdparty->parent > 0) && getDolGlobalString('THIRDPARTY_INCLUDE_PARENT_IN_LINKTO')) {
9799
-				$listofidcompanytoscan .= ',' . (int) $object->thirdparty->parent;
9799
+				$listofidcompanytoscan .= ','.(int) $object->thirdparty->parent;
9800 9800
 			}
9801 9801
 			if (($object->fk_project > 0) && getDolGlobalString('THIRDPARTY_INCLUDE_PROJECT_THIRDPARY_IN_LINKTO')) {
9802
-				include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
9802
+				include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
9803 9803
 				$tmpproject = new Project($this->db);
9804 9804
 				$tmpproject->fetch($object->fk_project);
9805 9805
 				if ($tmpproject->socid > 0 && ($tmpproject->socid != $object->thirdparty->id)) {
9806
-					$listofidcompanytoscan .= ',' . (int) $tmpproject->socid;
9806
+					$listofidcompanytoscan .= ','.(int) $tmpproject->socid;
9807 9807
 				}
9808 9808
 				unset($tmpproject);
9809 9809
 			}
@@ -9813,75 +9813,75 @@  discard block
 block discarded – undo
9813 9813
 					'enabled' => isModEnabled('propal'),
9814 9814
 					'perms' => 1,
9815 9815
 					'label' => 'LinkToProposal',
9816
-					'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "propal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('propal') . ')'.($dontIncludeCompletedItems ? ' AND t.fk_statut < 4' : ''),
9816
+					'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."propal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('propal').')'.($dontIncludeCompletedItems ? ' AND t.fk_statut < 4' : ''),
9817 9817
 				),
9818 9818
 				'shipping' => array(
9819 9819
 					'enabled' => isModEnabled('shipping'),
9820 9820
 					'perms' => 1,
9821 9821
 					'label' => 'LinkToExpedition',
9822
-					'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "expedition as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('shipping') . ')'.($dontIncludeCompletedItems ? ' AND t.fk_statut < 2' : ''),
9822
+					'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."expedition as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('shipping').')'.($dontIncludeCompletedItems ? ' AND t.fk_statut < 2' : ''),
9823 9823
 				),
9824 9824
 				'order' => array(
9825 9825
 					'enabled' => isModEnabled('order'),
9826 9826
 					'perms' => 1,
9827 9827
 					'label' => 'LinkToOrder',
9828
-					'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "commande as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('commande') . ')'.($dontIncludeCompletedItems ? ' AND t.facture < 1' : ''),
9828
+					'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."commande as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('commande').')'.($dontIncludeCompletedItems ? ' AND t.facture < 1' : ''),
9829 9829
 					'linkname' => 'commande',
9830 9830
 				),
9831 9831
 				'invoice' => array(
9832 9832
 					'enabled' => isModEnabled('invoice'),
9833 9833
 					'perms' => 1,
9834 9834
 					'label' => 'LinkToInvoice',
9835
-					'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "facture as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('invoice') . ')'.($dontIncludeCompletedItems ? ' AND t.paye < 1' : ''),
9835
+					'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."facture as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('invoice').')'.($dontIncludeCompletedItems ? ' AND t.paye < 1' : ''),
9836 9836
 					'linkname' => 'facture',
9837 9837
 				),
9838 9838
 				'invoice_template' => array(
9839 9839
 					'enabled' => isModEnabled('invoice'),
9840 9840
 					'perms' => 1,
9841 9841
 					'label' => 'LinkToTemplateInvoice',
9842
-					'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.titre as ref, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "facture_rec as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('invoice') . ')'.($dontIncludeCompletedItems ? ' AND t.paye < 1' : ''),
9842
+					'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.titre as ref, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."facture_rec as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('invoice').')'.($dontIncludeCompletedItems ? ' AND t.paye < 1' : ''),
9843 9843
 				),
9844 9844
 				'contrat' => array(
9845 9845
 					'enabled' => isModEnabled('contract'),
9846 9846
 					'perms' => 1,
9847 9847
 					'label' => 'LinkToContract',
9848 9848
 					'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
9849
-							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',
9849
+							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',
9850 9850
 				),
9851 9851
 				'fichinter' => array(
9852 9852
 					'enabled' => isModEnabled('intervention'),
9853 9853
 					'perms' => 1,
9854 9854
 					'label' => 'LinkToIntervention',
9855
-					'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') . ')',
9855
+					'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').')',
9856 9856
 				),
9857 9857
 				'supplier_proposal' => array(
9858 9858
 					'enabled' => isModEnabled('supplier_proposal'),
9859 9859
 					'perms' => 1,
9860 9860
 					'label' => 'LinkToSupplierProposal',
9861
-					'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, '' as ref_supplier, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "supplier_proposal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('supplier_proposal') . ')'.($dontIncludeCompletedItems ? ' AND t.fk_statut < 4' : ''),
9861
+					'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, '' as ref_supplier, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."supplier_proposal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('supplier_proposal').')'.($dontIncludeCompletedItems ? ' AND t.fk_statut < 4' : ''),
9862 9862
 				),
9863 9863
 				'order_supplier' => array(
9864 9864
 					'enabled' => isModEnabled("supplier_order"),
9865 9865
 					'perms' => 1,
9866 9866
 					'label' => 'LinkToSupplierOrder',
9867
-					'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "commande_fournisseur as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('commande_fournisseur') . ')'.($dontIncludeCompletedItems ? ' AND t.billed < 1' : ''),
9867
+					'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."commande_fournisseur as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('commande_fournisseur').')'.($dontIncludeCompletedItems ? ' AND t.billed < 1' : ''),
9868 9868
 				),
9869 9869
 				'invoice_supplier' => array(
9870 9870
 					'enabled' => isModEnabled("supplier_invoice"),
9871 9871
 					'perms' => 1, 'label' => 'LinkToSupplierInvoice',
9872
-					'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "facture_fourn as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('facture_fourn') . ')'.($dontIncludeCompletedItems ? ' AND t.paye < 1' : ''),
9872
+					'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."facture_fourn as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('facture_fourn').')'.($dontIncludeCompletedItems ? ' AND t.paye < 1' : ''),
9873 9873
 				),
9874 9874
 				'ticket' => array(
9875 9875
 					'enabled' => isModEnabled('ticket'),
9876 9876
 					'perms' => 1,
9877 9877
 					'label' => 'LinkToTicket',
9878
-					'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.track_id, '0' as total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "ticket as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('ticket') . ')'.($dontIncludeCompletedItems ? ' AND t.fk_statut < 8' : ''),
9878
+					'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.track_id, '0' as total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."ticket as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('ticket').')'.($dontIncludeCompletedItems ? ' AND t.fk_statut < 8' : ''),
9879 9879
 				),
9880 9880
 				'mo' => array(
9881 9881
 					'enabled' => isModEnabled('mrp'),
9882 9882
 					'perms' => 1,
9883 9883
 					'label' => 'LinkToMo',
9884
-					'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.rowid, '0' as total_ht FROM " . $this->db->prefix() . "societe as s INNER JOIN " . $this->db->prefix() . "mrp_mo as t ON t.fk_soc = s.rowid  WHERE  t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('mo') . ')'.($dontIncludeCompletedItems ? ' AND t.status < 3' : ''),
9884
+					'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.rowid, '0' as total_ht FROM ".$this->db->prefix()."societe as s INNER JOIN ".$this->db->prefix()."mrp_mo as t ON t.fk_soc = s.rowid  WHERE  t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('mo').')'.($dontIncludeCompletedItems ? ' AND t.status < 3' : ''),
9885 9885
 				),
9886 9886
 			);
9887 9887
 		}
@@ -9923,23 +9923,23 @@  discard block
 block discarded – undo
9923 9923
 			}
9924 9924
 
9925 9925
 			if (!empty($possiblelink['perms']) && (empty($restrictlinksto) || in_array($key, $restrictlinksto)) && (empty($excludelinksto) || !in_array($key, $excludelinksto))) {
9926
-				$htmltoenteralink .= '<div id="' . $key . 'list"' . (empty($conf->use_javascript_ajax) ? '' : ' style="display:none"') . '>';
9926
+				$htmltoenteralink .= '<div id="'.$key.'list"'.(empty($conf->use_javascript_ajax) ? '' : ' style="display:none"').'>';
9927 9927
 
9928 9928
 				// Section for free ref input
9929 9929
 				if (!getDolGlobalString('MAIN_HIDE_LINK_BY_REF_IN_LINKTO')) {
9930 9930
 					$htmltoenteralink .= '<br>'."\n";
9931 9931
 					$htmltoenteralink .= '<!-- form to add a link from anywhere -->'."\n";
9932
-					$htmltoenteralink .= '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST" name="formlinkedbyref' . $key . '">';
9933
-					$htmltoenteralink .= '<input type="hidden" name="token" value="' . newToken() . '">';
9932
+					$htmltoenteralink .= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" name="formlinkedbyref'.$key.'">';
9933
+					$htmltoenteralink .= '<input type="hidden" name="token" value="'.newToken().'">';
9934 9934
 					$htmltoenteralink .= '<input type="hidden" name="action" value="addlinkbyref">';
9935
-					$htmltoenteralink .= '<input type="hidden" name="id" value="' . $object->id . '">';
9936
-					$htmltoenteralink .= '<input type="hidden" name="addlink" value="' . $key . '">';
9935
+					$htmltoenteralink .= '<input type="hidden" name="id" value="'.$object->id.'">';
9936
+					$htmltoenteralink .= '<input type="hidden" name="addlink" value="'.$key.'">';
9937 9937
 					$htmltoenteralink .= '<table class="noborder">';
9938 9938
 					$htmltoenteralink .= '<tr class="liste_titre">';
9939 9939
 					//print '<td>' . $langs->trans("Ref") . '</td>';
9940
-					$htmltoenteralink .= '<td class="center"><input type="text" placeholder="'.dol_escape_htmltag($langs->trans("Ref")).'" name="reftolinkto" value="' . dol_escape_htmltag(GETPOST('reftolinkto', 'alpha')) . '">&nbsp;';
9941
-					$htmltoenteralink .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans('ToLink') . '">&nbsp;';
9942
-					$htmltoenteralink .= '<input type="submit" class="button smallpaddingimp" name="cancel" value="' . $langs->trans('Cancel') . '"></td>';
9940
+					$htmltoenteralink .= '<td class="center"><input type="text" placeholder="'.dol_escape_htmltag($langs->trans("Ref")).'" name="reftolinkto" value="'.dol_escape_htmltag(GETPOST('reftolinkto', 'alpha')).'">&nbsp;';
9941
+					$htmltoenteralink .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans('ToLink').'">&nbsp;';
9942
+					$htmltoenteralink .= '<input type="submit" class="button smallpaddingimp" name="cancel" value="'.$langs->trans('Cancel').'"></td>';
9943 9943
 					$htmltoenteralink .= '</tr>';
9944 9944
 					$htmltoenteralink .= '</table>';
9945 9945
 					$htmltoenteralink .= '</form>';
@@ -9958,18 +9958,18 @@  discard block
 block discarded – undo
9958 9958
 							$htmltoenteralink .= '<br>';
9959 9959
 						}
9960 9960
 						$htmltoenteralink .= '<!-- form to add a link from object to same thirdparty -->'."\n";
9961
-						$htmltoenteralink .= '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST" name="formlinked' . $key . '">';
9962
-						$htmltoenteralink .= '<input type="hidden" name="token" value="' . newToken() . '">';
9961
+						$htmltoenteralink .= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" name="formlinked'.$key.'">';
9962
+						$htmltoenteralink .= '<input type="hidden" name="token" value="'.newToken().'">';
9963 9963
 						$htmltoenteralink .= '<input type="hidden" name="action" value="addlink">';
9964
-						$htmltoenteralink .= '<input type="hidden" name="id" value="' . $object->id . '">';
9965
-						$htmltoenteralink .= '<input type="hidden" name="addlink" value="' . $key . '">';
9964
+						$htmltoenteralink .= '<input type="hidden" name="id" value="'.$object->id.'">';
9965
+						$htmltoenteralink .= '<input type="hidden" name="addlink" value="'.$key.'">';
9966 9966
 						$htmltoenteralink .= '<table class="noborder">';
9967 9967
 						$htmltoenteralink .= '<tr class="liste_titre">';
9968 9968
 						$htmltoenteralink .= '<td class="nowrap"></td>';
9969
-						$htmltoenteralink .= '<td>' . $langs->trans("Ref") . '</td>';
9970
-						$htmltoenteralink .= '<td>' . $langs->trans("RefCustomer") . '</td>';
9971
-						$htmltoenteralink .= '<td class="right">' . $langs->trans("AmountHTShort") . '</td>';
9972
-						$htmltoenteralink .= '<td>' . $langs->trans("Company") . '</td>';
9969
+						$htmltoenteralink .= '<td>'.$langs->trans("Ref").'</td>';
9970
+						$htmltoenteralink .= '<td>'.$langs->trans("RefCustomer").'</td>';
9971
+						$htmltoenteralink .= '<td class="right">'.$langs->trans("AmountHTShort").'</td>';
9972
+						$htmltoenteralink .= '<td>'.$langs->trans("Company").'</td>';
9973 9973
 						$htmltoenteralink .= '</tr>';
9974 9974
 						while ($i < $num) {
9975 9975
 							$objp = $this->db->fetch_object($resqllist);
@@ -9984,30 +9984,30 @@  discard block
 block discarded – undo
9984 9984
 							if ($alreadylinked) {
9985 9985
 								$htmltoenteralink .= img_picto('', 'link');
9986 9986
 							} else {
9987
-								$htmltoenteralink .= '<input type="checkbox" name="idtolinkto[' . $key . '_' . $objp->rowid . ']" id="' . $key . '_' . $objp->rowid . '" value="' . $objp->rowid . '">';
9987
+								$htmltoenteralink .= '<input type="checkbox" name="idtolinkto['.$key.'_'.$objp->rowid.']" id="'.$key.'_'.$objp->rowid.'" value="'.$objp->rowid.'">';
9988 9988
 							}
9989 9989
 							$htmltoenteralink .= '</td>';
9990
-							$htmltoenteralink .= '<td><label for="' . $key . '_' . $objp->rowid . '">' . $objp->ref . '</label></td>';
9991
-							$htmltoenteralink .= '<td>' . (!empty($objp->ref_client) ? $objp->ref_client : (!empty($objp->ref_supplier) ? $objp->ref_supplier : '')) . '</td>';
9990
+							$htmltoenteralink .= '<td><label for="'.$key.'_'.$objp->rowid.'">'.$objp->ref.'</label></td>';
9991
+							$htmltoenteralink .= '<td>'.(!empty($objp->ref_client) ? $objp->ref_client : (!empty($objp->ref_supplier) ? $objp->ref_supplier : '')).'</td>';
9992 9992
 							$htmltoenteralink .= '<td class="right">';
9993 9993
 							if ($possiblelink['label'] == 'LinkToContract') {
9994
-								$htmltoenteralink .= $form->textwithpicto('', $langs->trans("InformationOnLinkToContract")) . ' ';
9994
+								$htmltoenteralink .= $form->textwithpicto('', $langs->trans("InformationOnLinkToContract")).' ';
9995 9995
 							}
9996
-							$htmltoenteralink .= '<span class="amount">' . (isset($objp->total_ht) ? price($objp->total_ht) : '') . '</span>';
9996
+							$htmltoenteralink .= '<span class="amount">'.(isset($objp->total_ht) ? price($objp->total_ht) : '').'</span>';
9997 9997
 							$htmltoenteralink .= '</td>';
9998
-							$htmltoenteralink .= '<td>' . $objp->name . '</td>';
9998
+							$htmltoenteralink .= '<td>'.$objp->name.'</td>';
9999 9999
 							$htmltoenteralink .= '</tr>';
10000 10000
 							$i++;
10001 10001
 						}
10002 10002
 						$htmltoenteralink .= '</table>';
10003 10003
 						$htmltoenteralink .= '<div class="center">';
10004 10004
 						if ($num) {
10005
-							$htmltoenteralink .= '<input type="submit" class="button valignmiddle marginleftonly marginrightonly smallpaddingimp" value="' . $langs->trans('ToLink') . '">';
10005
+							$htmltoenteralink .= '<input type="submit" class="button valignmiddle marginleftonly marginrightonly smallpaddingimp" value="'.$langs->trans('ToLink').'">';
10006 10006
 						}
10007 10007
 						if (empty($conf->use_javascript_ajax)) {
10008
-							$htmltoenteralink .= '<input type="submit" class="button button-cancel marginleftonly marginrightonly smallpaddingimp" name="cancel" value="' . $langs->trans("Cancel") . '"></div>';
10008
+							$htmltoenteralink .= '<input type="submit" class="button button-cancel marginleftonly marginrightonly smallpaddingimp" name="cancel" value="'.$langs->trans("Cancel").'"></div>';
10009 10009
 						} else {
10010
-							$htmltoenteralink .= '<input type="submit" onclick="jQuery(\'#' . $key . 'list\').toggle(); return false;" class="button button-cancel marginleftonly marginrightonly smallpaddingimp" name="cancel" value="' . $langs->trans("Cancel") . '"></div>';
10010
+							$htmltoenteralink .= '<input type="submit" onclick="jQuery(\'#'.$key.'list\').toggle(); return false;" class="button button-cancel marginleftonly marginrightonly smallpaddingimp" name="cancel" value="'.$langs->trans("Cancel").'"></div>';
10011 10011
 						}
10012 10012
 						$htmltoenteralink .= '</form>';
10013 10013
 					}
@@ -10021,10 +10021,10 @@  discard block
 block discarded – undo
10021 10021
 
10022 10022
 				// Complete the list for the combo box
10023 10023
 				if ($num > 0 || !getDolGlobalString('MAIN_HIDE_LINK_BY_REF_IN_LINKTO')) {
10024
-					$linktoelemlist .= '<li><a href="#linkto' . $key . '" class="linkto dropdowncloseonclick" rel="' . $key . '">' . $langs->trans($possiblelink['label']) . ' (' . $num . ')</a></li>';
10024
+					$linktoelemlist .= '<li><a href="#linkto'.$key.'" class="linkto dropdowncloseonclick" rel="'.$key.'">'.$langs->trans($possiblelink['label']).' ('.$num.')</a></li>';
10025 10025
 					// } else $linktoelem.=$langs->trans($possiblelink['label']);
10026 10026
 				} else {
10027
-					$linktoelemlist .= '<li><span class="linktodisabled">' . $langs->trans($possiblelink['label']) . ' (0)</span></li>';
10027
+					$linktoelemlist .= '<li><span class="linktodisabled">'.$langs->trans($possiblelink['label']).' (0)</span></li>';
10028 10028
 				}
10029 10029
 			}
10030 10030
 		}
@@ -10034,11 +10034,11 @@  discard block
 block discarded – undo
10034 10034
 			<dl class="dropdown" id="linktoobjectname">
10035 10035
 			';
10036 10036
 			if (!empty($conf->use_javascript_ajax)) {
10037
-				$linktoelem .= '<dt><a href="#linktoobjectname"><span class="fas fa-link paddingrightonly"></span>' . $langs->trans("LinkTo") . '...</a></dt>';
10037
+				$linktoelem .= '<dt><a href="#linktoobjectname"><span class="fas fa-link paddingrightonly"></span>'.$langs->trans("LinkTo").'...</a></dt>';
10038 10038
 			}
10039 10039
 			$linktoelem .= '<dd>
10040 10040
 			<div class="multiselectlinkto">
10041
-			<ul class="ulselectedfields">' . $linktoelemlist . '
10041
+			<ul class="ulselectedfields">' . $linktoelemlist.'
10042 10042
 			</ul>
10043 10043
 			</div>
10044 10044
 			</dd>
@@ -10049,7 +10049,7 @@  discard block
 block discarded – undo
10049 10049
 
10050 10050
 		if (!empty($conf->use_javascript_ajax)) {
10051 10051
 			print '<!-- Add js to show linkto box -->
10052
-				<script nonce="' . getNonce() . '">
10052
+				<script nonce="' . getNonce().'">
10053 10053
 				jQuery(document).ready(function() {
10054 10054
 					jQuery(".linkto").click(function() {
10055 10055
 						console.log("We choose to show/hide links for rel="+jQuery(this).attr(\'rel\')+" so #"+jQuery(this).attr(\'rel\')+"list");
@@ -10096,19 +10096,19 @@  discard block
 block discarded – undo
10096 10096
 
10097 10097
 		$disabled = ($disabled ? ' disabled' : '');
10098 10098
 
10099
-		$resultyesno = '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . '"' . $disabled . '>' . "\n";
10099
+		$resultyesno = '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.'"'.$disabled.'>'."\n";
10100 10100
 		if ($useempty) {
10101
-			$resultyesno .= '<option value="-1"' . (($value < 0) ? ' selected' : '') . '>&nbsp;</option>' . "\n";
10101
+			$resultyesno .= '<option value="-1"'.(($value < 0) ? ' selected' : '').'>&nbsp;</option>'."\n";
10102 10102
 		}
10103 10103
 		if (("$value" == 'yes') || ($value == 1)) {
10104
-			$resultyesno .= '<option value="' . $yes . '" selected>' . $langs->trans($labelyes) . '</option>' . "\n";
10105
-			$resultyesno .= '<option value="' . $no . '">' . $langs->trans($labelno) . '</option>' . "\n";
10104
+			$resultyesno .= '<option value="'.$yes.'" selected>'.$langs->trans($labelyes).'</option>'."\n";
10105
+			$resultyesno .= '<option value="'.$no.'">'.$langs->trans($labelno).'</option>'."\n";
10106 10106
 		} else {
10107 10107
 			$selected = (($useempty && $value != '0' && $value != 'no') ? '' : ' selected');
10108
-			$resultyesno .= '<option value="' . $yes . '">' . $langs->trans($labelyes) . '</option>' . "\n";
10109
-			$resultyesno .= '<option value="' . $no . '"' . $selected . '>' . $langs->trans($labelno) . '</option>' . "\n";
10108
+			$resultyesno .= '<option value="'.$yes.'">'.$langs->trans($labelyes).'</option>'."\n";
10109
+			$resultyesno .= '<option value="'.$no.'"'.$selected.'>'.$langs->trans($labelno).'</option>'."\n";
10110 10110
 		}
10111
-		$resultyesno .= '</select>' . "\n";
10111
+		$resultyesno .= '</select>'."\n";
10112 10112
 
10113 10113
 		if ($addjscombo) {
10114 10114
 			$resultyesno .= ajax_combobox($htmlname, array(), 0, 0, 'resolve', ($useempty < 0 ? (string) $useempty : '-1'), $morecss);
@@ -10132,12 +10132,12 @@  discard block
 block discarded – undo
10132 10132
 	{
10133 10133
 		// phpcs:enable
10134 10134
 		$sql = "SELECT rowid, label";
10135
-		$sql .= " FROM " . $this->db->prefix() . "export_model";
10136
-		$sql .= " WHERE type = '" . $this->db->escape($type) . "'";
10135
+		$sql .= " FROM ".$this->db->prefix()."export_model";
10136
+		$sql .= " WHERE type = '".$this->db->escape($type)."'";
10137 10137
 		$sql .= " ORDER BY rowid";
10138 10138
 		$result = $this->db->query($sql);
10139 10139
 		if ($result) {
10140
-			print '<select class="flat" id="select_' . $htmlname . '" name="' . $htmlname . '">';
10140
+			print '<select class="flat" id="select_'.$htmlname.'" name="'.$htmlname.'">';
10141 10141
 			if ($useempty) {
10142 10142
 				print '<option value="-1">&nbsp;</option>';
10143 10143
 			}
@@ -10147,9 +10147,9 @@  discard block
 block discarded – undo
10147 10147
 			while ($i < $num) {
10148 10148
 				$obj = $this->db->fetch_object($result);
10149 10149
 				if ($selected == $obj->rowid) {
10150
-					print '<option value="' . $obj->rowid . '" selected>';
10150
+					print '<option value="'.$obj->rowid.'" selected>';
10151 10151
 				} else {
10152
-					print '<option value="' . $obj->rowid . '">';
10152
+					print '<option value="'.$obj->rowid.'">';
10153 10153
 				}
10154 10154
 				print $obj->label;
10155 10155
 				print '</option>';
@@ -10248,8 +10248,8 @@  discard block
 block discarded – undo
10248 10248
 				$stringforfirstkey .= ' CTL +';
10249 10249
 			}
10250 10250
 
10251
-			$previous_ref = $object->ref_previous ? '<a accesskey="p" alt="'.dol_escape_htmltag($langs->trans("Previous")).'" title="' . $stringforfirstkey . ' p" class="classfortooltip" href="' . $navurl . '?' . $paramid . '=' . urlencode($object->ref_previous) . $moreparam . '"><i class="fa fa-chevron-left"></i></a>' : '<span class="inactive"><i class="fa fa-chevron-left opacitymedium"></i></span>';
10252
-			$next_ref = $object->ref_next ? '<a accesskey="n" alt="'.dol_escape_htmltag($langs->trans("Next")).'" title="' . $stringforfirstkey . ' n" class="classfortooltip" href="' . $navurl . '?' . $paramid . '=' . urlencode($object->ref_next) . $moreparam . '"><i class="fa fa-chevron-right"></i></a>' : '<span class="inactive"><i class="fa fa-chevron-right opacitymedium"></i></span>';
10251
+			$previous_ref = $object->ref_previous ? '<a accesskey="p" alt="'.dol_escape_htmltag($langs->trans("Previous")).'" title="'.$stringforfirstkey.' p" class="classfortooltip" href="'.$navurl.'?'.$paramid.'='.urlencode($object->ref_previous).$moreparam.'"><i class="fa fa-chevron-left"></i></a>' : '<span class="inactive"><i class="fa fa-chevron-left opacitymedium"></i></span>';
10252
+			$next_ref = $object->ref_next ? '<a accesskey="n" alt="'.dol_escape_htmltag($langs->trans("Next")).'" title="'.$stringforfirstkey.' n" class="classfortooltip" href="'.$navurl.'?'.$paramid.'='.urlencode($object->ref_next).$moreparam.'"><i class="fa fa-chevron-right"></i></a>' : '<span class="inactive"><i class="fa fa-chevron-right opacitymedium"></i></span>';
10253 10253
 		}
10254 10254
 
10255 10255
 		//print "xx".$previous_ref."x".$next_ref;
@@ -10257,18 +10257,18 @@  discard block
 block discarded – undo
10257 10257
 
10258 10258
 		// Right part of banner
10259 10259
 		if ($morehtmlright) {
10260
-			$ret .= '<div class="inline-block floatleft">' . $morehtmlright . '</div>';
10260
+			$ret .= '<div class="inline-block floatleft">'.$morehtmlright.'</div>';
10261 10261
 		}
10262 10262
 
10263 10263
 		if ($previous_ref || $next_ref || $morehtml) {
10264 10264
 			$ret .= '<div class="pagination paginationref"><ul class="right">';
10265 10265
 		}
10266 10266
 		if ($morehtml && getDolGlobalInt('MAIN_OPTIMIZEFORTEXTBROWSER') < 2) {
10267
-			$ret .= '<!-- morehtml --><li class="noborder litext' . (($shownav && $previous_ref && $next_ref) ? ' clearbothonsmartphone' : '') . '">' . $morehtml . '</li>';
10267
+			$ret .= '<!-- morehtml --><li class="noborder litext'.(($shownav && $previous_ref && $next_ref) ? ' clearbothonsmartphone' : '').'">'.$morehtml.'</li>';
10268 10268
 		}
10269 10269
 		if ($shownav && ($previous_ref || $next_ref)) {
10270
-			$ret .= '<li class="pagination">' . $previous_ref . '</li>';
10271
-			$ret .= '<li class="pagination">' . $next_ref . '</li>';
10270
+			$ret .= '<li class="pagination">'.$previous_ref.'</li>';
10271
+			$ret .= '<li class="pagination">'.$next_ref.'</li>';
10272 10272
 		}
10273 10273
 		if ($previous_ref || $next_ref || $morehtml) {
10274 10274
 			$ret .= '</ul></div>';
@@ -10283,7 +10283,7 @@  discard block
 block discarded – undo
10283 10283
 			$morehtmlstatus = $hookmanager->resPrint;
10284 10284
 		}
10285 10285
 		if ($morehtmlstatus) {
10286
-			$ret .= '<div class="statusref">' . $morehtmlstatus . '</div>';
10286
+			$ret .= '<div class="statusref">'.$morehtmlstatus.'</div>';
10287 10287
 		}
10288 10288
 
10289 10289
 		$parameters = array();
@@ -10297,14 +10297,14 @@  discard block
 block discarded – undo
10297 10297
 		// Left part of banner
10298 10298
 		if ($morehtmlleft) {
10299 10299
 			if ($conf->browser->layout == 'phone') {
10300
-				$ret .= '<!-- morehtmlleft --><div class="floatleft">' . $morehtmlleft . '</div>';
10300
+				$ret .= '<!-- morehtmlleft --><div class="floatleft">'.$morehtmlleft.'</div>';
10301 10301
 			} else {
10302
-				$ret .= '<!-- morehtmlleft --><div class="inline-block floatleft">' . $morehtmlleft . '</div>';
10302
+				$ret .= '<!-- morehtmlleft --><div class="inline-block floatleft">'.$morehtmlleft.'</div>';
10303 10303
 			}
10304 10304
 		}
10305 10305
 
10306 10306
 		//if ($conf->browser->layout == 'phone') $ret.='<div class="clearboth"></div>';
10307
-		$ret .= '<div class="inline-block floatleft valignmiddle maxwidth750 marginbottomonly refid' . (($shownav && ($previous_ref || $next_ref)) ? ' refidpadding' : '') . '">';
10307
+		$ret .= '<div class="inline-block floatleft valignmiddle maxwidth750 marginbottomonly refid'.(($shownav && ($previous_ref || $next_ref)) ? ' refidpadding' : '').'">';
10308 10308
 
10309 10309
 		// For thirdparty, contact, user, member, the ref is the id, so we show something else
10310 10310
 		if ($object->element == 'societe') {
@@ -10318,7 +10318,7 @@  discard block
 block discarded – undo
10318 10318
 
10319 10319
 			if (is_array($arrayoflangcode) && count($arrayoflangcode)) {
10320 10320
 				if (!is_object($extralanguages)) {
10321
-					include_once DOL_DOCUMENT_ROOT . '/core/class/extralanguages.class.php';
10321
+					include_once DOL_DOCUMENT_ROOT.'/core/class/extralanguages.class.php';
10322 10322
 					$extralanguages = new ExtraLanguages($this->db);
10323 10323
 				}
10324 10324
 				$extralanguages->fetch_name_extralanguages('societe');
@@ -10333,21 +10333,21 @@  discard block
 block discarded – undo
10333 10333
 						if ($object->array_languages['name'][$extralangcode]) {
10334 10334
 							$htmltext .= $object->array_languages['name'][$extralangcode];
10335 10335
 						} else {
10336
-							$htmltext .= '<span class="opacitymedium">' . $langs->trans("SwitchInEditModeToAddTranslation") . '</span>';
10336
+							$htmltext .= '<span class="opacitymedium">'.$langs->trans("SwitchInEditModeToAddTranslation").'</span>';
10337 10337
 						}
10338 10338
 					}
10339
-					$ret .= '<!-- Show translations of name -->' . "\n";
10339
+					$ret .= '<!-- Show translations of name -->'."\n";
10340 10340
 					$ret .= $this->textwithpicto('', $htmltext, -1, 'language', 'opacitymedium paddingleft');
10341 10341
 				}
10342 10342
 			}
10343 10343
 		} elseif ($object->element == 'member') {
10344 10344
 			'@phan-var-force Adherent $object';
10345
-			$ret .= $object->ref . '<br>';
10345
+			$ret .= $object->ref.'<br>';
10346 10346
 			$fullname = $object->getFullName($langs);
10347 10347
 			if ($object->morphy == 'mor' && $object->societe) {
10348
-				$ret .= dol_htmlentities($object->societe) . ((!empty($fullname) && $object->societe != $fullname) ? ' (' . dol_htmlentities($fullname) . $addgendertxt . ')' : '');
10348
+				$ret .= dol_htmlentities($object->societe).((!empty($fullname) && $object->societe != $fullname) ? ' ('.dol_htmlentities($fullname).$addgendertxt.')' : '');
10349 10349
 			} else {
10350
-				$ret .= dol_htmlentities($fullname) . $addgendertxt . ((!empty($object->societe) && $object->societe != $fullname) ? ' (' . dol_htmlentities($object->societe) . ')' : '');
10350
+				$ret .= dol_htmlentities($fullname).$addgendertxt.((!empty($object->societe) && $object->societe != $fullname) ? ' ('.dol_htmlentities($object->societe).')' : '');
10351 10351
 			}
10352 10352
 		} elseif (in_array($object->element, array('contact', 'user'))) {
10353 10353
 			$ret .= '<span class="valignmiddle">'.dol_htmlentities($object->getFullName($langs)).'</span>'.$addgendertxt;
@@ -10355,7 +10355,7 @@  discard block
 block discarded – undo
10355 10355
 			$ret .= dol_htmlentities($object->name);
10356 10356
 		} elseif (in_array($object->element, array('action', 'agenda'))) {
10357 10357
 			'@phan-var-force ActionComm $object';
10358
-			$ret .= $object->ref . '<br>' . $object->label;
10358
+			$ret .= $object->ref.'<br>'.$object->label;
10359 10359
 		} elseif (in_array($object->element, array('adherent_type'))) {
10360 10360
 			$ret .= $object->label;
10361 10361
 		} elseif ($object->element == 'ecm_directories') {
@@ -10408,9 +10408,9 @@  discard block
 block discarded – undo
10408 10408
 		}
10409 10409
 
10410 10410
 		// Barcode image  @phan-suppress-next-line PhanUndeclaredProperty
10411
-		$url = DOL_URL_ROOT . '/viewimage.php?modulepart=barcode&generator=' . urlencode($object->barcode_type_coder) . '&code=' . urlencode($object->barcode) . '&encoding=' . urlencode($object->barcode_type_code);
10412
-		$out = '<!-- url barcode = ' . $url . ' -->';
10413
-		$out .= '<img src="' . $url . '"' . ($morecss ? ' class="' . $morecss . '"' : '') . '>';
10411
+		$url = DOL_URL_ROOT.'/viewimage.php?modulepart=barcode&generator='.urlencode($object->barcode_type_coder).'&code='.urlencode($object->barcode).'&encoding='.urlencode($object->barcode_type_code);
10412
+		$out = '<!-- url barcode = '.$url.' -->';
10413
+		$out .= '<img src="'.$url.'"'.($morecss ? ' class="'.$morecss.'"' : '').'>';
10414 10414
 
10415 10415
 		return $out;
10416 10416
 	}
@@ -10437,7 +10437,7 @@  discard block
 block discarded – undo
10437 10437
 		global $conf, $langs;
10438 10438
 
10439 10439
 		$entity = (empty($object->entity) ? $conf->entity : $object->entity);
10440
-		$id = (empty($object->id) ? $object->rowid : $object->id);  // @phan-suppress-current-line PhanUndeclaredProperty (->rowid)
10440
+		$id = (empty($object->id) ? $object->rowid : $object->id); // @phan-suppress-current-line PhanUndeclaredProperty (->rowid)
10441 10441
 
10442 10442
 		$dir = '';
10443 10443
 		$file = '';
@@ -10450,28 +10450,28 @@  discard block
 block discarded – undo
10450 10450
 			if (!empty($object->logo)) {
10451 10451
 				if (dolIsAllowedForPreview($object->logo)) {
10452 10452
 					if ((string) $imagesize == 'mini') {
10453
-						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . getImageFileNameForSize($object->logo, '_mini'); // getImageFileNameForSize include the thumbs
10453
+						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.getImageFileNameForSize($object->logo, '_mini'); // getImageFileNameForSize include the thumbs
10454 10454
 					} elseif ((string) $imagesize == 'small') {
10455
-						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . getImageFileNameForSize($object->logo, '_small');
10455
+						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.getImageFileNameForSize($object->logo, '_small');
10456 10456
 					} else {
10457
-						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . $object->logo;
10457
+						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.$object->logo;
10458 10458
 					}
10459
-					$originalfile = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . $object->logo;
10459
+					$originalfile = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.$object->logo;
10460 10460
 				}
10461 10461
 			}
10462 10462
 			$email = $object->email;
10463 10463
 		} elseif ($modulepart == 'contact') {
10464
-			$dir = $conf->societe->multidir_output[$entity] . '/contact';
10464
+			$dir = $conf->societe->multidir_output[$entity].'/contact';
10465 10465
 			if (!empty($object->photo)) {
10466 10466
 				if (dolIsAllowedForPreview($object->photo)) {
10467 10467
 					if ((string) $imagesize == 'mini') {
10468
-						$file = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . getImageFileNameForSize($object->photo, '_mini');
10468
+						$file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.getImageFileNameForSize($object->photo, '_mini');
10469 10469
 					} elseif ((string) $imagesize == 'small') {
10470
-						$file = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . getImageFileNameForSize($object->photo, '_small');
10470
+						$file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.getImageFileNameForSize($object->photo, '_small');
10471 10471
 					} else {
10472
-						$file = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . $object->photo;
10472
+						$file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.$object->photo;
10473 10473
 					}
10474
-					$originalfile = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . $object->photo;
10474
+					$originalfile = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.$object->photo;
10475 10475
 				}
10476 10476
 			}
10477 10477
 			$email = $object->email;
@@ -10481,17 +10481,17 @@  discard block
 block discarded – undo
10481 10481
 			if (!empty($object->photo)) {
10482 10482
 				if (dolIsAllowedForPreview($object->photo)) {
10483 10483
 					if ((string) $imagesize == 'mini') {
10484
-						$file = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . getImageFileNameForSize($object->photo, '_mini');
10484
+						$file = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.getImageFileNameForSize($object->photo, '_mini');
10485 10485
 					} elseif ((string) $imagesize == 'small') {
10486
-						$file = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . getImageFileNameForSize($object->photo, '_small');
10486
+						$file = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.getImageFileNameForSize($object->photo, '_small');
10487 10487
 					} else {
10488
-						$file = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . $object->photo;
10488
+						$file = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.$object->photo;
10489 10489
 					}
10490
-					$originalfile = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . $object->photo;
10490
+					$originalfile = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.$object->photo;
10491 10491
 				}
10492 10492
 			}
10493 10493
 			if (getDolGlobalString('MAIN_OLD_IMAGE_LINKS')) {
10494
-				$altfile = $object->id . ".jpg"; // For backward compatibility
10494
+				$altfile = $object->id.".jpg"; // For backward compatibility
10495 10495
 			}
10496 10496
 			$email = $object->email;
10497 10497
 			$capture = 'user';
@@ -10500,17 +10500,17 @@  discard block
 block discarded – undo
10500 10500
 			if (!empty($object->photo)) {
10501 10501
 				if (dolIsAllowedForPreview($object->photo)) {
10502 10502
 					if ((string) $imagesize == 'mini') {
10503
-						$file = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . getImageFileNameForSize($object->photo, '_mini');
10503
+						$file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_mini');
10504 10504
 					} elseif ((string) $imagesize == 'small') {
10505
-						$file = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . getImageFileNameForSize($object->photo, '_small');
10505
+						$file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_small');
10506 10506
 					} else {
10507
-						$file = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . $object->photo;
10507
+						$file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.$object->photo;
10508 10508
 					}
10509
-					$originalfile = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . $object->photo;
10509
+					$originalfile = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.$object->photo;
10510 10510
 				}
10511 10511
 			}
10512 10512
 			if (getDolGlobalString('MAIN_OLD_IMAGE_LINKS')) {
10513
-				$altfile = $object->id . ".jpg"; // For backward compatibility
10513
+				$altfile = $object->id.".jpg"; // For backward compatibility
10514 10514
 			}
10515 10515
 			$email = $object->email;
10516 10516
 			$capture = 'user';
@@ -10536,35 +10536,35 @@  discard block
 block discarded – undo
10536 10536
 		$ret = '';
10537 10537
 
10538 10538
 		if ($dir) {
10539
-			if ($file && file_exists($dir . "/" . $file)) {
10539
+			if ($file && file_exists($dir."/".$file)) {
10540 10540
 				if ($addlinktofullsize) {
10541
-					$urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity=' . $entity);
10541
+					$urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity='.$entity);
10542 10542
 					if ($urladvanced) {
10543
-						$ret .= '<a href="' . $urladvanced . '">';
10543
+						$ret .= '<a href="'.$urladvanced.'">';
10544 10544
 					} else {
10545
-						$ret .= '<a href="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($originalfile) . '&cache=' . $cache . '">';
10545
+						$ret .= '<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($originalfile).'&cache='.$cache.'">';
10546 10546
 					}
10547 10547
 				}
10548
-				$ret .= '<img alt="" class="photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . ' photologo' . (preg_replace('/[^a-z]/i', '_', $file)) . '" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . ' src="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($file) . '&cache=' . $cache . '">';
10548
+				$ret .= '<img alt="" class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').' photologo'.(preg_replace('/[^a-z]/i', '_', $file)).'" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').' src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($file).'&cache='.$cache.'">';
10549 10549
 				if ($addlinktofullsize) {
10550 10550
 					$ret .= '</a>';
10551 10551
 				}
10552
-			} elseif ($altfile && file_exists($dir . "/" . $altfile)) {
10552
+			} elseif ($altfile && file_exists($dir."/".$altfile)) {
10553 10553
 				if ($addlinktofullsize) {
10554
-					$urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity=' . $entity);
10554
+					$urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity='.$entity);
10555 10555
 					if ($urladvanced) {
10556
-						$ret .= '<a href="' . $urladvanced . '">';
10556
+						$ret .= '<a href="'.$urladvanced.'">';
10557 10557
 					} else {
10558
-						$ret .= '<a href="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($originalfile) . '&cache=' . $cache . '">';
10558
+						$ret .= '<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($originalfile).'&cache='.$cache.'">';
10559 10559
 					}
10560 10560
 				}
10561
-				$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 . '">';
10561
+				$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.'">';
10562 10562
 				if ($addlinktofullsize) {
10563 10563
 					$ret .= '</a>';
10564 10564
 				}
10565 10565
 			} else {
10566 10566
 				$nophoto = '/public/theme/common/nophoto.png';
10567
-				$defaultimg = 'identicon';        // For gravatar
10567
+				$defaultimg = 'identicon'; // For gravatar
10568 10568
 				if (in_array($modulepart, array('societe', 'userphoto', 'contact', 'memberphoto'))) {    // For modules that need a special image when photo not found
10569 10569
 					if ($modulepart == 'societe' || ($modulepart == 'memberphoto' && !empty($object->morphy) && strpos($object->morphy, 'mor') !== false)) {
10570 10570
 						$nophoto = 'company';
@@ -10582,13 +10582,13 @@  discard block
 block discarded – undo
10582 10582
 				if (isModEnabled('gravatar') && $email && empty($noexternsourceoverwrite)) {
10583 10583
 					// see https://gravatar.com/site/implement/images/php/
10584 10584
 					$ret .= '<!-- Put link to gravatar -->';
10585
-					$ret .= '<img class="photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="" title="' . $email . ' Gravatar avatar" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . ' src="https://www.gravatar.com/avatar/' . dol_hash(strtolower(trim($email)), 'sha256', 1) . '?s=' . $width . '&d=' . $defaultimg . '">'; // gravatar need md5 hash
10585
+					$ret .= '<img class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="" title="'.$email.' Gravatar avatar" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').' src="https://www.gravatar.com/avatar/'.dol_hash(strtolower(trim($email)), 'sha256', 1).'?s='.$width.'&d='.$defaultimg.'">'; // gravatar need md5 hash
10586 10586
 				} else {
10587 10587
 					if ($nophoto == 'company') {
10588
-						$ret .= '<div class="divforspanimg valignmiddle center photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . '>' . img_picto('', 'company') . '</div>';
10588
+						$ret .= '<div class="divforspanimg valignmiddle center photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').'>'.img_picto('', 'company').'</div>';
10589 10589
 						//$ret .= '<div class="difforspanimgright"></div>';
10590 10590
 					} else {
10591
-						$ret .= '<img class="photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . ' src="' . DOL_URL_ROOT . $nophoto . '">';
10591
+						$ret .= '<img class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').' src="'.DOL_URL_ROOT.$nophoto.'">';
10592 10592
 					}
10593 10593
 				}
10594 10594
 			}
@@ -10599,15 +10599,15 @@  discard block
 block discarded – undo
10599 10599
 				}
10600 10600
 				$ret .= '<table class="nobordernopadding centpercent">';
10601 10601
 				if ($object->photo) {
10602
-					$ret .= '<tr><td><input type="checkbox" class="flat photodelete" name="deletephoto" id="photodelete"> <label for="photodelete">' . $langs->trans("Delete") . '</label><br><br></td></tr>';
10602
+					$ret .= '<tr><td><input type="checkbox" class="flat photodelete" name="deletephoto" id="photodelete"> <label for="photodelete">'.$langs->trans("Delete").'</label><br><br></td></tr>';
10603 10603
 				}
10604 10604
 				$ret .= '<tr><td class="tdoverflow">';
10605 10605
 				$maxfilesizearray = getMaxFileSizeArray();
10606 10606
 				$maxmin = $maxfilesizearray['maxmin'];
10607 10607
 				if ($maxmin > 0) {
10608
-					$ret .= '<input type="hidden" name="MAX_FILE_SIZE" value="' . ($maxmin * 1024) . '">';    // MAX_FILE_SIZE must precede the field type=file
10608
+					$ret .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file
10609 10609
 				}
10610
-				$ret .= '<input type="file" class="flat maxwidth200onsmartphone" name="photo" id="photoinput" accept="image/*"' . ($capture ? ' capture="' . $capture . '"' : '') . '>';
10610
+				$ret .= '<input type="file" class="flat maxwidth200onsmartphone" name="photo" id="photoinput" accept="image/*"'.($capture ? ' capture="'.$capture.'"' : '').'>';
10611 10611
 				$ret .= '</td></tr>';
10612 10612
 				$ret .= '</table>';
10613 10613
 			}
@@ -10661,38 +10661,38 @@  discard block
 block discarded – undo
10661 10661
 		if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) {
10662 10662
 			$sql .= ", e.label";
10663 10663
 		}
10664
-		$sql .= " FROM " . $this->db->prefix() . "usergroup as ug ";
10664
+		$sql .= " FROM ".$this->db->prefix()."usergroup as ug ";
10665 10665
 		if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) {
10666
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "entity as e ON e.rowid=ug.entity";
10666
+			$sql .= " LEFT JOIN ".$this->db->prefix()."entity as e ON e.rowid=ug.entity";
10667 10667
 			if ($force_entity) {
10668
-				$sql .= " WHERE ug.entity IN (0, " . $force_entity . ")";
10668
+				$sql .= " WHERE ug.entity IN (0, ".$force_entity.")";
10669 10669
 			} else {
10670 10670
 				$sql .= " WHERE ug.entity IS NOT NULL";
10671 10671
 			}
10672 10672
 		} else {
10673
-			$sql .= " WHERE ug.entity IN (0, " . $conf->entity . ")";
10673
+			$sql .= " WHERE ug.entity IN (0, ".$conf->entity.")";
10674 10674
 		}
10675 10675
 		if (is_array($exclude) && $excludeGroups) {
10676
-			$sql .= " AND ug.rowid NOT IN (" . $this->db->sanitize($excludeGroups) . ")";
10676
+			$sql .= " AND ug.rowid NOT IN (".$this->db->sanitize($excludeGroups).")";
10677 10677
 		}
10678 10678
 		if (is_array($include) && $includeGroups) {
10679
-			$sql .= " AND ug.rowid IN (" . $this->db->sanitize($includeGroups) . ")";
10679
+			$sql .= " AND ug.rowid IN (".$this->db->sanitize($includeGroups).")";
10680 10680
 		}
10681 10681
 		$sql .= " ORDER BY ug.nom ASC";
10682 10682
 
10683
-		dol_syslog(get_class($this) . "::select_dolgroups", LOG_DEBUG);
10683
+		dol_syslog(get_class($this)."::select_dolgroups", LOG_DEBUG);
10684 10684
 		$resql = $this->db->query($sql);
10685 10685
 		if ($resql) {
10686 10686
 			// Enhance with select2
10687
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
10687
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
10688 10688
 
10689
-			$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . ' ' . ($disabled ? ' disabled' : '') . '>';
10689
+			$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.($disabled ? ' disabled' : '').'>';
10690 10690
 
10691 10691
 			$num = $this->db->num_rows($resql);
10692 10692
 			$i = 0;
10693 10693
 			if ($num) {
10694 10694
 				if ($show_empty && !$multiple) {
10695
-					$out .= '<option value="-1"' . (in_array(-1, $selected) ? ' selected' : '') . '>&nbsp;</option>' . "\n";
10695
+					$out .= '<option value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'>&nbsp;</option>'."\n";
10696 10696
 				}
10697 10697
 
10698 10698
 				while ($i < $num) {
@@ -10705,11 +10705,11 @@  discard block
 block discarded – undo
10705 10705
 					$label = $obj->name;
10706 10706
 					$labelhtml = $obj->name;
10707 10707
 					if (isModEnabled('multicompany') && !getDolGlobalInt('MULTICOMPANY_TRANSVERSE_MODE') && $conf->entity == 1) {
10708
-						$label .= " (" . $obj->label . ")";
10709
-						$labelhtml .= ' <span class="opacitymedium">(' . $obj->label . ')</span>';
10708
+						$label .= " (".$obj->label.")";
10709
+						$labelhtml .= ' <span class="opacitymedium">('.$obj->label.')</span>';
10710 10710
 					}
10711 10711
 
10712
-					$out .= '<option value="' . $obj->rowid . '"';
10712
+					$out .= '<option value="'.$obj->rowid.'"';
10713 10713
 					if ($disableline) {
10714 10714
 						$out .= ' disabled';
10715 10715
 					}
@@ -10725,9 +10725,9 @@  discard block
 block discarded – undo
10725 10725
 				}
10726 10726
 			} else {
10727 10727
 				if ($show_empty) {
10728
-					$out .= '<option value="-1"' . (in_array(-1, $selected) ? ' selected' : '') . '></option>' . "\n";
10728
+					$out .= '<option value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'></option>'."\n";
10729 10729
 				}
10730
-				$out .= '<option value="" disabled>' . $langs->trans("NoUserGroupDefined") . '</option>';
10730
+				$out .= '<option value="" disabled>'.$langs->trans("NoUserGroupDefined").'</option>';
10731 10731
 			}
10732 10732
 			$out .= '</select>';
10733 10733
 
@@ -10771,25 +10771,25 @@  discard block
 block discarded – undo
10771 10771
 		$out = '';
10772 10772
 
10773 10773
 		if (!empty($conf->use_javascript_ajax)) {
10774
-			$out .= '<div class="inline-block checkallactions"><input type="checkbox" id="' . $cssclass . 's" name="' . $cssclass . 's" class="checkallactions"></div>';
10774
+			$out .= '<div class="inline-block checkallactions"><input type="checkbox" id="'.$cssclass.'s" name="'.$cssclass.'s" class="checkallactions"></div>';
10775 10775
 		}
10776
-		$out .= '<script nonce="' . getNonce() . '">
10776
+		$out .= '<script nonce="'.getNonce().'">
10777 10777
             $(document).ready(function() {
10778
-                $("#' . $cssclass . 's").click(function() {
10778
+                $("#' . $cssclass.'s").click(function() {
10779 10779
                     if($(this).is(\':checked\')){
10780
-                        console.log("We check all ' . $cssclass . ' and trigger the change method");
10781
-                		$(".' . $cssclass . '").prop(\'checked\', true).trigger(\'change\');
10780
+                        console.log("We check all ' . $cssclass.' and trigger the change method");
10781
+                		$(".' . $cssclass.'").prop(\'checked\', true).trigger(\'change\');
10782 10782
                     }
10783 10783
                     else
10784 10784
                     {
10785 10785
                         console.log("We uncheck all");
10786
-                		$(".' . $cssclass . '").prop(\'checked\', false).trigger(\'change\');
10786
+                		$(".' . $cssclass.'").prop(\'checked\', false).trigger(\'change\');
10787 10787
                     }' . "\n";
10788 10788
 		if ($calljsfunction) {
10789
-			$out .= 'if (typeof initCheckForSelect == \'function\') { initCheckForSelect(0, "' . $massactionname . '", "' . $cssclass . '"); } else { console.log("No function initCheckForSelect found. Call won\'t be done."); }';
10789
+			$out .= 'if (typeof initCheckForSelect == \'function\') { initCheckForSelect(0, "'.$massactionname.'", "'.$cssclass.'"); } else { console.log("No function initCheckForSelect found. Call won\'t be done."); }';
10790 10790
 		}
10791 10791
 		$out .= '         });
10792
-        	        $(".' . $cssclass . '").change(function() {
10792
+        	        $(".' . $cssclass.'").change(function() {
10793 10793
 					$(this).closest("tr").toggleClass("highlight", this.checked);
10794 10794
 				});
10795 10795
 		 	});
@@ -10834,67 +10834,67 @@  discard block
 block discarded – undo
10834 10834
 		global $langs, $user;
10835 10835
 
10836 10836
 		$out = '';
10837
-		$sql = "SELECT rowid, label FROM " . $this->db->prefix() . "c_exp_tax_cat WHERE active = 1";
10838
-		$sql .= " AND entity IN (0," . getEntity('exp_tax_cat') . ")";
10837
+		$sql = "SELECT rowid, label FROM ".$this->db->prefix()."c_exp_tax_cat WHERE active = 1";
10838
+		$sql .= " AND entity IN (0,".getEntity('exp_tax_cat').")";
10839 10839
 		if (!empty($excludeid)) {
10840
-			$sql .= " AND rowid NOT IN (" . $this->db->sanitize(implode(',', $excludeid)) . ")";
10840
+			$sql .= " AND rowid NOT IN (".$this->db->sanitize(implode(',', $excludeid)).")";
10841 10841
 		}
10842 10842
 		$sql .= " ORDER BY label";
10843 10843
 
10844 10844
 		$resql = $this->db->query($sql);
10845 10845
 		if ($resql) {
10846
-			$out = '<select id="select_' . $htmlname . '" name="' . $htmlname . '" class="' . $htmlname . ' flat minwidth75imp maxwidth200">';
10846
+			$out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp maxwidth200">';
10847 10847
 			if ($useempty) {
10848 10848
 				$out .= '<option value="0">&nbsp;</option>';
10849 10849
 			}
10850 10850
 
10851 10851
 			while ($obj = $this->db->fetch_object($resql)) {
10852
-				$out .= '<option ' . ($selected == $obj->rowid ? 'selected="selected"' : '') . ' value="' . $obj->rowid . '">' . $langs->trans($obj->label) . '</option>';
10852
+				$out .= '<option '.($selected == $obj->rowid ? 'selected="selected"' : '').' value="'.$obj->rowid.'">'.$langs->trans($obj->label).'</option>';
10853 10853
 			}
10854 10854
 			$out .= '</select>';
10855
-			$out .= ajax_combobox('select_' . $htmlname);
10855
+			$out .= ajax_combobox('select_'.$htmlname);
10856 10856
 
10857 10857
 			if (!empty($htmlname) && $user->admin && $info_admin) {
10858
-				$out .= ' ' . info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
10858
+				$out .= ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
10859 10859
 			}
10860 10860
 
10861 10861
 			if (!empty($target)) {
10862
-				$sql = "SELECT c.id FROM " . $this->db->prefix() . "c_type_fees as c WHERE c.code = 'EX_KME' AND c.active = 1";
10862
+				$sql = "SELECT c.id FROM ".$this->db->prefix()."c_type_fees as c WHERE c.code = 'EX_KME' AND c.active = 1";
10863 10863
 				$resql = $this->db->query($sql);
10864 10864
 				if ($resql) {
10865 10865
 					if ($this->db->num_rows($resql) > 0) {
10866 10866
 						$obj = $this->db->fetch_object($resql);
10867
-						$out .= '<script nonce="' . getNonce() . '">
10867
+						$out .= '<script nonce="'.getNonce().'">
10868 10868
 							$(function() {
10869
-								$("select[name=' . $target . ']").on("change", function() {
10869
+								$("select[name=' . $target.']").on("change", function() {
10870 10870
 									var current_val = $(this).val();
10871
-									if (current_val == ' . $obj->id . ') {';
10871
+									if (current_val == ' . $obj->id.') {';
10872 10872
 						if (!empty($default_selected) || !empty($selected)) {
10873
-							$out .= '$("select[name=' . $htmlname . ']").val("' . ($default_selected > 0 ? $default_selected : $selected) . '");';
10873
+							$out .= '$("select[name='.$htmlname.']").val("'.($default_selected > 0 ? $default_selected : $selected).'");';
10874 10874
 						}
10875 10875
 
10876 10876
 						$out .= '
10877
-										$("select[name=' . $htmlname . ']").change();
10877
+										$("select[name=' . $htmlname.']").change();
10878 10878
 									}
10879 10879
 								});
10880 10880
 
10881
-								$("select[name=' . $htmlname . ']").change(function() {
10881
+								$("select[name=' . $htmlname.']").change(function() {
10882 10882
 
10883
-									if ($("select[name=' . $target . ']").val() == ' . $obj->id . ') {
10883
+									if ($("select[name=' . $target.']").val() == '.$obj->id.') {
10884 10884
 										// get price of kilometer to fill the unit price
10885 10885
 										$.ajax({
10886 10886
 											method: "POST",
10887 10887
 											dataType: "json",
10888
-											data: { fk_c_exp_tax_cat: $(this).val(), token: \'' . currentToken() . '\' },
10889
-											url: "' . (DOL_URL_ROOT . '/expensereport/ajax/ajaxik.php?' . implode('&', $params)) . '",
10888
+											data: { fk_c_exp_tax_cat: $(this).val(), token: \'' . currentToken().'\' },
10889
+											url: "' . (DOL_URL_ROOT.'/expensereport/ajax/ajaxik.php?'.implode('&', $params)).'",
10890 10890
 										}).done(function( data, textStatus, jqXHR ) {
10891 10891
 											console.log(data);
10892 10892
 											if (typeof data.up != "undefined") {
10893 10893
 												$("input[name=value_unit]").val(data.up);
10894
-												$("select[name=' . $htmlname . ']").attr("title", data.title);
10894
+												$("select[name=' . $htmlname.']").attr("title", data.title);
10895 10895
 											} else {
10896 10896
 												$("input[name=value_unit]").val("");
10897
-												$("select[name=' . $htmlname . ']").attr("title", "");
10897
+												$("select[name=' . $htmlname.']").attr("title", "");
10898 10898
 											}
10899 10899
 										});
10900 10900
 									}
@@ -10924,18 +10924,18 @@  discard block
 block discarded – undo
10924 10924
 		global $conf, $langs;
10925 10925
 
10926 10926
 		$out = '';
10927
-		$sql = "SELECT rowid, range_ik FROM " . $this->db->prefix() . "c_exp_tax_range";
10928
-		$sql .= " WHERE entity = " . $conf->entity . " AND active = 1";
10927
+		$sql = "SELECT rowid, range_ik FROM ".$this->db->prefix()."c_exp_tax_range";
10928
+		$sql .= " WHERE entity = ".$conf->entity." AND active = 1";
10929 10929
 
10930 10930
 		$resql = $this->db->query($sql);
10931 10931
 		if ($resql) {
10932
-			$out = '<select id="select_' . $htmlname . '" name="' . $htmlname . '" class="' . $htmlname . ' flat minwidth75imp">';
10932
+			$out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp">';
10933 10933
 			if ($useempty) {
10934 10934
 				$out .= '<option value="0"></option>';
10935 10935
 			}
10936 10936
 
10937 10937
 			while ($obj = $this->db->fetch_object($resql)) {
10938
-				$out .= '<option ' . ($selected == $obj->rowid ? 'selected="selected"' : '') . ' value="' . $obj->rowid . '">' . price($obj->range_ik, 0, $langs, 1, 0) . '</option>';
10938
+				$out .= '<option '.($selected == $obj->rowid ? 'selected="selected"' : '').' value="'.$obj->rowid.'">'.price($obj->range_ik, 0, $langs, 1, 0).'</option>';
10939 10939
 			}
10940 10940
 			$out .= '</select>';
10941 10941
 		} else {
@@ -10966,12 +10966,12 @@  discard block
 block discarded – undo
10966 10966
 
10967 10967
 		$resql = $this->db->query($sql);
10968 10968
 		if ($resql) {
10969
-			$out = '<select id="select_' . $htmlname . '" name="' . $htmlname . '" class="' . $htmlname . ' flat minwidth75imp">';
10969
+			$out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp">';
10970 10970
 			if ($useempty) {
10971 10971
 				$out .= '<option value="0"></option>';
10972 10972
 			}
10973 10973
 			if ($allchoice) {
10974
-				$out .= '<option value="-1">' . $langs->trans('AllExpenseReport') . '</option>';
10974
+				$out .= '<option value="-1">'.$langs->trans('AllExpenseReport').'</option>';
10975 10975
 			}
10976 10976
 
10977 10977
 			$field = 'code';
@@ -10981,7 +10981,7 @@  discard block
 block discarded – undo
10981 10981
 
10982 10982
 			while ($obj = $this->db->fetch_object($resql)) {
10983 10983
 				$key = $langs->trans($obj->code);
10984
-				$out .= '<option ' . ($selected == $obj->{$field} ? 'selected="selected"' : '') . ' value="' . $obj->{$field} . '">' . ($key != $obj->code ? $key : $obj->label) . '</option>';
10984
+				$out .= '<option '.($selected == $obj->{$field} ? 'selected="selected"' : '').' value="'.$obj->{$field}.'">'.($key != $obj->code ? $key : $obj->label).'</option>';
10985 10985
 			}
10986 10986
 			$out .= '</select>';
10987 10987
 
@@ -11015,7 +11015,7 @@  discard block
 block discarded – undo
11015 11015
 	{
11016 11016
 		global $user, $conf, $langs;
11017 11017
 
11018
-		require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
11018
+		require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
11019 11019
 
11020 11020
 		if (is_null($usertofilter)) {
11021 11021
 			$usertofilter = $user;
@@ -11039,10 +11039,10 @@  discard block
 block discarded – undo
11039 11039
 		$sql = "SELECT f.rowid, f.ref as fref, 'nolabel' as flabel, p.rowid as pid, f.ref,
11040 11040
             p.title, p.fk_soc, p.fk_statut, p.public,";
11041 11041
 		$sql .= ' s.nom as name';
11042
-		$sql .= ' FROM ' . $this->db->prefix() . 'projet as p';
11043
-		$sql .= ' LEFT JOIN ' . $this->db->prefix() . 'societe as s ON s.rowid = p.fk_soc,';
11044
-		$sql .= ' ' . $this->db->prefix() . 'facture as f';
11045
-		$sql .= " WHERE p.entity IN (" . getEntity('project') . ")";
11042
+		$sql .= ' FROM '.$this->db->prefix().'projet as p';
11043
+		$sql .= ' LEFT JOIN '.$this->db->prefix().'societe as s ON s.rowid = p.fk_soc,';
11044
+		$sql .= ' '.$this->db->prefix().'facture as f';
11045
+		$sql .= " WHERE p.entity IN (".getEntity('project').")";
11046 11046
 		$sql .= " AND f.fk_projet = p.rowid AND f.fk_statut=0"; //Brouillons seulement
11047 11047
 		//if ($projectsListId) $sql.= " AND p.rowid IN (".$this->db->sanitize($projectsListId).")";
11048 11048
 		//if ($socid == 0) $sql.= " AND (p.fk_soc=0 OR p.fk_soc IS NULL)";
@@ -11053,14 +11053,14 @@  discard block
 block discarded – undo
11053 11053
 		if ($resql) {
11054 11054
 			// Use select2 selector
11055 11055
 			if (!empty($conf->use_javascript_ajax)) {
11056
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
11056
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
11057 11057
 				$comboenhancement = ajax_combobox($htmlname, array(), 0, $forcefocus);
11058 11058
 				$out .= $comboenhancement;
11059 11059
 				$morecss = 'minwidth200imp maxwidth500';
11060 11060
 			}
11061 11061
 
11062 11062
 			if (empty($option_only)) {
11063
-				$out .= '<select class="valignmiddle flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ' id="' . $htmlname . '" name="' . $htmlname . '">';
11063
+				$out .= '<select class="valignmiddle flat'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').' id="'.$htmlname.'" name="'.$htmlname.'">';
11064 11064
 			}
11065 11065
 			if (!empty($show_empty)) {
11066 11066
 				$out .= '<option value="0" class="optiongrey">';
@@ -11090,33 +11090,33 @@  discard block
 block discarded – undo
11090 11090
 						if ($showproject == 'all') {
11091 11091
 							$labeltoshow .= dol_trunc($obj->ref, 18); // Invoice ref
11092 11092
 							if ($obj->name) {
11093
-								$labeltoshow .= ' - ' . $obj->name; // Soc name
11093
+								$labeltoshow .= ' - '.$obj->name; // Soc name
11094 11094
 							}
11095 11095
 
11096 11096
 							$disabled = 0;
11097 11097
 							if ($obj->fk_statut == Project::STATUS_DRAFT) {
11098 11098
 								$disabled = 1;
11099
-								$labeltoshow .= ' - ' . $langs->trans("Draft");
11099
+								$labeltoshow .= ' - '.$langs->trans("Draft");
11100 11100
 							} elseif ($obj->fk_statut == Project::STATUS_CLOSED) {
11101 11101
 								if ($discard_closed == 2) {
11102 11102
 									$disabled = 1;
11103 11103
 								}
11104
-								$labeltoshow .= ' - ' . $langs->trans("Closed");
11104
+								$labeltoshow .= ' - '.$langs->trans("Closed");
11105 11105
 							} elseif ($socid > 0 && (!empty($obj->fk_soc) && $obj->fk_soc != $socid)) {
11106 11106
 								$disabled = 1;
11107
-								$labeltoshow .= ' - ' . $langs->trans("LinkedToAnotherCompany");
11107
+								$labeltoshow .= ' - '.$langs->trans("LinkedToAnotherCompany");
11108 11108
 							}
11109 11109
 						}
11110 11110
 
11111 11111
 						if (!empty($selected) && $selected == $obj->rowid) {
11112
-							$out .= '<option value="' . $obj->rowid . '" selected';
11112
+							$out .= '<option value="'.$obj->rowid.'" selected';
11113 11113
 							//if ($disabled) $out.=' disabled';						// with select2, field can't be preselected if disabled
11114
-							$out .= '>' . $labeltoshow . '</option>';
11114
+							$out .= '>'.$labeltoshow.'</option>';
11115 11115
 						} else {
11116 11116
 							if ($hideunselectables && $disabled && ($selected != $obj->rowid)) {
11117 11117
 								$resultat = '';
11118 11118
 							} else {
11119
-								$resultat = '<option value="' . $obj->rowid . '"';
11119
+								$resultat = '<option value="'.$obj->rowid.'"';
11120 11120
 								if ($disabled) {
11121 11121
 									$resultat .= ' disabled';
11122 11122
 								}
@@ -11168,22 +11168,22 @@  discard block
 block discarded – undo
11168 11168
 
11169 11169
 		$sql = 'SELECT f.rowid, f.entity, f.titre as title, f.suspended, f.fk_soc';
11170 11170
 		//$sql.= ', el.fk_source';
11171
-		$sql .= ' FROM ' . MAIN_DB_PREFIX . 'facture_rec as f';
11172
-		$sql .= " WHERE f.entity IN (" . getEntity('invoice') . ")";
11171
+		$sql .= ' FROM '.MAIN_DB_PREFIX.'facture_rec as f';
11172
+		$sql .= " WHERE f.entity IN (".getEntity('invoice').")";
11173 11173
 		$sql .= " ORDER BY f.titre ASC";
11174 11174
 
11175 11175
 		$resql = $this->db->query($sql);
11176 11176
 		if ($resql) {
11177 11177
 			// Use select2 selector
11178 11178
 			if (!empty($conf->use_javascript_ajax)) {
11179
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
11179
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
11180 11180
 				$comboenhancement = ajax_combobox($htmlname, array(), 0, $forcefocus);
11181 11181
 				$out .= $comboenhancement;
11182 11182
 				$morecss = 'minwidth200imp maxwidth500';
11183 11183
 			}
11184 11184
 
11185 11185
 			if (empty($option_only)) {
11186
-				$out .= '<select class="valignmiddle flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ' id="' . $htmlname . '" name="' . $htmlname . '">';
11186
+				$out .= '<select class="valignmiddle flat'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').' id="'.$htmlname.'" name="'.$htmlname.'">';
11187 11187
 			}
11188 11188
 			if (!empty($show_empty)) {
11189 11189
 				$out .= '<option value="0" class="optiongrey">';
@@ -11202,19 +11202,19 @@  discard block
 block discarded – undo
11202 11202
 					$disabled = 0;
11203 11203
 					if (!empty($obj->suspended)) {
11204 11204
 						$disabled = 1;
11205
-						$labeltoshow .= ' - ' . $langs->trans("Closed");
11205
+						$labeltoshow .= ' - '.$langs->trans("Closed");
11206 11206
 					}
11207 11207
 
11208 11208
 
11209 11209
 					if (!empty($selected) && $selected == $obj->rowid) {
11210
-						$out .= '<option value="' . $obj->rowid . '" selected';
11210
+						$out .= '<option value="'.$obj->rowid.'" selected';
11211 11211
 						//if ($disabled) $out.=' disabled';						// with select2, field can't be preselected if disabled
11212
-						$out .= '>' . $labeltoshow . '</option>';
11212
+						$out .= '>'.$labeltoshow.'</option>';
11213 11213
 					} else {
11214 11214
 						if ($disabled && ($selected != $obj->rowid)) {
11215 11215
 							$resultat = '';
11216 11216
 						} else {
11217
-							$resultat = '<option value="' . $obj->rowid . '"';
11217
+							$resultat = '<option value="'.$obj->rowid.'"';
11218 11218
 							if ($disabled) {
11219 11219
 								$resultat .= ' disabled';
11220 11220
 							}
@@ -11259,14 +11259,14 @@  discard block
 block discarded – undo
11259 11259
 		$formother = new FormOther($this->db);
11260 11260
 
11261 11261
 		if ($search_component_params_hidden != '' && !preg_match('/^\(.*\)$/', $search_component_params_hidden)) {    // If $search_component_params_hidden does not start and end with ()
11262
-			$search_component_params_hidden = '(' . $search_component_params_hidden . ')';
11262
+			$search_component_params_hidden = '('.$search_component_params_hidden.')';
11263 11263
 		}
11264 11264
 
11265 11265
 		$ret = '';
11266 11266
 
11267 11267
 		$ret .= '<div class="divadvancedsearchfieldcomp centpercent inline-block">';
11268 11268
 		$ret .= '<a href="#" class="dropdownsearch-toggle unsetcolor">';
11269
-		$ret .= '<span class="fas fa-filter linkobject boxfilter paddingright pictofixedwidth" title="' . dol_escape_htmltag($langs->trans("Filters")) . '" id="idsubimgproductdistribution"></span>';
11269
+		$ret .= '<span class="fas fa-filter linkobject boxfilter paddingright pictofixedwidth" title="'.dol_escape_htmltag($langs->trans("Filters")).'" id="idsubimgproductdistribution"></span>';
11270 11270
 		$ret .= '</a>';
11271 11271
 
11272 11272
 		$ret .= '<div class="divadvancedsearchfieldcompinput inline-block minwidth500 maxwidth300onsmartphone">';
@@ -11310,30 +11310,30 @@  discard block
 block discarded – undo
11310 11310
 			$ret .= '<input type="hidden" name="show_search_component_params_hidden" value="1">';
11311 11311
 		}
11312 11312
 		$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%')) -->";
11313
-		$ret .= '<input type="hidden" id="search_component_params_hidden" name="search_component_params_hidden" value="' . dol_escape_htmltag($search_component_params_hidden) . '">';
11313
+		$ret .= '<input type="hidden" id="search_component_params_hidden" name="search_component_params_hidden" value="'.dol_escape_htmltag($search_component_params_hidden).'">';
11314 11314
 		// $ret .= "<!-- sql= ".forgeSQLFromUniversalSearchCriteria($search_component_params_hidden, $errormessage)." -->";
11315 11315
 
11316 11316
 		// TODO : Use $arrayoffiltercriterias instead of $arrayofcriterias
11317 11317
 		// For compatibility with forms that show themself the search criteria in addition of this component, we output these fields
11318 11318
 		foreach ($arrayofcriterias as $criteria) {
11319 11319
 			foreach ($criteria as $criteriafamilykey => $criteriafamilyval) {
11320
-				if (in_array('search_' . $criteriafamilykey, $arrayofinputfieldsalreadyoutput)) {
11320
+				if (in_array('search_'.$criteriafamilykey, $arrayofinputfieldsalreadyoutput)) {
11321 11321
 					continue;
11322 11322
 				}
11323 11323
 				if (in_array($criteriafamilykey, array('rowid', 'ref_ext', 'entity', 'extraparams'))) {
11324 11324
 					continue;
11325 11325
 				}
11326 11326
 				if (in_array($criteriafamilyval['type'], array('date', 'datetime', 'timestamp'))) {
11327
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_start">';
11328
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_startyear">';
11329
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_startmonth">';
11330
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_startday">';
11331
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_end">';
11332
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_endyear">';
11333
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_endmonth">';
11334
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_endday">';
11327
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_start">';
11328
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_startyear">';
11329
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_startmonth">';
11330
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_startday">';
11331
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_end">';
11332
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_endyear">';
11333
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_endmonth">';
11334
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_endday">';
11335 11335
 				} else {
11336
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '">';
11336
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'">';
11337 11337
 				}
11338 11338
 			}
11339 11339
 		}
@@ -11341,7 +11341,7 @@  discard block
 block discarded – undo
11341 11341
 		$ret .= '</div>';
11342 11342
 
11343 11343
 		$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";
11344
-		$ret .= '<input type="text" placeholder="' . $langs->trans("Filters") . '" id="search_component_params_input" name="search_component_params_input" class="noborderbottom search_component_input" value="">';
11344
+		$ret .= '<input type="text" placeholder="'.$langs->trans("Filters").'" id="search_component_params_input" name="search_component_params_input" class="noborderbottom search_component_input" value="">';
11345 11345
 
11346 11346
 		$ret .= '</div>';
11347 11347
 		$ret .= '</div>';
@@ -11398,7 +11398,7 @@  discard block
 block discarded – undo
11398 11398
 		// Convert $arrayoffiltercriterias into a json object that can be used in jquery to build the search component dynamically
11399 11399
 		$arrayoffiltercriterias_json = json_encode($arrayoffiltercriterias);
11400 11400
 		$ret .= '<script>
11401
-			var arrayoffiltercriterias = ' . $arrayoffiltercriterias_json . ';
11401
+			var arrayoffiltercriterias = ' . $arrayoffiltercriterias_json.';
11402 11402
 		</script>';
11403 11403
 
11404 11404
 
@@ -11412,9 +11412,9 @@  discard block
 block discarded – undo
11412 11412
 		$ret .= '<div class="search-component-assistance">';
11413 11413
 		$ret .= '<div>';
11414 11414
 
11415
-		$ret .= '<p class="assistance-title">' . img_picto('', 'filter') . ' ' . $langs->trans('FilterAssistance') . ' </p>';
11415
+		$ret .= '<p class="assistance-title">'.img_picto('', 'filter').' '.$langs->trans('FilterAssistance').' </p>';
11416 11416
 
11417
-		$ret .= '<p class="assistance-errors error" style="display:none">' . $langs->trans('AllFieldsRequired') . ' </p>';
11417
+		$ret .= '<p class="assistance-errors error" style="display:none">'.$langs->trans('AllFieldsRequired').' </p>';
11418 11418
 
11419 11419
 		$ret .= '<div class="operand">';
11420 11420
 		$ret .= $form->selectarray('search_filter_field', $arrayoffilterfieldslabel, '', $langs->trans("Fields"), 0, 0, '', 0, 0, 0, '', 'width250', 1);
@@ -11428,7 +11428,7 @@  discard block
 block discarded – undo
11428 11428
 		$ret .= '</select>';
11429 11429
 		$ret .= '<script>$(document).ready(function() {';
11430 11430
 		$ret .= '   $(".operator-selector").select2({';
11431
-		$ret .= '       placeholder: \'' . dol_escape_js($langs->trans('Operator')) . '\'';
11431
+		$ret .= '       placeholder: \''.dol_escape_js($langs->trans('Operator')).'\'';
11432 11432
 		$ret .= '   });';
11433 11433
 		$ret .= '});</script>';
11434 11434
 		$ret .= '</div>';
@@ -11437,12 +11437,12 @@  discard block
 block discarded – undo
11437 11437
 
11438 11438
 		$ret .= '<div class="value">';
11439 11439
 		// Input field for entering values
11440
-		$ret .= '<input type="text" class="flat width100 value-input" placeholder="' . dolPrintHTML($langs->trans('Value')) . '">';
11440
+		$ret .= '<input type="text" class="flat width100 value-input" placeholder="'.dolPrintHTML($langs->trans('Value')).'">';
11441 11441
 
11442 11442
 		// Date selector
11443 11443
 		$dateOne = '';
11444 11444
 		$ret .= '<span class="date-one" style="display:none">';
11445
-		$ret .=  $form->selectDate(($dateOne ? $dateOne : -1), 'dateone', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '');
11445
+		$ret .= $form->selectDate(($dateOne ? $dateOne : -1), 'dateone', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '');
11446 11446
 		$ret .= '</span>';
11447 11447
 
11448 11448
 		// Value selector (will be populated dynamically) based on search_filter_field value if a selected value has an array of values
@@ -11451,7 +11451,7 @@  discard block
 block discarded – undo
11451 11451
 		$ret .= '<script>
11452 11452
 			$(document).ready(function() {
11453 11453
 				$("#value-selector").select2({
11454
-					placeholder: "' . dol_escape_js($langs->trans('Value')) . '"
11454
+					placeholder: "' . dol_escape_js($langs->trans('Value')).'"
11455 11455
 				});
11456 11456
 				$("#value-selector").hide();
11457 11457
 				$("#value-selector").next(".select2-container").hide();
@@ -11461,7 +11461,7 @@  discard block
 block discarded – undo
11461 11461
 		$ret .= '</div>';
11462 11462
 
11463 11463
 		$ret .= '<div class="btn-div">';
11464
-		$ret .= '<button class="button buttongen button-save add-filter-btn" type="button">' . $langs->trans("addToFilter") . '</button>';
11464
+		$ret .= '<button class="button buttongen button-save add-filter-btn" type="button">'.$langs->trans("addToFilter").'</button>';
11465 11465
 		$ret .= '</div>';
11466 11466
 
11467 11467
 		$ret .= '</div>';
@@ -11627,7 +11627,7 @@  discard block
 block discarded – undo
11627 11627
 
11628 11628
 		$TModels = array();
11629 11629
 
11630
-		include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php';
11630
+		include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
11631 11631
 		$formmail = new FormMail($this->db);
11632 11632
 		$result = $formmail->fetchAllEMailTemplate($modelType, $user, $langs);
11633 11633
 
@@ -11640,20 +11640,20 @@  discard block
 block discarded – undo
11640 11640
 			}
11641 11641
 		}
11642 11642
 
11643
-		$retstring .= '<select class="flat" id="select_' . $prefix . 'model_mail" name="' . $prefix . 'model_mail">';
11643
+		$retstring .= '<select class="flat" id="select_'.$prefix.'model_mail" name="'.$prefix.'model_mail">';
11644 11644
 
11645 11645
 		foreach ($TModels as $id_model => $label_model) {
11646
-			$retstring .= '<option value="' . $id_model . '"';
11646
+			$retstring .= '<option value="'.$id_model.'"';
11647 11647
 			if (!empty($selected) && $selected == $id_model) {
11648 11648
 				$retstring .= "selected";
11649 11649
 			}
11650
-			$retstring .= ">" . $label_model . "</option>";
11650
+			$retstring .= ">".$label_model."</option>";
11651 11651
 		}
11652 11652
 
11653 11653
 		$retstring .= "</select>";
11654 11654
 
11655 11655
 		if ($addjscombo) {
11656
-			$retstring .= ajax_combobox('select_' . $prefix . 'model_mail');
11656
+			$retstring .= ajax_combobox('select_'.$prefix.'model_mail');
11657 11657
 		}
11658 11658
 
11659 11659
 		return $retstring;
@@ -11704,16 +11704,16 @@  discard block
 block discarded – undo
11704 11704
 
11705 11705
 		foreach ($buttons as $button) {
11706 11706
 			$addclass = empty($button['addclass']) ? '' : $button['addclass'];
11707
-			$retstring .= '<input type="submit" class="button button-' . $button['name'] . ($morecss ? ' ' . $morecss : '') . ' ' . $addclass . '" name="' . $button['name'] . '" value="' . dol_escape_htmltag($langs->transnoentities($button['label_key'])) . '">';
11707
+			$retstring .= '<input type="submit" class="button button-'.$button['name'].($morecss ? ' '.$morecss : '').' '.$addclass.'" name="'.$button['name'].'" value="'.dol_escape_htmltag($langs->transnoentities($button['label_key'])).'">';
11708 11708
 		}
11709 11709
 		$retstring .= $withoutdiv ? '' : '</div>';
11710 11710
 
11711 11711
 		if ($dol_openinpopup) {
11712
-			$retstring .= '<!-- buttons are shown into a $dol_openinpopup=' . dol_escape_htmltag($dol_openinpopup) . ' context, so we enable the close of dialog on cancel -->' . "\n";
11713
-			$retstring .= '<script nonce="' . getNonce() . '">';
11712
+			$retstring .= '<!-- buttons are shown into a $dol_openinpopup='.dol_escape_htmltag($dol_openinpopup).' context, so we enable the close of dialog on cancel -->'."\n";
11713
+			$retstring .= '<script nonce="'.getNonce().'">';
11714 11714
 			$retstring .= 'jQuery(".button-cancel").click(function(e) {
11715
-				e.preventDefault(); console.log(\'We click on cancel in iframe popup ' . dol_escape_js($dol_openinpopup) . '\');
11716
-				window.parent.jQuery(\'#idfordialog' . dol_escape_js($dol_openinpopup) . '\').dialog(\'close\');
11715
+				e.preventDefault(); console.log(\'We click on cancel in iframe popup ' . dol_escape_js($dol_openinpopup).'\');
11716
+				window.parent.jQuery(\'#idfordialog' . dol_escape_js($dol_openinpopup).'\').dialog(\'close\');
11717 11717
 				 });';
11718 11718
 			$retstring .= '</script>';
11719 11719
 		}
@@ -11742,7 +11742,7 @@  discard block
 block discarded – undo
11742 11742
 		dol_syslog(__METHOD__, LOG_DEBUG);
11743 11743
 
11744 11744
 		$sql = "SELECT rowid, code, label as label";
11745
-		$sql .= " FROM " . MAIN_DB_PREFIX . 'c_invoice_subtype';
11745
+		$sql .= " FROM ".MAIN_DB_PREFIX.'c_invoice_subtype';
11746 11746
 		$sql .= " WHERE active = 1";
11747 11747
 
11748 11748
 		$resql = $this->db->query($sql);
@@ -11753,7 +11753,7 @@  discard block
 block discarded – undo
11753 11753
 				$obj = $this->db->fetch_object($resql);
11754 11754
 
11755 11755
 				// If translation exists, we use it, otherwise we take the default wording
11756
-				$label = ($langs->trans("InvoiceSubtype" . $obj->rowid) != "InvoiceSubtype" . $obj->rowid) ? $langs->trans("InvoiceSubtype" . $obj->rowid) : (($obj->label != '-') ? $obj->label : '');
11756
+				$label = ($langs->trans("InvoiceSubtype".$obj->rowid) != "InvoiceSubtype".$obj->rowid) ? $langs->trans("InvoiceSubtype".$obj->rowid) : (($obj->label != '-') ? $obj->label : '');
11757 11757
 				$this->cache_invoice_subtype[$obj->rowid]['rowid'] = $obj->rowid;
11758 11758
 				$this->cache_invoice_subtype[$obj->rowid]['code'] = $obj->code;
11759 11759
 				$this->cache_invoice_subtype[$obj->rowid]['label'] = $label;
@@ -11785,18 +11785,18 @@  discard block
 block discarded – undo
11785 11785
 		global $langs, $user;
11786 11786
 
11787 11787
 		$out = '';
11788
-		dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG);
11788
+		dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG);
11789 11789
 
11790 11790
 		$this->load_cache_invoice_subtype();
11791 11791
 
11792
-		$out .= '<select id="' . $htmlname . '" class="flat selectsubtype' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">';
11792
+		$out .= '<select id="'.$htmlname.'" class="flat selectsubtype'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
11793 11793
 		if ($addempty) {
11794 11794
 			$out .= '<option value="0">&nbsp;</option>';
11795 11795
 		}
11796 11796
 
11797 11797
 		foreach ($this->cache_invoice_subtype as $rowid => $subtype) {
11798 11798
 			$label = $subtype['label'];
11799
-			$out .= '<option value="' . $subtype['rowid'] . '"';
11799
+			$out .= '<option value="'.$subtype['rowid'].'"';
11800 11800
 			if ($selected == $subtype['rowid']) {
11801 11801
 				$out .= ' selected="selected"';
11802 11802
 			}
Please login to merge, or discard this patch.
htdocs/projet/tasks/note.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -125,9 +125,9 @@  discard block
 block discarded – undo
125 125
 
126 126
 $now = dol_now();
127 127
 
128
-$title = $object->ref . ' - ' . $langs->trans("Notes");
128
+$title = $object->ref.' - '.$langs->trans("Notes");
129 129
 if (!empty($withproject)) {
130
-	$title .= ' | ' . $langs->trans("Project") . (!empty($projectstatic->ref) ? ': '.$projectstatic->ref : '')  ;
130
+	$title .= ' | '.$langs->trans("Project").(!empty($projectstatic->ref) ? ': '.$projectstatic->ref : '');
131 131
 }
132 132
 $help_url = '';
133 133
 
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
 		$cols = 2;
237 237
 		$savobject = $object;
238 238
 		$object = $projectstatic;
239
-		include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
239
+		include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
240 240
 		$object = $savobject;
241 241
 
242 242
 		print '</table>';
Please login to merge, or discard this patch.
htdocs/projet/tasks/time.php 1 patch
Spacing   +173 added lines, -173 removed lines patch added patch discarded remove patch
@@ -34,14 +34,14 @@  discard block
 block discarded – undo
34 34
 
35 35
 // Load Dolibarr environment
36 36
 require '../../main.inc.php';
37
-require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
38
-require_once DOL_DOCUMENT_ROOT . '/projet/class/task.class.php';
39
-require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
40
-require_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php';
41
-require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
42
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
43
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php';
44
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formintervention.class.php';
37
+require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
38
+require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php';
39
+require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
40
+require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
41
+require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
42
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
43
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
44
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formintervention.class.php';
45 45
 
46 46
 /**
47 47
  * @var Conf $conf
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
 	setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
181 181
 }
182 182
 
183
-include DOL_DOCUMENT_ROOT . '/core/actions_changeselectedfields.inc.php';
183
+include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
184 184
 
185 185
 // Purge search criteria
186 186
 if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers
@@ -362,10 +362,10 @@  discard block
 block discarded – undo
362 362
 }
363 363
 
364 364
 if ($action == 'confirm_deleteline' && $confirm == "yes" && ($user->hasRight('projet', 'time') || $user->hasRight('projet', 'all', 'creer'))) {
365
-	$object->fetchTimeSpent(GETPOSTINT('lineid'));    // load properties like $object->timespent_xxx
365
+	$object->fetchTimeSpent(GETPOSTINT('lineid')); // load properties like $object->timespent_xxx
366 366
 
367 367
 	if (in_array($object->timespent_fk_user, $childids) || $user->hasRight('projet', 'all', 'creer')) {
368
-		$result = $object->delTimeSpent($user);    // delete line with $object->timespent_id
368
+		$result = $object->delTimeSpent($user); // delete line with $object->timespent_id
369 369
 
370 370
 		if ($result < 0) {
371 371
 			$langs->load("errors");
@@ -385,7 +385,7 @@  discard block
 block discarded – undo
385 385
 		if (count($tasksarray) > 0) {
386 386
 			$id = $tasksarray[0]->id;
387 387
 		} else {
388
-			header("Location: " . DOL_URL_ROOT . '/projet/tasks.php?id=' . $projectstatic->id . ($withproject ? '&withproject=1' : '') . (empty($mode) ? '' : '&mode=' . $mode));
388
+			header("Location: ".DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.($withproject ? '&withproject=1' : '').(empty($mode) ? '' : '&mode='.$mode));
389 389
 			exit;
390 390
 		}
391 391
 	}
@@ -422,9 +422,9 @@  discard block
 block discarded – undo
422 422
 	if (!($projectstatic->thirdparty->id > 0)) {
423 423
 		setEventMessages($langs->trans("ThirdPartyRequiredToGenerateInvoice"), null, 'errors');
424 424
 	} else {
425
-		include_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
426
-		include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
427
-		include_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
425
+		include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
426
+		include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
427
+		include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
428 428
 
429 429
 		$tmpinvoice = new Facture($db);
430 430
 		$tmptimespent = new Task($db);
@@ -490,7 +490,7 @@  discard block
 block discarded – undo
490 490
 				$arrayoftasks = array();
491 491
 				foreach ($toselect as $key => $value) {
492 492
 					// Get userid, timepent
493
-					$object->fetchTimeSpent($value);    // $value is ID of 1 line in timespent table
493
+					$object->fetchTimeSpent($value); // $value is ID of 1 line in timespent table
494 494
 					$arrayoftasks[$object->timespent_fk_user][(int) $object->timespent_fk_product]['timespent'] += $object->timespent_duration;
495 495
 					$arrayoftasks[$object->timespent_fk_user][(int) $object->timespent_fk_product]['totalvaluetodivideby3600'] += ($object->timespent_duration * $object->timespent_thm);
496 496
 				}
@@ -563,7 +563,7 @@  discard block
 block discarded – undo
563 563
 						}
564 564
 
565 565
 						// Add lines
566
-						$lineid = $tmpinvoice->addline($langs->trans("TimeSpentForInvoice", $username) . ' : ' . $qtyhourtext, $pu_htline, round($qtyhour / $prodDurationHours, 2), $txtvaline, $localtax1line, $localtax2line, ($idprodline > 0 ? $idprodline : 0), $remiseproject);
566
+						$lineid = $tmpinvoice->addline($langs->trans("TimeSpentForInvoice", $username).' : '.$qtyhourtext, $pu_htline, round($qtyhour / $prodDurationHours, 2), $txtvaline, $localtax1line, $localtax2line, ($idprodline > 0 ? $idprodline : 0), $remiseproject);
567 567
 						if ($lineid < 0) {
568 568
 							$error++;
569 569
 							setEventMessages(null, $tmpinvoice->errors, 'errors');
@@ -596,16 +596,16 @@  discard block
 block discarded – undo
596 596
 
597 597
 					$arrayoftasks[$object->timespent_id]['timespent'] = $object->timespent_duration;
598 598
 					$arrayoftasks[$object->timespent_id]['totalvaluetodivideby3600'] = $object->timespent_duration * $object->timespent_thm;
599
-					$arrayoftasks[$object->timespent_id]['note'] = $ftask->ref . ' - ' . $ftask->label . ' - ' . $username;
599
+					$arrayoftasks[$object->timespent_id]['note'] = $ftask->ref.' - '.$ftask->label.' - '.$username;
600 600
 					$arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $object->timespent_note);
601 601
 
602 602
 					if (!empty($withdetail)) {
603 603
 						if (!empty($object->timespent_withhour)) {
604
-							$arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Date") . ': ' . dol_print_date($object->timespent_datehour));
604
+							$arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Date").': '.dol_print_date($object->timespent_datehour));
605 605
 						} else {
606
-							$arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Date") . ': ' . dol_print_date($object->timespent_date));
606
+							$arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Date").': '.dol_print_date($object->timespent_date));
607 607
 						}
608
-						$arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Duration") . ': ' . convertSecondToTime($object->timespent_duration, 'all', $conf->global->MAIN_DURATION_OF_WORKDAY));
608
+						$arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Duration").': '.convertSecondToTime($object->timespent_duration, 'all', $conf->global->MAIN_DURATION_OF_WORKDAY));
609 609
 					}
610 610
 					$arrayoftasks[$object->timespent_id]['user'] = $object->timespent_fk_user;
611 611
 					$arrayoftasks[$object->timespent_id]['fk_product'] = $object->timespent_fk_product;
@@ -683,7 +683,7 @@  discard block
 block discarded – undo
683 683
 				$arrayoftasks = array();
684 684
 				foreach ($toselect as $key => $value) {
685 685
 					// Get userid, timepent
686
-					$object->fetchTimeSpent($value);        // Call method to get list of timespent for a timespent line id (We use the utiliy method found into Task object)
686
+					$object->fetchTimeSpent($value); // Call method to get list of timespent for a timespent line id (We use the utiliy method found into Task object)
687 687
 					// $object->id is now the task id
688 688
 					$arrayoftasks[$object->id][(int) $object->timespent_fk_product]['timespent'] += $object->timespent_duration;
689 689
 					$arrayoftasks[$object->id][(int) $object->timespent_fk_product]['totalvaluetodivideby3600'] += ($object->timespent_duration * $object->timespent_thm);
@@ -759,7 +759,7 @@  discard block
 block discarded – undo
759 759
 						// Add lines
760 760
 						$date_start = '';
761 761
 						$date_end = '';
762
-						$lineName = $ftask->ref . ' - ' . $ftask->label;
762
+						$lineName = $ftask->ref.' - '.$ftask->label;
763 763
 						$lineid = $tmpinvoice->addline($lineName, $pu_ht_for_task, price2num($qtyhour / $prodDurationHours, 'MS'), $txtvaline, $localtax1line, $localtax2line, ($idprodline > 0 ? $idprodline : 0), $remiseproject, $date_start, $date_end, 0, 0, '', 'HT', 0, 1, -1, 0, '', 0, 0, null, $pa_ht);
764 764
 						if ($lineid < 0) {
765 765
 							$error++;
@@ -769,8 +769,8 @@  discard block
 block discarded – undo
769 769
 
770 770
 						if (!$error) {
771 771
 							// Update lineid into line of timespent
772
-							$sql = 'UPDATE ' . MAIN_DB_PREFIX . 'element_time SET invoice_line_id = ' . ((int) $lineid) . ', invoice_id = ' . ((int) $tmpinvoice->id);
773
-							$sql .= ' WHERE rowid IN (' . $db->sanitize(implode(',', $toselect)) . ')';
772
+							$sql = 'UPDATE '.MAIN_DB_PREFIX.'element_time SET invoice_line_id = '.((int) $lineid).', invoice_id = '.((int) $tmpinvoice->id);
773
+							$sql .= ' WHERE rowid IN ('.$db->sanitize(implode(',', $toselect)).')';
774 774
 							$result = $db->query($sql);
775 775
 							if (!$result) {
776 776
 								$error++;
@@ -806,12 +806,12 @@  discard block
 block discarded – undo
806 806
 	if (!($projectstatic->thirdparty->id > 0)) {
807 807
 		setEventMessages($langs->trans("ThirdPartyRequiredToGenerateIntervention"), null, 'errors');
808 808
 	} else {
809
-		include_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
810
-		include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
811
-		include_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
809
+		include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
810
+		include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
811
+		include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
812 812
 
813 813
 
814
-		require_once DOL_DOCUMENT_ROOT . '/fichinter/class/fichinter.class.php';
814
+		require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php';
815 815
 		$tmpinter = new Fichinter($db);
816 816
 		$tmptimespent = new Task($db);
817 817
 		$fuser = new User($db);
@@ -823,7 +823,7 @@  discard block
 block discarded – undo
823 823
 		$tmpinter->socid = $projectstatic->thirdparty->id;
824 824
 		$tmpinter->date = dol_mktime(GETPOSTINT('rehour'), GETPOSTINT('remin'), GETPOSTINT('resec'), GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'));
825 825
 		$tmpinter->fk_project = $projectstatic->id;
826
-		$tmpinter->description = $projectstatic->title . (!empty($projectstatic->description) ? '-' . $projectstatic->label : '');
826
+		$tmpinter->description = $projectstatic->title.(!empty($projectstatic->description) ? '-'.$projectstatic->label : '');
827 827
 
828 828
 		if ($interToUse) {
829 829
 			$tmpinter->fetch($interToUse);
@@ -856,7 +856,7 @@  discard block
 block discarded – undo
856 856
 				$qtyhourtext = convertSecondToTime($value['timespent'], 'all', $conf->global->MAIN_DURATION_OF_WORKDAY);
857 857
 
858 858
 				// Add lines
859
-				$lineid = $tmpinter->addline($user, $tmpinter->id, $ftask->label . (!empty($value['note']) ? ' - ' . $value['note'] : ''), $value['date'], $value['timespent']);
859
+				$lineid = $tmpinter->addline($user, $tmpinter->id, $ftask->label.(!empty($value['note']) ? ' - '.$value['note'] : ''), $value['date'], $value['timespent']);
860 860
 			}
861 861
 		}
862 862
 
@@ -887,9 +887,9 @@  discard block
 block discarded – undo
887 887
 //$result = $projectstatic->fetch($object->fk_project);
888 888
 $arrayofselected = is_array($toselect) ? $toselect : array();
889 889
 
890
-$title = $object->ref . ' - ' . $langs->trans("TimeSpent");
890
+$title = $object->ref.' - '.$langs->trans("TimeSpent");
891 891
 if (!empty($withproject)) {
892
-	$title .= ' | ' . $langs->trans("Project") . (!empty($projectstatic->ref) ? ': ' . $projectstatic->ref : '');
892
+	$title .= ' | '.$langs->trans("Project").(!empty($projectstatic->ref) ? ': '.$projectstatic->ref : '');
893 893
 }
894 894
 $help_url = '';
895 895
 
@@ -938,13 +938,13 @@  discard block
 block discarded – undo
938 938
 
939 939
 			$param = ((!empty($mode) && $mode == 'mine') ? '&mode=mine' : '');
940 940
 			if ($search_user) {
941
-				$param .= '&search_user=' . ((int) $search_user);
941
+				$param .= '&search_user='.((int) $search_user);
942 942
 			}
943 943
 			if ($search_month) {
944
-				$param .= '&search_month=' . ((int) $search_month);
944
+				$param .= '&search_month='.((int) $search_month);
945 945
 			}
946 946
 			if ($search_year) {
947
-				$param .= '&search_year=' . ((int) $search_year);
947
+				$param .= '&search_year='.((int) $search_year);
948 948
 			}
949 949
 
950 950
 			// Project card
@@ -956,14 +956,14 @@  discard block
 block discarded – undo
956 956
 			$morehtmlref .= $projectstatic->title;
957 957
 			// Thirdparty
958 958
 			if (!empty($projectstatic->thirdparty->id) && $projectstatic->thirdparty->id > 0) {
959
-				$morehtmlref .= '<br>' . $projectstatic->thirdparty->getNomUrl(1, 'project');
959
+				$morehtmlref .= '<br>'.$projectstatic->thirdparty->getNomUrl(1, 'project');
960 960
 			}
961 961
 			$morehtmlref .= '</div>';
962 962
 
963 963
 			// Define a complementary filter for search of next/prev ref.
964 964
 			if (!$user->hasRight('projet', 'all', 'lire')) {
965 965
 				$objectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 0);
966
-				$projectstatic->next_prev_filter = "rowid:IN:" . $db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0');
966
+				$projectstatic->next_prev_filter = "rowid:IN:".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0');
967 967
 			}
968 968
 
969 969
 			dol_banner_tab($projectstatic, 'project_ref', $linkback, 1, 'ref', 'ref', $morehtmlref, $param);
@@ -981,25 +981,25 @@  discard block
 block discarded – undo
981 981
 				print '</td>';
982 982
 				print '<td>';
983 983
 				if (getDolGlobalString('PROJECT_USE_OPPORTUNITIES')) {
984
-					print '<input type="checkbox" disabled name="usage_opportunity"' . (GETPOSTISSET('usage_opportunity') ? (GETPOST('usage_opportunity', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_opportunity ? ' checked="checked"' : '')) . '"> ';
984
+					print '<input type="checkbox" disabled name="usage_opportunity"'.(GETPOSTISSET('usage_opportunity') ? (GETPOST('usage_opportunity', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_opportunity ? ' checked="checked"' : '')).'"> ';
985 985
 					$htmltext = $langs->trans("ProjectFollowOpportunity");
986 986
 					print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext);
987 987
 					print '<br>';
988 988
 				}
989 989
 				if (!getDolGlobalString('PROJECT_HIDE_TASKS')) {
990
-					print '<input type="checkbox" disabled name="usage_task"' . (GETPOSTISSET('usage_task') ? (GETPOST('usage_task', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_task ? ' checked="checked"' : '')) . '"> ';
990
+					print '<input type="checkbox" disabled name="usage_task"'.(GETPOSTISSET('usage_task') ? (GETPOST('usage_task', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_task ? ' checked="checked"' : '')).'"> ';
991 991
 					$htmltext = $langs->trans("ProjectFollowTasks");
992 992
 					print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext);
993 993
 					print '<br>';
994 994
 				}
995 995
 				if (!getDolGlobalString('PROJECT_HIDE_TASKS') && getDolGlobalString('PROJECT_BILL_TIME_SPENT')) {
996
-					print '<input type="checkbox" disabled name="usage_bill_time"' . (GETPOSTISSET('usage_bill_time') ? (GETPOST('usage_bill_time', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_bill_time ? ' checked="checked"' : '')) . '"> ';
996
+					print '<input type="checkbox" disabled name="usage_bill_time"'.(GETPOSTISSET('usage_bill_time') ? (GETPOST('usage_bill_time', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_bill_time ? ' checked="checked"' : '')).'"> ';
997 997
 					$htmltext = $langs->trans("ProjectBillTimeDescription");
998 998
 					print $form->textwithpicto($langs->trans("BillTime"), $htmltext);
999 999
 					print '<br>';
1000 1000
 				}
1001 1001
 				if (isModEnabled('eventorganization')) {
1002
-					print '<input type="checkbox" disabled name="usage_organize_event"' . (GETPOSTISSET('usage_organize_event') ? (GETPOST('usage_organize_event', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_organize_event ? ' checked="checked"' : '')) . '"> ';
1002
+					print '<input type="checkbox" disabled name="usage_organize_event"'.(GETPOSTISSET('usage_organize_event') ? (GETPOST('usage_organize_event', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_organize_event ? ' checked="checked"' : '')).'"> ';
1003 1003
 					$htmltext = $langs->trans("EventOrganizationDescriptionLong");
1004 1004
 					print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext);
1005 1005
 				}
@@ -1007,14 +1007,14 @@  discard block
 block discarded – undo
1007 1007
 			}
1008 1008
 
1009 1009
 			// Budget
1010
-			print '<tr><td>' . $langs->trans("Budget") . '</td><td>';
1010
+			print '<tr><td>'.$langs->trans("Budget").'</td><td>';
1011 1011
 			if (!is_null($projectstatic->budget_amount) && strcmp($projectstatic->budget_amount, '')) {
1012
-				print '<span class="amount">' . price($projectstatic->budget_amount, 0, $langs, 1, 0, 0, $conf->currency) . '</span>';
1012
+				print '<span class="amount">'.price($projectstatic->budget_amount, 0, $langs, 1, 0, 0, $conf->currency).'</span>';
1013 1013
 			}
1014 1014
 			print '</td></tr>';
1015 1015
 
1016 1016
 			// Date start - end project
1017
-			print '<tr><td>' . $langs->trans("Dates") . '</td><td>';
1017
+			print '<tr><td>'.$langs->trans("Dates").'</td><td>';
1018 1018
 			$start = dol_print_date($projectstatic->date_start, 'day');
1019 1019
 			print($start ? $start : '?');
1020 1020
 			$end = dol_print_date($projectstatic->date_end, 'day');
@@ -1026,7 +1026,7 @@  discard block
 block discarded – undo
1026 1026
 			print '</td></tr>';
1027 1027
 
1028 1028
 			// Visibility
1029
-			print '<tr><td class="titlefield">' . $langs->trans("Visibility") . '</td><td>';
1029
+			print '<tr><td class="titlefield">'.$langs->trans("Visibility").'</td><td>';
1030 1030
 			if ($projectstatic->public) {
1031 1031
 				print img_picto($langs->trans('SharedProject'), 'world', 'class="paddingrightonly"');
1032 1032
 				print $langs->trans('SharedProject');
@@ -1040,7 +1040,7 @@  discard block
 block discarded – undo
1040 1040
 			$cols = 2;
1041 1041
 			$savobject = $object;
1042 1042
 			$object = $projectstatic;
1043
-			include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
1043
+			include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
1044 1044
 			$object = $savobject;
1045 1045
 
1046 1046
 			print '</table>';
@@ -1053,7 +1053,7 @@  discard block
 block discarded – undo
1053 1053
 
1054 1054
 			// Categories
1055 1055
 			if (isModEnabled('category')) {
1056
-				print '<tr><td class="valignmiddle">' . $langs->trans("Categories") . '</td><td>';
1056
+				print '<tr><td class="valignmiddle">'.$langs->trans("Categories").'</td><td>';
1057 1057
 				print $form->showCategories($projectstatic->id, 'project', 1);
1058 1058
 				print "</td></tr>";
1059 1059
 			}
@@ -1092,12 +1092,12 @@  discard block
 block discarded – undo
1092 1092
 
1093 1093
 				if (!empty($projectidforalltimes)) {
1094 1094
 					// We are on tab 'Time Spent' of project
1095
-					$backtourl = $_SERVER['PHP_SELF'] . '?projectid=' . $projectstatic->id . ($withproject ? '&withproject=1' : '');
1096
-					$linktocreatetimeUrl = $_SERVER['PHP_SELF'] . '?' . ($withproject ? 'withproject=1' : '') . '&projectid=' . $projectstatic->id . '&action=createtime&token=' . newToken() . $param . '&backtopage=' . urlencode($backtourl);
1095
+					$backtourl = $_SERVER['PHP_SELF'].'?projectid='.$projectstatic->id.($withproject ? '&withproject=1' : '');
1096
+					$linktocreatetimeUrl = $_SERVER['PHP_SELF'].'?'.($withproject ? 'withproject=1' : '').'&projectid='.$projectstatic->id.'&action=createtime&token='.newToken().$param.'&backtopage='.urlencode($backtourl);
1097 1097
 				} else {
1098 1098
 					// We are on tab 'Time Spent' of task
1099
-					$backtourl = $_SERVER['PHP_SELF'] . '?id=' . $object->id . ($withproject ? '&withproject=1' : '');
1100
-					$linktocreatetimeUrl = $_SERVER['PHP_SELF'] . '?' . ($withproject ? 'withproject=1' : '') . ($object->id > 0 ? '&id=' . $object->id : '&projectid=' . $projectstatic->id) . '&action=createtime&token=' . newToken() . $param . '&backtopage=' . urlencode($backtourl);
1099
+					$backtourl = $_SERVER['PHP_SELF'].'?id='.$object->id.($withproject ? '&withproject=1' : '');
1100
+					$linktocreatetimeUrl = $_SERVER['PHP_SELF'].'?'.($withproject ? 'withproject=1' : '').($object->id > 0 ? '&id='.$object->id : '&projectid='.$projectstatic->id).'&action=createtime&token='.newToken().$param.'&backtopage='.urlencode($backtourl);
1101 1101
 				}
1102 1102
 			} else {
1103 1103
 				$linktocreatetimeBtnStatus = -2;
@@ -1142,19 +1142,19 @@  discard block
 block discarded – undo
1142 1142
 		print dol_get_fiche_head($head, 'task_time', $langs->trans("Task"), -1, 'projecttask', 0, '', 'reposition');
1143 1143
 
1144 1144
 		if ($action == 'deleteline') {
1145
-			$urlafterconfirm = $_SERVER["PHP_SELF"] . "?" . ($object->id > 0 ? "id=" . $object->id : 'projectid=' . $projectstatic->id) . '&lineid=' . GETPOSTINT("lineid") . ($withproject ? '&withproject=1' : '');
1145
+			$urlafterconfirm = $_SERVER["PHP_SELF"]."?".($object->id > 0 ? "id=".$object->id : 'projectid='.$projectstatic->id).'&lineid='.GETPOSTINT("lineid").($withproject ? '&withproject=1' : '');
1146 1146
 			print $form->formconfirm($urlafterconfirm, $langs->trans("DeleteATimeSpent"), $langs->trans("ConfirmDeleteATimeSpent"), "confirm_deleteline", '', '', 1);
1147 1147
 		}
1148 1148
 
1149 1149
 		$param = ($withproject ? '&withproject=1' : '');
1150
-		$param .= ($param ? '&' : '') . 'id=' . $object->id;        // ID of task
1151
-		$linkback = $withproject ? '<a href="' . DOL_URL_ROOT . '/projet/tasks.php?id=' . $projectstatic->id . '">' . $langs->trans("BackToList") . '</a>' : '';
1150
+		$param .= ($param ? '&' : '').'id='.$object->id; // ID of task
1151
+		$linkback = $withproject ? '<a href="'.DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.'">'.$langs->trans("BackToList").'</a>' : '';
1152 1152
 
1153 1153
 		if (!GETPOST('withproject') || empty($projectstatic->id)) {
1154 1154
 			$projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1);
1155
-			$object->next_prev_filter = "fk_projet:IN:" . $db->sanitize($projectsListId);
1155
+			$object->next_prev_filter = "fk_projet:IN:".$db->sanitize($projectsListId);
1156 1156
 		} else {
1157
-			$object->next_prev_filter = "fk_projet:=:" . ((int) $projectstatic->id);
1157
+			$object->next_prev_filter = "fk_projet:=:".((int) $projectstatic->id);
1158 1158
 		}
1159 1159
 
1160 1160
 		$morehtmlref = '';
@@ -1162,12 +1162,12 @@  discard block
 block discarded – undo
1162 1162
 		// Project
1163 1163
 		if (empty($withproject)) {
1164 1164
 			$morehtmlref .= '<div class="refidno">';
1165
-			$morehtmlref .= $langs->trans("Project") . ': ';
1165
+			$morehtmlref .= $langs->trans("Project").': ';
1166 1166
 			$morehtmlref .= $projectstatic->getNomUrl(1);
1167 1167
 			$morehtmlref .= '<br>';
1168 1168
 
1169 1169
 			// Third party
1170
-			$morehtmlref .= $langs->trans("ThirdParty") . ': ';
1170
+			$morehtmlref .= $langs->trans("ThirdParty").': ';
1171 1171
 			if (!empty($projectstatic->thirdparty) && is_object($projectstatic->thirdparty)) {
1172 1172
 				$morehtmlref .= $projectstatic->thirdparty->getNomUrl(1);
1173 1173
 			}
@@ -1183,7 +1183,7 @@  discard block
 block discarded – undo
1183 1183
 		print '<table class="border centpercent tableforfield">';
1184 1184
 
1185 1185
 		// Task parent
1186
-		print '<tr><td>' . $langs->trans("ChildOfTask") . '</td><td>';
1186
+		print '<tr><td>'.$langs->trans("ChildOfTask").'</td><td>';
1187 1187
 		if ($object->fk_task_parent > 0) {
1188 1188
 			$tasktmp = new Task($db);
1189 1189
 			$tasktmp->fetch($object->fk_task_parent);
@@ -1192,7 +1192,7 @@  discard block
 block discarded – undo
1192 1192
 		print '</td></tr>';
1193 1193
 
1194 1194
 		// Date start - Date end task
1195
-		print '<tr><td class="titlefield">' . $langs->trans("DateStart") . ' - ' . $langs->trans("Deadline") . '</td><td>';
1195
+		print '<tr><td class="titlefield">'.$langs->trans("DateStart").' - '.$langs->trans("Deadline").'</td><td>';
1196 1196
 		$start = dol_print_date($object->date_start, 'dayhour');
1197 1197
 		print($start ? $start : '?');
1198 1198
 		$end = dol_print_date($object->date_end, 'dayhour');
@@ -1204,7 +1204,7 @@  discard block
 block discarded – undo
1204 1204
 		print '</td></tr>';
1205 1205
 
1206 1206
 		// Planned workload
1207
-		print '<tr><td>' . $langs->trans("PlannedWorkload") . '</td><td>';
1207
+		print '<tr><td>'.$langs->trans("PlannedWorkload").'</td><td>';
1208 1208
 		if ($object->planned_workload) {
1209 1209
 			print convertSecondToTime($object->planned_workload, 'allhourmin');
1210 1210
 		}
@@ -1219,21 +1219,21 @@  discard block
 block discarded – undo
1219 1219
 		print '<table class="border tableforfield centpercent">';
1220 1220
 
1221 1221
 		// Progress declared
1222
-		print '<tr><td class="titlefield">' . $langs->trans("ProgressDeclared") . '</td><td>';
1223
-		print $object->progress != '' ? $object->progress . ' %' : '';
1222
+		print '<tr><td class="titlefield">'.$langs->trans("ProgressDeclared").'</td><td>';
1223
+		print $object->progress != '' ? $object->progress.' %' : '';
1224 1224
 		print '</td></tr>';
1225 1225
 
1226 1226
 		// Progress calculated
1227
-		print '<tr><td>' . $langs->trans("ProgressCalculated") . '</td><td>';
1227
+		print '<tr><td>'.$langs->trans("ProgressCalculated").'</td><td>';
1228 1228
 		if ($object->planned_workload) {
1229 1229
 			$tmparray = $object->getSummaryOfTimeSpent();
1230 1230
 			if ($tmparray['total_duration'] > 0) {
1231
-				print round($tmparray['total_duration'] / $object->planned_workload * 100, 2) . ' %';
1231
+				print round($tmparray['total_duration'] / $object->planned_workload * 100, 2).' %';
1232 1232
 			} else {
1233 1233
 				print '0 %';
1234 1234
 			}
1235 1235
 		} else {
1236
-			print '<span class="opacitymedium">' . $langs->trans("WorkloadNotDefined") . '</span>';
1236
+			print '<span class="opacitymedium">'.$langs->trans("WorkloadNotDefined").'</span>';
1237 1237
 		}
1238 1238
 		print '</td>';
1239 1239
 
@@ -1249,7 +1249,7 @@  discard block
 block discarded – undo
1249 1249
 		print dol_get_fiche_end();
1250 1250
 	} else {
1251 1251
 		if ($action == 'deleteline') {
1252
-			$urlafterconfirm = $_SERVER["PHP_SELF"] . "?" . ($object->id > 0 ? "id=" . $object->id : 'projectid=' . $projectstatic->id) . '&lineid=' . GETPOSTINT("lineid") . ($withproject ? '&withproject=1' : '');
1252
+			$urlafterconfirm = $_SERVER["PHP_SELF"]."?".($object->id > 0 ? "id=".$object->id : 'projectid='.$projectstatic->id).'&lineid='.GETPOSTINT("lineid").($withproject ? '&withproject=1' : '');
1253 1253
 			print $form->formconfirm($urlafterconfirm, $langs->trans("DeleteATimeSpent"), $langs->trans("ConfirmDeleteATimeSpent"), "confirm_deleteline", '', '', 1);
1254 1254
 		}
1255 1255
 	}
@@ -1263,7 +1263,7 @@  discard block
 block discarded – undo
1263 1263
 
1264 1264
 		if ($action == 'deleteline' && !empty($projectidforalltimes)) {
1265 1265
 			// We must use projectidprojectid if on list of timespent of project and id=taskid if on list of timespent of a task
1266
-			$urlafterconfirm = $_SERVER["PHP_SELF"] . "?" . ($projectstatic->id > 0 ? 'projectid=' . $projectstatic->id : ($object->id > 0 ? "id=" . $object->id : '')) . '&lineid=' . GETPOSTINT('lineid') . ($withproject ? '&withproject=1' : '') . "&contextpage=" . urlencode($contextpage);
1266
+			$urlafterconfirm = $_SERVER["PHP_SELF"]."?".($projectstatic->id > 0 ? 'projectid='.$projectstatic->id : ($object->id > 0 ? "id=".$object->id : '')).'&lineid='.GETPOSTINT('lineid').($withproject ? '&withproject=1' : '')."&contextpage=".urlencode($contextpage);
1267 1267
 			$formconfirm = $form->formconfirm($urlafterconfirm, $langs->trans("DeleteATimeSpent"), $langs->trans("ConfirmDeleteATimeSpent"), "confirm_deleteline", '', '', 1);
1268 1268
 		}
1269 1269
 
@@ -1282,10 +1282,10 @@  discard block
 block discarded – undo
1282 1282
 		// Definition of fields for list
1283 1283
 		$arrayfields = array();
1284 1284
 		$arrayfields['t.element_date'] = array('label' => $langs->trans("Date"), 'checked' => 1);
1285
-		$arrayfields['p.fk_soc'] = array('label' => $langs->trans("ThirdParty"), 'type' => 'integer:Societe:/societe/class/societe.class.php:1','checked' => 1);
1285
+		$arrayfields['p.fk_soc'] = array('label' => $langs->trans("ThirdParty"), 'type' => 'integer:Societe:/societe/class/societe.class.php:1', 'checked' => 1);
1286 1286
 		$arrayfields['s.name_alias'] = array('label' => $langs->trans("AliasNameShort"), 'type' => 'integer:Societe:/societe/class/societe.class.php:1');
1287 1287
 		if ((empty($id) && empty($ref)) || !empty($projectidforalltimes)) {	// Not a dedicated task
1288
-			if (! empty($allprojectforuser)) {
1288
+			if (!empty($allprojectforuser)) {
1289 1289
 				$arrayfields['p.project_ref'] = ['label' => $langs->trans('RefProject'), 'checked' => 1];
1290 1290
 				$arrayfields['p.project_label'] = ['label' => $langs->trans('ProjectLabel'), 'checked' => 1];
1291 1291
 			}
@@ -1301,83 +1301,83 @@  discard block
 block discarded – undo
1301 1301
 		$arrayfields['value'] = array('label' => $langs->trans("Value"), 'checked' => 1, 'enabled' => isModEnabled("salaries"));
1302 1302
 		$arrayfields['valuebilled'] = array('label' => $langs->trans("Billed"), 'checked' => 1, 'enabled' => (((getDolGlobalInt('PROJECT_HIDE_TASKS') || !getDolGlobalInt('PROJECT_BILL_TIME_SPENT')) ? 0 : 1) && $projectstatic->usage_bill_time));
1303 1303
 		// Extra fields
1304
-		include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_array_fields.tpl.php';
1304
+		include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
1305 1305
 
1306 1306
 		$arrayfields = dol_sort_array($arrayfields, 'position');
1307
-		'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields';  // dol_sort_array looses type for Phan
1307
+		'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan
1308 1308
 
1309 1309
 		$param = '';
1310 1310
 		if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
1311
-			$param .= '&contextpage=' . urlencode($contextpage);
1311
+			$param .= '&contextpage='.urlencode($contextpage);
1312 1312
 		}
1313 1313
 		if ($limit > 0 && $limit != $conf->liste_limit) {
1314 1314
 			$param .= '&limit='.((int) $limit);
1315 1315
 		}
1316 1316
 		if ($search_month > 0) {
1317
-			$param .= '&search_month=' . urlencode((string) ($search_month));
1317
+			$param .= '&search_month='.urlencode((string) ($search_month));
1318 1318
 		}
1319 1319
 		if ($search_year > 0) {
1320
-			$param .= '&search_year=' . urlencode((string) ($search_year));
1320
+			$param .= '&search_year='.urlencode((string) ($search_year));
1321 1321
 		}
1322 1322
 		if (!empty($search_user)) { 	// We keep param if -1 because default value is forced to user id if not set
1323 1323
 			$param .= '&search_user='.urlencode($search_user);
1324 1324
 		}
1325 1325
 		if ($search_task_ref != '') {
1326
-			$param .= '&search_task_ref=' . urlencode($search_task_ref);
1326
+			$param .= '&search_task_ref='.urlencode($search_task_ref);
1327 1327
 		}
1328 1328
 		if ($search_company != '') {
1329
-			$param .= '&amp;$search_company=' . urlencode($search_company);
1329
+			$param .= '&amp;$search_company='.urlencode($search_company);
1330 1330
 		}
1331 1331
 		if ($search_company_alias != '') {
1332
-			$param .= '&amp;$search_company_alias=' . urlencode($search_company_alias);
1332
+			$param .= '&amp;$search_company_alias='.urlencode($search_company_alias);
1333 1333
 		}
1334 1334
 		if ($search_project_ref != '') {
1335
-			$param .= '&amp;$search_project_ref=' . urlencode($search_project_ref);
1335
+			$param .= '&amp;$search_project_ref='.urlencode($search_project_ref);
1336 1336
 		}
1337 1337
 		if ($search_project_label != '') {
1338
-			$param .= '&amp;$search_project_label=' . urlencode($search_project_label);
1338
+			$param .= '&amp;$search_project_label='.urlencode($search_project_label);
1339 1339
 		}
1340 1340
 		if ($search_task_label != '') {
1341
-			$param .= '&search_task_label=' . urlencode($search_task_label);
1341
+			$param .= '&search_task_label='.urlencode($search_task_label);
1342 1342
 		}
1343 1343
 		if ($search_note != '') {
1344
-			$param .= '&search_note=' . urlencode($search_note);
1344
+			$param .= '&search_note='.urlencode($search_note);
1345 1345
 		}
1346 1346
 		if ($search_duration != '') {
1347
-			$param .= '&amp;search_field2=' . urlencode((string) ($search_duration));
1347
+			$param .= '&amp;search_field2='.urlencode((string) ($search_duration));
1348 1348
 		}
1349 1349
 		if ($optioncss != '') {
1350
-			$param .= '&optioncss=' . urlencode($optioncss);
1350
+			$param .= '&optioncss='.urlencode($optioncss);
1351 1351
 		}
1352 1352
 		if ($search_date_startday) {
1353
-			$param .= '&search_date_startday=' . urlencode((string) ($search_date_startday));
1353
+			$param .= '&search_date_startday='.urlencode((string) ($search_date_startday));
1354 1354
 		}
1355 1355
 		if ($search_date_startmonth) {
1356
-			$param .= '&search_date_startmonth=' . urlencode((string) ($search_date_startmonth));
1356
+			$param .= '&search_date_startmonth='.urlencode((string) ($search_date_startmonth));
1357 1357
 		}
1358 1358
 		if ($search_date_startyear) {
1359
-			$param .= '&search_date_startyear=' . urlencode((string) ($search_date_startyear));
1359
+			$param .= '&search_date_startyear='.urlencode((string) ($search_date_startyear));
1360 1360
 		}
1361 1361
 		if ($search_date_endday) {
1362
-			$param .= '&search_date_endday=' . urlencode((string) ($search_date_endday));
1362
+			$param .= '&search_date_endday='.urlencode((string) ($search_date_endday));
1363 1363
 		}
1364 1364
 		if ($search_date_endmonth) {
1365
-			$param .= '&search_date_endmonth=' . urlencode((string) ($search_date_endmonth));
1365
+			$param .= '&search_date_endmonth='.urlencode((string) ($search_date_endmonth));
1366 1366
 		}
1367 1367
 		if ($search_date_endyear) {
1368
-			$param .= '&search_date_endyear=' . urlencode((string) ($search_date_endyear));
1368
+			$param .= '&search_date_endyear='.urlencode((string) ($search_date_endyear));
1369 1369
 		}
1370 1370
 		if ($search_timespent_starthour) {
1371
-			$param .= '&search_timespent_duration_starthour=' . urlencode((string) ($search_timespent_starthour));
1371
+			$param .= '&search_timespent_duration_starthour='.urlencode((string) ($search_timespent_starthour));
1372 1372
 		}
1373 1373
 		if ($search_timespent_startmin) {
1374
-			$param .= '&search_timespent_duration_startmin=' . urlencode((string) ($search_timespent_startmin));
1374
+			$param .= '&search_timespent_duration_startmin='.urlencode((string) ($search_timespent_startmin));
1375 1375
 		}
1376 1376
 		if ($search_timespent_endhour) {
1377
-			$param .= '&search_timespent_duration_endhour=' . urlencode((string) ($search_timespent_endhour));
1377
+			$param .= '&search_timespent_duration_endhour='.urlencode((string) ($search_timespent_endhour));
1378 1378
 		}
1379 1379
 		if ($search_timespent_endmin) {
1380
-			$param .= '&search_timespent_duration_endmin=' . urlencode((string) ($search_timespent_endmin));
1380
+			$param .= '&search_timespent_duration_endmin='.urlencode((string) ($search_timespent_endmin));
1381 1381
 		}
1382 1382
 
1383 1383
 		/*
@@ -1385,24 +1385,24 @@  discard block
 block discarded – undo
1385 1385
 		 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
1386 1386
 		 */
1387 1387
 		if ($id) {
1388
-			$param .= '&id=' . urlencode((string) ($id));
1388
+			$param .= '&id='.urlencode((string) ($id));
1389 1389
 		}
1390 1390
 		if ($projectid) {
1391
-			$param .= '&projectid=' . urlencode((string) ($projectid));
1391
+			$param .= '&projectid='.urlencode((string) ($projectid));
1392 1392
 		}
1393 1393
 		if ($withproject) {
1394
-			$param .= '&withproject=' . urlencode((string) ($withproject));
1394
+			$param .= '&withproject='.urlencode((string) ($withproject));
1395 1395
 		}
1396 1396
 		// Add $param from hooks
1397 1397
 		$parameters = array('param' => &$param);
1398 1398
 		$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
1399 1399
 		$param .= $hookmanager->resPrint;
1400 1400
 
1401
-		print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">';
1401
+		print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
1402 1402
 		if ($optioncss != '') {
1403
-			print '<input type="hidden" name="optioncss" value="' . $optioncss . '">';
1403
+			print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
1404 1404
 		}
1405
-		print '<input type="hidden" name="token" value="' . newToken() . '">';
1405
+		print '<input type="hidden" name="token" value="'.newToken().'">';
1406 1406
 		print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
1407 1407
 		if ($action == 'editline') {
1408 1408
 			print '<input type="hidden" name="action" value="updateline">';
@@ -1417,13 +1417,13 @@  discard block
 block discarded – undo
1417 1417
 		} else {
1418 1418
 			print '<input type="hidden" name="action" value="list">';
1419 1419
 		}
1420
-		print '<input type="hidden" name="sortfield" value="' . $sortfield . '">';
1421
-		print '<input type="hidden" name="sortorder" value="' . $sortorder . '">';
1420
+		print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
1421
+		print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
1422 1422
 
1423
-		print '<input type="hidden" name="id" value="' . $id . '">';
1424
-		print '<input type="hidden" name="projectid" value="' . $projectidforalltimes . '">';
1425
-		print '<input type="hidden" name="withproject" value="' . $withproject . '">';
1426
-		print '<input type="hidden" name="tab" value="' . $tab . '">';
1423
+		print '<input type="hidden" name="id" value="'.$id.'">';
1424
+		print '<input type="hidden" name="projectid" value="'.$projectidforalltimes.'">';
1425
+		print '<input type="hidden" name="withproject" value="'.$withproject.'">';
1426
+		print '<input type="hidden" name="tab" value="'.$tab.'">';
1427 1427
 		print '<input type="hidden" name="page_y" value="">';
1428 1428
 
1429 1429
 		// Form to convert time spent into invoice
@@ -1450,7 +1450,7 @@  discard block
 block discarded – undo
1450 1450
 					'onelineperperiod' => 'OneLinePerTimeSpentLine',
1451 1451
 				);
1452 1452
 				print $form->selectarray('generateinvoicemode', $tmparray, 'onelineperuser', 0, 0, 0, '', 1);
1453
-				print "\n" . '<script type="text/javascript">';
1453
+				print "\n".'<script type="text/javascript">';
1454 1454
 				print '
1455 1455
 				$(document).ready(function () {
1456 1456
 					setDetailVisibility();
@@ -1467,8 +1467,8 @@  discard block
 block discarded – undo
1467 1467
             		}
1468 1468
             	});
1469 1469
             			';
1470
-				print '</script>' . "\n";
1471
-				print '<span style="display:none" id="detail_time_duration"><input type="checkbox" value="detail" name="detail_time_duration"/>' . $langs->trans('AddDetailDateAndDuration') . '</span>';
1470
+				print '</script>'."\n";
1471
+				print '<span style="display:none" id="detail_time_duration"><input type="checkbox" value="detail" name="detail_time_duration"/>'.$langs->trans('AddDetailDateAndDuration').'</span>';
1472 1472
 				print '</td>';
1473 1473
 				print '</tr>';
1474 1474
 
@@ -1518,14 +1518,14 @@  discard block
 block discarded – undo
1518 1518
 
1519 1519
 				print '<br>';
1520 1520
 				print '<div class="center">';
1521
-				print '<input type="submit" class="button" id="createbills" name="createbills" value="' . $langs->trans('GenerateBill') . '">  ';
1522
-				print '<input type="submit" class="button button-cancel" id="cancel" name="cancel" value="' . $langs->trans("Cancel") . '">';
1521
+				print '<input type="submit" class="button" id="createbills" name="createbills" value="'.$langs->trans('GenerateBill').'">  ';
1522
+				print '<input type="submit" class="button button-cancel" id="cancel" name="cancel" value="'.$langs->trans("Cancel").'">';
1523 1523
 				print '</div>';
1524 1524
 				print '<br>';
1525 1525
 			} else {
1526
-				print '<div class="warning">' . $langs->trans("ThirdPartyRequiredToGenerateInvoice") . '</div>';
1526
+				print '<div class="warning">'.$langs->trans("ThirdPartyRequiredToGenerateInvoice").'</div>';
1527 1527
 				print '<div class="center">';
1528
-				print '<input type="submit" class="button button-cancel" id="cancel" name="cancel" value="' . $langs->trans("Cancel") . '">';
1528
+				print '<input type="submit" class="button button-cancel" id="cancel" name="cancel" value="'.$langs->trans("Cancel").'">';
1529 1529
 				print '</div>';
1530 1530
 				$massaction = '';
1531 1531
 			}
@@ -1538,7 +1538,7 @@  discard block
 block discarded – undo
1538 1538
 				print '<table class="noborder centpercent">';
1539 1539
 				print '<tr>';
1540 1540
 				print '<td class="titlefield">';
1541
-				print img_picto('', 'intervention', 'class="pictofixedwidth"') . $langs->trans('InterToUse');
1541
+				print img_picto('', 'intervention', 'class="pictofixedwidth"').$langs->trans('InterToUse');
1542 1542
 				print '</td>';
1543 1543
 				print '<td>';
1544 1544
 				$forminter = new FormIntervention($db);
@@ -1548,14 +1548,14 @@  discard block
 block discarded – undo
1548 1548
 				print '</table>';
1549 1549
 
1550 1550
 				print '<div class="center">';
1551
-				print '<input type="submit" class="button" id="createinter" name="createinter" value="' . $langs->trans('GenerateInter') . '">  ';
1552
-				print '<input type="submit" class="button" id="cancel" name="cancel" value="' . $langs->trans('Cancel') . '">';
1551
+				print '<input type="submit" class="button" id="createinter" name="createinter" value="'.$langs->trans('GenerateInter').'">  ';
1552
+				print '<input type="submit" class="button" id="cancel" name="cancel" value="'.$langs->trans('Cancel').'">';
1553 1553
 				print '</div>';
1554 1554
 				print '<br>';
1555 1555
 			} else {
1556
-				print '<div class="warning">' . $langs->trans("ThirdPartyRequiredToGenerateIntervention") . '</div>';
1556
+				print '<div class="warning">'.$langs->trans("ThirdPartyRequiredToGenerateIntervention").'</div>';
1557 1557
 				print '<div class="center">';
1558
-				print '<input type="submit" class="button" id="cancel" name="cancel" value="' . $langs->trans('Cancel') . '">';
1558
+				print '<input type="submit" class="button" id="cancel" name="cancel" value="'.$langs->trans('Cancel').'">';
1559 1559
 				print '</div>';
1560 1560
 				$massaction = '';
1561 1561
 			}
@@ -1625,14 +1625,14 @@  discard block
 block discarded – undo
1625 1625
 			$sql .= " AND t.fk_element =".((int) $object->id);
1626 1626
 		} elseif (!empty($projectidforalltimes)) {
1627 1627
 			// Limit on one project
1628
-			$sql .= " AND pt.fk_projet IN (" . $db->sanitize($projectidforalltimes) . ")";
1628
+			$sql .= " AND pt.fk_projet IN (".$db->sanitize($projectidforalltimes).")";
1629 1629
 		} elseif (!empty($allprojectforuser)) {
1630 1630
 			// Limit on on user
1631 1631
 			if (empty($search_user)) {
1632 1632
 				$search_user = $user->id;
1633 1633
 			}
1634 1634
 			if ($search_user > 0) {
1635
-				$sql .= " AND t.fk_user = " . ((int) $search_user);
1635
+				$sql .= " AND t.fk_user = ".((int) $search_user);
1636 1636
 			}
1637 1637
 		}
1638 1638
 
@@ -1685,13 +1685,13 @@  discard block
 block discarded – undo
1685 1685
 			if ($search_timespent_starthour || $search_timespent_startmin) {
1686 1686
 				$timespent_duration_start = $search_timespent_starthour * 60 * 60; // We store duration in seconds
1687 1687
 				$timespent_duration_start += ($search_timespent_startmin ? $search_timespent_startmin : 0) * 60; // We store duration in seconds
1688
-				$sql .= " AND t.element_duration >= " . $timespent_duration_start;
1688
+				$sql .= " AND t.element_duration >= ".$timespent_duration_start;
1689 1689
 			}
1690 1690
 
1691 1691
 			if ($search_timespent_endhour || $search_timespent_endmin) {
1692 1692
 				$timespent_duration_end = $search_timespent_endhour * 60 * 60; // We store duration in seconds
1693 1693
 				$timespent_duration_end += ($search_timespent_endmin ? $search_timespent_endmin : 0) * 60; // We store duration in seconds
1694
-				$sql .= " AND t.element_duration <= " . $timespent_duration_end;
1694
+				$sql .= " AND t.element_duration <= ".$timespent_duration_end;
1695 1695
 			}
1696 1696
 		}
1697 1697
 
@@ -1739,13 +1739,13 @@  discard block
 block discarded – undo
1739 1739
 
1740 1740
 		if ($num >= 0) {
1741 1741
 			if (!empty($projectidforalltimes)) {
1742
-				print '<!-- List of time spent for project -->' . "\n";
1742
+				print '<!-- List of time spent for project -->'."\n";
1743 1743
 
1744 1744
 				$title = $langs->trans("ListTaskTimeUserProject");
1745 1745
 
1746 1746
 				print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'clock', 0, $linktocreatetime, '', $limit, 0, 0, 1);
1747 1747
 			} else {
1748
-				print '<!-- List of time spent -->' . "\n";
1748
+				print '<!-- List of time spent -->'."\n";
1749 1749
 
1750 1750
 				$title = $langs->trans("ListTaskTimeForTask");
1751 1751
 
@@ -1767,26 +1767,26 @@  discard block
 block discarded – undo
1767 1767
 		 * Form to add a new line of time spent
1768 1768
 		 */
1769 1769
 		if ($action == 'createtime' && $user->hasRight('projet', 'time')) {
1770
-			print '<!-- table to add time spent -->' . "\n";
1770
+			print '<!-- table to add time spent -->'."\n";
1771 1771
 			if (!empty($id)) {
1772
-				print '<input type="hidden" name="taskid" value="' . $id . '">';
1772
+				print '<input type="hidden" name="taskid" value="'.$id.'">';
1773 1773
 			}
1774 1774
 
1775 1775
 			print '<div class="div-table-responsive-no-min">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
1776 1776
 			print '<table class="noborder nohover centpercent">';
1777 1777
 
1778 1778
 			print '<tr class="liste_titre">';
1779
-			print '<td>' . $langs->trans("Date") . '</td>';
1779
+			print '<td>'.$langs->trans("Date").'</td>';
1780 1780
 			if (!empty($allprojectforuser)) {
1781
-				print '<td>' . $langs->trans("Project") . '</td>';
1781
+				print '<td>'.$langs->trans("Project").'</td>';
1782 1782
 			}
1783 1783
 			if (empty($id)) {
1784
-				print '<td>' . $langs->trans("Task") . '</td>';
1784
+				print '<td>'.$langs->trans("Task").'</td>';
1785 1785
 			}
1786
-			print '<td>' . $langs->trans("By") . '</td>';
1787
-			print '<td>' . $langs->trans("Note") . '</td>';
1788
-			print '<td>' . $langs->trans("NewTimeSpent") . '</td>';
1789
-			print '<td>' . $langs->trans("ProgressDeclared") . '</td>';
1786
+			print '<td>'.$langs->trans("By").'</td>';
1787
+			print '<td>'.$langs->trans("Note").'</td>';
1788
+			print '<td>'.$langs->trans("NewTimeSpent").'</td>';
1789
+			print '<td>'.$langs->trans("ProgressDeclared").'</td>';
1790 1790
 			if (!getDolGlobalString('PROJECT_HIDE_TASKS') && getDolGlobalString('PROJECT_BILL_TIME_SPENT')) {
1791 1791
 				print '<td></td>';
1792 1792
 
@@ -1840,14 +1840,14 @@  discard block
 block discarded – undo
1840 1840
 				print $form->select_dolusers((GETPOSTINT('userid') ? GETPOSTINT('userid') : $userid), 'userid', 0, '', 0, '', $contactsofproject, 0, 0, 0, '', 0, $langs->trans("ResourceNotAssignedToProject"), 'minwidth150imp maxwidth200');
1841 1841
 			} else {
1842 1842
 				if ($nboftasks) {
1843
-					print img_error($langs->trans('FirstAddRessourceToAllocateTime')) . ' ' . $langs->trans('FirstAddRessourceToAllocateTime');
1843
+					print img_error($langs->trans('FirstAddRessourceToAllocateTime')).' '.$langs->trans('FirstAddRessourceToAllocateTime');
1844 1844
 				}
1845 1845
 			}
1846 1846
 			print '</td>';
1847 1847
 
1848 1848
 			// Note
1849 1849
 			print '<td>';
1850
-			print '<textarea name="timespent_note" class="maxwidth100onsmartphone" rows="' . ROWS_2 . '">' . (GETPOST('timespent_note') ? GETPOST('timespent_note') : '') . '</textarea>';
1850
+			print '<textarea name="timespent_note" class="maxwidth100onsmartphone" rows="'.ROWS_2.'">'.(GETPOST('timespent_note') ? GETPOST('timespent_note') : '').'</textarea>';
1851 1851
 			print '</td>';
1852 1852
 
1853 1853
 			// Duration - Time spent
@@ -1915,7 +1915,7 @@  discard block
 block discarded – undo
1915 1915
 		$selectedfields .= (is_array($arrayofmassactions) && count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
1916 1916
 
1917 1917
 		print '<div class="div-table-responsive">';
1918
-		print '<table class="tagtable nobottomiftotal liste' . ($moreforfilter ? " listwithfilterbefore" : "") . '">' . "\n";
1918
+		print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
1919 1919
 
1920 1920
 		// Fields title search
1921 1921
 		// --------------------------------------------------------------------
@@ -1940,20 +1940,20 @@  discard block
 block discarded – undo
1940 1940
 		}
1941 1941
 		// Thirdparty
1942 1942
 		if (!empty($arrayfields['p.fk_soc']['checked'])) {
1943
-			print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_company" value="' . dol_escape_htmltag($search_company) . '"></td>';
1943
+			print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_company" value="'.dol_escape_htmltag($search_company).'"></td>';
1944 1944
 		}
1945 1945
 
1946 1946
 		// Thirdparty alias
1947 1947
 		if (!empty($arrayfields['s.name_alias']['checked'])) {
1948
-			print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_company_alias" value="' . dol_escape_htmltag($search_company_alias) . '"></td>';
1948
+			print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_company_alias" value="'.dol_escape_htmltag($search_company_alias).'"></td>';
1949 1949
 		}
1950 1950
 
1951 1951
 		if (!empty($allprojectforuser)) {
1952 1952
 			if (!empty($arrayfields['p.project_ref']['checked'])) {
1953
-				print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_project_ref" value="' . dol_escape_htmltag($search_project_ref) . '"></td>';
1953
+				print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_project_ref" value="'.dol_escape_htmltag($search_project_ref).'"></td>';
1954 1954
 			}
1955 1955
 			if (!empty($arrayfields['p.project_label']['checked'])) {
1956
-				print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_project_label" value="' . dol_escape_htmltag($search_project_label) . '"></td>';
1956
+				print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_project_label" value="'.dol_escape_htmltag($search_project_label).'"></td>';
1957 1957
 			}
1958 1958
 		}
1959 1959
 		// Task
@@ -1971,7 +1971,7 @@  discard block
 block discarded – undo
1971 1971
 		}
1972 1972
 		// Note
1973 1973
 		if (!empty($arrayfields['t.note']['checked'])) {
1974
-			print '<td class="liste_titre"><input type="text" class="flat maxwidth75" name="search_note" value="' . dol_escape_htmltag($search_note) . '"></td>';
1974
+			print '<td class="liste_titre"><input type="text" class="flat maxwidth75" name="search_note" value="'.dol_escape_htmltag($search_note).'"></td>';
1975 1975
 		}
1976 1976
 		// Duration
1977 1977
 		if (!empty($arrayfields['t.element_duration']['checked'])) {
@@ -1982,7 +1982,7 @@  discard block
 block discarded – undo
1982 1982
 			if ($search_timespent_starthour || $search_timespent_startmin) {
1983 1983
 				$durationtouse_start = ($search_timespent_starthour * 3600 + $search_timespent_startmin * 60);
1984 1984
 			}
1985
-			print '<div class="nowraponall">' . $langs->trans('from') . ' ';
1985
+			print '<div class="nowraponall">'.$langs->trans('from').' ';
1986 1986
 			print $form->select_duration('search_timespent_duration_start', $durationtouse_start, 0, 'text', 0, 1);
1987 1987
 			print '</div>';
1988 1988
 
@@ -1990,7 +1990,7 @@  discard block
 block discarded – undo
1990 1990
 			if ($search_timespent_endhour || $search_timespent_endmin) {
1991 1991
 				$durationtouse_end = ($search_timespent_endhour * 3600 + $search_timespent_endmin * 60);
1992 1992
 			}
1993
-			print '<div class="nowraponall">' . $langs->trans('to') . ' ';
1993
+			print '<div class="nowraponall">'.$langs->trans('to').' ';
1994 1994
 			print $form->select_duration('search_timespent_duration_end', $durationtouse_end, 0, 'text', 0, 1);
1995 1995
 			print '</div>';
1996 1996
 
@@ -2006,7 +2006,7 @@  discard block
 block discarded – undo
2006 2006
 		}
2007 2007
 		// Value billed
2008 2008
 		if (!empty($arrayfields['valuebilled']['checked'])) {
2009
-			print '<td class="liste_titre center">' . $form->selectyesno('search_valuebilled', $search_valuebilled, 1, false, 1) . '</td>';
2009
+			print '<td class="liste_titre center">'.$form->selectyesno('search_valuebilled', $search_valuebilled, 1, false, 1).'</td>';
2010 2010
 		}
2011 2011
 
2012 2012
 		/*
@@ -2024,7 +2024,7 @@  discard block
 block discarded – undo
2024 2024
 			print $searchpicto;
2025 2025
 			print '</td>';
2026 2026
 		}
2027
-		print '</tr>' . "\n";
2027
+		print '</tr>'."\n";
2028 2028
 
2029 2029
 
2030 2030
 		$totalarray = array();
@@ -2142,7 +2142,7 @@  discard block
 block discarded – undo
2142 2142
 			if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
2143 2143
 				print '<td class="center nowraponall">';
2144 2144
 				if (($action == 'editline' || $action == 'splitline') && GETPOSTINT('lineid') == $task_time->rowid) {
2145
-					print '<input type="hidden" name="lineid" value="' . GETPOSTINT('lineid') . '">';
2145
+					print '<input type="hidden" name="lineid" value="'.GETPOSTINT('lineid').'">';
2146 2146
 					print '<input type="submit" class="button buttongen smallpaddingimp margintoponlyshort marginbottomonlyshort button-save" name="save" value="'.$langs->trans("Save").'">';
2147 2147
 					print '<br>';
2148 2148
 					print '<input type="submit" class="button buttongen smallpaddingimp margintoponlyshort marginbottomonlyshort button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">';
@@ -2153,7 +2153,7 @@  discard block
 block discarded – undo
2153 2153
 						print '</a>';
2154 2154
 
2155 2155
 						if (getDolGlobalString('PROJECT_ALLOW_SPLIT_TIMESPENT')) {
2156
-							print '<a class="reposition editfielda paddingleft" href="' . $_SERVER["PHP_SELF"] . '?action=splitline&token=' . newToken() . '&lineid=' . $task_time->rowid . $param . ((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '') . '">';
2156
+							print '<a class="reposition editfielda paddingleft" href="'.$_SERVER["PHP_SELF"].'?action=splitline&token='.newToken().'&lineid='.$task_time->rowid.$param.((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '').'">';
2157 2157
 							print img_split('', 'class="pictofixedwidth paddingleft"');
2158 2158
 							print '</a>';
2159 2159
 						}
@@ -2171,12 +2171,12 @@  discard block
 block discarded – undo
2171 2171
 
2172 2172
 							// Disable select if task not billable or already invoiced
2173 2173
 							$disabled = (intval($task_time->billable) != 1 || $invoiced);
2174
-							$ctrl = '<input '.($disabled ? 'disabled' : '').' id="cb' . $task_time->rowid . '" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="' . $task_time->rowid . '"' . ($selected ? ' checked="checked"' : '') . '>';
2174
+							$ctrl = '<input '.($disabled ? 'disabled' : '').' id="cb'.$task_time->rowid.'" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="'.$task_time->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
2175 2175
 							if ($disabled) {
2176 2176
 								// If disabled, a dbl-click very close outside the control
2177 2177
 								// will re-enable it, so that user is not blocked if needed.
2178
-								print '<span id="cbsp'. $task_time->rowid . '">'.$ctrl.'</span>';
2179
-								print '<script>$("#cbsp' . $task_time->rowid . '").dblclick(()=>{ $("#cb' . $task_time->rowid . '").removeAttr("disabled") })</script>';
2178
+								print '<span id="cbsp'.$task_time->rowid.'">'.$ctrl.'</span>';
2179
+								print '<script>$("#cbsp'.$task_time->rowid.'").dblclick(()=>{ $("#cb'.$task_time->rowid.'").removeAttr("disabled") })</script>';
2180 2180
 							} else {
2181 2181
 								print $ctrl;
2182 2182
 							}
@@ -2298,7 +2298,7 @@  discard block
 block discarded – undo
2298 2298
 					}
2299 2299
 				}
2300 2300
 			} elseif ($action !== 'createtime') {
2301
-				print '<input type="hidden" name="taskid" value="' . $id . '">';
2301
+				print '<input type="hidden" name="taskid" value="'.$id.'">';
2302 2302
 			}
2303 2303
 
2304 2304
 			// Task label
@@ -2327,9 +2327,9 @@  discard block
 block discarded – undo
2327 2327
 					}
2328 2328
 					if (count($contactsoftask) > 0) {
2329 2329
 						print img_object('', 'user', 'class="pictofixedwidth hideonsmartphone"');
2330
-						print $form->select_dolusers($task_time->fk_user, 'userid_line', 0, null, 0, '', $contactsoftask, '0', 0, 0, '', 0, '', 'minwidth100 maxwidth100');	// maxwidth must be lowed than minwidth of the td
2330
+						print $form->select_dolusers($task_time->fk_user, 'userid_line', 0, null, 0, '', $contactsoftask, '0', 0, 0, '', 0, '', 'minwidth100 maxwidth100'); // maxwidth must be lowed than minwidth of the td
2331 2331
 					} else {
2332
-						print img_error($langs->trans('FirstAddRessourceToAllocateTime')) . $langs->trans('FirstAddRessourceToAllocateTime');
2332
+						print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime');
2333 2333
 					}
2334 2334
 				} else {
2335 2335
 					$userstatic->id = $task_time->fk_user;
@@ -2351,7 +2351,7 @@  discard block
 block discarded – undo
2351 2351
 			if (!empty($arrayfields['t.note']['checked'])) {
2352 2352
 				if ($action == 'editline' && GETPOSTINT('lineid') == $task_time->rowid) {
2353 2353
 					print '<td class="small">';
2354
-					print '<textarea name="timespent_note_line" width="95%" rows="' . ROWS_2 . '">' . dol_escape_htmltag($task_time->note, 0, 1) . '</textarea>';
2354
+					print '<textarea name="timespent_note_line" width="95%" rows="'.ROWS_2.'">'.dol_escape_htmltag($task_time->note, 0, 1).'</textarea>';
2355 2355
 					print '</td>';
2356 2356
 				} else {
2357 2357
 					print '<td class="small tdoverflowmax150 classfortooltip" title="'.dol_string_onlythesehtmltags(dol_htmlentitiesbr($task_time->note)).'">';
@@ -2362,7 +2362,7 @@  discard block
 block discarded – undo
2362 2362
 					$totalarray['nbfield']++;
2363 2363
 				}
2364 2364
 			} elseif ($action == 'editline' && GETPOSTINT('lineid') == $task_time->rowid) {
2365
-				print '<input type="hidden" name="timespent_note_line" value="' . dol_escape_htmltag($task_time->note, 0, 1) . '">';
2365
+				print '<input type="hidden" name="timespent_note_line" value="'.dol_escape_htmltag($task_time->note, 0, 1).'">';
2366 2366
 			}
2367 2367
 
2368 2368
 			// Time spent
@@ -2423,7 +2423,7 @@  discard block
 block discarded – undo
2423 2423
 				$value = price2num($task_time->thm * $task_time->element_duration / 3600, 'MT', 1);
2424 2424
 
2425 2425
 				print '<td class="nowraponall right">';
2426
-				print '<span class="amount" title="' . $langs->trans("THM") . ': ' . price($task_time->thm) . '">';
2426
+				print '<span class="amount" title="'.$langs->trans("THM").': '.price($task_time->thm).'">';
2427 2427
 				print price($value, 1, $langs, 1, -1, -1, $conf->currency);
2428 2428
 				print '</span>';
2429 2429
 				print '</td>';
@@ -2479,7 +2479,7 @@  discard block
 block discarded – undo
2479 2479
 							}
2480 2480
 						}
2481 2481
 					} else {
2482
-						print '<span class="opacitymedium">' . $langs->trans("NA") . '</span>';
2482
+						print '<span class="opacitymedium">'.$langs->trans("NA").'</span>';
2483 2483
 					}
2484 2484
 				}
2485 2485
 				print '</td>';
@@ -2513,7 +2513,7 @@  discard block
 block discarded – undo
2513 2513
 						print '</a>';
2514 2514
 
2515 2515
 						if (getDolGlobalString('PROJECT_ALLOW_SPLIT_TIMESPENT')) {
2516
-							print '<a class="reposition editfielda paddingleft" href="' . $_SERVER["PHP_SELF"] . '?action=splitline&token=' . newToken() . '&lineid=' . $task_time->rowid . $param . ((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '') . '">';
2516
+							print '<a class="reposition editfielda paddingleft" href="'.$_SERVER["PHP_SELF"].'?action=splitline&token='.newToken().'&lineid='.$task_time->rowid.$param.((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '').'">';
2517 2517
 							print img_split('', 'class="pictofixedwidth paddingleft"');
2518 2518
 							print '</a>';
2519 2519
 						}
@@ -2531,12 +2531,12 @@  discard block
 block discarded – undo
2531 2531
 
2532 2532
 							// Disable select if task not billable or already invoiced
2533 2533
 							$disabled = (intval($task_time->billable) != 1 || $invoiced);
2534
-							$ctrl = '<input '.($disabled ? 'disabled' : '').' id="cb' . $task_time->rowid . '" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="' . $task_time->rowid . '"' . ($selected ? ' checked="checked"' : '') . '>';
2534
+							$ctrl = '<input '.($disabled ? 'disabled' : '').' id="cb'.$task_time->rowid.'" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="'.$task_time->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
2535 2535
 							if ($disabled) {
2536 2536
 								// If disabled, a dbl-click very close outside the control
2537 2537
 								// will re-enable it, so that user is not blocked if needed.
2538
-								print '<span id="cbsp'. $task_time->rowid . '">'.$ctrl.'</span>';
2539
-								print '<script>$("#cbsp' . $task_time->rowid . '").dblclick(()=>{ $("#cb' . $task_time->rowid . '").removeAttr("disabled") })</script>';
2538
+								print '<span id="cbsp'.$task_time->rowid.'">'.$ctrl.'</span>';
2539
+								print '<script>$("#cbsp'.$task_time->rowid.'").dblclick(()=>{ $("#cb'.$task_time->rowid.'").removeAttr("disabled") })</script>';
2540 2540
 							} else {
2541 2541
 								print $ctrl;
2542 2542
 							}
@@ -2635,7 +2635,7 @@  discard block
 block discarded – undo
2635 2635
 							print img_object('', 'user', 'class="hideonsmartphone"');
2636 2636
 							print $form->select_dolusers($task_time->fk_user, 'userid_line', 0, '', 0, '', $contactsoftask);
2637 2637
 						} else {
2638
-							print img_error($langs->trans('FirstAddRessourceToAllocateTime')) . $langs->trans('FirstAddRessourceToAllocateTime');
2638
+							print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime');
2639 2639
 						}
2640 2640
 					} else {
2641 2641
 						$userstatic->id = $task_time->fk_user;
@@ -2652,13 +2652,13 @@  discard block
 block discarded – undo
2652 2652
 				if (!empty($arrayfields['t.note']['checked'])) {
2653 2653
 					print '<td class="tdoverflowmax300">';
2654 2654
 					if ($action == 'splitline' && GETPOSTINT('lineid') == $task_time->rowid) {
2655
-						print '<textarea name="timespent_note_line" width="95%" rows="' . ROWS_2 . '">' . dol_escape_htmltag($task_time->note, 0, 1) . '</textarea>';
2655
+						print '<textarea name="timespent_note_line" width="95%" rows="'.ROWS_2.'">'.dol_escape_htmltag($task_time->note, 0, 1).'</textarea>';
2656 2656
 					} else {
2657 2657
 						print dol_nl2br($task_time->note);
2658 2658
 					}
2659 2659
 					print '</td>';
2660 2660
 				} elseif ($action == 'splitline' && GETPOSTINT('lineid') == $task_time->rowid) {
2661
-					print '<input type="hidden" name="timespent_note_line" rows="' . ROWS_2 . '" value="' . dol_escape_htmltag($task_time->note, 0, 1) . '">';
2661
+					print '<input type="hidden" name="timespent_note_line" rows="'.ROWS_2.'" value="'.dol_escape_htmltag($task_time->note, 0, 1).'">';
2662 2662
 				}
2663 2663
 
2664 2664
 				// Time spent
@@ -2800,7 +2800,7 @@  discard block
 block discarded – undo
2800 2800
 							print img_object('', 'user', 'class="hideonsmartphone"');
2801 2801
 							print $form->select_dolusers($task_time->fk_user, 'userid_line_2', 0, '', 0, '', $contactsoftask);
2802 2802
 						} else {
2803
-							print img_error($langs->trans('FirstAddRessourceToAllocateTime')) . $langs->trans('FirstAddRessourceToAllocateTime');
2803
+							print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime');
2804 2804
 						}
2805 2805
 					} else {
2806 2806
 						$userstatic->id = $task_time->fk_user;
@@ -2817,13 +2817,13 @@  discard block
 block discarded – undo
2817 2817
 				if (!empty($arrayfields['t.note']['checked'])) {
2818 2818
 					print '<td class="small tdoverflowmax300"">';
2819 2819
 					if ($action == 'splitline' && GETPOSTINT('lineid') == $task_time->rowid) {
2820
-						print '<textarea name="timespent_note_line_2" width="95%" rows="' . ROWS_2 . '">' . dol_escape_htmltag($task_time->note, 0, 1) . '</textarea>';
2820
+						print '<textarea name="timespent_note_line_2" width="95%" rows="'.ROWS_2.'">'.dol_escape_htmltag($task_time->note, 0, 1).'</textarea>';
2821 2821
 					} else {
2822 2822
 						print dol_nl2br($task_time->note);
2823 2823
 					}
2824 2824
 					print '</td>';
2825 2825
 				} elseif ($action == 'splitline' && GETPOSTINT('lineid') == $task_time->rowid) {
2826
-					print '<input type="hidden" name="timespent_note_line_2" value="' . dol_escape_htmltag($task_time->note, 0, 1) . '">';
2826
+					print '<input type="hidden" name="timespent_note_line_2" value="'.dol_escape_htmltag($task_time->note, 0, 1).'">';
2827 2827
 				}
2828 2828
 
2829 2829
 				// Time spent
@@ -2897,14 +2897,14 @@  discard block
 block discarded – undo
2897 2897
 				$i++;
2898 2898
 				if ($i == 1) {
2899 2899
 					if ($num < $limit && empty($offset)) {
2900
-						print '<td class="left">' . $langs->trans("Total") . '</td>';
2900
+						print '<td class="left">'.$langs->trans("Total").'</td>';
2901 2901
 					} else {
2902 2902
 						print '<td class="left">'.$form->textwithpicto($langs->trans("Total"), $langs->trans("Totalforthispage")).'</td>';
2903 2903
 					}
2904 2904
 				} elseif (isset($totalarray['totaldurationfield']) && $totalarray['totaldurationfield'] == $i) {
2905
-					print '<td class="right">' . convertSecondToTime($totalarray['totalduration'], 'allhourmin') . '</td>';
2905
+					print '<td class="right">'.convertSecondToTime($totalarray['totalduration'], 'allhourmin').'</td>';
2906 2906
 				} elseif (isset($totalarray['totalvaluefield']) && $totalarray['totalvaluefield'] == $i) {
2907
-					print '<td class="right">' . price($totalarray['totalvalue']) . '</td>';
2907
+					print '<td class="right">'.price($totalarray['totalvalue']).'</td>';
2908 2908
 					//} elseif ($totalarray['totalvaluebilledfield'] == $i) { print '<td class="center">'.price($totalarray['totalvaluebilled']).'</td>';
2909 2909
 				} else {
2910 2910
 					print '<td></td>';
@@ -2920,8 +2920,8 @@  discard block
 block discarded – undo
2920 2920
 					$totalnboffields++;
2921 2921
 				}
2922 2922
 			}
2923
-			print '<tr class="oddeven"><td colspan="' . $totalnboffields . '">';
2924
-			print '<span class="opacitymedium">' . $langs->trans("None") . '</span>';
2923
+			print '<tr class="oddeven"><td colspan="'.$totalnboffields.'">';
2924
+			print '<span class="opacitymedium">'.$langs->trans("None").'</span>';
2925 2925
 			print '</td></tr>';
2926 2926
 		}
2927 2927
 
Please login to merge, or discard this patch.
htdocs/projet/tasks/contact.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -155,9 +155,9 @@  discard block
 block discarded – undo
155 155
 $userstatic = new User($db);
156 156
 $result = $projectstatic->fetch($object->fk_project);
157 157
 
158
-$title = $object->ref . ' - ' . $langs->trans("Contacts");
158
+$title = $object->ref.' - '.$langs->trans("Contacts");
159 159
 if (!empty($withproject)) {
160
-	$title .= ' | ' . $langs->trans("Project") . (!empty($projectstatic->ref) ? ': '.$projectstatic->ref : '')  ;
160
+	$title .= ' | '.$langs->trans("Project").(!empty($projectstatic->ref) ? ': '.$projectstatic->ref : '');
161 161
 }
162 162
 $help_url = '';
163 163
 
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
 			$cols = 2;
290 290
 			$savobject = $object;
291 291
 			$object = $projectstatic;
292
-			include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
292
+			include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
293 293
 			$object = $savobject;
294 294
 
295 295
 			print '</table>';
Please login to merge, or discard this patch.
htdocs/projet/tasks/document.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -131,9 +131,9 @@  discard block
 block discarded – undo
131 131
  */
132 132
 $form = new Form($db);
133 133
 
134
-$title = $object->ref . ' - ' . $langs->trans("Documents");
134
+$title = $object->ref.' - '.$langs->trans("Documents");
135 135
 if (!empty($withproject)) {
136
-	$title .= ' | ' . $langs->trans("Project") . (!empty($projectstatic->ref) ? ': '.$projectstatic->ref : '')  ;
136
+	$title .= ' | '.$langs->trans("Project").(!empty($projectstatic->ref) ? ': '.$projectstatic->ref : '');
137 137
 }
138 138
 $help_url = '';
139 139
 
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
 		$cols = 2;
247 247
 		$savobject = $object;
248 248
 		$object = $projectstatic;
249
-		include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
249
+		include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
250 250
 		$object = $savobject;
251 251
 
252 252
 		print '</table>';
Please login to merge, or discard this patch.
htdocs/projet/tasks/task.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
 
160 160
 if ($action == 'confirm_merge' && $confirm == 'yes' && $user->hasRight('projet', 'creer')) {
161 161
 	$task_origin_id = GETPOSTINT('task_origin');
162
-	$task_origin = new Task($db);		// The Task that we will delete
162
+	$task_origin = new Task($db); // The Task that we will delete
163 163
 
164 164
 	if ($task_origin_id <= 0) {
165 165
 		$langs->load('errors');
@@ -299,7 +299,7 @@  discard block
 block discarded – undo
299 299
 
300 300
 $title = $object->ref;
301 301
 if (!empty($withproject)) {
302
-	$title .= ' | ' . $langs->trans("Project") . (!empty($projectstatic->ref) ? ': '.$projectstatic->ref : '')  ;
302
+	$title .= ' | '.$langs->trans("Project").(!empty($projectstatic->ref) ? ': '.$projectstatic->ref : '');
303 303
 }
304 304
 $help_url = '';
305 305
 
@@ -425,7 +425,7 @@  discard block
 block discarded – undo
425 425
 		$cols = 2;
426 426
 		$savobject = $object;
427 427
 		$object = $projectstatic;
428
-		include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
428
+		include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
429 429
 		$object = $savobject;
430 430
 
431 431
 		print '</table>';
Please login to merge, or discard this patch.