Completed
Branch develop (fbba2b)
by
unknown
23:35
created
htdocs/categories/viewcat.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1126,7 +1126,7 @@
 block discarded – undo
1126 1126
 			if ($showclassifyform) {
1127 1127
 				print '<table class="noborder centpercent">';
1128 1128
 				print '<tr class="liste_titre"><td>';
1129
-				$force_entity = getEntity($object->element);	// So we will get same filter than the getObjectsInCateg()
1129
+				$force_entity = getEntity($object->element); // So we will get same filter than the getObjectsInCateg()
1130 1130
 				print img_picto('', $type, 'class="pictofixedwidth"');
1131 1131
 				print $form->select_dolusers('', 'elemid', 1, null, 0, '', '', $force_entity);
1132 1132
 				print '<input type="submit" class="button buttongen" name="addintocategory" value="'.$langs->trans("ClassifyInCategory").'"></td>';
Please login to merge, or discard this patch.
htdocs/categories/index.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -221,12 +221,12 @@
 block discarded – undo
221 221
 	$entry .= '</td>';
222 222
 	$entry .= '<td class="right" width="30px;">';
223 223
 	if ($user->hasRight('categorie', 'creer')) {
224
-		$entry .= '<a class="editfielda" href="' . DOL_URL_ROOT . '/categories/edit.php?id=' . $val['id'] . '&type=' . urlencode($type) . $moreparam . '&backtopage=' . urlencode($_SERVER["PHP_SELF"] . '?type=' . urlencode($type)) . '">' . img_edit() . '</a>';
224
+		$entry .= '<a class="editfielda" href="'.DOL_URL_ROOT.'/categories/edit.php?id='.$val['id'].'&type='.urlencode($type).$moreparam.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?type='.urlencode($type)).'">'.img_edit().'</a>';
225 225
 	}
226 226
 	$entry .= '</td>';
227 227
 	$entry .= '<td class="right" width="30px;">';
228 228
 	if ($user->hasRight('categorie', 'supprimer')) {
229
-		$entry .= '<a class="deletefilelink" href="' . DOL_URL_ROOT . '/categories/viewcat.php?action=delete&token=' . newToken() . '&id=' . $val['id'] . '&type=' . urlencode($type) . $moreparam . '&backtopage=' . urlencode($_SERVER["PHP_SELF"] . '?type=' . urlencode($type) . $moreparam) . '&backtolist=' . urlencode($_SERVER["PHP_SELF"] . '?type=' . urlencode($type) . $moreparam) . '">' . img_delete() . '</a>';
229
+		$entry .= '<a class="deletefilelink" href="'.DOL_URL_ROOT.'/categories/viewcat.php?action=delete&token='.newToken().'&id='.$val['id'].'&type='.urlencode($type).$moreparam.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?type='.urlencode($type).$moreparam).'&backtolist='.urlencode($_SERVER["PHP_SELF"].'?type='.urlencode($type).$moreparam).'">'.img_delete().'</a>';
230 230
 	}
231 231
 	$entry .= '</td>';
232 232
 
Please login to merge, or discard this patch.
htdocs/website/class/website.class.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1163,8 +1163,8 @@  discard block
 block discarded – undo
1163 1163
 			$stringtoexport = str_replace('file=js/'.$website->ref.'/', "file=js/__WEBSITE_KEY__/", $stringtoexport);
1164 1164
 			$stringtoexport = str_replace('medias/image/'.$website->ref.'/', "medias/image/__WEBSITE_KEY__/", $stringtoexport);
1165 1165
 			$stringtoexport = str_replace('medias/js/'.$website->ref.'/', "medias/js/__WEBSITE_KEY__/", $stringtoexport);
1166
-			$stringtoexport = str_replace('"image/'.$website->ref.'/', '"image/__WEBSITE_KEY__/', $stringtoexport);	// When we have a link src="image/websiteref/file.png" into html content
1167
-			$stringtoexport = str_replace('"/image/'.$website->ref.'/', '"/image/__WEBSITE_KEY__/', $stringtoexport);	// When we have a link src="/image/websiteref/file.png" into html content
1166
+			$stringtoexport = str_replace('"image/'.$website->ref.'/', '"image/__WEBSITE_KEY__/', $stringtoexport); // When we have a link src="image/websiteref/file.png" into html content
1167
+			$stringtoexport = str_replace('"/image/'.$website->ref.'/', '"/image/__WEBSITE_KEY__/', $stringtoexport); // When we have a link src="/image/websiteref/file.png" into html content
1168 1168
 			$stringtoexport = str_replace('"js/'.$website->ref.'/', '"js/__WEBSITE_KEY__/', $stringtoexport);
1169 1169
 			$stringtoexport = str_replace('"/js/'.$website->ref.'/', '"/js/__WEBSITE_KEY__/', $stringtoexport);
1170 1170
 
@@ -1472,7 +1472,7 @@  discard block
 block discarded – undo
1472 1472
 				foreach ($aliasesarray as $aliasshortcuttocreate) {
1473 1473
 					if (trim($aliasshortcuttocreate)) {
1474 1474
 						$filealias = $conf->website->dir_output.'/'.$object->ref.'/'.trim($aliasshortcuttocreate).'.php';
1475
-						$result = dolSavePageAlias($filealias, $object, $objectpagestatic);	// This includes also a copy into sublanguage directories.
1475
+						$result = dolSavePageAlias($filealias, $object, $objectpagestatic); // This includes also a copy into sublanguage directories.
1476 1476
 						if (!$result) {
1477 1477
 							$this->errors[] = 'Failed to write file '.basename($filealias);
1478 1478
 							$error++;
@@ -1493,7 +1493,7 @@  discard block
 block discarded – undo
1493 1493
 				$filetpl = $pathofwebsite.'/page'.$object->fk_default_home.'.tpl.php';
1494 1494
 			}
1495 1495
 			$filewrapper = $pathofwebsite.'/wrapper.php';
1496
-			dolSaveIndexPage($pathofwebsite, $fileindex, $filetpl, $filewrapper, $object);	// This includes also a version of index.php into sublanguage directories
1496
+			dolSaveIndexPage($pathofwebsite, $fileindex, $filetpl, $filewrapper, $object); // This includes also a version of index.php into sublanguage directories
1497 1497
 		}
1498 1498
 
1499 1499
 		if ($error) {
@@ -1940,7 +1940,7 @@  discard block
 block discarded – undo
1940 1940
 				$destContent = file_get_contents($fileNeeded['fullname']);
1941 1941
 
1942 1942
 				$numOfPageDest = $this->extractNumberFromFilename($fileNeeded['name']);
1943
-				$differences = $this->showDifferences($destContent, $sourceContent, array($numOfPageDest,$numOfPageSource));
1943
+				$differences = $this->showDifferences($destContent, $sourceContent, array($numOfPageDest, $numOfPageSource));
1944 1944
 				$differences['file_destination'] = $fileNeeded;
1945 1945
 			} else {
1946 1946
 				$differences = array();
@@ -1983,10 +1983,10 @@  discard block
 block discarded – undo
1983 1983
 		$linefound = array();
1984 1984
 		$countNumPage = count($exceptNumPge);
1985 1985
 
1986
-		for ($i = 0;$i < $countNumPage; $i++) {
1986
+		for ($i = 0; $i < $countNumPage; $i++) {
1987 1987
 			$linefound[$i] = array();
1988
-			$linefound[$i]['meta'] = '/content="' . preg_quote((string) $exceptNumPge[$i], '/') . '" \/>/';
1989
-			$linefound[$i]['output'] = '/dolWebsiteOutput\(\$tmp, "html", ' . preg_quote((string) $exceptNumPge[$i], '/') . '\);/';
1988
+			$linefound[$i]['meta'] = '/content="'.preg_quote((string) $exceptNumPge[$i], '/').'" \/>/';
1989
+			$linefound[$i]['output'] = '/dolWebsiteOutput\(\$tmp, "html", '.preg_quote((string) $exceptNumPge[$i], '/').'\);/';
1990 1990
 		}
1991 1991
 
1992 1992
 		if (isset($linefound[1])) {
@@ -2009,13 +2009,13 @@  discard block
 block discarded – undo
2009 2009
 				if ($lineContent1 !== $lineContent2) {
2010 2010
 					if (isset($lines1[$lineNum]) && !isset($lines2[$lineNum])) {
2011 2011
 						// Ligne deleted de la source
2012
-						$diff["Supprimée à la ligne " . ($lineNum + 1)] = $lineContent1;
2012
+						$diff["Supprimée à la ligne ".($lineNum + 1)] = $lineContent1;
2013 2013
 					} elseif (!isset($lines1[$lineNum]) && isset($lines2[$lineNum])) {
2014 2014
 						// Nouvelle ligne added dans la destination
2015
-						$diff["Ajoutée à la ligne " . ($lineNum + 1)] = $lineContent2;
2015
+						$diff["Ajoutée à la ligne ".($lineNum + 1)] = $lineContent2;
2016 2016
 					} else {
2017 2017
 						// Différence found it
2018
-						$diff["Modifiée à la ligne " . ($lineNum + 1)] = $lineContent2;
2018
+						$diff["Modifiée à la ligne ".($lineNum + 1)] = $lineContent2;
2019 2019
 					}
2020 2020
 				}
2021 2021
 			}
Please login to merge, or discard this patch.
htdocs/admin/remotestore/class/dolistore.class.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
 			} elseif ($trace[0]['args'][0] == 401) {
141 141
 				die('Bad auth key');
142 142
 			} else {
143
-				print 'Can not access to ' . getDolGlobalString('MAIN_MODULE_DOLISTORE_API_SRV').'<br>';
143
+				print 'Can not access to '.getDolGlobalString('MAIN_MODULE_DOLISTORE_API_SRV').'<br>';
144 144
 				print $e->getMessage();
145 145
 			}
146 146
 		}
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
 
180 180
 			// make a search to limit the id returned.
181 181
 			if ($this->search != '') {
182
-				$opt2['url'] = getDolGlobalString('MAIN_MODULE_DOLISTORE_API_SRV') . '/api/search?query='.$this->search.'&language='.$this->lang; // It seems for search, key start with
182
+				$opt2['url'] = getDolGlobalString('MAIN_MODULE_DOLISTORE_API_SRV').'/api/search?query='.$this->search.'&language='.$this->lang; // It seems for search, key start with
183 183
 
184 184
 				// Call
185 185
 				dol_syslog("Call API with opt2 = ".var_export($opt2, true));
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
 			} elseif ($trace[0]['args'][0] == 401) {
227 227
 				die('Bad auth key');
228 228
 			} else {
229
-				print 'Can not access to ' . getDolGlobalString('MAIN_MODULE_DOLISTORE_API_SRV').'<br>';
229
+				print 'Can not access to '.getDolGlobalString('MAIN_MODULE_DOLISTORE_API_SRV').'<br>';
230 230
 				print $e->getMessage();
231 231
 			}
232 232
 		}
@@ -378,16 +378,16 @@  discard block
 block discarded – undo
378 378
 			//output template
379 379
 			$html .= '<tr class="app oddeven '.dol_escape_htmltag($compatible).'">';
380 380
 			$html .= '<td class="center" width="160"><div class="newAppParent">';
381
-			$html .= $newapp.$images;	// No dol_escape_htmltag, it is already escape html
381
+			$html .= $newapp.$images; // No dol_escape_htmltag, it is already escape html
382 382
 			$html .= '</div></td>';
383 383
 			$html .= '<td class="margeCote"><h2 class="appTitle">';
384 384
 			$html .= dol_escape_htmltag(dol_string_nohtmltag($product->name->language[$this->lang - 1]));
385 385
 			$html .= '<br><small>';
386
-			$html .= $version;			// No dol_escape_htmltag, it is already escape html
386
+			$html .= $version; // No dol_escape_htmltag, it is already escape html
387 387
 			$html .= '</small></h2>';
388 388
 			$html .= '<small> '.dol_print_date(dol_stringtotime($product->date_upd), 'dayhour').' - '.$langs->trans('Ref').': '.dol_escape_htmltag($product->reference).' - '.dol_escape_htmltag($langs->trans('Id')).': '.((int) $product->id).'</small><br>';
389 389
 			$html .= '<br>'.dol_escape_htmltag(dol_string_nohtmltag($product->description_short->language[$this->lang - 1]));
390
-			$html.= '</td>';
390
+			$html .= '</td>';
391 391
 			// do not load if display none
392 392
 			$html .= '<td class="margeCote center amount">';
393 393
 			$html .= $price;
Please login to merge, or discard this patch.
htdocs/admin/modules.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 $options['end']       = ((int) (GETPOSTINT('end') ? GETPOSTINT('end') : 0));
88 88
 $options['search']    = GETPOST('search_keyword', 'alpha');
89 89
 
90
-$remotestore            = new Dolistore(false);
90
+$remotestore = new Dolistore(false);
91 91
 
92 92
 
93 93
 if (!$user->admin) {
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
 				//var_dump($modulenamearrays);exit;
314 314
 
315 315
 				// Lop on each packages (can have several if package is a metapackage)
316
-				if (! $error) {
316
+				if (!$error) {
317 317
 					foreach ($modulenamearrays as $modulenameval) {
318 318
 						if (strpos($modulenameval, '#') === 0) {
319 319
 							continue; // Discard comments
@@ -382,7 +382,7 @@  discard block
 block discarded – undo
382 382
 			'search_version' => '-1'
383 383
 		);
384 384
 		$queryString = http_build_query($searchParams);
385
-		$redirectUrl = DOL_URL_ROOT . '/admin/modules.php?' . $queryString;
385
+		$redirectUrl = DOL_URL_ROOT.'/admin/modules.php?'.$queryString;
386 386
 
387 387
 		$message = $langs->trans("SetupIsReadyForUse", $redirectUrl, $langs->transnoentitiesnoconv("Home").' - '.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("Modules"));
388 388
 
@@ -584,7 +584,7 @@  discard block
 block discarded – undo
584 584
 								} else {
585 585
 									$familykey = $objMod->family;
586 586
 								}
587
-								'@phan-var-force string $familykey';  // if not, phan considers $familykey may be null
587
+								'@phan-var-force string $familykey'; // if not, phan considers $familykey may be null
588 588
 
589 589
 								$moduleposition = ($objMod->module_position ? $objMod->module_position : '50');
590 590
 								if ($objMod->isCoreOrExternalModule() == 'external' && $moduleposition < 100000) {
@@ -690,7 +690,7 @@  discard block
 block discarded – undo
690 690
 print load_fiche_titre($langs->trans("ModulesSetup"), '', 'title_setup');
691 691
 
692 692
 // Start to show page
693
-$deschelp  = '';
693
+$deschelp = '';
694 694
 if ($mode == 'common' || $mode == 'commonkanban') {
695 695
 	$desc = $langs->trans("ModulesDesc", '{picto}');
696 696
 	$desc .= ' '.$langs->trans("ModulesDesc2", '{picto2}');
@@ -977,7 +977,7 @@  discard block
 block discarded – undo
977 977
 		}
978 978
 
979 979
 		if ($objMod->isCoreOrExternalModule() == 'external' && $action == 'checklastversion' && !getDolGlobalString('DISABLE_CHECK_ON_MALWARE_MODULES')) {
980
-			$checkRes = $objMod->checkForCompliance();	// Check if module is reported as non compliant with Dolibarr rules and law
980
+			$checkRes = $objMod->checkForCompliance(); // Check if module is reported as non compliant with Dolibarr rules and law
981 981
 			if (!is_numeric($checkRes) && $checkRes != '') {
982 982
 				$langs->load("errors");
983 983
 				setEventMessages($objMod->getName().' : '.$langs->trans($checkRes), null, 'errors');
@@ -1309,7 +1309,7 @@  discard block
 block discarded – undo
1309 1309
 			<div id="category-tree-left">
1310 1310
 				<ul class="tree">
1311 1311
 					<?php
1312
-					echo $remotestore->get_categories();	// Do not use dol_escape_htmltag here, it is already a structured content?>
1312
+					echo $remotestore->get_categories(); // Do not use dol_escape_htmltag here, it is already a structured content?>
1313 1313
 				</ul>
1314 1314
 			</div>
1315 1315
 
Please login to merge, or discard this patch.
htdocs/user/class/user.class.php 1 patch
Spacing   +45 added lines, -45 removed lines patch added patch discarded remove patch
@@ -688,11 +688,11 @@  discard block
 block discarded – undo
688 688
 
689 689
 				$this->job = $obj->job;
690 690
 				$this->signature = $obj->signature;
691
-				$this->admin		= $obj->admin;
691
+				$this->admin = $obj->admin;
692 692
 				$this->note_public = $obj->note_public;
693 693
 				$this->note_private = $obj->note_private;
694 694
 
695
-				$this->statut		= $obj->status;			// deprecated
695
+				$this->statut		= $obj->status; // deprecated
696 696
 				$this->status		= $obj->status;
697 697
 
698 698
 				$this->photo		= $obj->photo;
@@ -824,7 +824,7 @@  discard block
 block discarded – undo
824 824
 			require_once DOL_DOCUMENT_ROOT.'/core/class/defaultvalues.class.php';
825 825
 
826 826
 			$defaultValues = new DefaultValues($this->db);
827
-			$result = $defaultValues->fetchAll('', '', 0, 0, '(t.user_id:in:0,'.$this->id.') AND (entity:in:'.(isset($this->entity) ? $this->entity : $conf->entity).','.$conf->entity.')');	// User 0 (all) + me (if defined)
827
+			$result = $defaultValues->fetchAll('', '', 0, 0, '(t.user_id:in:0,'.$this->id.') AND (entity:in:'.(isset($this->entity) ? $this->entity : $conf->entity).','.$conf->entity.')'); // User 0 (all) + me (if defined)
828 828
 			//$result = $defaultValues->fetchAll('', '', 0, 0, array('t.user_id'=>array(0, $this->id), 'entity'=>array((isset($this->entity) ? $this->entity : $conf->entity), $conf->entity)));	// User 0 (all) + me (if defined)
829 829
 
830 830
 			if (!is_array($result) && $result < 0) {
@@ -939,16 +939,16 @@  discard block
 block discarded – undo
939 939
 		// Special case for external user
940 940
 		if (!empty($this->socid)) {
941 941
 			if ($module == 'societe' && ($permlevel1 == 'creer' || $permlevel1 == 'write')) {
942
-				return 0;	// An external user never has the permission ->societe->write to see all thirdparties (always restricted to himself)
942
+				return 0; // An external user never has the permission ->societe->write to see all thirdparties (always restricted to himself)
943 943
 			}
944 944
 			if ($module == 'societe' && $permlevel1 == 'client' && $permlevel2 == 'voir') {
945
-				return 0;	// An external user never has the permission ->societe->client->voir to see all thirdparties (always restricted to himself)
945
+				return 0; // An external user never has the permission ->societe->client->voir to see all thirdparties (always restricted to himself)
946 946
 			}
947 947
 			if ($module == 'societe' && $permlevel1 == 'export') {
948
-				return 0;	// An external user never has the permission ->societe->export to see all thirdparties (always restricted to himself)
948
+				return 0; // An external user never has the permission ->societe->export to see all thirdparties (always restricted to himself)
949 949
 			}
950 950
 			if ($module == 'societe' && ($permlevel1 == 'supprimer' || $permlevel1 == 'delete')) {
951
-				return 0;	// An external user never has the permission ->societe->delete to see all thirdparties (always restricted to himself)
951
+				return 0; // An external user never has the permission ->societe->delete to see all thirdparties (always restricted to himself)
952 952
 			}
953 953
 		}
954 954
 
@@ -1096,7 +1096,7 @@  discard block
 block discarded – undo
1096 1096
 			$sql .= " FROM ".$this->db->prefix()."rights_def";
1097 1097
 			$sql .= " WHERE entity = ".((int) $entity);
1098 1098
 			if (!empty($whereforadd) && $whereforadd != 'allmodules') {
1099
-				$sql .= " AND (".$whereforadd.")";	// Note: parenthesis are important because whereforadd can contains OR. Also note that $whereforadd is already sanitized
1099
+				$sql .= " AND (".$whereforadd.")"; // Note: parenthesis are important because whereforadd can contains OR. Also note that $whereforadd is already sanitized
1100 1100
 			}
1101 1101
 
1102 1102
 			$sqldelete = "DELETE FROM ".$this->db->prefix()."user_rights";
@@ -1232,7 +1232,7 @@  discard block
 block discarded – undo
1232 1232
 			$sql .= " FROM ".$this->db->prefix()."rights_def";
1233 1233
 			$sql .= " WHERE entity IN (".$this->db->sanitize($entity, 0, 0, 0, 0).")";
1234 1234
 			if (!empty($wherefordel) && $wherefordel != 'allmodules') {
1235
-				$sql .= " AND (".$wherefordel.")";	// Note: parenthesis are important because wherefordel can contains OR. Also note that $wherefordel is already sanitized
1235
+				$sql .= " AND (".$wherefordel.")"; // Note: parenthesis are important because wherefordel can contains OR. Also note that $wherefordel is already sanitized
1236 1236
 			}
1237 1237
 
1238 1238
 			// avoid admin to remove his own important rights
@@ -1411,12 +1411,12 @@  discard block
 block discarded – undo
1411 1411
 					$sql .= " AND r.entity = ".((int) $conf->entity);
1412 1412
 				}
1413 1413
 			} else {
1414
-				$sql .= " AND gr.entity = ".((int) $conf->entity);	// Only groups created in current entity
1414
+				$sql .= " AND gr.entity = ".((int) $conf->entity); // Only groups created in current entity
1415 1415
 				// The entity on the table gu=usergroup_user should be useless and should never be used because it is already into gr and r.
1416 1416
 				// but when using MULTICOMPANY_TRANSVERSE_MODE, we may have inserted record that make rubbish result here due to the duplicate record of
1417 1417
 				// other entities, so we are forced to add a filter on gu here
1418 1418
 				$sql .= " AND gu.entity IN (0,".$conf->entity.")";
1419
-				$sql .= " AND r.entity = ".((int) $conf->entity);	// Only permission of modules enabled in current entity
1419
+				$sql .= " AND r.entity = ".((int) $conf->entity); // Only permission of modules enabled in current entity
1420 1420
 			}
1421 1421
 			// End of strange business rule
1422 1422
 			$sql .= " AND gr.fk_usergroup = gu.fk_usergroup";
@@ -1970,7 +1970,7 @@  discard block
 block discarded – undo
1970 1970
 		$this->civility_code = $member->civility_code;
1971 1971
 		$this->lastname     = $member->lastname;
1972 1972
 		$this->firstname    = $member->firstname;
1973
-		$this->gender		= $member->gender;
1973
+		$this->gender = $member->gender;
1974 1974
 		$this->email        = $member->email;
1975 1975
 		$this->fk_member    = $member->id;
1976 1976
 		$this->address      = $member->address;
@@ -2108,45 +2108,45 @@  discard block
 block discarded – undo
2108 2108
 		$this->lastname						= trim((string) $this->lastname);
2109 2109
 		$this->firstname					= trim((string) $this->firstname);
2110 2110
 		$this->ref_employee					= trim((string) $this->ref_employee);
2111
-		$this->national_registration_number	= trim((string) $this->national_registration_number);
2111
+		$this->national_registration_number = trim((string) $this->national_registration_number);
2112 2112
 		$this->employee						= ($this->employee > 0 ? $this->employee : 0);
2113 2113
 		$this->login						= trim((string) $this->login);
2114
-		$this->gender						= trim((string) $this->gender);
2114
+		$this->gender = trim((string) $this->gender);
2115 2115
 
2116 2116
 		$this->pass							= trim((string) $this->pass);
2117
-		$this->api_key						= trim((string) $this->api_key);
2118
-		$this->datestartvalidity			= empty($this->datestartvalidity) ? '' : $this->datestartvalidity;
2119
-		$this->dateendvalidity				= empty($this->dateendvalidity) ? '' : $this->dateendvalidity;
2117
+		$this->api_key = trim((string) $this->api_key);
2118
+		$this->datestartvalidity = empty($this->datestartvalidity) ? '' : $this->datestartvalidity;
2119
+		$this->dateendvalidity = empty($this->dateendvalidity) ? '' : $this->dateendvalidity;
2120 2120
 
2121
-		$this->address						= trim((string) $this->address);
2122
-		$this->zip							= trim((string) $this->zip);
2123
-		$this->town							= trim((string) $this->town);
2121
+		$this->address = trim((string) $this->address);
2122
+		$this->zip = trim((string) $this->zip);
2123
+		$this->town = trim((string) $this->town);
2124 2124
 
2125
-		$this->state_id						= ($this->state_id > 0 ? $this->state_id : 0);
2125
+		$this->state_id = ($this->state_id > 0 ? $this->state_id : 0);
2126 2126
 		$this->country_id					= ($this->country_id > 0 ? $this->country_id : 0);
2127
-		$this->office_phone					= trim((string) $this->office_phone);
2127
+		$this->office_phone = trim((string) $this->office_phone);
2128 2128
 		$this->office_fax					= trim((string) $this->office_fax);
2129
-		$this->user_mobile					= trim((string) $this->user_mobile);
2130
-		$this->personal_mobile				= trim((string) $this->personal_mobile);
2131
-		$this->email						= trim((string) $this->email);
2132
-		$this->personal_email				= trim((string) $this->personal_email);
2133
-
2134
-		$this->job							= trim((string) $this->job);
2135
-		$this->signature					= trim((string) $this->signature);
2136
-		$this->note_public					= trim((string) $this->note_public);
2137
-		$this->note_private					= trim((string) $this->note_private);
2138
-		$this->openid						= trim((string) $this->openid);
2139
-		$this->admin						= ($this->admin > 0 ? $this->admin : 0);
2140
-
2141
-		$this->accountancy_code_user_general	= trim((string) $this->accountancy_code_user_general);
2129
+		$this->user_mobile = trim((string) $this->user_mobile);
2130
+		$this->personal_mobile = trim((string) $this->personal_mobile);
2131
+		$this->email = trim((string) $this->email);
2132
+		$this->personal_email = trim((string) $this->personal_email);
2133
+
2134
+		$this->job = trim((string) $this->job);
2135
+		$this->signature = trim((string) $this->signature);
2136
+		$this->note_public = trim((string) $this->note_public);
2137
+		$this->note_private = trim((string) $this->note_private);
2138
+		$this->openid = trim((string) $this->openid);
2139
+		$this->admin = ($this->admin > 0 ? $this->admin : 0);
2140
+
2141
+		$this->accountancy_code_user_general = trim((string) $this->accountancy_code_user_general);
2142 2142
 		$this->accountancy_code				= trim((string) $this->accountancy_code);
2143
-		$this->color						= trim((string) $this->color);
2144
-		$this->dateemployment				= empty($this->dateemployment) ? '' : $this->dateemployment;
2143
+		$this->color = trim((string) $this->color);
2144
+		$this->dateemployment = empty($this->dateemployment) ? '' : $this->dateemployment;
2145 2145
 		$this->dateemploymentend			= empty($this->dateemploymentend) ? '' : $this->dateemploymentend;
2146 2146
 
2147
-		$this->birth						= empty($this->birth) ? '' : $this->birth;
2148
-		$this->fk_warehouse					= (int) $this->fk_warehouse;
2149
-		$this->fk_establishment				= (int) $this->fk_establishment;
2147
+		$this->birth = empty($this->birth) ? '' : $this->birth;
2148
+		$this->fk_warehouse = (int) $this->fk_warehouse;
2149
+		$this->fk_establishment = (int) $this->fk_establishment;
2150 2150
 
2151 2151
 		$this->setUpperOrLowerCase();
2152 2152
 
@@ -2914,7 +2914,7 @@  discard block
 block discarded – undo
2914 2914
 		$sql .= " WHERE fk_user  = ".((int) $this->id);
2915 2915
 		$sql .= " AND fk_usergroup = ".((int) $group);
2916 2916
 		if (empty($entity)) {
2917
-			$sql .= " AND entity IN (0, 1)";	// group may be in entity 0 (so $entity=0) and link with user into entity 1.
2917
+			$sql .= " AND entity IN (0, 1)"; // group may be in entity 0 (so $entity=0) and link with user into entity 1.
2918 2918
 		} else {
2919 2919
 			$sql .= " AND entity = ".((int) $entity);
2920 2920
 		}
@@ -3175,7 +3175,7 @@  discard block
 block discarded – undo
3175 3175
 				$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
3176 3176
 			}
3177 3177
 			$linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"');
3178
-			$linkclose .= $dataparams . ' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"';
3178
+			$linkclose .= $dataparams.' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"';
3179 3179
 		} else {
3180 3180
 			$linkclose = ($morecss ? ' class="'.$morecss.'"' : '');
3181 3181
 		}
@@ -3414,11 +3414,11 @@  discard block
 block discarded – undo
3414 3414
 		global $conf;
3415 3415
 		$dn = '';
3416 3416
 		if ($mode == 0) {
3417
-			$dn = getDolGlobalString('LDAP_KEY_USERS') . "=".$info[getDolGlobalString('LDAP_KEY_USERS')]."," . getDolGlobalString('LDAP_USER_DN');
3417
+			$dn = getDolGlobalString('LDAP_KEY_USERS')."=".$info[getDolGlobalString('LDAP_KEY_USERS')].",".getDolGlobalString('LDAP_USER_DN');
3418 3418
 		} elseif ($mode == 1) {
3419 3419
 			$dn = getDolGlobalString('LDAP_USER_DN');
3420 3420
 		} elseif ($mode == 2) {
3421
-			$dn = getDolGlobalString('LDAP_KEY_USERS') . "=".$info[getDolGlobalString('LDAP_KEY_USERS')];
3421
+			$dn = getDolGlobalString('LDAP_KEY_USERS')."=".$info[getDolGlobalString('LDAP_KEY_USERS')];
3422 3422
 		}
3423 3423
 		return $dn;
3424 3424
 	}
@@ -3633,7 +3633,7 @@  discard block
 block discarded – undo
3633 3633
 		$this->iplastlogin = '127.0.0.1';
3634 3634
 		$this->datepreviouslogin = $now;
3635 3635
 		$this->ippreviouslogin = '127.0.0.1';
3636
-		$this->statut = 1;		// deprecated
3636
+		$this->statut = 1; // deprecated
3637 3637
 		$this->status = 1;
3638 3638
 
3639 3639
 		$this->entity = 1;
Please login to merge, or discard this patch.
htdocs/user/bank.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -104,8 +104,8 @@  discard block
 block discarded – undo
104 104
 
105 105
 // Define value to know what current user can do on users
106 106
 $selfpermission = ($user->id == $id && $user->hasRight('user', 'self', 'creer'));
107
-$usercanadd = (!empty($user->admin) || $user->hasRight('user', 'user', 'creer') || $user->hasRight('hrm', 'write_personal_information', 'write') );
108
-$usercanread = (!empty($user->admin) || $user->hasRight('user', 'user', 'lire') || $user->hasRight('hrm', 'read_personal_information', 'read') );
107
+$usercanadd = (!empty($user->admin) || $user->hasRight('user', 'user', 'creer') || $user->hasRight('hrm', 'write_personal_information', 'write'));
108
+$usercanread = (!empty($user->admin) || $user->hasRight('user', 'user', 'lire') || $user->hasRight('hrm', 'read_personal_information', 'read'));
109 109
 $permissiontoaddbankaccount = ($user->hasRight('salaries', 'write') || $user->hasRight('hrm', 'employee', 'write') || $user->hasRight('user', 'user', 'creer') || $selfpermission);
110 110
 $permissiontoreadhr = $user->hasRight('hrm', 'read_personal_information', 'read') || $user->hasRight('hrm', 'write_personal_information', 'write');
111 111
 $permissiontowritehr = $user->hasRight('hrm', 'write_personal_information', 'write');
@@ -630,7 +630,7 @@  discard block
 block discarded – undo
630 630
 			$accountingaccount->fetch(0, $object->accountancy_code_user_general, 1);
631 631
 			print $accountingaccount->getNomUrl(0, 1, 1, '', 1);
632 632
 		}
633
-		$accountingAccountByDefault = " (" . $langs->trans("AccountingAccountByDefaultShort") . ": " . length_accountg(getDolGlobalString('SALARIES_ACCOUNTING_ACCOUNT_PAYMENT')) . ")";
633
+		$accountingAccountByDefault = " (".$langs->trans("AccountingAccountByDefaultShort").": ".length_accountg(getDolGlobalString('SALARIES_ACCOUNTING_ACCOUNT_PAYMENT')).")";
634 634
 		print (getDolGlobalString('SALARIES_ACCOUNTING_ACCOUNT_PAYMENT') ? $accountingAccountByDefault : '');
635 635
 		print '</td>';
636 636
 
Please login to merge, or discard this patch.
htdocs/accountancy/closure/index.php 1 patch
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 			if ($fiscal_period_id == $fiscal_period['id'] || (empty($fiscal_period_id) && $fiscal_period['date_start'] <= $now && $now <= $fiscal_period['date_end'])) {
96 96
 				$current_fiscal_period = $fiscal_period;
97 97
 			} else {
98
-				$last_fiscal_period = $fiscal_period;	// $last_fiscal_period is in fact $previous_fiscal_period
98
+				$last_fiscal_period = $fiscal_period; // $last_fiscal_period is in fact $previous_fiscal_period
99 99
 			}
100 100
 		}
101 101
 	}
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
 			if ($result > 0) {
145 145
 				setEventMessages($langs->trans("AllMovementsWereRecordedAsValidated"), null, 'mesgs');
146 146
 
147
-				header("Location: " . $_SERVER['PHP_SELF'] . (isset($current_fiscal_period) ? '?fiscal_period_id=' . $current_fiscal_period['id'] : ''));
147
+				header("Location: ".$_SERVER['PHP_SELF'].(isset($current_fiscal_period) ? '?fiscal_period_id='.$current_fiscal_period['id'] : ''));
148 148
 				exit;
149 149
 			} else {
150 150
 				setEventMessages($langs->trans("NotAllMovementsCouldBeRecordedAsValidated"), null, 'errors');
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
 				} else {
175 175
 					setEventMessages($langs->trans("AccountancyClosureCloseSuccessfully"), null, 'mesgs');
176 176
 
177
-					header("Location: " . $_SERVER['PHP_SELF'] . (isset($current_fiscal_period) ? '?fiscal_period_id=' . $current_fiscal_period['id'] : ''));
177
+					header("Location: ".$_SERVER['PHP_SELF'].(isset($current_fiscal_period) ? '?fiscal_period_id='.$current_fiscal_period['id'] : ''));
178 178
 					exit;
179 179
 				}
