Completed
Branch develop (ab5575)
by
unknown
18:12
created
htdocs/includes/restler/framework/Luracast/Restler/RestException.php 1 patch
Indentation   +110 added lines, -110 removed lines patch added patch discarded remove patch
@@ -19,120 +19,120 @@
 block discarded – undo
19 19
 
20 20
 class RestException extends Exception
21 21
 {
22
-    /**
23
-     * HTTP status codes
24
-     *
25
-     * @var array
26
-     */
27
-    public static $codes = array(
28
-        100 => 'Continue',
29
-        101 => 'Switching Protocols',
30
-        200 => 'OK',
31
-        201 => 'Created',
32
-        202 => 'Accepted',
33
-        203 => 'Non-Authoritative Information',
34
-        204 => 'No Content',
35
-        205 => 'Reset Content',
36
-        206 => 'Partial Content',
37
-        300 => 'Multiple Choices',
38
-        301 => 'Moved Permanently',
39
-        302 => 'Found',
40
-        303 => 'See Other',
41
-        304 => 'Not Modified',
42
-        305 => 'Use Proxy',
43
-        306 => '(Unused)',
44
-        307 => 'Temporary Redirect',
45
-        400 => 'Bad Request',
46
-        401 => 'Unauthorized',
47
-        402 => 'Payment Required',
48
-        403 => 'Forbidden',
49
-        404 => 'Not Found',
50
-        405 => 'Method Not Allowed',
51
-        406 => 'Not Acceptable',
52
-        407 => 'Proxy Authentication Required',
53
-        408 => 'Request Timeout',
54
-        409 => 'Conflict',
55
-        410 => 'Gone',
56
-        411 => 'Length Required',
57
-        412 => 'Precondition Failed',
58
-        413 => 'Request Entity Too Large',
59
-        414 => 'Request-URI Too Long',
60
-        415 => 'Unsupported Media Type',
61
-        416 => 'Requested Range Not Satisfiable',
62
-        417 => 'Expectation Failed',
63
-        429 => 'Too Many Requests', //still in draft but used for rate limiting
64
-        500 => 'Internal Server Error',
65
-        501 => 'Not Implemented',
66
-        502 => 'Bad Gateway',
67
-        503 => 'Service Unavailable',
68
-        504 => 'Gateway Timeout',
69
-        505 => 'HTTP Version Not Supported'
70
-    );
71
-    private $details;
72
-    private $stage;
22
+	/**
23
+	 * HTTP status codes
24
+	 *
25
+	 * @var array
26
+	 */
27
+	public static $codes = array(
28
+		100 => 'Continue',
29
+		101 => 'Switching Protocols',
30
+		200 => 'OK',
31
+		201 => 'Created',
32
+		202 => 'Accepted',
33
+		203 => 'Non-Authoritative Information',
34
+		204 => 'No Content',
35
+		205 => 'Reset Content',
36
+		206 => 'Partial Content',
37
+		300 => 'Multiple Choices',
38
+		301 => 'Moved Permanently',
39
+		302 => 'Found',
40
+		303 => 'See Other',
41
+		304 => 'Not Modified',
42
+		305 => 'Use Proxy',
43
+		306 => '(Unused)',
44
+		307 => 'Temporary Redirect',
45
+		400 => 'Bad Request',
46
+		401 => 'Unauthorized',
47
+		402 => 'Payment Required',
48
+		403 => 'Forbidden',
49
+		404 => 'Not Found',
50
+		405 => 'Method Not Allowed',
51
+		406 => 'Not Acceptable',
52
+		407 => 'Proxy Authentication Required',
53
+		408 => 'Request Timeout',
54
+		409 => 'Conflict',
55
+		410 => 'Gone',
56
+		411 => 'Length Required',
57
+		412 => 'Precondition Failed',
58
+		413 => 'Request Entity Too Large',
59
+		414 => 'Request-URI Too Long',
60
+		415 => 'Unsupported Media Type',
61
+		416 => 'Requested Range Not Satisfiable',
62
+		417 => 'Expectation Failed',
63
+		429 => 'Too Many Requests', //still in draft but used for rate limiting
64
+		500 => 'Internal Server Error',
65
+		501 => 'Not Implemented',
66
+		502 => 'Bad Gateway',
67
+		503 => 'Service Unavailable',
68
+		504 => 'Gateway Timeout',
69
+		505 => 'HTTP Version Not Supported'
70
+	);
71
+	private $details;
72
+	private $stage;
73 73
 
74
-    /**
75
-     * @param int         $httpStatusCode http status code
76
-     * @param string|null $errorMessage   error message
77
-     * @param array       $details        any extra detail about the exception
78
-     * @param Exception   $previous       previous exception if any
79
-     */
80
-    public function __construct($httpStatusCode, $errorMessage = null, array $details = array(), Exception $previous = null)
81
-    {
82
-        $events = Scope::get('Restler')->getEvents();
83
-        if(count($events)<= 1){
84
-            $this->stage = 'setup';
85
-        } else {
86
-            $this->stage = $previous ? $events[count($events)-2] : end($events);
87
-        }
88
-        $this->details = $details;
89
-        parent::__construct($errorMessage, $httpStatusCode, $previous);
90
-    }
74
+	/**
75
+	 * @param int         $httpStatusCode http status code
76
+	 * @param string|null $errorMessage   error message
77
+	 * @param array       $details        any extra detail about the exception
78
+	 * @param Exception   $previous       previous exception if any
79
+	 */
80
+	public function __construct($httpStatusCode, $errorMessage = null, array $details = array(), Exception $previous = null)
81
+	{
82
+		$events = Scope::get('Restler')->getEvents();
83
+		if(count($events)<= 1){
84
+			$this->stage = 'setup';
85
+		} else {
86
+			$this->stage = $previous ? $events[count($events)-2] : end($events);
87
+		}
88
+		$this->details = $details;
89
+		parent::__construct($errorMessage, $httpStatusCode, $previous);
90
+	}
91 91
 
92
-    /**
93
-     * Get extra details about the exception
94
-     *
95
-     * @return array details array
96
-     */
97
-    public function getDetails()
98
-    {
99
-        return $this->details;
100
-    }
92
+	/**
93
+	 * Get extra details about the exception
94
+	 *
95
+	 * @return array details array
96
+	 */
97
+	public function getDetails()
98
+	{
99
+		return $this->details;
100
+	}
101 101
 
102
-    public function getStage()
103
-    {
104
-        return $this->stage;
105
-    }
102
+	public function getStage()
103
+	{
104
+		return $this->stage;
105
+	}
106 106
 
107
-    public function getStages()
108
-    {
109
-        $e = Scope::get('Restler')->getEvents();
110
-        $i = array_search($this->stage, $e);
111
-        return array(
112
-            'success' => array_slice($e, 0, $i),
113
-            'failure' => array_slice($e, $i),
114
-        );
115
-    }
107
+	public function getStages()
108
+	{
109
+		$e = Scope::get('Restler')->getEvents();
110
+		$i = array_search($this->stage, $e);
111
+		return array(
112
+			'success' => array_slice($e, 0, $i),
113
+			'failure' => array_slice($e, $i),
114
+		);
115
+	}
116 116
 
117
-    public function getErrorMessage()
118
-    {
119
-        $statusCode = $this->getCode();
120
-        $message = $this->getMessage();
121
-        if (isset(RestException::$codes[$statusCode])) {
122
-            $message = RestException::$codes[$statusCode] .
123
-                (empty($message) ? '' : ': ' . $message);
124
-        }
125
-        return $message;
126
-    }
117
+	public function getErrorMessage()
118
+	{
119
+		$statusCode = $this->getCode();
120
+		$message = $this->getMessage();
121
+		if (isset(RestException::$codes[$statusCode])) {
122
+			$message = RestException::$codes[$statusCode] .
123
+				(empty($message) ? '' : ': ' . $message);
124
+		}
125
+		return $message;
126
+	}
127 127
 
128
-    public function getSource()
129
-    {
130
-        $e = $this;
131
-        while ($e->getPrevious()) {
132
-            $e = $e->getPrevious();
133
-        }
134
-        return basename($e->getFile()) . ':'
135
-        . $e->getLine() . ' at '
136
-        . $this->getStage() . ' stage';
137
-    }
128
+	public function getSource()
129
+	{
130
+		$e = $this;
131
+		while ($e->getPrevious()) {
132
+			$e = $e->getPrevious();
133
+		}
134
+		return basename($e->getFile()) . ':'
135
+		. $e->getLine() . ' at '
136
+		. $this->getStage() . ' stage';
137
+	}
138 138
 }
Please login to merge, or discard this patch.
htdocs/fourn/class/fournisseur.product.class.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
 	/**
143 143
 	 * @var ?float
144 144
 	 */
145
-	public $fourn_charges;	// when getDolGlobalString('PRODUCT_CHARGES') is set
145
+	public $fourn_charges; // when getDolGlobalString('PRODUCT_CHARGES') is set
146 146
 
147 147
 	/**
148 148
 	 * @var int		product-supplier id
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
 	/**
172 172
 	 * @var float|int
173 173
 	 */
174
-	public $fourn_unitprice_with_discount;	// not saved into database
174
+	public $fourn_unitprice_with_discount; // not saved into database
175 175
 	/**
176 176
 	 * @var string
177 177
 	 */
@@ -523,7 +523,7 @@  discard block
 block discarded – undo
523 523
 			}
524 524
 			$sql = "UPDATE ".MAIN_DB_PREFIX."product_fournisseur_price";
525 525
 			$sql .= " SET fk_user = ".((int) $user->id)." ,";
526
-			$sql .= " datec = '".$this->db->idate($now)."' ,";	// Note: Even if this is an update, we update the creation date as the log of each change is tracked into product_fournisseur_log.
526
+			$sql .= " datec = '".$this->db->idate($now)."' ,"; // Note: Even if this is an update, we update the creation date as the log of each change is tracked into product_fournisseur_log.
527 527
 			$sql .= " ref_fourn = '".$this->db->escape($ref_fourn)."',";
528 528
 			$sql .= " desc_fourn = '".$this->db->escape($desc_fourn)."',";
529 529
 			$sql .= " price = ".((float) $buyprice).",";
@@ -748,8 +748,8 @@  discard block
 block discarded – undo
748 748
 
749 749
 				$this->fk_product				= $obj->fk_product;
750 750
 				$this->product_id				= $obj->fk_product;
751
-				$this->product_ref				= $obj->product_ref;
752
-				$this->status					= $obj->status;
751
+				$this->product_ref = $obj->product_ref;
752
+				$this->status = $obj->status;
753 753
 				$this->status_buy				= $obj->status_buy;
754 754
 				$this->fourn_id					= $obj->fk_soc;
755 755
 				$this->fourn_ref				= $obj->ref_fourn; // deprecated
@@ -857,8 +857,8 @@  discard block
 block discarded – undo
857 857
 
858 858
 				$prodfourn->product_ref = $record["product_ref"];
859 859
 				$prodfourn->product_fourn_price_id = $record["product_fourn_pri_id"];
860
-				$prodfourn->status					= $record["status"];
861
-				$prodfourn->status_buy				= $record["status_buy"];
860
+				$prodfourn->status = $record["status"];
861
+				$prodfourn->status_buy = $record["status_buy"];
862 862
 				$prodfourn->product_fourn_id = $record["product_fourn_id"];
863 863
 				$prodfourn->product_fourn_entity = $record["entity"];
864 864
 				$prodfourn->ref_supplier			= $record["ref_fourn"];
@@ -1039,7 +1039,7 @@  discard block
 block discarded – undo
1039 1039
 						$this->fourn_unitprice_with_discount = $fourn_unitprice_with_discount;
1040 1040
 						$this->fourn_charges            = $record["charges"]; // when getDolGlobalString('PRODUCT_CHARGES') is set
1041 1041
 						$this->fourn_tva_tx             = $record["tva_tx"];
1042
-						$this->fourn_id                 = $record["fourn_id"];	// thirdparty id
1042
+						$this->fourn_id                 = $record["fourn_id"]; // thirdparty id
1043 1043
 						$this->fourn_name               = $record["supplier_name"];
1044 1044
 						$this->delivery_time_days = $record["delivery_time_days"];
1045 1045
 						// False positive @phan-suppress-next-line PhanTypeMismatchProperty
@@ -1442,7 +1442,7 @@  discard block
 block discarded – undo
1442 1442
 		}
1443 1443
 
1444 1444
 		global $action;
1445
-		$hookmanager->initHooks(array($this->element . 'dao'));
1445
+		$hookmanager->initHooks(array($this->element.'dao'));
1446 1446
 		$parameters = array('id' => $this->id, 'getnomurl' => &$result);
1447 1447
 		$reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
1448 1448
 		if ($reshook > 0) {
Please login to merge, or discard this patch.
htdocs/core/modules/facture/doc/pdf_octopus.modules.php 1 patch
Spacing   +47 added lines, -47 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 	 * Dolibarr version of the loaded document
79 79
 	 * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
80 80
 	 */
81
-	public $version = 'disabled';	// Disabled by default. Enabled in constructor if option INVOICE_USE_SITUATION is 2.
81
+	public $version = 'disabled'; // Disabled by default. Enabled in constructor if option INVOICE_USE_SITUATION is 2.
82 82
 
83 83
 	/**
84 84
 	 * @var int height for info total
@@ -292,7 +292,7 @@  discard block
 block discarded – undo
292 292
 			$outputlangsbis->loadLangs(array("main", "bills", "products", "dict", "companies"));
293 293
 		}
294 294
 
295
-		if (empty($object) || ($object->type != Facture::TYPE_SITUATION && ($object->type != Facture::TYPE_CREDIT_NOTE &&  !empty($object->situation_cycle_ref)))) {
295
+		if (empty($object) || ($object->type != Facture::TYPE_SITUATION && ($object->type != Facture::TYPE_CREDIT_NOTE && !empty($object->situation_cycle_ref)))) {
296 296
 			setEventMessage($langs->trans('WarningsObjectIsNotASituation'), 'warnings');
297 297
 			return 1;
298 298
 		}
@@ -411,15 +411,15 @@  discard block
 block discarded – undo
411 411
 				$pdf->SetAutoPageBreak(1, 0);
412 412
 
413 413
 				// compute height for situation invoices
414
-				$this->heightforinfotot = 45;	// Height reserved to output the info and total part and payment part
414
+				$this->heightforinfotot = 45; // Height reserved to output the info and total part and payment part
415 415
 				if (!getDolGlobalString('INVOICE_NO_PAYMENT_DETAILS') && $nbpayments > 0) {
416 416
 					$this->heightforinfotot += 4 * ($nbpayments + 3);
417 417
 				}
418 418
 				if ($nbprevsituation > 0) {
419 419
 					$this->heightforinfotot += 4 * ($nbprevsituation + 3);
420 420
 				}
421
-				$this->heightforfreetext = (getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5));	// Height reserved to output the free text on last page
422
-				$this->heightforfooter = $this->marge_basse + (!getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS') ? 12 : 22);	// Height reserved to output the footer (value include bottom margin)
421
+				$this->heightforfreetext = (getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5)); // Height reserved to output the free text on last page
422
+				$this->heightforfooter = $this->marge_basse + (!getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS') ? 12 : 22); // Height reserved to output the footer (value include bottom margin)
423 423
 
424 424
 				if (class_exists('TCPDF')) {
425 425
 					$pdf->setPrintHeader(false);
@@ -433,7 +433,7 @@  discard block
 block discarded – undo
433 433
 					if (!empty($conf->mycompany->multidir_output[$object->entity])) {
434 434
 						$logodir = $conf->mycompany->multidir_output[$object->entity];
435 435
 					}
436
-					$pagecount = $pdf->setSourceFile($logodir.'/' . getDolGlobalString('MAIN_ADD_PDF_BACKGROUND'));
436
+					$pagecount = $pdf->setSourceFile($logodir.'/'.getDolGlobalString('MAIN_ADD_PDF_BACKGROUND'));
437 437
 					$this->tplidx = $pdf->importPage(1);
438 438
 				}
439 439
 
@@ -525,7 +525,7 @@  discard block
 block discarded – undo
525 525
 				// $pdf->GetY() here can't be used. It is bottom of the second address box but first one may be higher
526 526
 
527 527
 				// $this->tab_top is y where we must continue content (90 = 42 + 48: 42 is height of logo and ref, 48 is address blocks)
528
-				$this->tab_top = 90 + $top_shift + $shipp_shift;		// top_shift is an addition for linked objects or addons (0 in most cases)
528
+				$this->tab_top = 90 + $top_shift + $shipp_shift; // top_shift is an addition for linked objects or addons (0 in most cases)
529 529
 				$this->tab_top_newpage = (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD') ? 42 + $top_shift : 10);
530 530
 
531 531
 				// You can add more thing under header here, if you increase $extra_under_address_shift too.
@@ -1035,7 +1035,7 @@  discard block
 block discarded – undo
1035 1035
 					if (!isset($this->tva[$vatrate])) {
1036 1036
 						$this->tva[$vatrate] = 0;
1037 1037
 					}
1038
-					$this->tva[$vatrate] += $tvaligne;	// ->tva is abandoned, we use now ->tva_array that is more complete
1038
+					$this->tva[$vatrate] += $tvaligne; // ->tva is abandoned, we use now ->tva_array that is more complete
1039 1039
 					$vatcode = $object->lines[$i]->vat_src_code;
1040 1040
 					if (empty($this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'])) {
1041 1041
 						$this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'] = 0;
@@ -1124,7 +1124,7 @@  discard block
 block discarded – undo
1124 1124
 				// Pagefoot
1125 1125
 				$this->_pagefoot($pdf, $object, $outputlangs);
1126 1126
 				if (method_exists($pdf, 'AliasNbPages')) {
1127
-					$pdf->AliasNbPages();  // @phan-suppress-current-line PhanUndeclaredMethod
1127
+					$pdf->AliasNbPages(); // @phan-suppress-current-line PhanUndeclaredMethod
1128 1128
 				}
1129 1129
 
1130 1130
 				$this->resumeLastPage($pdf, $object, 0, $tab_top, $outputlangs, $outputlangsbis);
@@ -1336,8 +1336,8 @@  discard block
 block discarded – undo
1336 1336
 			$posy = $pdf->GetY() + 4;
1337 1337
 		}
1338 1338
 
1339
-		$posxval = 52;	// Position of values of properties shown on left side
1340
-		$posxend = 110;	// End of x for text on left side
1339
+		$posxval = 52; // Position of values of properties shown on left side
1340
+		$posxend = 110; // End of x for text on left side
1341 1341
 		if ($this->page_largeur < 210) { // To work with US executive format
1342 1342
 			$posxend -= 10;
1343 1343
 		}
@@ -1367,7 +1367,7 @@  discard block
 block discarded – undo
1367 1367
 
1368 1368
 			$pdf->SetFont('', '', $default_font_size - 2);
1369 1369
 			$pdf->SetXY($posxval, $posy);
1370
-			$categoryOfOperationLabel = $outputlangs->transnoentities("MentionCategoryOfOperations" . $this->categoryOfOperation);
1370
+			$categoryOfOperationLabel = $outputlangs->transnoentities("MentionCategoryOfOperations".$this->categoryOfOperation);
1371 1371
 			$pdf->MultiCell($posxend - $posxval, 4, $categoryOfOperationLabel, 0, 'L');
1372 1372
 
1373 1373
 			$posy = $pdf->GetY() + 3; // for 2 lines
@@ -1701,7 +1701,7 @@  discard block
 block discarded – undo
1701 1701
 					if (($object->lines[$i]->info_bits & 0x01) == 0x01) {
1702 1702
 						$vatrate .= '*';
1703 1703
 					}
1704
-					if (! isset($tvas[$vatrate])) {
1704
+					if (!isset($tvas[$vatrate])) {
1705 1705
 						$tvas[$vatrate] = 0;
1706 1706
 					}
1707 1707
 					$tvas[$vatrate] += $tvaligne;
@@ -1969,7 +1969,7 @@  discard block
 block discarded – undo
1969 1969
 		if (empty($hidetop)) {
1970 1970
 			// Show category of operations
1971 1971
 			if (getDolGlobalInt('INVOICE_CATEGORY_OF_OPERATION') == 1 && $this->categoryOfOperation >= 0) {
1972
-				$categoryOfOperations = $outputlangs->transnoentities("MentionCategoryOfOperations") . ' : ' . $outputlangs->transnoentities("MentionCategoryOfOperations" . $this->categoryOfOperation);
1972
+				$categoryOfOperations = $outputlangs->transnoentities("MentionCategoryOfOperations").' : '.$outputlangs->transnoentities("MentionCategoryOfOperations".$this->categoryOfOperation);
1973 1973
 				$pdf->SetXY($this->marge_gauche, $tab_top - 4);
1974 1974
 				$pdf->MultiCell(($pdf->GetStringWidth($categoryOfOperations)) + 4, 2, $categoryOfOperations);
1975 1975
 			}
@@ -1989,7 +1989,7 @@  discard block
 block discarded – undo
1989 1989
 		$pdf->SetFont('', '', $default_font_size - 1);
1990 1990
 
1991 1991
 		// Output Rect
1992
-		$this->printRoundedRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $this->corner_radius, $hidetop, $hidebottom, 'D');	// Rect prend une longueur en 3eme param et 4eme param
1992
+		$this->printRoundedRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $this->corner_radius, $hidetop, $hidebottom, 'D'); // Rect prend une longueur en 3eme param et 4eme param
1993 1993
 
1994 1994
 		// situation invoice
1995 1995
 		$pdf->SetFont('', '', $default_font_size - 2);
@@ -2029,7 +2029,7 @@  discard block
 block discarded – undo
2029 2029
 		$pdf->SetFont('', '', $default_font_size - 1);
2030 2030
 
2031 2031
 		if (empty($hidetop)) {
2032
-			$pdf->line($this->marge_gauche, $tab_top + 5, $this->page_largeur - $this->marge_droite, $tab_top + 5);	// line prend une position y en 2eme param et 4eme param
2032
+			$pdf->line($this->marge_gauche, $tab_top + 5, $this->page_largeur - $this->marge_droite, $tab_top + 5); // line prend une position y en 2eme param et 4eme param
2033 2033
 		}
2034 2034
 	}
2035 2035
 
@@ -2599,7 +2599,7 @@  discard block
 block discarded – undo
2599 2599
 			'overtitle' => array(
2600 2600
 				'textkey' => 'Chantier', // use lang key is useful in somme case with module
2601 2601
 				'align' => 'C',
2602
-				'padding' => array(0.5,0.5,0.5,0.5), // Like css 0 => top , 1 => right, 2 => bottom, 3 => left
2602
+				'padding' => array(0.5, 0.5, 0.5, 0.5), // Like css 0 => top , 1 => right, 2 => bottom, 3 => left
2603 2603
 				'width' => 18
2604 2604
 			),
2605 2605
 		);
@@ -2624,13 +2624,13 @@  discard block
 block discarded – undo
2624 2624
 			),
2625 2625
 			'border-left' => true, // add left line separator
2626 2626
 			'overtitle' => array(
2627
-				'textkey' => 'S'.$derniere_situation->situation_counter . ' - ' . dol_print_date($derniere_situation->date, "%d/%m/%Y"),
2627
+				'textkey' => 'S'.$derniere_situation->situation_counter.' - '.dol_print_date($derniere_situation->date, "%d/%m/%Y"),
2628 2628
 				'align' => 'C',
2629
-				'padding' => array(0.5,0.2,0.5,0.2), // Like css 0 => top, 1 => right, 2 => bottom, 3 => left
2629
+				'padding' => array(0.5, 0.2, 0.5, 0.2), // Like css 0 => top, 1 => right, 2 => bottom, 3 => left
2630 2630
 				'width' => 10 + 15 //current width + amount cell width
2631 2631
 			),
2632 2632
 		);
2633
-		if ($this->situationinvoice && ! empty($this->TDataSituation['date_derniere_situation'])) {
2633
+		if ($this->situationinvoice && !empty($this->TDataSituation['date_derniere_situation'])) {
2634 2634
 			$this->cols['prev_progress']['status'] = true;
2635 2635
 		}
2636 2636
 
@@ -2645,7 +2645,7 @@  discard block
 block discarded – undo
2645 2645
 			),
2646 2646
 			'border-left' => true, // add left line separator
2647 2647
 		);
2648
-		if ($this->situationinvoice && ! empty($this->TDataSituation['date_derniere_situation'])) {
2648
+		if ($this->situationinvoice && !empty($this->TDataSituation['date_derniere_situation'])) {
2649 2649
 			$this->cols['prev_progress_amount']['status'] = true;
2650 2650
 		}
2651 2651
 
@@ -2660,9 +2660,9 @@  discard block
 block discarded – undo
2660 2660
 			),
2661 2661
 			'border-left' => true, // add left line separator
2662 2662
 			'overtitle' => array(
2663
-				'textkey' => 'S'.$object->situation_counter . ' - ' . dol_print_date($object->date, "%d/%m/%Y"),
2663
+				'textkey' => 'S'.$object->situation_counter.' - '.dol_print_date($object->date, "%d/%m/%Y"),
2664 2664
 				'align' => 'C',
2665
-				'padding' => array(0.5,0.2,0.5,0.2), // Like css 0 => top, 1 => right, 2 => bottom, 3 => left
2665
+				'padding' => array(0.5, 0.2, 0.5, 0.2), // Like css 0 => top, 1 => right, 2 => bottom, 3 => left
2666 2666
 				'width' => 10 + 15
2667 2667
 			),
2668 2668
 		);
@@ -2787,7 +2787,7 @@  discard block
 block discarded – undo
2787 2787
 
2788 2788
 		// Output Rect
2789 2789
 		// KEEPTHIS => Affiche les bords extérieurs
2790
-		$this->printRoundedRectBtp($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $this->corner_radius, $hidetop, $hidebottom, 'D');	// Rect prend une longueur en 3eme param et 4eme param
2790
+		$this->printRoundedRectBtp($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $this->corner_radius, $hidetop, $hidebottom, 'D'); // Rect prend une longueur en 3eme param et 4eme param
2791 2791
 
2792 2792
 		$pdf->line($this->posx_cumul_anterieur - 1, $tab_top, $this->posx_cumul_anterieur - 1, $tab_top + $tab_height);
2793 2793
 		if (empty($hidetop)) {
@@ -2844,7 +2844,7 @@  discard block
 block discarded – undo
2844 2844
 			$pdf->SetXY($this->marge_gauche + 10, $tab_top + 24 + $i);
2845 2845
 			$pdf->MultiCell(80, 2, $outputlangs->transnoentities("TotalHT").' '.$TVatInfo['label'], '', 'L');
2846 2846
 
2847
-			if (! empty($this->TDataSituation['current'][$tva_tx_formated]['TVA'])) {
2847
+			if (!empty($this->TDataSituation['current'][$tva_tx_formated]['TVA'])) {
2848 2848
 				$pdf->SetXY($this->marge_gauche + 10, $tab_top + 28 + $i);
2849 2849
 				$pdf->MultiCell(80, 2, $outputlangs->transnoentities("VAT").' '.$TVatInfo['label'], '', 'L');
2850 2850
 			} else {
@@ -2908,7 +2908,7 @@  discard block
 block discarded – undo
2908 2908
 				$pdf->MultiCell(32, 2, price($this->TDataSituation[$col][$tva_tx_formated]['HT'], 0, '', 1, -1, 2), '', 'R');
2909 2909
 
2910 2910
 				// Total TVA
2911
-				if (! empty($this->TDataSituation['current'][$tva_tx_formated]['TVA'])) {
2911
+				if (!empty($this->TDataSituation['current'][$tva_tx_formated]['TVA'])) {
2912 2912
 					$pdf->SetXY($x, $tab_top + 28 + $i);
2913 2913
 					$pdf->MultiCell(32, 2, price($this->TDataSituation[$col][$tva_tx_formated]['TVA'], 0, '', 1, -1, 2), '', 'R');
2914 2914
 				} else {
@@ -2988,7 +2988,7 @@  discard block
 block discarded – undo
2988 2988
 
2989 2989
 		$TDataSituation = array();
2990 2990
 
2991
-		if (! empty($facDerniereSituation)) {
2991
+		if (!empty($facDerniereSituation)) {
2992 2992
 			$TDataSituation['derniere_situation'] = $facDerniereSituation;
2993 2993
 			$TDataSituation['date_derniere_situation'] = $facDerniereSituation->date;
2994 2994
 		}
@@ -2997,9 +2997,9 @@  discard block
 block discarded – undo
2997 2997
 		$retenue_garantie_anterieure = 0;
2998 2998
 		// Init tous les champs à 0
2999 2999
 		$TDataSituation['cumul_anterieur'] = array(
3000
-			'HT' => 0,	//montant HT normal
3001
-			'TVA' => 0,   //montant de la TVA sur le HTnet
3002
-			'TTC' => 0,   //montant TTC (HTnet + TVA)
3000
+			'HT' => 0, //montant HT normal
3001
+			'TVA' => 0, //montant de la TVA sur le HTnet
3002
+			'TTC' => 0, //montant TTC (HTnet + TVA)
3003 3003
 			'retenue_garantie' => 0,
3004 3004
 			'travaux_sup' => 0,
3005 3005
 			'HTnet' => 0, //montant HT
@@ -3029,7 +3029,7 @@  discard block
 block discarded – undo
3029 3029
 					$isFirstSituation = false;
3030 3030
 					if (!empty($l->fk_prev_id)) {
3031 3031
 						$prevSituationPercent = $l->get_prev_progress($previousInvoice->id, true);
3032
-					} elseif (! array_key_exists($i + 1, $TPreviousInvoices)) {
3032
+					} elseif (!array_key_exists($i + 1, $TPreviousInvoices)) {
3033 3033
 						$isFirstSituation = true;
3034 3034
 					}
3035 3035
 
@@ -3039,7 +3039,7 @@  discard block
 block discarded – undo
3039 3039
 
3040 3040
 					//1ere ligne
3041 3041
 					$amounttva = $calc_ht * ($ltvatx / 100);
3042
-					if (! isset($TDataSituation['cumul_anterieur'][$ltvatx])) {
3042
+					if (!isset($TDataSituation['cumul_anterieur'][$ltvatx])) {
3043 3043
 						$TDataSituation['cumul_anterieur'][$ltvatx]['HT'] = $calc_ht;
3044 3044
 						$TDataSituation['cumul_anterieur'][$ltvatx]['TVA'] = $amounttva;
3045 3045
 					} else {
@@ -3051,14 +3051,14 @@  discard block
 block discarded – undo
3051 3051
 					//le grand total de TVA
3052 3052
 					// $TDataSituation['cumul_anterieur']['TVA'] += $amounttva;
3053 3053
 
3054
-					if (empty($l->fk_prev_id) && ! $isFirstSituation) {
3054
+					if (empty($l->fk_prev_id) && !$isFirstSituation) {
3055 3055
 						// TODO: à clarifier, mais pour moi, un facture de situation précédente qui a des progressions à 0% c'est pas logique
3056 3056
 						$TDataSituation['cumul_anterieur']['travaux_sup'] += $calc_ht;
3057 3057
 					}
3058 3058
 				}
3059 3059
 			}
3060 3060
 
3061
-			if (! empty($previousInvoice->retained_warranty) && !getDolGlobalString('USE_RETAINED_WARRANTY_ONLY_FOR_SITUATION_FINAL')) {
3061
+			if (!empty($previousInvoice->retained_warranty) && !getDolGlobalString('USE_RETAINED_WARRANTY_ONLY_FOR_SITUATION_FINAL')) {
3062 3062
 				$retenue_garantie_anterieure += $previousInvoice->getRetainedWarrantyAmount();
3063 3063
 			}
3064 3064
 
@@ -3072,7 +3072,7 @@  discard block
 block discarded – undo
3072 3072
 		// print json_encode($facDerniereSituation->lines);exit;
3073 3073
 		$TDataSituation['current'] = $this->btpGetInvoiceAmounts($object->id);
3074 3074
 
3075
-		if (! empty($facDerniereSituation->lines)) {
3075
+		if (!empty($facDerniereSituation->lines)) {
3076 3076
 			$TFacLinesKey = array_keys($facDerniereSituation->lines);
3077 3077
 			$TObjectLinesKey = array_keys($object->lines);
3078 3078
 			$TDiffKey = array_diff($TObjectLinesKey, $TFacLinesKey);
@@ -3266,7 +3266,7 @@  discard block
 block discarded – undo
3266 3266
 	 */
3267 3267
 	public function btpGetInvoiceAmounts($id, $forceReadFromDB = false)
3268 3268
 	{
3269
-		global $user,$langs,$conf,$mysoc,$db,$hookmanager,$nblignes;
3269
+		global $user, $langs, $conf, $mysoc, $db, $hookmanager, $nblignes;
3270 3270
 
3271 3271
 		$object = new Facture($db);
3272 3272
 		$object->fetch($id);
@@ -3284,16 +3284,16 @@  discard block
 block discarded – undo
3284 3284
 		$facDerniereSituation = $TPreviousInvoices[0];
3285 3285
 
3286 3286
 		$ret = array(
3287
-			'HT' => 0,	//montant HT normal
3287
+			'HT' => 0, //montant HT normal
3288 3288
 			'HTnet' => 0, //montant HT
3289
-			'TVA' => 0,   //montant de la TVA sur le HTnet
3290
-			'TTC' => 0,   //montant TTC (HTnet + TVA)
3289
+			'TVA' => 0, //montant de la TVA sur le HTnet
3290
+			'TTC' => 0, //montant TTC (HTnet + TVA)
3291 3291
 			'retenue_garantie' => 0,
3292 3292
 			'travaux_sup' => 0,
3293 3293
 			'total_a_payer' => 0 //montant "a payer" sur la facture
3294 3294
 		);
3295 3295
 
3296
-		if (! empty($facDerniereSituation)) {
3296
+		if (!empty($facDerniereSituation)) {
3297 3297
 			$ret['derniere_situation'] = $facDerniereSituation;
3298 3298
 			$ret['date_derniere_situation'] = $facDerniereSituation->date;
3299 3299
 		}
@@ -3425,7 +3425,7 @@  discard block
 block discarded – undo
3425 3425
 			$label = $outputlangs->transnoentities("SituationInvoiceTotalProposal");
3426 3426
 			$pdf->MultiCell($this->page_largeur - ($this->marge_droite + $this->marge_gauche), 3, $label, 0, 'L', 0, 1, $posx, $posy + 1);
3427 3427
 
3428
-			$amount = price($sign * ($total_ht + (! empty($propal->remise) ? $propal->remise : 0)));
3428
+			$amount = price($sign * ($total_ht + (!empty($propal->remise) ? $propal->remise : 0)));
3429 3429
 			$pdf->MultiCell($width2, 3, $amount, 0, 'R', 0, 1, $posx + $width, $posy + 1);
3430 3430
 
3431 3431
 			$pdf->SetFont('', '', $default_font_size - 1);
@@ -3468,7 +3468,7 @@  discard block
 block discarded – undo
3468 3468
 
3469 3469
 		$force_to_zero = false;
3470 3470
 
3471
-		$idinv = 0;//count($previousinvoices);
3471
+		$idinv = 0; //count($previousinvoices);
3472 3472
 		while ($idinv < count($previousinvoices)) {
3473 3473
 			$invoice = $previousinvoices[$idinv];
3474 3474
 
@@ -3490,7 +3490,7 @@  discard block
 block discarded – undo
3490 3490
 				$force_to_zero = true;
3491 3491
 			}
3492 3492
 
3493
-			$ref .= ' - '. $invoice->ref;
3493
+			$ref .= ' - '.$invoice->ref;
3494 3494
 			$ref .= ' ('.dol_print_date($invoice->date, "%d/%m/%Y", false, $outputlangs).')';
3495 3495
 			$pdf->MultiCell($this->page_largeur - ($this->marge_droite + $this->marge_gauche), 3, $ref, 0, 'L', 0);
3496 3496
 
@@ -3521,7 +3521,7 @@  discard block
 block discarded – undo
3521 3521
 				if (($invoice->lines[$i]->info_bits & 0x01) == 0x01) {
3522 3522
 					$vatrate .= '*';
3523 3523
 				}
3524
-				if (! isset($tvas[$vatrate])) {
3524
+				if (!isset($tvas[$vatrate])) {
3525 3525
 					$tvas[$vatrate] = 0;
3526 3526
 				}
3527 3527
 				$tvas[$vatrate] += $tvaligne;
@@ -3699,7 +3699,7 @@  discard block
 block discarded – undo
3699 3699
 						$pdf->SetXY($posx + $width4, $posy + $height * $index + $y);
3700 3700
 						$pdf->MultiCell($width4, $height - 1, price($sign * $payment['amount'], 0, $outputlangs), 0, 'L', 0);
3701 3701
 						$pdf->SetXY($posx + $width4 * 2, $posy + $height * $index + $y);
3702
-						$oper = $outputlangs->transnoentitiesnoconv("PaymentTypeShort" . $payment['type']);
3702
+						$oper = $outputlangs->transnoentitiesnoconv("PaymentTypeShort".$payment['type']);
3703 3703
 
3704 3704
 						$pdf->MultiCell($width4, $height - 1, $oper, 0, 'L', 0);
3705 3705
 						$pdf->SetXY($posx + $width4 * 3, $posy + $height * $index + $y);
@@ -3730,7 +3730,7 @@  discard block
 block discarded – undo
3730 3730
 					$this->_pagehead($pdf, $object, 0, $outputlangs);
3731 3731
 				}
3732 3732
 				$pdf->setPage($pageposafter + 1);
3733
-				$pdf->setPageOrientation('', 1, 0);	// The only function to edit the bottom margin of current page to set it.
3733
+				$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
3734 3734
 
3735 3735
 				$posy = $this->tab_top_newpage + 1;
3736 3736
 			} else {
@@ -3762,7 +3762,7 @@  discard block
 block discarded – undo
3762 3762
 
3763 3763
 		$posy += 10;
3764 3764
 
3765
-		$pdf->setPageOrientation('', 1, 0);	// The only function to edit the bottom margin of current page to set it.
3765
+		$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
3766 3766
 
3767 3767
 		$pdf->SetTextColor(0, 0, 60);
3768 3768
 		$pdf->SetFont('', '', $default_font_size - 1);
Please login to merge, or discard this patch.
htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
 				$pdf->SetFont(pdf_getPDFFont($outputlangs));
203 203
 				// Set path to the background PDF File
204 204
 				if (getDolGlobalString('MAIN_ADD_PDF_BACKGROUND')) {
205
-					$pagecount = $pdf->setSourceFile($conf->mycompany->dir_output.'/' . getDolGlobalString('MAIN_ADD_PDF_BACKGROUND'));
205
+					$pagecount = $pdf->setSourceFile($conf->mycompany->dir_output.'/'.getDolGlobalString('MAIN_ADD_PDF_BACKGROUND'));
206 206
 					$tplidx = $pdf->importPage(1);
207 207
 				}
208 208
 
@@ -410,7 +410,7 @@  discard block
 block discarded – undo
410 410
 
411 411
 				$this->_pagefoot($pdf, $object, $outputlangs);
412 412
 				if (method_exists($pdf, 'AliasNbPages')) {
413
-					$pdf->AliasNbPages();  // @phan-suppress-current-line PhanUndeclaredMethod
413
+					$pdf->AliasNbPages(); // @phan-suppress-current-line PhanUndeclaredMethod
414 414
 				}
415 415
 
416 416
 				$pdf->Close();
@@ -488,7 +488,7 @@  discard block
 block discarded – undo
488 488
 		*/
489 489
 
490 490
 		// Output Rect
491
-		$this->printRoundedRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height + 1, $this->corner_radius, 0, 0, 'D');	 // Rect takes a length in 3rd parameter and 4th parameter
491
+		$this->printRoundedRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height + 1, $this->corner_radius, 0, 0, 'D'); // Rect takes a length in 3rd parameter and 4th parameter
492 492
 
493 493
 		if (empty($hidebottom)) {
494 494
 			$employee_name = '';
@@ -586,7 +586,7 @@  discard block
 block discarded – undo
586 586
 			$posy += 4;
587 587
 			$pdf->SetXY($posx, $posy);
588 588
 			$pdf->SetTextColor(0, 0, 60);
589
-			$pdf->MultiCell(100, 3, $outputlangs->transnoentities("RefCustomer") . " : " . dol_trunc($outputlangs->convToOutputCharset($object->ref_client), 65), '', 'R');
589
+			$pdf->MultiCell(100, 3, $outputlangs->transnoentities("RefCustomer")." : ".dol_trunc($outputlangs->convToOutputCharset($object->ref_client), 65), '', 'R');
590 590
 		}
591 591
 
592 592
 
Please login to merge, or discard this patch.
htdocs/core/modules/stock/doc/pdf_standard_stock.modules.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
 				$pdf->SetFont(pdf_getPDFFont($outputlangs));
203 203
 				// Set path to the background PDF File
204 204
 				if (!getDolGlobalString('MAIN_DISABLE_FPDI') && getDolGlobalString('MAIN_ADD_PDF_BACKGROUND')) {
205
-					$pagecount = $pdf->setSourceFile($conf->mycompany->dir_output.'/' . getDolGlobalString('MAIN_ADD_PDF_BACKGROUND'));
205
+					$pagecount = $pdf->setSourceFile($conf->mycompany->dir_output.'/'.getDolGlobalString('MAIN_ADD_PDF_BACKGROUND'));
206 206
 					$tplidx = $pdf->importPage(1);
207 207
 				}
208 208
 
@@ -541,7 +541,7 @@  discard block
 block discarded – undo
541 541
 				// Pied de page
542 542
 				$this->_pagefoot($pdf, $object, $outputlangs);
543 543
 				if (method_exists($pdf, 'AliasNbPages')) {
544
-					$pdf->AliasNbPages();  // @phan-suppress-current-line PhanUndeclaredMethod
544
+					$pdf->AliasNbPages(); // @phan-suppress-current-line PhanUndeclaredMethod
545 545
 				}
546 546
 
547 547
 				$pdf->Close();
@@ -620,7 +620,7 @@  discard block
 block discarded – undo
620 620
 		$pdf->SetFont('', 'B', $default_font_size - 3);
621 621
 
622 622
 		// Output Rect
623
-		$this->printRoundedRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $this->corner_radius, $hidetop, $hidebottom, 'D');	// Rect takes a length in 3rd parameter and 4th parameter
623
+		$this->printRoundedRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $this->corner_radius, $hidetop, $hidebottom, 'D'); // Rect takes a length in 3rd parameter and 4th parameter
624 624
 
625 625
 		$pdf->SetLineStyle(array('dash' => '0', 'color' => array(200, 200, 200)));
626 626
 		$pdf->SetDrawColor(200, 200, 200);
@@ -631,7 +631,7 @@  discard block
 block discarded – undo
631 631
 
632 632
 
633 633
 		if (empty($hidetop)) {
634
-			$pdf->line($this->marge_gauche, $tab_top + 11, $this->page_largeur - $this->marge_droite, $tab_top + 11);	// line takes a position y in 2nd parameter and 4th parameter
634
+			$pdf->line($this->marge_gauche, $tab_top + 11, $this->page_largeur - $this->marge_droite, $tab_top + 11); // line takes a position y in 2nd parameter and 4th parameter
635 635
 			$pdf->SetXY($this->posxdesc - 1, $tab_top + 1);
636 636
 			$pdf->MultiCell($this->wref, 3, $outputlangs->transnoentities("Ref"), '', 'L');
637 637
 		}
Please login to merge, or discard this patch.
htdocs/core/lib/functionscli.lib.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -24,8 +24,8 @@  discard block
 block discarded – undo
24 24
 
25 25
 
26 26
 // Define ANSI color constant to use colors and bold in CLI script
27
-define('DOL_COLOR_RESET', "\033[0m");		// Restore color
28
-define('DOL_COLOR_BOLD', "\033[1m");			// Bold
27
+define('DOL_COLOR_RESET', "\033[0m"); // Restore color
28
+define('DOL_COLOR_BOLD', "\033[1m"); // Bold
29 29
 define('DOL_COLOR_RED', "\033[31m");
30 30
 define('DOL_COLOR_GREEN', "\033[32m");
31 31
 define('DOL_COLOR_YELLOW', "\033[33m");
@@ -46,5 +46,5 @@  discard block
 block discarded – undo
46 46
 function coloredText($text, $color, $bold = false)
47 47
 {
48 48
 	$boldCode = $bold ? DOL_COLOR_BOLD : '';
49
-	return $boldCode . $color . $text . DOL_COLOR_RESET;
49
+	return $boldCode.$color.$text.DOL_COLOR_RESET;
50 50
 }
Please login to merge, or discard this patch.
htdocs/core/tpl/contacts.tpl.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
 		<div class="tagtd nowrap noborderbottom">
172 172
 			<?php
173 173
 			$selectedCompany = GETPOSTISSET("newcompany") ? GETPOSTINT("newcompany") : (empty($object->socid) ? 0 : $object->socid);
174
-			$selectedCompany = $formcompany->selectCompaniesForNewContact($object, 'id', $selectedCompany, 'newcompany', array(), 0, '', 'minwidth300imp maxwidth400 widthcentpercentminusx');	// This also print the select component?>
174
+			$selectedCompany = $formcompany->selectCompaniesForNewContact($object, 'id', $selectedCompany, 'newcompany', array(), 0, '', 'minwidth300imp maxwidth400 widthcentpercentminusx'); // This also print the select component?>
175 175
 		</div>
176 176
 		<div class="tagtd noborderbottom minwidth500imp">
177 177
 			<?php
@@ -334,13 +334,13 @@  discard block
 block discarded – undo
334 334
 print "</tr>";
335 335
 
336 336
 foreach ($list as $entry) {
337
-	print '<tr class="oddeven" data-rowid="' . $entry->id . '">';
337
+	print '<tr class="oddeven" data-rowid="'.$entry->id.'">';
338 338
 
339
-	print '<td class="tdoverflowmax200" data-thirdparty_id="' . ((int) $entry->thirdparty_id) . '" data-thirdparty_name="' . dol_escape_htmltag($entry->thirdparty_name) . '">'.$entry->thirdparty_html.'</td>';
340
-	print '<td class="tdoverflowmax200" data-contact_id="' . ((int) $entry->contact_id) . '">'.$entry->contact_html.'</td>';
341
-	print '<td class="nowrap" data-nature="' . dol_escape_htmltag($entry->nature) . '"><span class="opacitymedium">'.dol_escape_htmltag($entry->nature_html).'</span></td>';
342
-	print '<td class="tdoverflowmax200" data-type_id="' . ((int) $entry->type_id) . '" data-type="' . dol_escape_htmltag($entry->type) . '">'.dol_escape_htmltag($entry->type).'</td>';
343
-	print '<td class="tdoverflowmax200 center" data-status_id="' . ((int) $entry->status) . '">'.$entry->status_html.'</td>';
339
+	print '<td class="tdoverflowmax200" data-thirdparty_id="'.((int) $entry->thirdparty_id).'" data-thirdparty_name="'.dol_escape_htmltag($entry->thirdparty_name).'">'.$entry->thirdparty_html.'</td>';
340
+	print '<td class="tdoverflowmax200" data-contact_id="'.((int) $entry->contact_id).'">'.$entry->contact_html.'</td>';
341
+	print '<td class="nowrap" data-nature="'.dol_escape_htmltag($entry->nature).'"><span class="opacitymedium">'.dol_escape_htmltag($entry->nature_html).'</span></td>';
342
+	print '<td class="tdoverflowmax200" data-type_id="'.((int) $entry->type_id).'" data-type="'.dol_escape_htmltag($entry->type).'">'.dol_escape_htmltag($entry->type).'</td>';
343
+	print '<td class="tdoverflowmax200 center" data-status_id="'.((int) $entry->status).'">'.$entry->status_html.'</td>';
344 344
 
345 345
 	if ($permission) {
346 346
 		$href = $_SERVER["PHP_SELF"];
Please login to merge, or discard this patch.
htdocs/core/class/html.form.class.php 1 patch
Spacing   +1230 added lines, -1230 removed lines patch added patch discarded remove patch
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
 		if (getDolGlobalString('MAIN_USE_JQUERY_JEDITABLE') && !preg_match('/^select;/', $typeofdata)) {
124 124
 			if (!empty($perm)) {
125 125
 				$tmp = explode(':', $typeofdata);
126
-				$ret .= '<div class="editkey_' . $tmp[0] . (!empty($tmp[1]) ? ' ' . $tmp[1] : '') . '" id="' . $htmlname . '">';
126
+				$ret .= '<div class="editkey_'.$tmp[0].(!empty($tmp[1]) ? ' '.$tmp[1] : '').'" id="'.$htmlname.'">';
127 127
 				if ($fieldrequired) {
128 128
 					$ret .= '<span class="fieldrequired">';
129 129
 				}
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
 				if ($fieldrequired) {
136 136
 					$ret .= '</span>';
137 137
 				}
138
-				$ret .= '</div>' . "\n";
138
+				$ret .= '</div>'."\n";
139 139
 			} else {
140 140
 				if ($fieldrequired) {
141 141
 					$ret .= '<span class="fieldrequired">';
@@ -173,8 +173,8 @@  discard block
 block discarded – undo
173 173
 			if (empty($notabletag) && $perm) {
174 174
 				$ret .= '<td class="right">';
175 175
 			}
176
-			if ($htmlname && GETPOST('action', 'aZ09') != 'edit' . $htmlname && $perm) {
177
-				$ret .= '<a class="editfielda reposition" href="' . $_SERVER["PHP_SELF"] . '?action=edit' . $htmlname . '&token=' . newToken() . '&' . $paramid . '=' . $object->id . $moreparam . '">' . img_edit($langs->trans('Edit'), ($notabletag ? 0 : 1)) . '</a>';
176
+			if ($htmlname && GETPOST('action', 'aZ09') != 'edit'.$htmlname && $perm) {
177
+				$ret .= '<a class="editfielda reposition" href="'.$_SERVER["PHP_SELF"].'?action=edit'.$htmlname.'&token='.newToken().'&'.$paramid.'='.$object->id.$moreparam.'">'.img_edit($langs->trans('Edit'), ($notabletag ? 0 : 1)).'</a>';
178 178
 			}
179 179
 			if (!empty($notabletag) && $notabletag == 1) {
180 180
 				if ($text) {
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
 			} elseif ($reg[1] == 'int') {
242 242
 				$typeofdata = 'numeric';
243 243
 			} else {
244
-				return 'ErrorBadParameter ' . $typeofdata;
244
+				return 'ErrorBadParameter '.$typeofdata;
245 245
 			}
246 246
 		}
247 247
 
@@ -252,13 +252,13 @@  discard block
 block discarded – undo
252 252
 			if ($editaction == '') {
253 253
 				$editaction = GETPOST('action', 'aZ09');
254 254
 			}
255
-			$editmode = ($editaction == 'edit' . $htmlname);
255
+			$editmode = ($editaction == 'edit'.$htmlname);
256 256
 			if ($editmode) {	// edit mode
257 257
 				$ret .= "<!-- formeditfieldval -->\n";
258
-				$ret .= '<form method="post" action="' . $_SERVER["PHP_SELF"] . ($moreparam ? '?' . $moreparam : '') . '">';
259
-				$ret .= '<input type="hidden" name="action" value="set' . $htmlname . '">';
260
-				$ret .= '<input type="hidden" name="token" value="' . newToken() . '">';
261
-				$ret .= '<input type="hidden" name="' . $paramid . '" value="' . $object->id . '">';
258
+				$ret .= '<form method="post" action="'.$_SERVER["PHP_SELF"].($moreparam ? '?'.$moreparam : '').'">';
259
+				$ret .= '<input type="hidden" name="action" value="set'.$htmlname.'">';
260
+				$ret .= '<input type="hidden" name="token" value="'.newToken().'">';
261
+				$ret .= '<input type="hidden" name="'.$paramid.'" value="'.$object->id.'">';
262 262
 				if (empty($notabletag)) {
263 263
 					$ret .= '<table class="nobordernopadding centpercent">';
264 264
 				}
@@ -267,28 +267,28 @@  discard block
 block discarded – undo
267 267
 				}
268 268
 				if (preg_match('/^(string|safehtmlstring|email|phone|url)/', $typeofdata)) {
269 269
 					$tmp = explode(':', $typeofdata);
270
-					$ret .= '<input type="text" id="' . $htmlname . '" name="' . $htmlname . '" value="' . ($editvalue ? $editvalue : $value) . '"' . (empty($tmp[1]) ? '' : ' size="' . $tmp[1] . '"') . ' autofocus>';
270
+					$ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($editvalue ? $editvalue : $value).'"'.(empty($tmp[1]) ? '' : ' size="'.$tmp[1].'"').' autofocus>';
271 271
 				} elseif (preg_match('/^(integer)/', $typeofdata)) {
272 272
 					$tmp = explode(':', $typeofdata);
273 273
 					$valuetoshow = price2num($editvalue ? $editvalue : $value, 0);
274
-					$ret .= '<input type="text" id="' . $htmlname . '" name="' . $htmlname . '" value="' . $valuetoshow . '"' . (empty($tmp[1]) ? '' : ' size="' . $tmp[1] . '"') . ' autofocus>';
274
+					$ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.$valuetoshow.'"'.(empty($tmp[1]) ? '' : ' size="'.$tmp[1].'"').' autofocus>';
275 275
 				} elseif (preg_match('/^(numeric|amount)/', $typeofdata)) {
276 276
 					$tmp = explode(':', $typeofdata);
277 277
 					$valuetoshow = price2num($editvalue ? $editvalue : $value);
278
-					$ret .= '<input type="text" id="' . $htmlname . '" name="' . $htmlname . '" value="' . ($valuetoshow != '' ? price($valuetoshow) : '') . '"' . (empty($tmp[1]) ? '' : ' size="' . $tmp[1] . '"') . ' autofocus>';
278
+					$ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($valuetoshow != '' ? price($valuetoshow) : '').'"'.(empty($tmp[1]) ? '' : ' size="'.$tmp[1].'"').' autofocus>';
279 279
 				} elseif (preg_match('/^(checkbox)/', $typeofdata)) {
280 280
 					$tmp = explode(':', $typeofdata);
281
-					$ret .= '<input type="checkbox" id="' . $htmlname . '" name="' . $htmlname . '" value="' . ($value ? $value : 'on') . '"' . ($value ? ' checked' : '') . (empty($tmp[1]) ? '' : $tmp[1]) . '/>';
281
+					$ret .= '<input type="checkbox" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($value ? $value : 'on').'"'.($value ? ' checked' : '').(empty($tmp[1]) ? '' : $tmp[1]).'/>';
282 282
 				} elseif (preg_match('/^text/', $typeofdata) || preg_match('/^note/', $typeofdata)) {    // if wysiwyg is enabled $typeofdata = 'ckeditor'
283 283
 					$tmp = explode(':', $typeofdata);
284 284
 					$cols = (empty($tmp[2]) ? '' : $tmp[2]);
285 285
 					$morealt = '';
286 286
 					if (preg_match('/%/', $cols)) {
287
-						$morealt = ' style="width: ' . $cols . '"';
287
+						$morealt = ' style="width: '.$cols.'"';
288 288
 						$cols = '';
289 289
 					}
290 290
 					$valuetoshow = ($editvalue ? $editvalue : $value);
291
-					$ret .= '<textarea id="' . $htmlname . '" name="' . $htmlname . '" wrap="soft" rows="' . (empty($tmp[1]) ? '20' : $tmp[1]) . '"' . ($cols ? ' cols="' . $cols . '"' : 'class="quatrevingtpercent"') . $morealt . '" autofocus>';
291
+					$ret .= '<textarea id="'.$htmlname.'" name="'.$htmlname.'" wrap="soft" rows="'.(empty($tmp[1]) ? '20' : $tmp[1]).'"'.($cols ? ' cols="'.$cols.'"' : 'class="quatrevingtpercent"').$morealt.'" autofocus>';
292 292
 					// textarea convert automatically entities chars into simple chars.
293 293
 					// So we convert & into &amp; so a string like 'a &lt; <b>b</b><br>é<br>&lt;script&gt;alert('X');&lt;script&gt;' stay a correct html and is not converted by textarea component when wysiwyg is off.
294 294
 					$valuetoshow = str_replace('&', '&amp;', $valuetoshow);
@@ -298,12 +298,12 @@  discard block
 block discarded – undo
298 298
 					$addnowlink = empty($moreoptions['addnowlink']) ? 0 : $moreoptions['addnowlink'];
299 299
 					$adddateof = empty($moreoptions['adddateof']) ? '' : $moreoptions['adddateof'];
300 300
 					$labeladddateof = empty($moreoptions['labeladddateof']) ? '' : $moreoptions['labeladddateof'];
301
-					$ret .= $this->selectDate($value, $htmlname, 0, 0, 1, 'form' . $htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm);
301
+					$ret .= $this->selectDate($value, $htmlname, 0, 0, 1, 'form'.$htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm);
302 302
 				} elseif ($typeofdata == 'dayhour' || $typeofdata == 'datehourpicker') {
303 303
 					$addnowlink = empty($moreoptions['addnowlink']) ? 0 : $moreoptions['addnowlink'];
304 304
 					$adddateof = empty($moreoptions['adddateof']) ? '' : $moreoptions['adddateof'];
305 305
 					$labeladddateof = empty($moreoptions['labeladddateof']) ? '' : $moreoptions['labeladddateof'];
306
-					$ret .= $this->selectDate($value, $htmlname, 1, 1, 1, 'form' . $htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm);
306
+					$ret .= $this->selectDate($value, $htmlname, 1, 1, 1, 'form'.$htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm);
307 307
 				} elseif (preg_match('/^select;/', $typeofdata)) {
308 308
 					$arraydata = explode(',', preg_replace('/^select;/', '', $typeofdata));
309 309
 					$arraylist = array();
@@ -317,7 +317,7 @@  discard block
 block discarded – undo
317 317
 					// TODO Not yet implemented. See code for extrafields
318 318
 				} elseif (preg_match('/^ckeditor/', $typeofdata)) {
319 319
 					$tmp = explode(':', $typeofdata); // Example: ckeditor:dolibarr_zzz:width:height:savemethod:toolbarstartexpanded:rows:cols:uselocalbrowser
320
-					require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';
320
+					require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
321 321
 					$doleditor = new DolEditor($htmlname, ($editvalue ? $editvalue : $value), (empty($tmp[2]) ? '' : $tmp[2]), (empty($tmp[3]) ? 100 : (int) $tmp[3]), (empty($tmp[1]) ? 'dolibarr_notes' : $tmp[1]), 'In', (empty($tmp[5]) ? 0 : $tmp[5]), (isset($tmp[8]) ? ($tmp[8] ? true : false) : true), true, (empty($tmp[6]) ? 20 : (int) $tmp[6]), (empty($tmp[7]) ? '100' : $tmp[7]));
322 322
 					$ret .= $doleditor->Create(1);
323 323
 				} elseif ($typeofdata == 'asis') {
@@ -332,19 +332,19 @@  discard block
 block discarded – undo
332 332
 					$ret .= '<td>';
333 333
 				}
334 334
 				//else $ret.='<div class="clearboth"></div>';
335
-				$ret .= '<input type="submit" class="smallpaddingimp nomargingtop nomarginbottom button' . (empty($notabletag) ? '' : ' ') . '" name="modify" value="' . $langs->trans("Modify") . '">';
335
+				$ret .= '<input type="submit" class="smallpaddingimp nomargingtop nomarginbottom button'.(empty($notabletag) ? '' : ' ').'" name="modify" value="'.$langs->trans("Modify").'">';
336 336
 				if (preg_match('/ckeditor|textarea/', $typeofdata) && empty($notabletag)) {
337
-					$ret .= '<br>' . "\n";
337
+					$ret .= '<br>'."\n";
338 338
 				}
339
-				$ret .= '<input type="submit" class="smallpaddingimp nomargingtop nomarginbottom button button-cancel' . (empty($notabletag) ? '' : ' ') . '" name="cancel" value="' . $langs->trans("Cancel") . '">';
339
+				$ret .= '<input type="submit" class="smallpaddingimp nomargingtop nomarginbottom button button-cancel'.(empty($notabletag) ? '' : ' ').'" name="cancel" value="'.$langs->trans("Cancel").'">';
340 340
 				if (empty($notabletag)) {
341 341
 					$ret .= '</td>';
342 342
 				}
343 343
 
344 344
 				if (empty($notabletag)) {
345
-					$ret .= '</tr></table>' . "\n";
345
+					$ret .= '</tr></table>'."\n";
346 346
 				}
347
-				$ret .= '</form>' . "\n";
347
+				$ret .= '</form>'."\n";
348 348
 			} else {		// view mode
349 349
 				if (preg_match('/^email/', $typeofdata)) {
350 350
 					$ret .= dol_print_email($value, 0, 0, 0, 0, 1);
@@ -356,15 +356,15 @@  discard block
 block discarded – undo
356 356
 					$ret .= ($value != '' ? price($value, 0, $langs, 0, -1, -1, $conf->currency) : '');
357 357
 				} elseif (preg_match('/^checkbox/', $typeofdata)) {
358 358
 					$tmp = explode(':', $typeofdata);
359
-					$ret .= '<input type="checkbox" disabled id="' . $htmlname . '" name="' . $htmlname . '" value="' . $value . '"' . ($value ? ' checked' : '') . ($tmp[1] ? $tmp[1] : '') . '/>';
359
+					$ret .= '<input type="checkbox" disabled id="'.$htmlname.'" name="'.$htmlname.'" value="'.$value.'"'.($value ? ' checked' : '').($tmp[1] ? $tmp[1] : '').'/>';
360 360
 				} elseif (preg_match('/^text/', $typeofdata) || preg_match('/^note/', $typeofdata)) {
361 361
 					$ret .= dol_htmlwithnojs(dol_string_onlythesehtmltags(dol_htmlentitiesbr($value), 1, 1, 1));
362 362
 				} elseif (preg_match('/^(safehtmlstring|restricthtml)/', $typeofdata)) {	// 'restricthtml' is not an allowed type for editfieldval. Value is 'safehtmlstring'
363 363
 					$ret .= dol_htmlwithnojs(dol_string_onlythesehtmltags($value));
364 364
 				} elseif ($typeofdata == 'day' || $typeofdata == 'datepicker') {
365
-					$ret .= '<span class="valuedate">' . dol_print_date($value, 'day', $gm) . '</span>';
365
+					$ret .= '<span class="valuedate">'.dol_print_date($value, 'day', $gm).'</span>';
366 366
 				} elseif ($typeofdata == 'dayhour' || $typeofdata == 'datehourpicker') {
367
-					$ret .= '<span class="valuedate">' . dol_print_date($value, 'dayhour', $gm) . '</span>';
367
+					$ret .= '<span class="valuedate">'.dol_print_date($value, 'dayhour', $gm).'</span>';
368 368
 				} elseif (preg_match('/^select;/', $typeofdata)) {
369 369
 					$arraydata = explode(',', preg_replace('/^select;/', '', $typeofdata));
370 370
 					$arraylist = array();
@@ -375,9 +375,9 @@  discard block
 block discarded – undo
375 375
 					$ret .= $arraylist[$value];
376 376
 					if ($htmlname == 'fk_product_type') {
377 377
 						if ($value == 0) {
378
-							$ret = img_picto($langs->trans("Product"), 'product', 'class="paddingleftonly paddingrightonly colorgrey"') . $ret;
378
+							$ret = img_picto($langs->trans("Product"), 'product', 'class="paddingleftonly paddingrightonly colorgrey"').$ret;
379 379
 						} else {
380
-							$ret = img_picto($langs->trans("Service"), 'service', 'class="paddingleftonly paddingrightonly colorgrey"') . $ret;
380
+							$ret = img_picto($langs->trans("Service"), 'service', 'class="paddingleftonly paddingrightonly colorgrey"').$ret;
381 381
 						}
382 382
 					}
383 383
 				} elseif (preg_match('/^ckeditor/', $typeofdata)) {
@@ -385,7 +385,7 @@  discard block
 block discarded – undo
385 385
 					if (getDolGlobalString('MAIN_DISABLE_NOTES_TAB')) {
386 386
 						$firstline = preg_replace('/<br>.*/', '', $tmpcontent);
387 387
 						$firstline = preg_replace('/[\n\r].*/', '', $firstline);
388
-						$tmpcontent = $firstline . ((strlen($firstline) != strlen($tmpcontent)) ? '...' : '');
388
+						$tmpcontent = $firstline.((strlen($firstline) != strlen($tmpcontent)) ? '...' : '');
389 389
 					}
390 390
 					// We don't use dol_escape_htmltag to get the html formatting active, but this need we must also
391 391
 					// clean data from some dangerous html
@@ -394,7 +394,7 @@  discard block
 block discarded – undo
394 394
 					if (empty($moreoptions['valuealreadyhtmlescaped'])) {
395 395
 						$ret .= dol_escape_htmltag($value);
396 396
 					} else {
397
-						$ret .= $value;        // $value must be already html escaped.
397
+						$ret .= $value; // $value must be already html escaped.
398 398
 					}
399 399
 				}
400 400
 
@@ -432,7 +432,7 @@  discard block
 block discarded – undo
432 432
 
433 433
 		if (is_array($arrayoflangcode) && count($arrayoflangcode)) {
434 434
 			if (!is_object($extralanguages)) {
435
-				include_once DOL_DOCUMENT_ROOT . '/core/class/extralanguages.class.php';
435
+				include_once DOL_DOCUMENT_ROOT.'/core/class/extralanguages.class.php';
436 436
 				$extralanguages = new ExtraLanguages($this->db);
437 437
 			}
438 438
 			$extralanguages->fetch_name_extralanguages('societe');
@@ -441,17 +441,17 @@  discard block
 block discarded – undo
441 441
 				return ''; // No extralang field to show
442 442
 			}
443 443
 
444
-			$result .= '<!-- Widget for translation -->' . "\n";
445
-			$result .= '<div class="inline-block paddingleft image-' . $object->element . '-' . $fieldname . '">';
444
+			$result .= '<!-- Widget for translation -->'."\n";
445
+			$result .= '<div class="inline-block paddingleft image-'.$object->element.'-'.$fieldname.'">';
446 446
 			$s = img_picto($langs->trans("ShowOtherLanguages"), 'language', '', 0, 0, 0, '', 'fa-15 editfieldlang');
447 447
 			$result .= $s;
448 448
 			$result .= '</div>';
449 449
 
450
-			$result .= '<div class="inline-block hidden field-' . $object->element . '-' . $fieldname . '">';
450
+			$result .= '<div class="inline-block hidden field-'.$object->element.'-'.$fieldname.'">';
451 451
 
452 452
 			$resultforextrlang = '';
453 453
 			foreach ($arrayoflangcode as $langcode) {
454
-				$valuetoshow = GETPOSTISSET('field-' . $object->element . "-" . $fieldname . "-" . $langcode) ? GETPOST('field-' . $object->element . '-' . $fieldname . "-" . $langcode, $check) : '';
454
+				$valuetoshow = GETPOSTISSET('field-'.$object->element."-".$fieldname."-".$langcode) ? GETPOST('field-'.$object->element.'-'.$fieldname."-".$langcode, $check) : '';
455 455
 				if (empty($valuetoshow)) {
456 456
 					$object->fetchValuesForExtraLanguages();
457 457
 					//var_dump($object->array_languages);
@@ -463,17 +463,17 @@  discard block
 block discarded – undo
463 463
 
464 464
 				// TODO Use the showInputField() method of ExtraLanguages object
465 465
 				if ($typeofdata == 'textarea') {
466
-					$resultforextrlang .= '<textarea name="field-' . $object->element . "-" . $fieldname . "-" . $langcode . '" id="' . $fieldname . "-" . $langcode . '" class="' . $morecss . '" rows="' . ROWS_2 . '" wrap="soft">';
466
+					$resultforextrlang .= '<textarea name="field-'.$object->element."-".$fieldname."-".$langcode.'" id="'.$fieldname."-".$langcode.'" class="'.$morecss.'" rows="'.ROWS_2.'" wrap="soft">';
467 467
 					$resultforextrlang .= $valuetoshow;
468 468
 					$resultforextrlang .= '</textarea>';
469 469
 				} else {
470
-					$resultforextrlang .= '<input type="text" class="inputfieldforlang ' . ($morecss ? ' ' . $morecss : '') . '" name="field-' . $object->element . '-' . $fieldname . '-' . $langcode . '" value="' . $valuetoshow . '">';
470
+					$resultforextrlang .= '<input type="text" class="inputfieldforlang '.($morecss ? ' '.$morecss : '').'" name="field-'.$object->element.'-'.$fieldname.'-'.$langcode.'" value="'.$valuetoshow.'">';
471 471
 				}
472 472
 			}
473 473
 			$result .= $resultforextrlang;
474 474
 
475 475
 			$result .= '</div>';
476
-			$result .= '<script nonce="' . getNonce() . '">$(".image-' . $object->element . '-' . $fieldname . '").click(function() { console.log("Toggle lang widget"); jQuery(".field-' . $object->element . '-' . $fieldname . '").toggle(); });</script>';
476
+			$result .= '<script nonce="'.getNonce().'">$(".image-'.$object->element.'-'.$fieldname.'").click(function() { console.log("Toggle lang widget"); jQuery(".field-'.$object->element.'-'.$fieldname.'").toggle(); });</script>';
477 477
 		}
478 478
 
479 479
 		return $result;
@@ -536,7 +536,7 @@  discard block
 block discarded – undo
536 536
 				if (!empty($tmp[2])) {
537 537
 					$savemethod = $tmp[2];
538 538
 				}
539
-				$out .= '<input id="width_' . $htmlname . '" value="' . $inputOption . '" type="hidden"/>' . "\n";
539
+				$out .= '<input id="width_'.$htmlname.'" value="'.$inputOption.'" type="hidden"/>'."\n";
540 540
 			} elseif ((preg_match('/^day$/', $inputType)) || (preg_match('/^datepicker/', $inputType)) || (preg_match('/^datehourpicker/', $inputType))) {
541 541
 				$tmp = explode(':', $inputType);
542 542
 				$inputType = $tmp[0];
@@ -547,7 +547,7 @@  discard block
 block discarded – undo
547 547
 					$savemethod = $tmp[2];
548 548
 				}
549 549
 
550
-				$out .= '<input id="timestamp" type="hidden"/>' . "\n"; // Use for timestamp format
550
+				$out .= '<input id="timestamp" type="hidden"/>'."\n"; // Use for timestamp format
551 551
 			} elseif (preg_match('/^(select|autocomplete)/', $inputType)) {
552 552
 				$tmp = explode(':', $inputType);
553 553
 				$inputType = $tmp[0];
@@ -578,40 +578,40 @@  discard block
 block discarded – undo
578 578
 				}
579 579
 
580 580
 				if (isModEnabled('fckeditor')) {
581
-					$out .= '<input id="ckeditor_toolbar" value="' . $toolbar . '" type="hidden"/>' . "\n";
581
+					$out .= '<input id="ckeditor_toolbar" value="'.$toolbar.'" type="hidden"/>'."\n";
582 582
 				} else {
583 583
 					$inputType = 'textarea';
584 584
 				}
585 585
 			}
586 586
 
587
-			$out .= '<input id="element_' . $htmlname . '" value="' . $element . '" type="hidden"/>' . "\n";
588
-			$out .= '<input id="table_element_' . $htmlname . '" value="' . $table_element . '" type="hidden"/>' . "\n";
589
-			$out .= '<input id="fk_element_' . $htmlname . '" value="' . $fk_element . '" type="hidden"/>' . "\n";
590
-			$out .= '<input id="loadmethod_' . $htmlname . '" value="' . $loadmethod . '" type="hidden"/>' . "\n";
587
+			$out .= '<input id="element_'.$htmlname.'" value="'.$element.'" type="hidden"/>'."\n";
588
+			$out .= '<input id="table_element_'.$htmlname.'" value="'.$table_element.'" type="hidden"/>'."\n";
589
+			$out .= '<input id="fk_element_'.$htmlname.'" value="'.$fk_element.'" type="hidden"/>'."\n";
590
+			$out .= '<input id="loadmethod_'.$htmlname.'" value="'.$loadmethod.'" type="hidden"/>'."\n";
591 591
 			if (!empty($savemethod)) {
592
-				$out .= '<input id="savemethod_' . $htmlname . '" value="' . $savemethod . '" type="hidden"/>' . "\n";
592
+				$out .= '<input id="savemethod_'.$htmlname.'" value="'.$savemethod.'" type="hidden"/>'."\n";
593 593
 			}
594 594
 			if (!empty($ext_element)) {
595
-				$out .= '<input id="ext_element_' . $htmlname . '" value="' . $ext_element . '" type="hidden"/>' . "\n";
595
+				$out .= '<input id="ext_element_'.$htmlname.'" value="'.$ext_element.'" type="hidden"/>'."\n";
596 596
 			}
597 597
 			if (!empty($custommsg)) {
598 598
 				if (is_array($custommsg)) {
599 599
 					if (!empty($custommsg['success'])) {
600
-						$out .= '<input id="successmsg_' . $htmlname . '" value="' . $custommsg['success'] . '" type="hidden"/>' . "\n";
600
+						$out .= '<input id="successmsg_'.$htmlname.'" value="'.$custommsg['success'].'" type="hidden"/>'."\n";
601 601
 					}
602 602
 					if (!empty($custommsg['error'])) {
603
-						$out .= '<input id="errormsg_' . $htmlname . '" value="' . $custommsg['error'] . '" type="hidden"/>' . "\n";
603
+						$out .= '<input id="errormsg_'.$htmlname.'" value="'.$custommsg['error'].'" type="hidden"/>'."\n";
604 604
 					}
605 605
 				} else {
606
-					$out .= '<input id="successmsg_' . $htmlname . '" value="' . $custommsg . '" type="hidden"/>' . "\n";
606
+					$out .= '<input id="successmsg_'.$htmlname.'" value="'.$custommsg.'" type="hidden"/>'."\n";
607 607
 				}
608 608
 			}
609 609
 			if ($inputType == 'textarea') {
610
-				$out .= '<input id="textarea_' . $htmlname . '_rows" value="' . $rows . '" type="hidden"/>' . "\n";
611
-				$out .= '<input id="textarea_' . $htmlname . '_cols" value="' . $cols . '" type="hidden"/>' . "\n";
610
+				$out .= '<input id="textarea_'.$htmlname.'_rows" value="'.$rows.'" type="hidden"/>'."\n";
611
+				$out .= '<input id="textarea_'.$htmlname.'_cols" value="'.$cols.'" type="hidden"/>'."\n";
612 612
 			}
613
-			$out .= '<span id="viewval_' . $htmlname . '" class="viewval_' . $inputType . ($button_only ? ' inactive' : ' active') . '">' . $value . '</span>' . "\n";
614
-			$out .= '<span id="editval_' . $htmlname . '" class="editval_' . $inputType . ($button_only ? ' inactive' : ' active') . ' hideobject">' . (!empty($editvalue) ? $editvalue : $value) . '</span>' . "\n";
613
+			$out .= '<span id="viewval_'.$htmlname.'" class="viewval_'.$inputType.($button_only ? ' inactive' : ' active').'">'.$value.'</span>'."\n";
614
+			$out .= '<span id="editval_'.$htmlname.'" class="editval_'.$inputType.($button_only ? ' inactive' : ' active').' hideobject">'.(!empty($editvalue) ? $editvalue : $value).'</span>'."\n";
615 615
 		} else {
616 616
 			$out = $value;
617 617
 		}
@@ -640,12 +640,12 @@  discard block
 block discarded – undo
640 640
 	public function textwithtooltip($text, $htmltext, $tooltipon = 1, $direction = 0, $img = '', $extracss = '', $notabs = 3, $incbefore = '', $noencodehtmltext = 0, $tooltiptrigger = '', $forcenowrap = 0)
641 641
 	{
642 642
 		if ($incbefore) {
643
-			$text = $incbefore . $text;
643
+			$text = $incbefore.$text;
644 644
 		}
645 645
 		if (!$htmltext) {
646 646
 			return $text;
647 647
 		}
648
-		$direction = (int) $direction;    // For backward compatibility when $direction was set to '' instead of 0
648
+		$direction = (int) $direction; // For backward compatibility when $direction was set to '' instead of 0
649 649
 
650 650
 		$tag = 'td';
651 651
 		if ($notabs == 2) {
@@ -659,11 +659,11 @@  discard block
 block discarded – undo
659 659
 
660 660
 		$extrastyle = '';
661 661
 		if ($direction < 0) {
662
-			$extracss = ($extracss ? $extracss : '') . ($notabs != 3 ? ' inline-block' : '');
662
+			$extracss = ($extracss ? $extracss : '').($notabs != 3 ? ' inline-block' : '');
663 663
 			$extrastyle = 'padding: 0px; padding-left: 2px;';
664 664
 		}
665 665
 		if ($direction > 0) {
666
-			$extracss = ($extracss ? $extracss : '') . ($notabs != 3 ? ' inline-block' : '');
666
+			$extracss = ($extracss ? $extracss : '').($notabs != 3 ? ' inline-block' : '');
667 667
 			$extrastyle = 'padding: 0px; padding-right: 2px;';
668 668
 		}
669 669
 
@@ -676,53 +676,53 @@  discard block
 block discarded – undo
676 676
 			$htmltext = str_replace('"', '&quot;', $htmltext);
677 677
 		} else {
678 678
 			$classfortooltip = 'classfortooltiponclick';
679
-			$textfordialog .= '<div style="display: none;" id="idfortooltiponclick_' . $tooltiptrigger . '" class="classfortooltiponclicktext">' . $htmltext . '</div>';
679
+			$textfordialog .= '<div style="display: none;" id="idfortooltiponclick_'.$tooltiptrigger.'" class="classfortooltiponclicktext">'.$htmltext.'</div>';
680 680
 		}
681 681
 		if ($tooltipon == 2 || $tooltipon == 3) {
682
-			$paramfortooltipimg = ' class="' . $classfortooltip . ($notabs != 3 ? ' inline-block' : '') . ($extracss ? ' ' . $extracss : '') . '" style="padding: 0px;' . ($extrastyle ? ' ' . $extrastyle : '') . '"';
682
+			$paramfortooltipimg = ' class="'.$classfortooltip.($notabs != 3 ? ' inline-block' : '').($extracss ? ' '.$extracss : '').'" style="padding: 0px;'.($extrastyle ? ' '.$extrastyle : '').'"';
683 683
 			if ($tooltiptrigger == '') {
684
-				$paramfortooltipimg .= ' title="' . ($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)) . '"'; // Attribute to put on img tag to store tooltip
684
+				$paramfortooltipimg .= ' title="'.($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)).'"'; // Attribute to put on img tag to store tooltip
685 685
 			} else {
686
-				$paramfortooltipimg .= ' dolid="' . $tooltiptrigger . '"';
686
+				$paramfortooltipimg .= ' dolid="'.$tooltiptrigger.'"';
687 687
 			}
688 688
 		} else {
689
-			$paramfortooltipimg = ($extracss ? ' class="' . $extracss . '"' : '') . ($extrastyle ? ' style="' . $extrastyle . '"' : ''); // Attribute to put on td text tag
689
+			$paramfortooltipimg = ($extracss ? ' class="'.$extracss.'"' : '').($extrastyle ? ' style="'.$extrastyle.'"' : ''); // Attribute to put on td text tag
690 690
 		}
691 691
 		if ($tooltipon == 1 || $tooltipon == 3) {
692
-			$paramfortooltiptd = ' class="' . ($tooltipon == 3 ? 'cursorpointer ' : '') . $classfortooltip . ' inline-block' . ($extracss ? ' ' . $extracss : '') . '" style="padding: 0px;' . ($extrastyle ? ' ' . $extrastyle : '') . '" ';
692
+			$paramfortooltiptd = ' class="'.($tooltipon == 3 ? 'cursorpointer ' : '').$classfortooltip.' inline-block'.($extracss ? ' '.$extracss : '').'" style="padding: 0px;'.($extrastyle ? ' '.$extrastyle : '').'" ';
693 693
 			if ($tooltiptrigger == '') {
694
-				$paramfortooltiptd .= ' title="' . ($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)) . '"'; // Attribute to put on td tag to store tooltip
694
+				$paramfortooltiptd .= ' title="'.($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)).'"'; // Attribute to put on td tag to store tooltip
695 695
 			} else {
696
-				$paramfortooltiptd .= ' dolid="' . $tooltiptrigger . '"';
696
+				$paramfortooltiptd .= ' dolid="'.$tooltiptrigger.'"';
697 697
 			}
698 698
 		} else {
699
-			$paramfortooltiptd = ($extracss ? ' class="' . $extracss . '"' : '') . ($extrastyle ? ' style="' . $extrastyle . '"' : ''); // Attribute to put on td text tag
699
+			$paramfortooltiptd = ($extracss ? ' class="'.$extracss.'"' : '').($extrastyle ? ' style="'.$extrastyle.'"' : ''); // Attribute to put on td text tag
700 700
 		}
701 701
 		if (empty($notabs)) {
702 702
 			$s .= '<table class="nobordernopadding"><tr style="height: auto;">';
703 703
 		} elseif ($notabs == 2) {
704
-			$s .= '<div class="inline-block' . ($forcenowrap ? ' nowrap' : '') . '">';
704
+			$s .= '<div class="inline-block'.($forcenowrap ? ' nowrap' : '').'">';
705 705
 		}
706 706
 		// Define value if value is before
707 707
 		if ($direction < 0) {
708
-			$s .= '<' . $tag . $paramfortooltipimg;
708
+			$s .= '<'.$tag.$paramfortooltipimg;
709 709
 			if ($tag == 'td') {
710 710
 				$s .= ' class="valigntop" width="14"';
711 711
 			}
712
-			$s .= '>' . $textfordialog . $img . '</' . $tag . '>';
712
+			$s .= '>'.$textfordialog.$img.'</'.$tag.'>';
713 713
 		}
714 714
 		// Use another method to help avoid having a space in value in order to use this value with jquery
715 715
 		// Define label
716 716
 		if ((string) $text != '') {
717
-			$s .= '<' . $tag . $paramfortooltiptd . '>' . $text . '</' . $tag . '>';
717
+			$s .= '<'.$tag.$paramfortooltiptd.'>'.$text.'</'.$tag.'>';
718 718
 		}
719 719
 		// Define value if value is after
720 720
 		if ($direction > 0) {
721
-			$s .= '<' . $tag . $paramfortooltipimg;
721
+			$s .= '<'.$tag.$paramfortooltipimg;
722 722
 			if ($tag == 'td') {
723 723
 				$s .= ' class="valignmiddle" width="14"';
724 724
 			}
725
-			$s .= '>' . $textfordialog . $img . '</' . $tag . '>';
725
+			$s .= '>'.$textfordialog.$img.'</'.$tag.'>';
726 726
 		}
727 727
 		if (empty($notabs)) {
728 728
 			$s .= '</tr></table>';
@@ -829,7 +829,7 @@  discard block
 block discarded – undo
829 829
 
830 830
 		$disabled = 0;
831 831
 		$ret = '<div class="centpercent center">';
832
-		$ret .= '<select class="flat' . (empty($conf->use_javascript_ajax) ? '' : ' hideobject') . ' ' . $name . ' ' . $name . 'select valignmiddle alignstart" id="' . $name . '" name="' . $name . '"' . ($disabled ? ' disabled="disabled"' : '') . '>';
832
+		$ret .= '<select class="flat'.(empty($conf->use_javascript_ajax) ? '' : ' hideobject').' '.$name.' '.$name.'select valignmiddle alignstart" id="'.$name.'" name="'.$name.'"'.($disabled ? ' disabled="disabled"' : '').'>';
833 833
 
834 834
 		// Complete list with data from external modules. THe module can use $_SERVER['PHP_SELF'] to know on which page we are, or use the $parameters['currentcontext'] completed by executeHooks.
835 835
 		$parameters = array();
@@ -840,10 +840,10 @@  discard block
 block discarded – undo
840 840
 			return;
841 841
 		}
842 842
 		if (empty($reshook)) {
843
-			$ret .= '<option value="0"' . ($disabled ? ' disabled="disabled"' : '') . '>-- ' . $langs->trans("SelectAction") . ' --</option>';
843
+			$ret .= '<option value="0"'.($disabled ? ' disabled="disabled"' : '').'>-- '.$langs->trans("SelectAction").' --</option>';
844 844
 			if (is_array($arrayofaction)) {
845 845
 				foreach ($arrayofaction as $code => $label) {
846
-					$ret .= '<option value="' . $code . '"' . ($disabled ? ' disabled="disabled"' : '') . ' data-html="' . dol_escape_htmltag($label) . '">' . $label . '</option>';
846
+					$ret .= '<option value="'.$code.'"'.($disabled ? ' disabled="disabled"' : '').' data-html="'.dol_escape_htmltag($label).'">'.$label.'</option>';
847 847
 				}
848 848
 			}
849 849
 		}
@@ -852,17 +852,17 @@  discard block
 block discarded – undo
852 852
 		$ret .= '</select>';
853 853
 
854 854
 		if (empty($conf->dol_optimize_smallscreen)) {
855
-			$ret .= ajax_combobox('.' . $name . 'select');
855
+			$ret .= ajax_combobox('.'.$name.'select');
856 856
 		}
857 857
 
858 858
 		// Warning: if you set submit button to disabled, post using 'Enter' will no more work if there is no another input submit. So we add a hidden button
859 859
 		$ret .= '<input type="submit" name="confirmmassactioninvisible" style="display: none" tabindex="-1">'; // Hidden button BEFORE so it is the one used when we submit with ENTER.
860
-		$ret .= '<input type="submit" disabled name="confirmmassaction"' . (empty($conf->use_javascript_ajax) ? '' : ' style="display: none"') . ' class="reposition button smallpaddingimp' . (empty($conf->use_javascript_ajax) ? '' : ' hideobject') . ' ' . $name . ' ' . $name . 'confirmed" value="' . dol_escape_htmltag($langs->trans("Confirm")) . '">';
860
+		$ret .= '<input type="submit" disabled name="confirmmassaction"'.(empty($conf->use_javascript_ajax) ? '' : ' style="display: none"').' class="reposition button smallpaddingimp'.(empty($conf->use_javascript_ajax) ? '' : ' hideobject').' '.$name.' '.$name.'confirmed" value="'.dol_escape_htmltag($langs->trans("Confirm")).'">';
861 861
 		$ret .= '</div>';
862 862
 
863 863
 		if (!empty($conf->use_javascript_ajax)) {
864 864
 			$ret .= '<!-- JS CODE TO ENABLE mass action select -->
865
-    		<script nonce="' . getNonce() . '">
865
+    		<script nonce="' . getNonce().'">
866 866
                         function initCheckForSelect(mode, name, cssclass)	/* mode is 0 during init of page or click all, 1 when we click on 1 checkboxi, "name" refers to the class of the massaction button, "cssclass" to the class of the checkfor select boxes */
867 867
         		{
868 868
         			atleastoneselected=0;
@@ -873,11 +873,11 @@  discard block
 block discarded – undo
873 873
 
874 874
 					console.log("initCheckForSelect mode="+mode+" name="+name+" cssclass="+cssclass+" atleastoneselected="+atleastoneselected);
875 875
 
876
-    	  			if (atleastoneselected || ' . $alwaysvisible . ')
876
+    	  			if (atleastoneselected || ' . $alwaysvisible.')
877 877
     	  			{
878 878
                                     jQuery("."+name).show();
879
-        			    ' . ($selected ? 'if (atleastoneselected) { jQuery("."+name+"select").val("' . $selected . '").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', false); }' : '') . '
880
-        			    ' . ($selected ? 'if (! atleastoneselected) { jQuery("."+name+"select").val("0").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', true); } ' : '') . '
879
+        			    ' . ($selected ? 'if (atleastoneselected) { jQuery("."+name+"select").val("'.$selected.'").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', false); }' : '').'
880
+        			    ' . ($selected ? 'if (! atleastoneselected) { jQuery("."+name+"select").val("0").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', true); } ' : '').'
881 881
     	  			}
882 882
     	  			else
883 883
     	  			{
@@ -887,26 +887,26 @@  discard block
 block discarded – undo
887 887
         		}
888 888
 
889 889
         	jQuery(document).ready(function () {
890
-                    initCheckForSelect(0, "' . $name . '", "' . $cssclass . '");
891
-                    jQuery(".' . $cssclass . '").click(function() {
892
-                        initCheckForSelect(1, "' . $name . '", "' . $cssclass . '");
890
+                    initCheckForSelect(0, "' . $name.'", "'.$cssclass.'");
891
+                    jQuery(".' . $cssclass.'").click(function() {
892
+                        initCheckForSelect(1, "' . $name.'", "'.$cssclass.'");
893 893
                     });
894
-                    jQuery(".' . $name . 'select").change(function() {
894
+                    jQuery(".' . $name.'select").change(function() {
895 895
         				var massaction = $( this ).val();
896 896
         				var urlform = $( this ).closest("form").attr("action").replace("#show_files","");
897 897
         				if (massaction == "builddoc") {
898 898
                         	urlform = urlform + "#show_files";
899 899
     	            	}
900 900
         				$( this ).closest("form").attr("action", urlform);
901
-                    	console.log("we select a mass action name=' . $name . ' massaction="+massaction+" - "+urlform);
901
+                    	console.log("we select a mass action name=' . $name.' massaction="+massaction+" - "+urlform);
902 902
         	        	/* Warning: if you set submit button to disabled, post using Enter will no more work if there is no other button */
903 903
         				if ($(this).val() != \'0\') {
904
-                                        jQuery(".' . $name . 'confirmed").prop(\'disabled\', false);
905
-										jQuery(".' . $name . 'other").hide();	/* To disable if another div was open */
906
-                                        jQuery(".' . $name . '"+massaction).show();
904
+                                        jQuery(".' . $name.'confirmed").prop(\'disabled\', false);
905
+										jQuery(".' . $name.'other").hide();	/* To disable if another div was open */
906
+                                        jQuery(".' . $name.'"+massaction).show();
907 907
     	  				} else {
908
-                                        jQuery(".' . $name . 'confirmed").prop(\'disabled\', true);
909
-										jQuery(".' . $name . 'other").hide();	/* To disable any div open */
908
+                                        jQuery(".' . $name.'confirmed").prop(\'disabled\', true);
909
+										jQuery(".' . $name.'other").hide();	/* To disable any div open */
910 910
     	  				}
911 911
     	        });
912 912
         	});
@@ -949,14 +949,14 @@  discard block
 block discarded – undo
949 949
 		$atleastonefavorite = 0;
950 950
 
951 951
 		$sql = "SELECT rowid, code as code_iso, code_iso as code_iso3, label, favorite, eec";
952
-		$sql .= " FROM " . $this->db->prefix() . "c_country";
952
+		$sql .= " FROM ".$this->db->prefix()."c_country";
953 953
 		$sql .= " WHERE active > 0";
954 954
 		//$sql.= " ORDER BY code ASC";
955 955
 
956
-		dol_syslog(get_class($this) . "::select_country", LOG_DEBUG);
956
+		dol_syslog(get_class($this)."::select_country", LOG_DEBUG);
957 957
 		$resql = $this->db->query($sql);
958 958
 		if ($resql) {
959
-			$out .= '<select id="select' . $htmlname . '" class="flat maxwidth200onsmartphone selectcountry' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" ' . $htmloption . '>';
959
+			$out .= '<select id="select'.$htmlname.'" class="flat maxwidth200onsmartphone selectcountry'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" '.$htmloption.'>';
960 960
 			$num = $this->db->num_rows($resql);
961 961
 			$i = 0;
962 962
 			if ($num) {
@@ -966,7 +966,7 @@  discard block
 block discarded – undo
966 966
 					$countryArray[$i]['rowid'] = $obj->rowid;
967 967
 					$countryArray[$i]['code_iso'] = $obj->code_iso;
968 968
 					$countryArray[$i]['code_iso3'] = $obj->code_iso3;
969
-					$countryArray[$i]['label'] = ($obj->code_iso && $langs->transnoentitiesnoconv("Country" . $obj->code_iso) != "Country" . $obj->code_iso ? $langs->transnoentitiesnoconv("Country" . $obj->code_iso) : ($obj->label != '-' ? $obj->label : ''));
969
+					$countryArray[$i]['label'] = ($obj->code_iso && $langs->transnoentitiesnoconv("Country".$obj->code_iso) != "Country".$obj->code_iso ? $langs->transnoentitiesnoconv("Country".$obj->code_iso) : ($obj->label != '-' ? $obj->label : ''));
970 970
 					$countryArray[$i]['favorite'] = $obj->favorite;
971 971
 					$countryArray[$i]['eec'] = $obj->eec;
972 972
 					$favorite[$i] = $obj->favorite;
@@ -984,20 +984,20 @@  discard block
 block discarded – undo
984 984
 
985 985
 				if ($showempty) {
986 986
 					if (is_numeric($showempty)) {
987
-						$out .= '<option value="">&nbsp;</option>' . "\n";
987
+						$out .= '<option value="">&nbsp;</option>'."\n";
988 988
 					} else {
989
-						$out .= '<option value="-1">' . $langs->trans($showempty) . '</option>' . "\n";
989
+						$out .= '<option value="-1">'.$langs->trans($showempty).'</option>'."\n";
990 990
 					}
991 991
 				}
992 992
 
993 993
 				if ($addspecialentries) {    // Add dedicated entries for groups of countries
994 994
 					//if ($showempty) $out.= '<option value="" disabled class="selectoptiondisabledwhite">--------------</option>';
995
-					$out .= '<option value="special_allnotme"' . ($selected == 'special_allnotme' ? ' selected' : '') . '>' . $langs->trans("CountriesExceptMe", $langs->transnoentitiesnoconv("Country" . $mysoc->country_code)) . '</option>';
996
-					$out .= '<option value="special_eec"' . ($selected == 'special_eec' ? ' selected' : '') . '>' . $langs->trans("CountriesInEEC") . '</option>';
995
+					$out .= '<option value="special_allnotme"'.($selected == 'special_allnotme' ? ' selected' : '').'>'.$langs->trans("CountriesExceptMe", $langs->transnoentitiesnoconv("Country".$mysoc->country_code)).'</option>';
996
+					$out .= '<option value="special_eec"'.($selected == 'special_eec' ? ' selected' : '').'>'.$langs->trans("CountriesInEEC").'</option>';
997 997
 					if ($mysoc->isInEEC()) {
998
-						$out .= '<option value="special_eecnotme"' . ($selected == 'special_eecnotme' ? ' selected' : '') . '>' . $langs->trans("CountriesInEECExceptMe", $langs->transnoentitiesnoconv("Country" . $mysoc->country_code)) . '</option>';
998
+						$out .= '<option value="special_eecnotme"'.($selected == 'special_eecnotme' ? ' selected' : '').'>'.$langs->trans("CountriesInEECExceptMe", $langs->transnoentitiesnoconv("Country".$mysoc->country_code)).'</option>';
999 999
 					}
1000
-					$out .= '<option value="special_noteec"' . ($selected == 'special_noteec' ? ' selected' : '') . '>' . $langs->trans("CountriesNotInEEC") . '</option>';
1000
+					$out .= '<option value="special_noteec"'.($selected == 'special_noteec' ? ' selected' : '').'>'.$langs->trans("CountriesNotInEEC").'</option>';
1001 1001
 					$out .= '<option value="" disabled class="selectoptiondisabledwhite">------------</option>';
1002 1002
 				}
1003 1003
 
@@ -1025,20 +1025,20 @@  discard block
 block discarded – undo
1025 1025
 						$labeltoshow .= '&nbsp;';
1026 1026
 					}
1027 1027
 					if ($row['code_iso']) {
1028
-						$labeltoshow .= ' <span class="opacitymedium">(' . $row['code_iso'] . ')</span>';
1028
+						$labeltoshow .= ' <span class="opacitymedium">('.$row['code_iso'].')</span>';
1029 1029
 						if (empty($hideflags)) {
1030 1030
 							$tmpflag = picto_from_langcode($row['code_iso'], 'class="saturatemedium paddingrightonly"', 1);
1031
-							$labeltoshow = $tmpflag . ' ' . $labeltoshow;
1031
+							$labeltoshow = $tmpflag.' '.$labeltoshow;
1032 1032
 						}
1033 1033
 					}
1034 1034
 
1035 1035
 					if ($selected && $selected != '-1' && ($selected == $row['rowid'] || $selected == $row['code_iso'] || $selected == $row['code_iso3'] || $selected == $row['label'])) {
1036
-						$out .= '<option value="' . ($usecodeaskey ? ($usecodeaskey == 'code2' ? $row['code_iso'] : $row['code_iso3']) : $row['rowid']) . '" selected data-html="' . dol_escape_htmltag($labeltoshow) . '" data-eec="' . ((int) $row['eec']) . '">';
1036
+						$out .= '<option value="'.($usecodeaskey ? ($usecodeaskey == 'code2' ? $row['code_iso'] : $row['code_iso3']) : $row['rowid']).'" selected data-html="'.dol_escape_htmltag($labeltoshow).'" data-eec="'.((int) $row['eec']).'">';
1037 1037
 					} else {
1038
-						$out .= '<option value="' . ($usecodeaskey ? ($usecodeaskey == 'code2' ? $row['code_iso'] : $row['code_iso3']) : $row['rowid']) . '" data-html="' . dol_escape_htmltag($labeltoshow) . '" data-eec="' . ((int) $row['eec']) . '">';
1038
+						$out .= '<option value="'.($usecodeaskey ? ($usecodeaskey == 'code2' ? $row['code_iso'] : $row['code_iso3']) : $row['rowid']).'" data-html="'.dol_escape_htmltag($labeltoshow).'" data-eec="'.((int) $row['eec']).'">';
1039 1039
 					}
1040 1040
 					$out .= $labeltoshow;
1041
-					$out .= '</option>' . "\n";
1041
+					$out .= '</option>'."\n";
1042 1042
 				}
1043 1043
 			}
1044 1044
 			$out .= '</select>';
@@ -1047,8 +1047,8 @@  discard block
 block discarded – undo
1047 1047
 		}
1048 1048
 
1049 1049
 		// Make select dynamic
1050
-		include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
1051
-		$out .= ajax_combobox('select' . $htmlname, array(), 0, 0, 'resolve');
1050
+		include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
1051
+		$out .= ajax_combobox('select'.$htmlname, array(), 0, 0, 'resolve');
1052 1052
 
1053 1053
 		return $out;
1054 1054
 	}
@@ -1080,25 +1080,25 @@  discard block
 block discarded – undo
1080 1080
 		$incotermArray = array();
1081 1081
 
1082 1082
 		$sql = "SELECT rowid, code";
1083
-		$sql .= " FROM " . $this->db->prefix() . "c_incoterms";
1083
+		$sql .= " FROM ".$this->db->prefix()."c_incoterms";
1084 1084
 		$sql .= " WHERE active > 0";
1085 1085
 		$sql .= " ORDER BY code ASC";
1086 1086
 
1087
-		dol_syslog(get_class($this) . "::select_incoterm", LOG_DEBUG);
1087
+		dol_syslog(get_class($this)."::select_incoterm", LOG_DEBUG);
1088 1088
 		$resql = $this->db->query($sql);
1089 1089
 		if ($resql) {
1090 1090
 			if ($conf->use_javascript_ajax && !$forcecombo) {
1091
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
1091
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
1092 1092
 				$out .= ajax_combobox($htmlname, $events);
1093 1093
 			}
1094 1094
 
1095 1095
 			if (!empty($page)) {
1096
-				$out .= '<form method="post" action="' . $page . '">';
1096
+				$out .= '<form method="post" action="'.$page.'">';
1097 1097
 				$out .= '<input type="hidden" name="action" value="set_incoterms">';
1098
-				$out .= '<input type="hidden" name="token" value="' . newToken() . '">';
1098
+				$out .= '<input type="hidden" name="token" value="'.newToken().'">';
1099 1099
 			}
1100 1100
 
1101
-			$out .= '<select id="' . $htmlname . '" class="flat selectincoterm width75" name="' . $htmlname . '" ' . $htmloption . '>';
1101
+			$out .= '<select id="'.$htmlname.'" class="flat selectincoterm width75" name="'.$htmlname.'" '.$htmloption.'>';
1102 1102
 			$out .= '<option value="0">&nbsp;</option>';
1103 1103
 			$num = $this->db->num_rows($resql);
1104 1104
 			$i = 0;
@@ -1112,9 +1112,9 @@  discard block
 block discarded – undo
1112 1112
 
1113 1113
 				foreach ($incotermArray as $row) {
1114 1114
 					if ($selected && ($selected == $row['rowid'] || $selected == $row['code'])) {
1115
-						$out .= '<option value="' . $row['rowid'] . '" selected>';
1115
+						$out .= '<option value="'.$row['rowid'].'" selected>';
1116 1116
 					} else {
1117
-						$out .= '<option value="' . $row['rowid'] . '">';
1117
+						$out .= '<option value="'.$row['rowid'].'">';
1118 1118
 					}
1119 1119
 
1120 1120
 					if ($row['code']) {
@@ -1128,13 +1128,13 @@  discard block
 block discarded – undo
1128 1128
 			$out .= ajax_combobox($htmlname);
1129 1129
 
1130 1130
 			if ($conf->use_javascript_ajax && empty($disableautocomplete)) {
1131
-				$out .= ajax_multiautocompleter('location_incoterms', array(), DOL_URL_ROOT . '/core/ajax/locationincoterms.php') . "\n";
1131
+				$out .= ajax_multiautocompleter('location_incoterms', array(), DOL_URL_ROOT.'/core/ajax/locationincoterms.php')."\n";
1132 1132
 				$moreattrib .= ' autocomplete="off"';
1133 1133
 			}
1134
-			$out .= '<input id="location_incoterms" class="maxwidthonsmartphone type="text" name="location_incoterms" value="' . $location_incoterms . '">' . "\n";
1134
+			$out .= '<input id="location_incoterms" class="maxwidthonsmartphone type="text" name="location_incoterms" value="'.$location_incoterms.'">'."\n";
1135 1135
 
1136 1136
 			if (!empty($page)) {
1137
-				$out .= '<input type="submit" class="button valignmiddle smallpaddingimp nomargintop nomarginbottom" value="' . $langs->trans("Modify") . '"></form>';
1137
+				$out .= '<input type="submit" class="button valignmiddle smallpaddingimp nomargintop nomarginbottom" value="'.$langs->trans("Modify").'"></form>';
1138 1138
 			}
1139 1139
 		} else {
1140 1140
 			dol_print_error($this->db);
@@ -1166,9 +1166,9 @@  discard block
 block discarded – undo
1166 1166
 		if ($forceall == 1 || (empty($forceall) && isModEnabled("product") && isModEnabled("service"))
1167 1167
 			|| (empty($forceall) && !isModEnabled('product') && !isModEnabled('service'))) {
1168 1168
 			if (empty($hidetext)) {
1169
-				print $langs->trans("Type") . ': ';
1169
+				print $langs->trans("Type").': ';
1170 1170
 			}
1171
-			print '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="select_' . $htmlname . '" name="' . $htmlname . '">';
1171
+			print '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="select_'.$htmlname.'" name="'.$htmlname.'">';
1172 1172
 			if ($showempty) {
1173 1173
 				print '<option value="-1"';
1174 1174
 				if ($selected == -1) {
@@ -1187,28 +1187,28 @@  discard block
 block discarded – undo
1187 1187
 			if (0 == $selected || ($selected == -1 && getDolGlobalString('MAIN_FREE_PRODUCT_CHECKED_BY_DEFAULT') == 'product')) {
1188 1188
 				print ' selected';
1189 1189
 			}
1190
-			print '>' . $langs->trans("Product");
1190
+			print '>'.$langs->trans("Product");
1191 1191
 
1192 1192
 			print '<option value="1"';
1193 1193
 			if (1 == $selected || ($selected == -1 && getDolGlobalString('MAIN_FREE_PRODUCT_CHECKED_BY_DEFAULT') == 'service')) {
1194 1194
 				print ' selected';
1195 1195
 			}
1196
-			print '>' . $langs->trans("Service");
1196
+			print '>'.$langs->trans("Service");
1197 1197
 
1198 1198
 			print '</select>';
1199
-			print ajax_combobox('select_' . $htmlname);
1199
+			print ajax_combobox('select_'.$htmlname);
1200 1200
 			//if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1);
1201 1201
 		}
1202 1202
 		if ((empty($forceall) && !isModEnabled('product') && isModEnabled("service")) || $forceall == 3) {
1203 1203
 			print $langs->trans("Service");
1204
-			print '<input type="hidden" name="' . $htmlname . '" value="1">';
1204
+			print '<input type="hidden" name="'.$htmlname.'" value="1">';
1205 1205
 		}
1206 1206
 		if ((empty($forceall) && isModEnabled("product") && !isModEnabled('service')) || $forceall == 2) {
1207 1207
 			print $langs->trans("Product");
1208
-			print '<input type="hidden" name="' . $htmlname . '" value="0">';
1208
+			print '<input type="hidden" name="'.$htmlname.'" value="0">';
1209 1209
 		}
1210 1210
 		if ($forceall < 0) {    // This should happened only for contracts when both predefined product and service are disabled.
1211
-			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
1211
+			print '<input type="hidden" name="'.$htmlname.'" value="1">'; // By default we set on service for contract. If CONTRACT_SUPPORT_PRODUCTS is set, forceall should be 1 not -1
1212 1212
 		}
1213 1213
 	}
1214 1214
 
@@ -1234,7 +1234,7 @@  discard block
 block discarded – undo
1234 1234
 		$langs->load("trips");
1235 1235
 
1236 1236
 		$sql = "SELECT c.code, c.label";
1237
-		$sql .= " FROM " . $this->db->prefix() . "c_type_fees as c";
1237
+		$sql .= " FROM ".$this->db->prefix()."c_type_fees as c";
1238 1238
 		$sql .= " WHERE active > 0";
1239 1239
 
1240 1240
 		$resql = $this->db->query($sql);
@@ -1275,11 +1275,11 @@  discard block
 block discarded – undo
1275 1275
 		// phpcs:enable
1276 1276
 		global $user, $langs;
1277 1277
 
1278
-		dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG);
1278
+		dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG);
1279 1279
 
1280 1280
 		$this->load_cache_types_fees();
1281 1281
 
1282
-		print '<select id="select_' . $htmlname . '" class="flat" name="' . $htmlname . '">';
1282
+		print '<select id="select_'.$htmlname.'" class="flat" name="'.$htmlname.'">';
1283 1283
 		if ($showempty) {
1284 1284
 			print '<option value="-1"';
1285 1285
 			if ($selected == -1) {
@@ -1289,7 +1289,7 @@  discard block
 block discarded – undo
1289 1289
 		}
1290 1290
 
1291 1291
 		foreach ($this->cache_types_fees as $key => $value) {
1292
-			print '<option value="' . $key . '"';
1292
+			print '<option value="'.$key.'"';
1293 1293
 			if ($key == $selected) {
1294 1294
 				print ' selected';
1295 1295
 			}
@@ -1341,12 +1341,12 @@  discard block
 block discarded – undo
1341 1341
 				$ajaxoptions = array();
1342 1342
 			}
1343 1343
 
1344
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
1344
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
1345 1345
 
1346 1346
 			// No immediate load of all database
1347 1347
 			$placeholder = '';
1348 1348
 			if ($selected && empty($selected_input_value)) {
1349
-				require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
1349
+				require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
1350 1350
 				$societetmp = new Societe($this->db);
1351 1351
 				$societetmp->fetch($selected);
1352 1352
 				$selected_input_value = $societetmp->name;
@@ -1354,18 +1354,18 @@  discard block
 block discarded – undo
1354 1354
 			}
1355 1355
 
1356 1356
 			// mode 1
1357
-			$urloption = 'htmlname=' . urlencode((string) (str_replace('.', '_', $htmlname))) . '&outjson=1&filter=' . urlencode((string) ($filter)) . (empty($excludeids) ? '' : '&excludeids=' . implode(',', $excludeids)) . ($showtype ? '&showtype=' . urlencode((string) ($showtype)) : '') . ($showcode ? '&showcode=' . urlencode((string) ($showcode)) : '');
1357
+			$urloption = 'htmlname='.urlencode((string) (str_replace('.', '_', $htmlname))).'&outjson=1&filter='.urlencode((string) ($filter)).(empty($excludeids) ? '' : '&excludeids='.implode(',', $excludeids)).($showtype ? '&showtype='.urlencode((string) ($showtype)) : '').($showcode ? '&showcode='.urlencode((string) ($showcode)) : '');
1358 1358
 
1359 1359
 			$out .= '<!-- force css to be higher than dialog popup --><style type="text/css">.ui-autocomplete { z-index: 1010; }</style>';
1360 1360
 			if (empty($hidelabel)) {
1361
-				print $langs->trans("RefOrLabel") . ' : ';
1361
+				print $langs->trans("RefOrLabel").' : ';
1362 1362
 			} elseif ($hidelabel > 1) {
1363 1363
 				$placeholder = $langs->trans("RefOrLabel");
1364 1364
 				if ($hidelabel == 2) {
1365 1365
 					$out .= img_picto($langs->trans("Search"), 'search');
1366 1366
 				}
1367 1367
 			}
1368
-			$out .= '<input type="text" class="' . $morecss . '" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . ($placeholder ? ' placeholder="' . dol_escape_htmltag($placeholder) . '"' : '') . ' ' . (getDolGlobalString('THIRDPARTY_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />';
1368
+			$out .= '<input type="text" class="'.$morecss.'" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.($placeholder ? ' placeholder="'.dol_escape_htmltag($placeholder).'"' : '').' '.(getDolGlobalString('THIRDPARTY_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />';
1369 1369
 			if ($hidelabel == 3) {
1370 1370
 				$out .= img_picto($langs->trans("Search"), 'search');
1371 1371
 			}
@@ -1427,12 +1427,12 @@  discard block
 block discarded – undo
1427 1427
 				$events = array();
1428 1428
 			}
1429 1429
 
1430
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
1430
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
1431 1431
 
1432 1432
 			// No immediate load of all database
1433 1433
 			$placeholder = '';
1434 1434
 			if ($selected && empty($selected_input_value)) {
1435
-				require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php';
1435
+				require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
1436 1436
 				$contacttmp = new Contact($this->db);
1437 1437
 				$contacttmp->fetch($selected);
1438 1438
 				$selected_input_value = $contacttmp->getFullName($langs);
@@ -1443,11 +1443,11 @@  discard block
 block discarded – undo
1443 1443
 			}
1444 1444
 
1445 1445
 			// mode 1
1446
-			$urloption = 'htmlname=' . urlencode((string) (str_replace('.', '_', $htmlname))) . '&outjson=1&filter=' . urlencode((string) ($filter)) . (empty($exclude) ? '' : '&exclude=' . urlencode($exclude)) . ($showsoc ? '&showsoc=' . urlencode((string) ($showsoc)) : '');
1446
+			$urloption = 'htmlname='.urlencode((string) (str_replace('.', '_', $htmlname))).'&outjson=1&filter='.urlencode((string) ($filter)).(empty($exclude) ? '' : '&exclude='.urlencode($exclude)).($showsoc ? '&showsoc='.urlencode((string) ($showsoc)) : '');
1447 1447
 
1448 1448
 			$out .= '<!-- force css to be higher than dialog popup --><style type="text/css">.ui-autocomplete { z-index: 1010; }</style>';
1449 1449
 
1450
-			$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' : '') . ' />';
1450
+			$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' : '').' />';
1451 1451
 
1452 1452
 			$out .= ajax_event($htmlname, $events);
1453 1453
 
@@ -1544,30 +1544,30 @@  discard block
 block discarded – undo
1544 1544
 			$sql .= ", s.address, s.zip, s.town";
1545 1545
 			$sql .= ", dictp.code as country_code";
1546 1546
 		}
1547
-		$sql .= " FROM " . $this->db->prefix() . "societe as s";
1547
+		$sql .= " FROM ".$this->db->prefix()."societe as s";
1548 1548
 		if (getDolGlobalString('COMPANY_SHOW_ADDRESS_SELECTLIST')) {
1549
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "c_country as dictp ON dictp.rowid = s.fk_pays";
1549
+			$sql .= " LEFT JOIN ".$this->db->prefix()."c_country as dictp ON dictp.rowid = s.fk_pays";
1550 1550
 		}
1551 1551
 		if (!$user->hasRight('societe', 'client', 'voir')) {
1552
-			$sql .= ", " . $this->db->prefix() . "societe_commerciaux as sc";
1552
+			$sql .= ", ".$this->db->prefix()."societe_commerciaux as sc";
1553 1553
 		}
1554
-		$sql .= " WHERE s.entity IN (" . getEntity('societe') . ")";
1554
+		$sql .= " WHERE s.entity IN (".getEntity('societe').")";
1555 1555
 		if (!empty($user->socid)) {
1556
-			$sql .= " AND s.rowid = " . ((int) $user->socid);
1556
+			$sql .= " AND s.rowid = ".((int) $user->socid);
1557 1557
 		}
1558 1558
 		if ($filter) {
1559 1559
 			// $filter is safe because, if it contains '(' or ')', it has been sanitized by testSqlAndScriptInject() and forgeSQLFromUniversalSearchCriteria()
1560 1560
 			// if not, by testSqlAndScriptInject() only.
1561
-			$sql .= " AND (" . $filter . ")";
1561
+			$sql .= " AND (".$filter.")";
1562 1562
 		}
1563 1563
 		if (!$user->hasRight('societe', 'client', 'voir')) {
1564
-			$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " . ((int) $user->id);
1564
+			$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
1565 1565
 		}
1566 1566
 		if (getDolGlobalString('COMPANY_HIDE_INACTIVE_IN_COMBOBOX')) {
1567 1567
 			$sql .= " AND s.status <> 0";
1568 1568
 		}
1569 1569
 		if (!empty($excludeids)) {
1570
-			$sql .= " AND s.rowid NOT IN (" . $this->db->sanitize(implode(',', $excludeids)) . ")";
1570
+			$sql .= " AND s.rowid NOT IN (".$this->db->sanitize(implode(',', $excludeids)).")";
1571 1571
 		}
1572 1572
 		// Add where from hooks
1573 1573
 		$parameters = array();
@@ -1587,17 +1587,17 @@  discard block
 block discarded – undo
1587 1587
 				if ($i > 0) {
1588 1588
 					$sql .= " AND ";
1589 1589
 				}
1590
-				$sql .= "(s.nom LIKE '" . $this->db->escape($prefix . $crit) . "%')";
1590
+				$sql .= "(s.nom LIKE '".$this->db->escape($prefix.$crit)."%')";
1591 1591
 				$i++;
1592 1592
 			}
1593 1593
 			if (count($search_crit) > 1) {
1594 1594
 				$sql .= ")";
1595 1595
 			}
1596 1596
 			if (isModEnabled('barcode')) {
1597
-				$sql .= " OR s.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
1597
+				$sql .= " OR s.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'";
1598 1598
 			}
1599
-			$sql .= " OR s.code_client LIKE '" . $this->db->escape($prefix . $filterkey) . "%' OR s.code_fournisseur LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
1600
-			$sql .= " OR s.name_alias LIKE '" . $this->db->escape($prefix . $filterkey) . "%' OR s.tva_intra LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
1599
+			$sql .= " OR s.code_client LIKE '".$this->db->escape($prefix.$filterkey)."%' OR s.code_fournisseur LIKE '".$this->db->escape($prefix.$filterkey)."%'";
1600
+			$sql .= " OR s.name_alias LIKE '".$this->db->escape($prefix.$filterkey)."%' OR s.tva_intra LIKE '".$this->db->escape($prefix.$filterkey)."%'";
1601 1601
 			$sql .= ")";
1602 1602
 		}
1603 1603
 		$sql .= $this->db->order("nom", "ASC");
@@ -1608,7 +1608,7 @@  discard block
 block discarded – undo
1608 1608
 		$resql = $this->db->query($sql);
1609 1609
 		if ($resql) {
1610 1610
 			// Construct $out and $outarray
1611
-			$out .= '<select id="' . $htmlname . '" class="flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($moreparam ? ' ' . $moreparam : '') . ' name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . '>' . "\n";
1611
+			$out .= '<select id="'.$htmlname.'" class="flat'.($morecss ? ' '.$morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').'>'."\n";
1612 1612
 
1613 1613
 			$textifempty = (($showempty && !is_numeric($showempty)) ? $langs->trans($showempty) : '');
1614 1614
 			if (getDolGlobalString('COMPANY_USE_SEARCH_TO_SELECT')) {
@@ -1621,7 +1621,7 @@  discard block
 block discarded – undo
1621 1621
 				}
1622 1622
 			}
1623 1623
 			if ($showempty) {
1624
-				$out .= '<option value="-1" data-html="' . dol_escape_htmltag('<span class="opacitymedium">' . ($textifempty ? $textifempty : '&nbsp;') . '</span>') . '">' . $textifempty . '</option>' . "\n";
1624
+				$out .= '<option value="-1" data-html="'.dol_escape_htmltag('<span class="opacitymedium">'.($textifempty ? $textifempty : '&nbsp;').'</span>').'">'.$textifempty.'</option>'."\n";
1625 1625
 			}
1626 1626
 
1627 1627
 			$companytemp = new Societe($this->db);
@@ -1634,18 +1634,18 @@  discard block
 block discarded – undo
1634 1634
 					$label = '';
1635 1635
 					if ($showcode || getDolGlobalString('SOCIETE_ADD_REF_IN_LIST')) {
1636 1636
 						if (($obj->client) && (!empty($obj->code_client))) {
1637
-							$label = $obj->code_client . ' - ';
1637
+							$label = $obj->code_client.' - ';
1638 1638
 						}
1639 1639
 						if (($obj->fournisseur) && (!empty($obj->code_fournisseur))) {
1640
-							$label .= $obj->code_fournisseur . ' - ';
1640
+							$label .= $obj->code_fournisseur.' - ';
1641 1641
 						}
1642
-						$label .= ' ' . $obj->name;
1642
+						$label .= ' '.$obj->name;
1643 1643
 					} else {
1644 1644
 						$label = $obj->name;
1645 1645
 					}
1646 1646
 
1647 1647
 					if (!empty($obj->name_alias)) {
1648
-						$label .= ' (' . $obj->name_alias . ')';
1648
+						$label .= ' ('.$obj->name_alias.')';
1649 1649
 					}
1650 1650
 
1651 1651
 					if (getDolGlobalString('SOCIETE_SHOW_VAT_IN_LIST') && !empty($obj->tva_intra)) {
@@ -1660,7 +1660,7 @@  discard block
 block discarded – undo
1660 1660
 						$companytemp->fournisseur = $obj->fournisseur;
1661 1661
 						$tmptype = $companytemp->getTypeUrl(1, '', 0, 'span');
1662 1662
 						if ($tmptype) {
1663
-							$labelhtml .= ' ' . $tmptype;
1663
+							$labelhtml .= ' '.$tmptype;
1664 1664
 						}
1665 1665
 
1666 1666
 						if ($obj->client || $obj->fournisseur) {
@@ -1670,10 +1670,10 @@  discard block
 block discarded – undo
1670 1670
 							$label .= $langs->trans("Customer");
1671 1671
 						}
1672 1672
 						if ($obj->client == 2 || $obj->client == 3) {
1673
-							$label .= ($obj->client == 3 ? ', ' : '') . $langs->trans("Prospect");
1673
+							$label .= ($obj->client == 3 ? ', ' : '').$langs->trans("Prospect");
1674 1674
 						}
1675 1675
 						if ($obj->fournisseur) {
1676
-							$label .= ($obj->client ? ', ' : '') . $langs->trans("Supplier");
1676
+							$label .= ($obj->client ? ', ' : '').$langs->trans("Supplier");
1677 1677
 						}
1678 1678
 						if ($obj->client || $obj->fournisseur) {
1679 1679
 							$label .= ')';
@@ -1681,9 +1681,9 @@  discard block
 block discarded – undo
1681 1681
 					}
1682 1682
 
1683 1683
 					if (getDolGlobalString('COMPANY_SHOW_ADDRESS_SELECTLIST')) {
1684
-						$s = ($obj->address ? ' - ' . $obj->address : '') . ($obj->zip ? ' - ' . $obj->zip : '') . ($obj->town ? ' ' . $obj->town : '');
1684
+						$s = ($obj->address ? ' - '.$obj->address : '').($obj->zip ? ' - '.$obj->zip : '').($obj->town ? ' '.$obj->town : '');
1685 1685
 						if (!empty($obj->country_code)) {
1686
-							$s .= ', ' . $langs->trans('Country' . $obj->country_code);
1686
+							$s .= ', '.$langs->trans('Country'.$obj->country_code);
1687 1687
 						}
1688 1688
 						$label .= $s;
1689 1689
 						$labelhtml .= $s;
@@ -1691,9 +1691,9 @@  discard block
 block discarded – undo
1691 1691
 
1692 1692
 					if (empty($outputmode)) {
1693 1693
 						if (in_array($obj->rowid, $selected)) {
1694
-							$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>';
1694
+							$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>';
1695 1695
 						} else {
1696
-							$out .= '<option value="' . $obj->rowid . '" data-html="' . dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1) . '">' . dol_escape_htmltag($label, 0, 0, '', 0, 1) . '</option>';
1696
+							$out .= '<option value="'.$obj->rowid.'" data-html="'.dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1).'">'.dol_escape_htmltag($label, 0, 0, '', 0, 1).'</option>';
1697 1697
 						}
1698 1698
 					} else {
1699 1699
 						array_push($outarray, array('key' => $obj->rowid, 'value' => $label, 'label' => $label, 'labelhtml' => $labelhtml));
@@ -1705,9 +1705,9 @@  discard block
 block discarded – undo
1705 1705
 					}
1706 1706
 				}
1707 1707
 			}
1708
-			$out .= '</select>' . "\n";
1708
+			$out .= '</select>'."\n";
1709 1709
 			if (!$forcecombo) {
1710
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
1710
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
1711 1711
 				$out .= ajax_combobox($htmlname, $events, getDolGlobalInt("COMPANY_USE_SEARCH_TO_SELECT"));
1712 1712
 			}
1713 1713
 		} else {
@@ -1796,7 +1796,7 @@  discard block
 block discarded – undo
1796 1796
 		}
1797 1797
 
1798 1798
 		if (!is_object($hookmanager)) {
1799
-			include_once DOL_DOCUMENT_ROOT . '/core/class/hookmanager.class.php';
1799
+			include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
1800 1800
 			$hookmanager = new HookManager($this->db);
1801 1801
 		}
1802 1802
 
@@ -1805,13 +1805,13 @@  discard block
 block discarded – undo
1805 1805
 		if ($showsoc > 0 || getDolGlobalString('CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST')) {
1806 1806
 			$sql .= ", s.nom as company, s.town AS company_town";
1807 1807
 		}
1808
-		$sql .= " FROM " . $this->db->prefix() . "socpeople as sp";
1808
+		$sql .= " FROM ".$this->db->prefix()."socpeople as sp";
1809 1809
 		if ($showsoc > 0 || getDolGlobalString('CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST')) {
1810
-			$sql .= " LEFT OUTER JOIN  " . $this->db->prefix() . "societe as s ON s.rowid=sp.fk_soc";
1810
+			$sql .= " LEFT OUTER JOIN  ".$this->db->prefix()."societe as s ON s.rowid=sp.fk_soc";
1811 1811
 		}
1812
-		$sql .= " WHERE sp.entity IN (" . getEntity('contact') . ")";
1812
+		$sql .= " WHERE sp.entity IN (".getEntity('contact').")";
1813 1813
 		if ($socid > 0 || $socid == -1) {
1814
-			$sql .= " AND sp.fk_soc = " . ((int) $socid);
1814
+			$sql .= " AND sp.fk_soc = ".((int) $socid);
1815 1815
 		}
1816 1816
 		if (getDolGlobalString('CONTACT_HIDE_INACTIVE_IN_COMBOBOX')) {
1817 1817
 			$sql .= " AND sp.statut <> 0";
@@ -1819,7 +1819,7 @@  discard block
 block discarded – undo
1819 1819
 		if ($filter) {
1820 1820
 			// $filter is safe because, if it contains '(' or ')', it has been sanitized by testSqlAndScriptInject() and forgeSQLFromUniversalSearchCriteria()
1821 1821
 			// if not, by testSqlAndScriptInject() only.
1822
-			$sql .= " AND (" . $filter . ")";
1822
+			$sql .= " AND (".$filter.")";
1823 1823
 		}
1824 1824
 		// Add where from hooks
1825 1825
 		$parameters = array();
@@ -1827,30 +1827,30 @@  discard block
 block discarded – undo
1827 1827
 		$sql .= $hookmanager->resPrint;
1828 1828
 		$sql .= " ORDER BY sp.lastname ASC";
1829 1829
 
1830
-		dol_syslog(get_class($this) . "::selectcontacts", LOG_DEBUG);
1830
+		dol_syslog(get_class($this)."::selectcontacts", LOG_DEBUG);
1831 1831
 		$resql = $this->db->query($sql);
1832 1832
 		if ($resql) {
1833 1833
 			$num = $this->db->num_rows($resql);
1834 1834
 
1835 1835
 			if ($htmlname != 'none' && !$options_only) {
1836
-				$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlid . '" name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . (($num || empty($disableifempty)) ? '' : ' disabled') . ($multiple ? 'multiple' : '') . ' ' . (!empty($moreparam) ? $moreparam : '') . '>';
1836
+				$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="'.$htmlid.'" name="'.$htmlname.($multiple ? '[]' : '').'" '.(($num || empty($disableifempty)) ? '' : ' disabled').($multiple ? 'multiple' : '').' '.(!empty($moreparam) ? $moreparam : '').'>';
1837 1837
 			}
1838 1838
 
1839 1839
 			if ($showempty && !is_numeric($showempty)) {
1840 1840
 				$textforempty = $showempty;
1841
-				$out .= '<option class="optiongrey" value="-1"' . (in_array(-1, $selected) ? ' selected' : '') . '>' . $textforempty . '</option>';
1841
+				$out .= '<option class="optiongrey" value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'>'.$textforempty.'</option>';
1842 1842
 			} else {
1843 1843
 				if (($showempty == 1 || ($showempty == 3 && $num > 1)) && !$multiple) {
1844
-					$out .= '<option value="0"' . (in_array(0, $selected) ? ' selected' : '') . '>&nbsp;</option>';
1844
+					$out .= '<option value="0"'.(in_array(0, $selected) ? ' selected' : '').'>&nbsp;</option>';
1845 1845
 				}
1846 1846
 				if ($showempty == 2) {
1847
-					$out .= '<option value="0"' . (in_array(0, $selected) ? ' selected' : '') . '>-- ' . $langs->trans("Internal") . ' --</option>';
1847
+					$out .= '<option value="0"'.(in_array(0, $selected) ? ' selected' : '').'>-- '.$langs->trans("Internal").' --</option>';
1848 1848
 				}
1849 1849
 			}
1850 1850
 
1851 1851
 			$i = 0;
1852 1852
 			if ($num) {
1853
-				include_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php';
1853
+				include_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
1854 1854
 				$contactstatic = new Contact($this->db);
1855 1855
 
1856 1856
 				while ($i < $num) {
@@ -1886,7 +1886,7 @@  discard block
 block discarded – undo
1886 1886
 						}
1887 1887
 						$extendedInfos = implode(' - ', $extendedInfos);
1888 1888
 						if (!empty($extendedInfos)) {
1889
-							$extendedInfos = ' - ' . $extendedInfos;
1889
+							$extendedInfos = ' - '.$extendedInfos;
1890 1890
 						}
1891 1891
 					}
1892 1892
 
@@ -1904,35 +1904,35 @@  discard block
 block discarded – undo
1904 1904
 								$disabled = 1;
1905 1905
 							}
1906 1906
 							if (!empty($selected) && in_array($obj->rowid, $selected)) {
1907
-								$out .= '<option value="' . $obj->rowid . '"';
1907
+								$out .= '<option value="'.$obj->rowid.'"';
1908 1908
 								if ($disabled) {
1909 1909
 									$out .= ' disabled';
1910 1910
 								}
1911 1911
 								$out .= ' selected>';
1912 1912
 
1913
-								$tmplabel = $contactstatic->getFullName($langs) . $extendedInfos;
1913
+								$tmplabel = $contactstatic->getFullName($langs).$extendedInfos;
1914 1914
 								if ($showfunction && $obj->poste) {
1915
-									$tmplabel .= ' (' . $obj->poste . ')';
1915
+									$tmplabel .= ' ('.$obj->poste.')';
1916 1916
 								}
1917 1917
 								if (($showsoc > 0) && $obj->company) {
1918
-									$tmplabel .= ' - (' . $obj->company . ')';
1918
+									$tmplabel .= ' - ('.$obj->company.')';
1919 1919
 								}
1920 1920
 
1921 1921
 								$out .= $tmplabel;
1922 1922
 								$out .= '</option>';
1923 1923
 							} else {
1924
-								$out .= '<option value="' . $obj->rowid . '"';
1924
+								$out .= '<option value="'.$obj->rowid.'"';
1925 1925
 								if ($disabled) {
1926 1926
 									$out .= ' disabled';
1927 1927
 								}
1928 1928
 								$out .= '>';
1929 1929
 
1930
-								$tmplabel = $contactstatic->getFullName($langs) . $extendedInfos;
1930
+								$tmplabel = $contactstatic->getFullName($langs).$extendedInfos;
1931 1931
 								if ($showfunction && $obj->poste) {
1932
-									$tmplabel .= ' (' . $obj->poste . ')';
1932
+									$tmplabel .= ' ('.$obj->poste.')';
1933 1933
 								}
1934 1934
 								if (($showsoc > 0) && $obj->company) {
1935
-									$tmplabel .= ' - (' . $obj->company . ')';
1935
+									$tmplabel .= ' - ('.$obj->company.')';
1936 1936
 								}
1937 1937
 
1938 1938
 								$out .= $tmplabel;
@@ -1940,12 +1940,12 @@  discard block
 block discarded – undo
1940 1940
 							}
1941 1941
 						} else {
1942 1942
 							if (in_array($obj->rowid, $selected)) {
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;
@@ -1960,7 +1960,7 @@  discard block
 block discarded – undo
1960 1960
 				}
1961 1961
 			} else {
1962 1962
 				$labeltoshow = ($socid != -1) ? ($langs->trans($socid ? "NoContactDefinedForThirdParty" : "NoContactDefined")) : $langs->trans('SelectAThirdPartyFirst');
1963
-				$out .= '<option class="disabled" value="-1"' . (($showempty == 2 || $multiple) ? '' : ' selected') . ' disabled="disabled">';
1963
+				$out .= '<option class="disabled" value="-1"'.(($showempty == 2 || $multiple) ? '' : ' selected').' disabled="disabled">';
1964 1964
 				$out .= $labeltoshow;
1965 1965
 				$out .= '</option>';
1966 1966
 			}
@@ -1981,7 +1981,7 @@  discard block
 block discarded – undo
1981 1981
 			}
1982 1982
 
1983 1983
 			if ($conf->use_javascript_ajax && !$forcecombo && !$options_only) {
1984
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
1984
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
1985 1985
 				$out .= ajax_combobox($htmlid, $events, getDolGlobalInt("CONTACT_USE_SEARCH_TO_SELECT"));
1986 1986
 			}
1987 1987
 
@@ -2020,18 +2020,18 @@  discard block
 block discarded – undo
2020 2020
 		// On recherche les remises
2021 2021
 		$sql = "SELECT re.rowid, re.amount_ht, re.amount_tva, re.amount_ttc,";
2022 2022
 		$sql .= " re.description, re.fk_facture_source";
2023
-		$sql .= " FROM " . $this->db->prefix() . "societe_remise_except as re";
2024
-		$sql .= " WHERE re.fk_soc = " . (int) $socid;
2025
-		$sql .= " AND re.entity = " . $conf->entity;
2023
+		$sql .= " FROM ".$this->db->prefix()."societe_remise_except as re";
2024
+		$sql .= " WHERE re.fk_soc = ".(int) $socid;
2025
+		$sql .= " AND re.entity = ".$conf->entity;
2026 2026
 		if ($filter) {
2027
-			$sql .= " AND " . $filter;
2027
+			$sql .= " AND ".$filter;
2028 2028
 		}
2029 2029
 		$sql .= " ORDER BY re.description ASC";
2030 2030
 
2031
-		dol_syslog(get_class($this) . "::select_remises", LOG_DEBUG);
2031
+		dol_syslog(get_class($this)."::select_remises", LOG_DEBUG);
2032 2032
 		$resql = $this->db->query($sql);
2033 2033
 		if ($resql) {
2034
-			print '<select id="select_' . $htmlname . '" class="flat maxwidthonsmartphone" name="' . $htmlname . '">';
2034
+			print '<select id="select_'.$htmlname.'" class="flat maxwidthonsmartphone" name="'.$htmlname.'">';
2035 2035
 			$num = $this->db->num_rows($resql);
2036 2036
 
2037 2037
 			$qualifiedlines = $num;
@@ -2069,16 +2069,16 @@  discard block
 block discarded – undo
2069 2069
 					if (getDolGlobalString('MAIN_SHOW_FACNUMBER_IN_DISCOUNT_LIST') && !empty($obj->fk_facture_source)) {
2070 2070
 						$tmpfac = new Facture($this->db);
2071 2071
 						if ($tmpfac->fetch($obj->fk_facture_source) > 0) {
2072
-							$desc = $desc . ' - ' . $tmpfac->ref;
2072
+							$desc = $desc.' - '.$tmpfac->ref;
2073 2073
 						}
2074 2074
 					}
2075 2075
 
2076
-					print '<option value="' . $obj->rowid . '"' . $selectstring . $disabled . '>' . $desc . ' (' . price($obj->amount_ht) . ' ' . $langs->trans("HT") . ' - ' . price($obj->amount_ttc) . ' ' . $langs->trans("TTC") . ')</option>';
2076
+					print '<option value="'.$obj->rowid.'"'.$selectstring.$disabled.'>'.$desc.' ('.price($obj->amount_ht).' '.$langs->trans("HT").' - '.price($obj->amount_ttc).' '.$langs->trans("TTC").')</option>';
2077 2077
 					$i++;
2078 2078
 				}
2079 2079
 			}
2080 2080
 			print '</select>';
2081
-			print ajax_combobox('select_' . $htmlname);
2081
+			print ajax_combobox('select_'.$htmlname);
2082 2082
 
2083 2083
 			return $qualifiedlines;
2084 2084
 		} else {
@@ -2187,14 +2187,14 @@  discard block
 block discarded – undo
2187 2187
 		if ($showlabelofentity) {
2188 2188
 			$sql .= ", e.label";
2189 2189
 		}
2190
-		$sql .= " FROM " . $this->db->prefix() . "user as u";
2190
+		$sql .= " FROM ".$this->db->prefix()."user as u";
2191 2191
 		if ($showlabelofentity) {
2192
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "entity as e ON e.rowid = u.entity";
2192
+			$sql .= " LEFT JOIN ".$this->db->prefix()."entity as e ON e.rowid = u.entity";
2193 2193
 		}
2194 2194
 		// Condition here should be the same than into societe->getSalesRepresentatives().
2195 2195
 		if ($userissuperadminentityone && $force_entity != 'default') {
2196 2196
 			if (!empty($force_entity)) {
2197
-				$sql .= " WHERE u.entity IN (0, " . $this->db->sanitize($force_entity) . ")";
2197
+				$sql .= " WHERE u.entity IN (0, ".$this->db->sanitize($force_entity).")";
2198 2198
 			} else {
2199 2199
 				$sql .= " WHERE u.entity IS NOT NULL";
2200 2200
 			}
@@ -2202,18 +2202,18 @@  discard block
 block discarded – undo
2202 2202
 			if (isModEnabled('multicompany') && getDolGlobalInt('MULTICOMPANY_TRANSVERSE_MODE')) {
2203 2203
 				$sql .= " WHERE u.rowid IN (SELECT ug.fk_user FROM ".$this->db->prefix()."usergroup_user as ug WHERE ug.entity IN (".getEntity('usergroup')."))";
2204 2204
 			} else {
2205
-				$sql .= " WHERE u.entity IN (" . getEntity('user') . ")";
2205
+				$sql .= " WHERE u.entity IN (".getEntity('user').")";
2206 2206
 			}
2207 2207
 		}
2208 2208
 
2209 2209
 		if (!empty($user->socid)) {
2210
-			$sql .= " AND u.fk_soc = " . ((int) $user->socid);
2210
+			$sql .= " AND u.fk_soc = ".((int) $user->socid);
2211 2211
 		}
2212 2212
 		if (is_array($exclude) && $excludeUsers) {
2213
-			$sql .= " AND u.rowid NOT IN (" . $this->db->sanitize($excludeUsers) . ")";
2213
+			$sql .= " AND u.rowid NOT IN (".$this->db->sanitize($excludeUsers).")";
2214 2214
 		}
2215 2215
 		if ($includeUsers) {
2216
-			$sql .= " AND u.rowid IN (" . $this->db->sanitize($includeUsers) . ")";
2216
+			$sql .= " AND u.rowid IN (".$this->db->sanitize($includeUsers).")";
2217 2217
 		}
2218 2218
 		if (getDolGlobalString('USER_HIDE_INACTIVE_IN_COMBOBOX') || $notdisabled) {
2219 2219
 			$sql .= " AND u.statut <> 0";
@@ -2225,7 +2225,7 @@  discard block
 block discarded – undo
2225 2225
 			$sql .= " AND u.fk_soc IS NULL";
2226 2226
 		}
2227 2227
 		if (!empty($morefilter)) {
2228
-			$sql .= " " . $morefilter;
2228
+			$sql .= " ".$morefilter;
2229 2229
 		}
2230 2230
 
2231 2231
 		//Add hook to filter on user (for example on usergroup define in custom modules)
@@ -2240,7 +2240,7 @@  discard block
 block discarded – undo
2240 2240
 			$sql .= " ORDER BY u.statut DESC, u.lastname ASC, u.firstname ASC";
2241 2241
 		}
2242 2242
 
2243
-		dol_syslog(get_class($this) . "::select_dolusers", LOG_DEBUG);
2243
+		dol_syslog(get_class($this)."::select_dolusers", LOG_DEBUG);
2244 2244
 
2245 2245
 		$resql = $this->db->query($sql);
2246 2246
 		if ($resql) {
@@ -2248,7 +2248,7 @@  discard block
 block discarded – undo
2248 2248
 			$i = 0;
2249 2249
 			if ($num) {
2250 2250
 				// do not use maxwidthonsmartphone by default. Set it by caller so auto size to 100% will work when not defined
2251
-				$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : ' minwidth200') . '" id="' . $htmlname . '" name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . ' ' . ($disabled ? ' disabled' : '') . '>';
2251
+				$out .= '<select class="flat'.($morecss ? ' '.$morecss : ' minwidth200').'" id="'.$htmlname.'" name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.($disabled ? ' disabled' : '').'>';
2252 2252
 				if ($show_empty && !$multiple) {
2253 2253
 					$textforempty = ' ';
2254 2254
 					if (!empty($conf->use_javascript_ajax)) {
@@ -2257,7 +2257,7 @@  discard block
 block discarded – undo
2257 2257
 					if (!is_numeric($show_empty)) {
2258 2258
 						$textforempty = $show_empty;
2259 2259
 					}
2260
-					$out .= '<option class="optiongrey" value="' . ($show_empty < 0 ? $show_empty : -1) . '"' . ((empty($selected) || in_array(-1, $selected)) ? ' selected' : '') . '>' . $textforempty . '</option>' . "\n";
2260
+					$out .= '<option class="optiongrey" value="'.($show_empty < 0 ? $show_empty : -1).'"'.((empty($selected) || in_array(-1, $selected)) ? ' selected' : '').'>'.$textforempty.'</option>'."\n";
2261 2261
 
2262 2262
 					$outarray[($show_empty < 0 ? $show_empty : -1)] = $textforempty;
2263 2263
 					$outarray2[($show_empty < 0 ? $show_empty : -1)] = array(
@@ -2269,13 +2269,13 @@  discard block
 block discarded – undo
2269 2269
 					);
2270 2270
 				}
2271 2271
 				if ($show_every) {
2272
-					$out .= '<option value="-2"' . ((in_array(-2, $selected)) ? ' selected' : '') . '>-- ' . $langs->trans("Everybody") . ' --</option>' . "\n";
2272
+					$out .= '<option value="-2"'.((in_array(-2, $selected)) ? ' selected' : '').'>-- '.$langs->trans("Everybody").' --</option>'."\n";
2273 2273
 
2274
-					$outarray[-2] = '-- ' . $langs->trans("Everybody") . ' --';
2274
+					$outarray[-2] = '-- '.$langs->trans("Everybody").' --';
2275 2275
 					$outarray2[-2] = array(
2276 2276
 						'id' => -2,
2277
-						'label' => '-- ' . $langs->trans("Everybody") . ' --',
2278
-						'labelhtml' => '-- ' . $langs->trans("Everybody") . ' --',
2277
+						'label' => '-- '.$langs->trans("Everybody").' --',
2278
+						'labelhtml' => '-- '.$langs->trans("Everybody").' --',
2279 2279
 						'color' => '',
2280 2280
 						'picto' => ''
2281 2281
 					);
@@ -2326,21 +2326,21 @@  discard block
 block discarded – undo
2326 2326
 					}
2327 2327
 					if ($showstatus >= 0) {
2328 2328
 						if ($obj->status == 1 && $showstatus == 1) {
2329
-							$moreinfo .= ($moreinfo ? ' - ' : ' (') . $langs->trans('Enabled');
2330
-							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . $langs->trans('Enabled');
2329
+							$moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans('Enabled');
2330
+							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').$langs->trans('Enabled');
2331 2331
 						}
2332 2332
 						if ($obj->status == 0 && $showstatus == 1) {
2333
-							$moreinfo .= ($moreinfo ? ' - ' : ' (') . $langs->trans('Disabled');
2334
-							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . $langs->trans('Disabled');
2333
+							$moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans('Disabled');
2334
+							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').$langs->trans('Disabled');
2335 2335
 						}
2336 2336
 					}
2337 2337
 					if ($showlabelofentity) {
2338 2338
 						if (empty($obj->entity)) {
2339
-							$moreinfo .= ($moreinfo ? ' - ' : ' (') . $langs->trans("AllEntities");
2340
-							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . $langs->trans("AllEntities");
2339
+							$moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans("AllEntities");
2340
+							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').$langs->trans("AllEntities");
2341 2341
 						} else {
2342 2342
 							if ($obj->entity != $conf->entity) {
2343
-								$moreinfo .= ($moreinfo ? ' - ' : ' (') . ($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined"));
2343
+								$moreinfo .= ($moreinfo ? ' - ' : ' (').($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined"));
2344 2344
 								$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined"));
2345 2345
 							}
2346 2346
 						}
@@ -2349,13 +2349,13 @@  discard block
 block discarded – undo
2349 2349
 					$moreinfohtml .= (!empty($moreinfohtml) ? ')</span>' : '');
2350 2350
 					if (!empty($disableline) && $disableline != '1') {
2351 2351
 						// Add text from $enableonlytext parameter
2352
-						$moreinfo .= ' - ' . $disableline;
2353
-						$moreinfohtml .= ' - ' . $disableline;
2352
+						$moreinfo .= ' - '.$disableline;
2353
+						$moreinfohtml .= ' - '.$disableline;
2354 2354
 					}
2355 2355
 					$labeltoshow .= $moreinfo;
2356 2356
 					$labeltoshowhtml .= $moreinfohtml;
2357 2357
 
2358
-					$out .= '<option value="' . $obj->rowid . '"';
2358
+					$out .= '<option value="'.$obj->rowid.'"';
2359 2359
 					if (!empty($disableline)) {
2360 2360
 						$out .= ' disabled';
2361 2361
 					}
@@ -2364,7 +2364,7 @@  discard block
 block discarded – undo
2364 2364
 					}
2365 2365
 					$out .= ' data-html="';
2366 2366
 
2367
-					$outhtml = $userstatic->getNomUrl(-3, '', 0, 1, 24, 1, 'login', '', 1) . ' ';
2367
+					$outhtml = $userstatic->getNomUrl(-3, '', 0, 1, 24, 1, 'login', '', 1).' ';
2368 2368
 					if ($showstatus >= 0 && $obj->status == 0) {
2369 2369
 						$outhtml .= '<strike class="opacitymediumxxx">';
2370 2370
 					}
@@ -2379,7 +2379,7 @@  discard block
 block discarded – undo
2379 2379
 					$out .= $labeltoshow;
2380 2380
 					$out .= '</option>';
2381 2381
 
2382
-					$outarray[$userstatic->id] = $userstatic->getFullName($langs, $fullNameMode, -1, $maxlength) . $moreinfo;
2382
+					$outarray[$userstatic->id] = $userstatic->getFullName($langs, $fullNameMode, -1, $maxlength).$moreinfo;
2383 2383
 					$outarray2[$userstatic->id] = array(
2384 2384
 						'id' => $userstatic->id,
2385 2385
 						'label' => $labeltoshow,
@@ -2391,14 +2391,14 @@  discard block
 block discarded – undo
2391 2391
 					$i++;
2392 2392
 				}
2393 2393
 			} else {
2394
-				$out .= '<select class="flat" id="' . $htmlname . '" name="' . $htmlname . '" disabled>';
2395
-				$out .= '<option value="">' . $langs->trans("None") . '</option>';
2394
+				$out .= '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'" disabled>';
2395
+				$out .= '<option value="">'.$langs->trans("None").'</option>';
2396 2396
 			}
2397 2397
 			$out .= '</select>';
2398 2398
 
2399 2399
 			if ($num && !$forcecombo) {
2400 2400
 				// Enhance with select2
2401
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
2401
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
2402 2402
 				$out .= ajax_combobox($htmlname);
2403 2403
 			}
2404 2404
 		} else {
@@ -2474,16 +2474,16 @@  discard block
 block discarded – undo
2474 2474
 			$out .= $userstatic->getNomUrl(-1);
2475 2475
 			if ($i == 0) {
2476 2476
 				$ownerid = $value['id'];
2477
-				$out .= ' (' . $langs->trans("Owner") . ')';
2477
+				$out .= ' ('.$langs->trans("Owner").')';
2478 2478
 			}
2479 2479
 			if ($nbassignetouser > 1 && $action != 'view') {
2480
-				$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 . '">';
2480
+				$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.'">';
2481 2481
 			}
2482 2482
 			// Show my availability
2483 2483
 			if ($showproperties) {
2484 2484
 				if ($ownerid == $value['id'] && is_array($listofuserid) && count($listofuserid) && in_array($ownerid, array_keys($listofuserid))) {
2485 2485
 					$out .= '<div class="myavailability inline-block">';
2486
-					$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>';
2486
+					$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>';
2487 2487
 					$out .= '</div>';
2488 2488
 				}
2489 2489
 			}
@@ -2500,15 +2500,15 @@  discard block
 block discarded – undo
2500 2500
 		// Method with no ajax
2501 2501
 		if ($action != 'view') {
2502 2502
 			$out .= '<input type="hidden" class="removedassignedhidden" name="removedassigned" value="">';
2503
-			$out .= '<script nonce="' . getNonce() . '" type="text/javascript">jQuery(document).ready(function () {';
2503
+			$out .= '<script nonce="'.getNonce().'" type="text/javascript">jQuery(document).ready(function () {';
2504 2504
 			$out .= 'jQuery(".removedassigned").click(function() { jQuery(".removedassignedhidden").val(jQuery(this).val()); });';
2505 2505
 			$out .= 'jQuery(".assignedtouser").change(function() { console.log(jQuery(".assignedtouser option:selected").val());';
2506
-			$out .= ' if (jQuery(".assignedtouser option:selected").val() > 0) { jQuery("#' . $action . 'assignedtouser").attr("disabled", false); }';
2507
-			$out .= ' else { jQuery("#' . $action . 'assignedtouser").attr("disabled", true); }';
2506
+			$out .= ' if (jQuery(".assignedtouser option:selected").val() > 0) { jQuery("#'.$action.'assignedtouser").attr("disabled", false); }';
2507
+			$out .= ' else { jQuery("#'.$action.'assignedtouser").attr("disabled", true); }';
2508 2508
 			$out .= '});';
2509 2509
 			$out .= '})</script>';
2510 2510
 			$out .= $this->select_dolusers('', $htmlname, $show_empty, $exclude, $disabled, $include, $enableonly, $force_entity, $maxlength, $showstatus, $morefilter);
2511
-			$out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="' . $action . 'assignedtouser" name="' . $action . 'assignedtouser" value="' . dol_escape_htmltag($langs->trans("Add")) . '">';
2511
+			$out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="'.$action.'assignedtouser" name="'.$action.'assignedtouser" value="'.dol_escape_htmltag($langs->trans("Add")).'">';
2512 2512
 			$out .= '<br>';
2513 2513
 		}
2514 2514
 
@@ -2567,13 +2567,13 @@  discard block
 block discarded – undo
2567 2567
 			$resourcestatic->fetch($value['id']);
2568 2568
 			$out .= $resourcestatic->getNomUrl(-1);
2569 2569
 			if ($nbassignetoresource > 1 && $action != 'view') {
2570
-				$out .= ' <input type="image" style="border: 0px;" src="' . img_picto($langs->trans("Remove"), 'delete', '', 0, 1) . '" value="' . $resourcestatic->id . '" class="removedassigned reposition" id="removedassignedresource_' . $resourcestatic->id . '" name="removedassignedresource_' . $resourcestatic->id . '">';
2570
+				$out .= ' <input type="image" style="border: 0px;" src="'.img_picto($langs->trans("Remove"), 'delete', '', 0, 1).'" value="'.$resourcestatic->id.'" class="removedassigned reposition" id="removedassignedresource_'.$resourcestatic->id.'" name="removedassignedresource_'.$resourcestatic->id.'">';
2571 2571
 			}
2572 2572
 			// Show my availability
2573 2573
 			if ($showproperties) {
2574 2574
 				if (is_array($listofresourceid) && count($listofresourceid)) {
2575 2575
 					$out .= '<div class="myavailability inline-block">';
2576
-					$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>';
2576
+					$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>';
2577 2577
 					$out .= '</div>';
2578 2578
 				}
2579 2579
 			}
@@ -2590,11 +2590,11 @@  discard block
 block discarded – undo
2590 2590
 		// Method with no ajax
2591 2591
 		if ($action != 'view') {
2592 2592
 			$out .= '<input type="hidden" class="removedassignedhidden" name="removedassignedresource" value="">';
2593
-			$out .= '<script nonce="' . getNonce() . '" type="text/javascript">jQuery(document).ready(function () {';
2593
+			$out .= '<script nonce="'.getNonce().'" type="text/javascript">jQuery(document).ready(function () {';
2594 2594
 			$out .= 'jQuery(".removedassignedresource").click(function() { jQuery(".removedassignedresourcehidden").val(jQuery(this).val()); });';
2595 2595
 			$out .= 'jQuery(".assignedtoresource").change(function() { console.log(jQuery(".assignedtoresource option:selected").val());';
2596
-			$out .= ' if (jQuery(".assignedtoresource option:selected").val() > 0) { jQuery("#' . $action . 'assignedtoresource").attr("disabled", false); }';
2597
-			$out .= ' else { jQuery("#' . $action . 'assignedtoresource").attr("disabled", true); }';
2596
+			$out .= ' if (jQuery(".assignedtoresource option:selected").val() > 0) { jQuery("#'.$action.'assignedtoresource").attr("disabled", false); }';
2597
+			$out .= ' else { jQuery("#'.$action.'assignedtoresource").attr("disabled", true); }';
2598 2598
 			$out .= '});';
2599 2599
 			$out .= '})</script>';
2600 2600
 
@@ -2602,7 +2602,7 @@  discard block
 block discarded – undo
2602 2602
 			$out .= img_picto('', 'resource', 'class="pictofixedwidth"');
2603 2603
 			$out .= $formresources->select_resource_list(0, $htmlname, [], 1, 1, 0, $events, array(), 2, 0);
2604 2604
 			//$out .= $this->select_dolusers('', $htmlname, $show_empty, $exclude, $disabled, $include, $enableonly, $force_entity, $maxlength, $showstatus, $morefilter);
2605
-			$out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="' . $action . 'assignedtoresource" name="' . $action . 'assignedtoresource" value="' . dol_escape_htmltag($langs->trans("Add")) . '">';
2605
+			$out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="'.$action.'assignedtoresource" name="'.$action.'assignedtoresource" value="'.dol_escape_htmltag($langs->trans("Add")).'">';
2606 2606
 			$out .= '<br>';
2607 2607
 		}
2608 2608
 
@@ -2666,7 +2666,7 @@  discard block
 block discarded – undo
2666 2666
 			$placeholder = '';
2667 2667
 
2668 2668
 			if ($selected && empty($selected_input_value)) {
2669
-				require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
2669
+				require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
2670 2670
 				$producttmpselect = new Product($this->db);
2671 2671
 				$producttmpselect->fetch($selected);
2672 2672
 				$selected_input_value = $producttmpselect->ref;
@@ -2681,20 +2681,20 @@  discard block
 block discarded – undo
2681 2681
 				}
2682 2682
 			}
2683 2683
 			// mode=1 means customers products
2684
-			$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;
2684
+			$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;
2685 2685
 			if ((int) $warehouseId > 0) {
2686
-				$urloption .= '&warehouseid=' . (int) $warehouseId;
2686
+				$urloption .= '&warehouseid='.(int) $warehouseId;
2687 2687
 			}
2688
-			$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);
2688
+			$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);
2689 2689
 
2690 2690
 			if (isModEnabled('variants') && is_array($selected_combinations)) {
2691 2691
 				// Code to automatically insert with javascript the select of attributes under the select of product
2692 2692
 				// when a parent of variant has been selected.
2693 2693
 				$out .= '
2694 2694
 				<!-- script to auto show attributes select tags if a variant was selected -->
2695
-				<script nonce="' . getNonce() . '">
2695
+				<script nonce="' . getNonce().'">
2696 2696
 					// auto show attributes fields
2697
-					selected = ' . json_encode($selected_combinations) . ';
2697
+					selected = ' . json_encode($selected_combinations).';
2698 2698
 					combvalues = {};
2699 2699
 
2700 2700
 					jQuery(document).ready(function () {
@@ -2705,7 +2705,7 @@  discard block
 block discarded – undo
2705 2705
 							}
2706 2706
 						});
2707 2707
 
2708
-						jQuery("input#' . $htmlname . '").change(function () {
2708
+						jQuery("input#' . $htmlname.'").change(function () {
2709 2709
 
2710 2710
 							if (!jQuery(this).val()) {
2711 2711
 								jQuery(\'div#attributes_box\').empty();
@@ -2714,7 +2714,7 @@  discard block
 block discarded – undo
2714 2714
 
2715 2715
 							console.log("A change has started. We get variants fields to inject html select");
2716 2716
 
2717
-							jQuery.getJSON("' . DOL_URL_ROOT . '/variants/ajax/getCombinations.php", {
2717
+							jQuery.getJSON("' . DOL_URL_ROOT.'/variants/ajax/getCombinations.php", {
2718 2718
 								id: jQuery(this).val()
2719 2719
 							}, function (data) {
2720 2720
 								jQuery(\'div#attributes_box\').empty();
@@ -2757,21 +2757,21 @@  discard block
 block discarded – undo
2757 2757
 							})
2758 2758
 						});
2759 2759
 
2760
-						' . ($selected ? 'jQuery("input#' . $htmlname . '").change();' : '') . '
2760
+						' . ($selected ? 'jQuery("input#'.$htmlname.'").change();' : '').'
2761 2761
 					});
2762 2762
 				</script>
2763 2763
                 ';
2764 2764
 			}
2765 2765
 
2766 2766
 			if (empty($hidelabel)) {
2767
-				$out .= $langs->trans("RefOrLabel") . ' : ';
2767
+				$out .= $langs->trans("RefOrLabel").' : ';
2768 2768
 			} elseif ($hidelabel > 1) {
2769
-				$placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"';
2769
+				$placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"';
2770 2770
 				if ($hidelabel == 2) {
2771 2771
 					$out .= img_picto($langs->trans("Search"), 'search');
2772 2772
 				}
2773 2773
 			}
2774
-			$out .= '<input type="text" class="minwidth100' . ($morecss ? ' ' . $morecss : '') . '" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />';
2774
+			$out .= '<input type="text" class="minwidth100'.($morecss ? ' '.$morecss : '').'" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />';
2775 2775
 			if ($hidelabel == 3) {
2776 2776
 				$out .= img_picto($langs->trans("Search"), 'search');
2777 2777
 			}
@@ -2808,33 +2808,33 @@  discard block
 block discarded – undo
2808 2808
 		// phpcs:enable
2809 2809
 		global $db;
2810 2810
 
2811
-		require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
2811
+		require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
2812 2812
 
2813 2813
 		$error = 0;
2814 2814
 		$out = '';
2815 2815
 
2816 2816
 		if (!$forcecombo) {
2817
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
2817
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
2818 2818
 			$events = array();
2819 2819
 			$out .= ajax_combobox($htmlname, $events, getDolGlobalInt("PRODUIT_USE_SEARCH_TO_SELECT"));
2820 2820
 		}
2821 2821
 
2822
-		$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
2822
+		$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
2823 2823
 
2824 2824
 		$sql = 'SELECT b.rowid, b.ref, b.label, b.fk_product';
2825
-		$sql .= ' FROM ' . MAIN_DB_PREFIX . 'bom_bom as b';
2826
-		$sql .= ' WHERE b.entity IN (' . getEntity('bom') . ')';
2825
+		$sql .= ' FROM '.MAIN_DB_PREFIX.'bom_bom as b';
2826
+		$sql .= ' WHERE b.entity IN ('.getEntity('bom').')';
2827 2827
 		if (!empty($status)) {
2828
-			$sql .= ' AND status = ' . (int) $status;
2828
+			$sql .= ' AND status = '.(int) $status;
2829 2829
 		}
2830 2830
 		if (!empty($type)) {
2831
-			$sql .= ' AND bomtype = ' . (int) $type;
2831
+			$sql .= ' AND bomtype = '.(int) $type;
2832 2832
 		}
2833 2833
 		if (!empty($TProducts)) {
2834
-			$sql .= ' AND fk_product IN (' . $this->db->sanitize(implode(',', $TProducts)) . ')';
2834
+			$sql .= ' AND fk_product IN ('.$this->db->sanitize(implode(',', $TProducts)).')';
2835 2835
 		}
2836 2836
 		if (!empty($limit)) {
2837
-			$sql .= ' LIMIT ' . (int) $limit;
2837
+			$sql .= ' LIMIT '.(int) $limit;
2838 2838
 		}
2839 2839
 		$resql = $db->query($sql);
2840 2840
 		if ($resql) {
@@ -2848,11 +2848,11 @@  discard block
 block discarded – undo
2848 2848
 			while ($obj = $db->fetch_object($resql)) {
2849 2849
 				$product = new Product($db);
2850 2850
 				$res = $product->fetch($obj->fk_product);
2851
-				$out .= '<option value="' . $obj->rowid . '"';
2851
+				$out .= '<option value="'.$obj->rowid.'"';
2852 2852
 				if ($obj->rowid == $selected) {
2853 2853
 					$out .= 'selected';
2854 2854
 				}
2855
-				$out .= '>' . $obj->ref . ' - ' . $product->label . ' - ' . $obj->label . '</option>';
2855
+				$out .= '>'.$obj->ref.' - '.$product->label.' - '.$obj->label.'</option>';
2856 2856
 			}
2857 2857
 		} else {
2858 2858
 			$error++;
@@ -2910,7 +2910,7 @@  discard block
 block discarded – undo
2910 2910
 
2911 2911
 		$warehouseStatusArray = array();
2912 2912
 		if (!empty($warehouseStatus)) {
2913
-			require_once DOL_DOCUMENT_ROOT . '/product/stock/class/entrepot.class.php';
2913
+			require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php';
2914 2914
 			if (preg_match('/warehouseclosed/', $warehouseStatus)) {
2915 2915
 				$warehouseStatusArray[] = Entrepot::STATUS_CLOSED;
2916 2916
 			}
@@ -2924,9 +2924,9 @@  discard block
 block discarded – undo
2924 2924
 
2925 2925
 		$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";
2926 2926
 		if (count($warehouseStatusArray)) {
2927
-			$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
2927
+			$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
2928 2928
 		} else {
2929
-			$selectFieldsGrouped = ", " . $this->db->ifsql("p.stock IS NULL", 0, "p.stock") . " AS stock";
2929
+			$selectFieldsGrouped = ", ".$this->db->ifsql("p.stock IS NULL", 0, "p.stock")." AS stock";
2930 2930
 		}
2931 2931
 
2932 2932
 		$sql = "SELECT ";
@@ -2942,9 +2942,9 @@  discard block
 block discarded – undo
2942 2942
 
2943 2943
 		if (getDolGlobalString('PRODUCT_SORT_BY_CATEGORY')) {
2944 2944
 			//Product category
2945
-			$sql .= ", (SELECT " . $this->db->prefix() . "categorie_product.fk_categorie
2946
-						FROM " . $this->db->prefix() . "categorie_product
2947
-						WHERE " . $this->db->prefix() . "categorie_product.fk_product=p.rowid
2945
+			$sql .= ", (SELECT ".$this->db->prefix()."categorie_product.fk_categorie
2946
+						FROM " . $this->db->prefix()."categorie_product
2947
+						WHERE " . $this->db->prefix()."categorie_product.fk_product=p.rowid
2948 2948
 						LIMIT 1
2949 2949
 				) AS categorie_product_id ";
2950 2950
 		}
@@ -2970,15 +2970,15 @@  discard block
 block discarded – undo
2970 2970
 		}
2971 2971
 		// Price by quantity
2972 2972
 		if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) {
2973
-			$sql .= ", (SELECT pp.rowid FROM " . $this->db->prefix() . "product_price as pp WHERE pp.fk_product = p.rowid";
2973
+			$sql .= ", (SELECT pp.rowid FROM ".$this->db->prefix()."product_price as pp WHERE pp.fk_product = p.rowid";
2974 2974
 			if ($price_level >= 1 && getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) {
2975
-				$sql .= " AND price_level = " . ((int) $price_level);
2975
+				$sql .= " AND price_level = ".((int) $price_level);
2976 2976
 			}
2977 2977
 			$sql .= " ORDER BY date_price";
2978 2978
 			$sql .= " DESC LIMIT 1) as price_rowid";
2979
-			$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
2979
+			$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
2980 2980
 			if ($price_level >= 1 && getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) {
2981
-				$sql .= " AND price_level = " . ((int) $price_level);
2981
+				$sql .= " AND price_level = ".((int) $price_level);
2982 2982
 			}
2983 2983
 			$sql .= " ORDER BY date_price";
2984 2984
 			$sql .= " DESC LIMIT 1) as price_by_qty";
@@ -2988,7 +2988,7 @@  discard block
 block discarded – undo
2988 2988
 		$sql .= " FROM ".$this->db->prefix()."product as p";
2989 2989
 
2990 2990
 		if (getDolGlobalString('MAIN_SEARCH_PRODUCT_FORCE_INDEX')) {
2991
-			$sql .= " USE INDEX (" . $this->db->sanitize(getDolGlobalString('MAIN_PRODUCT_FORCE_INDEX')) . ")";
2991
+			$sql .= " USE INDEX (".$this->db->sanitize(getDolGlobalString('MAIN_PRODUCT_FORCE_INDEX')).")";
2992 2992
 		}
2993 2993
 
2994 2994
 		// Add from (left join) from hooks
@@ -2997,53 +2997,53 @@  discard block
 block discarded – undo
2997 2997
 		$sql .= $hookmanager->resPrint;
2998 2998
 
2999 2999
 		if (count($warehouseStatusArray)) {
3000
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "product_stock as ps on ps.fk_product = p.rowid";
3001
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "entrepot as e on ps.fk_entrepot = e.rowid AND e.entity IN (" . getEntity('stock') . ")";
3002
-			$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.
3000
+			$sql .= " LEFT JOIN ".$this->db->prefix()."product_stock as ps on ps.fk_product = p.rowid";
3001
+			$sql .= " LEFT JOIN ".$this->db->prefix()."entrepot as e on ps.fk_entrepot = e.rowid AND e.entity IN (".getEntity('stock').")";
3002
+			$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.
3003 3003
 		}
3004 3004
 
3005 3005
 		// include search in supplier ref
3006 3006
 		if (getDolGlobalString('MAIN_SEARCH_PRODUCT_BY_FOURN_REF')) {
3007
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
3007
+			$sql .= " LEFT JOIN ".$this->db->prefix()."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
3008 3008
 		}
3009 3009
 
3010 3010
 		//Price by customer
3011 3011
 		if ((getDolGlobalString('PRODUIT_CUSTOMER_PRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) && !empty($socid)) {
3012
-			$sql .= " LEFT JOIN  " . $this->db->prefix() . "product_customer_price as pcp ON pcp.fk_soc=" . ((int) $socid) . " AND pcp.fk_product=p.rowid";
3012
+			$sql .= " LEFT JOIN  ".$this->db->prefix()."product_customer_price as pcp ON pcp.fk_soc=".((int) $socid)." AND pcp.fk_product=p.rowid";
3013 3013
 		}
3014 3014
 		// Units
3015 3015
 		if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
3016
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "c_units u ON u.rowid = p.fk_unit";
3016
+			$sql .= " LEFT JOIN ".$this->db->prefix()."c_units u ON u.rowid = p.fk_unit";
3017 3017
 		}
3018 3018
 		// Multilang : we add translation
3019 3019
 		if (getDolGlobalInt('MAIN_MULTILANGS')) {
3020
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "product_lang as pl ON pl.fk_product = p.rowid ";
3020
+			$sql .= " LEFT JOIN ".$this->db->prefix()."product_lang as pl ON pl.fk_product = p.rowid ";
3021 3021
 			if (getDolGlobalString('PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE') && !empty($socid)) {
3022
-				require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
3022
+				require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
3023 3023
 				$soc = new Societe($this->db);
3024 3024
 				$result = $soc->fetch($socid);
3025 3025
 				if ($result > 0 && !empty($soc->default_lang)) {
3026
-					$sql .= " AND pl.lang = '" . $this->db->escape($soc->default_lang) . "'";
3026
+					$sql .= " AND pl.lang = '".$this->db->escape($soc->default_lang)."'";
3027 3027
 				} else {
3028
-					$sql .= " AND pl.lang = '" . $this->db->escape($langs->getDefaultLang()) . "'";
3028
+					$sql .= " AND pl.lang = '".$this->db->escape($langs->getDefaultLang())."'";
3029 3029
 				}
3030 3030
 			} else {
3031
-				$sql .= " AND pl.lang = '" . $this->db->escape($langs->getDefaultLang()) . "'";
3031
+				$sql .= " AND pl.lang = '".$this->db->escape($langs->getDefaultLang())."'";
3032 3032
 			}
3033 3033
 		}
3034 3034
 
3035 3035
 		if (getDolGlobalString('PRODUIT_ATTRIBUTES_HIDECHILD')) {
3036
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "product_attribute_combination pac ON pac.fk_product_child = p.rowid";
3036
+			$sql .= " LEFT JOIN ".$this->db->prefix()."product_attribute_combination pac ON pac.fk_product_child = p.rowid";
3037 3037
 		}
3038 3038
 
3039
-		$sql .= ' WHERE p.entity IN (' . getEntity('product') . ')';
3039
+		$sql .= ' WHERE p.entity IN ('.getEntity('product').')';
3040 3040
 
3041 3041
 		if (getDolGlobalString('PRODUIT_ATTRIBUTES_HIDECHILD')) {
3042 3042
 			$sql .= " AND pac.rowid IS NULL";
3043 3043
 		}
3044 3044
 
3045 3045
 		if ($finished == 0) {
3046
-			$sql .= " AND p.finished = " . ((int) $finished);
3046
+			$sql .= " AND p.finished = ".((int) $finished);
3047 3047
 		} elseif ($finished == 1) {
3048 3048
 			$sql .= " AND p.finished = ".((int) $finished);
3049 3049
 		}
@@ -3051,11 +3051,11 @@  discard block
 block discarded – undo
3051 3051
 			$sql .= " AND p.tosell = ".((int) $status);
3052 3052
 		}
3053 3053
 		if ($status_purchase >= 0) {
3054
-			$sql .= " AND p.tobuy = " . ((int) $status_purchase);
3054
+			$sql .= " AND p.tobuy = ".((int) $status_purchase);
3055 3055
 		}
3056 3056
 		// Filter by product type
3057 3057
 		if (strval($filtertype) != '') {
3058
-			$sql .= " AND p.fk_product_type = " . ((int) $filtertype);
3058
+			$sql .= " AND p.fk_product_type = ".((int) $filtertype);
3059 3059
 		} elseif (!isModEnabled('product')) { // when product module is disabled, show services only
3060 3060
 			$sql .= " AND p.fk_product_type = 1";
3061 3061
 		} elseif (!isModEnabled('service')) { // when service module is disabled, show products only
@@ -3063,7 +3063,7 @@  discard block
 block discarded – undo
3063 3063
 		}
3064 3064
 
3065 3065
 		if ((int) $warehouseId > 0) {
3066
-			$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)";
3066
+			$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)";
3067 3067
 		}
3068 3068
 
3069 3069
 		// Add where from hooks
@@ -3084,21 +3084,21 @@  discard block
 block discarded – undo
3084 3084
 				if ($i > 0) {
3085 3085
 					$sql .= " AND ";
3086 3086
 				}
3087
-				$sql .= "(p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%' OR p.label LIKE '" . $this->db->escape($prefix . $crit) . "%'";
3087
+				$sql .= "(p.ref LIKE '".$this->db->escape($prefix.$crit)."%' OR p.label LIKE '".$this->db->escape($prefix.$crit)."%'";
3088 3088
 				if (getDolGlobalInt('MAIN_MULTILANGS')) {
3089
-					$sql .= " OR pl.label LIKE '" . $this->db->escape($prefix . $crit) . "%'";
3089
+					$sql .= " OR pl.label LIKE '".$this->db->escape($prefix.$crit)."%'";
3090 3090
 				}
3091 3091
 				if ((getDolGlobalString('PRODUIT_CUSTOMER_PRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) && !empty($socid)) {
3092
-					$sql .= " OR pcp.ref_customer LIKE '" . $this->db->escape($prefix . $crit) . "%'";
3092
+					$sql .= " OR pcp.ref_customer LIKE '".$this->db->escape($prefix.$crit)."%'";
3093 3093
 				}
3094 3094
 				if (getDolGlobalString('PRODUCT_AJAX_SEARCH_ON_DESCRIPTION')) {
3095
-					$sql .= " OR p.description LIKE '" . $this->db->escape($prefix . $crit) . "%'";
3095
+					$sql .= " OR p.description LIKE '".$this->db->escape($prefix.$crit)."%'";
3096 3096
 					if (getDolGlobalInt('MAIN_MULTILANGS')) {
3097
-						$sql .= " OR pl.description LIKE '" . $this->db->escape($prefix . $crit) . "%'";
3097
+						$sql .= " OR pl.description LIKE '".$this->db->escape($prefix.$crit)."%'";
3098 3098
 					}
3099 3099
 				}
3100 3100
 				if (getDolGlobalString('MAIN_SEARCH_PRODUCT_BY_FOURN_REF')) {
3101
-					$sql .= " OR pfp.ref_fourn LIKE '" . $this->db->escape($prefix . $crit) . "%'";
3101
+					$sql .= " OR pfp.ref_fourn LIKE '".$this->db->escape($prefix.$crit)."%'";
3102 3102
 				}
3103 3103
 				$sql .= ")";
3104 3104
 				$i++;
@@ -3107,12 +3107,12 @@  discard block
 block discarded – undo
3107 3107
 				$sql .= ")";
3108 3108
 			}
3109 3109
 			if (isModEnabled('barcode')) {
3110
-				$sql .= " OR p.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
3110
+				$sql .= " OR p.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'";
3111 3111
 			}
3112 3112
 			$sql .= ')';
3113 3113
 		}
3114 3114
 		if (count($warehouseStatusArray)) {
3115
-			$sql .= " GROUP BY " . $selectFields;
3115
+			$sql .= " GROUP BY ".$selectFields;
3116 3116
 		}
3117 3117
 
3118 3118
 		//Sort by category
@@ -3127,23 +3127,23 @@  discard block
 block discarded – undo
3127 3127
 		$sql .= $this->db->plimit($limit, 0);
3128 3128
 
3129 3129
 		// Build output string
3130
-		dol_syslog(get_class($this) . "::select_produits_list search products", LOG_DEBUG);
3130
+		dol_syslog(get_class($this)."::select_produits_list search products", LOG_DEBUG);
3131 3131
 		$result = $this->db->query($sql);
3132 3132
 		if ($result) {
3133
-			require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
3134
-			require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
3135
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/product.lib.php';
3133
+			require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
3134
+			require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
3135
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php';
3136 3136
 
3137 3137
 			$num = $this->db->num_rows($result);
3138 3138
 
3139 3139
 			$events = array();
3140 3140
 
3141 3141
 			if (!$forcecombo) {
3142
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
3142
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
3143 3143
 				$out .= ajax_combobox($htmlname, $events, getDolGlobalInt("PRODUIT_USE_SEARCH_TO_SELECT"));
3144 3144
 			}
3145 3145
 
3146
-			$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
3146
+			$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
3147 3147
 
3148 3148
 			$textifempty = '';
3149 3149
 			// Do not use textifempty = ' ' or '&nbsp;' here, or search on key will search on ' key'.
@@ -3160,7 +3160,7 @@  discard block
 block discarded – undo
3160 3160
 				}
3161 3161
 			}
3162 3162
 			if ($showempty) {
3163
-				$out .= '<option value="-1" selected>' . ($textifempty ? $textifempty : '&nbsp;') . '</option>';
3163
+				$out .= '<option value="-1" selected>'.($textifempty ? $textifempty : '&nbsp;').'</option>';
3164 3164
 			}
3165 3165
 
3166 3166
 			$i = 0;
@@ -3171,11 +3171,11 @@  discard block
 block discarded – undo
3171 3171
 
3172 3172
 				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
3173 3173
 					$sql = "SELECT rowid, quantity, price, unitprice, remise_percent, remise, price_base_type";
3174
-					$sql .= " FROM " . $this->db->prefix() . "product_price_by_qty";
3175
-					$sql .= " WHERE fk_product_price = " . ((int) $objp->price_rowid);
3174
+					$sql .= " FROM ".$this->db->prefix()."product_price_by_qty";
3175
+					$sql .= " WHERE fk_product_price = ".((int) $objp->price_rowid);
3176 3176
 					$sql .= " ORDER BY quantity ASC";
3177 3177
 
3178
-					dol_syslog(get_class($this) . "::select_produits_list search prices by qty", LOG_DEBUG);
3178
+					dol_syslog(get_class($this)."::select_produits_list search prices by qty", LOG_DEBUG);
3179 3179
 					$result2 = $this->db->query($sql);
3180 3180
 					if ($result2) {
3181 3181
 						$nb_prices = $this->db->num_rows($result2);
@@ -3213,7 +3213,7 @@  discard block
 block discarded – undo
3213 3213
 						$price_product = new Product($this->db);
3214 3214
 						$price_product->fetch($objp->rowid, '', '', 1);
3215 3215
 
3216
-						require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
3216
+						require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
3217 3217
 						$priceparser = new PriceParser($this->db);
3218 3218
 						$price_result = $priceparser->parseProduct($price_product);
3219 3219
 						if ($price_result >= 0) {
@@ -3299,7 +3299,7 @@  discard block
 block discarded – undo
3299 3299
 			$label = $objp->label_translated;
3300 3300
 		}
3301 3301
 		if (!empty($filterkey) && $filterkey != '') {
3302
-			$label = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $label, 1);
3302
+			$label = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $label, 1);
3303 3303
 		}
3304 3304
 
3305 3305
 		$outkey = $objp->rowid;
@@ -3320,32 +3320,32 @@  discard block
 block discarded – undo
3320 3320
 		$outdurationunit = $outtype == Product::TYPE_SERVICE ? substr($objp->duration, -1) : '';
3321 3321
 
3322 3322
 		if ($outorigin && getDolGlobalString('PRODUCT_SHOW_ORIGIN_IN_COMBO')) {
3323
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
3323
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
3324 3324
 		}
3325 3325
 
3326 3326
 		// Units
3327 3327
 		$outvalUnits = '';
3328 3328
 		if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
3329 3329
 			if (!empty($objp->unit_short)) {
3330
-				$outvalUnits .= ' - ' . $objp->unit_short;
3330
+				$outvalUnits .= ' - '.$objp->unit_short;
3331 3331
 			}
3332 3332
 		}
3333 3333
 		if (getDolGlobalString('PRODUCT_SHOW_DIMENSIONS_IN_COMBO')) {
3334 3334
 			if (!empty($objp->weight) && $objp->weight_units !== null) {
3335 3335
 				$unitToShow = showDimensionInBestUnit($objp->weight, $objp->weight_units, 'weight', $langs);
3336
-				$outvalUnits .= ' - ' . $unitToShow;
3336
+				$outvalUnits .= ' - '.$unitToShow;
3337 3337
 			}
3338 3338
 			if ((!empty($objp->length) || !empty($objp->width) || !empty($objp->height)) && $objp->length_units !== null) {
3339
-				$unitToShow = $objp->length . ' x ' . $objp->width . ' x ' . $objp->height . ' ' . measuringUnitString(0, 'size', $objp->length_units);
3340
-				$outvalUnits .= ' - ' . $unitToShow;
3339
+				$unitToShow = $objp->length.' x '.$objp->width.' x '.$objp->height.' '.measuringUnitString(0, 'size', $objp->length_units);
3340
+				$outvalUnits .= ' - '.$unitToShow;
3341 3341
 			}
3342 3342
 			if (!empty($objp->surface) && $objp->surface_units !== null) {
3343 3343
 				$unitToShow = showDimensionInBestUnit($objp->surface, $objp->surface_units, 'surface', $langs);
3344
-				$outvalUnits .= ' - ' . $unitToShow;
3344
+				$outvalUnits .= ' - '.$unitToShow;
3345 3345
 			}
3346 3346
 			if (!empty($objp->volume) && $objp->volume_units !== null) {
3347 3347
 				$unitToShow = showDimensionInBestUnit($objp->volume, $objp->volume_units, 'volume', $langs);
3348
-				$outvalUnits .= ' - ' . $unitToShow;
3348
+				$outvalUnits .= ' - '.$unitToShow;
3349 3349
 			}
3350 3350
 		}
3351 3351
 		if ($outdurationvalue && $outdurationunit) {
@@ -3357,7 +3357,7 @@  discard block
 block discarded – undo
3357 3357
 				'y' => $langs->trans('Year')
3358 3358
 			);
3359 3359
 			if (isset($da[$outdurationunit])) {
3360
-				$outvalUnits .= ' - ' . $outdurationvalue . ' ' . $langs->transnoentities($da[$outdurationunit] . ($outdurationvalue > 1 ? 's' : ''));
3360
+				$outvalUnits .= ' - '.$outdurationvalue.' '.$langs->transnoentities($da[$outdurationunit].($outdurationvalue > 1 ? 's' : ''));
3361 3361
 			}
3362 3362
 		}
3363 3363
 
@@ -3377,31 +3377,31 @@  discard block
 block discarded – undo
3377 3377
 		$labeltoshow = '';
3378 3378
 		$labeltoshow .= $objp->ref;
3379 3379
 		if (!empty($objp->custref)) {
3380
-			$labeltoshow .= ' (' . $objp->custref . ')';
3380
+			$labeltoshow .= ' ('.$objp->custref.')';
3381 3381
 		}
3382 3382
 		if ($outbarcode) {
3383
-			$labeltoshow .= ' (' . $outbarcode . ')';
3383
+			$labeltoshow .= ' ('.$outbarcode.')';
3384 3384
 		}
3385
-		$labeltoshow .= ' - ' . dol_trunc($label, $maxlengtharticle);
3385
+		$labeltoshow .= ' - '.dol_trunc($label, $maxlengtharticle);
3386 3386
 		if ($outorigin && getDolGlobalString('PRODUCT_SHOW_ORIGIN_IN_COMBO')) {
3387
-			$labeltoshow .= ' (' . getCountry($outorigin, '1') . ')';
3387
+			$labeltoshow .= ' ('.getCountry($outorigin, '1').')';
3388 3388
 		}
3389 3389
 
3390 3390
 		// Set $labltoshowhtml
3391 3391
 		$labeltoshowhtml = '';
3392 3392
 		$labeltoshowhtml .= $objp->ref;
3393 3393
 		if (!empty($objp->custref)) {
3394
-			$labeltoshowhtml .= ' (' . $objp->custref . ')';
3394
+			$labeltoshowhtml .= ' ('.$objp->custref.')';
3395 3395
 		}
3396 3396
 		if (!empty($filterkey) && $filterkey != '') {
3397
-			$labeltoshowhtml = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $labeltoshowhtml, 1);
3397
+			$labeltoshowhtml = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $labeltoshowhtml, 1);
3398 3398
 		}
3399 3399
 		if ($outbarcode) {
3400
-			$labeltoshowhtml .= ' (' . $outbarcode . ')';
3400
+			$labeltoshowhtml .= ' ('.$outbarcode.')';
3401 3401
 		}
3402
-		$labeltoshowhtml .= ' - ' . dol_trunc($label, $maxlengtharticle);
3402
+		$labeltoshowhtml .= ' - '.dol_trunc($label, $maxlengtharticle);
3403 3403
 		if ($outorigin && getDolGlobalString('PRODUCT_SHOW_ORIGIN_IN_COMBO')) {
3404
-			$labeltoshowhtml .= ' (' . getCountry($outorigin, '1') . ')';
3404
+			$labeltoshowhtml .= ' ('.getCountry($outorigin, '1').')';
3405 3405
 		}
3406 3406
 
3407 3407
 		// Stock
@@ -3409,14 +3409,14 @@  discard block
 block discarded – undo
3409 3409
 		$labeltoshowhtmlstock = '';
3410 3410
 		if (isModEnabled('stock') && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || getDolGlobalString('STOCK_SUPPORTS_SERVICES'))) {
3411 3411
 			if ($user->hasRight('stock', 'lire')) {
3412
-				$labeltoshowstock .= ' - ' . $langs->trans("Stock") . ': ' . price(price2num($objp->stock, 'MS'));
3412
+				$labeltoshowstock .= ' - '.$langs->trans("Stock").': '.price(price2num($objp->stock, 'MS'));
3413 3413
 
3414 3414
 				if ($objp->stock > 0) {
3415 3415
 					$labeltoshowhtmlstock .= ' - <span class="product_line_stock_ok">';
3416 3416
 				} elseif ($objp->stock <= 0) {
3417 3417
 					$labeltoshowhtmlstock .= ' - <span class="product_line_stock_too_low">';
3418 3418
 				}
3419
-				$labeltoshowhtmlstock .= $langs->transnoentities("Stock") . ': ' . price(price2num($objp->stock, 'MS'));
3419
+				$labeltoshowhtmlstock .= $langs->transnoentities("Stock").': '.price(price2num($objp->stock, 'MS'));
3420 3420
 				$labeltoshowhtmlstock .= '</span>';
3421 3421
 
3422 3422
 				if (empty($novirtualstock) && getDolGlobalString('STOCK_SHOW_VIRTUAL_STOCK_IN_PRODUCTS_COMBO')) {  // Warning, this option may slow down combo list generation
@@ -3427,9 +3427,9 @@  discard block
 block discarded – undo
3427 3427
 					$tmpproduct->load_virtual_stock();
3428 3428
 					$virtualstock = $tmpproduct->stock_theorique;
3429 3429
 
3430
-					$labeltoshowstock .= ' - ' . $langs->trans("VirtualStock") . ':' . $virtualstock;
3430
+					$labeltoshowstock .= ' - '.$langs->trans("VirtualStock").':'.$virtualstock;
3431 3431
 
3432
-					$labeltoshowhtmlstock .= ' - ' . $langs->transnoentities("VirtualStock") . ':';
3432
+					$labeltoshowhtmlstock .= ' - '.$langs->transnoentities("VirtualStock").':';
3433 3433
 					if ($virtualstock > 0) {
3434 3434
 						$labeltoshowhtmlstock .= '<span class="product_line_stock_ok">';
3435 3435
 					} elseif ($virtualstock <= 0) {
@@ -3450,35 +3450,35 @@  discard block
 block discarded – undo
3450 3450
 		// If we need a particular price level (from 1 to n)
3451 3451
 		if (empty($hidepriceinlabel) && $price_level >= 1 && (getDolGlobalString('PRODUIT_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES'))) {
3452 3452
 			$sql = "SELECT price, price_ttc, price_base_type, tva_tx, default_vat_code";
3453
-			$sql .= " FROM " . $this->db->prefix() . "product_price";
3454
-			$sql .= " WHERE fk_product = " . ((int) $objp->rowid);
3455
-			$sql .= " AND entity IN (" . getEntity('productprice') . ")";
3456
-			$sql .= " AND price_level = " . ((int) $price_level);
3453
+			$sql .= " FROM ".$this->db->prefix()."product_price";
3454
+			$sql .= " WHERE fk_product = ".((int) $objp->rowid);
3455
+			$sql .= " AND entity IN (".getEntity('productprice').")";
3456
+			$sql .= " AND price_level = ".((int) $price_level);
3457 3457
 			$sql .= " ORDER BY date_price DESC, rowid DESC"; // Warning DESC must be both on date_price and rowid.
3458 3458
 			$sql .= " LIMIT 1";
3459 3459
 
3460
-			dol_syslog(get_class($this) . '::constructProductListOption search price for product ' . $objp->rowid . ' AND level ' . $price_level, LOG_DEBUG);
3460
+			dol_syslog(get_class($this).'::constructProductListOption search price for product '.$objp->rowid.' AND level '.$price_level, LOG_DEBUG);
3461 3461
 			$result2 = $this->db->query($sql);
3462 3462
 			if ($result2) {
3463 3463
 				$objp2 = $this->db->fetch_object($result2);
3464 3464
 				if ($objp2) {
3465 3465
 					$found = 1;
3466 3466
 					if ($objp2->price_base_type == 'HT') {
3467
-						$labeltoshowprice .= ' - ' . price($objp2->price, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("HT");
3468
-						$labeltoshowhtmlprice .= ' - ' . price($objp2->price, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("HT");
3467
+						$labeltoshowprice .= ' - '.price($objp2->price, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT");
3468
+						$labeltoshowhtmlprice .= ' - '.price($objp2->price, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT");
3469 3469
 					} else {
3470
-						$labeltoshowprice .= ' - ' . price($objp2->price_ttc, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("TTC");
3471
-						$labeltoshowhtmlprice .= ' - ' . price($objp2->price_ttc, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("TTC");
3470
+						$labeltoshowprice .= ' - '.price($objp2->price_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC");
3471
+						$labeltoshowhtmlprice .= ' - '.price($objp2->price_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC");
3472 3472
 					}
3473 3473
 					$outprice_ht = price($objp2->price);
3474 3474
 					$outprice_ttc = price($objp2->price_ttc);
3475 3475
 					$outpricebasetype = $objp2->price_base_type;
3476 3476
 					if (getDolGlobalString('PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL')) {  // using this option is a bug. kept for backward compatibility
3477
-						$outtva_tx = $objp2->tva_tx;                        // We use the vat rate on line of multiprice
3478
-						$outdefault_vat_code = $objp2->default_vat_code;    // We use the vat code on line of multiprice
3477
+						$outtva_tx = $objp2->tva_tx; // We use the vat rate on line of multiprice
3478
+						$outdefault_vat_code = $objp2->default_vat_code; // We use the vat code on line of multiprice
3479 3479
 					} else {
3480
-						$outtva_tx = $objp->tva_tx;                            // We use the vat rate of product, not the one on line of multiprice
3481
-						$outdefault_vat_code = $objp->default_vat_code;        // We use the vat code or product, not the one on line of multiprice
3480
+						$outtva_tx = $objp->tva_tx; // We use the vat rate of product, not the one on line of multiprice
3481
+						$outdefault_vat_code = $objp->default_vat_code; // We use the vat code or product, not the one on line of multiprice
3482 3482
 					}
3483 3483
 				}
3484 3484
 			} else {
@@ -3492,13 +3492,13 @@  discard block
 block discarded – undo
3492 3492
 			$outqty = $objp->quantity;
3493 3493
 			$outdiscount = $objp->remise_percent;
3494 3494
 			if ($objp->quantity == 1) {
3495
-				$labeltoshowprice .= ' - ' . price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency) . "/";
3496
-				$labeltoshowhtmlprice .= ' - ' . price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency) . "/";
3495
+				$labeltoshowprice .= ' - '.price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency)."/";
3496
+				$labeltoshowhtmlprice .= ' - '.price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency)."/";
3497 3497
 				$labeltoshowprice .= $langs->trans("Unit"); // Do not use strtolower because it breaks utf8 encoding
3498 3498
 				$labeltoshowhtmlprice .= $langs->transnoentities("Unit");
3499 3499
 			} else {
3500
-				$labeltoshowprice .= ' - ' . price($objp->price, 1, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity;
3501
-				$labeltoshowhtmlprice .= ' - ' . price($objp->price, 0, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity;
3500
+				$labeltoshowprice .= ' - '.price($objp->price, 1, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity;
3501
+				$labeltoshowhtmlprice .= ' - '.price($objp->price, 0, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity;
3502 3502
 				$labeltoshowprice .= $langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding
3503 3503
 				$labeltoshowhtmlprice .= $langs->transnoentities("Units");
3504 3504
 			}
@@ -3506,16 +3506,16 @@  discard block
 block discarded – undo
3506 3506
 			$outprice_ht = price($objp->unitprice);
3507 3507
 			$outprice_ttc = price($objp->unitprice * (1 + ($objp->tva_tx / 100)));
3508 3508
 			$outpricebasetype = $objp->price_base_type;
3509
-			$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
3510
-			$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
3509
+			$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
3510
+			$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
3511 3511
 		}
3512 3512
 		if (empty($hidepriceinlabel) && !empty($objp->quantity) && $objp->quantity >= 1) {
3513
-			$labeltoshowprice .= " (" . price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->trans("Unit") . ")"; // Do not use strtolower because it breaks utf8 encoding
3514
-			$labeltoshowhtmlprice .= " (" . price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->transnoentities("Unit") . ")"; // Do not use strtolower because it breaks utf8 encoding
3513
+			$labeltoshowprice .= " (".price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency)."/".$langs->trans("Unit").")"; // Do not use strtolower because it breaks utf8 encoding
3514
+			$labeltoshowhtmlprice .= " (".price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency)."/".$langs->transnoentities("Unit").")"; // Do not use strtolower because it breaks utf8 encoding
3515 3515
 		}
3516 3516
 		if (empty($hidepriceinlabel) && !empty($objp->remise_percent) && $objp->remise_percent >= 1) {
3517
-			$labeltoshowprice .= " - " . $langs->trans("Discount") . " : " . vatrate($objp->remise_percent) . ' %';
3518
-			$labeltoshowhtmlprice .= " - " . $langs->transnoentities("Discount") . " : " . vatrate($objp->remise_percent) . ' %';
3517
+			$labeltoshowprice .= " - ".$langs->trans("Discount")." : ".vatrate($objp->remise_percent).' %';
3518
+			$labeltoshowhtmlprice .= " - ".$langs->transnoentities("Discount")." : ".vatrate($objp->remise_percent).' %';
3519 3519
 		}
3520 3520
 
3521 3521
 		// Price by customer
@@ -3524,11 +3524,11 @@  discard block
 block discarded – undo
3524 3524
 				$found = 1;
3525 3525
 
3526 3526
 				if ($objp->custprice_base_type == 'HT') {
3527
-					$labeltoshowprice .= ' - ' . price($objp->custprice, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("HT");
3528
-					$labeltoshowhtmlprice .= ' - ' . price($objp->custprice, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("HT");
3527
+					$labeltoshowprice .= ' - '.price($objp->custprice, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT");
3528
+					$labeltoshowhtmlprice .= ' - '.price($objp->custprice, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT");
3529 3529
 				} else {
3530
-					$labeltoshowprice .= ' - ' . price($objp->custprice_ttc, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("TTC");
3531
-					$labeltoshowhtmlprice .= ' - ' . price($objp->custprice_ttc, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("TTC");
3530
+					$labeltoshowprice .= ' - '.price($objp->custprice_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC");
3531
+					$labeltoshowhtmlprice .= ' - '.price($objp->custprice_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC");
3532 3532
 				}
3533 3533
 
3534 3534
 				$outprice_ht = price($objp->custprice);
@@ -3542,11 +3542,11 @@  discard block
 block discarded – undo
3542 3542
 		// If level no defined or multiprice not found, we used the default price
3543 3543
 		if (empty($hidepriceinlabel) && !$found) {
3544 3544
 			if ($objp->price_base_type == 'HT') {
3545
-				$labeltoshowprice .= ' - ' . price($objp->price, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("HT");
3546
-				$labeltoshowhtmlprice .= ' - ' . price($objp->price, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("HT");
3545
+				$labeltoshowprice .= ' - '.price($objp->price, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT");
3546
+				$labeltoshowhtmlprice .= ' - '.price($objp->price, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT");
3547 3547
 			} else {
3548
-				$labeltoshowprice .= ' - ' . price($objp->price_ttc, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("TTC");
3549
-				$labeltoshowhtmlprice .= ' - ' . price($objp->price_ttc, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("TTC");
3548
+				$labeltoshowprice .= ' - '.price($objp->price_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC");
3549
+				$labeltoshowhtmlprice .= ' - '.price($objp->price_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC");
3550 3550
 			}
3551 3551
 			$outprice_ht = price($objp->price);
3552 3552
 			$outprice_ttc = price($objp->price_ttc);
@@ -3557,14 +3557,14 @@  discard block
 block discarded – undo
3557 3557
 
3558 3558
 
3559 3559
 		// Build options
3560
-		$opt = '<option value="' . $objp->rowid . '"';
3560
+		$opt = '<option value="'.$objp->rowid.'"';
3561 3561
 		$opt .= ($objp->rowid == $selected) ? ' selected' : '';
3562 3562
 		if (!empty($objp->price_by_qty_rowid) && $objp->price_by_qty_rowid > 0) {
3563
-			$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 . '"';
3563
+			$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.'"';
3564 3564
 		}
3565 3565
 		if (getDolGlobalString('PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE')) {
3566
-			$opt .= ' data-labeltrans="' . $outlabel_translated . '"';
3567
-			$opt .= ' data-desctrans="' . dol_escape_htmltag($outdesc_translated) . '"';
3566
+			$opt .= ' data-labeltrans="'.$outlabel_translated.'"';
3567
+			$opt .= ' data-desctrans="'.dol_escape_htmltag($outdesc_translated).'"';
3568 3568
 		}
3569 3569
 
3570 3570
 		if ($stocktag == 1) {
@@ -3659,7 +3659,7 @@  discard block
 block discarded – undo
3659 3659
 		$selected_input_value = '';
3660 3660
 		if (!empty($conf->use_javascript_ajax) && getDolGlobalString('PRODUIT_USE_SEARCH_TO_SELECT')) {
3661 3661
 			if ($selected > 0) {
3662
-				require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
3662
+				require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
3663 3663
 				$producttmpselect = new Product($this->db);
3664 3664
 				$producttmpselect->fetch($selected);
3665 3665
 				$selected_input_value = $producttmpselect->ref;
@@ -3667,10 +3667,10 @@  discard block
 block discarded – undo
3667 3667
 			}
3668 3668
 
3669 3669
 			// mode=2 means suppliers products
3670
-			$urloption = ($socid > 0 ? 'socid=' . $socid . '&' : '') . 'htmlname=' . $htmlname . '&outjson=1&price_level=' . $price_level . '&type=' . $filtertype . '&mode=2&status=' . $status . '&finished=' . $finished . '&alsoproductwithnosupplierprice=' . $alsoproductwithnosupplierprice;
3671
-			print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/product/ajax/products.php', $urloption, getDolGlobalInt('PRODUIT_USE_SEARCH_TO_SELECT'), 0, $ajaxoptions);
3670
+			$urloption = ($socid > 0 ? 'socid='.$socid.'&' : '').'htmlname='.$htmlname.'&outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=2&status='.$status.'&finished='.$finished.'&alsoproductwithnosupplierprice='.$alsoproductwithnosupplierprice;
3671
+			print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajax/products.php', $urloption, getDolGlobalInt('PRODUIT_USE_SEARCH_TO_SELECT'), 0, $ajaxoptions);
3672 3672
 
3673
-			print($hidelabel ? '' : $langs->trans("RefOrLabel") . ' : ') . '<input type="text" class="'.$morecss.'" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . ($placeholder ? ' placeholder="' . $placeholder . '"' : '') . '>';
3673
+			print($hidelabel ? '' : $langs->trans("RefOrLabel").' : ').'<input type="text" class="'.$morecss.'" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.($placeholder ? ' placeholder="'.$placeholder.'"' : '').'>';
3674 3674
 		} else {
3675 3675
 			print $this->select_produits_fournisseurs_list($socid, $selected, $htmlname, $filtertype, $filtre, '', $status, 0, 0, $alsoproductwithnosupplierprice, $morecss, 0, $placeholder);
3676 3676
 		}
@@ -3728,25 +3728,25 @@  discard block
 block discarded – undo
3728 3728
 		if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
3729 3729
 			$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";
3730 3730
 		}
3731
-		$sql .= " FROM " . $this->db->prefix() . "product as p";
3732
-		$sql .= " LEFT JOIN " . $this->db->prefix() . "product_fournisseur_price as pfp ON ( p.rowid = pfp.fk_product AND pfp.entity IN (" . getEntity('product') . ") )";
3731
+		$sql .= " FROM ".$this->db->prefix()."product as p";
3732
+		$sql .= " LEFT JOIN ".$this->db->prefix()."product_fournisseur_price as pfp ON ( p.rowid = pfp.fk_product AND pfp.entity IN (".getEntity('product').") )";
3733 3733
 		if ($socid > 0) {
3734
-			$sql .= " AND pfp.fk_soc = " . ((int) $socid);
3734
+			$sql .= " AND pfp.fk_soc = ".((int) $socid);
3735 3735
 		}
3736
-		$sql .= " LEFT JOIN " . $this->db->prefix() . "societe as s ON pfp.fk_soc = s.rowid";
3736
+		$sql .= " LEFT JOIN ".$this->db->prefix()."societe as s ON pfp.fk_soc = s.rowid";
3737 3737
 		// Units
3738 3738
 		if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
3739
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "c_units u ON u.rowid = p.fk_unit";
3739
+			$sql .= " LEFT JOIN ".$this->db->prefix()."c_units u ON u.rowid = p.fk_unit";
3740 3740
 		}
3741
-		$sql .= " WHERE p.entity IN (" . getEntity('product') . ")";
3741
+		$sql .= " WHERE p.entity IN (".getEntity('product').")";
3742 3742
 		if ($statut != -1) {
3743
-			$sql .= " AND p.tobuy = " . ((int) $statut);
3743
+			$sql .= " AND p.tobuy = ".((int) $statut);
3744 3744
 		}
3745 3745
 		if (strval($filtertype) != '') {
3746
-			$sql .= " AND p.fk_product_type = " . ((int) $filtertype);
3746
+			$sql .= " AND p.fk_product_type = ".((int) $filtertype);
3747 3747
 		}
3748 3748
 		if (!empty($filtre)) {
3749
-			$sql .= " " . $filtre;
3749
+			$sql .= " ".$filtre;
3750 3750
 		}
3751 3751
 		// Add where from hooks
3752 3752
 		$parameters = array();
@@ -3766,9 +3766,9 @@  discard block
 block discarded – undo
3766 3766
 				if ($i > 0) {
3767 3767
 					$sql .= " AND ";
3768 3768
 				}
3769
-				$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) . "%'";
3769
+				$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)."%'";
3770 3770
 				if (getDolGlobalString('PRODUIT_FOURN_TEXTS')) {
3771
-					$sql .= " OR pfp.desc_fourn LIKE '" . $this->db->escape($prefix . $crit) . "%'";
3771
+					$sql .= " OR pfp.desc_fourn LIKE '".$this->db->escape($prefix.$crit)."%'";
3772 3772
 				}
3773 3773
 				$sql .= ")";
3774 3774
 				$i++;
@@ -3777,8 +3777,8 @@  discard block
 block discarded – undo
3777 3777
 				$sql .= ")";
3778 3778
 			}
3779 3779
 			if (isModEnabled('barcode')) {
3780
-				$sql .= " OR p.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
3781
-				$sql .= " OR pfp.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
3780
+				$sql .= " OR p.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'";
3781
+				$sql .= " OR pfp.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'";
3782 3782
 			}
3783 3783
 			$sql .= ')';
3784 3784
 		}
@@ -3787,20 +3787,20 @@  discard block
 block discarded – undo
3787 3787
 
3788 3788
 		// Build output string
3789 3789
 
3790
-		dol_syslog(get_class($this) . "::select_produits_fournisseurs_list", LOG_DEBUG);
3790
+		dol_syslog(get_class($this)."::select_produits_fournisseurs_list", LOG_DEBUG);
3791 3791
 		$result = $this->db->query($sql);
3792 3792
 		if ($result) {
3793
-			require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
3794
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/product.lib.php';
3793
+			require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
3794
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php';
3795 3795
 
3796 3796
 			$num = $this->db->num_rows($result);
3797 3797
 
3798 3798
 			//$out.='<select class="flat" id="select'.$htmlname.'" name="'.$htmlname.'">';	// remove select to have id same with combo and ajax
3799
-			$out .= '<select class="flat ' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . '">';
3799
+			$out .= '<select class="flat '.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.'">';
3800 3800
 			if (!$selected) {
3801
-				$out .= '<option value="-1" selected>' . ($placeholder ? $placeholder : '&nbsp;') . '</option>';
3801
+				$out .= '<option value="-1" selected>'.($placeholder ? $placeholder : '&nbsp;').'</option>';
3802 3802
 			} else {
3803
-				$out .= '<option value="-1">' . ($placeholder ? $placeholder : '&nbsp;') . '</option>';
3803
+				$out .= '<option value="-1">'.($placeholder ? $placeholder : '&nbsp;').'</option>';
3804 3804
 			}
3805 3805
 
3806 3806
 			$i = 0;
@@ -3815,7 +3815,7 @@  discard block
 block discarded – undo
3815 3815
 
3816 3816
 				$outkey = $objp->idprodfournprice; // id in table of price
3817 3817
 				if (!$outkey && $alsoproductwithnosupplierprice) {
3818
-					$outkey = 'idprod_' . $objp->rowid; // id of product
3818
+					$outkey = 'idprod_'.$objp->rowid; // id of product
3819 3819
 				}
3820 3820
 
3821 3821
 				$outref = $objp->ref;
@@ -3830,23 +3830,23 @@  discard block
 block discarded – undo
3830 3830
 				$outvalUnits = '';
3831 3831
 				if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
3832 3832
 					if (!empty($objp->unit_short)) {
3833
-						$outvalUnits .= ' - ' . $objp->unit_short;
3833
+						$outvalUnits .= ' - '.$objp->unit_short;
3834 3834
 					}
3835 3835
 					if (!empty($objp->weight) && $objp->weight_units !== null) {
3836 3836
 						$unitToShow = showDimensionInBestUnit($objp->weight, $objp->weight_units, 'weight', $langs);
3837
-						$outvalUnits .= ' - ' . $unitToShow;
3837
+						$outvalUnits .= ' - '.$unitToShow;
3838 3838
 					}
3839 3839
 					if ((!empty($objp->length) || !empty($objp->width) || !empty($objp->height)) && $objp->length_units !== null) {
3840
-						$unitToShow = $objp->length . ' x ' . $objp->width . ' x ' . $objp->height . ' ' . measuringUnitString(0, 'size', $objp->length_units);
3841
-						$outvalUnits .= ' - ' . $unitToShow;
3840
+						$unitToShow = $objp->length.' x '.$objp->width.' x '.$objp->height.' '.measuringUnitString(0, 'size', $objp->length_units);
3841
+						$outvalUnits .= ' - '.$unitToShow;
3842 3842
 					}
3843 3843
 					if (!empty($objp->surface) && $objp->surface_units !== null) {
3844 3844
 						$unitToShow = showDimensionInBestUnit($objp->surface, $objp->surface_units, 'surface', $langs);
3845
-						$outvalUnits .= ' - ' . $unitToShow;
3845
+						$outvalUnits .= ' - '.$unitToShow;
3846 3846
 					}
3847 3847
 					if (!empty($objp->volume) && $objp->volume_units !== null) {
3848 3848
 						$unitToShow = showDimensionInBestUnit($objp->volume, $objp->volume_units, 'volume', $langs);
3849
-						$outvalUnits .= ' - ' . $unitToShow;
3849
+						$outvalUnits .= ' - '.$unitToShow;
3850 3850
 					}
3851 3851
 					if ($outdurationvalue && $outdurationunit) {
3852 3852
 						$da = array(
@@ -3857,22 +3857,22 @@  discard block
 block discarded – undo
3857 3857
 							'y' => $langs->trans('Year')
3858 3858
 						);
3859 3859
 						if (isset($da[$outdurationunit])) {
3860
-							$outvalUnits .= ' - ' . $outdurationvalue . ' ' . $langs->transnoentities($da[$outdurationunit] . ($outdurationvalue > 1 ? 's' : ''));
3860
+							$outvalUnits .= ' - '.$outdurationvalue.' '.$langs->transnoentities($da[$outdurationunit].($outdurationvalue > 1 ? 's' : ''));
3861 3861
 						}
3862 3862
 					}
3863 3863
 				}
3864 3864
 
3865 3865
 				$objRef = $objp->ref;
3866 3866
 				if ($filterkey && $filterkey != '') {
3867
-					$objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1);
3867
+					$objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1);
3868 3868
 				}
3869 3869
 				$objRefFourn = $objp->ref_fourn;
3870 3870
 				if ($filterkey && $filterkey != '') {
3871
-					$objRefFourn = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRefFourn, 1);
3871
+					$objRefFourn = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRefFourn, 1);
3872 3872
 				}
3873 3873
 				$label = $objp->label;
3874 3874
 				if ($filterkey && $filterkey != '') {
3875
-					$label = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $label, 1);
3875
+					$label = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $label, 1);
3876 3876
 				}
3877 3877
 
3878 3878
 				switch ($objp->fk_product_type) {
@@ -3895,21 +3895,21 @@  discard block
 block discarded – undo
3895 3895
 
3896 3896
 				$optlabel .= $objp->ref;
3897 3897
 				if (!empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) {
3898
-					$optlabel .= ' <span class="opacitymedium">(' . $objp->ref_fourn . ')</span>';
3898
+					$optlabel .= ' <span class="opacitymedium">('.$objp->ref_fourn.')</span>';
3899 3899
 				}
3900 3900
 				if (isModEnabled('barcode') && !empty($objp->barcode)) {
3901
-					$optlabel .= ' (' . $outbarcode . ')';
3901
+					$optlabel .= ' ('.$outbarcode.')';
3902 3902
 				}
3903
-				$optlabel .= ' - ' . dol_trunc($label, $maxlengtharticle);
3903
+				$optlabel .= ' - '.dol_trunc($label, $maxlengtharticle);
3904 3904
 
3905 3905
 				$outvallabel = $objRef;
3906 3906
 				if (!empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) {
3907
-					$outvallabel .= ' (' . $objRefFourn . ')';
3907
+					$outvallabel .= ' ('.$objRefFourn.')';
3908 3908
 				}
3909 3909
 				if (isModEnabled('barcode') && !empty($objp->barcode)) {
3910
-					$outvallabel .= ' (' . $outbarcode . ')';
3910
+					$outvallabel .= ' ('.$outbarcode.')';
3911 3911
 				}
3912
-				$outvallabel .= ' - ' . dol_trunc($label, $maxlengtharticle);
3912
+				$outvallabel .= ' - '.dol_trunc($label, $maxlengtharticle);
3913 3913
 
3914 3914
 				// Units
3915 3915
 				$optlabel .= $outvalUnits;
@@ -3926,7 +3926,7 @@  discard block
 block discarded – undo
3926 3926
 						$prod_supplier->fourn_tva_tx = $objp->tva_tx;
3927 3927
 						$prod_supplier->fk_supplier_price_expression = $objp->fk_supplier_price_expression;
3928 3928
 
3929
-						require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
3929
+						require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
3930 3930
 						$priceparser = new PriceParser($this->db);
3931 3931
 						$price_result = $priceparser->parseProductSupplier($prod_supplier);
3932 3932
 						if ($price_result >= 0) {
@@ -3937,57 +3937,57 @@  discard block
 block discarded – undo
3937 3937
 						}
3938 3938
 					}
3939 3939
 					if ($objp->quantity == 1) {
3940
-						$optlabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/";
3941
-						$outvallabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency) . "/";
3940
+						$optlabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/";
3941
+						$outvallabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency)."/";
3942 3942
 						$optlabel .= $langs->trans("Unit"); // Do not use strtolower because it breaks utf8 encoding
3943 3943
 						$outvallabel .= $langs->transnoentities("Unit");
3944 3944
 					} else {
3945
-						$optlabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity;
3946
-						$outvallabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity;
3947
-						$optlabel .= ' ' . $langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding
3948
-						$outvallabel .= ' ' . $langs->transnoentities("Units");
3945
+						$optlabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity;
3946
+						$outvallabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity;
3947
+						$optlabel .= ' '.$langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding
3948
+						$outvallabel .= ' '.$langs->transnoentities("Units");
3949 3949
 					}
3950 3950
 
3951 3951
 					if ($objp->quantity > 1) {
3952
-						$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
3953
-						$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
3952
+						$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
3953
+						$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
3954 3954
 					}
3955 3955
 					if ($objp->remise_percent >= 1) {
3956
-						$optlabel .= " - " . $langs->trans("Discount") . " : " . vatrate($objp->remise_percent) . ' %';
3957
-						$outvallabel .= " - " . $langs->transnoentities("Discount") . " : " . vatrate($objp->remise_percent) . ' %';
3956
+						$optlabel .= " - ".$langs->trans("Discount")." : ".vatrate($objp->remise_percent).' %';
3957
+						$outvallabel .= " - ".$langs->transnoentities("Discount")." : ".vatrate($objp->remise_percent).' %';
3958 3958
 					}
3959 3959
 					if ($objp->duration) {
3960
-						$optlabel .= " - " . $objp->duration;
3961
-						$outvallabel .= " - " . $objp->duration;
3960
+						$optlabel .= " - ".$objp->duration;
3961
+						$outvallabel .= " - ".$objp->duration;
3962 3962
 					}
3963 3963
 					if (!$socid) {
3964
-						$optlabel .= " - " . dol_trunc($objp->name, 8);
3965
-						$outvallabel .= " - " . dol_trunc($objp->name, 8);
3964
+						$optlabel .= " - ".dol_trunc($objp->name, 8);
3965
+						$outvallabel .= " - ".dol_trunc($objp->name, 8);
3966 3966
 					}
3967 3967
 					if ($objp->supplier_reputation) {
3968 3968
 						//TODO dictionary
3969 3969
 						$reputations = array('' => $langs->trans('Standard'), 'FAVORITE' => $langs->trans('Favorite'), 'NOTTHGOOD' => $langs->trans('NotTheGoodQualitySupplier'), 'DONOTORDER' => $langs->trans('DoNotOrderThisProductToThisSupplier'));
3970 3970
 
3971
-						$optlabel .= " - " . $reputations[$objp->supplier_reputation];
3972
-						$outvallabel .= " - " . $reputations[$objp->supplier_reputation];
3971
+						$optlabel .= " - ".$reputations[$objp->supplier_reputation];
3972
+						$outvallabel .= " - ".$reputations[$objp->supplier_reputation];
3973 3973
 					}
3974 3974
 				} else {
3975
-					$optlabel .= " - <span class='opacitymedium'>" . $langs->trans("NoPriceDefinedForThisSupplier") . '</span>';
3976
-					$outvallabel .= ' - ' . $langs->transnoentities("NoPriceDefinedForThisSupplier");
3975
+					$optlabel .= " - <span class='opacitymedium'>".$langs->trans("NoPriceDefinedForThisSupplier").'</span>';
3976
+					$outvallabel .= ' - '.$langs->transnoentities("NoPriceDefinedForThisSupplier");
3977 3977
 				}
3978 3978
 
3979 3979
 				if (isModEnabled('stock') && $showstockinlist && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || getDolGlobalString('STOCK_SUPPORTS_SERVICES'))) {
3980 3980
 					$novirtualstock = ($showstockinlist == 2);
3981 3981
 
3982 3982
 					if ($user->hasRight('stock', 'lire')) {
3983
-						$outvallabel .= ' - ' . $langs->trans("Stock") . ': ' . price(price2num($objp->stock, 'MS'));
3983
+						$outvallabel .= ' - '.$langs->trans("Stock").': '.price(price2num($objp->stock, 'MS'));
3984 3984
 
3985 3985
 						if ($objp->stock > 0) {
3986 3986
 							$optlabel .= ' - <span class="product_line_stock_ok">';
3987 3987
 						} elseif ($objp->stock <= 0) {
3988 3988
 							$optlabel .= ' - <span class="product_line_stock_too_low">';
3989 3989
 						}
3990
-						$optlabel .= $langs->transnoentities("Stock") . ':' . price(price2num($objp->stock, 'MS'));
3990
+						$optlabel .= $langs->transnoentities("Stock").':'.price(price2num($objp->stock, 'MS'));
3991 3991
 						$optlabel .= '</span>';
3992 3992
 						if (empty($novirtualstock) && getDolGlobalString('STOCK_SHOW_VIRTUAL_STOCK_IN_PRODUCTS_COMBO')) {  // Warning, this option may slow down combo list generation
3993 3993
 							$langs->load("stocks");
@@ -3997,9 +3997,9 @@  discard block
 block discarded – undo
3997 3997
 							$tmpproduct->load_virtual_stock();
3998 3998
 							$virtualstock = $tmpproduct->stock_theorique;
3999 3999
 
4000
-							$outvallabel .= ' - ' . $langs->trans("VirtualStock") . ':' . $virtualstock;
4000
+							$outvallabel .= ' - '.$langs->trans("VirtualStock").':'.$virtualstock;
4001 4001
 
4002
-							$optlabel .= ' - ' . $langs->transnoentities("VirtualStock") . ':';
4002
+							$optlabel .= ' - '.$langs->transnoentities("VirtualStock").':';
4003 4003
 							if ($virtualstock > 0) {
4004 4004
 								$optlabel .= '<span class="product_line_stock_ok">';
4005 4005
 							} elseif ($virtualstock <= 0) {
@@ -4013,7 +4013,7 @@  discard block
 block discarded – undo
4013 4013
 					}
4014 4014
 				}
4015 4015
 
4016
-				$optstart = '<option value="' . $outkey . '"';
4016
+				$optstart = '<option value="'.$outkey.'"';
4017 4017
 				if ($selected && $selected == $objp->idprodfournprice) {
4018 4018
 					$optstart .= ' selected';
4019 4019
 				}
@@ -4022,31 +4022,31 @@  discard block
 block discarded – undo
4022 4022
 				}
4023 4023
 
4024 4024
 				if (!empty($objp->idprodfournprice) && $objp->idprodfournprice > 0) {
4025
-					$optstart .= ' data-product-id="' . dol_escape_htmltag($objp->rowid) . '"';
4026
-					$optstart .= ' data-price-id="' . dol_escape_htmltag($objp->idprodfournprice) . '"';
4027
-					$optstart .= ' data-qty="' . dol_escape_htmltag($objp->quantity) . '"';
4028
-					$optstart .= ' data-up="' . dol_escape_htmltag(price2num($objp->unitprice)) . '"';
4029
-					$optstart .= ' data-up-locale="' . dol_escape_htmltag(price($objp->unitprice)) . '"';
4030
-					$optstart .= ' data-discount="' . dol_escape_htmltag($outdiscount) . '"';
4031
-					$optstart .= ' data-tvatx="' . dol_escape_htmltag(price2num($objp->tva_tx)) . '"';
4032
-					$optstart .= ' data-tvatx-formated="' . dol_escape_htmltag(price($objp->tva_tx, 0, $langs, 1, -1, 2)) . '"';
4033
-					$optstart .= ' data-default-vat-code="' . dol_escape_htmltag($objp->default_vat_code) . '"';
4034
-					$optstart .= ' data-supplier-ref="' . dol_escape_htmltag($objp->ref_fourn) . '"';
4025
+					$optstart .= ' data-product-id="'.dol_escape_htmltag($objp->rowid).'"';
4026
+					$optstart .= ' data-price-id="'.dol_escape_htmltag($objp->idprodfournprice).'"';
4027
+					$optstart .= ' data-qty="'.dol_escape_htmltag($objp->quantity).'"';
4028
+					$optstart .= ' data-up="'.dol_escape_htmltag(price2num($objp->unitprice)).'"';
4029
+					$optstart .= ' data-up-locale="'.dol_escape_htmltag(price($objp->unitprice)).'"';
4030
+					$optstart .= ' data-discount="'.dol_escape_htmltag($outdiscount).'"';
4031
+					$optstart .= ' data-tvatx="'.dol_escape_htmltag(price2num($objp->tva_tx)).'"';
4032
+					$optstart .= ' data-tvatx-formated="'.dol_escape_htmltag(price($objp->tva_tx, 0, $langs, 1, -1, 2)).'"';
4033
+					$optstart .= ' data-default-vat-code="'.dol_escape_htmltag($objp->default_vat_code).'"';
4034
+					$optstart .= ' data-supplier-ref="'.dol_escape_htmltag($objp->ref_fourn).'"';
4035 4035
 					if (isModEnabled('multicurrency')) {
4036
-						$optstart .= ' data-multicurrency-code="' . dol_escape_htmltag($objp->multicurrency_code) . '"';
4037
-						$optstart .= ' data-multicurrency-up="' . dol_escape_htmltag($objp->multicurrency_unitprice) . '"';
4036
+						$optstart .= ' data-multicurrency-code="'.dol_escape_htmltag($objp->multicurrency_code).'"';
4037
+						$optstart .= ' data-multicurrency-up="'.dol_escape_htmltag($objp->multicurrency_unitprice).'"';
4038 4038
 					}
4039 4039
 				}
4040
-				$optstart .= ' data-description="' . dol_escape_htmltag($objp->description, 0, 1) . '"';
4040
+				$optstart .= ' data-description="'.dol_escape_htmltag($objp->description, 0, 1).'"';
4041 4041
 
4042 4042
 				$outarrayentry = array(
4043 4043
 					'key' => $outkey,
4044 4044
 					'value' => $outref,
4045 4045
 					'label' => $outvallabel,
4046 4046
 					'qty' => $outqty,
4047
-					'price_qty_ht' => price2num($objp->fprice, 'MU'),    // Keep higher resolution for price for the min qty
4048
-					'price_unit_ht' => price2num($objp->unitprice, 'MU'),    // This is used to fill the Unit Price
4049
-					'price_ht' => price2num($objp->unitprice, 'MU'),        // This is used to fill the Unit Price (for compatibility)
4047
+					'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty
4048
+					'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price
4049
+					'price_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility)
4050 4050
 					'tva_tx_formated' => price($objp->tva_tx, 0, $langs, 1, -1, 2),
4051 4051
 					'tva_tx' => price2num($objp->tva_tx),
4052 4052
 					'default_vat_code' => $objp->default_vat_code,
@@ -4077,17 +4077,17 @@  discard block
 block discarded – undo
4077 4077
 				// Add new entry
4078 4078
 				// "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
4079 4079
 				// "label" value of json key array is used by jQuery automatically as text for combo box
4080
-				$out .= $optstart . ' data-html="' . dol_escape_htmltag($optlabel) . '">' . $optlabel . "</option>\n";
4080
+				$out .= $optstart.' data-html="'.dol_escape_htmltag($optlabel).'">'.$optlabel."</option>\n";
4081 4081
 				$outarraypush = array(
4082 4082
 					'key' => $outkey,
4083 4083
 					'value' => $outref,
4084 4084
 					'label' => $outvallabel,
4085 4085
 					'qty' => $outqty,
4086
-					'price_qty_ht' => price2num($objp->fprice, 'MU'),        // Keep higher resolution for price for the min qty
4086
+					'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty
4087 4087
 					'price_qty_ht_locale' => price($objp->fprice),
4088
-					'price_unit_ht' => price2num($objp->unitprice, 'MU'),    // This is used to fill the Unit Price
4088
+					'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price
4089 4089
 					'price_unit_ht_locale' => price($objp->unitprice),
4090
-					'price_ht' => price2num($objp->unitprice, 'MU'),        // This is used to fill the Unit Price (for compatibility)
4090
+					'price_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility)
4091 4091
 					'tva_tx_formated' => price($objp->tva_tx),
4092 4092
 					'tva_tx' => price2num($objp->tva_tx),
4093 4093
 					'default_vat_code' => $objp->default_vat_code,
@@ -4120,7 +4120,7 @@  discard block
 block discarded – undo
4120 4120
 
4121 4121
 			$this->db->free($result);
4122 4122
 
4123
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
4123
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
4124 4124
 			$out .= ajax_combobox($htmlname);
4125 4125
 		} else {
4126 4126
 			dol_print_error($this->db);
@@ -4152,43 +4152,43 @@  discard block
 block discarded – undo
4152 4152
 		$sql = "SELECT p.rowid, p.ref, p.label, p.price, p.duration, pfp.fk_soc,";
4153 4153
 		$sql .= " pfp.ref_fourn, pfp.rowid as idprodfournprice, pfp.price as fprice, pfp.remise_percent, pfp.quantity, pfp.unitprice,";
4154 4154
 		$sql .= " pfp.fk_supplier_price_expression, pfp.fk_product, pfp.tva_tx, s.nom as name";
4155
-		$sql .= " FROM " . $this->db->prefix() . "product as p";
4156
-		$sql .= " LEFT JOIN " . $this->db->prefix() . "product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
4157
-		$sql .= " LEFT JOIN " . $this->db->prefix() . "societe as s ON pfp.fk_soc = s.rowid";
4158
-		$sql .= " WHERE pfp.entity IN (" . getEntity('productsupplierprice') . ")";
4155
+		$sql .= " FROM ".$this->db->prefix()."product as p";
4156
+		$sql .= " LEFT JOIN ".$this->db->prefix()."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
4157
+		$sql .= " LEFT JOIN ".$this->db->prefix()."societe as s ON pfp.fk_soc = s.rowid";
4158
+		$sql .= " WHERE pfp.entity IN (".getEntity('productsupplierprice').")";
4159 4159
 		$sql .= " AND p.tobuy = 1";
4160 4160
 		$sql .= " AND s.fournisseur = 1";
4161
-		$sql .= " AND p.rowid = " . ((int) $productid);
4161
+		$sql .= " AND p.rowid = ".((int) $productid);
4162 4162
 		if (!getDolGlobalString('PRODUCT_BEST_SUPPLIER_PRICE_PRESELECTED')) {
4163 4163
 			$sql .= " ORDER BY s.nom, pfp.ref_fourn DESC";
4164 4164
 		} else {
4165 4165
 			$sql .= " ORDER BY pfp.unitprice ASC";
4166 4166
 		}
4167 4167
 
4168
-		dol_syslog(get_class($this) . "::select_product_fourn_price", LOG_DEBUG);
4168
+		dol_syslog(get_class($this)."::select_product_fourn_price", LOG_DEBUG);
4169 4169
 		$result = $this->db->query($sql);
4170 4170
 
4171 4171
 		if ($result) {
4172 4172
 			$num = $this->db->num_rows($result);
4173 4173
 
4174
-			$form = '<select class="flat" id="select_' . $htmlname . '" name="' . $htmlname . '">';
4174
+			$form = '<select class="flat" id="select_'.$htmlname.'" name="'.$htmlname.'">';
4175 4175
 
4176 4176
 			if (!$num) {
4177
-				$form .= '<option value="0">-- ' . $langs->trans("NoSupplierPriceDefinedForThisProduct") . ' --</option>';
4177
+				$form .= '<option value="0">-- '.$langs->trans("NoSupplierPriceDefinedForThisProduct").' --</option>';
4178 4178
 			} else {
4179
-				require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
4179
+				require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
4180 4180
 				$form .= '<option value="0">&nbsp;</option>';
4181 4181
 
4182 4182
 				$i = 0;
4183 4183
 				while ($i < $num) {
4184 4184
 					$objp = $this->db->fetch_object($result);
4185 4185
 
4186
-					$opt = '<option value="' . $objp->idprodfournprice . '"';
4186
+					$opt = '<option value="'.$objp->idprodfournprice.'"';
4187 4187
 					//if there is only one supplier, preselect it
4188 4188
 					if ($num == 1 || ($selected_supplier > 0 && $objp->fk_soc == $selected_supplier) || ($i == 0 && getDolGlobalString('PRODUCT_BEST_SUPPLIER_PRICE_PRESELECTED'))) {
4189 4189
 						$opt .= ' selected';
4190 4190
 					}
4191
-					$opt .= '>' . $objp->name . ' - ' . $objp->ref_fourn . ' - ';
4191
+					$opt .= '>'.$objp->name.' - '.$objp->ref_fourn.' - ';
4192 4192
 
4193 4193
 					if (isModEnabled('dynamicprices') && !empty($objp->fk_supplier_price_expression)) {
4194 4194
 						$prod_supplier = new ProductFournisseur($this->db);
@@ -4198,7 +4198,7 @@  discard block
 block discarded – undo
4198 4198
 						$prod_supplier->fourn_tva_tx = $objp->tva_tx;
4199 4199
 						$prod_supplier->fk_supplier_price_expression = $objp->fk_supplier_price_expression;
4200 4200
 
4201
-						require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
4201
+						require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
4202 4202
 						$priceparser = new PriceParser($this->db);
4203 4203
 						$price_result = $priceparser->parseProductSupplier($prod_supplier);
4204 4204
 						if ($price_result >= 0) {
@@ -4209,10 +4209,10 @@  discard block
 block discarded – undo
4209 4209
 						}
4210 4210
 					}
4211 4211
 					if ($objp->quantity == 1) {
4212
-						$opt .= price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/";
4212
+						$opt .= price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/";
4213 4213
 					}
4214 4214
 
4215
-					$opt .= $objp->quantity . ' ';
4215
+					$opt .= $objp->quantity.' ';
4216 4216
 
4217 4217
 					if ($objp->quantity == 1) {
4218 4218
 						$opt .= $langs->trans("Unit");
@@ -4221,10 +4221,10 @@  discard block
 block discarded – undo
4221 4221
 					}
4222 4222
 					if ($objp->quantity > 1) {
4223 4223
 						$opt .= " - ";
4224
-						$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");
4224
+						$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");
4225 4225
 					}
4226 4226
 					if ($objp->duration) {
4227
-						$opt .= " - " . $objp->duration;
4227
+						$opt .= " - ".$objp->duration;
4228 4228
 					}
4229 4229
 					$opt .= "</option>\n";
4230 4230
 
@@ -4262,8 +4262,8 @@  discard block
 block discarded – undo
4262 4262
 		dol_syslog(__METHOD__, LOG_DEBUG);
4263 4263
 
4264 4264
 		$sql = "SELECT rowid, code, libelle as label, deposit_percent";
4265
-		$sql .= " FROM " . $this->db->prefix() . 'c_payment_term';
4266
-		$sql .= " WHERE entity IN (" . getEntity('c_payment_term') . ")";
4265
+		$sql .= " FROM ".$this->db->prefix().'c_payment_term';
4266
+		$sql .= " WHERE entity IN (".getEntity('c_payment_term').")";
4267 4267
 		$sql .= " AND active > 0";
4268 4268
 		$sql .= " ORDER BY sortorder";
4269 4269
 
@@ -4275,7 +4275,7 @@  discard block
 block discarded – undo
4275 4275
 				$obj = $this->db->fetch_object($resql);
4276 4276
 
4277 4277
 				// Si traduction existe, on l'utilise, sinon on prend le libelle par default
4278
-				$label = ($langs->trans("PaymentConditionShort" . $obj->code) != "PaymentConditionShort" . $obj->code ? $langs->trans("PaymentConditionShort" . $obj->code) : ($obj->label != '-' ? $obj->label : ''));
4278
+				$label = ($langs->trans("PaymentConditionShort".$obj->code) != "PaymentConditionShort".$obj->code ? $langs->trans("PaymentConditionShort".$obj->code) : ($obj->label != '-' ? $obj->label : ''));
4279 4279
 				$this->cache_conditions_paiements[$obj->rowid]['code'] = $obj->code;
4280 4280
 				$this->cache_conditions_paiements[$obj->rowid]['label'] = $label;
4281 4281
 				$this->cache_conditions_paiements[$obj->rowid]['deposit_percent'] = $obj->deposit_percent;
@@ -4303,7 +4303,7 @@  discard block
 block discarded – undo
4303 4303
 		// phpcs:enable
4304 4304
 		global $langs;
4305 4305
 
4306
-		$num = count($this->cache_availability);    // TODO Use $conf->cache['availability'] instead of $this->cache_availability
4306
+		$num = count($this->cache_availability); // TODO Use $conf->cache['availability'] instead of $this->cache_availability
4307 4307
 		if ($num > 0) {
4308 4308
 			return 0; // Cache already loaded
4309 4309
 		}
@@ -4313,7 +4313,7 @@  discard block
 block discarded – undo
4313 4313
 		$langs->load('propal');
4314 4314
 
4315 4315
 		$sql = "SELECT rowid, code, label, position";
4316
-		$sql .= " FROM " . $this->db->prefix() . 'c_availability';
4316
+		$sql .= " FROM ".$this->db->prefix().'c_availability';
4317 4317
 		$sql .= " WHERE active > 0";
4318 4318
 
4319 4319
 		$resql = $this->db->query($sql);
@@ -4324,7 +4324,7 @@  discard block
 block discarded – undo
4324 4324
 				$obj = $this->db->fetch_object($resql);
4325 4325
 
4326 4326
 				// Si traduction existe, on l'utilise, sinon on prend le libelle par default
4327
-				$label = ($langs->trans("AvailabilityType" . $obj->code) != "AvailabilityType" . $obj->code ? $langs->trans("AvailabilityType" . $obj->code) : ($obj->label != '-' ? $obj->label : ''));
4327
+				$label = ($langs->trans("AvailabilityType".$obj->code) != "AvailabilityType".$obj->code ? $langs->trans("AvailabilityType".$obj->code) : ($obj->label != '-' ? $obj->label : ''));
4328 4328
 				$this->cache_availability[$obj->rowid]['code'] = $obj->code;
4329 4329
 				$this->cache_availability[$obj->rowid]['label'] = $label;
4330 4330
 				$this->cache_availability[$obj->rowid]['position'] = $obj->position;
@@ -4356,17 +4356,17 @@  discard block
 block discarded – undo
4356 4356
 
4357 4357
 		$this->load_cache_availability();
4358 4358
 
4359
-		dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG);
4359
+		dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG);
4360 4360
 
4361
-		print '<select id="' . $htmlname . '" class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">';
4361
+		print '<select id="'.$htmlname.'" class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
4362 4362
 		if ($addempty) {
4363 4363
 			print '<option value="0">&nbsp;</option>';
4364 4364
 		}
4365 4365
 		foreach ($this->cache_availability as $id => $arrayavailability) {
4366 4366
 			if ($selected == $id) {
4367
-				print '<option value="' . $id . '" selected>';
4367
+				print '<option value="'.$id.'" selected>';
4368 4368
 			} else {
4369
-				print '<option value="' . $id . '">';
4369
+				print '<option value="'.$id.'">';
4370 4370
 			}
4371 4371
 			print dol_escape_htmltag($arrayavailability['label']);
4372 4372
 			print '</option>';
@@ -4387,13 +4387,13 @@  discard block
 block discarded – undo
4387 4387
 	{
4388 4388
 		global $langs;
4389 4389
 
4390
-		$num = count($this->cache_demand_reason);    // TODO Use $conf->cache['input_reason'] instead of $this->cache_demand_reason
4390
+		$num = count($this->cache_demand_reason); // TODO Use $conf->cache['input_reason'] instead of $this->cache_demand_reason
4391 4391
 		if ($num > 0) {
4392 4392
 			return 0; // Cache already loaded
4393 4393
 		}
4394 4394
 
4395 4395
 		$sql = "SELECT rowid, code, label";
4396
-		$sql .= " FROM " . $this->db->prefix() . 'c_input_reason';
4396
+		$sql .= " FROM ".$this->db->prefix().'c_input_reason';
4397 4397
 		$sql .= " WHERE active > 0";
4398 4398
 
4399 4399
 		$resql = $this->db->query($sql);
@@ -4406,8 +4406,8 @@  discard block
 block discarded – undo
4406 4406
 
4407 4407
 				// Si traduction existe, on l'utilise, sinon on prend le libelle par default
4408 4408
 				$label = ($obj->label != '-' ? $obj->label : '');
4409
-				if ($langs->trans("DemandReasonType" . $obj->code) != "DemandReasonType" . $obj->code) {
4410
-					$label = $langs->trans("DemandReasonType" . $obj->code); // So translation key DemandReasonTypeSRC_XXX will work
4409
+				if ($langs->trans("DemandReasonType".$obj->code) != "DemandReasonType".$obj->code) {
4410
+					$label = $langs->trans("DemandReasonType".$obj->code); // So translation key DemandReasonTypeSRC_XXX will work
4411 4411
 				}
4412 4412
 				if ($langs->trans($obj->code) != $obj->code) {
4413 4413
 					$label = $langs->trans($obj->code); // So translation key SRC_XXX will work
@@ -4447,9 +4447,9 @@  discard block
 block discarded – undo
4447 4447
 
4448 4448
 		$this->loadCacheInputReason();
4449 4449
 
4450
-		print '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="select_' . $htmlname . '" name="' . $htmlname . '">';
4450
+		print '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="select_'.$htmlname.'" name="'.$htmlname.'">';
4451 4451
 		if ($addempty) {
4452
-			print '<option value="0"' . (empty($selected) ? ' selected' : '') . '>&nbsp;</option>';
4452
+			print '<option value="0"'.(empty($selected) ? ' selected' : '').'>&nbsp;</option>';
4453 4453
 		}
4454 4454
 		foreach ($this->cache_demand_reason as $id => $arraydemandreason) {
4455 4455
 			if ($arraydemandreason['code'] == $exclude) {
@@ -4457,9 +4457,9 @@  discard block
 block discarded – undo
4457 4457
 			}
4458 4458
 
4459 4459
 			if ($selected && ($selected == $arraydemandreason['id'] || $selected == $arraydemandreason['code'])) {
4460
-				print '<option value="' . $arraydemandreason['id'] . '" selected>';
4460
+				print '<option value="'.$arraydemandreason['id'].'" selected>';
4461 4461
 			} else {
4462
-				print '<option value="' . $arraydemandreason['id'] . '">';
4462
+				print '<option value="'.$arraydemandreason['id'].'">';
4463 4463
 			}
4464 4464
 			$label = $arraydemandreason['label']; // Translation of label was already done into the ->loadCacheInputReason
4465 4465
 			print $langs->trans($label);
@@ -4469,7 +4469,7 @@  discard block
 block discarded – undo
4469 4469
 		if ($user->admin && empty($notooltip)) {
4470 4470
 			print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
4471 4471
 		}
4472
-		print ajax_combobox('select_' . $htmlname);
4472
+		print ajax_combobox('select_'.$htmlname);
4473 4473
 	}
4474 4474
 
4475 4475
 	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
@@ -4484,7 +4484,7 @@  discard block
 block discarded – undo
4484 4484
 		// phpcs:enable
4485 4485
 		global $langs;
4486 4486
 
4487
-		$num = count($this->cache_types_paiements);        // TODO Use $conf->cache['payment_mode'] instead of $this->cache_types_paiements
4487
+		$num = count($this->cache_types_paiements); // TODO Use $conf->cache['payment_mode'] instead of $this->cache_types_paiements
4488 4488
 		if ($num > 0) {
4489 4489
 			return $num; // Cache already loaded
4490 4490
 		}
@@ -4494,8 +4494,8 @@  discard block
 block discarded – undo
4494 4494
 		$this->cache_types_paiements = array();
4495 4495
 
4496 4496
 		$sql = "SELECT id, code, libelle as label, type, active";
4497
-		$sql .= " FROM " . $this->db->prefix() . "c_paiement";
4498
-		$sql .= " WHERE entity IN (" . getEntity('c_paiement') . ")";
4497
+		$sql .= " FROM ".$this->db->prefix()."c_paiement";
4498
+		$sql .= " WHERE entity IN (".getEntity('c_paiement').")";
4499 4499
 
4500 4500
 		$resql = $this->db->query($sql);
4501 4501
 		if ($resql) {
@@ -4505,7 +4505,7 @@  discard block
 block discarded – undo
4505 4505
 				$obj = $this->db->fetch_object($resql);
4506 4506
 
4507 4507
 				// Si traduction existe, on l'utilise, sinon on prend le libelle par default
4508
-				$label = ($langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) != "PaymentTypeShort" . $obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) : ($obj->label != '-' ? $obj->label : ''));
4508
+				$label = ($langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) != "PaymentTypeShort".$obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) : ($obj->label != '-' ? $obj->label : ''));
4509 4509
 				$this->cache_types_paiements[$obj->id]['id'] = $obj->id;
4510 4510
 				$this->cache_types_paiements[$obj->id]['code'] = $obj->code;
4511 4511
 				$this->cache_types_paiements[$obj->id]['label'] = $label;
@@ -4577,17 +4577,17 @@  discard block
 block discarded – undo
4577 4577
 		global $langs, $user, $conf;
4578 4578
 
4579 4579
 		$out = '';
4580
-		dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG);
4580
+		dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG);
4581 4581
 
4582 4582
 		$this->load_cache_conditions_paiements();
4583 4583
 
4584 4584
 		// Set default value if not already set by caller
4585 4585
 		if (empty($selected) && getDolGlobalString('MAIN_DEFAULT_PAYMENT_TERM_ID')) {
4586
-			dol_syslog(__METHOD__ . "Using deprecated option MAIN_DEFAULT_PAYMENT_TERM_ID", LOG_NOTICE);
4586
+			dol_syslog(__METHOD__."Using deprecated option MAIN_DEFAULT_PAYMENT_TERM_ID", LOG_NOTICE);
4587 4587
 			$selected = getDolGlobalString('MAIN_DEFAULT_PAYMENT_TERM_ID');
4588 4588
 		}
4589 4589
 
4590
-		$out .= '<select id="' . $htmlname . '" class="flat selectpaymentterms' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">';
4590
+		$out .= '<select id="'.$htmlname.'" class="flat selectpaymentterms'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
4591 4591
 		if ($addempty) {
4592 4592
 			$out .= '<option value="0">&nbsp;</option>';
4593 4593
 		}
@@ -4601,9 +4601,9 @@  discard block
 block discarded – undo
4601 4601
 
4602 4602
 			if ($selected == $id) {
4603 4603
 				$selectedDepositPercent = $deposit_percent > 0 ? $deposit_percent : $arrayconditions['deposit_percent'];
4604
-				$out .= '<option value="' . $id . '" data-deposit_percent="' . $arrayconditions['deposit_percent'] . '" selected>';
4604
+				$out .= '<option value="'.$id.'" data-deposit_percent="'.$arrayconditions['deposit_percent'].'" selected>';
4605 4605
 			} else {
4606
-				$out .= '<option value="' . $id . '" data-deposit_percent="' . $arrayconditions['deposit_percent'] . '">';
4606
+				$out .= '<option value="'.$id.'" data-deposit_percent="'.$arrayconditions['deposit_percent'].'">';
4607 4607
 			}
4608 4608
 			$label = $arrayconditions['label'];
4609 4609
 
@@ -4621,21 +4621,21 @@  discard block
 block discarded – undo
4621 4621
 		$out .= ajax_combobox($htmlname);
4622 4622
 
4623 4623
 		if ($deposit_percent >= 0) {
4624
-			$out .= ' <span id="' . $htmlname . '_deposit_percent_container"' . (empty($selectedDepositPercent) ? ' style="display: none"' : '') . '>';
4625
-			$out .= $langs->trans('DepositPercent') . ' : ';
4626
-			$out .= '<input id="' . $htmlname . '_deposit_percent" name="' . $htmlname . '_deposit_percent" class="maxwidth50" value="' . $deposit_percent . '" />';
4624
+			$out .= ' <span id="'.$htmlname.'_deposit_percent_container"'.(empty($selectedDepositPercent) ? ' style="display: none"' : '').'>';
4625
+			$out .= $langs->trans('DepositPercent').' : ';
4626
+			$out .= '<input id="'.$htmlname.'_deposit_percent" name="'.$htmlname.'_deposit_percent" class="maxwidth50" value="'.$deposit_percent.'" />';
4627 4627
 			$out .= '</span>';
4628 4628
 			$out .= '
4629
-				<script nonce="' . getNonce() . '">
4629
+				<script nonce="' . getNonce().'">
4630 4630
 					$(document).ready(function () {
4631
-						$("#' . $htmlname . '").change(function () {
4631
+						$("#' . $htmlname.'").change(function () {
4632 4632
 							let $selected = $(this).find("option:selected");
4633 4633
 							let depositPercent = $selected.attr("data-deposit_percent");
4634 4634
 
4635 4635
 							if (depositPercent.length > 0) {
4636
-								$("#' . $htmlname . '_deposit_percent_container").show().find("#' . $htmlname . '_deposit_percent").val(depositPercent);
4636
+								$("#' . $htmlname.'_deposit_percent_container").show().find("#'.$htmlname.'_deposit_percent").val(depositPercent);
4637 4637
 							} else {
4638
-								$("#' . $htmlname . '_deposit_percent_container").hide();
4638
+								$("#' . $htmlname.'_deposit_percent_container").hide();
4639 4639
 							}
4640 4640
 
4641 4641
 							return true;
@@ -4673,7 +4673,7 @@  discard block
 block discarded – undo
4673 4673
 
4674 4674
 		$out = '';
4675 4675
 
4676
-		dol_syslog(__METHOD__ . " " . $selected . ", " . $htmlname . ", " . $filtertype . ", " . $format, LOG_DEBUG);
4676
+		dol_syslog(__METHOD__." ".$selected.", ".$htmlname.", ".$filtertype.", ".$format, LOG_DEBUG);
4677 4677
 
4678 4678
 		$filterarray = array();
4679 4679
 		if ($filtertype == 'CRDT') {
@@ -4688,11 +4688,11 @@  discard block
 block discarded – undo
4688 4688
 
4689 4689
 		// Set default value if not already set by caller
4690 4690
 		if (empty($selected) && getDolGlobalString('MAIN_DEFAULT_PAYMENT_TYPE_ID')) {
4691
-			dol_syslog(__METHOD__ . "Using deprecated option MAIN_DEFAULT_PAYMENT_TYPE_ID", LOG_NOTICE);
4691
+			dol_syslog(__METHOD__."Using deprecated option MAIN_DEFAULT_PAYMENT_TYPE_ID", LOG_NOTICE);
4692 4692
 			$selected = getDolGlobalString('MAIN_DEFAULT_PAYMENT_TYPE_ID');
4693 4693
 		}
4694 4694
 
4695
-		$out .= '<select id="select' . $htmlname . '" class="flat selectpaymenttypes' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">';
4695
+		$out .= '<select id="select'.$htmlname.'" class="flat selectpaymenttypes'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
4696 4696
 		if ($empty) {
4697 4697
 			$out .= '<option value="">&nbsp;</option>';
4698 4698
 		}
@@ -4713,13 +4713,13 @@  discard block
 block discarded – undo
4713 4713
 			}
4714 4714
 
4715 4715
 			if ($format == 0) {
4716
-				$out .= '<option value="' . $id . '"';
4716
+				$out .= '<option value="'.$id.'"';
4717 4717
 			} elseif ($format == 1) {
4718
-				$out .= '<option value="' . $arraytypes['code'] . '"';
4718
+				$out .= '<option value="'.$arraytypes['code'].'"';
4719 4719
 			} elseif ($format == 2) {
4720
-				$out .= '<option value="' . $arraytypes['code'] . '"';
4720
+				$out .= '<option value="'.$arraytypes['code'].'"';
4721 4721
 			} elseif ($format == 3) {
4722
-				$out .= '<option value="' . $id . '"';
4722
+				$out .= '<option value="'.$id.'"';
4723 4723
 			}
4724 4724
 			// Print attribute selected or not
4725 4725
 			if ($format == 1 || $format == 2) {
@@ -4749,7 +4749,7 @@  discard block
 block discarded – undo
4749 4749
 		if ($user->admin && !$noadmininfo) {
4750 4750
 			$out .= info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
4751 4751
 		}
4752
-		$out .= ajax_combobox('select' . $htmlname);
4752
+		$out .= ajax_combobox('select'.$htmlname);
4753 4753
 
4754 4754
 		if (empty($nooutput)) {
4755 4755
 			print $out;
@@ -4771,22 +4771,22 @@  discard block
 block discarded – undo
4771 4771
 	{
4772 4772
 		global $langs;
4773 4773
 
4774
-		$return = '<select class="flat maxwidth100" id="select_' . $htmlname . '" name="' . $htmlname . '">';
4774
+		$return = '<select class="flat maxwidth100" id="select_'.$htmlname.'" name="'.$htmlname.'">';
4775 4775
 		$options = array(
4776 4776
 			'HT' => $langs->trans("HT"),
4777 4777
 			'TTC' => $langs->trans("TTC")
4778 4778
 		);
4779 4779
 		foreach ($options as $id => $value) {
4780 4780
 			if ($selected == $id) {
4781
-				$return .= '<option value="' . $id . '" selected>' . $value;
4781
+				$return .= '<option value="'.$id.'" selected>'.$value;
4782 4782
 			} else {
4783
-				$return .= '<option value="' . $id . '">' . $value;
4783
+				$return .= '<option value="'.$id.'">'.$value;
4784 4784
 			}
4785 4785
 			$return .= '</option>';
4786 4786
 		}
4787 4787
 		$return .= '</select>';
4788 4788
 		if ($addjscombo) {
4789
-			$return .= ajax_combobox('select_' . $htmlname);
4789
+			$return .= ajax_combobox('select_'.$htmlname);
4790 4790
 		}
4791 4791
 
4792 4792
 		return $return;
@@ -4804,7 +4804,7 @@  discard block
 block discarded – undo
4804 4804
 		// phpcs:enable
4805 4805
 		global $langs;
4806 4806
 
4807
-		$num = count($this->cache_transport_mode);        // TODO Use $conf->cache['payment_mode'] instead of $this->cache_transport_mode
4807
+		$num = count($this->cache_transport_mode); // TODO Use $conf->cache['payment_mode'] instead of $this->cache_transport_mode
4808 4808
 		if ($num > 0) {
4809 4809
 			return $num; // Cache already loaded
4810 4810
 		}
@@ -4814,8 +4814,8 @@  discard block
 block discarded – undo
4814 4814
 		$this->cache_transport_mode = array();
4815 4815
 
4816 4816
 		$sql = "SELECT rowid, code, label, active";
4817
-		$sql .= " FROM " . $this->db->prefix() . "c_transport_mode";
4818
-		$sql .= " WHERE entity IN (" . getEntity('c_transport_mode') . ")";
4817
+		$sql .= " FROM ".$this->db->prefix()."c_transport_mode";
4818
+		$sql .= " WHERE entity IN (".getEntity('c_transport_mode').")";
4819 4819
 
4820 4820
 		$resql = $this->db->query($sql);
4821 4821
 		if ($resql) {
@@ -4825,7 +4825,7 @@  discard block
 block discarded – undo
4825 4825
 				$obj = $this->db->fetch_object($resql);
4826 4826
 
4827 4827
 				// If traduction exist, we use it else we take the default label
4828
-				$label = ($langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) != "PaymentTypeShort" . $obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) : ($obj->label != '-' ? $obj->label : ''));
4828
+				$label = ($langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) != "PaymentTypeShort".$obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) : ($obj->label != '-' ? $obj->label : ''));
4829 4829
 				$this->cache_transport_mode[$obj->rowid]['rowid'] = $obj->rowid;
4830 4830
 				$this->cache_transport_mode[$obj->rowid]['code'] = $obj->code;
4831 4831
 				$this->cache_transport_mode[$obj->rowid]['label'] = $label;
@@ -4859,11 +4859,11 @@  discard block
 block discarded – undo
4859 4859
 	{
4860 4860
 		global $langs, $user;
4861 4861
 
4862
-		dol_syslog(__METHOD__ . " " . $selected . ", " . $htmlname . ", " . $format, LOG_DEBUG);
4862
+		dol_syslog(__METHOD__." ".$selected.", ".$htmlname.", ".$format, LOG_DEBUG);
4863 4863
 
4864 4864
 		$this->load_cache_transport_mode();
4865 4865
 
4866
-		print '<select id="select' . $htmlname . '" class="flat selectmodetransport' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">';
4866
+		print '<select id="select'.$htmlname.'" class="flat selectmodetransport'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
4867 4867
 		if ($empty) {
4868 4868
 			print '<option value="">&nbsp;</option>';
4869 4869
 		}
@@ -4879,13 +4879,13 @@  discard block
 block discarded – undo
4879 4879
 			}
4880 4880
 
4881 4881
 			if ($format == 0) {
4882
-				print '<option value="' . $id . '"';
4882
+				print '<option value="'.$id.'"';
4883 4883
 			} elseif ($format == 1) {
4884
-				print '<option value="' . $arraytypes['code'] . '"';
4884
+				print '<option value="'.$arraytypes['code'].'"';
4885 4885
 			} elseif ($format == 2) {
4886
-				print '<option value="' . $arraytypes['code'] . '"';
4886
+				print '<option value="'.$arraytypes['code'].'"';
4887 4887
 			} elseif ($format == 3) {
4888
-				print '<option value="' . $id . '"';
4888
+				print '<option value="'.$id.'"';
4889 4889
 			}
4890 4890
 			// If text is selected, we compare with code, else with id
4891 4891
 			if (preg_match('/[a-z]/i', $selected) && $selected == $arraytypes['code']) {
@@ -4933,31 +4933,31 @@  discard block
 block discarded – undo
4933 4933
 		$langs->load("deliveries");
4934 4934
 
4935 4935
 		$sql = "SELECT rowid, code, libelle as label";
4936
-		$sql .= " FROM " . $this->db->prefix() . "c_shipment_mode";
4936
+		$sql .= " FROM ".$this->db->prefix()."c_shipment_mode";
4937 4937
 		$sql .= " WHERE active > 0";
4938 4938
 		if ($filtre) {
4939
-			$sql .= " AND " . $filtre;
4939
+			$sql .= " AND ".$filtre;
4940 4940
 		}
4941 4941
 		$sql .= " ORDER BY libelle ASC";
4942 4942
 
4943
-		dol_syslog(get_class($this) . "::selectShippingMode", LOG_DEBUG);
4943
+		dol_syslog(get_class($this)."::selectShippingMode", LOG_DEBUG);
4944 4944
 		$result = $this->db->query($sql);
4945 4945
 		if ($result) {
4946 4946
 			$num = $this->db->num_rows($result);
4947 4947
 			$i = 0;
4948 4948
 			if ($num) {
4949
-				print '<select id="select' . $htmlname . '" class="flat selectshippingmethod' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>';
4949
+				print '<select id="select'.$htmlname.'" class="flat selectshippingmethod'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>';
4950 4950
 				if ($useempty == 1 || ($useempty == 2 && $num > 1)) {
4951 4951
 					print '<option value="-1">&nbsp;</option>';
4952 4952
 				}
4953 4953
 				while ($i < $num) {
4954 4954
 					$obj = $this->db->fetch_object($result);
4955 4955
 					if ($selected == $obj->rowid) {
4956
-						print '<option value="' . $obj->rowid . '" selected>';
4956
+						print '<option value="'.$obj->rowid.'" selected>';
4957 4957
 					} else {
4958
-						print '<option value="' . $obj->rowid . '">';
4958
+						print '<option value="'.$obj->rowid.'">';
4959 4959
 					}
4960
-					print ($langs->trans("SendingMethod" . strtoupper($obj->code)) != "SendingMethod" . strtoupper($obj->code)) ? $langs->trans("SendingMethod" . strtoupper($obj->code)) : $obj->label;
4960
+					print ($langs->trans("SendingMethod".strtoupper($obj->code)) != "SendingMethod".strtoupper($obj->code)) ? $langs->trans("SendingMethod".strtoupper($obj->code)) : $obj->label;
4961 4961
 					print '</option>';
4962 4962
 					$i++;
4963 4963
 				}
@@ -4966,7 +4966,7 @@  discard block
 block discarded – undo
4966 4966
 					print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
4967 4967
 				}
4968 4968
 
4969
-				print ajax_combobox('select' . $htmlname);
4969
+				print ajax_combobox('select'.$htmlname);
4970 4970
 			} else {
4971 4971
 				print $langs->trans("NoShippingMethodDefined");
4972 4972
 			}
@@ -4991,16 +4991,16 @@  discard block
 block discarded – undo
4991 4991
 		$langs->load("deliveries");
4992 4992
 
4993 4993
 		if ($htmlname != "none") {
4994
-			print '<form method="POST" action="' . $page . '">';
4994
+			print '<form method="POST" action="'.$page.'">';
4995 4995
 			print '<input type="hidden" name="action" value="setshippingmethod">';
4996
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
4996
+			print '<input type="hidden" name="token" value="'.newToken().'">';
4997 4997
 			$this->selectShippingMethod($selected, $htmlname, '', $addempty);
4998
-			print '<input type="submit" class="button valignmiddle" value="' . $langs->trans("Modify") . '">';
4998
+			print '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
4999 4999
 			print '</form>';
5000 5000
 		} else {
5001 5001
 			if ($selected) {
5002 5002
 				$code = $langs->getLabelFromKey($this->db, $selected, 'c_shipment_mode', 'rowid', 'code');
5003
-				print $langs->trans("SendingMethod" . strtoupper($code));
5003
+				print $langs->trans("SendingMethod".strtoupper($code));
5004 5004
 			} else {
5005 5005
 				print "&nbsp;";
5006 5006
 			}
@@ -5023,10 +5023,10 @@  discard block
 block discarded – undo
5023 5023
 
5024 5024
 		$opt = '<option value="" selected></option>';
5025 5025
 		$sql = "SELECT rowid, ref, situation_cycle_ref, situation_counter, situation_final, fk_soc";
5026
-		$sql .= ' FROM ' . $this->db->prefix() . 'facture';
5027
-		$sql .= ' WHERE entity IN (' . getEntity('invoice') . ')';
5026
+		$sql .= ' FROM '.$this->db->prefix().'facture';
5027
+		$sql .= ' WHERE entity IN ('.getEntity('invoice').')';
5028 5028
 		$sql .= ' AND situation_counter >= 1';
5029
-		$sql .= ' AND fk_soc = ' . (int) $socid;
5029
+		$sql .= ' AND fk_soc = '.(int) $socid;
5030 5030
 		$sql .= ' AND type <> 2';
5031 5031
 		$sql .= ' ORDER by situation_cycle_ref, situation_counter desc';
5032 5032
 		$resql = $this->db->query($sql);
@@ -5044,19 +5044,19 @@  discard block
 block discarded – undo
5044 5044
 						//Not prov?
5045 5045
 						if (substr($obj->ref, 1, 4) != 'PROV') {
5046 5046
 							if ($selected == $obj->rowid) {
5047
-								$opt .= '<option value="' . $obj->rowid . '" selected>' . $obj->ref . '</option>';
5047
+								$opt .= '<option value="'.$obj->rowid.'" selected>'.$obj->ref.'</option>';
5048 5048
 							} else {
5049
-								$opt .= '<option value="' . $obj->rowid . '">' . $obj->ref . '</option>';
5049
+								$opt .= '<option value="'.$obj->rowid.'">'.$obj->ref.'</option>';
5050 5050
 							}
5051 5051
 						}
5052 5052
 					}
5053 5053
 				}
5054 5054
 			}
5055 5055
 		} else {
5056
-			dol_syslog("Error sql=" . $sql . ", error=" . $this->error, LOG_ERR);
5056
+			dol_syslog("Error sql=".$sql.", error=".$this->error, LOG_ERR);
5057 5057
 		}
5058 5058
 		if ($opt == '<option value ="" selected></option>') {
5059
-			$opt = '<option value ="0" selected>' . $langs->trans('NoSituations') . '</option>';
5059
+			$opt = '<option value ="0" selected>'.$langs->trans('NoSituations').'</option>';
5060 5060
 		}
5061 5061
 		return $opt;
5062 5062
 	}
@@ -5076,12 +5076,12 @@  discard block
 block discarded – undo
5076 5076
 
5077 5077
 		$langs->load('products');
5078 5078
 
5079
-		$return = '<select class="flat" id="' . $htmlname . '" name="' . $htmlname . '">';
5079
+		$return = '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'">';
5080 5080
 
5081
-		$sql = "SELECT rowid, label, code FROM " . $this->db->prefix() . "c_units";
5081
+		$sql = "SELECT rowid, label, code FROM ".$this->db->prefix()."c_units";
5082 5082
 		$sql .= ' WHERE active > 0';
5083 5083
 		if (!empty($unit_type)) {
5084
-			$sql .= " AND unit_type = '" . $this->db->escape($unit_type) . "'";
5084
+			$sql .= " AND unit_type = '".$this->db->escape($unit_type)."'";
5085 5085
 		}
5086 5086
 		$sql .= " ORDER BY sortorder";
5087 5087
 
@@ -5093,14 +5093,14 @@  discard block
 block discarded – undo
5093 5093
 
5094 5094
 			while ($res = $this->db->fetch_object($resql)) {
5095 5095
 				$unitLabel = $res->label;
5096
-				if (!empty($langs->tab_translate['unit' . $res->code])) {    // check if Translation is available before
5097
-					$unitLabel = $langs->trans('unit' . $res->code) != $res->label ? $langs->trans('unit' . $res->code) : $res->label;
5096
+				if (!empty($langs->tab_translate['unit'.$res->code])) {    // check if Translation is available before
5097
+					$unitLabel = $langs->trans('unit'.$res->code) != $res->label ? $langs->trans('unit'.$res->code) : $res->label;
5098 5098
 				}
5099 5099
 
5100 5100
 				if ($selected == $res->rowid) {
5101
-					$return .= '<option value="' . $res->rowid . '" selected>' . $unitLabel . '</option>';
5101
+					$return .= '<option value="'.$res->rowid.'" selected>'.$unitLabel.'</option>';
5102 5102
 				} else {
5103
-					$return .= '<option value="' . $res->rowid . '">' . $unitLabel . '</option>';
5103
+					$return .= '<option value="'.$res->rowid.'">'.$unitLabel.'</option>';
5104 5104
 				}
5105 5105
 			}
5106 5106
 			$return .= '</select>';
@@ -5135,23 +5135,23 @@  discard block
 block discarded – undo
5135 5135
 		$num = 0;
5136 5136
 
5137 5137
 		$sql = "SELECT rowid, label, bank, clos as status, currency_code";
5138
-		$sql .= " FROM " . $this->db->prefix() . "bank_account";
5139
-		$sql .= " WHERE entity IN (" . getEntity('bank_account') . ")";
5138
+		$sql .= " FROM ".$this->db->prefix()."bank_account";
5139
+		$sql .= " WHERE entity IN (".getEntity('bank_account').")";
5140 5140
 		if ($status != 2) {
5141
-			$sql .= " AND clos = " . (int) $status;
5141
+			$sql .= " AND clos = ".(int) $status;
5142 5142
 		}
5143 5143
 		if ($filtre) {	// TODO Support USF
5144
-			$sql .= " AND " . $filtre;
5144
+			$sql .= " AND ".$filtre;
5145 5145
 		}
5146 5146
 		$sql .= " ORDER BY label";
5147 5147
 
5148
-		dol_syslog(get_class($this) . "::select_comptes", LOG_DEBUG);
5148
+		dol_syslog(get_class($this)."::select_comptes", LOG_DEBUG);
5149 5149
 		$result = $this->db->query($sql);
5150 5150
 		if ($result) {
5151 5151
 			$num = $this->db->num_rows($result);
5152 5152
 			$i = 0;
5153 5153
 			if ($num) {
5154
-				$out .= '<select id="select' . $htmlname . '" class="flat selectbankaccount' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>';
5154
+				$out .= '<select id="select'.$htmlname.'" class="flat selectbankaccount'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>';
5155 5155
 
5156 5156
 				if (!empty($useempty) && !is_numeric($useempty)) {
5157 5157
 					$out .= '<option value="-1">'.$langs->trans($useempty).'</option>';
@@ -5162,27 +5162,27 @@  discard block
 block discarded – undo
5162 5162
 				while ($i < $num) {
5163 5163
 					$obj = $this->db->fetch_object($result);
5164 5164
 					if ($selected == $obj->rowid || ($useempty == 2 && $num == 1 && empty($selected))) {
5165
-						$out .= '<option value="' . $obj->rowid . '" data-currency-code="' . $obj->currency_code . '" selected>';
5165
+						$out .= '<option value="'.$obj->rowid.'" data-currency-code="'.$obj->currency_code.'" selected>';
5166 5166
 					} else {
5167
-						$out .= '<option value="' . $obj->rowid . '" data-currency-code="' . $obj->currency_code . '">';
5167
+						$out .= '<option value="'.$obj->rowid.'" data-currency-code="'.$obj->currency_code.'">';
5168 5168
 					}
5169 5169
 					$out .= trim($obj->label);
5170 5170
 					if ($showcurrency) {
5171
-						$out .= ' (' . $obj->currency_code . ')';
5171
+						$out .= ' ('.$obj->currency_code.')';
5172 5172
 					}
5173 5173
 					if ($status == 2 && $obj->status == 1) {
5174
-						$out .= ' (' . $langs->trans("Closed") . ')';
5174
+						$out .= ' ('.$langs->trans("Closed").')';
5175 5175
 					}
5176 5176
 					$out .= '</option>';
5177 5177
 					$i++;
5178 5178
 				}
5179 5179
 				$out .= "</select>";
5180
-				$out .= ajax_combobox('select' . $htmlname);
5180
+				$out .= ajax_combobox('select'.$htmlname);
5181 5181
 			} else {
5182 5182
 				if ($status == 0) {
5183
-					$out .= '<span class="opacitymedium">' . $langs->trans("NoActiveBankAccountDefined") . '</span>';
5183
+					$out .= '<span class="opacitymedium">'.$langs->trans("NoActiveBankAccountDefined").'</span>';
5184 5184
 				} else {
5185
-					$out .= '<span class="opacitymedium">' . $langs->trans("NoBankAccountFound") . '</span>';
5185
+					$out .= '<span class="opacitymedium">'.$langs->trans("NoBankAccountFound").'</span>';
5186 5186
 				}
5187 5187
 			}
5188 5188
 		} else {
@@ -5218,23 +5218,23 @@  discard block
 block discarded – undo
5218 5218
 		$num = 0;
5219 5219
 
5220 5220
 		$sql = "SELECT rowid, name, fk_country, status, entity";
5221
-		$sql .= " FROM " . $this->db->prefix() . "establishment";
5221
+		$sql .= " FROM ".$this->db->prefix()."establishment";
5222 5222
 		$sql .= " WHERE 1=1";
5223 5223
 		if ($status != 2) {
5224
-			$sql .= " AND status = " . (int) $status;
5224
+			$sql .= " AND status = ".(int) $status;
5225 5225
 		}
5226 5226
 		if ($filtre) {	// TODO Support USF
5227
-			$sql .= " AND " . $filtre;
5227
+			$sql .= " AND ".$filtre;
5228 5228
 		}
5229 5229
 		$sql .= " ORDER BY name";
5230 5230
 
5231
-		dol_syslog(get_class($this) . "::select_establishment", LOG_DEBUG);
5231
+		dol_syslog(get_class($this)."::select_establishment", LOG_DEBUG);
5232 5232
 		$result = $this->db->query($sql);
5233 5233
 		if ($result) {
5234 5234
 			$num = $this->db->num_rows($result);
5235 5235
 			$i = 0;
5236 5236
 			if ($num) {
5237
-				print '<select id="select' . $htmlname . '" class="flat selectestablishment" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>';
5237
+				print '<select id="select'.$htmlname.'" class="flat selectestablishment" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>';
5238 5238
 				if ($useempty == 1 || ($useempty == 2 && $num > 1)) {
5239 5239
 					print '<option value="-1">&nbsp;</option>';
5240 5240
 				}
@@ -5242,13 +5242,13 @@  discard block
 block discarded – undo
5242 5242
 				while ($i < $num) {
5243 5243
 					$obj = $this->db->fetch_object($result);
5244 5244
 					if ($selected == $obj->rowid) {
5245
-						print '<option value="' . $obj->rowid . '" selected>';
5245
+						print '<option value="'.$obj->rowid.'" selected>';
5246 5246
 					} else {
5247
-						print '<option value="' . $obj->rowid . '">';
5247
+						print '<option value="'.$obj->rowid.'">';
5248 5248
 					}
5249 5249
 					print trim($obj->name);
5250 5250
 					if ($status == 2 && $obj->status == 1) {
5251
-						print ' (' . $langs->trans("Closed") . ')';
5251
+						print ' ('.$langs->trans("Closed").')';
5252 5252
 					}
5253 5253
 					print '</option>';
5254 5254
 					$i++;
@@ -5256,9 +5256,9 @@  discard block
 block discarded – undo
5256 5256
 				print "</select>";
5257 5257
 			} else {
5258 5258
 				if ($status == 0) {
5259
-					print '<span class="opacitymedium">' . $langs->trans("NoActiveEstablishmentDefined") . '</span>';
5259
+					print '<span class="opacitymedium">'.$langs->trans("NoActiveEstablishmentDefined").'</span>';
5260 5260
 				} else {
5261
-					print '<span class="opacitymedium">' . $langs->trans("NoEstablishmentFound") . '</span>';
5261
+					print '<span class="opacitymedium">'.$langs->trans("NoEstablishmentFound").'</span>';
5262 5262
 				}
5263 5263
 			}
5264 5264
 
@@ -5282,20 +5282,20 @@  discard block
 block discarded – undo
5282 5282
 	{
5283 5283
 		global $langs;
5284 5284
 		if ($htmlname != "none") {
5285
-			print '<form method="POST" action="' . $page . '">';
5285
+			print '<form method="POST" action="'.$page.'">';
5286 5286
 			print '<input type="hidden" name="action" value="setbankaccount">';
5287
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
5287
+			print '<input type="hidden" name="token" value="'.newToken().'">';
5288 5288
 			print img_picto('', 'bank_account', 'class="pictofixedwidth"');
5289 5289
 			$nbaccountfound = $this->select_comptes($selected, $htmlname, 0, '', $addempty);
5290 5290
 			if ($nbaccountfound > 0) {
5291
-				print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
5291
+				print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
5292 5292
 			}
5293 5293
 			print '</form>';
5294 5294
 		} else {
5295 5295
 			$langs->load('banks');
5296 5296
 
5297 5297
 			if ($selected) {
5298
-				require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php';
5298
+				require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
5299 5299
 				$bankstatic = new Account($this->db);
5300 5300
 				$result = $bankstatic->fetch($selected);
5301 5301
 				if ($result) {
@@ -5334,19 +5334,19 @@  discard block
 block discarded – undo
5334 5334
 		global $conf, $langs;
5335 5335
 		$langs->load("categories");
5336 5336
 
5337
-		include_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
5337
+		include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
5338 5338
 
5339 5339
 		// For backward compatibility
5340 5340
 		if (is_numeric($type)) {
5341
-			dol_syslog(__METHOD__ . ': using numeric value for parameter type is deprecated. Use string code instead.', LOG_WARNING);
5341
+			dol_syslog(__METHOD__.': using numeric value for parameter type is deprecated. Use string code instead.', LOG_WARNING);
5342 5342
 		}
5343 5343
 
5344 5344
 		if ($type === Categorie::TYPE_BANK_LINE) {
5345 5345
 			// TODO Move this into common category feature
5346 5346
 			$cate_arbo = array();
5347 5347
 			$sql = "SELECT c.label, c.rowid";
5348
-			$sql .= " FROM " . $this->db->prefix() . "category_bank as c";
5349
-			$sql .= " WHERE entity = " . $conf->entity;
5348
+			$sql .= " FROM ".$this->db->prefix()."category_bank as c";
5349
+			$sql .= " WHERE entity = ".$conf->entity;
5350 5350
 			$sql .= " ORDER BY c.label";
5351 5351
 			$result = $this->db->query($sql);
5352 5352
 			if ($result) {
@@ -5372,12 +5372,12 @@  discard block
 block discarded – undo
5372 5372
 		$outarrayrichhtml = array();
5373 5373
 
5374 5374
 
5375
-		$output = '<select class="flat minwidth100' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
5375
+		$output = '<select class="flat minwidth100'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
5376 5376
 		if (is_array($cate_arbo)) {
5377 5377
 			$num = count($cate_arbo);
5378 5378
 
5379 5379
 			if (!$num) {
5380
-				$output .= '<option value="-1" disabled>' . $langs->trans("NoCategoriesDefined") . '</option>';
5380
+				$output .= '<option value="-1" disabled>'.$langs->trans("NoCategoriesDefined").'</option>';
5381 5381
 			} else {
5382 5382
 				if ($useempty == 1 || ($useempty == 2 && $num > 1)) {
5383 5383
 					$output .= '<option value="-1">&nbsp;</option>';
@@ -5389,15 +5389,15 @@  discard block
 block discarded – undo
5389 5389
 						$add = '';
5390 5390
 					}
5391 5391
 
5392
-					$labeltoshow = img_picto('', 'category', 'class="pictofixedwidth" style="color: #' . $cate_arbo[$key]['color'] . '"');
5392
+					$labeltoshow = img_picto('', 'category', 'class="pictofixedwidth" style="color: #'.$cate_arbo[$key]['color'].'"');
5393 5393
 					$labeltoshow .= dol_trunc($cate_arbo[$key]['fulllabel'], $maxlength, 'middle');
5394 5394
 
5395 5395
 					$outarray[$cate_arbo[$key]['id']] = $cate_arbo[$key]['fulllabel'];
5396 5396
 
5397 5397
 					$outarrayrichhtml[$cate_arbo[$key]['id']] = $labeltoshow;
5398 5398
 
5399
-					$output .= '<option ' . $add . 'value="' . $cate_arbo[$key]['id'] . '"';
5400
-					$output .= ' data-html="' . dol_escape_htmltag($labeltoshow) . '"';
5399
+					$output .= '<option '.$add.'value="'.$cate_arbo[$key]['id'].'"';
5400
+					$output .= ' data-html="'.dol_escape_htmltag($labeltoshow).'"';
5401 5401
 					$output .= '>';
5402 5402
 					$output .= dol_trunc($cate_arbo[$key]['fulllabel'], $maxlength, 'middle');
5403 5403
 					$output .= '</option>';
@@ -5443,7 +5443,7 @@  discard block
 block discarded – undo
5443 5443
 	public function form_confirm($page, $title, $question, $action, $formquestion = array(), $selectedchoice = "", $useajax = 0, $height = 170, $width = 500)
5444 5444
 	{
5445 5445
 		// phpcs:enable
5446
-		dol_syslog(__METHOD__ . ': using form_confirm is deprecated. Use formconfim instead.', LOG_WARNING);
5446
+		dol_syslog(__METHOD__.': using form_confirm is deprecated. Use formconfim instead.', LOG_WARNING);
5447 5447
 		print $this->formconfirm($page, $title, $question, $action, $formquestion, $selectedchoice, $useajax, $height, $width);
5448 5448
 	}
5449 5449
 
@@ -5478,7 +5478,7 @@  discard block
 block discarded – undo
5478 5478
 	{
5479 5479
 		global $langs, $conf;
5480 5480
 
5481
-		$more = '<!-- formconfirm - before call, page=' . dol_escape_htmltag($page) . ' -->';
5481
+		$more = '<!-- formconfirm - before call, page='.dol_escape_htmltag($page).' -->';
5482 5482
 		$formconfirm = '';
5483 5483
 		$inputok = array();
5484 5484
 		$inputko = array();
@@ -5502,27 +5502,27 @@  discard block
 block discarded – undo
5502 5502
 			foreach ($formquestion as $key => $input) {
5503 5503
 				if (is_array($input) && !empty($input)) {
5504 5504
 					if ($input['type'] == 'hidden') {
5505
-						$moreattr = (!empty($input['moreattr']) ? ' ' . $input['moreattr'] : '');
5506
-						$morecss = (!empty($input['morecss']) ? ' ' . $input['morecss'] : '');
5505
+						$moreattr = (!empty($input['moreattr']) ? ' '.$input['moreattr'] : '');
5506
+						$morecss = (!empty($input['morecss']) ? ' '.$input['morecss'] : '');
5507 5507
 
5508
-						$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";
5508
+						$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";
5509 5509
 					}
5510 5510
 				}
5511 5511
 			}
5512 5512
 
5513 5513
 			// Now add questions
5514 5514
 			$moreonecolumn = '';
5515
-			$more .= '<div class="tagtable paddingtopbottomonly centpercent noborderspacing">' . "\n";
5515
+			$more .= '<div class="tagtable paddingtopbottomonly centpercent noborderspacing">'."\n";
5516 5516
 			foreach ($formquestion as $key => $input) {
5517 5517
 				if (is_array($input) && !empty($input)) {
5518
-					$size = (!empty($input['size']) ? ' size="' . $input['size'] . '"' : '');    // deprecated. Use morecss instead.
5519
-					$moreattr = (!empty($input['moreattr']) ? ' ' . $input['moreattr'] : '');
5520
-					$morecss = (!empty($input['morecss']) ? ' ' . $input['morecss'] : '');
5518
+					$size = (!empty($input['size']) ? ' size="'.$input['size'].'"' : ''); // deprecated. Use morecss instead.
5519
+					$moreattr = (!empty($input['moreattr']) ? ' '.$input['moreattr'] : '');
5520
+					$morecss = (!empty($input['morecss']) ? ' '.$input['morecss'] : '');
5521 5521
 
5522 5522
 					if ($input['type'] == 'text') {
5523
-						$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";
5523
+						$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";
5524 5524
 					} elseif ($input['type'] == 'password') {
5525
-						$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";
5525
+						$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";
5526 5526
 					} elseif ($input['type'] == 'textarea') {
5527 5527
 						/*$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div><div class="tagtd">';
5528 5528
 						$more .= '<textarea name="'.$input['name'].'" class="'.$morecss.'"'.$moreattr.'>';
@@ -5530,8 +5530,8 @@  discard block
 block discarded – undo
5530 5530
 						$more .= '</textarea>';
5531 5531
 						$more .= '</div></div>'."\n";*/
5532 5532
 						$moreonecolumn .= '<div class="margintoponly">';
5533
-						$moreonecolumn .= $input['label'] . '<br>';
5534
-						$moreonecolumn .= '<textarea name="' . dol_escape_htmltag($input['name']) . '" id="' . dol_escape_htmltag($input['name']) . '" class="' . $morecss . '"' . $moreattr . '>';
5533
+						$moreonecolumn .= $input['label'].'<br>';
5534
+						$moreonecolumn .= '<textarea name="'.dol_escape_htmltag($input['name']).'" id="'.dol_escape_htmltag($input['name']).'" class="'.$morecss.'"'.$moreattr.'>';
5535 5535
 						$moreonecolumn .= $input['value'];
5536 5536
 						$moreonecolumn .= '</textarea>';
5537 5537
 						$moreonecolumn .= '</div>';
@@ -5548,20 +5548,20 @@  discard block
 block discarded – undo
5548 5548
 						$disabled = isset($input['select_disabled']) ? $input['select_disabled'] : 0;
5549 5549
 						$sort = isset($input['select_sort']) ? $input['select_sort'] : '';
5550 5550
 
5551
-						$more .= '<div class="tagtr"><div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '">';
5551
+						$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">';
5552 5552
 						if (!empty($input['label'])) {
5553
-							$more .= $input['label'] . '</div><div class="tagtd left">';
5553
+							$more .= $input['label'].'</div><div class="tagtd left">';
5554 5554
 						}
5555 5555
 						if ($input['type'] == 'select') {
5556 5556
 							$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);
5557 5557
 						} else {
5558 5558
 							$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);
5559 5559
 						}
5560
-						$more .= '</div></div>' . "\n";
5560
+						$more .= '</div></div>'."\n";
5561 5561
 					} elseif ($input['type'] == 'checkbox') {
5562 5562
 						$more .= '<div class="tagtr">';
5563
-						$more .= '<div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '"><label for="' . dol_escape_htmltag($input['name']) . '">' . $input['label'] . '</label></div><div class="tagtd">';
5564
-						$more .= '<input type="checkbox" class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . dol_escape_htmltag($input['name']) . '" name="' . dol_escape_htmltag($input['name']) . '"' . $moreattr;
5563
+						$more .= '<div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'"><label for="'.dol_escape_htmltag($input['name']).'">'.$input['label'].'</label></div><div class="tagtd">';
5564
+						$more .= '<input type="checkbox" class="flat'.($morecss ? ' '.$morecss : '').'" id="'.dol_escape_htmltag($input['name']).'" name="'.dol_escape_htmltag($input['name']).'"'.$moreattr;
5565 5565
 						if (!is_bool($input['value']) && $input['value'] != 'false' && $input['value'] != '0' && $input['value'] != '') {
5566 5566
 							$more .= ' checked';
5567 5567
 						}
@@ -5572,19 +5572,19 @@  discard block
 block discarded – undo
5572 5572
 							$more .= ' disabled';
5573 5573
 						}
5574 5574
 						$more .= ' /></div>';
5575
-						$more .= '</div>' . "\n";
5575
+						$more .= '</div>'."\n";
5576 5576
 					} elseif ($input['type'] == 'radio') {
5577 5577
 						$i = 0;
5578 5578
 						foreach ($input['values'] as $selkey => $selval) {
5579 5579
 							$more .= '<div class="tagtr">';
5580 5580
 							if (isset($input['label'])) {
5581 5581
 								if ($i == 0) {
5582
-									$more .= '<div class="tagtd' . (empty($input['tdclass']) ? ' tdtop' : (' tdtop ' . $input['tdclass'])) . '">' . $input['label'] . '</div>';
5582
+									$more .= '<div class="tagtd'.(empty($input['tdclass']) ? ' tdtop' : (' tdtop '.$input['tdclass'])).'">'.$input['label'].'</div>';
5583 5583
 								} else {
5584
-									$more .= '<div class="tagtd' . (empty($input['tdclass']) ? '' : (' "' . $input['tdclass'])) . '">&nbsp;</div>';
5584
+									$more .= '<div class="tagtd'.(empty($input['tdclass']) ? '' : (' "'.$input['tdclass'])).'">&nbsp;</div>';
5585 5585
 								}
5586 5586
 							}
5587
-							$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;
5587
+							$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;
5588 5588
 							if (!empty($input['disabled'])) {
5589 5589
 								$more .= ' disabled';
5590 5590
 							}
@@ -5592,12 +5592,12 @@  discard block
 block discarded – undo
5592 5592
 								$more .= ' checked="checked"';
5593 5593
 							}
5594 5594
 							$more .= ' /> ';
5595
-							$more .= '<label for="' . dol_escape_htmltag($input['name'] . $selkey) . '" class="valignmiddle">' . $selval . '</label>';
5596
-							$more .= '</div></div>' . "\n";
5595
+							$more .= '<label for="'.dol_escape_htmltag($input['name'].$selkey).'" class="valignmiddle">'.$selval.'</label>';
5596
+							$more .= '</div></div>'."\n";
5597 5597
 							$i++;
5598 5598
 						}
5599 5599
 					} elseif ($input['type'] == 'date' || $input['type'] == 'datetime') {
5600
-						$more .= '<div class="tagtr"><div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '">' . $input['label'] . '</div>';
5600
+						$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div>';
5601 5601
 						$more .= '<div class="tagtd">';
5602 5602
 						$addnowlink = (empty($input['datenow']) ? 0 : 1);
5603 5603
 						$h = $m = 0;
@@ -5615,24 +5615,24 @@  discard block
 block discarded – undo
5615 5615
 					} elseif ($input['type'] == 'other') { // can be 1 column or 2 depending if label is set or not
5616 5616
 						$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">';
5617 5617
 						if (!empty($input['label'])) {
5618
-							$more .= $input['label'] . '</div><div class="tagtd">';
5618
+							$more .= $input['label'].'</div><div class="tagtd">';
5619 5619
 						}
5620 5620
 						$more .= $input['value'];
5621
-						$more .= '</div></div>' . "\n";
5621
+						$more .= '</div></div>'."\n";
5622 5622
 					} elseif ($input['type'] == 'onecolumn') {
5623 5623
 						$moreonecolumn .= '<div class="margintoponly">';
5624 5624
 						$moreonecolumn .= $input['value'];
5625
-						$moreonecolumn .= '</div>' . "\n";
5625
+						$moreonecolumn .= '</div>'."\n";
5626 5626
 					} elseif ($input['type'] == 'hidden') {
5627 5627
 						// Do nothing more, already added by a previous loop
5628 5628
 					} elseif ($input['type'] == 'separator') {
5629 5629
 						$more .= '<br>';
5630 5630
 					} else {
5631
-						$more .= 'Error type ' . $input['type'] . ' for the confirm box is not a supported type';
5631
+						$more .= 'Error type '.$input['type'].' for the confirm box is not a supported type';
5632 5632
 					}
5633 5633
 				}
5634 5634
 			}
5635
-			$more .= '</div>' . "\n";
5635
+			$more .= '</div>'."\n";
5636 5636
 			$more .= $moreonecolumn;
5637 5637
 		}
5638 5638
 
@@ -5654,10 +5654,10 @@  discard block
 block discarded – undo
5654 5654
 				$button = $useajax;
5655 5655
 				$useajax = 1;
5656 5656
 				$autoOpen = false;
5657
-				$dialogconfirm .= '-' . $button;
5657
+				$dialogconfirm .= '-'.$button;
5658 5658
 			}
5659
-			$pageyes = $page . (preg_match('/\?/', $page) ? '&' : '?') . 'action=' . urlencode($action) . '&confirm=yes';
5660
-			$pageno = ($useajax == 2 ? $page . (preg_match('/\?/', $page) ? '&' : '?') . 'action=' . urlencode($action) . '&confirm=no' : '');
5659
+			$pageyes = $page.(preg_match('/\?/', $page) ? '&' : '?').'action='.urlencode($action).'&confirm=yes';
5660
+			$pageno = ($useajax == 2 ? $page.(preg_match('/\?/', $page) ? '&' : '?').'action='.urlencode($action).'&confirm=no' : '');
5661 5661
 
5662 5662
 			// Add input fields into list of fields to read during submit (inputok and inputko)
5663 5663
 			if (is_array($formquestion)) {
@@ -5680,24 +5680,24 @@  discard block
 block discarded – undo
5680 5680
 			}
5681 5681
 
5682 5682
 			// Show JQuery confirm box.
5683
-			$formconfirm .= '<div id="' . $dialogconfirm . '" title="' . dol_escape_htmltag($title) . '" style="display: none;">';
5683
+			$formconfirm .= '<div id="'.$dialogconfirm.'" title="'.dol_escape_htmltag($title).'" style="display: none;">';
5684 5684
 			if (is_array($formquestion) && array_key_exists('text', $formquestion) && !empty($formquestion['text'])) {
5685
-				$formconfirm .= '<div class="confirmtext">' . $formquestion['text'] . '</div>' . "\n";
5685
+				$formconfirm .= '<div class="confirmtext">'.$formquestion['text'].'</div>'."\n";
5686 5686
 			}
5687 5687
 			if (!empty($more)) {
5688
-				$formconfirm .= '<div class="confirmquestions">' . $more . '</div>' . "\n";
5688
+				$formconfirm .= '<div class="confirmquestions">'.$more.'</div>'."\n";
5689 5689
 			}
5690
-			$formconfirm .= ($question ? '<div class="confirmmessage">' . img_help(0, '') . ' ' . $question . '</div>' : '');
5691
-			$formconfirm .= '</div>' . "\n";
5690
+			$formconfirm .= ($question ? '<div class="confirmmessage">'.img_help(0, '').' '.$question.'</div>' : '');
5691
+			$formconfirm .= '</div>'."\n";
5692 5692
 
5693
-			$formconfirm .= "\n<!-- begin code of popup for formconfirm page=" . $page . " -->\n";
5694
-			$formconfirm .= '<script nonce="' . getNonce() . '" type="text/javascript">' . "\n";
5693
+			$formconfirm .= "\n<!-- begin code of popup for formconfirm page=".$page." -->\n";
5694
+			$formconfirm .= '<script nonce="'.getNonce().'" type="text/javascript">'."\n";
5695 5695
 			$formconfirm .= "/* Code for the jQuery('#dialogforpopup').dialog() */\n";
5696 5696
 			$formconfirm .= 'jQuery(document).ready(function() {
5697 5697
             $(function() {
5698
-            	$( "#' . $dialogconfirm . '" ).dialog(
5698
+            	$( "#' . $dialogconfirm.'" ).dialog(
5699 5699
             	{
5700
-                    autoOpen: ' . ($autoOpen ? "true" : "false") . ',';
5700
+                    autoOpen: ' . ($autoOpen ? "true" : "false").',';
5701 5701
 			if ($newselectedchoice == 'no') {
5702 5702
 				$formconfirm .= '
5703 5703
 						open: function() {
@@ -5707,24 +5707,24 @@  discard block
 block discarded – undo
5707 5707
 
5708 5708
 			$jsforcursor = '';
5709 5709
 			if ($useajax == 1) {
5710
-				$jsforcursor = '// The call to urljump can be slow, so we set the wait cursor' . "\n";
5711
-				$jsforcursor .= 'jQuery("html,body,#id-container").addClass("cursorwait");' . "\n";
5710
+				$jsforcursor = '// The call to urljump can be slow, so we set the wait cursor'."\n";
5711
+				$jsforcursor .= 'jQuery("html,body,#id-container").addClass("cursorwait");'."\n";
5712 5712
 			}
5713 5713
 
5714 5714
 			$postconfirmas = 'GET';
5715 5715
 
5716 5716
 			$formconfirm .= '
5717 5717
                     resizable: false,
5718
-                    height: "' . $height . '",
5719
-                    width: "' . $width . '",
5718
+                    height: "' . $height.'",
5719
+                    width: "' . $width.'",
5720 5720
                     modal: true,
5721 5721
                     closeOnEscape: false,
5722 5722
                     buttons: {
5723
-                        "' . dol_escape_js($langs->transnoentities($labelbuttonyes)) . '": function() {
5724
-							var options = "token=' . urlencode(newToken()) . '";
5725
-                        	var inputok = ' . json_encode($inputok) . ';	/* List of fields into form */
5726
-							var page = "' . dol_escape_js(!empty($page) ? $page : '') . '";
5727
-                         	var pageyes = "' . dol_escape_js(!empty($pageyes) ? $pageyes : '') . '";
5723
+                        "' . dol_escape_js($langs->transnoentities($labelbuttonyes)).'": function() {
5724
+							var options = "token=' . urlencode(newToken()).'";
5725
+                        	var inputok = ' . json_encode($inputok).';	/* List of fields into form */
5726
+							var page = "' . dol_escape_js(!empty($page) ? $page : '').'";
5727
+                         	var pageyes = "' . dol_escape_js(!empty($pageyes) ? $pageyes : '').'";
5728 5728
 
5729 5729
                          	if (inputok.length > 0) {
5730 5730
                          		$.each(inputok, function(i, inputname) {
@@ -5758,11 +5758,11 @@  discard block
 block discarded – undo
5758 5758
 							}
5759 5759
 	                        $(this).dialog("close");
5760 5760
                         },
5761
-                        "' . dol_escape_js($langs->transnoentities($labelbuttonno)) . '": function() {
5762
-                        	var options = "token=' . urlencode(newToken()) . '";
5763
-                         	var inputko = ' . json_encode($inputko) . ';	/* List of fields into form */
5764
-							var page = "' . dol_escape_js(!empty($page) ? $page : '') . '";
5765
-                         	var pageno="' . dol_escape_js(!empty($pageno) ? $pageno : '') . '";
5761
+                        "' . dol_escape_js($langs->transnoentities($labelbuttonno)).'": function() {
5762
+                        	var options = "token=' . urlencode(newToken()).'";
5763
+                         	var inputko = ' . json_encode($inputko).';	/* List of fields into form */
5764
+							var page = "' . dol_escape_js(!empty($page) ? $page : '').'";
5765
+                         	var pageno="' . dol_escape_js(!empty($pageno) ? $pageno : '').'";
5766 5766
                          	if (inputko.length > 0) {
5767 5767
                          		$.each(inputko, function(i, inputname) {
5768 5768
                          			var more = "";
@@ -5794,10 +5794,10 @@  discard block
 block discarded – undo
5794 5794
                 }
5795 5795
                 );
5796 5796
 
5797
-            	var button = "' . $button . '";
5797
+            	var button = "' . $button.'";
5798 5798
             	if (button.length > 0) {
5799 5799
                 	$( "#" + button ).click(function() {
5800
-                		$("#' . $dialogconfirm . '").dialog("open");
5800
+                		$("#' . $dialogconfirm.'").dialog("open");
5801 5801
         			});
5802 5802
                 }
5803 5803
             });
@@ -5805,44 +5805,44 @@  discard block
 block discarded – undo
5805 5805
             </script>';
5806 5806
 			$formconfirm .= "<!-- end ajax formconfirm -->\n";
5807 5807
 		} else {
5808
-			$formconfirm .= "\n<!-- begin formconfirm page=" . dol_escape_htmltag($page) . " -->\n";
5808
+			$formconfirm .= "\n<!-- begin formconfirm page=".dol_escape_htmltag($page)." -->\n";
5809 5809
 
5810 5810
 			if (empty($disableformtag)) {
5811
-				$formconfirm .= '<form method="POST" action="' . $page . '" class="notoptoleftnoright">' . "\n";
5811
+				$formconfirm .= '<form method="POST" action="'.$page.'" class="notoptoleftnoright">'."\n";
5812 5812
 			}
5813 5813
 
5814
-			$formconfirm .= '<input type="hidden" name="action" value="' . $action . '">' . "\n";
5815
-			$formconfirm .= '<input type="hidden" name="token" value="' . newToken() . '">' . "\n";
5814
+			$formconfirm .= '<input type="hidden" name="action" value="'.$action.'">'."\n";
5815
+			$formconfirm .= '<input type="hidden" name="token" value="'.newToken().'">'."\n";
5816 5816
 
5817
-			$formconfirm .= '<table class="valid centpercent">' . "\n";
5817
+			$formconfirm .= '<table class="valid centpercent">'."\n";
5818 5818
 
5819 5819
 			// Line title
5820 5820
 			$formconfirm .= '<tr class="validtitre"><td class="validtitre" colspan="2">';
5821
-			$formconfirm .= img_picto('', 'pictoconfirm') . ' ' . $title;
5822
-			$formconfirm .= '</td></tr>' . "\n";
5821
+			$formconfirm .= img_picto('', 'pictoconfirm').' '.$title;
5822
+			$formconfirm .= '</td></tr>'."\n";
5823 5823
 
5824 5824
 			// Line text
5825 5825
 			if (is_array($formquestion) && array_key_exists('text', $formquestion) && !empty($formquestion['text'])) {
5826
-				$formconfirm .= '<tr class="valid"><td class="valid" colspan="2">' . $formquestion['text'] . '</td></tr>' . "\n";
5826
+				$formconfirm .= '<tr class="valid"><td class="valid" colspan="2">'.$formquestion['text'].'</td></tr>'."\n";
5827 5827
 			}
5828 5828
 
5829 5829
 			// Line form fields
5830 5830
 			if ($more) {
5831
-				$formconfirm .= '<tr class="valid"><td class="valid" colspan="2">' . "\n";
5831
+				$formconfirm .= '<tr class="valid"><td class="valid" colspan="2">'."\n";
5832 5832
 				$formconfirm .= $more;
5833
-				$formconfirm .= '</td></tr>' . "\n";
5833
+				$formconfirm .= '</td></tr>'."\n";
5834 5834
 			}
5835 5835
 
5836 5836
 			// Line with question
5837 5837
 			$formconfirm .= '<tr class="valid">';
5838
-			$formconfirm .= '<td class="valid">' . $question . '</td>';
5838
+			$formconfirm .= '<td class="valid">'.$question.'</td>';
5839 5839
 			$formconfirm .= '<td class="valid center">';
5840 5840
 			$formconfirm .= $this->selectyesno("confirm", $newselectedchoice, 0, false, 0, 0, 'marginleftonly marginrightonly', $labelbuttonyes, $labelbuttonno);
5841
-			$formconfirm .= '<input class="button valignmiddle confirmvalidatebutton small" type="submit" value="' . $langs->trans("Validate") . '">';
5841
+			$formconfirm .= '<input class="button valignmiddle confirmvalidatebutton small" type="submit" value="'.$langs->trans("Validate").'">';
5842 5842
 			$formconfirm .= '</td>';
5843
-			$formconfirm .= '</tr>' . "\n";
5843
+			$formconfirm .= '</tr>'."\n";
5844 5844
 
5845
-			$formconfirm .= '</table>' . "\n";
5845
+			$formconfirm .= '</table>'."\n";
5846 5846
 
5847 5847
 			if (empty($disableformtag)) {
5848 5848
 				$formconfirm .= "</form>\n";
@@ -5851,7 +5851,7 @@  discard block
 block discarded – undo
5851 5851
 
5852 5852
 			if (!empty($conf->use_javascript_ajax)) {
5853 5853
 				$formconfirm .= '<!-- code to disable button to avoid double clic -->';
5854
-				$formconfirm .= '<script nonce="' . getNonce() . '" type="text/javascript">' . "\n";
5854
+				$formconfirm .= '<script nonce="'.getNonce().'" type="text/javascript">'."\n";
5855 5855
 				$formconfirm .= '
5856 5856
 				$(document).ready(function () {
5857 5857
 					$(".confirmvalidatebutton").on("click", function() {
@@ -5863,7 +5863,7 @@  discard block
 block discarded – undo
5863 5863
 					});
5864 5864
 				});
5865 5865
 				';
5866
-				$formconfirm .= '</script>' . "\n";
5866
+				$formconfirm .= '</script>'."\n";
5867 5867
 			}
5868 5868
 
5869 5869
 			$formconfirm .= "<!-- end formconfirm -->\n";
@@ -5895,8 +5895,8 @@  discard block
 block discarded – undo
5895 5895
 		// phpcs:enable
5896 5896
 		global $langs;
5897 5897
 
5898
-		require_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php';
5899
-		require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php';
5898
+		require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
5899
+		require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
5900 5900
 
5901 5901
 		$out = '';
5902 5902
 
@@ -5904,11 +5904,11 @@  discard block
 block discarded – undo
5904 5904
 
5905 5905
 		$langs->load("project");
5906 5906
 		if ($htmlname != "none") {
5907
-			$out .= '<form method="post" action="' . $page . '">';
5907
+			$out .= '<form method="post" action="'.$page.'">';
5908 5908
 			$out .= '<input type="hidden" name="action" value="classin">';
5909
-			$out .= '<input type="hidden" name="token" value="' . newToken() . '">';
5909
+			$out .= '<input type="hidden" name="token" value="'.newToken().'">';
5910 5910
 			$out .= $formproject->select_projects($socid, $selected, $htmlname, $maxlength, 0, 1, $discard_closed, $forcefocus, 0, 0, '', 1, 0, $morecss);
5911
-			$out .= '<input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '">';
5911
+			$out .= '<input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">';
5912 5912
 			$out .= '</form>';
5913 5913
 		} else {
5914 5914
 			$out .= '<span class="project_head_block">';
@@ -5917,7 +5917,7 @@  discard block
 block discarded – undo
5917 5917
 				$projet->fetch($selected);
5918 5918
 				$out .= $projet->getNomUrl(0, '', 1);
5919 5919
 			} else {
5920
-				$out .= '<span class="opacitymedium">' . $textifnoproject . '</span>';
5920
+				$out .= '<span class="opacitymedium">'.$textifnoproject.'</span>';
5921 5921
 			}
5922 5922
 			$out .= '</span>';
5923 5923
 		}
@@ -5954,14 +5954,14 @@  discard block
 block discarded – undo
5954 5954
 		$out = '';
5955 5955
 
5956 5956
 		if ($htmlname != "none") {
5957
-			$out .= '<form method="POST" action="' . $page . '">';
5957
+			$out .= '<form method="POST" action="'.$page.'">';
5958 5958
 			$out .= '<input type="hidden" name="action" value="setconditions">';
5959
-			$out .= '<input type="hidden" name="token" value="' . newToken() . '">';
5959
+			$out .= '<input type="hidden" name="token" value="'.newToken().'">';
5960 5960
 			if ($type) {
5961
-				$out .= '<input type="hidden" name="type" value="' . dol_escape_htmltag($type) . '">';
5961
+				$out .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">';
5962 5962
 			}
5963 5963
 			$out .= $this->getSelectConditionsPaiements($selected, $htmlname, $filtertype, $addempty, 0, '', $deposit_percent);
5964
-			$out .= '<input type="submit" class="button valignmiddle smallpaddingimp" value="' . $langs->trans("Modify") . '">';
5964
+			$out .= '<input type="submit" class="button valignmiddle smallpaddingimp" value="'.$langs->trans("Modify").'">';
5965 5965
 			$out .= '</form>';
5966 5966
 		} else {
5967 5967
 			if ($selected) {
@@ -6006,12 +6006,12 @@  discard block
 block discarded – undo
6006 6006
 		// phpcs:enable
6007 6007
 		global $langs;
6008 6008
 		if ($htmlname != "none") {
6009
-			print '<form method="post" action="' . $page . '">';
6009
+			print '<form method="post" action="'.$page.'">';
6010 6010
 			print '<input type="hidden" name="action" value="setavailability">';
6011
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
6011
+			print '<input type="hidden" name="token" value="'.newToken().'">';
6012 6012
 			$this->selectAvailabilityDelay($selected, $htmlname, '', $addempty);
6013
-			print '<input type="submit" name="modify" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '">';
6014
-			print '<input type="submit" name="cancel" class="button smallpaddingimp" value="' . $langs->trans("Cancel") . '">';
6013
+			print '<input type="submit" name="modify" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">';
6014
+			print '<input type="submit" name="cancel" class="button smallpaddingimp" value="'.$langs->trans("Cancel").'">';
6015 6015
 			print '</form>';
6016 6016
 		} else {
6017 6017
 			if ($selected) {
@@ -6037,11 +6037,11 @@  discard block
 block discarded – undo
6037 6037
 	{
6038 6038
 		global $langs;
6039 6039
 		if ($htmlname != "none") {
6040
-			print '<form method="post" action="' . $page . '">';
6040
+			print '<form method="post" action="'.$page.'">';
6041 6041
 			print '<input type="hidden" name="action" value="setdemandreason">';
6042
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
6042
+			print '<input type="hidden" name="token" value="'.newToken().'">';
6043 6043
 			$this->selectInputReason($selected, $htmlname, '-1', $addempty);
6044
-			print '<input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '">';
6044
+			print '<input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">';
6045 6045
 			print '</form>';
6046 6046
 		} else {
6047 6047
 			if ($selected) {
@@ -6081,17 +6081,17 @@  discard block
 block discarded – undo
6081 6081
 		$ret = '';
6082 6082
 
6083 6083
 		if ($htmlname != "none") {
6084
-			$ret .= '<form method="POST" action="' . $page . '" name="form' . $htmlname . '">';
6085
-			$ret .= '<input type="hidden" name="action" value="set' . $htmlname . '">';
6086
-			$ret .= '<input type="hidden" name="token" value="' . newToken() . '">';
6084
+			$ret .= '<form method="POST" action="'.$page.'" name="form'.$htmlname.'">';
6085
+			$ret .= '<input type="hidden" name="action" value="set'.$htmlname.'">';
6086
+			$ret .= '<input type="hidden" name="token" value="'.newToken().'">';
6087 6087
 			if ($type) {
6088
-				$ret .= '<input type="hidden" name="type" value="' . dol_escape_htmltag($type) . '">';
6088
+				$ret .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">';
6089 6089
 			}
6090 6090
 			$ret .= '<table class="nobordernopadding">';
6091 6091
 			$ret .= '<tr><td>';
6092
-			$ret .= $this->selectDate($selected, $htmlname, $displayhour, $displaymin, 1, 'form' . $htmlname, 1, 0);
6092
+			$ret .= $this->selectDate($selected, $htmlname, $displayhour, $displaymin, 1, 'form'.$htmlname, 1, 0);
6093 6093
 			$ret .= '</td>';
6094
-			$ret .= '<td class="left"><input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '"></td>';
6094
+			$ret .= '<td class="left"><input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'"></td>';
6095 6095
 			$ret .= '</tr></table></form>';
6096 6096
 		} else {
6097 6097
 			if ($displayhour) {
@@ -6126,15 +6126,15 @@  discard block
 block discarded – undo
6126 6126
 		global $langs;
6127 6127
 
6128 6128
 		if ($htmlname != "none") {
6129
-			print '<form method="POST" action="' . $page . '" name="form' . $htmlname . '">';
6130
-			print '<input type="hidden" name="action" value="set' . $htmlname . '">';
6131
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
6129
+			print '<form method="POST" action="'.$page.'" name="form'.$htmlname.'">';
6130
+			print '<input type="hidden" name="action" value="set'.$htmlname.'">';
6131
+			print '<input type="hidden" name="token" value="'.newToken().'">';
6132 6132
 			print $this->select_dolusers($selected, $htmlname, 1, $exclude, 0, $include);
6133
-			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
6133
+			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
6134 6134
 			print '</form>';
6135 6135
 		} else {
6136 6136
 			if ($selected) {
6137
-				require_once DOL_DOCUMENT_ROOT . '/user/class/user.class.php';
6137
+				require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
6138 6138
 				$theuser = new User($this->db);
6139 6139
 				$theuser->fetch($selected);
6140 6140
 				print $theuser->getNomUrl(1);
@@ -6167,14 +6167,14 @@  discard block
 block discarded – undo
6167 6167
 
6168 6168
 		$out = '';
6169 6169
 		if ($htmlname != "none") {
6170
-			$out .= '<form method="POST" action="' . $page . '">';
6170
+			$out .= '<form method="POST" action="'.$page.'">';
6171 6171
 			$out .= '<input type="hidden" name="action" value="setmode">';
6172
-			$out .= '<input type="hidden" name="token" value="' . newToken() . '">';
6172
+			$out .= '<input type="hidden" name="token" value="'.newToken().'">';
6173 6173
 			if ($type) {
6174
-				$out .= '<input type="hidden" name="type" value="' . dol_escape_htmltag($type) . '">';
6174
+				$out .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">';
6175 6175
 			}
6176 6176
 			$out .= $this->select_types_paiements($selected, $htmlname, $filtertype, 0, $addempty, 0, 0, $active, '', 1);
6177
-			$out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
6177
+			$out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
6178 6178
 			$out .= '</form>';
6179 6179
 		} else {
6180 6180
 			if ($selected) {
@@ -6207,11 +6207,11 @@  discard block
 block discarded – undo
6207 6207
 	{
6208 6208
 		global $langs;
6209 6209
 		if ($htmlname != "none") {
6210
-			print '<form method="POST" action="' . $page . '">';
6210
+			print '<form method="POST" action="'.$page.'">';
6211 6211
 			print '<input type="hidden" name="action" value="settransportmode">';
6212
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
6212
+			print '<input type="hidden" name="token" value="'.newToken().'">';
6213 6213
 			$this->selectTransportMode($selected, $htmlname, 0, $addempty, 0, 0, $active);
6214
-			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
6214
+			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
6215 6215
 			print '</form>';
6216 6216
 		} else {
6217 6217
 			if ($selected) {
@@ -6238,14 +6238,14 @@  discard block
 block discarded – undo
6238 6238
 		// phpcs:enable
6239 6239
 		global $langs;
6240 6240
 		if ($htmlname != "none") {
6241
-			print '<form method="POST" action="' . $page . '">';
6241
+			print '<form method="POST" action="'.$page.'">';
6242 6242
 			print '<input type="hidden" name="action" value="setmulticurrencycode">';
6243
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
6243
+			print '<input type="hidden" name="token" value="'.newToken().'">';
6244 6244
 			print $this->selectMultiCurrency($selected, $htmlname, 0);
6245
-			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
6245
+			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
6246 6246
 			print '</form>';
6247 6247
 		} else {
6248
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
6248
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
6249 6249
 			print !empty($selected) ? currency_name($selected, 1) : '&nbsp;';
6250 6250
 		}
6251 6251
 	}
@@ -6267,22 +6267,22 @@  discard block
 block discarded – undo
6267 6267
 		global $langs, $mysoc, $conf;
6268 6268
 
6269 6269
 		if ($htmlname != "none") {
6270
-			print '<form method="POST" action="' . $page . '">';
6270
+			print '<form method="POST" action="'.$page.'">';
6271 6271
 			print '<input type="hidden" name="action" value="setmulticurrencyrate">';
6272
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
6273
-			print '<input type="text" class="maxwidth75" name="' . $htmlname . '" value="' . (!empty($rate) ? price(price2num($rate, 'CU')) : 1) . '" /> ';
6272
+			print '<input type="hidden" name="token" value="'.newToken().'">';
6273
+			print '<input type="text" class="maxwidth75" name="'.$htmlname.'" value="'.(!empty($rate) ? price(price2num($rate, 'CU')) : 1).'" /> ';
6274 6274
 			print '<select name="calculation_mode" id="calculation_mode">';
6275
-			print '<option value="1">Change ' . $langs->trans("PriceUHT") . ' of lines</option>';
6276
-			print '<option value="2">Change ' . $langs->trans("PriceUHTCurrency") . ' of lines</option>';
6275
+			print '<option value="1">Change '.$langs->trans("PriceUHT").' of lines</option>';
6276
+			print '<option value="2">Change '.$langs->trans("PriceUHTCurrency").' of lines</option>';
6277 6277
 			print '</select> ';
6278 6278
 			print ajax_combobox("calculation_mode");
6279
-			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
6279
+			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
6280 6280
 			print '</form>';
6281 6281
 		} else {
6282 6282
 			if (!empty($rate)) {
6283 6283
 				print price($rate, 1, $langs, 0, 0);
6284 6284
 				if ($currency && $rate != 1) {
6285
-					print ' &nbsp; <span class="opacitymedium">(' . price($rate, 1, $langs, 0, 0) . ' ' . $currency . ' = 1 ' . $conf->currency . ')</span>';
6285
+					print ' &nbsp; <span class="opacitymedium">('.price($rate, 1, $langs, 0, 0).' '.$currency.' = 1 '.$conf->currency.')</span>';
6286 6286
 				}
6287 6287
 			} else {
6288 6288
 				print 1;
@@ -6313,9 +6313,9 @@  discard block
 block discarded – undo
6313 6313
 		// phpcs:enable
6314 6314
 		global $conf, $langs;
6315 6315
 		if ($htmlname != "none") {
6316
-			print '<form method="post" action="' . $page . '">';
6316
+			print '<form method="post" action="'.$page.'">';
6317 6317
 			print '<input type="hidden" name="action" value="setabsolutediscount">';
6318
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
6318
+			print '<input type="hidden" name="token" value="'.newToken().'">';
6319 6319
 			print '<div class="inline-block">';
6320 6320
 			if (!empty($discount_type)) {
6321 6321
 				if (getDolGlobalString('FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS')) {
@@ -6353,24 +6353,24 @@  discard block
 block discarded – undo
6353 6353
 			print '</div>';
6354 6354
 			if (empty($hidelist)) {
6355 6355
 				print '<div class="inline-block" style="padding-right: 10px">';
6356
-				$newfilter = 'discount_type=' . intval($discount_type);
6356
+				$newfilter = 'discount_type='.intval($discount_type);
6357 6357
 				if (!empty($discount_type)) {
6358 6358
 					$newfilter .= ' AND fk_invoice_supplier IS NULL AND fk_invoice_supplier_line IS NULL'; // Supplier discounts available
6359 6359
 				} else {
6360 6360
 					$newfilter .= ' AND fk_facture IS NULL AND fk_facture_line IS NULL'; // Customer discounts available
6361 6361
 				}
6362 6362
 				if ($filter) {
6363
-					$newfilter .= ' AND (' . $filter . ')';
6363
+					$newfilter .= ' AND ('.$filter.')';
6364 6364
 				}
6365 6365
 				// output the combo of discounts
6366 6366
 				$nbqualifiedlines = $this->select_remises((string) $selected, $htmlname, $newfilter, $socid, $maxvalue);
6367 6367
 				if ($nbqualifiedlines > 0) {
6368
-					print ' &nbsp; <input type="submit" class="button smallpaddingimp" value="' . dol_escape_htmltag($langs->trans("UseLine")) . '"';
6368
+					print ' &nbsp; <input type="submit" class="button smallpaddingimp" value="'.dol_escape_htmltag($langs->trans("UseLine")).'"';
6369 6369
 					if (!empty($discount_type) && $filter && $filter != "fk_invoice_supplier_source IS NULL OR (description LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS PAID)%')") {
6370
-						print ' title="' . $langs->trans("UseCreditNoteInInvoicePayment") . '"';
6370
+						print ' title="'.$langs->trans("UseCreditNoteInInvoicePayment").'"';
6371 6371
 					}
6372 6372
 					if (empty($discount_type) && $filter && $filter != "fk_facture_source IS NULL OR (description LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS RECEIVED)%')") {
6373
-						print ' title="' . $langs->trans("UseCreditNoteInInvoicePayment") . '"';
6373
+						print ' title="'.$langs->trans("UseCreditNoteInInvoicePayment").'"';
6374 6374
 					}
6375 6375
 
6376 6376
 					print '>';
@@ -6410,23 +6410,23 @@  discard block
 block discarded – undo
6410 6410
 		global $langs;
6411 6411
 
6412 6412
 		if ($htmlname != "none") {
6413
-			print '<form method="post" action="' . $page . '">';
6413
+			print '<form method="post" action="'.$page.'">';
6414 6414
 			print '<input type="hidden" name="action" value="set_contact">';
6415
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
6415
+			print '<input type="hidden" name="token" value="'.newToken().'">';
6416 6416
 			print '<table class="nobordernopadding">';
6417 6417
 			print '<tr><td>';
6418 6418
 			print $this->selectcontacts($societe->id, $selected, $htmlname);
6419 6419
 			$num = $this->num;
6420 6420
 			if ($num == 0) {
6421 6421
 				$addcontact = (getDolGlobalString('SOCIETE_ADDRESSES_MANAGEMENT') ? $langs->trans("AddContact") : $langs->trans("AddContactAddress"));
6422
-				print '<a href="' . DOL_URL_ROOT . '/contact/card.php?socid=' . $societe->id . '&amp;action=create&amp;backtoreferer=1">' . $addcontact . '</a>';
6422
+				print '<a href="'.DOL_URL_ROOT.'/contact/card.php?socid='.$societe->id.'&amp;action=create&amp;backtoreferer=1">'.$addcontact.'</a>';
6423 6423
 			}
6424 6424
 			print '</td>';
6425
-			print '<td class="left"><input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '"></td>';
6425
+			print '<td class="left"><input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'"></td>';
6426 6426
 			print '</tr></table></form>';
6427 6427
 		} else {
6428 6428
 			if ($selected) {
6429
-				require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php';
6429
+				require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
6430 6430
 				$contact = new Contact($this->db);
6431 6431
 				$contact->fetch($selected);
6432 6432
 				print $contact->getFullName($langs);
@@ -6461,20 +6461,20 @@  discard block
 block discarded – undo
6461 6461
 
6462 6462
 		$out = '';
6463 6463
 		if ($htmlname != "none") {
6464
-			$out .= '<form method="post" action="' . $page . '">';
6464
+			$out .= '<form method="post" action="'.$page.'">';
6465 6465
 			$out .= '<input type="hidden" name="action" value="set_thirdparty">';
6466
-			$out .= '<input type="hidden" name="token" value="' . newToken() . '">';
6466
+			$out .= '<input type="hidden" name="token" value="'.newToken().'">';
6467 6467
 			$out .= $this->select_company($selected, $htmlname, $filter, $showempty, $showtype, $forcecombo, $events, 0, 'minwidth100', '', '', 1, array(), false, $excludeids);
6468
-			$out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
6468
+			$out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
6469 6469
 			$out .= '</form>';
6470 6470
 		} else {
6471 6471
 			if ($selected) {
6472
-				require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
6472
+				require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
6473 6473
 				$soc = new Societe($this->db);
6474 6474
 				$soc->fetch($selected);
6475 6475
 				$out .= $soc->getNomUrl(0, '');
6476 6476
 			} else {
6477
-				$out .= '<span class="opacitymedium">' . $textifnothirdparty . '</span>';
6477
+				$out .= '<span class="opacitymedium">'.$textifnothirdparty.'</span>';
6478 6478
 			}
6479 6479
 		}
6480 6480
 
@@ -6524,22 +6524,22 @@  discard block
 block discarded – undo
6524 6524
 			$selected = 'EUR'; // Pour compatibilite
6525 6525
 		}
6526 6526
 
6527
-		$out .= '<select class="flat maxwidth200onsmartphone minwidth300" name="' . $htmlname . '" id="' . $htmlname . '">';
6527
+		$out .= '<select class="flat maxwidth200onsmartphone minwidth300" name="'.$htmlname.'" id="'.$htmlname.'">';
6528 6528
 		if ($useempty) {
6529 6529
 			$out .= '<option value="-1" selected></option>';
6530 6530
 		}
6531 6531
 		foreach ($langs->cache_currencies as $code_iso => $currency) {
6532 6532
 			$labeltoshow = $currency['label'];
6533 6533
 			if ($mode == 1) {
6534
-				$labeltoshow .= ' <span class="opacitymedium">(' . $code_iso . ')</span>';
6534
+				$labeltoshow .= ' <span class="opacitymedium">('.$code_iso.')</span>';
6535 6535
 			} else {
6536
-				$labeltoshow .= ' <span class="opacitymedium">(' . $langs->getCurrencySymbol($code_iso) . ')</span>';
6536
+				$labeltoshow .= ' <span class="opacitymedium">('.$langs->getCurrencySymbol($code_iso).')</span>';
6537 6537
 			}
6538 6538
 
6539 6539
 			if ($selected && $selected == $code_iso) {
6540
-				$out .= '<option value="' . $code_iso . '" selected data-html="' . dol_escape_htmltag($labeltoshow) . '">';
6540
+				$out .= '<option value="'.$code_iso.'" selected data-html="'.dol_escape_htmltag($labeltoshow).'">';
6541 6541
 			} else {
6542
-				$out .= '<option value="' . $code_iso . '" data-html="' . dol_escape_htmltag($labeltoshow) . '">';
6542
+				$out .= '<option value="'.$code_iso.'" data-html="'.dol_escape_htmltag($labeltoshow).'">';
6543 6543
 			}
6544 6544
 			$out .= $labeltoshow;
6545 6545
 			$out .= '</option>';
@@ -6550,7 +6550,7 @@  discard block
 block discarded – undo
6550 6550
 		}
6551 6551
 
6552 6552
 		// Make select dynamic
6553
-		include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
6553
+		include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
6554 6554
 		$out .= ajax_combobox($htmlname);
6555 6555
 
6556 6556
 		return $out;
@@ -6576,10 +6576,10 @@  discard block
 block discarded – undo
6576 6576
 
6577 6577
 		$TCurrency = array();
6578 6578
 
6579
-		$sql = "SELECT code FROM " . $this->db->prefix() . "multicurrency";
6580
-		$sql .= " WHERE entity IN ('" . getEntity('mutlicurrency') . "')";
6579
+		$sql = "SELECT code FROM ".$this->db->prefix()."multicurrency";
6580
+		$sql .= " WHERE entity IN ('".getEntity('mutlicurrency')."')";
6581 6581
 		if ($filter) {
6582
-			$sql .= " AND " . $filter;
6582
+			$sql .= " AND ".$filter;
6583 6583
 		}
6584 6584
 		$resql = $this->db->query($sql);
6585 6585
 		if ($resql) {
@@ -6589,7 +6589,7 @@  discard block
 block discarded – undo
6589 6589
 		}
6590 6590
 
6591 6591
 		$out = '';
6592
-		$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
6592
+		$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
6593 6593
 		if ($useempty) {
6594 6594
 			$out .= '<option value="">&nbsp;</option>';
6595 6595
 		}
@@ -6601,13 +6601,13 @@  discard block
 block discarded – undo
6601 6601
 			foreach ($langs->cache_currencies as $code_iso => $currency) {
6602 6602
 				if (isset($TCurrency[$code_iso])) {
6603 6603
 					if (!empty($selected) && $selected == $code_iso) {
6604
-						$out .= '<option value="' . $code_iso . '" selected="selected">';
6604
+						$out .= '<option value="'.$code_iso.'" selected="selected">';
6605 6605
 					} else {
6606
-						$out .= '<option value="' . $code_iso . '">';
6606
+						$out .= '<option value="'.$code_iso.'">';
6607 6607
 					}
6608 6608
 
6609 6609
 					$out .= $currency['label'];
6610
-					$out .= ' (' . $langs->getCurrencySymbol($code_iso) . ')';
6610
+					$out .= ' ('.$langs->getCurrencySymbol($code_iso).')';
6611 6611
 					$out .= '</option>';
6612 6612
 				}
6613 6613
 			}
@@ -6616,7 +6616,7 @@  discard block
 block discarded – undo
6616 6616
 		$out .= '</select>';
6617 6617
 
6618 6618
 		// Make select dynamic
6619
-		include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
6619
+		include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
6620 6620
 		$out .= ajax_combobox($htmlname);
6621 6621
 
6622 6622
 		return $out;
@@ -6647,7 +6647,7 @@  discard block
 block discarded – undo
6647 6647
 		$sql .= " WHERE t.fk_pays = c.rowid";
6648 6648
 		$sql .= " AND t.active > 0";
6649 6649
 		$sql .= " AND t.entity IN (".getEntity('c_tva').")";
6650
-		$sql .= " AND c.code IN (" . $this->db->sanitize($country_code, 1) . ")";
6650
+		$sql .= " AND c.code IN (".$this->db->sanitize($country_code, 1).")";
6651 6651
 		$sql .= " ORDER BY t.code ASC, t.taux ASC, t.recuperableonly ASC";
6652 6652
 
6653 6653
 		$resql = $this->db->query($sql);
@@ -6659,30 +6659,30 @@  discard block
 block discarded – undo
6659 6659
 
6660 6660
 					$tmparray = array();
6661 6661
 					$tmparray['rowid']			= $obj->rowid;
6662
-					$tmparray['type_vat']		= $obj->type_vat;
6663
-					$tmparray['code']			= $obj->code;
6662
+					$tmparray['type_vat'] = $obj->type_vat;
6663
+					$tmparray['code'] = $obj->code;
6664 6664
 					$tmparray['txtva']			= $obj->taux;
6665
-					$tmparray['nprtva']			= $obj->recuperableonly;
6665
+					$tmparray['nprtva'] = $obj->recuperableonly;
6666 6666
 					$tmparray['localtax1']	    = $obj->localtax1;
6667 6667
 					$tmparray['localtax1_type']	= $obj->localtax1_type;
6668 6668
 					$tmparray['localtax2']	    = $obj->localtax2;
6669 6669
 					$tmparray['localtax2_type']	= $obj->localtax1_type;
6670
-					$tmparray['label']			= $obj->taux . '%' . ($obj->code ? ' (' . $obj->code . ')' : ''); // Label must contains only 0-9 , . % or *
6671
-					$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
6670
+					$tmparray['label'] = $obj->taux.'%'.($obj->code ? ' ('.$obj->code.')' : ''); // Label must contains only 0-9 , . % or *
6671
+					$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
6672 6672
 					$positiverates = '';
6673 6673
 					if ($obj->taux) {
6674
-						$positiverates .= ($positiverates ? '/' : '') . $obj->taux;
6674
+						$positiverates .= ($positiverates ? '/' : '').$obj->taux;
6675 6675
 					}
6676 6676
 					if ($obj->localtax1) {
6677
-						$positiverates .= ($positiverates ? '/' : '') . $obj->localtax1;
6677
+						$positiverates .= ($positiverates ? '/' : '').$obj->localtax1;
6678 6678
 					}
6679 6679
 					if ($obj->localtax2) {
6680
-						$positiverates .= ($positiverates ? '/' : '') . $obj->localtax2;
6680
+						$positiverates .= ($positiverates ? '/' : '').$obj->localtax2;
6681 6681
 					}
6682 6682
 					if (empty($positiverates)) {
6683 6683
 						$positiverates = '0';
6684 6684
 					}
6685
-					$tmparray['labelpositiverates'] = $positiverates . ($obj->code ? ' (' . $obj->code . ')' : ''); // Must never be used as key, only label
6685
+					$tmparray['labelpositiverates'] = $positiverates.($obj->code ? ' ('.$obj->code.')' : ''); // Must never be used as key, only label
6686 6686
 
6687 6687
 					$this->cache_vatrates[$obj->rowid] = $tmparray;
6688 6688
 				}
@@ -6702,7 +6702,7 @@  discard block
 block discarded – undo
6702 6702
 				return -1;
6703 6703
 			}
6704 6704
 		} else {
6705
-			$this->error = '<span class="error">' . $this->db->error() . '</span>';
6705
+			$this->error = '<span class="error">'.$this->db->error().'</span>';
6706 6706
 			return -2;
6707 6707
 		}
6708 6708
 	}
@@ -6755,9 +6755,9 @@  discard block
 block discarded – undo
6755 6755
 		// Check parameters
6756 6756
 		if (is_object($societe_vendeuse) && !$societe_vendeuse->country_code) {
6757 6757
 			if ($societe_vendeuse->id == $mysoc->id) {
6758
-				$return .= '<span class="error">' . $langs->trans("ErrorYourCountryIsNotDefined") . '</span>';
6758
+				$return .= '<span class="error">'.$langs->trans("ErrorYourCountryIsNotDefined").'</span>';
6759 6759
 			} else {
6760
-				$return .= '<span class="error">' . $langs->trans("ErrorSupplierCountryIsNotDefined") . '</span>';
6760
+				$return .= '<span class="error">'.$langs->trans("ErrorSupplierCountryIsNotDefined").'</span>';
6761 6761
 			}
6762 6762
 			return $return;
6763 6763
 		}
@@ -6769,12 +6769,12 @@  discard block
 block discarded – undo
6769 6769
 		// Define list of countries to use to search VAT rates to show
6770 6770
 		// First we defined code_country to use to find list
6771 6771
 		if (is_object($societe_vendeuse)) {
6772
-			$code_country = "'" . $societe_vendeuse->country_code . "'";
6772
+			$code_country = "'".$societe_vendeuse->country_code."'";
6773 6773
 		} else {
6774
-			$code_country = "'" . $mysoc->country_code . "'"; // Pour compatibilite ascendente
6774
+			$code_country = "'".$mysoc->country_code."'"; // Pour compatibilite ascendente
6775 6775
 		}
6776 6776
 		if (getDolGlobalString('SERVICE_ARE_ECOMMERCE_200238EC')) {    // If option to have vat for end customer for services is on
6777
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
6777
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
6778 6778
 			// If SERVICE_ARE_ECOMMERCE_200238EC=1 combo list vat rate of purchaser and seller countries
6779 6779
 			// If SERVICE_ARE_ECOMMERCE_200238EC=2 combo list only the vat rate of the purchaser country
6780 6780
 			$selectVatComboMode = getDolGlobalString('SERVICE_ARE_ECOMMERCE_200238EC');
@@ -6784,27 +6784,27 @@  discard block
 block discarded – undo
6784 6784
 					if ($type == 1) { // We know product is a service
6785 6785
 						switch ($selectVatComboMode) {
6786 6786
 							case '1':
6787
-								$code_country .= ",'" . $societe_acheteuse->country_code . "'";
6787
+								$code_country .= ",'".$societe_acheteuse->country_code."'";
6788 6788
 								break;
6789 6789
 							case '2':
6790
-								$code_country = "'" . $societe_acheteuse->country_code . "'";
6790
+								$code_country = "'".$societe_acheteuse->country_code."'";
6791 6791
 								break;
6792 6792
 						}
6793 6793
 					}
6794 6794
 				} elseif (!$idprod) {  // We don't know type of product
6795 6795
 					switch ($selectVatComboMode) {
6796 6796
 						case '1':
6797
-							$code_country .= ",'" . $societe_acheteuse->country_code . "'";
6797
+							$code_country .= ",'".$societe_acheteuse->country_code."'";
6798 6798
 							break;
6799 6799
 						case '2':
6800
-							$code_country = "'" . $societe_acheteuse->country_code . "'";
6800
+							$code_country = "'".$societe_acheteuse->country_code."'";
6801 6801
 							break;
6802 6802
 					}
6803 6803
 				} else {
6804 6804
 					$prodstatic = new Product($this->db);
6805 6805
 					$prodstatic->fetch($idprod);
6806 6806
 					if ($prodstatic->type == Product::TYPE_SERVICE) {   // We know product is a service
6807
-						$code_country .= ",'" . $societe_acheteuse->country_code . "'";
6807
+						$code_country .= ",'".$societe_acheteuse->country_code."'";
6808 6808
 					}
6809 6809
 				}
6810 6810
 			}
@@ -6866,13 +6866,13 @@  discard block
 block discarded – undo
6866 6866
 				// Override/enable VAT for expense report regardless of global setting - needed if expense report used for business expenses instead
6867 6867
 				// of using supplier invoices (this is a very bad idea !)
6868 6868
 				if (!getDolGlobalString('EXPENSEREPORT_OVERRIDE_VAT')) {
6869
-					$title = ' title="' . dol_escape_htmltag($langs->trans('VATIsNotUsed')) . '"';
6869
+					$title = ' title="'.dol_escape_htmltag($langs->trans('VATIsNotUsed')).'"';
6870 6870
 					$disabled = true;
6871 6871
 				}
6872 6872
 			}
6873 6873
 
6874 6874
 			if (!$options_only) {
6875
-				$return .= '<select class="flat minwidth75imp maxwidth100 right" id="' . $htmlname . '" name="' . $htmlname . '"' . ($disabled ? ' disabled' : '') . $title . '>';
6875
+				$return .= '<select class="flat minwidth75imp maxwidth100 right" id="'.$htmlname.'" name="'.$htmlname.'"'.($disabled ? ' disabled' : '').$title.'>';
6876 6876
 			}
6877 6877
 
6878 6878
 			$selectedfound = false;
@@ -6886,13 +6886,13 @@  discard block
 block discarded – undo
6886 6886
 				$key = $rate['txtva'];
6887 6887
 				$key .= $rate['nprtva'] ? '*' : '';
6888 6888
 				if ($mode > 0 && $rate['code']) {
6889
-					$key .= ' (' . $rate['code'] . ')';
6889
+					$key .= ' ('.$rate['code'].')';
6890 6890
 				}
6891 6891
 				if ($mode < 0) {
6892 6892
 					$key = $rate['rowid'];
6893 6893
 				}
6894 6894
 
6895
-				$return .= '<option value="' . $key . '"';
6895
+				$return .= '<option value="'.$key.'"';
6896 6896
 				if (!$selectedfound) {
6897 6897
 					if ($defaultcode) { // If defaultcode is defined, we used it in priority to select combo option instead of using rate+npr flag
6898 6898
 						if ($defaultcode == $rate['code']) {
@@ -6963,7 +6963,7 @@  discard block
 block discarded – undo
6963 6963
 	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 = '')
6964 6964
 	{
6965 6965
 		// phpcs:enable
6966
-		dol_syslog(__METHOD__ . ': using select_date is deprecated. Use selectDate instead.', LOG_WARNING);
6966
+		dol_syslog(__METHOD__.': using select_date is deprecated. Use selectDate instead.', LOG_WARNING);
6967 6967
 		$retstring = $this->selectDate($set_time, $prefix, $h, $m, $empty, $form_name, $d, $addnowlink, $disabled, $fullday, $addplusone, $adddateof);
6968 6968
 		if (!empty($nooutput)) {
6969 6969
 			return $retstring;
@@ -6992,11 +6992,11 @@  discard block
 block discarded – undo
6992 6992
 	{
6993 6993
 		global $langs;
6994 6994
 
6995
-		$ret = $this->selectDate($set_time, $prefix . '_start', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("from"), 'tzuserrel');
6995
+		$ret = $this->selectDate($set_time, $prefix.'_start', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("from"), 'tzuserrel');
6996 6996
 		if ($forcenewline) {
6997 6997
 			$ret .= '<br>';
6998 6998
 		}
6999
-		$ret .= $this->selectDate($set_time_end, $prefix . '_end', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"), 'tzuserrel');
6999
+		$ret .= $this->selectDate($set_time_end, $prefix.'_end', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"), 'tzuserrel');
7000 7000
 		return $ret;
7001 7001
 	}
7002 7002
 
@@ -7062,7 +7062,7 @@  discard block
 block discarded – undo
7062 7062
 		$orig_set_time = $set_time;
7063 7063
 
7064 7064
 		if ($set_time === '' && $emptydate == 0) {
7065
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
7065
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
7066 7066
 			if ($gm == 'tzuser' || $gm == 'tzuserrel') {
7067 7067
 				$set_time = dol_now($gm);
7068 7068
 			} else {
@@ -7134,38 +7134,38 @@  discard block
 block discarded – undo
7134 7134
 				// Calendrier popup version eldy
7135 7135
 				if ($usecalendar == "eldy") {
7136 7136
 					// Input area to enter date manually
7137
-					$retstring .= '<input id="' . $prefix . '" name="' . $prefix . '" type="text" class="maxwidthdate center" maxlength="11" value="' . $formated_date . '"';
7137
+					$retstring .= '<input id="'.$prefix.'" name="'.$prefix.'" type="text" class="maxwidthdate center" maxlength="11" value="'.$formated_date.'"';
7138 7138
 					$retstring .= ($disabled ? ' disabled' : '');
7139
-					$retstring .= ' onChange="dpChangeDay(\'' . $prefix . '\',\'' . $langs->trans("FormatDateShortJavaInput") . '\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript
7139
+					$retstring .= ' onChange="dpChangeDay(\''.$prefix.'\',\''.$langs->trans("FormatDateShortJavaInput").'\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript
7140 7140
 					$retstring .= ' autocomplete="off">';
7141 7141
 
7142 7142
 					// Icon calendar
7143 7143
 					$retstringbuttom = '';
7144 7144
 					if (!$disabled) {
7145
-						$retstringbuttom = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons"';
7146
-						$base = DOL_URL_ROOT . '/core/';
7147
-						$retstringbuttom .= ' onClick="showDP(\'' . $base . '\',\'' . $prefix . '\',\'' . $langs->trans("FormatDateShortJavaInput") . '\',\'' . $langs->defaultlang . '\');"';
7148
-						$retstringbuttom .= '>' . img_object($langs->trans("SelectDate"), 'calendarday', 'class="datecallink"') . '</button>';
7145
+						$retstringbuttom = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons"';
7146
+						$base = DOL_URL_ROOT.'/core/';
7147
+						$retstringbuttom .= ' onClick="showDP(\''.$base.'\',\''.$prefix.'\',\''.$langs->trans("FormatDateShortJavaInput").'\',\''.$langs->defaultlang.'\');"';
7148
+						$retstringbuttom .= '>'.img_object($langs->trans("SelectDate"), 'calendarday', 'class="datecallink"').'</button>';
7149 7149
 					} else {
7150
-						$retstringbuttom = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons">' . img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"') . '</button>';
7150
+						$retstringbuttom = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons">'.img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"').'</button>';
7151 7151
 					}
7152
-					$retstring = $retstringbuttom . $retstring;
7152
+					$retstring = $retstringbuttom.$retstring;
7153 7153
 
7154
-					$retstring .= '<input type="hidden" id="' . $prefix . 'day"   name="' . $prefix . 'day"   value="' . $sday . '">' . "\n";
7155
-					$retstring .= '<input type="hidden" id="' . $prefix . 'month" name="' . $prefix . 'month" value="' . $smonth . '">' . "\n";
7156
-					$retstring .= '<input type="hidden" id="' . $prefix . 'year"  name="' . $prefix . 'year"  value="' . $syear . '">' . "\n";
7154
+					$retstring .= '<input type="hidden" id="'.$prefix.'day"   name="'.$prefix.'day"   value="'.$sday.'">'."\n";
7155
+					$retstring .= '<input type="hidden" id="'.$prefix.'month" name="'.$prefix.'month" value="'.$smonth.'">'."\n";
7156
+					$retstring .= '<input type="hidden" id="'.$prefix.'year"  name="'.$prefix.'year"  value="'.$syear.'">'."\n";
7157 7157
 				} elseif ($usecalendar == 'jquery' || $usecalendar == 'html') {
7158 7158
 					if (!$disabled && $usecalendar != 'html') {
7159 7159
 						// Output javascript for datepicker
7160 7160
 						$minYear = getDolGlobalInt('MIN_YEAR_SELECT_DATE', (idate('Y') - 100));
7161 7161
 						$maxYear = getDolGlobalInt('MAX_YEAR_SELECT_DATE', (idate('Y') + 100));
7162 7162
 
7163
-						$retstring .= '<script nonce="' . getNonce() . '" type="text/javascript">';
7164
-						$retstring .= "$(function(){ $('#" . $prefix . "').datepicker({
7165
-							dateFormat: '" . $langs->trans("FormatDateShortJQueryInput") . "',
7163
+						$retstring .= '<script nonce="'.getNonce().'" type="text/javascript">';
7164
+						$retstring .= "$(function(){ $('#".$prefix."').datepicker({
7165
+							dateFormat: '" . $langs->trans("FormatDateShortJQueryInput")."',
7166 7166
 							autoclose: true,
7167 7167
 							todayHighlight: true,
7168
-							yearRange: '" . $minYear . ":" . $maxYear . "',";
7168
+							yearRange: '" . $minYear.":".$maxYear."',";
7169 7169
 						if (!empty($conf->dol_use_jmobile)) {
7170 7170
 							$retstring .= "
7171 7171
 								beforeShow: function (input, datePicker) {
@@ -7180,7 +7180,7 @@  discard block
 block discarded – undo
7180 7180
 						if (!getDolGlobalString('MAIN_POPUP_CALENDAR_ON_FOCUS')) {
7181 7181
 							$retstring .= "
7182 7182
 								showOn: 'button',	/* both has problem with autocompletion */
7183
-								buttonImage: '" . DOL_URL_ROOT . "/theme/" . dol_escape_js($conf->theme) . "/img/object_calendarday.png',
7183
+								buttonImage: '" . DOL_URL_ROOT."/theme/".dol_escape_js($conf->theme)."/img/object_calendarday.png',
7184 7184
 								buttonImageOnly: true";
7185 7185
 						}
7186 7186
 						$retstring .= "
@@ -7192,46 +7192,46 @@  discard block
 block discarded – undo
7192 7192
 					$retstring .= '<div class="nowraponall inline-block divfordateinput">';
7193 7193
 					$retstring .= '<input id="'.$prefix.'" name="'.$prefix.'" type="text" class="maxwidthdate center" maxlength="11" value="'.$formated_date.'"';
7194 7194
 					$retstring .= ($disabled ? ' disabled' : '');
7195
-					$retstring .= ($placeholder ? ' placeholder="' . dol_escape_htmltag($placeholder) . '"' : '');
7196
-					$retstring .= ' onChange="dpChangeDay(\'' . dol_escape_js($prefix) . '\',\'' . dol_escape_js($langs->trans("FormatDateShortJavaInput")) . '\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript
7195
+					$retstring .= ($placeholder ? ' placeholder="'.dol_escape_htmltag($placeholder).'"' : '');
7196
+					$retstring .= ' onChange="dpChangeDay(\''.dol_escape_js($prefix).'\',\''.dol_escape_js($langs->trans("FormatDateShortJavaInput")).'\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript
7197 7197
 					$retstring .= ' autocomplete="off">';
7198 7198
 
7199 7199
 					// Icone calendrier
7200 7200
 					if ($disabled) {
7201
-						$retstringbutton = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons">' . img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"') . '</button>';
7202
-						$retstring = $retstringbutton . $retstring;
7201
+						$retstringbutton = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons">'.img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"').'</button>';
7202
+						$retstring = $retstringbutton.$retstring;
7203 7203
 					}
7204 7204
 
7205 7205
 					$retstring .= '</div>';
7206
-					$retstring .= '<input type="hidden" id="' . $prefix . 'day"   name="' . $prefix . 'day"   value="' . $sday . '">' . "\n";
7207
-					$retstring .= '<input type="hidden" id="' . $prefix . 'month" name="' . $prefix . 'month" value="' . $smonth . '">' . "\n";
7208
-					$retstring .= '<input type="hidden" id="' . $prefix . 'year"  name="' . $prefix . 'year"  value="' . $syear . '">' . "\n";
7206
+					$retstring .= '<input type="hidden" id="'.$prefix.'day"   name="'.$prefix.'day"   value="'.$sday.'">'."\n";
7207
+					$retstring .= '<input type="hidden" id="'.$prefix.'month" name="'.$prefix.'month" value="'.$smonth.'">'."\n";
7208
+					$retstring .= '<input type="hidden" id="'.$prefix.'year"  name="'.$prefix.'year"  value="'.$syear.'">'."\n";
7209 7209
 				} else {
7210 7210
 					$retstring .= "Bad value of MAIN_POPUP_CALENDAR";
7211 7211
 				}
7212 7212
 			} else {
7213 7213
 				// Show date with combo selects
7214 7214
 				// Day
7215
-				$retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth50imp" id="' . $prefix . 'day" name="' . $prefix . 'day">';
7215
+				$retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50imp" id="'.$prefix.'day" name="'.$prefix.'day">';
7216 7216
 
7217 7217
 				if ($emptydate || $set_time == -1) {
7218 7218
 					$retstring .= '<option value="0" selected>&nbsp;</option>';
7219 7219
 				}
7220 7220
 
7221 7221
 				for ($day = 1; $day <= 31; $day++) {
7222
-					$retstring .= '<option value="' . $day . '"' . ($day == $sday ? ' selected' : '') . '>' . $day . '</option>';
7222
+					$retstring .= '<option value="'.$day.'"'.($day == $sday ? ' selected' : '').'>'.$day.'</option>';
7223 7223
 				}
7224 7224
 
7225 7225
 				$retstring .= "</select>";
7226 7226
 
7227
-				$retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth75imp" id="' . $prefix . 'month" name="' . $prefix . 'month">';
7227
+				$retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth75imp" id="'.$prefix.'month" name="'.$prefix.'month">';
7228 7228
 				if ($emptydate || $set_time == -1) {
7229 7229
 					$retstring .= '<option value="0" selected>&nbsp;</option>';
7230 7230
 				}
7231 7231
 
7232 7232
 				// Month
7233 7233
 				for ($month = 1; $month <= 12; $month++) {
7234
-					$retstring .= '<option value="' . $month . '"' . ($month == $smonth ? ' selected' : '') . '>';
7234
+					$retstring .= '<option value="'.$month.'"'.($month == $smonth ? ' selected' : '').'>';
7235 7235
 					$retstring .= dol_print_date(mktime(12, 0, 0, $month, 1, 2000), "%b");
7236 7236
 					$retstring .= "</option>";
7237 7237
 				}
@@ -7239,13 +7239,13 @@  discard block
 block discarded – undo
7239 7239
 
7240 7240
 				// Year
7241 7241
 				if ($emptydate || $set_time == -1) {
7242
-					$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 . '">';
7242
+					$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.'">';
7243 7243
 				} else {
7244
-					$retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth75imp" id="' . $prefix . 'year" name="' . $prefix . 'year">';
7244
+					$retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth75imp" id="'.$prefix.'year" name="'.$prefix.'year">';
7245 7245
 
7246 7246
 					$syear = (int) $syear;
7247 7247
 					for ($year = $syear - 10; $year < (int) $syear + 10; $year++) {
7248
-						$retstring .= '<option value="' . $year . '"' . ($year == $syear ? ' selected' : '') . '>' . $year . '</option>';
7248
+						$retstring .= '<option value="'.$year.'"'.($year == $syear ? ' selected' : '').'>'.$year.'</option>';
7249 7249
 					}
7250 7250
 					$retstring .= "</select>\n";
7251 7251
 				}
@@ -7269,15 +7269,15 @@  discard block
 block discarded – undo
7269 7269
 				}
7270 7270
 			}
7271 7271
 			// Show hour
7272
-			$retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth50 ' . ($fullday ? $fullday . 'hour' : '') . '" id="' . $prefix . 'hour" name="' . $prefix . 'hour">';
7272
+			$retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50 '.($fullday ? $fullday.'hour' : '').'" id="'.$prefix.'hour" name="'.$prefix.'hour">';
7273 7273
 			if ($emptyhours) {
7274 7274
 				$retstring .= '<option value="-1">&nbsp;</option>';
7275 7275
 			}
7276 7276
 			for ($hour = $hourstart; $hour < $hourend; $hour++) {
7277 7277
 				if (strlen($hour) < 2) {
7278
-					$hour = "0" . $hour;
7278
+					$hour = "0".$hour;
7279 7279
 				}
7280
-				$retstring .= '<option value="' . $hour . '"' . (($hour == $shour) ? ' selected' : '') . '>' . $hour;
7280
+				$retstring .= '<option value="'.$hour.'"'.(($hour == $shour) ? ' selected' : '').'>'.$hour;
7281 7281
 				//$retstring .= (empty($conf->dol_optimize_smallscreen) ? '' : 'H');
7282 7282
 				$retstring .= '</option>';
7283 7283
 			}
@@ -7290,17 +7290,17 @@  discard block
 block discarded – undo
7290 7290
 
7291 7291
 		if ($m) {
7292 7292
 			// Show minutes
7293
-			$retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth50 ' . ($fullday ? $fullday . 'min' : '') . '" id="' . $prefix . 'min" name="' . $prefix . 'min">';
7293
+			$retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50 '.($fullday ? $fullday.'min' : '').'" id="'.$prefix.'min" name="'.$prefix.'min">';
7294 7294
 			if ($emptyhours) {
7295 7295
 				$retstring .= '<option value="-1">&nbsp;</option>';
7296 7296
 			}
7297 7297
 			for ($min = 0; $min < 60; $min += $stepminutes) {
7298 7298
 				$min_str = sprintf("%02d", $min);
7299
-				$retstring .= '<option value="' . $min_str . '"' . (($min_str == $smin) ? ' selected' : '') . '>' . $min_str . '</option>';
7299
+				$retstring .= '<option value="'.$min_str.'"'.(($min_str == $smin) ? ' selected' : '').'>'.$min_str.'</option>';
7300 7300
 			}
7301 7301
 			$retstring .= '</select>';
7302 7302
 
7303
-			$retstring .= '<input type="hidden" name="' . $prefix . 'sec" value="' . $ssec . '">';
7303
+			$retstring .= '<input type="hidden" name="'.$prefix.'sec" value="'.$ssec.'">';
7304 7304
 		}
7305 7305
 
7306 7306
 		if ($d && $h) {
@@ -7323,10 +7323,10 @@  discard block
 block discarded – undo
7323 7323
 
7324 7324
 			// Generate the date part, depending on the use or not of the javascript calendar
7325 7325
 			if ($addnowlink == 1) { // server time expressed in user time setup
7326
-				$reset_scripts .= 'jQuery(\'#' . $prefix . '\').val(\'' . dol_print_date($nowgmt, 'day', 'tzuserrel') . '\');';
7327
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'day\').val(\'' . dol_print_date($nowgmt, '%d', 'tzuserrel') . '\');';
7328
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'month\').val(\'' . dol_print_date($nowgmt, '%m', 'tzuserrel') . '\');';
7329
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'year\').val(\'' . dol_print_date($nowgmt, '%Y', 'tzuserrel') . '\');';
7326
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'day', 'tzuserrel').'\');';
7327
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');';
7328
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');';
7329
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');';
7330 7330
 			} elseif ($addnowlink == 2) {
7331 7331
 				/* Disabled because the output does not use the string format defined by FormatDateShort key to forge the value into #prefix.
7332 7332
 				 * This break application for foreign languages.
@@ -7335,10 +7335,10 @@  discard block
 block discarded – undo
7335 7335
 				$reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(parseInt(d.getMonth().pad()) + 1);';
7336 7336
 				$reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(d.getFullYear());';
7337 7337
 				*/
7338
-				$reset_scripts .= 'jQuery(\'#' . $prefix . '\').val(\'' . dol_print_date($nowgmt, 'day', 'tzuserrel') . '\');';
7339
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'day\').val(\'' . dol_print_date($nowgmt, '%d', 'tzuserrel') . '\');';
7340
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'month\').val(\'' . dol_print_date($nowgmt, '%m', 'tzuserrel') . '\');';
7341
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'year\').val(\'' . dol_print_date($nowgmt, '%Y', 'tzuserrel') . '\');';
7338
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'day', 'tzuserrel').'\');';
7339
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');';
7340
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');';
7341
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');';
7342 7342
 			}
7343 7343
 			/*if ($usecalendar == "eldy")
7344 7344
 			{
@@ -7358,11 +7358,11 @@  discard block
 block discarded – undo
7358 7358
 				}
7359 7359
 				//$reset_scripts .= 'this.form.elements[\''.$prefix.'hour\'].value=formatDate(new Date(), \'HH\'); ';
7360 7360
 				if ($addnowlink == 1) {
7361
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').val(\'' . dol_print_date($nowgmt, '%H', 'tzuserrel') . '\');';
7362
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').change();';
7361
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(\''.dol_print_date($nowgmt, '%H', 'tzuserrel').'\');';
7362
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').change();';
7363 7363
 				} elseif ($addnowlink == 2) {
7364
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').val(d.getHours().pad());';
7365
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').change();';
7364
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(d.getHours().pad());';
7365
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').change();';
7366 7366
 				}
7367 7367
 
7368 7368
 				if ($fullday) {
@@ -7376,11 +7376,11 @@  discard block
 block discarded – undo
7376 7376
 				}
7377 7377
 				//$reset_scripts .= 'this.form.elements[\''.$prefix.'min\'].value=formatDate(new Date(), \'mm\'); ';
7378 7378
 				if ($addnowlink == 1) {
7379
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').val(\'' . dol_print_date($nowgmt, '%M', 'tzuserrel') . '\');';
7380
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').change();';
7379
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(\''.dol_print_date($nowgmt, '%M', 'tzuserrel').'\');';
7380
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').change();';
7381 7381
 				} elseif ($addnowlink == 2) {
7382
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').val(d.getMinutes().pad());';
7383
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').change();';
7382
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(d.getMinutes().pad());';
7383
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').change();';
7384 7384
 				}
7385 7385
 				if ($fullday) {
7386 7386
 					$reset_scripts .= ' } ';
@@ -7388,7 +7388,7 @@  discard block
 block discarded – undo
7388 7388
 			}
7389 7389
 			// If reset_scripts is not empty, print the link with the reset_scripts in the onClick
7390 7390
 			if ($reset_scripts && !getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
7391
-				$retstring .= ' <button class="dpInvisibleButtons datenowlink" id="' . $prefix . 'ButtonNow" type="button" name="_useless" value="now" onClick="' . $reset_scripts . '">';
7391
+				$retstring .= ' <button class="dpInvisibleButtons datenowlink" id="'.$prefix.'ButtonNow" type="button" name="_useless" value="now" onClick="'.$reset_scripts.'">';
7392 7392
 				$retstring .= $langs->trans("Now");
7393 7393
 				$retstring .= '</button> ';
7394 7394
 			}
@@ -7400,16 +7400,16 @@  discard block
 block discarded – undo
7400 7400
 			$reset_scripts = "";
7401 7401
 
7402 7402
 			// Generate the date part, depending on the use or not of the javascript calendar
7403
-			$reset_scripts .= 'jQuery(\'#' . $prefix . '\').val(\'' . dol_print_date($nowgmt, 'dayinputnoreduce', 'tzuserrel') . '\');';
7404
-			$reset_scripts .= 'jQuery(\'#' . $prefix . 'day\').val(\'' . dol_print_date($nowgmt, '%d', 'tzuserrel') . '\');';
7405
-			$reset_scripts .= 'jQuery(\'#' . $prefix . 'month\').val(\'' . dol_print_date($nowgmt, '%m', 'tzuserrel') . '\');';
7406
-			$reset_scripts .= 'jQuery(\'#' . $prefix . 'year\').val(\'' . dol_print_date($nowgmt, '%Y', 'tzuserrel') . '\');';
7403
+			$reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'dayinputnoreduce', 'tzuserrel').'\');';
7404
+			$reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');';
7405
+			$reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');';
7406
+			$reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');';
7407 7407
 			// Update the hour part
7408 7408
 			if ($h) {
7409 7409
 				if ($fullday) {
7410 7410
 					$reset_scripts .= " if (jQuery('#fullday:checked').val() == null) {";
7411 7411
 				}
7412
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').val(\'' . dol_print_date($nowgmt, '%H', 'tzuserrel') . '\');';
7412
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(\''.dol_print_date($nowgmt, '%H', 'tzuserrel').'\');';
7413 7413
 				if ($fullday) {
7414 7414
 					$reset_scripts .= ' } ';
7415 7415
 				}
@@ -7419,14 +7419,14 @@  discard block
 block discarded – undo
7419 7419
 				if ($fullday) {
7420 7420
 					$reset_scripts .= " if (jQuery('#fullday:checked').val() == null) {";
7421 7421
 				}
7422
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').val(\'' . dol_print_date($nowgmt, '%M', 'tzuserrel') . '\');';
7422
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(\''.dol_print_date($nowgmt, '%M', 'tzuserrel').'\');';
7423 7423
 				if ($fullday) {
7424 7424
 					$reset_scripts .= ' } ';
7425 7425
 				}
7426 7426
 			}
7427 7427
 			// If reset_scripts is not empty, print the link with the reset_scripts in the onClick
7428 7428
 			if ($reset_scripts && empty($conf->dol_optimize_smallscreen)) {
7429
-				$retstring .= ' <button class="dpInvisibleButtons datenowlink" id="' . $prefix . 'ButtonPlusOne" type="button" name="_useless2" value="plusone" onClick="' . $reset_scripts . '">';
7429
+				$retstring .= ' <button class="dpInvisibleButtons datenowlink" id="'.$prefix.'ButtonPlusOne" type="button" name="_useless2" value="plusone" onClick="'.$reset_scripts.'">';
7430 7430
 				$retstring .= $langs->trans("DateStartPlusOne");
7431 7431
 				$retstring .= '</button> ';
7432 7432
 			}
@@ -7484,17 +7484,17 @@  discard block
 block discarded – undo
7484 7484
 			unset($TDurationTypes[$value]);
7485 7485
 		}
7486 7486
 
7487
-		$retstring = '<select class="flat minwidth75 maxwidth100" id="select_' . $prefix . 'type_duration" name="' . $prefix . 'type_duration">';
7487
+		$retstring = '<select class="flat minwidth75 maxwidth100" id="select_'.$prefix.'type_duration" name="'.$prefix.'type_duration">';
7488 7488
 		foreach ($TDurationTypes as $key => $typeduration) {
7489
-			$retstring .= '<option value="' . $key . '"';
7489
+			$retstring .= '<option value="'.$key.'"';
7490 7490
 			if ($key == $selected) {
7491 7491
 				$retstring .= " selected";
7492 7492
 			}
7493
-			$retstring .= ">" . $typeduration . "</option>";
7493
+			$retstring .= ">".$typeduration."</option>";
7494 7494
 		}
7495 7495
 		$retstring .= "</select>";
7496 7496
 
7497
-		$retstring .= ajax_combobox('select_' . $prefix . 'type_duration');
7497
+		$retstring .= ajax_combobox('select_'.$prefix.'type_duration');
7498 7498
 
7499 7499
 		return $retstring;
7500 7500
 	}
@@ -7526,30 +7526,30 @@  discard block
 block discarded – undo
7526 7526
 
7527 7527
 		// Hours
7528 7528
 		if ($iSecond != '') {
7529
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
7529
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
7530 7530
 
7531 7531
 			$hourSelected = convertSecondToTime($iSecond, 'allhour');
7532 7532
 			$minSelected = convertSecondToTime($iSecond, 'min');
7533 7533
 		}
7534 7534
 
7535 7535
 		if ($typehour == 'select') {
7536
-			$retstring .= '<select class="flat" id="select_' . $prefix . 'hour" name="' . $prefix . 'hour"' . ($disabled ? ' disabled' : '') . '>';
7536
+			$retstring .= '<select class="flat" id="select_'.$prefix.'hour" name="'.$prefix.'hour"'.($disabled ? ' disabled' : '').'>';
7537 7537
 			for ($hour = 0; $hour < 25; $hour++) {    // For a duration, we allow 24 hours
7538
-				$retstring .= '<option value="' . $hour . '"';
7538
+				$retstring .= '<option value="'.$hour.'"';
7539 7539
 				if (is_numeric($hourSelected) && $hourSelected == $hour) {
7540 7540
 					$retstring .= " selected";
7541 7541
 				}
7542
-				$retstring .= ">" . $hour . "</option>";
7542
+				$retstring .= ">".$hour."</option>";
7543 7543
 			}
7544 7544
 			$retstring .= "</select>";
7545 7545
 		} elseif ($typehour == 'text' || $typehour == 'textselect') {
7546
-			$retstring .= '<input placeholder="' . $langs->trans('HourShort') . '" type="number" min="0" name="' . $prefix . 'hour"' . ($disabled ? ' disabled' : '') . ' class="flat maxwidth50 inputhour right" value="' . (($hourSelected != '') ? ((int) $hourSelected) : '') . '">';
7546
+			$retstring .= '<input placeholder="'.$langs->trans('HourShort').'" type="number" min="0" name="'.$prefix.'hour"'.($disabled ? ' disabled' : '').' class="flat maxwidth50 inputhour right" value="'.(($hourSelected != '') ? ((int) $hourSelected) : '').'">';
7547 7547
 		} else {
7548 7548
 			return 'BadValueForParameterTypeHour';
7549 7549
 		}
7550 7550
 
7551 7551
 		if ($typehour != 'text') {
7552
-			$retstring .= ' ' . $langs->trans('HourShort');
7552
+			$retstring .= ' '.$langs->trans('HourShort');
7553 7553
 		} else {
7554 7554
 			$retstring .= '<span class="">:</span>';
7555 7555
 		}
@@ -7564,21 +7564,21 @@  discard block
 block discarded – undo
7564 7564
 		}
7565 7565
 
7566 7566
 		if ($typehour == 'select' || $typehour == 'textselect') {
7567
-			$retstring .= '<select class="flat" id="select_' . $prefix . 'min" name="' . $prefix . 'min"' . ($disabled ? ' disabled' : '') . '>';
7567
+			$retstring .= '<select class="flat" id="select_'.$prefix.'min" name="'.$prefix.'min"'.($disabled ? ' disabled' : '').'>';
7568 7568
 			for ($min = 0; $min <= 55; $min += 5) {
7569
-				$retstring .= '<option value="' . $min . '"';
7569
+				$retstring .= '<option value="'.$min.'"';
7570 7570
 				if (is_numeric($minSelected) && $minSelected == $min) {
7571 7571
 					$retstring .= ' selected';
7572 7572
 				}
7573
-				$retstring .= '>' . $min . '</option>';
7573
+				$retstring .= '>'.$min.'</option>';
7574 7574
 			}
7575 7575
 			$retstring .= "</select>";
7576 7576
 		} elseif ($typehour == 'text') {
7577
-			$retstring .= '<input placeholder="' . $langs->trans('MinuteShort') . '" type="number" min="0" name="' . $prefix . 'min"' . ($disabled ? ' disabled' : '') . ' class="flat maxwidth50 inputminute right" value="' . (($minSelected != '') ? ((int) $minSelected) : '') . '">';
7577
+			$retstring .= '<input placeholder="'.$langs->trans('MinuteShort').'" type="number" min="0" name="'.$prefix.'min"'.($disabled ? ' disabled' : '').' class="flat maxwidth50 inputminute right" value="'.(($minSelected != '') ? ((int) $minSelected) : '').'">';
7578 7578
 		}
7579 7579
 
7580 7580
 		if ($typehour != 'text') {
7581
-			$retstring .= ' ' . $langs->trans('MinuteShort');
7581
+			$retstring .= ' '.$langs->trans('MinuteShort');
7582 7582
 		}
7583 7583
 
7584 7584
 		$retstring .= "</span>";
@@ -7626,7 +7626,7 @@  discard block
 block discarded – undo
7626 7626
 			$placeholder = '';
7627 7627
 
7628 7628
 			if ($selected && empty($selected_input_value)) {
7629
-				require_once DOL_DOCUMENT_ROOT . '/ticket/class/ticket.class.php';
7629
+				require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php';
7630 7630
 				$tickettmpselect = new Ticket($this->db);
7631 7631
 				$tickettmpselect->fetch($selected);
7632 7632
 				$selected_input_value = $tickettmpselect->ref;
@@ -7634,17 +7634,17 @@  discard block
 block discarded – undo
7634 7634
 			}
7635 7635
 
7636 7636
 			$urloption = '';
7637
-			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/ticket/ajax/tickets.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
7637
+			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/ticket/ajax/tickets.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
7638 7638
 
7639 7639
 			if (empty($hidelabel)) {
7640
-				$out .= $langs->trans("RefOrLabel") . ' : ';
7640
+				$out .= $langs->trans("RefOrLabel").' : ';
7641 7641
 			} elseif ($hidelabel > 1) {
7642
-				$placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"';
7642
+				$placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"';
7643 7643
 				if ($hidelabel == 2) {
7644 7644
 					$out .= img_picto($langs->trans("Search"), 'search');
7645 7645
 				}
7646 7646
 			}
7647
-			$out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />';
7647
+			$out .= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />';
7648 7648
 			if ($hidelabel == 3) {
7649 7649
 				$out .= img_picto($langs->trans("Search"), 'search');
7650 7650
 			}
@@ -7688,8 +7688,8 @@  discard block
 block discarded – undo
7688 7688
 
7689 7689
 		$sql = "SELECT ";
7690 7690
 		$sql .= $selectFields;
7691
-		$sql .= " FROM " . $this->db->prefix() . "ticket as p";
7692
-		$sql .= ' WHERE p.entity IN (' . getEntity('ticket') . ')';
7691
+		$sql .= " FROM ".$this->db->prefix()."ticket as p";
7692
+		$sql .= ' WHERE p.entity IN ('.getEntity('ticket').')';
7693 7693
 
7694 7694
 		// Add criteria on ref/label
7695 7695
 		if ($filterkey != '') {
@@ -7705,7 +7705,7 @@  discard block
 block discarded – undo
7705 7705
 				if ($i > 0) {
7706 7706
 					$sql .= " AND ";
7707 7707
 				}
7708
-				$sql .= "(p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%' OR p.subject LIKE '" . $this->db->escape($prefix . $crit) . "%'";
7708
+				$sql .= "(p.ref LIKE '".$this->db->escape($prefix.$crit)."%' OR p.subject LIKE '".$this->db->escape($prefix.$crit)."%'";
7709 7709
 				$sql .= ")";
7710 7710
 				$i++;
7711 7711
 			}
@@ -7718,22 +7718,22 @@  discard block
 block discarded – undo
7718 7718
 		$sql .= $this->db->plimit($limit, 0);
7719 7719
 
7720 7720
 		// Build output string
7721
-		dol_syslog(get_class($this) . "::selectTicketsList search tickets", LOG_DEBUG);
7721
+		dol_syslog(get_class($this)."::selectTicketsList search tickets", LOG_DEBUG);
7722 7722
 		$result = $this->db->query($sql);
7723 7723
 		if ($result) {
7724
-			require_once DOL_DOCUMENT_ROOT . '/ticket/class/ticket.class.php';
7725
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/ticket.lib.php';
7724
+			require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php';
7725
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/ticket.lib.php';
7726 7726
 
7727 7727
 			$num = $this->db->num_rows($result);
7728 7728
 
7729 7729
 			$events = array();
7730 7730
 
7731 7731
 			if (!$forcecombo) {
7732
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
7732
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
7733 7733
 				$out .= ajax_combobox($htmlname, $events, getDolGlobalInt('TICKET_USE_SEARCH_TO_SELECT'));
7734 7734
 			}
7735 7735
 
7736
-			$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
7736
+			$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
7737 7737
 
7738 7738
 			$textifempty = '';
7739 7739
 			// Do not use textifempty = ' ' or '&nbsp;' here, or search on key will search on ' key'.
@@ -7750,7 +7750,7 @@  discard block
 block discarded – undo
7750 7750
 				}
7751 7751
 			}
7752 7752
 			if ($showempty) {
7753
-				$out .= '<option value="0" selected>' . $textifempty . '</option>';
7753
+				$out .= '<option value="0" selected>'.$textifempty.'</option>';
7754 7754
 			}
7755 7755
 
7756 7756
 			$i = 0;
@@ -7804,13 +7804,13 @@  discard block
 block discarded – undo
7804 7804
 		$outkey = $objp->rowid;
7805 7805
 		$outref = $objp->ref;
7806 7806
 
7807
-		$opt = '<option value="' . $objp->rowid . '"';
7807
+		$opt = '<option value="'.$objp->rowid.'"';
7808 7808
 		$opt .= ($objp->rowid == $selected) ? ' selected' : '';
7809 7809
 		$opt .= '>';
7810 7810
 		$opt .= $objp->ref;
7811 7811
 		$objRef = $objp->ref;
7812 7812
 		if (!empty($filterkey) && $filterkey != '') {
7813
-			$objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1);
7813
+			$objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1);
7814 7814
 		}
7815 7815
 
7816 7816
 		$opt .= "</option>\n";
@@ -7851,7 +7851,7 @@  discard block
 block discarded – undo
7851 7851
 			$placeholder = '';
7852 7852
 
7853 7853
 			if ($selected && empty($selected_input_value)) {
7854
-				require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
7854
+				require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
7855 7855
 				$projecttmpselect = new Project($this->db);
7856 7856
 				$projecttmpselect->fetch($selected);
7857 7857
 				$selected_input_value = $projecttmpselect->ref;
@@ -7859,17 +7859,17 @@  discard block
 block discarded – undo
7859 7859
 			}
7860 7860
 
7861 7861
 			$urloption = '';
7862
-			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/projet/ajax/projects.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
7862
+			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/projet/ajax/projects.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
7863 7863
 
7864 7864
 			if (empty($hidelabel)) {
7865
-				$out .= $langs->trans("RefOrLabel") . ' : ';
7865
+				$out .= $langs->trans("RefOrLabel").' : ';
7866 7866
 			} elseif ($hidelabel > 1) {
7867
-				$placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"';
7867
+				$placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"';
7868 7868
 				if ($hidelabel == 2) {
7869 7869
 					$out .= img_picto($langs->trans("Search"), 'search');
7870 7870
 				}
7871 7871
 			}
7872
-			$out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />';
7872
+			$out .= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />';
7873 7873
 			if ($hidelabel == 3) {
7874 7874
 				$out .= img_picto($langs->trans("Search"), 'search');
7875 7875
 			}
@@ -7912,8 +7912,8 @@  discard block
 block discarded – undo
7912 7912
 
7913 7913
 		$sql = "SELECT ";
7914 7914
 		$sql .= $selectFields;
7915
-		$sql .= " FROM " . $this->db->prefix() . "projet as p";
7916
-		$sql .= ' WHERE p.entity IN (' . getEntity('project') . ')';
7915
+		$sql .= " FROM ".$this->db->prefix()."projet as p";
7916
+		$sql .= ' WHERE p.entity IN ('.getEntity('project').')';
7917 7917
 
7918 7918
 		// Add criteria on ref/label
7919 7919
 		if ($filterkey != '') {
@@ -7929,7 +7929,7 @@  discard block
 block discarded – undo
7929 7929
 				if ($i > 0) {
7930 7930
 					$sql .= " AND ";
7931 7931
 				}
7932
-				$sql .= "p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%'";
7932
+				$sql .= "p.ref LIKE '".$this->db->escape($prefix.$crit)."%'";
7933 7933
 				$sql .= "";
7934 7934
 				$i++;
7935 7935
 			}
@@ -7942,22 +7942,22 @@  discard block
 block discarded – undo
7942 7942
 		$sql .= $this->db->plimit($limit, 0);
7943 7943
 
7944 7944
 		// Build output string
7945
-		dol_syslog(get_class($this) . "::selectProjectsList search projects", LOG_DEBUG);
7945
+		dol_syslog(get_class($this)."::selectProjectsList search projects", LOG_DEBUG);
7946 7946
 		$result = $this->db->query($sql);
7947 7947
 		if ($result) {
7948
-			require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
7949
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php';
7948
+			require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
7949
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
7950 7950
 
7951 7951
 			$num = $this->db->num_rows($result);
7952 7952
 
7953 7953
 			$events = array();
7954 7954
 
7955 7955
 			if (!$forcecombo) {
7956
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
7956
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
7957 7957
 				$out .= ajax_combobox($htmlname, $events, getDolGlobalInt('PROJECT_USE_SEARCH_TO_SELECT'));
7958 7958
 			}
7959 7959
 
7960
-			$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
7960
+			$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
7961 7961
 
7962 7962
 			$textifempty = '';
7963 7963
 			// Do not use textifempty = ' ' or '&nbsp;' here, or search on key will search on ' key'.
@@ -7974,7 +7974,7 @@  discard block
 block discarded – undo
7974 7974
 				}
7975 7975
 			}
7976 7976
 			if ($showempty) {
7977
-				$out .= '<option value="0" selected>' . $textifempty . '</option>';
7977
+				$out .= '<option value="0" selected>'.$textifempty.'</option>';
7978 7978
 			}
7979 7979
 
7980 7980
 			$i = 0;
@@ -8032,13 +8032,13 @@  discard block
 block discarded – undo
8032 8032
 		$outlabel = $objp->label;
8033 8033
 		$outtype = $objp->fk_product_type;
8034 8034
 
8035
-		$opt = '<option value="' . $objp->rowid . '"';
8035
+		$opt = '<option value="'.$objp->rowid.'"';
8036 8036
 		$opt .= ($objp->rowid == $selected) ? ' selected' : '';
8037 8037
 		$opt .= '>';
8038 8038
 		$opt .= $objp->ref;
8039 8039
 		$objRef = $objp->ref;
8040 8040
 		if (!empty($filterkey) && $filterkey != '') {
8041
-			$objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1);
8041
+			$objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1);
8042 8042
 		}
8043 8043
 
8044 8044
 		$opt .= "</option>\n";
@@ -8080,7 +8080,7 @@  discard block
 block discarded – undo
8080 8080
 			$placeholder = '';
8081 8081
 
8082 8082
 			if ($selected && empty($selected_input_value)) {
8083
-				require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php';
8083
+				require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
8084 8084
 				$adherenttmpselect = new Adherent($this->db);
8085 8085
 				$adherenttmpselect->fetch($selected);
8086 8086
 				$selected_input_value = $adherenttmpselect->ref;
@@ -8089,17 +8089,17 @@  discard block
 block discarded – undo
8089 8089
 
8090 8090
 			$urloption = '';
8091 8091
 
8092
-			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/adherents/ajax/adherents.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
8092
+			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/adherents/ajax/adherents.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
8093 8093
 
8094 8094
 			if (empty($hidelabel)) {
8095
-				$out .= $langs->trans("RefOrLabel") . ' : ';
8095
+				$out .= $langs->trans("RefOrLabel").' : ';
8096 8096
 			} elseif ($hidelabel > 1) {
8097
-				$placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"';
8097
+				$placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"';
8098 8098
 				if ($hidelabel == 2) {
8099 8099
 					$out .= img_picto($langs->trans("Search"), 'search');
8100 8100
 				}
8101 8101
 			}
8102
-			$out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />';
8102
+			$out .= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />';
8103 8103
 			if ($hidelabel == 3) {
8104 8104
 				$out .= img_picto($langs->trans("Search"), 'search');
8105 8105
 			}
@@ -8144,8 +8144,8 @@  discard block
 block discarded – undo
8144 8144
 
8145 8145
 		$sql = "SELECT ";
8146 8146
 		$sql .= $selectFields;
8147
-		$sql .= " FROM " . $this->db->prefix() . "adherent as p";
8148
-		$sql .= ' WHERE p.entity IN (' . getEntity('adherent') . ')';
8147
+		$sql .= " FROM ".$this->db->prefix()."adherent as p";
8148
+		$sql .= ' WHERE p.entity IN ('.getEntity('adherent').')';
8149 8149
 
8150 8150
 		// Add criteria on ref/label
8151 8151
 		if ($filterkey != '') {
@@ -8161,8 +8161,8 @@  discard block
 block discarded – undo
8161 8161
 				if ($i > 0) {
8162 8162
 					$sql .= " AND ";
8163 8163
 				}
8164
-				$sql .= "(p.firstname LIKE '" . $this->db->escape($prefix . $crit) . "%'";
8165
-				$sql .= " OR p.lastname LIKE '" . $this->db->escape($prefix . $crit) . "%')";
8164
+				$sql .= "(p.firstname LIKE '".$this->db->escape($prefix.$crit)."%'";
8165
+				$sql .= " OR p.lastname LIKE '".$this->db->escape($prefix.$crit)."%')";
8166 8166
 				$i++;
8167 8167
 			}
8168 8168
 			if (count($search_crit) > 1) {
@@ -8171,27 +8171,27 @@  discard block
 block discarded – undo
8171 8171
 			$sql .= ')';
8172 8172
 		}
8173 8173
 		if ($status != -1) {
8174
-			$sql .= ' AND statut = ' . ((int) $status);
8174
+			$sql .= ' AND statut = '.((int) $status);
8175 8175
 		}
8176 8176
 		$sql .= $this->db->plimit($limit, 0);
8177 8177
 
8178 8178
 		// Build output string
8179
-		dol_syslog(get_class($this) . "::selectMembersList search adherents", LOG_DEBUG);
8179
+		dol_syslog(get_class($this)."::selectMembersList search adherents", LOG_DEBUG);
8180 8180
 		$result = $this->db->query($sql);
8181 8181
 		if ($result) {
8182
-			require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php';
8183
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/member.lib.php';
8182
+			require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
8183
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
8184 8184
 
8185 8185
 			$num = $this->db->num_rows($result);
8186 8186
 
8187 8187
 			$events = array();
8188 8188
 
8189 8189
 			if (!$forcecombo) {
8190
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
8190
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
8191 8191
 				$out .= ajax_combobox($htmlname, $events, getDolGlobalString('PROJECT_USE_SEARCH_TO_SELECT') ? $conf->global->PROJECT_USE_SEARCH_TO_SELECT : '');
8192 8192
 			}
8193 8193
 
8194
-			$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
8194
+			$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
8195 8195
 
8196 8196
 			$textifempty = '';
8197 8197
 			// Do not use textifempty = ' ' or '&nbsp;' here, or search on key will search on ' key'.
@@ -8208,7 +8208,7 @@  discard block
 block discarded – undo
8208 8208
 				}
8209 8209
 			}
8210 8210
 			if ($showempty) {
8211
-				$out .= '<option value="-1" selected>' . $textifempty . '</option>';
8211
+				$out .= '<option value="-1" selected>'.$textifempty.'</option>';
8212 8212
 			}
8213 8213
 
8214 8214
 			$i = 0;
@@ -8264,11 +8264,11 @@  discard block
 block discarded – undo
8264 8264
 		$outlabel = dolGetFirstLastname($objp->firstname, $objp->lastname);
8265 8265
 		$outtype = $objp->fk_adherent_type;
8266 8266
 
8267
-		$opt = '<option value="' . $objp->rowid . '"';
8267
+		$opt = '<option value="'.$objp->rowid.'"';
8268 8268
 		$opt .= ($objp->rowid == $selected) ? ' selected' : '';
8269 8269
 		$opt .= '>';
8270 8270
 		if (!empty($filterkey) && $filterkey != '') {
8271
-			$outlabel = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $outlabel, 1);
8271
+			$outlabel = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $outlabel, 1);
8272 8272
 		}
8273 8273
 		$opt .= $outlabel;
8274 8274
 		$opt .= "</option>\n";
@@ -8323,8 +8323,8 @@  discard block
 block discarded – undo
8323 8323
 		$objecttmp = null;
8324 8324
 		$InfoFieldList = array();
8325 8325
 		$classname = '';
8326
-		$filter = '';  // Ensure filter has value (for static analysis)
8327
-		$sortfield = '';  // Ensure filter has value (for static analysis)
8326
+		$filter = ''; // Ensure filter has value (for static analysis)
8327
+		$sortfield = ''; // Ensure filter has value (for static analysis)
8328 8328
 
8329 8329
 		if ($objectfield) {	// We must retrieve the objectdesc from the field or extrafield
8330 8330
 			// Example: $objectfield = 'product:options_package' or 'myobject@mymodule:options_myfield'
@@ -8368,9 +8368,9 @@  discard block
 block discarded – undo
8368 8368
 			$vartmp = (empty($InfoFieldList[3]) ? '' : $InfoFieldList[3]);
8369 8369
 			$reg = array();
8370 8370
 			if (preg_match('/^.*:(\w*)$/', $vartmp, $reg)) {
8371
-				$InfoFieldList[4] = $reg[1];    // take the sort field
8371
+				$InfoFieldList[4] = $reg[1]; // take the sort field
8372 8372
 			}
8373
-			$InfoFieldList[3] = preg_replace('/:\w*$/', '', $vartmp);    // take the filter field
8373
+			$InfoFieldList[3] = preg_replace('/:\w*$/', '', $vartmp); // take the filter field
8374 8374
 
8375 8375
 			$classname = $InfoFieldList[0];
8376 8376
 			$classpath = empty($InfoFieldList[1]) ? '' : $InfoFieldList[1];
@@ -8401,8 +8401,8 @@  discard block
 block discarded – undo
8401 8401
 		);
8402 8402
 
8403 8403
 		if (!is_object($objecttmp)) {
8404
-			dol_syslog('selectForForms: Error bad setup of field objectdescorig=' . $objectdescorig.', objectfield='.$objectfield.', objectdesc='.$objectdesc, LOG_WARNING);
8405
-			return 'selectForForms: Error bad setup of field objectdescorig=' . $objectdescorig.', objectfield='.$objectfield.', objectdesc='.$objectdesc;
8404
+			dol_syslog('selectForForms: Error bad setup of field objectdescorig='.$objectdescorig.', objectfield='.$objectfield.', objectdesc='.$objectdesc, LOG_WARNING);
8405
+			return 'selectForForms: Error bad setup of field objectdescorig='.$objectdescorig.', objectfield='.$objectfield.', objectdesc='.$objectdesc;
8406 8406
 		}
8407 8407
 		'@phan-var-force CommonObject $objecttmp';
8408 8408
 
@@ -8414,9 +8414,9 @@  discard block
 block discarded – undo
8414 8414
 		if ($prefixforautocompletemode == 'product') {
8415 8415
 			$prefixforautocompletemode = 'produit';
8416 8416
 		}
8417
-		$confkeyforautocompletemode = strtoupper($prefixforautocompletemode) . '_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT
8417
+		$confkeyforautocompletemode = strtoupper($prefixforautocompletemode).'_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT
8418 8418
 
8419
-		dol_syslog(get_class($this) . "::selectForForms filter=" . $filter, LOG_DEBUG);
8419
+		dol_syslog(get_class($this)."::selectForForms filter=".$filter, LOG_DEBUG);
8420 8420
 
8421 8421
 		// Generate the combo HTML component
8422 8422
 		$out = '';
@@ -8445,13 +8445,13 @@  discard block
 block discarded – undo
8445 8445
 			}
8446 8446
 
8447 8447
 			// Set url and param to call to get json of the search results
8448
-			$urlforajaxcall = DOL_URL_ROOT . '/core/ajax/selectobject.php';
8449
-			$urloption = 'htmlname=' . urlencode($htmlname) . '&outjson=1&objectdesc=' . urlencode($objectdescorig) . '&objectfield='.urlencode($objectfield) . ($sortfield ? '&sortfield=' . urlencode($sortfield) : '');
8448
+			$urlforajaxcall = DOL_URL_ROOT.'/core/ajax/selectobject.php';
8449
+			$urloption = 'htmlname='.urlencode($htmlname).'&outjson=1&objectdesc='.urlencode($objectdescorig).'&objectfield='.urlencode($objectfield).($sortfield ? '&sortfield='.urlencode($sortfield) : '');
8450 8450
 
8451 8451
 			// Activate the auto complete using ajax call.
8452 8452
 			$out .= ajax_autocompleter((string) $preSelectedValue, $htmlname, $urlforajaxcall, $urloption, getDolGlobalInt($confkeyforautocompletemode), 0);
8453 8453
 			$out .= '<!-- force css to be higher than dialog popup --><style type="text/css">.ui-autocomplete { z-index: 1010; }</style>';
8454
-			$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) . '"' : '') . ' />';
8454
+			$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).'"' : '').' />';
8455 8455
 		} else {
8456 8456
 			// Immediate load of table record.
8457 8457
 			$out .= $this->selectForFormsList($objecttmp, $htmlname, $preSelectedValue, $showempty, $searchkey, $placeholder, $morecss, $moreparams, $forcecombo, 0, $disabled, $sortfield, $filter);
@@ -8491,16 +8491,16 @@  discard block
 block discarded – undo
8491 8491
 		if ($prefixforautocompletemode == 'societe') {
8492 8492
 			$prefixforautocompletemode = 'company';
8493 8493
 		}
8494
-		$confkeyforautocompletemode = strtoupper($prefixforautocompletemode) . '_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT
8494
+		$confkeyforautocompletemode = strtoupper($prefixforautocompletemode).'_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT
8495 8495
 
8496 8496
 		if (!empty($objecttmp->fields)) {    // For object that declare it, it is better to use declared fields (like societe, contact, ...)
8497 8497
 			$tmpfieldstoshow = '';
8498 8498
 			foreach ($objecttmp->fields as $key => $val) {
8499
-				if (! (int) dol_eval($val['enabled'], 1, 1, '1')) {
8499
+				if (!(int) dol_eval($val['enabled'], 1, 1, '1')) {
8500 8500
 					continue;
8501 8501
 				}
8502 8502
 				if (!empty($val['showoncombobox'])) {
8503
-					$tmpfieldstoshow .= ($tmpfieldstoshow ? ',' : '') . 't.' . $key;
8503
+					$tmpfieldstoshow .= ($tmpfieldstoshow ? ',' : '').'t.'.$key;
8504 8504
 				}
8505 8505
 			}
8506 8506
 			if ($tmpfieldstoshow) {
@@ -8528,18 +8528,18 @@  discard block
 block discarded – undo
8528 8528
 		$num = 0;
8529 8529
 
8530 8530
 		// Search data
8531
-		$sql = "SELECT t.rowid, " . $fieldstoshow . " FROM " . $this->db->prefix() . $objecttmp->table_element . " as t";
8531
+		$sql = "SELECT t.rowid, ".$fieldstoshow." FROM ".$this->db->prefix().$objecttmp->table_element." as t";
8532 8532
 		if (!empty($objecttmp->isextrafieldmanaged)) {
8533
-			$sql .= " LEFT JOIN " . $this->db->prefix() . $objecttmp->table_element . "_extrafields as e ON t.rowid=e.fk_object";
8533
+			$sql .= " LEFT JOIN ".$this->db->prefix().$objecttmp->table_element."_extrafields as e ON t.rowid=e.fk_object";
8534 8534
 		}
8535 8535
 		if (isset($objecttmp->ismultientitymanaged)) {
8536 8536
 			if (!is_numeric($objecttmp->ismultientitymanaged)) {
8537 8537
 				$tmparray = explode('@', $objecttmp->ismultientitymanaged);
8538
-				$sql .= " INNER JOIN " . $this->db->prefix() . $tmparray[1] . " as parenttable ON parenttable.rowid = t." . $tmparray[0];
8538
+				$sql .= " INNER JOIN ".$this->db->prefix().$tmparray[1]." as parenttable ON parenttable.rowid = t.".$tmparray[0];
8539 8539
 			}
8540 8540
 			if ($objecttmp->ismultientitymanaged === 'fk_soc@societe') {
8541 8541
 				if (!$user->hasRight('societe', 'client', 'voir')) {
8542
-					$sql .= ", " . $this->db->prefix() . "societe_commerciaux as sc";
8542
+					$sql .= ", ".$this->db->prefix()."societe_commerciaux as sc";
8543 8543
 				}
8544 8544
 			}
8545 8545
 		}
@@ -8559,21 +8559,21 @@  discard block
 block discarded – undo
8559 8559
 			$sql .= " WHERE 1=1";
8560 8560
 			if (isset($objecttmp->ismultientitymanaged)) {
8561 8561
 				if ($objecttmp->ismultientitymanaged == 1) {
8562
-					$sql .= " AND t.entity IN (" . getEntity($objecttmp->table_element) . ")";
8562
+					$sql .= " AND t.entity IN (".getEntity($objecttmp->table_element).")";
8563 8563
 				}
8564 8564
 				if (!is_numeric($objecttmp->ismultientitymanaged)) {
8565
-					$sql .= " AND parenttable.entity = t." . $tmparray[0];
8565
+					$sql .= " AND parenttable.entity = t.".$tmparray[0];
8566 8566
 				}
8567 8567
 				if ($objecttmp->ismultientitymanaged == 1 && !empty($user->socid)) {
8568 8568
 					if ($objecttmp->element == 'societe') {
8569
-						$sql .= " AND t.rowid = " . ((int) $user->socid);
8569
+						$sql .= " AND t.rowid = ".((int) $user->socid);
8570 8570
 					} else {
8571
-						$sql .= " AND t.fk_soc = " . ((int) $user->socid);
8571
+						$sql .= " AND t.fk_soc = ".((int) $user->socid);
8572 8572
 					}
8573 8573
 				}
8574 8574
 				if ($objecttmp->ismultientitymanaged === 'fk_soc@societe') {
8575 8575
 					if (!$user->hasRight('societe', 'client', 'voir')) {
8576
-						$sql .= " AND t.rowid = sc.fk_soc AND sc.fk_user = " . ((int) $user->id);
8576
+						$sql .= " AND t.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
8577 8577
 					}
8578 8578
 				}
8579 8579
 			}
@@ -8585,7 +8585,7 @@  discard block
 block discarded – undo
8585 8585
 				$errormessage = '';
8586 8586
 				$sql .= forgeSQLFromUniversalSearchCriteria($filter, $errormessage);
8587 8587
 				if ($errormessage) {
8588
-					return 'Error forging a SQL request from an universal criteria: ' . $errormessage;
8588
+					return 'Error forging a SQL request from an universal criteria: '.$errormessage;
8589 8589
 				}
8590 8590
 			}
8591 8591
 		}
@@ -8597,7 +8597,7 @@  discard block
 block discarded – undo
8597 8597
 		$resql = $this->db->query($sql);
8598 8598
 		if ($resql) {
8599 8599
 			// Construct $out and $outarray
8600
-			$out .= '<select id="' . $htmlname . '" class="flat minwidth100' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ($moreparams ? ' ' . $moreparams : '') . ' name="' . $htmlname . '">' . "\n";
8600
+			$out .= '<select id="'.$htmlname.'" class="flat minwidth100'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').($moreparams ? ' '.$moreparams : '').' name="'.$htmlname.'">'."\n";
8601 8601
 
8602 8602
 			// 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
8603 8603
 			$textifempty = '&nbsp;';
@@ -8611,7 +8611,7 @@  discard block
 block discarded – undo
8611 8611
 				}
8612 8612
 			}
8613 8613
 			if ($showempty) {
8614
-				$out .= '<option value="-1">' . $textifempty . '</option>' . "\n";
8614
+				$out .= '<option value="-1">'.$textifempty.'</option>'."\n";
8615 8615
 			}
8616 8616
 
8617 8617
 			$num = $this->db->num_rows($resql);
@@ -8634,9 +8634,9 @@  discard block
 block discarded – undo
8634 8634
 					}
8635 8635
 					if (empty($outputmode)) {
8636 8636
 						if ($preselectedvalue > 0 && $preselectedvalue == $obj->rowid) {
8637
-							$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>';
8637
+							$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>';
8638 8638
 						} else {
8639
-							$out .= '<option value="' . $obj->rowid . '" data-html="' . dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1) . '">' . dol_escape_htmltag($label, 0, 0, '', 0, 1) . '</option>';
8639
+							$out .= '<option value="'.$obj->rowid.'" data-html="'.dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1).'">'.dol_escape_htmltag($label, 0, 0, '', 0, 1).'</option>';
8640 8640
 						}
8641 8641
 					} else {
8642 8642
 						array_push($outarray, array('key' => $obj->rowid, 'value' => $label, 'label' => $label));
@@ -8649,10 +8649,10 @@  discard block
 block discarded – undo
8649 8649
 				}
8650 8650
 			}
8651 8651
 
8652
-			$out .= '</select>' . "\n";
8652
+			$out .= '</select>'."\n";
8653 8653
 
8654 8654
 			if (!$forcecombo) {
8655
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
8655
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
8656 8656
 				$out .= ajax_combobox($htmlname, array(), getDolGlobalInt($confkeyforautocompletemode, 0));
8657 8657
 			}
8658 8658
 		} else {
@@ -8716,8 +8716,8 @@  discard block
 block discarded – undo
8716 8716
 			}
8717 8717
 		}
8718 8718
 		$idname = str_replace(array('[', ']'), array('', ''), $htmlname);
8719
-		$out .= '<select id="' . preg_replace('/^\./', '', $idname) . '" ' . ($disabled ? 'disabled="disabled" ' : '') . 'class="flat ' . (preg_replace('/^\./', '', $htmlname)) . ($morecss ? ' ' . $morecss : '') . ' selectformat"';
8720
-		$out .= ' name="' . preg_replace('/^\./', '', $htmlname) . '" ' . ($moreparam ? $moreparam : '');
8719
+		$out .= '<select id="'.preg_replace('/^\./', '', $idname).'" '.($disabled ? 'disabled="disabled" ' : '').'class="flat '.(preg_replace('/^\./', '', $htmlname)).($morecss ? ' '.$morecss : '').' selectformat"';
8720
+		$out .= ' name="'.preg_replace('/^\./', '', $htmlname).'" '.($moreparam ? $moreparam : '');
8721 8721
 		$out .= '>'."\n";
8722 8722
 
8723 8723
 		if ($show_empty) {
@@ -8728,7 +8728,7 @@  discard block
 block discarded – undo
8728 8728
 			if (!is_numeric($show_empty)) {
8729 8729
 				$textforempty = $show_empty;
8730 8730
 			}
8731
-			$out .= '<option class="optiongrey" ' . ($moreparamonempty ? $moreparamonempty . ' ' : '') . 'value="' . (((int) $show_empty) < 0 ? $show_empty : -1) . '"' . ($id == $show_empty ? ' selected' : '') . '>' . $textforempty . '</option>' . "\n";
8731
+			$out .= '<option class="optiongrey" '.($moreparamonempty ? $moreparamonempty.' ' : '').'value="'.(((int) $show_empty) < 0 ? $show_empty : -1).'"'.($id == $show_empty ? ' selected' : '').'>'.$textforempty.'</option>'."\n";
8732 8732
 		}
8733 8733
 		if (is_array($array)) {
8734 8734
 			// Translate
@@ -8753,7 +8753,7 @@  discard block
 block discarded – undo
8753 8753
 					$value = $tmpvalue['label'];
8754 8754
 					//$valuehtml = empty($tmpvalue['data-html']) ? $value : $tmpvalue['data-html'];
8755 8755
 					$disabled = empty($tmpvalue['disabled']) ? '' : ' disabled';
8756
-					$style = empty($tmpvalue['css']) ? '' : ' class="' . $tmpvalue['css'] . '"';
8756
+					$style = empty($tmpvalue['css']) ? '' : ' class="'.$tmpvalue['css'].'"';
8757 8757
 				} else {
8758 8758
 					$value = $tmpvalue;
8759 8759
 					//$valuehtml = $tmpvalue;
@@ -8769,9 +8769,9 @@  discard block
 block discarded – undo
8769 8769
 				}
8770 8770
 				if ($key_in_label) {
8771 8771
 					if (empty($nohtmlescape)) {
8772
-						$selectOptionValue = dol_escape_htmltag($key . ' - ' . ($maxlen ? dol_trunc($value, $maxlen) : $value));
8772
+						$selectOptionValue = dol_escape_htmltag($key.' - '.($maxlen ? dol_trunc($value, $maxlen) : $value));
8773 8773
 					} else {
8774
-						$selectOptionValue = $key . ' - ' . ($maxlen ? dol_trunc($value, $maxlen) : $value);
8774
+						$selectOptionValue = $key.' - '.($maxlen ? dol_trunc($value, $maxlen) : $value);
8775 8775
 					}
8776 8776
 				} else {
8777 8777
 					if (empty($nohtmlescape)) {
@@ -8783,8 +8783,8 @@  discard block
 block discarded – undo
8783 8783
 						$selectOptionValue = '&nbsp;';
8784 8784
 					}
8785 8785
 				}
8786
-				$out .= '<option value="' . $key . '"';
8787
-				$out .= $style . $disabled;
8786
+				$out .= '<option value="'.$key.'"';
8787
+				$out .= $style.$disabled;
8788 8788
 				if (is_array($id)) {
8789 8789
 					if (in_array($key, $id) && !$disabled) {
8790 8790
 						$out .= ' selected'; // To preselect a value
@@ -8796,7 +8796,7 @@  discard block
 block discarded – undo
8796 8796
 					}
8797 8797
 				}
8798 8798
 				if (!empty($nohtmlescape)) {	// deprecated. Use instead the key 'data-html' into input $array, managed at next step to use HTML content.
8799
-					$out .= ' data-html="' . dol_escape_htmltag($selectOptionValue) . '"';
8799
+					$out .= ' data-html="'.dol_escape_htmltag($selectOptionValue).'"';
8800 8800
 				}
8801 8801
 
8802 8802
 				if (is_array($tmpvalue)) {
@@ -8819,7 +8819,7 @@  discard block
 block discarded – undo
8819 8819
 		// Add code for jquery to use multiselect
8820 8820
 		if ($addjscombo && $jsbeautify) {
8821 8821
 			// Enhance with select2
8822
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
8822
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
8823 8823
 			$out .= ajax_combobox($idname, array(), 0, 0, 'resolve', (((int) $show_empty) < 0 ? (string) $show_empty : '-1'), $morecss);
8824 8824
 		}
8825 8825
 
@@ -8847,28 +8847,28 @@  discard block
 block discarded – undo
8847 8847
 	public static function selectArrayAjax($htmlname, $url, $id = '', $moreparam = '', $moreparamtourl = '', $disabled = 0, $minimumInputLength = 1, $morecss = '', $callurlonselect = 0, $placeholder = '', $acceptdelayedhtml = 0)
8848 8848
 	{
8849 8849
 		global $conf, $langs;
8850
-		global $delayedhtmlcontent;    // Will be used later outside of this function
8850
+		global $delayedhtmlcontent; // Will be used later outside of this function
8851 8851
 
8852 8852
 		// TODO Use an internal dolibarr component instead of select2
8853 8853
 		if (!getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') && !defined('REQUIRE_JQUERY_MULTISELECT')) {
8854 8854
 			return '';
8855 8855
 		}
8856 8856
 
8857
-		$out = '<select type="text" class="' . $htmlname . ($morecss ? ' ' . $morecss : '') . '" ' . ($moreparam ? $moreparam . ' ' : '') . 'name="' . $htmlname . '"></select>';
8857
+		$out = '<select type="text" class="'.$htmlname.($morecss ? ' '.$morecss : '').'" '.($moreparam ? $moreparam.' ' : '').'name="'.$htmlname.'"></select>';
8858 8858
 
8859 8859
 		$outdelayed = '';
8860 8860
 		if (!empty($conf->use_javascript_ajax)) {
8861 8861
 			$tmpplugin = 'select2';
8862
-			$outdelayed = "\n" . '<!-- JS CODE TO ENABLE ' . $tmpplugin . ' for id ' . $htmlname . ' -->
8863
-		    	<script nonce="' . getNonce() . '">
8862
+			$outdelayed = "\n".'<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' -->
8863
+		    	<script nonce="' . getNonce().'">
8864 8864
 		    	$(document).ready(function () {
8865 8865
 
8866
-	    	        ' . ($callurlonselect ? 'var saveRemoteData = [];' : '') . '
8866
+	    	        ' . ($callurlonselect ? 'var saveRemoteData = [];' : '').'
8867 8867
 
8868
-	                $(".' . $htmlname . '").select2({
8868
+	                $(".' . $htmlname.'").select2({
8869 8869
 				    	ajax: {
8870 8870
 					    	dir: "ltr",
8871
-					    	url: "' . $url . '",
8871
+					    	url: "' . $url.'",
8872 8872
 					    	dataType: \'json\',
8873 8873
 					    	delay: 250,
8874 8874
 					    	data: function (params) {
@@ -8895,9 +8895,9 @@  discard block
 block discarded – undo
8895 8895
 				    	},
8896 8896
 		 				language: select2arrayoflanguage,
8897 8897
 						containerCssClass: \':all:\',					/* Line to add class from the original SELECT propagated to the new <span class="select2-selection...> tag */
8898
-					    placeholder: "' . dol_escape_js($placeholder) . '",
8898
+					    placeholder: "' . dol_escape_js($placeholder).'",
8899 8899
 				    	escapeMarkup: function (markup) { return markup; }, 	// let our custom formatter work
8900
-				    	minimumInputLength: ' . ((int) $minimumInputLength) . ',
8900
+				    	minimumInputLength: ' . ((int) $minimumInputLength).',
8901 8901
 				        formatResult: function (result, container, query, escapeMarkup) {
8902 8902
 	                        return escapeMarkup(result.text);
8903 8903
 	                    },
@@ -8905,10 +8905,10 @@  discard block
 block discarded – undo
8905 8905
 
8906 8906
 	                ' . ($callurlonselect ? '
8907 8907
 	                /* Code to execute a GET when we select a value */
8908
-	                $(".' . $htmlname . '").change(function() {
8909
-				    	var selected = $(".' . $htmlname . '").val();
8908
+	                $(".' . $htmlname.'").change(function() {
8909
+				    	var selected = $(".' . $htmlname.'").val();
8910 8910
 	                	console.log("We select in selectArrayAjax the entry "+selected)
8911
-				        $(".' . $htmlname . '").val("");  /* reset visible combo value */
8911
+				        $(".' . $htmlname.'").val("");  /* reset visible combo value */
8912 8912
 	    			    $.each( saveRemoteData, function( key, value ) {
8913 8913
 	    				        if (key == selected)
8914 8914
 	    			            {
@@ -8916,7 +8916,7 @@  discard block
 block discarded – undo
8916 8916
 	    			                 location.assign(value.url);
8917 8917
 	    			            }
8918 8918
 	                    });
8919
-	    			});' : '') . '
8919
+	    			});' : '').'
8920 8920
 
8921 8921
 	    	   });
8922 8922
 		       </script>';
@@ -8952,14 +8952,14 @@  discard block
 block discarded – undo
8952 8952
 	public static function selectArrayFilter($htmlname, $array, $id = '', $moreparam = '', $disableFiltering = 0, $disabled = 0, $minimumInputLength = 1, $morecss = '', $callurlonselect = 0, $placeholder = '', $acceptdelayedhtml = 0, $textfortitle = '')
8953 8953
 	{
8954 8954
 		global $conf, $langs;
8955
-		global $delayedhtmlcontent;    // Will be used later outside of this function
8955
+		global $delayedhtmlcontent; // Will be used later outside of this function
8956 8956
 
8957 8957
 		// TODO Use an internal dolibarr component instead of select2
8958 8958
 		if (!getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') && !defined('REQUIRE_JQUERY_MULTISELECT')) {
8959 8959
 			return '';
8960 8960
 		}
8961 8961
 
8962
-		$out = '<select type="text"'.($textfortitle ? ' title="'.dol_escape_htmltag($textfortitle).'"' : '').' id="'.$htmlname.'" class="'.$htmlname.($morecss ? ' ' . $morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.'"><option></option></select>';
8962
+		$out = '<select type="text"'.($textfortitle ? ' title="'.dol_escape_htmltag($textfortitle).'"' : '').' id="'.$htmlname.'" class="'.$htmlname.($morecss ? ' '.$morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.'"><option></option></select>';
8963 8963
 
8964 8964
 		$formattedarrayresult = array();
8965 8965
 
@@ -8974,20 +8974,20 @@  discard block
 block discarded – undo
8974 8974
 		$outdelayed = '';
8975 8975
 		if (!empty($conf->use_javascript_ajax)) {
8976 8976
 			$tmpplugin = 'select2';
8977
-			$outdelayed = "\n" . '<!-- JS CODE TO ENABLE ' . $tmpplugin . ' for id ' . $htmlname . ' -->
8978
-				<script nonce="' . getNonce() . '">
8977
+			$outdelayed = "\n".'<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' -->
8978
+				<script nonce="' . getNonce().'">
8979 8979
 				$(document).ready(function () {
8980
-					var data = ' . json_encode($formattedarrayresult) . ';
8980
+					var data = ' . json_encode($formattedarrayresult).';
8981 8981
 
8982
-					' . ($callurlonselect ? 'var saveRemoteData = ' . json_encode($array) . ';' : '') . '
8982
+					' . ($callurlonselect ? 'var saveRemoteData = '.json_encode($array).';' : '').'
8983 8983
 
8984
-					$(".' . $htmlname . '").select2({
8984
+					$(".' . $htmlname.'").select2({
8985 8985
 						data: data,
8986 8986
 						language: select2arrayoflanguage,
8987 8987
 						containerCssClass: \':all:\',					/* Line to add class from the original SELECT propagated to the new <span class="select2-selection...> tag */
8988
-						placeholder: "' . dol_escape_js($placeholder) . '",
8988
+						placeholder: "' . dol_escape_js($placeholder).'",
8989 8989
 						escapeMarkup: function (markup) { return markup; }, 	// let our custom formatter work
8990
-						minimumInputLength: ' . $minimumInputLength . ',
8990
+						minimumInputLength: ' . $minimumInputLength.',
8991 8991
 						formatResult: function (result, container, query, escapeMarkup) {
8992 8992
 							return escapeMarkup(result.text);
8993 8993
 						},
@@ -9026,11 +9026,11 @@  discard block
 block discarded – undo
9026 9026
 
9027 9027
 					' . ($callurlonselect ? '
9028 9028
 					/* Code to execute a GET when we select a value */
9029
-					$(".' . $htmlname . '").change(function() {
9030
-						var selected = $(".' . $htmlname . '").val();
9029
+					$(".' . $htmlname.'").change(function() {
9030
+						var selected = $(".' . $htmlname.'").val();
9031 9031
 						console.log("We select "+selected)
9032 9032
 
9033
-						$(".' . $htmlname . '").val("");  /* reset visible combo value */
9033
+						$(".' . $htmlname.'").val("");  /* reset visible combo value */
9034 9034
 						$.each( saveRemoteData, function( key, value ) {
9035 9035
 							if (key == selected)
9036 9036
 							{
@@ -9038,7 +9038,7 @@  discard block
 block discarded – undo
9038 9038
 								location.assign(value.url);
9039 9039
 							}
9040 9040
 						});
9041
-					});' : '') . '
9041
+					});' : '').'
9042 9042
 
9043 9043
 				});
9044 9044
 				</script>';
@@ -9087,7 +9087,7 @@  discard block
 block discarded – undo
9087 9087
 		$useenhancedmultiselect = 0;
9088 9088
 		if (!empty($conf->use_javascript_ajax) && !defined('MAIN_DO_NOT_USE_JQUERY_MULTISELECT') && (getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') || defined('REQUIRE_JQUERY_MULTISELECT'))) {
9089 9089
 			if ($addjscombo) {
9090
-				$useenhancedmultiselect = 1;	// Use the js multiselect in one line. Possible only if $addjscombo not 0.
9090
+				$useenhancedmultiselect = 1; // Use the js multiselect in one line. Possible only if $addjscombo not 0.
9091 9091
 			}
9092 9092
 		}
9093 9093
 
@@ -9096,7 +9096,7 @@  discard block
 block discarded – undo
9096 9096
 		// submitted to nothing.
9097 9097
 		$out .= '<input type="hidden" name="'.$htmlname.'_multiselect" value="1">';
9098 9098
 		// Output select component
9099
-		$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";
9099
+		$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";
9100 9100
 		if (is_array($array) && !empty($array)) {
9101 9101
 			if ($value_as_key) {
9102 9102
 				$array = array_combine($array, $array);
@@ -9117,33 +9117,33 @@  discard block
 block discarded – undo
9117 9117
 						$tmplabelhtml = empty($value['labelhtml']) ? (empty($value['data-html']) ? '' : $value['data-html']) : $value['labelhtml'];
9118 9118
 					}
9119 9119
 					$newval = ($translate ? $langs->trans($tmpvalue) : $tmpvalue);
9120
-					$newval = ($key_in_label ? $tmpkey . ' - ' . $newval : $newval);
9120
+					$newval = ($key_in_label ? $tmpkey.' - '.$newval : $newval);
9121 9121
 
9122
-					$out .= '<option value="' . $tmpkey . '"';
9122
+					$out .= '<option value="'.$tmpkey.'"';
9123 9123
 					if (is_array($selected) && !empty($selected) && in_array((string) $tmpkey, $selected) && ((string) $tmpkey != '')) {
9124 9124
 						$out .= ' selected';
9125 9125
 					}
9126 9126
 					if (!empty($tmplabelhtml)) {
9127
-						$out .= ' data-html="' . dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1) . '"';
9127
+						$out .= ' data-html="'.dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1).'"';
9128 9128
 					} else {
9129
-						$tmplabelhtml = ($tmppicto ? img_picto('', $tmppicto, 'class="pictofixedwidth" style="color: #' . $tmpcolor . '"') : '') . $newval;
9130
-						$out .= ' data-html="' . dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1) . '"';
9129
+						$tmplabelhtml = ($tmppicto ? img_picto('', $tmppicto, 'class="pictofixedwidth" style="color: #'.$tmpcolor.'"') : '').$newval;
9130
+						$out .= ' data-html="'.dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1).'"';
9131 9131
 					}
9132 9132
 					$out .= '>';
9133 9133
 					$out .= dol_htmlentitiesbr($newval);
9134
-					$out .= '</option>' . "\n";
9134
+					$out .= '</option>'."\n";
9135 9135
 				}
9136 9136
 			}
9137 9137
 		}
9138
-		$out .= '</select>' . "\n";
9138
+		$out .= '</select>'."\n";
9139 9139
 
9140 9140
 		// Add code for jquery to use multiselect
9141 9141
 		if (!empty($conf->use_javascript_ajax) && getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') || defined('REQUIRE_JQUERY_MULTISELECT')) {
9142
-			$out .= "\n" . '<!-- JS CODE TO ENABLE select for id ' . $htmlname . ', addjscombo=' . $addjscombo . ' -->';
9143
-			$out .= "\n" . '<script nonce="' . getNonce() . '">' . "\n";
9142
+			$out .= "\n".'<!-- JS CODE TO ENABLE select for id '.$htmlname.', addjscombo='.$addjscombo.' -->';
9143
+			$out .= "\n".'<script nonce="'.getNonce().'">'."\n";
9144 9144
 			if ($addjscombo == 1) {
9145 9145
 				$tmpplugin = !getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') ? constant('REQUIRE_JQUERY_MULTISELECT') : $conf->global->MAIN_USE_JQUERY_MULTISELECT;
9146
-				$out .= 'function formatResult(record, container) {' . "\n";
9146
+				$out .= 'function formatResult(record, container) {'."\n";
9147 9147
 				// If property data-html set, we decode html entities and use this.
9148 9148
 				// Note that HTML content must have been sanitized from js with dol_escape_htmltag(xxx, 0, 0, '', 0, 1) when building the select option.
9149 9149
 				$out .= '	if ($(record.element).attr("data-html") != undefined && typeof htmlEntityDecodeJs === "function") {';
@@ -9151,26 +9151,26 @@  discard block
 block discarded – undo
9151 9151
 				$out .= '		return htmlEntityDecodeJs($(record.element).attr("data-html"));';
9152 9152
 				$out .= '	}'."\n";
9153 9153
 				$out .= '	return record.text;';
9154
-				$out .= '}' . "\n";
9155
-				$out .= 'function formatSelection(record) {' . "\n";
9154
+				$out .= '}'."\n";
9155
+				$out .= 'function formatSelection(record) {'."\n";
9156 9156
 				if ($elemtype == 'category') {
9157
-					$out .= 'return \'<span><img src="' . DOL_URL_ROOT . '/theme/eldy/img/object_category.png"> \'+record.text+\'</span>\';';
9157
+					$out .= 'return \'<span><img src="'.DOL_URL_ROOT.'/theme/eldy/img/object_category.png"> \'+record.text+\'</span>\';';
9158 9158
 				} else {
9159 9159
 					$out .= 'return record.text;';
9160 9160
 				}
9161
-				$out .= '}' . "\n";
9161
+				$out .= '}'."\n";
9162 9162
 				$out .= '$(document).ready(function () {
9163
-							$(\'#' . $htmlname . '\').' . $tmpplugin . '({';
9163
+							$(\'#' . $htmlname.'\').'.$tmpplugin.'({';
9164 9164
 				if ($placeholder) {
9165 9165
 					$out .= '
9166 9166
 								placeholder: {
9167 9167
 								    id: \'-1\',
9168
-								    text: \'' . dol_escape_js($placeholder) . '\'
9168
+								    text: \'' . dol_escape_js($placeholder).'\'
9169 9169
 								  },';
9170 9170
 				}
9171 9171
 				$out .= '		dir: \'ltr\',
9172 9172
 								containerCssClass: \':all:\',					/* Line to add class of origin SELECT propagated to the new <span class="select2-selection...> tag (ko with multiselect) */
9173
-								dropdownCssClass: \'' . $morecss . '\',				/* Line to add class on the new <span class="select2-selection...> tag (ok with multiselect). Need full version of select2. */
9173
+								dropdownCssClass: \'' . $morecss.'\',				/* Line to add class on the new <span class="select2-selection...> tag (ok with multiselect). Need full version of select2. */
9174 9174
 								// Specify format function for dropdown item
9175 9175
 								formatResult: formatResult,
9176 9176
 							 	templateResult: formatResult,		/* For 4.0 */
@@ -9182,21 +9182,21 @@  discard block
 block discarded – undo
9182 9182
 
9183 9183
 							/* Add also morecss to the css .select2 that is after the #htmlname, for component that are show dynamically after load, because select2 set
9184 9184
 								 the size only if component is not hidden by default on load */
9185
-							$(\'#' . $htmlname . ' + .select2\').addClass(\'' . $morecss . '\');
9185
+							$(\'#' . $htmlname.' + .select2\').addClass(\''.$morecss.'\');
9186 9186
 						});' . "\n";
9187 9187
 			} elseif ($addjscombo == 2 && !defined('DISABLE_MULTISELECT')) {
9188 9188
 				// Add other js lib
9189 9189
 				// TODO external lib multiselect/jquery.multi-select.js must have been loaded to use this multiselect plugin
9190 9190
 				// ...
9191
-				$out .= 'console.log(\'addjscombo=2 for htmlname=' . $htmlname . '\');';
9191
+				$out .= 'console.log(\'addjscombo=2 for htmlname='.$htmlname.'\');';
9192 9192
 				$out .= '$(document).ready(function () {
9193
-							$(\'#' . $htmlname . '\').multiSelect({
9193
+							$(\'#' . $htmlname.'\').multiSelect({
9194 9194
 								containerHTML: \'<div class="multi-select-container">\',
9195 9195
 								menuHTML: \'<div class="multi-select-menu">\',
9196
-								buttonHTML: \'<span class="multi-select-button ' . $morecss . '">\',
9196
+								buttonHTML: \'<span class="multi-select-button ' . $morecss.'">\',
9197 9197
 								menuItemHTML: \'<label class="multi-select-menuitem">\',
9198 9198
 								activeClass: \'multi-select-container--open\',
9199
-								noneText: \'' . $placeholder . '\'
9199
+								noneText: \'' . $placeholder.'\'
9200 9200
 							});
9201 9201
 						})';
9202 9202
 			}
@@ -9229,7 +9229,7 @@  discard block
 block discarded – undo
9229 9229
 			return '';
9230 9230
 		}
9231 9231
 
9232
-		$tmpvar = "MAIN_SELECTEDFIELDS_" . $varpage; // To get list of saved selected fields to show
9232
+		$tmpvar = "MAIN_SELECTEDFIELDS_".$varpage; // To get list of saved selected fields to show
9233 9233
 
9234 9234
 		if (!empty($user->conf->$tmpvar)) {        // A list of fields was already customized for user
9235 9235
 			$tmparray = explode(',', $user->conf->$tmpvar);
@@ -9272,19 +9272,19 @@  discard block
 block discarded – undo
9272 9272
 				}
9273 9273
 
9274 9274
 				// Note: $val['checked'] <> 0 means we must show the field into the combo list  @phan-suppress-next-line PhanTypePossiblyInvalidDimOffset
9275
-				$listoffieldsforselection .= '<li><input type="checkbox" id="checkbox' . $key . '" value="' . $key . '"' . ((!array_key_exists('checked', $val) || empty($val['checked']) || $val['checked'] == '-1') ? '' : ' checked="checked"') . '/><label for="checkbox' . $key . '">' . dol_escape_htmltag($langs->trans($val['label'])) . '</label></li>';
9276
-				$listcheckedstring .= (empty($val['checked']) ? '' : $key . ',');
9275
+				$listoffieldsforselection .= '<li><input type="checkbox" id="checkbox'.$key.'" value="'.$key.'"'.((!array_key_exists('checked', $val) || empty($val['checked']) || $val['checked'] == '-1') ? '' : ' checked="checked"').'/><label for="checkbox'.$key.'">'.dol_escape_htmltag($langs->trans($val['label'])).'</label></li>';
9276
+				$listcheckedstring .= (empty($val['checked']) ? '' : $key.',');
9277 9277
 			}
9278 9278
 		}
9279 9279
 
9280
-		$out = '<!-- Component multiSelectArrayWithCheckbox ' . $htmlname . ' -->
9280
+		$out = '<!-- Component multiSelectArrayWithCheckbox '.$htmlname.' -->
9281 9281
 
9282 9282
         <dl class="dropdown">
9283 9283
             <dt>
9284
-            <a href="#' . $htmlname . '">
9285
-              ' . img_picto('', 'list') . '
9284
+            <a href="#' . $htmlname.'">
9285
+              ' . img_picto('', 'list').'
9286 9286
             </a>
9287
-            <input type="hidden" class="' . $htmlname . '" name="' . $htmlname . '" value="' . $listcheckedstring . '">
9287
+            <input type="hidden" class="' . $htmlname.'" name="'.$htmlname.'" value="'.$listcheckedstring.'">
9288 9288
             </dt>
9289 9289
             <dd class="dropdowndd">
9290 9290
                 <div class="multiselectcheckbox'.$htmlname.'">
@@ -9296,19 +9296,19 @@  discard block
 block discarded – undo
9296 9296
             </dd>
9297 9297
         </dl>
9298 9298
 
9299
-        <script nonce="' . getNonce() . '" type="text/javascript">
9299
+        <script nonce="' . getNonce().'" type="text/javascript">
9300 9300
           jQuery(document).ready(function () {
9301
-              $(\'.multiselectcheckbox' . $htmlname . ' input[type="checkbox"]\').on(\'click\', function () {
9301
+              $(\'.multiselectcheckbox' . $htmlname.' input[type="checkbox"]\').on(\'click\', function () {
9302 9302
                   console.log("A new field was added/removed, we edit field input[name=formfilteraction]");
9303 9303
 
9304 9304
                   $("input:hidden[name=formfilteraction]").val(\'listafterchangingselectedfields\');	// Update field so we know we changed something on selected fields after POST
9305 9305
 
9306 9306
                   var title = $(this).val() + ",";
9307 9307
                   if ($(this).is(\':checked\')) {
9308
-                      $(\'.' . $htmlname . '\').val(title + $(\'.' . $htmlname . '\').val());
9308
+                      $(\'.' . $htmlname.'\').val(title + $(\'.'.$htmlname.'\').val());
9309 9309
                   }
9310 9310
                   else {
9311
-                      $(\'.' . $htmlname . '\').val( $(\'.' . $htmlname . '\').val().replace(title, \'\') )
9311
+                      $(\'.' . $htmlname.'\').val( $(\'.'.$htmlname.'\').val().replace(title, \'\') )
9312 9312
                   }
9313 9313
                   // Now, we submit page
9314 9314
                   //$(this).parents(\'form:first\').submit();
@@ -9339,7 +9339,7 @@  discard block
 block discarded – undo
9339 9339
 	 */
9340 9340
 	public function showCategories($id, $type, $rendermode = 0, $nolink = 0)
9341 9341
 	{
9342
-		include_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
9342
+		include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
9343 9343
 
9344 9344
 		$cat = new Categorie($this->db);
9345 9345
 		$categories = $cat->containing($id, $type);
@@ -9349,13 +9349,13 @@  discard block
 block discarded – undo
9349 9349
 			foreach ($categories as $c) {
9350 9350
 				$ways = $c->print_all_ways(' &gt;&gt; ', ($nolink ? 'none' : ''), 0, 1); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text
9351 9351
 				foreach ($ways as $way) {
9352
-					$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #bbb"') . '>' . $way . '</li>';
9352
+					$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #bbb"').'>'.$way.'</li>';
9353 9353
 				}
9354 9354
 			}
9355 9355
 			if (empty($toprint)) {
9356 9356
 				return '';
9357 9357
 			} else {
9358
-				return '<div class="select2-container-multi-dolibarr"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>';
9358
+				return '<div class="select2-container-multi-dolibarr"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
9359 9359
 			}
9360 9360
 		}
9361 9361
 
@@ -9404,15 +9404,15 @@  discard block
 block discarded – undo
9404 9404
 
9405 9405
 
9406 9406
 			print '<div class="div-table-responsive-no-min">';
9407
-			print '<table class="noborder allwidth" data-block="showLinkedObject" data-element="' . $object->element . '"  data-elementid="' . $object->id . '"   >';
9407
+			print '<table class="noborder allwidth" data-block="showLinkedObject" data-element="'.$object->element.'"  data-elementid="'.$object->id.'"   >';
9408 9408
 
9409 9409
 			print '<tr class="liste_titre">';
9410
-			print '<td>' . $langs->trans("Type") . '</td>';
9411
-			print '<td>' . $langs->trans("Ref") . '</td>';
9410
+			print '<td>'.$langs->trans("Type").'</td>';
9411
+			print '<td>'.$langs->trans("Ref").'</td>';
9412 9412
 			print '<td class="center"></td>';
9413
-			print '<td class="center">' . $langs->trans("Date") . '</td>';
9414
-			print '<td class="right">' . $langs->trans("AmountHTShort") . '</td>';
9415
-			print '<td class="right">' . $langs->trans("Status") . '</td>';
9413
+			print '<td class="center">'.$langs->trans("Date").'</td>';
9414
+			print '<td class="right">'.$langs->trans("AmountHTShort").'</td>';
9415
+			print '<td class="right">'.$langs->trans("Status").'</td>';
9416 9416
 			print '<td></td>';
9417 9417
 			print '</tr>';
9418 9418
 
@@ -9431,13 +9431,13 @@  discard block
 block discarded – undo
9431 9431
 				if ($objecttype != 'supplier_proposal' && preg_match('/^([^_]+)_([^_]+)/i', $objecttype, $regs)) {
9432 9432
 					$element = $regs[1];
9433 9433
 					$subelement = $regs[2];
9434
-					$tplpath = $element . '/' . $subelement;
9434
+					$tplpath = $element.'/'.$subelement;
9435 9435
 				}
9436 9436
 				$tplname = 'linkedobjectblock';
9437 9437
 
9438 9438
 				// To work with non standard path
9439 9439
 				if ($objecttype == 'facture') {
9440
-					$tplpath = 'compta/' . $element;
9440
+					$tplpath = 'compta/'.$element;
9441 9441
 					if (!isModEnabled('invoice')) {
9442 9442
 						continue; // Do not show if module disabled
9443 9443
 					}
@@ -9448,7 +9448,7 @@  discard block
 block discarded – undo
9448 9448
 						continue; // Do not show if module disabled
9449 9449
 					}
9450 9450
 				} elseif ($objecttype == 'propal') {
9451
-					$tplpath = 'comm/' . $element;
9451
+					$tplpath = 'comm/'.$element;
9452 9452
 					if (!isModEnabled('propal')) {
9453 9453
 						continue; // Do not show if module disabled
9454 9454
 					}
@@ -9501,7 +9501,7 @@  discard block
 block discarded – undo
9501 9501
 				$linkedObjectBlock = $objects;
9502 9502
 
9503 9503
 				// Output template part (modules that overwrite templates must declare this into descriptor)
9504
-				$dirtpls = array_merge($conf->modules_parts['tpl'], array('/' . $tplpath . '/tpl'));
9504
+				$dirtpls = array_merge($conf->modules_parts['tpl'], array('/'.$tplpath.'/tpl'));
9505 9505
 				foreach ($dirtpls as $reldir) {
9506 9506
 					$reldir = rtrim($reldir, '/');
9507 9507
 					if ($nboftypesoutput == ($nbofdifferenttypes - 1)) {    // No more type to show after
@@ -9509,7 +9509,7 @@  discard block
 block discarded – undo
9509 9509
 						$noMoreLinkedObjectBlockAfter = 1;
9510 9510
 					}
9511 9511
 
9512
-					$res = @include dol_buildpath($reldir . '/' . $tplname . '.tpl.php');
9512
+					$res = @include dol_buildpath($reldir.'/'.$tplname.'.tpl.php');
9513 9513
 					if ($res) {
9514 9514
 						$nboftypesoutput++;
9515 9515
 						break;
@@ -9518,7 +9518,7 @@  discard block
 block discarded – undo
9518 9518
 			}
9519 9519
 
9520 9520
 			if (!$nboftypesoutput) {
9521
-				print '<tr><td colspan="7"><span class="opacitymedium">' . $langs->trans("None") . '</span></td></tr>';
9521
+				print '<tr><td colspan="7"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
9522 9522
 			}
9523 9523
 
9524 9524
 			print '</table>';
@@ -9561,14 +9561,14 @@  discard block
 block discarded – undo
9561 9561
 		if (is_object($object->thirdparty) && !empty($object->thirdparty->id) && $object->thirdparty->id > 0) {
9562 9562
 			$listofidcompanytoscan = $object->thirdparty->id;
9563 9563
 			if (($object->thirdparty->parent > 0) && getDolGlobalString('THIRDPARTY_INCLUDE_PARENT_IN_LINKTO')) {
9564
-				$listofidcompanytoscan .= ',' . $object->thirdparty->parent;
9564
+				$listofidcompanytoscan .= ','.$object->thirdparty->parent;
9565 9565
 			}
9566 9566
 			if (($object->fk_project > 0) && getDolGlobalString('THIRDPARTY_INCLUDE_PROJECT_THIRDPARY_IN_LINKTO')) {
9567
-				include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
9567
+				include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
9568 9568
 				$tmpproject = new Project($this->db);
9569 9569
 				$tmpproject->fetch($object->fk_project);
9570 9570
 				if ($tmpproject->socid > 0 && ($tmpproject->socid != $object->thirdparty->id)) {
9571
-					$listofidcompanytoscan .= ',' . $tmpproject->socid;
9571
+					$listofidcompanytoscan .= ','.$tmpproject->socid;
9572 9572
 				}
9573 9573
 				unset($tmpproject);
9574 9574
 			}
@@ -9578,63 +9578,63 @@  discard block
 block discarded – undo
9578 9578
 					'enabled' => isModEnabled('propal'),
9579 9579
 					'perms' => 1,
9580 9580
 					'label' => 'LinkToProposal',
9581
-					'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') . ')'),
9581
+					'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').')'),
9582 9582
 				'shipping' => array(
9583 9583
 					'enabled' => isModEnabled('shipping'),
9584 9584
 					'perms' => 1,
9585 9585
 					'label' => 'LinkToExpedition',
9586
-					'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') . ')'),
9586
+					'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').')'),
9587 9587
 				'order' => array(
9588 9588
 					'enabled' => isModEnabled('order'),
9589 9589
 					'perms' => 1,
9590 9590
 					'label' => 'LinkToOrder',
9591
-					'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') . ')'),
9591
+					'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').')'),
9592 9592
 				'invoice' => array(
9593 9593
 					'enabled' => isModEnabled('invoice'),
9594 9594
 					'perms' => 1,
9595 9595
 					'label' => 'LinkToInvoice',
9596
-					'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') . ')'),
9596
+					'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').')'),
9597 9597
 				'invoice_template' => array(
9598 9598
 					'enabled' => isModEnabled('invoice'),
9599 9599
 					'perms' => 1,
9600 9600
 					'label' => 'LinkToTemplateInvoice',
9601
-					'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') . ')'),
9601
+					'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').')'),
9602 9602
 				'contrat' => array(
9603 9603
 					'enabled' => isModEnabled('contract'),
9604 9604
 					'perms' => 1,
9605 9605
 					'label' => 'LinkToContract',
9606 9606
 					'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
9607
-							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'
9607
+							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'
9608 9608
 				),
9609 9609
 				'fichinter' => array(
9610 9610
 					'enabled' => isModEnabled('intervention'),
9611 9611
 					'perms' => 1,
9612 9612
 					'label' => 'LinkToIntervention',
9613
-					'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') . ')'),
9613
+					'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').')'),
9614 9614
 				'supplier_proposal' => array(
9615 9615
 					'enabled' => isModEnabled('supplier_proposal'),
9616 9616
 					'perms' => 1,
9617 9617
 					'label' => 'LinkToSupplierProposal',
9618
-					'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') . ')'),
9618
+					'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').')'),
9619 9619
 				'order_supplier' => array(
9620 9620
 					'enabled' => isModEnabled("supplier_order"),
9621 9621
 					'perms' => 1,
9622 9622
 					'label' => 'LinkToSupplierOrder',
9623
-					'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') . ')'),
9623
+					'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').')'),
9624 9624
 				'invoice_supplier' => array(
9625 9625
 					'enabled' => isModEnabled("supplier_invoice"),
9626 9626
 					'perms' => 1, 'label' => 'LinkToSupplierInvoice',
9627
-					'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') . ')'),
9627
+					'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').')'),
9628 9628
 				'ticket' => array(
9629 9629
 					'enabled' => isModEnabled('ticket'),
9630 9630
 					'perms' => 1,
9631 9631
 					'label' => 'LinkToTicket',
9632
-					'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') . ')'),
9632
+					'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').')'),
9633 9633
 				'mo' => array(
9634 9634
 					'enabled' => isModEnabled('mrp'),
9635 9635
 					'perms' => 1,
9636 9636
 					'label' => 'LinkToMo',
9637
-					'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') . ')')
9637
+					'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').')')
9638 9638
 			);
9639 9639
 		}
9640 9640
 
@@ -9672,23 +9672,23 @@  discard block
 block discarded – undo
9672 9672
 			}
9673 9673
 
9674 9674
 			if (!empty($possiblelink['perms']) && (empty($restrictlinksto) || in_array($key, $restrictlinksto)) && (empty($excludelinksto) || !in_array($key, $excludelinksto))) {
9675
-				$htmltoenteralink .= '<div id="' . $key . 'list"' . (empty($conf->use_javascript_ajax) ? '' : ' style="display:none"') . '>';
9675
+				$htmltoenteralink .= '<div id="'.$key.'list"'.(empty($conf->use_javascript_ajax) ? '' : ' style="display:none"').'>';
9676 9676
 
9677 9677
 				// Section for free ref input
9678 9678
 				if (!getDolGlobalString('MAIN_HIDE_LINK_BY_REF_IN_LINKTO')) {
9679 9679
 					$htmltoenteralink .= '<br>'."\n";
9680 9680
 					$htmltoenteralink .= '<!-- form to add a link from anywhere -->'."\n";
9681
-					$htmltoenteralink .= '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST" name="formlinkedbyref' . $key . '">';
9682
-					$htmltoenteralink .= '<input type="hidden" name="id" value="' . $object->id . '">';
9681
+					$htmltoenteralink .= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" name="formlinkedbyref'.$key.'">';
9682
+					$htmltoenteralink .= '<input type="hidden" name="id" value="'.$object->id.'">';
9683 9683
 					$htmltoenteralink .= '<input type="hidden" name="action" value="addlinkbyref">';
9684
-					$htmltoenteralink .= '<input type="hidden" name="token" value="' . newToken() . '">';
9685
-					$htmltoenteralink .= '<input type="hidden" name="addlink" value="' . $key . '">';
9684
+					$htmltoenteralink .= '<input type="hidden" name="token" value="'.newToken().'">';
9685
+					$htmltoenteralink .= '<input type="hidden" name="addlink" value="'.$key.'">';
9686 9686
 					$htmltoenteralink .= '<table class="noborder">';
9687 9687
 					$htmltoenteralink .= '<tr>';
9688 9688
 					//print '<td>' . $langs->trans("Ref") . '</td>';
9689
-					$htmltoenteralink .= '<td class="center"><input type="text" placeholder="'.dol_escape_htmltag($langs->trans("Ref")).'" name="reftolinkto" value="' . dol_escape_htmltag(GETPOST('reftolinkto', 'alpha')) . '">&nbsp;';
9690
-					$htmltoenteralink .= '<input type="submit" class="button small valignmiddle" value="' . $langs->trans('ToLink') . '">&nbsp;';
9691
-					$htmltoenteralink .= '<input type="submit" class="button small" name="cancel" value="' . $langs->trans('Cancel') . '"></td>';
9689
+					$htmltoenteralink .= '<td class="center"><input type="text" placeholder="'.dol_escape_htmltag($langs->trans("Ref")).'" name="reftolinkto" value="'.dol_escape_htmltag(GETPOST('reftolinkto', 'alpha')).'">&nbsp;';
9690
+					$htmltoenteralink .= '<input type="submit" class="button small valignmiddle" value="'.$langs->trans('ToLink').'">&nbsp;';
9691
+					$htmltoenteralink .= '<input type="submit" class="button small" name="cancel" value="'.$langs->trans('Cancel').'"></td>';
9692 9692
 					$htmltoenteralink .= '</tr>';
9693 9693
 					$htmltoenteralink .= '</table>';
9694 9694
 					$htmltoenteralink .= '</form>';
@@ -9705,47 +9705,47 @@  discard block
 block discarded – undo
9705 9705
 						// Section for free predefined list
9706 9706
 						$htmltoenteralink .= '<br>';
9707 9707
 						$htmltoenteralink .= '<!-- form to add a link from object to same thirdparty -->'."\n";
9708
-						$htmltoenteralink .= '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST" name="formlinked' . $key . '">';
9708
+						$htmltoenteralink .= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" name="formlinked'.$key.'">';
9709 9709
 						$htmltoenteralink .= '<input type="hidden" name="action" value="addlink">';
9710
-						$htmltoenteralink .= '<input type="hidden" name="token" value="' . newToken() . '">';
9711
-						$htmltoenteralink .= '<input type="hidden" name="id" value="' . $object->id . '">';
9712
-						$htmltoenteralink .= '<input type="hidden" name="addlink" value="' . $key . '">';
9710
+						$htmltoenteralink .= '<input type="hidden" name="token" value="'.newToken().'">';
9711
+						$htmltoenteralink .= '<input type="hidden" name="id" value="'.$object->id.'">';
9712
+						$htmltoenteralink .= '<input type="hidden" name="addlink" value="'.$key.'">';
9713 9713
 						$htmltoenteralink .= '<table class="noborder">';
9714 9714
 						$htmltoenteralink .= '<tr class="liste_titre">';
9715 9715
 						$htmltoenteralink .= '<td class="nowrap"></td>';
9716
-						$htmltoenteralink .= '<td>' . $langs->trans("Ref") . '</td>';
9717
-						$htmltoenteralink .= '<td>' . $langs->trans("RefCustomer") . '</td>';
9718
-						$htmltoenteralink .= '<td class="right">' . $langs->trans("AmountHTShort") . '</td>';
9719
-						$htmltoenteralink .= '<td>' . $langs->trans("Company") . '</td>';
9716
+						$htmltoenteralink .= '<td>'.$langs->trans("Ref").'</td>';
9717
+						$htmltoenteralink .= '<td>'.$langs->trans("RefCustomer").'</td>';
9718
+						$htmltoenteralink .= '<td class="right">'.$langs->trans("AmountHTShort").'</td>';
9719
+						$htmltoenteralink .= '<td>'.$langs->trans("Company").'</td>';
9720 9720
 						$htmltoenteralink .= '</tr>';
9721 9721
 						while ($i < $num) {
9722 9722
 							$objp = $this->db->fetch_object($resqllist);
9723 9723
 
9724 9724
 							$htmltoenteralink .= '<tr class="oddeven">';
9725 9725
 							$htmltoenteralink .= '<td>';
9726
-							$htmltoenteralink .= '<input type="checkbox" name="idtolinkto[' . $key . '_' . $objp->rowid . ']" id="' . $key . '_' . $objp->rowid . '" value="' . $objp->rowid . '">';
9726
+							$htmltoenteralink .= '<input type="checkbox" name="idtolinkto['.$key.'_'.$objp->rowid.']" id="'.$key.'_'.$objp->rowid.'" value="'.$objp->rowid.'">';
9727 9727
 							$htmltoenteralink .= '</td>';
9728
-							$htmltoenteralink .= '<td><label for="' . $key . '_' . $objp->rowid . '">' . $objp->ref . '</label></td>';
9729
-							$htmltoenteralink .= '<td>' . (!empty($objp->ref_client) ? $objp->ref_client : (!empty($objp->ref_supplier) ? $objp->ref_supplier : '')) . '</td>';
9728
+							$htmltoenteralink .= '<td><label for="'.$key.'_'.$objp->rowid.'">'.$objp->ref.'</label></td>';
9729
+							$htmltoenteralink .= '<td>'.(!empty($objp->ref_client) ? $objp->ref_client : (!empty($objp->ref_supplier) ? $objp->ref_supplier : '')).'</td>';
9730 9730
 							$htmltoenteralink .= '<td class="right">';
9731 9731
 							if ($possiblelink['label'] == 'LinkToContract') {
9732
-								$htmltoenteralink .= $form->textwithpicto('', $langs->trans("InformationOnLinkToContract")) . ' ';
9732
+								$htmltoenteralink .= $form->textwithpicto('', $langs->trans("InformationOnLinkToContract")).' ';
9733 9733
 							}
9734
-							$htmltoenteralink .= '<span class="amount">' . (isset($objp->total_ht) ? price($objp->total_ht) : '') . '</span>';
9734
+							$htmltoenteralink .= '<span class="amount">'.(isset($objp->total_ht) ? price($objp->total_ht) : '').'</span>';
9735 9735
 							$htmltoenteralink .= '</td>';
9736
-							$htmltoenteralink .= '<td>' . $objp->name . '</td>';
9736
+							$htmltoenteralink .= '<td>'.$objp->name.'</td>';
9737 9737
 							$htmltoenteralink .= '</tr>';
9738 9738
 							$i++;
9739 9739
 						}
9740 9740
 						$htmltoenteralink .= '</table>';
9741 9741
 						$htmltoenteralink .= '<div class="center">';
9742 9742
 						if ($num) {
9743
-							$htmltoenteralink .= '<input type="submit" class="button valignmiddle marginleftonly marginrightonly small" value="' . $langs->trans('ToLink') . '">';
9743
+							$htmltoenteralink .= '<input type="submit" class="button valignmiddle marginleftonly marginrightonly small" value="'.$langs->trans('ToLink').'">';
9744 9744
 						}
9745 9745
 						if (empty($conf->use_javascript_ajax)) {
9746
-							$htmltoenteralink .= '<input type="submit" class="button button-cancel marginleftonly marginrightonly small" name="cancel" value="' . $langs->trans("Cancel") . '"></div>';
9746
+							$htmltoenteralink .= '<input type="submit" class="button button-cancel marginleftonly marginrightonly small" name="cancel" value="'.$langs->trans("Cancel").'"></div>';
9747 9747
 						} else {
9748
-							$htmltoenteralink .= '<input type="submit" onclick="jQuery(\'#' . $key . 'list\').toggle(); return false;" class="button button-cancel marginleftonly marginrightonly small" name="cancel" value="' . $langs->trans("Cancel") . '"></div>';
9748
+							$htmltoenteralink .= '<input type="submit" onclick="jQuery(\'#'.$key.'list\').toggle(); return false;" class="button button-cancel marginleftonly marginrightonly small" name="cancel" value="'.$langs->trans("Cancel").'"></div>';
9749 9749
 						}
9750 9750
 						$htmltoenteralink .= '</form>';
9751 9751
 					}
@@ -9759,10 +9759,10 @@  discard block
 block discarded – undo
9759 9759
 
9760 9760
 				// Complete the list for the combo box
9761 9761
 				if ($num > 0 || !getDolGlobalString('MAIN_HIDE_LINK_BY_REF_IN_LINKTO')) {
9762
-					$linktoelemlist .= '<li><a href="#linkto' . $key . '" class="linkto dropdowncloseonclick" rel="' . $key . '">' . $langs->trans($possiblelink['label']) . ' (' . $num . ')</a></li>';
9762
+					$linktoelemlist .= '<li><a href="#linkto'.$key.'" class="linkto dropdowncloseonclick" rel="'.$key.'">'.$langs->trans($possiblelink['label']).' ('.$num.')</a></li>';
9763 9763
 					// } else $linktoelem.=$langs->trans($possiblelink['label']);
9764 9764
 				} else {
9765
-					$linktoelemlist .= '<li><span class="linktodisabled">' . $langs->trans($possiblelink['label']) . ' (0)</span></li>';
9765
+					$linktoelemlist .= '<li><span class="linktodisabled">'.$langs->trans($possiblelink['label']).' (0)</span></li>';
9766 9766
 				}
9767 9767
 			}
9768 9768
 		}
@@ -9772,11 +9772,11 @@  discard block
 block discarded – undo
9772 9772
 			<dl class="dropdown" id="linktoobjectname">
9773 9773
 			';
9774 9774
 			if (!empty($conf->use_javascript_ajax)) {
9775
-				$linktoelem .= '<dt><a href="#linktoobjectname"><span class="fas fa-link paddingrightonly"></span>' . $langs->trans("LinkTo") . '...</a></dt>';
9775
+				$linktoelem .= '<dt><a href="#linktoobjectname"><span class="fas fa-link paddingrightonly"></span>'.$langs->trans("LinkTo").'...</a></dt>';
9776 9776
 			}
9777 9777
 			$linktoelem .= '<dd>
9778 9778
 			<div class="multiselectlinkto">
9779
-			<ul class="ulselectedfields">' . $linktoelemlist . '
9779
+			<ul class="ulselectedfields">' . $linktoelemlist.'
9780 9780
 			</ul>
9781 9781
 			</div>
9782 9782
 			</dd>
@@ -9787,7 +9787,7 @@  discard block
 block discarded – undo
9787 9787
 
9788 9788
 		if (!empty($conf->use_javascript_ajax)) {
9789 9789
 			print '<!-- Add js to show linkto box -->
9790
-				<script nonce="' . getNonce() . '">
9790
+				<script nonce="' . getNonce().'">
9791 9791
 				jQuery(document).ready(function() {
9792 9792
 					jQuery(".linkto").click(function() {
9793 9793
 						console.log("We choose to show/hide links for rel="+jQuery(this).attr(\'rel\')+" so #"+jQuery(this).attr(\'rel\')+"list");
@@ -9834,19 +9834,19 @@  discard block
 block discarded – undo
9834 9834
 
9835 9835
 		$disabled = ($disabled ? ' disabled' : '');
9836 9836
 
9837
-		$resultyesno = '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . '"' . $disabled . '>' . "\n";
9837
+		$resultyesno = '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.'"'.$disabled.'>'."\n";
9838 9838
 		if ($useempty) {
9839
-			$resultyesno .= '<option value="-1"' . (($value < 0) ? ' selected' : '') . '>&nbsp;</option>' . "\n";
9839
+			$resultyesno .= '<option value="-1"'.(($value < 0) ? ' selected' : '').'>&nbsp;</option>'."\n";
9840 9840
 		}
9841 9841
 		if (("$value" == 'yes') || ($value == 1)) {
9842
-			$resultyesno .= '<option value="' . $yes . '" selected>' . $langs->trans($labelyes) . '</option>' . "\n";
9843
-			$resultyesno .= '<option value="' . $no . '">' . $langs->trans($labelno) . '</option>' . "\n";
9842
+			$resultyesno .= '<option value="'.$yes.'" selected>'.$langs->trans($labelyes).'</option>'."\n";
9843
+			$resultyesno .= '<option value="'.$no.'">'.$langs->trans($labelno).'</option>'."\n";
9844 9844
 		} else {
9845 9845
 			$selected = (($useempty && $value != '0' && $value != 'no') ? '' : ' selected');
9846
-			$resultyesno .= '<option value="' . $yes . '">' . $langs->trans($labelyes) . '</option>' . "\n";
9847
-			$resultyesno .= '<option value="' . $no . '"' . $selected . '>' . $langs->trans($labelno) . '</option>' . "\n";
9846
+			$resultyesno .= '<option value="'.$yes.'">'.$langs->trans($labelyes).'</option>'."\n";
9847
+			$resultyesno .= '<option value="'.$no.'"'.$selected.'>'.$langs->trans($labelno).'</option>'."\n";
9848 9848
 		}
9849
-		$resultyesno .= '</select>' . "\n";
9849
+		$resultyesno .= '</select>'."\n";
9850 9850
 
9851 9851
 		if ($addjscombo) {
9852 9852
 			$resultyesno .= ajax_combobox($htmlname, array(), 0, 0, 'resolve', ($useempty < 0 ? (string) $useempty : '-1'), $morecss);
@@ -9870,12 +9870,12 @@  discard block
 block discarded – undo
9870 9870
 	{
9871 9871
 		// phpcs:enable
9872 9872
 		$sql = "SELECT rowid, label";
9873
-		$sql .= " FROM " . $this->db->prefix() . "export_model";
9874
-		$sql .= " WHERE type = '" . $this->db->escape($type) . "'";
9873
+		$sql .= " FROM ".$this->db->prefix()."export_model";
9874
+		$sql .= " WHERE type = '".$this->db->escape($type)."'";
9875 9875
 		$sql .= " ORDER BY rowid";
9876 9876
 		$result = $this->db->query($sql);
9877 9877
 		if ($result) {
9878
-			print '<select class="flat" id="select_' . $htmlname . '" name="' . $htmlname . '">';
9878
+			print '<select class="flat" id="select_'.$htmlname.'" name="'.$htmlname.'">';
9879 9879
 			if ($useempty) {
9880 9880
 				print '<option value="-1">&nbsp;</option>';
9881 9881
 			}
@@ -9885,9 +9885,9 @@  discard block
 block discarded – undo
9885 9885
 			while ($i < $num) {
9886 9886
 				$obj = $this->db->fetch_object($result);
9887 9887
 				if ($selected == $obj->rowid) {
9888
-					print '<option value="' . $obj->rowid . '" selected>';
9888
+					print '<option value="'.$obj->rowid.'" selected>';
9889 9889
 				} else {
9890
-					print '<option value="' . $obj->rowid . '">';
9890
+					print '<option value="'.$obj->rowid.'">';
9891 9891
 				}
9892 9892
 				print $obj->label;
9893 9893
 				print '</option>';
@@ -9978,8 +9978,8 @@  discard block
 block discarded – undo
9978 9978
 				$stringforfirstkey .= ' CTL +';
9979 9979
 			}
9980 9980
 
9981
-			$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>';
9982
-			$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>';
9981
+			$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>';
9982
+			$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>';
9983 9983
 		}
9984 9984
 
9985 9985
 		//print "xx".$previous_ref."x".$next_ref;
@@ -9987,18 +9987,18 @@  discard block
 block discarded – undo
9987 9987
 
9988 9988
 		// Right part of banner
9989 9989
 		if ($morehtmlright) {
9990
-			$ret .= '<div class="inline-block floatleft">' . $morehtmlright . '</div>';
9990
+			$ret .= '<div class="inline-block floatleft">'.$morehtmlright.'</div>';
9991 9991
 		}
9992 9992
 
9993 9993
 		if ($previous_ref || $next_ref || $morehtml) {
9994 9994
 			$ret .= '<div class="pagination paginationref"><ul class="right">';
9995 9995
 		}
9996 9996
 		if ($morehtml && getDolGlobalInt('MAIN_OPTIMIZEFORTEXTBROWSER') < 2) {
9997
-			$ret .= '<!-- morehtml --><li class="noborder litext' . (($shownav && $previous_ref && $next_ref) ? ' clearbothonsmartphone' : '') . '">' . $morehtml . '</li>';
9997
+			$ret .= '<!-- morehtml --><li class="noborder litext'.(($shownav && $previous_ref && $next_ref) ? ' clearbothonsmartphone' : '').'">'.$morehtml.'</li>';
9998 9998
 		}
9999 9999
 		if ($shownav && ($previous_ref || $next_ref)) {
10000
-			$ret .= '<li class="pagination">' . $previous_ref . '</li>';
10001
-			$ret .= '<li class="pagination">' . $next_ref . '</li>';
10000
+			$ret .= '<li class="pagination">'.$previous_ref.'</li>';
10001
+			$ret .= '<li class="pagination">'.$next_ref.'</li>';
10002 10002
 		}
10003 10003
 		if ($previous_ref || $next_ref || $morehtml) {
10004 10004
 			$ret .= '</ul></div>';
@@ -10013,7 +10013,7 @@  discard block
 block discarded – undo
10013 10013
 			$morehtmlstatus = $hookmanager->resPrint;
10014 10014
 		}
10015 10015
 		if ($morehtmlstatus) {
10016
-			$ret .= '<div class="statusref">' . $morehtmlstatus . '</div>';
10016
+			$ret .= '<div class="statusref">'.$morehtmlstatus.'</div>';
10017 10017
 		}
10018 10018
 
10019 10019
 		$parameters = array();
@@ -10027,14 +10027,14 @@  discard block
 block discarded – undo
10027 10027
 		// Left part of banner
10028 10028
 		if ($morehtmlleft) {
10029 10029
 			if ($conf->browser->layout == 'phone') {
10030
-				$ret .= '<!-- morehtmlleft --><div class="floatleft">' . $morehtmlleft . '</div>';
10030
+				$ret .= '<!-- morehtmlleft --><div class="floatleft">'.$morehtmlleft.'</div>';
10031 10031
 			} else {
10032
-				$ret .= '<!-- morehtmlleft --><div class="inline-block floatleft">' . $morehtmlleft . '</div>';
10032
+				$ret .= '<!-- morehtmlleft --><div class="inline-block floatleft">'.$morehtmlleft.'</div>';
10033 10033
 			}
10034 10034
 		}
10035 10035
 
10036 10036
 		//if ($conf->browser->layout == 'phone') $ret.='<div class="clearboth"></div>';
10037
-		$ret .= '<div class="inline-block floatleft valignmiddle maxwidth750 marginbottomonly refid' . (($shownav && ($previous_ref || $next_ref)) ? ' refidpadding' : '') . '">';
10037
+		$ret .= '<div class="inline-block floatleft valignmiddle maxwidth750 marginbottomonly refid'.(($shownav && ($previous_ref || $next_ref)) ? ' refidpadding' : '').'">';
10038 10038
 
10039 10039
 		// For thirdparty, contact, user, member, the ref is the id, so we show something else
10040 10040
 		if ($object->element == 'societe') {
@@ -10048,7 +10048,7 @@  discard block
 block discarded – undo
10048 10048
 
10049 10049
 			if (is_array($arrayoflangcode) && count($arrayoflangcode)) {
10050 10050
 				if (!is_object($extralanguages)) {
10051
-					include_once DOL_DOCUMENT_ROOT . '/core/class/extralanguages.class.php';
10051
+					include_once DOL_DOCUMENT_ROOT.'/core/class/extralanguages.class.php';
10052 10052
 					$extralanguages = new ExtraLanguages($this->db);
10053 10053
 				}
10054 10054
 				$extralanguages->fetch_name_extralanguages('societe');
@@ -10063,29 +10063,29 @@  discard block
 block discarded – undo
10063 10063
 						if ($object->array_languages['name'][$extralangcode]) {
10064 10064
 							$htmltext .= $object->array_languages['name'][$extralangcode];
10065 10065
 						} else {
10066
-							$htmltext .= '<span class="opacitymedium">' . $langs->trans("SwitchInEditModeToAddTranslation") . '</span>';
10066
+							$htmltext .= '<span class="opacitymedium">'.$langs->trans("SwitchInEditModeToAddTranslation").'</span>';
10067 10067
 						}
10068 10068
 					}
10069
-					$ret .= '<!-- Show translations of name -->' . "\n";
10069
+					$ret .= '<!-- Show translations of name -->'."\n";
10070 10070
 					$ret .= $this->textwithpicto('', $htmltext, -1, 'language', 'opacitymedium paddingleft');
10071 10071
 				}
10072 10072
 			}
10073 10073
 		} elseif ($object->element == 'member') {
10074 10074
 			'@phan-var-force Adherent $object';
10075
-			$ret .= $object->ref . '<br>';
10075
+			$ret .= $object->ref.'<br>';
10076 10076
 			$fullname = $object->getFullName($langs);
10077 10077
 			if ($object->morphy == 'mor' && $object->societe) {
10078
-				$ret .= dol_htmlentities($object->societe) . ((!empty($fullname) && $object->societe != $fullname) ? ' (' . dol_htmlentities($fullname) . $addgendertxt . ')' : '');
10078
+				$ret .= dol_htmlentities($object->societe).((!empty($fullname) && $object->societe != $fullname) ? ' ('.dol_htmlentities($fullname).$addgendertxt.')' : '');
10079 10079
 			} else {
10080
-				$ret .= dol_htmlentities($fullname) . $addgendertxt . ((!empty($object->societe) && $object->societe != $fullname) ? ' (' . dol_htmlentities($object->societe) . ')' : '');
10080
+				$ret .= dol_htmlentities($fullname).$addgendertxt.((!empty($object->societe) && $object->societe != $fullname) ? ' ('.dol_htmlentities($object->societe).')' : '');
10081 10081
 			}
10082 10082
 		} elseif (in_array($object->element, array('contact', 'user'))) {
10083
-			$ret .= dol_htmlentities($object->getFullName($langs)) . $addgendertxt;
10083
+			$ret .= dol_htmlentities($object->getFullName($langs)).$addgendertxt;
10084 10084
 		} elseif ($object->element == 'usergroup') {
10085 10085
 			$ret .= dol_htmlentities($object->name);
10086 10086
 		} elseif (in_array($object->element, array('action', 'agenda'))) {
10087 10087
 			'@phan-var-force ActionComm $object';
10088
-			$ret .= $object->ref . '<br>' . $object->label;
10088
+			$ret .= $object->ref.'<br>'.$object->label;
10089 10089
 		} elseif (in_array($object->element, array('adherent_type'))) {
10090 10090
 			$ret .= $object->label;
10091 10091
 		} elseif ($object->element == 'ecm_directories') {
@@ -10138,9 +10138,9 @@  discard block
 block discarded – undo
10138 10138
 		}
10139 10139
 
10140 10140
 		// Barcode image  @phan-suppress-next-line PhanUndeclaredProperty
10141
-		$url = DOL_URL_ROOT . '/viewimage.php?modulepart=barcode&generator=' . urlencode($object->barcode_type_coder) . '&code=' . urlencode($object->barcode) . '&encoding=' . urlencode($object->barcode_type_code);
10142
-		$out = '<!-- url barcode = ' . $url . ' -->';
10143
-		$out .= '<img src="' . $url . '"' . ($morecss ? ' class="' . $morecss . '"' : '') . '>';
10141
+		$url = DOL_URL_ROOT.'/viewimage.php?modulepart=barcode&generator='.urlencode($object->barcode_type_coder).'&code='.urlencode($object->barcode).'&encoding='.urlencode($object->barcode_type_code);
10142
+		$out = '<!-- url barcode = '.$url.' -->';
10143
+		$out .= '<img src="'.$url.'"'.($morecss ? ' class="'.$morecss.'"' : '').'>';
10144 10144
 
10145 10145
 		return $out;
10146 10146
 	}
@@ -10167,7 +10167,7 @@  discard block
 block discarded – undo
10167 10167
 		global $conf, $langs;
10168 10168
 
10169 10169
 		$entity = (empty($object->entity) ? $conf->entity : $object->entity);
10170
-		$id = (empty($object->id) ? $object->rowid : $object->id);  // @phan-suppress-current-line PhanUndeclaredProperty (->rowid)
10170
+		$id = (empty($object->id) ? $object->rowid : $object->id); // @phan-suppress-current-line PhanUndeclaredProperty (->rowid)
10171 10171
 
10172 10172
 		$dir = '';
10173 10173
 		$file = '';
@@ -10180,28 +10180,28 @@  discard block
 block discarded – undo
10180 10180
 			if (!empty($object->logo)) {
10181 10181
 				if (dolIsAllowedForPreview($object->logo)) {
10182 10182
 					if ((string) $imagesize == 'mini') {
10183
-						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . getImageFileNameForSize($object->logo, '_mini'); // getImageFileNameForSize include the thumbs
10183
+						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.getImageFileNameForSize($object->logo, '_mini'); // getImageFileNameForSize include the thumbs
10184 10184
 					} elseif ((string) $imagesize == 'small') {
10185
-						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . getImageFileNameForSize($object->logo, '_small');
10185
+						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.getImageFileNameForSize($object->logo, '_small');
10186 10186
 					} else {
10187
-						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . $object->logo;
10187
+						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.$object->logo;
10188 10188
 					}
10189
-					$originalfile = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . $object->logo;
10189
+					$originalfile = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.$object->logo;
10190 10190
 				}
10191 10191
 			}
10192 10192
 			$email = $object->email;
10193 10193
 		} elseif ($modulepart == 'contact') {
10194
-			$dir = $conf->societe->multidir_output[$entity] . '/contact';
10194
+			$dir = $conf->societe->multidir_output[$entity].'/contact';
10195 10195
 			if (!empty($object->photo)) {
10196 10196
 				if (dolIsAllowedForPreview($object->photo)) {
10197 10197
 					if ((string) $imagesize == 'mini') {
10198
-						$file = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . getImageFileNameForSize($object->photo, '_mini');
10198
+						$file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.getImageFileNameForSize($object->photo, '_mini');
10199 10199
 					} elseif ((string) $imagesize == 'small') {
10200
-						$file = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . getImageFileNameForSize($object->photo, '_small');
10200
+						$file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.getImageFileNameForSize($object->photo, '_small');
10201 10201
 					} else {
10202
-						$file = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . $object->photo;
10202
+						$file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.$object->photo;
10203 10203
 					}
10204
-					$originalfile = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . $object->photo;
10204
+					$originalfile = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.$object->photo;
10205 10205
 				}
10206 10206
 			}
10207 10207
 			$email = $object->email;
@@ -10211,17 +10211,17 @@  discard block
 block discarded – undo
10211 10211
 			if (!empty($object->photo)) {
10212 10212
 				if (dolIsAllowedForPreview($object->photo)) {
10213 10213
 					if ((string) $imagesize == 'mini') {
10214
-						$file = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . getImageFileNameForSize($object->photo, '_mini');
10214
+						$file = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.getImageFileNameForSize($object->photo, '_mini');
10215 10215
 					} elseif ((string) $imagesize == 'small') {
10216
-						$file = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . getImageFileNameForSize($object->photo, '_small');
10216
+						$file = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.getImageFileNameForSize($object->photo, '_small');
10217 10217
 					} else {
10218
-						$file = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . $object->photo;
10218
+						$file = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.$object->photo;
10219 10219
 					}
10220
-					$originalfile = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . $object->photo;
10220
+					$originalfile = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.$object->photo;
10221 10221
 				}
10222 10222
 			}
10223 10223
 			if (getDolGlobalString('MAIN_OLD_IMAGE_LINKS')) {
10224
-				$altfile = $object->id . ".jpg"; // For backward compatibility
10224
+				$altfile = $object->id.".jpg"; // For backward compatibility
10225 10225
 			}
10226 10226
 			$email = $object->email;
10227 10227
 			$capture = 'user';
@@ -10230,17 +10230,17 @@  discard block
 block discarded – undo
10230 10230
 			if (!empty($object->photo)) {
10231 10231
 				if (dolIsAllowedForPreview($object->photo)) {
10232 10232
 					if ((string) $imagesize == 'mini') {
10233
-						$file = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . getImageFileNameForSize($object->photo, '_mini');
10233
+						$file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_mini');
10234 10234
 					} elseif ((string) $imagesize == 'small') {
10235
-						$file = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . getImageFileNameForSize($object->photo, '_small');
10235
+						$file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_small');
10236 10236
 					} else {
10237
-						$file = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . $object->photo;
10237
+						$file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.$object->photo;
10238 10238
 					}
10239
-					$originalfile = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . $object->photo;
10239
+					$originalfile = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.$object->photo;
10240 10240
 				}
10241 10241
 			}
10242 10242
 			if (getDolGlobalString('MAIN_OLD_IMAGE_LINKS')) {
10243
-				$altfile = $object->id . ".jpg"; // For backward compatibility
10243
+				$altfile = $object->id.".jpg"; // For backward compatibility
10244 10244
 			}
10245 10245
 			$email = $object->email;
10246 10246
 			$capture = 'user';
@@ -10266,35 +10266,35 @@  discard block
 block discarded – undo
10266 10266
 		$ret = '';
10267 10267
 
10268 10268
 		if ($dir) {
10269
-			if ($file && file_exists($dir . "/" . $file)) {
10269
+			if ($file && file_exists($dir."/".$file)) {
10270 10270
 				if ($addlinktofullsize) {
10271
-					$urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity=' . $entity);
10271
+					$urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity='.$entity);
10272 10272
 					if ($urladvanced) {
10273
-						$ret .= '<a href="' . $urladvanced . '">';
10273
+						$ret .= '<a href="'.$urladvanced.'">';
10274 10274
 					} else {
10275
-						$ret .= '<a href="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($originalfile) . '&cache=' . $cache . '">';
10275
+						$ret .= '<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($originalfile).'&cache='.$cache.'">';
10276 10276
 					}
10277 10277
 				}
10278
-				$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 . '">';
10278
+				$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.'">';
10279 10279
 				if ($addlinktofullsize) {
10280 10280
 					$ret .= '</a>';
10281 10281
 				}
10282
-			} elseif ($altfile && file_exists($dir . "/" . $altfile)) {
10282
+			} elseif ($altfile && file_exists($dir."/".$altfile)) {
10283 10283
 				if ($addlinktofullsize) {
10284
-					$urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity=' . $entity);
10284
+					$urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity='.$entity);
10285 10285
 					if ($urladvanced) {
10286
-						$ret .= '<a href="' . $urladvanced . '">';
10286
+						$ret .= '<a href="'.$urladvanced.'">';
10287 10287
 					} else {
10288
-						$ret .= '<a href="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($originalfile) . '&cache=' . $cache . '">';
10288
+						$ret .= '<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($originalfile).'&cache='.$cache.'">';
10289 10289
 					}
10290 10290
 				}
10291
-				$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 . '">';
10291
+				$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.'">';
10292 10292
 				if ($addlinktofullsize) {
10293 10293
 					$ret .= '</a>';
10294 10294
 				}
10295 10295
 			} else {
10296 10296
 				$nophoto = '/public/theme/common/nophoto.png';
10297
-				$defaultimg = 'identicon';        // For gravatar
10297
+				$defaultimg = 'identicon'; // For gravatar
10298 10298
 				if (in_array($modulepart, array('societe', 'userphoto', 'contact', 'memberphoto'))) {    // For modules that need a special image when photo not found
10299 10299
 					if ($modulepart == 'societe' || ($modulepart == 'memberphoto' && !empty($object->morphy) && strpos($object->morphy, 'mor') !== false)) {
10300 10300
 						$nophoto = 'company';
@@ -10312,13 +10312,13 @@  discard block
 block discarded – undo
10312 10312
 				if (isModEnabled('gravatar') && $email && empty($noexternsourceoverwrite)) {
10313 10313
 					// see https://gravatar.com/site/implement/images/php/
10314 10314
 					$ret .= '<!-- Put link to gravatar -->';
10315
-					$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
10315
+					$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
10316 10316
 				} else {
10317 10317
 					if ($nophoto == 'company') {
10318
-						$ret .= '<div class="divforspanimg valignmiddle center photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . '>' . img_picto('', 'company') . '</div>';
10318
+						$ret .= '<div class="divforspanimg valignmiddle center photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').'>'.img_picto('', 'company').'</div>';
10319 10319
 						//$ret .= '<div class="difforspanimgright"></div>';
10320 10320
 					} else {
10321
-						$ret .= '<img class="photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . ' src="' . DOL_URL_ROOT . $nophoto . '">';
10321
+						$ret .= '<img class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').' src="'.DOL_URL_ROOT.$nophoto.'">';
10322 10322
 					}
10323 10323
 				}
10324 10324
 			}
@@ -10329,15 +10329,15 @@  discard block
 block discarded – undo
10329 10329
 				}
10330 10330
 				$ret .= '<table class="nobordernopadding centpercent">';
10331 10331
 				if ($object->photo) {
10332
-					$ret .= '<tr><td><input type="checkbox" class="flat photodelete" name="deletephoto" id="photodelete"> <label for="photodelete">' . $langs->trans("Delete") . '</label><br><br></td></tr>';
10332
+					$ret .= '<tr><td><input type="checkbox" class="flat photodelete" name="deletephoto" id="photodelete"> <label for="photodelete">'.$langs->trans("Delete").'</label><br><br></td></tr>';
10333 10333
 				}
10334 10334
 				$ret .= '<tr><td class="tdoverflow">';
10335 10335
 				$maxfilesizearray = getMaxFileSizeArray();
10336 10336
 				$maxmin = $maxfilesizearray['maxmin'];
10337 10337
 				if ($maxmin > 0) {
10338
-					$ret .= '<input type="hidden" name="MAX_FILE_SIZE" value="' . ($maxmin * 1024) . '">';    // MAX_FILE_SIZE must precede the field type=file
10338
+					$ret .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file
10339 10339
 				}
10340
-				$ret .= '<input type="file" class="flat maxwidth200onsmartphone" name="photo" id="photoinput" accept="image/*"' . ($capture ? ' capture="' . $capture . '"' : '') . '>';
10340
+				$ret .= '<input type="file" class="flat maxwidth200onsmartphone" name="photo" id="photoinput" accept="image/*"'.($capture ? ' capture="'.$capture.'"' : '').'>';
10341 10341
 				$ret .= '</td></tr>';
10342 10342
 				$ret .= '</table>';
10343 10343
 			}
@@ -10391,38 +10391,38 @@  discard block
 block discarded – undo
10391 10391
 		if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) {
10392 10392
 			$sql .= ", e.label";
10393 10393
 		}
10394
-		$sql .= " FROM " . $this->db->prefix() . "usergroup as ug ";
10394
+		$sql .= " FROM ".$this->db->prefix()."usergroup as ug ";
10395 10395
 		if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) {
10396
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "entity as e ON e.rowid=ug.entity";
10396
+			$sql .= " LEFT JOIN ".$this->db->prefix()."entity as e ON e.rowid=ug.entity";
10397 10397
 			if ($force_entity) {
10398
-				$sql .= " WHERE ug.entity IN (0, " . $force_entity . ")";
10398
+				$sql .= " WHERE ug.entity IN (0, ".$force_entity.")";
10399 10399
 			} else {
10400 10400
 				$sql .= " WHERE ug.entity IS NOT NULL";
10401 10401
 			}
10402 10402
 		} else {
10403
-			$sql .= " WHERE ug.entity IN (0, " . $conf->entity . ")";
10403
+			$sql .= " WHERE ug.entity IN (0, ".$conf->entity.")";
10404 10404
 		}
10405 10405
 		if (is_array($exclude) && $excludeGroups) {
10406
-			$sql .= " AND ug.rowid NOT IN (" . $this->db->sanitize($excludeGroups) . ")";
10406
+			$sql .= " AND ug.rowid NOT IN (".$this->db->sanitize($excludeGroups).")";
10407 10407
 		}
10408 10408
 		if (is_array($include) && $includeGroups) {
10409
-			$sql .= " AND ug.rowid IN (" . $this->db->sanitize($includeGroups) . ")";
10409
+			$sql .= " AND ug.rowid IN (".$this->db->sanitize($includeGroups).")";
10410 10410
 		}
10411 10411
 		$sql .= " ORDER BY ug.nom ASC";
10412 10412
 
10413
-		dol_syslog(get_class($this) . "::select_dolgroups", LOG_DEBUG);
10413
+		dol_syslog(get_class($this)."::select_dolgroups", LOG_DEBUG);
10414 10414
 		$resql = $this->db->query($sql);
10415 10415
 		if ($resql) {
10416 10416
 			// Enhance with select2
10417
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
10417
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
10418 10418
 
10419
-			$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . ' ' . ($disabled ? ' disabled' : '') . '>';
10419
+			$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.($disabled ? ' disabled' : '').'>';
10420 10420
 
10421 10421
 			$num = $this->db->num_rows($resql);
10422 10422
 			$i = 0;
10423 10423
 			if ($num) {
10424 10424
 				if ($show_empty && !$multiple) {
10425
-					$out .= '<option value="-1"' . (in_array(-1, $selected) ? ' selected' : '') . '>&nbsp;</option>' . "\n";
10425
+					$out .= '<option value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'>&nbsp;</option>'."\n";
10426 10426
 				}
10427 10427
 
10428 10428
 				while ($i < $num) {
@@ -10435,11 +10435,11 @@  discard block
 block discarded – undo
10435 10435
 					$label = $obj->name;
10436 10436
 					$labelhtml = $obj->name;
10437 10437
 					if (isModEnabled('multicompany') && !getDolGlobalInt('MULTICOMPANY_TRANSVERSE_MODE') && $conf->entity == 1) {
10438
-						$label .= " (" . $obj->label . ")";
10439
-						$labelhtml .= ' <span class="opacitymedium">(' . $obj->label . ')</span>';
10438
+						$label .= " (".$obj->label.")";
10439
+						$labelhtml .= ' <span class="opacitymedium">('.$obj->label.')</span>';
10440 10440
 					}
10441 10441
 
10442
-					$out .= '<option value="' . $obj->rowid . '"';
10442
+					$out .= '<option value="'.$obj->rowid.'"';
10443 10443
 					if ($disableline) {
10444 10444
 						$out .= ' disabled';
10445 10445
 					}
@@ -10455,9 +10455,9 @@  discard block
 block discarded – undo
10455 10455
 				}
10456 10456
 			} else {
10457 10457
 				if ($show_empty) {
10458
-					$out .= '<option value="-1"' . (in_array(-1, $selected) ? ' selected' : '') . '></option>' . "\n";
10458
+					$out .= '<option value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'></option>'."\n";
10459 10459
 				}
10460
-				$out .= '<option value="" disabled>' . $langs->trans("NoUserGroupDefined") . '</option>';
10460
+				$out .= '<option value="" disabled>'.$langs->trans("NoUserGroupDefined").'</option>';
10461 10461
 			}
10462 10462
 			$out .= '</select>';
10463 10463
 
@@ -10501,25 +10501,25 @@  discard block
 block discarded – undo
10501 10501
 		$out = '';
10502 10502
 
10503 10503
 		if (!empty($conf->use_javascript_ajax)) {
10504
-			$out .= '<div class="inline-block checkallactions"><input type="checkbox" id="' . $cssclass . 's" name="' . $cssclass . 's" class="checkallactions"></div>';
10504
+			$out .= '<div class="inline-block checkallactions"><input type="checkbox" id="'.$cssclass.'s" name="'.$cssclass.'s" class="checkallactions"></div>';
10505 10505
 		}
10506
-		$out .= '<script nonce="' . getNonce() . '">
10506
+		$out .= '<script nonce="'.getNonce().'">
10507 10507
             $(document).ready(function() {
10508
-                $("#' . $cssclass . 's").click(function() {
10508
+                $("#' . $cssclass.'s").click(function() {
10509 10509
                     if($(this).is(\':checked\')){
10510
-                        console.log("We check all ' . $cssclass . ' and trigger the change method");
10511
-                		$(".' . $cssclass . '").prop(\'checked\', true).trigger(\'change\');
10510
+                        console.log("We check all ' . $cssclass.' and trigger the change method");
10511
+                		$(".' . $cssclass.'").prop(\'checked\', true).trigger(\'change\');
10512 10512
                     }
10513 10513
                     else
10514 10514
                     {
10515 10515
                         console.log("We uncheck all");
10516
-                		$(".' . $cssclass . '").prop(\'checked\', false).trigger(\'change\');
10516
+                		$(".' . $cssclass.'").prop(\'checked\', false).trigger(\'change\');
10517 10517
                     }' . "\n";
10518 10518
 		if ($calljsfunction) {
10519
-			$out .= 'if (typeof initCheckForSelect == \'function\') { initCheckForSelect(0, "' . $massactionname . '", "' . $cssclass . '"); } else { console.log("No function initCheckForSelect found. Call won\'t be done."); }';
10519
+			$out .= 'if (typeof initCheckForSelect == \'function\') { initCheckForSelect(0, "'.$massactionname.'", "'.$cssclass.'"); } else { console.log("No function initCheckForSelect found. Call won\'t be done."); }';
10520 10520
 		}
10521 10521
 		$out .= '         });
10522
-        	        $(".' . $cssclass . '").change(function() {
10522
+        	        $(".' . $cssclass.'").change(function() {
10523 10523
 					$(this).closest("tr").toggleClass("highlight", this.checked);
10524 10524
 				});
10525 10525
 		 	});
@@ -10564,67 +10564,67 @@  discard block
 block discarded – undo
10564 10564
 		global $langs, $user;
10565 10565
 
10566 10566
 		$out = '';
10567
-		$sql = "SELECT rowid, label FROM " . $this->db->prefix() . "c_exp_tax_cat WHERE active = 1";
10568
-		$sql .= " AND entity IN (0," . getEntity('exp_tax_cat') . ")";
10567
+		$sql = "SELECT rowid, label FROM ".$this->db->prefix()."c_exp_tax_cat WHERE active = 1";
10568
+		$sql .= " AND entity IN (0,".getEntity('exp_tax_cat').")";
10569 10569
 		if (!empty($excludeid)) {
10570
-			$sql .= " AND rowid NOT IN (" . $this->db->sanitize(implode(',', $excludeid)) . ")";
10570
+			$sql .= " AND rowid NOT IN (".$this->db->sanitize(implode(',', $excludeid)).")";
10571 10571
 		}
10572 10572
 		$sql .= " ORDER BY label";
10573 10573
 
10574 10574
 		$resql = $this->db->query($sql);
10575 10575
 		if ($resql) {
10576
-			$out = '<select id="select_' . $htmlname . '" name="' . $htmlname . '" class="' . $htmlname . ' flat minwidth75imp maxwidth200">';
10576
+			$out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp maxwidth200">';
10577 10577
 			if ($useempty) {
10578 10578
 				$out .= '<option value="0">&nbsp;</option>';
10579 10579
 			}
10580 10580
 
10581 10581
 			while ($obj = $this->db->fetch_object($resql)) {
10582
-				$out .= '<option ' . ($selected == $obj->rowid ? 'selected="selected"' : '') . ' value="' . $obj->rowid . '">' . $langs->trans($obj->label) . '</option>';
10582
+				$out .= '<option '.($selected == $obj->rowid ? 'selected="selected"' : '').' value="'.$obj->rowid.'">'.$langs->trans($obj->label).'</option>';
10583 10583
 			}
10584 10584
 			$out .= '</select>';
10585
-			$out .= ajax_combobox('select_' . $htmlname);
10585
+			$out .= ajax_combobox('select_'.$htmlname);
10586 10586
 
10587 10587
 			if (!empty($htmlname) && $user->admin && $info_admin) {
10588
-				$out .= ' ' . info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
10588
+				$out .= ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
10589 10589
 			}
10590 10590
 
10591 10591
 			if (!empty($target)) {
10592
-				$sql = "SELECT c.id FROM " . $this->db->prefix() . "c_type_fees as c WHERE c.code = 'EX_KME' AND c.active = 1";
10592
+				$sql = "SELECT c.id FROM ".$this->db->prefix()."c_type_fees as c WHERE c.code = 'EX_KME' AND c.active = 1";
10593 10593
 				$resql = $this->db->query($sql);
10594 10594
 				if ($resql) {
10595 10595
 					if ($this->db->num_rows($resql) > 0) {
10596 10596
 						$obj = $this->db->fetch_object($resql);
10597
-						$out .= '<script nonce="' . getNonce() . '">
10597
+						$out .= '<script nonce="'.getNonce().'">
10598 10598
 							$(function() {
10599
-								$("select[name=' . $target . ']").on("change", function() {
10599
+								$("select[name=' . $target.']").on("change", function() {
10600 10600
 									var current_val = $(this).val();
10601
-									if (current_val == ' . $obj->id . ') {';
10601
+									if (current_val == ' . $obj->id.') {';
10602 10602
 						if (!empty($default_selected) || !empty($selected)) {
10603
-							$out .= '$("select[name=' . $htmlname . ']").val("' . ($default_selected > 0 ? $default_selected : $selected) . '");';
10603
+							$out .= '$("select[name='.$htmlname.']").val("'.($default_selected > 0 ? $default_selected : $selected).'");';
10604 10604
 						}
10605 10605
 
10606 10606
 						$out .= '
10607
-										$("select[name=' . $htmlname . ']").change();
10607
+										$("select[name=' . $htmlname.']").change();
10608 10608
 									}
10609 10609
 								});
10610 10610
 
10611
-								$("select[name=' . $htmlname . ']").change(function() {
10611
+								$("select[name=' . $htmlname.']").change(function() {
10612 10612
 
10613
-									if ($("select[name=' . $target . ']").val() == ' . $obj->id . ') {
10613
+									if ($("select[name=' . $target.']").val() == '.$obj->id.') {
10614 10614
 										// get price of kilometer to fill the unit price
10615 10615
 										$.ajax({
10616 10616
 											method: "POST",
10617 10617
 											dataType: "json",
10618
-											data: { fk_c_exp_tax_cat: $(this).val(), token: \'' . currentToken() . '\' },
10619
-											url: "' . (DOL_URL_ROOT . '/expensereport/ajax/ajaxik.php?' . implode('&', $params)) . '",
10618
+											data: { fk_c_exp_tax_cat: $(this).val(), token: \'' . currentToken().'\' },
10619
+											url: "' . (DOL_URL_ROOT.'/expensereport/ajax/ajaxik.php?'.implode('&', $params)).'",
10620 10620
 										}).done(function( data, textStatus, jqXHR ) {
10621 10621
 											console.log(data);
10622 10622
 											if (typeof data.up != "undefined") {
10623 10623
 												$("input[name=value_unit]").val(data.up);
10624
-												$("select[name=' . $htmlname . ']").attr("title", data.title);
10624
+												$("select[name=' . $htmlname.']").attr("title", data.title);
10625 10625
 											} else {
10626 10626
 												$("input[name=value_unit]").val("");
10627
-												$("select[name=' . $htmlname . ']").attr("title", "");
10627
+												$("select[name=' . $htmlname.']").attr("title", "");
10628 10628
 											}
10629 10629
 										});
10630 10630
 									}
@@ -10654,18 +10654,18 @@  discard block
 block discarded – undo
10654 10654
 		global $conf, $langs;
10655 10655
 
10656 10656
 		$out = '';
10657
-		$sql = "SELECT rowid, range_ik FROM " . $this->db->prefix() . "c_exp_tax_range";
10658
-		$sql .= " WHERE entity = " . $conf->entity . " AND active = 1";
10657
+		$sql = "SELECT rowid, range_ik FROM ".$this->db->prefix()."c_exp_tax_range";
10658
+		$sql .= " WHERE entity = ".$conf->entity." AND active = 1";
10659 10659
 
10660 10660
 		$resql = $this->db->query($sql);
10661 10661
 		if ($resql) {
10662
-			$out = '<select id="select_' . $htmlname . '" name="' . $htmlname . '" class="' . $htmlname . ' flat minwidth75imp">';
10662
+			$out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp">';
10663 10663
 			if ($useempty) {
10664 10664
 				$out .= '<option value="0"></option>';
10665 10665
 			}
10666 10666
 
10667 10667
 			while ($obj = $this->db->fetch_object($resql)) {
10668
-				$out .= '<option ' . ($selected == $obj->rowid ? 'selected="selected"' : '') . ' value="' . $obj->rowid . '">' . price($obj->range_ik, 0, $langs, 1, 0) . '</option>';
10668
+				$out .= '<option '.($selected == $obj->rowid ? 'selected="selected"' : '').' value="'.$obj->rowid.'">'.price($obj->range_ik, 0, $langs, 1, 0).'</option>';
10669 10669
 			}
10670 10670
 			$out .= '</select>';
10671 10671
 		} else {
@@ -10696,12 +10696,12 @@  discard block
 block discarded – undo
10696 10696
 
10697 10697
 		$resql = $this->db->query($sql);
10698 10698
 		if ($resql) {
10699
-			$out = '<select id="select_' . $htmlname . '" name="' . $htmlname . '" class="' . $htmlname . ' flat minwidth75imp">';
10699
+			$out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp">';
10700 10700
 			if ($useempty) {
10701 10701
 				$out .= '<option value="0"></option>';
10702 10702
 			}
10703 10703
 			if ($allchoice) {
10704
-				$out .= '<option value="-1">' . $langs->trans('AllExpenseReport') . '</option>';
10704
+				$out .= '<option value="-1">'.$langs->trans('AllExpenseReport').'</option>';
10705 10705
 			}
10706 10706
 
10707 10707
 			$field = 'code';
@@ -10711,7 +10711,7 @@  discard block
 block discarded – undo
10711 10711
 
10712 10712
 			while ($obj = $this->db->fetch_object($resql)) {
10713 10713
 				$key = $langs->trans($obj->code);
10714
-				$out .= '<option ' . ($selected == $obj->{$field} ? 'selected="selected"' : '') . ' value="' . $obj->{$field} . '">' . ($key != $obj->code ? $key : $obj->label) . '</option>';
10714
+				$out .= '<option '.($selected == $obj->{$field} ? 'selected="selected"' : '').' value="'.$obj->{$field}.'">'.($key != $obj->code ? $key : $obj->label).'</option>';
10715 10715
 			}
10716 10716
 			$out .= '</select>';
10717 10717
 
@@ -10745,7 +10745,7 @@  discard block
 block discarded – undo
10745 10745
 	{
10746 10746
 		global $user, $conf, $langs;
10747 10747
 
10748
-		require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
10748
+		require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
10749 10749
 
10750 10750
 		if (is_null($usertofilter)) {
10751 10751
 			$usertofilter = $user;
@@ -10769,10 +10769,10 @@  discard block
 block discarded – undo
10769 10769
 		$sql = "SELECT f.rowid, f.ref as fref, 'nolabel' as flabel, p.rowid as pid, f.ref,
10770 10770
             p.title, p.fk_soc, p.fk_statut, p.public,";
10771 10771
 		$sql .= ' s.nom as name';
10772
-		$sql .= ' FROM ' . $this->db->prefix() . 'projet as p';
10773
-		$sql .= ' LEFT JOIN ' . $this->db->prefix() . 'societe as s ON s.rowid = p.fk_soc,';
10774
-		$sql .= ' ' . $this->db->prefix() . 'facture as f';
10775
-		$sql .= " WHERE p.entity IN (" . getEntity('project') . ")";
10772
+		$sql .= ' FROM '.$this->db->prefix().'projet as p';
10773
+		$sql .= ' LEFT JOIN '.$this->db->prefix().'societe as s ON s.rowid = p.fk_soc,';
10774
+		$sql .= ' '.$this->db->prefix().'facture as f';
10775
+		$sql .= " WHERE p.entity IN (".getEntity('project').")";
10776 10776
 		$sql .= " AND f.fk_projet = p.rowid AND f.fk_statut=0"; //Brouillons seulement
10777 10777
 		//if ($projectsListId) $sql.= " AND p.rowid IN (".$this->db->sanitize($projectsListId).")";
10778 10778
 		//if ($socid == 0) $sql.= " AND (p.fk_soc=0 OR p.fk_soc IS NULL)";
@@ -10783,14 +10783,14 @@  discard block
 block discarded – undo
10783 10783
 		if ($resql) {
10784 10784
 			// Use select2 selector
10785 10785
 			if (!empty($conf->use_javascript_ajax)) {
10786
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
10786
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
10787 10787
 				$comboenhancement = ajax_combobox($htmlname, array(), 0, $forcefocus);
10788 10788
 				$out .= $comboenhancement;
10789 10789
 				$morecss = 'minwidth200imp maxwidth500';
10790 10790
 			}
10791 10791
 
10792 10792
 			if (empty($option_only)) {
10793
-				$out .= '<select class="valignmiddle flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ' id="' . $htmlname . '" name="' . $htmlname . '">';
10793
+				$out .= '<select class="valignmiddle flat'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').' id="'.$htmlname.'" name="'.$htmlname.'">';
10794 10794
 			}
10795 10795
 			if (!empty($show_empty)) {
10796 10796
 				$out .= '<option value="0" class="optiongrey">';
@@ -10820,33 +10820,33 @@  discard block
 block discarded – undo
10820 10820
 						if ($showproject == 'all') {
10821 10821
 							$labeltoshow .= dol_trunc($obj->ref, 18); // Invoice ref
10822 10822
 							if ($obj->name) {
10823
-								$labeltoshow .= ' - ' . $obj->name; // Soc name
10823
+								$labeltoshow .= ' - '.$obj->name; // Soc name
10824 10824
 							}
10825 10825
 
10826 10826
 							$disabled = 0;
10827 10827
 							if ($obj->fk_statut == Project::STATUS_DRAFT) {
10828 10828
 								$disabled = 1;
10829
-								$labeltoshow .= ' - ' . $langs->trans("Draft");
10829
+								$labeltoshow .= ' - '.$langs->trans("Draft");
10830 10830
 							} elseif ($obj->fk_statut == Project::STATUS_CLOSED) {
10831 10831
 								if ($discard_closed == 2) {
10832 10832
 									$disabled = 1;
10833 10833
 								}
10834
-								$labeltoshow .= ' - ' . $langs->trans("Closed");
10834
+								$labeltoshow .= ' - '.$langs->trans("Closed");
10835 10835
 							} elseif ($socid > 0 && (!empty($obj->fk_soc) && $obj->fk_soc != $socid)) {
10836 10836
 								$disabled = 1;
10837
-								$labeltoshow .= ' - ' . $langs->trans("LinkedToAnotherCompany");
10837
+								$labeltoshow .= ' - '.$langs->trans("LinkedToAnotherCompany");
10838 10838
 							}
10839 10839
 						}
10840 10840
 
10841 10841
 						if (!empty($selected) && $selected == $obj->rowid) {
10842
-							$out .= '<option value="' . $obj->rowid . '" selected';
10842
+							$out .= '<option value="'.$obj->rowid.'" selected';
10843 10843
 							//if ($disabled) $out.=' disabled';						// with select2, field can't be preselected if disabled
10844
-							$out .= '>' . $labeltoshow . '</option>';
10844
+							$out .= '>'.$labeltoshow.'</option>';
10845 10845
 						} else {
10846 10846
 							if ($hideunselectables && $disabled && ($selected != $obj->rowid)) {
10847 10847
 								$resultat = '';
10848 10848
 							} else {
10849
-								$resultat = '<option value="' . $obj->rowid . '"';
10849
+								$resultat = '<option value="'.$obj->rowid.'"';
10850 10850
 								if ($disabled) {
10851 10851
 									$resultat .= ' disabled';
10852 10852
 								}
@@ -10898,22 +10898,22 @@  discard block
 block discarded – undo
10898 10898
 
10899 10899
 		$sql = 'SELECT f.rowid, f.entity, f.titre as title, f.suspended, f.fk_soc';
10900 10900
 		//$sql.= ', el.fk_source';
10901
-		$sql .= ' FROM ' . MAIN_DB_PREFIX . 'facture_rec as f';
10902
-		$sql .= " WHERE f.entity IN (" . getEntity('invoice') . ")";
10901
+		$sql .= ' FROM '.MAIN_DB_PREFIX.'facture_rec as f';
10902
+		$sql .= " WHERE f.entity IN (".getEntity('invoice').")";
10903 10903
 		$sql .= " ORDER BY f.titre ASC";
10904 10904
 
10905 10905
 		$resql = $this->db->query($sql);
10906 10906
 		if ($resql) {
10907 10907
 			// Use select2 selector
10908 10908
 			if (!empty($conf->use_javascript_ajax)) {
10909
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
10909
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
10910 10910
 				$comboenhancement = ajax_combobox($htmlname, array(), 0, $forcefocus);
10911 10911
 				$out .= $comboenhancement;
10912 10912
 				$morecss = 'minwidth200imp maxwidth500';
10913 10913
 			}
10914 10914
 
10915 10915
 			if (empty($option_only)) {
10916
-				$out .= '<select class="valignmiddle flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ' id="' . $htmlname . '" name="' . $htmlname . '">';
10916
+				$out .= '<select class="valignmiddle flat'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').' id="'.$htmlname.'" name="'.$htmlname.'">';
10917 10917
 			}
10918 10918
 			if (!empty($show_empty)) {
10919 10919
 				$out .= '<option value="0" class="optiongrey">';
@@ -10932,19 +10932,19 @@  discard block
 block discarded – undo
10932 10932
 					$disabled = 0;
10933 10933
 					if (!empty($obj->suspended)) {
10934 10934
 						$disabled = 1;
10935
-						$labeltoshow .= ' - ' . $langs->trans("Closed");
10935
+						$labeltoshow .= ' - '.$langs->trans("Closed");
10936 10936
 					}
10937 10937
 
10938 10938
 
10939 10939
 					if (!empty($selected) && $selected == $obj->rowid) {
10940
-						$out .= '<option value="' . $obj->rowid . '" selected';
10940
+						$out .= '<option value="'.$obj->rowid.'" selected';
10941 10941
 						//if ($disabled) $out.=' disabled';						// with select2, field can't be preselected if disabled
10942
-						$out .= '>' . $labeltoshow . '</option>';
10942
+						$out .= '>'.$labeltoshow.'</option>';
10943 10943
 					} else {
10944 10944
 						if ($disabled && ($selected != $obj->rowid)) {
10945 10945
 							$resultat = '';
10946 10946
 						} else {
10947
-							$resultat = '<option value="' . $obj->rowid . '"';
10947
+							$resultat = '<option value="'.$obj->rowid.'"';
10948 10948
 							if ($disabled) {
10949 10949
 								$resultat .= ' disabled';
10950 10950
 							}
@@ -10984,14 +10984,14 @@  discard block
 block discarded – undo
10984 10984
 		global $langs;
10985 10985
 
10986 10986
 		if ($search_component_params_hidden != '' && !preg_match('/^\(.*\)$/', $search_component_params_hidden)) {    // If $search_component_params_hidden does not start and end with ()
10987
-			$search_component_params_hidden = '(' . $search_component_params_hidden . ')';
10987
+			$search_component_params_hidden = '('.$search_component_params_hidden.')';
10988 10988
 		}
10989 10989
 
10990 10990
 		$ret = '';
10991 10991
 
10992 10992
 		$ret .= '<div class="divadvancedsearchfieldcomp centpercent inline-block">';
10993 10993
 		$ret .= '<a href="#" class="dropdownsearch-toggle unsetcolor">';
10994
-		$ret .= '<span class="fas fa-filter linkobject boxfilter paddingright pictofixedwidth" title="' . dol_escape_htmltag($langs->trans("Filters")) . '" id="idsubimgproductdistribution"></span>';
10994
+		$ret .= '<span class="fas fa-filter linkobject boxfilter paddingright pictofixedwidth" title="'.dol_escape_htmltag($langs->trans("Filters")).'" id="idsubimgproductdistribution"></span>';
10995 10995
 		$ret .= '</a>';
10996 10996
 
10997 10997
 		$ret .= '<div class="divadvancedsearchfieldcompinput inline-block minwidth500 maxwidth300onsmartphone">';
@@ -11035,29 +11035,29 @@  discard block
 block discarded – undo
11035 11035
 			$ret .= '<input type="hidden" name="show_search_component_params_hidden" value="1">';
11036 11036
 		}
11037 11037
 		$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%')) -->";
11038
-		$ret .= '<input type="hidden" id="search_component_params_hidden" name="search_component_params_hidden" value="' . dol_escape_htmltag($search_component_params_hidden) . '">';
11038
+		$ret .= '<input type="hidden" id="search_component_params_hidden" name="search_component_params_hidden" value="'.dol_escape_htmltag($search_component_params_hidden).'">';
11039 11039
 		// $ret .= "<!-- sql= ".forgeSQLFromUniversalSearchCriteria($search_component_params_hidden, $errormessage)." -->";
11040 11040
 
11041 11041
 		// For compatibility with forms that show themself the search criteria in addition of this component, we output these fields
11042 11042
 		foreach ($arrayofcriterias as $criteria) {
11043 11043
 			foreach ($criteria as $criteriafamilykey => $criteriafamilyval) {
11044
-				if (in_array('search_' . $criteriafamilykey, $arrayofinputfieldsalreadyoutput)) {
11044
+				if (in_array('search_'.$criteriafamilykey, $arrayofinputfieldsalreadyoutput)) {
11045 11045
 					continue;
11046 11046
 				}
11047 11047
 				if (in_array($criteriafamilykey, array('rowid', 'ref_ext', 'entity', 'extraparams'))) {
11048 11048
 					continue;
11049 11049
 				}
11050 11050
 				if (in_array($criteriafamilyval['type'], array('date', 'datetime', 'timestamp'))) {
11051
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_start">';
11052
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_startyear">';
11053
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_startmonth">';
11054
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_startday">';
11055
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_end">';
11056
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_endyear">';
11057
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_endmonth">';
11058
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_endday">';
11051
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_start">';
11052
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_startyear">';
11053
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_startmonth">';
11054
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_startday">';
11055
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_end">';
11056
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_endyear">';
11057
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_endmonth">';
11058
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_endday">';
11059 11059
 				} else {
11060
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '">';
11060
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'">';
11061 11061
 				}
11062 11062
 			}
11063 11063
 		}
@@ -11065,7 +11065,7 @@  discard block
 block discarded – undo
11065 11065
 		$ret .= '</div>';
11066 11066
 
11067 11067
 		$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";
11068
-		$ret .= '<input type="text" placeholder="' . $langs->trans("Filters") . '" id="search_component_params_input" name="search_component_params_input" class="noborderbottom search_component_input" value="">';
11068
+		$ret .= '<input type="text" placeholder="'.$langs->trans("Filters").'" id="search_component_params_input" name="search_component_params_input" class="noborderbottom search_component_input" value="">';
11069 11069
 
11070 11070
 		$ret .= '</div>';
11071 11071
 		$ret .= '</div>';
@@ -11139,7 +11139,7 @@  discard block
 block discarded – undo
11139 11139
 
11140 11140
 		$TModels = array();
11141 11141
 
11142
-		include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php';
11142
+		include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
11143 11143
 		$formmail = new FormMail($this->db);
11144 11144
 		$result = $formmail->fetchAllEMailTemplate($modelType, $user, $langs);
11145 11145
 
@@ -11152,17 +11152,17 @@  discard block
 block discarded – undo
11152 11152
 			}
11153 11153
 		}
11154 11154
 
11155
-		$retstring .= '<select class="flat" id="select_' . $prefix . 'model_mail" name="' . $prefix . 'model_mail">';
11155
+		$retstring .= '<select class="flat" id="select_'.$prefix.'model_mail" name="'.$prefix.'model_mail">';
11156 11156
 
11157 11157
 		foreach ($TModels as $id_model => $label_model) {
11158
-			$retstring .= '<option value="' . $id_model . '"';
11159
-			$retstring .= ">" . $label_model . "</option>";
11158
+			$retstring .= '<option value="'.$id_model.'"';
11159
+			$retstring .= ">".$label_model."</option>";
11160 11160
 		}
11161 11161
 
11162 11162
 		$retstring .= "</select>";
11163 11163
 
11164 11164
 		if ($addjscombo) {
11165
-			$retstring .= ajax_combobox('select_' . $prefix . 'model_mail');
11165
+			$retstring .= ajax_combobox('select_'.$prefix.'model_mail');
11166 11166
 		}
11167 11167
 
11168 11168
 		return $retstring;
@@ -11213,16 +11213,16 @@  discard block
 block discarded – undo
11213 11213
 
11214 11214
 		foreach ($buttons as $button) {
11215 11215
 			$addclass = empty($button['addclass']) ? '' : $button['addclass'];
11216
-			$retstring .= '<input type="submit" class="button button-' . $button['name'] . ($morecss ? ' ' . $morecss : '') . ' ' . $addclass . '" name="' . $button['name'] . '" value="' . dol_escape_htmltag($langs->trans($button['label_key'])) . '">';
11216
+			$retstring .= '<input type="submit" class="button button-'.$button['name'].($morecss ? ' '.$morecss : '').' '.$addclass.'" name="'.$button['name'].'" value="'.dol_escape_htmltag($langs->trans($button['label_key'])).'">';
11217 11217
 		}
11218 11218
 		$retstring .= $withoutdiv ? '' : '</div>';
11219 11219
 
11220 11220
 		if ($dol_openinpopup) {
11221
-			$retstring .= '<!-- buttons are shown into a $dol_openinpopup=' . dol_escape_htmltag($dol_openinpopup) . ' context, so we enable the close of dialog on cancel -->' . "\n";
11222
-			$retstring .= '<script nonce="' . getNonce() . '">';
11221
+			$retstring .= '<!-- buttons are shown into a $dol_openinpopup='.dol_escape_htmltag($dol_openinpopup).' context, so we enable the close of dialog on cancel -->'."\n";
11222
+			$retstring .= '<script nonce="'.getNonce().'">';
11223 11223
 			$retstring .= 'jQuery(".button-cancel").click(function(e) {
11224
-				e.preventDefault(); console.log(\'We click on cancel in iframe popup ' . dol_escape_js($dol_openinpopup) . '\');
11225
-				window.parent.jQuery(\'#idfordialog' . dol_escape_js($dol_openinpopup) . '\').dialog(\'close\');
11224
+				e.preventDefault(); console.log(\'We click on cancel in iframe popup ' . dol_escape_js($dol_openinpopup).'\');
11225
+				window.parent.jQuery(\'#idfordialog' . dol_escape_js($dol_openinpopup).'\').dialog(\'close\');
11226 11226
 				 });';
11227 11227
 			$retstring .= '</script>';
11228 11228
 		}
@@ -11251,7 +11251,7 @@  discard block
 block discarded – undo
11251 11251
 		dol_syslog(__METHOD__, LOG_DEBUG);
11252 11252
 
11253 11253
 		$sql = "SELECT rowid, code, label as label";
11254
-		$sql .= " FROM " . MAIN_DB_PREFIX . 'c_invoice_subtype';
11254
+		$sql .= " FROM ".MAIN_DB_PREFIX.'c_invoice_subtype';
11255 11255
 		$sql .= " WHERE active = 1";
11256 11256
 
11257 11257
 		$resql = $this->db->query($sql);
@@ -11262,7 +11262,7 @@  discard block
 block discarded – undo
11262 11262
 				$obj = $this->db->fetch_object($resql);
11263 11263
 
11264 11264
 				// If translation exists, we use it, otherwise we take the default wording
11265
-				$label = ($langs->trans("InvoiceSubtype" . $obj->rowid) != "InvoiceSubtype" . $obj->rowid) ? $langs->trans("InvoiceSubtype" . $obj->rowid) : (($obj->label != '-') ? $obj->label : '');
11265
+				$label = ($langs->trans("InvoiceSubtype".$obj->rowid) != "InvoiceSubtype".$obj->rowid) ? $langs->trans("InvoiceSubtype".$obj->rowid) : (($obj->label != '-') ? $obj->label : '');
11266 11266
 				$this->cache_invoice_subtype[$obj->rowid]['rowid'] = $obj->rowid;
11267 11267
 				$this->cache_invoice_subtype[$obj->rowid]['code'] = $obj->code;
11268 11268
 				$this->cache_invoice_subtype[$obj->rowid]['label'] = $label;
@@ -11294,18 +11294,18 @@  discard block
 block discarded – undo
11294 11294
 		global $langs, $user;
11295 11295
 
11296 11296
 		$out = '';
11297
-		dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG);
11297
+		dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG);
11298 11298
 
11299 11299
 		$this->load_cache_invoice_subtype();
11300 11300
 
11301
-		$out .= '<select id="' . $htmlname . '" class="flat selectsubtype' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">';
11301
+		$out .= '<select id="'.$htmlname.'" class="flat selectsubtype'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
11302 11302
 		if ($addempty) {
11303 11303
 			$out .= '<option value="0">&nbsp;</option>';
11304 11304
 		}
11305 11305
 
11306 11306
 		foreach ($this->cache_invoice_subtype as $rowid => $subtype) {
11307 11307
 			$label = $subtype['label'];
11308
-			$out .= '<option value="' . $subtype['rowid'] . '"';
11308
+			$out .= '<option value="'.$subtype['rowid'].'"';
11309 11309
 			if ($selected == $subtype['rowid']) {
11310 11310
 				$out .= ' selected="selected"';
11311 11311
 			}
Please login to merge, or discard this patch.
htdocs/mrp/tpl/linkedobjectblock.tpl.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -55,25 +55,25 @@  discard block
 block discarded – undo
55 55
 
56 56
 			$trclass = 'oddeven';
57 57
 
58
-			echo '<tr class="' . $trclass . '" >';
59
-			echo '<td class="linkedcol-element tdoverflowmax100">' . $langs->trans("ManufacturingOrder");
58
+			echo '<tr class="'.$trclass.'" >';
59
+			echo '<td class="linkedcol-element tdoverflowmax100">'.$langs->trans("ManufacturingOrder");
60 60
 			if (!empty($showImportButton) && $conf->global->MAIN_ENABLE_IMPORT_LINKED_OBJECT_LINES) {
61
-				print '<a class="objectlinked_importbtn" href="' . $objectlink->getNomUrl(0, '', 0, 1) . '&amp;action=selectlines&amp;token='.newToken().'" data-element="' . $objectlink->element . '" data-id="' . $objectlink->id . '"  > <i class="fa fa-indent"></i> </a';
61
+				print '<a class="objectlinked_importbtn" href="'.$objectlink->getNomUrl(0, '', 0, 1).'&amp;action=selectlines&amp;token='.newToken().'" data-element="'.$objectlink->element.'" data-id="'.$objectlink->id.'"  > <i class="fa fa-indent"></i> </a';
62 62
 			}
63 63
 			echo '</td>';
64
-			echo '<td class="linkedcol-name nowraponall" >' . $objectlink->getNomUrl(1) . '</td>';
64
+			echo '<td class="linkedcol-name nowraponall" >'.$objectlink->getNomUrl(1).'</td>';
65 65
 
66 66
 			echo '<td class="linkedcol-ref center">';
67 67
 			//  $result = $product_static->fetch($objectlink->fk_product);
68 68
 			print '</td>';
69
-			echo '<td class="linkedcol-date center">' . dol_print_date($objectlink->date_creation, 'day') . '</td>';
69
+			echo '<td class="linkedcol-date center">'.dol_print_date($objectlink->date_creation, 'day').'</td>';
70 70
 			echo '<td class="linkedcol-amount right">-</td>';
71
-			echo '<td class="linkedcol-statut right">' . $objectlink->getLibStatut(3) . '</td>';
71
+			echo '<td class="linkedcol-statut right">'.$objectlink->getLibStatut(3).'</td>';
72 72
 			echo '<td class="linkedcol-action right">';
73 73
 
74 74
 			// we want to make the link via element_element for delete action
75
-			$sql = " Select rowid from " . MAIN_DB_PREFIX . "element_element";
76
-			$sql .= " WHERE  fk_source = " . (int) $object->id . " and fk_target = '" . dol_escape_htmltag($key) . "'";
75
+			$sql = " Select rowid from ".MAIN_DB_PREFIX."element_element";
76
+			$sql .= " WHERE  fk_source = ".(int) $object->id." and fk_target = '".dol_escape_htmltag($key)."'";
77 77
 
78 78
 			$resql = $db->query($sql);
79 79
 			$k = 0;
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 					$k = $obj->rowid;
84 84
 				}
85 85
 			}
86
-			echo '<a class="reposition" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=dellink&token=' . newToken() . '&dellinkid=' . $k . '">' . img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink') . '</a>';
86
+			echo '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=dellink&token='.newToken().'&dellinkid='.$k.'">'.img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink').'</a>';
87 87
 			echo '</td>';
88 88
 			echo "</tr>\n";
89 89
 		}
Please login to merge, or discard this patch.