Completed
Branch develop (fc1aaa)
by
unknown
18:31
created
htdocs/core/lib/public.lib.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,8 +26,8 @@
 block discarded – undo
26 26
  * 	\brief		Library of public page functions
27 27
  */
28 28
 
29
-require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
30
-require_once DOL_DOCUMENT_ROOT . '/core/lib/functions.lib.php';
29
+require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
30
+require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php';
31 31
 
32 32
 /**
33 33
  * Check if the object exceeded the number of posts for a specific ip
Please login to merge, or discard this patch.
htdocs/core/lib/propal.lib.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
 			} else {
133 133
 				dol_syslog('Failed to count actioncomm '.$db->lasterror(), LOG_ERR);
134 134
 			}
135
-			dol_setcache($cachekey, $nbEvent, 120);		// If setting cache fails, this is not a problem, so we do not test result.
135
+			dol_setcache($cachekey, $nbEvent, 120); // If setting cache fails, this is not a problem, so we do not test result.
136 136
 		}
137 137
 
138 138
 		$head[$h][1] .= '/';
@@ -267,9 +267,9 @@  discard block
 block discarded – undo
267 267
 		$result = '<div class="div-table-responsive-no-min">';
268 268
 		$result .= '<table class="noborder nohover centpercent">';
269 269
 
270
-		$result .=  '<tr class="liste_titre">';
271
-		$result .=  '<td colspan="2">'.$langs->trans("Statistics").' - '.$langs->trans("Proposals").'</td>';
272
-		$result .=  '</tr>';
270
+		$result .= '<tr class="liste_titre">';
271
+		$result .= '<td colspan="2">'.$langs->trans("Statistics").' - '.$langs->trans("Proposals").'</td>';
272
+		$result .= '</tr>';
273 273
 
274 274
 		foreach ($listofstatus as $status) {
275 275
 			$dataseries[] = array($propalstatic->LibStatut($status, 1), (isset($vals[$status]) ? (int) $vals[$status] : 0));
@@ -290,16 +290,16 @@  discard block
 block discarded – undo
290 290
 			}
291 291
 
292 292
 			if (empty($conf->use_javascript_ajax)) {
293
-				$result .=  '<tr class="oddeven">';
294
-				$result .=  '<td>'.$propalstatic->LibStatut($status, 0).'</td>';
295
-				$result .=  '<td class="right"><a href="list.php?statut='.$status.'">'.(isset($vals[$status]) ? $vals[$status] : 0).'</a></td>';
296
-				$result .=  "</tr>\n";
293
+				$result .= '<tr class="oddeven">';
294
+				$result .= '<td>'.$propalstatic->LibStatut($status, 0).'</td>';
295
+				$result .= '<td class="right"><a href="list.php?statut='.$status.'">'.(isset($vals[$status]) ? $vals[$status] : 0).'</a></td>';
296
+				$result .= "</tr>\n";
297 297
 			}
298 298
 		}
299 299
 
300 300
 		if ($conf->use_javascript_ajax) {
301
-			$result .=  '<tr>';
302
-			$result .=  '<td align="center" colspan="2">';
301
+			$result .= '<tr>';
302
+			$result .= '<td align="center" colspan="2">';
303 303
 
304 304
 			include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
305 305
 			$dolgraph = new DolGraph();
@@ -311,10 +311,10 @@  discard block
 block discarded – undo
311 311
 			$dolgraph->setHeight('150');
312 312
 			$dolgraph->setWidth('300');
313 313
 			$dolgraph->draw('idgraphthirdparties');
314
-			$result .=  $dolgraph->show($total ? 0 : 1);
314
+			$result .= $dolgraph->show($total ? 0 : 1);
315 315
 
316
-			$result .=  '</td>';
317
-			$result .=  '</tr>';
316
+			$result .= '</td>';
317
+			$result .= '</tr>';
318 318
 		}
319 319
 
320 320
 		//if ($totalinprocess != $total)
@@ -325,14 +325,14 @@  discard block
 block discarded – undo
325 325
 		//	print '</tr>';
326 326
 		//}
327 327
 
328
-		$result .=  '<tr class="liste_total">';
329
-		$result .=  '<td>'.$langs->trans("Total").'</td>';
330
-		$result .=  '<td class="right">'.$total.'</td>';
331
-		$result .=  '</tr>';
328
+		$result .= '<tr class="liste_total">';
329
+		$result .= '<td>'.$langs->trans("Total").'</td>';
330
+		$result .= '<td class="right">'.$total.'</td>';
331
+		$result .= '</tr>';
332 332
 
333
-		$result .=  '</table>';
334
-		$result .=  '</div>';
335
-		$result .=  '<br>';
333
+		$result .= '</table>';
334
+		$result .= '</div>';
335
+		$result .= '<br>';
336 336
 	} else {
337 337
 		dol_print_error($db);
338 338
 	}
Please login to merge, or discard this patch.
htdocs/core/lib/project.lib.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 		$nbContacts = $dataretrieved;
60 60
 	} else {
61 61
 		$nbContacts = count($project->liste_contact(-1, 'internal')) + count($project->liste_contact(-1, 'external'));
62
-		dol_setcache($cachekey, $nbContacts, 120);	// If setting cache fails, this is not a problem, so we do not test result.
62
+		dol_setcache($cachekey, $nbContacts, 120); // If setting cache fails, this is not a problem, so we do not test result.
63 63
 	}
64 64
 	$head[$h][0] = DOL_URL_ROOT.'/projet/contact.php?id='.((int) $project->id).($moreparam ? '&'.$moreparam : '');
65 65
 	$head[$h][1] = $langs->trans("ProjectContact");
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 			require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php';
84 84
 			$taskstatic = new Task($db);
85 85
 			$nbTasks = count($taskstatic->getTasksArray(null, null, $project->id, 0, 0));
86
-			dol_setcache($cachekey, $nbTasks, 120);	// If setting cache fails, this is not a problem, so we do not test result.
86
+			dol_setcache($cachekey, $nbTasks, 120); // If setting cache fails, this is not a problem, so we do not test result.
87 87
 		}
88 88
 		$head[$h][0] = DOL_URL_ROOT.'/projet/tasks.php?id='.((int) $project->id).($moreparam ? '&'.$moreparam : '');
89 89
 		$head[$h][1] = $langs->trans("Tasks");
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 				$obj = $db->fetch_object($resql);
113 113
 				if ($obj) {
114 114
 					$nbTimeSpent = 1;
115
-					dol_setcache($cachekey, $nbTimeSpent, 120);	// If setting cache fails, this is not a problem, so we do not test result.
115
+					dol_setcache($cachekey, $nbTimeSpent, 120); // If setting cache fails, this is not a problem, so we do not test result.
116 116
 				}
117 117
 			} else {
118 118
 				dol_print_error($db);
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
 			if (isModEnabled("bank")) {
203 203
 				$nbElements += $project->getElementCount('variouspayment', 'payment_various');
204 204
 			}
205
-			dol_setcache($cachekey, $nbElements, 120);	// If setting cache fails, this is not a problem, so we do not test result.
205
+			dol_setcache($cachekey, $nbElements, 120); // If setting cache fails, this is not a problem, so we do not test result.
206 206
 		}
207 207
 		$head[$h][0] = DOL_URL_ROOT.'/projet/element.php?id='.$project->id;
208 208
 		$head[$h][1] = $langs->trans("ProjectOverview");
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
 
229 229
 	if (isModEnabled('eventorganization') && !empty($project->usage_organize_event)) {
230 230
 		$langs->load('eventorganization');
231
-		$head[$h][0] = DOL_URL_ROOT . '/eventorganization/conferenceorbooth_list.php?projectid=' . $project->id;
231
+		$head[$h][0] = DOL_URL_ROOT.'/eventorganization/conferenceorbooth_list.php?projectid='.$project->id;
232 232
 		$head[$h][1] = $langs->trans("EventOrganization");
233 233
 
234 234
 		// Enable caching of conf or booth count
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
 			} else {
250 250
 				$nbConfOrBooth = count($result);
251 251
 			}
252
-			dol_setcache($cachekey, $nbConfOrBooth, 120);	// If setting cache fails, this is not a problem, so we do not test result.
252
+			dol_setcache($cachekey, $nbConfOrBooth, 120); // If setting cache fails, this is not a problem, so we do not test result.
253 253
 		}
254 254
 		$cachekey = 'count_attendees_'.$project->id;
255 255
 		$dataretrieved = dol_getcache($cachekey);
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
 			} else {
266 266
 				$nbAttendees = count($result);
267 267
 			}
268
-			dol_setcache($cachekey, $nbAttendees, 120);	// If setting cache fails, this is not a problem, so we do not test result.
268
+			dol_setcache($cachekey, $nbAttendees, 120); // If setting cache fails, this is not a problem, so we do not test result.
269 269
 		}
270 270
 		if ($nbConfOrBooth > 0 || $nbAttendees > 0) {
271 271
 			$head[$h][1] .= '<span class="badge marginleftonlyshort">';
@@ -317,7 +317,7 @@  discard block
 block discarded – undo
317 317
 		$nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$'));
318 318
 		$nbLinks = Link::count($db, $project->element, $project->id);
319 319
 		$totalAttached = $nbFiles + $nbLinks;
320
-		dol_setcache($cachekey, $totalAttached, 120);		// If setting cache fails, this is not a problem, so we do not test result.
320
+		dol_setcache($cachekey, $totalAttached, 120); // If setting cache fails, this is not a problem, so we do not test result.
321 321
 	}
322 322
 	$head[$h][0] = DOL_URL_ROOT.'/projet/document.php?id='.$project->id;
323 323
 	$head[$h][1] = $langs->trans('Documents');
@@ -338,7 +338,7 @@  discard block
 block discarded – undo
338 338
 			$nbComments = $dataretrieved;
339 339
 		} else {
340 340
 			$nbComments = $project->getNbComments();
341
-			dol_setcache($cachekey, $nbComments, 120);		// If setting cache fails, this is not a problem, so we do not test result.
341
+			dol_setcache($cachekey, $nbComments, 120); // If setting cache fails, this is not a problem, so we do not test result.
342 342
 		}
343 343
 		$head[$h][0] = DOL_URL_ROOT.'/projet/comment.php?id='.$project->id;
344 344
 		$head[$h][1] = $langs->trans("CommentLink");
@@ -553,11 +553,11 @@  discard block
 block discarded – undo
553 553
 	$h++;
554 554
 
555 555
 	if (empty($conf->global->PROJECT_HIDE_TASKS)) {
556
-		$head[$h][0] = DOL_URL_ROOT . '/projet/admin/project_task_extrafields.php';
556
+		$head[$h][0] = DOL_URL_ROOT.'/projet/admin/project_task_extrafields.php';
557 557
 		$head[$h][1] = $langs->trans("ExtraFieldsProjectTask");
558 558
 		$nbExtrafields = $extrafields->attributes['projet_task']['count'];
559 559
 		if ($nbExtrafields > 0) {
560
-			$head[$h][1] .= '<span class="badge marginleftonlyshort">' . $nbExtrafields . '</span>';
560
+			$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
561 561
 		}
562 562
 		$head[$h][2] = 'attributes_task';
563 563
 		$h++;
@@ -690,7 +690,7 @@  discard block
 block discarded – undo
690 690
 				$taskstatic->label = (!empty($taskrole[$lines[$i]->id]) ? $langs->trans("YourRole").': '.$taskrole[$lines[$i]->id] : '');
691 691
 				$taskstatic->projectstatus = $lines[$i]->projectstatus;
692 692
 				$taskstatic->progress = $lines[$i]->progress;
693
-				$taskstatic->fk_statut = $lines[$i]->status;	// deprecated
693
+				$taskstatic->fk_statut = $lines[$i]->status; // deprecated
694 694
 				$taskstatic->status = $lines[$i]->status;
695 695
 				$taskstatic->date_start = $lines[$i]->date_start;
696 696
 				$taskstatic->date_end = $lines[$i]->date_end;
@@ -707,7 +707,7 @@  discard block
 block discarded – undo
707 707
 					if (in_array($lines[$i]->id, $arrayofselected)) {
708 708
 						$selected = 1;
709 709
 					}
710
-					print '<input id="cb' . $lines[$i]->id . '" class="flat checkforselect" type="checkbox" name="toselect[]" value="' . $lines[$i]->id . '"' . ($selected ? ' checked="checked"' : '') . '>';
710
+					print '<input id="cb'.$lines[$i]->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$lines[$i]->id.'"'.($selected ? ' checked="checked"' : '').'>';
711 711
 					print '</td>';
712 712
 				}
713 713
 
@@ -971,7 +971,7 @@  discard block
 block discarded – undo
971 971
 					if (in_array($lines[$i]->id, $arrayofselected)) {
972 972
 						$selected = 1;
973 973
 					}
974
-					print '<input id="cb' . $lines[$i]->id . '" class="flat checkforselect" type="checkbox" name="toselect[]" value="' . $lines[$i]->id . '"' . ($selected ? ' checked="checked"' : '') . '>';
974
+					print '<input id="cb'.$lines[$i]->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$lines[$i]->id.'"'.($selected ? ' checked="checked"' : '').'>';
975 975
 
976 976
 					print '</td>';
977 977
 				}
@@ -2141,7 +2141,7 @@  discard block
 block discarded – undo
2141 2141
 
2142 2142
 					$disabledtaskday = $disabledtask;
2143 2143
 
2144
-					if (! $disabledtask && $restrictBefore && $tmpday < $restrictBefore) {
2144
+					if (!$disabledtask && $restrictBefore && $tmpday < $restrictBefore) {
2145 2145
 						$disabledtaskday = 1;
2146 2146
 					}
2147 2147
 
@@ -2431,7 +2431,7 @@  discard block
 block discarded – undo
2431 2431
 				$j = 0;
2432 2432
 				foreach ($TWeek as $weekIndex => $weekNb) {
2433 2433
 					$j++;
2434
-					$weekWorkLoad = !empty($projectstatic->monthWorkLoadPerTask[$weekNb][$lines[$i]->id]) ? $projectstatic->monthWorkLoadPerTask[$weekNb][$lines[$i]->id] : 0 ;
2434
+					$weekWorkLoad = !empty($projectstatic->monthWorkLoadPerTask[$weekNb][$lines[$i]->id]) ? $projectstatic->monthWorkLoadPerTask[$weekNb][$lines[$i]->id] : 0;
2435 2435
 					if (!isset($totalforeachweek[$weekNb])) {
2436 2436
 						$totalforeachweek[$weekNb] = 0;
2437 2437
 					}
@@ -2446,7 +2446,7 @@  discard block
 block discarded – undo
2446 2446
 					$disabledtaskweek = $disabledtask;
2447 2447
 					$firstdayofweek = dol_mktime(0, 0, 0, $month, $TFirstDay[$weekIndex], $year);
2448 2448
 
2449
-					if (! $disabledtask && $restrictBefore && $firstdayofweek < $restrictBefore) {
2449
+					if (!$disabledtask && $restrictBefore && $firstdayofweek < $restrictBefore) {
2450 2450
 						$disabledtaskweek = 1;
2451 2451
 					}
2452 2452
 
@@ -2622,7 +2622,7 @@  discard block
 block discarded – undo
2622 2622
 		$sql .= " AND p.fk_statut = ".(int) $status;
2623 2623
 	}
2624 2624
 	if (getDolGlobalString('PROJECT_LIMIT_YEAR_RANGE')) {
2625
-		$project_year_filter = GETPOST("project_year_filter", 'alpha');	// '*' seems allowed
2625
+		$project_year_filter = GETPOST("project_year_filter", 'alpha'); // '*' seems allowed
2626 2626
 		//Check if empty or invalid year. Wildcard ignores the sql check
2627 2627
 		if ($project_year_filter != "*") {
2628 2628
 			if (empty($project_year_filter) || !is_numeric($project_year_filter)) {
Please login to merge, or discard this patch.
htdocs/core/lib/date.lib.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
 
184 184
 		$newtimeyear = (int) dol_print_date($newtime, '%Y');
185 185
 		$newtimemonth = (int) dol_print_date($newtime, '%m');
186
-		$newtimetotalmonths = (($newtimeyear * 12) +  $newtimemonth);
186
+		$newtimetotalmonths = (($newtimeyear * 12) + $newtimemonth);
187 187
 
188 188
 		if ($monthsexpected < $newtimetotalmonths) {
189 189
 			$newtimehours = (int) dol_print_date($newtime, '%H');
@@ -796,7 +796,7 @@  discard block
 block discarded – undo
796 796
 		$sql = "SELECT id, code, entity, fk_country, dayrule, year, month, day, active";
797 797
 		$sql .= " FROM ".MAIN_DB_PREFIX."c_hrm_public_holiday";
798 798
 		$sql .= " WHERE active = 1 and fk_country IN (0".($country_id > 0 ? ", ".$country_id : 0).")";
799
-		$sql .= " AND entity IN (0," .getEntity('holiday') .")";
799
+		$sql .= " AND entity IN (0,".getEntity('holiday').")";
800 800
 
801 801
 		$resql = $db->query($sql);
802 802
 		if ($resql) {
Please login to merge, or discard this patch.
htdocs/core/class/commonobject.class.php 1 patch
Spacing   +128 added lines, -128 removed lines patch added patch discarded remove patch
@@ -476,11 +476,11 @@  discard block
 block discarded – undo
476 476
 	 *
477 477
 	 * Note: cond_reglement can not be aliased to cond_reglement!!!
478 478
 	 */