180 180
 			}
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
 			} else {
191 191
 				setEventMessages($langs->trans("AccountancyClosureInsertAccountingReversalSuccessfully"), null, 'mesgs');
192 192
 
193
-				header("Location: " . $_SERVER['PHP_SELF'] . (isset($current_fiscal_period) ? '?fiscal_period_id=' . $current_fiscal_period['id'] : ''));
193
+				header("Location: ".$_SERVER['PHP_SELF'].(isset($current_fiscal_period) ? '?fiscal_period_id='.$current_fiscal_period['id'] : ''));
194 194
 				exit;
195 195
 			}
196 196
 		}
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
 		);
232 232
 
233 233
 		$formconfirm = $form->formconfirm(
234
-			$_SERVER["PHP_SELF"] . '?fiscal_period_id=' . $current_fiscal_period['id'],
234
+			$_SERVER["PHP_SELF"].'?fiscal_period_id='.$current_fiscal_period['id'],
235 235
 			$langs->trans('ValidateMovements'),
236 236
 			$langs->trans('DescValidateMovements', $langs->transnoentitiesnoconv("RegistrationInAccounting")),
237 237
 			'confirm_step_1',
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
 		);
270 270
 
271 271
 		$formconfirm = $form->formconfirm(
272
-			$_SERVER["PHP_SELF"] . '?fiscal_period_id=' . $current_fiscal_period['id'],
272
+			$_SERVER["PHP_SELF"].'?fiscal_period_id='.$current_fiscal_period['id'],
273 273
 			$langs->trans('AccountancyClosureClose'),
274 274
 			$langs->trans('AccountancyClosureConfirmClose'),
275 275
 			'confirm_step_2',
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
 		);
