Completed
Branch develop (57268a)
by
unknown
21:19
created
htdocs/core/lib/files.lib.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
 	$utf8_path = preg_replace('/([\\/]+)$/', '', $utf8_path);
106 106
 
107 107
 	if (preg_match('/\*/', $utf8_path)) {
108
-		$utf8_path_array = glob($utf8_path, GLOB_ONLYDIR);	// This scan dir for files. If file does not exists, return empty.
108
+		$utf8_path_array = glob($utf8_path, GLOB_ONLYDIR); // This scan dir for files. If file does not exists, return empty.
109 109
 		//$os_path_array = dol_dir_list($utf8_path);
110 110
 	} else {
111 111
 		$utf8_path_array = array($utf8_path);
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
 				'types' => $types,
124 124
 				'recursive' => $recursive,
125 125
 				'filter' => $filter,
126
-				'excludefilter' => $exclude_array,  // Already converted to array.
126
+				'excludefilter' => $exclude_array, // Already converted to array.
127 127
 				'sortcriteria' => $sortcriteria,
128 128
 				'sortorder' => $sortorder,
129 129
 				'loaddate' => $loaddate,
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
 
159 159
 				$qualified = 1;
160 160
 
161
-				$utf8_fullpathfile = $utf8_path_cursor."/".$utf8_file;  // Temp variable for speed
161
+				$utf8_fullpathfile = $utf8_path_cursor."/".$utf8_file; // Temp variable for speed
162 162
 
163 163
 				// Check if file is qualified
164 164
 				foreach ($excludefilterarray as $filt) {
@@ -962,7 +962,7 @@  discard block
 block discarded – undo
962 962
 	// Recursive function to copy all subdirectories and contents:
963 963
 	if (is_dir($ossrcfile)) {
964 964
 		$dir_handle = opendir($ossrcfile);
965
-		$tmpresult = 0;  // Initialised before loop to keep old behavior, may be needed inside loop
965
+		$tmpresult = 0; // Initialised before loop to keep old behavior, may be needed inside loop
966 966
 		while ($file = readdir($dir_handle)) {
967 967
 			if ($file != "." && $file != ".." && !is_link($ossrcfile."/".$file)) {
968 968
 				if (is_dir($ossrcfile."/".$file)) {
@@ -1497,7 +1497,7 @@  discard block
 block discarded – undo
1497 1497
 
1498 1498
 		if ($return) {
1499 1499
 			dolChmod($file_name_osencoded);
1500
-			dol_syslog("Files.lib::dol_move_uploaded_file Success to move ".$src_file." to ".$file_name." - Umask=" . getDolGlobalString('MAIN_UMASK'), LOG_DEBUG);
1500
+			dol_syslog("Files.lib::dol_move_uploaded_file Success to move ".$src_file." to ".$file_name." - Umask=".getDolGlobalString('MAIN_UMASK'), LOG_DEBUG);
1501 1501
 			return $successcode; // Success
1502 1502
 		} else {
1503 1503
 			dol_syslog("Files.lib::dol_move_uploaded_file Failed to move ".$src_file." to ".$file_name, LOG_ERR);
@@ -1563,7 +1563,7 @@  discard block
 block discarded – undo
1563 1563
 			$ok = true;
1564 1564
 			$globencoded = str_replace('[', '\[', $file_osencoded);
1565 1565
 			$globencoded = str_replace(']', '\]', $globencoded);
1566
-			$listofdir = glob($globencoded);	// This scan dir for files. If file does not exists, return empty.
1566
+			$listofdir = glob($globencoded); // This scan dir for files. If file does not exists, return empty.
1567 1567
 
1568 1568
 			if (!empty($listofdir) && is_array($listofdir)) {
1569 1569
 				foreach ($listofdir as $filename) {
@@ -2044,7 +2044,7 @@  discard block
 block discarded – undo
2044 2044
 					$maxwidthmini = $tmparraysize['maxwidthmini'];
2045 2045
 					$maxheightmini = $tmparraysize['maxheightmini'];
2046 2046
 					//$quality = $tmparraysize['quality'];
2047
-					$quality = 50;	// For thumbs, we force quality to 50
2047
+					$quality = 50; // For thumbs, we force quality to 50
2048 2048
 
2049 2049
 					// Generate thumbs.
2050 2050
 					if ($generatethumbs) {
@@ -2238,7 +2238,7 @@  discard block
 block discarded – undo
2238 2238
 			if (isset($object->table_element)) {
2239 2239
 				$ecmfile->src_object_type = $object->table_element;
2240 2240
 			} else {
2241
-				dol_syslog('Error: object ' . get_class($object) . ' has no table_element attribute.');
2241
+				dol_syslog('Error: object '.get_class($object).' has no table_element attribute.');
2242 2242
 				return -1;
2243 2243
 			}
2244 2244
 			if (isset($object->src_object_description)) {
@@ -2535,9 +2535,9 @@  discard block
 block discarded – undo
2535 2535
 					// Skip directories (they would be added automatically)
2536 2536
 					if (!$file->isDir()) {
2537 2537
 						// Get real and relative path for current file
2538
-						$filePath = $file->getPath();				// the full path with filename using the $inputdir root.
2538
+						$filePath = $file->getPath(); // the full path with filename using the $inputdir root.
2539 2539
 						$fileName = $file->getFilename();
2540
-						$fileFullRealPath = $file->getRealPath();	// the full path with name and transformed to use real path directory.
2540
+						$fileFullRealPath = $file->getRealPath(); // the full path with name and transformed to use real path directory.
2541 2541
 
2542 2542
 						//$relativePath = substr($fileFullRealPath, strlen($rootPath) + 1);
2543 2543
 						$relativePath = substr(($filePath ? $filePath.'/' : '').$fileName, strlen($rootPath) + 1);
@@ -2809,9 +2809,9 @@  discard block
 block discarded – undo
2809 2809
 					// Skip directories (they would be added automatically)
2810 2810
 					if (!$file->isDir()) {
2811 2811
 						// Get real and relative path for current file
2812
-						$filePath = $file->getPath();				// the full path with filename using the $inputdir root.
2812
+						$filePath = $file->getPath(); // the full path with filename using the $inputdir root.
2813 2813
 						$fileName = $file->getFilename();
2814
-						$fileFullRealPath = $file->getRealPath();	// the full path with name and transformed to use real path directory.
2814
+						$fileFullRealPath = $file->getRealPath(); // the full path with name and transformed to use real path directory.
2815 2815
 
2816 2816
 						//$relativePath = ($rootdirinzip ? $rootdirinzip.'/' : '').substr($fileFullRealPath, strlen($inputdir) + 1);
2817 2817
 						$relativePath = ($rootdirinzip ? $rootdirinzip.'/' : '').substr(($filePath ? $filePath.'/' : '').$fileName, strlen($inputdir) + 1);
@@ -3918,7 +3918,7 @@  discard block
 block discarded – undo
3918 3918
 function archiveOrBackupFile($srcfile, $max_versions = 5, $archivedir = '', $suffix = "v", $moveorcopy = 'move')
3919 3919
 {
3920 3920
 	$base_file_pattern = ($archivedir ? $archivedir : dirname($srcfile)).'/'.basename($srcfile).".".$suffix;
3921
-	$files_in_directory = glob($base_file_pattern . "*");
3921
+	$files_in_directory = glob($base_file_pattern."*");
3922 3922
 
3923 3923
 	// Extract the modification timestamps for each file
3924 3924
 	$files_with_timestamps = [];
@@ -3959,7 +3959,7 @@  discard block
 block discarded – undo
3959 3959
 	}
3960 3960
 
3961 3961
 	$timestamp = dol_now('gmt');
3962
-	$new_backup = $srcfile . ".v" . $timestamp;
3962
+	$new_backup = $srcfile.".v".$timestamp;
3963 3963
 
3964 3964
 	// Move or copy the original file to the new backup with the timestamp
3965 3965
 	if ($moveorcopy == 'move') {
Please login to merge, or discard this patch.
htdocs/core/class/translate.class.php 1 patch
Spacing   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -131,9 +131,9 @@  discard block
 block discarded – undo
131 131
 			$more = array();
132 132
 			$i = 0;
133 133
 			foreach ($conf->file->dol_document_root as $dir) {
134
-				$newdir = $dir . getDolGlobalString('MAIN_FORCELANGDIR'); // For example $conf->global->MAIN_FORCELANGDIR is '/mymodule' meaning we search files into '/mymodule/langs/xx_XX'
134
+				$newdir = $dir.getDolGlobalString('MAIN_FORCELANGDIR'); // For example $conf->global->MAIN_FORCELANGDIR is '/mymodule' meaning we search files into '/mymodule/langs/xx_XX'
135 135
 				if (!in_array($newdir, $this->dir)) {
136
-					$more['module_' . $i] = $newdir;
136
+					$more['module_'.$i] = $newdir;
137 137
 					$i++; // We add the forced dir into the array $more. Just after, we add entries into $more to list of lang dir $this->dir.
138 138
 				}
139 139
 			}
@@ -163,13 +163,13 @@  discard block
 block discarded – undo
163 163
 			if (isset($longforshort[strtolower($langpart[0])]) && !in_array($codetouse, $longforshortexcep)) {
164 164
 				$srclang = $longforshort[strtolower($langpart[0])];
165 165
 			} elseif (!is_numeric($langpart[1])) {		// Second part YY may be a numeric with some Chrome browser
166
-				$srclang = strtolower($langpart[0]) . "_" . strtoupper($langpart[1]);
166
+				$srclang = strtolower($langpart[0])."_".strtoupper($langpart[1]);
167 167
 				$longforlong = array('no_nb' => 'nb_NO');
168 168
 				if (isset($longforlong[strtolower($srclang)])) {
169 169
 					$srclang = $longforlong[strtolower($srclang)];
170 170
 				}
171 171
 			} else {
172
-				$srclang = strtolower($langpart[0]) . "_" . strtoupper($langpart[0]);
172
+				$srclang = strtolower($langpart[0])."_".strtoupper($langpart[0]);
173 173
 			}
174 174
 		} else {						// If it's for a codetouse that is a short code xx
175 175
 			// Array to convert short lang code into long code.
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
 			if (isset($longforshort[strtolower($langpart[0])])) {
183 183
 				$srclang = $longforshort[strtolower($langpart[0])];
184 184
 			} elseif (!empty($langpart[0])) {
185
-				$srclang = strtolower($langpart[0]) . "_" . strtoupper($langpart[0]);
185
+				$srclang = strtolower($langpart[0])."_".strtoupper($langpart[0]);
186 186
 			} else {
187 187
 				$srclang = 'en_US';
188 188
 			}
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
 
263 263
 		// Check parameters
264 264
 		if (empty($domain)) {
265
-			dol_print_error(null, get_class($this) . "::Load ErrorWrongParameters");
265
+			dol_print_error(null, get_class($this)."::Load ErrorWrongParameters");
266 266
 			return -1;
267 267
 		}
268 268
 		if ($this->defaultlang === 'none_NONE') {
@@ -309,18 +309,18 @@  discard block
 block discarded – undo
309 309
 		}
310 310
 
311 311
 		if (empty($langofdir)) {	// This may occurs when load is called without setting the language and without providing a value for forcelangdir
312
-			dol_syslog("Error: " . get_class($this) . "::load was called for domain=" . $domain . " but language was not set yet with langs->setDefaultLang(). Nothing will be loaded.", LOG_WARNING);
312
+			dol_syslog("Error: ".get_class($this)."::load was called for domain=".$domain." but language was not set yet with langs->setDefaultLang(). Nothing will be loaded.", LOG_WARNING);
313 313
 			return -1;
314 314
 		}
315 315
 
316 316
 		$usecachekey = '';
317 317
 		foreach ($this->dir as $searchdir) {
318 318
 			// Directory of translation files
319
-			$file_lang = $searchdir . ($modulename ? '/' . $modulename : '') . "/langs/" . $langofdir . "/" . $newdomain . ".lang";
319
+			$file_lang = $searchdir.($modulename ? '/'.$modulename : '')."/langs/".$langofdir."/".$newdomain.".lang";
320 320
 			$file_lang_osencoded = dol_osencode($file_lang);
321 321
 
322 322
 			//$filelangexists = is_file($file_lang_osencoded);
323
-			$filelangexists = @is_file($file_lang_osencoded);	// avoid [php:warn]
323
+			$filelangexists = @is_file($file_lang_osencoded); // avoid [php:warn]
324 324
 
325 325
 			//dol_syslog(get_class($this).'::Load Try to read for alt='.$alt.' langofdir='.$langofdir.' domain='.$domain.' newdomain='.$newdomain.' modulename='.$modulename.' file_lang='.$file_lang." => filelangexists=".$filelangexists);
326 326
 			//print 'Try to read for alt='.$alt.' langofdir='.$langofdir.' domain='.$domain.' newdomain='.$newdomain.' modulename='.$modulename.' this->_tab_loaded[newdomain]='.$this->_tab_loaded[$newdomain].' file_lang='.$file_lang." => filelangexists=".$filelangexists."\n";
@@ -333,7 +333,7 @@  discard block
 block discarded – undo
333 333
 				$usecachekey = '';
334 334
 				// Using a memcached server
335 335
 				if (isModEnabled('memcached') && getDolGlobalString('MEMCACHED_SERVER')) {
336
-					$usecachekey = $newdomain . '_' . $langkey . '_' . md5($file_lang); // Should not contains special chars
336
+					$usecachekey = $newdomain.'_'.$langkey.'_'.md5($file_lang); // Should not contains special chars
337 337
 				} elseif (getDolGlobalInt('MAIN_OPTIMIZE_SPEED') & 0x02) {
338 338
 					// Using cache with shmop. Speed gain: 40ms - Memory overusage: 200ko (Size of session cache file)
339 339
 					$usecachekey = $newdomain;
@@ -341,7 +341,7 @@  discard block
 block discarded – undo
341 341
 
342 342
 				if ($usecachekey) {
343 343
 					//dol_syslog('Translate::Load we will cache result into usecachekey '.$usecachekey);
344
-					require_once DOL_DOCUMENT_ROOT . '/core/lib/memory.lib.php';
344
+					require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php';
345 345
 					$tmparray = dol_getcache($usecachekey);
346 346
 					if (is_array($tmparray) && count($tmparray)) {
347 347
 						$this->tab_translate += $tmparray; // Faster than array_merge($tmparray,$this->tab_translate). Note: If a value already exists into tab_translate, value into tmparaay is not added.
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
403 403
 		if ($alt == 0) {
404 404
 			// This function MUST NOT contains call to syslog
405 405
 			//dol_syslog("Translate::Load loading alternate translation file (to complete ".$this->defaultlang."/".$newdomain.".lang file)", LOG_DEBUG);
406
-			$langofdir = strtolower($langarray[0]) . '_' . strtoupper($langarray[0]);
406
+			$langofdir = strtolower($langarray[0]).'_'.strtoupper($langarray[0]);
407 407
 			if ($langofdir == 'el_EL') {
408 408
 				$langofdir = 'el_GR'; // main parent for el_CY is not 'el_EL' but 'el_GR'
409 409
 			}
@@ -435,7 +435,7 @@  discard block
 block discarded – undo
435 435
 		// This part is deprecated and replaced with table llx_overwrite_trans
436 436
 		// Kept for backward compatibility.
437 437
 		if (empty($loadfromfileonly)) {
438
-			$overwritekey = 'MAIN_OVERWRITE_TRANS_' . $this->defaultlang;
438
+			$overwritekey = 'MAIN_OVERWRITE_TRANS_'.$this->defaultlang;
439 439
 			if (getDolGlobalString($overwritekey)) {    // Overwrite translation with key1:newstring1,key2:newstring2
440 440
 				// Overwrite translation with param MAIN_OVERWRITE_TRANS_xx_XX
441 441
 				$tmparray = explode(',', getDolGlobalString($overwritekey));
@@ -452,7 +452,7 @@  discard block
 block discarded – undo
452 452
 		if ($usecachekey && count($tabtranslatedomain)) {
453 453
 			$ressetcache = dol_setcache($usecachekey, $tabtranslatedomain);
454 454
 			if ($ressetcache < 0) {
455
-				$error = 'Failed to set cache for usecachekey=' . $usecachekey . ' result=' . $ressetcache;
455
+				$error = 'Failed to set cache for usecachekey='.$usecachekey.' result='.$ressetcache;
456 456
 				dol_syslog($error, LOG_ERR);
457 457
 			}
458 458
 		}
@@ -507,7 +507,7 @@  discard block
 block discarded – undo
507 507
 		$langofdir = $this->defaultlang;
508 508
 
509 509
 		if (empty($langofdir)) {	// This may occurs when load is called without setting the language and without providing a value for forcelangdir
510
-			dol_syslog("Error: " . get_class($this) . "::loadFromDatabase was called but language was not set yet with langs->setDefaultLang(). Nothing will be loaded.", LOG_WARNING);
510
+			dol_syslog("Error: ".get_class($this)."::loadFromDatabase was called but language was not set yet with langs->setDefaultLang(). Nothing will be loaded.", LOG_WARNING);
511 511
 			return -1;
512 512
 		}
513 513
 
@@ -518,7 +518,7 @@  discard block
 block discarded – undo
518 518
 		$usecachekey = '';
519 519
 		// Using a memcached server
520 520
 		if (isModEnabled('memcached') && getDolGlobalString('MEMCACHED_SERVER')) {
521
-			$usecachekey = $newdomain . '_' . $langofdir; // Should not contains special chars
521
+			$usecachekey = $newdomain.'_'.$langofdir; // Should not contains special chars
522 522
 		} elseif (getDolGlobalInt('MAIN_OPTIMIZE_SPEED') & 0x02) {
523 523
 			// Using cache with shmop. Speed gain: 40ms - Memory overusage: 200ko (Size of session cache file)
524 524
 			$usecachekey = $newdomain;
@@ -526,7 +526,7 @@  discard block
 block discarded – undo
526 526
 
527 527
 		if ($usecachekey) {
528 528
 			//dol_syslog('Translate::Load we will cache result into usecachekey '.$usecachekey);
529
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/memory.lib.php';
529
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php';
530 530
 			$tmparray = dol_getcache($usecachekey);
531 531
 			if (is_array($tmparray) && count($tmparray)) {
532 532
 				$this->tab_translate += $tmparray; // Faster than array_merge($tmparray,$this->tab_translate). Note: If a value already exists into tab_translate, value into tmparaay is not added.
@@ -576,7 +576,7 @@  discard block
 block discarded – undo
576 576
 					if ($usecachekey && count($tabtranslatedomain)) {
577 577
 						$ressetcache = dol_setcache($usecachekey, $tabtranslatedomain);
578 578
 						if ($ressetcache < 0) {
579
-							$error = 'Failed to set cache for usecachekey=' . $usecachekey . ' result=' . $ressetcache;
579
+							$error = 'Failed to set cache for usecachekey='.$usecachekey.' result='.$ressetcache;
580 580
 							dol_syslog($error, LOG_ERR);
581 581
 						}
582 582
 					}
@@ -670,12 +670,12 @@  discard block
 block discarded – undo
670 670
 			$str = $this->tab_translate[$key];
671 671
 
672 672
 			// Make some string replacement after translation
673
-			$replacekey = 'MAIN_REPLACE_TRANS_' . $this->defaultlang;
673
+			$replacekey = 'MAIN_REPLACE_TRANS_'.$this->defaultlang;
674 674
 			if (getDolGlobalString($replacekey)) {    // Replacement translation variable with string1:newstring1;string2:newstring2
675 675
 				$tmparray = explode(';', getDolGlobalString($replacekey));
676 676
 				foreach ($tmparray as $tmp) {
677 677
 					$tmparray2 = explode(':', $tmp);
678
-					$str = preg_replace('/' . preg_quote($tmparray2[0]) . '/', $tmparray2[1], $str);
678
+					$str = preg_replace('/'.preg_quote($tmparray2[0]).'/', $tmparray2[1], $str);
679 679
 				}
680 680
 			}
681 681
 
@@ -789,12 +789,12 @@  discard block
 block discarded – undo
789 789
 			$str = $this->tab_translate[$key];
790 790
 
791 791
 			// Make some string replacement after translation
792
-			$replacekey = 'MAIN_REPLACE_TRANS_' . $this->defaultlang;
792
+			$replacekey = 'MAIN_REPLACE_TRANS_'.$this->defaultlang;
793 793
 			if (getDolGlobalString($replacekey)) {    // Replacement translation variable with string1:newstring1;string2:newstring2
794 794
 				$tmparray = explode(';', getDolGlobalString($replacekey));
795 795
 				foreach ($tmparray as $tmp) {
796 796
 					$tmparray2 = explode(':', $tmp);
797
-					$str = preg_replace('/' . preg_quote($tmparray2[0]) . '/', $tmparray2[1], $str);
797
+					$str = preg_replace('/'.preg_quote($tmparray2[0]).'/', $tmparray2[1], $str);
798 798
 				}
799 799
 			}
800 800
 
@@ -902,7 +902,7 @@  discard block
 block discarded – undo
902 902
 		$this->load("languages");
903 903
 
904 904
 		// We scan directory langs to detect available languages
905
-		$handle = opendir($langdir . "/langs");
905
+		$handle = opendir($langdir."/langs");
906 906
 		$langs_available = array();
907 907
 		while ($dir = trim(readdir($handle))) {
908 908
 			$regs = array();
@@ -952,9 +952,9 @@  discard block
 block discarded – undo
952 952
 				}
953 953
 
954 954
 				if ($usecode == 1 || getDolGlobalString('MAIN_SHOW_LANGUAGE_CODE')) {
955
-					$langs_available[$dir] = $dir . ': ' . dol_trunc($this->trans('Language_' . $dir), $maxlength);
955
+					$langs_available[$dir] = $dir.': '.dol_trunc($this->trans('Language_'.$dir), $maxlength);
956 956
 				} else {
957
-					$langs_available[$dir] = $this->trans('Language_' . $dir);
957
+					$langs_available[$dir] = $this->trans('Language_'.$dir);
958 958
 				}
959 959
 				if ($mainlangonly) {
960 960
 					$langs_available[$dir] = str_replace(' (United States)', '', $langs_available[$dir]);
@@ -978,7 +978,7 @@  discard block
 block discarded – undo
978 978
 		// phpcs:enable
979 979
 		// Test si fichier dans repertoire de la langue
980 980
 		foreach ($this->dir as $searchdir) {
981
-			if (is_readable(dol_osencode($searchdir . "/langs/" . $this->defaultlang . "/" . $filename))) {
981
+			if (is_readable(dol_osencode($searchdir."/langs/".$this->defaultlang."/".$filename))) {
982 982
 				return true;
983 983
 			}
984 984
 
@@ -986,7 +986,7 @@  discard block
 block discarded – undo
986 986
 				$filenamealt = null;
987 987
 				// Test si fichier dans repertoire de la langue alternative
988 988
 				if ($this->defaultlang != "en_US") {
989
-					$filenamealt = $searchdir . "/langs/en_US/" . $filename;
989
+					$filenamealt = $searchdir."/langs/en_US/".$filename;
990 990
 				}
991 991
 				//else $filenamealt = $searchdir."/langs/fr_FR/".$filename;
992 992
 				if ($filenamealt !== null && is_readable(dol_osencode($filenamealt))) {
@@ -1027,8 +1027,8 @@  discard block
 block discarded – undo
1027 1027
 			}
1028 1028
 
1029 1029
 			$fonc = 'numberwords';
1030
-			if (file_exists($newdir . '/functions_' . $fonc . '.lib.php')) {
1031
-				include_once $newdir . '/functions_' . $fonc . '.lib.php';
1030
+			if (file_exists($newdir.'/functions_'.$fonc.'.lib.php')) {
1031
+				include_once $newdir.'/functions_'.$fonc.'.lib.php';
1032 1032
 				if (function_exists('numberwords_getLabelFromNumber')) {
1033 1033
 					$newnumber = numberwords_getLabelFromNumber($this, $number, $isamount);
1034 1034
 					break;
@@ -1081,13 +1081,13 @@  discard block
 block discarded – undo
1081 1081
 		}
1082 1082
 
1083 1083
 		// Not found in loaded language file nor in cache. So we will take the label into database.
1084
-		$sql = "SELECT " . $fieldlabel . " as label";
1085
-		$sql .= " FROM " . $db->prefix() . $tablename;
1086
-		$sql .= " WHERE " . $fieldkey . " = '" . $db->escape($keyforselect ? $keyforselect : $key) . "'";
1084
+		$sql = "SELECT ".$fieldlabel." as label";
1085
+		$sql .= " FROM ".$db->prefix().$tablename;
1086
+		$sql .= " WHERE ".$fieldkey." = '".$db->escape($keyforselect ? $keyforselect : $key)."'";
1087 1087
 		if ($filteronentity) {
1088
-			$sql .= " AND entity IN (" . getEntity($tablename) . ')';
1088
+			$sql .= " AND entity IN (".getEntity($tablename).')';
1089 1089
 		}
1090
-		dol_syslog(get_class($this) . '::getLabelFromKey', LOG_DEBUG);
1090
+		dol_syslog(get_class($this).'::getLabelFromKey', LOG_DEBUG);
1091 1091
 		$resql = $db->query($sql);
1092 1092
 		if ($resql) {
1093 1093
 			$obj = $db->fetch_object($resql);
@@ -1120,9 +1120,9 @@  discard block
 block discarded – undo
1120 1120
 		$symbol = $this->getCurrencySymbol($currency_code);
1121 1121
 
1122 1122
 		if (in_array($currency_code, array('USD'))) {
1123
-			return $symbol . $amount;
1123
+			return $symbol.$amount;
1124 1124
 		} else {
1125
-			return $amount . $symbol;
1125
+			return $amount.$symbol;
1126 1126
 		}
1127 1127
 	}
1128 1128
 
@@ -1143,7 +1143,7 @@  discard block
 block discarded – undo
1143 1143
 
1144 1144
 			if (isset($this->cache_currencies[$currency_code]) && !empty($this->cache_currencies[$currency_code]['unicode']) && is_array($this->cache_currencies[$currency_code]['unicode'])) {  // @phan-suppress-current-line PhanTypeMismatchProperty
1145 1145
 				foreach ($this->cache_currencies[$currency_code]['unicode'] as $unicode) {
1146
-					$currency_sign .= mb_convert_encoding("&#" . $unicode . ";", "UTF-8", 'HTML-ENTITIES');
1146
+					$currency_sign .= mb_convert_encoding("&#".$unicode.";", "UTF-8", 'HTML-ENTITIES');
1147 1147
 				}
1148 1148
 			}
1149 1149
 		}
@@ -1169,14 +1169,14 @@  discard block
 block discarded – undo
1169 1169
 		}
1170 1170
 
1171 1171
 		$sql = "SELECT code_iso, label, unicode";
1172
-		$sql .= " FROM " . $db->prefix() . "c_currencies";
1172
+		$sql .= " FROM ".$db->prefix()."c_currencies";
1173 1173
 		$sql .= " WHERE active = 1";
1174 1174
 		if (!empty($currency_code)) {
1175
-			$sql .= " AND code_iso = '" . $db->escape($currency_code) . "'";
1175
+			$sql .= " AND code_iso = '".$db->escape($currency_code)."'";
1176 1176
 		}
1177 1177
 		//$sql.= " ORDER BY code_iso ASC"; // Not required, a sort is done later
1178 1178
 
1179
-		dol_syslog(get_class($this) . '::loadCacheCurrencies', LOG_DEBUG);
1179
+		dol_syslog(get_class($this).'::loadCacheCurrencies', LOG_DEBUG);
1180 1180
 		$resql = $db->query($sql);
1181 1181
 		if ($resql) {
1182 1182
 			$this->load("dict");
@@ -1193,8 +1193,8 @@  discard block
 block discarded – undo
1193 1193
 				$obj = $db->fetch_object($resql);
1194 1194
 				if ($obj) {
1195 1195
 					// If a translation exists, we use it lese we use the default label
1196
-					$this->cache_currencies[$obj->code_iso]['label'] = ($obj->code_iso && $this->trans("Currency" . $obj->code_iso) != "Currency" . $obj->code_iso ? $this->trans("Currency" . $obj->code_iso) : ($obj->label != '-' ? $obj->label : ''));
1197
-					$this->cache_currencies[$obj->code_iso]['unicode'] = (array) json_decode((empty($obj->unicode) ? '' : $obj->unicode), true);  // @phan-suppress-current-line PhanTypeMismatchProperty
1196
+					$this->cache_currencies[$obj->code_iso]['label'] = ($obj->code_iso && $this->trans("Currency".$obj->code_iso) != "Currency".$obj->code_iso ? $this->trans("Currency".$obj->code_iso) : ($obj->label != '-' ? $obj->label : ''));
1197
+					$this->cache_currencies[$obj->code_iso]['unicode'] = (array) json_decode((empty($obj->unicode) ? '' : $obj->unicode), true); // @phan-suppress-current-line PhanTypeMismatchProperty
1198 1198
 					$label[$obj->code_iso] = $this->cache_currencies[$obj->code_iso]['label'];
1199 1199
 				}
1200 1200
 				$i++;
@@ -1227,8 +1227,8 @@  discard block
 block discarded – undo
1227 1227
 		$substitutionarray = array();
1228 1228
 
1229 1229
 		foreach ($this->tab_translate as $code => $label) {
1230
-			$substitutionarray['lang_' . $code] = $label;
1231
-			$substitutionarray['__(' . $code . ')__'] = $label;
1230
+			$substitutionarray['lang_'.$code] = $label;
1231
+			$substitutionarray['__('.$code.')__'] = $label;
1232 1232
 		}
1233 1233
 
1234 1234
 		return $substitutionarray;
Please login to merge, or discard this patch.
htdocs/core/class/fileupload.class.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
 				'options' => &$options,
163 163
 				'element' => $element
164 164
 			),
165
-			$object,  // @phan-suppress-current-line PhanTypeMismatchArgumentNullable
165
+			$object, // @phan-suppress-current-line PhanTypeMismatchArgumentNullable
166 166
 			$action
167 167
 		);
168 168
 
@@ -433,7 +433,7 @@  discard block
 block discarded – undo
433 433
 		// Sanitize to avoid stream execution when calling file_size(). Not that this is a second security because
434 434
 		// most streams are already disabled by stream_wrapper_unregister() in filefunc.inc.php
435 435
 		$uploaded_file = preg_replace('/\s*(http|ftp|sftp|)s?:/i', '', $uploaded_file);
436
-		$uploaded_file = realpath($uploaded_file);	// A hack to be sure the file point to an existing file on disk (and is not a SSRF attack)
436
+		$uploaded_file = realpath($uploaded_file); // A hack to be sure the file point to an existing file on disk (and is not a SSRF attack)
437 437
 
438 438
 		$validate = $this->validate($uploaded_file, $file, $error, $index);
439 439
 
Please login to merge, or discard this patch.
htdocs/core/class/objectlink.class.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -236,21 +236,21 @@
 block discarded – undo
236 236
 
237 237
 		// create sourceobject and targetobject, make sure they exist with the respective numbers
238 238
 		$sourceobject = $this->_makeobject($fk_source, $sourcetype);
239
-		if ($sourceobject < 0 ) {
239
+		if ($sourceobject < 0) {
240 240
 			$this->error = "Error when looking for Object id=".$fk_source." of type=".$sourcetype;
241 241
 			return -2;
242 242
 		}
243
-		if ($sourceobject == 0 ) {
243
+		if ($sourceobject == 0) {
244 244
 			$this->error = "Object id ".$fk_source." of type ".$sourcetype." does not exist";
245 245
 			return -1;
246 246
 		}
247 247
 
248 248
 		$targetobject = $this->_makeobject($fk_target, $targettype);
249
-		if ($targetobject < 0 ) {
249
+		if ($targetobject < 0) {
250 250
 			$this->error = "Error when looking for Object id=".$fk_target." of type=".$targettype;
251 251
 			return -2;
252 252
 		}
253
-		if ($targetobject == 0 ) {
253
+		if ($targetobject == 0) {
254 254
 			$this->error = "Object id ".$fk_target." of type ".$targettype." does not exist";
255 255
 			return -1;
256 256
 		}
Please login to merge, or discard this patch.
htdocs/compta/facture/card.php 1 patch
Spacing   +55 added lines, -55 removed lines patch added patch discarded remove patch
@@ -91,14 +91,14 @@  discard block
 block discarded – undo
91 91
 }
92 92
 
93 93
 // General $Variables
94
-$id = (GETPOSTINT('id') ? GETPOSTINT('id') : GETPOSTINT('facid'));    // For backward compatibility
94
+$id = (GETPOSTINT('id') ? GETPOSTINT('id') : GETPOSTINT('facid')); // For backward compatibility
95 95
 $ref = GETPOST('ref', 'alpha');
96 96
 $socid = GETPOSTINT('socid');
97 97
 $action = GETPOST('action', 'aZ09');
98 98
 $confirm = GETPOST('confirm', 'alpha');
99 99
 $cancel = GETPOST('cancel', 'alpha');
100
-$backtopage = GETPOST('backtopage', 'alpha');					// if not set, a default page will be used
101
-$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');	// if not set, $backtopage will be used
100
+$backtopage = GETPOST('backtopage', 'alpha'); // if not set, a default page will be used
101
+$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); // if not set, $backtopage will be used
102 102
 $lineid = GETPOSTINT('lineid');
103 103
 $userid = GETPOSTINT('userid');
104 104
 $search_ref = GETPOST('sf_ref', 'alpha') ? GETPOST('sf_ref', 'alpha') : GETPOST('search_ref', 'alpha');
@@ -273,7 +273,7 @@  discard block
 block discarded – undo
273 273
 					setEventMessages('', $warningMsgLineList, 'warnings');
274 274
 				}
275 275
 
276
-				header("Location: " . $_SERVER['PHP_SELF'] . '?facid=' . $result);
276
+				header("Location: ".$_SERVER['PHP_SELF'].'?facid='.$result);
277 277
 				exit();
278 278
 			} else {
279 279
 				$langs->load("errors");
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
 		// Validation
365 365
 		$object->fetch($id);
366 366
 
367
-		if ((preg_match('/^[\(]?PROV/i', $object->ref) || empty($object->ref)) &&	// empty should not happened, but when it occurs, the test save life
367
+		if ((preg_match('/^[\(]?PROV/i', $object->ref) || empty($object->ref)) && // empty should not happened, but when it occurs, the test save life
368 368
 			getDolGlobalString('FAC_FORCE_DATE_VALIDATION')								// If option enabled, we force invoice date
369 369
 		) {
370 370
 			$object->date = dol_now();
@@ -789,8 +789,8 @@  discard block
 block discarded – undo
789 789
 			// We check if invoice has payments
790 790
 			$totalpaid = 0;
791 791
 			$sql = 'SELECT pf.amount';
792
-			$sql .= ' FROM ' . MAIN_DB_PREFIX . 'paiement_facture as pf';
793
-			$sql .= ' WHERE pf.fk_facture = ' . ((int) $object->id);
792
+			$sql .= ' FROM '.MAIN_DB_PREFIX.'paiement_facture as pf';
793
+			$sql .= ' WHERE pf.fk_facture = '.((int) $object->id);
794 794
 
795 795
 			$result = $db->query($sql);
796 796
 			if ($result) {
@@ -859,7 +859,7 @@  discard block
 block discarded – undo
859 859
 			if ($result < 0) {
860 860
 				setEventMessages($object->error, $object->errors, 'errors');
861 861
 			} else {
862
-				$object->fetch($object->id);	// Reload properties
862
+				$object->fetch($object->id); // Reload properties
863 863
 			}
864 864
 		} else {
865 865
 			setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Reason")), null, 'errors');
@@ -874,7 +874,7 @@  discard block
 block discarded – undo
874 874
 			if ($result < 0) {
875 875
 				setEventMessages($object->error, $object->errors, 'errors');
876 876
 			} else {
877
-				$object->fetch($object->id);	// Reload properties
877
+				$object->fetch($object->id); // Reload properties
878 878
 			}
879 879
 		} else {
880 880
 			setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Reason")), null, 'errors');
@@ -1053,7 +1053,7 @@  discard block
 block discarded – undo
1053 1053
 					// Set invoice as paid
1054 1054
 					$result = $object->setPaid($user);
1055 1055
 					if ($result >= 0) {
1056
-						$object->fetch($object->id);	// Reload properties
1056
+						$object->fetch($object->id); // Reload properties
1057 1057
 						$db->commit();
1058 1058
 					} else {
1059 1059
 						setEventMessages($object->error, $object->errors, 'errors');
@@ -1104,7 +1104,7 @@  discard block
 block discarded – undo
1104 1104
 			$error++;
1105 1105
 		}
1106 1106
 
1107
-		$dateinvoice = dol_mktime(0, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'), 'tzserver');	// If we enter the 02 january, we need to save the 02 january for server
1107
+		$dateinvoice = dol_mktime(0, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server
1108 1108
 		$date_pointoftax = dol_mktime(0, 0, 0, GETPOSTINT('date_pointoftaxmonth'), GETPOSTINT('date_pointoftaxday'), GETPOSTINT('date_pointoftaxyear'), 'tzserver');
1109 1109
 
1110 1110
 		// Replacement invoice
@@ -1136,7 +1136,7 @@  discard block
 block discarded – undo
1136 1136
 				$object->note_private		= trim(GETPOST('note_private', 'restricthtml'));
1137 1137
 				$object->ref_client			= GETPOST('ref_client', 'alphanohtml');
1138 1138
 				$object->ref_customer		= GETPOST('ref_client', 'alphanohtml');
1139
-				$object->model_pdf          = GETPOST('model', 'alphanohtml');
1139
+				$object->model_pdf = GETPOST('model', 'alphanohtml');
1140 1140
 				$object->fk_project			= GETPOSTINT('projectid');
1141 1141
 				$object->cond_reglement_id	= GETPOSTINT('cond_reglement_id');
1142 1142
 				$object->mode_reglement_id	= GETPOSTINT('mode_reglement_id');
@@ -1197,9 +1197,9 @@  discard block
 block discarded – undo
1197 1197
 				$object->note_private		= trim(GETPOST('note_private', 'restricthtml'));
1198 1198
 				$object->ref_client			= GETPOST('ref_client', 'alphanohtml');
1199 1199
 				$object->ref_customer		= GETPOST('ref_client', 'alphanohtml');
1200
-				$object->model_pdf          = GETPOST('model');
1200
+				$object->model_pdf = GETPOST('model');
1201 1201
 				$object->fk_project			= GETPOSTINT('projectid');
1202
-				$object->cond_reglement_id	= 0;		// No payment term for a credit note
1202
+				$object->cond_reglement_id	= 0; // No payment term for a credit note
1203 1203
 				$object->mode_reglement_id	= GETPOSTINT('mode_reglement_id');
1204 1204
 				$object->fk_account         = GETPOSTINT('fk_account');
1205 1205
 				//$object->remise_absolue		= price2num(GETPOST('remise_absolue'), 'MU');
@@ -1522,7 +1522,7 @@  discard block
 block discarded – undo
1522 1522
 				$object->note_public		= trim(GETPOST('note_public', 'restricthtml'));
1523 1523
 				$object->note_private       = trim(GETPOST('note_private', 'restricthtml'));
1524 1524
 				$object->ref_client			= GETPOST('ref_client');
1525
-				$object->ref_customer		= GETPOST('ref_client');
1525
+				$object->ref_customer = GETPOST('ref_client');
1526 1526
 				$object->model_pdf          = GETPOST('model');
1527 1527
 				$object->fk_project			= GETPOSTINT('projectid');
1528 1528
 				$object->cond_reglement_id	= (GETPOSTINT('type') == 3 ? 1 : GETPOST('cond_reglement_id'));
@@ -1586,7 +1586,7 @@  discard block
 block discarded – undo
1586 1586
 						$element = $subelement = 'expedition';
1587 1587
 					}
1588 1588
 
1589
-					$object->origin = $origin;		// deprecated
1589
+					$object->origin = $origin; // deprecated
1590 1590
 					$object->origin_type = $origin;
1591 1591
 					$object->origin_id = $originid;
1592 1592
 
@@ -1621,7 +1621,7 @@  discard block
 block discarded – undo
1621 1621
 						dol_syslog("Try to find source object origin=".$object->origin." originid=".$object->origin_id." to add lines or deposit lines");
1622 1622
 						$result = $srcobject->fetch($object->origin_id);
1623 1623
 
1624
-						$i = -1;  // Ensure initialised for static analysis, but with invalid idx.
1624
+						$i = -1; // Ensure initialised for static analysis, but with invalid idx.
1625 1625
 						// If deposit invoice - down payment with 1 line (fixed amount or percent)
1626 1626
 						if (GETPOST('type') == Facture::TYPE_DEPOSIT && in_array($typeamount, array('amount', 'variable'))) {
1627 1627
 							// Define the array $amountdeposit
@@ -2024,7 +2024,7 @@  discard block
 block discarded – undo
2024 2024
 				if (!empty($origin) && !empty($originid)) {
2025 2025
 					include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';
2026 2026
 
2027
-					$object->origin = $origin;		// deprecated
2027
+					$object->origin = $origin; // deprecated
2028 2028
 					$object->origin_type = $origin;
2029 2029
 					$object->origin_id = $originid;
2030 2030
 
@@ -2050,7 +2050,7 @@  discard block
 block discarded – undo
2050 2050
 						$line->fk_prev_id = $line->id;
2051 2051
 						$line->fetch_optionals();
2052 2052
 						if (getDolGlobalInt('INVOICE_USE_SITUATION') == 2) {
2053
-							$line->situation_percent = 0;  // New situation percent must be 0 (No cumulative)
2053
+							$line->situation_percent = 0; // New situation percent must be 0 (No cumulative)
2054 2054
 						} else {
2055 2055
 							$line->situation_percent = $line->get_prev_progress($object->id); // get good progress including credit note
2056 2056
 						}
@@ -2167,7 +2167,7 @@  discard block
 block discarded – undo
2167 2167
 		} else {
2168 2168
 			$db->rollback();
2169 2169
 			$action = 'create';
2170
-			$_GET["origin"] = $_POST["origin"];		// Keep GET and POST here ?
2170
+			$_GET["origin"] = $_POST["origin"]; // Keep GET and POST here ?
2171 2171
 			$_GET["originid"] = $_POST["originid"]; // Keep GET and POST here ?
2172 2172
 			setEventMessages($object->error, $object->errors, 'errors');
2173 2173
 		}
@@ -2520,7 +2520,7 @@  discard block
 block discarded – undo
2520 2520
 			 */
2521 2521
 
2522 2522
 			// Margin
2523
-			$fournprice = (int) (GETPOST('fournprice'.$predef) ? GETPOST('fournprice'.$predef) : '');				// This can be id of supplier price, or 'pmpprice' or 'costprice', or 'inputprice', we force to keep ID only
2523
+			$fournprice = (int) (GETPOST('fournprice'.$predef) ? GETPOST('fournprice'.$predef) : ''); // This can be id of supplier price, or 'pmpprice' or 'costprice', or 'inputprice', we force to keep ID only
2524 2524
 			$buyingprice = price2num(GETPOST('buying_price'.$predef) != '' ? GETPOST('buying_price'.$predef) : ''); // If buying_price is '0', we must keep this value
2525 2525
 
2526 2526
 
@@ -2653,7 +2653,7 @@  discard block
 block discarded – undo
2653 2653
 				if ($prod->price_min > $line->subprice) {
2654 2654
 					$price_subprice = price($line->subprice, 0, $outlangs, 1, -1, -1, 'auto');
2655 2655
 					$price_price_min = price($prod->price_min, 0, $outlangs, 1, -1, -1, 'auto');
2656
-					setEventMessages($prod->ref . ' - ' . $prod->label . ' (' . $price_subprice . ' < ' . $price_price_min . ' ' . strtolower($langs->trans("MinPrice")) . ')' . "\n", null, 'warnings');
2656
+					setEventMessages($prod->ref.' - '.$prod->label.' ('.$price_subprice.' < '.$price_price_min.' '.strtolower($langs->trans("MinPrice")).')'."\n", null, 'warnings');
2657 2657
 				} else {
2658 2658
 					setEventMessages($prod->error, $prod->errors, 'errors');
2659 2659
 				}
@@ -2719,7 +2719,7 @@  discard block
 block discarded – undo
2719 2719
 		$localtax2_rate = get_localtax($vat_rate, 2, $object->thirdparty);
2720 2720
 
2721 2721
 		// Add buying price
2722
-		$fournprice = (int) (GETPOST('fournprice') ? GETPOST('fournprice') : '');				// This can be id of supplier price, or 'pmpprice' or 'costprice', or 'inputprice', we force to keep ID only
2722
+		$fournprice = (int) (GETPOST('fournprice') ? GETPOST('fournprice') : ''); // This can be id of supplier price, or 'pmpprice' or 'costprice', or 'inputprice', we force to keep ID only
2723 2723
 		$buyingprice = price2num(GETPOST('buying_price') != '' ? GETPOST('buying_price') : ''); // If buying_price is '0', we must keep this value
2724 2724
 
2725 2725
 		// Prepare a price equivalent for minimum price check
@@ -2762,7 +2762,7 @@  discard block
 block discarded – undo
2762 2762
 		// Define special_code for special lines
2763 2763
 		$special_code = GETPOSTINT('special_code');
2764 2764
 		if ($special_code == 3) {
2765
-			$special_code = 0;	// Options should not exists on invoices
2765
+			$special_code = 0; // Options should not exists on invoices
2766 2766
 		}
2767 2767
 
2768 2768
 		$line = new FactureLigne($db);
@@ -3209,7 +3209,7 @@  discard block
 block discarded – undo
3209 3209
 
3210 3210
 
3211 3211
 	if ($action == 'update_extras' && $permissiontoeditextra) {
3212
-		$object->oldcopy = dol_clone($object, 2);  // @phan-suppress-current-line PhanTypeMismatchProperty
3212
+		$object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty
3213 3213
 
3214 3214
 		$attribute_name = GETPOST('attribute', 'aZ09');
3215 3215
 
@@ -3327,7 +3327,7 @@  discard block
 block discarded – undo
3327 3327
 	$fk_account = GETPOSTINT('fk_account');
3328 3328
 
3329 3329
 	// Load objectsrc
3330
-	$objectsrc = null;  // Initialise
3330
+	$objectsrc = null; // Initialise
3331 3331
 	//$remise_absolue = 0;
3332 3332
 	if (!empty($origin) && !empty($originid)) {
3333 3333
 		// Parse element/subelement (ex: project_task)
@@ -3338,7 +3338,7 @@  discard block
 block discarded – undo
3338 3338
 			$subelement = $regs[2];
3339 3339
 		}
3340 3340
 
3341
-		$dateinvoice = dol_mktime(0, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'), 'tzserver');	// If we enter the 02 january, we need to save the 02 january for server
3341
+		$dateinvoice = dol_mktime(0, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server
3342 3342
 		$date_pointoftax = dol_mktime(0, 0, 0, GETPOSTINT('date_pointoftaxmonth'), GETPOSTINT('date_pointoftaxday'), GETPOSTINT('date_pointoftaxyear'), 'tzserver');
3343 3343
 
3344 3344
 		if ($element == 'project') {
@@ -3416,8 +3416,8 @@  discard block
 block discarded – undo
3416 3416
 				$fk_account         = (!empty($expesrc->fk_account) ? $expesrc->fk_account : (!empty($soc->fk_account) ? $soc->fk_account : 0));
3417 3417
 
3418 3418
 				if (isModEnabled('multicurrency')) {
3419
-					$currency_code 	= (!empty($expesrc->multicurrency_code) ? $expesrc->multicurrency_code : (!empty($soc->multicurrency_code) ? $soc->multicurrency_code : $objectsrc->multicurrency_code));
3420
-					$currency_tx 	= (!empty($expesrc->multicurrency_tx) ? $expesrc->multicurrency_tx : (!empty($soc->multicurrency_tx) ? $soc->multicurrency_tx : $objectsrc->multicurrency_tx));
3419
+					$currency_code = (!empty($expesrc->multicurrency_code) ? $expesrc->multicurrency_code : (!empty($soc->multicurrency_code) ? $soc->multicurrency_code : $objectsrc->multicurrency_code));
3420
+					$currency_tx = (!empty($expesrc->multicurrency_tx) ? $expesrc->multicurrency_tx : (!empty($soc->multicurrency_tx) ? $soc->multicurrency_tx : $objectsrc->multicurrency_tx));
3421 3421
 				}
3422 3422
 
3423 3423
 				// replicate input reason
@@ -3517,7 +3517,7 @@  discard block
 block discarded – undo
3517 3517
 	print '<form name="add" action="'.$_SERVER["PHP_SELF"].'" method="POST" id="formtocreate" name="formtocreate">';
3518 3518
 	print '<input type="hidden" name="token" value="'.newToken().'">';
3519 3519
 	print '<input type="hidden" name="action" id="formtocreateaction" value="add">';
3520
-	print '<input type="hidden" name="changecompany" value="0">';	// will be set to 1 by javascript so we know post is done after a company change
3520
+	print '<input type="hidden" name="changecompany" value="0">'; // will be set to 1 by javascript so we know post is done after a company change
3521 3521
 	if ($soc->id > 0) {
3522 3522
 		print '<input type="hidden" name="socid" value="'.$soc->id.'">'."\n";
3523 3523
 	}
@@ -3699,7 +3699,7 @@  discard block
 block discarded – undo
3699 3699
 			print $form->selectarray('typestandard', $arraylist, GETPOST('typestandard', 'aZ09'), 0, 0, 0, '', 1);
3700 3700
 			print '</td>';*/
3701 3701
 			if (!getDolGlobalInt('INVOICE_DEPOSIT_INVOICE_ONLY_SAME_LINES')) {
3702
-				print '<span class="opacitymedium marginleftonly">' . $langs->trans('PercentOfOriginalObject') . '</span>:<input class="right" placeholder="100%" type="text" id="valuestandardinvoice" name="valuestandardinvoice" size="3" value="' . (GETPOSTISSET('valuestandardinvoice') ? GETPOST('valuestandardinvoice', 'alpha') : '100%') . '"/>';
3702
+				print '<span class="opacitymedium marginleftonly">'.$langs->trans('PercentOfOriginalObject').'</span>:<input class="right" placeholder="100%" type="text" id="valuestandardinvoice" name="valuestandardinvoice" size="3" value="'.(GETPOSTISSET('valuestandardinvoice') ? GETPOST('valuestandardinvoice', 'alpha') : '100%').'"/>';
3703 3703
 			}
3704 3704
 		}
3705 3705
 		print '</div></div>'."\n";
@@ -4052,8 +4052,8 @@  discard block
 block discarded – undo
4052 4052
 		if ($socid > 0) {
4053 4053
 			print '<tr><td>'.$langs->trans('DiscountStillRemaining').'</td><td colspan="2">';
4054 4054
 
4055
-			$thirdparty = $soc;	// used by object_discounts.tpl.php
4056
-			$discount_type = 0;	// used by object_discounts.tpl.php
4055
+			$thirdparty = $soc; // used by object_discounts.tpl.php
4056
+			$discount_type = 0; // used by object_discounts.tpl.php
4057 4057
 			$backtopage = $_SERVER["PHP_SELF"].'?socid='.$thirdparty->id.'&action='.$action.'&origin='.urlencode((string) (GETPOST('origin'))).'&originid='.urlencode((string) (GETPOSTINT('originid')));
4058 4058
 			include DOL_DOCUMENT_ROOT.'/core/tpl/object_discounts.tpl.php';
4059 4059
 
@@ -4094,7 +4094,7 @@  discard block
 block discarded – undo
4094 4094
 			if (empty($retained_warranty)) {
4095 4095
 				if ($objectsrc !== null && property_exists($objectsrc, 'retained_warranty') && !empty($objectsrc->retained_warranty)) { // use previous situation value
4096 4096
 					// Facture->retained_warranty  (does not exist on Expedition)
4097
-					$retained_warranty = $objectsrc->retained_warranty;  // @phan-suppress-current-line PhanUndeclaredProperty
4097
+					$retained_warranty = $objectsrc->retained_warranty; // @phan-suppress-current-line PhanUndeclaredProperty
4098 4098
 				}
4099 4099
 			}
4100 4100
 			$retained_warranty_js_default = !empty($retained_warranty) ? $retained_warranty : getDolGlobalString('INVOICE_SITUATION_DEFAULT_RETAINED_WARRANTY_PERCENT');
@@ -4595,7 +4595,7 @@  discard block
 block discarded – undo
4595 4595
 		$nbMandated = 0;
4596 4596
 		foreach ($object->lines as $line) {
4597 4597
 			$res = $line->fetch_product();
4598
-			if ($res  > 0) {
4598
+			if ($res > 0) {
4599 4599
 				if ($line->product->isService() && $line->product->isMandatoryPeriod() && (empty($line->date_start) || empty($line->date_end))) {
4600 4600
 					$nbMandated++;
4601 4601
 					break;
@@ -4812,7 +4812,7 @@  discard block
 block discarded – undo
4812 4812
 	}
4813 4813
 	// Ref customer
4814 4814
 	$morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_customer, $object, (int) $usercancreate, 'string', '', 0, 1);
4815
-	$morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_customer, $object, (int) $usercancreate, 'string'.(getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') ? ':' . getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1);
4815
+	$morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_customer, $object, (int) $usercancreate, 'string'.(getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') ? ':'.getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1);
4816 4816
 	// Thirdparty
4817 4817
 	$morehtmlref .= '<br>'.$object->thirdparty->getNomUrl(1, 'customer');
4818 4818
 	if (!getDolGlobalString('MAIN_DISABLE_OTHER_LINK') && $object->thirdparty->id > 0) {
@@ -5253,45 +5253,45 @@  discard block
 block discarded – undo
5253 5253
 		}
5254 5254
 		print '<tr>';
5255 5255
 		// Amount HT
5256
-		print '<td class="titlefieldmiddle">' . $langs->trans('AmountHT') . '</td>';
5257
-		print '<td class="nowrap amountcard right">' . price($sign * $object->total_ht, 0, $langs, 0, -1, -1, $conf->currency) . '</td>';
5256
+		print '<td class="titlefieldmiddle">'.$langs->trans('AmountHT').'</td>';
5257
+		print '<td class="nowrap amountcard right">'.price($sign * $object->total_ht, 0, $langs, 0, -1, -1, $conf->currency).'</td>';
5258 5258
 		if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
5259 5259
 			// Multicurrency Amount HT
5260
-			print '<td class="nowrap amountcard right">' . price($sign * $object->multicurrency_total_ht, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
5260
+			print '<td class="nowrap amountcard right">'.price($sign * $object->multicurrency_total_ht, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
5261 5261
 		}
5262 5262
 		print '</tr>';
5263 5263
 
5264 5264
 		print '<tr>';
5265 5265
 		// Amount VAT
5266
-		print '<td>' . $langs->trans('AmountVAT') . '</td>';
5267
-		print '<td class="nowrap amountcard right">' . price($sign * $object->total_tva, 0, $langs, 0, -1, -1, $conf->currency) . '</td>';
5266
+		print '<td>'.$langs->trans('AmountVAT').'</td>';
5267
+		print '<td class="nowrap amountcard right">'.price($sign * $object->total_tva, 0, $langs, 0, -1, -1, $conf->currency).'</td>';
5268 5268
 		if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
5269 5269
 			// Multicurrency Amount VAT
5270
-			print '<td class="nowrap amountcard right">' . price($sign * $object->multicurrency_total_tva, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
5270
+			print '<td class="nowrap amountcard right">'.price($sign * $object->multicurrency_total_tva, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
5271 5271
 		}
5272 5272
 		print '</tr>';
5273 5273
 
5274 5274
 		// Amount Local Taxes
5275 5275
 		if (($mysoc->localtax1_assuj == "1" && $mysoc->useLocalTax(1)) || $object->total_localtax1 != 0) {
5276 5276
 			print '<tr>';
5277
-			print '<td class="titlefieldmiddle">' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td>';
5278
-			print '<td class="nowrap amountcard right">' . price($sign * $object->total_localtax1, 0, $langs, 0, -1, -1, $conf->currency) . '</td>';
5277
+			print '<td class="titlefieldmiddle">'.$langs->transcountry("AmountLT1", $mysoc->country_code).'</td>';
5278
+			print '<td class="nowrap amountcard right">'.price($sign * $object->total_localtax1, 0, $langs, 0, -1, -1, $conf->currency).'</td>';
5279 5279
 			if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
5280 5280
 				$object->multicurrency_total_localtax1 = (float) price2num($object->total_localtax1 * $object->multicurrency_tx, 'MT');
5281 5281
 
5282
-				print '<td class="nowrap amountcard right">' . price($sign * $object->multicurrency_total_localtax1, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
5282
+				print '<td class="nowrap amountcard right">'.price($sign * $object->multicurrency_total_localtax1, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
5283 5283
 			}
5284 5284
 			print '</tr>';
5285 5285
 		}
5286 5286
 
5287 5287
 		if (($mysoc->localtax2_assuj == "1" && $mysoc->useLocalTax(2)) || $object->total_localtax2 != 0) {
5288 5288
 			print '<tr>';
5289
-			print '<td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td>';
5290
-			print '<td class="nowrap amountcard right">' . price($sign * $object->total_localtax2, 0, $langs, 0, -1, -1, $conf->currency) . '</td>';
5289
+			print '<td>'.$langs->transcountry("AmountLT2", $mysoc->country_code).'</td>';
5290
+			print '<td class="nowrap amountcard right">'.price($sign * $object->total_localtax2, 0, $langs, 0, -1, -1, $conf->currency).'</td>';
5291 5291
 			if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
5292 5292
 				$object->multicurrency_total_localtax2 = (float) price2num($object->total_localtax2 * $object->multicurrency_tx, 'MT');
5293 5293
 
5294
-				print '<td class="nowrap amountcard right">' . price($sign * $object->multicurrency_total_localtax2, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
5294
+				print '<td class="nowrap amountcard right">'.price($sign * $object->multicurrency_total_localtax2, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
5295 5295
 			}
5296 5296
 			print '</tr>';
5297 5297
 		}
@@ -5351,11 +5351,11 @@  discard block
 block discarded – undo
5351 5351
 
5352 5352
 		print '<tr>';
5353 5353
 		// Amount TTC
5354
-		print '<td>' . $langs->trans('AmountTTC') . '</td>';
5355
-		print '<td class="nowrap amountcard right">' . price($sign * $object->total_ttc, 0, $langs, 0, -1, -1, $conf->currency) . '</td>';
5354
+		print '<td>'.$langs->trans('AmountTTC').'</td>';
5355
+		print '<td class="nowrap amountcard right">'.price($sign * $object->total_ttc, 0, $langs, 0, -1, -1, $conf->currency).'</td>';
5356 5356
 		if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
5357 5357
 			// Multicurrency Amount TTC
5358
-			print '<td class="nowrap amountcard right">' . price($sign * $object->multicurrency_total_ttc, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
5358
+			print '<td class="nowrap amountcard right">'.price($sign * $object->multicurrency_total_ttc, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
5359 5359
 		}
5360 5360
 		print '</tr>';
5361 5361
 
@@ -5985,10 +5985,10 @@  discard block
 block discarded – undo
5985 5985
 						if (!$objectidnext && $object->is_last_in_cycle()) {
5986 5986
 							if ($usercanunvalidate) {
5987 5987
 								unset($params['attr']['title']);
5988
-								print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER['PHP_SELF'] . '?facid=' . $object->id . '&action=modif&token=' . newToken(), '', true, $params);
5988
+								print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER['PHP_SELF'].'?facid='.$object->id.'&action=modif&token='.newToken(), '', true, $params);
5989 5989
 							} else {
5990 5990
 								$params['attr']['title'] = $langs->trans('NotEnoughPermissions');
5991
-								print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER['PHP_SELF'] . '?facid=' . $object->id . '&action=modif&token=' . newToken(), '', false, $params);
5991
+								print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER['PHP_SELF'].'?facid='.$object->id.'&action=modif&token='.newToken(), '', false, $params);
5992 5992
 							}
5993 5993
 						} elseif (!$object->is_last_in_cycle()) {
5994 5994
 							$params['attr']['title'] = $langs->trans('NotLastInCycle');
@@ -6029,7 +6029,7 @@  discard block
 block discarded – undo
6029 6029
 					$langs->load("contracts");
6030 6030
 
6031 6031
 					if ($usercancreatecontract) {
6032
-						print '<a class="butAction" href="' . DOL_URL_ROOT . '/contrat/card.php?action=create&amp;origin=' . $object->element . '&amp;originid=' . $object->id . '&amp;socid=' . $object->socid . '">' . $langs->trans('AddContract') . '</a>';
6032
+						print '<a class="butAction" href="'.DOL_URL_ROOT.'/contrat/card.php?action=create&amp;origin='.$object->element.'&amp;originid='.$object->id.'&amp;socid='.$object->socid.'">'.$langs->trans('AddContract').'</a>';
6033 6033
 					}
6034 6034
 				}
6035 6035
 			}
@@ -6255,7 +6255,7 @@  discard block
 block discarded – undo
6255 6255
 			if ($usercandelete || ($usercancreate && $isErasable == 1)) {	// isErasable = 1 means draft with temporary ref (draft can always be deleted with no need of permissions)
6256 6256
 				$enableDelete = false;
6257 6257
 				$deleteHref = '#';
6258
-				if ($isErasable > 0 && ! $objectidnext) {
6258
+				if ($isErasable > 0 && !$objectidnext) {
6259 6259
 					$deleteHref = $_SERVER["PHP_SELF"].'?facid='.$object->id.'&action=delete&token='.newToken();
6260 6260
 					$enableDelete = true;
6261 6261
 				}
Please login to merge, or discard this patch.
htdocs/asset/accountancy_codes.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -25,10 +25,10 @@  discard block
 block discarded – undo
25 25
 
26 26
 // Load Dolibarr environment
27 27
 require '../main.inc.php';
28
-require_once DOL_DOCUMENT_ROOT . '/core/lib/asset.lib.php';
29
-require_once DOL_DOCUMENT_ROOT . '/asset/class/asset.class.php';
30
-require_once DOL_DOCUMENT_ROOT . '/asset/class/assetaccountancycodes.class.php';
31
-require_once DOL_DOCUMENT_ROOT . '/asset/class/assetdepreciationoptions.class.php';
28
+require_once DOL_DOCUMENT_ROOT.'/core/lib/asset.lib.php';
29
+require_once DOL_DOCUMENT_ROOT.'/asset/class/asset.class.php';
30
+require_once DOL_DOCUMENT_ROOT.'/asset/class/assetaccountancycodes.class.php';
31
+require_once DOL_DOCUMENT_ROOT.'/asset/class/assetdepreciationoptions.class.php';
32 32
 
33 33
 /**
34 34
  * @var Conf $conf
@@ -54,15 +54,15 @@  discard block
 block discarded – undo
54 54
 $assetaccountancycodes = new AssetAccountancyCodes($db);
55 55
 $assetdepreciationoptions = new AssetDepreciationOptions($db);
56 56
 $extrafields = new ExtraFields($db);
57
-$diroutputmassaction = $conf->asset->dir_output . '/temp/massgeneration/' . $user->id;
57
+$diroutputmassaction = $conf->asset->dir_output.'/temp/massgeneration/'.$user->id;
58 58
 $hookmanager->initHooks(array('assetaccountancycodes', 'globalcard')); // Note that conf->hooks_modules contains array
59 59
 // Fetch optionals attributes and labels
60 60
 $extrafields->fetch_name_optionals_label($object->table_element);
61 61
 
62 62
 // Load object
63
-include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals
63
+include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals
64 64
 if ($id > 0 || !empty($ref)) {
65
-	$upload_dir = $conf->asset->multidir_output[isset($object->entity) ? $object->entity : 1] . "/" . $object->id;
65
+	$upload_dir = $conf->asset->multidir_output[isset($object->entity) ? $object->entity : 1]."/".$object->id;
66 66
 }
67 67
 
68 68
 $permissiontoadd = $user->hasRight('asset', 'write'); // Used by the include of actions_addupdatedelete.inc.php
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
 			$action = 'edit';
135 135
 		} else {
136 136
 			setEventMessage($langs->trans('RecordSaved'));
137
-			header("Location: " . $_SERVER["PHP_SELF"] . '?id=' . $object->id);
137
+			header("Location: ".$_SERVER["PHP_SELF"].'?id='.$object->id);
138 138
 			exit;
139 139
 		}
140 140
 	}
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
 
157 157
 	// Object card
158 158
 	// ------------------------------------------------------------
159
-	$linkback = '<a href="' . DOL_URL_ROOT . '/asset/list.php?restore_lastsearch_values=1">' . $langs->trans("BackToList") . '</a>';
159
+	$linkback = '<a href="'.DOL_URL_ROOT.'/asset/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
160 160
 
161 161
 	$morehtmlref = '<div class="refidno">';
162 162
 	$morehtmlref .= '</div>';
@@ -170,29 +170,29 @@  discard block
 block discarded – undo
170 170
 	print '<br>';
171 171
 
172 172
 	if ($action == 'edit') {
173
-		print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '">';
174
-		print '<input type="hidden" name="token" value="' . newToken() . '">';
173
+		print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'">';
174
+		print '<input type="hidden" name="token" value="'.newToken().'">';
175 175
 		print '<input type="hidden" name="action" value="update">';
176 176
 		if ($backtopage) {
177
-			print '<input type="hidden" name="backtopage" value="' . $backtopage . '">';
177
+			print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
178 178
 		}
179 179
 		if ($backtopageforcancel) {
180
-			print '<input type="hidden" name="backtopageforcancel" value="' . $backtopageforcancel . '">';
180
+			print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">';
181 181
 		}
182 182
 
183
-		include DOL_DOCUMENT_ROOT . '/asset/tpl/accountancy_codes_edit.tpl.php';
183
+		include DOL_DOCUMENT_ROOT.'/asset/tpl/accountancy_codes_edit.tpl.php';
184 184
 
185 185
 		print $form->buttonsSaveCancel();
186 186
 
187 187
 		print '</form>';
188 188
 	} else {
189
-		include DOL_DOCUMENT_ROOT . '/asset/tpl/accountancy_codes_view.tpl.php';
189
+		include DOL_DOCUMENT_ROOT.'/asset/tpl/accountancy_codes_view.tpl.php';
190 190
 	}
191 191
 
192 192
 	print dol_get_fiche_end();
193 193
 
194 194
 	if ($action != 'edit') {
195
-		print '<div class="tabsAction">' . "\n";
195
+		print '<div class="tabsAction">'."\n";
196 196
 		$parameters = array();
197 197
 		$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
198 198
 		if ($reshook < 0) {
@@ -201,10 +201,10 @@  discard block
 block discarded – undo
201 201
 
202 202
 		if (empty($reshook)) {
203 203
 			if ($object->status == $object::STATUS_DRAFT/* && !empty($object->enabled_modes)*/) {
204
-				print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=edit&token=' . newToken(), '', $permissiontoadd);
204
+				print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit&token='.newToken(), '', $permissiontoadd);
205 205
 			}
206 206
 		}
207
-		print '</div>' . "\n";
207
+		print '</div>'."\n";
208 208
 	}
209 209
 }
210 210
 
Please login to merge, or discard this patch.
htdocs/asset/depreciation_options.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -25,9 +25,9 @@  discard block
 block discarded – undo
25 25
 
26 26
 // Load Dolibarr environment
27 27
 require '../main.inc.php';
28
-require_once DOL_DOCUMENT_ROOT . '/core/lib/asset.lib.php';
29
-require_once DOL_DOCUMENT_ROOT . '/asset/class/asset.class.php';
30
-require_once DOL_DOCUMENT_ROOT . '/asset/class/assetdepreciationoptions.class.php';
28
+require_once DOL_DOCUMENT_ROOT.'/core/lib/asset.lib.php';
29
+require_once DOL_DOCUMENT_ROOT.'/asset/class/asset.class.php';
30
+require_once DOL_DOCUMENT_ROOT.'/asset/class/assetdepreciationoptions.class.php';
31 31
 
32 32
 /**
33 33
  * @var Conf $conf
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 $action = GETPOST('action', 'aZ09');
47 47
 $cancel = GETPOST('cancel', 'aZ09');
48 48
 $backtopage = GETPOST('backtopage', 'alpha');
49
-$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');	// if not set, $backtopage will be used
49
+$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); // if not set, $backtopage will be used
50 50
 
51 51
 // Initialize a technical objects
52 52
 $object = new Asset($db);
@@ -58,9 +58,9 @@  discard block
 block discarded – undo
58 58
 $extrafields->fetch_name_optionals_label($object->table_element);
59 59
 
60 60
 // Load object
61
-include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals
61
+include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals
62 62
 if ($id > 0 || !empty($ref)) {
63
-	$upload_dir = $conf->asset->multidir_output[isset($object->entity) ? $object->entity : 1] . "/" . $object->id;
63
+	$upload_dir = $conf->asset->multidir_output[isset($object->entity) ? $object->entity : 1]."/".$object->id;
64 64
 }
65 65
 
66 66
 $permissiontoadd = $user->hasRight('asset', 'write'); // Used by the include of actions_addupdatedelete.inc.php
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
 			$action = 'edit';
130 130
 		} else {
131 131
 			setEventMessage($langs->trans('RecordSaved'));
132
-			header("Location: " . $_SERVER["PHP_SELF"] . '?id=' . $object->id);
132
+			header("Location: ".$_SERVER["PHP_SELF"].'?id='.$object->id);
133 133
 			exit;
134 134
 		}
135 135
 	}
@@ -165,29 +165,29 @@  discard block
 block discarded – undo
165 165
 	print '<br>';
166 166
 
167 167
 	if ($action == 'edit') {
168
-		print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '">';
169
-		print '<input type="hidden" name="token" value="' . newToken() . '">';
168
+		print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'">';
169
+		print '<input type="hidden" name="token" value="'.newToken().'">';
170 170
 		print '<input type="hidden" name="action" value="update">';
171 171
 		if ($backtopage) {
172
-			print '<input type="hidden" name="backtopage" value="' . $backtopage . '">';
172
+			print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
173 173
 		}
174 174
 		if ($backtopageforcancel) {
175
-			print '<input type="hidden" name="backtopageforcancel" value="' . $backtopageforcancel . '">';
175
+			print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">';
176 176
 		}
177 177
 
178
-		include DOL_DOCUMENT_ROOT . '/asset/tpl/depreciation_options_edit.tpl.php';
178
+		include DOL_DOCUMENT_ROOT.'/asset/tpl/depreciation_options_edit.tpl.php';
179 179
 
180 180
 		print $form->buttonsSaveCancel();
181 181
 
182 182
 		print '</form>';
183 183
 	} else {
184
-		include DOL_DOCUMENT_ROOT . '/asset/tpl/depreciation_options_view.tpl.php';
184
+		include DOL_DOCUMENT_ROOT.'/asset/tpl/depreciation_options_view.tpl.php';
185 185
 	}
186 186
 
187 187
 	print dol_get_fiche_end();
188 188
 
189 189
 	if ($action != 'edit') {
190
-		print '<div class="tabsAction">' . "\n";
190
+		print '<div class="tabsAction">'."\n";
191 191
 		$parameters = array();
192 192
 		$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
193 193
 		if ($reshook < 0) {
@@ -196,10 +196,10 @@  discard block
 block discarded – undo
196 196
 
197 197
 		if (empty($reshook)) {
198 198
 			if ($object->status == $object::STATUS_DRAFT/* && !empty($object->enabled_modes)*/) {
199
-				print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=edit&token=' . newToken(), '', $permissiontoadd);
199
+				print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit&token='.newToken(), '', $permissiontoadd);
200 200
 			}
201 201
 		}
202
-		print '</div>' . "\n";
202
+		print '</div>'."\n";
203 203
 	}
204 204
 }
205 205
 
Please login to merge, or discard this patch.
htdocs/asset/card.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 		}
129 129
 	}
130 130
 
131
-	$object->oldcopy = dol_clone($object, 2);  // @phan-suppress-current-line PhanTypeMismatchProperty
131
+	$object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty
132 132
 	$triggermodname = 'ASSET_MODIFY'; // Name of trigger action code to execute when we modify record
133 133
 
134 134
 	// Action dispose object
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
 	}
200 200
 	if (GETPOSTISSET('supplier_invoice_id')) {
201 201
 		$object->fields['supplier_invoice_id'] = array('type' => 'integer:FactureFournisseur:fourn/class/fournisseur.facture.class.php:1:entity IN (__SHARED_ENTITIES__)', 'label' => 'SupplierInvoice', 'enabled' => '1', 'noteditable' => 1, 'position' => 280, 'notnull' => 0, 'visible' => 1, 'index' => 1, 'validate' => '1',);
202
-		print '<input type="hidden" name="supplier_invoice_id" value="' . GETPOSTINT('supplier_invoice_id') . '">';
202
+		print '<input type="hidden" name="supplier_invoice_id" value="'.GETPOSTINT('supplier_invoice_id').'">';
203 203
 	}
204 204
 
205 205
 	print dol_get_fiche_head(array(), '');
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
 
285 285
 		$text = $langs->trans('ConfirmValidateAsset', $numref);
286 286
 		if (isModEnabled('notification')) {
287
-			require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php';
287
+			require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php';
288 288
 			$notify = new Notify($db);
289 289
 			$text .= '<br>';
290 290
 			$text .= $notify->confirmMessage('ASSET_VALIDATE', 0, $object);
@@ -326,7 +326,7 @@  discard block
 block discarded – undo
326 326
 			array('type' => 'checkbox', 'name' => 'disposal_depreciated', 'label' => $langs->trans("AssetDisposalDepreciated"), 'value' => $disposal_depreciated),
327 327
 			array('type' => 'checkbox', 'name' => 'disposal_subject_to_vat', 'label' => $langs->trans("AssetDisposalSubjectToVat"), 'value' => $disposal_subject_to_vat),
328 328
 		);
329
-		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('AssetDisposal'), $langs->trans('AssetConfirmDisposalAsk', $object->ref . ' - ' . $object->label), 'confirm_disposal', $formquestion, 'yes', 1, 350);
329
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('AssetDisposal'), $langs->trans('AssetConfirmDisposalAsk', $object->ref.' - '.$object->label), 'confirm_disposal', $formquestion, 'yes', 1, 350);
330 330
 	}
331 331
 
332 332
 	// Confirmation of reopen
@@ -382,7 +382,7 @@  discard block
 block discarded – undo
382 382
 	print '<table class="border centpercent tableforfield">'."\n";
383 383
 
384 384
 	// Common attributes
385
-	$keyforbreak = 'date_acquisition';	// We change column just before this field
385
+	$keyforbreak = 'date_acquisition'; // We change column just before this field
386 386
 	//unset($object->fields['fk_project']);				// Hide field already shown in banner
387 387
 	//unset($object->fields['fk_soc']);					// Hide field already shown in banner
388 388
 	include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php';
@@ -400,7 +400,7 @@  discard block
 block discarded – undo
400 400
 
401 401
 	// Buttons for actions
402 402
 	if ($action != 'presend' && $action != 'editline') {
403
-		print '<div class="tabsAction">' . "\n";
403
+		print '<div class="tabsAction">'."\n";
404 404
 		$parameters = array();
405 405
 		$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
406 406
 		if ($reshook < 0) {
@@ -410,7 +410,7 @@  discard block
 block discarded – undo
410 410
 		if (empty($reshook)) {
411 411
 			// Send
412 412
 			if (empty($user->socid)) {
413
-				print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=presend&mode=init&token=' . newToken() . '#formmailbeforetitle');
413
+				print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&mode=init&token='.newToken().'#formmailbeforetitle');
414 414
 			}
415 415
 
416 416
 			// Back to draft
@@ -422,30 +422,30 @@  discard block
 block discarded – undo
422 422
 
423 423
 			// Modify
424 424
 			if ($object->status == $object::STATUS_DRAFT) {
425
-				print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=edit&token=' . newToken(), '', $permissiontoadd);
425
+				print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit&token='.newToken(), '', $permissiontoadd);
426 426
 			}
427 427
 
428 428
 			// Validate
429 429
 			if ($object->status == $object::STATUS_DRAFT) {
430
-				print dolGetButtonAction($langs->trans('Validate'), '', 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=validate&token=' . newToken(), '', $permissiontoadd);
430
+				print dolGetButtonAction($langs->trans('Validate'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=validate&token='.newToken(), '', $permissiontoadd);
431 431
 			}
432 432
 
433 433
 			if ($object->status == $object::STATUS_VALIDATED) {
434
-				print dolGetButtonAction($langs->trans('AssetDisposal'), '', 'default', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=disposal&token=' . newToken(), '', $permissiontoadd);
434
+				print dolGetButtonAction($langs->trans('AssetDisposal'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=disposal&token='.newToken(), '', $permissiontoadd);
435 435
 			}
436 436
 
437 437
 			// Re-open
438 438
 			if ($permissiontoadd && $object->status == $object::STATUS_DISPOSED) {
439
-				print dolGetButtonAction($langs->trans('ReOpen'), '', 'default', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=reopen&token=' . newToken(), '', $permissiontoadd);
439
+				print dolGetButtonAction($langs->trans('ReOpen'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=reopen&token='.newToken(), '', $permissiontoadd);
440 440
 			}
441 441
 
442 442
 			// Clone
443 443
 			//print dolGetButtonAction($langs->trans('ToClone'), '', 'default', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=clone&token=' . newToken(), '', false && $permissiontoadd);
444 444
 
445 445
 			// Delete (need delete permission, or if draft, just need create/modify permission)
446
-			print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=delete&token=' . newToken(), '', $permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd));
446
+			print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=delete&token='.newToken(), '', $permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd));
447 447
 		}
448
-		print '</div>' . "\n";
448
+		print '</div>'."\n";
449 449
 	}
450 450
 
451 451
 	// Select mail models is same action as presend
Please login to merge, or discard this patch.
htdocs/adherents/card.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 $action = GETPOST('action', 'aZ09');
67 67
 $cancel = GETPOST('cancel', 'alpha');
68 68
 $backtopage = GETPOST('backtopage', 'alpha');
69
-$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');	// if not set, $backtopage will be used
69
+$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); // if not set, $backtopage will be used
70 70
 $confirm = GETPOST('confirm', 'alpha');
71 71
 $rowid = GETPOSTINT('rowid');
72 72
 $id = GETPOST('id') ? GETPOSTINT('id') : $rowid;
@@ -310,7 +310,7 @@  discard block
 block discarded – undo
310 310
 		}
311 311
 		// Create new object
312 312
 		if ($result > 0 && !$error) {
313
-			$object->oldcopy = dol_clone($object, 2);  // @phan-suppress-current-line PhanTypeMismatchProperty
313
+			$object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty
314 314
 
315 315
 			// Change values
316 316
 			$object->civility_id = trim(GETPOST("civility_id", 'alphanohtml'));
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
 			$object->gender      = trim(GETPOST("gender", 'alphanohtml'));
320 320
 			$object->login       = trim(GETPOST("login", 'alphanohtml'));
321 321
 			if (GETPOSTISSET('pass')) {
322
-				$object->pass        = trim(GETPOST("pass", 'password'));	// For password, we must use 'none'
322
+				$object->pass = trim(GETPOST("pass", 'password')); // For password, we must use 'none'
323 323
 			}
324 324
 
325 325
 			$object->societe     = trim(GETPOST("societe", 'alphanohtml')); // deprecated
@@ -374,10 +374,10 @@  discard block
 block discarded – undo
374 374
 			}
375 375
 
376 376
 			// Check if we need to also synchronize password information
377
-			$nosyncuserpass = 1;	// no by default
377
+			$nosyncuserpass = 1; // no by default
378 378
 			if (GETPOSTISSET('pass')) {
379 379
 				if ($object->user_id) {	// If member is linked to a user
380
-					$nosyncuserpass = 0;	// We may try to sync password
380
+					$nosyncuserpass = 0; // We may try to sync password
381 381
 					if ($user->id == $object->user_id) {
382 382
 						if (!$user->hasRight('user', 'self', 'password')) {
383 383
 							$nosyncuserpass = 1; // Disable synchronizing
@@ -487,7 +487,7 @@  discard block
 block discarded – undo
487 487
 		$email = preg_replace('/\s+/', '', GETPOST("member_email", 'aZ09arobase'));
488 488
 		$url = trim(GETPOST('url', 'custom', 0, FILTER_SANITIZE_URL));
489 489
 		$login = GETPOST("member_login", 'alphanohtml');
490
-		$pass = GETPOST("password", 'password');	// For password, we use 'none'
490
+		$pass = GETPOST("password", 'password'); // For password, we use 'none'
491 491
 		$photo = GETPOST("photo", 'alphanohtml');
492 492
 		$morphy = GETPOST("morphy", 'alphanohtml');
493 493
 		$public = GETPOSTINT("public");
@@ -867,7 +867,7 @@  discard block
 block discarded – undo
867 867
 	}
868 868
 
869 869
 	if ($action == 'update_extras' && $permissiontoeditextra) {
870
-		$object->oldcopy = dol_clone($object, 2);  // @phan-suppress-current-line PhanTypeMismatchProperty
870
+		$object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty
871 871
 		$attribute_name = GETPOST('attribute', 'aZ09');
872 872
 
873 873
 		// Fill array 'array_options' with data from update form
@@ -1367,7 +1367,7 @@  discard block
 block discarded – undo
1367 1367
 			$maxfilesizearray = getMaxFileSizeArray();
1368 1368
 			$maxmin = $maxfilesizearray['maxmin'];
1369 1369
 			if ($maxmin > 0) {
1370
-				print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">';	// MAX_FILE_SIZE must precede the field type=file
1370
+				print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file
1371 1371
 			}
1372 1372
 			print '<input type="file" class="flat" name="photo" id="photoinput">';
1373 1373
 			print '</td></tr>';
@@ -1616,7 +1616,7 @@  discard block
 block discarded – undo
1616 1616
 
1617 1617
 			if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
1618 1618
 				$subject = (string) $arraydefaultmessage->topic;
1619
-				$msg	 = (string) $arraydefaultmessage->content;
1619
+				$msg = (string) $arraydefaultmessage->content;
1620 1620
 			}
1621 1621
 
1622 1622
 			$substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $object);
Please login to merge, or discard this patch.