479
-	private $cond_reglement;  // Private to call DolDeprecationHandler
479
+	private $cond_reglement; // Private to call DolDeprecationHandler
480 480
 	/**
481 481
 	 * @var int|string Internal to detect deprecated access
482 482
 	 */
483
-	protected $depr_cond_reglement;  // Internal value for deprecation
483
+	protected $depr_cond_reglement; // Internal value for deprecation
484 484
 
485 485
 	/**
486 486
 	 * @var int 		Delivery address ID
@@ -537,12 +537,12 @@  discard block
 block discarded – undo
537 537
 	/**
538 538
 	 * @var float|string Multicurrency total localtax1
539 539
 	 */
540
-	public $multicurrency_total_localtax1;	// not in database
540
+	public $multicurrency_total_localtax1; // not in database
541 541
 
542 542
 	/**
543 543
 	 * @var float|string Multicurrency total localtax2
544 544
 	 */
545
-	public $multicurrency_total_localtax2;	// not in database
545
+	public $multicurrency_total_localtax2; // not in database
546 546
 
547 547
 	/**
548 548
 	 * @var string
@@ -1027,17 +1027,17 @@  discard block
 block discarded – undo
1027 1027
 				}
1028 1028
 				$labelextra = $langs->trans((string) $extrafields->attributes[$this->table_element]['label'][$key]);
1029 1029
 				if ($extrafields->attributes[$this->table_element]['type'][$key] == 'separate') {
1030
-					$data[$key] = '<br><b><u>'. $labelextra . '</u></b>';
1030
+					$data[$key] = '<br><b><u>'.$labelextra.'</u></b>';
1031 1031
 				} else {
1032
-					$value = (empty($this->array_options['options_' . $key]) ? '' : $this->array_options['options_' . $key]);
1033
-					$data[$key] = '<br><b>'. $labelextra . ':</b> ' . $extrafields->showOutputField($key, $value, '', $this->table_element);
1032
+					$value = (empty($this->array_options['options_'.$key]) ? '' : $this->array_options['options_'.$key]);
1033
+					$data[$key] = '<br><b>'.$labelextra.':</b> '.$extrafields->showOutputField($key, $value, '', $this->table_element);
1034 1034
 					$count++;
1035 1035
 				}
1036 1036
 			}
1037 1037
 			$data['closedivextra'] = '</div>';
1038 1038
 		}
1039 1039
 
1040
-		$hookmanager->initHooks(array($this->element . 'dao'));
1040
+		$hookmanager->initHooks(array($this->element.'dao'));
1041 1041
 		$parameters = array(
1042 1042
 			'tooltipcontentarray' => &$data,
1043 1043
 			'params' => $params,
@@ -1536,7 +1536,7 @@  discard block
 block discarded – undo
1536 1536
 			$sql .= " AND ec.fk_c_type_contact IN (".$this->db->sanitize(implode(',', $arrayoftcids)).")";
1537 1537
 		}
1538 1538
 		if ($status >= 0) {
1539
-			$sql .= " AND t.statut = ".((int) $status);	// t is llx_user or llx_socpeople
1539
+			$sql .= " AND t.statut = ".((int) $status); // t is llx_user or llx_socpeople
1540 1540
 		}
1541 1541
 		if ($statusoflink >= 0) {
1542 1542
 			$sql .= " AND ec.statut = ".((int) $statusoflink);
@@ -1918,7 +1918,7 @@  discard block
 block discarded – undo
1918 1918
 		}
1919 1919
 
1920 1920
 		$sql = "SELECT rowid FROM ".$this->db->prefix().$this->table_element;
1921
-		$sql .= " WHERE ".$this->table_ref_field." LIKE '".$this->db->escape($ref)."'";	// no escapeforlike here
1921
+		$sql .= " WHERE ".$this->table_ref_field." LIKE '".$this->db->escape($ref)."'"; // no escapeforlike here
1922 1922
 		$sql .= " LIMIT 1";
1923 1923
 
1924 1924
 		$query = $this->db->query($sql);
@@ -2210,9 +2210,9 @@  discard block
 block discarded – undo
2210 2210
 
2211 2211
 		$oldvalue = null;
2212 2212
 		if ($trigkey) {
2213
-			$sql = "SELECT " . $field;
2214
-			$sql .= " FROM " . MAIN_DB_PREFIX . $table;
2215
-			$sql .= " WHERE " . $id_field . " = " . ((int) $id);
2213
+			$sql = "SELECT ".$field;
2214
+			$sql .= " FROM ".MAIN_DB_PREFIX.$table;
2215
+			$sql .= " WHERE ".$id_field." = ".((int) $id);
2216 2216
 
2217 2217
 			$resql = $this->db->query($sql);
2218 2218
 			if ($resql) {
@@ -2592,7 +2592,7 @@  discard block
 block discarded – undo
2592 2592
 		// Triggers
2593 2593
 		if (!$error && !$notrigger) {
2594 2594
 			// Call triggers
2595
-			$result = $this->call_trigger(strtoupper($this->element) . '_MODIFY', $user);
2595
+			$result = $this->call_trigger(strtoupper($this->element).'_MODIFY', $user);
2596 2596
 			if ($result < 0) {
2597 2597
 				$error++;
2598 2598
 			} //Do also here what you must do to rollback action if trigger fail
@@ -2958,7 +2958,7 @@  discard block
 block discarded – undo
2958 2958
 			$sql = 'UPDATE '.$this->db->prefix().$this->table_element;
2959 2959
 			$sql .= " SET ".$fieldname." = ".(($id > 0 || $id == '0') ? ((int) $id) : 'NULL');
2960 2960
 			if (in_array($this->table_element, array('propal', 'commande', 'societe'))) {
2961
-				$sql .= " , deposit_percent = " . (empty($deposit_percent) ? 'NULL' : "'".$this->db->escape($deposit_percent)."'");
2961
+				$sql .= " , deposit_percent = ".(empty($deposit_percent) ? 'NULL' : "'".$this->db->escape($deposit_percent)."'");
2962 2962
 			}
2963 2963
 			$sql .= ' WHERE rowid='.((int) $this->id);
2964 2964
 
@@ -3306,10 +3306,10 @@  discard block
 block discarded – undo
3306 3306
 		$sql = "SELECT count(rowid) FROM ".$this->db->prefix().$this->table_element_line;
3307 3307
 		$sql .= " WHERE ".$this->fk_element." = ".((int) $this->id);
3308 3308
 		if (!$renum) {
3309
-			$sql .= " AND " . $fieldposition . " = 0";
3309
+			$sql .= " AND ".$fieldposition." = 0";
3310 3310
 		}
3311 3311
 		if ($renum) {
3312
-			$sql .= " AND " . $fieldposition . " <> 0";
3312
+			$sql .= " AND ".$fieldposition." <> 0";
3313 3313
 		}
3314 3314
 
3315 3315
 		dol_syslog(get_class($this)."::line_order", LOG_DEBUG);
@@ -3330,7 +3330,7 @@  discard block
 block discarded – undo
3330 3330
 			if ($fk_parent_line) {
3331 3331
 				$sql .= ' AND fk_parent_line IS NULL';
3332 3332
 			}
3333
-			$sql .= " ORDER BY " . $fieldposition . " ASC, rowid " . $rowidorder;
3333
+			$sql .= " ORDER BY ".$fieldposition." ASC, rowid ".$rowidorder;
3334 3334
 
3335 3335
 			dol_syslog(get_class($this)."::line_order search all parent lines", LOG_DEBUG);
3336 3336
 			$resql = $this->db->query($sql);
@@ -3381,7 +3381,7 @@  discard block
 block discarded – undo
3381 3381
 		$sql = "SELECT rowid FROM ".$this->db->prefix().$this->table_element_line;
3382 3382
 		$sql .= " WHERE ".$this->fk_element." = ".((int) $this->id);
3383 3383
 		$sql .= ' AND fk_parent_line = '.((int) $id);
3384
-		$sql .= " ORDER BY " . $fieldposition . " ASC";
3384
+		$sql .= " ORDER BY ".$fieldposition." ASC";
3385 3385
 
3386 3386
 		dol_syslog(get_class($this)."::getChildrenOfLine search children lines for line ".$id, LOG_DEBUG);
3387 3387
 
@@ -3505,7 +3505,7 @@  discard block
 block discarded – undo
3505 3505
 
3506 3506
 			$sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) $rang);
3507 3507
 			$sql .= " WHERE ".$this->fk_element." = ".((int) $this->id);
3508
-			$sql .= " AND " . $fieldposition . " = " . ((int) ($rang - 1));
3508
+			$sql .= " AND ".$fieldposition." = ".((int) ($rang - 1));
3509 3509
 			if ($this->db->query($sql)) {
3510 3510
 				$sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) ($rang - 1));
3511 3511
 				$sql .= ' WHERE rowid = '.((int) $rowid);
@@ -3536,7 +3536,7 @@  discard block
 block discarded – undo
3536 3536
 
3537 3537
 			$sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) $rang);
3538 3538
 			$sql .= " WHERE ".$this->fk_element." = ".((int) $this->id);
3539
-			$sql .= " AND " . $fieldposition . " = " . ((int) ($rang + 1));
3539
+			$sql .= " AND ".$fieldposition." = ".((int) ($rang + 1));
3540 3540
 			if ($this->db->query($sql)) {
3541 3541
 				$sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) ($rang + 1));
3542 3542
 				$sql .= ' WHERE rowid = '.((int) $rowid);
@@ -3562,7 +3562,7 @@  discard block
 block discarded – undo
3562 3562
 			$fieldposition = 'position';
3563 3563
 		}
3564 3564
 
3565
-		$sql = "SELECT " . $fieldposition . " FROM ".$this->db->prefix().$this->table_element_line;
3565
+		$sql = "SELECT ".$fieldposition." FROM ".$this->db->prefix().$this->table_element_line;
3566 3566
 		$sql .= " WHERE rowid = ".((int) $rowid);
3567 3567
 
3568 3568
 		dol_syslog(get_class($this)."::getRangOfLine", LOG_DEBUG);
@@ -3590,7 +3590,7 @@  discard block
 block discarded – undo
3590 3590
 
3591 3591
 		$sql = "SELECT rowid FROM ".$this->db->prefix().$this->table_element_line;
3592 3592
 		$sql .= " WHERE ".$this->fk_element." = ".((int) $this->id);
3593
-		$sql .= " AND " . $fieldposition . " = ".((int) $rang);
3593
+		$sql .= " AND ".$fieldposition." = ".((int) $rang);
3594 3594
 		$resql = $this->db->query($sql);
3595 3595
 		if ($resql) {
3596 3596
 			$row = $this->db->fetch_row($resql);
@@ -3708,7 +3708,7 @@  discard block
 block discarded – undo
3708 3708
 			$newsuffix = '';
3709 3709
 		}
3710 3710
 		if (in_array($this->table_element, array('actioncomm', 'adherent', 'advtargetemailing', 'cronjob', 'establishment'))) {
3711
-			$fieldusermod =  "fk_user_mod";
3711
+			$fieldusermod = "fk_user_mod";
3712 3712
 		} elseif ($this->table_element == 'ecm_files') {
3713 3713
 			$fieldusermod = "fk_user_m";
3714 3714
 		} else {
@@ -3750,7 +3750,7 @@  discard block
 block discarded – undo
3750 3750
 						$trigger_name = 'EXPENSE_REPORT_MODIFY';
3751 3751
 						break;
3752 3752
 					default:
3753
-						$trigger_name = strtoupper($this->element) . '_MODIFY';
3753
+						$trigger_name = strtoupper($this->element).'_MODIFY';
3754 3754
 				}
3755 3755
 				$ret = $this->call_trigger($trigger_name, $user);
3756 3756
 				if ($ret < 0) {
@@ -4151,19 +4151,19 @@  discard block
 block discarded – undo
4151 4151
 		$this->db->begin();
4152 4152
 		$error = 0;
4153 4153
 
4154
-		$sql = "INSERT INTO " . $this->db->prefix() . "element_element (";
4154
+		$sql = "INSERT INTO ".$this->db->prefix()."element_element (";
4155 4155
 		$sql .= "fk_source";
4156 4156
 		$sql .= ", sourcetype";
4157 4157
 		$sql .= ", fk_target";
4158 4158
 		$sql .= ", targettype";
4159 4159
 		$sql .= ") VALUES (";
4160 4160
 		$sql .= ((int) $origin_id);
4161
-		$sql .= ", '" . $this->db->escape($origin) . "'";
4162
-		$sql .= ", " . ((int) $this->id);
4163
-		$sql .= ", '" . $this->db->escape($targettype) . "'";
4161
+		$sql .= ", '".$this->db->escape($origin)."'";
4162
+		$sql .= ", ".((int) $this->id);
4163
+		$sql .= ", '".$this->db->escape($targettype)."'";
4164 4164
 		$sql .= ")";
4165 4165
 
4166
-		dol_syslog(get_class($this) . "::add_object_linked", LOG_DEBUG);
4166
+		dol_syslog(get_class($this)."::add_object_linked", LOG_DEBUG);
4167 4167
 		if ($this->db->query($sql)) {
4168 4168
 			if (!$notrigger) {
4169 4169
 				// Call trigger
@@ -4415,20 +4415,20 @@  discard block
 block discarded – undo
4415 4415
 		$this->db->begin();
4416 4416
 		$error = 0;
4417 4417
 
4418
-		$sql = "UPDATE " . $this->db->prefix() . "element_element SET ";
4418
+		$sql = "UPDATE ".$this->db->prefix()."element_element SET ";
4419 4419
 		if ($updatesource) {
4420
-			$sql .= "fk_source = " . ((int) $sourceid);
4421
-			$sql .= ", sourcetype = '" . $this->db->escape($sourcetype) . "'";
4422
-			$sql .= " WHERE fk_target = " . ((int) $this->id);
4423
-			$sql .= " AND targettype = '" . $this->db->escape($this->element) . "'";
4420
+			$sql .= "fk_source = ".((int) $sourceid);
4421
+			$sql .= ", sourcetype = '".$this->db->escape($sourcetype)."'";
4422
+			$sql .= " WHERE fk_target = ".((int) $this->id);
4423
+			$sql .= " AND targettype = '".$this->db->escape($this->element)."'";
4424 4424
 		} elseif ($updatetarget) {
4425
-			$sql .= "fk_target = " . ((int) $targetid);
4426
-			$sql .= ", targettype = '" . $this->db->escape($targettype) . "'";
4427
-			$sql .= " WHERE fk_source = " . ((int) $this->id);
4428
-			$sql .= " AND sourcetype = '" . $this->db->escape($this->element) . "'";
4425
+			$sql .= "fk_target = ".((int) $targetid);
4426
+			$sql .= ", targettype = '".$this->db->escape($targettype)."'";
4427
+			$sql .= " WHERE fk_source = ".((int) $this->id);
4428
+			$sql .= " AND sourcetype = '".$this->db->escape($this->element)."'";
4429 4429
 		}
4430 4430
 
4431
-		dol_syslog(get_class($this) . "::updateObjectLinked", LOG_DEBUG);
4431
+		dol_syslog(get_class($this)."::updateObjectLinked", LOG_DEBUG);
4432 4432
 		if ($this->db->query($sql)) {
4433 4433
 			if (!$notrigger) {
4434 4434
 				// Call trigger
@@ -4504,25 +4504,25 @@  discard block
 block discarded – undo
4504 4504
 		}
4505 4505
 
4506 4506
 		if (!$error) {
4507
-			$sql = "DELETE FROM " . $this->db->prefix() . "element_element";
4507
+			$sql = "DELETE FROM ".$this->db->prefix()."element_element";
4508 4508
 			$sql .= " WHERE";
4509 4509
 			if ($rowid > 0) {
4510
-				$sql .= " rowid = " . ((int) $rowid);
4510
+				$sql .= " rowid = ".((int) $rowid);
4511 4511
 			} else {
4512 4512
 				if ($deletesource) {
4513
-					$sql .= " fk_source = " . ((int) $sourceid) . " AND sourcetype = '" . $this->db->escape($sourcetype) . "'";
4514
-					$sql .= " AND fk_target = " . ((int) $this->id) . " AND targettype = '" . $this->db->escape($this->element) . "'";
4513
+					$sql .= " fk_source = ".((int) $sourceid)." AND sourcetype = '".$this->db->escape($sourcetype)."'";
4514
+					$sql .= " AND fk_target = ".((int) $this->id)." AND targettype = '".$this->db->escape($this->element)."'";
4515 4515
 				} elseif ($deletetarget) {
4516
-					$sql .= " fk_target = " . ((int) $targetid) . " AND targettype = '" . $this->db->escape($targettype) . "'";
4517
-					$sql .= " AND fk_source = " . ((int) $this->id) . " AND sourcetype = '" . $this->db->escape($this->element) . "'";
4516
+					$sql .= " fk_target = ".((int) $targetid)." AND targettype = '".$this->db->escape($targettype)."'";
4517
+					$sql .= " AND fk_source = ".((int) $this->id)." AND sourcetype = '".$this->db->escape($this->element)."'";
4518 4518
 				} else {
4519
-					$sql .= " (fk_source = " . ((int) $this->id) . " AND sourcetype = '" . $this->db->escape($this->element) . "')";
4519
+					$sql .= " (fk_source = ".((int) $this->id)." AND sourcetype = '".$this->db->escape($this->element)."')";
4520 4520
 					$sql .= " OR";
4521
-					$sql .= " (fk_target = " . ((int) $this->id) . " AND targettype = '" . $this->db->escape($this->element) . "')";
4521
+					$sql .= " (fk_target = ".((int) $this->id)." AND targettype = '".$this->db->escape($this->element)."')";
4522 4522
 				}
4523 4523
 			}
4524 4524
 
4525
-			dol_syslog(get_class($this) . "::deleteObjectLinked", LOG_DEBUG);
4525
+			dol_syslog(get_class($this)."::deleteObjectLinked", LOG_DEBUG);
4526 4526
 			if (!$this->db->query($sql)) {
4527 4527
 				$this->error = $this->db->lasterror();
4528 4528
 				$this->errors[] = $this->error;
@@ -4687,14 +4687,14 @@  discard block
 block discarded – undo
4687 4687
 			$sql .= ", date_validation = '".$this->db->idate(dol_now())."'";
4688 4688
 		}
4689 4689
 		$sql .= " WHERE rowid = ".((int) $elementId);
4690
-		$sql .= " AND ".$fieldstatus." <> ".((int) $status);	// We avoid update if status already correct
4690
+		$sql .= " AND ".$fieldstatus." <> ".((int) $status); // We avoid update if status already correct
4691 4691
 
4692 4692
 		dol_syslog(get_class($this)."::setStatut", LOG_DEBUG);
4693 4693
 		$resql = $this->db->query($sql);
4694 4694
 		if ($resql) {
4695 4695
 			$error = 0;
4696 4696
 
4697
-			$nb_rows_affected = $this->db->affected_rows($resql);	// should be 1 or 0 if status was already correct
4697
+			$nb_rows_affected = $this->db->affected_rows($resql); // should be 1 or 0 if status was already correct
4698 4698
 
4699 4699
 			if ($nb_rows_affected > 0) {
4700 4700
 				if (empty($trigkey)) {
@@ -4741,7 +4741,7 @@  discard block
 block discarded – undo
4741 4741
 					if ($fieldstatus == 'tosell') {
4742 4742
 						$this->status = $status;
4743 4743
 					} elseif ($fieldstatus == 'tobuy') {
4744
-						$this->status_buy = $status;	// @phpstan-ignore-line
4744
+						$this->status_buy = $status; // @phpstan-ignore-line
4745 4745
 					} else {
4746 4746
 						$this->status = $status;
4747 4747
 					}
@@ -4849,7 +4849,7 @@  discard block
 block discarded – undo
4849 4849
 			return -1;
4850 4850
 		}
4851 4851
 
4852
-		$arraytoscan = $this->childtables;		// array('tablename'=>array('fk_element'=>'parentfield'), ...) or array('tablename'=>array('parent'=>table_parent, 'parentkey'=>'nameoffieldforparentfkkey'), ...)
4852
+		$arraytoscan = $this->childtables; // array('tablename'=>array('fk_element'=>'parentfield'), ...) or array('tablename'=>array('parent'=>table_parent, 'parentkey'=>'nameoffieldforparentfkkey'), ...)
4853 4853
 		// For backward compatibility, we check if array is old format array('tablename1', 'tablename2', ...)
4854 4854
 		$tmparray = array_keys($this->childtables);
4855 4855
 		if (is_numeric($tmparray[0])) {
@@ -5927,7 +5927,7 @@  discard block
 block discarded – undo
5927 5927
 			$setsharekey = false;
5928 5928
 			if ($this->element == 'propal' || $this->element == 'proposal') {
5929 5929
 				if (getDolGlobalInt("PROPOSAL_ALLOW_ONLINESIGN")) {
5930
-					$setsharekey = true;	// feature to make online signature is not set or set to on (default)
5930
+					$setsharekey = true; // feature to make online signature is not set or set to on (default)
5931 5931
 				}
5932 5932
 				if (getDolGlobalInt("PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD")) {
5933 5933
 					$setsharekey = true;
@@ -5987,7 +5987,7 @@  discard block
 block discarded – undo
5987 5987
 				$ecmfile->gen_or_uploaded = 'generated';
5988 5988
 				$ecmfile->description = ''; // indexed content
5989 5989
 				$ecmfile->keywords = ''; // keyword content
5990
-				$ecmfile->src_object_type = $this->table_element;	// $this->table_name is 'myobject' or 'mymodule_myobject'.
5990
+				$ecmfile->src_object_type = $this->table_element; // $this->table_name is 'myobject' or 'mymodule_myobject'.
5991 5991
 				$ecmfile->src_object_id   = $this->id;
5992 5992
 
5993 5993
 				$result = $ecmfile->create($user);
@@ -6039,7 +6039,7 @@  discard block
 block discarded – undo
6039 6039
 			$maxwidthmini = $tmparraysize['maxwidthmini'];
6040 6040
 			$maxheightmini = $tmparraysize['maxheightmini'];
6041 6041
 			//$quality = $tmparraysize['quality'];
6042
-			$quality = 50;	// For thumbs, we force quality to 50
6042
+			$quality = 50; // For thumbs, we force quality to 50
6043 6043
 
6044 6044
 			// Create small thumbs for company (Ratio is near 16/9)
6045 6045
 			// Used on logon for example
@@ -6139,8 +6139,8 @@  discard block
 block discarded – undo
6139 6139
 		// phpcs:enable
6140 6140
 		global $langs, $conf;
6141 6141
 
6142
-		if (!empty(self::TRIGGER_PREFIX) && strpos($triggerName, self::TRIGGER_PREFIX . '_') !== 0) {
6143
-			dol_print_error(null, 'The trigger "' . $triggerName . '" does not start with "' . self::TRIGGER_PREFIX . '_" as required.');
6142
+		if (!empty(self::TRIGGER_PREFIX) && strpos($triggerName, self::TRIGGER_PREFIX.'_') !== 0) {
6143
+			dol_print_error(null, 'The trigger "'.$triggerName.'" does not start with "'.self::TRIGGER_PREFIX.'_" as required.');
6144 6144
 			exit;
6145 6145
 		}
6146 6146
 		if (!is_object($langs)) {	// If lang was not defined, we set it. It is required by run_triggers().
@@ -6332,7 +6332,7 @@  discard block
 block discarded – undo
6332 6332
 		$savDisableCompute = $conf->disable_compute;
6333 6333
 		$conf->disable_compute = 1;
6334 6334
 
6335
-		$ret = $this->fetch($id);	/* @phpstan-ignore-line */
6335
+		$ret = $this->fetch($id); /* @phpstan-ignore-line */
6336 6336
 