314 314
 
315 315
 		$formconfirm = $form->formconfirm(
316
-			$_SERVER["PHP_SELF"] . '?fiscal_period_id=' . $current_fiscal_period['id'],
316
+			$_SERVER["PHP_SELF"].'?fiscal_period_id='.$current_fiscal_period['id'],
317 317
 			$langs->trans('AccountancyClosureAccountingReversal'),
318 318
 			$langs->trans('AccountancyClosureConfirmAccountingReversal'),
319 319
 			'confirm_step_3',
@@ -340,13 +340,13 @@  discard block
 block discarded – undo
340 340
 
341 341
 $fiscal_period_nav_text = $langs->trans("FiscalPeriod");
342 342
 
343
-$fiscal_period_nav_text .= '&nbsp;<a href="' . (isset($last_fiscal_period) ? $_SERVER["PHP_SELF"] . '?fiscal_period_id=' . $last_fiscal_period['id'] : '#" class="disabled') . '">' . img_previous() . '</a>';
344
-$fiscal_period_nav_text .= '&nbsp;<a href="' . (isset($next_fiscal_period) ? $_SERVER["PHP_SELF"] . '?fiscal_period_id=' . $next_fiscal_period['id'] : '#" class="disabled') . '">' . img_next() . '</a>';
343
+$fiscal_period_nav_text .= '&nbsp;<a href="'.(isset($last_fiscal_period) ? $_SERVER["PHP_SELF"].'?fiscal_period_id='.$last_fiscal_period['id'] : '#" class="disabled').'">'.img_previous().'</a>';
344
+$fiscal_period_nav_text .= '&nbsp;<a href="'.(isset($next_fiscal_period) ? $_SERVER["PHP_SELF"].'?fiscal_period_id='.$next_fiscal_period['id'] : '#" class="disabled').'">'.img_next().'</a>';
345 345
 if (!empty($current_fiscal_period)) {
346
-	$fiscal_period_nav_text .= $current_fiscal_period['label'].' &nbsp;(' . (isset($current_fiscal_period) ? dol_print_date($current_fiscal_period['date_start'], 'day') . '&nbsp;-&nbsp;' . dol_print_date($current_fiscal_period['date_end'], 'day') . ')' : '');
346
+	$fiscal_period_nav_text .= $current_fiscal_period['label'].' &nbsp;('.(isset($current_fiscal_period) ? dol_print_date($current_fiscal_period['date_start'], 'day').'&nbsp;-&nbsp;'.dol_print_date($current_fiscal_period['date_end'], 'day').')' : '');
347 347
 }
348 348
 
349
-print load_fiche_titre($langs->trans("Closure") . " - " . $fiscal_period_nav_text, '', 'title_accountancy');
349
+print load_fiche_titre($langs->trans("Closure")." - ".$fiscal_period_nav_text, '', 'title_accountancy');
350 350
 
351 351
 if (empty($current_fiscal_period)) {
352 352
 	print $langs->trans('ErrorNoFiscalPeriodActiveFound', $langs->transnoentitiesnoconv("Accounting"), $langs->transnoentitiesnoconv("Setup"), $langs->transnoentitiesnoconv("FiscalPeriod"));
@@ -354,12 +354,12 @@  discard block
 block discarded – undo
354 354
 	if (!getDolGlobalString("ACCOUNTANCY_DISABLE_CLOSURE_LINE_BY_LINE")) {
355 355
 		// Step 1
356 356
 		$head = array();
357
-		$head[0][0] = DOL_URL_ROOT . '/accountancy/closure/index.php?fiscal_period_id=' . $current_fiscal_period['id'];
357
+		$head[0][0] = DOL_URL_ROOT.'/accountancy/closure/index.php?fiscal_period_id='.$current_fiscal_period['id'];
358 358
 		$head[0][1] = $langs->trans("Step").' 1 - '.$langs->trans("AccountancyClosureStep1");
359 359
 		$head[0][2] = 'step1';
360 360
 		print dol_get_fiche_head($head, 'step1', '', -1, '');
361 361
 
362
-		print '<span class="opacitymedium">' . $langs->trans("AccountancyClosureStep1Desc") . '</span><br>';
362
+		print '<span class="opacitymedium">'.$langs->trans("AccountancyClosureStep1Desc").'</span><br>';
363 363
 
364 364
 		$count_by_month = $object->getCountByMonthForFiscalPeriod($current_fiscal_period['date_start'], $current_fiscal_period['date_end']);
365 365
 
@@ -368,9 +368,9 @@  discard block
 block discarded – undo
368 368
 		}
369 369
 
370 370
 		if (empty($count_by_month['total'])) {
371
-			$buttonvalidate = '<a class="butActionRefused classfortooltip" href="#">' . $langs->trans("ValidateMovements") . '</a>';
371
+			$buttonvalidate = '<a class="butActionRefused classfortooltip" href="#">'.$langs->trans("ValidateMovements").'</a>';
372 372
 		} else {
373
-			$buttonvalidate = '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?action=step_1&token='.newToken().'&fiscal_period_id=' . $current_fiscal_period['id'] . '">' . $langs->trans("ValidateMovements") . '</a>';
373
+			$buttonvalidate = '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=step_1&token='.newToken().'&fiscal_period_id='.$current_fiscal_period['id'].'">'.$langs->trans("ValidateMovements").'</a>';
374 374
 		}
375 375
 		print_barre_liste($langs->trans("OverviewOfMovementsNotValidated"), 0, '', '', '', '', '', -1, '', '', 0, $buttonvalidate, '', 0, 1, 0);
376 376
 
@@ -380,24 +380,24 @@  discard block
 block discarded – undo
380 380
 		print '<tr class="liste_titre">';
381 381
 		$nb_years = is_array($count_by_month['list']) ? count($count_by_month['list']) : 0;
382 382
 		if ($nb_years > 1) {
383
-			print '<td class="right">' . $langs->trans("Year") . '</td>';
383
+			print '<td class="right">'.$langs->trans("Year").'</td>';
384 384
 		}
385 385
 		for ($i = 1; $i <= 12; $i++) {
386
-			print '<td class="right">' . $langs->trans('MonthShort' . str_pad((string) $i, 2, '0', STR_PAD_LEFT)) . '</td>';
386
+			print '<td class="right">'.$langs->trans('MonthShort'.str_pad((string) $i, 2, '0', STR_PAD_LEFT)).'</td>';
387 387
 		}
388
-		print '<td class="right"><b>' . $langs->trans("Total") . '</b></td>';
388
+		print '<td class="right"><b>'.$langs->trans("Total").'</b></td>';
389 389
 		print '</tr>';
390 390
 
391 391
 		if (is_array($count_by_month['list'])) {
392 392
 			foreach ($count_by_month['list'] as $info) {
393 393
 				print '<tr class="oddeven">';
394 394
 				if ($nb_years > 1) {
395
-					print '<td class="right">' . $info['year'] . '</td>';
395
+					print '<td class="right">'.$info['year'].'</td>';
396 396
 				}
397 397
 				for ($i = 1; $i <= 12; $i++) {
398
-					print '<td class="right">' . ((int) $info['count'][$i]) . '</td>';
398
+					print '<td class="right">'.((int) $info['count'][$i]).'</td>';
399 399
 				}
400
-				print '<td class="right"><b>' . $info['total'] . '</b></td></tr>';
400
+				print '<td class="right"><b>'.$info['total'].'</b></td></tr>';
401 401
 			}
402 402
 		}
403 403
 
@@ -409,7 +409,7 @@  discard block
 block discarded – undo
409 409
 
410 410
 	// Step 2
411 411
 	$head = array();
412
-	$head[0][0] = DOL_URL_ROOT . '/accountancy/closure/index.php?fiscal_period_id=' . $current_fiscal_period['id'];
412
+	$head[0][0] = DOL_URL_ROOT.'/accountancy/closure/index.php?fiscal_period_id='.$current_fiscal_period['id'];
413 413
 	$head[0][1] = $langs->trans("Step").(getDolGlobalString("ACCOUNTANCY_DISABLE_CLOSURE_LINE_BY_LINE") ? '1' : '2').' - '.$langs->trans("AccountancyClosureStep2");
414 414
 	$head[0][2] = 'step2';
415 415
 	print dol_get_fiche_head($head, 'step2', '', -1, '');
@@ -418,12 +418,12 @@  discard block
 block discarded – undo
418 418
 	// print '<span class="opacitymedium">' . $langs->trans("AccountancyClosureStep2Desc") . '</span><br>';
419 419
 	if ((empty($count_by_month['total']) || getDolGlobalString("ACCOUNTANCY_DISABLE_CLOSURE_LINE_BY_LINE")) && empty($current_fiscal_period['status'])) {
420 420
 		// If no unlocked record and period still open
421
-		$button = '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?action=step_2&token='.newToken().'&fiscal_period_id=' . $current_fiscal_period['id'] . '">' . $langs->trans("AccountancyClosureClose") . '</a>';
421
+		$button = '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=step_2&token='.newToken().'&fiscal_period_id='.$current_fiscal_period['id'].'">'.$langs->trans("AccountancyClosureClose").'</a>';
422 422
 	} else {
423 423
 		if (!empty($current_fiscal_period['status'])) {
424
-			$button = '<a class="butActionRefused classfortooltip" href="#" title="The period is already closed. Feature disabled.">' . $langs->trans("AccountancyClosureClose") . '</a>';
424
+			$button = '<a class="butActionRefused classfortooltip" href="#" title="The period is already closed. Feature disabled.">'.$langs->trans("AccountancyClosureClose").'</a>';
425 425
 		} elseif (!empty($count_by_month['total'])) {
426
-			$button = '<a class="butActionRefused classfortooltip" href="#" title="There is some lines not yet locked. Feature disabled.">' . $langs->trans("AccountancyClosureClose") . '</a>';
426
+			$button = '<a class="butActionRefused classfortooltip" href="#" title="There is some lines not yet locked. Feature disabled.">'.$langs->trans("AccountancyClosureClose").'</a>';
427 427
 		}
428 428
 	}
429 429
 	print_barre_liste('', 0, '', '', '', '', '', -1, '', '', 0, $button, '', 0, 1, 0);
@@ -432,7 +432,7 @@  discard block
 block discarded – undo
432 432
 
433 433
 	// Step 3
434 434
 	$head = array();
435
-	$head[0][0] = DOL_URL_ROOT . '/accountancy/closure/index.php?fiscal_period_id=' . $current_fiscal_period['id'];
435
+	$head[0][0] = DOL_URL_ROOT.'/accountancy/closure/index.php?fiscal_period_id='.$current_fiscal_period['id'];
436 436
 	$head[0][1] = $langs->trans("Step").(getDolGlobalString("ACCOUNTANCY_DISABLE_CLOSURE_LINE_BY_LINE") ? '2' : '3').' - '.$langs->trans("AccountancyClosureStep3");
437 437
 	$head[0][2] = 'step3';
438 438
 	print dol_get_fiche_head($head, 'step3', '', -1, '');
@@ -440,9 +440,9 @@  discard block
 block discarded – undo
440 440
 	// print '<span class="opacitymedium">' . $langs->trans("AccountancyClosureStep3Desc") . '</span><br>';
441 441
 
442 442
 	if (empty($current_fiscal_period['status'])) {
443
-		$button = '<a class="butActionRefused classfortooltip" href="#">' . $langs->trans("AccountancyClosureAccountingReversal") . '</a>';
443
+		$button = '<a class="butActionRefused classfortooltip" href="#">'.$langs->trans("AccountancyClosureAccountingReversal").'</a>';
444 444
 	} else {
445
-		$button = '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?action=step_3&token='.newToken().'&fiscal_period_id=' . $current_fiscal_period['id'] . '">' . $langs->trans("AccountancyClosureAccountingReversal") . '</a>';
445
+		$button = '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=step_3&token='.newToken().'&fiscal_period_id='.$current_fiscal_period['id'].'">'.$langs->trans("AccountancyClosureAccountingReversal").'</a>';
446 446
 	}
447 447
 	print_barre_liste('', 0, '', '', '', '', '', -1, '', '', 0, $button, '', 0, 1, 0);
448 448
 }
Please login to merge, or discard this patch.
htdocs/core/class/commonobject.class.php 1 patch
Spacing   +129 added lines, -129 removed lines patch added patch discarded remove patch
@@ -477,11 +477,11 @@  discard block
 block discarded – undo
477 477
 	 *
478 478
 	 * Note: cond_reglement can not be aliased to cond_reglement!!!
479 479
 	 */
480
-	private $cond_reglement;  // Private to call DolDeprecationHandler
480
+	private $cond_reglement; // Private to call DolDeprecationHandler
481 481
 	/**
482 482
 	 * @var int|string Internal to detect deprecated access
483 483
 	 */
484
-	protected $depr_cond_reglement;  // Internal value for deprecation
484
+	protected $depr_cond_reglement; // Internal value for deprecation
485 485
 
486 486
 	/**
487 487
 	 * @var int 		Delivery address ID
@@ -538,12 +538,12 @@  discard block
 block discarded – undo
538 538
 	/**
539 539
 	 * @var float|string Multicurrency total localtax1
540 540
 	 */
541
-	public $multicurrency_total_localtax1;	// not in database
541
+	public $multicurrency_total_localtax1; // not in database
542 542
 
543 543
 	/**
544 544
 	 * @var float|string Multicurrency total localtax2
545 545
 	 */
546
-	public $multicurrency_total_localtax2;	// not in database
546
+	public $multicurrency_total_localtax2; // not in database
547 547
 
548 548
 	/**
549 549
 	 * @var string
@@ -1028,17 +1028,17 @@  discard block
 block discarded – undo
1028 1028
 				}
1029 1029
 				$labelextra = $langs->trans((string) $extrafields->attributes[$this->table_element]['label'][$key]);
1030 1030
 				if ($extrafields->attributes[$this->table_element]['type'][$key] == 'separate') {
1031
-					$data[$key] = '<br><b><u>'. $labelextra . '</u></b>';
1031
+					$data[$key] = '<br><b><u>'.$labelextra.'</u></b>';
1032 1032
 				} else {
1033
-					$value = (empty($this->array_options['options_' . $key]) ? '' : $this->array_options['options_' . $key]);
1034
-					$data[$key] = '<br><b>'. $labelextra . ':</b> ' . $extrafields->showOutputField($key, $value, '', $this->table_element);
1033
+					$value = (empty($this->array_options['options_'.$key]) ? '' : $this->array_options['options_'.$key]);
1034
+					$data[$key] = '<br><b>'.$labelextra.':</b> '.$extrafields->showOutputField($key, $value, '', $this->table_element);
1035 1035
 					$count++;
1036 1036
 				}
1037 1037
 			}
1038 1038
 			$data['closedivextra'] = '</div>';
1039 1039
 		}
1040 1040
 
1041
-		$hookmanager->initHooks(array($this->element . 'dao'));
1041
+		$hookmanager->initHooks(array($this->element.'dao'));
1042 1042
 		$parameters = array(
1043 1043
 			'tooltipcontentarray' => &$data,
1044 1044
 			'params' => $params,
@@ -1538,7 +1538,7 @@  discard block
 block discarded – undo
1538 1538
 			$sql .= " AND ec.fk_c_type_contact IN (".$this->db->sanitize(implode(',', $arrayoftcids)).")";
1539 1539
 		}
1540 1540
 		if ($status >= 0) {
1541
-			$sql .= " AND t.statut = ".((int) $status);	// t is llx_user or llx_socpeople
1541
+			$sql .= " AND t.statut = ".((int) $status); // t is llx_user or llx_socpeople
1542 1542
 		}
1543 1543
 		if ($statusoflink >= 0) {
1544 1544
 			$sql .= " AND ec.statut = ".((int) $statusoflink);
@@ -1920,7 +1920,7 @@  discard block
 block discarded – undo
1920 1920
 		}
1921 1921
 
1922 1922
 		$sql = "SELECT rowid FROM ".$this->db->prefix().$this->table_element;
1923
-		$sql .= " WHERE ".$this->table_ref_field." LIKE '".$this->db->escape($ref)."'";	// no escapeforlike here
1923
+		$sql .= " WHERE ".$this->table_ref_field." LIKE '".$this->db->escape($ref)."'"; // no escapeforlike here
1924 1924
 		$sql .= " LIMIT 1";
1925 1925
 
1926 1926
 		$query = $this->db->query($sql);
@@ -2227,9 +2227,9 @@  discard block
 block discarded – undo
2227 2227
 
2228 2228
 		$oldvalue = null;
2229 2229
 		if ($trigkey) {
2230
-			$sql = "SELECT " . $field;
2231
-			$sql .= " FROM " . MAIN_DB_PREFIX . $table;
2232
-			$sql .= " WHERE " . $id_field . " = " . ((int) $id);
2230
+			$sql = "SELECT ".$field;
2231
+			$sql .= " FROM ".MAIN_DB_PREFIX.$table;
2232
+			$sql .= " WHERE ".$id_field." = ".((int) $id);
2233 2233
 
2234 2234
 			$resql = $this->db->query($sql);
2235 2235
 			if ($resql) {
@@ -2609,7 +2609,7 @@  discard block
 block discarded – undo
2609 2609
 		// Triggers
2610 2610
 		if (!$error && !$notrigger) {
2611 2611
 			// Call triggers
2612
-			$result = $this->call_trigger(strtoupper($this->element) . '_MODIFY', $user);
2612
+			$result = $this->call_trigger(strtoupper($this->element).'_MODIFY', $user);
2613 2613
 			if ($result < 0) {
2614 2614
 				$error++;
2615 2615
 			} //Do also here what you must do to rollback action if trigger fail
@@ -2987,7 +2987,7 @@  discard block
 block discarded – undo
2987 2987
 			$sql = 'UPDATE '.$this->db->prefix().$this->table_element;
2988 2988
 			$sql .= " SET ".$fieldname." = ".(($id > 0 || $id == '0') ? ((int) $id) : 'NULL');
2989 2989
 			if (in_array($this->table_element, array('propal', 'commande', 'societe'))) {
2990
-				$sql .= " , deposit_percent = " . (empty($deposit_percent) ? 'NULL' : "'".$this->db->escape($deposit_percent)."'");
2990
+				$sql .= " , deposit_percent = ".(empty($deposit_percent) ? 'NULL' : "'".$this->db->escape($deposit_percent)."'");
2991 2991
 			}
2992 2992
 			$sql .= ' WHERE rowid='.((int) $this->id);
2993 2993
 
@@ -3335,10 +3335,10 @@  discard block
 block discarded – undo
3335 3335
 		$sql = "SELECT count(rowid) FROM ".$this->db->prefix().$this->table_element_line;
3336 3336
 		$sql .= " WHERE ".$this->fk_element." = ".((int) $this->id);
3337 3337
 		if (!$renum) {
3338
-			$sql .= " AND " . $fieldposition . " = 0";
3338
+			$sql .= " AND ".$fieldposition." = 0";
3339 3339
 		}
3340 3340
 		if ($renum) {
3341
-			$sql .= " AND " . $fieldposition . " <> 0";
3341
+			$sql .= " AND ".$fieldposition." <> 0";
3342 3342
 		}
3343 3343
 
3344 3344
 		dol_syslog(get_class($this)."::line_order", LOG_DEBUG);
@@ -3359,7 +3359,7 @@  discard block
 block discarded – undo
3359 3359
 			if ($fk_parent_line) {
3360 3360
 				$sql .= ' AND fk_parent_line IS NULL';
3361 3361
 			}
3362
-			$sql .= " ORDER BY " . $fieldposition . " ASC, rowid " . $rowidorder;
3362
+			$sql .= " ORDER BY ".$fieldposition." ASC, rowid ".$rowidorder;
3363 3363
 
3364 3364
 			dol_syslog(get_class($this)."::line_order search all parent lines", LOG_DEBUG);
3365 3365
 			$resql = $this->db->query($sql);
@@ -3411,7 +3411,7 @@  discard block
 block discarded – undo
3411 3411
 		$sql = "SELECT rowid FROM ".$this->db->prefix().$this->table_element_line;
3412 3412
 		$sql .= " WHERE ".$this->fk_element." = ".((int) $this->id);
3413 3413
 		$sql .= ' AND fk_parent_line = '.((int) $id);
3414
-		$sql .= " ORDER BY " . $fieldposition . " ASC";
3414
+		$sql .= " ORDER BY ".$fieldposition." ASC";
3415 3415
 
3416 3416
 		dol_syslog(get_class($this)."::getChildrenOfLine search children lines for line ".$id, LOG_DEBUG);
3417 3417
 
@@ -3535,7 +3535,7 @@  discard block
 block discarded – undo
3535 3535
 
3536 3536
 			$sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) $rang);
3537 3537
 			$sql .= " WHERE ".$this->fk_element." = ".((int) $this->id);
3538
-			$sql .= " AND " . $fieldposition . " = " . ((int) ($rang - 1));
3538
+			$sql .= " AND ".$fieldposition." = ".((int) ($rang - 1));
3539 3539
 			if ($this->db->query($sql)) {
3540 3540
 				$sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) ($rang - 1));
3541 3541
 				$sql .= ' WHERE rowid = '.((int) $rowid);
@@ -3566,7 +3566,7 @@  discard block
 block discarded – undo
3566 3566
 
3567 3567
 			$sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) $rang);
3568 3568
 			$sql .= " WHERE ".$this->fk_element." = ".((int) $this->id);
3569
-			$sql .= " AND " . $fieldposition . " = " . ((int) ($rang + 1));
3569
+			$sql .= " AND ".$fieldposition." = ".((int) ($rang + 1));
3570 3570
 			if ($this->db->query($sql)) {
3571 3571
 				$sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) ($rang + 1));
3572 3572
 				$sql .= ' WHERE rowid = '.((int) $rowid);
@@ -3592,7 +3592,7 @@  discard block
 block discarded – undo
3592 3592
 			$fieldposition = 'position';
3593 3593
 		}
3594 3594
 
3595
-		$sql = "SELECT " . $fieldposition . " FROM ".$this->db->prefix().$this->table_element_line;
3595
+		$sql = "SELECT ".$fieldposition." FROM ".$this->db->prefix().$this->table_element_line;
3596 3596
 		$sql .= " WHERE rowid = ".((int) $rowid);
3597 3597
 
3598 3598
 		dol_syslog(get_class($this)."::getRangOfLine", LOG_DEBUG);
@@ -3620,7 +3620,7 @@  discard block
 block discarded – undo
3620 3620
 
3621 3621
 		$sql = "SELECT rowid FROM ".$this->db->prefix().$this->table_element_line;
3622 3622
 		$sql .= " WHERE ".$this->fk_element." = ".((int) $this->id);
3623
-		$sql .= " AND " . $fieldposition . " = ".((int) $rang);
3623
+		$sql .= " AND ".$fieldposition." = ".((int) $rang);
3624 3624
 		$resql = $this->db->query($sql);
3625 3625
 		if ($resql) {
3626 3626
 			$row = $this->db->fetch_row($resql);
@@ -3739,7 +3739,7 @@  discard block
 block discarded – undo
3739 3739
 			$newsuffix = '';
3740 3740
 		}
3741 3741
 		if (in_array($this->table_element, array('actioncomm', 'adherent', 'advtargetemailing', 'cronjob', 'establishment'))) {
3742
-			$fieldusermod =  "fk_user_mod";
3742
+			$fieldusermod = "fk_user_mod";
3743 3743
 		} elseif ($this->table_element == 'ecm_files') {
3744 3744
 			$fieldusermod = "fk_user_m";
3745 3745
 		} else {
@@ -3781,7 +3781,7 @@  discard block
 block discarded – undo
3781 3781
 						$trigger_name = 'EXPENSE_REPORT_MODIFY';
3782 3782
 						break;
3783 3783
 					default:
3784
-						$trigger_name = strtoupper($this->element) . '_MODIFY';
3784
+						$trigger_name = strtoupper($this->element).'_MODIFY';
3785 3785
 				}
3786 3786
 				$ret = $this->call_trigger($trigger_name, $user);
3787 3787
 				if ($ret < 0) {
@@ -4079,7 +4079,7 @@  discard block
 block discarded – undo
4079 4079
 			// Situations totals
4080 4080
 			if (!empty($this->situation_cycle_ref) && !empty($this->situation_counter) && $this->situation_counter > 1 && method_exists($this, 'get_prev_sits')) {  // @phan-suppress-current-line PhanUndeclaredProperty
4081 4081
 				'@phan-var-force Facture $this';
4082
-				include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';  // Note: possibly useless as $this is normally already Facture, so the class file should be loaded
4082
+				include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; // Note: possibly useless as $this is normally already Facture, so the class file should be loaded
4083 4083
 				if ($this->type != Facture::TYPE_CREDIT_NOTE) {	// @phpstan-ignore-line
4084 4084
 					if (getDolGlobalInt('INVOICE_USE_SITUATION') != 2) {
4085 4085
 						$prev_sits = $this->get_prev_sits();
@@ -4201,19 +4201,19 @@  discard block
 block discarded – undo
4201 4201
 		$this->db->begin();
4202 4202
 		$error = 0;
4203 4203
 
4204
-		$sql = "INSERT INTO " . $this->db->prefix() . "element_element (";
4204
+		$sql = "INSERT INTO ".$this->db->prefix()."element_element (";
4205 4205
 		$sql .= "fk_source";
4206 4206
 		$sql .= ", sourcetype";
4207 4207
 		$sql .= ", fk_target";
4208 4208
 		$sql .= ", targettype";
4209 4209
 		$sql .= ") VALUES (";
4210 4210
 		$sql .= ((int) $origin_id);
4211
-		$sql .= ", '" . $this->db->escape($origin) . "'";
4212
-		$sql .= ", " . ((int) $this->id);
4213
-		$sql .= ", '" . $this->db->escape($targettype) . "'";
4211
+		$sql .= ", '".$this->db->escape($origin)."'";
4212
+		$sql .= ", ".((int) $this->id);
4213
+		$sql .= ", '".$this->db->escape($targettype)."'";
4214 4214
 		$sql .= ")";
4215 4215
 
4216
-		dol_syslog(get_class($this) . "::add_object_linked", LOG_DEBUG);
4216
+		dol_syslog(get_class($this)."::add_object_linked", LOG_DEBUG);
4217 4217
 		if ($this->db->query($sql)) {
4218 4218
 			if (!$notrigger) {
4219 4219
 				// Call trigger
@@ -4466,20 +4466,20 @@  discard block
 block discarded – undo
4466 4466
 		$this->db->begin();
4467 4467
 		$error = 0;
4468 4468
 
4469
-		$sql = "UPDATE " . $this->db->prefix() . "element_element SET ";
4469
+		$sql = "UPDATE ".$this->db->prefix()."element_element SET ";
4470 4470
 		if ($updatesource) {
4471
-			$sql .= "fk_source = " . ((int) $sourceid);
4472
-			$sql .= ", sourcetype = '" . $this->db->escape($sourcetype) . "'";
4473
-			$sql .= " WHERE fk_target = " . ((int) $this->id);
4474
-			$sql .= " AND targettype = '" . $this->db->escape($this->element) . "'";
4471
+			$sql .= "fk_source = ".((int) $sourceid);
4472
+			$sql .= ", sourcetype = '".$this->db->escape($sourcetype)."'";
4473
+			$sql .= " WHERE fk_target = ".((int) $this->id);
4474
+			$sql .= " AND targettype = '".$this->db->escape($this->element)."'";
4475 4475
 		} elseif ($updatetarget) {
4476
-			$sql .= "fk_target = " . ((int) $targetid);
4477
-			$sql .= ", targettype = '" . $this->db->escape($targettype) . "'";
4478
-			$sql .= " WHERE fk_source = " . ((int) $this->id);
4479
-			$sql .= " AND sourcetype = '" . $this->db->escape($this->element) . "'";
4476
+			$sql .= "fk_target = ".((int) $targetid);
4477
+			$sql .= ", targettype = '".$this->db->escape($targettype)."'";
4478
+			$sql .= " WHERE fk_source = ".((int) $this->id);
4479
+			$sql .= " AND sourcetype = '".$this->db->escape($this->element)."'";
4480 4480
 		}
4481 4481
 
4482
-		dol_syslog(get_class($this) . "::updateObjectLinked", LOG_DEBUG);
4482
+		dol_syslog(get_class($this)."::updateObjectLinked", LOG_DEBUG);
4483 4483
 		if ($this->db->query($sql)) {
4484 4484
 			if (!$notrigger) {
4485 4485
 				// Call trigger
@@ -4555,25 +4555,25 @@  discard block
 block discarded – undo
4555 4555
 		}
4556 4556
 
4557 4557
 		if (!$error) {
4558
-			$sql = "DELETE FROM " . $this->db->prefix() . "element_element";
4558
+			$sql = "DELETE FROM ".$this->db->prefix()."element_element";
4559 4559
 			$sql .= " WHERE";
4560 4560
 			if ($rowid > 0) {
4561
-				$sql .= " rowid = " . ((int) $rowid);
4561
+				$sql .= " rowid = ".((int) $rowid);
4562 4562
 			} else {
4563 4563
 				if ($deletesource) {
4564
-					$sql .= " fk_source = " . ((int) $sourceid) . " AND sourcetype = '" . $this->db->escape($sourcetype) . "'";
4565
-					$sql .= " AND fk_target = " . ((int) $this->id) . " AND targettype = '" . $this->db->escape($this->element) . "'";
4564
+					$sql .= " fk_source = ".((int) $sourceid)." AND sourcetype = '".$this->db->escape($sourcetype)."'";
4565
+					$sql .= " AND fk_target = ".((int) $this->id)." AND targettype = '".$this->db->escape($this->element)."'";
4566 4566
 				} elseif ($deletetarget) {
4567
-					$sql .= " fk_target = " . ((int) $targetid) . " AND targettype = '" . $this->db->escape($targettype) . "'";
4568
-					$sql .= " AND fk_source = " . ((int) $this->id) . " AND sourcetype = '" . $this->db->escape($this->element) . "'";
4567
+					$sql .= " fk_target = ".((int) $targetid)." AND targettype = '".$this->db->escape($targettype)."'";
4568
+					$sql .= " AND fk_source = ".((int) $this->id)." AND sourcetype = '".$this->db->escape($this->element)."'";
4569 4569
 				} else {
4570
-					$sql .= " (fk_source = " . ((int) $this->id) . " AND sourcetype = '" . $this->db->escape($this->element) . "')";
4570
+					$sql .= " (fk_source = ".((int) $this->id)." AND sourcetype = '".$this->db->escape($this->element)."')";
4571 4571
 					$sql .= " OR";
4572
-					$sql .= " (fk_target = " . ((int) $this->id) . " AND targettype = '" . $this->db->escape($this->element) . "')";
4572
+					$sql .= " (fk_target = ".((int) $this->id)." AND targettype = '".$this->db->escape($this->element)."')";
4573 4573
 				}
4574 4574
 			}
4575 4575
 
4576
-			dol_syslog(get_class($this) . "::deleteObjectLinked", LOG_DEBUG);
4576
+			dol_syslog(get_class($this)."::deleteObjectLinked", LOG_DEBUG);
4577 4577
 			if (!$this->db->query($sql)) {
4578 4578
 				$this->error = $this->db->lasterror();
4579 4579
 				$this->errors[] = $this->error;
@@ -4738,14 +4738,14 @@  discard block
 block discarded – undo
4738 4738
 			$sql .= ", date_validation = '".$this->db->idate(dol_now())."'";
4739 4739
 		}
4740 4740
 		$sql .= " WHERE rowid = ".((int) $elementId);
4741
-		$sql .= " AND ".$fieldstatus." <> ".((int) $status);	// We avoid update if status already correct
4741
+		$sql .= " AND ".$fieldstatus." <> ".((int) $status); // We avoid update if status already correct
4742 4742
 
4743 4743
 		dol_syslog(get_class($this)."::setStatut", LOG_DEBUG);
4744 4744
 		$resql = $this->db->query($sql);
4745 4745
 		if ($resql) {
4746 4746
 			$error = 0;
4747 4747
 
4748
-			$nb_rows_affected = $this->db->affected_rows($resql);	// should be 1 or 0 if status was already correct
4748
+			$nb_rows_affected = $this->db->affected_rows($resql); // should be 1 or 0 if status was already correct
4749 4749
 
4750 4750
 			if ($nb_rows_affected > 0) {
4751 4751
 				if (empty($trigkey)) {
@@ -4792,7 +4792,7 @@  discard block
 block discarded – undo
4792 4792
 					if ($fieldstatus == 'tosell') {
4793 4793
 						$this->status = $status;
4794 4794
 					} elseif ($fieldstatus == 'tobuy') {
4795
-						$this->status_buy = $status;	// @phpstan-ignore-line
4795
+						$this->status_buy = $status; // @phpstan-ignore-line
4796 4796
 					} else {
4797 4797
 						$this->status = $status;
4798 4798
 					}
@@ -4900,7 +4900,7 @@  discard block
 block discarded – undo
4900 4900
 			return -1;
4901 4901
 		}
4902 4902
 
4903
-		$arraytoscan = $this->childtables;		// array('tablename'=>array('fk_element'=>'parentfield'), ...) or array('tablename'=>array('parent'=>table_parent, 'parentkey'=>'nameoffieldforparentfkkey'), ...)
4903
+		$arraytoscan = $this->childtables; // array('tablename'=>array('fk_element'=>'parentfield'), ...) or array('tablename'=>array('parent'=>table_parent, 'parentkey'=>'nameoffieldforparentfkkey'), ...)
4904 4904
 		// For backward compatibility, we check if array is old format array('tablename1', 'tablename2', ...)
4905 4905
 		$tmparray = array_keys($this->childtables);
4906 4906
 		if (is_numeric($tmparray[0])) {
@@ -5994,7 +5994,7 @@  discard block
 block discarded – undo
5994 5994
 			$setsharekey = false;
5995 5995
 			if ($this->element == 'propal' || $this->element == 'proposal') {
5996 5996
 				if (getDolGlobalInt("PROPOSAL_ALLOW_ONLINESIGN")) {
5997
-					$setsharekey = true;	// feature to make online signature is not set or set to on (default)
5997
+					$setsharekey = true; // feature to make online signature is not set or set to on (default)
5998 5998
 				}
5999 5999
 				if (getDolGlobalInt("PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD")) {
6000 6000
 					$setsharekey = true;
@@ -6054,7 +6054,7 @@  discard block
 block discarded – undo
6054 6054
 				$ecmfile->gen_or_uploaded = 'generated';
6055 6055
 				$ecmfile->description = ''; // indexed content
6056 6056
 				$ecmfile->keywords = ''; // keyword content
6057
-				$ecmfile->src_object_type = $this->table_element;	// $this->table_name is 'myobject' or 'mymodule_myobject'.
6057
+				$ecmfile->src_object_type = $this->table_element; // $this->table_name is 'myobject' or 'mymodule_myobject'.
6058 6058
 				$ecmfile->src_object_id   = $this->id;
6059 6059
 
6060 6060
 				$result = $ecmfile->create($user);
@@ -6106,7 +6106,7 @@  discard block
 block discarded – undo
6106 6106
 			$maxwidthmini = $tmparraysize['maxwidthmini'];
6107 6107
 			$maxheightmini = $tmparraysize['maxheightmini'];
6108 6108
 			//$quality = $tmparraysize['quality'];
6109
-			$quality = 50;	// For thumbs, we force quality to 50
6109
+			$quality = 50; // For thumbs, we force quality to 50
6110 6110
 
6111 6111
 			// Create small thumbs for company (Ratio is near 16/9)
6112 6112
 			// Used on logon for example
@@ -6206,8 +6206,8 @@  discard block
 block discarded – undo
6206 6206
 		// phpcs:enable
6207 6207
 		global $langs, $conf;
6208 6208
 
6209
-		if (!empty(self::TRIGGER_PREFIX) && strpos($triggerName, self::TRIGGER_PREFIX . '_') !== 0) {
6210
-			dol_print_error(null, 'The trigger "' . $triggerName . '" does not start with "' . self::TRIGGER_PREFIX . '_" as required.');
6209
+		if (!empty(self::TRIGGER_PREFIX) && strpos($triggerName, self::TRIGGER_PREFIX.'_') !== 0) {
6210
+			dol_print_error(null, 'The trigger "'.$triggerName.'" does not start with "'.self::TRIGGER_PREFIX.'_" as required.');
6211 6211
 			exit;
6212 6212
 		}
6213 6213
 		if (!is_object($langs)) {	// If lang was not defined, we set it. It is required by run_triggers().
@@ -6399,7 +6399,7 @@  discard block
 block discarded – undo
6399 6399
 		$savDisableCompute = $conf->disable_compute;
6400 6400
 		$conf->disable_compute = 1;
6401 6401
 
6402
-		$ret = $this->fetch($id);	/* @phpstan-ignore-line */
6402
+		$ret = $this->fetch($id); /* @phpstan-ignore-line */
6403 6403
 
6404 6404
 		$conf->disable_compute = $savDisableCompute;
6405 6405
 
@@ -6461,7 +6461,7 @@  discard block
 block discarded – undo
6461 6461
 		if (is_array($optionsArray) && count($optionsArray) > 0) {
6462 6462
 			$sql = "SELECT rowid";
6463 6463
 			foreach ($optionsArray as $name => $label) {
6464
-				if (empty($extrafields->attributes[$this->table_element]['type'][$name]) || (!in_array($extrafields->attributes[$this->table_element]['type'][$name], ['separate', 'point', 'multipts', 'linestrg','polygon']))) {
6464
+				if (empty($extrafields->attributes[$this->table_element]['type'][$name]) || (!in_array($extrafields->attributes[$this->table_element]['type'][$name], ['separate', 'point', 'multipts', 'linestrg', 'polygon']))) {
6465 6465
 					$sql .= ", ".$name;
6466 6466
 				}
6467 6467
 				// use geo sql fonction to read as text
@@ -6514,7 +6514,7 @@  discard block
 block discarded – undo
6514 6514
 					 **/
6515 6515
 					if (is_array($extrafields->attributes[$this->table_element]['label'])) {
6516 6516
 						foreach ($extrafields->attributes[$this->table_element]['label'] as $key => $val) {
6517
-							$this->array_options['options_' . $key] = null;
6517
+							$this->array_options['options_'.$key] = null;
6518 6518
 						}
6519 6519
 					}
6520 6520
 				}
@@ -6526,9 +6526,9 @@  discard block
 block discarded – undo
6526 6526
 						if (!empty($extrafields->attributes[$this->table_element]) && !empty($extrafields->attributes[$this->table_element]['computed'][$key])) {
6527 6527
 							//var_dump($conf->disable_compute);
6528 6528
 							if (empty($conf->disable_compute)) {
6529
-								global $objectoffield;        // We set a global variable to $objectoffield so
6530
-								$objectoffield = $this;        // we can use it inside computed formula
6531
-								$this->array_options['options_' . $key] = dol_eval($extrafields->attributes[$this->table_element]['computed'][$key], 1, 0, '2');
6529
+								global $objectoffield; // We set a global variable to $objectoffield so
6530
+								$objectoffield = $this; // we can use it inside computed formula
6531
+								$this->array_options['options_'.$key] = dol_eval($extrafields->attributes[$this->table_element]['computed'][$key], 1, 0, '2');
6532 6532
 							}
6533 6533
 						}
6534 6534
 					}
@@ -6709,7 +6709,7 @@  discard block
 block discarded – undo
6709 6709
 										// If old value encrypted in database is same than submitted new value, it means we don't change it, so we don't update.
6710 6710
 										if ($algo == 'dolcrypt') {	// dolibarr reversible encryption
6711 6711
 											if (!preg_match('/^dolcrypt:/', $this->array_options[$key])) {
6712
-												$new_array_options[$key] = dolEncrypt($this->array_options[$key]);	// warning, must be called when on the master
6712
+												$new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master
6713 6713
 											} else {
6714 6714
 												$new_array_options[$key] = $this->array_options[$key]; // Value is kept
6715 6715
 											}
@@ -6720,7 +6720,7 @@  discard block
 block discarded – undo
6720 6720
 										// If value has changed
6721 6721
 										if ($algo == 'dolcrypt') {	// dolibarr reversible encryption
6722 6722
 											if (!preg_match('/^dolcrypt:/', $this->array_options[$key])) {
6723
-												$new_array_options[$key] = dolEncrypt($this->array_options[$key]);	// warning, must be called when on the master
6723
+												$new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master
6724 6724
 											} else {
6725 6725
 												$new_array_options[$key] = $this->array_options[$key]; // Value is kept
6726 6726
 											}
@@ -6732,7 +6732,7 @@  discard block
 block discarded – undo
6732 6732
 									//var_dump('jjj'.$algo.' '.$this->oldcopy->array_options[$key].' -> '.$this->array_options[$key]);
6733 6733
 									// If this->oldcopy is not defined, we can't know if we change attribute or not, so we must keep value
6734 6734
 									if ($algo == 'dolcrypt' && !preg_match('/^dolcrypt:/', $this->array_options[$key])) {	// dolibarr reversible encryption
6735
-										$new_array_options[$key] = dolEncrypt($this->array_options[$key]);	// warning, must be called when on the master
6735
+										$new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master
6736 6736
 									} else {
6737 6737
 										$new_array_options[$key] = $this->array_options[$key]; // Value is kept
6738 6738
 									}
@@ -7158,7 +7158,7 @@  discard block
 block discarded – undo
7158 7158
 								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.
7159 7159
 									if ($algo == 'dolcrypt') {	// dolibarr reversible encryption
7160 7160
 										if (!preg_match('/^dolcrypt:/', $this->array_options["options_".$key])) {
7161
-											$new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]);	// warning, must be called when on the master
7161
+											$new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]); // warning, must be called when on the master
7162 7162
 										} else {
7163 7163
 											$new_array_options["options_".$key] = $this->array_options["options_".$key]; // Value is kept
7164 7164
 										}
@@ -7178,7 +7178,7 @@  discard block
 block discarded – undo
7178 7178
 								}
