Completed
Branch develop (a43bf4)
by
unknown
25:03
created
htdocs/core/lib/company.lib.php 1 patch
Spacing   +359 added lines, -359 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
 				}
@@ -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.