6337 6337
 		$conf->disable_compute = $savDisableCompute;
6338 6338
 
@@ -6394,7 +6394,7 @@  discard block
 block discarded – undo
6394 6394
 		if (is_array($optionsArray) && count($optionsArray) > 0) {
6395 6395
 			$sql = "SELECT rowid";
6396 6396
 			foreach ($optionsArray as $name => $label) {
6397
-				if (empty($extrafields->attributes[$this->table_element]['type'][$name]) || (!in_array($extrafields->attributes[$this->table_element]['type'][$name], ['separate', 'point', 'multipts', 'linestrg','polygon']))) {
6397
+				if (empty($extrafields->attributes[$this->table_element]['type'][$name]) || (!in_array($extrafields->attributes[$this->table_element]['type'][$name], ['separate', 'point', 'multipts', 'linestrg', 'polygon']))) {
6398 6398
 					$sql .= ", ".$name;
6399 6399
 				}
6400 6400
 				// use geo sql fonction to read as text
@@ -6447,7 +6447,7 @@  discard block
 block discarded – undo
6447 6447
 					 **/
6448 6448
 					if (is_array($extrafields->attributes[$this->table_element]['label'])) {
6449 6449
 						foreach ($extrafields->attributes[$this->table_element]['label'] as $key => $val) {
6450
-							$this->array_options['options_' . $key] = null;
6450
+							$this->array_options['options_'.$key] = null;
6451 6451
 						}
6452 6452
 					}
6453 6453
 				}
@@ -6459,9 +6459,9 @@  discard block
 block discarded – undo
6459 6459
 						if (!empty($extrafields->attributes[$this->table_element]) && !empty($extrafields->attributes[$this->table_element]['computed'][$key])) {
6460 6460
 							//var_dump($conf->disable_compute);
6461 6461
 							if (empty($conf->disable_compute)) {
6462
-								global $objectoffield;        // We set a global variable to $objectoffield so
6463
-								$objectoffield = $this;        // we can use it inside computed formula
6464
-								$this->array_options['options_' . $key] = dol_eval($extrafields->attributes[$this->table_element]['computed'][$key], 1, 0, '2');
6462
+								global $objectoffield; // We set a global variable to $objectoffield so
6463
+								$objectoffield = $this; // we can use it inside computed formula
6464
+								$this->array_options['options_'.$key] = dol_eval($extrafields->attributes[$this->table_element]['computed'][$key], 1, 0, '2');
6465 6465
 							}
6466 6466
 						}
6467 6467
 					}
@@ -6642,7 +6642,7 @@  discard block
 block discarded – undo
6642 6642
 										// If old value encrypted in database is same than submitted new value, it means we don't change it, so we don't update.
6643 6643
 										if ($algo == 'dolcrypt') {	// dolibarr reversible encryption
6644 6644
 											if (!preg_match('/^dolcrypt:/', $this->array_options[$key])) {
6645
-												$new_array_options[$key] = dolEncrypt($this->array_options[$key]);	// warning, must be called when on the master
6645
+												$new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master
6646 6646
 											} else {
6647 6647
 												$new_array_options[$key] = $this->array_options[$key]; // Value is kept
6648 6648
 											}
@@ -6653,7 +6653,7 @@  discard block
 block discarded – undo
6653 6653
 										// If value has changed
6654 6654
 										if ($algo == 'dolcrypt') {	// dolibarr reversible encryption
6655 6655
 											if (!preg_match('/^dolcrypt:/', $this->array_options[$key])) {
6656
-												$new_array_options[$key] = dolEncrypt($this->array_options[$key]);	// warning, must be called when on the master
6656
+												$new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master
6657 6657
 											} else {
6658 6658
 												$new_array_options[$key] = $this->array_options[$key]; // Value is kept
6659 6659
 											}
@@ -6665,7 +6665,7 @@  discard block
 block discarded – undo
6665 6665
 									//var_dump('jjj'.$algo.' '.$this->oldcopy->array_options[$key].' -> '.$this->array_options[$key]);
6666 6666
 									// If this->oldcopy is not defined, we can't know if we change attribute or not, so we must keep value
6667 6667
 									if ($algo == 'dolcrypt' && !preg_match('/^dolcrypt:/', $this->array_options[$key])) {	// dolibarr reversible encryption
6668
-										$new_array_options[$key] = dolEncrypt($this->array_options[$key]);	// warning, must be called when on the master
6668
+										$new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master
6669 6669
 									} else {
6670 6670
 										$new_array_options[$key] = $this->array_options[$key]; // Value is kept
6671 6671
 									}
@@ -7090,7 +7090,7 @@  discard block
 block discarded – undo
7090 7090
 								if (isset($this->oldcopy->array_options["options_".$key]) && $this->array_options["options_".$key] == $this->oldcopy->array_options["options_".$key]) {	// If old value encrypted in database is same than submitted new value, it means we don't change it, so we don't update.
7091 7091
 									if ($algo == 'dolcrypt') {	// dolibarr reversible encryption
7092 7092
 										if (!preg_match('/^dolcrypt:/', $this->array_options["options_".$key])) {
7093
-											$new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]);	// warning, must be called when on the master
7093
+											$new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]); // warning, must be called when on the master
7094 7094
 										} else {
7095 7095
 											$new_array_options["options_".$key] = $this->array_options["options_".$key]; // Value is kept
7096 7096
 										}
@@ -7110,7 +7110,7 @@  discard block
 block discarded – undo
7110 7110
 								}