7179 7179
 							} else {
7180 7180
 								if ($algo == 'dolcrypt' && !preg_match('/^dolcrypt:/', $this->array_options["options_".$key])) {	// dolibarr reversible encryption
7181
-									$new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]);	// warning, must be called when on the master
7181
+									$new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]); // warning, must be called when on the master
7182 7182
 								} else {
7183 7183
 									$new_array_options["options_".$key] = $this->array_options["options_".$key]; // Value is kept
7184 7184
 								}
@@ -7762,7 +7762,7 @@  discard block
 block discarded – undo
7762 7762
 				// 7 : sort field
7763 7763
 
7764 7764
 				// If there is filter
7765
-				if (! empty($InfoFieldList[4])) {
7765
+				if (!empty($InfoFieldList[4])) {
7766 7766
 					$pos = 0;
7767 7767
 					$parenthesisopen = 0;
7768 7768
 					while (substr($InfoFieldList[4], $pos, 1) !== '' && ($parenthesisopen || $pos == 0 || substr($InfoFieldList[4], $pos, 1) != ':')) {
@@ -7826,8 +7826,8 @@  discard block
 block discarded – undo
7826 7826
 					}
7827 7827
 
7828 7828
 					$sqlwhere = '';
7829
-					$sql = "SELECT " . $keyList;
7830
-					$sql .= " FROM " . $this->db->prefix() . $InfoFieldList[0];
7829
+					$sql = "SELECT ".$keyList;
7830
+					$sql .= " FROM ".$this->db->prefix().$InfoFieldList[0];
7831 7831
 
7832 7832
 					if (!empty($InfoFieldList[4])) {
7833 7833
 						// can use SELECT request
@@ -7845,11 +7845,11 @@  discard block
 block discarded – undo
7845 7845
 						// We have to join on extrafield table
7846 7846
 						$errstr = '';
7847 7847
 						if (strpos($InfoFieldList[4], 'extra') !== false) {
7848
-							$sql .= " as main, " . $this->db->sanitize($this->db->prefix() . $InfoFieldList[0]) . "_extrafields as extra";
7849
-							$sqlwhere .= " WHERE extra.fk_object = main." . $this->db->sanitize($InfoFieldList[2]);
7850
-							$sqlwhere .= " AND " . forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1);
7848
+							$sql .= " as main, ".$this->db->sanitize($this->db->prefix().$InfoFieldList[0])."_extrafields as extra";
7849
+							$sqlwhere .= " WHERE extra.fk_object = main.".$this->db->sanitize($InfoFieldList[2]);
7850
+							$sqlwhere .= " AND ".forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1);
7851 7851
 						} else {
7852
-							$sqlwhere .= " WHERE " . forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1);
7852
+							$sqlwhere .= " WHERE ".forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1);
7853 7853
 						}
