Completed
Branch develop (4bc589)
by
unknown
20:09
created
htdocs/core/modules/expedition/doc/pdf_espadon.modules.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
 		$this->watermark = '';
115 115
 
116 116
 		if ($mysoc === null) {
117
-			dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'. getCallerInfoString(), LOG_ERR);
117
+			dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'.getCallerInfoString(), LOG_ERR);
118 118
 			return;
119 119
 		}
120 120
 
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
 				$pdf->SetFont(pdf_getPDFFont($outputlangs));
273 273
 				// Set path to the background PDF File
274 274
 				if (!getDolGlobalString('MAIN_DISABLE_FPDI') && getDolGlobalString('MAIN_ADD_PDF_BACKGROUND')) {
275
-					$pagecount = $pdf->setSourceFile($conf->mycompany->dir_output.'/' . getDolGlobalString('MAIN_ADD_PDF_BACKGROUND'));
275
+					$pagecount = $pdf->setSourceFile($conf->mycompany->dir_output.'/'.getDolGlobalString('MAIN_ADD_PDF_BACKGROUND'));
276 276
 					$tplidx = $pdf->importPage(1);
277 277
 				}
278 278
 
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
 				$pdf->SetDrawColor(128, 128, 128);
282 282
 
283 283
 				if (method_exists($pdf, 'AliasNbPages')) {
284
-					$pdf->AliasNbPages();  // @phan-suppress-current-line PhanUndeclaredMethod
284
+					$pdf->AliasNbPages(); // @phan-suppress-current-line PhanUndeclaredMethod
285 285
 				}
286 286
 
287 287
 				$pdf->SetTitle($outputlangs->convToOutputCharset($object->ref));
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
 				$pdf->MultiCell(0, 3, ''); // Set interline to 3
308 308
 				$pdf->SetTextColor(0, 0, 0);
309 309
 
310
-				$tab_top = 90;	// position of top tab
310
+				$tab_top = 90; // position of top tab
311 311
 				$tab_top_newpage = (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD') ? 42 + $top_shift : 10);
312 312
 
313 313
 				$tab_height = $this->page_hauteur - $tab_top - $heightforfooter - $heightforfreetext;
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
 						$height_trackingnumber = 4;
354 354
 
355 355
 						$pdf->SetFont('', 'B', $default_font_size - 2);
356
-						$pdf->writeHTMLCell(60, $height_trackingnumber, $this->posxdesc - 1, $tab_top - 1, $outputlangs->transnoentities("TrackingNumber") . " : " . $object->tracking_number, 0, 1, false, true, 'L');
356
+						$pdf->writeHTMLCell(60, $height_trackingnumber, $this->posxdesc - 1, $tab_top - 1, $outputlangs->transnoentities("TrackingNumber")." : ".$object->tracking_number, 0, 1, false, true, 'L');
357 357
 						$tab_top_alt = $pdf->GetY();
358 358
 
359 359
 						$object->getUrlTrackingStatus($object->tracking_number);
@@ -538,7 +538,7 @@  discard block
 block discarded – undo
538 538
 						if (!preg_match('/^\w+$/', $newcode) || dol_strlen($newcode) > 32) {
539 539
 							$newcode = dol_hash($newcode, 'md5');
540 540
 						}
541
-						$barcode_path = $conf->barcode->dir_temp . '/barcode_' . $newcode . '_' . $encoding . '.png';
541
+						$barcode_path = $conf->barcode->dir_temp.'/barcode_'.$newcode.'_'.$encoding.'.png';
542 542
 					}
543 543
 
544 544
 					if ($result > 0) {
@@ -791,7 +791,7 @@  discard block
 block discarded – undo
791 791
 				// Pagefoot
792 792
 				$this->_pagefoot($pdf, $object, $outputlangs);
793 793
 				if (method_exists($pdf, 'AliasNbPages')) {
794
-					$pdf->AliasNbPages();  // @phan-suppress-current-line PhanUndeclaredMethod
794
+					$pdf->AliasNbPages(); // @phan-suppress-current-line PhanUndeclaredMethod
795 795
 				}
796 796
 
797 797
 				$pdf->Close();
@@ -892,7 +892,7 @@  discard block
 block discarded – undo
892 892
 			if ($object->volume_units < 50) {
893 893
 				$totalVolumetoshow = showDimensionInBestUnit($object->trueVolume, $object->volume_units, "volume", $outputlangs);
894 894
 			} else {
895
-				$totalVolumetoshow =  price($object->trueVolume, 0, $outputlangs, 0, 0).' '.measuringUnitString(0, "volume", $object->volume_units);
895
+				$totalVolumetoshow = price($object->trueVolume, 0, $outputlangs, 0, 0).' '.measuringUnitString(0, "volume", $object->volume_units);
896 896
 			}
897 897
 		}
898 898
 
Please login to merge, or discard this patch.
htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
 		$this->watermark = '';
130 130
 
131 131
 		if ($mysoc === null) {
132
-			dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'. getCallerInfoString(), LOG_ERR);
132
+			dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'.getCallerInfoString(), LOG_ERR);
133 133
 			return;
134 134
 		}
135 135
 
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
 			}
278 278
 
279 279
 			if ($dir === null) {
280
-				dol_syslog(get_class($this).'::'.__METHOD__."Target directory should not be null.". getCallerInfoString(), LOG_ERR);
280
+				dol_syslog(get_class($this).'::'.__METHOD__."Target directory should not be null.".getCallerInfoString(), LOG_ERR);
281 281
 				$this->error = $langs->transnoentities("ErrorCanNotCreateDir", "Null dir");
282 282
 				return 0;
283 283
 			}
@@ -860,7 +860,7 @@  discard block
 block discarded – undo
860 860
 
861 861
 				// Add number of pages in footer
862 862
 				if (method_exists($pdf, 'AliasNbPages')) {
863
-					$pdf->AliasNbPages();  // @phan-suppress-current-line PhanUndeclaredMethod
863
+					$pdf->AliasNbPages(); // @phan-suppress-current-line PhanUndeclaredMethod
864 864
 				}
865 865
 
866 866
 				// Add terms to sale
@@ -1750,7 +1750,7 @@  discard block
 block discarded – undo
1750 1750
 				$carac_client_name = '';
1751 1751
 			}
1752 1752
 
1753
-			$mode =  'target';
1753
+			$mode = 'target';
1754 1754
 			$carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), ($usecontact ? 1 : 0), $mode, $object);
1755 1755
 
1756 1756
 			// Show recipient
@@ -1805,7 +1805,7 @@  discard block
 block discarded – undo
1805 1805
 				if (!empty($carac_client_shipping)) {
1806 1806
 					$posy += $hautcadre;
1807 1807
 
1808
-					$hautcadre -= 10;	// Height for the shipping address does not need to be as high as main box
1808
+					$hautcadre -= 10; // Height for the shipping address does not need to be as high as main box
1809 1809
 
1810 1810
 					// Show shipping frame
1811 1811
 					$pdf->SetXY($posx + 2, $posy - 5);
Please login to merge, or discard this patch.
htdocs/recruitment/lib/recruitment.lib.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -41,35 +41,35 @@
 block discarded – undo
41 41
 	$h = 0;
42 42
 	$head = array();
43 43
 
44
-	$head[$h][0] = DOL_URL_ROOT . '/recruitment/admin/setup.php';
44
+	$head[$h][0] = DOL_URL_ROOT.'/recruitment/admin/setup.php';
45 45
 	$head[$h][1] = $langs->trans("JobPositions");
46 46
 	$head[$h][2] = 'settings';
47 47
 	$h++;
48 48
 
49
-	$head[$h][0] = DOL_URL_ROOT . '/recruitment/admin/setup_candidatures.php';
49
+	$head[$h][0] = DOL_URL_ROOT.'/recruitment/admin/setup_candidatures.php';
50 50
 	$head[$h][1] = $langs->trans("RecruitmentCandidatures");
51 51
 	$head[$h][2] = 'settings_candidatures';
52 52
 	$h++;
53 53
 
54
-	$head[$h][0] = DOL_URL_ROOT . '/recruitment/admin/jobposition_extrafields.php';
54
+	$head[$h][0] = DOL_URL_ROOT.'/recruitment/admin/jobposition_extrafields.php';
55 55
 	$head[$h][1] = $langs->trans("ExtrafieldsJobPosition");
56 56
 	$nbExtrafields = $extrafields->attributes['recruitment_recruitmentjobposition']['count'];
57 57
 	if ($nbExtrafields > 0) {
58
-		$head[$h][1] .= '<span class="badge marginleftonlyshort">' . $nbExtrafields . '</span>';
58
+		$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
59 59
 	}
60 60
 	$head[$h][2] = 'jobposition_extrafields';
61 61
 	$h++;
62 62
 
63
-	$head[$h][0] = DOL_URL_ROOT . '/recruitment/admin/candidature_extrafields.php';
63
+	$head[$h][0] = DOL_URL_ROOT.'/recruitment/admin/candidature_extrafields.php';
64 64
 	$head[$h][1] = $langs->trans("ExtrafieldsApplication");
65 65
 	$nbExtrafields = $extrafields->attributes['recruitment_recruitmentcandidature']['count'];
66 66
 	if ($nbExtrafields > 0) {
67
-		$head[$h][1] .= '<span class="badge marginleftonlyshort">' . $nbExtrafields . '</span>';
67
+		$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
68 68
 	}
69 69
 	$head[$h][2] = 'candidature_extrafields';
70 70
 	$h++;
71 71
 
72
-	$head[$h][0] = DOL_URL_ROOT . '/recruitment/admin/public_interface.php';
72
+	$head[$h][0] = DOL_URL_ROOT.'/recruitment/admin/public_interface.php';
73 73
 	$head[$h][1] = $langs->trans("PublicUrl");
74 74
 	$head[$h][2] = 'publicurl';
75 75
 	$h++;
Please login to merge, or discard this patch.
htdocs/user/class/api_users.class.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -511,7 +511,7 @@  discard block
 block discarded – undo
511 511
 			throw new RestException(403, 'Access on this object not allowed for login '.DolibarrApiAccess::$user->login);
512 512
 		}
513 513
 
514
-		$newpassword = $this->useraccount->setPassword($this->useraccount, '');	// This will generate a new password
514
+		$newpassword = $this->useraccount->setPassword($this->useraccount, ''); // This will generate a new password
515 515
 		if (is_int($newpassword) && $newpassword < 0) {
516 516
 			throw new RestException(500, 'ErrorFailedToSetNewPassword'.$this->useraccount->error);
517 517
 		} else {
@@ -635,14 +635,14 @@  discard block
 block discarded – undo
635 635
 			throw new RestException(403, 'Only admin can remove users from groups');
636 636
 		}
637 637
 
638
-		$sql = "DELETE FROM " . MAIN_DB_PREFIX . "usergroup_user";
639
-		$sql .= " WHERE fk_user = " . ((int) $id);
640
-		$sql .= " AND fk_usergroup = " . ((int) $group);
638
+		$sql = "DELETE FROM ".MAIN_DB_PREFIX."usergroup_user";
639
+		$sql .= " WHERE fk_user = ".((int) $id);
640
+		$sql .= " AND fk_usergroup = ".((int) $group);
641 641
 
642 642
 		$resql = $this->db->query($sql);
643 643
 
644 644
 		if (!$resql) {
645
-			throw new RestException(503, 'DB error: ' . $this->db->lasterror());
645
+			throw new RestException(503, 'DB error: '.$this->db->lasterror());
646 646
 		}
647 647
 
648 648
 		return [
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -647,7 +647,7 @@
 block discarded – undo
647 647
 
648 648
 		return [
649 649
 			'success' => true,
650
-			'message' => "User $id removed from group $group"
650
+			'message' => "user $id removed from group $group"
651 651
 		];
652 652
 	}
653 653
 
Please login to merge, or discard this patch.
htdocs/expedition/card.php 1 patch
Spacing   +348 added lines, -348 removed lines patch added patch discarded remove patch
@@ -39,29 +39,29 @@  discard block
 block discarded – undo
39 39
 
40 40
 // Load Dolibarr environment
41 41
 require '../main.inc.php';
42
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php';
43
-require_once DOL_DOCUMENT_ROOT . '/expedition/class/expedition.class.php';
44
-require_once DOL_DOCUMENT_ROOT . '/product/class/html.formproduct.class.php';
45
-require_once DOL_DOCUMENT_ROOT . '/core/lib/product.lib.php';
46
-require_once DOL_DOCUMENT_ROOT . '/core/lib/sendings.lib.php';
47
-require_once DOL_DOCUMENT_ROOT . '/core/modules/expedition/modules_expedition.php';
48
-require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';
49
-require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php';
50
-require_once DOL_DOCUMENT_ROOT . '/product/stock/class/entrepot.class.php';
51
-require_once DOL_DOCUMENT_ROOT . '/product/stock/class/productlot.class.php';
52
-require_once DOL_DOCUMENT_ROOT . '/commande/class/commande.class.php';
42
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
43
+require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php';
44
+require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
45
+require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php';
46
+require_once DOL_DOCUMENT_ROOT.'/core/lib/sendings.lib.php';
47
+require_once DOL_DOCUMENT_ROOT.'/core/modules/expedition/modules_expedition.php';
48
+require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
49
+require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
50
+require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php';
51
+require_once DOL_DOCUMENT_ROOT.'/product/stock/class/productlot.class.php';
52
+require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
53 53
 if (isModEnabled("product") || isModEnabled("service")) {
54
-	require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
54
+	require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
55 55
 }
56 56
 if (isModEnabled("propal")) {
57
-	require_once DOL_DOCUMENT_ROOT . '/comm/propal/class/propal.class.php';
57
+	require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
58 58
 }
59 59
 if (isModEnabled('productbatch')) {
60
-	require_once DOL_DOCUMENT_ROOT . '/product/class/productbatch.class.php';
60
+	require_once DOL_DOCUMENT_ROOT.'/product/class/productbatch.class.php';
61 61
 }
62 62
 if (isModEnabled('project')) {
63
-	require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
64
-	require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php';
63
+	require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
64
+	require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
65 65
 }
66 66
 
67 67
 /**
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
 $extrafields->fetch_name_optionals_label($objectorder->table_element_line);
115 115
 
116 116
 // Load object. Make an object->fetch
117
-include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'
117
+include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'
118 118
 
119 119
 // Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
120 120
 $hookmanager->initHooks(array('expeditioncard', 'globalcard'));
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
 	$permissiontoeditextra = dol_eval($extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')]);
145 145
 }
146 146
 
147
-$upload_dir = $conf->expedition->dir_output . '/sending';
147
+$upload_dir = $conf->expedition->dir_output.'/sending';
148 148
 
149 149
 $editColspan = 0;
150 150
 $objectsrc = null;
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
 	if ($cancel) {
167 167
 		if ($origin && $origin_id > 0) {
168 168
 			if ($origin == 'commande') {
169
-				header("Location: " . DOL_URL_ROOT . '/expedition/shipment.php?id=' . ((int) $origin_id));
169
+				header("Location: ".DOL_URL_ROOT.'/expedition/shipment.php?id='.((int) $origin_id));
170 170
 				exit;
171 171
 			}
172 172
 		} else {
@@ -175,10 +175,10 @@  discard block
 block discarded – undo
175 175
 		}
176 176
 	}
177 177
 
178
-	include DOL_DOCUMENT_ROOT . '/core/actions_dellink.inc.php'; // Must be 'include', not 'include_once'
178
+	include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be 'include', not 'include_once'
179 179
 
180 180
 	// Actions to build doc
181
-	include DOL_DOCUMENT_ROOT . '/core/actions_builddoc.inc.php';
181
+	include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
182 182
 
183 183
 	// Back to draft
184 184
 	if ($action == 'setdraft' && $permissiontoadd) {
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
 		if ($result < 0) {
188 188
 			setEventMessages($object->error, $object->errors, 'errors');
189 189
 		} else {
190
-			header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $object->id);
190
+			header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
191 191
 			exit;
192 192
 		}
193 193
 	}
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
 		if ($result < 0) {
199 199
 			setEventMessages($object->error, $object->errors, 'errors');
200 200
 		} else {
201
-			header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $object->id);
201
+			header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
202 202
 			exit;
203 203
 		}
204 204
 	}
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
 			setEventMessages($object->error, $object->errors, 'errors');
220 220
 			$action = 'editref_customer';
221 221
 		} else {
222
-			header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $object->id);
222
+			header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
223 223
 			exit;
224 224
 		}
225 225
 	}
@@ -296,16 +296,16 @@  discard block
 block discarded – undo
296 296
 		$product_batch_used = array();
297 297
 
298 298
 		for ($i = 0; $i < $num; $i++) {
299
-			$idl = "idl" . $i;
299
+			$idl = "idl".$i;
300 300
 
301 301
 			$sub_qty = array();
302 302
 			$subtotalqty = 0;
303 303
 
304 304
 			$j = 0;
305 305
 
306
-			$batch = "batchl" . $i . "_0";
307
-			$stockLocation = "ent1" . $i . "_0";
308
-			$qty = "qtyl" . $i;
306
+			$batch = "batchl".$i."_0";
307
+			$stockLocation = "ent1".$i."_0";
308
+			$qty = "qtyl".$i;
309 309
 
310 310
 			$is_batch_or_serial = 0;
311 311
 			if (!empty($objectsrc->lines[$i]->fk_product)) {
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
 			if (isModEnabled('productbatch') && $objectsrc->lines[$i]->product_tobatch) {
321 321
 				if (GETPOSTISSET($batch)) {
322 322
 					//shipment line with batch-enable product
323
-					$qty .= '_' . $j;
323
+					$qty .= '_'.$j;
324 324
 					while (GETPOSTISSET($batch)) {
325 325
 						// save line of detail into sub_qty
326 326
 						$sub_qty[$j]['q'] = price2num(GETPOST($qty, 'alpha'), 'MS'); // the qty we want to move for this stock record
@@ -339,8 +339,8 @@  discard block
 block discarded – undo
339 339
 						}
340 340
 
341 341
 						$j++;
342
-						$batch = "batchl" . $i . "_" . $j;
343
-						$qty = "qtyl" . $i . '_' . $j;
342
+						$batch = "batchl".$i."_".$j;
343
+						$qty = "qtyl".$i.'_'.$j;
344 344
 					}
345 345
 
346 346
 					$batch_line[$i]['detail'] = $sub_qty; // array of details
@@ -354,13 +354,13 @@  discard block
 block discarded – undo
354 354
 						// We try to set an amount
355 355
 						// Case we don't use the list of available qty for each warehouse/lot
356 356
 						// GUI does not allow this yet
357
-						setEventMessages($langs->trans("StockIsRequiredToChooseWhichLotToUse") . ' (' . $langs->trans("Line") . ' ' . GETPOSTINT($idl) . ')', null, 'errors');
357
+						setEventMessages($langs->trans("StockIsRequiredToChooseWhichLotToUse").' ('.$langs->trans("Line").' '.GETPOSTINT($idl).')', null, 'errors');
358 358
 						$error++;
359 359
 					}
360 360
 				}
361 361
 			} elseif (GETPOSTISSET($stockLocation)) {
362 362
 				//shipment line from multiple stock locations
363
-				$qty .= '_' . $j;
363
+				$qty .= '_'.$j;
364 364
 				while (GETPOSTISSET($stockLocation)) {
365 365
 					// save sub line of warehouse
366 366
 					$stockLine[$i][$j]['qty'] = price2num(GETPOST($qty, 'alpha'), 'MS');
@@ -371,8 +371,8 @@  discard block
 block discarded – undo
371 371
 					$subtotalqty += price2num(GETPOST($qty, 'alpha'), 'MS');
372 372
 
373 373
 					$j++;
374
-					$stockLocation = "ent1" . $i . "_" . $j;
375
-					$qty = "qtyl" . $i . '_' . $j;
374
+					$stockLocation = "ent1".$i."_".$j;
375
+					$qty = "qtyl".$i.'_'.$j;
376 376
 				}
377 377
 			} else {
378 378
 				//shipment line for product with no batch management and no multiple stock location
@@ -395,7 +395,7 @@  discard block
 block discarded – undo
395 395
 			if (isset($extrafields->attributes[$object->table_element_line]['label']) && is_array($extrafields->attributes[$object->table_element_line]['label'])) {
396 396
 				// Get extra fields
397 397
 				foreach ($extrafields->attributes[$object->table_element_line]['label'] as $key => $value) {
398
-					unset($_POST["options_" . $key]);
398
+					unset($_POST["options_".$key]);
399 399
 				}
400 400
 			}
401 401
 		}
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
403 403
 		if (($totalqty > 0 || getDolGlobalString('SHIPMENT_GETS_ALL_ORDER_PRODUCTS')) && !$error) {		// There is at least one thing to ship and no error
404 404
 			$selected_subtotal_lines = GETPOST('subtotal_toselect', 'array:int');
405 405
 			for ($i = 0; $i < $num; $i++) {
406
-				$qty = "qtyl" . $i;
406
+				$qty = "qtyl".$i;
407 407
 
408 408
 				if (!isset($batch_line[$i])) {
409 409
 					// not batch mode
@@ -421,8 +421,8 @@  discard block
 block discarded – undo
421 421
 						}
422 422
 					} else {
423 423
 						if (GETPOSTFLOAT($qty) > 0 || getDolGlobalString('SHIPMENT_GETS_ALL_ORDER_PRODUCTS')) {
424
-							$ent = "entl" . $i;
425
-							$idl = "idl" . $i;
424
+							$ent = "entl".$i;
425
+							$idl = "idl".$i;
426 426
 							$entrepot_id = is_numeric(GETPOSTINT($ent)) ? GETPOSTINT($ent) : GETPOSTINT('entrepot_id');
427 427
 							if ($entrepot_id < 0) {
428 428
 								$entrepot_id = '';
@@ -475,7 +475,7 @@  discard block
 block discarded – undo
475 475
 		} elseif (!$error) {
476 476
 			$labelfieldmissing = $langs->transnoentitiesnoconv("QtyToShip");
477 477
 			if (isModEnabled('stock')) {
478
-				$labelfieldmissing .= '/' . $langs->transnoentitiesnoconv("Warehouse");
478
+				$labelfieldmissing .= '/'.$langs->transnoentitiesnoconv("Warehouse");
479 479
 			}
480 480
 			setEventMessages($langs->trans("ErrorFieldRequired", $labelfieldmissing), null, 'errors');
481 481
 			$error++;
@@ -491,7 +491,7 @@  discard block
 block discarded – undo
491 491
 				$line->extraparams = $objectsrc_line->extraparams;
492 492
 				$line->setExtraParameters();
493 493
 			}
494
-			header("Location: card.php?id=" . $object->id);
494
+			header("Location: card.php?id=".$object->id);
495 495
 			exit;
496 496
 		} else {
497 497
 			$db->rollback();
@@ -506,7 +506,7 @@  discard block
 block discarded – undo
506 506
 		if ($result > 0) {
507 507
 			$db->commit();
508 508
 
509
-			header("Location: " . DOL_URL_ROOT . '/delivery/card.php?action=create_delivery&token=' . newToken() . '&id=' . $result);
509
+			header("Location: ".DOL_URL_ROOT.'/delivery/card.php?action=create_delivery&token='.newToken().'&id='.$result);
510 510
 			exit;
511 511
 		} else {
512 512
 			$db->rollback();
@@ -559,7 +559,7 @@  discard block
 block discarded – undo
559 559
 		$also_update_stock = (GETPOST('alsoUpdateStock', 'alpha') ? 1 : 0);
560 560
 		$result = $object->delete($user, 0, (bool) $also_update_stock);
561 561
 		if ($result > 0) {
562
-			header("Location: " . DOL_URL_ROOT . '/expedition/index.php');
562
+			header("Location: ".DOL_URL_ROOT.'/expedition/index.php');
563 563
 			exit;
564 564
 		} else {
565 565
 			setEventMessages($object->error, $object->errors, 'errors');
@@ -596,7 +596,7 @@  discard block
 block discarded – undo
596 596
 				$object->generateDocument($object->model_pdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
597 597
 			}
598 598
 
599
-			header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id);
599
+			header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
600 600
 			exit;
601 601
 		} else {
602 602
 			setEventMessages($object->error, $object->errors, 'errors');
@@ -604,7 +604,7 @@  discard block
 block discarded – undo
604 604
 	} elseif ($action == 'confirm_sign' && $confirm == 'yes' && $user->hasRight('expedition', 'creer')) {
605 605
 		$result = $object->setSignedStatus($user, GETPOSTINT('signed_status'), 0, 'SHIPPING_MODIFY');
606 606
 		if ($result >= 0) {
607
-			header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id);
607
+			header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
608 608
 			exit;
609 609
 		} else {
610 610
 			setEventMessages($object->error, $object->errors, 'errors');
@@ -612,7 +612,7 @@  discard block
 block discarded – undo
612 612
 	} elseif ($action == 'confirm_unsign' && $confirm == 'yes' && $user->hasRight('expedition', 'creer')) {
613 613
 		$result = $object->setSignedStatus($user, Expedition::$SIGNED_STATUSES['STATUS_NO_SIGNATURE'], 0, 'SHIPPING_MODIFY');
614 614
 		if ($result >= 0) {
615
-			header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id);
615
+			header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
616 616
 			exit;
617 617
 		} else {
618 618
 			setEventMessages($object->error, $object->errors, 'errors');
@@ -621,7 +621,7 @@  discard block
 block discarded – undo
621 621
 		$datedelivery = dol_mktime(GETPOSTINT('liv_hour'), GETPOSTINT('liv_min'), 0, GETPOSTINT('liv_month'), GETPOSTINT('liv_day'), GETPOSTINT('liv_year'));
622 622
 
623 623
 		$object->fetch($id);
624
-		$result = $object->setDeliveryDate($user, $datedelivery);	// Set the planned delivery date
624
+		$result = $object->setDeliveryDate($user, $datedelivery); // Set the planned delivery date
625 625
 		if ($result < 0) {
626 626
 			setEventMessages($object->error, $object->errors, 'errors');
627 627
 		}
@@ -663,7 +663,7 @@  discard block
 block discarded – undo
663 663
 
664 664
 		if (!$error) {
665 665
 			if ($object->update($user) >= 0) {
666
-				header("Location: card.php?id=" . $object->id);
666
+				header("Location: card.php?id=".$object->id);
667 667
 				exit;
668 668
 			}
669 669
 			setEventMessages($object->error, $object->errors, 'errors');
@@ -674,7 +674,7 @@  discard block
 block discarded – undo
674 674
 		$object->fetch($id);
675 675
 		$result = $object->setBilled();
676 676
 		if ($result >= 0) {
677
-			header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id);
677
+			header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
678 678
 			exit();
679 679
 		}
680 680
 		setEventMessages($object->error, $object->errors, 'errors');
@@ -682,7 +682,7 @@  discard block
 block discarded – undo
682 682
 		$object->fetch($id);
683 683
 		$result = $object->setClosed();
684 684
 		if ($result >= 0) {
685
-			header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id);
685
+			header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
686 686
 			exit();
687 687
 		}
688 688
 		setEventMessages($object->error, $object->errors, 'errors');
@@ -716,7 +716,7 @@  discard block
 block discarded – undo
716 716
 		}
717 717
 
718 718
 		if (!$error) {
719
-			header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id);
719
+			header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
720 720
 			exit();
721 721
 		} else {
722 722
 			setEventMessages($line->error, $line->errors, 'errors');
@@ -740,7 +740,7 @@  discard block
 block discarded – undo
740 740
 				// Unset extrafield POST Data
741 741
 				if (is_array($extrafields->attributes[$object->table_element_line]['label'])) {
742 742
 					foreach ($extrafields->attributes[$object->table_element_line]['label'] as $key => $value) {
743
-						unset($_POST["options_" . $key]);
743
+						unset($_POST["options_".$key]);
744 744
 					}
745 745
 				}
746 746
 				$line->fk_product = $lines[$i]->fk_product;
@@ -748,8 +748,8 @@  discard block
 block discarded – undo
748 748
 					// line with lot
749 749
 					foreach ($lines[$i]->detail_batch as $detail_batch) {
750 750
 						$lotStock = new Productbatch($db);
751
-						$batch = "batchl" . $detail_batch->fk_expeditiondet . "_" . $detail_batch->fk_origin_stock;
752
-						$qty = "qtyl" . $detail_batch->fk_expeditiondet . '_' . $detail_batch->id;
751
+						$batch = "batchl".$detail_batch->fk_expeditiondet."_".$detail_batch->fk_origin_stock;
752
+						$qty = "qtyl".$detail_batch->fk_expeditiondet.'_'.$detail_batch->id;
753 753
 						$batch_id = GETPOSTINT($batch);
754 754
 						$batch_qty = GETPOSTFLOAT($qty);
755 755
 						if (!empty($batch_id)) {
@@ -785,8 +785,8 @@  discard block
 block discarded – undo
785 785
 					}
786 786
 					// add new batch
787 787
 					$lotStock = new Productbatch($db);
788
-					$batch = "batchl" . $line_id . "_0";
789
-					$qty = "qtyl" . $line_id . "_0";
788
+					$batch = "batchl".$line_id."_0";
789
+					$qty = "qtyl".$line_id."_0";
790 790
 					$batch_id = GETPOSTINT($batch);
791 791
 					$batch_qty = GETPOSTFLOAT($qty);
792 792
 					$lineIdToAddLot = 0;
@@ -849,8 +849,8 @@  discard block
 block discarded – undo
849 849
 						// line without lot
850 850
 						if ($lines[$i]->entrepot_id == 0) {
851 851
 							// single warehouse shipment line or line in several warehouses context but with warehouse not defined
852
-							$stockLocation = "entl" . $line_id;
853
-							$qty = "qtyl" . $line_id;
852
+							$stockLocation = "entl".$line_id;
853
+							$qty = "qtyl".$line_id;
854 854
 							$line->id = $line_id;
855 855
 							$line->entrepot_id = GETPOSTINT((string) $stockLocation);
856 856
 							$line->qty = GETPOSTFLOAT($qty);
@@ -862,8 +862,8 @@  discard block
 block discarded – undo
862 862
 							unset($_POST[$qty]);
863 863
 						} elseif ($lines[$i]->entrepot_id > 0) {
864 864
 							// single warehouse shipment line
865
-							$stockLocation = "entl" . $line_id;
866
-							$qty = "qtyl" . $line_id;
865
+							$stockLocation = "entl".$line_id;
866
+							$qty = "qtyl".$line_id;
867 867
 							$line->id = $line_id;
868 868
 							$line->entrepot_id = GETPOSTINT($stockLocation);
869 869
 							$line->qty = GETPOSTFLOAT($qty);
@@ -877,8 +877,8 @@  discard block
 block discarded – undo
877 877
 							// multi warehouse shipment lines
878 878
 							foreach ($lines[$i]->details_entrepot as $detail_entrepot) {
879 879
 								if (!$error) {
880
-									$stockLocation = "entl" . $detail_entrepot->line_id;
881
-									$qty = "qtyl" . $detail_entrepot->line_id;
880
+									$stockLocation = "entl".$detail_entrepot->line_id;
881
+									$qty = "qtyl".$detail_entrepot->line_id;
882 882
 									$warehouse = GETPOSTINT($stockLocation);
883 883
 									if (!empty($warehouse)) {
884 884
 										$line->id = $detail_entrepot->line_id;
@@ -896,7 +896,7 @@  discard block
 block discarded – undo
896 896
 								}
897 897
 							}
898 898
 						} elseif (!isModEnabled('stock') && empty($conf->productbatch->enabled)) { // both product batch and stock are not activated.
899
-							$qty = "qtyl" . $line_id;
899
+							$qty = "qtyl".$line_id;
900 900
 							$line->id = $line_id;
901 901
 							$line->qty = GETPOSTFLOAT($qty);
902 902
 							$line->entrepot_id = 0;
@@ -910,7 +910,7 @@  discard block
 block discarded – undo
910 910
 						}
911 911
 					} else {
912 912
 						// Product no predefined
913
-						$qty = "qtyl" . $line_id;
913
+						$qty = "qtyl".$line_id;
914 914
 						$line->id = $line_id;
915 915
 						$line->qty = GETPOSTFLOAT($qty);
916 916
 						$line->entrepot_id = 0;
@@ -953,11 +953,11 @@  discard block
 block discarded – undo
953 953
 				$object->generateDocument($object->model_pdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
954 954
 			}
955 955
 		} else {
956
-			header('Location: ' . $_SERVER['PHP_SELF'] . '?id=' . $object->id); // To redisplay the form being edited
956
+			header('Location: '.$_SERVER['PHP_SELF'].'?id='.$object->id); // To redisplay the form being edited
957 957
 			exit();
958 958
 		}
959 959
 	} elseif ($action == 'updateline' && $permissiontoadd && GETPOST('cancel', 'alpha') == $langs->trans("Cancel")) {
960
-		header('Location: ' . $_SERVER['PHP_SELF'] . '?id=' . $object->id); // To redisplay the form being edited
960
+		header('Location: '.$_SERVER['PHP_SELF'].'?id='.$object->id); // To redisplay the form being edited
961 961
 		exit();
962 962
 	} elseif ($action == 'confirm_sign' && $confirm == 'yes' && $permissiontoadd) {
963 963
 		$result = $object->setSignedStatus($user, GETPOSTINT('signed_status'), 0, 'SHIPPING_MODIFY');
@@ -979,7 +979,7 @@  discard block
 block discarded – undo
979 979
 				$object->generateDocument($object->model_pdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
980 980
 			}
981 981
 
982
-			header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id);
982
+			header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
983 983
 			exit;
984 984
 		} else {
985 985
 			$mesg = $object->error;
@@ -1004,14 +1004,14 @@  discard block
 block discarded – undo
1004 1004
 				$object->generateDocument($object->model_pdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
1005 1005
 			}
1006 1006
 
1007
-			header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id);
1007
+			header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
1008 1008
 			exit;
1009 1009
 		} else {
1010 1010
 			$mesg = $object->error;
1011 1011
 		}
1012 1012
 	}
1013 1013
 
1014
-	include DOL_DOCUMENT_ROOT . '/core/actions_printing.inc.php';
1014
+	include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
1015 1015
 
1016 1016
 	// Actions to send emails
1017 1017
 	if (empty($id)) {
@@ -1021,8 +1021,8 @@  discard block
 block discarded – undo
1021 1021
 	$paramname = 'id';
1022 1022
 	$autocopy = 'MAIN_MAIL_AUTOCOPY_SHIPMENT_TO';
1023 1023
 	$mode = 'emailfromshipment';
1024
-	$trackid = 'shi' . $object->id;
1025
-	include DOL_DOCUMENT_ROOT . '/core/actions_sendmails.inc.php';
1024
+	$trackid = 'shi'.$object->id;
1025
+	include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
1026 1026
 }
1027 1027
 
1028 1028
 
@@ -1030,7 +1030,7 @@  discard block
 block discarded – undo
1030 1030
  * View
1031 1031
  */
1032 1032
 
1033
-$title = $object->ref . ' - ' . $langs->trans("Shipment");
1033
+$title = $object->ref.' - '.$langs->trans("Shipment");
1034 1034
 if ($action == 'create2') {
1035 1035
 	$title = $langs->trans("CreateShipment");
1036 1036
 }
@@ -1058,7 +1058,7 @@  discard block
 block discarded – undo
1058 1058
 if ($action == 'create2') {
1059 1059
 	print load_fiche_titre($langs->trans("CreateShipment"), '', 'dolly');
1060 1060
 
1061
-	print '<br>' . $langs->trans("ShipmentCreationIsDoneFromOrder");
1061
+	print '<br>'.$langs->trans("ShipmentCreationIsDoneFromOrder");
1062 1062
 	$action = '';
1063 1063
 	$id = '';
1064 1064
 	$ref = '';
@@ -1092,13 +1092,13 @@  discard block
 block discarded – undo
1092 1092
 				$entrepot = new Entrepot($db);
1093 1093
 			}
1094 1094
 
1095
-			print '<form action="' . $_SERVER["PHP_SELF"] . '" method="post">';
1096
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
1095
+			print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
1096
+			print '<input type="hidden" name="token" value="'.newToken().'">';
1097 1097
 			print '<input type="hidden" name="action" value="add">';
1098
-			print '<input type="hidden" name="origin" value="' . $origin . '">';
1099
-			print '<input type="hidden" name="origin_id" value="' . $object->id . '">';
1098
+			print '<input type="hidden" name="origin" value="'.$origin.'">';
1099
+			print '<input type="hidden" name="origin_id" value="'.$object->id.'">';
1100 1100
 			if (GETPOSTINT('entrepot_id')) {
1101
-				print '<input type="hidden" name="entrepot_id" value="' . GETPOSTINT('entrepot_id') . '">';
1101
+				print '<input type="hidden" name="entrepot_id" value="'.GETPOSTINT('entrepot_id').'">';
1102 1102
 			}
1103 1103
 
1104 1104
 			print dol_get_fiche_head([]);
@@ -1128,13 +1128,13 @@  discard block
 block discarded – undo
1128 1128
 				print $langs->trans('RefCustomer');
1129 1129
 			}
1130 1130
 			print '</td><td colspan="3">';
1131
-			print '<input type="text" name="ref_customer" value="' . $object->ref_client . '" />';
1131
+			print '<input type="text" name="ref_customer" value="'.$object->ref_client.'" />';
1132 1132
 			print '</td>';
1133 1133
 			print '</tr>';
1134 1134
 
1135 1135
 			// Tiers
1136
-			print '<tr><td class="titlefieldcreate fieldrequired">' . $langs->trans('Company') . '</td>';
1137
-			print '<td colspan="3">' . $soc->getNomUrl(1) . '</td>';
1136
+			print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans('Company').'</td>';
1137
+			print '<td colspan="3">'.$soc->getNomUrl(1).'</td>';
1138 1138
 			print '</tr>';
1139 1139
 
1140 1140
 			// Project
@@ -1149,16 +1149,16 @@  discard block
 block discarded – undo
1149 1149
 
1150 1150
 				$langs->load("projects");
1151 1151
 				print '<tr>';
1152
-				print '<td>' . $langs->trans("Project") . '</td><td colspan="2">';
1152
+				print '<td>'.$langs->trans("Project").'</td><td colspan="2">';
1153 1153
 				print img_picto('', 'project', 'class="pictofixedwidth"');
1154 1154
 				print $formproject->select_projects($soc->id, $projectid, 'projectid', 0, 0, 1, 0, 0, 0, 0, '', 1, 0, 'widthcentpercentminusxx');
1155
-				print ' <a class="paddingleft" href="' . DOL_URL_ROOT . '/projet/card.php?socid=' . $soc->id . '&action=create&status=1&backtopage=' . urlencode($_SERVER["PHP_SELF"] . '?action=create&socid=' . $soc->id) . '"><span class="fa fa-plus-circle valignmiddle"></span></a>';
1155
+				print ' <a class="paddingleft" href="'.DOL_URL_ROOT.'/projet/card.php?socid='.$soc->id.'&action=create&status=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create&socid='.$soc->id).'"><span class="fa fa-plus-circle valignmiddle"></span></a>';
1156 1156
 				print '</td>';
1157 1157
 				print '</tr>';
1158 1158
 			}
1159 1159
 
1160 1160
 			// Date delivery planned
1161
-			print '<tr><td>' . $langs->trans("DateDeliveryPlanned") . '</td>';
1161
+			print '<tr><td>'.$langs->trans("DateDeliveryPlanned").'</td>';
1162 1162
 			print '<td colspan="3">';
1163 1163
 			print img_picto('', 'action', 'class="pictofixedwidth"');
1164 1164
 			$date_delivery = ($date_delivery ? $date_delivery : $object->delivery_date); // $date_delivery comes from GETPOST
@@ -1167,7 +1167,7 @@  discard block
 block discarded – undo
1167 1167
 			print '</tr>';
1168 1168
 
1169 1169
 			// Date shipment (sending)
1170
-			print '<tr><td>' . $langs->trans("DateShipping") . '</td>';
1170
+			print '<tr><td>'.$langs->trans("DateShipping").'</td>';
1171 1171
 			print '<td colspan="3">';
1172 1172
 			print img_picto('', 'action', 'class="pictofixedwidth"');
1173 1173
 			//$date_shipping = ($date_shipping ? $date_shipping : $object->date_shipping); // $date_shipping comes from GETPOST
@@ -1176,7 +1176,7 @@  discard block
 block discarded – undo
1176 1176
 			print '</tr>';
1177 1177
 
1178 1178
 			// Note Public
1179
-			print '<tr><td>' . $langs->trans("NotePublic") . '</td>';
1179
+			print '<tr><td>'.$langs->trans("NotePublic").'</td>';
1180 1180
 			print '<td colspan="3">';
1181 1181
 			$doleditor = new DolEditor('note_public', $object->note_public, '', 60, 'dolibarr_notes', 'In', false, false, !getDolGlobalString('FCKEDITOR_ENABLE_NOTE_PUBLIC') ? 0 : 1, ROWS_3, '90%');
1182 1182
 			print $doleditor->Create(1);
@@ -1184,7 +1184,7 @@  discard block
 block discarded – undo
1184 1184
 
1185 1185
 			// Note Private
1186 1186
 			if ($object->note_private && !$user->socid) {
1187
-				print '<tr><td>' . $langs->trans("NotePrivate") . '</td>';
1187
+				print '<tr><td>'.$langs->trans("NotePrivate").'</td>';
1188 1188
 				print '<td colspan="3">';
1189 1189
 				$doleditor = new DolEditor('note_private', $object->note_private, '', 60, 'dolibarr_notes', 'In', false, false, !getDolGlobalString('FCKEDITOR_ENABLE_NOTE_PRIVATE') ? 0 : 1, ROWS_3, '90%');
1190 1190
 				print $doleditor->Create(1);
@@ -1196,19 +1196,19 @@  discard block
 block discarded – undo
1196 1196
 			print $langs->trans("Weight");
1197 1197
 			print '</td><td colspan="3">';
1198 1198
 			print img_picto('', 'fa-balance-scale', 'class="pictofixedwidth"');
1199
-			print '<input name="weight" size="4" value="' . GETPOSTINT('weight') . '"> ';
1199
+			print '<input name="weight" size="4" value="'.GETPOSTINT('weight').'"> ';
1200 1200
 			$text = $formproduct->selectMeasuringUnits("weight_units", "weight", (string) GETPOSTINT('weight_units'), 0, 2);
1201 1201
 			$htmltext = $langs->trans("KeepEmptyForAutoCalculation");
1202 1202
 			print $form->textwithpicto($text, $htmltext);
1203 1203
 			print '</td></tr>';
1204 1204
 			// Dim
1205 1205
 			print '<tr><td>';
1206
-			print $langs->trans("Width") . ' x ' . $langs->trans("Height") . ' x ' . $langs->trans("Depth");
1206
+			print $langs->trans("Width").' x '.$langs->trans("Height").' x '.$langs->trans("Depth");
1207 1207
 			print ' </td><td colspan="3">';
1208 1208
 			print img_picto('', 'fa-ruler', 'class="pictofixedwidth"');
1209
-			print '<input name="sizeW" size="4" value="' . GETPOSTINT('sizeW') . '">';
1210
-			print ' x <input name="sizeH" size="4" value="' . GETPOSTINT('sizeH') . '">';
1211
-			print ' x <input name="sizeS" size="4" value="' . GETPOSTINT('sizeS') . '">';
1209
+			print '<input name="sizeW" size="4" value="'.GETPOSTINT('sizeW').'">';
1210
+			print ' x <input name="sizeH" size="4" value="'.GETPOSTINT('sizeH').'">';
1211
+			print ' x <input name="sizeS" size="4" value="'.GETPOSTINT('sizeS').'">';
1212 1212
 			print ' ';
1213 1213
 			$text = $formproduct->selectMeasuringUnits("size_units", "size", (string) GETPOSTINT('size_units'), 0, 2);
1214 1214
 			$htmltext = $langs->trans("KeepEmptyForAutoCalculation");
@@ -1216,7 +1216,7 @@  discard block
 block discarded – undo
1216 1216
 			print '</td></tr>';
1217 1217
 
1218 1218
 			// Delivery method
1219
-			print "<tr><td>" . $langs->trans("DeliveryMethod") . "</td>";
1219
+			print "<tr><td>".$langs->trans("DeliveryMethod")."</td>";
1220 1220
 			print '<td colspan="3">';
1221 1221
 			$expe->fetch_delivery_methods();
1222 1222
 			print img_picto('', 'dolly', 'class="pictofixedwidth"');
@@ -1227,16 +1227,16 @@  discard block
 block discarded – undo
1227 1227
 			print "</td></tr>\n";
1228 1228
 
1229 1229
 			// Tracking number
1230
-			print "<tr><td>" . $langs->trans("TrackingNumber") . "</td>";
1230
+			print "<tr><td>".$langs->trans("TrackingNumber")."</td>";
1231 1231
 			print '<td colspan="3">';
1232 1232
 			print img_picto('', 'barcode', 'class="pictofixedwidth"');
1233
-			print '<input name="tracking_number" size="20" value="' . GETPOST('tracking_number', 'alpha') . '">';
1233
+			print '<input name="tracking_number" size="20" value="'.GETPOST('tracking_number', 'alpha').'">';
1234 1234
 			print "</td></tr>\n";
1235 1235
 
1236 1236
 			// Incoterms
1237 1237
 			if (isModEnabled('incoterm')) {
1238 1238
 				print '<tr>';
1239
-				print '<td><label for="incoterm_id">' . $form->textwithpicto($langs->trans("IncotermLabel"), $object->label_incoterms, 1) . '</label></td>';
1239
+				print '<td><label for="incoterm_id">'.$form->textwithpicto($langs->trans("IncotermLabel"), $object->label_incoterms, 1).'</label></td>';
1240 1240
 				print '<td colspan="3" class="maxwidthonsmartphone">';
1241 1241
 				print img_picto('', 'incoterm', 'class="pictofixedwidth"');
1242 1242
 				print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms) ? $object->location_incoterms : ''));
@@ -1244,10 +1244,10 @@  discard block
 block discarded – undo
1244 1244
 			}
1245 1245
 
1246 1246
 			// Document model
1247
-			include_once DOL_DOCUMENT_ROOT . '/core/modules/expedition/modules_expedition.php';
1247
+			include_once DOL_DOCUMENT_ROOT.'/core/modules/expedition/modules_expedition.php';
1248 1248
 			$list = ModelePdfExpedition::liste_modeles($db);
1249 1249
 			if (is_countable($list) && count($list) > 1) {
1250
-				print "<tr><td>" . $langs->trans("DefaultModel") . "</td>";
1250
+				print "<tr><td>".$langs->trans("DefaultModel")."</td>";
1251 1251
 				print '<td colspan="3">';
1252 1252
 				print img_picto('', 'pdf', 'class="pictofixedwidth"');
1253 1253
 				print $form->selectarray('model', $list, getDolGlobalString('EXPEDITION_ADDON_PDF'), 0, 0, 0, '', 0, 0, 0, '', 'widthcentpercentminusx');
@@ -1256,7 +1256,7 @@  discard block
 block discarded – undo
1256 1256
 
1257 1257
 			// Other attributes. Fields from hook formObjectOptions and Extrafields.
1258 1258
 			// $objectsrc is Commande|Facture
1259
-			$objectsav = $object;	// Because Expedition is $expe and not $object that is wrongly a duplicate of $objectsrc.
1259
+			$objectsav = $object; // Because Expedition is $expe and not $object that is wrongly a duplicate of $objectsrc.
1260 1260
 			$object = $expe;
1261 1261
 			$parameters = array('objectsrc' => isset($objectsrc) ? $objectsrc : '', 'cols' => '3', 'socid' => $socid);
1262 1262
 			include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php';
@@ -1271,22 +1271,22 @@  discard block
 block discarded – undo
1271 1271
 
1272 1272
 			$numAsked = count($object->lines);
1273 1273
 
1274
-			print '<script type="text/javascript">' . "\n";
1275
-			print 'jQuery(document).ready(function() {' . "\n";
1274
+			print '<script type="text/javascript">'."\n";
1275
+			print 'jQuery(document).ready(function() {'."\n";
1276 1276
 			print 'jQuery("#autofill").click(function() {';
1277 1277
 			$i = 0;
1278 1278
 			while ($i < $numAsked) {
1279
-				print 'jQuery("#qtyl' . $i . '").val(jQuery("#qtyasked' . $i . '").val() - jQuery("#qtydelivered' . $i . '").val());' . "\n";
1279
+				print 'jQuery("#qtyl'.$i.'").val(jQuery("#qtyasked'.$i.'").val() - jQuery("#qtydelivered'.$i.'").val());'."\n";
1280 1280
 				if (isModEnabled('productbatch')) {
1281
-					print 'jQuery("#qtyl' . $i . '_' . $i . '").val(jQuery("#qtyasked' . $i . '").val() - jQuery("#qtydelivered' . $i . '").val());' . "\n";
1281
+					print 'jQuery("#qtyl'.$i.'_'.$i.'").val(jQuery("#qtyasked'.$i.'").val() - jQuery("#qtydelivered'.$i.'").val());'."\n";
1282 1282
 				}
1283 1283
 				$i++;
1284 1284
 			}
1285
-			print 'return false; });' . "\n";
1286
-			print 'jQuery("#autoreset").click(function() { console.log("Reset values to 0"); jQuery(".qtyl").val(0);' . "\n";
1287
-			print 'return false; });' . "\n";
1288
-			print '});' . "\n";
1289
-			print '</script>' . "\n";
1285
+			print 'return false; });'."\n";
1286
+			print 'jQuery("#autoreset").click(function() { console.log("Reset values to 0"); jQuery(".qtyl").val(0);'."\n";
1287
+			print 'return false; });'."\n";
1288
+			print '});'."\n";
1289
+			print '</script>'."\n";
1290 1290
 
1291 1291
 			print '<br>';
1292 1292
 
@@ -1320,26 +1320,26 @@  discard block
 block discarded – undo
1320 1320
 				}
1321 1321
 				print $langs->trans("Description");
1322 1322
 				print '</td>';
1323
-				print '<td class="center">' . $langs->trans("QtyOrdered") . '</td>';
1324
-				print '<td class="center">' . $langs->trans("QtyShipped") . '</td>';
1325
-				print '<td class="center">' . $langs->trans("QtyToShip");
1323
+				print '<td class="center">'.$langs->trans("QtyOrdered").'</td>';
1324
+				print '<td class="center">'.$langs->trans("QtyShipped").'</td>';
1325
+				print '<td class="center">'.$langs->trans("QtyToShip");
1326 1326
 				if (empty($conf->productbatch->enabled)) {
1327
-					print '<br><a href="#" id="autofill" class="opacitymedium link cursor cursorpointer">' . img_picto($langs->trans("Autofill"), 'autofill', 'class="paddingrightonly"') . '</a>';
1327
+					print '<br><a href="#" id="autofill" class="opacitymedium link cursor cursorpointer">'.img_picto($langs->trans("Autofill"), 'autofill', 'class="paddingrightonly"').'</a>';
1328 1328
 					print ' / ';
1329 1329
 				} else {
1330 1330
 					print '<br>';
1331 1331
 				}
1332
-				print '<span id="autoreset" class="opacitymedium link cursor cursorpointer">' . img_picto($langs->trans("Reset"), 'eraser') . '</span>';
1332
+				print '<span id="autoreset" class="opacitymedium link cursor cursorpointer">'.img_picto($langs->trans("Reset"), 'eraser').'</span>';
1333 1333
 				print '</td>';
1334 1334
 				if (isModEnabled('stock')) {
1335 1335
 					if (empty($conf->productbatch->enabled)) {
1336
-						print '<td class="left">' . $langs->trans("Warehouse") . ' (' . $langs->trans("Stock") . ')</td>';
1336
+						print '<td class="left">'.$langs->trans("Warehouse").' ('.$langs->trans("Stock").')</td>';
1337 1337
 					} else {
1338
-						print '<td class="left">' . $langs->trans("Warehouse") . ' / ' . $langs->trans("Batch") . ' (' . $langs->trans("Stock") . ')</td>';
1338
+						print '<td class="left">'.$langs->trans("Warehouse").' / '.$langs->trans("Batch").' ('.$langs->trans("Stock").')</td>';
1339 1339
 					}
1340 1340
 				}
1341 1341
 				if (getDolGlobalString('SHIPPING_DISPLAY_STOCK_ENTRY_DATE')) {
1342
-					print '<td class="left">' . $langs->trans('StockEntryDate') . '</td>';
1342
+					print '<td class="left">'.$langs->trans('StockEntryDate').'</td>';
1343 1343
 				}
1344 1344
 				print "</tr>\n";
1345 1345
 			}
@@ -1376,8 +1376,8 @@  discard block
 block discarded – undo
1376 1376
 						$type = 1;
1377 1377
 					}
1378 1378
 
1379
-					print '<!-- line for order line ' . $line->id . ' -->' . "\n";
1380
-					print '<tr class="oddeven" id="row-' . $line->id . '">' . "\n";
1379
+					print '<!-- line for order line '.$line->id.' -->'."\n";
1380
+					print '<tr class="oddeven" id="row-'.$line->id.'">'."\n";
1381 1381
 
1382 1382
 					$qtyProdCom = $line->qty;
1383 1383
 					$productChildrenNb = 0;
@@ -1398,7 +1398,7 @@  discard block
 block discarded – undo
1398 1398
 						//var_dump($product->stock_warehouse[1]);
1399 1399
 
1400 1400
 						print '<td>';
1401
-						print '<a name="' . $line->id . '"></a>'; // ancre pour retourner sur la ligne
1401
+						print '<a name="'.$line->id.'"></a>'; // ancre pour retourner sur la ligne
1402 1402
 
1403 1403
 						// Show product and description
1404 1404
 						$product_static->type = $line->fk_product_type;
@@ -1411,7 +1411,7 @@  discard block
 block discarded – undo
1411 1411
 						$showdescinproductdesc = getDolGlobalString('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE');
1412 1412
 
1413 1413
 						$text = $product_static->getNomUrl(1);
1414
-						$text .= ' - ' . (!empty($line->label) ? $line->label : $line->product_label);
1414
+						$text .= ' - '.(!empty($line->label) ? $line->label : $line->product_label);
1415 1415
 						$description = ($showdescinproductdesc ? '' : dol_htmlentitiesbr($line->desc));
1416 1416
 						$description .= empty($product->stockable_product) ? $langs->trans('StockDisabled') : $langs->trans('StockEnabled');
1417 1417
 						print $form->textwithtooltip($text, $description, 3, 0, '', (string) $i);
@@ -1421,7 +1421,7 @@  discard block
 block discarded – undo
1421 1421
 
1422 1422
 						// Add description in form
1423 1423
 						if ($showdescinproductdesc) {
1424
-							print ($line->desc && $line->desc != $line->product_label) ? '<br>' . dol_htmlentitiesbr($line->desc) : '';
1424
+							print ($line->desc && $line->desc != $line->product_label) ? '<br>'.dol_htmlentitiesbr($line->desc) : '';
1425 1425
 						}
1426 1426
 
1427 1427
 						print '</td>';
@@ -1434,10 +1434,10 @@  discard block
 block discarded – undo
1434 1434
 						}
1435 1435
 
1436 1436
 						if (!empty($line->label)) {
1437
-							$text .= ' <strong>' . $line->label . '</strong>';
1437
+							$text .= ' <strong>'.$line->label.'</strong>';
1438 1438
 							print $form->textwithtooltip($text, $line->desc, 3, 0, '', (string) $i);
1439 1439
 						} else {
1440
-							print $text . ' ' . nl2br($line->desc);
1440
+							print $text.' '.nl2br($line->desc);
1441 1441
 						}
1442 1442
 
1443 1443
 						// Show range
@@ -1452,16 +1452,16 @@  discard block
 block discarded – undo
1452 1452
 					}
1453 1453
 
1454 1454
 					// Qty
1455
-					print '<td class="center">' . $line->qty;
1456
-					print '<input name="qtyasked' . $indiceAsked . '" id="qtyasked' . $indiceAsked . '" type="hidden" value="' . $line->qty . '">';
1457
-					print '' . $unit_order . '</td>';
1455
+					print '<td class="center">'.$line->qty;
1456
+					print '<input name="qtyasked'.$indiceAsked.'" id="qtyasked'.$indiceAsked.'" type="hidden" value="'.$line->qty.'">';
1457
+					print ''.$unit_order.'</td>';
1458 1458
 
1459 1459
 					// Qty already shipped
1460 1460
 					print '<td class="center">';
1461 1461
 					$quantityDelivered = isset($object->expeditions[$line->id]) ? $object->expeditions[$line->id] : '';
1462 1462
 					print $quantityDelivered;
1463
-					print '<input name="qtydelivered' . $indiceAsked . '" id="qtydelivered' . $indiceAsked . '" type="hidden" value="' . $quantityDelivered . '">';
1464
-					print '' . $unit_order . '</td>';
1463
+					print '<input name="qtydelivered'.$indiceAsked.'" id="qtydelivered'.$indiceAsked.'" type="hidden" value="'.$quantityDelivered.'">';
1464
+					print ''.$unit_order.'</td>';
1465 1465
 
1466 1466
 					// Qty to ship
1467 1467
 					$quantityAsked = $line->qty;
@@ -1492,19 +1492,19 @@  discard block
 block discarded – undo
1492 1492
 							// Quantity to send
1493 1493
 							print '<td class="center">';
1494 1494
 							if ($line->product_type == Product::TYPE_PRODUCT || getDolGlobalString('STOCK_SUPPORTS_SERVICES') || ($line->product_type == Product::TYPE_SERVICE && getDolGlobalString('SHIPMENT_SUPPORTS_SERVICES'))) {
1495
-								if (GETPOSTINT('qtyl' . $indiceAsked)) {
1496
-									$deliverableQty = GETPOSTINT('qtyl' . $indiceAsked);
1495
+								if (GETPOSTINT('qtyl'.$indiceAsked)) {
1496
+									$deliverableQty = GETPOSTINT('qtyl'.$indiceAsked);
1497 1497
 								}
1498
-								print '<input name="idl' . $indiceAsked . '" type="hidden" value="' . $line->id . '">';
1498
+								print '<input name="idl'.$indiceAsked.'" type="hidden" value="'.$line->id.'">';
1499 1499
 								$qtylValue = $deliverableQty;
1500 1500
 								if (getDolGlobalBool('SHIPMENT_DONT_PREFILL_QTY', false)) {
1501 1501
 									$qtylValue = '';
1502 1502
 								}
1503
-								print '<input name="qtyl' . $indiceAsked . '" id="qtyl' . $indiceAsked . '" class="qtyl right" type="text" size="4" value="' . $qtylValue . '">';
1503
+								print '<input name="qtyl'.$indiceAsked.'" id="qtyl'.$indiceAsked.'" class="qtyl right" type="text" size="4" value="'.$qtylValue.'">';
1504 1504
 							} else {
1505 1505
 								if (getDolGlobalString('SHIPMENT_GETS_ALL_ORDER_PRODUCTS')) {
1506
-									print '<input name="idl' . $indiceAsked . '" type="hidden" value="' . $line->id . '">';
1507
-									print '<input name="qtyl' . $indiceAsked . '" id="qtyl' . $indiceAsked . '" type="hidden" value="0">';
1506
+									print '<input name="idl'.$indiceAsked.'" type="hidden" value="'.$line->id.'">';
1507
+									print '<input name="qtyl'.$indiceAsked.'" id="qtyl'.$indiceAsked.'" type="hidden" value="0">';
1508 1508
 								}
1509 1509
 
1510 1510
 								print $langs->trans("NA");
@@ -1516,8 +1516,8 @@  discard block
 block discarded – undo
1516 1516
 								print '<td class="left">';
1517 1517
 								if ($line->product_type == Product::TYPE_PRODUCT || getDolGlobalString('STOCK_SUPPORTS_SERVICES')) {   // Type of product need stock change ?
1518 1518
 									// Show warehouse combo list
1519
-									$ent = "entl" . $indiceAsked;
1520
-									$idl = "idl" . $indiceAsked;
1519
+									$ent = "entl".$indiceAsked;
1520
+									$idl = "idl".$indiceAsked;
1521 1521
 									$tmpentrepot_id = is_numeric(GETPOST($ent)) ? GETPOSTINT($ent) : $warehouse_id;
1522 1522
 									if ($line->fk_product > 0) {
1523 1523
 										print '<!-- Show warehouse selection -->';
@@ -1527,24 +1527,24 @@  discard block
 block discarded – undo
1527 1527
 											$stockMin = 0;
1528 1528
 										}
1529 1529
 										if ($productChildrenNb > 0) {
1530
-											print $formproduct->selectWarehouses($tmpentrepot_id, 'entl' . $indiceAsked, '', 1, 0, 0, '', 0, 0, array(), 'minwidth200', array(), 1, $stockMin, 'stock DESC, e.ref');
1530
+											print $formproduct->selectWarehouses($tmpentrepot_id, 'entl'.$indiceAsked, '', 1, 0, 0, '', 0, 0, array(), 'minwidth200', array(), 1, $stockMin, 'stock DESC, e.ref');
1531 1531
 										} else {
1532 1532
 											if ($product->stockable_product == Product::ENABLED_STOCK) {
1533
-												print $formproduct->selectWarehouses($tmpentrepot_id, 'entl' . $indiceAsked, '', 1, 0, $line->fk_product, '', 1, 0, array(), 'minwidth200', array(), 1, $stockMin, 'stock DESC, e.ref');
1533
+												print $formproduct->selectWarehouses($tmpentrepot_id, 'entl'.$indiceAsked, '', 1, 0, $line->fk_product, '', 1, 0, array(), 'minwidth200', array(), 1, $stockMin, 'stock DESC, e.ref');
1534 1534
 											} else {
1535
-												print img_warning() . ' ' . $langs->trans('StockDisabled');
1535
+												print img_warning().' '.$langs->trans('StockDisabled');
1536 1536
 											}
1537 1537
 										}
1538 1538
 
1539 1539
 										if ($tmpentrepot_id > 0 && $tmpentrepot_id == $warehouse_id) {
1540 1540
 											//print $stock.' '.$quantityToBeDelivered;
1541 1541
 											if ($stock < $quantityToBeDelivered) {
1542
-												print ' ' . img_warning($langs->trans("StockTooLow")); // Stock too low for this $warehouse_id but you can change warehouse
1542
+												print ' '.img_warning($langs->trans("StockTooLow")); // Stock too low for this $warehouse_id but you can change warehouse
1543 1543
 											}
1544 1544
 										}
1545 1545
 									}
1546 1546
 								} else {
1547
-									print '<span class="opacitymedium">(' . $langs->trans("Service") . ')</span><input name="entl' . $indiceAsked . '" id="entl' . $indiceAsked . '" type="hidden" value="0">';
1547
+									print '<span class="opacitymedium">('.$langs->trans("Service").')</span><input name="entl'.$indiceAsked.'" id="entl'.$indiceAsked.'" type="hidden" value="0">';
1548 1548
 								}
1549 1549
 								print '</td>';
1550 1550
 							}
@@ -1565,9 +1565,9 @@  discard block
 block discarded – undo
1565 1565
 											$img = img_warning($langs->trans("StockTooLow"));
1566 1566
 										}
1567 1567
 										print "<tr class=\"oddeven\"><td>&nbsp; &nbsp; &nbsp; ->
1568
-											<a href=\"" . DOL_URL_ROOT . "/product/card.php?id=" . $value['id'] . "\">" . $value['fullpath'] . "
1569
-											</a> (" . $value['nb'] . ")</td><td class=\"center\"> " . $value['nb_total'] . "</td><td>&nbsp;</td><td>&nbsp;</td>
1570
-											<td class=\"center\">" . $value['stock'] . " " . $img . "</td>";
1568
+											<a href=\"" . DOL_URL_ROOT."/product/card.php?id=".$value['id']."\">".$value['fullpath']."
1569
+											</a> (" . $value['nb'].")</td><td class=\"center\"> ".$value['nb_total']."</td><td>&nbsp;</td><td>&nbsp;</td>
1570
+											<td class=\"center\">" . $value['stock']." ".$img."</td>";
1571 1571
 										if (getDolGlobalString('SHIPPING_DISPLAY_STOCK_ENTRY_DATE')) {
1572 1572
 											print '<td></td>';
1573 1573
 										} //StockEntrydate
@@ -1597,7 +1597,7 @@  discard block
 block discarded – undo
1597 1597
 									$nbofsuggested++;
1598 1598
 								}
1599 1599
 							}
1600
-							print '<input name="idl' . $indiceAsked . '" type="hidden" value="' . $line->id . '">';
1600
+							print '<input name="idl'.$indiceAsked.'" type="hidden" value="'.$line->id.'">';
1601 1601
 							if (is_object($product->stock_warehouse[$warehouse_id]) && count($product->stock_warehouse[$warehouse_id]->detail_batch)) {
1602 1602
 								foreach ($product->stock_warehouse[$warehouse_id]->detail_batch as $dbatch) {	// $dbatch is instance of Productbatch
1603 1603
 									//var_dump($dbatch);
@@ -1623,7 +1623,7 @@  discard block
 block discarded – undo
1623 1623
 										$deliverableQty = 0;
1624 1624
 									}
1625 1625
 
1626
-									$inputName = 'qtyl' . $indiceAsked . '_' . $subj;
1626
+									$inputName = 'qtyl'.$indiceAsked.'_'.$subj;
1627 1627
 									if (GETPOSTISSET($inputName)) {
1628 1628
 										$deliverableQty = GETPOST($inputName, 'int');
1629 1629
 									}
@@ -1631,37 +1631,37 @@  discard block
 block discarded – undo
1631 1631
 									$tooltipClass = $tooltipTitle = '';
1632 1632
 									if (!empty($alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)])) {
1633 1633
 										$tooltipClass = ' classfortooltip';
1634
-										$tooltipTitle = $langs->trans('StockQuantitiesAlreadyAllocatedOnPreviousLines') . ' : ' . $alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)];
1634
+										$tooltipTitle = $langs->trans('StockQuantitiesAlreadyAllocatedOnPreviousLines').' : '.$alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)];
1635 1635
 									} else {
1636 1636
 										$alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)] = 0;
1637 1637
 									}
1638 1638
 									$alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)] = $deliverableQty + $alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)];
1639 1639
 
1640
-									print '<!-- subj=' . $subj . '/' . $nbofsuggested . ' --><tr ' . ((($subj + 1) == $nbofsuggested) ? 'oddeven' : '') . '>';
1640
+									print '<!-- subj='.$subj.'/'.$nbofsuggested.' --><tr '.((($subj + 1) == $nbofsuggested) ? 'oddeven' : '').'>';
1641 1641
 									print '<td colspan="3" ></td><td class="center">';
1642 1642
 									$qtylValue = $deliverableQty;
1643 1643
 									if (getDolGlobalBool('SHIPMENT_DONT_PREFILL_QTY', false)) {
1644 1644
 										$qtylValue = '';
1645 1645
 									}
1646
-									print '<input class="qtyl ' . $tooltipClass . ' right" title="' . $tooltipTitle . '" name="qtyl' . $indiceAsked . '_' . $subj . '" id="qtyl' . $indiceAsked . '_' . $subj . '" type="text" size="4" value="' . $qtylValue . '">';
1646
+									print '<input class="qtyl '.$tooltipClass.' right" title="'.$tooltipTitle.'" name="qtyl'.$indiceAsked.'_'.$subj.'" id="qtyl'.$indiceAsked.'_'.$subj.'" type="text" size="4" value="'.$qtylValue.'">';
1647 1647
 									print '</td>';
1648 1648
 
1649 1649
 									print '<!-- Show details of lot -->';
1650 1650
 									print '<td class="left">';
1651 1651
 
1652
-									print $staticwarehouse->getNomUrl(0) . ' / ';
1652
+									print $staticwarehouse->getNomUrl(0).' / ';
1653 1653
 
1654
-									print '<input name="batchl' . $indiceAsked . '_' . $subj . '" type="hidden" value="' . $dbatch->id . '">';
1654
+									print '<input name="batchl'.$indiceAsked.'_'.$subj.'" type="hidden" value="'.$dbatch->id.'">';
1655 1655
 
1656 1656
 									$detail = '';
1657
-									$detail .= $langs->trans("Batch") . ': ' . $dbatch->batch;
1657
+									$detail .= $langs->trans("Batch").': '.$dbatch->batch;
1658 1658
 									if (!getDolGlobalString('PRODUCT_DISABLE_SELLBY') && !empty($dbatch->sellby)) {
1659
-										$detail .= ' - ' . $langs->trans("SellByDate") . ': ' . dol_print_date($dbatch->sellby, "day");
1659
+										$detail .= ' - '.$langs->trans("SellByDate").': '.dol_print_date($dbatch->sellby, "day");
1660 1660
 									}
1661 1661
 									if (!getDolGlobalString('PRODUCT_DISABLE_EATBY') && !empty($dbatch->eatby)) {
1662
-										$detail .= ' - ' . $langs->trans("EatByDate") . ': ' . dol_print_date($dbatch->eatby, "day");
1662
+										$detail .= ' - '.$langs->trans("EatByDate").': '.dol_print_date($dbatch->eatby, "day");
1663 1663
 									}
1664
-									$detail .= ' - ' . $langs->trans("Qty") . ': ' . $dbatch->qty;
1664
+									$detail .= ' - '.$langs->trans("Qty").': '.$dbatch->qty;
1665 1665
 									$detail .= '<br>';
1666 1666
 									print $detail;
1667 1667
 
@@ -1672,18 +1672,18 @@  discard block
 block discarded – undo
1672 1672
 									$subj++;
1673 1673
 									print '</td>';
1674 1674
 									if (getDolGlobalInt('SHIPPING_DISPLAY_STOCK_ENTRY_DATE')) {
1675
-										print '<td>' . dol_print_date($dbatch->context['stock_entry_date'], 'day') . '</td>'; //StockEntrydate
1675
+										print '<td>'.dol_print_date($dbatch->context['stock_entry_date'], 'day').'</td>'; //StockEntrydate
1676 1676
 									}
1677 1677
 									print '</tr>';
1678 1678
 								}
1679 1679
 							} else {
1680 1680
 								print '<!-- Case there is no details of lot at all -->';
1681 1681
 								print '<tr class="oddeven"><td colspan="3"></td><td class="center">';
1682
-								print '<input class="qtyl right" name="qtyl' . $indiceAsked . '_' . $subj . '" id="qtyl' . $indiceAsked . '_' . $subj . '" type="text" size="4" value="0" disabled="disabled"> ';
1682
+								print '<input class="qtyl right" name="qtyl'.$indiceAsked.'_'.$subj.'" id="qtyl'.$indiceAsked.'_'.$subj.'" type="text" size="4" value="0" disabled="disabled"> ';
1683 1683
 								print '</td>';
1684 1684
 
1685 1685
 								print '<td class="left">';
1686
-								print img_warning() . ' ' . $langs->trans("NoProductToShipFoundIntoStock", $staticwarehouse->label);
1686
+								print img_warning().' '.$langs->trans("NoProductToShipFoundIntoStock", $staticwarehouse->label);
1687 1687
 								print '</td>';
1688 1688
 								if (getDolGlobalInt('SHIPPING_DISPLAY_STOCK_ENTRY_DATE')) {
1689 1689
 									print '<td></td>';
@@ -1699,9 +1699,9 @@  discard block
 block discarded – undo
1699 1699
 							if (getDolGlobalString('SHIPPING_DISPLAY_STOCK_ENTRY_DATE')) {
1700 1700
 								print '<td></td>';
1701 1701
 							} //StockEntrydate
1702
-							print '</tr>' . "\n"; // end line and start a new one for each warehouse
1702
+							print '</tr>'."\n"; // end line and start a new one for each warehouse
1703 1703
 
1704
-							print '<input name="idl' . $indiceAsked . '" type="hidden" value="' . $line->id . '">';
1704
+							print '<input name="idl'.$indiceAsked.'" type="hidden" value="'.$line->id.'">';
1705 1705
 							$subj = 0;
1706 1706
 							// Define nb of lines suggested for this order line
1707 1707
 							$nbofsuggested = 0;
@@ -1725,8 +1725,8 @@  discard block
 block discarded – undo
1725 1725
 									$deliverableQty = min($quantityToBeDelivered, $stock);
1726 1726
 									$deliverableQty = max(0, $deliverableQty);
1727 1727
 									// Quantity to send
1728
-									print '<!-- subj=' . $subj . '/' . $nbofsuggested . ' --><tr ' . ((($subj + 1) == $nbofsuggested) ? 'oddeven' : '') . '>';
1729
-									print '<td colspan="3" ></td><td class="center"><!-- qty to ship (no lot management for product line indiceAsked=' . $indiceAsked . ') -->';
1728
+									print '<!-- subj='.$subj.'/'.$nbofsuggested.' --><tr '.((($subj + 1) == $nbofsuggested) ? 'oddeven' : '').'>';
1729
+									print '<td colspan="3" ></td><td class="center"><!-- qty to ship (no lot management for product line indiceAsked='.$indiceAsked.') -->';
1730 1730
 									if ($line->product_type == Product::TYPE_PRODUCT || getDolGlobalString('STOCK_SUPPORTS_SERVICES') || getDolGlobalString('SHIPMENT_SUPPORTS_SERVICES')) {
1731 1731
 										if (isset($alreadyQtySetted[$line->fk_product][intval($warehouse_id)])) {
1732 1732
 											$deliverableQty = min($quantityToBeDelivered, $stock - $alreadyQtySetted[$line->fk_product][intval($warehouse_id)]);
@@ -1745,14 +1745,14 @@  discard block
 block discarded – undo
1745 1745
 										$tooltipClass = $tooltipTitle = '';
1746 1746
 										if (!empty($alreadyQtySetted[$line->fk_product][intval($warehouse_id)])) {
1747 1747
 											$tooltipClass = ' classfortooltip';
1748
-											$tooltipTitle = $langs->trans('StockQuantitiesAlreadyAllocatedOnPreviousLines') . ' : ' . $alreadyQtySetted[$line->fk_product][intval($warehouse_id)];
1748
+											$tooltipTitle = $langs->trans('StockQuantitiesAlreadyAllocatedOnPreviousLines').' : '.$alreadyQtySetted[$line->fk_product][intval($warehouse_id)];
1749 1749
 										} else {
1750 1750
 											$alreadyQtySetted[$line->fk_product][intval($warehouse_id)] = 0;
1751 1751
 										}
1752 1752
 
1753 1753
 										$alreadyQtySetted[$line->fk_product][intval($warehouse_id)] = $deliverableQty + $alreadyQtySetted[$line->fk_product][intval($warehouse_id)];
1754 1754
 
1755
-										$inputName = 'qtyl' . $indiceAsked . '_' . $subj;
1755
+										$inputName = 'qtyl'.$indiceAsked.'_'.$subj;
1756 1756
 										if (GETPOSTISSET($inputName)) {
1757 1757
 											$deliverableQty = GETPOSTINT($inputName);
1758 1758
 										}
@@ -1760,11 +1760,11 @@  discard block
 block discarded – undo
1760 1760
 										if (getDolGlobalBool('SHIPMENT_DONT_PREFILL_QTY', false)) {
1761 1761
 											$qtylValue = '';
1762 1762
 										}
1763
-										print '<input class="qtyl' . $tooltipClass . ' right" title="' . $tooltipTitle . '" name="qtyl' . $indiceAsked . '_' . $subj . '" id="qtyl' . $indiceAsked . '" type="text" size="4" value="' . $qtylValue . '">';
1764
-										print '<input name="ent1' . $indiceAsked . '_' . $subj . '" type="hidden" value="' . $warehouse_id . '">';
1763
+										print '<input class="qtyl'.$tooltipClass.' right" title="'.$tooltipTitle.'" name="qtyl'.$indiceAsked.'_'.$subj.'" id="qtyl'.$indiceAsked.'" type="text" size="4" value="'.$qtylValue.'">';
1764
+										print '<input name="ent1'.$indiceAsked.'_'.$subj.'" type="hidden" value="'.$warehouse_id.'">';
1765 1765
 									} else {
1766 1766
 										if (getDolGlobalString('SHIPMENT_GETS_ALL_ORDER_PRODUCTS')) {
1767
-											print '<input name="qtyl' . $indiceAsked . '_' . $subj . '" id="qtyl' . $indiceAsked . '" type="hidden" value="0">';
1767
+											print '<input name="qtyl'.$indiceAsked.'_'.$subj.'" id="qtyl'.$indiceAsked.'" type="hidden" value="0">';
1768 1768
 										}
1769 1769
 
1770 1770
 										print $langs->trans("NA");
@@ -1776,16 +1776,16 @@  discard block
 block discarded – undo
1776 1776
 										print '<td class="left">';
1777 1777
 										if ($line->product_type == Product::TYPE_PRODUCT || getDolGlobalString('STOCK_SUPPORTS_SERVICES')) {
1778 1778
 											if ($product->stockable_product == Product::ENABLED_STOCK || $productChildrenNb > 0) {
1779
-												print $tmpwarehouseObject->getNomUrl(0) . ' ';
1779
+												print $tmpwarehouseObject->getNomUrl(0).' ';
1780 1780
 												if ($productChildrenNb <= 0) {
1781 1781
 													print '<!-- Show details of stock -->';
1782
-													print '(' . $stock . ')';
1782
+													print '('.$stock.')';
1783 1783
 												}
1784 1784
 											} else {
1785
-												print img_warning() . ' ' . $langs->trans('StockDisabled');
1785
+												print img_warning().' '.$langs->trans('StockDisabled');
1786 1786
 											}
1787 1787
 										} else {
1788
-											print '<span class="opacitymedium">(' . $langs->trans("Service") . ')</span>';
1788
+											print '<span class="opacitymedium">('.$langs->trans("Service").')</span>';
1789 1789
 										}
1790 1790
 										print '</td>';
1791 1791
 									}
@@ -1813,9 +1813,9 @@  discard block
 block discarded – undo
1813 1813
 										}
1814 1814
 										print '<tr class"oddeven"><td>';
1815 1815
 										print "&nbsp; &nbsp; &nbsp; ->
1816
-										<a href=\"" . DOL_URL_ROOT . "/product/card.php?id=" . $value['id'] . "\">" . $value['fullpath'] . "
1817
-										</a> (" . $value['nb'] . ")</td><td class=\"center\"> " . $value['nb_total'] . "</td><td>&nbsp;</td><td>&nbsp;</td>
1818
-										<td class=\"center\">" . $value['stock'] . " " . $img . "</td>";
1816
+										<a href=\"" . DOL_URL_ROOT."/product/card.php?id=".$value['id']."\">".$value['fullpath']."
1817
+										</a> (" . $value['nb'].")</td><td class=\"center\"> ".$value['nb_total']."</td><td>&nbsp;</td><td>&nbsp;</td>
1818
+										<td class=\"center\">" . $value['stock']." ".$img."</td>";
1819 1819
 										if (getDolGlobalString('SHIPPING_DISPLAY_STOCK_ENTRY_DATE')) {
1820 1820
 											print '<td></td>';
1821 1821
 										} //StockEntrydate
@@ -1832,7 +1832,7 @@  discard block
 block discarded – undo
1832 1832
 							print '</tr>'; // end line and start a new one for lot/serial
1833 1833
 
1834 1834
 							$subj = 0;
1835
-							print '<input name="idl' . $indiceAsked . '" type="hidden" value="' . $line->id . '">';
1835
+							print '<input name="idl'.$indiceAsked.'" type="hidden" value="'.$line->id.'">';
1836 1836
 
1837 1837
 							$tmpwarehouseObject = new Entrepot($db);
1838 1838
 							$productlotObject = new Productlot($db);
@@ -1874,7 +1874,7 @@  discard block
 block discarded – undo
1874 1874
 											$deliverableQty = 0;
1875 1875
 										}
1876 1876
 
1877
-										$inputName = 'qtyl' . $indiceAsked . '_' . $subj;
1877
+										$inputName = 'qtyl'.$indiceAsked.'_'.$subj;
1878 1878
 										if (GETPOSTISSET($inputName)) {
1879 1879
 											$deliverableQty = GETPOSTINT($inputName);
1880 1880
 										}
@@ -1882,29 +1882,29 @@  discard block
 block discarded – undo
1882 1882
 										$tooltipClass = $tooltipTitle = '';
1883 1883
 										if (!empty($alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)])) {
1884 1884
 											$tooltipClass = ' classfortooltip';
1885
-											$tooltipTitle = $langs->trans('StockQuantitiesAlreadyAllocatedOnPreviousLines') . ' : ' . $alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)];
1885
+											$tooltipTitle = $langs->trans('StockQuantitiesAlreadyAllocatedOnPreviousLines').' : '.$alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)];
1886 1886
 										} else {
1887 1887
 											$alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)] = 0;
1888 1888
 										}
1889 1889
 										$alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)] = $deliverableQty + $alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)];
1890 1890
 
1891
-										print '<!-- subj=' . $subj . '/' . $nbofsuggested . ' --><tr ' . ((($subj + 1) == $nbofsuggested) ? 'oddeven' : '') . '><td colspan="3"></td><td class="center">';
1891
+										print '<!-- subj='.$subj.'/'.$nbofsuggested.' --><tr '.((($subj + 1) == $nbofsuggested) ? 'oddeven' : '').'><td colspan="3"></td><td class="center">';
1892 1892
 										$qtylValue = $deliverableQty;
1893 1893
 										if (getDolGlobalBool('SHIPMENT_DONT_PREFILL_QTY', false)) {
1894 1894
 											$qtylValue = '';
1895 1895
 										}
1896
-										print '<input class="qtyl right ' . $tooltipClass . '" title="' . $tooltipTitle . '" name="' . $inputName . '" id="' . $inputName . '" type="text" size="4" value="' . $qtylValue . '">';
1896
+										print '<input class="qtyl right '.$tooltipClass.'" title="'.$tooltipTitle.'" name="'.$inputName.'" id="'.$inputName.'" type="text" size="4" value="'.$qtylValue.'">';
1897 1897
 										print '</td>';
1898 1898
 
1899 1899
 										print '<td class="left">';
1900 1900
 
1901
-										print $tmpwarehouseObject->getNomUrl(0) . ' / ';
1901
+										print $tmpwarehouseObject->getNomUrl(0).' / ';
1902 1902
 
1903 1903
 										print '<!-- Show details of lot -->';
1904
-										print '<input name="batchl' . $indiceAsked . '_' . $subj . '" type="hidden" value="' . $dbatch->id . '">';
1904
+										print '<input name="batchl'.$indiceAsked.'_'.$subj.'" type="hidden" value="'.$dbatch->id.'">';
1905 1905
 
1906 1906
 										//print '|'.$line->fk_product.'|'.$dbatch->batch.'|<br>';
1907
-										print $langs->trans("Batch") . ': ';
1907
+										print $langs->trans("Batch").': ';
1908 1908
 										$result = $productlotObject->fetch(0, $line->fk_product, $dbatch->batch);
1909 1909
 										if ($result > 0) {
1910 1910
 											print $productlotObject->getNomUrl(1);
@@ -1912,12 +1912,12 @@  discard block
 block discarded – undo
1912 1912
 											print $langs->trans("TableLotIncompleteRunRepairWithParamStandardEqualConfirmed");
1913 1913
 										}
1914 1914
 										if (!getDolGlobalString('PRODUCT_DISABLE_SELLBY') && !empty($dbatch->sellby)) {
1915
-											print ' - ' . $langs->trans("SellByDate") . ': ' . dol_print_date($dbatch->sellby, "day");
1915
+											print ' - '.$langs->trans("SellByDate").': '.dol_print_date($dbatch->sellby, "day");
1916 1916
 										}
1917 1917
 										if (!getDolGlobalString('PRODUCT_DISABLE_EATBY') && !empty($dbatch->eatby)) {
1918
-											print ' - ' . $langs->trans("EatByDate") . ': ' . dol_print_date($dbatch->eatby, "day");
1918
+											print ' - '.$langs->trans("EatByDate").': '.dol_print_date($dbatch->eatby, "day");
1919 1919
 										}
1920
-										print ' (' . $dbatch->qty . ')';
1920
+										print ' ('.$dbatch->qty.')';
1921 1921
 										$quantityToBeDelivered -= $deliverableQty;
1922 1922
 										if ($quantityToBeDelivered < 0) {
1923 1923
 											$quantityToBeDelivered = 0;
@@ -1926,7 +1926,7 @@  discard block
 block discarded – undo
1926 1926
 										$subj++;
1927 1927
 										print '</td>';
1928 1928
 										if (getDolGlobalString('SHIPPING_DISPLAY_STOCK_ENTRY_DATE')) {
1929
-											print '<td class="left">' . dol_print_date($dbatch->context['stock_entry_date'], 'day') . '</td>';
1929
+											print '<td class="left">'.dol_print_date($dbatch->context['stock_entry_date'], 'day').'</td>';
1930 1930
 										}
1931 1931
 										print '</tr>';
1932 1932
 									}
@@ -1951,9 +1951,9 @@  discard block
 block discarded – undo
1951 1951
 								if ($product->stockable_product == Product::DISABLED_STOCK) {
1952 1952
 									$disabled = '';
1953 1953
 								}
1954
-								print '<input class="qtyl right" name="qtyl' . $indiceAsked . '_' . $subj . '" id="qtyl' . $indiceAsked . '_' . $subj . '" type="text" size="4" value="0"' . ($disabled ? ' ' . $disabled : '') . '> ';
1954
+								print '<input class="qtyl right" name="qtyl'.$indiceAsked.'_'.$subj.'" id="qtyl'.$indiceAsked.'_'.$subj.'" type="text" size="4" value="0"'.($disabled ? ' '.$disabled : '').'> ';
1955 1955
 								if (empty($disabled) && !getDolGlobalInt('STOCK_DISALLOW_NEGATIVE_TRANSFER')) {
1956
-									print '<input name="ent1' . $indiceAsked . '_' . $subj . '" type="hidden" value="' . $warehouse_selected_id . '">';
1956
+									print '<input name="ent1'.$indiceAsked.'_'.$subj.'" type="hidden" value="'.$warehouse_selected_id.'">';
1957 1957
 								}
1958 1958
 							} elseif ($line->product_type == Product::TYPE_SERVICE && getDolGlobalString('SHIPMENT_SUPPORTS_SERVICES')) {
1959 1959
 								$disabled = '';
@@ -1963,9 +1963,9 @@  discard block
 block discarded – undo
1963 1963
 								if ($warehouse_selected_id <= 0) {		// We did not force a given warehouse, so we won't have no warehouse to change qty.
1964 1964
 									$disabled = 'disabled="disabled"';
1965 1965
 								}
1966
-								print '<input class="qtyl right" name="qtyl' . $indiceAsked . '_' . $subj . '" id="qtyl' . $indiceAsked . '_' . $subj . '" type="text" size="4" value="' . $quantityToBeDelivered . '"' . ($disabled ? ' ' . $disabled : '') . '> ';
1966
+								print '<input class="qtyl right" name="qtyl'.$indiceAsked.'_'.$subj.'" id="qtyl'.$indiceAsked.'_'.$subj.'" type="text" size="4" value="'.$quantityToBeDelivered.'"'.($disabled ? ' '.$disabled : '').'> ';
1967 1967
 								if (empty($disabled) && !getDolGlobalInt('STOCK_DISALLOW_NEGATIVE_TRANSFER')) {
1968
-									print '<input name="ent1' . $indiceAsked . '_' . $subj . '" type="hidden" value="' . $warehouse_selected_id . '">';
1968
+									print '<input name="ent1'.$indiceAsked.'_'.$subj.'" type="hidden" value="'.$warehouse_selected_id.'">';
1969 1969
 								}
1970 1970
 							} else {
1971 1971
 								print $langs->trans("NA");
@@ -1977,20 +1977,20 @@  discard block
 block discarded – undo
1977 1977
 								if ($warehouse_selected_id > 0) {
1978 1978
 									$warehouseObject = new Entrepot($db);
1979 1979
 									$warehouseObject->fetch($warehouse_selected_id);
1980
-									print img_warning() . ' ' . $langs->trans("NoProductToShipFoundIntoStock", $warehouseObject->label);
1980
+									print img_warning().' '.$langs->trans("NoProductToShipFoundIntoStock", $warehouseObject->label);
1981 1981
 								} else {
1982 1982
 									if ($line->fk_product) {
1983 1983
 										if ($product->stockable_product == Product::ENABLED_STOCK) {
1984
-											print img_warning() . ' ' . $langs->trans('StockTooLow');
1984
+											print img_warning().' '.$langs->trans('StockTooLow');
1985 1985
 										} else {
1986
-											print img_warning() . ' ' . $langs->trans('StockDisabled');
1986
+											print img_warning().' '.$langs->trans('StockDisabled');
1987 1987
 										}
1988 1988
 									} else {
1989 1989
 										print '';
1990 1990
 									}
1991 1991
 								}
1992 1992
 							} else {
1993
-								print '<span class="opacitymedium">(' . $langs->trans("Service") . ')</span>';
1993
+								print '<span class="opacitymedium">('.$langs->trans("Service").')</span>';
1994 1994
 							}
1995 1995
 							print '</td>';
1996 1996
 							if (getDolGlobalString('SHIPPING_DISPLAY_STOCK_ENTRY_DATE')) {
@@ -2037,7 +2037,7 @@  discard block
 block discarded – undo
2037 2037
 		}
2038 2038
 	}
2039 2039
 } elseif ($object->id > 0) {
2040
-	'@phan-var-force Expedition $object';  // Need to force it (type overridden earlier)
2040
+	'@phan-var-force Expedition $object'; // Need to force it (type overridden earlier)
2041 2041
 
2042 2042
 	// Edit and view mode
2043 2043
 
@@ -2077,7 +2077,7 @@  discard block
 block discarded – undo
2077 2077
 			);
2078 2078
 		}
2079 2079
 		$formconfirm = $form->formconfirm(
2080
-			$_SERVER['PHP_SELF'] . '?id=' . $object->id,
2080
+			$_SERVER['PHP_SELF'].'?id='.$object->id,
2081 2081
 			$langs->trans('DeleteSending'),
2082 2082
 			$langs->trans("ConfirmDeleteSending", $object->ref),
2083 2083
 			'confirm_delete',
@@ -2098,7 +2098,7 @@  discard block
 block discarded – undo
2098 2098
 			$title = "DeleteTitleLine";
2099 2099
 			$question = "ConfirmDeleteTitleLine";
2100 2100
 		}
2101
-		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&lineid=' . $lineid, $langs->trans($title), $langs->trans($question), 'confirm_delete_subtotalline', $formconfirm, 'no', 1);
2101
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans($title), $langs->trans($question), 'confirm_delete_subtotalline', $formconfirm, 'no', 1);
2102 2102
 	}
2103 2103
 
2104 2104
 	// Confirm validation
@@ -2112,13 +2112,13 @@  discard block
 block discarded – undo
2112 2112
 
2113 2113
 		$text = $langs->trans("ConfirmValidateSending", $numref);
2114 2114
 		if (getDolGlobalString('STOCK_CALCULATE_ON_SHIPMENT')) {
2115
-			$text .= '<br>' . img_picto('', 'movement', 'class="pictofixedwidth"') . $langs->trans("StockMovementWillBeRecorded") . '.';
2115
+			$text .= '<br>'.img_picto('', 'movement', 'class="pictofixedwidth"').$langs->trans("StockMovementWillBeRecorded").'.';
2116 2116
 		} elseif (getDolGlobalString('STOCK_CALCULATE_ON_SHIPMENT_CLOSE')) {
2117
-			$text .= '<br>' . img_picto('', 'movement', 'class="pictofixedwidth"') . $langs->trans("StockMovementNotYetRecorded") . '.';
2117
+			$text .= '<br>'.img_picto('', 'movement', 'class="pictofixedwidth"').$langs->trans("StockMovementNotYetRecorded").'.';
2118 2118
 		}
2119 2119
 
2120 2120
 		if (isModEnabled('notification')) {
2121
-			require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php';
2121
+			require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php';
2122 2122
 			$notify = new Notify($db);
2123 2123
 			$text .= '<br>';
2124 2124
 			$text .= $notify->confirmMessage('SHIPPING_VALIDATE', $object->socid, $object);
@@ -2129,14 +2129,14 @@  discard block
 block discarded – undo
2129 2129
 
2130 2130
 	// Confirm cancellation
2131 2131
 	if ($action == 'cancel') {
2132
-		$formconfirm = $form->formconfirm($_SERVER['PHP_SELF'] . '?id=' . $object->id, $langs->trans('CancelSending'), $langs->trans("ConfirmCancelSending", $object->ref), 'confirm_cancel', '', 0, 1);
2132
+		$formconfirm = $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id, $langs->trans('CancelSending'), $langs->trans("ConfirmCancelSending", $object->ref), 'confirm_cancel', '', 0, 1);
2133 2133
 	}
2134 2134
 
2135 2135
 	// Confirm sign
2136 2136
 	if ($action == 'sign') {
2137 2137
 		$text = $langs->trans('ConfirmSignShipping');
2138 2138
 		if (isModEnabled('notification')) {
2139
-			require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php';
2139
+			require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php';
2140 2140
 			$notify = new Notify($db);
2141 2141
 			$text .= '<br>';
2142 2142
 			$text .= $notify->confirmMessage('SHIPPING_MODIFY', $object->socid, $object);
@@ -2146,22 +2146,22 @@  discard block
 block discarded – undo
2146 2146
 			'type' 		=> 'select',
2147 2147
 			'name' 		=> 'signed_status',
2148 2148
 			'select_show_empty' => 0,
2149
-			'label'		=> '<span class="fieldrequired">' . $langs->trans('SignStatus') . '</span>',
2149
+			'label'		=> '<span class="fieldrequired">'.$langs->trans('SignStatus').'</span>',
2150 2150
 			'values'	=> $object->getSignedStatusLocalisedArray()
2151 2151
 		];
2152
-		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('SignShipping'), $text, 'confirm_sign', $formquestion, 0, 1);
2152
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('SignShipping'), $text, 'confirm_sign', $formquestion, 0, 1);
2153 2153
 	}
2154 2154
 
2155 2155
 	// Confirm unsign
2156 2156
 	if ($action == 'unsign') {
2157 2157
 		$text = $langs->trans('ConfirmUnsignShipping');
2158 2158
 		if (isModEnabled('notification')) {
2159
-			require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php';
2159
+			require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php';
2160 2160
 			$notify = new Notify($db);
2161 2161
 			$text .= '<br>';
2162 2162
 			$text .= $notify->confirmMessage('SHIPPING_MODIFY', $object->socid, $object);
2163 2163
 		}
2164
-		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('UnsignShipping'), $text, 'confirm_unsign', '', 0, 1);
2164
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('UnsignShipping'), $text, 'confirm_unsign', '', 0, 1);
2165 2165
 	}
2166 2166
 
2167 2167
 	// Call Hook formConfirm
@@ -2192,13 +2192,13 @@  discard block
 block discarded – undo
2192 2192
 	}
2193 2193
 
2194 2194
 	// Shipment card
2195
-	$linkback = '<a href="' . DOL_URL_ROOT . '/expedition/list.php?restore_lastsearch_values=1' . (!empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
2195
+	$linkback = '<a href="'.DOL_URL_ROOT.'/expedition/list.php?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
2196 2196
 	$morehtmlref = '<div class="refidno">';
2197 2197
 	// Ref customer shipment
2198 2198
 	$morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_customer', $object->ref_customer, $object, $user->hasRight('expedition', 'creer'), 'string', '', 0, 1);
2199
-	$morehtmlref .= $form->editfieldval("RefCustomer", 'ref_customer', $object->ref_customer, $object, $user->hasRight('expedition', 'creer'), 'string' . (isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':' . getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1);
2199
+	$morehtmlref .= $form->editfieldval("RefCustomer", 'ref_customer', $object->ref_customer, $object, $user->hasRight('expedition', 'creer'), 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':'.getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1);
2200 2200
 	// Thirdparty
2201
-	$morehtmlref .= '<br>' . $object->thirdparty->getNomUrl(1);
2201
+	$morehtmlref .= '<br>'.$object->thirdparty->getNomUrl(1);
2202 2202
 	// Project
2203 2203
 	if (isModEnabled('project')) {
2204 2204
 		$langs->load("projects");
@@ -2206,16 +2206,16 @@  discard block
 block discarded – undo
2206 2206
 		if (0) {	// @phpstan-ignore-line  Do not change on shipment
2207 2207
 			$morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"');
2208 2208
 			if ($action != 'classify') {
2209
-				$morehtmlref .= '<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> ';
2209
+				$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> ';
2210 2210
 			}
2211
-			$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $objectsrc->socid, (string) $objectsrc->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300');
2211
+			$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $objectsrc->socid, (string) $objectsrc->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300');
2212 2212
 		} else {
2213 2213
 			if (!empty($objectsrc) && !empty($objectsrc->fk_project)) {
2214 2214
 				$proj = new Project($db);
2215 2215
 				$proj->fetch($objectsrc->fk_project);
2216 2216
 				$morehtmlref .= $proj->getNomUrl(1);
2217 2217
 				if ($proj->title) {
2218
-					$morehtmlref .= '<span class="opacitymedium"> - ' . dol_escape_htmltag($proj->title) . '</span>';
2218
+					$morehtmlref .= '<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).'</span>';
2219 2219
 				}
2220 2220
 			}
2221 2221
 		}
@@ -2235,7 +2235,7 @@  discard block
 block discarded – undo
2235 2235
 	// Linked documents
2236 2236
 	if (!empty($typeobject) && $typeobject == 'commande' && $object->origin_object->id && isModEnabled('order')) {
2237 2237
 		print '<tr><td>';
2238
-		print $langs->trans("RefOrder") . '</td>';
2238
+		print $langs->trans("RefOrder").'</td>';
2239 2239
 		print '<td>';
2240 2240
 		print $objectsrc->getNomUrl(1, 'commande');
2241 2241
 		print "</td>\n";
@@ -2243,7 +2243,7 @@  discard block
 block discarded – undo
2243 2243
 	}
2244 2244
 	if (!empty($typeobject) && $typeobject == 'propal' && $object->origin_object->id && isModEnabled("propal")) {
2245 2245
 		print '<tr><td>';
2246
-		print $langs->trans("RefProposal") . '</td>';
2246
+		print $langs->trans("RefProposal").'</td>';
2247 2247
 		print '<td>';
2248 2248
 		print $objectsrc->getNomUrl(1, 'expedition');
2249 2249
 		print "</td>\n";
@@ -2251,8 +2251,8 @@  discard block
 block discarded – undo
2251 2251
 	}
2252 2252
 
2253 2253
 	// Date creation
2254
-	print '<tr><td class="titlefieldmiddle">' . $langs->trans("DateCreation") . '</td>';
2255
-	print '<td>' . dol_print_date($object->date_creation, "dayhour") . "</td>\n";
2254
+	print '<tr><td class="titlefieldmiddle">'.$langs->trans("DateCreation").'</td>';
2255
+	print '<td>'.dol_print_date($object->date_creation, "dayhour")."</td>\n";
2256 2256
 	print '</tr>';
2257 2257
 
2258 2258
 	// Delivery date planned
@@ -2261,16 +2261,16 @@  discard block
 block discarded – undo
2261 2261
 	print $langs->trans('DateDeliveryPlanned');
2262 2262
 	print '</td>';
2263 2263
 	if ($action != 'editdate_livraison') {
2264
-		print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editdate_livraison&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->trans('SetDeliveryDate'), 1) . '</a></td>';
2264
+		print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editdate_livraison&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->trans('SetDeliveryDate'), 1).'</a></td>';
2265 2265
 	}
2266 2266
 	print '</tr></table>';
2267 2267
 	print '</td><td>';
2268 2268
 	if ($action == 'editdate_livraison') {
2269
-		print '<form name="setdate_livraison" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '" method="post">';
2270
-		print '<input type="hidden" name="token" value="' . newToken() . '">';
2269
+		print '<form name="setdate_livraison" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
2270
+		print '<input type="hidden" name="token" value="'.newToken().'">';
2271 2271
 		print '<input type="hidden" name="action" value="setdate_livraison">';
2272 2272
 		print $form->selectDate($object->date_delivery ? $object->date_delivery : -1, 'liv_', 1, 1, 0, "setdate_livraison", 1, 0);
2273
-		print '<input type="submit" class="button button-edit smallpaddingimp" value="' . $langs->trans('Modify') . '">';
2273
+		print '<input type="submit" class="button button-edit smallpaddingimp" value="'.$langs->trans('Modify').'">';
2274 2274
 		print '</form>';
2275 2275
 	} else {
2276 2276
 		print $object->date_delivery ? dol_print_date($object->date_delivery, 'dayhour') : '&nbsp;';
@@ -2284,16 +2284,16 @@  discard block
 block discarded – undo
2284 2284
 	print $langs->trans('DateShipping');
2285 2285
 	print '</td>';
2286 2286
 	if ($action != 'editdate_shipping') {
2287
-		print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editdate_shipping&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->trans('SetShippingDate'), 1) . '</a></td>';
2287
+		print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editdate_shipping&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->trans('SetShippingDate'), 1).'</a></td>';
2288 2288
 	}
2289 2289
 	print '</tr></table>';
2290 2290
 	print '</td><td>';
2291 2291
 	if ($action == 'editdate_shipping') {
2292
-		print '<form name="setdate_shipping" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '" method="post">';
2293
-		print '<input type="hidden" name="token" value="' . newToken() . '">';
2292
+		print '<form name="setdate_shipping" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
2293
+		print '<input type="hidden" name="token" value="'.newToken().'">';
2294 2294
 		print '<input type="hidden" name="action" value="setdate_shipping">';
2295 2295
 		print $form->selectDate($object->date_shipping ? $object->date_shipping : -1, 'ship_', 1, 1, 0, "setdate_shipping", 1, 0);
2296
-		print '<input type="submit" class="button button-edit smallpaddingimp" value="' . $langs->trans('Modify') . '">';
2296
+		print '<input type="submit" class="button button-edit smallpaddingimp" value="'.$langs->trans('Modify').'">';
2297 2297
 		print '</form>';
2298 2298
 	} else {
2299 2299
 		print $object->date_shipping ? dol_print_date($object->date_shipping, 'dayhour') : '&nbsp;';
@@ -2307,24 +2307,24 @@  discard block
 block discarded – undo
2307 2307
 	print '</td><td>';
2308 2308
 
2309 2309
 	if ($action == 'edittrueWeight') {
2310
-		print '<form name="settrueweight" action="' . $_SERVER["PHP_SELF"] . '" method="post">';
2310
+		print '<form name="settrueweight" action="'.$_SERVER["PHP_SELF"].'" method="post">';
2311 2311
 		print '<input name="action" value="settrueWeight" type="hidden">';
2312
-		print '<input name="id" value="' . $object->id . '" type="hidden">';
2313
-		print '<input type="hidden" name="token" value="' . newToken() . '">';
2314
-		print '<input id="trueWeight" name="trueWeight" value="' . $object->trueWeight . '" type="text" class="width50 valignmiddle">';
2312
+		print '<input name="id" value="'.$object->id.'" type="hidden">';
2313
+		print '<input type="hidden" name="token" value="'.newToken().'">';
2314
+		print '<input id="trueWeight" name="trueWeight" value="'.$object->trueWeight.'" type="text" class="width50 valignmiddle">';
2315 2315
 		print $formproduct->selectMeasuringUnits("weight_units", "weight", (string) $object->weight_units, 0, 2, 'maxwidth125 valignmiddle');
2316
-		print ' <input class="button smallpaddingimp valignmiddle" name="modify" value="' . $langs->trans("Modify") . '" type="submit">';
2317
-		print ' <input class="button button-cancel smallpaddingimp valignmiddle" name="cancel" value="' . $langs->trans("Cancel") . '" type="submit">';
2316
+		print ' <input class="button smallpaddingimp valignmiddle" name="modify" value="'.$langs->trans("Modify").'" type="submit">';
2317
+		print ' <input class="button button-cancel smallpaddingimp valignmiddle" name="cancel" value="'.$langs->trans("Cancel").'" type="submit">';
2318 2318
 		print '</form>';
2319 2319
 	} else {
2320 2320
 		print $object->trueWeight;
2321
-		print ($object->trueWeight && $object->weight_units != '') ? ' ' . measuringUnitString(0, "weight", $object->weight_units) : '';
2321
+		print ($object->trueWeight && $object->weight_units != '') ? ' '.measuringUnitString(0, "weight", $object->weight_units) : '';
2322 2322
 	}
2323 2323
 
2324 2324
 	// Calculated
2325 2325
 	if ($totalWeight > 0) {
2326 2326
 		if (!empty($object->trueWeight)) {
2327
-			print ' (' . $langs->trans("SumOfProductWeights") . ': ';
2327
+			print ' ('.$langs->trans("SumOfProductWeights").': ';
2328 2328
 		}
2329 2329
 		print showDimensionInBestUnit($totalWeight, 0, "weight", $langs, getDolGlobalInt('MAIN_WEIGHT_DEFAULT_ROUND', -1), isset($conf->global->MAIN_WEIGHT_DEFAULT_UNIT) ? $conf->global->MAIN_WEIGHT_DEFAULT_UNIT : 'no');
2330 2330
 		if (!empty($object->trueWeight)) {
@@ -2334,34 +2334,34 @@  discard block
 block discarded – undo
2334 2334
 	print '</td></tr>';
2335 2335
 
2336 2336
 	// Width
2337
-	print '<tr><td>' . $form->editfieldkey("Width", 'trueWidth', $object->trueWidth, $object, $user->hasRight('expedition', 'creer')) . '</td><td>';
2337
+	print '<tr><td>'.$form->editfieldkey("Width", 'trueWidth', $object->trueWidth, $object, $user->hasRight('expedition', 'creer')).'</td><td>';
2338 2338
 	print $form->editfieldval("Width", 'trueWidth', $object->trueWidth, $object, $user->hasRight('expedition', 'creer'));
2339
-	print ($object->trueWidth && $object->width_units != '') ? ' ' . measuringUnitString(0, "size", $object->width_units) : '';
2339
+	print ($object->trueWidth && $object->width_units != '') ? ' '.measuringUnitString(0, "size", $object->width_units) : '';
2340 2340
 	print '</td></tr>';
2341 2341
 
2342 2342
 	// Height
2343
-	print '<tr><td>' . $form->editfieldkey("Height", 'trueHeight', $object->trueHeight, $object, $user->hasRight('expedition', 'creer')) . '</td><td>';
2343
+	print '<tr><td>'.$form->editfieldkey("Height", 'trueHeight', $object->trueHeight, $object, $user->hasRight('expedition', 'creer')).'</td><td>';
2344 2344
 	if ($action == 'edittrueHeight') {
2345
-		print '<form name="settrueHeight" action="' . $_SERVER["PHP_SELF"] . '" method="post">';
2345
+		print '<form name="settrueHeight" action="'.$_SERVER["PHP_SELF"].'" method="post">';
2346 2346
 		print '<input name="action" value="settrueHeight" type="hidden">';
2347
-		print '<input name="id" value="' . $object->id . '" type="hidden">';
2348
-		print '<input type="hidden" name="token" value="' . newToken() . '">';
2349
-		print '<input id="trueHeight" name="trueHeight" value="' . $object->trueHeight . '" type="text" class="width50">';
2347
+		print '<input name="id" value="'.$object->id.'" type="hidden">';
2348
+		print '<input type="hidden" name="token" value="'.newToken().'">';
2349
+		print '<input id="trueHeight" name="trueHeight" value="'.$object->trueHeight.'" type="text" class="width50">';
2350 2350
 		print $formproduct->selectMeasuringUnits("size_units", "size", $object->size_units, 0, 2);
2351
-		print ' <input class="button smallpaddingimp" name="modify" value="' . $langs->trans("Modify") . '" type="submit">';
2352
-		print ' <input class="button button-cancel smallpaddingimp" name="cancel" value="' . $langs->trans("Cancel") . '" type="submit">';
2351
+		print ' <input class="button smallpaddingimp" name="modify" value="'.$langs->trans("Modify").'" type="submit">';
2352
+		print ' <input class="button button-cancel smallpaddingimp" name="cancel" value="'.$langs->trans("Cancel").'" type="submit">';
2353 2353
 		print '</form>';
2354 2354
 	} else {
2355 2355
 		print $object->trueHeight;
2356
-		print ($object->trueHeight && $object->height_units != '') ? ' ' . measuringUnitString(0, "size", $object->height_units) : '';
2356
+		print ($object->trueHeight && $object->height_units != '') ? ' '.measuringUnitString(0, "size", $object->height_units) : '';
2357 2357
 	}
2358 2358
 
2359 2359
 	print '</td></tr>';
2360 2360
 
2361 2361
 	// Depth
2362
-	print '<tr><td>' . $form->editfieldkey("Depth", 'trueDepth', $object->trueDepth, $object, $user->hasRight('expedition', 'creer')) . '</td><td>';
2362
+	print '<tr><td>'.$form->editfieldkey("Depth", 'trueDepth', $object->trueDepth, $object, $user->hasRight('expedition', 'creer')).'</td><td>';
2363 2363
 	print $form->editfieldval("Depth", 'trueDepth', $object->trueDepth, $object, $user->hasRight('expedition', 'creer'));
2364
-	print ($object->trueDepth && $object->depth_units != '') ? ' ' . measuringUnitString(0, "size", $object->depth_units) : '';
2364
+	print ($object->trueDepth && $object->depth_units != '') ? ' '.measuringUnitString(0, "size", $object->depth_units) : '';
2365 2365
 	print '</td></tr>';
2366 2366
 
2367 2367
 	// Volume
@@ -2380,12 +2380,12 @@  discard block
 block discarded – undo
2380 2380
 		if ($volumeUnit < 50) {
2381 2381
 			print showDimensionInBestUnit($calculatedVolume, $volumeUnit, "volume", $langs, getDolGlobalInt('MAIN_VOLUME_DEFAULT_ROUND', -1), getDolGlobalString('MAIN_VOLUME_DEFAULT_UNIT', 'no'));
2382 2382
 		} else {
2383
-			print $calculatedVolume . ' ' . measuringUnitString(0, "volume", $volumeUnit);
2383
+			print $calculatedVolume.' '.measuringUnitString(0, "volume", $volumeUnit);
2384 2384
 		}
2385 2385
 	}
2386 2386
 	if ($totalVolume > 0) {
2387 2387
 		if ($calculatedVolume) {
2388
-			print ' (' . $langs->trans("SumOfProductVolumes") . ': ';
2388
+			print ' ('.$langs->trans("SumOfProductVolumes").': ';
2389 2389
 		}
2390 2390
 		print showDimensionInBestUnit($totalVolume, 0, "volume", $langs, getDolGlobalInt('MAIN_VOLUME_DEFAULT_ROUND', -1), getDolGlobalString('MAIN_VOLUME_DEFAULT_UNIT', 'no'));
2391 2391
 		//if (empty($calculatedVolume)) print ' ('.$langs->trans("Calculated").')';
@@ -2398,7 +2398,7 @@  discard block
 block discarded – undo
2398 2398
 
2399 2399
 	// Other attributes
2400 2400
 	//$cols = 2;
2401
-	include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
2401
+	include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
2402 2402
 
2403 2403
 	print '</table>';
2404 2404
 
@@ -2415,33 +2415,33 @@  discard block
 block discarded – undo
2415 2415
 	print '</td>';
2416 2416
 
2417 2417
 	if ($action != 'editshipping_method_id' && $permissiontoadd) {
2418
-		print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editshipping_method_id&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->trans('SetSendingMethod'), 1) . '</a></td>';
2418
+		print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editshipping_method_id&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->trans('SetSendingMethod'), 1).'</a></td>';
2419 2419
 	}
2420 2420
 	print '</tr></table>';
2421 2421
 	print '</td><td>';
2422 2422
 	if ($action == 'editshipping_method_id') {
2423
-		print '<form name="setshipping_method_id" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '" method="post">';
2424
-		print '<input type="hidden" name="token" value="' . newToken() . '">';
2423
+		print '<form name="setshipping_method_id" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
2424
+		print '<input type="hidden" name="token" value="'.newToken().'">';
2425 2425
 		print '<input type="hidden" name="action" value="setshipping_method_id">';
2426 2426
 		$object->fetch_delivery_methods();
2427 2427
 		print $form->selectarray("shipping_method_id", $object->meths, $object->shipping_method_id, 1, 0, 0, "", 1);
2428 2428
 		if ($user->admin) {
2429 2429
 			print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
2430 2430
 		}
2431
-		print '<input type="submit" class="button button-edit smallpaddingimp" value="' . $langs->trans('Modify') . '">';
2431
+		print '<input type="submit" class="button button-edit smallpaddingimp" value="'.$langs->trans('Modify').'">';
2432 2432
 		print '</form>';
2433 2433
 	} else {
2434 2434
 		if ($object->shipping_method_id > 0) {
2435 2435
 			// Get code using getLabelFromKey
2436 2436
 			$code = $langs->getLabelFromKey($db, (string) $object->shipping_method_id, 'c_shipment_mode', 'rowid', 'code');
2437
-			print $langs->trans("SendingMethod" . strtoupper($code));
2437
+			print $langs->trans("SendingMethod".strtoupper($code));
2438 2438
 		}
2439 2439
 	}
2440 2440
 	print '</td>';
2441 2441
 	print '</tr>';
2442 2442
 
2443 2443
 	// Tracking Number
2444
-	print '<tr><td class="titlefieldmiddle">' . $form->editfieldkey("TrackingNumber", 'tracking_number', $object->tracking_number, $object, $user->hasRight('expedition', 'creer')) . '</td><td>';
2444
+	print '<tr><td class="titlefieldmiddle">'.$form->editfieldkey("TrackingNumber", 'tracking_number', $object->tracking_number, $object, $user->hasRight('expedition', 'creer')).'</td><td>';
2445 2445
 	print $form->editfieldval("TrackingNumber", 'tracking_number', $object->tracking_url, $object, $user->hasRight('expedition', 'creer'), 'safehtmlstring', $object->tracking_number);
2446 2446
 	print '</td></tr>';
2447 2447
 
@@ -2452,7 +2452,7 @@  discard block
 block discarded – undo
2452 2452
 		print $langs->trans('IncotermLabel');
2453 2453
 		print '<td><td class="right">';
2454 2454
 		if ($permissiontoadd) {
2455
-			print '<a class="editfielda" href="' . DOL_URL_ROOT . '/expedition/card.php?id=' . $object->id . '&action=editincoterm&token=' . newToken() . '">' . img_edit() . '</a>';
2455
+			print '<a class="editfielda" href="'.DOL_URL_ROOT.'/expedition/card.php?id='.$object->id.'&action=editincoterm&token='.newToken().'">'.img_edit().'</a>';
2456 2456
 		} else {
2457 2457
 			print '&nbsp;';
2458 2458
 		}
@@ -2462,7 +2462,7 @@  discard block
 block discarded – undo
2462 2462
 		if ($action != 'editincoterm') {
2463 2463
 			print $form->textwithpicto($object->display_incoterms(), $object->label_incoterms, 1);
2464 2464
 		} else {
2465
-			print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms) ? $object->location_incoterms : ''), $_SERVER['PHP_SELF'] . '?id=' . $object->id);
2465
+			print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms) ? $object->location_incoterms : ''), $_SERVER['PHP_SELF'].'?id='.$object->id);
2466 2466
 		}
2467 2467
 		print '</td></tr>';
2468 2468
 	}
@@ -2483,11 +2483,11 @@  discard block
 block discarded – undo
2483 2483
 	// Lines of products
2484 2484
 
2485 2485
 	if ($action == 'editline') {
2486
-		print '	<form name="updateline" id="updateline" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&amp;lineid=' . $line_id . '" method="POST">
2487
-		<input type="hidden" name="token" value="' . newToken() . '">
2486
+		print '	<form name="updateline" id="updateline" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;lineid='.$line_id.'" method="POST">
2487
+		<input type="hidden" name="token" value="' . newToken().'">
2488 2488
 		<input type="hidden" name="action" value="updateline">
2489 2489
 		<input type="hidden" name="mode" value="">
2490
-		<input type="hidden" name="id" value="' . $object->id . '">
2490
+		<input type="hidden" name="id" value="' . $object->id.'">
2491 2491
 		';
2492 2492
 	}
2493 2493
 	print '<br>';
@@ -2501,11 +2501,11 @@  discard block
 block discarded – undo
2501 2501
 		print '<td width="5" class="center linecolnum">&nbsp;</td>';
2502 2502
 	}
2503 2503
 	// Product/Service
2504
-	print '<td  class="linecoldescription" >' . $langs->trans("Products") . '</td>';
2504
+	print '<td  class="linecoldescription" >'.$langs->trans("Products").'</td>';
2505 2505
 	// Qty
2506
-	print '<td class="center linecolqty">' . $langs->trans("QtyOrdered") . '</td>';
2506
+	print '<td class="center linecolqty">'.$langs->trans("QtyOrdered").'</td>';
2507 2507
 	if ($origin && $origin_id > 0) {
2508
-		print '<td class="center linecolqtyinothershipments">' . $langs->trans("QtyInOtherShipments") . '</td>';
2508
+		print '<td class="center linecolqtyinothershipments">'.$langs->trans("QtyInOtherShipments").'</td>';
2509 2509
 	}
2510 2510
 	if ($action == 'editline') {
2511 2511
 		$editColspan = 3;
@@ -2515,35 +2515,35 @@  discard block
 block discarded – undo
2515 2515
 		if (empty($conf->productbatch->enabled)) {
2516 2516
 			$editColspan--;
2517 2517
 		}
2518
-		print '<td class="center linecoleditlineotherinfo" colspan="' . $editColspan . '">';
2518
+		print '<td class="center linecoleditlineotherinfo" colspan="'.$editColspan.'">';
2519 2519
 		if ($object->status <= 1) {
2520 2520
 			print $langs->trans("QtyToShip");
2521 2521
 		} else {
2522 2522
 			print $langs->trans("QtyShipped");
2523 2523
 		}
2524 2524
 		if (isModEnabled('stock')) {
2525
-			print ' - ' . $langs->trans("WarehouseSource");
2525
+			print ' - '.$langs->trans("WarehouseSource");
2526 2526
 		}
2527 2527
 		if (isModEnabled('productbatch')) {
2528
-			print ' - ' . $langs->trans("Batch");
2528
+			print ' - '.$langs->trans("Batch");
2529 2529
 		}
2530 2530
 		print '</td>';
2531 2531
 	} else {
2532 2532
 		if ($object->status <= 1) {
2533
-			print '<td class="center linecolqtytoship">' . $langs->trans("QtyToShip") . '</td>';
2533
+			print '<td class="center linecolqtytoship">'.$langs->trans("QtyToShip").'</td>';
2534 2534
 		} else {
2535
-			print '<td class="center linecolqtyshipped">' . $langs->trans("QtyShipped") . '</td>';
2535
+			print '<td class="center linecolqtyshipped">'.$langs->trans("QtyShipped").'</td>';
2536 2536
 		}
2537 2537
 		if (isModEnabled('stock')) {
2538
-			print '<td class="left linecolwarehousesource">' . $langs->trans("WarehouseSource") . '</td>';
2538
+			print '<td class="left linecolwarehousesource">'.$langs->trans("WarehouseSource").'</td>';
2539 2539
 		}
2540 2540
 
2541 2541
 		if (isModEnabled('productbatch')) {
2542
-			print '<td class="left linecolbatch">' . $langs->trans("Batch") . '</td>';
2542
+			print '<td class="left linecolbatch">'.$langs->trans("Batch").'</td>';
2543 2543
 		}
2544 2544
 	}
2545
-	print '<td class="center linecolweight">' . $langs->trans("CalculatedWeight") . '</td>';
2546
-	print '<td class="center linecolvolume">' . $langs->trans("CalculatedVolume") . '</td>';
2545
+	print '<td class="center linecolweight">'.$langs->trans("CalculatedWeight").'</td>';
2546
+	print '<td class="center linecolvolume">'.$langs->trans("CalculatedVolume").'</td>';
2547 2547
 	//print '<td class="center">'.$langs->trans("Size").'</td>';
2548 2548
 	if ($object->status == 0) {
2549 2549
 		print '<td class="linecoledit"></td>';
@@ -2578,13 +2578,13 @@  discard block
 block discarded – undo
2578 2578
 		//if (getDolGlobalInt('MAIN_SUBMODULE_DELIVERY')) $sql .= ", l.rowid as livraison_id, l.ref as livraison_ref, l.date_delivery, ld.qty as qty_received";
2579 2579
 		$sql .= ', p.label as product_label, p.ref, p.fk_product_type, p.rowid as prodid, p.tosell as product_tosell, p.tobuy as product_tobuy, p.tobatch as product_tobatch';
2580 2580
 		$sql .= ', p.description as product_desc';
2581
-		$sql .= " FROM " . MAIN_DB_PREFIX . "expeditiondet as ed";
2582
-		$sql .= ", " . MAIN_DB_PREFIX . "expedition as e";
2583
-		$sql .= ", " . MAIN_DB_PREFIX . $origin . "det as obj";
2581
+		$sql .= " FROM ".MAIN_DB_PREFIX."expeditiondet as ed";
2582
+		$sql .= ", ".MAIN_DB_PREFIX."expedition as e";
2583
+		$sql .= ", ".MAIN_DB_PREFIX.$origin."det as obj";
2584 2584
 		//if (getDolGlobalInt('MAIN_SUBMODULE_DELIVERY')) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."delivery as l ON l.fk_expedition = e.rowid LEFT JOIN ".MAIN_DB_PREFIX."deliverydet as ld ON ld.fk_delivery = l.rowid  AND obj.rowid = ld.fk_origin_line";
2585
-		$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON obj.fk_product = p.rowid";
2586
-		$sql .= " WHERE e.entity IN (" . getEntity('expedition') . ")";
2587
-		$sql .= " AND obj.fk_" . $origin . " = " . ((int) $origin_id);
2585
+		$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON obj.fk_product = p.rowid";
2586
+		$sql .= " WHERE e.entity IN (".getEntity('expedition').")";
2587
+		$sql .= " AND obj.fk_".$origin." = ".((int) $origin_id);
2588 2588
 		$sql .= " AND obj.rowid = ed.fk_elementdet";
2589 2589
 		$sql .= " AND ed.fk_expedition = e.rowid";
2590 2590
 		//if ($filter) $sql.= $filter;
@@ -2631,12 +2631,12 @@  discard block
 block discarded – undo
2631 2631
 		}
2632 2632
 
2633 2633
 		if (empty($reshook) && $lines[$i]->product_type != "9") {
2634
-			print '<!-- origin line id = ' . $lines[$i]->origin_line_id . ' -->'; // id of order line
2635
-			print '<tr class="oddeven" id="row-' . $lines[$i]->id . '" data-id="' . $lines[$i]->id . '" data-element="' . $lines[$i]->element . '" >';
2634
+			print '<!-- origin line id = '.$lines[$i]->origin_line_id.' -->'; // id of order line
2635
+			print '<tr class="oddeven" id="row-'.$lines[$i]->id.'" data-id="'.$lines[$i]->id.'" data-element="'.$lines[$i]->element.'" >';
2636 2636
 
2637 2637
 			// #
2638 2638
 			if (getDolGlobalString('MAIN_VIEW_LINE_NUMBER')) {
2639
-				print '<td class="center linecolnum">' . ($i + 1) . '</td>';
2639
+				print '<td class="center linecolnum">'.($i + 1).'</td>';
2640 2640
 			}
2641 2641
 
2642 2642
 			// Predefined product or service
@@ -2681,12 +2681,12 @@  discard block
 block discarded – undo
2681 2681
 				$product_static->stockable_product = $lines[$i]->stockable_product;
2682 2682
 
2683 2683
 				$text = $product_static->getNomUrl(1);
2684
-				$text .= ' - ' . $label;
2684
+				$text .= ' - '.$label;
2685 2685
 				$description = (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE') ? '' : dol_htmlentitiesbr($lines[$i]->description));
2686 2686
 				print $form->textwithtooltip($text, $description, 3, 0, '', (string) $i);
2687 2687
 				print_date_range(!empty($lines[$i]->date_start) ? $lines[$i]->date_start : '', !empty($lines[$i]->date_end) ? $lines[$i]->date_end : '');
2688 2688
 				if (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE')) {
2689
-					print (!empty($lines[$i]->description) && $lines[$i]->description != $lines[$i]->product) ? '<br>' . dol_htmlentitiesbr($lines[$i]->description) : '';
2689
+					print (!empty($lines[$i]->description) && $lines[$i]->description != $lines[$i]->product) ? '<br>'.dol_htmlentitiesbr($lines[$i]->description) : '';
2690 2690
 				}
2691 2691
 				print "</td>\n";
2692 2692
 			} else {
@@ -2698,10 +2698,10 @@  discard block
 block discarded – undo
2698 2698
 				}
2699 2699
 
2700 2700
 				if (!empty($lines[$i]->label)) {
2701
-					$text .= ' <strong>' . $lines[$i]->label . '</strong>';
2701
+					$text .= ' <strong>'.$lines[$i]->label.'</strong>';
2702 2702
 					print $form->textwithtooltip($text, $lines[$i]->description, 3, 0, '', (string) $i);
2703 2703
 				} else {
2704
-					print $text . ' ' . nl2br($lines[$i]->description);
2704
+					print $text.' '.nl2br($lines[$i]->description);
2705 2705
 				}
2706 2706
 
2707 2707
 				print_date_range($lines[$i]->date_start, $lines[$i]->date_end);
@@ -2714,7 +2714,7 @@  discard block
 block discarded – undo
2714 2714
 			}
2715 2715
 
2716 2716
 			// Qty ordered
2717
-			print '<td class="center linecolqty">' . $lines[$i]->qty_asked . ' ' . $unit_order . '</td>';
2717
+			print '<td class="center linecolqty">'.$lines[$i]->qty_asked.' '.$unit_order.'</td>';
2718 2718
 
2719 2719
 			// Qty in other shipments (with shipment and warehouse used)
2720 2720
 			if ($origin && $origin_id > 0) {
@@ -2735,8 +2735,8 @@  discard block
 block discarded – undo
2735 2735
 							}
2736 2736
 							$shipment_static->fetch($shipmentline_var['shipment_id']);
2737 2737
 							$htmltooltip .= $shipment_static->getNomUrl(1, '', 0, 0, 1);
2738
-							$htmltooltip .= ' - ' . $shipmentline_var['qty_shipped'];
2739
-							$htmltooltip .= ' - ' . $langs->trans("DateValidation") . ' : ' . (empty($shipmentline_var['date_valid']) ? $langs->trans("Draft") : dol_print_date($shipmentline_var['date_valid'], 'dayhour'));
2738
+							$htmltooltip .= ' - '.$shipmentline_var['qty_shipped'];
2739
+							$htmltooltip .= ' - '.$langs->trans("DateValidation").' : '.(empty($shipmentline_var['date_valid']) ? $langs->trans("Draft") : dol_print_date($shipmentline_var['date_valid'], 'dayhour'));
2740 2740
 							/*if (isModEnabled('stock') && $shipmentline_var['warehouse'] > 0) {
2741 2741
 								$warehousestatic->fetch($shipmentline_var['warehouse']);
2742 2742
 								$htmltext .= '<br>'.$langs->trans("FromLocation").' : '.$warehousestatic->getNomUrl(1, '', 0, 1);
@@ -2746,39 +2746,39 @@  discard block
 block discarded – undo
2746 2746
 							$qtyalreadysent += $shipmentline_var['qty_shipped'];
2747 2747
 						}
2748 2748
 						if ($j) {
2749
-							$htmltooltip = $langs->trans("QtyInOtherShipments") . '...<br><br>' . $htmltooltip . '<br><input type="submit" name="dummyhiddenbuttontogetfocus" style="display:none" autofocus>';
2749
+							$htmltooltip = $langs->trans("QtyInOtherShipments").'...<br><br>'.$htmltooltip.'<br><input type="submit" name="dummyhiddenbuttontogetfocus" style="display:none" autofocus>';
2750 2750
 						}
2751 2751
 					}
2752 2752
 				}
2753
-				print $form->textwithpicto((string) $qtyalreadysent, $htmltooltip, 1, 'info', '', 0, 3, 'tooltip' . $lines[$i]->id);
2753
+				print $form->textwithpicto((string) $qtyalreadysent, $htmltooltip, 1, 'info', '', 0, 3, 'tooltip'.$lines[$i]->id);
2754 2754
 				print '</td>';
2755 2755
 			}
2756 2756
 
2757 2757
 			if ($action == 'editline' && $lines[$i]->id == $line_id) {
2758 2758
 				// edit mode
2759
-				print '<td colspan="' . $editColspan . '" class="center"><table class="nobordernopadding centpercent">';
2759
+				print '<td colspan="'.$editColspan.'" class="center"><table class="nobordernopadding centpercent">';
2760 2760
 				if (is_array($lines[$i]->detail_batch) && count($lines[$i]->detail_batch) > 0) {
2761 2761
 					print '<!-- case edit 1 -->';
2762 2762
 					$line = new ExpeditionLigne($db);
2763 2763
 					foreach ($lines[$i]->detail_batch as $detail_batch) {
2764 2764
 						print '<tr>';
2765 2765
 						// Qty to ship or shipped
2766
-						print '<td><input class="qtyl right" name="qtyl' . $detail_batch->fk_expeditiondet . '_' . $detail_batch->id . '" id="qtyl' . $line_id . '_' . $detail_batch->id . '" type="text" size="4" value="' . $detail_batch->qty . '"></td>';
2766
+						print '<td><input class="qtyl right" name="qtyl'.$detail_batch->fk_expeditiondet.'_'.$detail_batch->id.'" id="qtyl'.$line_id.'_'.$detail_batch->id.'" type="text" size="4" value="'.$detail_batch->qty.'"></td>';
2767 2767
 						// Batch number management
2768 2768
 						if ($lines[$i]->entrepot_id == 0) {
2769 2769
 							// only show lot numbers from src warehouse when shipping from multiple warehouses
2770 2770
 							$line->fetch($detail_batch->fk_expeditiondet);
2771 2771
 						}
2772 2772
 						$entrepot_id = !empty($detail_batch->entrepot_id) ? $detail_batch->entrepot_id : $lines[$i]->entrepot_id;
2773
-						print '<td>' . $formproduct->selectLotStock($detail_batch->fk_origin_stock, 'batchl' . $detail_batch->fk_expeditiondet . '_' . $detail_batch->fk_origin_stock, '', 1, 0, $lines[$i]->fk_product, $entrepot_id) . '</td>';
2773
+						print '<td>'.$formproduct->selectLotStock($detail_batch->fk_origin_stock, 'batchl'.$detail_batch->fk_expeditiondet.'_'.$detail_batch->fk_origin_stock, '', 1, 0, $lines[$i]->fk_product, $entrepot_id).'</td>';
2774 2774
 						print '</tr>';
2775 2775
 					}
2776 2776
 					// add a 0 qty lot row to be able to add a lot
2777 2777
 					print '<tr>';
2778 2778
 					// Qty to ship or shipped
2779
-					print '<td><input class="qtyl" name="qtyl' . $line_id . '_0" id="qtyl' . $line_id . '_0" type="text" size="4" value="0"></td>';
2779
+					print '<td><input class="qtyl" name="qtyl'.$line_id.'_0" id="qtyl'.$line_id.'_0" type="text" size="4" value="0"></td>';
2780 2780
 					// Batch number management
2781
-					print '<td>' . $formproduct->selectLotStock('', 'batchl' . $line_id . '_0', '', 1, 0, $lines[$i]->fk_product) . '</td>';
2781
+					print '<td>'.$formproduct->selectLotStock('', 'batchl'.$line_id.'_0', '', 1, 0, $lines[$i]->fk_product).'</td>';
2782 2782
 					print '</tr>';
2783 2783
 				} elseif (isModEnabled('stock')) {
2784 2784
 					if ($lines[$i]->fk_product > 0) {
@@ -2786,13 +2786,13 @@  discard block
 block discarded – undo
2786 2786
 							print '<!-- case edit 2 -->';
2787 2787
 							print '<tr>';
2788 2788
 							// Qty to ship or shipped
2789
-							print '<td><input class="qtyl right" name="qtyl' . $line_id . '" id="qtyl' . $line_id . '" type="text" size="4" value="' . $lines[$i]->qty_shipped . '">' . $unit_order . '</td>';
2789
+							print '<td><input class="qtyl right" name="qtyl'.$line_id.'" id="qtyl'.$line_id.'" type="text" size="4" value="'.$lines[$i]->qty_shipped.'">'.$unit_order.'</td>';
2790 2790
 							// Warehouse source
2791
-							print '<td>' . $formproduct->selectWarehouses($lines[$i]->entrepot_id, 'entl' . $line_id, '', 1, 0, $lines[$i]->fk_product, '', 1, 0, array(), 'minwidth200') . '</td>';
2791
+							print '<td>'.$formproduct->selectWarehouses($lines[$i]->entrepot_id, 'entl'.$line_id, '', 1, 0, $lines[$i]->fk_product, '', 1, 0, array(), 'minwidth200').'</td>';
2792 2792
 							// Batch number management
2793 2793
 							print '<td>';
2794 2794
 							if (isModEnabled('productbatch')) {
2795
-								print ' - ' . $langs->trans("NA");
2795
+								print ' - '.$langs->trans("NA");
2796 2796
 							}
2797 2797
 							print '</td>';
2798 2798
 							print '</tr>';
@@ -2801,13 +2801,13 @@  discard block
 block discarded – undo
2801 2801
 							foreach ($lines[$i]->details_entrepot as $detail_entrepot) {
2802 2802
 								print '<tr>';
2803 2803
 								// Qty to ship or shipped
2804
-								print '<td><input class="qtyl right" name="qtyl' . $detail_entrepot->line_id . '" id="qtyl' . $detail_entrepot->line_id . '" type="text" size="4" value="' . $detail_entrepot->qty_shipped . '">' . $unit_order . '</td>';
2804
+								print '<td><input class="qtyl right" name="qtyl'.$detail_entrepot->line_id.'" id="qtyl'.$detail_entrepot->line_id.'" type="text" size="4" value="'.$detail_entrepot->qty_shipped.'">'.$unit_order.'</td>';
2805 2805
 								// Warehouse source
2806
-								print '<td>' . $formproduct->selectWarehouses($detail_entrepot->entrepot_id, 'entl' . $detail_entrepot->line_id, '', 1, 0, $lines[$i]->fk_product, '', 1, 0, array(), 'minwidth200') . '</td>';
2806
+								print '<td>'.$formproduct->selectWarehouses($detail_entrepot->entrepot_id, 'entl'.$detail_entrepot->line_id, '', 1, 0, $lines[$i]->fk_product, '', 1, 0, array(), 'minwidth200').'</td>';
2807 2807
 								// Batch number management
2808 2808
 								print '<td>';
2809 2809
 								if (isModEnabled('productbatch')) {
2810
-									print ' - ' . $langs->trans("NA");
2810
+									print ' - '.$langs->trans("NA");
2811 2811
 								}
2812 2812
 								print '</td>';
2813 2813
 								print '</tr>';
@@ -2816,19 +2816,19 @@  discard block
 block discarded – undo
2816 2816
 							print '<!-- case edit 4 -->';
2817 2817
 							print '<tr>';
2818 2818
 							// Qty to ship or shipped
2819
-							print '<td><input class="qtyl right" name="qtyl' . $line_id . '" id="qtyl' . $line_id . '" type="text" size="4" value="' . $lines[$i]->qty_shipped . '"></td>';
2820
-							print '<td><span class="opacitymedium">(' . $langs->trans("Service") . ')</span></td>';
2819
+							print '<td><input class="qtyl right" name="qtyl'.$line_id.'" id="qtyl'.$line_id.'" type="text" size="4" value="'.$lines[$i]->qty_shipped.'"></td>';
2820
+							print '<td><span class="opacitymedium">('.$langs->trans("Service").')</span></td>';
2821 2821
 							print '<td></td>';
2822 2822
 							print '</tr>';
2823 2823
 						} else {
2824 2824
 							print '<!-- case edit 5 -->';
2825
-							print '<tr><td colspan="3">' . $langs->trans("ErrorStockIsNotEnough") . '</td></tr>';
2825
+							print '<tr><td colspan="3">'.$langs->trans("ErrorStockIsNotEnough").'</td></tr>';
2826 2826
 						}
2827 2827
 					} else {
2828 2828
 						print '<!-- case edit 6 -->';
2829 2829
 						print '<tr>';
2830 2830
 						// Qty to ship or shipped
2831
-						print '<td><input class="qtyl right" name="qtyl' . $line_id . '" id="qtyl' . $line_id . '" type="text" size="4" value="' . $lines[$i]->qty_shipped . '">' . $unit_order . '</td>';
2831
+						print '<td><input class="qtyl right" name="qtyl'.$line_id.'" id="qtyl'.$line_id.'" type="text" size="4" value="'.$lines[$i]->qty_shipped.'">'.$unit_order.'</td>';
2832 2832
 						// Warehouse source
2833 2833
 						print '<td></td>';
2834 2834
 						// Batch number management
@@ -2839,7 +2839,7 @@  discard block
 block discarded – undo
2839 2839
 					print '<!-- case edit 7 -->';
2840 2840
 					print '<tr>';
2841 2841
 					// Qty to ship or shipped
2842
-					print '<td><input class="qtyl right" name="qtyl' . $line_id . '" id="qtyl' . $line_id . '" type="text" size="4" value="' . $lines[$i]->qty_shipped . '"></td>';
2842
+					print '<td><input class="qtyl right" name="qtyl'.$line_id.'" id="qtyl'.$line_id.'" type="text" size="4" value="'.$lines[$i]->qty_shipped.'"></td>';
2843 2843
 					// Warehouse source
2844 2844
 					print '<td></td>';
2845 2845
 					// Batch number management
@@ -2850,13 +2850,13 @@  discard block
 block discarded – undo
2850 2850
 				print '</table></td>';
2851 2851
 			} else {
2852 2852
 				// Qty to ship or shipped
2853
-				print '<td class="linecolqtytoship center">' . $lines[$i]->qty_shipped . ' ' . $unit_order . '</td>';
2853
+				print '<td class="linecolqtytoship center">'.$lines[$i]->qty_shipped.' '.$unit_order.'</td>';
2854 2854
 
2855 2855
 				// Warehouse source
2856 2856
 				if (isModEnabled('stock')) {
2857 2857
 					print '<td class="linecolwarehousesource tdoverflowmax200">';
2858 2858
 					if ($lines[$i]->product_type == Product::TYPE_SERVICE && getDolGlobalString('SHIPMENT_SUPPORTS_SERVICES')) {
2859
-						print '<span class="opacitymedium">(' . $langs->trans("Service") . ')</span>';
2859
+						print '<span class="opacitymedium">('.$langs->trans("Service").')</span>';
2860 2860
 					} elseif ($lines[$i]->entrepot_id > 0 && $lines[$i]->stockable_product == Product::ENABLED_STOCK) {
2861 2861
 						$warehouse_id = $lines[$i]->entrepot_id;
2862 2862
 						if (!isset($conf->cache['warehouse'][$warehouse_id])) {
@@ -2879,7 +2879,7 @@  discard block
 block discarded – undo
2879 2879
 								} else {
2880 2880
 									$warehouse = $conf->cache['warehouse'][$warehouse_id];
2881 2881
 								}
2882
-								$detail .= $langs->trans("DetailWarehouseFormat", $warehouse->label, $detail_entrepot->qty_shipped) . '<br>';
2882
+								$detail .= $langs->trans("DetailWarehouseFormat", $warehouse->label, $detail_entrepot->qty_shipped).'<br>';
2883 2883
 							}
2884 2884
 						}
2885 2885
 						print $form->textwithtooltip(img_picto('', 'object_stock').' '.$langs->trans("DetailWarehouseNumber"), $detail);
@@ -2896,7 +2896,7 @@  discard block
 block discarded – undo
2896 2896
 								} else {
2897 2897
 									$child_product = $conf->cache['product'][$child_product_id];
2898 2898
 								}
2899
-								$child_product_label = $child_product->ref . ' ' . $child_product->label;
2899
+								$child_product_label = $child_product->ref.' '.$child_product->label;
2900 2900
 
2901 2901
 								// get warehouse from cache
2902 2902
 								if (!isset($conf->cache['warehouse'][$warehouse_id])) {
@@ -2907,10 +2907,10 @@  discard block
 block discarded – undo
2907 2907
 									$child_warehouse = $conf->cache['warehouse'][$warehouse_id];
2908 2908
 								}
2909 2909
 
2910
-								$detail .= $langs->trans('DetailChildrenFormat', $child_product_label, $child_warehouse->label, price2num($total_qty, 'MS')) . '<br>';
2910
+								$detail .= $langs->trans('DetailChildrenFormat', $child_product_label, $child_warehouse->label, price2num($total_qty, 'MS')).'<br>';
2911 2911
 							}
2912 2912
 						}
2913
-						print $form->textwithtooltip(img_picto('', 'object_stock') . ' ' . $langs->trans('DetailWarehouseNumber'), $detail);
2913
+						print $form->textwithtooltip(img_picto('', 'object_stock').' '.$langs->trans('DetailWarehouseNumber'), $detail);
2914 2914
 					}
2915 2915
 					print '</td>';
2916 2916
 				}
@@ -2923,17 +2923,17 @@  discard block
 block discarded – undo
2923 2923
 						if ($lines[$i]->product_tobatch) {
2924 2924
 							$detail = '';
2925 2925
 							foreach ($lines[$i]->detail_batch as $dbatch) {	// $dbatch is instance of ExpeditionLineBatch
2926
-								$detail .= $langs->trans("Batch") . ': ' . $dbatch->batch;
2926
+								$detail .= $langs->trans("Batch").': '.$dbatch->batch;
2927 2927
 								if (!getDolGlobalString('PRODUCT_DISABLE_SELLBY')) {
2928
-									$detail .= ' - ' . $langs->trans("SellByDate") . ': ' . dol_print_date($dbatch->sellby, "day");
2928
+									$detail .= ' - '.$langs->trans("SellByDate").': '.dol_print_date($dbatch->sellby, "day");
2929 2929
 								}
2930 2930
 								if (!getDolGlobalString('PRODUCT_DISABLE_EATBY')) {
2931
-									$detail .= ' - ' . $langs->trans("EatByDate") . ': ' . dol_print_date($dbatch->eatby, "day");
2931
+									$detail .= ' - '.$langs->trans("EatByDate").': '.dol_print_date($dbatch->eatby, "day");
2932 2932
 								}
2933
-								$detail .= ' - ' . $langs->trans("Qty") . ': ' . $dbatch->qty;
2933
+								$detail .= ' - '.$langs->trans("Qty").': '.$dbatch->qty;
2934 2934
 								$detail .= '<br>';
2935 2935
 							}
2936
-							print $form->textwithtooltip(img_picto('', 'object_barcode') . ' ' . $langs->trans("DetailBatchNumber"), $detail);
2936
+							print $form->textwithtooltip(img_picto('', 'object_barcode').' '.$langs->trans("DetailBatchNumber"), $detail);
2937 2937
 						} else {
2938 2938
 							print $langs->trans("NA");
2939 2939
 						}
@@ -2947,7 +2947,7 @@  discard block
 block discarded – undo
2947 2947
 			// Weight
2948 2948
 			print '<td class="center linecolweight">';
2949 2949
 			if ($lines[$i]->fk_product_type == Product::TYPE_PRODUCT) {
2950
-				print $lines[$i]->weight * $lines[$i]->qty_shipped . ' ' . measuringUnitString(0, "weight", $lines[$i]->weight_units);
2950
+				print $lines[$i]->weight * $lines[$i]->qty_shipped.' '.measuringUnitString(0, "weight", $lines[$i]->weight_units);
2951 2951
 			} else {
2952 2952
 				print '&nbsp;';
2953 2953
 			}
@@ -2956,7 +2956,7 @@  discard block
 block discarded – undo
2956 2956
 			// Volume
2957 2957
 			print '<td class="center linecolvolume">';
2958 2958
 			if ($lines[$i]->fk_product_type == Product::TYPE_PRODUCT) {
2959
-				print $lines[$i]->volume * $lines[$i]->qty_shipped . ' ' . measuringUnitString(0, "volume", $lines[$i]->volume_units);
2959
+				print $lines[$i]->volume * $lines[$i]->qty_shipped.' '.measuringUnitString(0, "volume", $lines[$i]->volume_units);
2960 2960
 			} else {
2961 2961
 				print '&nbsp;';
2962 2962
 			}
@@ -2967,11 +2967,11 @@  discard block
 block discarded – undo
2967 2967
 
2968 2968
 			if ($action == 'editline' && $lines[$i]->id == $line_id) {
2969 2969
 				print '<td class="center" colspan="2" valign="middle">';
2970
-				print '<input type="submit" class="button button-save" id="savelinebutton marginbottomonly" name="save" value="' . $langs->trans("Save") . '"><br>';
2971
-				print '<input type="submit" class="button button-cancel" id="cancellinebutton" name="cancel" value="' . $langs->trans("Cancel") . '"><br>';
2970
+				print '<input type="submit" class="button button-save" id="savelinebutton marginbottomonly" name="save" value="'.$langs->trans("Save").'"><br>';
2971
+				print '<input type="submit" class="button button-cancel" id="cancellinebutton" name="cancel" value="'.$langs->trans("Cancel").'"><br>';
2972 2972
 				print '</td>';
2973 2973
 			} elseif ($object->status == Expedition::STATUS_DRAFT) {
2974
-				$edit_url = $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=editline&token=' . newToken() . '&lineid=' . $lines[$i]->id;
2974
+				$edit_url = $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=editline&token='.newToken().'&lineid='.$lines[$i]->id;
2975 2975
 				if (getDolGlobalInt('PRODUIT_SOUSPRODUITS')) {
2976 2976
 					$product_id = $lines[$i]->fk_product;
2977 2977
 					if (!isset($conf->cache['product'][$product_id])) {
@@ -2983,16 +2983,16 @@  discard block
 block discarded – undo
2983 2983
 					}
2984 2984
 
2985 2985
 					if ($product->hasFatherOrChild(1)) {
2986
-						$edit_url = dol_buildpath('/expedition/dispatch.php?id=' . $object->id, 1);
2986
+						$edit_url = dol_buildpath('/expedition/dispatch.php?id='.$object->id, 1);
2987 2987
 					}
2988 2988
 				}
2989 2989
 
2990 2990
 				// edit-delete buttons
2991 2991
 				print '<td class="linecoledit center">';
2992
-				print '<a class="editfielda reposition" href="' . $edit_url . '">' . img_edit() . '</a>';
2992
+				print '<a class="editfielda reposition" href="'.$edit_url.'">'.img_edit().'</a>';
2993 2993
 				print '</td>';
2994 2994
 				print '<td class="linecoldelete" width="10">';
2995
-				print '<a class="reposition" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=deleteline&token=' . newToken() . '&lineid=' . $lines[$i]->id . '">' . img_delete() . '</a>';
2995
+				print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=deleteline&token='.newToken().'&lineid='.$lines[$i]->id.'">'.img_delete().'</a>';
2996 2996
 				print '</td>';
2997 2997
 
2998 2998
 				// Display lines extrafields
@@ -3041,7 +3041,7 @@  discard block
 block discarded – undo
3041 3041
 	// TODO Show also lines ordered but not delivered
3042 3042
 
3043 3043
 	if (empty($num_prod)) {
3044
-		print '<tr><td colspan="8"><span class="opacitymedium">' . $langs->trans("NoLineGoOnTabToAddSome", $langs->transnoentitiesnoconv("ShipmentDistribution")) . '</span></td></tr>';
3044
+		print '<tr><td colspan="8"><span class="opacitymedium">'.$langs->trans("NoLineGoOnTabToAddSome", $langs->transnoentitiesnoconv("ShipmentDistribution")).'</span></td></tr>';
3045 3045
 	}
3046 3046
 
3047 3047
 	print "</table>\n";
@@ -3070,21 +3070,21 @@  discard block
 block discarded – undo
3070 3070
 				if ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('expedition', 'creer'))
3071 3071
 					|| (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('expedition', 'shipping_advance', 'validate'))
3072 3072
 				) {
3073
-					print dolGetButtonAction('', $langs->trans('Validate'), 'default', $_SERVER["PHP_SELF"] . '?action=valid&token=' . newToken() . '&id=' . $object->id, '');
3073
+					print dolGetButtonAction('', $langs->trans('Validate'), 'default', $_SERVER["PHP_SELF"].'?action=valid&token='.newToken().'&id='.$object->id, '');
3074 3074
 				} else {
3075
-					print dolGetButtonAction($langs->trans('NotAllowed'), $langs->trans('Validate'), 'default', $_SERVER['PHP_SELF'] . '#', '', false);
3075
+					print dolGetButtonAction($langs->trans('NotAllowed'), $langs->trans('Validate'), 'default', $_SERVER['PHP_SELF'].'#', '', false);
3076 3076
 				}
3077 3077
 			}
3078 3078
 
3079 3079
 			// 0=draft, 1=validated/delivered, 2=closed/delivered
3080 3080
 			if ($object->status == Expedition::STATUS_VALIDATED && !getDolGlobalString('STOCK_CALCULATE_ON_SHIPMENT')) {
3081 3081
 				if ($user->hasRight('expedition', 'creer')) {
3082
-					print dolGetButtonAction('', $langs->trans('SetToDraft'), 'default', $_SERVER["PHP_SELF"] . '?action=setdraft&token=' . newToken() . '&id=' . $object->id, '');
3082
+					print dolGetButtonAction('', $langs->trans('SetToDraft'), 'default', $_SERVER["PHP_SELF"].'?action=setdraft&token='.newToken().'&id='.$object->id, '');
3083 3083
 				}
3084 3084
 			}
3085 3085
 			if ($object->status == Expedition::STATUS_CLOSED) {
3086 3086
 				if ($user->hasRight('expedition', 'creer')) {
3087
-					print dolGetButtonAction('', $langs->trans('ReOpen'), 'default', $_SERVER["PHP_SELF"] . '?action=reopen&token=' . newToken() . '&id=' . $object->id, '');
3087
+					print dolGetButtonAction('', $langs->trans('ReOpen'), 'default', $_SERVER["PHP_SELF"].'?action=reopen&token='.newToken().'&id='.$object->id, '');
3088 3088
 				}
3089 3089
 			}
3090 3090
 
@@ -3092,9 +3092,9 @@  discard block
 block discarded – undo
3092 3092
 			if (empty($user->socid)) {
3093 3093
 				if ($object->status > 0) {
3094 3094
 					if (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') || $user->hasRight('expedition', 'shipping_advance', 'send')) {
3095
-						print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER["PHP_SELF"] . '?action=presend&token=' . newToken() . '&id=' . $object->id . '&mode=init#formmailbeforetitle', '');
3095
+						print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER["PHP_SELF"].'?action=presend&token='.newToken().'&id='.$object->id.'&mode=init#formmailbeforetitle', '');
3096 3096
 					} else {
3097
-						print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER['PHP_SELF'] . '#', '', false);
3097
+						print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER['PHP_SELF'].'#', '', false);
3098 3098
 					}
3099 3099
 				}
3100 3100
 			}
@@ -3102,15 +3102,15 @@  discard block
 block discarded – undo
3102 3102
 			// This is just to generate a delivery receipt when option to do this is on
3103 3103
 			//var_dump($object->linkedObjectsIds['delivery']);
3104 3104
 			if (getDolGlobalInt('MAIN_SUBMODULE_DELIVERY') && ($object->status == Expedition::STATUS_VALIDATED || $object->status == Expedition::STATUS_CLOSED) && $user->hasRight('expedition', 'delivery', 'creer') && empty($object->linkedObjectsIds['delivery'])) {
3105
-				print dolGetButtonAction('', $langs->trans('CreateDeliveryOrder'), 'default', $_SERVER["PHP_SELF"] . '?action=create_delivery&token=' . newToken() . '&id=' . $object->id, '');
3105
+				print dolGetButtonAction('', $langs->trans('CreateDeliveryOrder'), 'default', $_SERVER["PHP_SELF"].'?action=create_delivery&token='.newToken().'&id='.$object->id, '');
3106 3106
 			}
3107 3107
 
3108 3108
 			// Sign (to set to status "Signed" without using the online signature page)
3109 3109
 			if ($object->status > Expedition::STATUS_DRAFT) {
3110 3110
 				if ($object->signed_status != Expedition::$SIGNED_STATUSES['STATUS_SIGNED_ALL']) {
3111
-					print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=sign&token=' . newToken() . '">' . $langs->trans("SignShipping") . '</a></div>';
3111
+					print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=sign&token='.newToken().'">'.$langs->trans("SignShipping").'</a></div>';
3112 3112
 				} else {
3113
-					print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=unsign&token=' . newToken() . '">' . $langs->trans("UnsignShipping") . '</a></div>';
3113
+					print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=unsign&token='.newToken().'">'.$langs->trans("UnsignShipping").'</a></div>';
3114 3114
 				}
3115 3115
 			}
3116 3116
 
@@ -3118,7 +3118,7 @@  discard block
 block discarded – undo
3118 3118
 			if (isModEnabled('invoice') && ($object->status == Expedition::STATUS_VALIDATED || $object->status == Expedition::STATUS_CLOSED)) {
3119 3119
 				if ($user->hasRight('facture', 'creer')) {
3120 3120
 					if (getDolGlobalString('WORKFLOW_BILL_ON_SHIPMENT') !== '0') {
3121
-						print dolGetButtonAction('', $langs->trans('CreateBill'), 'default', DOL_URL_ROOT . '/compta/facture/card.php?action=create&origin=' . $object->element . '&originid=' . $object->id . '&socid=' . $object->socid, '');
3121
+						print dolGetButtonAction('', $langs->trans('CreateBill'), 'default', DOL_URL_ROOT.'/compta/facture/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid, '');
3122 3122
 					}
3123 3123
 				}
3124 3124
 			}
@@ -3127,22 +3127,22 @@  discard block
 block discarded – undo
3127 3127
 			if ($object->status == Expedition::STATUS_VALIDATED) {
3128 3128
 				if ($user->hasRight('expedition', 'creer') && $object->status > 0) {
3129 3129
 					if (!$object->billed && getDolGlobalString('WORKFLOW_BILL_ON_SHIPMENT') !== '0') {
3130
-						print dolGetButtonAction('', $langs->trans('ClassifyBilled'), 'default', $_SERVER["PHP_SELF"] . '?action=classifybilled&token=' . newToken() . '&id=' . $object->id, '');
3130
+						print dolGetButtonAction('', $langs->trans('ClassifyBilled'), 'default', $_SERVER["PHP_SELF"].'?action=classifybilled&token='.newToken().'&id='.$object->id, '');
3131 3131
 					}
3132
-					print dolGetButtonAction('', $langs->trans("Close"), 'default', $_SERVER["PHP_SELF"] . '?action=classifyclosed&token=' . newToken() . '&id=' . $object->id, '');
3132
+					print dolGetButtonAction('', $langs->trans("Close"), 'default', $_SERVER["PHP_SELF"].'?action=classifyclosed&token='.newToken().'&id='.$object->id, '');
3133 3133
 				}
3134 3134
 			}
3135 3135
 
3136 3136
 			// Cancel
3137 3137
 			if ($object->status == Expedition::STATUS_VALIDATED) {
3138 3138
 				if ($user->hasRight('expedition', 'creer')) {
3139
-					print dolGetButtonAction('', $langs->trans('Cancel'), 'danger', $_SERVER["PHP_SELF"] . '?action=cancel&token=' . newToken() . '&id=' . $object->id . '&mode=init#formmailbeforetitle', '');
3139
+					print dolGetButtonAction('', $langs->trans('Cancel'), 'danger', $_SERVER["PHP_SELF"].'?action=cancel&token='.newToken().'&id='.$object->id.'&mode=init#formmailbeforetitle', '');
3140 3140
 				}
3141 3141
 			}
3142 3142
 
3143 3143
 			// Delete
3144 3144
 			if ($user->hasRight('expedition', 'supprimer')) {
3145
-				print dolGetButtonAction('', $langs->trans('Delete'), 'delete', $_SERVER["PHP_SELF"] . '?action=delete&token=' . newToken() . '&id=' . $object->id, '');
3145
+				print dolGetButtonAction('', $langs->trans('Delete'), 'delete', $_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&id='.$object->id, '');
3146 3146
 			}
3147 3147
 		}
3148 3148
 
@@ -3158,9 +3158,9 @@  discard block
 block discarded – undo
3158 3158
 		print '<div class="fichecenter"><div class="fichehalfleft">';
3159 3159
 
3160 3160
 		$objectref = dol_sanitizeFileName($object->ref);
3161
-		$filedir = $conf->expedition->dir_output . "/sending/" . $objectref;
3161
+		$filedir = $conf->expedition->dir_output."/sending/".$objectref;
3162 3162
 
3163
-		$urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id;
3163
+		$urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id;
3164 3164
 
3165 3165
 		$genallowed = $user->hasRight('expedition', 'lire');
3166 3166
 		$delallowed = $user->hasRight('expedition', 'creer');
@@ -3181,8 +3181,8 @@  discard block
 block discarded – undo
3181 3181
 
3182 3182
 		if ($object->status != Expedition::STATUS_DRAFT && $useonlinesignature) {
3183 3183
 			print '<br><!-- Link to sign -->';
3184
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/signature.lib.php';
3185
-			print showOnlineSignatureUrl('expedition', $object->ref, $object) . '<br>';
3184
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/signature.lib.php';
3185
+			print showOnlineSignatureUrl('expedition', $object->ref, $object).'<br>';
3186 3186
 		}
3187 3187
 
3188 3188
 		print '</div><div class="fichehalfright">';
@@ -3190,13 +3190,13 @@  discard block
 block discarded – undo
3190 3190
 
3191 3191
 
3192 3192
 		// List of actions on element
3193
-		include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
3193
+		include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
3194 3194
 		$formactions = new FormActions($db);
3195 3195
 
3196 3196
 		//button to go to messaging from the events box
3197 3197
 		$MAXEVENT = 10;
3198
-		$morehtmlcenter = dolGetButtonTitle($langs->trans('FullConversation'), '', 'fa fa-comments imgforviewmode', DOL_URL_ROOT . '/expedition/messaging.php?id=' . $object->id);
3199
-		$morehtmlcenter .= dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT . '/expedition/agenda.php?id=' . $object->id);
3198
+		$morehtmlcenter = dolGetButtonTitle($langs->trans('FullConversation'), '', 'fa fa-comments imgforviewmode', DOL_URL_ROOT.'/expedition/messaging.php?id='.$object->id);
3199
+		$morehtmlcenter .= dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/expedition/agenda.php?id='.$object->id);
3200 3200
 
3201 3201
 		$somethingshown = $formactions->showactions($object, 'shipping', $socid, 1, '', $MAXEVENT, '', $morehtmlcenter);
3202 3202
 
@@ -3216,10 +3216,10 @@  discard block
 block discarded – undo
3216 3216
 	// Presend form
3217 3217
 	$modelmail = 'shipping_send';
3218 3218
 	$defaulttopic = 'SendShippingRef';
3219
-	$diroutput = $conf->expedition->dir_output . '/sending';
3220
-	$trackid = 'shi' . $object->id;
3219
+	$diroutput = $conf->expedition->dir_output.'/sending';
3220
+	$trackid = 'shi'.$object->id;
3221 3221
 
3222
-	include DOL_DOCUMENT_ROOT . '/core/tpl/card_presend.tpl.php';
3222
+	include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php';
3223 3223
 }
3224 3224
 
3225 3225
 // End of page
Please login to merge, or discard this patch.
htdocs/holiday/card.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
 	if ($action == 'update' && GETPOSTISSET('savevalidator') && $permissiontoapprove) {
320 320
 		$object->fetch($id);
321 321
 
322
-		$object->oldcopy = dol_clone($object, 2);  // @phan-suppress-current-line PhanTypeMismatchProperty
322
+		$object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty
323 323
 
324 324
 		$object->fk_validator = GETPOSTINT('valideur');
325 325
 
@@ -478,7 +478,7 @@  discard block
 block discarded – undo
478 478
 
479 479
 		// If draft and owner of leave
480 480
 		if ($object->status == Holiday::STATUS_DRAFT && $permissiontoadd) {
481
-			$object->oldcopy = dol_clone($object, 2);  // @phan-suppress-current-line PhanTypeMismatchProperty
481
+			$object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty
482 482
 
483 483
 			$object->status = Holiday::STATUS_VALIDATED;
484 484
 
@@ -519,7 +519,7 @@  discard block
 block discarded – undo
519 519
 
520 520
 				// option to warn the validator in case of too short delay
521 521
 				if (!getDolGlobalString('HOLIDAY_HIDE_APPROVER_ABOUT_TOO_LOW_DELAY')) {
522
-					$delayForRequest = getDolGlobalFloat('HOLIDAY_DELAY_TO_APPROVE_FOR_TYPE_'.$object->fk_type);	// Set delay depending of holiday leave type
522
+					$delayForRequest = getDolGlobalFloat('HOLIDAY_DELAY_TO_APPROVE_FOR_TYPE_'.$object->fk_type); // Set delay depending of holiday leave type
523 523
 					if ($delayForRequest) {
524 524
 						$nowplusdelay = dol_time_plus_duree($now, $delayForRequest, 'd');
525 525
 
@@ -561,7 +561,7 @@  discard block
 block discarded – undo
561 561
 					$endhalfdaykey = "";
562 562
 				}
563 563
 
564
-				$link = dol_buildpath("/holiday/card.php", 3) . '?id='.$object->id;
564
+				$link = dol_buildpath("/holiday/card.php", 3).'?id='.$object->id;
565 565
 
566 566
 				$message .= "<ul>";
567 567
 				$message .= "<li>".$langs->transnoentitiesnoconv("Name")." : ".dolGetFirstLastname($expediteur->firstname, $expediteur->lastname)."</li>\n";
@@ -594,7 +594,7 @@  discard block
 block discarded – undo
594 594
 	}
595 595
 
596 596
 	if ($action == 'update_extras' && $permissiontoeditextra) {
597
-		$object->oldcopy = dol_clone($object, 2);  // @phan-suppress-current-line PhanTypeMismatchProperty
597
+		$object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty
598 598
 
599 599
 		$attribute_name = GETPOST('attribute', 'aZ09');
600 600
 
@@ -623,7 +623,7 @@  discard block
 block discarded – undo
623 623
 
624 624
 		// If status is waiting approval and approver is also user
625 625
 		if ($object->status == Holiday::STATUS_VALIDATED && ($user->id == $object->fk_validator || $permissiontoaddall)) {
626
-			$object->oldcopy = dol_clone($object, 2);  // @phan-suppress-current-line PhanTypeMismatchProperty
626
+			$object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty
627 627
 
628 628
 			$object->date_approval = dol_now();
629 629
 			$object->fk_user_approve = $user->id;
@@ -1258,7 +1258,7 @@  discard block
 block discarded – undo
1258 1258
 			$result = $object->fetch($id, $ref);
1259 1259
 
1260 1260
 			$approverexpected = new User($db);
1261
-			$approverexpected->fetch($object->fk_validator);	// Use that should be the approver
1261
+			$approverexpected->fetch($object->fk_validator); // Use that should be the approver
1262 1262
 
1263 1263
 			$userRequest = new User($db);
1264 1264
 			$userRequest->fetch($object->fk_user);
@@ -1493,7 +1493,7 @@  discard block
 block discarded – undo
1493 1493
 					print '</tr>';
1494 1494
 				} else {
1495 1495
 					print '<tr>';
1496
-					print '<td class="titlefield">'.$langs->trans('ReviewedByCP').'</td>';	// Will be approved by
1496
+					print '<td class="titlefield">'.$langs->trans('ReviewedByCP').'</td>'; // Will be approved by
1497 1497
 					print '<td>';
1498 1498
 					$include_users = $object->fetch_users_approver_holiday();
1499 1499
 					if (!in_array($object->fk_validator, $include_users)) {  // Add the current validator to the list to not lose it when editing.
Please login to merge, or discard this patch.
htdocs/comm/action/class/actioncomm.class.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -472,7 +472,7 @@  discard block
 block discarded – undo
472 472
 		"fk_user_mod" => array("type" => "integer", "label" => "UserModification", "picto" => "user", "enabled" => "1", 'position' => 506, 'notnull' => 0, "visible" => "0", "css" => "maxwidth500 widthcentpercentminusxx",),
473 473
 		"datec" => array("type" => "datetime", "label" => "DateCreation", "enabled" => "1", 'position' => 510, 'notnull' => 0, "visible" => "-1",),
474 474
 		"tms" => array("type" => "timestamp", "label" => "DateModification", "enabled" => "1", 'position' => 520, 'notnull' => 1, "visible" => "-1",),
475
-		"percent" => array("type" => "smallint(6)", "label" => "Status", "enabled" => "1", 'position' => 1000, 'notnull' => 1, "visible" => "1",),	// status
475
+		"percent" => array("type" => "smallint(6)", "label" => "Status", "enabled" => "1", 'position' => 1000, 'notnull' => 1, "visible" => "1",), // status
476 476
 	);
477 477
 	// END MODULEBUILDER PROPERTIES
478 478
 
@@ -646,8 +646,8 @@  discard block
 block discarded – undo
646 646
 		$sql .= "ip";
647 647
 		$sql .= ") VALUES (";
648 648
 		$sql .= "'(PROV)', ";
649
-		$sql .= "'".$this->db->idate($now)."', ";	// date creation
650
-		$sql .= "'".$this->db->idate($this->datep)."', ";	// date start event
649
+		$sql .= "'".$this->db->idate($now)."', "; // date creation
650
+		$sql .= "'".$this->db->idate($this->datep)."', "; // date start event
651 651
 		$sql .= (strval($this->datef) != '' ? "'".$this->db->idate($this->datef)."'" : "null").", ";
652 652
 		$sql .= ((isset($this->durationp) && $this->durationp >= 0 && $this->durationp != '') ? "'".$this->db->escape((string) $this->durationp)."'" : "null").", "; // deprecated
653 653
 		$sql .= (isset($this->type_id) ? $this->type_id : "null").",";
@@ -721,7 +721,7 @@  discard block
 block discarded – undo
721 721
 						$resql = $this->db->query($sql);
722 722
 						if (!$resql) {
723 723
 							$error++;
724
-							dol_syslog('Error to process userassigned: ' . $this->db->lasterror(), LOG_ERR);
724
+							dol_syslog('Error to process userassigned: '.$this->db->lasterror(), LOG_ERR);
725 725
 							$this->errors[] = $this->db->lasterror();
726 726
 						} else {
727 727
 							$already_inserted[$val['id']] = true;
@@ -746,7 +746,7 @@  discard block
 block discarded – undo
746 746
 						$resql = $this->db->query($sql);
747 747
 						if (!$resql) {
748 748
 							$error++;
749
-							dol_syslog('Error to process socpeopleassigned: ' . $this->db->lasterror(), LOG_ERR);
749
+							dol_syslog('Error to process socpeopleassigned: '.$this->db->lasterror(), LOG_ERR);
750 750
 							$this->errors[] = $this->db->lasterror();
751 751
 						} else {
752 752
 							$already_inserted[$id] = true;
@@ -1261,7 +1261,7 @@  discard block
 block discarded – undo
1261 1261
 		$sql = "UPDATE ".MAIN_DB_PREFIX."actioncomm";
1262 1262
 		$sql .= " SET percent = '".$this->db->escape((string) $this->percentage)."'";
1263 1263
 		$sql .= ", fk_action = ".(int) $this->type_id;
1264
-		$sql .= ", code = " . ($code ? "'".$this->db->escape($code)."'" : "null");
1264
+		$sql .= ", code = ".($code ? "'".$this->db->escape($code)."'" : "null");
1265 1265
 		$sql .= ", label = ".($this->label ? "'".$this->db->escape($this->label)."'" : "null");
1266 1266
 		$sql .= ", datep = ".(strval($this->datep) != '' ? "'".$this->db->idate($this->datep)."'" : 'null');
1267 1267
 		$sql .= ", datep2 = ".(strval($this->datef) != '' ? "'".$this->db->idate($this->datef)."'" : 'null');
@@ -1420,7 +1420,7 @@  discard block
 block discarded – undo
1420 1420
 		$sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as a";
1421 1421
 		// Fields from hook
1422 1422
 		$parameters = array('sql' => &$sql, 'socid' => $socid, 'fk_element' => $fk_element, 'elementtype' => $elementtype);
1423
-		$reshook = $hookmanager->executeHooks('getActionsListFrom', $parameters);    // Note that $action and $object may have been modified by hook
1423
+		$reshook = $hookmanager->executeHooks('getActionsListFrom', $parameters); // Note that $action and $object may have been modified by hook
1424 1424
 		if (!empty($hookmanager->resPrint)) {
1425 1425
 			$sql .= $hookmanager->resPrint;
1426 1426
 		}
@@ -1449,7 +1449,7 @@  discard block
 block discarded – undo
1449 1449
 		}
1450 1450
 		// Fields where hook
1451 1451
 		$parameters = array('sql' => &$sql, 'socid' => $socid, 'fk_element' => $fk_element, 'elementtype' => $elementtype);
1452
-		$reshook = $hookmanager->executeHooks('getActionsListWhere', $parameters);    // Note that $action and $object may have been modified by hook
1452
+		$reshook = $hookmanager->executeHooks('getActionsListWhere', $parameters); // Note that $action and $object may have been modified by hook
1453 1453
 		if (!empty($hookmanager->resPrint)) {
1454 1454
 			$sql .= $hookmanager->resPrint;
1455 1455
 		}
@@ -1526,7 +1526,7 @@  discard block
 block discarded – undo
1526 1526
 
1527 1527
 		$resql = $this->db->query($sql);
1528 1528
 		if ($resql) {
1529
-			$response = null;  // Ensure the variable is defined
1529
+			$response = null; // Ensure the variable is defined
1530 1530
 			if (empty($load_state_board)) {
1531 1531
 				$agenda_static = new ActionComm($this->db);
1532 1532
 				$response = new WorkboardResponse();
@@ -1765,7 +1765,7 @@  discard block
 block discarded – undo
1765 1765
 
1766 1766
 		// show categories for this record only in ajax to not overload lists
1767 1767
 		if (isModEnabled('category') && !$nofetch) {
1768
-			require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
1768
+			require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
1769 1769
 			if (empty($form)) {
1770 1770
 				include_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
1771 1771
 				$form = new Form($this->db);
@@ -2627,7 +2627,7 @@  discard block
 block discarded – undo
2627 2627
 	 */
2628 2628
 	public static function replaceProduct(DoliDB $dbs, $origin_id, $dest_id)
2629 2629
 	{
2630
-		$sql = 'UPDATE ' . MAIN_DB_PREFIX . 'actioncomm SET fk_element = ' . ((int) $dest_id) . ' WHERE elementtype="product" AND fk_element = '.((int) $origin_id);
2630
+		$sql = 'UPDATE '.MAIN_DB_PREFIX.'actioncomm SET fk_element = '.((int) $dest_id).' WHERE elementtype="product" AND fk_element = '.((int) $origin_id);
2631 2631
 		// using $dbs, not $this->db because function is static
2632 2632
 		if (!$dbs->query($sql)) {
2633 2633
 			//$this->errors = $dbs->lasterror();
@@ -2751,7 +2751,7 @@  discard block
 block discarded – undo
2751 2751
 		//Select all action comm reminders
2752 2752
 		$sql = "SELECT rowid as id FROM ".MAIN_DB_PREFIX."actioncomm_reminder";
2753 2753
 		$sql .= " WHERE typeremind = 'email'";
2754
-		$sql .= " AND status = 0";	// 0=No yet sent, -1=Error. TODO Include reminder in error once we can count number of error, so we can try 5 times and not more on errors.
2754
+		$sql .= " AND status = 0"; // 0=No yet sent, -1=Error. TODO Include reminder in error once we can count number of error, so we can try 5 times and not more on errors.
2755 2755
 		$sql .= " AND dateremind <= '".$this->db->idate($now)."'";
2756 2756
 		$sql .= " AND entity IN (".getEntity('actioncomm').")";
2757 2757
 		$sql .= $this->db->order("dateremind", "ASC");
@@ -2760,7 +2760,7 @@  discard block
 block discarded – undo
2760 2760
 		if ($resql) {
2761 2761
 			require_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
2762 2762
 			$formmail = new FormMail($this->db);
2763
-			$to = null;  // Ensure 'to' is defined for static analysis
2763
+			$to = null; // Ensure 'to' is defined for static analysis
2764 2764
 
2765 2765
 			while ($obj = $this->db->fetch_object($resql)) {
2766 2766
 				$res = $actionCommReminder->fetch($obj->id);
@@ -2798,11 +2798,11 @@  discard block
 block discarded – undo
2798 2798
 							if (!empty($recipient->email)) {
2799 2799
 								$to = $recipient->email;
2800 2800
 							} else {
2801
-								$errormesg = "Failed to send remind to user id=" . $actionCommReminder->fk_user . ". No email defined for user.";
2801
+								$errormesg = "Failed to send remind to user id=".$actionCommReminder->fk_user.". No email defined for user.";
2802 2802
 								$error++;
2803 2803
 							}
2804 2804
 						} else {
2805
-							$errormesg = "Failed to load recipient with user id=" . $actionCommReminder->fk_user;
2805
+							$errormesg = "Failed to load recipient with user id=".$actionCommReminder->fk_user;
2806 2806
 							$error++;
2807 2807
 						}
2808 2808
 
@@ -2824,7 +2824,7 @@  discard block
 block discarded – undo
2824 2824
 							if ($cMailFile->sendfile()) {
2825 2825
 								$nbMailSend++;
2826 2826
 							} else {
2827
-								$errormesg = 'Failed to send email to: ' . $to . ' ' . $cMailFile->error . implode(',', $cMailFile->errors);
2827
+								$errormesg = 'Failed to send email to: '.$to.' '.$cMailFile->error.implode(',', $cMailFile->errors);
2828 2828
 								$error++;
2829 2829
 							}
2830 2830
 						}
@@ -2928,7 +2928,7 @@  discard block
 block discarded – undo
2928 2928
 		//Select all action comm reminders
2929 2929
 		$sql = "SELECT rowid as id FROM ".MAIN_DB_PREFIX."actioncomm_reminder";
2930 2930
 		$sql .= " WHERE typeremind = 'sms'";
2931
-		$sql .= " AND status = 0";	// 0=No yet sent, -1=Error. TODO Include reminder in error once we can count number of error, so we can try 5 times and not more on errors.
2931
+		$sql .= " AND status = 0"; // 0=No yet sent, -1=Error. TODO Include reminder in error once we can count number of error, so we can try 5 times and not more on errors.
2932 2932
 		$sql .= " AND dateremind <= '".$this->db->idate($now)."'";
2933 2933
 		$sql .= " AND entity IN (".getEntity('actioncomm').")";
2934 2934
 		$sql .= $this->db->order("dateremind", "ASC");
@@ -2937,7 +2937,7 @@  discard block
 block discarded – undo
2937 2937
 		if ($resql) {
2938 2938
 			require_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
2939 2939
 			$formmail = new FormMail($this->db);
2940
-			$to = null;  // Ensure 'to' is defined for static analysis
2940
+			$to = null; // Ensure 'to' is defined for static analysis
2941 2941
 
2942 2942
 			while ($obj = $this->db->fetch_object($resql)) {
2943 2943
 				$res = $actionCommReminder->fetch($obj->id);
@@ -2975,11 +2975,11 @@  discard block
 block discarded – undo
2975 2975
 							if (!empty($recipient->user_mobile)) {
2976 2976
 								$to = $recipient->user_mobile;
2977 2977
 							} else {
2978
-								$errormesg = "Failed to send remind to user id=" . $actionCommReminder->fk_user . ". No email defined for user.";
2978
+								$errormesg = "Failed to send remind to user id=".$actionCommReminder->fk_user.". No email defined for user.";
2979 2979
 								$error++;
2980 2980
 							}
2981 2981
 						} else {
2982
-							$errormesg = "Failed to load recipient with user id=" . $actionCommReminder->fk_user;
2982
+							$errormesg = "Failed to load recipient with user id=".$actionCommReminder->fk_user;
2983 2983
 							$error++;
2984 2984
 						}
2985 2985
 
@@ -3001,7 +3001,7 @@  discard block
 block discarded – undo
3001 3001
 							if ($CSMSFile->sendfile()) {
3002 3002
 								$nbSmsSent++;
3003 3003
 							} else {
3004
-								$errormesg = 'Failed to send email to: ' . $to . ' ' . $CSMSFile->error . implode(',', $CSMSFile->errors);
3004
+								$errormesg = 'Failed to send email to: '.$to.' '.$CSMSFile->error.implode(',', $CSMSFile->errors);
3005 3005
 								$error++;
3006 3006
 							}
3007 3007
 						}
Please login to merge, or discard this patch.
htdocs/core/lib/company.lib.php 1 patch
Spacing   +360 added lines, -360 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 	$h = 0;
49 49
 	$head = array();
50 50
 
51
-	$head[$h][0] = DOL_URL_ROOT . '/societe/card.php?socid=' . $object->id;
51
+	$head[$h][0] = DOL_URL_ROOT.'/societe/card.php?socid='.$object->id;
52 52
 	$head[$h][1] = $langs->trans("ThirdParty");
53 53
 	$head[$h][2] = 'card';
54 54
 	$h++;
@@ -58,21 +58,21 @@  discard block
 block discarded – undo
58 58
 		//$nbContact = count($object->liste_contact(-1,'internal')) + count($object->liste_contact(-1,'external'));
59 59
 		$nbContact = 0;
60 60
 		// Enable caching of thirdrparty count Contacts
61
-		require_once DOL_DOCUMENT_ROOT . '/core/lib/memory.lib.php';
62
-		$cachekey = 'count_contacts_thirdparty_' . $object->id;
61
+		require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php';
62
+		$cachekey = 'count_contacts_thirdparty_'.$object->id;
63 63
 		$dataretrieved = dol_getcache($cachekey);
64 64
 
65 65
 		if (!is_null($dataretrieved)) {
66 66
 			$nbContact = $dataretrieved;
67 67
 		} else {
68 68
 			$sql = "SELECT COUNT(p.rowid) as nb";
69
-			$sql .= " FROM " . MAIN_DB_PREFIX . "socpeople as p";
69
+			$sql .= " FROM ".MAIN_DB_PREFIX."socpeople as p";
70 70
 			// Add table from hooks
71 71
 			$parameters = array('contacttab' => true);
72 72
 			$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object); // Note that $action and $object may have been modified by hook
73 73
 			$sql .= $hookmanager->resPrint;
74
-			$sql .= " WHERE p.fk_soc = " . ((int) $object->id);
75
-			$sql .= " AND p.entity IN (" . getEntity($object->element) . ")";
74
+			$sql .= " WHERE p.fk_soc = ".((int) $object->id);
75
+			$sql .= " AND p.entity IN (".getEntity($object->element).")";
76 76
 			// Add where from hooks
77 77
 			$parameters = array('contacttab' => true);
78 78
 			$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object); // Note that $action and $object may have been modified by hook
@@ -83,31 +83,31 @@  discard block
 block discarded – undo
83 83
 				$nbContact = $obj->nb;
84 84
 			}
85 85
 
86
-			dol_setcache($cachekey, $nbContact, 120);	// If setting cache fails, this is not a problem, so we do not test result.
86
+			dol_setcache($cachekey, $nbContact, 120); // If setting cache fails, this is not a problem, so we do not test result.
87 87
 		}
88 88
 
89
-		$head[$h][0] = DOL_URL_ROOT . '/societe/contact.php?socid=' . $object->id;
89
+		$head[$h][0] = DOL_URL_ROOT.'/societe/contact.php?socid='.$object->id;
90 90
 		$head[$h][1] = $langs->trans('ContactsAddresses');
91 91
 		if ($nbContact > 0) {
92
-			$head[$h][1] .= '<span class="badge marginleftonlyshort">' . $nbContact . '</span>';
92
+			$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbContact.'</span>';
93 93
 		}
94 94
 		$head[$h][2] = 'contact';
95 95
 		$h++;
96 96
 	}
97 97
 	if (getDolGlobalString('MAIN_SUPPORT_SHARED_CONTACT_BETWEEN_THIRDPARTIES')) {
98 98
 		// Some features may be unstable with this option, like permissions rules, import contact, ...
99
-		$head[$h][0] = DOL_URL_ROOT . '/societe/societecontact.php?socid=' . $object->id;
99
+		$head[$h][0] = DOL_URL_ROOT.'/societe/societecontact.php?socid='.$object->id;
100 100
 		$nbContact = count($object->liste_contact(-1, 'internal')) + count($object->liste_contact(-1, 'external'));
101 101
 		$head[$h][1] = $langs->trans("ContactsAddressesExt");
102 102
 		if ($nbContact > 0) {
103
-			$head[$h][1] .= '<span class="badge marginleftonlyshort">' . $nbContact . '</span>';
103
+			$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbContact.'</span>';
104 104
 		}
105 105
 		$head[$h][2] = 'contactext';
106 106
 		$h++;
107 107
 	}
108 108
 
109 109
 	if ($object->client == 1 || $object->client == 2 || $object->client == 3) {
110
-		$head[$h][0] = DOL_URL_ROOT . '/comm/card.php?socid=' . $object->id;
110
+		$head[$h][0] = DOL_URL_ROOT.'/comm/card.php?socid='.$object->id;
111 111
 		$head[$h][1] = '';
112 112
 		if (!getDolGlobalString('SOCIETE_DISABLE_PROSPECTS') && ($object->client == 2 || $object->client == 3)) {
113 113
 			$head[$h][1] .= $langs->trans("Prospect");
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
 		if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) {
125 125
 			$langs->load("products");
126 126
 			// price
127
-			$head[$h][0] = DOL_URL_ROOT . '/societe/price.php?socid=' . $object->id;
127
+			$head[$h][0] = DOL_URL_ROOT.'/societe/price.php?socid='.$object->id;
128 128
 			$head[$h][1] = $langs->trans("CustomerPrices");
129 129
 			$head[$h][2] = 'price';
130 130
 			$h++;
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
 		$supplier_module_enabled = 1;
136 136
 	}
137 137
 	if ($supplier_module_enabled == 1 && $object->fournisseur && $user->hasRight('fournisseur', 'lire')) {
138
-		$head[$h][0] = DOL_URL_ROOT . '/fourn/card.php?socid=' . $object->id;
138
+		$head[$h][0] = DOL_URL_ROOT.'/fourn/card.php?socid='.$object->id;
139 139
 		$head[$h][1] = $langs->trans("Supplier");
140 140
 		$head[$h][2] = 'supplier';
141 141
 		$h++;
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
 			$mode = 'customer';
155 155
 		}
156 156
 
157
-		$head[$h][0] = DOL_URL_ROOT . '/accountancy/bookkeeping/listbyaccount.php?socid=' . $object->id . '&mode=' . $mode . '&type=sub&search_accountancy_code_start=' . $subledger_start_account . '&search_accountancy_code_end=' . $subledger_end_account;
157
+		$head[$h][0] = DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?socid='.$object->id.'&mode='.$mode.'&type=sub&search_accountancy_code_start='.$subledger_start_account.'&search_accountancy_code_end='.$subledger_end_account;
158 158
 		$head[$h][1] = $langs->trans("Accounting");
159 159
 		$head[$h][2] = 'accounting';
160 160
 		$h++;
@@ -163,17 +163,17 @@  discard block
 block discarded – undo
163 163
 	if (isModEnabled('project') && ($user->hasRight('projet', 'lire'))) {
164 164
 		$nbProject = 0;
165 165
 		// Enable caching of thirdrparty count projects
166
-		require_once DOL_DOCUMENT_ROOT . '/core/lib/memory.lib.php';
167
-		$cachekey = 'count_projects_thirdparty_' . $object->id;
166
+		require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php';
167
+		$cachekey = 'count_projects_thirdparty_'.$object->id;
168 168
 		$dataretrieved = dol_getcache($cachekey);
169 169
 
170 170
 		if (!is_null($dataretrieved)) {
171 171
 			$nbProject = $dataretrieved;
172 172
 		} else {
173 173
 			$sql = "SELECT COUNT(n.rowid) as nb";
174
-			$sql .= " FROM " . MAIN_DB_PREFIX . "projet as n";
175
-			$sql .= " WHERE fk_soc = " . ((int) $object->id);
176
-			$sql .= " AND entity IN (" . getEntity('project') . ")";
174
+			$sql .= " FROM ".MAIN_DB_PREFIX."projet as n";
175
+			$sql .= " WHERE fk_soc = ".((int) $object->id);
176
+			$sql .= " AND entity IN (".getEntity('project').")";
177 177
 			$resql = $db->query($sql);
178 178
 			if ($resql) {
179 179
 				$obj = $db->fetch_object($resql);
@@ -181,12 +181,12 @@  discard block
 block discarded – undo
181 181
 			} else {
182 182
 				dol_print_error($db);
183 183
 			}
184
-			dol_setcache($cachekey, $nbProject, 120);	// If setting cache fails, this is not a problem, so we do not test result.
184
+			dol_setcache($cachekey, $nbProject, 120); // If setting cache fails, this is not a problem, so we do not test result.
185 185
 		}
186
-		$head[$h][0] = DOL_URL_ROOT . '/societe/project.php?socid=' . $object->id;
186
+		$head[$h][0] = DOL_URL_ROOT.'/societe/project.php?socid='.$object->id;
187 187
 		$head[$h][1] = $langs->trans("Projects");
188 188
 		if ($nbProject > 0) {
189
-			$head[$h][1] .= '<span class="badge marginleftonlyshort">' . $nbProject . '</span>';
189
+			$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbProject.'</span>';
190 190
 		}
191 191
 		$head[$h][2] = 'project';
192 192
 		$h++;
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
 
195 195
 	// Tab to link resources
196 196
 	if (isModEnabled('resource') && getDolGlobalString('RESOURCE_ON_THIRDPARTIES')) {
197
-		$head[$h][0] = DOL_URL_ROOT . '/resource/element_resource.php?element=societe&element_id=' . $object->id;
197
+		$head[$h][0] = DOL_URL_ROOT.'/resource/element_resource.php?element=societe&element_id='.$object->id;
198 198
 		$head[$h][1] = $langs->trans("Resources");
199 199
 		$head[$h][2] = 'resources';
200 200
 		$h++;
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
 	if ((isModEnabled('order') || isModEnabled('propal') || isModEnabled('invoice') || isModEnabled('intervention') || isModEnabled("supplier_proposal") || isModEnabled("supplier_order") || isModEnabled("supplier_invoice"))
205 205
 		&& !getDolGlobalString('THIRDPARTIES_DISABLE_RELATED_OBJECT_TAB')
206 206
 	) {
207
-		$head[$h][0] = DOL_URL_ROOT . '/societe/consumption.php?socid=' . $object->id;
207
+		$head[$h][0] = DOL_URL_ROOT.'/societe/consumption.php?socid='.$object->id;
208 208
 		$head[$h][1] = $langs->trans("Referers");
209 209
 		$head[$h][2] = 'consumption';
210 210
 		$h++;
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
 				$servicestatus = 1;
225 225
 			}
226 226
 
227
-			include_once DOL_DOCUMENT_ROOT . '/societe/class/societeaccount.class.php';
227
+			include_once DOL_DOCUMENT_ROOT.'/societe/class/societeaccount.class.php';
228 228
 			$societeaccount = new SocieteAccount($db);
229 229
 			$stripecu = $societeaccount->getCustomerAccount($object->id, 'stripe', $servicestatus); // Get thirdparty cu_...
230 230
 			if ($stripecu) {
@@ -233,12 +233,12 @@  discard block
 block discarded – undo
233 233
 		}
234 234
 
235 235
 		$sql = "SELECT COUNT(n.rowid) as nb";
236
-		$sql .= " FROM " . MAIN_DB_PREFIX . "societe_rib as n";
237
-		$sql .= " WHERE n.fk_soc = " . ((int) $object->id);
236
+		$sql .= " FROM ".MAIN_DB_PREFIX."societe_rib as n";
237
+		$sql .= " WHERE n.fk_soc = ".((int) $object->id);
238 238
 		if (!isModEnabled('stripe')) {
239 239
 			$sql .= " AND n.stripe_card_ref IS NULL";
240 240
 		} else {
241
-			$sql .= " AND (n.stripe_card_ref IS NULL OR (n.stripe_card_ref IS NOT NULL AND n.status = " . ((int) $servicestatus) . "))";
241
+			$sql .= " AND (n.stripe_card_ref IS NULL OR (n.stripe_card_ref IS NOT NULL AND n.status = ".((int) $servicestatus)."))";
242 242
 		}
243 243
 
244 244
 		$resql = $db->query($sql);
@@ -251,12 +251,12 @@  discard block
 block discarded – undo
251 251
 
252 252
 		//if (isModEnabled('stripe') && $nbBankAccount > 0) $nbBankAccount = '...';	// No way to know exact number
253 253
 
254
-		$head[$h][0] = DOL_URL_ROOT . '/societe/paymentmodes.php?socid=' . urlencode((string) ($object->id));
254
+		$head[$h][0] = DOL_URL_ROOT.'/societe/paymentmodes.php?socid='.urlencode((string) ($object->id));
255 255
 		$head[$h][1] = $title;
256 256
 		if ($foundonexternalonlinesystem) {
257 257
 			$head[$h][1] .= '<span class="badge marginleftonlyshort">...</span>';
258 258
 		} elseif ($nbBankAccount > 0) {
259
-			$head[$h][1] .= '<span class="badge marginleftonlyshort">' . $nbBankAccount . '</span>';
259
+			$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbBankAccount.'</span>';
260 260
 		}
261 261
 		$head[$h][2] = 'rib';
262 262
 		$h++;
@@ -271,15 +271,15 @@  discard block
 block discarded – undo
271 271
 			$site_filter_list[] = 'dolibarr_portal';
272 272
 		}
273 273
 
274
-		$head[$h][0] = DOL_URL_ROOT . '/societe/website.php?id=' . urlencode((string) ($object->id));
274
+		$head[$h][0] = DOL_URL_ROOT.'/societe/website.php?id='.urlencode((string) ($object->id));
275 275
 		$head[$h][1] = $langs->trans("WebSiteAccounts");
276 276
 		$nbNote = 0;
277 277
 		$sql = "SELECT COUNT(n.rowid) as nb";
278
-		$sql .= " FROM " . MAIN_DB_PREFIX . "societe_account as n";
279
-		$sql .= " WHERE fk_soc = " . ((int) $object->id);
280
-		$sql .= " AND entity IN (" . getEntity('thirdpartyaccount') . ")";
278
+		$sql .= " FROM ".MAIN_DB_PREFIX."societe_account as n";
279
+		$sql .= " WHERE fk_soc = ".((int) $object->id);
280
+		$sql .= " AND entity IN (".getEntity('thirdpartyaccount').")";
281 281
 		if (!empty($site_filter_list)) {
282
-			$sql .= " AND n.site IN (" . $db->sanitize("'" . implode("','", $site_filter_list) . "'", 1) . ")";
282
+			$sql .= " AND n.site IN (".$db->sanitize("'".implode("','", $site_filter_list)."'", 1).")";
283 283
 		}
284 284
 		$resql = $db->query($sql);
285 285
 		if ($resql) {
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
 			dol_print_error($db);
290 290
 		}
291 291
 		if ($nbNote > 0) {
292
-			$head[$h][1] .= '<span class="badge marginleftonlyshort">' . $nbNote . '</span>';
292
+			$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbNote.'</span>';
293 293
 		}
294 294
 		$head[$h][2] = 'website';
295 295
 		$h++;
@@ -299,13 +299,13 @@  discard block
 block discarded – undo
299 299
 		if ($user->hasRight('partnership', 'read')) {
300 300
 			$langs->load("partnership");
301 301
 			$nbPartnership = is_array($object->partnerships) ? count($object->partnerships) : 0;
302
-			$head[$h][0] = DOL_URL_ROOT . '/partnership/partnership_list.php?socid=' . $object->id;
302
+			$head[$h][0] = DOL_URL_ROOT.'/partnership/partnership_list.php?socid='.$object->id;
303 303
 			$head[$h][1] = $langs->trans("Partnerships");
304 304
 			$nbNote = 0;
305 305
 			$sql = "SELECT COUNT(n.rowid) as nb";
306
-			$sql .= " FROM " . MAIN_DB_PREFIX . "partnership as n";
307
-			$sql .= " WHERE fk_soc = " . ((int) $object->id);
308
-			$sql .= " AND entity IN (" . getEntity('partnership') . ")";
306
+			$sql .= " FROM ".MAIN_DB_PREFIX."partnership as n";
307
+			$sql .= " WHERE fk_soc = ".((int) $object->id);
308
+			$sql .= " AND entity IN (".getEntity('partnership').")";
309 309
 			$resql = $db->query($sql);
310 310
 			if ($resql) {
311 311
 				$obj = $db->fetch_object($resql);
@@ -314,11 +314,11 @@  discard block
 block discarded – undo
314 314
 				dol_print_error($db);
315 315
 			}
316 316
 			if ($nbNote > 0) {
317
-				$head[$h][1] .= '<span class="badge marginleftonlyshort">' . $nbNote . '</span>';
317
+				$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbNote.'</span>';
318 318
 			}
319 319
 			$head[$h][2] = 'partnerships';
320 320
 			if ($nbPartnership > 0) {
321
-				$head[$h][1] .= '<span class="badge marginleftonlyshort">' . $nbPartnership . '</span>';
321
+				$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbPartnership.'</span>';
322 322
 			}
323 323
 			$h++;
324 324
 		}
@@ -329,16 +329,16 @@  discard block
 block discarded – undo
329 329
 		//$langs->load('ticket');
330 330
 		$nbTicket = 0;
331 331
 		// Enable caching of thirdparty count notifications
332
-		require_once DOL_DOCUMENT_ROOT . '/core/lib/memory.lib.php';
333
-		$cachekey = 'count_ticket_thirdparty_' . $object->id;
332
+		require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php';
333
+		$cachekey = 'count_ticket_thirdparty_'.$object->id;
334 334
 		$nbticketretreived = dol_getcache($cachekey);
335 335
 		if (!is_null($nbticketretreived)) {
336 336
 			$nbTicket = $nbticketretreived;
337 337
 		} else {
338 338
 			// List of notifications enabled for contacts of the third party
339 339
 			$sql = "SELECT COUNT(t.rowid) as nb";
340
-			$sql .= " FROM " . MAIN_DB_PREFIX . "ticket as t";
341
-			$sql .= " WHERE t.fk_soc = " . ((int) $object->id);
340
+			$sql .= " FROM ".MAIN_DB_PREFIX."ticket as t";
341
+			$sql .= " WHERE t.fk_soc = ".((int) $object->id);
342 342
 			$resql = $db->query($sql);
343 343
 			if ($resql) {
344 344
 				$obj = $db->fetch_object($resql);
@@ -346,13 +346,13 @@  discard block
 block discarded – undo
346 346
 			} else {
347 347
 				dol_print_error($db);
348 348
 			}
349
-			dol_setcache($cachekey, $nbTicket, 120);		// If setting cache fails, this is not a problem, so we do not test result.
349
+			dol_setcache($cachekey, $nbTicket, 120); // If setting cache fails, this is not a problem, so we do not test result.
350 350
 		}
351 351
 
352
-		$head[$h][0] = DOL_URL_ROOT . '/ticket/list.php?socid=' . urlencode((string) ($object->id));
352
+		$head[$h][0] = DOL_URL_ROOT.'/ticket/list.php?socid='.urlencode((string) ($object->id));
353 353
 		$head[$h][1] = $langs->trans("Tickets");
354 354
 		if ($nbTicket > 0) {
355
-			$head[$h][1] .= '<span class="badge marginleftonlyshort">' . $nbTicket . '</span>';
355
+			$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbTicket.'</span>';
356 356
 		}
357 357
 		$head[$h][2] = 'ticket';
358 358
 		$h++;
@@ -371,20 +371,20 @@  discard block
 block discarded – undo
371 371
 			$langs->load('mails');
372 372
 			$nbNotif = 0;
373 373
 			// Enable caching of thirdparty count notifications
374
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/memory.lib.php';
375
-			$cachekey = 'count_notifications_thirdparty_' . $object->id;
374
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php';
375
+			$cachekey = 'count_notifications_thirdparty_'.$object->id;
376 376
 			$dataretrieved = dol_getcache($cachekey);
377 377
 			if (!is_null($dataretrieved)) {
378 378
 				$nbNotif = $dataretrieved;
379 379
 			} else {
380 380
 				// List of notifications enabled for contacts of the third party
381 381
 				$sql = "SELECT COUNT(n.rowid) as nb";
382
-				$sql .= " FROM " . MAIN_DB_PREFIX . "c_action_trigger as a,";
383
-				$sql .= " " . MAIN_DB_PREFIX . "notify_def as n,";
384
-				$sql .= " " . MAIN_DB_PREFIX . "socpeople as c";
382
+				$sql .= " FROM ".MAIN_DB_PREFIX."c_action_trigger as a,";
383
+				$sql .= " ".MAIN_DB_PREFIX."notify_def as n,";
384
+				$sql .= " ".MAIN_DB_PREFIX."socpeople as c";
385 385
 				$sql .= " WHERE a.rowid = n.fk_action";
386 386
 				$sql .= " AND c.rowid = n.fk_contact";
387
-				$sql .= " AND c.fk_soc = " . ((int) $object->id);
387
+				$sql .= " AND c.fk_soc = ".((int) $object->id);
388 388
 				$resql = $db->query($sql);
389 389
 				if ($resql) {
390 390
 					$obj = $db->fetch_object($resql);
@@ -392,13 +392,13 @@  discard block
 block discarded – undo
392 392
 				} else {
393 393
 					dol_print_error($db);
394 394
 				}
395
-				dol_setcache($cachekey, $nbNotif, 120);		// If setting cache fails, this is not a problem, so we do not test result.
395
+				dol_setcache($cachekey, $nbNotif, 120); // If setting cache fails, this is not a problem, so we do not test result.
396 396
 			}
397 397
 
398
-			$head[$h][0] = DOL_URL_ROOT . '/societe/notify/card.php?socid=' . urlencode((string) ($object->id));
398
+			$head[$h][0] = DOL_URL_ROOT.'/societe/notify/card.php?socid='.urlencode((string) ($object->id));
399 399
 			$head[$h][1] = $langs->trans("Notifications");
400 400
 			if ($nbNotif > 0) {
401
-				$head[$h][1] .= '<span class="badge marginleftonlyshort">' . $nbNotif . '</span>';
401
+				$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbNotif.'</span>';
402 402
 			}
403 403
 			$head[$h][2] = 'notify';
404 404
 			$h++;
@@ -412,10 +412,10 @@  discard block
 block discarded – undo
412 412
 		if (!empty($object->note_public)) {
413 413
 			$nbNote++;
414 414
 		}
415
-		$head[$h][0] = DOL_URL_ROOT . '/societe/note.php?id=' . urlencode((string) ($object->id));
415
+		$head[$h][0] = DOL_URL_ROOT.'/societe/note.php?id='.urlencode((string) ($object->id));
416 416
 		$head[$h][1] = $langs->trans("Notes");
417 417
 		if ($nbNote > 0) {
418
-			$head[$h][1] .= '<span class="badge marginleftonlyshort">' . $nbNote . '</span>';
418
+			$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbNote.'</span>';
419 419
 		}
420 420
 		$head[$h][2] = 'note';
421 421
 		$h++;
@@ -423,59 +423,59 @@  discard block
 block discarded – undo
423 423
 		// Attached files and Links
424 424
 		$totalAttached = 0;
425 425
 		// Enable caching of thirdrparty count attached files and links
426
-		require_once DOL_DOCUMENT_ROOT . '/core/lib/memory.lib.php';
427
-		$cachekey = 'count_attached_thirdparty_' . $object->id;
426
+		require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php';
427
+		$cachekey = 'count_attached_thirdparty_'.$object->id;
428 428
 		$dataretrieved = dol_getcache($cachekey);
429 429
 		if (!is_null($dataretrieved)) {
430 430
 			$totalAttached = $dataretrieved;
431 431
 		} else {
432
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
433
-			require_once DOL_DOCUMENT_ROOT . '/core/class/link.class.php';
434
-			$upload_dir = $conf->societe->multidir_output[$object->entity ?? $conf->entity] . "/" . $object->id;
432
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
433
+			require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
434
+			$upload_dir = $conf->societe->multidir_output[$object->entity ?? $conf->entity]."/".$object->id;
435 435
 			$nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$'));
436 436
 			$nbLinks = Link::count($db, $object->element, $object->id);
437 437
 			$totalAttached = $nbFiles + $nbLinks;
438
-			dol_setcache($cachekey, $totalAttached, 120);		// If setting cache fails, this is not a problem, so we do not test result.
438
+			dol_setcache($cachekey, $totalAttached, 120); // If setting cache fails, this is not a problem, so we do not test result.
439 439
 		}
440 440
 
441
-		$head[$h][0] = DOL_URL_ROOT . '/societe/document.php?socid=' . $object->id;
441
+		$head[$h][0] = DOL_URL_ROOT.'/societe/document.php?socid='.$object->id;
442 442
 		$head[$h][1] = $langs->trans("Documents");
443 443
 		if (($totalAttached) > 0) {
444
-			$head[$h][1] .= '<span class="badge marginleftonlyshort">' . ($totalAttached) . '</span>';
444
+			$head[$h][1] .= '<span class="badge marginleftonlyshort">'.($totalAttached).'</span>';
445 445
 		}
446 446
 		$head[$h][2] = 'document';
447 447
 		$h++;
448 448
 	}
449 449
 
450
-	$head[$h][0] = DOL_URL_ROOT . '/societe/messaging.php?socid=' . $object->id;
450
+	$head[$h][0] = DOL_URL_ROOT.'/societe/messaging.php?socid='.$object->id;
451 451
 	$head[$h][1] = $langs->trans("Events");
452 452
 	if (isModEnabled('agenda') && ($user->hasRight('agenda', 'myactions', 'read') || $user->hasRight('agenda', 'allactions', 'read'))) {
453 453
 		$nbEvent = 0;
454 454
 		// Enable caching of thirdparty count actioncomm
455
-		require_once DOL_DOCUMENT_ROOT . '/core/lib/memory.lib.php';
456
-		$cachekey = 'count_events_thirdparty_' . $object->id;
455
+		require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php';
456
+		$cachekey = 'count_events_thirdparty_'.$object->id;
457 457
 		$dataretrieved = dol_getcache($cachekey);
458 458
 		if (!is_null($dataretrieved)) {
459 459
 			$nbEvent = $dataretrieved;
460 460
 		} else {
461 461
 			$sql = "SELECT COUNT(id) as nb";
462
-			$sql .= " FROM " . MAIN_DB_PREFIX . "actioncomm";
463
-			$sql .= " WHERE fk_soc = " . ((int) $object->id);
464
-			$sql .= " AND entity IN (" . getEntity('agenda') . ")";
462
+			$sql .= " FROM ".MAIN_DB_PREFIX."actioncomm";
463
+			$sql .= " WHERE fk_soc = ".((int) $object->id);
464
+			$sql .= " AND entity IN (".getEntity('agenda').")";
465 465
 			$resql = $db->query($sql);
466 466
 			if ($resql) {
467 467
 				$obj = $db->fetch_object($resql);
468 468
 				$nbEvent = $obj->nb;
469 469
 			} else {
470
-				dol_syslog('Failed to count actioncomm ' . $db->lasterror(), LOG_ERR);
470
+				dol_syslog('Failed to count actioncomm '.$db->lasterror(), LOG_ERR);
471 471
 			}
472
-			dol_setcache($cachekey, $nbEvent, 120);		// If setting cache fails, this is not a problem, so we do not test result.
472
+			dol_setcache($cachekey, $nbEvent, 120); // If setting cache fails, this is not a problem, so we do not test result.
473 473
 		}
474 474
 
475 475
 		$head[$h][1] .= '/';
476 476
 		$head[$h][1] .= $langs->trans("Agenda");
477 477
 		if ($nbEvent > 0) {
478
-			$head[$h][1] .= '<span class="badge marginleftonlyshort">' . $nbEvent . '</span>';
478
+			$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbEvent.'</span>';
479 479
 		}
480 480
 	}
481 481
 	$head[$h][2] = 'agenda';
@@ -505,12 +505,12 @@  discard block
 block discarded – undo
505 505
 	$h = 0;
506 506
 	$head = array();
507 507
 
508
-	$head[$h][0] = DOL_URL_ROOT . '/societe/card.php?socid=' . $object->id;
508
+	$head[$h][0] = DOL_URL_ROOT.'/societe/card.php?socid='.$object->id;
509 509
 	$head[$h][1] = $langs->trans("ThirdParty");
510 510
 	$head[$h][2] = 'company';
511 511
 	$h++;
512 512
 
513
-	$head[$h][0] = 'commerciaux.php?socid=' . $object->id;
513
+	$head[$h][0] = 'commerciaux.php?socid='.$object->id;
514 514
 	$head[$h][1] = $langs->trans("SalesRepresentative");
515 515
 	$head[$h][2] = 'salesrepresentative';
516 516
 	$h++;
@@ -536,7 +536,7 @@  discard block
 block discarded – undo
536 536
 	$h = 0;
537 537
 	$head = array();
538 538
 
539
-	$head[$h][0] = DOL_URL_ROOT . '/societe/admin/societe.php';
539
+	$head[$h][0] = DOL_URL_ROOT.'/societe/admin/societe.php';
540 540
 	$head[$h][1] = $langs->trans("Miscellaneous");
541 541
 	$head[$h][2] = 'general';
542 542
 	$h++;
@@ -547,26 +547,26 @@  discard block
 block discarded – undo
547 547
 	// $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__');   to remove a tab
548 548
 	complete_head_from_modules($conf, $langs, null, $head, $h, 'company_admin');
549 549
 
550
-	$head[$h][0] = DOL_URL_ROOT . '/societe/admin/societe_extrafields.php';
550
+	$head[$h][0] = DOL_URL_ROOT.'/societe/admin/societe_extrafields.php';
551 551
 	$head[$h][1] = $langs->trans("ExtraFieldsThirdParties");
552 552
 	$nbExtrafields = $extrafields->attributes['societe']['count'];
553 553
 	if ($nbExtrafields > 0) {
554
-		$head[$h][1] .= '<span class="badge marginleftonlyshort">' . $nbExtrafields . '</span>';
554
+		$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
555 555
 	}
556 556
 	$head[$h][2] = 'attributes';
557 557
 	$h++;
558 558
 
559
-	$head[$h][0] = DOL_URL_ROOT . '/societe/admin/contact_extrafields.php';
559
+	$head[$h][0] = DOL_URL_ROOT.'/societe/admin/contact_extrafields.php';
560 560
 	$head[$h][1] = $langs->trans("ExtraFieldsContacts");
561 561
 	$nbExtrafields = $extrafields->attributes['socpeople']['count'];
562 562
 	if ($nbExtrafields > 0) {
563
-		$head[$h][1] .= '<span class="badge marginleftonlyshort">' . $nbExtrafields . '</span>';
563
+		$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
564 564
 	}
565 565
 	$head[$h][2] = 'attributes_contacts';
566 566
 	$h++;
567 567
 
568 568
 	if (getDolGlobalString('MAIN_FEATURES_LEVEL') >= 1) {
569
-		$head[$h][0] = DOL_URL_ROOT . '/societe/admin/public_interface.php';
569
+		$head[$h][0] = DOL_URL_ROOT.'/societe/admin/public_interface.php';
570 570
 		$head[$h][1] = $langs->trans("PublicUrl");
571 571
 		$head[$h][2] = 'publicurl';
572 572
 		$h++;
@@ -615,13 +615,13 @@  discard block
 block discarded – undo
615 615
 		$outputlangs = $langs;
616 616
 	}
617 617
 
618
-	$sql = "SELECT rowid, code, label FROM " . MAIN_DB_PREFIX . "c_country";
618
+	$sql = "SELECT rowid, code, label FROM ".MAIN_DB_PREFIX."c_country";
619 619
 	if (is_numeric($searchkey)) {
620
-		$sql .= " WHERE rowid = " . ((int) $searchkey);
620
+		$sql .= " WHERE rowid = ".((int) $searchkey);
621 621
 	} elseif (!empty($searchkey)) {
622
-		$sql .= " WHERE code = '" . $db->escape($searchkey) . "'";
622
+		$sql .= " WHERE code = '".$db->escape($searchkey)."'";
623 623
 	} else {
624
-		$sql .= " WHERE label = '" . $db->escape($searchlabel) . "'";
624
+		$sql .= " WHERE label = '".$db->escape($searchlabel)."'";
625 625
 	}
626 626
 
627 627
 	$resql = $dbtouse->query($sql);
@@ -632,9 +632,9 @@  discard block
 block discarded – undo
632 632
 			if (is_object($outputlangs)) {
633 633
 				$outputlangs->load("dict");
634 634
 				if ($entconv) {
635
-					$label = ($obj->code && ($outputlangs->trans("Country" . $obj->code) != "Country" . $obj->code)) ? $outputlangs->trans("Country" . $obj->code) : $label;
635
+					$label = ($obj->code && ($outputlangs->trans("Country".$obj->code) != "Country".$obj->code)) ? $outputlangs->trans("Country".$obj->code) : $label;
636 636
 				} else {
637
-					$label = ($obj->code && ($outputlangs->transnoentitiesnoconv("Country" . $obj->code) != "Country" . $obj->code)) ? $outputlangs->transnoentitiesnoconv("Country" . $obj->code) : $label;
637
+					$label = ($obj->code && ($outputlangs->transnoentitiesnoconv("Country".$obj->code) != "Country".$obj->code)) ? $outputlangs->transnoentitiesnoconv("Country".$obj->code) : $label;
638 638
 				}
639 639
 			}
640 640
 			if ($withcode == '1') {
@@ -683,8 +683,8 @@  discard block
 block discarded – undo
683 683
 	}
684 684
 
685 685
 	$sql = "SELECT d.rowid as id, d.code_departement as code, d.nom as name, d.active, c.label as country, c.code as country_code, r.code_region as region_code, r.nom as region_name FROM";
686
-	$sql .= " " . MAIN_DB_PREFIX . "c_departements as d, " . MAIN_DB_PREFIX . "c_regions as r," . MAIN_DB_PREFIX . "c_country as c";
687
-	$sql .= " WHERE d.fk_region=r.code_region and r.fk_pays=c.rowid and d.rowid=" . ((int) $id);
686
+	$sql .= " ".MAIN_DB_PREFIX."c_departements as d, ".MAIN_DB_PREFIX."c_regions as r,".MAIN_DB_PREFIX."c_country as c";
687
+	$sql .= " WHERE d.fk_region=r.code_region and r.fk_pays=c.rowid and d.rowid=".((int) $id);
688 688
 	$sql .= " AND d.active = 1 AND r.active = 1 AND c.active = 1";
689 689
 	$sql .= " ORDER BY c.code, d.code_departement";
690 690
 
@@ -697,21 +697,21 @@  discard block
 block discarded – undo
697 697
 			if (is_object($outputlangs)) {
698 698
 				$outputlangs->load("dict");
699 699
 				if ($entconv) {
700
-					$label = ($obj->code && ($outputlangs->trans("State" . $obj->code) != "State" . $obj->code)) ? $outputlangs->trans("State" . $obj->code) : $label;
700
+					$label = ($obj->code && ($outputlangs->trans("State".$obj->code) != "State".$obj->code)) ? $outputlangs->trans("State".$obj->code) : $label;
701 701
 				} else {
702
-					$label = ($obj->code && ($outputlangs->transnoentitiesnoconv("State" . $obj->code) != "State" . $obj->code)) ? $outputlangs->transnoentitiesnoconv("State" . $obj->code) : $label;
702
+					$label = ($obj->code && ($outputlangs->transnoentitiesnoconv("State".$obj->code) != "State".$obj->code)) ? $outputlangs->transnoentitiesnoconv("State".$obj->code) : $label;
703 703
 				}
704 704
 			}
705 705
 
706 706
 			if ($withcode == 1) {
707 707
 				if ($withregion == 1) {
708
-					return $label = $obj->region_name . ' - ' . $obj->code . ' - ' . ($langs->trans($obj->code) != $obj->code ? $langs->trans($obj->code) : ($obj->name != '-' ? $obj->name : ''));
708
+					return $label = $obj->region_name.' - '.$obj->code.' - '.($langs->trans($obj->code) != $obj->code ? $langs->trans($obj->code) : ($obj->name != '-' ? $obj->name : ''));
709 709
 				} else {
710
-					return $label = $obj->code . ' - ' . ($langs->trans($obj->code) != $obj->code ? $langs->trans($obj->code) : ($obj->name != '-' ? $obj->name : ''));
710
+					return $label = $obj->code.' - '.($langs->trans($obj->code) != $obj->code ? $langs->trans($obj->code) : ($obj->name != '-' ? $obj->name : ''));
711 711
 				}
712 712
 			} elseif ($withcode == 2) {
713 713
 				if ($withregion == 1) {
714
-					return $label = $obj->region_name . ' - ' . ($langs->trans($obj->code) != $obj->code ? $langs->trans($obj->code) : ($obj->name != '-' ? $obj->name : ''));
714
+					return $label = $obj->region_name.' - '.($langs->trans($obj->code) != $obj->code ? $langs->trans($obj->code) : ($obj->name != '-' ? $obj->name : ''));
715 715
 				} else {
716 716
 					return $label = ($langs->trans($obj->code) != $obj->code ? $langs->trans($obj->code) : ($obj->name != '-' ? $obj->name : ''));
717 717
 				}
@@ -723,7 +723,7 @@  discard block
 block discarded – undo
723 723
 				}
724 724
 			} else {
725 725
 				if ($withregion == 1) {
726
-					return $label = $obj->region_name . ' - ' . $label;
726
+					return $label = $obj->region_name.' - '.$label;
727 727
 				} else {
728 728
 					return $label;
729 729
 				}
@@ -757,13 +757,13 @@  discard block
 block discarded – undo
757 757
 	$outputlangs->load("dict");
758 758
 
759 759
 	// If there is a translation, we can send immediately the label
760
-	if ($outputlangs->trans("Currency" . $code_iso) != "Currency" . $code_iso) {
761
-		return ($withcode ? $code_iso . ' - ' : '') . $outputlangs->trans("Currency" . $code_iso);
760
+	if ($outputlangs->trans("Currency".$code_iso) != "Currency".$code_iso) {
761
+		return ($withcode ? $code_iso.' - ' : '').$outputlangs->trans("Currency".$code_iso);
762 762
 	}
763 763
 
764 764
 	// If no translation, we read table to get label by default
765
-	$sql = "SELECT label FROM " . MAIN_DB_PREFIX . "c_currencies";
766
-	$sql .= " WHERE code_iso='" . $db->escape($code_iso) . "'";
765
+	$sql = "SELECT label FROM ".MAIN_DB_PREFIX."c_currencies";
766
+	$sql .= " WHERE code_iso='".$db->escape($code_iso)."'";
767 767
 
768 768
 	$resql = $db->query($sql);
769 769
 	if ($resql) {
@@ -799,12 +799,12 @@  discard block
 block discarded – undo
799 799
 		return '';
800 800
 	}
801 801
 
802
-	if (!empty($conf->cache["legalform_" . $langs->defaultlang . '_' . $code])) {
803
-		return $conf->cache["legalform_" . $langs->defaultlang . '_' . $code];
802
+	if (!empty($conf->cache["legalform_".$langs->defaultlang.'_'.$code])) {
803
+		return $conf->cache["legalform_".$langs->defaultlang.'_'.$code];
804 804
 	}
805 805
 
806
-	$sql = "SELECT libelle as label FROM " . MAIN_DB_PREFIX . "c_forme_juridique";
807
-	$sql .= " WHERE code = '" . $db->escape($code) . "'";
806
+	$sql = "SELECT libelle as label FROM ".MAIN_DB_PREFIX."c_forme_juridique";
807
+	$sql .= " WHERE code = '".$db->escape($code)."'";
808 808
 
809 809
 	dol_syslog("Company.lib::getFormeJuridiqueLabel", LOG_DEBUG);
810 810
 
@@ -816,14 +816,14 @@  discard block
 block discarded – undo
816 816
 
817 817
 			$label = ($obj->label != '-' ? $obj->label : '');
818 818
 
819
-			$conf->cache["legalform_" . $langs->defaultlang . '_' . $code] = $label;
819
+			$conf->cache["legalform_".$langs->defaultlang.'_'.$code] = $label;
820 820
 
821 821
 			return $langs->trans($label);
822 822
 		} else {
823 823
 			return $langs->trans("NotDefined");
824 824
 		}
825 825
 	} else {
826
-		return 'Error ' . $db->lasterror();
826
+		return 'Error '.$db->lasterror();
827 827
 	}
828 828
 }
829 829
 
@@ -845,7 +845,7 @@  discard block
 block discarded – undo
845 845
 		// Use of cache to reduce number of database requests
846 846
 		$country_code_in_EEC = $conf->cache['country_code_in_EEC'];
847 847
 	} else {
848
-		$sql = "SELECT cc.code FROM " . MAIN_DB_PREFIX . "c_country as cc";
848
+		$sql = "SELECT cc.code FROM ".MAIN_DB_PREFIX."c_country as cc";
849 849
 		$sql .= " WHERE cc.eec = 1";
850 850
 
851 851
 		$resql = $db->query($sql);
@@ -877,7 +877,7 @@  discard block
 block discarded – undo
877 877
 		return false;
878 878
 	}
879 879
 
880
-	$country_code_in_EEC = getCountriesInEEC();		// This make a database call but there is a cache done into $conf->cache['country_code_in_EEC']
880
+	$country_code_in_EEC = getCountriesInEEC(); // This make a database call but there is a cache done into $conf->cache['country_code_in_EEC']
881 881
 
882 882
 	//print "dd".$object->country_code;
883 883
 	return in_array($object->country_code, $country_code_in_EEC);
@@ -900,7 +900,7 @@  discard block
 block discarded – undo
900 900
 		// Use of cache to reduce number of database requests
901 901
 		$country_code_in_SEPA = $conf->cache['country_code_in_SEPA'];
902 902
 	} else {
903
-		$sql = "SELECT cc.code FROM " . MAIN_DB_PREFIX . "c_country as cc";
903
+		$sql = "SELECT cc.code FROM ".MAIN_DB_PREFIX."c_country as cc";
904 904
 		$sql .= " WHERE cc.sepa = 1";
905 905
 
906 906
 		$resql = $db->query($sql);
@@ -932,7 +932,7 @@  discard block
 block discarded – undo
932 932
 		return false;
933 933
 	}
934 934
 
935
-	$country_code_in_SEPA = getCountriesInSEPA();		// This make a database call but there is a cache done into $conf->cache['country_code_in_SEPA']
935
+	$country_code_in_SEPA = getCountriesInSEPA(); // This make a database call but there is a cache done into $conf->cache['country_code_in_SEPA']
936 936
 
937 937
 	//print "dd".$object->country_code;
938 938
 	return in_array($object->country_code, $country_code_in_SEPA);
@@ -962,21 +962,21 @@  discard block
 block discarded – undo
962 962
 
963 963
 		$newcardbutton = '';
964 964
 		if ($user->hasRight('projet', 'creer') && empty($nocreatelink)) {
965
-			$newcardbutton .= dolGetButtonTitle($langs->trans('AddProject'), '', 'fa fa-plus-circle', DOL_URL_ROOT . '/projet/card.php?socid=' . $object->id . '&action=create&backtopage=' . urlencode($backtopage));
965
+			$newcardbutton .= dolGetButtonTitle($langs->trans('AddProject'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/projet/card.php?socid='.$object->id.'&action=create&backtopage='.urlencode($backtopage));
966 966
 		}
967 967
 
968 968
 		print "\n";
969
-		print load_fiche_titre($langs->trans("ProjectsDedicatedToThisThirdParty"), $newcardbutton . $morehtmlright, '');
969
+		print load_fiche_titre($langs->trans("ProjectsDedicatedToThisThirdParty"), $newcardbutton.$morehtmlright, '');
970 970
 
971
-		print '<div class="div-table-responsive">' . "\n";
971
+		print '<div class="div-table-responsive">'."\n";
972 972
 		print '<table class="noborder centpercent">';
973 973
 
974 974
 		$sql  = "SELECT p.rowid as id, p.entity, p.title, p.ref, p.public, p.dateo as do, p.datee as de, p.fk_statut as status, p.fk_opp_status, p.opp_amount, p.opp_percent, p.tms as date_modification, p.budget_amount";
975 975
 		$sql .= ", cls.code as opp_status_code";
976
-		$sql .= " FROM " . MAIN_DB_PREFIX . "projet as p";
977
-		$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_lead_status as cls on p.fk_opp_status = cls.rowid";
978
-		$sql .= " WHERE p.fk_soc = " . ((int) $object->id);
979
-		$sql .= " AND p.entity IN (" . getEntity('project') . ")";
976
+		$sql .= " FROM ".MAIN_DB_PREFIX."projet as p";
977
+		$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_lead_status as cls on p.fk_opp_status = cls.rowid";
978
+		$sql .= " WHERE p.fk_soc = ".((int) $object->id);
979
+		$sql .= " AND p.entity IN (".getEntity('project').")";
980 980
 		$sql .= " ORDER BY p.dateo DESC";
981 981
 
982 982
 		$result = $db->query($sql);
@@ -990,14 +990,14 @@  discard block
 block discarded – undo
990 990
 				print $selectedfields;
991 991
 				print '</td>';
992 992
 			}
993
-			print '<td>' . $langs->trans("Ref") . '</td>';
994
-			print '<td>' . $langs->trans("Name") . '</td>';
995
-			print '<td class="center">' . $langs->trans("DateStart") . '</td>';
996
-			print '<td class="center">' . $langs->trans("DateEnd") . '</td>';
997
-			print '<td class="right">' . $langs->trans("OpportunityAmountShort") . '</td>';
998
-			print '<td class="center">' . $langs->trans("OpportunityStatusShort") . '</td>';
999
-			print '<td class="right">' . $langs->trans("OpportunityProbabilityShort") . '</td>';
1000
-			print '<td class="right">' . $langs->trans("Status") . '</td>';
993
+			print '<td>'.$langs->trans("Ref").'</td>';
994
+			print '<td>'.$langs->trans("Name").'</td>';
995
+			print '<td class="center">'.$langs->trans("DateStart").'</td>';
996
+			print '<td class="center">'.$langs->trans("DateEnd").'</td>';
997
+			print '<td class="right">'.$langs->trans("OpportunityAmountShort").'</td>';
998
+			print '<td class="center">'.$langs->trans("OpportunityStatusShort").'</td>';
999
+			print '<td class="right">'.$langs->trans("OpportunityProbabilityShort").'</td>';
1000
+			print '<td class="right">'.$langs->trans("Status").'</td>';
1001 1001
 			if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
1002 1002
 				print '<td class="center">';
1003 1003
 				$selectedfields = (is_array($arrayofmassactions) && count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
@@ -1007,7 +1007,7 @@  discard block
 block discarded – undo
1007 1007
 			print '</tr>';
1008 1008
 
1009 1009
 			if ($num > 0) {
1010
-				require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
1010
+				require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
1011 1011
 
1012 1012
 				$projecttmp = new Project($db);
1013 1013
 
@@ -1030,41 +1030,41 @@  discard block
 block discarded – undo
1030 1030
 								if (in_array($obj->id, $arrayofselected)) {
1031 1031
 									$selected = 1;
1032 1032
 								}
1033
-								print '<input id="cb' . $obj->id . '" class="flat checkforselect" type="checkbox" name="toselect[]" value="' . $obj->id . '"' . ($selected ? ' checked="checked"' : '') . '>';
1033
+								print '<input id="cb'.$obj->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->id.'"'.($selected ? ' checked="checked"' : '').'>';
1034 1034
 							}
1035 1035
 							print '</td>';
1036 1036
 						}
1037 1037
 						// Ref
1038 1038
 						print '<td class="nowraponall">';
1039
-						print $projecttmp->getNomUrl(1, '', 0, '', '-', 0, 1, '', 'project:' . $_SERVER["PHP_SELF"] . '?socid=__SOCID__');
1039
+						print $projecttmp->getNomUrl(1, '', 0, '', '-', 0, 1, '', 'project:'.$_SERVER["PHP_SELF"].'?socid=__SOCID__');
1040 1040
 						print '</td>';
1041 1041
 
1042 1042
 						// Label
1043
-						print '<td class="tdoverflowmax200" title="' . dol_escape_htmltag($obj->title) . '">' . dol_escape_htmltag($obj->title) . '</td>';
1043
+						print '<td class="tdoverflowmax200" title="'.dol_escape_htmltag($obj->title).'">'.dol_escape_htmltag($obj->title).'</td>';
1044 1044
 						// Date start
1045
-						print '<td class="center">' . dol_print_date($db->jdate($obj->do), "day") . '</td>';
1045
+						print '<td class="center">'.dol_print_date($db->jdate($obj->do), "day").'</td>';
1046 1046
 						// Date end
1047
-						print '<td class="center">' . dol_print_date($db->jdate($obj->de), "day") . '</td>';
1047
+						print '<td class="center">'.dol_print_date($db->jdate($obj->de), "day").'</td>';
1048 1048
 						// Opp amount
1049 1049
 						print '<td class="right">';
1050 1050
 						if ($obj->opp_status_code) {
1051
-							print '<span class="amount">' . price($obj->opp_amount, 1, '', 1, -1, -1, '') . '</span>';
1051
+							print '<span class="amount">'.price($obj->opp_amount, 1, '', 1, -1, -1, '').'</span>';
1052 1052
 						}
1053 1053
 						print '</td>';
1054 1054
 						// Opp status
1055 1055
 						print '<td class="center">';
1056 1056
 						if ($obj->opp_status_code) {
1057
-							print $langs->trans("OppStatus" . $obj->opp_status_code);
1057
+							print $langs->trans("OppStatus".$obj->opp_status_code);
1058 1058
 						}
1059 1059
 						print '</td>';
1060 1060
 						// Opp percent
1061 1061
 						print '<td class="right">';
1062 1062
 						if ($obj->opp_percent) {
1063
-							print price($obj->opp_percent, 1, '', 1, 0) . '%';
1063
+							print price($obj->opp_percent, 1, '', 1, 0).'%';
1064 1064
 						}
1065 1065
 						print '</td>';
1066 1066
 						// Status
1067
-						print '<td class="right">' . $projecttmp->getLibStatut(5) . '</td>';
1067
+						print '<td class="right">'.$projecttmp->getLibStatut(5).'</td>';
1068 1068
 
1069 1069
 						// Action column
1070 1070
 						if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
@@ -1074,7 +1074,7 @@  discard block
 block discarded – undo
1074 1074
 								if (in_array($obj->id, $arrayofselected)) {
1075 1075
 									$selected = 1;
1076 1076
 								}
1077
-								print '<input id="cb' . $obj->id . '" class="flat checkforselect" type="checkbox" name="toselect[]" value="' . $obj->id . '"' . ($selected ? ' checked="checked"' : '') . '>';
1077
+								print '<input id="cb'.$obj->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->id.'"'.($selected ? ' checked="checked"' : '').'>';
1078 1078
 							}
1079 1079
 							print '</td>';
1080 1080
 						}
@@ -1083,7 +1083,7 @@  discard block
 block discarded – undo
1083 1083
 					$i++;
1084 1084
 				}
1085 1085
 			} else {
1086
-				print '<tr class="oddeven"><td colspan="9"><span class="opacitymedium">' . $langs->trans("None") . '</span></td></tr>';
1086
+				print '<tr class="oddeven"><td colspan="9"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
1087 1087
 			}
1088 1088
 			$db->free($result);
1089 1089
 		} else {
@@ -1096,18 +1096,18 @@  discard block
 block discarded – undo
1096 1096
 			print load_fiche_titre($langs->trans("ProjectsLinkedToThisThirdParty"), '', '');
1097 1097
 
1098 1098
 
1099
-			print '<div class="div-table-responsive">' . "\n";
1099
+			print '<div class="div-table-responsive">'."\n";
1100 1100
 			print '<table class="noborder centpercent">';
1101 1101
 
1102 1102
 			$sql  = "SELECT p.rowid as id, p.entity, p.title, p.ref, p.public, p.dateo as do, p.datee as de, p.fk_statut as status, p.fk_opp_status, p.opp_amount, p.opp_percent, p.tms as date_update, p.budget_amount";
1103 1103
 			$sql .= ", cls.code as opp_status_code";
1104
-			$sql .= " FROM " . MAIN_DB_PREFIX . "projet as p";
1105
-			$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_lead_status as cls on p.fk_opp_status = cls.rowid";
1106
-			$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "element_contact as ec on p.rowid = ec.element_id";
1107
-			$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "socpeople as sc on ec.fk_socpeople = sc.rowid";
1108
-			$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_type_contact as tc on ec.fk_c_type_contact = tc.rowid";
1109
-			$sql .= " WHERE sc.fk_soc = " . ((int) $object->id);
1110
-			$sql .= " AND p.entity IN (" . getEntity('project') . ")";
1104
+			$sql .= " FROM ".MAIN_DB_PREFIX."projet as p";
1105
+			$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_lead_status as cls on p.fk_opp_status = cls.rowid";
1106
+			$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."element_contact as ec on p.rowid = ec.element_id";
1107
+			$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sc on ec.fk_socpeople = sc.rowid";
1108
+			$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_type_contact as tc on ec.fk_c_type_contact = tc.rowid";
1109
+			$sql .= " WHERE sc.fk_soc = ".((int) $object->id);
1110
+			$sql .= " AND p.entity IN (".getEntity('project').")";
1111 1111
 			$sql .= " AND tc.element = 'project' AND tc.source = 'external'";
1112 1112
 			$sql .= " ORDER BY p.dateo DESC";
1113 1113
 
@@ -1116,18 +1116,18 @@  discard block
 block discarded – undo
1116 1116
 				$num = $db->num_rows($result);
1117 1117
 
1118 1118
 				print '<tr class="liste_titre">';
1119
-				print '<td>' . $langs->trans("Ref") . '</td>';
1120
-				print '<td>' . $langs->trans("Name") . '</td>';
1121
-				print '<td class="center">' . $langs->trans("DateStart") . '</td>';
1122
-				print '<td class="center">' . $langs->trans("DateEnd") . '</td>';
1123
-				print '<td class="right">' . $langs->trans("OpportunityAmountShort") . '</td>';
1124
-				print '<td class="center">' . $langs->trans("OpportunityStatusShort") . '</td>';
1125
-				print '<td class="right">' . $langs->trans("OpportunityProbabilityShort") . '</td>';
1126
-				print '<td class="right">' . $langs->trans("Status") . '</td>';
1119
+				print '<td>'.$langs->trans("Ref").'</td>';
1120
+				print '<td>'.$langs->trans("Name").'</td>';
1121
+				print '<td class="center">'.$langs->trans("DateStart").'</td>';
1122
+				print '<td class="center">'.$langs->trans("DateEnd").'</td>';
1123
+				print '<td class="right">'.$langs->trans("OpportunityAmountShort").'</td>';
1124
+				print '<td class="center">'.$langs->trans("OpportunityStatusShort").'</td>';
1125
+				print '<td class="right">'.$langs->trans("OpportunityProbabilityShort").'</td>';
1126
+				print '<td class="right">'.$langs->trans("Status").'</td>';
1127 1127
 				print '</tr>';
1128 1128
 
1129 1129
 				if ($num > 0) {
1130
-					require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
1130
+					require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
1131 1131
 
1132 1132
 					$projecttmp = new Project($db);
1133 1133
 
@@ -1145,42 +1145,42 @@  discard block
 block discarded – undo
1145 1145
 
1146 1146
 							// Ref
1147 1147
 							print '<td class="nowraponall">';
1148
-							print $projecttmp->getNomUrl(1, '', 0, '', '-', 0, 1, '', 'project:' . $_SERVER["PHP_SELF"] . '?socid=__SOCID__');
1148
+							print $projecttmp->getNomUrl(1, '', 0, '', '-', 0, 1, '', 'project:'.$_SERVER["PHP_SELF"].'?socid=__SOCID__');
1149 1149
 							print '</td>';
1150 1150
 
1151 1151
 							// Label
1152
-							print '<td class="tdoverflowmax200" title="' . dol_escape_htmltag($obj->title) . '">' . dol_escape_htmltag($obj->title) . '</td>';
1152
+							print '<td class="tdoverflowmax200" title="'.dol_escape_htmltag($obj->title).'">'.dol_escape_htmltag($obj->title).'</td>';
1153 1153
 							// Date start
1154
-							print '<td class="center">' . dol_print_date($db->jdate($obj->do), "day") . '</td>';
1154
+							print '<td class="center">'.dol_print_date($db->jdate($obj->do), "day").'</td>';
1155 1155
 							// Date end
1156
-							print '<td class="center">' . dol_print_date($db->jdate($obj->de), "day") . '</td>';
1156
+							print '<td class="center">'.dol_print_date($db->jdate($obj->de), "day").'</td>';
1157 1157
 							// Opp amount
1158 1158
 							print '<td class="right">';
1159 1159
 							if ($obj->opp_status_code) {
1160
-								print '<span class="amount">' . price($obj->opp_amount, 1, '', 1, -1, -1, '') . '</span>';
1160
+								print '<span class="amount">'.price($obj->opp_amount, 1, '', 1, -1, -1, '').'</span>';
1161 1161
 							}
1162 1162
 							print '</td>';
1163 1163
 							// Opp status
1164 1164
 							print '<td class="center">';
1165 1165
 							if ($obj->opp_status_code) {
1166
-								print $langs->trans("OppStatus" . $obj->opp_status_code);
1166
+								print $langs->trans("OppStatus".$obj->opp_status_code);
1167 1167
 							}
1168 1168
 							print '</td>';
1169 1169
 							// Opp percent
1170 1170
 							print '<td class="right">';
1171 1171
 							if ($obj->opp_percent) {
1172
-								print price($obj->opp_percent, 1, '', 1, 0) . '%';
1172
+								print price($obj->opp_percent, 1, '', 1, 0).'%';
1173 1173
 							}
1174 1174
 							print '</td>';
1175 1175
 							// Status
1176
-							print '<td class="right">' . $projecttmp->getLibStatut(5) . '</td>';
1176
+							print '<td class="right">'.$projecttmp->getLibStatut(5).'</td>';
1177 1177
 
1178 1178
 							print '</tr>';
1179 1179
 						}
1180 1180
 						$i++;
1181 1181
 					}
1182 1182
 				} else {
1183
-					print '<tr class="oddeven"><td colspan="8"><span class="opacitymedium">' . $langs->trans("None") . '</span></td></tr>';
1183
+					print '<tr class="oddeven"><td colspan="8"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
1184 1184
 				}
1185 1185
 				$db->free($result);
1186 1186
 			} else {
@@ -1218,7 +1218,7 @@  discard block
 block discarded – undo
1218 1218
 	global $user, $conf, $extrafields, $hookmanager;
1219 1219
 	global $contextpage;
1220 1220
 
1221
-	require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php';
1221
+	require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
1222 1222
 	$formcompany = new FormCompany($db);
1223 1223
 	$form = new Form($db);
1224 1224
 
@@ -1303,7 +1303,7 @@  discard block
 block discarded – undo
1303 1303
 		't.rowid' => array('label' => "TechnicalID", 'checked' => (getDolGlobalString('MAIN_SHOW_TECHNICAL_ID') ? '1' : '0'), 'enabled' => (getDolGlobalString('MAIN_SHOW_TECHNICAL_ID') ? '1' : '0'), 'position' => 1),
1304 1304
 		't.name' => array('label' => "Name", 'checked' => '1', 'position' => 10),
1305 1305
 		't.poste' => array('label' => "PostOrFunction", 'checked' => '1', 'position' => 20),
1306
-		't.address' => array('label' => (empty($conf->dol_optimize_smallscreen) ? $langs->trans("Address") . ' / ' . $langs->trans("Phone") . ' / ' . $langs->trans("Email") : $langs->trans("Address")), 'checked' => '1', 'position' => 30),
1306
+		't.address' => array('label' => (empty($conf->dol_optimize_smallscreen) ? $langs->trans("Address").' / '.$langs->trans("Phone").' / '.$langs->trans("Email") : $langs->trans("Address")), 'checked' => '1', 'position' => 30),
1307 1307
 		't.note_private' => array('label' => 'NotePrivate', 'checked' => '0', 'position' => 35),
1308 1308
 		'sc.role' => array('label' => "ContactByDefaultFor", 'checked' => '1', 'position' => 40),
1309 1309
 		't.birthday' => array('label' => "Birthday", 'checked' => '0', 'position' => 45),
@@ -1314,12 +1314,12 @@  discard block
 block discarded – undo
1314 1314
 	$extrafieldsobjectkey = $contactstatic->table_element;
1315 1315
 	$extrafieldsobjectprefix = 'ef.';
1316 1316
 	$extrafieldspositionoffset = 1000;
1317
-	include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_array_fields.tpl.php';
1317
+	include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
1318 1318
 
1319 1319
 	// Initialize array of search criteria
1320 1320
 	$search = array();
1321 1321
 	foreach ($arrayfields as $key => $val) {
1322
-		$queryName = 'search_' . substr($key, 2);
1322
+		$queryName = 'search_'.substr($key, 2);
1323 1323
 		if (GETPOST($queryName, 'alpha')) {
1324 1324
 			$search[substr($key, 2)] = GETPOST($queryName, 'alpha');
1325 1325
 		}
@@ -1354,7 +1354,7 @@  discard block
 block discarded – undo
1354 1354
 	if (empty($reshook)) {
1355 1355
 		if ($user->hasRight('societe', 'contact', 'creer')) {
1356 1356
 			$addcontact = (getDolGlobalString('SOCIETE_ADDRESSES_MANAGEMENT') ? $langs->trans("AddContact") : $langs->trans("AddContactAddress"));
1357
-			$newcardbutton .= dolGetButtonTitle($addcontact, '', 'fa fa-plus-circle', DOL_URL_ROOT . '/contact/card.php?socid=' . $object->id . '&action=create&backtopage=' . urlencode($backtopage));
1357
+			$newcardbutton .= dolGetButtonTitle($addcontact, '', 'fa fa-plus-circle', DOL_URL_ROOT.'/contact/card.php?socid='.$object->id.'&action=create&backtopage='.urlencode($backtopage));
1358 1358
 		}
1359 1359
 	} else {
1360 1360
 		$newcardbutton = $hookmanager->resPrint;
@@ -1365,75 +1365,75 @@  discard block
 block discarded – undo
1365 1365
 	$title = (getDolGlobalString('SOCIETE_ADDRESSES_MANAGEMENT') ? $langs->trans("ContactsForCompany") : $langs->trans("ContactsAddressesForCompany"));
1366 1366
 	print load_fiche_titre($title, $newcardbutton, 'contact');
1367 1367
 
1368
-	print '<form method="POST" id="searchFormList" action="' . $_SERVER["PHP_SELF"] . '" name="formfilter">';
1369
-	print '<input type="hidden" name="token" value="' . newToken() . '">';
1368
+	print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'" name="formfilter">';
1369
+	print '<input type="hidden" name="token" value="'.newToken().'">';
1370 1370
 	print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
1371
-	print '<input type="hidden" name="socid" value="' . $object->id . '">';
1372
-	print '<input type="hidden" name="sortorder" value="' . $sortorder . '">';
1373
-	print '<input type="hidden" name="sortfield" value="' . $sortfield . '">';
1374
-	print '<input type="hidden" name="page" value="' . $page . '">';
1371
+	print '<input type="hidden" name="socid" value="'.$object->id.'">';
1372
+	print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
1373
+	print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
1374
+	print '<input type="hidden" name="page" value="'.$page.'">';
1375 1375
 
1376 1376
 	$arrayofmassactions = array();
1377 1377
 	$mode = 'view';
1378 1378
 
1379 1379
 	$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
1380
-	$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN'));  // This also change content of $arrayfields with user setup
1380
+	$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup
1381 1381
 	$selectedfields = ($mode != 'kanban' ? $htmlofselectarray : '');
1382 1382
 	$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
1383 1383
 
1384 1384
 	print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
1385
-	print "\n" . '<table class="tagtable liste noborder">' . "\n";
1385
+	print "\n".'<table class="tagtable liste noborder">'."\n";
1386 1386
 
1387
-	$param = "socid=" . urlencode((string) ($object->id));
1387
+	$param = "socid=".urlencode((string) ($object->id));
1388 1388
 	if ($search_rowid != '') {
1389
-		$param .= '&search_rowid=' . urlencode((string) ($search_rowid));
1389
+		$param .= '&search_rowid='.urlencode((string) ($search_rowid));
1390 1390
 	}
1391 1391
 	if ($search_status != '') {
1392
-		$param .= '&search_status=' . urlencode((string) ($search_status));
1392
+		$param .= '&search_status='.urlencode((string) ($search_status));
1393 1393
 	}
1394 1394
 	if (count($search_roles) > 0) {
1395 1395
 		$param .= implode('&search_roles[]=', $search_roles);
1396 1396
 	}
1397 1397
 	if ($search_name != '') {
1398
-		$param .= '&search_name=' . urlencode($search_name);
1398
+		$param .= '&search_name='.urlencode($search_name);
1399 1399
 	}
1400 1400
 	if ($search_poste != '') {
1401
-		$param .= '&search_poste=' . urlencode($search_poste);
1401
+		$param .= '&search_poste='.urlencode($search_poste);
1402 1402
 	}
1403 1403
 	if ($search_address != '') {
1404
-		$param .= '&search_address=' . urlencode($search_address);
1404
+		$param .= '&search_address='.urlencode($search_address);
1405 1405
 	}
1406 1406
 	if ($search_note_private != '') {
1407
-		$param .= '&search_note_private=' . urlencode($search_note_private);
1407
+		$param .= '&search_note_private='.urlencode($search_note_private);
1408 1408
 	}
1409 1409
 	if ($search_birthday_dtstart != '') {
1410
-		$param .= '&search_birthday_dtstart=' . urlencode((string) $search_birthday_dtstart);
1410
+		$param .= '&search_birthday_dtstart='.urlencode((string) $search_birthday_dtstart);
1411 1411
 	}
1412 1412
 	if ($search_birthday_dtend != '') {
1413
-		$param .= '&search_birthday_dtend=' . urlencode((string) $search_birthday_dtend);
1413
+		$param .= '&search_birthday_dtend='.urlencode((string) $search_birthday_dtend);
1414 1414
 	}
1415 1415
 	if ($optioncss != '') {
1416
-		$param .= '&optioncss=' . urlencode($optioncss);
1416
+		$param .= '&optioncss='.urlencode($optioncss);
1417 1417
 	}
1418 1418
 
1419 1419
 	// Add $param from extra fields
1420 1420
 	$extrafieldsobjectkey = $contactstatic->table_element;
1421
-	include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_search_param.tpl.php';
1421
+	include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
1422 1422
 
1423 1423
 	$sql = "SELECT t.rowid, t.entity, t.lastname, t.firstname, t.fk_pays as country_id, t.civility, t.poste,";
1424 1424
 	$sql .= " t.phone as phone_pro, t.phone_mobile, t.phone_perso, t.fax, t.email, t.socialnetworks, t.statut, t.photo, t.fk_soc,";
1425 1425
 	$sql .= " t.civility as civility_id, t.address, t.zip, t.town, t.birthday,";
1426 1426
 	$sql .= " t.note_private";
1427
-	$sql .= " FROM " . MAIN_DB_PREFIX . "socpeople as t";
1428
-	$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "socpeople_extrafields as ef on (t.rowid = ef.fk_object)";
1429
-	$sql .= " WHERE t.fk_soc = " . ((int) $object->id);
1430
-	$sql .= " AND t.entity IN (" . getEntity('socpeople') . ")";
1431
-	$sql .= " AND ((t.fk_user_creat = " . ((int) $user->id) . " AND t.priv = 1) OR t.priv = 0)";
1427
+	$sql .= " FROM ".MAIN_DB_PREFIX."socpeople as t";
1428
+	$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople_extrafields as ef on (t.rowid = ef.fk_object)";
1429
+	$sql .= " WHERE t.fk_soc = ".((int) $object->id);
1430
+	$sql .= " AND t.entity IN (".getEntity('socpeople').")";
1431
+	$sql .= " AND ((t.fk_user_creat = ".((int) $user->id)." AND t.priv = 1) OR t.priv = 0)";
1432 1432
 	if ($search_rowid) {
1433 1433
 		$sql .= natural_search('t.rowid', $search_rowid);
1434 1434
 	}
1435 1435
 	if ($search_status != '' && $search_status != '-1') {
1436
-		$sql .= " AND t.statut = " . ((int) $search_status);
1436
+		$sql .= " AND t.statut = ".((int) $search_status);
1437 1437
 	}
1438 1438
 	if ($search_name) {
1439 1439
 		$sql .= natural_search(array('t.lastname', 't.firstname'), $search_name);
@@ -1448,17 +1448,17 @@  discard block
 block discarded – undo
1448 1448
 		$sql .= natural_search('t.note_private', $search_note_private);
1449 1449
 	}
1450 1450
 	if ($search_birthday_dtstart != '') {
1451
-		$sql .= " AND t.birthday >= '" . $db->idate($search_birthday_dtstart) . "'";
1451
+		$sql .= " AND t.birthday >= '".$db->idate($search_birthday_dtstart)."'";
1452 1452
 	}
1453 1453
 	if ($search_birthday_dtend != '') {
1454
-		$sql .= " AND t.birthday <= '" . $db->idate($search_birthday_dtend) . "'";
1454
+		$sql .= " AND t.birthday <= '".$db->idate($search_birthday_dtend)."'";
1455 1455
 	}
1456 1456
 	if (count($search_roles) > 0) {
1457
-		$sql .= " AND t.rowid IN (SELECT sc.fk_socpeople FROM " . MAIN_DB_PREFIX . "societe_contacts as sc WHERE sc.fk_c_type_contact IN (" . $db->sanitize(implode(',', $search_roles)) . "))";
1457
+		$sql .= " AND t.rowid IN (SELECT sc.fk_socpeople FROM ".MAIN_DB_PREFIX."societe_contacts as sc WHERE sc.fk_c_type_contact IN (".$db->sanitize(implode(',', $search_roles))."))";
1458 1458
 	}
1459 1459
 	// Add where from extra fields
1460 1460
 	$extrafieldsobjectkey = $contactstatic->table_element;
1461
-	include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_search_sql.tpl.php';
1461
+	include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
1462 1462
 	// Add where from hooks
1463 1463
 	$parameters = array('socid' => $object->id);
1464 1464
 	$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object); // Note that $action and $object may have been modified by hook
@@ -1489,16 +1489,16 @@  discard block
 block discarded – undo
1489 1489
 	foreach ($contactstatic->fields as $key => $val) {
1490 1490
 		$align = '';
1491 1491
 		if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) {
1492
-			$align .= ($align ? ' ' : '') . 'center';
1492
+			$align .= ($align ? ' ' : '').'center';
1493 1493
 		}
1494 1494
 		if (in_array($val['type'], array('timestamp'))) {
1495
-			$align .= ($align ? ' ' : '') . 'nowrap';
1495
+			$align .= ($align ? ' ' : '').'nowrap';
1496 1496
 		}
1497 1497
 		if ($key == 'status' || $key == 'statut') {
1498
-			$align .= ($align ? ' ' : '') . 'center';
1498
+			$align .= ($align ? ' ' : '').'center';
1499 1499
 		}
1500
-		if (!empty($arrayfields['t.' . $key]['checked']) || !empty($arrayfields['sc.' . $key]['checked'])) {
1501
-			print '<td class="liste_titre' . ($align ? ' ' . $align : '') . '">';
1500
+		if (!empty($arrayfields['t.'.$key]['checked']) || !empty($arrayfields['sc.'.$key]['checked'])) {
1501
+			print '<td class="liste_titre'.($align ? ' '.$align : '').'">';
1502 1502
 			if (in_array($key, array('statut'))) {
1503 1503
 				print $form->selectarray('search_status', array('-1' => '', '0' => $contactstatic->LibStatut(0, 1), '1' => $contactstatic->LibStatut(1, 1)), $search_status, 0, 0, 0, '', 0, 0, 0, '', 'onrightofpage');
1504 1504
 			} elseif (in_array($key, array('role'))) {
@@ -1511,7 +1511,7 @@  discard block
 block discarded – undo
1511 1511
 				print $form->selectDate($search_birthday_dtend ? $search_birthday_dtend : '', "search_birthday_dtend", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to'));
1512 1512
 				print '</div>';
1513 1513
 			} else {
1514
-				print '<input type="text" class="flat maxwidth75" name="search_' . $key . '" value="' . (!empty($search[$key]) ? dol_escape_htmltag($search[$key]) : '') . '">';
1514
+				print '<input type="text" class="flat maxwidth75" name="search_'.$key.'" value="'.(!empty($search[$key]) ? dol_escape_htmltag($search[$key]) : '').'">';
1515 1515
 			}
1516 1516
 			print '</td>';
1517 1517
 		}
@@ -1521,7 +1521,7 @@  discard block
 block discarded – undo
1521 1521
 	}
1522 1522
 	// Extra fields
1523 1523
 	$extrafieldsobjectkey = $contactstatic->table_element;
1524
-	include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_search_input.tpl.php';
1524
+	include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
1525 1525
 
1526 1526
 	// Fields from hook
1527 1527
 	$parameters = array('arrayfields' => $arrayfields);
@@ -1533,7 +1533,7 @@  discard block
 block discarded – undo
1533 1533
 		print $form->showFilterButtons();
1534 1534
 		print '</td>';
1535 1535
 	}
1536
-	print '</tr>' . "\n";
1536
+	print '</tr>'."\n";
1537 1537
 
1538 1538
 
1539 1539
 	// Fields title label
@@ -1541,44 +1541,44 @@  discard block
 block discarded – undo
1541 1541
 	print '<tr class="liste_titre">';
1542 1542
 	// Action column
1543 1543
 	if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
1544
-		print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'maxwidthsearch center ') . "\n";
1544
+		print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'maxwidthsearch center ')."\n";
1545 1545
 	}
1546 1546
 	foreach ($contactstatic->fields as $key => $val) {
1547 1547
 		$align = '';
1548 1548
 		if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) {
1549
-			$align .= ($align ? ' ' : '') . 'center';
1549
+			$align .= ($align ? ' ' : '').'center';
1550 1550
 		}
1551 1551
 		if (in_array($val['type'], array('timestamp'))) {
1552
-			$align .= ($align ? ' ' : '') . 'nowrap';
1552
+			$align .= ($align ? ' ' : '').'nowrap';
1553 1553
 		}
1554 1554
 		if ($key == 'status' || $key == 'statut') {
1555
-			$align .= ($align ? ' ' : '') . 'center';
1555
+			$align .= ($align ? ' ' : '').'center';
1556 1556
 		}
1557
-		if (!empty($arrayfields['t.' . $key]['checked'])) {
1558
-			print getTitleFieldOfList($val['label'], 0, $_SERVER['PHP_SELF'], 't.' . $key, '', $param, ($align ? 'class="' . $align . '"' : ''), $sortfield, $sortorder, $align . ' ') . "\n";
1557
+		if (!empty($arrayfields['t.'.$key]['checked'])) {
1558
+			print getTitleFieldOfList($val['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($align ? 'class="'.$align.'"' : ''), $sortfield, $sortorder, $align.' ')."\n";
1559 1559
 		}
1560 1560
 		if ($key == 'role') {
1561
-			$align .= ($align ? ' ' : '') . 'left';
1561
+			$align .= ($align ? ' ' : '').'left';
1562 1562
 		}
1563
-		if (!empty($arrayfields['sc.' . $key]['checked'])) {
1564
-			print getTitleFieldOfList($arrayfields['sc.' . $key]['label'], 0, $_SERVER['PHP_SELF'], '', '', $param, ($align ? 'class="' . $align . '"' : ''), $sortfield, $sortorder, $align . ' ') . "\n";
1563
+		if (!empty($arrayfields['sc.'.$key]['checked'])) {
1564
+			print getTitleFieldOfList($arrayfields['sc.'.$key]['label'], 0, $_SERVER['PHP_SELF'], '', '', $param, ($align ? 'class="'.$align.'"' : ''), $sortfield, $sortorder, $align.' ')."\n";
1565 1565
 		}
1566 1566
 	}
1567 1567
 	if ($showuserlogin) {
1568
-		print '<th class="wrapcolumntitle liste_titre">' . $langs->trans("DolibarrLogin") . '</th>';
1568
+		print '<th class="wrapcolumntitle liste_titre">'.$langs->trans("DolibarrLogin").'</th>';
1569 1569
 	}
1570 1570
 	// Extra fields
1571 1571
 	$extrafieldsobjectkey = $contactstatic->table_element;
1572
-	include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_search_title.tpl.php';
1572
+	include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
1573 1573
 	// Hook fields
1574 1574
 	$parameters = array('arrayfields' => $arrayfields, 'param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder);
1575 1575
 	$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook
1576 1576
 	print $hookmanager->resPrint;
1577 1577
 	// Action column
1578 1578
 	if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
1579
-		print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'maxwidthsearch center ') . "\n";
1579
+		print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'maxwidthsearch center ')."\n";
1580 1580
 	}
1581
-	print '</tr>' . "\n";
1581
+	print '</tr>'."\n";
1582 1582
 
1583 1583
 	$i = -1;
1584 1584
 
@@ -1634,21 +1634,21 @@  discard block
 block discarded – undo
1634 1634
 
1635 1635
 				// Add to agenda
1636 1636
 				if (isModEnabled('agenda') && $user->hasRight('agenda', 'myactions', 'create')) {
1637
-					print '<a href="' . DOL_URL_ROOT . '/comm/action/card.php?action=create&actioncode=&contactid=' . $obj->rowid . '&socid=' . $object->id . '&backtopage=' . urlencode($backtopage) . '">';
1637
+					print '<a href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create&actioncode=&contactid='.$obj->rowid.'&socid='.$object->id.'&backtopage='.urlencode($backtopage).'">';
1638 1638
 					print img_object($langs->trans("Event"), "action");
1639 1639
 					print '</a> &nbsp; ';
1640 1640
 				}
1641 1641
 
1642 1642
 				// Edit
1643 1643
 				if ($user->hasRight('societe', 'contact', 'creer')) {
1644
-					print '<a class="editfielda paddingleft" href="' . DOL_URL_ROOT . '/contact/card.php?action=edit&token=' . newToken() . '&id=' . $obj->rowid . '&backtopage=' . urlencode($backtopage) . '">';
1644
+					print '<a class="editfielda paddingleft" href="'.DOL_URL_ROOT.'/contact/card.php?action=edit&token='.newToken().'&id='.$obj->rowid.'&backtopage='.urlencode($backtopage).'">';
1645 1645
 					print img_edit();
1646 1646
 					print '</a>';
1647 1647
 				}
1648 1648
 
1649 1649
 				// Delete
1650 1650
 				if ($user->hasRight('societe', 'contact', 'delete')) {
1651
-					print '<a class="marginleftonly right" href="' . DOL_URL_ROOT . '/societe/contact.php?action=delete&token=' . newToken() . '&id=' . $obj->rowid . '&socid=' . $object->id . '&backtopage=' . urlencode($backtopage) . '">';
1651
+					print '<a class="marginleftonly right" href="'.DOL_URL_ROOT.'/societe/contact.php?action=delete&token='.newToken().'&id='.$obj->rowid.'&socid='.$object->id.'&backtopage='.urlencode($backtopage).'">';
1652 1652
 					print img_delete();
1653 1653
 					print '</a>';
1654 1654
 				}
@@ -1667,13 +1667,13 @@  discard block
 block discarded – undo
1667 1667
 			if (!empty($arrayfields['t.name']['checked'])) {
1668 1668
 				print '<td class="tdoverflowmax150">';
1669 1669
 				print $form->showphoto('contact', $contactstatic, 0, 0, 0, 'photorefnoborder valignmiddle marginrightonly', 'small', 1, 0, 'user');
1670
-				print $contactstatic->getNomUrl(0, '', 0, '&backtopage=' . urlencode($backtopage));
1670
+				print $contactstatic->getNomUrl(0, '', 0, '&backtopage='.urlencode($backtopage));
1671 1671
 				print '</td>';
1672 1672
 			}
1673 1673
 
1674 1674
 			// Job position
1675 1675
 			if (!empty($arrayfields['t.poste']['checked'])) {
1676
-				print '<td class="tdoverflowmax100" title="' . dol_escape_htmltag($obj->poste) . '">';
1676
+				print '<td class="tdoverflowmax100" title="'.dol_escape_htmltag($obj->poste).'">';
1677 1677
 				if ($obj->poste) {
1678 1678
 					print dol_escape_htmltag($obj->poste);
1679 1679
 				}
@@ -1683,7 +1683,7 @@  discard block
 block discarded – undo
1683 1683
 			// Address - Phone - Email
1684 1684
 			if (!empty($arrayfields['t.address']['checked'])) {
1685 1685
 				$addresstoshow = $contactstatic->getBannerAddress('contact', $object);
1686
-				print '<td class="tdoverflowmax150" title="' . dolPrintHTMLForAttribute($addresstoshow) . '">';
1686
+				print '<td class="tdoverflowmax150" title="'.dolPrintHTMLForAttribute($addresstoshow).'">';
1687 1687
 				print $addresstoshow;
1688 1688
 				print '</td>';
1689 1689
 			}
@@ -1711,7 +1711,7 @@  discard block
 block discarded – undo
1711 1711
 
1712 1712
 			// Status
1713 1713
 			if (!empty($arrayfields['t.statut']['checked'])) {
1714
-				print '<td class="center">' . $contactstatic->getLibStatut(5) . '</td>';
1714
+				print '<td class="center">'.$contactstatic->getLibStatut(5).'</td>';
1715 1715
 			}
1716 1716
 
1717 1717
 			if ($showuserlogin) {
@@ -1727,7 +1727,7 @@  discard block
 block discarded – undo
1727 1727
 
1728 1728
 			// Extra fields
1729 1729
 			$extrafieldsobjectkey = $contactstatic->table_element;
1730
-			include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_print_fields.tpl.php';
1730
+			include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
1731 1731
 
1732 1732
 			// Actions
1733 1733
 			if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
@@ -1735,21 +1735,21 @@  discard block
 block discarded – undo
1735 1735
 
1736 1736
 				// Add to agenda
1737 1737
 				if (isModEnabled('agenda') && $user->hasRight('agenda', 'myactions', 'create')) {
1738
-					print '<a href="' . DOL_URL_ROOT . '/comm/action/card.php?action=create&actioncode=&contactid=' . $obj->rowid . '&socid=' . $object->id . '&backtopage=' . urlencode($backtopage) . '">';
1738
+					print '<a href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create&actioncode=&contactid='.$obj->rowid.'&socid='.$object->id.'&backtopage='.urlencode($backtopage).'">';
1739 1739
 					print img_object($langs->trans("Event"), "action");
1740 1740
 					print '</a> &nbsp; ';
1741 1741
 				}
1742 1742
 
1743 1743
 				// Edit
1744 1744
 				if ($user->hasRight('societe', 'contact', 'creer')) {
1745
-					print '<a class="editfielda paddingleft" href="' . DOL_URL_ROOT . '/contact/card.php?action=edit&token=' . newToken() . '&id=' . $obj->rowid . '&backtopage=' . urlencode($backtopage) . '">';
1745
+					print '<a class="editfielda paddingleft" href="'.DOL_URL_ROOT.'/contact/card.php?action=edit&token='.newToken().'&id='.$obj->rowid.'&backtopage='.urlencode($backtopage).'">';
1746 1746
 					print img_edit();
1747 1747
 					print '</a>';
1748 1748
 				}
1749 1749
 
1750 1750
 				// Delete
1751 1751
 				if ($user->hasRight('societe', 'contact', 'delete')) {
1752
-					print '<a class="marginleftonly right" href="' . DOL_URL_ROOT . '/societe/contact.php?action=delete&token=' . newToken() . '&id=' . $obj->rowid . '&socid=' . $object->id . '&backtopage=' . urlencode($backtopage) . '">';
1752
+					print '<a class="marginleftonly right" href="'.DOL_URL_ROOT.'/societe/contact.php?action=delete&token='.newToken().'&id='.$obj->rowid.'&socid='.$object->id.'&backtopage='.urlencode($backtopage).'">';
1753 1753
 					print img_delete();
1754 1754
 					print '</a>';
1755 1755
 				}
@@ -1768,7 +1768,7 @@  discard block
 block discarded – undo
1768 1768
 					$colspan++;
1769 1769
 				}
1770 1770
 			}
1771
-			print '<tr><td colspan="' . $colspan . '"><span class="opacitymedium">' . $langs->trans("NoRecordFound") . '</span></td></tr>';
1771
+			print '<tr><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>';
1772 1772
 		}
1773 1773
 	} else {
1774 1774
 		$colspan = 1 + ($showuserlogin ? 1 : 0);
@@ -1777,12 +1777,12 @@  discard block
 block discarded – undo
1777 1777
 				$colspan++;
1778 1778
 			}
1779 1779
 		}
1780
-		print '<tr><td colspan="' . $colspan . '"><span class="opacitymedium">' . $langs->trans("None") . '</span></td></tr>';
1780
+		print '<tr><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
1781 1781
 	}
1782 1782
 	print "\n</table>\n";
1783 1783
 	print '</div>';
1784 1784
 
1785
-	print '</form>' . "\n";
1785
+	print '</form>'."\n";
1786 1786
 
1787 1787
 	return $i;
1788 1788
 }
@@ -1857,7 +1857,7 @@  discard block
 block discarded – undo
1857 1857
 		$tms_start = '';
1858 1858
 		$tms_end = '';
1859 1859
 	}
1860
-	require_once DOL_DOCUMENT_ROOT . '/comm/action/class/actioncomm.class.php';
1860
+	require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
1861 1861
 
1862 1862
 	// Check parameters
1863 1863
 	if (!is_object($filterobj) && !is_object($objcon)) {
@@ -1923,16 +1923,16 @@  discard block
 block discarded – undo
1923 1923
 
1924 1924
 		// Fields from hook
1925 1925
 		$parameters = array('sql' => &$sql, 'filterobj' => $filterobj, 'objcon' => $objcon);
1926
-		$reshook = $hookmanager->executeHooks('showActionsDoneListSelect', $parameters);    // Note that $action and $object may have been modified by hook
1926
+		$reshook = $hookmanager->executeHooks('showActionsDoneListSelect', $parameters); // Note that $action and $object may have been modified by hook
1927 1927
 		if (!empty($hookmanager->resPrint)) {
1928 1928
 			$sql .= $hookmanager->resPrint;
1929 1929
 		}
1930 1930
 
1931
-		$sql .= " FROM " . MAIN_DB_PREFIX . "actioncomm as a";
1931
+		$sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as a";
1932 1932
 		// Link to the owner of action
1933
-		$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "user as u on u.rowid = a.fk_user_action";
1933
+		$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as u on u.rowid = a.fk_user_action";
1934 1934
 		// Link to action types
1935
-		$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_actioncomm as c ON a.fk_action = c.id";
1935
+		$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_actioncomm as c ON a.fk_action = c.id";
1936 1936
 
1937 1937
 		// Set $force_filter_contact:
1938 1938
 		// - true for a filter on a user or a contact, so a link on table llx_actioncomm_resources or llx_actioncomm.fk_user_action
@@ -1947,101 +1947,101 @@  discard block
 block discarded – undo
1947 1947
 
1948 1948
 		// Fields from hook
1949 1949
 		$parameters = array('sql' => &$sql, 'filterobj' => $filterobj, 'objcon' => $objcon);
1950
-		$reshook = $hookmanager->executeHooks('showActionsDoneListFrom', $parameters);    // Note that $action and $object may have been modified by hook
1950
+		$reshook = $hookmanager->executeHooks('showActionsDoneListFrom', $parameters); // Note that $action and $object may have been modified by hook
1951 1951
 		if (!empty($hookmanager->resPrint)) {
1952 1952
 			$sql .= $hookmanager->resPrint;
1953 1953
 		}
1954 1954
 		if (is_object($filterobj) && in_array(get_class($filterobj), array('Societe', 'Client', 'Fournisseur'))) {
1955
-			$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "socpeople as sp ON a.fk_contact = sp.rowid";
1955
+			$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid";
1956 1956
 		} elseif (is_object($filterobj) && get_class($filterobj) == 'Dolresource') {
1957
-			$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "element_resources as er";
1957
+			$sql .= " INNER JOIN ".MAIN_DB_PREFIX."element_resources as er";
1958 1958
 			$sql .= " ON er.resource_type = 'dolresource'";
1959 1959
 			$sql .= " AND er.element_type = 'action'";
1960 1960
 			$sql .= " AND er.element_id = a.id";
1961
-			$sql .= " AND er.resource_id = " . ((int) $filterobj->id);
1961
+			$sql .= " AND er.resource_id = ".((int) $filterobj->id);
1962 1962
 		} elseif (is_object($filterobj) && get_class($filterobj) == 'Project') {
1963 1963
 			/* Nothing */
1964 1964
 		} elseif (is_object($filterobj) && get_class($filterobj) == 'Adherent') {
1965
-			$sql .= ", " . MAIN_DB_PREFIX . "adherent as m";
1965
+			$sql .= ", ".MAIN_DB_PREFIX."adherent as m";
1966 1966
 		} elseif (is_object($filterobj) && get_class($filterobj) == 'CommandeFournisseur') {
1967
-			$sql .= ", " . MAIN_DB_PREFIX . "commande_fournisseur as o";
1967
+			$sql .= ", ".MAIN_DB_PREFIX."commande_fournisseur as o";
1968 1968
 		} elseif (is_object($filterobj) && get_class($filterobj) == 'Product') {
1969
-			$sql .= ", " . MAIN_DB_PREFIX . "product as o";
1969
+			$sql .= ", ".MAIN_DB_PREFIX."product as o";
1970 1970
 		} elseif (is_object($filterobj) && get_class($filterobj) == 'Ticket') {
1971
-			$sql .= ", " . MAIN_DB_PREFIX . "ticket as o";
1971
+			$sql .= ", ".MAIN_DB_PREFIX."ticket as o";
1972 1972
 		} elseif (is_object($filterobj) && get_class($filterobj) == 'BOM') {
1973
-			$sql .= ", " . MAIN_DB_PREFIX . "bom_bom as o";
1973
+			$sql .= ", ".MAIN_DB_PREFIX."bom_bom as o";
1974 1974
 		} elseif (is_object($filterobj) && get_class($filterobj) == 'Contrat') {
1975
-			$sql .= ", " . MAIN_DB_PREFIX . "contrat as o";
1975
+			$sql .= ", ".MAIN_DB_PREFIX."contrat as o";
1976 1976
 		} elseif (is_object($filterobj) && get_class($filterobj) == 'Expedition') {
1977
-			$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "expedition as s ON a.fk_element = s.rowid AND a.elementtype = 'shipping'"; // Jointure sur la table des expéditions avec condition ON
1977
+			$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."expedition as s ON a.fk_element = s.rowid AND a.elementtype = 'shipping'"; // Jointure sur la table des expéditions avec condition ON
1978 1978
 		} elseif (is_object($filterobj) && get_class($filterobj) == 'Propal') {
1979
-			$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "propal as o ON a.fk_element = o.rowid AND a.elementtype = 'propal'";
1979
+			$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."propal as o ON a.fk_element = o.rowid AND a.elementtype = 'propal'";
1980 1980
 		} elseif (
1981 1981
 			is_object($filterobj) && is_array($filterobj->fields) && is_array($filterobj->fields['rowid'])
1982 1982
 			&& ((!empty($filterobj->fields['ref']) && is_array($filterobj->fields['ref'])) || (!empty($filterobj->fields['label']) && is_array($filterobj->fields['label'])) || (!empty($filterobj->fields['titre']) && is_array($filterobj->fields['titre'])))  // @phan-suppress-current-line PhanTypeInvalidDimOffset
1983 1983
 			&& $filterobj->table_element && $filterobj->element
1984 1984
 		) {
1985
-			$sql .= ", " . MAIN_DB_PREFIX . $filterobj->table_element . " as o";
1985
+			$sql .= ", ".MAIN_DB_PREFIX.$filterobj->table_element." as o";
1986 1986
 		}
1987 1987
 
1988
-		$sql .= " WHERE a.entity IN (" . getEntity('agenda') . ")";
1988
+		$sql .= " WHERE a.entity IN (".getEntity('agenda').")";
1989 1989
 		if (!$force_filter_contact) {
1990 1990
 			if (is_object($filterobj) && in_array(get_class($filterobj), array('Societe', 'Client', 'Fournisseur')) && $filterobj->id) {
1991
-				$sql .= " AND a.fk_soc = " . ((int) $filterobj->id);
1991
+				$sql .= " AND a.fk_soc = ".((int) $filterobj->id);
1992 1992
 			} elseif (is_object($filterobj) && get_class($filterobj) == 'Dolresource') {
1993 1993
 				/* Nothing */
1994 1994
 			} elseif (is_object($filterobj) && get_class($filterobj) == 'Project' && $filterobj->id) {
1995
-				$sql .= " AND a.fk_project = " . ((int) $filterobj->id);
1995
+				$sql .= " AND a.fk_project = ".((int) $filterobj->id);
1996 1996
 			} elseif (is_object($filterobj) && get_class($filterobj) == 'Adherent') {
1997 1997
 				$sql .= " AND a.fk_element = m.rowid AND a.elementtype = 'member'";
1998 1998
 				if ($filterobj->id) {
1999
-					$sql .= " AND a.fk_element = " . ((int) $filterobj->id);
1999
+					$sql .= " AND a.fk_element = ".((int) $filterobj->id);
2000 2000
 				}
2001 2001
 			} elseif (is_object($filterobj) && get_class($filterobj) == 'Commande') {
2002 2002
 				$sql .= " AND a.fk_element = o.rowid AND a.elementtype = 'order'";
2003 2003
 				if ($filterobj->id) {
2004
-					$sql .= " AND a.fk_element = " . ((int) $filterobj->id);
2004
+					$sql .= " AND a.fk_element = ".((int) $filterobj->id);
2005 2005
 				}
2006 2006
 			} elseif (is_object($filterobj) && get_class($filterobj) == 'CommandeFournisseur') {
2007 2007
 				$sql .= " AND a.fk_element = o.rowid AND a.elementtype = 'order_supplier'";
2008 2008
 				if ($filterobj->id) {
2009
-					$sql .= " AND a.fk_element = " . ((int) $filterobj->id);
2009
+					$sql .= " AND a.fk_element = ".((int) $filterobj->id);
2010 2010
 				}
2011 2011
 			} elseif (is_object($filterobj) && get_class($filterobj) == 'Facture') {
2012 2012
 				$sql .= " AND a.fk_element = o.rowid AND a.elementtype = 'invoice'";
2013 2013
 				if ($filterobj->id) {
2014
-					$sql .= " AND a.fk_element = " . ((int) $filterobj->id);
2014
+					$sql .= " AND a.fk_element = ".((int) $filterobj->id);
2015 2015
 				}
2016 2016
 			} elseif (is_object($filterobj) && get_class($filterobj) == 'FactureFournisseur') {
2017 2017
 				$sql .= " AND a.fk_element = o.rowid AND a.elementtype = 'invoice_supplier'";
2018 2018
 				if ($filterobj->id) {
2019
-					$sql .= " AND a.fk_element = " . ((int) $filterobj->id);
2019
+					$sql .= " AND a.fk_element = ".((int) $filterobj->id);
2020 2020
 				}
2021 2021
 			} elseif (is_object($filterobj) && get_class($filterobj) == 'Product') {
2022 2022
 				$sql .= " AND a.fk_element = o.rowid AND a.elementtype = 'product'";
2023 2023
 				if ($filterobj->id) {
2024
-					$sql .= " AND a.fk_element = " . ((int) $filterobj->id);
2024
+					$sql .= " AND a.fk_element = ".((int) $filterobj->id);
2025 2025
 				}
2026 2026
 			} elseif (is_object($filterobj) && get_class($filterobj) == 'Ticket') {
2027 2027
 				$sql .= " AND a.fk_element = o.rowid AND a.elementtype = 'ticket'";
2028 2028
 				if ($filterobj->id) {
2029
-					$sql .= " AND a.fk_element = " . ((int) $filterobj->id);
2029
+					$sql .= " AND a.fk_element = ".((int) $filterobj->id);
2030 2030
 				}
2031 2031
 			} elseif (is_object($filterobj) && get_class($filterobj) == 'BOM') {
2032 2032
 				$sql .= " AND a.fk_element = o.rowid AND a.elementtype = 'bom'";
2033 2033
 				if ($filterobj->id) {
2034
-					$sql .= " AND a.fk_element = " . ((int) $filterobj->id);
2034
+					$sql .= " AND a.fk_element = ".((int) $filterobj->id);
2035 2035
 				}
2036 2036
 			} elseif (is_object($filterobj) && get_class($filterobj) == 'Contrat') {
2037 2037
 				$sql .= " AND a.fk_element = o.rowid AND a.elementtype = 'contract'";
2038 2038
 				if ($filterobj->id) {
2039
-					$sql .= " AND a.fk_element = " . ((int) $filterobj->id);
2039
+					$sql .= " AND a.fk_element = ".((int) $filterobj->id);
2040 2040
 				}
2041 2041
 			} elseif (is_object($filterobj) && get_class($filterobj) == 'Expedition') {
2042 2042
 				$sql .= " AND a.fk_element = s.rowid AND a.elementtype = 'shipping'"; //expedition filter
2043 2043
 				if ($filterobj->id) {
2044
-					$sql .= " AND a.fk_element = " . ((int) $filterobj->id);
2044
+					$sql .= " AND a.fk_element = ".((int) $filterobj->id);
2045 2045
 				}
2046 2046
 			} elseif (
2047 2047
 				is_object($filterobj) && is_array($filterobj->fields) && is_array($filterobj->fields['rowid'])
@@ -2049,32 +2049,32 @@  discard block
 block discarded – undo
2049 2049
 				&& $filterobj->table_element && $filterobj->element
2050 2050
 			) {
2051 2051
 				// Generic case (if there is a $filterobj and a field rowid and (ref or label) exists.
2052
-				$sql .= " AND a.fk_element = o.rowid AND a.elementtype = '" . $db->escape($filterobj->element) . ($module ? "@" . $module : "") . "'";
2052
+				$sql .= " AND a.fk_element = o.rowid AND a.elementtype = '".$db->escape($filterobj->element).($module ? "@".$module : "")."'";
2053 2053
 				if ($filterobj->id) {
2054
-					$sql .= " AND a.fk_element = " . ((int) $filterobj->id);
2054
+					$sql .= " AND a.fk_element = ".((int) $filterobj->id);
2055 2055
 				}
2056 2056
 			} elseif (is_object($filterobj)) {
2057 2057
 				return 'Bad value for $filterobj';
2058 2058
 			}
2059 2059
 		} else {
2060 2060
 			if (is_object($filterobj) && $filterobj->id > 0 && get_class($filterobj) == 'User') {
2061
-				$sql .= " AND (u.rowid = " . ((int) $filterobj->id) . ' OR ';
2062
-				$sql .= " EXISTS (SELECT r.rowid FROM " . MAIN_DB_PREFIX . "actioncomm_resources as r WHERE a.id = r.fk_actioncomm";
2063
-				$sql .= " AND r.element_type = '" . $db->escape($filterobj->table_element) . "' AND r.fk_element = " . ((int) $filterobj->id) . ')';
2061
+				$sql .= " AND (u.rowid = ".((int) $filterobj->id).' OR ';
2062
+				$sql .= " EXISTS (SELECT r.rowid FROM ".MAIN_DB_PREFIX."actioncomm_resources as r WHERE a.id = r.fk_actioncomm";
2063
+				$sql .= " AND r.element_type = '".$db->escape($filterobj->table_element)."' AND r.fk_element = ".((int) $filterobj->id).')';
2064 2064
 				$sql .= ")";
2065 2065
 			}
2066 2066
 			if (is_object($objcon) && $objcon->id > 0) {
2067
-				$sql .= " AND EXISTS (SELECT r.rowid FROM " . MAIN_DB_PREFIX . "actioncomm_resources as r WHERE a.id = r.fk_actioncomm";
2068
-				$sql .= " AND r.element_type = '" . $db->escape($objcon->table_element) . "' AND r.fk_element = " . ((int) $objcon->id) . ')';
2067
+				$sql .= " AND EXISTS (SELECT r.rowid FROM ".MAIN_DB_PREFIX."actioncomm_resources as r WHERE a.id = r.fk_actioncomm";
2068
+				$sql .= " AND r.element_type = '".$db->escape($objcon->table_element)."' AND r.fk_element = ".((int) $objcon->id).')';
2069 2069
 			}
2070 2070
 		}
2071 2071
 
2072 2072
 		if (!empty($tms_start) && !empty($tms_end)) {
2073
-			$sql .= " AND ((a.datep BETWEEN '" . $db->idate($tms_start) . "' AND '" . $db->idate($tms_end) . "') OR (a.datep2 BETWEEN '" . $db->idate($tms_start) . "' AND '" . $db->idate($tms_end) . "'))";
2073
+			$sql .= " AND ((a.datep BETWEEN '".$db->idate($tms_start)."' AND '".$db->idate($tms_end)."') OR (a.datep2 BETWEEN '".$db->idate($tms_start)."' AND '".$db->idate($tms_end)."'))";
2074 2074
 		} elseif (empty($tms_start) && !empty($tms_end)) {
2075
-			$sql .= " AND ((a.datep <= '" . $db->idate($tms_end) . "') OR (a.datep2 <= '" . $db->idate($tms_end) . "'))";
2075
+			$sql .= " AND ((a.datep <= '".$db->idate($tms_end)."') OR (a.datep2 <= '".$db->idate($tms_end)."'))";
2076 2076
 		} elseif (!empty($tms_start) && empty($tms_end)) {
2077
-			$sql .= " AND ((a.datep >= '" . $db->idate($tms_start) . "') OR (a.datep2 >= '" . $db->idate($tms_start) . "'))";
2077
+			$sql .= " AND ((a.datep >= '".$db->idate($tms_start)."') OR (a.datep2 >= '".$db->idate($tms_start)."'))";
2078 2078
 		}
2079 2079
 
2080 2080
 		if (is_array($actioncode) && !empty($actioncode)) {
@@ -2104,7 +2104,7 @@  discard block
 block discarded – undo
2104 2104
 
2105 2105
 		// Fields from hook
2106 2106
 		$parameters = array('sql' => &$sql, 'filterobj' => $filterobj, 'objcon' => $objcon, 'module' => $module);
2107
-		$reshook = $hookmanager->executeHooks('showActionsDoneListWhere', $parameters);    // Note that $action and $object may have been modified by hook
2107
+		$reshook = $hookmanager->executeHooks('showActionsDoneListWhere', $parameters); // Note that $action and $object may have been modified by hook
2108 2108
 		if (!empty($hookmanager->resPrint)) {
2109 2109
 			$sql .= $hookmanager->resPrint;
2110 2110
 		}
@@ -2115,7 +2115,7 @@  discard block
 block discarded – undo
2115 2115
 				$sql2 = addMailingEventTypeSQL($code, $objcon, $filterobj);
2116 2116
 				if (!empty($sql2)) {
2117 2117
 					if (!empty($sql)) {
2118
-						$sql = $sql . " UNION " . $sql2;
2118
+						$sql = $sql." UNION ".$sql2;
2119 2119
 					} elseif (empty($sql)) {
2120 2120
 						$sql = $sql2;
2121 2121
 					}
@@ -2125,7 +2125,7 @@  discard block
 block discarded – undo
2125 2125
 		} else {
2126 2126
 			$sql2 = addMailingEventTypeSQL($actioncode, $objcon, $filterobj);
2127 2127
 			if (!empty($sql) && !empty($sql2)) {
2128
-				$sql = $sql . " UNION " . $sql2;
2128
+				$sql = $sql." UNION ".$sql2;
2129 2129
 			} elseif (empty($sql) && !empty($sql2)) {
2130 2130
 				$sql = $sql2;
2131 2131
 			}
@@ -2236,10 +2236,10 @@  discard block
 block discarded – undo
2236 2236
 	if (isModEnabled('agenda') || (isModEnabled('mailing') && !empty($objcon->email))) {
2237 2237
 		$delay_warning = getDolGlobalInt('MAIN_DELAY_ACTIONS_TODO') * 24 * 60 * 60;
2238 2238
 
2239
-		require_once DOL_DOCUMENT_ROOT . '/comm/action/class/actioncomm.class.php';
2240
-		include_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php';
2241
-		require_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
2242
-		require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php';
2239
+		require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
2240
+		include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
2241
+		require_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
2242
+		require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
2243 2243
 
2244 2244
 		$formactions = new FormActions($db);
2245 2245
 
@@ -2249,20 +2249,20 @@  discard block
 block discarded – undo
2249 2249
 		$contactstatic = new Contact($db);
2250 2250
 		$elementlinkcache = array();
2251 2251
 
2252
-		$out .= '<form name="listactionsfilter" class="listactionsfilter" action="' . $_SERVER["PHP_SELF"] . '" method="POST">';
2253
-		$out .= '<input type="hidden" name="token" value="' . newToken() . '">';
2252
+		$out .= '<form name="listactionsfilter" class="listactionsfilter" action="'.$_SERVER["PHP_SELF"].'" method="POST">';
2253
+		$out .= '<input type="hidden" name="token" value="'.newToken().'">';
2254 2254
 		if (
2255 2255
 			$objcon && get_class($objcon) == 'Contact' &&
2256 2256
 			(is_null($filterobj) || get_class($filterobj) == 'Societe')
2257 2257
 		) {
2258
-			$out .= '<input type="hidden" name="id" value="' . $objcon->id . '" />';
2258
+			$out .= '<input type="hidden" name="id" value="'.$objcon->id.'" />';
2259 2259
 		} else {
2260
-			$out .= '<input type="hidden" name="id" value="' . $filterobj->id . '" />';
2260
+			$out .= '<input type="hidden" name="id" value="'.$filterobj->id.'" />';
2261 2261
 		}
2262 2262
 		if ($filterobj && get_class($filterobj) == 'Societe') {
2263
-			$out .= '<input type="hidden" name="socid" value="' . $filterobj->id . '" />';
2263
+			$out .= '<input type="hidden" name="socid" value="'.$filterobj->id.'" />';
2264 2264
 		} else {
2265
-			$out .= '<input type="hidden" name="userid" value="' . $filterobj->id . '" />';
2265
+			$out .= '<input type="hidden" name="userid" value="'.$filterobj->id.'" />';
2266 2266
 		}
2267 2267
 
2268 2268
 		$out .= "\n";
@@ -2285,7 +2285,7 @@  discard block
 block discarded – undo
2285 2285
 		}
2286 2286
 
2287 2287
 		// ID
2288
-		$out .= '<td class="liste_titre"><input type="text" class="width50" name="search_rowid" value="' . (isset($filters['search_rowid']) ? $filters['search_rowid'] : '') . '"></td>';
2288
+		$out .= '<td class="liste_titre"><input type="text" class="width50" name="search_rowid" value="'.(isset($filters['search_rowid']) ? $filters['search_rowid'] : '').'"></td>';
2289 2289
 		// Date
2290 2290
 		$out .= '<td class="liste_titre center">';
2291 2291
 		$out .= $form->selectDateToDate($tms_start, $tms_end, 'dateevent', 1);
@@ -2297,7 +2297,7 @@  discard block
 block discarded – undo
2297 2297
 		$out .= $formactions->select_type_actions($actioncode, "actioncode", '', getDolGlobalString('AGENDA_USE_EVENT_TYPE') ? -1 : 1, 0, (getDolGlobalString('AGENDA_USE_MULTISELECT_TYPE') ? 1 : 0), 1, 'selecttype combolargeelem minwidth100 maxwidth150', 1);
2298 2298
 		$out .= '</td>';
2299 2299
 		// Label
2300
-		$out .= '<td class="liste_titre maxwidth100onsmartphone"><input type="text" class="maxwidth100onsmartphone" name="search_agenda_label" value="' . $filters['search_agenda_label'] . '"></td>';
2300
+		$out .= '<td class="liste_titre maxwidth100onsmartphone"><input type="text" class="maxwidth100onsmartphone" name="search_agenda_label" value="'.$filters['search_agenda_label'].'"></td>';
2301 2301
 		$out .= '<td class="liste_titre"></td>';
2302 2302
 		$out .= '<td class="liste_titre"></td>';
2303 2303
 		$out .= '<td class="liste_titre"></td>';
@@ -2318,10 +2318,10 @@  discard block
 block discarded – undo
2318 2318
 		if ($donetodo && $filterobj !== null) {
2319 2319
 			$tmp = '';
2320 2320
 			if (get_class($filterobj) == 'Societe') {
2321
-				$tmp .= '<a href="' . DOL_URL_ROOT . '/comm/action/list.php?mode=show_list&socid=' . $filterobj->id . '&status=done">';
2321
+				$tmp .= '<a href="'.DOL_URL_ROOT.'/comm/action/list.php?mode=show_list&socid='.$filterobj->id.'&status=done">';
2322 2322
 			}
2323 2323
 			if (get_class($filterobj) == 'User') {
2324
-				$tmp .= '<a href="' . DOL_URL_ROOT . '/comm/action/list.php?mode=show_list&userid=' . $filterobj->id . '&status=done">';
2324
+				$tmp .= '<a href="'.DOL_URL_ROOT.'/comm/action/list.php?mode=show_list&userid='.$filterobj->id.'&status=done">';
2325 2325
 			}
2326 2326
 			$tmp .= ($donetodo != 'done' ? $langs->trans("ActionsToDoShort") : '');
2327 2327
 			$tmp .= ($donetodo != 'done' && $donetodo != 'todo' ? ' / ' : '');
@@ -2349,7 +2349,7 @@  discard block
 block discarded – undo
2349 2349
 		}
2350 2350
 		$out .= '</tr>';
2351 2351
 
2352
-		require_once DOL_DOCUMENT_ROOT . '/comm/action/class/cactioncomm.class.php';
2352
+		require_once DOL_DOCUMENT_ROOT.'/comm/action/class/cactioncomm.class.php';
2353 2353
 		$caction = new CActionComm($db);
2354 2354
 		$arraylist = $caction->liste_array(1, 'code', '', (getDolGlobalString('AGENDA_USE_EVENT_TYPE') ? 0 : 1), '', 1);
2355 2355
 
@@ -2378,7 +2378,7 @@  discard block
 block discarded – undo
2378 2378
 			// Ref
2379 2379
 			$out .= '<td class="nowraponall">';
2380 2380
 			if (isset($histo[$key]['type']) && $histo[$key]['type'] == 'mailing') {
2381
-				$out .= '<a href="' . DOL_URL_ROOT . '/comm/mailing/card.php?id=' . $histo[$key]['id'] . '">' . img_object($langs->trans("ShowEMailing"), "email") . ' ';
2381
+				$out .= '<a href="'.DOL_URL_ROOT.'/comm/mailing/card.php?id='.$histo[$key]['id'].'">'.img_object($langs->trans("ShowEMailing"), "email").' ';
2382 2382
 				$out .= $histo[$key]['id'];
2383 2383
 				$out .= '</a>';
2384 2384
 			} else {
@@ -2393,9 +2393,9 @@  discard block
 block discarded – undo
2393 2393
 				$tmpa = dol_getdate($histo[$key]['datestart'], true);
2394 2394
 				$tmpb = dol_getdate($histo[$key]['dateend'], true);
2395 2395
 				if ($tmpa['mday'] == $tmpb['mday'] && $tmpa['mon'] == $tmpb['mon'] && $tmpa['year'] == $tmpb['year']) {
2396
-					$out .= '-' . dol_print_date($histo[$key]['dateend'], 'hour', 'tzuserrel');
2396
+					$out .= '-'.dol_print_date($histo[$key]['dateend'], 'hour', 'tzuserrel');
2397 2397
 				} else {
2398
-					$out .= '-' . dol_print_date($histo[$key]['dateend'], 'dayhour', 'tzuserrel');
2398
+					$out .= '-'.dol_print_date($histo[$key]['dateend'], 'dayhour', 'tzuserrel');
2399 2399
 				}
2400 2400
 			}
2401 2401
 			$late = 0;
@@ -2412,7 +2412,7 @@  discard block
 block discarded – undo
2412 2412
 				$late = 1;
2413 2413
 			}
2414 2414
 			if ($late) {
2415
-				$out .= img_warning($langs->trans("Late")) . ' ';
2415
+				$out .= img_warning($langs->trans("Late")).' ';
2416 2416
 			}
2417 2417
 			$out .= "</td>\n";
2418 2418
 
@@ -2450,7 +2450,7 @@  discard block
 block discarded – undo
2450 2450
 					$labelOfTypeToShow = $langs->trans("Emailing");
2451 2451
 				}
2452 2452
 				if ($actionstatic->type_code == 'AC_OTH_AUTO' && ($actionstatic->type_code != $actionstatic->code) && $labelOfTypeToShow && !empty($arraylist[$actionstatic->code])) {
2453
-					$labelOfTypeToShow .= ' - ' . $arraylist[$actionstatic->code]; // Show also detailed code
2453
+					$labelOfTypeToShow .= ' - '.$arraylist[$actionstatic->code]; // Show also detailed code
2454 2454
 				}
2455 2455
 			}
2456 2456
 
@@ -2459,7 +2459,7 @@  discard block
 block discarded – undo
2459 2459
 				$labelOfTypeToShowLong .= ' (auto)';
2460 2460
 			}
2461 2461
 
2462
-			$out .= '<td class="tdoverflowmax125" title="' . $labelOfTypeToShowLong . '">';
2462
+			$out .= '<td class="tdoverflowmax125" title="'.$labelOfTypeToShowLong.'">';
2463 2463
 			$out .= $actionstatic->getTypePicto();
2464 2464
 			//if (empty($conf->dol_optimize_smallscreen)) {
2465 2465
 			$out .= $labelOfTypeToShow;
@@ -2469,19 +2469,19 @@  discard block
 block discarded – undo
2469 2469
 			// Title/Label of event
2470 2470
 			$out .= '<td class="tdoverflowmax300"';
2471 2471
 			if (isset($histo[$key]['type']) && $histo[$key]['type'] == 'action') {
2472
-				$transcode = $langs->trans("Action" . $histo[$key]['acode']);
2472
+				$transcode = $langs->trans("Action".$histo[$key]['acode']);
2473 2473
 				//$libelle = ($transcode != "Action".$histo[$key]['acode'] ? $transcode : $histo[$key]['alabel']);
2474 2474
 				$label = $histo[$key]['note'];
2475 2475
 				$actionstatic->id = $histo[$key]['id'];
2476
-				$out .= ' title="' . dol_escape_htmltag($label) . '">';
2476
+				$out .= ' title="'.dol_escape_htmltag($label).'">';
2477 2477
 				$out .= dol_trunc($label, 120);
2478 2478
 			}
2479 2479
 			if (isset($histo[$key]['type']) && $histo[$key]['type'] == 'mailing') {
2480
-				$transcode = $langs->trans("Action" . $histo[$key]['acode']);
2481
-				$label = ($transcode != "Action" . $histo[$key]['acode'] ? $transcode : 'Send mass mailing');
2482
-				$label .= ' - ' . $histo[$key]['note'];
2483
-				$out .= '<a href="' . DOL_URL_ROOT . '/comm/mailing/card.php?id=' . $histo[$key]['id'] . '"';
2484
-				$out .= ' title="' . dol_escape_htmltag($label) . '">';
2480
+				$transcode = $langs->trans("Action".$histo[$key]['acode']);
2481
+				$label = ($transcode != "Action".$histo[$key]['acode'] ? $transcode : 'Send mass mailing');
2482
+				$label .= ' - '.$histo[$key]['note'];
2483
+				$out .= '<a href="'.DOL_URL_ROOT.'/comm/mailing/card.php?id='.$histo[$key]['id'].'"';
2484
+				$out .= ' title="'.dol_escape_htmltag($label).'">';
2485 2485
 				//$out .= img_object($langs->trans("EMailing").'<br>'.$histo[$key]['note'], "email").' ';
2486 2486
 				$out .= dol_trunc($label, 120);
2487 2487
 				$out .= '</a>';
@@ -2519,7 +2519,7 @@  discard block
 block discarded – undo
2519 2519
 						$out .= $contact->getNomUrl(-3, '', 10, '', -1, 0, 'paddingright');
2520 2520
 						if (isset($histo[$key]['acode']) && $histo[$key]['acode'] == 'AC_TEL') {
2521 2521
 							if (!empty($contact->phone_pro)) {
2522
-								$out .= '(' . dol_print_phone($contact->phone_pro) . ')';
2522
+								$out .= '('.dol_print_phone($contact->phone_pro).')';
2523 2523
 							}
2524 2524
 						}
2525 2525
 						$out .= '<div class="paddingright"></div>';
@@ -2531,13 +2531,13 @@  discard block
 block discarded – undo
2531 2531
 				$contactstatic->firstname = $histo[$key]['firstname'];
2532 2532
 				$contactstatic->id = $histo[$key]['contact_id'];
2533 2533
 				$contactstatic->photo = $histo[$key]['contact_photo'];
2534
-				$out .= '<td width="120">' . $contactstatic->getNomUrl(-1, '', 10) . '</td>';
2534
+				$out .= '<td width="120">'.$contactstatic->getNomUrl(-1, '', 10).'</td>';
2535 2535
 			} else {
2536 2536
 				$out .= '<td>&nbsp;</td>';
2537 2537
 			}
2538 2538
 
2539 2539
 			// Status / Progression
2540
-			$out .= '<td class="nowrap center">' . $actionstatic->LibStatut($histo[$key]['percent'], 2, 0, $histo[$key]['datestart']) . '</td>';
2540
+			$out .= '<td class="nowrap center">'.$actionstatic->LibStatut($histo[$key]['percent'], 2, 0, $histo[$key]['datestart']).'</td>';
2541 2541
 
2542 2542
 			// Action column
2543 2543
 			if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
@@ -2548,7 +2548,7 @@  discard block
 block discarded – undo
2548 2548
 		}
2549 2549
 		if (empty($histo)) {
2550 2550
 			$colspan = 9;
2551
-			$out .= '<tr><td colspan="' . $colspan . '"><span class="opacitymedium">' . $langs->trans("NoRecordFound") . '</span></td></tr>';
2551
+			$out .= '<tr><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>';
2552 2552
 		}
2553 2553
 
2554 2554
 		$out .= "</table>\n";
@@ -2581,9 +2581,9 @@  discard block
 block discarded – undo
2581 2581
 	$i = -1;
2582 2582
 
2583 2583
 	$sql = "SELECT s.rowid, s.client, s.fournisseur, s.nom as name, s.name_alias, s.email, s.address, s.zip, s.town, s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur, s.canvas, s.status";
2584
-	$sql .= " FROM " . MAIN_DB_PREFIX . "societe as s";
2585
-	$sql .= " WHERE s.parent = " . ((int) $object->id);
2586
-	$sql .= " AND s.entity IN (" . getEntity('societe') . ")";
2584
+	$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
2585
+	$sql .= " WHERE s.parent = ".((int) $object->id);
2586
+	$sql .= " AND s.entity IN (".getEntity('societe').")";
2587 2587
 	$sql .= " ORDER BY s.nom";
2588 2588
 
2589 2589
 	$result = $db->query($sql);
@@ -2594,12 +2594,12 @@  discard block
 block discarded – undo
2594 2594
 
2595 2595
 		print load_fiche_titre($langs->trans("Subsidiaries"), '', '');
2596 2596
 
2597
-		print "\n" . '<div class="div-table-responsive-no-min">' . "\n";
2598
-		print '<table class="noborder centpercent">' . "\n";
2597
+		print "\n".'<div class="div-table-responsive-no-min">'."\n";
2598
+		print '<table class="noborder centpercent">'."\n";
2599 2599
 
2600
-		print '<tr class="liste_titre"><td>' . $langs->trans("Company") . '</td>';
2601
-		print '<td>' . $langs->trans("Address") . '</td><td>' . $langs->trans("Zip") . '</td>';
2602
-		print '<td>' . $langs->trans("Town") . '</td><td>' . $langs->trans("CustomerCode") . '</td>';
2600
+		print '<tr class="liste_titre"><td>'.$langs->trans("Company").'</td>';
2601
+		print '<td>'.$langs->trans("Address").'</td><td>'.$langs->trans("Zip").'</td>';
2602
+		print '<td>'.$langs->trans("Town").'</td><td>'.$langs->trans("CustomerCode").'</td>';
2603 2603
 		print "<td>&nbsp;</td>";
2604 2604
 		print "</tr>";
2605 2605
 
@@ -2629,13 +2629,13 @@  discard block
 block discarded – undo
2629 2629
 			print $socstatic->getNomUrl(1);
2630 2630
 			print '</td>';
2631 2631
 
2632
-			print '<td class="tdoverflowmax400" title="' . dol_escape_htmltag($obj->address) . '">' . dol_escape_htmltag($obj->address) . '</td>';
2633
-			print '<td class="tdoverflowmax100" title="' . dol_escape_htmltag($obj->zip) . '">' . $obj->zip . '</td>';
2634
-			print '<td class="tdoverflowmax200" title="' . dol_escape_htmltag($obj->town) . '">' . $obj->town . '</td>';
2635
-			print '<td class="tdoverflowmax200" title="' . dol_escape_htmltag($obj->code_client) . '">' . $obj->code_client . '</td>';
2632
+			print '<td class="tdoverflowmax400" title="'.dol_escape_htmltag($obj->address).'">'.dol_escape_htmltag($obj->address).'</td>';
2633
+			print '<td class="tdoverflowmax100" title="'.dol_escape_htmltag($obj->zip).'">'.$obj->zip.'</td>';
2634
+			print '<td class="tdoverflowmax200" title="'.dol_escape_htmltag($obj->town).'">'.$obj->town.'</td>';
2635
+			print '<td class="tdoverflowmax200" title="'.dol_escape_htmltag($obj->code_client).'">'.$obj->code_client.'</td>';
2636 2636
 
2637 2637
 			print '<td class="center">';
2638
-			print '<a class="editfielda" href="' . DOL_URL_ROOT . '/societe/card.php?socid=' . ((int) $obj->rowid) . '&action=edit&token=' . newToken() . '">';
2638
+			print '<a class="editfielda" href="'.DOL_URL_ROOT.'/societe/card.php?socid='.((int) $obj->rowid).'&action=edit&token='.newToken().'">';
2639 2639
 			print img_edit();
2640 2640
 			print '</a></td>';
2641 2641
 
@@ -2643,7 +2643,7 @@  discard block
 block discarded – undo
2643 2643
 			$i++;
2644 2644
 		}
2645 2645
 		print "\n</table>\n";
2646
-		print '</div>' . "\n";
2646
+		print '</div>'."\n";
2647 2647
 	}
2648 2648
 
2649 2649
 	print "<br>\n";
@@ -2686,7 +2686,7 @@  discard block
 block discarded – undo
2686 2686
 		} elseif ($actioncode == 'AC_ALL_AUTO') {
2687 2687
 			$sql .= " $sqlANDOR c.type = 'systemauto'";
2688 2688
 		} else {
2689
-			$sql .= " $sqlANDOR c.code = '" . $db->escape($actioncode) . "'";
2689
+			$sql .= " $sqlANDOR c.code = '".$db->escape($actioncode)."'";
2690 2690
 		}
2691 2691
 	}
2692 2692
 
@@ -2707,9 +2707,9 @@  discard block
 block discarded – undo
2707 2707
 	global $db;
2708 2708
 
2709 2709
 	if ($donetodo == 'todo') {
2710
-		$sql .= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep > '" . $db->idate($now) . "'))";
2710
+		$sql .= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep > '".$db->idate($now)."'))";
2711 2711
 	} elseif ($donetodo == 'done') {
2712
-		$sql .= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep <= '" . $db->idate($now) . "'))";
2712
+		$sql .= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep <= '".$db->idate($now)."'))";
2713 2713
 	}
2714 2714
 	if (is_array($filters) && !empty($filters['search_agenda_label'])) {
2715 2715
 		$sql .= natural_search('a.label', $filters['search_agenda_label']);
@@ -2750,8 +2750,8 @@  discard block
 block discarded – undo
2750 2750
 		} elseif (is_object($filterobj) && get_class($filterobj) == 'Ticket') {
2751 2751
 			$sql2 .= ", '' as ref";
2752 2752
 		}
2753
-		$sql2 .= " FROM " . MAIN_DB_PREFIX . "mailing as m, " . MAIN_DB_PREFIX . "mailing_cibles as mc, " . MAIN_DB_PREFIX . "user as u";
2754
-		$sql2 .= " WHERE mc.email = '" . $db->escape($objcon->email) . "'"; // Search is done on email.
2753
+		$sql2 .= " FROM ".MAIN_DB_PREFIX."mailing as m, ".MAIN_DB_PREFIX."mailing_cibles as mc, ".MAIN_DB_PREFIX."user as u";
2754
+		$sql2 .= " WHERE mc.email = '".$db->escape($objcon->email)."'"; // Search is done on email.
2755 2755
 		$sql2 .= " AND mc.statut = 1";
2756 2756
 		$sql2 .= " AND u.rowid = m.fk_user_valid";
2757 2757
 		$sql2 .= " AND mc.fk_mailing=m.rowid";
@@ -2793,15 +2793,15 @@  discard block
 block discarded – undo
2793 2793
 	//$urllogo = '';
2794 2794
 	$urllogopublic = '';
2795 2795
 	if ($showlogo) {
2796
-		if (!empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output . '/logos/thumbs/' . $logosmall)) {
2796
+		if (!empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$logosmall)) {
2797 2797
 			//$urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&amp;modulepart=mycompany&amp;file='.urlencode('logos/thumbs/'.$logosmall);
2798
-			$urllogopublic = $dolibarr_main_url_root . '/viewimage.php?modulepart=mycompany&entity=' . $conf->entity . '&file=' . urlencode('logos/thumbs/' . $logosmall);
2799
-		} elseif (!empty($mysoc->logo) && is_readable($conf->mycompany->dir_output . '/logos/' . $logo)) {
2798
+			$urllogopublic = $dolibarr_main_url_root.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/thumbs/'.$logosmall);
2799
+		} elseif (!empty($mysoc->logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$logo)) {
2800 2800
 			//$urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&amp;modulepart=mycompany&amp;file='.urlencode('logos/'.$logo);
2801
-			$urllogopublic = $dolibarr_main_url_root . '/viewimage.php?modulepart=mycompany&entity=' . $conf->entity . '&file=' . urlencode('logos/' . $logo);
2802
-		} elseif (is_readable(DOL_DOCUMENT_ROOT . '/theme/dolibarr_logo.svg')) {
2801
+			$urllogopublic = $dolibarr_main_url_root.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/'.$logo);
2802
+		} elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.svg')) {
2803 2803
 			//$urllogo = DOL_URL_ROOT.'/theme/dolibarr_logo.svg';
2804
-			$urllogopublic = $dolibarr_main_url_root . '/theme/dolibarr_logo.svg';
2804
+			$urllogopublic = $dolibarr_main_url_root.'/theme/dolibarr_logo.svg';
2805 2805
 		}
2806 2806
 	}
2807 2807
 
@@ -2813,19 +2813,19 @@  discard block
 block discarded – undo
2813 2813
 		print '<div class="logopublicpayment">';
2814 2814
 		if ($urllogopublic) {
2815 2815
 			if (!is_numeric($showlogo)) {
2816
-				print '<a href="' . $showlogo . '">';
2816
+				print '<a href="'.$showlogo.'">';
2817 2817
 			}
2818
-			print '<img id="dolpaymentlogo" src="' . $urllogopublic . '">';
2818
+			print '<img id="dolpaymentlogo" src="'.$urllogopublic.'">';
2819 2819
 			if (!is_numeric($showlogo)) {
2820 2820
 				print '</a>';
2821 2821
 			}
2822 2822
 		}
2823 2823
 		if ($alttext) {
2824
-			print '<div class="clearboth"></div><strong>' . $alttext . '</strong>';
2824
+			print '<div class="clearboth"></div><strong>'.$alttext.'</strong>';
2825 2825
 		}
2826 2826
 		print '</div>';
2827 2827
 		if (!getDolGlobalString('MAIN_HIDE_POWERED_BY')) {
2828
-			print '<div class="poweredbypublicpayment opacitymedium right hideonsmartphone"><a class="poweredbyhref" href="https://www.dolibarr.org?utm_medium=website&utm_source=poweredby" target="dolibarr" rel="noopener">' . $langs->trans("PoweredBy") . '<br><img class="poweredbyimg" src="' . DOL_URL_ROOT . '/theme/dolibarr_logo.svg" width="80px"></a></div>';
2828
+			print '<div class="poweredbypublicpayment opacitymedium right hideonsmartphone"><a class="poweredbyhref" href="https://www.dolibarr.org?utm_medium=website&utm_source=poweredby" target="dolibarr" rel="noopener">'.$langs->trans("PoweredBy").'<br><img class="poweredbyimg" src="'.DOL_URL_ROOT.'/theme/dolibarr_logo.svg" width="80px"></a></div>';
2829 2829
 		}
2830 2830
 		print '</div>';
2831 2831
 	}
@@ -2833,7 +2833,7 @@  discard block
 block discarded – undo
2833 2833
 	// Add an optional image under the ban with logo/title
2834 2834
 	if (getDolGlobalString($subimageconst)) {
2835 2835
 		print '<div class="backimagepublicsubimage">';
2836
-		print '<img id="id' . $subimageconst . '" src="' . getDolGlobalString($subimageconst) . '">';
2836
+		print '<img id="id'.$subimageconst.'" src="'.getDolGlobalString($subimageconst).'">';
2837 2837
 		print '</div>';
2838 2838
 	}
2839 2839
 
@@ -2860,11 +2860,11 @@  discard block
 block discarded – undo
2860 2860
 	// Juridical status
2861 2861
 	$line1 = "";
2862 2862
 	if ($fromcompany->forme_juridique_code) {
2863
-		$line1 .= ($line1 ? " - " : "") . getFormeJuridiqueLabel((string) $fromcompany->forme_juridique_code);
2863
+		$line1 .= ($line1 ? " - " : "").getFormeJuridiqueLabel((string) $fromcompany->forme_juridique_code);
2864 2864
 	}
2865 2865
 	// Capital
2866 2866
 	if ($fromcompany->capital) {
2867
-		$line1 .= ($line1 ? " - " : "") . $langs->transnoentities("CapitalOf", (string) $fromcompany->capital) . " " . $langs->transnoentities("Currency" . $conf->currency);
2867
+		$line1 .= ($line1 ? " - " : "").$langs->transnoentities("CapitalOf", (string) $fromcompany->capital)." ".$langs->transnoentities("Currency".$conf->currency);
2868 2868
 	}
2869 2869
 	// Prof Id 1
2870 2870
 	if ($fromcompany->idprof1 && ($fromcompany->country_code != 'FR' || !$fromcompany->idprof2)) {
@@ -2872,7 +2872,7 @@  discard block
 block discarded – undo
2872 2872
 		if (preg_match('/\((.*)\)/i', $field, $reg)) {
2873 2873
 			$field = $reg[1];
2874 2874
 		}
2875
-		$line1 .= ($line1 ? " - " : "") . $field . ": " . $fromcompany->idprof1;
2875
+		$line1 .= ($line1 ? " - " : "").$field.": ".$fromcompany->idprof1;
2876 2876
 	}
2877 2877
 	// Prof Id 2
2878 2878
 	if ($fromcompany->idprof2) {
@@ -2880,7 +2880,7 @@  discard block
 block discarded – undo
2880 2880
 		if (preg_match('/\((.*)\)/i', $field, $reg)) {
2881 2881
 			$field = $reg[1];
2882 2882
 		}
2883
-		$line1 .= ($line1 ? " - " : "") . $field . ": " . $fromcompany->idprof2;
2883
+		$line1 .= ($line1 ? " - " : "").$field.": ".$fromcompany->idprof2;
2884 2884
 	}
2885 2885
 
2886 2886
 	// Second line of company infos
@@ -2891,7 +2891,7 @@  discard block
 block discarded – undo
2891 2891
 		if (preg_match('/\((.*)\)/i', $field, $reg)) {
2892 2892
 			$field = $reg[1];
2893 2893
 		}
2894
-		$line2 .= ($line2 ? " - " : "") . $field . ": " . $fromcompany->idprof3;
2894
+		$line2 .= ($line2 ? " - " : "").$field.": ".$fromcompany->idprof3;
2895 2895
 	}
2896 2896
 	// Prof Id 4
2897 2897
 	if ($fromcompany->idprof4) {
@@ -2899,33 +2899,33 @@  discard block
 block discarded – undo
2899 2899
 		if (preg_match('/\((.*)\)/i', $field, $reg)) {
2900 2900
 			$field = $reg[1];
2901 2901
 		}
2902
-		$line2 .= ($line2 ? " - " : "") . $field . ": " . $fromcompany->idprof4;
2902
+		$line2 .= ($line2 ? " - " : "").$field.": ".$fromcompany->idprof4;
2903 2903
 	}
2904 2904
 	// IntraCommunautary VAT
2905 2905
 	if ($fromcompany->tva_intra != '') {
2906
-		$line2 .= ($line2 ? " - " : "") . $langs->transnoentities("VATIntraShort") . ": " . $fromcompany->tva_intra;
2906
+		$line2 .= ($line2 ? " - " : "").$langs->transnoentities("VATIntraShort").": ".$fromcompany->tva_intra;
2907 2907
 	}
2908 2908
 
2909
-	print '<!-- htmlPrintOnlineFooter -->' . "\n";
2909
+	print '<!-- htmlPrintOnlineFooter -->'."\n";
2910 2910
 
2911 2911
 	// css centpercent has been removed from class="..." because not compatible with paddingleft/right and there is an horizontal scroll appearring on payment page for example.
2912
-	print '<footer class="center centpercent opacitymedium">' . "\n";
2912
+	print '<footer class="center centpercent opacitymedium">'."\n";
2913 2913
 	print '<br>';
2914 2914
 	if ($addformmessage) {
2915
-		print '<!-- object = ' . (empty($object) ? 'undefined' : $object->element) . ' -->';
2915
+		print '<!-- object = '.(empty($object) ? 'undefined' : $object->element).' -->';
2916 2916
 		print '<br>';
2917 2917
 
2918
-		$parammessageform = 'ONLINE_PAYMENT_MESSAGE_FORM_' . $suffix;
2918
+		$parammessageform = 'ONLINE_PAYMENT_MESSAGE_FORM_'.$suffix;
2919 2919
 		if (getDolGlobalString($parammessageform) !== '') {
2920 2920
 			print $langs->transnoentities(getDolGlobalString($parammessageform));
2921
-		} elseif (getDolGlobalString('ONLINE_PAYMENT_MESSAGE_FORM')  !== '') {
2921
+		} elseif (getDolGlobalString('ONLINE_PAYMENT_MESSAGE_FORM') !== '') {
2922 2922
 			print $langs->transnoentities(getDolGlobalString('ONLINE_PAYMENT_MESSAGE_FORM'));
2923 2923
 		}
2924 2924
 
2925 2925
 		// Add other message if VAT exists
2926 2926
 		if (!empty($object->total_vat) || !empty($object->total_tva)) {
2927
-			$parammessageform = 'ONLINE_PAYMENT_MESSAGE_FORMIFVAT_' . $suffix;
2928
-			if (getDolGlobalString($parammessageform)  !== '') {
2927
+			$parammessageform = 'ONLINE_PAYMENT_MESSAGE_FORMIFVAT_'.$suffix;
2928
+			if (getDolGlobalString($parammessageform) !== '') {
2929 2929
 				print $langs->transnoentities(getDolGlobalString($parammessageform));
2930 2930
 			} elseif (getDolGlobalString('ONLINE_PAYMENT_MESSAGE_FORMIFVAT') !== '') {
2931 2931
 				print $langs->transnoentities(getDolGlobalString('ONLINE_PAYMENT_MESSAGE_FORMIFVAT'));
@@ -2933,15 +2933,15 @@  discard block
 block discarded – undo
2933 2933
 		}
2934 2934
 	}
2935 2935
 
2936
-	print '<span style="font-size: 10px;"><br><hr>' . "\n";
2937
-	print $fromcompany->name . '<br>';
2936
+	print '<span style="font-size: 10px;"><br><hr>'."\n";
2937
+	print $fromcompany->name.'<br>';
2938 2938
 	print $line1;
2939
-	if (strlen($line1 . $line2) > 50) {
2939
+	if (strlen($line1.$line2) > 50) {
2940 2940
 		print '<br>';
2941 2941
 	} else {
2942 2942
 		print ' - ';
2943 2943
 	}
2944 2944
 	print $line2;
2945 2945
 	print '</span>';
2946
-	print '</footer>' . "\n";
2946
+	print '</footer>'."\n";
2947 2947
 }
Please login to merge, or discard this patch.
htdocs/core/class/commonobject.class.php 1 patch
Spacing   +146 added lines, -146 removed lines patch added patch discarded remove patch
@@ -516,11 +516,11 @@  discard block
 block discarded – undo
516 516
 	 *
517 517
 	 * Note: cond_reglement can not be aliased to cond_reglement!!!
518 518
 	 */
519
-	private $cond_reglement;  // Private to call DolDeprecationHandler
519
+	private $cond_reglement; // Private to call DolDeprecationHandler
520 520
 	/**
521 521
 	 * @var int|string Internal to detect deprecated access
522 522
 	 */
523
-	protected $depr_cond_reglement;  // Internal value for deprecation
523
+	protected $depr_cond_reglement; // Internal value for deprecation
524 524
 
525 525
 	/**
526 526
 	 * @var ?int 		Delivery address ID
@@ -572,12 +572,12 @@  discard block
 block discarded – undo
572 572
 	/**
573 573
 	 * @var float|string Multicurrency total localtax1
574 574
 	 */
575
-	public $multicurrency_total_localtax1;	// not in database
575
+	public $multicurrency_total_localtax1; // not in database
576 576
 
577 577
 	/**
578 578
 	 * @var float|string Multicurrency total localtax2
579 579
 	 */
580
-	public $multicurrency_total_localtax2;	// not in database
580
+	public $multicurrency_total_localtax2; // not in database
581 581
 
582 582
 	/**
583 583
 	 * @var float 		Multicurrency total amount including taxes (TTC = "Toutes Taxes Comprises" in French)
@@ -1047,17 +1047,17 @@  discard block
 block discarded – undo
1047 1047
 				}
1048 1048
 				$labelextra = $langs->trans((string) $extrafields->attributes[$this->table_element]['label'][$key]);
1049 1049
 				if ($extrafields->attributes[$this->table_element]['type'][$key] == 'separate') {
1050
-					$data[$key] = '<br><b><u>'. $labelextra . '</u></b>';
1050
+					$data[$key] = '<br><b><u>'.$labelextra.'</u></b>';
1051 1051
 				} else {
1052
-					$value = (empty($this->array_options['options_' . $key]) ? '' : $this->array_options['options_' . $key]);
1053
-					$data[$key] = '<br><b>'. $labelextra . ':</b> ' . $extrafields->showOutputField($key, $value, '', $this->table_element);
1052
+					$value = (empty($this->array_options['options_'.$key]) ? '' : $this->array_options['options_'.$key]);
1053
+					$data[$key] = '<br><b>'.$labelextra.':</b> '.$extrafields->showOutputField($key, $value, '', $this->table_element);
1054 1054
 					$count++;
1055 1055
 				}
1056 1056
 			}
1057 1057
 			$data['closedivextra'] = '</div>';
1058 1058
 		}
1059 1059
 
1060
-		$hookmanager->initHooks(array($this->element . 'dao'));
1060
+		$hookmanager->initHooks(array($this->element.'dao'));
1061 1061
 		$parameters = array(
1062 1062
 			'tooltipcontentarray' => &$data,
1063 1063
 			'params' => $params,
@@ -1277,8 +1277,8 @@  discard block
 block discarded – undo
1277 1277
 
1278 1278
 		if ($this->restrictiononfksoc && property_exists($this, 'socid') && !empty($this->socid) && !$user->hasRight('societe', 'client', 'voir')) {
1279 1279
 			$sql_allowed_contacts = 'SELECT COUNT(*) as cnt FROM '.$this->db->prefix().'societe_commerciaux as sc';
1280
-			$sql_allowed_contacts.= ' WHERE sc.fk_soc = '.(int) $this->socid;
1281
-			$sql_allowed_contacts.= ' AND sc.fk_user = '.(int) $user->id;
1280
+			$sql_allowed_contacts .= ' WHERE sc.fk_soc = '.(int) $this->socid;
1281
+			$sql_allowed_contacts .= ' AND sc.fk_user = '.(int) $user->id;
1282 1282
 
1283 1283
 			$resql_allowed_contacts = $this->db->query($sql_allowed_contacts);
1284 1284
 
@@ -1579,7 +1579,7 @@  discard block
 block discarded – undo
1579 1579
 			$sql .= " AND ec.fk_c_type_contact IN (".$this->db->sanitize(implode(',', $arrayoftcids)).")";
1580 1580
 		}
1581 1581
 		if ($status >= 0) {
1582
-			$sql .= " AND t.statut = ".((int) $status);	// t is llx_user or llx_socpeople
1582
+			$sql .= " AND t.statut = ".((int) $status); // t is llx_user or llx_socpeople
1583 1583
 		}
1584 1584
 		if ($statusoflink >= 0) {
1585 1585
 			$sql .= " AND ec.statut = ".((int) $statusoflink);
@@ -1968,7 +1968,7 @@  discard block
 block discarded – undo
1968 1968
 		}
1969 1969
 
1970 1970
 		$sql = "SELECT rowid FROM ".$this->db->prefix().$this->table_element;
1971
-		$sql .= " WHERE ".$this->table_ref_field." LIKE '".$this->db->escape($ref)."'";	// no escapeforlike here
1971
+		$sql .= " WHERE ".$this->table_ref_field." LIKE '".$this->db->escape($ref)."'"; // no escapeforlike here
1972 1972
 		$sql .= " LIMIT 1";
1973 1973
 
1974 1974
 		$query = $this->db->query($sql);
@@ -2286,9 +2286,9 @@  discard block
 block discarded – undo
2286 2286
 
2287 2287
 		$oldvalue = null;
2288 2288
 		if ($trigkey) {
2289
-			$sql = "SELECT " . $field;
2290
-			$sql .= " FROM " . MAIN_DB_PREFIX . $table;
2291
-			$sql .= " WHERE " . $id_field . " = " . ((int) $id);
2289
+			$sql = "SELECT ".$field;
2290
+			$sql .= " FROM ".MAIN_DB_PREFIX.$table;
2291
+			$sql .= " WHERE ".$id_field." = ".((int) $id);
2292 2292
 
2293 2293
 			$resql = $this->db->query($sql);
2294 2294
 			if ($resql) {
@@ -2668,7 +2668,7 @@  discard block
 block discarded – undo
2668 2668
 		// Triggers
2669 2669
 		if (!$error && !$notrigger) {
2670 2670
 			// Call triggers
2671
-			$result = $this->call_trigger(strtoupper($this->element) . '_MODIFY', $user);
2671
+			$result = $this->call_trigger(strtoupper($this->element).'_MODIFY', $user);
2672 2672
 			if ($result < 0) {
2673 2673
 				$error++;
2674 2674
 			} //Do also here what you must do to rollback action if trigger fail
@@ -3077,7 +3077,7 @@  discard block
 block discarded – undo
3077 3077
 			$sql = 'UPDATE '.$this->db->prefix().$this->table_element;
3078 3078
 			$sql .= " SET ".$fieldname." = ".(($id > 0 || $id == '0') ? ((int) $id) : 'NULL');
3079 3079
 			if (in_array($this->table_element, array('propal', 'commande', 'societe'))) {
3080
-				$sql .= " , deposit_percent = " . (empty($deposit_percent) ? 'NULL' : "'".$this->db->escape((string) $deposit_percent)."'");
3080
+				$sql .= " , deposit_percent = ".(empty($deposit_percent) ? 'NULL' : "'".$this->db->escape((string) $deposit_percent)."'");
3081 3081
 			}
3082 3082
 			$sql .= ' WHERE rowid='.((int) $this->id);
3083 3083
 
@@ -3371,7 +3371,7 @@  discard block
 block discarded – undo
3371 3371
 
3372 3372
 				$triggerName = (empty($this->TRIGGER_PREFIX) ? strtoupper(get_class($this)) : $this->TRIGGER_PREFIX);
3373 3373
 				if (get_class($this) == 'Commande') {
3374
-					$triggerName = 'ORDER';	// TODO Remove this when TRIGGER_PREFI in order is implemented
3374
+					$triggerName = 'ORDER'; // TODO Remove this when TRIGGER_PREFI in order is implemented
3375 3375
 				}
3376 3376
 				if ($triggerName == 'FACTUREREC_MODIFY') {	// TODO Use the $this->TRIGGER_PREFIX when implemented
3377 3377
 					$triggerName = 'BILLREC_MODIFY';
@@ -3428,10 +3428,10 @@  discard block
 block discarded – undo
3428 3428
 		$sql = "SELECT count(rowid) FROM ".$this->db->prefix().$this->table_element_line;
3429 3429
 		$sql .= " WHERE ".$this->fk_element." = ".((int) $this->id);
3430 3430
 		if (!$renum) {
3431
-			$sql .= " AND " . $fieldposition . " = 0";
3431
+			$sql .= " AND ".$fieldposition." = 0";
3432 3432
 		}
3433 3433
 		if ($renum) {
3434
-			$sql .= " AND " . $fieldposition . " <> 0";
3434
+			$sql .= " AND ".$fieldposition." <> 0";
3435 3435
 		}
3436 3436
 
3437 3437
 		dol_syslog(get_class($this)."::line_order", LOG_DEBUG);
@@ -3452,7 +3452,7 @@  discard block
 block discarded – undo
3452 3452
 			if ($fk_parent_line) {
3453 3453
 				$sql .= ' AND fk_parent_line IS NULL';
3454 3454
 			}
3455
-			$sql .= " ORDER BY " . $fieldposition . " ASC, rowid " . $rowidorder;
3455
+			$sql .= " ORDER BY ".$fieldposition." ASC, rowid ".$rowidorder;
3456 3456
 
3457 3457
 			dol_syslog(get_class($this)."::line_order search all parent lines", LOG_DEBUG);
3458 3458
 			$resql = $this->db->query($sql);
@@ -3506,7 +3506,7 @@  discard block
 block discarded – undo
3506 3506
 		$sql = "SELECT rowid FROM ".$this->db->prefix().$this->table_element_line;
3507 3507
 		$sql .= " WHERE ".$this->fk_element." = ".((int) $this->id);
3508 3508
 		$sql .= ' AND fk_parent_line = '.((int) $id);
3509
-		$sql .= " ORDER BY " . $fieldposition . " ASC";
3509
+		$sql .= " ORDER BY ".$fieldposition." ASC";
3510 3510
 
3511 3511
 		dol_syslog(get_class($this)."::getChildrenOfLine search children lines for line ".$id, LOG_DEBUG);
3512 3512
 
@@ -3633,7 +3633,7 @@  discard block
 block discarded – undo
3633 3633
 
3634 3634
 		$sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) $rang);
3635 3635
 		$sql .= " WHERE ".$this->fk_element." = ".((int) $this->id);
3636
-		$sql .= " AND " . $fieldposition . " = " . ((int) ($rang - 1));
3636
+		$sql .= " AND ".$fieldposition." = ".((int) ($rang - 1));
3637 3637
 		if (!$this->db->query($sql)) {
3638 3638
 			$this->error = $this->db->lasterror();
3639 3639
 			return -1;
@@ -3670,7 +3670,7 @@  discard block
 block discarded – undo
3670 3670
 
3671 3671
 		$sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) $rang);
3672 3672
 		$sql .= " WHERE ".$this->fk_element." = ".((int) $this->id);
3673
-		$sql .= " AND " . $fieldposition . " = " . ((int) ($rang + 1));
3673
+		$sql .= " AND ".$fieldposition." = ".((int) ($rang + 1));
3674 3674
 		if (!$this->db->query($sql)) {
3675 3675
 			$this->error = $this->db->lasterror();
3676 3676
 			return -1;
@@ -3699,7 +3699,7 @@  discard block
 block discarded – undo
3699 3699
 			$fieldposition = 'position';
3700 3700
 		}
3701 3701
 
3702
-		$sql = "SELECT " . $fieldposition . " FROM ".$this->db->prefix().$this->table_element_line;
3702
+		$sql = "SELECT ".$fieldposition." FROM ".$this->db->prefix().$this->table_element_line;
3703 3703
 		$sql .= " WHERE rowid = ".((int) $rowid);
3704 3704
 
3705 3705
 		dol_syslog(get_class($this)."::getRangOfLine", LOG_DEBUG);
@@ -3727,7 +3727,7 @@  discard block
 block discarded – undo
3727 3727
 
3728 3728
 		$sql = "SELECT rowid FROM ".$this->db->prefix().$this->table_element_line;
3729 3729
 		$sql .= " WHERE ".$this->fk_element." = ".((int) $this->id);
3730
-		$sql .= " AND " . $fieldposition . " = ".((int) $rang);
3730
+		$sql .= " AND ".$fieldposition." = ".((int) $rang);
3731 3731
 		$resql = $this->db->query($sql);
3732 3732
 		if (!$resql) {
3733 3733
 			return 0;
@@ -3841,7 +3841,7 @@  discard block
 block discarded – undo
3841 3841
 			$newsuffix = '';
3842 3842
 		}
3843 3843
 		if (in_array($this->table_element, array('actioncomm', 'adherent', 'advtargetemailing', 'cronjob', 'establishment'))) {
3844
-			$fieldusermod =  "fk_user_mod";
3844
+			$fieldusermod = "fk_user_mod";
3845 3845
 		} elseif ($this->table_element == 'ecm_files') {
3846 3846
 			$fieldusermod = "fk_user_m";
3847 3847
 		} else {
@@ -3881,7 +3881,7 @@  discard block
 block discarded – undo
3881 3881
 						$triggerName = 'EXPENSE_REPORT_MODIFY';
3882 3882
 						break;
3883 3883
 					default:
3884
-						$triggerName = strtoupper($this->element) . '_MODIFY';
3884
+						$triggerName = strtoupper($this->element).'_MODIFY';
3885 3885
 				}
3886 3886
 				$ret = $this->call_trigger($triggerName, $user);
3887 3887
 				if ($ret < 0) {
@@ -4179,7 +4179,7 @@  discard block
 block discarded – undo
4179 4179
 			// Situations totals
4180 4180
 			if (!empty($this->situation_cycle_ref) && !empty($this->situation_counter) && $this->situation_counter > 1 && method_exists($this, 'get_prev_sits')) {  // @phan-suppress-current-line PhanUndeclaredProperty
4181 4181
 				'@phan-var-force Facture $this';
4182
-				include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';  // Note: possibly useless as $this is normally already Facture, so the class file should be loaded
4182
+				include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; // Note: possibly useless as $this is normally already Facture, so the class file should be loaded
4183 4183
 				if ($this->type != Facture::TYPE_CREDIT_NOTE) {	// @phpstan-ignore-line
4184 4184
 					if (getDolGlobalInt('INVOICE_USE_SITUATION') != 2) {
4185 4185
 						$prev_sits = $this->get_prev_sits();
@@ -4305,26 +4305,26 @@  discard block
 block discarded – undo
4305 4305
 		$this->db->begin();
4306 4306
 		$error = 0;
4307 4307
 
4308
-		$sql = "INSERT INTO " . $this->db->prefix() . "element_element (";
4308
+		$sql = "INSERT INTO ".$this->db->prefix()."element_element (";
4309 4309
 		$sql .= "fk_source";
4310 4310
 		$sql .= ", sourcetype";
4311 4311
 		$sql .= ", fk_target";
4312 4312
 		$sql .= ", targettype";
4313 4313
 		$sql .= ") VALUES (";
4314 4314
 		$sql .= ((int) $origin_id);
4315
-		$sql .= ", '" . $this->db->escape($origin) . "'";
4316
-		$sql .= ", " . ((int) $this->id);
4317
-		$sql .= ", '" . $this->db->escape($targettype) . "'";
4315
+		$sql .= ", '".$this->db->escape($origin)."'";
4316
+		$sql .= ", ".((int) $this->id);
4317
+		$sql .= ", '".$this->db->escape($targettype)."'";
4318 4318
 		$sql .= ")";
4319 4319
 
4320
-		dol_syslog(get_class($this) . "::add_object_linked", LOG_DEBUG);
4320
+		dol_syslog(get_class($this)."::add_object_linked", LOG_DEBUG);
4321 4321
 		if ($this->db->query($sql)) {
4322 4322
 			if (!$notrigger) {
4323 4323
 				// Call trigger
4324 4324
 				$this->context['link_origin'] = $origin;
4325 4325
 				$this->context['link_origin_id'] = $origin_id;
4326 4326
 
4327
-				$result = $this->call_trigger('OBJECT_LINK_INSERT', $f_user);	// Note: We should have used here a hook. Not a business event
4327
+				$result = $this->call_trigger('OBJECT_LINK_INSERT', $f_user); // Note: We should have used here a hook. Not a business event
4328 4328
 				if ($result < 0) {
4329 4329
 					$error++;
4330 4330
 				}
@@ -4589,20 +4589,20 @@  discard block
 block discarded – undo
4589 4589
 		$this->db->begin();
4590 4590
 		$error = 0;
4591 4591
 
4592
-		$sql = "UPDATE " . $this->db->prefix() . "element_element SET ";
4592
+		$sql = "UPDATE ".$this->db->prefix()."element_element SET ";
4593 4593
 		if ($updatesource) {
4594
-			$sql .= "fk_source = " . ((int) $sourceid);
4595
-			$sql .= ", sourcetype = '" . $this->db->escape($sourcetype) . "'";
4596
-			$sql .= " WHERE fk_target = " . ((int) $this->id);
4597
-			$sql .= " AND targettype = '" . $this->db->escape($this->element) . "'";
4594
+			$sql .= "fk_source = ".((int) $sourceid);
4595
+			$sql .= ", sourcetype = '".$this->db->escape($sourcetype)."'";
4596
+			$sql .= " WHERE fk_target = ".((int) $this->id);
4597
+			$sql .= " AND targettype = '".$this->db->escape($this->element)."'";
4598 4598
 		} elseif ($updatetarget) {
4599
-			$sql .= "fk_target = " . ((int) $targetid);
4600
-			$sql .= ", targettype = '" . $this->db->escape($targettype) . "'";
4601
-			$sql .= " WHERE fk_source = " . ((int) $this->id);
4602
-			$sql .= " AND sourcetype = '" . $this->db->escape($this->element) . "'";
4599
+			$sql .= "fk_target = ".((int) $targetid);
4600
+			$sql .= ", targettype = '".$this->db->escape($targettype)."'";
4601
+			$sql .= " WHERE fk_source = ".((int) $this->id);
4602
+			$sql .= " AND sourcetype = '".$this->db->escape($this->element)."'";
4603 4603
 		}
4604 4604
 
4605
-		dol_syslog(get_class($this) . "::updateObjectLinked", LOG_DEBUG);
4605
+		dol_syslog(get_class($this)."::updateObjectLinked", LOG_DEBUG);
4606 4606
 		if ($this->db->query($sql)) {
4607 4607
 			if (!$notrigger) {
4608 4608
 				// Call trigger
@@ -4611,7 +4611,7 @@  discard block
 block discarded – undo
4611 4611
 				$this->context['link_target_id'] = $targetid;
4612 4612
 				$this->context['link_target_type'] = $targettype;
4613 4613
 
4614
-				$result = $this->call_trigger('OBJECT_LINK_MODIFY', $f_user);	// Note: We should have used here a hook. Not a business event
4614
+				$result = $this->call_trigger('OBJECT_LINK_MODIFY', $f_user); // Note: We should have used here a hook. Not a business event
4615 4615
 				if ($result < 0) {
4616 4616
 					$error++;
4617 4617
 				}
@@ -4673,7 +4673,7 @@  discard block
 block discarded – undo
4673 4673
 			$this->context['link_target_id'] = $targetid;
4674 4674
 			$this->context['link_target_type'] = $targettype;
4675 4675
 
4676
-			$result = $this->call_trigger('OBJECT_LINK_DELETE', $f_user);	// Note: We should have used here a hook. Not a business event
4676
+			$result = $this->call_trigger('OBJECT_LINK_DELETE', $f_user); // Note: We should have used here a hook. Not a business event
4677 4677
 			if ($result < 0) {
4678 4678
 				$error++;
4679 4679
 			}
@@ -4681,25 +4681,25 @@  discard block
 block discarded – undo
4681 4681
 		}
4682 4682
 
4683 4683
 		if (!$error) {
4684
-			$sql = "DELETE FROM " . $this->db->prefix() . "element_element";
4684
+			$sql = "DELETE FROM ".$this->db->prefix()."element_element";
4685 4685
 			$sql .= " WHERE";
4686 4686
 			if ($rowid > 0) {
4687
-				$sql .= " rowid = " . ((int) $rowid);
4687
+				$sql .= " rowid = ".((int) $rowid);
4688 4688
 			} else {
4689 4689
 				if ($deletesource) {
4690
-					$sql .= " fk_source = " . ((int) $sourceid) . " AND sourcetype = '" . $this->db->escape($sourcetype) . "'";
4691
-					$sql .= " AND fk_target = " . ((int) $this->id) . " AND targettype = '" . $this->db->escape($element) . "'";
4690
+					$sql .= " fk_source = ".((int) $sourceid)." AND sourcetype = '".$this->db->escape($sourcetype)."'";
4691
+					$sql .= " AND fk_target = ".((int) $this->id)." AND targettype = '".$this->db->escape($element)."'";
4692 4692
 				} elseif ($deletetarget) {
4693
-					$sql .= " fk_target = " . ((int) $targetid) . " AND targettype = '" . $this->db->escape($targettype) . "'";
4694
-					$sql .= " AND fk_source = " . ((int) $this->id) . " AND sourcetype = '" . $this->db->escape($element) . "'";
4693
+					$sql .= " fk_target = ".((int) $targetid)." AND targettype = '".$this->db->escape($targettype)."'";
4694
+					$sql .= " AND fk_source = ".((int) $this->id)." AND sourcetype = '".$this->db->escape($element)."'";
4695 4695
 				} else {
4696
-					$sql .= " (fk_source = " . ((int) $this->id) . " AND sourcetype = '" . $this->db->escape($element) . "')";
4696
+					$sql .= " (fk_source = ".((int) $this->id)." AND sourcetype = '".$this->db->escape($element)."')";
4697 4697
 					$sql .= " OR";
4698
-					$sql .= " (fk_target = " . ((int) $this->id) . " AND targettype = '" . $this->db->escape($element) . "')";
4698
+					$sql .= " (fk_target = ".((int) $this->id)." AND targettype = '".$this->db->escape($element)."')";
4699 4699
 				}
4700 4700
 			}
4701 4701
 
4702
-			dol_syslog(get_class($this) . "::deleteObjectLinked", LOG_DEBUG);
4702
+			dol_syslog(get_class($this)."::deleteObjectLinked", LOG_DEBUG);
4703 4703
 			if (!$this->db->query($sql)) {
4704 4704
 				$this->error = $this->db->lasterror();
4705 4705
 				$this->errors[] = $this->error;
@@ -4871,14 +4871,14 @@  discard block
 block discarded – undo
4871 4871
 			$sql .= ", date_validation = '".$this->db->idate(dol_now())."'";
4872 4872
 		}
4873 4873
 		$sql .= " WHERE rowid = ".((int) $elementId);
4874
-		$sql .= " AND ".$this->db->sanitize($fieldstatus)." <> ".((int) $status);	// We avoid update if status already correct
4874
+		$sql .= " AND ".$this->db->sanitize($fieldstatus)." <> ".((int) $status); // We avoid update if status already correct
4875 4875
 
4876 4876
 		dol_syslog(get_class($this)."::setStatut", LOG_DEBUG);
4877 4877
 		$resql = $this->db->query($sql);
4878 4878
 		if ($resql) {
4879 4879
 			$error = 0;
4880 4880
 
4881
-			$nb_rows_affected = $this->db->affected_rows($resql);	// should be 1 or 0 if status was already correct
4881
+			$nb_rows_affected = $this->db->affected_rows($resql); // should be 1 or 0 if status was already correct
4882 4882
 
4883 4883
 			if ($nb_rows_affected > 0) {
4884 4884
 				if (empty($trigkey)) {
@@ -4927,9 +4927,9 @@  discard block
 block discarded – undo
4927 4927
 					} elseif ($fieldstatus == 'tosell') {
4928 4928
 						$this->status = $status;
4929 4929
 					} elseif ($fieldstatus == 'tobuy') {
4930
-						$this->status_buy = $status;	// @phpstan-ignore-line
4930
+						$this->status_buy = $status; // @phpstan-ignore-line
4931 4931
 					} elseif ($fieldstatus == 'tobatch') {
4932
-						$this->status_batch = $status;	// @phpstan-ignore-line
4932
+						$this->status_batch = $status; // @phpstan-ignore-line
4933 4933
 					} else {
4934 4934
 						$this->status = $status;
4935 4935
 					}
@@ -5035,7 +5035,7 @@  discard block
 block discarded – undo
5035 5035
 			return -1;
5036 5036
 		}
5037 5037
 
5038
-		$arraytoscan = $this->childtables;		// array('tablename'=>array('fk_element'=>'parentfield'), ...) or array('tablename'=>array('parent'=>table_parent, 'parentkey'=>'nameoffieldforparentfkkey'), ...)
5038
+		$arraytoscan = $this->childtables; // array('tablename'=>array('fk_element'=>'parentfield'), ...) or array('tablename'=>array('parent'=>table_parent, 'parentkey'=>'nameoffieldforparentfkkey'), ...)
5039 5039
 		// For backward compatibility, we check if array is old format array('tablename1', 'tablename2', ...)
5040 5040
 		$tmparray = array_keys($this->childtables);
5041 5041
 		if (is_numeric($tmparray[0])) {
@@ -5479,7 +5479,7 @@  discard block
 block discarded – undo
5479 5479
 	 */
5480 5480
 	public function printObjectLine($action, $line, $var, $num, $i, $dateSelector, $seller, $buyer, $selected = 0, $extrafields = null, $defaulttpldir = '/core/tpl')
5481 5481
 	{
5482
-		global $conf, $langs, $user, $object, $hookmanager;	// used into tpl
5482
+		global $conf, $langs, $user, $object, $hookmanager; // used into tpl
5483 5483
 		global $form;
5484 5484
 		global $disableedit, $disablemove, $disableremove; // TODO We should not use global var for this !
5485 5485
 
@@ -5533,7 +5533,7 @@  discard block
 block discarded – undo
5533 5533
 			}
5534 5534
 
5535 5535
 			$line->subprice_ttc = (float) price2num((!empty($line->subprice) ? $line->subprice : 0) * (1 + ((!empty($line->tva_tx) ? $line->tva_tx : 0) / 100)), 'MU');
5536
-			$line->pu_ttc = $line->subprice_ttc;	// deprecated
5536
+			$line->pu_ttc = $line->subprice_ttc; // deprecated
5537 5537
 
5538 5538
 			// Output template part (modules that overwrite templates must declare this into descriptor)
5539 5539
 			// Use global variables + $dateSelector + $seller and $buyer
@@ -5572,7 +5572,7 @@  discard block
 block discarded – undo
5572 5572
 			$label = (!empty($line->label) ? $line->label : (($line->fk_product > 0) ? $line->product_label : ''));
5573 5573
 
5574 5574
 			$line->subprice_ttc = (float) price2num($line->subprice * (1 + ($line->tva_tx / 100)), 'MU');
5575
-			$line->pu_ttc = $line->subprice_ttc;	// deprecated
5575
+			$line->pu_ttc = $line->subprice_ttc; // deprecated
5576 5576
 
5577 5577
 			// Output template part (modules that overwrite templates must declare this into descriptor)
5578 5578
 			// Use global variables + $dateSelector + $seller and $buyer
@@ -6101,7 +6101,7 @@  discard block
 block discarded – undo
6101 6101
 		} else {
6102 6102
 			// TODO: Try to set type above again
6103 6103
 			'@phan-var-force ModeleBarCode|ModeleExports|ModeleImports|ModelePDFAsset|ModelePDFContract|ModelePDFDeliveryOrder|ModelePDFEvaluation|ModelePDFFactures|ModelePDFFicheinter|ModelePDFMo|ModelePDFMovement|ModelePDFProduct|ModelePDFProjects|ModelePDFPropales|ModelePDFRecruitmentJobPosition|ModelePDFStock|ModelePDFStockTransfer|ModelePDFSupplierProposal|ModelePDFSuppliersInvoices|ModelePDFSuppliersOrders|ModelePDFSuppliersPayments|ModelePDFTask|ModelePDFTicket|ModelePDFUser|ModelePDFUserGroup|ModelePdfExpedition|ModelePdfReception|ModeleThirdPartyDoc $obj';
6104
-			$resultwritefile = $obj->write_file($this, $outputlangs, $srctemplatepath, $hidedetails, $hidedesc, $hideref, $moreparams);  // @phan-suppress-line-PhanTypeMismatchArgument
6104
+			$resultwritefile = $obj->write_file($this, $outputlangs, $srctemplatepath, $hidedetails, $hidedesc, $hideref, $moreparams); // @phan-suppress-line-PhanTypeMismatchArgument
6105 6105
 		}
6106 6106
 		// After call of write_file $obj->result['fullpath'] is set with generated file. It will be used to update the ECM database index.
6107 6107
 
@@ -6174,7 +6174,7 @@  discard block
 block discarded – undo
6174 6174
 			$setsharekey = false;
6175 6175
 			if ($this->element == 'propal' || $this->element == 'proposal') {
6176 6176
 				if (getDolGlobalInt("PROPOSAL_ALLOW_ONLINESIGN")) {
6177
-					$setsharekey = true;	// feature to make online signature is not set or set to on (default)
6177
+					$setsharekey = true; // feature to make online signature is not set or set to on (default)
6178 6178
 				}
6179 6179
 				if (getDolGlobalInt("PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD")) {
6180 6180
 					$setsharekey = true;
@@ -6234,7 +6234,7 @@  discard block
 block discarded – undo
6234 6234
 				$ecmfile->gen_or_uploaded = 'generated';
6235 6235
 				$ecmfile->description = ''; // indexed content
6236 6236
 				$ecmfile->keywords = ''; // keyword content
6237
-				$ecmfile->src_object_type = $this->table_element;	// $this->table_name is 'myobject' or 'mymodule_myobject'.
6237
+				$ecmfile->src_object_type = $this->table_element; // $this->table_name is 'myobject' or 'mymodule_myobject'.
6238 6238
 				$ecmfile->src_object_id   = $this->id;
6239 6239
 
6240 6240
 				$result = $ecmfile->create($user);
@@ -6537,7 +6537,7 @@  discard block
 block discarded – undo
6537 6537
 		$savDisableCompute = $conf->disable_compute;
6538 6538
 		$conf->disable_compute = 1;
6539 6539
 
6540
-		$ret = $this->fetch($id);	/* @phpstan-ignore-line */
6540
+		$ret = $this->fetch($id); /* @phpstan-ignore-line */
6541 6541
 
6542 6542
 		$conf->disable_compute = $savDisableCompute;
6543 6543
 
@@ -6599,7 +6599,7 @@  discard block
 block discarded – undo
6599 6599
 		if (is_array($optionsArray) && count($optionsArray) > 0) {
6600 6600
 			$sql = "SELECT rowid";
6601 6601
 			foreach ($optionsArray as $name => $label) {
6602
-				if (empty($extrafields->attributes[$this->table_element]['type'][$name]) || (!in_array($extrafields->attributes[$this->table_element]['type'][$name], ['separate', 'point', 'multipts', 'linestrg','polygon']))) {
6602
+				if (empty($extrafields->attributes[$this->table_element]['type'][$name]) || (!in_array($extrafields->attributes[$this->table_element]['type'][$name], ['separate', 'point', 'multipts', 'linestrg', 'polygon']))) {
6603 6603
 					$sql .= ", ".$name;
6604 6604
 				}
6605 6605
 				// use geo sql fonction to read as text
@@ -6644,7 +6644,7 @@  discard block
 block discarded – undo
6644 6644
 					 **/
6645 6645
 					if (is_array($extrafields->attributes[$this->table_element]['label'])) {
6646 6646
 						foreach ($extrafields->attributes[$this->table_element]['label'] as $key => $val) {
6647
-							$this->array_options['options_' . $key] = null;
6647
+							$this->array_options['options_'.$key] = null;
6648 6648
 						}
6649 6649
 					}
6650 6650
 				}
@@ -6656,9 +6656,9 @@  discard block
 block discarded – undo
6656 6656
 						if (!empty($extrafields->attributes[$this->table_element]) && !empty($extrafields->attributes[$this->table_element]['computed'][$key])) {
6657 6657
 							//var_dump($conf->disable_compute);
6658 6658
 							if (empty($conf->disable_compute)) {
6659
-								global $objectoffield;        // We set a global variable to $objectoffield so
6660
-								$objectoffield = $this;        // we can use it inside computed formula
6661
-								$this->array_options['options_' . $key] = dol_eval($extrafields->attributes[$this->table_element]['computed'][$key], 1, 0, '2');
6659
+								global $objectoffield; // We set a global variable to $objectoffield so
6660
+								$objectoffield = $this; // we can use it inside computed formula
6661
+								$this->array_options['options_'.$key] = dol_eval($extrafields->attributes[$this->table_element]['computed'][$key], 1, 0, '2');
6662 6662
 							}
6663 6663
 						}
6664 6664
 					}
@@ -6844,7 +6844,7 @@  discard block
 block discarded – undo
6844 6844
 									// If old value encrypted in database is same than submitted new value, it means we don't change it, so we don't update.
6845 6845
 									if ($algo == 'dolcrypt') {	// dolibarr reversible encryption
6846 6846
 										if (!preg_match('/^dolcrypt:/', $this->array_options[$key])) {
6847
-											$new_array_options[$key] = dolEncrypt($this->array_options[$key]);	// warning, must be called when on the master
6847
+											$new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master
6848 6848
 										} else {
6849 6849
 											$new_array_options[$key] = $this->array_options[$key]; // Value is kept
6850 6850
 										}
@@ -6855,7 +6855,7 @@  discard block
 block discarded – undo
6855 6855
 									// If value has changed
6856 6856
 									if ($algo == 'dolcrypt') {	// dolibarr reversible encryption
6857 6857
 										if (!preg_match('/^dolcrypt:/', $this->array_options[$key])) {
6858
-											$new_array_options[$key] = dolEncrypt($this->array_options[$key]);	// warning, must be called when on the master
6858
+											$new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master
6859 6859
 										} else {
6860 6860
 											$new_array_options[$key] = $this->array_options[$key]; // Value is kept
6861 6861
 										}
@@ -6867,7 +6867,7 @@  discard block
 block discarded – undo
6867 6867
 								//var_dump('jjj'.$algo.' '.$this->oldcopy->array_options[$key].' -> '.$this->array_options[$key]);
6868 6868
 								// If this->oldcopy is not defined, we can't know if we change attribute or not, so we must keep value
6869 6869
 								if ($algo == 'dolcrypt' && !preg_match('/^dolcrypt:/', $this->array_options[$key])) {	// dolibarr reversible encryption
6870
-									$new_array_options[$key] = dolEncrypt($this->array_options[$key]);	// warning, must be called when on the master
6870
+									$new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master
6871 6871
 								} else {
6872 6872
 									$new_array_options[$key] = $this->array_options[$key]; // Value is kept
6873 6873
 								}
@@ -6912,9 +6912,9 @@  discard block
 block discarded – undo
6912 6912
 
6913 6913
 							$sqlFetchObject = "SELECT rowid FROM ".$this->db->prefix().$object->table_element;
6914 6914
 							if (is_numeric($value)) {
6915
-								$sqlFetchObject .= " WHERE rowid = " . (int) $value;
6915
+								$sqlFetchObject .= " WHERE rowid = ".(int) $value;
6916 6916
 							} else {
6917
-								$sqlFetchObject .= " WHERE ref = '" . $this->db->escape($value) . "'";
6917
+								$sqlFetchObject .= " WHERE ref = '".$this->db->escape($value)."'";
6918 6918
 							}
6919 6919
 
6920 6920
 							$obj = $this->db->getRow($sqlFetchObject);
@@ -6959,7 +6959,7 @@  discard block
 block discarded – undo
6959 6959
 			}
6960 6960
 			$geoDataType = ExtraFields::$geoDataTypes[$attributeType] ?? null;
6961 6961
 			// Add field of attribute
6962
-			if (! $geoDataType) {
6962
+			if (!$geoDataType) {
6963 6963
 				// not a geodata type
6964 6964
 				if ($newValue != '') {
6965 6965
 					$sqlColumnValues[$attributeKey] = "'".$this->db->escape($newValue)."'";
@@ -6992,7 +6992,7 @@  discard block
 block discarded – undo
6992 6992
 		if ($table_element == 'categorie') {
6993 6993
 			$table_element = 'categories'; // For compatibility
6994 6994
 		}
6995
-		$extrafieldsTable = $this->db->prefix() . $table_element . '_extrafields';
6995
+		$extrafieldsTable = $this->db->prefix().$table_element.'_extrafields';
6996 6996
 
6997 6997
 		dol_syslog(get_class($this)."::insertExtraFields update or insert record line", LOG_DEBUG);
6998 6998
 
@@ -7015,7 +7015,7 @@  discard block
 block discarded – undo
7015 7015
 				 * @param string $key
7016 7016
 				 * @return string
7017 7017
 				 */
7018
-				array_map(function ($key) use ($sqlColumnValues) {
7018
+				array_map(function($key) use ($sqlColumnValues) {
7019 7019
 					return "{$key} = {$sqlColumnValues[$key]}";
7020 7020
 				}, array_keys($sqlColumnValues))
7021 7021
 			);
@@ -7318,7 +7318,7 @@  discard block
 block discarded – undo
7318 7318
 								if (isset($this->oldcopy->array_options["options_".$key]) && $this->array_options["options_".$key] == $this->oldcopy->array_options["options_".$key]) {	// If old value encrypted in database is same than submitted new value, it means we don't change it, so we don't update.
7319 7319
 									if ($algo == 'dolcrypt') {	// dolibarr reversible encryption
7320 7320
 										if (!preg_match('/^dolcrypt:/', $this->array_options["options_".$key])) {
7321
-											$new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]);	// warning, must be called when on the master
7321
+											$new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]); // warning, must be called when on the master
7322 7322
 										} else {
7323 7323
 											$new_array_options["options_".$key] = $this->array_options["options_".$key]; // Value is kept
7324 7324
 										}
@@ -7338,7 +7338,7 @@  discard block
 block discarded – undo
7338 7338
 								}
7339 7339
 							} else {
7340 7340
 								if ($algo == 'dolcrypt' && !preg_match('/^dolcrypt:/', $this->array_options["options_".$key])) {	// dolibarr reversible encryption
7341
-									$new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]);	// warning, must be called when on the master
7341
+									$new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]); // warning, must be called when on the master
7342 7342
 								} else {
7343 7343
 									$new_array_options["options_".$key] = $this->array_options["options_".$key]; // Value is kept
7344 7344
 								}
@@ -7935,7 +7935,7 @@  discard block
 block discarded – undo
7935 7935
 				// 7 : sort field
7936 7936
 
7937 7937
 				// If there is filter
7938
-				if (! empty($InfoFieldList[4])) {
7938
+				if (!empty($InfoFieldList[4])) {
7939 7939
 					$pos = 0;
7940 7940
 					$parenthesisopen = 0;
7941 7941
 					while (substr($InfoFieldList[4], $pos, 1) !== '' && ($parenthesisopen || $pos == 0 || substr($InfoFieldList[4], $pos, 1) != ':')) {
@@ -7999,8 +7999,8 @@  discard block
 block discarded – undo
7999 7999
 					}
8000 8000
 
8001 8001
 					$sqlwhere = '';
8002
-					$sql = "SELECT " . $keyList;
8003
-					$sql .= " FROM " . $this->db->prefix() . $InfoFieldList[0];
8002
+					$sql = "SELECT ".$keyList;
8003
+					$sql .= " FROM ".$this->db->prefix().$InfoFieldList[0];
8004 8004
 
8005 8005
 					if (!empty($InfoFieldList[4])) {
8006 8006
 						// can use SELECT request
@@ -8018,11 +8018,11 @@  discard block
 block discarded – undo
8018 8018
 						// We have to join on extrafield table
8019 8019
 						$errstr = '';
8020 8020
 						if (strpos($InfoFieldList[4], 'extra') !== false) {
8021
-							$sql .= " as main, " . $this->db->sanitize($this->db->prefix() . $InfoFieldList[0]) . "_extrafields as extra";
8022
-							$sqlwhere .= " WHERE extra.fk_object = main." . $this->db->sanitize($InfoFieldList[2]);
8023
-							$sqlwhere .= " AND " . forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1);
8021
+							$sql .= " as main, ".$this->db->sanitize($this->db->prefix().$InfoFieldList[0])."_extrafields as extra";
8022
+							$sqlwhere .= " WHERE extra.fk_object = main.".$this->db->sanitize($InfoFieldList[2]);
8023
+							$sqlwhere .= " AND ".forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1);
8024 8024
 						} else {
8025
-							$sqlwhere .= " WHERE " . forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1);
8025
+							$sqlwhere .= " WHERE ".forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1);
8026 8026
 						}
8027 8027
 					} else {
8028 8028
 						$sqlwhere .= ' WHERE 1=1';
@@ -8043,7 +8043,7 @@  discard block
 block discarded – undo
8043 8043
 
8044 8044
 					// Some tables may have field, some other not. For the moment we disable it.
8045 8045
 					if (in_array($InfoFieldList[0], array('tablewithentity'))) {
8046
-						$sqlwhere .= " AND entity = " . ((int) $conf->entity);
8046
+						$sqlwhere .= " AND entity = ".((int) $conf->entity);
8047 8047
 					}
8048 8048
 					$sql .= $sqlwhere;
8049 8049
 
@@ -8053,10 +8053,10 @@  discard block
 block discarded – undo
8053 8053
 					} else {
8054 8054
 						$sql .= " ORDER BY ".$this->db->sanitize(implode(', ', $fields_label));
8055 8055
 					}
8056
-					$sql .= ' LIMIT ' . getDolGlobalInt('MAIN_EXTRAFIELDS_LIMIT_SELLIST_SQL', 1000);
8056
+					$sql .= ' LIMIT '.getDolGlobalInt('MAIN_EXTRAFIELDS_LIMIT_SELLIST_SQL', 1000);
8057 8057
 					// print $sql;
8058 8058
 
8059
-					dol_syslog(get_class($this) . '::showInputField type=sellist', LOG_DEBUG);
8059
+					dol_syslog(get_class($this).'::showInputField type=sellist', LOG_DEBUG);
8060 8060
 					$resql = $this->db->query($sql);
8061 8061
 					if ($resql) {
8062 8062
 						$out .= '<option value="0">&nbsp;</option>';
@@ -8072,7 +8072,7 @@  discard block
 block discarded – undo
8072 8072
 							if (count($fields_label) > 1) {
8073 8073
 								$notrans = true;
8074 8074
 								foreach ($fields_label as $field_toshow) {
8075
-									$labeltoshow .= $obj->$field_toshow . ' ';
8075
+									$labeltoshow .= $obj->$field_toshow.' ';
8076 8076
 								}
8077 8077
 							} else {
8078 8078
 								$labeltoshow = $obj->{$InfoFieldList[1]};
@@ -8083,12 +8083,12 @@  discard block
 block discarded – undo
8083 8083
 								foreach ($fields_label as $field_toshow) {
8084 8084
 									$translabel = $langs->trans($obj->$field_toshow);
8085 8085
 									if ($translabel != $obj->$field_toshow) {
8086
-										$labeltoshow = dol_trunc($translabel) . ' ';
8086
+										$labeltoshow = dol_trunc($translabel).' ';
8087 8087
 									} else {
8088
-										$labeltoshow = dol_trunc($obj->$field_toshow) . ' ';
8088
+										$labeltoshow = dol_trunc($obj->$field_toshow).' ';
8089 8089
 									}
8090 8090
 								}
8091
-								$out .= '<option value="' . $obj->rowid . '" selected>' . $labeltoshow . '</option>';
8091
+								$out .= '<option value="'.$obj->rowid.'" selected>'.$labeltoshow.'</option>';
8092 8092
 							} else {
8093 8093
 								if (!$notrans) {
8094 8094
 									$translabel = $langs->trans($obj->{$InfoFieldList[1]});
@@ -8102,25 +8102,25 @@  discard block
 block discarded – undo
8102 8102
 									$labeltoshow = '(not defined)';
8103 8103
 								}
8104 8104
 								if ($value == $obj->rowid) {
8105
-									$out .= '<option value="' . $obj->rowid . '" selected>' . $labeltoshow . '</option>';
8105
+									$out .= '<option value="'.$obj->rowid.'" selected>'.$labeltoshow.'</option>';
8106 8106
 								}
8107 8107
 
8108 8108
 								if (!empty($InfoFieldList[3]) && $parentField) {
8109
-									$parent = $parentName . ':' . $obj->{$parentField};
8109
+									$parent = $parentName.':'.$obj->{$parentField};
8110 8110
 									$isDependList = 1;
8111 8111
 								}
8112 8112
 
8113
-								$out .= '<option value="' . $obj->rowid . '"';
8113
+								$out .= '<option value="'.$obj->rowid.'"';
8114 8114
 								$out .= ($value == $obj->rowid ? ' selected' : '');
8115
-								$out .= (!empty($parent) ? ' parent="' . $parent . '"' : '');
8116
-								$out .= '>' . $labeltoshow . '</option>';
8115
+								$out .= (!empty($parent) ? ' parent="'.$parent.'"' : '');
8116
+								$out .= '>'.$labeltoshow.'</option>';
8117 8117
 							}
8118 8118
 
8119 8119
 							$i++;
8120 8120
 						}
8121 8121
 						$this->db->free($resql);
8122 8122
 					} else {
8123
-						print 'Error in request ' . $sql . ' ' . $this->db->lasterror() . '. Check setup of extra parameters.<br>';
8123
+						print 'Error in request '.$sql.' '.$this->db->lasterror().'. Check setup of extra parameters.<br>';
8124 8124
 					}
8125 8125
 				} else {
8126 8126
 					require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
@@ -8134,9 +8134,9 @@  discard block
 block discarded – undo
8134 8134
 					$data = $form->select_all_categories($categcode, '', 'parent', 64, $InfoFieldList[6], 1, 1);
8135 8135
 					$out .= '<option value="0">&nbsp;</option>';
8136 8136
 					foreach ($data as $data_key => $data_value) {
8137
-						$out .= '<option value="' . $data_key . '"';
8137
+						$out .= '<option value="'.$data_key.'"';
8138 8138
 						$out .= ($value == $data_key ? ' selected' : '');
8139
-						$out .= '>' . $data_value . '</option>';
8139
+						$out .= '>'.$data_value.'</option>';
8140 8140
 					}
8141 8141
 				}
8142 8142
 			}
@@ -8176,7 +8176,7 @@  discard block
 block discarded – undo
8176 8176
 				// 7 : sort field
8177 8177
 
8178 8178
 				// If there is a filter
8179
-				if (! empty($InfoFieldList[4])) {
8179
+				if (!empty($InfoFieldList[4])) {
8180 8180
 					$pos = 0;
8181 8181
 					$parenthesisopen = 0;
8182 8182
 					while (substr($InfoFieldList[4], $pos, 1) !== '' && ($parenthesisopen || $pos == 0 || substr($InfoFieldList[4], $pos, 1) != ':')) {
@@ -8242,8 +8242,8 @@  discard block
 block discarded – undo
8242 8242
 					}
8243 8243
 
8244 8244
 					$sqlwhere = '';
8245
-					$sql = "SELECT " . $keyList;
8246
-					$sql .= ' FROM ' . $this->db->prefix() . $InfoFieldList[0];
8245
+					$sql = "SELECT ".$keyList;
8246
+					$sql .= ' FROM '.$this->db->prefix().$InfoFieldList[0];
8247 8247
 
8248 8248
 					if (!empty($InfoFieldList[4])) {
8249 8249
 						// can use SELECT request
@@ -8261,11 +8261,11 @@  discard block
 block discarded – undo
8261 8261
 						// We have to join on extrafield table
8262 8262
 						$errstr = '';
8263 8263
 						if (strpos($InfoFieldList[4], 'extra') !== false) {
8264
-							$sql .= ' as main, ' . $this->db->sanitize($this->db->prefix() . $InfoFieldList[0]) . '_extrafields as extra';
8265
-							$sqlwhere .= " WHERE extra.fk_object = main." . $this->db->sanitize($InfoFieldList[2]);
8266
-							$sqlwhere .= " AND " . $InfoFieldList[4];
8264
+							$sql .= ' as main, '.$this->db->sanitize($this->db->prefix().$InfoFieldList[0]).'_extrafields as extra';
8265
+							$sqlwhere .= " WHERE extra.fk_object = main.".$this->db->sanitize($InfoFieldList[2]);
8266
+							$sqlwhere .= " AND ".$InfoFieldList[4];
8267 8267
 						} else {
8268
-							$sqlwhere .= " WHERE " . $InfoFieldList[4];
8268
+							$sqlwhere .= " WHERE ".$InfoFieldList[4];
8269 8269
 						}
8270 8270
 					} else {
8271 8271
 						$sqlwhere .= ' WHERE 1=1';
@@ -8286,14 +8286,14 @@  discard block
 block discarded – undo
8286 8286
 
8287 8287
 					// Some tables may have field, some other not. For the moment we disable it.
8288 8288
 					if (in_array($InfoFieldList[0], array('tablewithentity'))) {
8289
-						$sqlwhere .= " AND entity = " . ((int) $conf->entity);
8289
+						$sqlwhere .= " AND entity = ".((int) $conf->entity);
8290 8290
 					}
8291 8291
 					// $sql.=preg_replace('/^ AND /','',$sqlwhere);
8292 8292
 					// print $sql;
8293 8293
 
8294 8294
 					$sql .= $sqlwhere;
8295 8295
 
8296
-					dol_syslog(get_class($this) . '::showInputField type=chkbxlst', LOG_DEBUG);
8296
+					dol_syslog(get_class($this).'::showInputField type=chkbxlst', LOG_DEBUG);
8297 8297
 
8298 8298
 					$resql = $this->db->query($sql);
8299 8299
 					if ($resql) {
@@ -8312,7 +8312,7 @@  discard block
 block discarded – undo
8312 8312
 							if (count($fields_label) > 1) {
8313 8313
 								$notrans = true;
8314 8314
 								foreach ($fields_label as $field_toshow) {
8315
-									$labeltoshow .= $obj->$field_toshow . ' ';
8315
+									$labeltoshow .= $obj->$field_toshow.' ';
8316 8316
 								}
8317 8317
 							} else {
8318 8318
 								$labeltoshow = $obj->{$InfoFieldList[1]};
@@ -8323,9 +8323,9 @@  discard block
 block discarded – undo
8323 8323
 								foreach ($fields_label as $field_toshow) {
8324 8324
 									$translabel = $langs->trans($obj->$field_toshow);
8325 8325
 									if ($translabel != $obj->$field_toshow) {
8326
-										$labeltoshow = dol_trunc($translabel, 18) . ' ';
8326
+										$labeltoshow = dol_trunc($translabel, 18).' ';
8327 8327
 									} else {
8328
-										$labeltoshow = dol_trunc($obj->$field_toshow, 18) . ' ';
8328
+										$labeltoshow = dol_trunc($obj->$field_toshow, 18).' ';
8329 8329
 									}
8330 8330
 								}
8331 8331
 
@@ -8348,7 +8348,7 @@  discard block
 block discarded – undo
8348 8348
 								}
8349 8349
 
8350 8350
 								if (!empty($InfoFieldList[3]) && $parentField) {
8351
-									$parent = $parentName . ':' . $obj->{$parentField};
8351
+									$parent = $parentName.':'.$obj->{$parentField};
8352 8352
 									$isDependList = 1;
8353 8353
 								}
8354 8354
 
@@ -8359,9 +8359,9 @@  discard block
 block discarded – undo
8359 8359
 						}
8360 8360
 						$this->db->free($resql);
8361 8361
 
8362
-						$out = $form->multiselectarray($keyprefix . $key . $keysuffix, $data, $value_arr, 0, 0, $morecss, 0, '100%');
8362
+						$out = $form->multiselectarray($keyprefix.$key.$keysuffix, $data, $value_arr, 0, 0, $morecss, 0, '100%');
8363 8363
 					} else {
8364
-						print 'Error in request ' . $sql . ' ' . $this->db->lasterror() . '. Check setup of extra parameters.<br>';
8364
+						print 'Error in request '.$sql.' '.$this->db->lasterror().'. Check setup of extra parameters.<br>';
8365 8365
 					}
8366 8366
 				} else {
8367 8367
 					require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
@@ -8373,7 +8373,7 @@  discard block
 block discarded – undo
8373 8373
 					}
8374 8374
 
8375 8375
 					$data = $form->select_all_categories($categcode, '', 'parent', 64, $InfoFieldList[6], 1, 1);
8376
-					$out = $form->multiselectarray($keyprefix . $key . $keysuffix, $data, $value_arr, 0, 0, $morecss, 0, '100%');
8376
+					$out = $form->multiselectarray($keyprefix.$key.$keysuffix, $data, $value_arr, 0, 0, $morecss, 0, '100%');
8377 8377
 				}
8378 8378
 			}
8379 8379
 		} elseif ($type == 'link') {
@@ -8408,7 +8408,7 @@  discard block
 block discarded – undo
8408 8408
 			// $val is already the record field found at same place than found by $valparent but already loaded and may have been modified by parent caller.
8409 8409
 
8410 8410
 			//$objectfield = $valparent;
8411
-			$objectfield = $val;			// Is better than using old method $valparent
8411
+			$objectfield = $val; // Is better than using old method $valparent
8412 8412
 
8413 8413
 			// @phan-suppress-next-line PhanTypeMismatchArgumentNullable
8414 8414
 			$out = $form->selectForForms($param_list_array[0], $keyprefix.$key.$keysuffix, (int) $value, $showempty, '', '', $morecss, $moreparam, 0, (empty($val['disabled']) ? 0 : 1), '', $objectfield);
@@ -8621,7 +8621,7 @@  discard block
 block discarded – undo
8621 8621
 			$value = $this->getLibStatut(3);
8622 8622
 		} elseif ($type == 'date') {
8623 8623
 			if (!empty($value)) {
8624
-				$value = dol_print_date($value, 'day');	// We suppose dates without time are always gmt (storage of course + output)
8624
+				$value = dol_print_date($value, 'day'); // We suppose dates without time are always gmt (storage of course + output)
8625 8625
 			} else {
8626 8626
 				$value = '';
8627 8627
 			}
@@ -8722,7 +8722,7 @@  discard block
 block discarded – undo
8722 8722
 			$value = isset($param['options'][(string) $value]) ? $param['options'][(string) $value] : '';
8723 8723
 			if (strpos($value, "|") !== false) {
8724 8724
 				$value = $langs->trans(explode('|', $value)[0]);
8725
-			} elseif (! is_numeric($value)) {
8725
+			} elseif (!is_numeric($value)) {
8726 8726
 				$value = $langs->trans($value);
8727 8727
 			}
8728 8728
 		} elseif ($type == 'sellist') {
@@ -8784,9 +8784,9 @@  discard block
 block discarded – undo
8784 8784
 									$translabel = $langs->trans($obj->$field_toshow);
8785 8785
 								}
8786 8786
 								if ($translabel != $field_toshow) {
8787
-									$value .= dol_trunc($translabel, 18) . ' ';
8787
+									$value .= dol_trunc($translabel, 18).' ';
8788 8788
 								} else {
8789
-									$value .= $obj->$field_toshow . ' ';
8789
+									$value .= $obj->$field_toshow.' ';
8790 8790
 								}
8791 8791
 							}
8792 8792
 						} else {
@@ -8802,7 +8802,7 @@  discard block
 block discarded – undo
8802 8802
 						}
8803 8803
 					}
8804 8804
 				} else {
8805
-					require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
8805
+					require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
8806 8806
 
8807 8807
 					$toprint = array();
8808 8808
 					$obj = $this->db->fetch_object($resql);
@@ -8810,7 +8810,7 @@  discard block
 block discarded – undo
8810 8810
 					$c->fetch($obj->rowid);
8811 8811
 					$ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text
8812 8812
 					foreach ($ways as $way) {
8813
-						$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #aaa"') . '>' . img_object('', 'category') . ' ' . $way . '</li>';
8813
+						$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #aaa"').'>'.img_object('', 'category').' '.$way.'</li>';
8814 8814
 					}
8815 8815
 					$value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
8816 8816
 				}
@@ -8826,11 +8826,11 @@  discard block
 block discarded – undo
8826 8826
 				$toprint = array();
8827 8827
 				foreach ($value_arr as $keyval => $valueval) {
8828 8828
 					if (!empty($valueval)) {
8829
-						$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . $param['options'][$valueval] . '</li>';
8829
+						$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$param['options'][$valueval].'</li>';
8830 8830
 					}
8831 8831
 				}
8832 8832
 				if (!empty($toprint)) {
8833
-					$value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>';
8833
+					$value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
8834 8834
 				}
8835 8835
 			}
8836 8836
 		} elseif ($type == 'chkbxlst') {
@@ -8885,9 +8885,9 @@  discard block
 block discarded – undo
8885 8885
 										$translabel = $langs->trans($obj->$field_toshow);
8886 8886
 									}
8887 8887
 									if ($translabel != $field_toshow) {
8888
-										$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . dol_trunc($translabel, 18) . '</li>';
8888
+										$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.dol_trunc($translabel, 18).'</li>';
8889 8889
 									} else {
8890
-										$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . $obj->$field_toshow . '</li>';
8890
+										$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$obj->$field_toshow.'</li>';
8891 8891
 									}
8892 8892
 								}
8893 8893
 							} else {
@@ -8896,15 +8896,15 @@  discard block
 block discarded – undo
8896 8896
 									$translabel = $langs->trans($obj->{$InfoFieldList[1]});
8897 8897
 								}
8898 8898
 								if ($translabel != $obj->{$InfoFieldList[1]}) {
8899
-									$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . dol_trunc($translabel, 18) . '</li>';
8899
+									$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.dol_trunc($translabel, 18).'</li>';
8900 8900
 								} else {
8901
-									$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . $obj->{$InfoFieldList[1]} . '</li>';
8901
+									$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$obj->{$InfoFieldList[1]}.'</li>';
8902 8902
 								}
8903 8903
 							}
8904 8904
 						}
8905 8905
 					}
8906 8906
 				} else {
8907
-					require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
8907
+					require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
8908 8908
 
8909 8909
 					$toprint = array();
8910 8910
 					while ($obj = $this->db->fetch_object($resql)) {
@@ -8913,7 +8913,7 @@  discard block
 block discarded – undo
8913 8913
 							$c->fetch($obj->rowid);
8914 8914
 							$ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text
8915 8915
 							foreach ($ways as $way) {
8916
-								$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #aaa"') . '>' . img_object('', 'category') . ' ' . $way . '</li>';
8916
+								$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #aaa"').'>'.img_object('', 'category').' '.$way.'</li>';
8917 8917
 							}
8918 8918
 						}
8919 8919
 					}
@@ -9083,7 +9083,7 @@  discard block
 block discarded – undo
9083 9083
 		global $langs;
9084 9084
 
9085 9085
 		if (!class_exists('Validate')) {
9086
-			require_once DOL_DOCUMENT_ROOT . '/core/class/validate.class.php';
9086
+			require_once DOL_DOCUMENT_ROOT.'/core/class/validate.class.php';
9087 9087
 		}
9088 9088
 
9089 9089
 		$this->clearFieldError($fieldKey);
@@ -9322,7 +9322,7 @@  discard block
 block discarded – undo
9322 9322
 				$out .= "\n";
9323 9323
 
9324 9324
 				$nbofextrafieldsshown = 0;
9325
-				$e = 0;	// var to manage the modulo (odd/even)
9325
+				$e = 0; // var to manage the modulo (odd/even)
9326 9326
 
9327 9327
 				$lastseparatorkeyfound = '';
9328 9328
 				$extrafields_collapse_num = '';
@@ -9360,9 +9360,9 @@  discard block
 block discarded – undo
9360 9360
 						continue; // <> -1 and <> 1 and <> 3 = not visible on forms, only on list
9361 9361
 					} elseif (($mode == 'edit') && !in_array(abs($visibility), array(1, 3, 4))) {
9362 9362
 						// We need to make sure, that the values of hidden extrafields are also part of $_POST. Otherwise, they would be empty after an update of the object. See also getOptionalsFromPost
9363
-						$ef_name = 'options_' . $key;
9363
+						$ef_name = 'options_'.$key;
9364 9364
 						$ef_value = $this->array_options[$ef_name];
9365
-						$out .= '<input type="hidden" name="' . $ef_name . '" id="' . $ef_name . '" value="' . $ef_value . '" />' . "\n";
9365
+						$out .= '<input type="hidden" name="'.$ef_name.'" id="'.$ef_name.'" value="'.$ef_value.'" />'."\n";
9366 9366
 						continue; // <> -1 and <> 1 and <> 3 = not visible on forms, only on list and <> 4 = not visible at the creation
9367 9367
 					} elseif ($mode == 'view' && empty($visibility)) {
9368 9368
 						continue;
@@ -10452,7 +10452,7 @@  discard block
 block discarded – undo
10452 10452
 						continue;
10453 10453
 					}
10454 10454
 				}
10455
-				$keys_with_alias[] = $alias . '.' . $fieldname;
10455
+				$keys_with_alias[] = $alias.'.'.$fieldname;
10456 10456
 			}
10457 10457
 			return implode(', ', $keys_with_alias);
10458 10458
 		} else {
@@ -10596,7 +10596,7 @@  discard block
 block discarded – undo
10596 10596
 		if (!$error) {
10597 10597
 			$sql = "INSERT INTO ".$this->db->prefix().$this->table_element;
10598 10598
 			$sql .= " (".implode(", ", $keys).')';
10599
-			$sql .= " VALUES (".implode(", ", $values).")";		// $values can contains 'abc' or 123
10599
+			$sql .= " VALUES (".implode(", ", $values).")"; // $values can contains 'abc' or 123
10600 10600
 
10601 10601
 			$res = $this->db->query($sql);
10602 10602
 			if (!$res) {
@@ -10910,7 +10910,7 @@  discard block
 block discarded – undo
10910 10910
 
10911 10911
 		// Update extrafield
10912 10912
 		if (!$error) {
10913
-			$result = $this->insertExtraFields();	// This update extrafields
10913
+			$result = $this->insertExtraFields(); // This update extrafields
10914 10914
 			if ($result < 0) {
10915 10915
 				$error++;
10916 10916
 			}
@@ -11134,12 +11134,12 @@  discard block
 block discarded – undo
11134 11134
 				$error++;
11135 11135
 			} else {
11136 11136
 				while ($obj = $this->db->fetch_object($resql)) {
11137
-					$result = $this->fetch($obj->rowid);	// @phpstan-ignore-line
11137
+					$result = $this->fetch($obj->rowid); // @phpstan-ignore-line
11138 11138
 					if ($result < 0) {
11139 11139
 						$error++;
11140 11140
 						$this->errors[] = $this->error;
11141 11141
 					} else {
11142
-						$result = $this->delete($user);	// @phpstan-ignore-line
11142
+						$result = $this->delete($user); // @phpstan-ignore-line
11143 11143
 						if ($result < 0) {
11144 11144
 							$error++;
11145 11145
 							$this->errors[] = $this->error;
@@ -11306,7 +11306,7 @@  discard block
 block discarded – undo
11306 11306
 		);
11307 11307
 		foreach ($fields as $key => $value) {
11308 11308
 			if (array_key_exists($key, $this->fields)) {
11309
-				$this->{$key} = $value;		// @phpstan-ignore-line
11309
+				$this->{$key} = $value; // @phpstan-ignore-line
11310 11310
 			}
11311 11311
 		}
11312 11312
 
Please login to merge, or discard this patch.