7111 7111
 							} else {
7112 7112
 								if ($algo == 'dolcrypt' && !preg_match('/^dolcrypt:/', $this->array_options["options_".$key])) {	// dolibarr reversible encryption
7113
-									$new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]);	// warning, must be called when on the master
7113
+									$new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]); // warning, must be called when on the master
7114 7114
 								} else {
7115 7115
 									$new_array_options["options_".$key] = $this->array_options["options_".$key]; // Value is kept
7116 7116
 								}
@@ -7651,7 +7651,7 @@  discard block
 block discarded – undo
7651 7651
 				// 7 : sort field
7652 7652
 
7653 7653
 				// If there is filter
7654
-				if (! empty($InfoFieldList[4])) {
7654
+				if (!empty($InfoFieldList[4])) {
7655 7655
 					$pos = 0;
7656 7656
 					$parenthesisopen = 0;
7657 7657
 					while (substr($InfoFieldList[4], $pos, 1) !== '' && ($parenthesisopen || $pos == 0 || substr($InfoFieldList[4], $pos, 1) != ':')) {
@@ -7715,8 +7715,8 @@  discard block
 block discarded – undo
7715 7715
 					}
7716 7716
 
7717 7717
 					$sqlwhere = '';
7718
-					$sql = "SELECT " . $keyList;
7719
-					$sql .= " FROM " . $this->db->prefix() . $InfoFieldList[0];
7718
+					$sql = "SELECT ".$keyList;
7719
+					$sql .= " FROM ".$this->db->prefix().$InfoFieldList[0];
7720 7720
 
7721 7721
 					if (!empty($InfoFieldList[4])) {
7722 7722
 						// can use SELECT request
@@ -7734,11 +7734,11 @@  discard block
 block discarded – undo
7734 7734
 						// We have to join on extrafield table
7735 7735
 						$errstr = '';
7736 7736
 						if (strpos($InfoFieldList[4], 'extra') !== false) {
7737
-							$sql .= " as main, " . $this->db->sanitize($this->db->prefix() . $InfoFieldList[0]) . "_extrafields as extra";
7738
-							$sqlwhere .= " WHERE extra.fk_object = main." . $this->db->sanitize($InfoFieldList[2]);
7739
-							$sqlwhere .= " AND " . forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1);
7737
+							$sql .= " as main, ".$this->db->sanitize($this->db->prefix().$InfoFieldList[0])."_extrafields as extra";
7738
+							$sqlwhere .= " WHERE extra.fk_object = main.".$this->db->sanitize($InfoFieldList[2]);
7739
+							$sqlwhere .= " AND ".forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1);
7740 7740
 						} else {
7741
-							$sqlwhere .= " WHERE " . forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1);
7741
+							$sqlwhere .= " WHERE ".forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1);
7742 7742
 						}