7854 7854
 					} else {
7855 7855
 						$sqlwhere .= ' WHERE 1=1';
@@ -7870,7 +7870,7 @@  discard block
 block discarded – undo
7870 7870
 
7871 7871
 					// Some tables may have field, some other not. For the moment we disable it.
7872 7872
 					if (in_array($InfoFieldList[0], array('tablewithentity'))) {
7873
-						$sqlwhere .= " AND entity = " . ((int) $conf->entity);
7873
+						$sqlwhere .= " AND entity = ".((int) $conf->entity);
7874 7874
 					}
7875 7875
 					$sql .= $sqlwhere;
7876 7876
 
@@ -7881,7 +7881,7 @@  discard block
 block discarded – undo
7881 7881
 						$sql .= " ORDER BY ".$this->db->sanitize(implode(', ', $fields_label));
7882 7882
 					}
7883 7883
 
7884
-					dol_syslog(get_class($this) . '::showInputField type=sellist', LOG_DEBUG);
7884
+					dol_syslog(get_class($this).'::showInputField type=sellist', LOG_DEBUG);
7885 7885
 					$resql = $this->db->query($sql);
7886 7886
 					if ($resql) {
7887 7887
 						$out .= '<option value="0">&nbsp;</option>';
@@ -7897,7 +7897,7 @@  discard block
 block discarded – undo
7897 7897
 							if (count($fields_label) > 1) {
7898 7898
 								$notrans = true;
7899 7899
 								foreach ($fields_label as $field_toshow) {
7900
-									$labeltoshow .= $obj->$field_toshow . ' ';
7900
+									$labeltoshow .= $obj->$field_toshow.' ';
7901 7901
 								}
7902 7902
 							} else {
7903 7903
 								$labeltoshow = $obj->{$InfoFieldList[1]};
@@ -7908,12 +7908,12 @@  discard block
 block discarded – undo
7908 7908
 								foreach ($fields_label as $field_toshow) {
7909 7909
 									$translabel = $langs->trans($obj->$field_toshow);
7910 7910
 									if ($translabel != $obj->$field_toshow) {
7911
-										$labeltoshow = dol_trunc($translabel) . ' ';
7911
+										$labeltoshow = dol_trunc($translabel).' ';
7912 7912
 									} else {
7913
-										$labeltoshow = dol_trunc($obj->$field_toshow) . ' ';
7913
+										$labeltoshow = dol_trunc($obj->$field_toshow).' ';
7914 7914
 									}
7915 7915
 								}
7916
-								$out .= '<option value="' . $obj->rowid . '" selected>' . $labeltoshow . '</option>';
7916
+								$out .= '<option value="'.$obj->rowid.'" selected>'.$labeltoshow.'</option>';
7917 7917
 							} else {
7918 7918
 								if (!$notrans) {
7919 7919
 									$translabel = $langs->trans($obj->{$InfoFieldList[1]});
@@ -7927,34 +7927,34 @@  discard block
 block discarded – undo
7927 7927
 									$labeltoshow = '(not defined)';
7928 7928
 								}
7929 7929
 								if ($value == $obj->rowid) {
7930
-									$out .= '<option value="' . $obj->rowid . '" selected>' . $labeltoshow . '</option>';
7930
+									$out .= '<option value="'.$obj->rowid.'" selected>'.$labeltoshow.'</option>';
7931 7931
 								}
7932 7932
 
7933 7933
 								if (!empty($InfoFieldList[3]) && $parentField) {
7934
-									$parent = $parentName . ':' . $obj->{$parentField};
7934
+									$parent = $parentName.':'.$obj->{$parentField};
7935 7935
 									$isDependList = 1;
7936 7936
 								}
7937 7937
 
7938
-								$out .= '<option value="' . $obj->rowid . '"';
7938
+								$out .= '<option value="'.$obj->rowid.'"';
7939 7939
 								$out .= ($value == $obj->rowid ? ' selected' : '');
7940
-								$out .= (!empty($parent) ? ' parent="' . $parent . '"' : '');
7941
-								$out .= '>' . $labeltoshow . '</option>';
7940
+								$out .= (!empty($parent) ? ' parent="'.$parent.'"' : '');
7941
+								$out .= '>'.$labeltoshow.'</option>';
7942 7942
 							}
7943 7943
 
7944 7944
 							$i++;
7945 7945
 						}
7946 7946
 						$this->db->free($resql);
7947 7947
 					} else {
7948
-						print 'Error in request ' . $sql . ' ' . $this->db->lasterror() . '. Check setup of extra parameters.<br>';
7948
+						print 'Error in request '.$sql.' '.$this->db->lasterror().'. Check setup of extra parameters.<br>';
7949 7949
 					}
7950 7950
 				} else {
7951 7951
 					require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
7952 7952
 					$data = $form->select_all_categories(Categorie::$MAP_ID_TO_CODE[$InfoFieldList[5]], '', 'parent', 64, $InfoFieldList[6], 1, 1);
7953 7953
 					$out .= '<option value="0">&nbsp;</option>';
7954 7954
 					foreach ($data as $data_key => $data_value) {
7955
-						$out .= '<option value="' . $data_key . '"';
7955
+						$out .= '<option value="'.$data_key.'"';
7956 7956
 						$out .= ($value == $data_key ? ' selected' : '');
7957
-						$out .= '>' . $data_value . '</option>';
7957
+						$out .= '>'.$data_value.'</option>';
7958 7958
 					}
7959 7959
 				}
7960 7960
 			}
@@ -7994,7 +7994,7 @@  discard block
 block discarded – undo
7994 7994
 				// 7 : sort field
7995 7995
 