7743 7743
 					} else {
7744 7744
 						$sqlwhere .= ' WHERE 1=1';
@@ -7759,7 +7759,7 @@  discard block
 block discarded – undo
7759 7759
 
7760 7760
 					// Some tables may have field, some other not. For the moment we disable it.
7761 7761
 					if (in_array($InfoFieldList[0], array('tablewithentity'))) {
7762
-						$sqlwhere .= " AND entity = " . ((int) $conf->entity);
7762
+						$sqlwhere .= " AND entity = ".((int) $conf->entity);
7763 7763
 					}
7764 7764
 					$sql .= $sqlwhere;
7765 7765
 					//print $sql;
@@ -7771,7 +7771,7 @@  discard block
 block discarded – undo
7771 7771
 						$sql .= " ORDER BY ".$this->db->sanitize(implode(', ', $fields_label));
7772 7772
 					}
7773 7773
 
7774
-					dol_syslog(get_class($this) . '::showInputField type=sellist', LOG_DEBUG);
7774
+					dol_syslog(get_class($this).'::showInputField type=sellist', LOG_DEBUG);
7775 7775
 					$resql = $this->db->query($sql);
7776 7776
 					if ($resql) {
7777 7777
 						$out .= '<option value="0">&nbsp;</option>';
@@ -7787,7 +7787,7 @@  discard block
 block discarded – undo
7787 7787
 							if (count($fields_label) > 1) {
7788 7788
 								$notrans = true;
7789 7789
 								foreach ($fields_label as $field_toshow) {
7790
-									$labeltoshow .= $obj->$field_toshow . ' ';
7790
+									$labeltoshow .= $obj->$field_toshow.' ';
7791 7791
 								}
7792 7792
 							} else {
7793 7793
 								$labeltoshow = $obj->{$InfoFieldList[1]};
@@ -7798,12 +7798,12 @@  discard block
 block discarded – undo
7798 7798
 								foreach ($fields_label as $field_toshow) {
7799 7799
 									$translabel = $langs->trans($obj->$field_toshow);
7800 7800
 									if ($translabel != $obj->$field_toshow) {
7801
-										$labeltoshow = dol_trunc($translabel) . ' ';
7801
+										$labeltoshow = dol_trunc($translabel).' ';
7802 7802
 									} else {
7803
-										$labeltoshow = dol_trunc($obj->$field_toshow) . ' ';
7803
+										$labeltoshow = dol_trunc($obj->$field_toshow).' ';
7804 7804
 									}
7805 7805
 								}
7806
-								$out .= '<option value="' . $obj->rowid . '" selected>' . $labeltoshow . '</option>';
7806
+								$out .= '<option value="'.$obj->rowid.'" selected>'.$labeltoshow.'</option>';
7807 7807
 							} else {
7808 7808
 								if (!$notrans) {
7809 7809
 									$translabel = $langs->trans($obj->{$InfoFieldList[1]});
@@ -7817,34 +7817,34 @@  discard block
 block discarded – undo
7817 7817
 									$labeltoshow = '(not defined)';
7818 7818
 								}
7819 7819
 								if ($value == $obj->rowid) {
7820
-									$out .= '<option value="' . $obj->rowid . '" selected>' . $labeltoshow . '</option>';
7820
+									$out .= '<option value="'.$obj->rowid.'" selected>'.$labeltoshow.'</option>';
7821 7821
 								}
7822 7822
 
7823 7823
 								if (!empty($InfoFieldList[3]) && $parentField) {
7824
-									$parent = $parentName . ':' . $obj->{$parentField};
7824
+									$parent = $parentName.':'.$obj->{$parentField};
7825 7825
 									$isDependList = 1;
7826 7826
 								}
7827 7827
 
7828
-								$out .= '<option value="' . $obj->rowid . '"';
7828
+								$out .= '<option value="'.$obj->rowid.'"';
7829 7829
 								$out .= ($value == $obj->rowid ? ' selected' : '');
7830
-								$out .= (!empty($parent) ? ' parent="' . $parent . '"' : '');
7831
-								$out .= '>' . $labeltoshow . '</option>';
7830
+								$out .= (!empty($parent) ? ' parent="'.$parent.'"' : '');
7831
+								$out .= '>'.$labeltoshow.'</option>';
7832 7832
 							}
7833 7833
 
7834 7834
 							$i++;
7835 7835
 						}