7996 7996
 				// If there is a filter
7997
-				if (! empty($InfoFieldList[4])) {
7997
+				if (!empty($InfoFieldList[4])) {
7998 7998
 					$pos = 0;
7999 7999
 					$parenthesisopen = 0;
8000 8000
 					while (substr($InfoFieldList[4], $pos, 1) !== '' && ($parenthesisopen || $pos == 0 || substr($InfoFieldList[4], $pos, 1) != ':')) {
@@ -8060,8 +8060,8 @@  discard block
 block discarded – undo
8060 8060
 					}
8061 8061
 
8062 8062
 					$sqlwhere = '';
8063
-					$sql = "SELECT " . $keyList;
8064
-					$sql .= ' FROM ' . $this->db->prefix() . $InfoFieldList[0];
8063
+					$sql = "SELECT ".$keyList;
8064
+					$sql .= ' FROM '.$this->db->prefix().$InfoFieldList[0];
8065 8065
 
8066 8066
 					if (!empty($InfoFieldList[4])) {
8067 8067
 						// can use SELECT request
@@ -8079,11 +8079,11 @@  discard block
 block discarded – undo
8079 8079
 						// We have to join on extrafield table
8080 8080
 						$errstr = '';
8081 8081
 						if (strpos($InfoFieldList[4], 'extra') !== false) {
8082
-							$sql .= ' as main, ' . $this->db->sanitize($this->db->prefix() . $InfoFieldList[0]) . '_extrafields as extra';
8083
-							$sqlwhere .= " WHERE extra.fk_object = main." . $this->db->sanitize($InfoFieldList[2]);
8084
-							$sqlwhere .= " AND " . $InfoFieldList[4];
8082
+							$sql .= ' as main, '.$this->db->sanitize($this->db->prefix().$InfoFieldList[0]).'_extrafields as extra';
8083
+							$sqlwhere .= " WHERE extra.fk_object = main.".$this->db->sanitize($InfoFieldList[2]);
8084
+							$sqlwhere .= " AND ".$InfoFieldList[4];
8085 8085
 						} else {
8086
-							$sqlwhere .= " WHERE " . $InfoFieldList[4];
8086
+							$sqlwhere .= " WHERE ".$InfoFieldList[4];
8087 8087
 						}
8088 8088
 					} else {
8089 8089
 						$sqlwhere .= ' WHERE 1=1';
@@ -8104,14 +8104,14 @@  discard block
 block discarded – undo
8104 8104
 
8105 8105
 					// Some tables may have field, some other not. For the moment we disable it.
8106 8106
 					if (in_array($InfoFieldList[0], array('tablewithentity'))) {
8107
-						$sqlwhere .= " AND entity = " . ((int) $conf->entity);
8107
+						$sqlwhere .= " AND entity = ".((int) $conf->entity);
8108 8108
 					}
8109 8109
 					// $sql.=preg_replace('/^ AND /','',$sqlwhere);
8110 8110
 					// print $sql;
8111 8111
 
8112 8112
 					$sql .= $sqlwhere;
8113 8113
 
8114
-					dol_syslog(get_class($this) . '::showInputField type=chkbxlst', LOG_DEBUG);
8114
+					dol_syslog(get_class($this).'::showInputField type=chkbxlst', LOG_DEBUG);
8115 8115
 
8116 8116
 					$resql = $this->db->query($sql);
8117 8117
 					if ($resql) {
@@ -8130,7 +8130,7 @@  discard block
 block discarded – undo
8130 8130
 							if (count($fields_label) > 1) {
8131 8131
 								$notrans = true;
8132 8132
 								foreach ($fields_label as $field_toshow) {
8133
-									$labeltoshow .= $obj->$field_toshow . ' ';
8133
+									$labeltoshow .= $obj->$field_toshow.' ';
8134 8134
 								}
8135 8135
 							} else {
8136 8136
 								$labeltoshow = $obj->{$InfoFieldList[1]};
@@ -8141,9 +8141,9 @@  discard block
 block discarded – undo
8141 8141
 								foreach ($fields_label as $field_toshow) {
8142 8142
 									$translabel = $langs->trans($obj->$field_toshow);
8143 8143
 									if ($translabel != $obj->$field_toshow) {
8144
-										$labeltoshow = dol_trunc($translabel, 18) . ' ';
8144
+										$labeltoshow = dol_trunc($translabel, 18).' ';
8145 8145
 									} else {
8146
-										$labeltoshow = dol_trunc($obj->$field_toshow, 18) . ' ';
8146
+										$labeltoshow = dol_trunc($obj->$field_toshow, 18).' ';
8147 8147
 									}
8148 8148
 								}
8149 8149
 
@@ -8166,7 +8166,7 @@  discard block
 block discarded – undo
8166 8166
 								}
8167 8167
 
8168 8168
 								if (!empty($InfoFieldList[3]) && $parentField) {
8169
-									$parent = $parentName . ':' . $obj->{$parentField};
8169
+									$parent = $parentName.':'.$obj->{$parentField};
8170 8170
 									$isDependList = 1;
8171 8171
 								}
8172 8172
 
@@ -8177,14 +8177,14 @@  discard block
 block discarded – undo
8177 8177
 						}
8178 8178
 						$this->db->free($resql);
8179 8179
 
8180
-						$out = $form->multiselectarray($keyprefix . $key . $keysuffix, $data, $value_arr, 0, 0, $morecss, 0, '100%');
8180
+						$out = $form->multiselectarray($keyprefix.$key.$keysuffix, $data, $value_arr, 0, 0, $morecss, 0, '100%');
8181 8181
 					} else {
8182
-						print 'Error in request ' . $sql . ' ' . $this->db->lasterror() . '. Check setup of extra parameters.<br>';
8182
+						print 'Error in request '.$sql.' '.$this->db->lasterror().'. Check setup of extra parameters.<br>';
8183 8183
 					}
8184 8184
 				} else {
8185 8185
 					require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
8186 8186
 					$data = $form->select_all_categories(Categorie::$MAP_ID_TO_CODE[(int) $InfoFieldList[5]], '', 'parent', 64, $InfoFieldList[6], 1, 1);
8187
-					$out = $form->multiselectarray($keyprefix . $key . $keysuffix, $data, $value_arr, 0, 0, $morecss, 0, '100%');
8187
+					$out = $form->multiselectarray($keyprefix.$key.$keysuffix, $data, $value_arr, 0, 0, $morecss, 0, '100%');
8188 8188
 				}
8189 8189
 			}
8190 8190
 		} elseif ($type == 'link') {
@@ -8419,7 +8419,7 @@  discard block
 block discarded – undo
8419 8419
 			$value = $this->getLibStatut(3);
8420 8420
 		} elseif ($type == 'date') {
8421 8421
 			if (!empty($value)) {
8422
-				$value = dol_print_date($value, 'day');	// We suppose dates without time are always gmt (storage of course + output)
8422
+				$value = dol_print_date($value, 'day'); // We suppose dates without time are always gmt (storage of course + output)
8423 8423
 			} else {
8424 8424
 				$value = '';
8425 8425
 			}
@@ -8520,7 +8520,7 @@  discard block
 block discarded – undo
8520 8520
 			$value = isset($param['options'][(string) $value]) ? $param['options'][(string) $value] : '';
8521 8521
 			if (strpos($value, "|") !== false) {
8522 8522
 				$value = $langs->trans(explode('|', $value)[0]);
8523
-			} elseif (! is_numeric($value)) {
8523
+			} elseif (!is_numeric($value)) {
8524 8524
 				$value = $langs->trans($value);
8525 8525
 			}
8526 8526
 		} elseif ($type == 'sellist') {
@@ -8582,9 +8582,9 @@  discard block
 block discarded – undo
8582 8582
 									$translabel = $langs->trans($obj->$field_toshow);
8583 8583
 								}
8584 8584
 								if ($translabel != $field_toshow) {
8585
-									$value .= dol_trunc($translabel, 18) . ' ';
8585
+									$value .= dol_trunc($translabel, 18).' ';
8586 8586
 								} else {
8587
-									$value .= $obj->$field_toshow . ' ';
8587
+									$value .= $obj->$field_toshow.' ';
8588 8588
 								}
8589 8589
 							}
8590 8590
 						} else {
@@ -8600,7 +8600,7 @@  discard block
 block discarded – undo
8600 8600
 						}
8601 8601
 					}
8602 8602
 				} else {
8603
-					require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
8603
+					require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
8604 8604
 
8605 8605
 					$toprint = array();
8606 8606
 					$obj = $this->db->fetch_object($resql);
@@ -8608,7 +8608,7 @@  discard block
 block discarded – undo
8608 8608
 					$c->fetch($obj->rowid);
8609 8609
 					$ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text
8610 8610
 					foreach ($ways as $way) {
8611
-						$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #aaa"') . '>' . img_object('', 'category') . ' ' . $way . '</li>';
8611
+						$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #aaa"').'>'.img_object('', 'category').' '.$way.'</li>';
8612 8612
 					}
8613 8613
 					$value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
8614 8614
 				}
@@ -8624,11 +8624,11 @@  discard block
 block discarded – undo
8624 8624
 				$toprint = array();
8625 8625
 				foreach ($value_arr as $keyval => $valueval) {
8626 8626
 					if (!empty($valueval)) {
8627
-						$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . $param['options'][$valueval] . '</li>';
8627
+						$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$param['options'][$valueval].'</li>';
8628 8628
 					}
8629 8629
 				}
8630 8630
 				if (!empty($toprint)) {
8631
-					$value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>';
8631
+					$value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
8632 8632
 				}
8633 8633
 			}
8634 8634
 		} elseif ($type == 'chkbxlst') {
@@ -8683,9 +8683,9 @@  discard block
 block discarded – undo
8683 8683
 										$translabel = $langs->trans($obj->$field_toshow);
8684 8684
 									}
8685 8685
 									if ($translabel != $field_toshow) {
8686
-										$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . dol_trunc($translabel, 18) . '</li>';
8686
+										$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.dol_trunc($translabel, 18).'</li>';
8687 8687
 									} else {
8688
-										$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . $obj->$field_toshow . '</li>';
8688
+										$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$obj->$field_toshow.'</li>';
8689 8689
 									}
8690 8690
 								}
8691 8691
 							} else {
@@ -8694,15 +8694,15 @@  discard block
 block discarded – undo
8694 8694
 									$translabel = $langs->trans($obj->{$InfoFieldList[1]});
8695 8695
 								}
8696 8696
 								if ($translabel != $obj->{$InfoFieldList[1]}) {
8697
-									$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . dol_trunc($translabel, 18) . '</li>';
8697
+									$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.dol_trunc($translabel, 18).'</li>';
8698 8698
 								} else {
8699
-									$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . $obj->{$InfoFieldList[1]} . '</li>';
8699
+									$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$obj->{$InfoFieldList[1]}.'</li>';
8700 8700
 								}
8701 8701
 							}
8702 8702
 						}
8703 8703
 					}
8704 8704
 				} else {
8705
-					require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
8705
+					require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
8706 8706
 
8707 8707
 					$toprint = array();
8708 8708
 					while ($obj = $this->db->fetch_object($resql)) {
@@ -8711,7 +8711,7 @@  discard block
 block discarded – undo
8711 8711
 							$c->fetch($obj->rowid);
8712 8712
 							$ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text
8713 8713
 							foreach ($ways as $way) {
8714
-								$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #aaa"') . '>' . img_object('', 'category') . ' ' . $way . '</li>';
8714
+								$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #aaa"').'>'.img_object('', 'category').' '.$way.'</li>';
8715 8715
 							}
8716 8716
 						}
8717 8717
 					}
@@ -8881,7 +8881,7 @@  discard block
 block discarded – undo
8881 8881
 		global $langs;
8882 8882
 
8883 8883
 		if (!class_exists('Validate')) {
8884
-			require_once DOL_DOCUMENT_ROOT . '/core/class/validate.class.php';
8884
+			require_once DOL_DOCUMENT_ROOT.'/core/class/validate.class.php';
8885 8885
 		}
8886 8886
 
8887 8887
 		$this->clearFieldError($fieldKey);
@@ -9120,7 +9120,7 @@  discard block
 block discarded – undo
9120 9120
 				$out .= "\n";
9121 9121
 
9122 9122
 				$nbofextrafieldsshown = 0;
9123
-				$e = 0;	// var to manage the modulo (odd/even)
9123
+				$e = 0; // var to manage the modulo (odd/even)
9124 9124
 
9125 9125
 				$lastseparatorkeyfound = '';
9126 9126
 				$extrafields_collapse_num = '';
@@ -10226,7 +10226,7 @@  discard block
 block discarded – undo
10226 10226
 						continue;
10227 10227
 					}
10228 10228
 				}
10229
-				$keys_with_alias[] = $alias . '.' . $fieldname;
10229
+				$keys_with_alias[] = $alias.'.'.$fieldname;
10230 10230
 			}
10231 10231
 			return implode(',', $keys_with_alias);
10232 10232
 		} else {
@@ -10361,7 +10361,7 @@  discard block
 block discarded – undo
10361 10361
 		if (!$error) {
10362 10362
 			$sql = "INSERT INTO ".$this->db->prefix().$this->table_element;
10363 10363
 			$sql .= " (".implode(", ", $keys).')';
10364
-			$sql .= " VALUES (".implode(", ", $values).")";		// $values can contains 'abc' or 123
10364
+			$sql .= " VALUES (".implode(", ", $values).")"; // $values can contains 'abc' or 123
10365 10365
 
10366 10366
 			$res = $this->db->query($sql);
10367 10367
 			if (!$res) {
@@ -10664,7 +10664,7 @@  discard block
 block discarded – undo
10664 10664
 
10665 10665
 		// Update extrafield
10666 10666
 		if (!$error) {
10667
-			$result = $this->insertExtraFields();	// This delete and reinsert extrafields
10667
+			$result = $this->insertExtraFields(); // This delete and reinsert extrafields
10668 10668
 			if ($result < 0) {
10669 10669
 				$error++;
10670 10670
 			}
@@ -10866,12 +10866,12 @@  discard block
 block discarded – undo
10866 10866
 				$error++;
10867 10867
 			} else {
10868 10868
 				while ($obj = $this->db->fetch_object($resql)) {
10869
-					$result = $this->fetch($obj->rowid);	// @phpstan-ignore-line
10869
+					$result = $this->fetch($obj->rowid); // @phpstan-ignore-line
10870 10870
 					if ($result < 0) {
10871 10871
 						$error++;
10872 10872
 						$this->errors[] = $this->error;
10873 10873
 					} else {
10874
-						$result = $this->delete($user);	// @phpstan-ignore-line
10874
+						$result = $this->delete($user); // @phpstan-ignore-line
10875 10875
 						if ($result < 0) {
10876 10876
 							$error++;
10877 10877
 							$this->errors[] = $this->error;
@@ -11037,7 +11037,7 @@  discard block
 block discarded – undo
11037 11037
 		);
11038 11038
 		foreach ($fields as $key => $value) {
11039 11039
 			if (array_key_exists($key, $this->fields)) {
11040
-				$this->{$key} = $value;		// @phpstan-ignore-line
11040
+				$this->{$key} = $value; // @phpstan-ignore-line
11041 11041
 			}
11042 11042
 		}
11043 11043
 
Please login to merge, or discard this patch.