7836 7836
 						$this->db->free($resql);
7837 7837
 					} else {
7838
-						print 'Error in request ' . $sql . ' ' . $this->db->lasterror() . '. Check setup of extra parameters.<br>';
7838
+						print 'Error in request '.$sql.' '.$this->db->lasterror().'. Check setup of extra parameters.<br>';
7839 7839
 					}
7840 7840
 				} else {
7841 7841
 					require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
7842 7842
 					$data = $form->select_all_categories(Categorie::$MAP_ID_TO_CODE[$InfoFieldList[5]], '', 'parent', 64, $InfoFieldList[6], 1, 1);
7843 7843
 					$out .= '<option value="0">&nbsp;</option>';
7844 7844
 					foreach ($data as $data_key => $data_value) {
7845
-						$out .= '<option value="' . $data_key . '"';
7845
+						$out .= '<option value="'.$data_key.'"';
7846 7846
 						$out .= ($value == $data_key ? ' selected' : '');
7847
-						$out .= '>' . $data_value . '</option>';
7847
+						$out .= '>'.$data_value.'</option>';
7848 7848
 					}
7849 7849
 				}
7850 7850
 			}
@@ -7884,7 +7884,7 @@  discard block
 block discarded – undo
7884 7884
 				// 7 : sort field
7885 7885
 
7886 7886
 				// If there is a filter
7887
-				if (! empty($InfoFieldList[4])) {
7887
+				if (!empty($InfoFieldList[4])) {
7888 7888
 					$pos = 0;
7889 7889
 					$parenthesisopen = 0;
7890 7890
 					while (substr($InfoFieldList[4], $pos, 1) !== '' && ($parenthesisopen || $pos == 0 || substr($InfoFieldList[4], $pos, 1) != ':')) {
@@ -7950,8 +7950,8 @@  discard block
 block discarded – undo
7950 7950
 					}
7951 7951
 
7952 7952
 					$sqlwhere = '';
7953
-					$sql = "SELECT " . $keyList;
7954
-					$sql .= ' FROM ' . $this->db->prefix() . $InfoFieldList[0];
7953
+					$sql = "SELECT ".$keyList;
7954
+					$sql .= ' FROM '.$this->db->prefix().$InfoFieldList[0];
7955 7955
 
7956 7956
 					if (!empty($InfoFieldList[4])) {
7957 7957
 						// can use SELECT request
@@ -7969,11 +7969,11 @@  discard block
 block discarded – undo
7969 7969
 						// We have to join on extrafield table
7970 7970
 						$errstr = '';
7971 7971
 						if (strpos($InfoFieldList[4], 'extra') !== false) {
7972
-							$sql .= ' as main, ' . $this->db->sanitize($this->db->prefix() . $InfoFieldList[0]) . '_extrafields as extra';
7973
-							$sqlwhere .= " WHERE extra.fk_object = main." . $this->db->sanitize($InfoFieldList[2]);
7974
-							$sqlwhere .= " AND " . $InfoFieldList[4];
7972
+							$sql .= ' as main, '.$this->db->sanitize($this->db->prefix().$InfoFieldList[0]).'_extrafields as extra';
7973
+							$sqlwhere .= " WHERE extra.fk_object = main.".$this->db->sanitize($InfoFieldList[2]);
7974
+							$sqlwhere .= " AND ".$InfoFieldList[4];
7975 7975
 						} else {
7976
-							$sqlwhere .= " WHERE " . $InfoFieldList[4];
7976
+							$sqlwhere .= " WHERE ".$InfoFieldList[4];
7977 7977
 						}
7978 7978
 					} else {
7979 7979
 						$sqlwhere .= ' WHERE 1=1';
@@ -7994,14 +7994,14 @@  discard block
 block discarded – undo
7994 7994
 
7995 7995
 					// Some tables may have field, some other not. For the moment we disable it.
7996 7996
 					if (in_array($InfoFieldList[0], array('tablewithentity'))) {
7997
-						$sqlwhere .= " AND entity = " . ((int) $conf->entity);
7997
+						$sqlwhere .= " AND entity = ".((int) $conf->entity);
7998 7998
 					}
7999 7999
 					// $sql.=preg_replace('/^ AND /','',$sqlwhere);
8000 8000
 					// print $sql;
8001 8001
 
8002 8002
 					$sql .= $sqlwhere;
8003 8003
 
8004
-					dol_syslog(get_class($this) . '::showInputField type=chkbxlst', LOG_DEBUG);
8004
+					dol_syslog(get_class($this).'::showInputField type=chkbxlst', LOG_DEBUG);
8005 8005
 
8006 8006
 					$resql = $this->db->query($sql);
8007 8007
 					if ($resql) {
@@ -8020,7 +8020,7 @@  discard block
 block discarded – undo
8020 8020
 							if (count($fields_label) > 1) {
8021 8021
 								$notrans = true;
8022 8022
 								foreach ($fields_label as $field_toshow) {
8023
-									$labeltoshow .= $obj->$field_toshow . ' ';
8023
+									$labeltoshow .= $obj->$field_toshow.' ';
8024 8024
 								}
8025 8025
 							} else {
8026 8026
 								$labeltoshow = $obj->{$InfoFieldList[1]};
@@ -8031,9 +8031,9 @@  discard block
 block discarded – undo
8031 8031
 								foreach ($fields_label as $field_toshow) {
8032 8032
 									$translabel = $langs->trans($obj->$field_toshow);
8033 8033
 									if ($translabel != $obj->$field_toshow) {
8034
-										$labeltoshow = dol_trunc($translabel, 18) . ' ';
8034
+										$labeltoshow = dol_trunc($translabel, 18).' ';
8035 8035
 									} else {
8036
-										$labeltoshow = dol_trunc($obj->$field_toshow, 18) . ' ';
8036
+										$labeltoshow = dol_trunc($obj->$field_toshow, 18).' ';
8037 8037
 									}
8038 8038
 								}
8039 8039
 
@@ -8056,7 +8056,7 @@  discard block
 block discarded – undo
8056 8056
 								}
8057 8057
 
8058 8058
 								if (!empty($InfoFieldList[3]) && $parentField) {
8059
-									$parent = $parentName . ':' . $obj->{$parentField};
8059
+									$parent = $parentName.':'.$obj->{$parentField};
8060 8060
 									$isDependList = 1;
8061 8061
 								}
8062 8062
 
@@ -8067,14 +8067,14 @@  discard block
 block discarded – undo
8067 8067
 						}
8068 8068
 						$this->db->free($resql);
8069 8069
 
8070
-						$out = $form->multiselectarray($keyprefix . $key . $keysuffix, $data, $value_arr, 0, 0, $morecss, 0, '100%');
8070
+						$out = $form->multiselectarray($keyprefix.$key.$keysuffix, $data, $value_arr, 0, 0, $morecss, 0, '100%');
8071 8071
 					} else {
8072
-						print 'Error in request ' . $sql . ' ' . $this->db->lasterror() . '. Check setup of extra parameters.<br>';
8072
+						print 'Error in request '.$sql.' '.$this->db->lasterror().'. Check setup of extra parameters.<br>';
8073 8073
 					}
8074 8074
 				} else {
8075 8075
 					require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
8076 8076
 					$data = $form->select_all_categories(Categorie::$MAP_ID_TO_CODE[$InfoFieldList[5]], '', 'parent', 64, $InfoFieldList[6], 1, 1);
8077
-					$out = $form->multiselectarray($keyprefix . $key . $keysuffix, $data, $value_arr, 0, 0, $morecss, 0, '100%');
8077
+					$out = $form->multiselectarray($keyprefix.$key.$keysuffix, $data, $value_arr, 0, 0, $morecss, 0, '100%');
8078 8078
 				}
8079 8079
 			}
8080 8080
 		} elseif ($type == 'link') {
@@ -8305,7 +8305,7 @@  discard block
 block discarded – undo
8305 8305
 			$value = $this->getLibStatut(3);
8306 8306
 		} elseif ($type == 'date') {
8307 8307
 			if (!empty($value)) {
8308
-				$value = dol_print_date($value, 'day');	// We suppose dates without time are always gmt (storage of course + output)
8308
+				$value = dol_print_date($value, 'day'); // We suppose dates without time are always gmt (storage of course + output)
8309 8309
 			} else {
8310 8310
 				$value = '';
8311 8311
 			}
@@ -8350,7 +8350,7 @@  discard block
 block discarded – undo
8350 8350
 			$value = isset($param['options'][(string) $value]) ? $param['options'][(string) $value] : '';
8351 8351
 			if (strpos($value, "|") !== false) {
8352 8352
 				$value = $langs->trans(explode('|', $value)[0]);
8353
-			} elseif (! is_numeric($value)) {
8353
+			} elseif (!is_numeric($value)) {
8354 8354
 				$value = $langs->trans($value);
8355 8355
 			}
8356 8356
 		} elseif ($type == 'sellist') {
@@ -8412,9 +8412,9 @@  discard block
 block discarded – undo
8412 8412
 									$translabel = $langs->trans($obj->$field_toshow);
8413 8413
 								}
8414 8414
 								if ($translabel != $field_toshow) {
8415
-									$value .= dol_trunc($translabel, 18) . ' ';
8415
+									$value .= dol_trunc($translabel, 18).' ';
8416 8416
 								} else {
8417
-									$value .= $obj->$field_toshow . ' ';
8417
+									$value .= $obj->$field_toshow.' ';
8418 8418
 								}
8419 8419
 							}
8420 8420
 						} else {
@@ -8430,7 +8430,7 @@  discard block
 block discarded – undo
8430 8430
 						}
8431 8431
 					}
8432 8432
 				} else {
8433
-					require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
8433
+					require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
8434 8434
 
8435 8435
 					$toprint = array();
8436 8436
 					$obj = $this->db->fetch_object($resql);
@@ -8438,7 +8438,7 @@  discard block
 block discarded – undo
8438 8438
 					$c->fetch($obj->rowid);
8439 8439
 					$ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text
8440 8440
 					foreach ($ways as $way) {
8441
-						$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #aaa"') . '>' . img_object('', 'category') . ' ' . $way . '</li>';
8441
+						$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #aaa"').'>'.img_object('', 'category').' '.$way.'</li>';
8442 8442
 					}
8443 8443
 					$value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
8444 8444
 				}
@@ -8454,11 +8454,11 @@  discard block
 block discarded – undo
8454 8454
 				$toprint = array();
8455 8455
 				foreach ($value_arr as $keyval => $valueval) {
8456 8456
 					if (!empty($valueval)) {
8457
-						$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . $param['options'][$valueval] . '</li>';
8457
+						$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$param['options'][$valueval].'</li>';
8458 8458
 					}
8459 8459
 				}
8460 8460
 				if (!empty($toprint)) {
8461
-					$value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>';
8461
+					$value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
8462 8462
 				}
8463 8463
 			}
8464 8464
 		} elseif ($type == 'chkbxlst') {
@@ -8513,9 +8513,9 @@  discard block
 block discarded – undo
8513 8513
 										$translabel = $langs->trans($obj->$field_toshow);
8514 8514
 									}
8515 8515
 									if ($translabel != $field_toshow) {
8516
-										$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . dol_trunc($translabel, 18) . '</li>';
8516
+										$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.dol_trunc($translabel, 18).'</li>';
8517 8517
 									} else {
8518
-										$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . $obj->$field_toshow . '</li>';
8518
+										$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$obj->$field_toshow.'</li>';
8519 8519
 									}
8520 8520
 								}
8521 8521
 							} else {
@@ -8524,15 +8524,15 @@  discard block
 block discarded – undo
8524 8524
 									$translabel = $langs->trans($obj->{$InfoFieldList[1]});
8525 8525
 								}
8526 8526
 								if ($translabel != $obj->{$InfoFieldList[1]}) {
8527
-									$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . dol_trunc($translabel, 18) . '</li>';
8527
+									$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.dol_trunc($translabel, 18).'</li>';
8528 8528
 								} else {
8529
-									$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . $obj->{$InfoFieldList[1]} . '</li>';
8529
+									$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$obj->{$InfoFieldList[1]}.'</li>';
8530 8530
 								}
8531 8531
 							}
8532 8532
 						}
8533 8533
 					}
8534 8534
 				} else {
8535
-					require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
8535
+					require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
8536 8536
 
8537 8537
 					$toprint = array();
8538 8538
 					while ($obj = $this->db->fetch_object($resql)) {
@@ -8541,7 +8541,7 @@  discard block
 block discarded – undo
8541 8541
 							$c->fetch($obj->rowid);
8542 8542
 							$ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text
8543 8543
 							foreach ($ways as $way) {
8544
-								$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #aaa"') . '>' . img_object('', 'category') . ' ' . $way . '</li>';
8544
+								$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #aaa"').'>'.img_object('', 'category').' '.$way.'</li>';
8545 8545
 							}
8546 8546
 						}
8547 8547
 					}
@@ -8708,7 +8708,7 @@  discard block
 block discarded – undo
8708 8708
 		global $langs;
8709 8709
 
8710 8710
 		if (!class_exists('Validate')) {
8711
-			require_once DOL_DOCUMENT_ROOT . '/core/class/validate.class.php';
8711
+			require_once DOL_DOCUMENT_ROOT.'/core/class/validate.class.php';
8712 8712
 		}
8713 8713
 
8714 8714
 		$this->clearFieldError($fieldKey);
@@ -8947,7 +8947,7 @@  discard block
 block discarded – undo
8947 8947
 				$out .= "\n";
8948 8948
 
8949 8949
 				$nbofextrafieldsshown = 0;
8950
-				$e = 0;	// var to manage the modulo (odd/even)
8950
+				$e = 0; // var to manage the modulo (odd/even)
8951 8951
 
8952 8952
 				$lastseparatorkeyfound = '';
8953 8953
 				$extrafields_collapse_num = '';
@@ -10039,7 +10039,7 @@  discard block
 block discarded – undo
10039 10039
 						continue;
10040 10040
 					}
10041 10041
 				}
10042
-				$keys_with_alias[] = $alias . '.' . $fieldname;
10042
+				$keys_with_alias[] = $alias.'.'.$fieldname;
10043 10043
 			}
10044 10044
 			return implode(',', $keys_with_alias);
10045 10045
 		} else {
@@ -10174,7 +10174,7 @@  discard block
 block discarded – undo
10174 10174
 		if (!$error) {
10175 10175
 			$sql = "INSERT INTO ".$this->db->prefix().$this->table_element;
10176 10176
 			$sql .= " (".implode(", ", $keys).')';
10177
-			$sql .= " VALUES (".implode(", ", $values).")";		// $values can contains 'abc' or 123
10177
+			$sql .= " VALUES (".implode(", ", $values).")"; // $values can contains 'abc' or 123
10178 10178
 
10179 10179
 			$res = $this->db->query($sql);
10180 10180
 			if (!$res) {
@@ -10476,7 +10476,7 @@  discard block
 block discarded – undo
10476 10476
 
10477 10477
 		// Update extrafield
10478 10478
 		if (!$error) {
10479
-			$result = $this->insertExtraFields();	// This delete and reinsert extrafields
10479
+			$result = $this->insertExtraFields(); // This delete and reinsert extrafields
10480 10480
 			if ($result < 0) {
10481 10481
 				$error++;
10482 10482
 			}
@@ -10678,12 +10678,12 @@  discard block
 block discarded – undo
10678 10678
 				$error++;
10679 10679
 			} else {
10680 10680
 				while ($obj = $this->db->fetch_object($resql)) {
10681
-					$result = $this->fetch($obj->rowid);	// @phpstan-ignore-line
10681
+					$result = $this->fetch($obj->rowid); // @phpstan-ignore-line
10682 10682
 					if ($result < 0) {
10683 10683
 						$error++;
10684 10684
 						$this->errors[] = $this->error;
10685 10685
 					} else {
10686
-						$result = $this->delete($user);	// @phpstan-ignore-line
10686
+						$result = $this->delete($user); // @phpstan-ignore-line
10687 10687
 						if ($result < 0) {
10688 10688
 							$error++;
10689 10689
 							$this->errors[] = $this->error;
@@ -10849,7 +10849,7 @@  discard block
 block discarded – undo
10849 10849
 		);
10850 10850
 		foreach ($fields as $key => $value) {
10851 10851
 			if (array_key_exists($key, $this->fields)) {
10852
-				$this->{$key} = $value;		// @phpstan-ignore-line
10852
+				$this->{$key} = $value; // @phpstan-ignore-line
10853 10853
 			}
10854 10854
 		}
10855 10855
 
Please login to merge, or discard this patch.
htdocs/core/class/html.formsms.class.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -257,10 +257,10 @@  discard block
 block discarded – undo
257 257
 				$resultsender = array();
258 258
 				$sms = null;
259 259
 				if (getDolGlobalString('MAIN_SMS_SENDMODE')) {
260
-					$sendmode = getDolGlobalString('MAIN_SMS_SENDMODE');	// $conf->global->MAIN_SMS_SENDMODE looks like a value 'module'
261
-					$classmoduleofsender = getDolGlobalString('MAIN_MODULE_'.strtoupper($sendmode).'_SMS', $sendmode);	// $conf->global->MAIN_MODULE_XXX_SMS looks like a value 'class@module'
260
+					$sendmode = getDolGlobalString('MAIN_SMS_SENDMODE'); // $conf->global->MAIN_SMS_SENDMODE looks like a value 'module'
261
+					$classmoduleofsender = getDolGlobalString('MAIN_MODULE_'.strtoupper($sendmode).'_SMS', $sendmode); // $conf->global->MAIN_MODULE_XXX_SMS looks like a value 'class@module'
262 262
 					if ($classmoduleofsender == 'ovh') {
263
-						$classmoduleofsender = 'ovhsms@ovh';	// For backward compatibility
263
+						$classmoduleofsender = 'ovhsms@ovh'; // For backward compatibility
264 264
 					}
265 265
 
266 266
 					$tmp = explode('@', $classmoduleofsender);
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
 						if (class_exists($classname)) {
273 273
 							$sms = new $classname($this->db);
274 274
 							'@phan-var-force CommonObject $sms';
275
-							$resultsender = $sms->SmsSenderList();  // @phan-suppress-current-line PhanUndeclaredMethod
275
+							$resultsender = $sms->SmsSenderList(); // @phan-suppress-current-line PhanUndeclaredMethod
276 276
 						} else {
277 277
 							$sms = new stdClass();
278 278
 							$sms->error = 'The SMS manager "'.$classfile.'" defined into SMS setup MAIN_MODULE_'.strtoupper($sendmode).'_SMS is not found';
Please login to merge, or discard this patch.
htdocs/expensereport/class/expensereportline.class.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2767,7 +2767,7 @@
 block discarded – undo
2767 2767
 		} elseif ($mode == 'mon' || $mode == 'EX_MON') {
2768 2768
 			$sql .= " AND DATE_FORMAT(d.date, '%Y-%m') = '".dol_print_date($this->date, '%Y-%m')."'"; // @todo DATE_FORMAT is forbidden
2769 2769
 		} elseif ($mode == 'year' || $mode == 'EX_YEA') {
2770
-			$sql .= " AND DATE_FORMAT(d.date, '%Y') = '".dol_print_date($this->date, '%Y')."'"; 	// @todo DATE_FORMAT is forbidden
2770
+			$sql .= " AND DATE_FORMAT(d.date, '%Y') = '".dol_print_date($this->date, '%Y')."'"; // @todo DATE_FORMAT is forbidden
2771 2771
 		}
2772 2772
 
2773 2773
 		dol_syslog('ExpenseReportLine::getExpAmount');
Please login to merge, or discard this patch.
htdocs/expensereport/class/expensereport.class.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -244,8 +244,8 @@  discard block
 block discarded – undo
244 244
 	 */
245 245
 	public $fk_user_approve;
246 246
 
247
-	public $localtax1;	// for backward compatibility (real field should be total_localtax1 defined into CommonObject)
248
-	public $localtax2;	// for backward compatibility (real field should be total_localtax2 defined into CommonObject)
247
+	public $localtax1; // for backward compatibility (real field should be total_localtax1 defined into CommonObject)
248
+	public $localtax2; // for backward compatibility (real field should be total_localtax2 defined into CommonObject)
249 249
 
250 250
 	/**
251 251
 	 * Draft status
@@ -336,8 +336,8 @@  discard block
 block discarded – undo
336 336
 		$this->total_tva = 0;
337 337
 		$this->total_localtax1 = 0;
338 338
 		$this->total_localtax2 = 0;
339
-		$this->localtax1 = 0;	// For backward compatibility
340
-		$this->localtax2 = 0;	// For backward compatibility
339
+		$this->localtax1 = 0; // For backward compatibility
340
+		$this->localtax2 = 0; // For backward compatibility
341 341
 		$this->modepaymentid = 0;
342 342
 
343 343
 		// List of language codes for status
@@ -694,8 +694,8 @@  discard block
 block discarded – undo
694 694
 				$this->total_ht     = $obj->total_ht;
695 695
 				$this->total_tva    = $obj->total_tva;
696 696
 				$this->total_ttc    = $obj->total_ttc;
697
-				$this->localtax1    = $obj->total_localtax1;		// For backward compatibility
698
-				$this->localtax2    = $obj->total_localtax2;		// For backward compatibility
697
+				$this->localtax1    = $obj->total_localtax1; // For backward compatibility
698
+				$this->localtax2    = $obj->total_localtax2; // For backward compatibility
699 699
 				$this->total_localtax1 = $obj->total_localtax1;
700 700
 				$this->total_localtax2 = $obj->total_localtax2;
701 701
 
@@ -1162,7 +1162,7 @@  discard block
 block discarded – undo
1162 1162
 
1163 1163
 				$deplig->rule_warning_message = $objp->rule_warning_message;
1164 1164
 
1165
-				$deplig->rang               = $objp->rang;
1165
+				$deplig->rang = $objp->rang;
1166 1166
 
1167 1167
 				$this->lines[$i] = $deplig;
1168 1168
 
@@ -1710,7 +1710,7 @@  discard block
 block discarded – undo
1710 1710
 		if (getDolGlobalString('EXPENSEREPORT_ADDON')) {
1711 1711
 			$mybool = false;
1712 1712
 
1713
-			$file = getDolGlobalString('EXPENSEREPORT_ADDON') . ".php";
1713
+			$file = getDolGlobalString('EXPENSEREPORT_ADDON').".php";
1714 1714
 			$classname = getDolGlobalString('EXPENSEREPORT_ADDON');
1715 1715
 
1716 1716
 			// Include file with class
@@ -1865,7 +1865,7 @@  discard block
 block discarded – undo
1865 1865
 		$result .= $linkend;
1866 1866
 
1867 1867
 		global $action;
1868
-		$hookmanager->initHooks(array($this->element . 'dao'));
1868
+		$hookmanager->initHooks(array($this->element.'dao'));
1869 1869
 		$parameters = array('id' => $this->id, 'getnomurl' => &$result);
1870 1870
 		$reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
1871 1871
 		if ($reshook > 0) {
@@ -1958,8 +1958,8 @@  discard block
 block discarded – undo
1958 1958
 			$this->line = new ExpenseReportLine($this->db);
1959 1959
 
1960 1960
 			// We don't know seller and buyer for expense reports
1961
-			$seller = $mysoc;			// We use same than current company (expense report are often done in same country)
1962
-			$seller->tva_assuj = 1;		// Most seller uses vat
1961
+			$seller = $mysoc; // We use same than current company (expense report are often done in same country)
1962
+			$seller->tva_assuj = 1; // Most seller uses vat
1963 1963
 			$buyer = new Societe($this->db);
1964 1964
 
1965 1965
 			$localtaxes_type = getLocalTaxesFromRate($vatrate, 0, $buyer, $seller);
@@ -2041,8 +2041,8 @@  discard block
 block discarded – undo
2041 2041
 
2042 2042
 		// We don't know seller and buyer for expense reports
2043 2043
 		if (!is_object($seller)) {
2044
-			$seller = $mysoc;			// We use same than current company (expense report are often done in same country)
2045
-			$seller->tva_assuj = 1;		// Most seller uses vat
2044
+			$seller = $mysoc; // We use same than current company (expense report are often done in same country)
2045
+			$seller->tva_assuj = 1; // Most seller uses vat
2046 2046
 		}
2047 2047
 
2048 2048
 		$expensereportrule = new ExpenseReportRule($db);
@@ -2126,8 +2126,8 @@  discard block
 block discarded – undo
2126 2126
 
2127 2127
 		// We don't know seller and buyer for expense reports
2128 2128
 		if (!is_object($seller)) {
2129
-			$seller = $mysoc;			// We use same than current company (expense report are often done in same country)
2130
-			$seller->tva_assuj = 1;		// Most seller uses vat
2129
+			$seller = $mysoc; // We use same than current company (expense report are often done in same country)
2130
+			$seller->tva_assuj = 1; // Most seller uses vat
2131 2131
 		}
2132 2132
 
2133 2133
 		$expenseik = new ExpenseReportIk($this->db);
@@ -2221,10 +2221,10 @@  discard block
 block discarded – undo
2221 2221
 			$type = 0; // TODO What if type is service ?
2222 2222
 
2223 2223
 			// We don't know seller and buyer for expense reports
2224
-			$seller = $mysoc;			// We use same than current company (expense report are often done in same country)
2225
-			$seller->tva_assuj = 1;		// Most seller uses vat
2226
-			$seller->localtax1_assuj = $mysoc->localtax1_assuj;		// We don't know, we reuse the state of company
2227
-			$seller->localtax2_assuj = $mysoc->localtax1_assuj;		// We don't know, we reuse the state of company
2224
+			$seller = $mysoc; // We use same than current company (expense report are often done in same country)
2225
+			$seller->tva_assuj = 1; // Most seller uses vat
2226
+			$seller->localtax1_assuj = $mysoc->localtax1_assuj; // We don't know, we reuse the state of company
2227
+			$seller->localtax2_assuj = $mysoc->localtax1_assuj; // We don't know, we reuse the state of company
2228 2228
 			$buyer = new Societe($this->db);
2229 2229
 
2230 2230
 			$localtaxes_type = getLocalTaxesFromRate($vatrate, 0, $buyer, $seller);
Please login to merge, or discard this patch.
htdocs/fourn/card.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 require '../main.inc.php';
35 35
 require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php';
36 36
 require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
37
-require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.facture-rec.class.php';
37
+require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture-rec.class.php';
38 38
 require_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php';
39 39
 require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
40 40
 require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 	require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
47 47
 }
48 48
 if (!empty($conf->accounting->enabled)) {
49
-	require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
49
+	require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
50 50
 }
51 51
 
52 52
 // Load translation files required by page
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
 		print '<td class="titlefield">';
286 286
 		print $form->textwithpicto($langs->trans('VATReverseChargeByDefault'), $langs->trans('VATReverseChargeByDefaultDesc'));
287 287
 		print '</td><td>';
288
-		print '<input type="checkbox" name="vat_reverse_charge" ' . ($object->vat_reverse_charge == '1' ? ' checked' : '') . ' disabled>';
288
+		print '<input type="checkbox" name="vat_reverse_charge" '.($object->vat_reverse_charge == '1' ? ' checked' : '').' disabled>';
289 289
 		print '</td>';
290 290
 		print '</tr>';
291 291
 	}
Please login to merge, or discard this patch.