Completed
Branch develop (c31049)
by
unknown
23:57
created
htdocs/accountancy/admin/categories.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -125,7 +125,7 @@
 block discarded – undo
125 125
 	$arraykeyvalue = array();
126 126
 	foreach ($accountingcategory->lines_cptbk as $key => $val) {
127 127
 		$doc_ref = !empty($val->doc_ref) ? $val->doc_ref : '';
128
-		$arraykeyvalue[length_accountg($val->numero_compte)] = length_accountg($val->numero_compte) . ' - ' . $val->label_compte . ($doc_ref ? ' '.$doc_ref : '');
128
+		$arraykeyvalue[length_accountg($val->numero_compte)] = length_accountg($val->numero_compte).' - '.$val->label_compte.($doc_ref ? ' '.$doc_ref : '');
129 129
 	}
130 130
 
131 131
 	if (is_array($accountingcategory->lines_cptbk) && count($accountingcategory->lines_cptbk) > 0) {
Please login to merge, or discard this patch.
dev/tools/phan/config.php 1 patch
Spacing   +70 added lines, -70 removed lines patch added patch discarded remove patch
@@ -79,12 +79,12 @@  discard block
 block discarded – undo
79 79
 	'bom' => 'Bom',
80 80
 	'bookcal' => 'BookCal',
81 81
 	'bookmark' => 'Bookmark',
82
-	'cashdesk' => null,  // TODO: fill in proper class
82
+	'cashdesk' => null, // TODO: fill in proper class
83 83
 	'category' => 'Categorie',
84 84
 	'clicktodial' => 'ClickToDial',
85 85
 	'collab' => 'Collab',
86 86
 	'comptabilite' => 'Comptabilite',
87
-	'contact' => null,  // TODO: fill in proper class
87
+	'contact' => null, // TODO: fill in proper class
88 88
 	'contract' => 'Contrat',
89 89
 	'cron' => 'Cron',
90 90
 	'datapolicy' => 'DataPolicy',
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 	'don' => 'Don',
97 97
 	'dynamicprices' => 'DynamicPrices',
98 98
 	'ecm' => 'ECM',
99
-	'ecotax' => null,  // TODO: External module ?
99
+	'ecotax' => null, // TODO: External module ?
100 100
 	'emailcollector' => 'EmailCollector',
101 101
 	'eventorganization' => 'EventOrganization',
102 102
 	'expensereport' => 'ExpenseReport',
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 	'fournisseur' => 'Fournisseur',
108 108
 	'ftp' => 'FTP',
109 109
 	'geoipmaxmind' => 'GeoIPMaxmind',
110
-	'google' => null,  // External ?
110
+	'google' => null, // External ?
111 111
 	'gravatar' => 'Gravatar',
112 112
 	'holiday' => 'Holiday',
113 113
 	'hrm' => 'HRM',
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
 	'ldap' => 'Ldap',
122 122
 	'loan' => 'Loan',
123 123
 	'mailing' => 'Mailing',
124
-	'mailman' => null,  // Same module as mailmanspip -> MailmanSpip ??
124
+	'mailman' => null, // Same module as mailmanspip -> MailmanSpip ??
125 125
 	'mailmanspip' => 'MailmanSpip',
126 126
 	'margin' => 'Margin',
127 127
 	'member' => 'Adherent',
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
 	'notification' => 'Notification',
135 135
 	'numberwords' => null, // Not provided by default, no module tests
136 136
 	'oauth' => 'OAuth',
137
-	'openstreetmap' => null,  // External module?
137
+	'openstreetmap' => null, // External module?
138 138
 	'opensurvey' => 'OpenSurvey',
139 139
 	'order' => 'Commande',
140 140
 	'partnership' => 'Partnership',
@@ -161,8 +161,8 @@  discard block
 block discarded – undo
161 161
 	'stock' => 'Stock',
162 162
 	'stocktransfer' => 'StockTransfer',
163 163
 	'stripe' => 'Stripe',
164
-	'supplier_invoice' => null,  // Special case, uses invoice
165
-	'supplier_order' => null,  // Special case, uses invoice
164
+	'supplier_invoice' => null, // Special case, uses invoice
165
+	'supplier_order' => null, // Special case, uses invoice
166 166
 	'supplier_proposal' => 'SupplierProposal',
167 167
 	'syslog' => 'Syslog',
168 168
 	'takepos' => 'TakePos',
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
 	//	'processes' => 6,
225 225
 	'backward_compatibility_checks' => false,
226 226
 	'simplify_ast' => true,
227
-	'analyzed_file_extensions' => ['php','inc'],
227
+	'analyzed_file_extensions' => ['php', 'inc'],
228 228
 	'globals_type_map' => [
229 229
 		'_Avery_Labels' => 'array<string,array{name:string,paper-size:string|array{0:float,1:float},orientation:string,metric:string,marginLeft:float,marginTop:float,NX:int,NY:int,SpaceX:float,SpaceY:float,width:float,height:float,font-size:int,custom_x:float,custom_y:float}>',
230 230
 		'action' => 'string',
@@ -283,7 +283,7 @@  discard block
 block discarded – undo
283 283
 		'shmkeys' => 'array<string,int>', // memory.lib
284 284
 		'shmoffset' => 'int', // memory.lib
285 285
 		'user' => '\User',
286
-		'website' => 'string',  // See discussion https://github.com/Dolibarr/dolibarr/pull/28891#issuecomment-2002268334  // Disable because Phan infers Website type
286
+		'website' => 'string', // See discussion https://github.com/Dolibarr/dolibarr/pull/28891#issuecomment-2002268334  // Disable because Phan infers Website type
287 287
 		'websitepage' => '\WebSitePage',
288 288
 		'websitepagefile' => 'string',
289 289
 		// 'object' => '\CommonObject',  // Deprecated, not enabled because conflicts with $object assignments
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
 	'directory_list' => [
309 309
 		'htdocs',
310 310
 		'scripts',
311
-		PHAN_DIR . '/stubs',
311
+		PHAN_DIR.'/stubs',
312 312
 	],
313 313
 
314 314
 	// A directory list that defines files that will be excluded
@@ -326,7 +326,7 @@  discard block
 block discarded – undo
326 326
 		'htdocs/includes/',
327 327
 		'htdocs/install/doctemplates/websites/',
328 328
 		'htdocs/core/class/lessc.class.php', // External library
329
-		PHAN_DIR . '/stubs/',
329
+		PHAN_DIR.'/stubs/',
330 330
 	],
331 331
 	//'exclude_file_regex' => '@^vendor/.*/(tests?|Tests?)/@',
332 332
 	'exclude_file_regex' => '@^('  // @phpstan-ignore-line
@@ -344,7 +344,7 @@  discard block
 block discarded – undo
344 344
 		.'|htdocs/includes/stripe/.*'  // @phpstan-ignore-line
345 345
 		.'|htdocs/conf/conf.php'  // @phpstan-ignore-line
346 346
 		// .'|htdocs/[^h].*/.*'  // For testing @phpstan-ignore-line
347
-		.')@',  // @phpstan-ignore-line
347
+		.')@', // @phpstan-ignore-line
348 348
 
349 349
 	// A list of plugin files to execute.
350 350
 	// Plugins which are bundled with Phan can be added here by providing their name
@@ -360,14 +360,14 @@  discard block
 block discarded – undo
360 360
 		'/^isModEnabled$/' => [0, $moduleNameRegex, 'UnknownModuleName'],
361 361
 		// Note: trick to have different key for same regex:
362 362
 		'/^isModEnable[d]$/' => [0, $deprecatedModuleNameRegex, "DeprecatedModuleName"],
363
-		'/^sanitizeVal$/' => [1, $sanitizeRegex,"UnknownSanitizeType"],
364
-		'/^checkVal$/' => [1, $sanitizeRegex,"UnknownCheckValSanitizeType"],
365
-		'/^\\\\ExtraFields::addExtraField$/' => [2, $extraFieldTypeRegex,"UnknownExtrafieldTypeBack"],
366
-		'/^dol_now$/' => [0, '{^(?:auto|gmt|tz(?:server|ref|user(?:rel)?))$}',"InvalidDolNowArgument"],
367
-		'/^dol_mktime$/' => [6, '{^(?:|0|1|auto|gmt|tz(?:server|ref|user(?:rel)?|,[+a-zA-Z-/]+))$}',"InvalidDolMktimeArgument"],  // '', 0, 1 match bool and int values
368
-		'/^dol_print_date$/' => [2, '{^(?:|0|1|auto|gmt|tz(?:server|user(?:rel)?))$}',"InvalidDolMktimeArgument"],  // '', 0, 1 match bool and int values
369
-		'/^GETPOSTFLOAT$/' => [1, '{^(?:|M[UTS]|C[UT]|\d+)$}',"InvalidGetPostFloatRounding"],
370
-		'/^price2num$/' => [1, '{^(?:|M[UTS]|C[UT]|\d+)$}',"InvalidPrice2NumRounding"],
363
+		'/^sanitizeVal$/' => [1, $sanitizeRegex, "UnknownSanitizeType"],
364
+		'/^checkVal$/' => [1, $sanitizeRegex, "UnknownCheckValSanitizeType"],
365
+		'/^\\\\ExtraFields::addExtraField$/' => [2, $extraFieldTypeRegex, "UnknownExtrafieldTypeBack"],
366
+		'/^dol_now$/' => [0, '{^(?:auto|gmt|tz(?:server|ref|user(?:rel)?))$}', "InvalidDolNowArgument"],
367
+		'/^dol_mktime$/' => [6, '{^(?:|0|1|auto|gmt|tz(?:server|ref|user(?:rel)?|,[+a-zA-Z-/]+))$}', "InvalidDolMktimeArgument"], // '', 0, 1 match bool and int values
368
+		'/^dol_print_date$/' => [2, '{^(?:|0|1|auto|gmt|tz(?:server|user(?:rel)?))$}', "InvalidDolMktimeArgument"], // '', 0, 1 match bool and int values
369
+		'/^GETPOSTFLOAT$/' => [1, '{^(?:|M[UTS]|C[UT]|\d+)$}', "InvalidGetPostFloatRounding"],
370
+		'/^price2num$/' => [1, '{^(?:|M[UTS]|C[UT]|\d+)$}', "InvalidPrice2NumRounding"],
371 371
 	],
372 372
 	'plugins' => [
373 373
 		__DIR__.'/plugins/NoVarDumpPlugin.php',
@@ -428,44 +428,44 @@  discard block
 block discarded – undo
428 428
 		// Dolibarr uses a lot of internal deprecated stuff, not reporting
429 429
 		'PhanDeprecatedProperty',
430 430
 
431
-		'PhanCompatibleNegativeStringOffset',	// return false positive
432
-		'PhanPluginConstantVariableBool',		// a lot of false positive, in most cases, we want to keep the code as it is
431
+		'PhanCompatibleNegativeStringOffset', // return false positive
432
+		'PhanPluginConstantVariableBool', // a lot of false positive, in most cases, we want to keep the code as it is
433 433
 		// 'PhanPluginUnknownArrayPropertyType', // Helps find missing array keys or mismatches, remaining occurrences are likely unused properties
434
-		'PhanTypeArraySuspiciousNullable',	// About 440 occurrences
434
+		'PhanTypeArraySuspiciousNullable', // About 440 occurrences
435 435
 		// 'PhanTypeInvalidDimOffset',			// Helps identify missing array indexes in types or reference to unset indexes
436 436
 		'PhanTypeObjectUnsetDeclaredProperty',
437
-		'PhanTypePossiblyInvalidDimOffset',			// a lot of false positive, in most cases, we want to keep the code as it is
437
+		'PhanTypePossiblyInvalidDimOffset', // a lot of false positive, in most cases, we want to keep the code as it is
438 438
 		// 'PhanPluginUnknownArrayFunctionReturnType',	// a lot of false positive, in most cases, we want to keep the code as it is
439 439
 
440
-		'PhanPluginWhitespaceTab',		// Dolibarr uses tabs
441
-		'PhanPluginCanUsePHP71Void',	// Dolibarr is maintaining 7.0 compatibility
442
-		'PhanPluginShortArray',			// Dolibarr uses array()
443
-		'PhanPluginShortArrayList',		// Dolibarr uses array()
440
+		'PhanPluginWhitespaceTab', // Dolibarr uses tabs
441
+		'PhanPluginCanUsePHP71Void', // Dolibarr is maintaining 7.0 compatibility
442
+		'PhanPluginShortArray', // Dolibarr uses array()
443
+		'PhanPluginShortArrayList', // Dolibarr uses array()
444 444
 		// Fixers From PHPDocToRealTypesPlugin:
445
-		'PhanPluginCanUseParamType',			// Fixer - Report/Add types in the function definition (function abc(string $var) (adds string)
446
-		'PhanPluginCanUseReturnType',			// Fixer - Report/Add return types in the function definition (function abc(string $var) (adds string)
447
-		'PhanPluginCanUseNullableParamType',	// Fixer - Report/Add nullable parameter types in the function definition
448
-		'PhanPluginCanUseNullableReturnType',	// Fixer - Report/Add nullable return types in the function definition
445
+		'PhanPluginCanUseParamType', // Fixer - Report/Add types in the function definition (function abc(string $var) (adds string)
446
+		'PhanPluginCanUseReturnType', // Fixer - Report/Add return types in the function definition (function abc(string $var) (adds string)
447
+		'PhanPluginCanUseNullableParamType', // Fixer - Report/Add nullable parameter types in the function definition
448
+		'PhanPluginCanUseNullableReturnType', // Fixer - Report/Add nullable return types in the function definition
449 449
 
450
-		'PhanPluginNonBoolBranch',			// Not essential - 31240+ occurrences
451
-		'PhanPluginNumericalComparison',	// Not essential - 19870+ occurrences
450
+		'PhanPluginNonBoolBranch', // Not essential - 31240+ occurrences
451
+		'PhanPluginNumericalComparison', // Not essential - 19870+ occurrences
452 452
 		// 'PhanTypeMismatchArgument',		// Can detect missing array keys, invalid types, objects being passed when scalar expected - Not all reported by phpstan - <=3800 cases (was: 12300+ before)
453
-		'PhanPluginNonBoolInLogicalArith',	// Not essential - 11040+ occurrences
454
-		'PhanPluginConstantVariableScalar',	// Not essential - 5180+ occurrences
453
+		'PhanPluginNonBoolInLogicalArith', // Not essential - 11040+ occurrences
454
+		'PhanPluginConstantVariableScalar', // Not essential - 5180+ occurrences
455 455
 		'PhanPluginDuplicateAdjacentStatement',
456
-		'PhanPluginDuplicateConditionalTernaryDuplication',		// 2750+ occurrences
457
-		'PhanPluginDuplicateConditionalNullCoalescing',	// Not essential - 990+ occurrences
458
-		'PhanPluginRedundantAssignmentInGlobalScope',	// Not essential, a lot of false warning
459
-		'PhanPluginRedundantAssignment',				// Not essential, useless
460
-		'PhanPluginDuplicateCatchStatementBody',  // Requires PHP7.1 - 50+ occurrences
456
+		'PhanPluginDuplicateConditionalTernaryDuplication', // 2750+ occurrences
457
+		'PhanPluginDuplicateConditionalNullCoalescing', // Not essential - 990+ occurrences
458
+		'PhanPluginRedundantAssignmentInGlobalScope', // Not essential, a lot of false warning
459
+		'PhanPluginRedundantAssignment', // Not essential, useless
460
+		'PhanPluginDuplicateCatchStatementBody', // Requires PHP7.1 - 50+ occurrences
461 461
 
462
-		'PhanPluginUnknownClosureReturnType',	// When we use closure (we must avoid), we do not have PHP doc
462
+		'PhanPluginUnknownClosureReturnType', // When we use closure (we must avoid), we do not have PHP doc
463 463
 
464 464
 		// 'PhanPluginUnknownArrayMethodParamType',	// All fixed
465 465
 		// 'PhanPluginUnknownArrayMethodReturnType',	// All fixed
466 466
 		// 'PhanUndeclaredGlobalVariable',			// Helps identify variables that are not set/defined - add '@phan-var-force TYPE $varname' in tpl or includes to help type the variable
467 467
 		// 'PhanPluginUnknownObjectMethodCall',	// False positive for some class. Is enabled in config_extended only.
468
-		'PhanTypeSuspiciousNonTraversableForeach',  // Reports on `foreach ($object as $key => $value)` which works without php notices, so we ignore it because this is intentional in the code.
468
+		'PhanTypeSuspiciousNonTraversableForeach', // Reports on `foreach ($object as $key => $value)` which works without php notices, so we ignore it because this is intentional in the code.
469 469
 	],
470 470
 	// You can put relative paths to internal stubs in this config option.
471 471
 	// Phan will continue using its detailed type annotations,
@@ -484,31 +484,31 @@  discard block
 block discarded – undo
484 484
 		//'xdebug'	=> 'vendor/phan/phan/.phan/internal_stubs/xdebug.phan_php',
485 485
 		//'memcached'  => PHAN_DIR . '/your_internal_stubs_folder_name/memcached.phan_php',
486 486
 		//'PDO'  => PHAN_DIR . '/stubs/PDO.phan_php',
487
-		'brotli'  => PHAN_DIR . '/stubs/brotli.phan_php',
488
-		'curl'  => PHAN_DIR . '/stubs/curl.phan_php',
489
-		'calendar'  => PHAN_DIR . '/stubs/calendar.phan_php',
490
-		'fileinfo'  => PHAN_DIR . '/stubs/fileinfo.phan_php',
491
-		'ftp'  => PHAN_DIR . '/stubs/ftp.phan_php',
492
-		'gd'  => PHAN_DIR . '/stubs/gd.phan_php',
493
-		'geoip'  => PHAN_DIR . '/stubs/geoip.phan_php',
494
-		'imagick'  => PHAN_DIR . '/stubs/imagick.phan_php',
495
-		'imap'  => PHAN_DIR . '/stubs/imap.phan_php',
496
-		'intl'  => PHAN_DIR . '/stubs/intl.phan_php',
497
-		'ldap'  => PHAN_DIR . '/stubs/ldap.phan_php',
498
-		'mcrypt'  => PHAN_DIR . '/stubs/mcrypt.phan_php',
499
-		'memcache'  => PHAN_DIR . '/stubs/memcache.phan_php',
500
-		'memcached' => PHAN_DIR . '/stubs/memcached.phan_php',
501
-		'mysqli'  => PHAN_DIR . '/stubs/mysqli.phan_php',
502
-		'pdo_cubrid'  => PHAN_DIR . '/stubs/pdo_cubrid.phan_php',
503
-		'pdo_mysql'  => PHAN_DIR . '/stubs/pdo_mysql.phan_php',
504
-		'pdo_pgsql'  => PHAN_DIR . '/stubs/pdo_pgsql.phan_php',
505
-		'pdo_sqlite'  => PHAN_DIR . '/stubs/pdo_sqlite.phan_php',
506
-		'pgsql'  => PHAN_DIR . '/stubs/pgsql.phan_php',
507
-		'session'  => PHAN_DIR . '/stubs/session.phan_php',
508
-		'simplexml'  => PHAN_DIR . '/stubs/SimpleXML.phan_php',
509
-		'soap'  => PHAN_DIR . '/stubs/soap.phan_php',
510
-		'sockets'  => PHAN_DIR . '/stubs/sockets.phan_php',
511
-		'tidy'  => PHAN_DIR . '/stubs/tidy.phan_php',
512
-		'zip'  => PHAN_DIR . '/stubs/zip.phan_php',
487
+		'brotli'  => PHAN_DIR.'/stubs/brotli.phan_php',
488
+		'curl'  => PHAN_DIR.'/stubs/curl.phan_php',
489
+		'calendar'  => PHAN_DIR.'/stubs/calendar.phan_php',
490
+		'fileinfo'  => PHAN_DIR.'/stubs/fileinfo.phan_php',
491
+		'ftp'  => PHAN_DIR.'/stubs/ftp.phan_php',
492
+		'gd'  => PHAN_DIR.'/stubs/gd.phan_php',
493
+		'geoip'  => PHAN_DIR.'/stubs/geoip.phan_php',
494
+		'imagick'  => PHAN_DIR.'/stubs/imagick.phan_php',
495
+		'imap'  => PHAN_DIR.'/stubs/imap.phan_php',
496
+		'intl'  => PHAN_DIR.'/stubs/intl.phan_php',
497
+		'ldap'  => PHAN_DIR.'/stubs/ldap.phan_php',
498
+		'mcrypt'  => PHAN_DIR.'/stubs/mcrypt.phan_php',
499
+		'memcache'  => PHAN_DIR.'/stubs/memcache.phan_php',
500
+		'memcached' => PHAN_DIR.'/stubs/memcached.phan_php',
501
+		'mysqli'  => PHAN_DIR.'/stubs/mysqli.phan_php',
502
+		'pdo_cubrid'  => PHAN_DIR.'/stubs/pdo_cubrid.phan_php',
503
+		'pdo_mysql'  => PHAN_DIR.'/stubs/pdo_mysql.phan_php',
504
+		'pdo_pgsql'  => PHAN_DIR.'/stubs/pdo_pgsql.phan_php',
505
+		'pdo_sqlite'  => PHAN_DIR.'/stubs/pdo_sqlite.phan_php',
506
+		'pgsql'  => PHAN_DIR.'/stubs/pgsql.phan_php',
507
+		'session'  => PHAN_DIR.'/stubs/session.phan_php',
508
+		'simplexml'  => PHAN_DIR.'/stubs/SimpleXML.phan_php',
509
+		'soap'  => PHAN_DIR.'/stubs/soap.phan_php',
510
+		'sockets'  => PHAN_DIR.'/stubs/sockets.phan_php',
511
+		'tidy'  => PHAN_DIR.'/stubs/tidy.phan_php',
512
+		'zip'  => PHAN_DIR.'/stubs/zip.phan_php',
513 513
 	],
514 514
 ];
Please login to merge, or discard this patch.
htdocs/eventorganization/core/actions_massactions_mail.inc.php 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 	$nbsent = 0;
86 86
 	$nbignored = 0;
87 87
 	$langs->load("mails");
88
-	include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
88
+	include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
89 89
 
90 90
 	$listofobjectid = array();
91 91
 
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 	$listofselectedid = array();
96 96
 	$listofselectedref = array();
97 97
 	if (!$error) {
98
-		require_once DOL_DOCUMENT_ROOT . '/eventorganization/class/conferenceorboothattendee.class.php';
98
+		require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorboothattendee.class.php';
99 99
 		$attendee = new ConferenceOrBoothAttendee($db);
100 100
 		$objecttmp = new $objectclass($db);
101 101
 		'@phan-var-force CommonObject $objecttmp';
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
 			$sendtoid = array();
156 156
 
157 157
 			// Define $sendto
158
-			$sendto = $attendees->thirdparty->name . '<' . trim($attendees->email) . '>';
158
+			$sendto = $attendees->thirdparty->name.'<'.trim($attendees->email).'>';
159 159
 
160 160
 			// Define $sendtocc
161 161
 			$receivercc = GETPOST('receivercc', 'alphawithlgt');
@@ -178,9 +178,9 @@  discard block
 block discarded – undo
178 178
 			$reg = array();
179 179
 			$fromtype = GETPOST('fromtype');
180 180
 			if ($fromtype === 'user') {
181
-				$from = $user->getFullName($langs) . ' <' . $user->email . '>';
181
+				$from = $user->getFullName($langs).' <'.$user->email.'>';
182 182
 			} elseif ($fromtype === 'company') {
183
-				$from = getDolGlobalString('MAIN_INFO_SOCIETE_NOM') . ' <' . getDolGlobalString('MAIN_INFO_SOCIETE_MAIL') . '>';
183
+				$from = getDolGlobalString('MAIN_INFO_SOCIETE_NOM').' <'.getDolGlobalString('MAIN_INFO_SOCIETE_MAIL').'>';
184 184
 			} elseif (preg_match('/user_aliases_(\d+)/', $fromtype, $reg)) {
185 185
 				$tmp = explode(',', $user->email_aliases);
186 186
 				$from = trim($tmp[((int) $reg[1] - 1)]);
@@ -188,14 +188,14 @@  discard block
 block discarded – undo
188 188
 				$tmp = explode(',', getDolGlobalString('MAIN_INFO_SOCIETE_MAIL_ALIASES'));
189 189
 				$from = trim($tmp[((int) $reg[1] - 1)]);
190 190
 			} elseif (preg_match('/senderprofile_(\d+)_(\d+)/', $fromtype, $reg)) {
191
-				$sql = "SELECT rowid, label, email FROM " . MAIN_DB_PREFIX . "c_email_senderprofile WHERE rowid = " . (int) $reg[1];
191
+				$sql = "SELECT rowid, label, email FROM ".MAIN_DB_PREFIX."c_email_senderprofile WHERE rowid = ".(int) $reg[1];
192 192
 				$resql = $db->query($sql);
193 193
 				$obj = $db->fetch_object($resql);
194 194
 				if ($obj) {
195
-					$from = dol_string_nospecial($obj->label, ' ', array(",")) . ' <' . $obj->email . '>';
195
+					$from = dol_string_nospecial($obj->label, ' ', array(",")).' <'.$obj->email.'>';
196 196
 				}
197 197
 			} else {
198
-				$from = dol_string_nospecial(GETPOST('fromname'), ' ', array(",")) . ' <' . GETPOST('frommail') . '>';
198
+				$from = dol_string_nospecial(GETPOST('fromname'), ' ', array(",")).' <'.GETPOST('frommail').'>';
199 199
 			}
200 200
 
201 201
 			$replyto = $from;
@@ -211,12 +211,12 @@  discard block
 block discarded – undo
211 211
 			$html_link = null;
212 212
 
213 213
 			if (getDolGlobalString('MAIN_AGENDA_XCAL_EXPORTKEY')) {
214
-				$urlwithouturlroot = preg_replace('/' . preg_quote(DOL_URL_ROOT, '/') . '$/i', '', trim($dolibarr_main_url_root));
215
-				$urlwithroot = $urlwithouturlroot . DOL_URL_ROOT;
216
-				$url_link = $urlwithroot . '/public/agenda/agendaexport.php?format=ical' . ($conf->entity > 1 ? "&entity=" . $conf->entity : "");
217
-				$url_link .= '&exportkey=' . ($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ? urlencode(getDolGlobalString('MAIN_AGENDA_XCAL_EXPORTKEY')) : '...');
218
-				$url_link .= "&project=" . $listofselectedref[$email]->fk_project . '&module=' . urlencode('@eventorganization') . '&status=' . ConferenceOrBooth::STATUS_CONFIRMED;
219
-				$html_link = '<a href="' . $url_link . '">' . $langs->trans('DownloadICSLink') . '</a>';
214
+				$urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
215
+				$urlwithroot = $urlwithouturlroot.DOL_URL_ROOT;
216
+				$url_link = $urlwithroot.'/public/agenda/agendaexport.php?format=ical'.($conf->entity > 1 ? "&entity=".$conf->entity : "");
217
+				$url_link .= '&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ? urlencode(getDolGlobalString('MAIN_AGENDA_XCAL_EXPORTKEY')) : '...');
218
+				$url_link .= "&project=".$listofselectedref[$email]->fk_project.'&module='.urlencode('@eventorganization').'&status='.ConferenceOrBooth::STATUS_CONFIRMED;
219
+				$html_link = '<a href="'.$url_link.'">'.$langs->trans('DownloadICSLink').'</a>';
220 220
 			}
221 221
 			$substitutionarray['__EVENTORGANIZATION_ICS_LINK__'] = $html_link;
222 222
 			$substitutionarray['__EVENTORGANIZATION_URL_LINK__'] = $url_link;
@@ -238,25 +238,25 @@  discard block
 block discarded – undo
238 238
 			}
239 239
 
240 240
 			// Send mail (substitutionarray must be done just before this)
241
-			require_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php';
241
+			require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
242 242
 			$mailfile = new CMailFile($subjectreplaced, $sendto, $from, $messagereplaced, array(), array(), array(), $sendtocc, $sendtobcc, (int) $deliveryreceipt, -1, '', '', "attendees_".$attendees->id, '', $sendcontext);
243 243
 			if ($mailfile->error) {
244
-				$resaction .= '<div class="error">' . $mailfile->error . '</div>';
244
+				$resaction .= '<div class="error">'.$mailfile->error.'</div>';
245 245
 			} else {
246 246
 				$result = $mailfile->sendfile();
247 247
 				if ($result) {
248
-					$resaction .= $langs->trans('MailSuccessfulySent', $mailfile->getValidAddress($from, 2), $mailfile->getValidAddress($sendto, 2)) . '<br>'; // Must not contain "
248
+					$resaction .= $langs->trans('MailSuccessfulySent', $mailfile->getValidAddress($from, 2), $mailfile->getValidAddress($sendto, 2)).'<br>'; // Must not contain "
249 249
 					$error = 0;
250 250
 
251
-					dol_syslog("Try to insert email event into agenda for objid=" . $attendees->id . " => objectobj=" . get_class($attendees));
251
+					dol_syslog("Try to insert email event into agenda for objid=".$attendees->id." => objectobj=".get_class($attendees));
252 252
 
253 253
 					$actionmsg = $langs->transnoentities('MailSentByTo', $from, $sendto);
254 254
 					if ($message) {
255 255
 						if ($sendtocc) {
256
-							$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('Bcc') . ": " . $sendtocc);
256
+							$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('Bcc').": ".$sendtocc);
257 257
 						}
258
-						$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic') . ": " . $subjectreplaced);
259
-						$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody') . ":");
258
+						$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic').": ".$subjectreplaced);
259
+						$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody').":");
260 260
 						$actionmsg = dol_concatdesc($actionmsg, $messagereplaced);
261 261
 					}
262 262
 					$actionmsg2 = '';
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
 
280 280
 						if ($error) {
281 281
 							setEventMessages($db->lasterror(), $objectobj2->errors, 'errors');
282
-							dol_syslog("Error in trigger " . $triggername . ' ' . $db->lasterror(), LOG_ERR);
282
+							dol_syslog("Error in trigger ".$triggername.' '.$db->lasterror(), LOG_ERR);
283 283
 						}
284 284
 					}
285 285
 
@@ -288,26 +288,26 @@  discard block
 block discarded – undo
288 288
 					$langs->load("other");
289 289
 					if ($mailfile->error) {
290 290
 						$resaction .= $langs->trans('ErrorFailedToSendMail', $from, $sendto);
291
-						$resaction .= '<br><div class="error">' . $mailfile->error . '</div>';
291
+						$resaction .= '<br><div class="error">'.$mailfile->error.'</div>';
292 292
 					} elseif (getDolGlobalString('MAIN_DISABLE_ALL_MAILS')) {
293 293
 						$resaction .= '<div class="warning">No mail sent. Feature is disabled by option MAIN_DISABLE_ALL_MAILS</div>';
294 294
 					} else {
295
-						$resaction .= $langs->trans('ErrorFailedToSendMail', $from, $sendto) . '<br><div class="error">(unhandled error)</div>';
295
+						$resaction .= $langs->trans('ErrorFailedToSendMail', $from, $sendto).'<br><div class="error">(unhandled error)</div>';
296 296
 					}
297 297
 				}
298 298
 			}
299 299
 		}  // foreach ($listofselectedid as $email => $attendees)
300 300
 	}
301 301
 	$resaction .= ($resaction ? '<br>' : $resaction);
302
-	$resaction .= '<strong>' . $langs->trans("ResultOfMailSending") . ':</strong><br>' . "\n";
303
-	$resaction .= $langs->trans("NbSelected") . ': ' . count($toselect) . "\n<br>";
304
-	$resaction .= $langs->trans("NbIgnored") . ': ' . ($nbignored ? $nbignored : 0) . "\n<br>";
305
-	$resaction .= $langs->trans("NbSent") . ': ' . ($nbsent ? $nbsent : 0) . "\n<br>";
302
+	$resaction .= '<strong>'.$langs->trans("ResultOfMailSending").':</strong><br>'."\n";
303
+	$resaction .= $langs->trans("NbSelected").': '.count($toselect)."\n<br>";
304
+	$resaction .= $langs->trans("NbIgnored").': '.($nbignored ? $nbignored : 0)."\n<br>";
305
+	$resaction .= $langs->trans("NbSent").': '.($nbsent ? $nbsent : 0)."\n<br>";
306 306
 
307 307
 	if ($nbsent) {
308 308
 		$action = ''; // Do not show form post if there was at least one successful sent
309 309
 		//setEventMessages($langs->trans("EMailSentToNRecipients", $nbsent.'/'.count($toselect)), null, 'mesgs');
310
-		setEventMessages($langs->trans("EMailSentForNElements", $nbsent . '/' . count($toselect)), null, 'mesgs');
310
+		setEventMessages($langs->trans("EMailSentForNElements", $nbsent.'/'.count($toselect)), null, 'mesgs');
311 311
 		setEventMessages($resaction, null, 'mesgs');
312 312
 	} else {
313 313
 		//setEventMessages($langs->trans("EMailSentToNRecipients", 0), null, 'warnings');  // May be object has no generated PDF file
Please login to merge, or discard this patch.
htdocs/hrm/job_card.php 1 patch
Spacing   +66 added lines, -66 removed lines patch added patch discarded remove patch
@@ -31,12 +31,12 @@  discard block
 block discarded – undo
31 31
 // Load Dolibarr environment
32 32
 require '../main.inc.php';
33 33
 
34
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php';
35
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php';
36
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php';
37
-require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php';
38
-require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_job.lib.php';
39
-require_once DOL_DOCUMENT_ROOT . '/hrm/class/skillrank.class.php';
34
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
35
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
36
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
37
+require_once DOL_DOCUMENT_ROOT.'/hrm/class/job.class.php';
38
+require_once DOL_DOCUMENT_ROOT.'/hrm/lib/hrm_job.lib.php';
39
+require_once DOL_DOCUMENT_ROOT.'/hrm/class/skillrank.class.php';
40 40
 
41 41
 /**
42 42
  * @var Conf $conf
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
  */
49 49
 
50 50
 // Load translation files required by the page
51
-$langs->loadLangs(array('hrm', 'other', 'products'));   // why products?
51
+$langs->loadLangs(array('hrm', 'other', 'products')); // why products?
52 52
 
53 53
 // Get parameters
54 54
 $id = GETPOSTINT('id');
@@ -59,12 +59,12 @@  discard block
 block discarded – undo
59 59
 $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'jobcard'; // To manage different context of search
60 60
 $backtopage = GETPOST('backtopage', 'alpha');
61 61
 $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');
62
-$lineid   = GETPOSTINT('lineid');
62
+$lineid = GETPOSTINT('lineid');
63 63
 
64 64
 // Initialize a technical objects
65 65
 $object = new Job($db);
66 66
 $extrafields = new ExtraFields($db);
67
-$diroutputmassaction = $conf->hrm->dir_output . '/temp/massgeneration/' . $user->id;
67
+$diroutputmassaction = $conf->hrm->dir_output.'/temp/massgeneration/'.$user->id;
68 68
 $hookmanager->initHooks(array('jobcard', 'globalcard')); // Note that conf->hooks_modules contains array
69 69
 
70 70
 // Fetch optionals attributes and labels
@@ -76,8 +76,8 @@  discard block
 block discarded – undo
76 76
 $search_all = GETPOST("search_all", 'alpha');
77 77
 $search = array();
78 78
 foreach ($object->fields as $key => $val) {
79
-	if (GETPOST('search_' . $key, 'alpha')) {
80
-		$search[$key] = GETPOST('search_' . $key, 'alpha');
79
+	if (GETPOST('search_'.$key, 'alpha')) {
80
+		$search[$key] = GETPOST('search_'.$key, 'alpha');
81 81
 	}
82 82
 }
83 83
 
@@ -86,13 +86,13 @@  discard block
 block discarded – undo
86 86
 }
87 87
 
88 88
 // Load object
89
-include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'.
89
+include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'.
90 90
 
91 91
 // Permissions
92 92
 $permissiontoread = $user->hasRight('hrm', 'all', 'read');
93 93
 $permissiontoadd  = $user->hasRight('hrm', 'all', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
94 94
 $permissiontodelete = $user->hasRight('hrm', 'all', 'delete');
95
-$upload_dir = $conf->hrm->multidir_output[isset($object->entity) ? $object->entity : 1] . '/job';
95
+$upload_dir = $conf->hrm->multidir_output[isset($object->entity) ? $object->entity : 1].'/job';
96 96
 
97 97
 // Security check (enable the most restrictive one)
98 98
 //if ($user->socid > 0) accessforbidden();
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 			if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) {
128 128
 				$backtopage = $backurlforlist;
129 129
 			} else {
130
-				$backtopage = dol_buildpath('/hrm/job_card.php', 1) . '?id=' . ($id > 0 ? $id : '__ID__');
130
+				$backtopage = dol_buildpath('/hrm/job_card.php', 1).'?id='.($id > 0 ? $id : '__ID__');
131 131
 			}
132 132
 		}
133 133
 	}
@@ -137,20 +137,20 @@  discard block
 block discarded – undo
137 137
 
138 138
 	// Actions cancel, add, update, update_extras, confirm_validate, confirm_delete, confirm_deleteline, confirm_clone, confirm_close, confirm_setdraft, confirm_reopen
139 139
 	if ($action != 'confirm_clone') {
140
-		include DOL_DOCUMENT_ROOT . '/core/actions_addupdatedelete.inc.php';
140
+		include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php';
141 141
 	}
142 142
 
143 143
 	// Actions when linking object each other
144
-	include DOL_DOCUMENT_ROOT . '/core/actions_dellink.inc.php';
144
+	include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php';
145 145
 
146 146
 	// Actions when printing a doc from card
147
-	include DOL_DOCUMENT_ROOT . '/core/actions_printing.inc.php';
147
+	include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
148 148
 
149 149
 	// Action to move up and down lines of object
150 150
 	//include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php';
151 151
 
152 152
 	// Action to build doc
153
-	include DOL_DOCUMENT_ROOT . '/core/actions_builddoc.inc.php';
153
+	include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
154 154
 
155 155
 	if ($action == 'set_thirdparty' && $permissiontoadd) {
156 156
 		$object->setValueFrom('fk_soc', GETPOSTINT('fk_soc'), '', null, 'date', '', $user, $triggermodname);
@@ -162,8 +162,8 @@  discard block
 block discarded – undo
162 162
 	// Actions to send emails
163 163
 	$triggersendname = 'HRM_JOB_SENTBYMAIL';
164 164
 	$autocopy = 'MAIN_MAIL_AUTOCOPY_JOB_TO';
165
-	$trackid = 'job' . $object->id;
166
-	include DOL_DOCUMENT_ROOT . '/core/actions_sendmails.inc.php';
165
+	$trackid = 'job'.$object->id;
166
+	include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
167 167
 
168 168
 	if ($action == 'confirm_clone' && $confirm != 'yes') {
169 169
 		$action = '';
@@ -250,36 +250,36 @@  discard block
 block discarded – undo
250 250
 
251 251
 // Part to create
252 252
 if ($action == 'create') {
253
-	print load_fiche_titre($langs->trans("NewJobProfile", $langs->transnoentities('Job')), '', 'object_' . $object->picto);
253
+	print load_fiche_titre($langs->trans("NewJobProfile", $langs->transnoentities('Job')), '', 'object_'.$object->picto);
254 254
 
255
-	print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">';
256
-	print '<input type="hidden" name="token" value="' . newToken() . '">';
255
+	print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
256
+	print '<input type="hidden" name="token" value="'.newToken().'">';
257 257
 	print '<input type="hidden" name="action" value="add">';
258 258
 	if ($backtopage) {
259
-		print '<input type="hidden" name="backtopage" value="' . $backtopage . '">';
259
+		print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
260 260
 	}
261 261
 	if ($backtopageforcancel) {
262
-		print '<input type="hidden" name="backtopageforcancel" value="' . $backtopageforcancel . '">';
262
+		print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">';
263 263
 	}
264 264
 
265 265
 	print dol_get_fiche_head(array(), '');
266 266
 
267
-	print '<table class="border centpercent tableforfieldcreate">' . "\n";
267
+	print '<table class="border centpercent tableforfieldcreate">'."\n";
268 268
 
269 269
 	// Common attributes
270
-	include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_add.tpl.php';
270
+	include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_add.tpl.php';
271 271
 
272 272
 	// Other attributes
273
-	include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_add.tpl.php';
273
+	include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php';
274 274
 
275
-	print '</table>' . "\n";
275
+	print '</table>'."\n";
276 276
 
277 277
 	print dol_get_fiche_end();
278 278
 
279 279
 	print '<div class="center">';
280
-	print '<input type="submit" class="button" name="add" value="' . dol_escape_htmltag($langs->trans("Create")) . '">';
280
+	print '<input type="submit" class="button" name="add" value="'.dol_escape_htmltag($langs->trans("Create")).'">';
281 281
 	print '&nbsp; ';
282
-	print '<input type="' . ($backtopage ? "submit" : "button") . '" class="button button-cancel" name="cancel" value="' . dol_escape_htmltag($langs->trans("Cancel")) . '"' . ($backtopage ? '' : ' onclick="history.go(-1)"') . '>'; // Cancel for create does not post form if we don't know the backtopage
282
+	print '<input type="'.($backtopage ? "submit" : "button").'" class="button button-cancel" name="cancel" value="'.dol_escape_htmltag($langs->trans("Cancel")).'"'.($backtopage ? '' : ' onclick="history.go(-1)"').'>'; // Cancel for create does not post form if we don't know the backtopage
283 283
 	print '</div>';
284 284
 
285 285
 	print '</form>';
@@ -289,35 +289,35 @@  discard block
 block discarded – undo
289 289
 
290 290
 // Part to edit record
291 291
 if (($id || $ref) && $action == 'edit') {
292
-	print load_fiche_titre($langs->trans("JobProfile"), '', 'object_' . $object->picto);
292
+	print load_fiche_titre($langs->trans("JobProfile"), '', 'object_'.$object->picto);
293 293
 
294
-	print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">';
295
-	print '<input type="hidden" name="token" value="' . newToken() . '">';
294
+	print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
295
+	print '<input type="hidden" name="token" value="'.newToken().'">';
296 296
 	print '<input type="hidden" name="action" value="update">';
297
-	print '<input type="hidden" name="id" value="' . $object->id . '">';
297
+	print '<input type="hidden" name="id" value="'.$object->id.'">';
298 298
 	if ($backtopage) {
299
-		print '<input type="hidden" name="backtopage" value="' . $backtopage . '">';
299
+		print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
300 300
 	}
301 301
 	if ($backtopageforcancel) {
302
-		print '<input type="hidden" name="backtopageforcancel" value="' . $backtopageforcancel . '">';
302
+		print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">';
303 303
 	}
304 304
 
305 305
 	print dol_get_fiche_head();
306 306
 
307
-	print '<table class="border centpercent tableforfieldedit">' . "\n";
307
+	print '<table class="border centpercent tableforfieldedit">'."\n";
308 308
 
309 309
 	// Common attributes
310
-	include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_edit.tpl.php';
310
+	include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_edit.tpl.php';
311 311
 
312 312
 	// Other attributes
313
-	include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_edit.tpl.php';
313
+	include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_edit.tpl.php';
314 314
 
315 315
 	print '</table>';
316 316
 
317 317
 	print dol_get_fiche_end();
318 318
 
319
-	print '<div class="center"><input type="submit" class="button button-save" name="save" value="' . $langs->trans("Save") . '">';
320
-	print ' &nbsp; <input type="submit" class="button button-cancel" name="cancel" value="' . $langs->trans("Cancel") . '">';
319
+	print '<div class="center"><input type="submit" class="button button-save" name="save" value="'.$langs->trans("Save").'">';
320
+	print ' &nbsp; <input type="submit" class="button button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">';
321 321
 	print '</div>';
322 322
 
323 323
 	print '</form>';
@@ -335,11 +335,11 @@  discard block
 block discarded – undo
335 335
 
336 336
 	// Confirmation to delete
337 337
 	if ($action == 'delete') {
338
-		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteJob'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1);
338
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteJob'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1);
339 339
 	}
340 340
 	// Confirmation to delete line
341 341
 	if ($action == 'deleteline') {
342
-		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&lineid=' . $lineid, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteline', '', 0, 1);
342
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteline', '', 0, 1);
343 343
 	}
344 344
 	// Clone confirmation
345 345
 	if ($action == 'clone') {
@@ -367,7 +367,7 @@  discard block
 block discarded – undo
367 367
 
368 368
 	// Object card
369 369
 	// ------------------------------------------------------------
370
-	$linkback = '<a href="' . dol_buildpath('/hrm/job_list.php', 1) . '?restore_lastsearch_values=1' . (!empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
370
+	$linkback = '<a href="'.dol_buildpath('/hrm/job_list.php', 1).'?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
371 371
 
372 372
 	$morehtmlref = '<div class="refid">';
373 373
 	$morehtmlref .= $object->label;
@@ -387,10 +387,10 @@  discard block
 block discarded – undo
387 387
 	//unset($object->fields['fk_project']);				// Hide field already shown in banner
388 388
 	//unset($object->fields['fk_soc']);					// Hide field already shown in banner
389 389
 	$object->fields['label']['visible'] = 0; // Already in banner
390
-	include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_view.tpl.php';
390
+	include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php';
391 391
 
392 392
 	// Other attributes. Fields from hook formObjectOptions and Extrafields.
393
-	include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
393
+	include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
394 394
 
395 395
 	print '</table>';
396 396
 	print '</div>';
@@ -409,16 +409,16 @@  discard block
 block discarded – undo
409 409
 		// Show object lines
410 410
 		$result = $object->getLinesArray();
411 411
 
412
-		print '	<form name="addproduct" id="addproduct" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . (($action != 'editline') ? '' : '#line_' . GETPOSTINT('lineid')) . '" method="POST">
413
-		<input type="hidden" name="token" value="' . newToken() . '">
414
-		<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline') . '">
412
+		print '	<form name="addproduct" id="addproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.(($action != 'editline') ? '' : '#line_'.GETPOSTINT('lineid')).'" method="POST">
413
+		<input type="hidden" name="token" value="' . newToken().'">
414
+		<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline').'">
415 415
 		<input type="hidden" name="mode" value="">
416 416
 		<input type="hidden" name="page_y" value="">
417
-		<input type="hidden" name="id" value="' . $object->id . '">
417
+		<input type="hidden" name="id" value="' . $object->id.'">
418 418
 		';
419 419
 
420 420
 		if (!empty($conf->use_javascript_ajax) && $object->status == 0) {
421
-			include DOL_DOCUMENT_ROOT . '/core/tpl/ajaxrow.tpl.php';
421
+			include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php';
422 422
 		}
423 423
 
424 424
 		print '<div class="div-table-responsive-no-min">';
@@ -458,7 +458,7 @@  discard block
 block discarded – undo
458 458
 	// Buttons for actions
459 459
 
460 460
 	if ($action != 'presend' && $action != 'editline') {
461
-		print '<div class="tabsAction">' . "\n";
461
+		print '<div class="tabsAction">'."\n";
462 462
 		$parameters = array();
463 463
 		$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
464 464
 		if ($reshook < 0) {
@@ -468,17 +468,17 @@  discard block
 block discarded – undo
468 468
 		if (empty($reshook)) {
469 469
 			// Back to draft
470 470
 			if ($object->status == $object::STATUS_VALIDATED) {
471
-				print dolGetButtonAction($langs->trans('SetToDraft'), '', 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=confirm_setdraft&confirm=yes&token=' . newToken(), '', $permissiontoadd);
471
+				print dolGetButtonAction($langs->trans('SetToDraft'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=confirm_setdraft&confirm=yes&token='.newToken(), '', $permissiontoadd);
472 472
 			}
473 473
 
474
-			print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=edit&token=' . newToken(), '', $permissiontoadd);
474
+			print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit&token='.newToken(), '', $permissiontoadd);
475 475
 
476
-			print dolGetButtonAction($langs->trans('ToClone'), '', 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=clone&token=' . newToken(), '', $permissiontoadd);
476
+			print dolGetButtonAction($langs->trans('ToClone'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=clone&token='.newToken(), '', $permissiontoadd);
477 477
 
478 478
 			// Delete (need delete permission, or if draft, just need create/modify permission)
479
-			print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=delete&token=' . newToken(), '', $permissiontodelete);
479
+			print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=delete&token='.newToken(), '', $permissiontodelete);
480 480
 		}
481
-		print '</div>' . "\n";
481
+		print '</div>'."\n";
482 482
 	}
483 483
 
484 484
 
@@ -496,12 +496,12 @@  discard block
 block discarded – undo
496 496
 		// Documents
497 497
 		if ($includedocgeneration) {
498 498
 			$objref = dol_sanitizeFileName($object->ref);
499
-			$relativepath = $objref . '/' . $objref . '.pdf';
500
-			$filedir = $conf->hrm->dir_output . '/' . $object->element . '/' . $objref;
501
-			$urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id;
499
+			$relativepath = $objref.'/'.$objref.'.pdf';
500
+			$filedir = $conf->hrm->dir_output.'/'.$object->element.'/'.$objref;
501
+			$urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id;
502 502
 			$genallowed = $user->hasRight('hrm', 'job', 'read'); // If you can read, you can build the PDF to read content
503 503
 			$delallowed = $user->hasRight('hrm', 'job', 'write'); // If you can create/edit, you can remove a file on card
504
-			print $formfile->showdocuments('hrm:Job', $object->element . '/' . $objref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', $langs->defaultlang);
504
+			print $formfile->showdocuments('hrm:Job', $object->element.'/'.$objref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', $langs->defaultlang);
505 505
 		}
506 506
 
507 507
 		// Show links to link elements
@@ -519,9 +519,9 @@  discard block
 block discarded – undo
519 519
 		$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/hrm/job_agenda.php?id='.$object->id);
520 520
 
521 521
 		// List of actions on element
522
-		include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
522
+		include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
523 523
 		$formactions = new FormActions($db);
524
-		$somethingshown = $formactions->showactions($object, $object->element . '@' . $object->module, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlcenter);
524
+		$somethingshown = $formactions->showactions($object, $object->element.'@'.$object->module, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlcenter);
525 525
 
526 526
 		print '</div></div>';
527 527
 	}
@@ -530,9 +530,9 @@  discard block
 block discarded – undo
530 530
 	$modelmail = 'job';
531 531
 	$defaulttopic = 'InformationMessage';
532 532
 	$diroutput = $conf->hrm->dir_output;
533
-	$trackid = 'job' . $object->id;
533
+	$trackid = 'job'.$object->id;
534 534
 
535
-	include DOL_DOCUMENT_ROOT . '/core/tpl/card_presend.tpl.php';
535
+	include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php';
536 536
 }
537 537
 
538 538
 // End of page
Please login to merge, or discard this patch.
htdocs/hrm/skill_card.php 1 patch
Spacing   +98 added lines, -98 removed lines patch added patch discarded remove patch
@@ -30,11 +30,11 @@  discard block
 block discarded – undo
30 30
 
31 31
 // Load Dolibarr environment
32 32
 require '../main.inc.php';
33
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php';
34
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php';
35
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php';
36
-require_once DOL_DOCUMENT_ROOT . '/hrm/class/skill.class.php';
37
-require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_skill.lib.php';
33
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
34
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
35
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
36
+require_once DOL_DOCUMENT_ROOT.'/hrm/class/skill.class.php';
37
+require_once DOL_DOCUMENT_ROOT.'/hrm/lib/hrm_skill.lib.php';
38 38
 
39 39
 
40 40
 /**
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
  */
47 47
 
48 48
 // Load translation files required by the page
49
-$langs->loadLangs(array('hrm', 'other', 'products'));  // why products?
49
+$langs->loadLangs(array('hrm', 'other', 'products')); // why products?
50 50
 
51 51
 // Get parameters
52 52
 $id = GETPOSTINT('id');
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'skillcard'; // To manage different context of search
58 58
 $backtopage = GETPOST('backtopage', 'alpha');
59 59
 $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');
60
-$lineid   = GETPOSTINT('lineid');
60
+$lineid = GETPOSTINT('lineid');
61 61
 
62 62
 // Initialize a technical objects
63 63
 $object = new Skill($db);
@@ -75,8 +75,8 @@  discard block
 block discarded – undo
75 75
 $search_all = GETPOST("search_all", 'alpha');
76 76
 $search = array();
77 77
 foreach ($object->fields as $key => $val) {
78
-	if (GETPOST('search_' . $key, 'alpha')) {
79
-		$search[$key] = GETPOST('search_' . $key, 'alpha');
78
+	if (GETPOST('search_'.$key, 'alpha')) {
79
+		$search[$key] = GETPOST('search_'.$key, 'alpha');
80 80
 	}
81 81
 }
82 82
 
@@ -85,14 +85,14 @@  discard block
 block discarded – undo
85 85
 }
86 86
 
87 87
 // Load object
88
-include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'.
88
+include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'.
89 89
 
90 90
 // Permissions
91 91
 $permissiontoread   = $user->hasRight('hrm', 'all', 'read');
92 92
 $permissiontoadd    = $user->hasRight('hrm', 'all', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
93 93
 $permissiontodelete = $user->hasRight('hrm', 'all', 'delete');
94 94
 
95
-$upload_dir = $conf->hrm->multidir_output[isset($object->entity) ? $object->entity : 1] . '/skill';
95
+$upload_dir = $conf->hrm->multidir_output[isset($object->entity) ? $object->entity : 1].'/skill';
96 96
 
97 97
 // Security check (enable the most restrictive one)
98 98
 //if ($user->socid > 0) accessforbidden();
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
 			if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) {
130 130
 				$backtopage = $backurlforlist;
131 131
 			} else {
132
-				$backtopage = DOL_URL_ROOT.'/hrm/skill_card.php?id=' . ($id > 0 ? $id : '__ID__');
132
+				$backtopage = DOL_URL_ROOT.'/hrm/skill_card.php?id='.($id > 0 ? $id : '__ID__');
133 133
 			}
134 134
 		}
135 135
 	}
@@ -194,16 +194,16 @@  discard block
 block discarded – undo
194 194
 
195 195
 
196 196
 	// Actions when linking object each other
197
-	include DOL_DOCUMENT_ROOT . '/core/actions_dellink.inc.php';
197
+	include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php';
198 198
 
199 199
 	// Actions when printing a doc from card
200
-	include DOL_DOCUMENT_ROOT . '/core/actions_printing.inc.php';
200
+	include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
201 201
 
202 202
 	// Action to move up and down lines of object
203 203
 	//include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php';
204 204
 
205 205
 	// Action to build doc
206
-	include DOL_DOCUMENT_ROOT . '/core/actions_builddoc.inc.php';
206
+	include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
207 207
 
208 208
 	if ($action == 'set_thirdparty' && $permissiontoadd) {
209 209
 		$object->setValueFrom('fk_soc', GETPOSTINT('fk_soc'), '', null, 'date', '', $user, $triggermodname);
@@ -215,8 +215,8 @@  discard block
 block discarded – undo
215 215
 	// Actions to send emails
216 216
 	$triggersendname = 'HRM_SKILL_SENTBYMAIL';
217 217
 	$autocopy = 'MAIN_MAIL_AUTOCOPY_SKILL_TO';
218
-	$trackid = 'skill' . $object->id;
219
-	include DOL_DOCUMENT_ROOT . '/core/actions_sendmails.inc.php';
218
+	$trackid = 'skill'.$object->id;
219
+	include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
220 220
 
221 221
 	if ($action == 'confirm_clone' && $confirm != 'yes') {
222 222
 		$action = '';
@@ -245,25 +245,25 @@  discard block
 block discarded – undo
245 245
 
246 246
 // Part to create
247 247
 if ($action == 'create') {
248
-	print load_fiche_titre($langs->trans("NewSkill"), '', 'object_' . $object->picto);
248
+	print load_fiche_titre($langs->trans("NewSkill"), '', 'object_'.$object->picto);
249 249
 
250
-	print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">';
251
-	print '<input type="hidden" name="token" value="' . newToken() . '">';
250
+	print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
251
+	print '<input type="hidden" name="token" value="'.newToken().'">';
252 252
 	print '<input type="hidden" name="action" value="add">';
253
-	$backtopage .= (strpos($backtopage, '?') > 0 ? '&' : '?') ."objecttype=job";
253
+	$backtopage .= (strpos($backtopage, '?') > 0 ? '&' : '?')."objecttype=job";
254 254
 	if ($backtopage) {
255
-		print '<input type="hidden" name="backtopage" value="' . $backtopage . '">';
255
+		print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
256 256
 	}
257 257
 	if ($backtopageforcancel) {
258
-		print '<input type="hidden" name="backtopageforcancel" value="' . $backtopageforcancel . '">';
258
+		print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">';
259 259
 	}
260 260
 
261 261
 	print dol_get_fiche_head(array(), '');
262 262
 
263
-	print '<table class="border centpercent tableforfieldcreate">' . "\n";
263
+	print '<table class="border centpercent tableforfieldcreate">'."\n";
264 264
 
265 265
 	// Common attributes
266
-	include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_add.tpl.php';
266
+	include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_add.tpl.php';
267 267
 
268 268
 	// Other attributes
269 269
 	include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php';
@@ -273,12 +273,12 @@  discard block
 block discarded – undo
273 273
 	//@todo je stop ici ... à continuer  (affichage des 5 skilled input pour create action
274 274
 	//print $object->showInputField($val, $key, $value, '', '['']', '', 0);
275 275
 
276
-	print '</table>' . "\n";
276
+	print '</table>'."\n";
277 277
 	print '<hr>';
278 278
 
279
-	print '<table class="border centpercent =">' . "\n";
279
+	print '<table class="border centpercent =">'."\n";
280 280
 	for ($i = 1; $i <= $MaxNumberSkill; $i++) {
281
-		print '<tr><td class="titlefieldcreate tdtop">'. $langs->trans('Description') . ' ' . $langs->trans('rank') . ' ' . $i . '</td>';
281
+		print '<tr><td class="titlefieldcreate tdtop">'.$langs->trans('Description').' '.$langs->trans('rank').' '.$i.'</td>';
282 282
 		print '<td class="valuefieldcreate"><textarea name="descriptionline[]" rows="5"  class="flat minwidth100" style="margin-top: 5px; width: 90%"></textarea></td>';
283 283
 	}
284 284
 	print '</table>';
@@ -286,9 +286,9 @@  discard block
 block discarded – undo
286 286
 	print dol_get_fiche_end();
287 287
 
288 288
 	print '<div class="center">';
289
-	print '<input type="submit" class="button" name="add" value="' . dol_escape_htmltag($langs->trans("Create")) . '">';
289
+	print '<input type="submit" class="button" name="add" value="'.dol_escape_htmltag($langs->trans("Create")).'">';
290 290
 	print '&nbsp; ';
291
-	print '<input type="' . ($backtopage ? "submit" : "button") . '" class="button button-cancel" name="cancel" value="' . dol_escape_htmltag($langs->trans("Cancel")) . '"' . ($backtopage ? '' : ' onclick="history.go(-1)"') . '>';
291
+	print '<input type="'.($backtopage ? "submit" : "button").'" class="button button-cancel" name="cancel" value="'.dol_escape_htmltag($langs->trans("Cancel")).'"'.($backtopage ? '' : ' onclick="history.go(-1)"').'>';
292 292
 	print '</div>';
293 293
 
294 294
 	print '</form>';
@@ -299,25 +299,25 @@  discard block
 block discarded – undo
299 299
 // Part to edit record
300 300
 // and skilldet edition
301 301
 if (($id || $ref) && $action == 'edit') {
302
-	print load_fiche_titre($langs->trans("Skill"), '', 'object_' . $object->picto);
302
+	print load_fiche_titre($langs->trans("Skill"), '', 'object_'.$object->picto);
303 303
 
304
-	print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">';
305
-	print '<input type="hidden" name="token" value="' . newToken() . '">';
304
+	print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
305
+	print '<input type="hidden" name="token" value="'.newToken().'">';
306 306
 	print '<input type="hidden" name="action" value="update">';
307
-	print '<input type="hidden" name="id" value="' . $object->id . '">';
307
+	print '<input type="hidden" name="id" value="'.$object->id.'">';
308 308
 	if ($backtopage) {
309
-		print '<input type="hidden" name="backtopage" value="' . $backtopage . '">';
309
+		print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
310 310
 	}
311 311
 	if ($backtopageforcancel) {
312
-		print '<input type="hidden" name="backtopageforcancel" value="' . $backtopageforcancel . '">';
312
+		print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">';
313 313
 	}
314 314
 
315 315
 	print dol_get_fiche_head();
316 316
 
317
-	print '<table class="border centpercent tableforfieldedit">' . "\n";
317
+	print '<table class="border centpercent tableforfieldedit">'."\n";
318 318
 
319 319
 	// Common attributes
320
-	include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_edit.tpl.php';
320
+	include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_edit.tpl.php';
321 321
 
322 322
 	// Other attributes
323 323
 	include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_edit.tpl.php';
@@ -341,7 +341,7 @@  discard block
 block discarded – undo
341 341
 				continue;
342 342
 			}
343 343
 
344
-			print '<table class="border centpercent =">' . "\n";
344
+			print '<table class="border centpercent =">'."\n";
345 345
 			$sk->fields = dol_sort_array($sk->fields, 'position');
346 346
 			foreach ($sk->fields as $key => $val) {
347 347
 				if (abs($val['visible']) != 1 && abs($val['visible']) != 3 && abs($val['visible']) != 4) {
@@ -352,7 +352,7 @@  discard block
 block discarded – undo
352 352
 					continue; // We don't want this field
353 353
 				}
354 354
 
355
-				print '<tr class="field_' . $key . '"><td';
355
+				print '<tr class="field_'.$key.'"><td';
356 356
 				print ' class="titlefieldcreate';
357 357
 				if (isset($val['notnull']) && $val['notnull'] > 0) {
358 358
 					print ' fieldrequired';
@@ -400,7 +400,7 @@  discard block
 block discarded – undo
400 400
 					print $sk->showOutputField($val, $key, $value, '', '', '', 0);
401 401
 				} else {
402 402
 					/** @var Skilldet $sk */
403
-					print $sk->showInputField($val, $key, $value, "", "line[" . $sk->id . "]", "", "");
403
+					print $sk->showInputField($val, $key, $value, "", "line[".$sk->id."]", "", "");
404 404
 				}
405 405
 				print '</td>';
406 406
 				print '</tr>';
@@ -412,8 +412,8 @@  discard block
 block discarded – undo
412 412
 
413 413
 	print dol_get_fiche_end();
414 414
 
415
-	print '<div class="center"><input type="submit" class="button button-save" name="save" value="' . $langs->trans("Save") . '">';
416
-	print ' &nbsp; <input type="submit" class="button button-cancel" name="cancel" value="' . $langs->trans("Cancel") . '">';
415
+	print '<div class="center"><input type="submit" class="button button-save" name="save" value="'.$langs->trans("Save").'">';
416
+	print ' &nbsp; <input type="submit" class="button button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">';
417 417
 	print '</div>';
418 418
 
419 419
 	print '</form>';
@@ -431,11 +431,11 @@  discard block
 block discarded – undo
431 431
 
432 432
 	// Confirmation to delete
433 433
 	if ($action == 'delete') {
434
-		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteSkill'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1);
434
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteSkill'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1);
435 435
 	}
436 436
 	// Confirmation to delete line
437 437
 	if ($action == 'deleteline') {
438
-		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&lineid=' . $lineid, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteline', '', 0, 1);
438
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteline', '', 0, 1);
439 439
 	}
440 440
 	// Confirmation clone
441 441
 	if ($action === 'clone') {
@@ -460,7 +460,7 @@  discard block
 block discarded – undo
460 460
 
461 461
 	// Object card
462 462
 	// ------------------------------------------------------------
463
-	$linkback = '<a href="' . DOL_URL_ROOT.'/hrm/skill_list.php?restore_lastsearch_values=1' . (!empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
463
+	$linkback = '<a href="'.DOL_URL_ROOT.'/hrm/skill_list.php?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
464 464
 
465 465
 
466 466
 	$morehtmlref = '<div class="refid">';
@@ -472,10 +472,10 @@  discard block
 block discarded – undo
472 472
 	print '<div class="fichecenter">';
473 473
 	print '<div class="fichehalfleft">';
474 474
 	print '<div class="underbanner clearboth"></div>';
475
-	print '<table class="border centpercent tableforfield">' . "\n";
475
+	print '<table class="border centpercent tableforfield">'."\n";
476 476
 
477 477
 	$object->fields['label']['visible'] = 0; // Already in banner
478
-	include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_view.tpl.php';
478
+	include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php';
479 479
 
480 480
 	// Other attributes. Fields from hook formObjectOptions and Extrafields.
481 481
 	include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
@@ -495,7 +495,7 @@  discard block
 block discarded – undo
495 495
 	// Buttons for actions
496 496
 
497 497
 	if ($action != 'presend' && $action != 'editline') {
498
-		print '<div class="tabsAction">' . "\n";
498
+		print '<div class="tabsAction">'."\n";
499 499
 		$parameters = array();
500 500
 		$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
501 501
 		if ($reshook < 0) {
@@ -505,19 +505,19 @@  discard block
 block discarded – undo
505 505
 		if (empty($reshook)) {
506 506
 			// Back to draft
507 507
 			if ($object->status == $object::STATUS_VALIDATED) {
508
-				print dolGetButtonAction($langs->trans('SetToDraft'), '', 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=confirm_setdraft&confirm=yes&token=' . newToken(), '', $permissiontoadd);
508
+				print dolGetButtonAction($langs->trans('SetToDraft'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=confirm_setdraft&confirm=yes&token='.newToken(), '', $permissiontoadd);
509 509
 			}
510 510
 
511
-			print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=edit&token=' . newToken(), '', $permissiontoadd);
511
+			print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit&token='.newToken(), '', $permissiontoadd);
512 512
 
513 513
 			// Clone
514 514
 			if ($permissiontoadd) {
515 515
 				print dolGetButtonAction('', $langs->trans('ToClone'), 'default', $_SERVER["PHP_SELF"].'?action=clone&token='.newToken().'&id='.$object->id, '');
516 516
 			}
517 517
 			// Delete (need delete permission, or if draft, just need create/modify permission)
518
-			print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=delete&token=' . newToken(), '', $permissiontodelete);
518
+			print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=delete&token='.newToken(), '', $permissiontodelete);
519 519
 		}
520
-		print '</div>' . "\n";
520
+		print '</div>'."\n";
521 521
 	}
522 522
 }
523 523
 
@@ -525,12 +525,12 @@  discard block
 block discarded – undo
525 525
 //*---------------------------------------------------------------------------
526 526
 
527 527
 if ($action != "create" && $action != "edit") {
528
-	require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php';
529
-	require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
530
-	require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
528
+	require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
529
+	require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
530
+	require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
531 531
 
532 532
 	// load hrm libraries
533
-	require_once __DIR__ . '/class/skilldet.class.php';
533
+	require_once __DIR__.'/class/skilldet.class.php';
534 534
 
535 535
 	// for other modules
536 536
 	//dol_include_once('/othermodule/class/otherobject.class.php');
@@ -567,8 +567,8 @@  discard block
 block discarded – undo
567 567
 
568 568
 	// Default sort order (if not yet defined by previous GETPOST)
569 569
 	if (!$sortfield) {
570
-		reset($objectline->fields);                    // Reset is required to avoid key() to return null.
571
-		$sortfield = "t." . key($objectline->fields); // Set here default search field. By default 1st field in definition.
570
+		reset($objectline->fields); // Reset is required to avoid key() to return null.
571
+		$sortfield = "t.".key($objectline->fields); // Set here default search field. By default 1st field in definition.
572 572
 	}
573 573
 	if (!$sortorder) {
574 574
 		$sortorder = "ASC";
@@ -578,12 +578,12 @@  discard block
 block discarded – undo
578 578
 	$search_all = GETPOST('search_all', 'alphanohtml');
579 579
 	$search = array();
580 580
 	foreach ($objectline->fields as $key => $val) {
581
-		if (GETPOST('search_' . $key, 'alpha') !== '') {
582
-			$search[$key] = GETPOST('search_' . $key, 'alpha');
581
+		if (GETPOST('search_'.$key, 'alpha') !== '') {
582
+			$search[$key] = GETPOST('search_'.$key, 'alpha');
583 583
 		}
584 584
 		if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
585
-			$search[$key . '_dtstart'] = dol_mktime(0, 0, 0, GETPOSTINT('search_' . $key . '_dtstartmonth'), GETPOSTINT('search_' . $key . '_dtstartday'), GETPOSTINT('search_' . $key . '_dtstartyear'));
586
-			$search[$key . '_dtend'] = dol_mktime(23, 59, 59, GETPOSTINT('search_' . $key . '_dtendmonth'), GETPOSTINT('search_' . $key . '_dtendday'), GETPOSTINT('search_' . $key . '_dtendyear'));
585
+			$search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOSTINT('search_'.$key.'_dtstartmonth'), GETPOSTINT('search_'.$key.'_dtstartday'), GETPOSTINT('search_'.$key.'_dtstartyear'));
586
+			$search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOSTINT('search_'.$key.'_dtendmonth'), GETPOSTINT('search_'.$key.'_dtendday'), GETPOSTINT('search_'.$key.'_dtendyear'));
587 587
 		}
588 588
 	}
589 589
 
@@ -591,7 +591,7 @@  discard block
 block discarded – undo
591 591
 	$fieldstosearchall = array();
592 592
 	foreach ($objectline->fields as $key => $val) {
593 593
 		if (!empty($val['searchall'])) {
594
-			$fieldstosearchall['t.' . $key] = $val['label'];
594
+			$fieldstosearchall['t.'.$key] = $val['label'];
595 595
 		}
596 596
 	}
597 597
 
@@ -601,7 +601,7 @@  discard block
 block discarded – undo
601 601
 		// If $val['visible']==0, then we never show the field
602 602
 		if (!empty($val['visible'])) {
603 603
 			$visible = (int) dol_eval((string) $val['visible'], 1, 1, '1');
604
-			$arrayfields['t.' . $key] = array(
604
+			$arrayfields['t.'.$key] = array(
605 605
 				'label' => $val['label'],
606 606
 				'checked' => (($visible < 0) ? 0 : 1),
607 607
 				'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)),
@@ -631,9 +631,9 @@  discard block
 block discarded – undo
631 631
 	// --------------------------------------------------------------------
632 632
 	$sql = 'SELECT ';
633 633
 	$sql .= $objectline->getFieldList('t');
634
-	$sql .= " FROM " . MAIN_DB_PREFIX . $objectline->table_element . " as t";
634
+	$sql .= " FROM ".MAIN_DB_PREFIX.$objectline->table_element." as t";
635 635
 	if ($objectline->ismultientitymanaged == 1) {
636
-		$sql .= " WHERE t.entity IN (" . getEntity($objectline->element) . ")";
636
+		$sql .= " WHERE t.entity IN (".getEntity($objectline->element).")";
637 637
 	} else {
638 638
 		$sql .= " WHERE 1 = 1 ";
639 639
 	}
@@ -644,41 +644,41 @@  discard block
 block discarded – undo
644 644
 	$nbtotalofrecords = $db->num_rows($resql);
645 645
 	$num = $db->num_rows($resql);
646 646
 
647
-	print '<form method="POST" id="searchFormList" action="' . $_SERVER["PHP_SELF"] . '">' . "\n";
647
+	print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
648 648
 	if ($optioncss != '') {
649
-		print '<input type="hidden" name="optioncss" value="' . $optioncss . '">';
649
+		print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
650 650
 	}
651
-	print '<input type="hidden" name="token" value="' . newToken() . '">';
651
+	print '<input type="hidden" name="token" value="'.newToken().'">';
652 652
 	print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
653 653
 	print '<input type="hidden" name="action" value="list">';
654
-	print '<input type="hidden" name="sortfield" value="' . $sortfield . '">';
655
-	print '<input type="hidden" name="sortorder" value="' . $sortorder . '">';
656
-	print '<input type="hidden" name="page" value="' . $page . '">';
657
-	print '<input type="hidden" name="contextpage" value="' . $contextpage . '">';
654
+	print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
655
+	print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
656
+	print '<input type="hidden" name="page" value="'.$page.'">';
657
+	print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
658 658
 	if (!empty($id)) {
659
-		print '<input type="hidden" name="id" value="' . $id . '">';
659
+		print '<input type="hidden" name="id" value="'.$id.'">';
660 660
 	}
661 661
 
662
-	$param_fk = "&fk_skill=" . $id . "&fk_user_creat=" . (!empty($user->rowid) ? $user->rowid : 0);
663
-	$backtopage = dol_buildpath('/hrm/skill_card.php', 1) . '?id=' . $id;
662
+	$param_fk = "&fk_skill=".$id."&fk_user_creat=".(!empty($user->rowid) ? $user->rowid : 0);
663
+	$backtopage = dol_buildpath('/hrm/skill_card.php', 1).'?id='.$id;
664 664
 	$param = "";
665 665
 	$massactionbutton = "";
666 666
 	//$newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', dol_buildpath('/hrm/skilldet_card.php', 1) . '?action=create&backtopage=' . urlencode($_SERVER['PHP_SELF']) . $param_fk . '&backtopage=' . $backtopage, '', $permissiontoadd);
667 667
 
668
-	print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'object_' . $object->picto, 0, '', '', 0, 0, 0, 1);
668
+	print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'object_'.$object->picto, 0, '', '', 0, 0, 0, 1);
669 669
 
670 670
 	// Add code for pre mass action (confirmation or email presend form)
671 671
 	$topicmail = "SendSkilldetRef";
672 672
 	$modelmail = "skilldet";
673 673
 	$objecttmp = new Skilldet($db);
674
-	$trackid = 'xxxx' . $object->id;
674
+	$trackid = 'xxxx'.$object->id;
675 675
 	//include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
676 676
 
677 677
 	if ($search_all) {
678 678
 		foreach ($fieldstosearchall as $key => $val) {
679 679
 			$fieldstosearchall[$key] = $langs->trans($val);
680 680
 		}
681
-		print '<div class="divsearchfieldfilter">' . $langs->trans("FilterOnInto", $search_all) . implode(', ', $fieldstosearchall) . '</div>';
681
+		print '<div class="divsearchfieldfilter">'.$langs->trans("FilterOnInto", $search_all).implode(', ', $fieldstosearchall).'</div>';
682 682
 	}
683 683
 
684 684
 	$moreforfilter = '';
@@ -705,7 +705,7 @@  discard block
 block discarded – undo
705 705
 	//  $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
706 706
 
707 707
 	print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
708
-	print '<table class="tagtable nobottomiftotal liste' . ($moreforfilter ? " listwithfilterbefore" : "") . '">' . "\n";
708
+	print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
709 709
 
710 710
 
711 711
 	// Fields title label
@@ -722,13 +722,13 @@  discard block
 block discarded – undo
722 722
 		//      } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) {
723 723
 		//          $cssforfield .= ($cssforfield ? ' ' : '') . 'right';
724 724
 		//      }
725
-		if (!empty($arrayfields['t.' . $key]['checked'])) {
726
-			print getTitleFieldOfList($arrayfields['t.' . $key]['label'], 0, $_SERVER['PHP_SELF'], 't.' . $key, '', $param, (!empty($cssforfield) ? 'class="' . $cssforfield . '"' : ''), $sortfield, $sortorder, (!empty($cssforfield) ? $cssforfield . ' ' : '')) . "\n";
725
+		if (!empty($arrayfields['t.'.$key]['checked'])) {
726
+			print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, (!empty($cssforfield) ? 'class="'.$cssforfield.'"' : ''), $sortfield, $sortorder, (!empty($cssforfield) ? $cssforfield.' ' : ''))."\n";
727 727
 		}
728 728
 	}
729 729
 	//print '<td></td>';
730 730
 	print '<td></td>';
731
-	print '</tr>' . "\n";
731
+	print '</tr>'."\n";
732 732
 
733 733
 
734 734
 	// Display all ranks of skill
@@ -771,14 +771,14 @@  discard block
 block discarded – undo
771 771
 			//          }
772 772
 			//if (in_array($key, array('fk_soc', 'fk_user', 'fk_warehouse'))) $cssforfield = 'tdoverflowmax100';
773 773
 
774
-			if (!empty($arrayfields['t.' . $key]['checked'])) {
775
-				print '<td' . (empty($cssforfield) ? '' : ' class="' . $cssforfield . '"') . '>';
774
+			if (!empty($arrayfields['t.'.$key]['checked'])) {
775
+				print '<td'.(empty($cssforfield) ? '' : ' class="'.$cssforfield.'"').'>';
776 776
 				if ($key == 'status') {
777 777
 					print $objectline->getLibStatut(5);
778 778
 				} elseif ($key == 'rowid') {
779 779
 					print $objectline->showOutputField($val, $key, (string) $objectline->id, '');
780 780
 					// ajout pencil
781
-					print '<a class="timeline-btn" href="' . DOL_MAIN_URL_ROOT . '/comm/action/skilldet_card.php?action=edit&id=' . $objectline->id . '"><i class="fa fa-pencil" title="' . $langs->trans("Modify") . '" ></i></a>';
781
+					print '<a class="timeline-btn" href="'.DOL_MAIN_URL_ROOT.'/comm/action/skilldet_card.php?action=edit&id='.$objectline->id.'"><i class="fa fa-pencil" title="'.$langs->trans("Modify").'" ></i></a>';
782 782
 				} else {
783 783
 					print $objectline->showOutputField($val, $key, $objectline->$key, '');
784 784
 				}
@@ -790,15 +790,15 @@  discard block
 block discarded – undo
790 790
 				}
791 791
 				if (!empty($val['isameasure']) && $val['isameasure'] == 1) {
792 792
 					if (!$i) {
793
-						$totalarray['pos'][$totalarray['nbfield']] = 't.' . $key;
793
+						$totalarray['pos'][$totalarray['nbfield']] = 't.'.$key;
794 794
 					}
795 795
 					if (!isset($totalarray['val'])) {
796 796
 						$totalarray['val'] = array();
797 797
 					}
798
-					if (!isset($totalarray['val']['t.' . $key])) {
799
-						$totalarray['val']['t.' . $key] = 0;
798
+					if (!isset($totalarray['val']['t.'.$key])) {
799
+						$totalarray['val']['t.'.$key] = 0;
800 800
 					}
801
-					$totalarray['val']['t.' . $key] += $objectline->$key;
801
+					$totalarray['val']['t.'.$key] += $objectline->$key;
802 802
 				}
803 803
 			}
804 804
 		}
@@ -831,7 +831,7 @@  discard block
 block discarded – undo
831 831
 			$totalarray['nbfield']++;
832 832
 		}
833 833
 
834
-		print '</tr>' . "\n";
834
+		print '</tr>'."\n";
835 835
 
836 836
 		$i++;
837 837
 	}
@@ -846,7 +846,7 @@  discard block
 block discarded – undo
846 846
 				$colspan++;
847 847
 			}
848 848
 		}
849
-		print '<tr><td colspan="' . $colspan . '"><span class="opacitymedium">' . $langs->trans("NoRecordFound") . '</span></td></tr>';
849
+		print '<tr><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>';
850 850
 	}
851 851
 
852 852
 	if (!empty($resql)) {
@@ -857,10 +857,10 @@  discard block
 block discarded – undo
857 857
 	$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $objectline); // Note that $action and $objectline may have been modified by hook
858 858
 	print $hookmanager->resPrint;
859 859
 
860
-	print '</table>' . "\n";
861
-	print '</div>' . "\n";
860
+	print '</table>'."\n";
861
+	print '</div>'."\n";
862 862
 
863
-	print '</form>' . "\n";
863
+	print '</form>'."\n";
864 864
 
865 865
 	//  if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) {
866 866
 	//      $hidegeneratedfilelistifempty = 1;
@@ -899,9 +899,9 @@  discard block
 block discarded – undo
899 899
 	$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/hrm/skill_agenda.php?id='.$object->id);
900 900
 
901 901
 	// List of actions on element
902
-	include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
902
+	include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
903 903
 	$formactions = new FormActions($db);
904
-	$somethingshown = $formactions->showactions($object, $object->element . '@' . $object->module, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlcenter);
904
+	$somethingshown = $formactions->showactions($object, $object->element.'@'.$object->module, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlcenter);
905 905
 
906 906
 	print '</div></div>';
907 907
 }
Please login to merge, or discard this patch.
htdocs/core/class/html.formcompany.class.php 1 patch
Spacing   +111 added lines, -111 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
  *	Only common components are here.
34 34
  */
35 35
 
36
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.form.class.php';
36
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
37 37
 
38 38
 
39 39
 /**
@@ -57,13 +57,13 @@  discard block
 block discarded – undo
57 57
 		$effs = array();
58 58
 
59 59
 		$sql = "SELECT id, code, libelle as label";
60
-		$sql .= " FROM " . $this->db->prefix() . "c_typent";
61
-		$sql .= " WHERE active = 1 AND (fk_country IS NULL OR fk_country = " . (empty($mysoc->country_id) ? '0' : $mysoc->country_id) . ")";
60
+		$sql .= " FROM ".$this->db->prefix()."c_typent";
61
+		$sql .= " WHERE active = 1 AND (fk_country IS NULL OR fk_country = ".(empty($mysoc->country_id) ? '0' : $mysoc->country_id).")";
62 62
 		if ($filter) {
63
-			$sql .= " " . $filter;
63
+			$sql .= " ".$filter;
64 64
 		}
65 65
 		$sql .= " ORDER by position, id";
66
-		dol_syslog(get_class($this) . '::typent_array', LOG_DEBUG);
66
+		dol_syslog(get_class($this).'::typent_array', LOG_DEBUG);
67 67
 		$resql = $this->db->query($sql);
68 68
 		if ($resql) {
69 69
 			$num = $this->db->num_rows($resql);
@@ -106,13 +106,13 @@  discard block
 block discarded – undo
106 106
 		$effs = array();
107 107
 
108 108
 		$sql = "SELECT id, code, libelle as label";
109
-		$sql .= " FROM " . $this->db->prefix() . "c_effectif";
109
+		$sql .= " FROM ".$this->db->prefix()."c_effectif";
110 110
 		$sql .= " WHERE active = 1";
111 111
 		if ($filter) {
112
-			$sql .= " " . $filter;
112
+			$sql .= " ".$filter;
113 113
 		}
114 114
 		$sql .= " ORDER BY id ASC";
115
-		dol_syslog(get_class($this) . '::effectif_array', LOG_DEBUG);
115
+		dol_syslog(get_class($this).'::effectif_array', LOG_DEBUG);
116 116
 		$resql = $this->db->query($sql);
117 117
 		if ($resql) {
118 118
 			$num = $this->db->num_rows($resql);
@@ -153,13 +153,13 @@  discard block
 block discarded – undo
153 153
 		// phpcs:enable
154 154
 		global $user, $langs;
155 155
 
156
-		print '<form method="post" action="' . $page . '">';
156
+		print '<form method="post" action="'.$page.'">';
157 157
 		print '<input type="hidden" name="action" value="setprospectlevel">';
158
-		print '<input type="hidden" name="token" value="' . newToken() . '">';
158
+		print '<input type="hidden" name="token" value="'.newToken().'">';
159 159
 
160
-		dol_syslog(get_class($this) . '::form_prospect_level', LOG_DEBUG);
160
+		dol_syslog(get_class($this).'::form_prospect_level', LOG_DEBUG);
161 161
 		$sql = "SELECT code, label";
162
-		$sql .= " FROM " . $this->db->prefix() . "c_prospectlevel";
162
+		$sql .= " FROM ".$this->db->prefix()."c_prospectlevel";
163 163
 		$sql .= " WHERE active > 0";
164 164
 		$sql .= " ORDER BY sortorder";
165 165
 		$resql = $this->db->query($sql);
@@ -185,9 +185,9 @@  discard block
 block discarded – undo
185 185
 			dol_print_error($this->db);
186 186
 		}
187 187
 		if (!empty($htmlname) && $user->admin) {
188
-			print ' ' . info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
188
+			print ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
189 189
 		}
190
-		print '<input type="submit" class="button button-save valignmiddle small" value="' . $langs->trans("Modify") . '">';
190
+		print '<input type="submit" class="button button-save valignmiddle small" value="'.$langs->trans("Modify").'">';
191 191
 		print '</form>';
192 192
 	}
193 193
 
@@ -204,13 +204,13 @@  discard block
 block discarded – undo
204 204
 	{
205 205
 		global $user, $langs;
206 206
 
207
-		print '<form method="post" action="' . $page . '">';
207
+		print '<form method="post" action="'.$page.'">';
208 208
 		print '<input type="hidden" name="action" value="setprospectcontactlevel">';
209
-		print '<input type="hidden" name="token" value="' . newToken() . '">';
209
+		print '<input type="hidden" name="token" value="'.newToken().'">';
210 210
 
211 211
 		dol_syslog(__METHOD__, LOG_DEBUG);
212 212
 		$sql = "SELECT code, label";
213
-		$sql .= " FROM " . $this->db->prefix() . "c_prospectcontactlevel";
213
+		$sql .= " FROM ".$this->db->prefix()."c_prospectcontactlevel";
214 214
 		$sql .= " WHERE active > 0";
215 215
 		$sql .= " ORDER BY sortorder";
216 216
 		$resql = $this->db->query($sql);
@@ -236,9 +236,9 @@  discard block
 block discarded – undo
236 236
 			dol_print_error($this->db);
237 237
 		}
238 238
 		if (!empty($htmlname) && $user->admin) {
239
-			print ' ' . info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
239
+			print ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
240 240
 		}
241
-		print '<input type="submit" class="button button-save valignmiddle small" value="' . $langs->trans("Modify") . '">';
241
+		print '<input type="submit" class="button button-save valignmiddle small" value="'.$langs->trans("Modify").'">';
242 242
 		print '</form>';
243 243
 	}
244 244
 
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
 		// phpcs:enable
280 280
 		global $conf, $langs, $user;
281 281
 
282
-		dol_syslog(get_class($this) . "::select_departement selected=" . $selected . ", country_codeid=" . $country_codeid, LOG_DEBUG);
282
+		dol_syslog(get_class($this)."::select_departement selected=".$selected.", country_codeid=".$country_codeid, LOG_DEBUG);
283 283
 
284 284
 		$langs->load("dict");
285 285
 
@@ -287,28 +287,28 @@  discard block
 block discarded – undo
287 287
 
288 288
 		// Search departements/cantons/province active d'une region et pays actif
289 289
 		$sql = "SELECT d.rowid, d.code_departement as code, d.nom as name, d.active, c.label as country, c.code as country_code, r.nom as region_name FROM";
290
-		$sql .= " " . $this->db->prefix() . "c_departements as d, " . $this->db->prefix() . "c_regions as r," . $this->db->prefix() . "c_country as c";
290
+		$sql .= " ".$this->db->prefix()."c_departements as d, ".$this->db->prefix()."c_regions as r,".$this->db->prefix()."c_country as c";
291 291
 		$sql .= " WHERE d.fk_region=r.code_region and r.fk_pays=c.rowid";
292 292
 		$sql .= " AND d.active = 1 AND r.active = 1 AND c.active = 1";
293 293
 		if ($country_codeid && is_numeric($country_codeid)) {
294
-			$sql .= " AND c.rowid = '" . $this->db->escape($country_codeid) . "'";
294
+			$sql .= " AND c.rowid = '".$this->db->escape($country_codeid)."'";
295 295
 		}
296 296
 		if ($country_codeid && !is_numeric($country_codeid)) {
297
-			$sql .= " AND c.code = '" . $this->db->escape($country_codeid) . "'";
297
+			$sql .= " AND c.code = '".$this->db->escape($country_codeid)."'";
298 298
 		}
299 299
 		$sql .= " ORDER BY c.code, d.code_departement";
300 300
 
301 301
 		$result = $this->db->query($sql);
302 302
 		if ($result) {
303 303
 			if (!empty($htmlname)) {
304
-				$out .= '<select id="' . $htmlname . '" class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">';
304
+				$out .= '<select id="'.$htmlname.'" class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
305 305
 			}
306 306
 			if ($country_codeid) {
307 307
 				$out .= '<option value="0">&nbsp;</option>';
308 308
 			}
309 309
 			$num = $this->db->num_rows($result);
310 310
 			$i = 0;
311
-			dol_syslog(get_class($this) . "::select_departement num=" . $num, LOG_DEBUG);
311
+			dol_syslog(get_class($this)."::select_departement num=".$num, LOG_DEBUG);
312 312
 			if ($num) {
313 313
 				$country = '';
314 314
 				while ($i < $num) {
@@ -319,15 +319,15 @@  discard block
 block discarded – undo
319 319
 						if (!$country || $country != $obj->country) {
320 320
 							// Show break if we are in list with multiple countries
321 321
 							if (!$country_codeid && $obj->country_code) {
322
-								$out .= '<option value="-1" disabled data-html="----- ' . $obj->country . ' -----">----- ' . $obj->country . " -----</option>\n";
322
+								$out .= '<option value="-1" disabled data-html="----- '.$obj->country.' -----">----- '.$obj->country." -----</option>\n";
323 323
 								$country = $obj->country;
324 324
 							}
325 325
 						}
326 326
 
327 327
 						if (!empty($selected) && $selected == $obj->rowid) {
328
-							$out .= '<option value="' . $obj->rowid . '" selected>';
328
+							$out .= '<option value="'.$obj->rowid.'" selected>';
329 329
 						} else {
330
-							$out .= '<option value="' . $obj->rowid . '">';
330
+							$out .= '<option value="'.$obj->rowid.'">';
331 331
 						}
332 332
 
333 333
 						// Si traduction existe, on l'utilise, sinon on prend le libelle par default
@@ -336,13 +336,13 @@  discard block
 block discarded – undo
336 336
 							(getDolGlobalInt('MAIN_SHOW_STATE_CODE') == 1 || getDolGlobalInt('MAIN_SHOW_STATE_CODE') == 2 || getDolGlobalString('MAIN_SHOW_STATE_CODE') === 'all')
337 337
 						) {
338 338
 							if (getDolGlobalInt('MAIN_SHOW_REGION_IN_STATE_SELECT') == 1) {
339
-								$out .= $obj->region_name . ' - ' . $obj->code . ' - ' . ($langs->trans($obj->code) != $obj->code ? $langs->trans($obj->code) : ($obj->name != '-' ? $obj->name : ''));
339
+								$out .= $obj->region_name.' - '.$obj->code.' - '.($langs->trans($obj->code) != $obj->code ? $langs->trans($obj->code) : ($obj->name != '-' ? $obj->name : ''));
340 340
 							} else {
341
-								$out .= $obj->code . ' - ' . ($langs->trans($obj->code) != $obj->code ? $langs->trans($obj->code) : ($obj->name != '-' ? $obj->name : ''));
341
+								$out .= $obj->code.' - '.($langs->trans($obj->code) != $obj->code ? $langs->trans($obj->code) : ($obj->name != '-' ? $obj->name : ''));
342 342
 							}
343 343
 						} else {
344 344
 							if (getDolGlobalInt('MAIN_SHOW_REGION_IN_STATE_SELECT') == 1) {
345
-								$out .= $obj->region_name . ' - ' . ($langs->trans($obj->code) != $obj->code ? $langs->trans($obj->code) : ($obj->name != '-' ? $obj->name : ''));
345
+								$out .= $obj->region_name.' - '.($langs->trans($obj->code) != $obj->code ? $langs->trans($obj->code) : ($obj->name != '-' ? $obj->name : ''));
346 346
 							} else {
347 347
 								$out .= ($langs->trans($obj->code) != $obj->code ? $langs->trans($obj->code) : ($obj->name != '-' ? $obj->name : ''));
348 348
 							}
@@ -357,7 +357,7 @@  discard block
 block discarded – undo
357 357
 				$out .= '</select>';
358 358
 			}
359 359
 			if (!empty($htmlname) && $user->admin) {
360
-				$out .= ' ' . info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
360
+				$out .= ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
361 361
 			}
362 362
 		} else {
363 363
 			dol_print_error($this->db);
@@ -365,7 +365,7 @@  discard block
 block discarded – undo
365 365
 
366 366
 		// Make select dynamic
367 367
 		if (!empty($htmlname)) {
368
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
368
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
369 369
 			$out .= ajax_combobox($htmlname);
370 370
 		}
371 371
 
@@ -418,14 +418,14 @@  discard block
 block discarded – undo
418 418
 		$langs->load("dict");
419 419
 
420 420
 		$sql = "SELECT r.rowid, r.code_region as code, r.nom as label, r.active, c.code as country_code, c.label as country";
421
-		$sql .= " FROM " . $this->db->prefix() . "c_regions as r, " . $this->db->prefix() . "c_country as c";
421
+		$sql .= " FROM ".$this->db->prefix()."c_regions as r, ".$this->db->prefix()."c_country as c";
422 422
 		$sql .= " WHERE r.fk_pays=c.rowid AND r.active = 1 and c.active = 1";
423 423
 		$sql .= " ORDER BY c.code, c.label ASC";
424 424
 
425
-		dol_syslog(get_class($this) . "::select_region", LOG_DEBUG);
425
+		dol_syslog(get_class($this)."::select_region", LOG_DEBUG);
426 426
 		$resql = $this->db->query($sql);
427 427
 		if ($resql) {
428
-			print '<select class="flat" id="' . $htmlname . '" name="' . $htmlname . '">';
428
+			print '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'">';
429 429
 			$num = $this->db->num_rows($resql);
430 430
 			$i = 0;
431 431
 			if ($num) {
@@ -437,16 +437,16 @@  discard block
 block discarded – undo
437 437
 					} else {
438 438
 						if ($country == '' || $country != $obj->country) {
439 439
 							// Show break
440
-							$key = $langs->trans("Country" . strtoupper($obj->country_code));
441
-							$valuetoshow = ($key != "Country" . strtoupper($obj->country_code)) ? $obj->country_code . " - " . $key : $obj->country;
442
-							print '<option value="-2" disabled>----- ' . $valuetoshow . " -----</option>\n";
440
+							$key = $langs->trans("Country".strtoupper($obj->country_code));
441
+							$valuetoshow = ($key != "Country".strtoupper($obj->country_code)) ? $obj->country_code." - ".$key : $obj->country;
442
+							print '<option value="-2" disabled>----- '.$valuetoshow." -----</option>\n";
443 443
 							$country = $obj->country;
444 444
 						}
445 445
 
446 446
 						if ($selected > 0 && $selected == $obj->code) {
447
-							print '<option value="' . $obj->code . '" selected>' . $obj->label . '</option>';
447
+							print '<option value="'.$obj->code.'" selected>'.$obj->label.'</option>';
448 448
 						} else {
449
-							print '<option value="' . $obj->code . '">' . $obj->label . '</option>';
449
+							print '<option value="'.$obj->code.'">'.$obj->label.'</option>';
450 450
 						}
451 451
 					}
452 452
 					$i++;
@@ -477,13 +477,13 @@  discard block
 block discarded – undo
477 477
 
478 478
 		$out = '';
479 479
 
480
-		$sql = "SELECT rowid, code, label, active FROM " . $this->db->prefix() . "c_civility";
480
+		$sql = "SELECT rowid, code, label, active FROM ".$this->db->prefix()."c_civility";
481 481
 		$sql .= " WHERE active = 1";
482 482
 
483 483
 		dol_syslog("Form::select_civility", LOG_DEBUG);
484 484
 		$resql = $this->db->query($sql);
485 485
 		if ($resql) {
486
-			$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
486
+			$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
487 487
 			$out .= '<option value="">&nbsp;</option>';
488 488
 			$num = $this->db->num_rows($resql);
489 489
 			$i = 0;
@@ -491,12 +491,12 @@  discard block
 block discarded – undo
491 491
 				while ($i < $num) {
492 492
 					$obj = $this->db->fetch_object($resql);
493 493
 					if ($selected == $obj->code) {
494
-						$out .= '<option value="' . $obj->code . '" selected>';
494
+						$out .= '<option value="'.$obj->code.'" selected>';
495 495
 					} else {
496
-						$out .= '<option value="' . $obj->code . '">';
496
+						$out .= '<option value="'.$obj->code.'">';
497 497
 					}
498 498
 					// If translation exists, we use it, otherwise, we use the hard coded label
499
-					$out .= ($langs->trans("Civility" . $obj->code) != "Civility" . $obj->code ? $langs->trans("Civility" . $obj->code) : ($obj->label != '-' ? $obj->label : ''));
499
+					$out .= ($langs->trans("Civility".$obj->code) != "Civility".$obj->code ? $langs->trans("Civility".$obj->code) : ($obj->label != '-' ? $obj->label : ''));
500 500
 					$out .= '</option>';
501 501
 					$i++;
502 502
 				}
@@ -508,7 +508,7 @@  discard block
 block discarded – undo
508 508
 
509 509
 			if ($addjscombo) {
510 510
 				// Enhance with select2
511
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
511
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
512 512
 				$out .= ajax_combobox($htmlname);
513 513
 			}
514 514
 		} else {
@@ -558,22 +558,22 @@  discard block
 block discarded – undo
558 558
 
559 559
 		// Lookup the active juridical types for the active countries
560 560
 		$sql  = "SELECT f.rowid, f.code as code , f.libelle as label, f.active, c.label as country, c.code as country_code";
561
-		$sql .= " FROM " . $this->db->prefix() . "c_forme_juridique as f, " . $this->db->prefix() . "c_country as c";
561
+		$sql .= " FROM ".$this->db->prefix()."c_forme_juridique as f, ".$this->db->prefix()."c_country as c";
562 562
 		$sql .= " WHERE f.fk_pays=c.rowid";
563 563
 		$sql .= " AND f.active = 1 AND c.active = 1";
564 564
 		if ($country_codeid) {
565
-			$sql .= " AND c.code = '" . $this->db->escape((string) $country_codeid) . "'";
565
+			$sql .= " AND c.code = '".$this->db->escape((string) $country_codeid)."'";
566 566
 		}
567 567
 		if ($filter) {
568
-			$sql .= " " . $filter;
568
+			$sql .= " ".$filter;
569 569
 		}
570 570
 		$sql .= " ORDER BY c.code";
571 571
 
572
-		dol_syslog(get_class($this) . "::select_juridicalstatus", LOG_DEBUG);
572
+		dol_syslog(get_class($this)."::select_juridicalstatus", LOG_DEBUG);
573 573
 		$resql = $this->db->query($sql);
574 574
 		if ($resql) {
575 575
 			$out .= '<div id="particulier2" class="visible">';
576
-			$out .= '<select class="flat minwidth200' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
576
+			$out .= '<select class="flat minwidth200'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
577 577
 			if ($country_codeid) {
578 578
 				$out .= '<option value="0">&nbsp;</option>'; // When country_codeid is set, we force to add an empty line because it does not appears from select. When not set, we already get the empty line from select.
579 579
 			}
@@ -587,9 +587,9 @@  discard block
 block discarded – undo
587 587
 					$obj = $this->db->fetch_object($resql);
588 588
 
589 589
 					if ($obj->code) {		// We exclude empty line, we will add it later
590
-						$labelcountry = (($langs->trans("Country" . $obj->country_code) != "Country" . $obj->country_code) ? $langs->trans("Country" . $obj->country_code) : $obj->country);
591
-						$labeljs = (($langs->trans("JuridicalStatus" . $obj->code) != "JuridicalStatus" . $obj->code) ? $langs->trans("JuridicalStatus" . $obj->code) : ($obj->label != '-' ? $obj->label : '')); // $obj->label is already in output charset (converted by database driver)
592
-						$arraydata[$obj->code] = array('code' => $obj->code, 'label' => $labeljs, 'label_sort' => $labelcountry . '_' . $labeljs, 'country_code' => $obj->country_code, 'country' => $labelcountry);
590
+						$labelcountry = (($langs->trans("Country".$obj->country_code) != "Country".$obj->country_code) ? $langs->trans("Country".$obj->country_code) : $obj->country);
591
+						$labeljs = (($langs->trans("JuridicalStatus".$obj->code) != "JuridicalStatus".$obj->code) ? $langs->trans("JuridicalStatus".$obj->code) : ($obj->label != '-' ? $obj->label : '')); // $obj->label is already in output charset (converted by database driver)
592
+						$arraydata[$obj->code] = array('code' => $obj->code, 'label' => $labeljs, 'label_sort' => $labelcountry.'_'.$labeljs, 'country_code' => $obj->country_code, 'country' => $labelcountry);
593 593
 					}
594 594
 					$i++;
595 595
 				}
@@ -603,15 +603,15 @@  discard block
 block discarded – undo
603 603
 					if (!$country || $country != $val['country']) {
604 604
 						// Show break when we are in multi country mode
605 605
 						if (empty($country_codeid) && $val['country_code']) {
606
-							$out .= '<option value="0" disabled class="selectoptiondisabledwhite">----- ' . $val['country'] . " -----</option>\n";
606
+							$out .= '<option value="0" disabled class="selectoptiondisabledwhite">----- '.$val['country']." -----</option>\n";
607 607
 							$country = $val['country'];
608 608
 						}
609 609
 					}
610 610
 
611 611
 					if ($selected > 0 && $selected == $val['code']) {
612
-						$out .= '<option value="' . $val['code'] . '" selected>';
612
+						$out .= '<option value="'.$val['code'].'" selected>';
613 613
 					} else {
614
-						$out .= '<option value="' . $val['code'] . '">';
614
+						$out .= '<option value="'.$val['code'].'">';
615 615
 					}
616 616
 					// If translation exists, we use it, otherwise we use default label in database
617 617
 					$out .= $val['label'];
@@ -620,11 +620,11 @@  discard block
 block discarded – undo
620 620
 			}
621 621
 			$out .= '</select>';
622 622
 			if ($user->admin) {
623
-				$out .= ' ' . info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
623
+				$out .= ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
624 624
 			}
625 625
 
626 626
 			// Make select dynamic
627
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
627
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
628 628
 			$out .= ajax_combobox($htmlname);
629 629
 
630 630
 			$out .= '</div>';
@@ -678,13 +678,13 @@  discard block
 block discarded – undo
678 678
 			$events[] = array('method' => 'getContacts', 'url' => dol_buildpath('/core/ajax/contacts.php', 1), 'htmlname' => 'contactid', 'params' => array('add-customer-contact' => 'disabled'));
679 679
 
680 680
 			if (count($events)) {	// If there is some ajax events to run once selection is done, we add code here to run events
681
-				print '<script nonce="' . getNonce() . '" type="text/javascript">
681
+				print '<script nonce="'.getNonce().'" type="text/javascript">
682 682
 				jQuery(document).ready(function() {
683
-					$("#search_' . $htmlname . '").change(function() {
684
-						var obj = ' . json_encode($events) . ';
683
+					$("#search_' . $htmlname.'").change(function() {
684
+						var obj = ' . json_encode($events).';
685 685
 						$.each(obj, function(key,values) {
686 686
 							if (values.method.length) {
687
-								runJsCodeForEvent' . $htmlname . '(values);
687
+								runJsCodeForEvent' . $htmlname.'(values);
688 688
 							}
689 689
 						});
690 690
 
@@ -692,13 +692,13 @@  discard block
 block discarded – undo
692 692
 					});
693 693
 
694 694
 					// Function used to execute events when search_htmlname change
695
-					function runJsCodeForEvent' . $htmlname . '(obj) {
696
-						var id = $("#' . $htmlname . '").val();
695
+					function runJsCodeForEvent' . $htmlname.'(obj) {
696
+						var id = $("#' . $htmlname.'").val();
697 697
 						var method = obj.method;
698 698
 						var url = obj.url;
699 699
 						var htmlname = obj.htmlname;
700 700
 						var showempty = obj.showempty;
701
-						console.log("Run runJsCodeForEvent-' . $htmlname . ' from selectCompaniesForNewContact id="+id+" method="+method+" showempty="+showempty+" url="+url+" htmlname="+htmlname);
701
+						console.log("Run runJsCodeForEvent-' . $htmlname.' from selectCompaniesForNewContact id="+id+" method="+method+" showempty="+showempty+" url="+url+" htmlname="+htmlname);
702 702
 						$.getJSON(url,
703 703
 							{
704 704
 								action: method,
@@ -728,9 +728,9 @@  discard block
 block discarded – undo
728 728
 				</script>';
729 729
 			}
730 730
 
731
-			print "\n" . '<!-- Input text for third party with Ajax.Autocompleter (selectCompaniesForNewContact) -->' . "\n";
732
-			print '<input type="text" size="30" id="search_' . $htmlname . '" name="search_' . $htmlname . '" value="' . $name . '" />';
733
-			print ajax_autocompleter((string) ($socid ? $socid : -1), $htmlname, DOL_URL_ROOT . '/societe/ajax/ajaxcompanies.php', '', $minLength, 0);
731
+			print "\n".'<!-- Input text for third party with Ajax.Autocompleter (selectCompaniesForNewContact) -->'."\n";
732
+			print '<input type="text" size="30" id="search_'.$htmlname.'" name="search_'.$htmlname.'" value="'.$name.'" />';
733
+			print ajax_autocompleter((string) ($socid ? $socid : -1), $htmlname, DOL_URL_ROOT.'/societe/ajax/ajaxcompanies.php', '', $minLength, 0);
734 734
 			return $socid;
735 735
 		} else {
736 736
 			// Search to list thirdparties
@@ -742,14 +742,14 @@  discard block
 block discarded – undo
742 742
 				$sql .= ", s.address, s.zip, s.town";
743 743
 				$sql .= ", dictp.code as country_code";
744 744
 			}
745
-			$sql .= " FROM " . $this->db->prefix() . "societe as s";
745
+			$sql .= " FROM ".$this->db->prefix()."societe as s";
746 746
 			if (getDolGlobalString('COMPANY_SHOW_ADDRESS_SELECTLIST')) {
747
-				$sql .= " LEFT JOIN " . $this->db->prefix() . "c_country as dictp ON dictp.rowid = s.fk_pays";
747
+				$sql .= " LEFT JOIN ".$this->db->prefix()."c_country as dictp ON dictp.rowid = s.fk_pays";
748 748
 			}
749
-			$sql .= " WHERE s.entity IN (" . getEntity('societe') . ")";
749
+			$sql .= " WHERE s.entity IN (".getEntity('societe').")";
750 750
 			// For ajax search we limit here. For combo list, we limit later
751 751
 			if (is_array($limitto) && count($limitto)) {
752
-				$sql .= " AND s.rowid IN (" . $this->db->sanitize(implode(',', $limitto)) . ")";
752
+				$sql .= " AND s.rowid IN (".$this->db->sanitize(implode(',', $limitto)).")";
753 753
 			}
754 754
 			// Add where from hooks
755 755
 			$parameters = array();
@@ -759,17 +759,17 @@  discard block
 block discarded – undo
759 759
 
760 760
 			$resql = $this->db->query($sql);
761 761
 			if ($resql) {
762
-				print '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . '"';
762
+				print '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.'"';
763 763
 				if ($conf->use_javascript_ajax) {
764
-					$javaScript = "window.location='" . dol_escape_js($_SERVER['PHP_SELF']) . "?" . $var_id . "=" . ($forceid > 0 ? $forceid : $object->id) . $moreparam . "&" . $htmlname . "=' + form." . $htmlname . ".options[form." . $htmlname . ".selectedIndex].value;";
765
-					print ' onChange="' . $javaScript . '"';
764
+					$javaScript = "window.location='".dol_escape_js($_SERVER['PHP_SELF'])."?".$var_id."=".($forceid > 0 ? $forceid : $object->id).$moreparam."&".$htmlname."=' + form.".$htmlname.".options[form.".$htmlname.".selectedIndex].value;";
765
+					print ' onChange="'.$javaScript.'"';
766 766
 				}
767 767
 				print '>';
768 768
 				print '<option value="-1">&nbsp;</option>';
769 769
 
770 770
 				$num = $this->db->num_rows($resql);
771 771
 				$i = 0;
772
-				$firstCompany = 0;  // For static analysis
772
+				$firstCompany = 0; // For static analysis
773 773
 				if ($num) {
774 774
 					while ($i < $num) {
775 775
 						$obj = $this->db->fetch_object($resql);
@@ -781,18 +781,18 @@  discard block
 block discarded – undo
781 781
 							$disabled = 1;
782 782
 						}
783 783
 						if ($selected > 0 && $selected == $obj->rowid) {
784
-							print '<option value="' . $obj->rowid . '"';
784
+							print '<option value="'.$obj->rowid.'"';
785 785
 							if ($disabled) {
786 786
 								print ' disabled';
787 787
 							}
788
-							print ' selected>' . dol_escape_htmltag($obj->name, 0, 0, '', 0, 1) . '</option>';
788
+							print ' selected>'.dol_escape_htmltag($obj->name, 0, 0, '', 0, 1).'</option>';
789 789
 							$firstCompany = $obj->rowid;
790 790
 						} else {
791
-							print '<option value="' . $obj->rowid . '"';
791
+							print '<option value="'.$obj->rowid.'"';
792 792
 							if ($disabled) {
793 793
 								print ' disabled';
794 794
 							}
795
-							print '>' . dol_escape_htmltag($obj->name, 0, 0, '', 0, 1) . '</option>';
795
+							print '>'.dol_escape_htmltag($obj->name, 0, 0, '', 0, 1).'</option>';
796 796
 						}
797 797
 						$i++;
798 798
 					}
@@ -827,10 +827,10 @@  discard block
 block discarded – undo
827 827
 
828 828
 		$out = '';
829 829
 		if (is_object($object) && method_exists($object, 'liste_type_contact')) {
830
-			'@phan-var-force CommonObject $object';  // CommonObject has the method.
831
-			$lesTypes = $object->liste_type_contact($source, $sortorder, 2, 1);	// List of types into c_type_contact for element=$object->element
830
+			'@phan-var-force CommonObject $object'; // CommonObject has the method.
831
+			$lesTypes = $object->liste_type_contact($source, $sortorder, 2, 1); // List of types into c_type_contact for element=$object->element
832 832
 
833
-			$out .= '<select class="flat valignmiddle' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
833
+			$out .= '<select class="flat valignmiddle'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
834 834
 			if ($showempty) {
835 835
 				$out .= '<option value="0">&nbsp;</option>';
836 836
 			}
@@ -873,9 +873,9 @@  discard block
 block discarded – undo
873 873
 		if ($rendermode === 'view') {
874 874
 			$toprint = array();
875 875
 			foreach ($contact->roles as $key => $val) {
876
-				$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb;">' . $val['label'] . '</li>';
876
+				$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb;">'.$val['label'].'</li>';
877 877
 			}
878
-			return '<div class="select2-container-multi-dolibarr" style="width: 90%;" id="' . $htmlname . '"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>';
878
+			return '<div class="select2-container-multi-dolibarr" style="width: 90%;" id="'.$htmlname.'"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
879 879
 		}
880 880
 
881 881
 		if ($rendermode === 'edit') {	// A multiselect combo list
@@ -921,14 +921,14 @@  discard block
 block discarded – undo
921 921
 
922 922
 		$size = '';
923 923
 		if (!empty($fieldsize)) {
924
-			$size = 'size="' . $fieldsize . '"';
924
+			$size = 'size="'.$fieldsize.'"';
925 925
 		}
926 926
 
927 927
 		if ($conf->use_javascript_ajax && empty($disableautocomplete)) {
928
-			$out .= ajax_multiautocompleter($htmlname, $fields, DOL_URL_ROOT . '/core/ajax/ziptown.php') . "\n";
928
+			$out .= ajax_multiautocompleter($htmlname, $fields, DOL_URL_ROOT.'/core/ajax/ziptown.php')."\n";
929 929
 			$moreattrib .= ' autocomplete="off"';
930 930
 		}
931
-		$out .= '<input id="' . $htmlname . '" class="maxwidthonsmartphone' . ($morecss ? ' ' . $morecss : '') . '" type="text"' . ($moreattrib ? ' ' . $moreattrib : '') . ' name="' . $htmlname . '" ' . $size . ' value="' . $selected . '">' . "\n";
931
+		$out .= '<input id="'.$htmlname.'" class="maxwidthonsmartphone'.($morecss ? ' '.$morecss : '').'" type="text"'.($moreattrib ? ' '.$moreattrib : '').' name="'.$htmlname.'" '.$size.' value="'.$selected.'">'."\n";
932 932
 
933 933
 		return $out;
934 934
 	}
@@ -1005,7 +1005,7 @@  discard block
 block discarded – undo
1005 1005
 		$parameters = array('formlength' => $formlength, 'selected' => $preselected, 'idprof' => $idprof, 'htmlname' => $htmlname, 'country_code' => $country_code);
1006 1006
 		$reshook = $hookmanager->executeHooks('getInputIdProf', $parameters);
1007 1007
 		if (empty($reshook)) {
1008
-			$out .= '<input type="text" ' . ($morecss ? 'class="' . $morecss . '" ' : '') . 'name="' . $htmlname . '" id="' . $htmlname . '" maxlength="' . $maxlength . '" value="' . $selected . '">';
1008
+			$out .= '<input type="text" '.($morecss ? 'class="'.$morecss.'" ' : '').'name="'.$htmlname.'" id="'.$htmlname.'" maxlength="'.$maxlength.'" value="'.$selected.'">';
1009 1009
 		}
1010 1010
 		$out .= $hookmanager->resPrint;
1011 1011
 
@@ -1036,9 +1036,9 @@  discard block
 block discarded – undo
1036 1036
 				$i = 0;
1037 1037
 				while ($i < $nbvalues) {
1038 1038
 					if ($selected == $valors[$i]) {
1039
-						print '<option value="' . $valors[$i] . '" selected>';
1039
+						print '<option value="'.$valors[$i].'" selected>';
1040 1040
 					} else {
1041
-						print '<option value="' . $valors[$i] . '">';
1041
+						print '<option value="'.$valors[$i].'">';
1042 1042
 					}
1043 1043
 					print $valors[$i];
1044 1044
 					print '</option>';
@@ -1067,7 +1067,7 @@  discard block
 block discarded – undo
1067 1067
 			return '';
1068 1068
 		}
1069 1069
 
1070
-		$out = '<select class="flat ' . $morecss . '" name="' . $htmlname . '" id="' . $htmlidname . '">';
1070
+		$out = '<select class="flat '.$morecss.'" name="'.$htmlname.'" id="'.$htmlidname.'">';
1071 1071
 		if ($typeinput == 'form') {
1072 1072
 			if ($allowempty || ($selected == '' || $selected == '-1')) {
1073 1073
 				$out .= '<option value="-1">';
@@ -1079,33 +1079,33 @@  discard block
 block discarded – undo
1079 1079
 				$out .= '</option>';
1080 1080
 			}
1081 1081
 			if (!getDolGlobalString('SOCIETE_DISABLE_PROSPECTS')) {
1082
-				$out .= '<option value="2"' . ($selected == 2 ? ' selected' : '') . '>' . $langs->trans('Prospect') . '</option>';
1082
+				$out .= '<option value="2"'.($selected == 2 ? ' selected' : '').'>'.$langs->trans('Prospect').'</option>';
1083 1083
 			}
1084 1084
 			if (!getDolGlobalString('SOCIETE_DISABLE_PROSPECTS') && !getDolGlobalString('SOCIETE_DISABLE_CUSTOMERS') && !getDolGlobalString('SOCIETE_DISABLE_PROSPECTSCUSTOMERS')) {
1085
-				$out .= '<option value="3"' . ($selected == 3 ? ' selected' : '') . '>' . $langs->trans('ProspectCustomer') . '</option>';
1085
+				$out .= '<option value="3"'.($selected == 3 ? ' selected' : '').'>'.$langs->trans('ProspectCustomer').'</option>';
1086 1086
 			}
1087 1087
 			if (!getDolGlobalString('SOCIETE_DISABLE_CUSTOMERS')) {
1088
-				$out .= '<option value="1"' . ($selected == 1 ? ' selected' : '') . '>' . $langs->trans('Customer') . '</option>';
1088
+				$out .= '<option value="1"'.($selected == 1 ? ' selected' : '').'>'.$langs->trans('Customer').'</option>';
1089 1089
 			}
1090
-			$out .= '<option value="0"' . ((string) $selected == '0' ? ' selected' : '') . '>' . $langs->trans('NorProspectNorCustomer') . '</option>';
1090
+			$out .= '<option value="0"'.((string) $selected == '0' ? ' selected' : '').'>'.$langs->trans('NorProspectNorCustomer').'</option>';
1091 1091
 		} elseif ($typeinput == 'list') {
1092
-			$out .= '<option value="-1"' . (($selected == '' || $selected == '-1') ? ' selected' : '') . '>&nbsp;</option>';
1092
+			$out .= '<option value="-1"'.(($selected == '' || $selected == '-1') ? ' selected' : '').'>&nbsp;</option>';
1093 1093
 			if (!getDolGlobalString('SOCIETE_DISABLE_PROSPECTS')) {
1094
-				$out .= '<option value="2,3"' . ($selected == '2,3' ? ' selected' : '') . '>' . $langs->trans('Prospect') . '</option>';
1094
+				$out .= '<option value="2,3"'.($selected == '2,3' ? ' selected' : '').'>'.$langs->trans('Prospect').'</option>';
1095 1095
 			}
1096 1096
 			if (!getDolGlobalString('SOCIETE_DISABLE_CUSTOMERS')) {
1097
-				$out .= '<option value="1,3"' . ($selected == '1,3' ? ' selected' : '') . '>' . $langs->trans('Customer') . '</option>';
1097
+				$out .= '<option value="1,3"'.($selected == '1,3' ? ' selected' : '').'>'.$langs->trans('Customer').'</option>';
1098 1098
 			}
1099 1099
 			if (isModEnabled("fournisseur")) {
1100
-				$out .= '<option value="4"' . ($selected == '4' ? ' selected' : '') . '>' . $langs->trans('Supplier') . '</option>';
1100
+				$out .= '<option value="4"'.($selected == '4' ? ' selected' : '').'>'.$langs->trans('Supplier').'</option>';
1101 1101
 			}
1102
-			$out .= '<option value="0"' . ($selected == '0' ? ' selected' : '') . '>' . $langs->trans('Other') . '</option>';
1102
+			$out .= '<option value="0"'.($selected == '0' ? ' selected' : '').'>'.$langs->trans('Other').'</option>';
1103 1103
 		} elseif ($typeinput == 'admin') {
1104 1104
 			if (!getDolGlobalString('SOCIETE_DISABLE_PROSPECTS') && !getDolGlobalString('SOCIETE_DISABLE_CUSTOMERS') && !getDolGlobalString('SOCIETE_DISABLE_PROSPECTSCUSTOMERS')) {
1105
-				$out .= '<option value="3"' . ($selected == 3 ? ' selected' : '') . '>' . $langs->trans('ProspectCustomer') . '</option>';
1105
+				$out .= '<option value="3"'.($selected == 3 ? ' selected' : '').'>'.$langs->trans('ProspectCustomer').'</option>';
1106 1106
 			}
1107 1107
 			if (!getDolGlobalString('SOCIETE_DISABLE_CUSTOMERS')) {
1108
-				$out .= '<option value="1"' . ($selected == 1 ? ' selected' : '') . '>' . $langs->trans('Customer') . '</option>';
1108
+				$out .= '<option value="1"'.($selected == 1 ? ' selected' : '').'>'.$langs->trans('Customer').'</option>';
1109 1109
 			}
1110 1110
 		}
1111 1111
 		$out .= '</select>';
@@ -1131,12 +1131,12 @@  discard block
 block discarded – undo
1131 1131
 
1132 1132
 		$out = '';
1133 1133
 		if ($htmlname != "none") {
1134
-			$out .= '<form method="post" action="' . $page . '">';
1134
+			$out .= '<form method="post" action="'.$page.'">';
1135 1135
 			$out .= '<input type="hidden" name="action" value="set_thirdpartytype">';
1136
-			$out .= '<input type="hidden" name="token" value="' . newToken() . '">';
1136
+			$out .= '<input type="hidden" name="token" value="'.newToken().'">';
1137 1137
 			$sortparam = (!getDolGlobalString('SOCIETE_SORT_ON_TYPEENT') ? 'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT); // NONE means we keep sort of original array, so we sort on position. ASC, means next function will sort on label.
1138 1138
 			$out .= $this->selectarray($htmlname, $this->typent_array(0, $filter), $selected, 1, 0, 0, '', 0, 0, 0, $sortparam, '', 1);
1139
-			$out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
1139
+			$out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
1140 1140
 			$out .= '</form>';
1141 1141
 		} else {
1142 1142
 			if ($selected > 0) {
@@ -1175,7 +1175,7 @@  discard block
 block discarded – undo
1175 1175
 
1176 1176
 			//print $prospectstatic->LibProspCommStatut($statusprospect, 2, $prospectstatic->cacheprospectstatus[$statusprospect]['label'], $prospectstatic->cacheprospectstatus[$statusprospect]['picto']);
1177 1177
 			print img_action('', $actioncode, $actionpicto, 'class="inline-block valignmiddle paddingright pictoprospectstatus"');
1178
-			print '<select class="flat selectprospectstatus maxwidth150" id="'. $htmlname.$idprospect .'" data-socid="'.$idprospect.'" name="' . $htmlname .'"';
1178
+			print '<select class="flat selectprospectstatus maxwidth150" id="'.$htmlname.$idprospect.'" data-socid="'.$idprospect.'" name="'.$htmlname.'"';
1179 1179
 			if (!$user->hasRight('societe', 'creer')) {
1180 1180
 				print ' disabled';
1181 1181
 			}
@@ -1205,8 +1205,8 @@  discard block
 block discarded – undo
1205 1205
 						var image = $(this).prev(".pictoprospectstatus");
1206 1206
 						$.ajax({
1207 1207
 							type: "POST",
1208
-							url: \'' . DOL_URL_ROOT . '/core/ajax/ajaxstatusprospect.php\',
1209
-							data: { id: statusid, prospectid: prospectid, token: \''. newToken() .'\', action: \'updatestatusprospect\' },
1208
+							url: \'' . DOL_URL_ROOT.'/core/ajax/ajaxstatusprospect.php\',
1209
+							data: { id: statusid, prospectid: prospectid, token: \''. newToken().'\', action: \'updatestatusprospect\' },
1210 1210
 							success: function(response) {
1211 1211
 								console.log(response.img);
1212 1212
 								image.replaceWith(response.img);
Please login to merge, or discard this patch.
htdocs/core/class/commonobject.class.php 1 patch
Spacing   +135 added lines, -135 removed lines patch added patch discarded remove patch
@@ -476,11 +476,11 @@  discard block
 block discarded – undo
476 476
 	 *
477 477
 	 * Note: cond_reglement can not be aliased to cond_reglement!!!
478 478
 	 */
479
-	private $cond_reglement;  // Private to call DolDeprecationHandler
479
+	private $cond_reglement; // Private to call DolDeprecationHandler
480 480
 	/**
481 481
 	 * @var int|string Internal to detect deprecated access
482 482
 	 */
483
-	protected $depr_cond_reglement;  // Internal value for deprecation
483
+	protected $depr_cond_reglement; // Internal value for deprecation
484 484
 
485 485
 	/**
486 486
 	 * @var int 		Delivery address ID
@@ -537,12 +537,12 @@  discard block
 block discarded – undo
537 537
 	/**
538 538
 	 * @var float|string Multicurrency total localtax1
539 539
 	 */
540
-	public $multicurrency_total_localtax1;	// not in database
540
+	public $multicurrency_total_localtax1; // not in database
541 541
 
542 542
 	/**
543 543
 	 * @var float|string Multicurrency total localtax2
544 544
 	 */
545
-	public $multicurrency_total_localtax2;	// not in database
545
+	public $multicurrency_total_localtax2; // not in database
546 546
 
547 547
 	/**
548 548
 	 * @var ?string
@@ -1033,17 +1033,17 @@  discard block
 block discarded – undo
1033 1033
 				}
1034 1034
 				$labelextra = $langs->trans((string) $extrafields->attributes[$this->table_element]['label'][$key]);
1035 1035
 				if ($extrafields->attributes[$this->table_element]['type'][$key] == 'separate') {
1036
-					$data[$key] = '<br><b><u>'. $labelextra . '</u></b>';
1036
+					$data[$key] = '<br><b><u>'.$labelextra.'</u></b>';
1037 1037
 				} else {
1038
-					$value = (empty($this->array_options['options_' . $key]) ? '' : $this->array_options['options_' . $key]);
1039
-					$data[$key] = '<br><b>'. $labelextra . ':</b> ' . $extrafields->showOutputField($key, $value, '', $this->table_element);
1038
+					$value = (empty($this->array_options['options_'.$key]) ? '' : $this->array_options['options_'.$key]);
1039
+					$data[$key] = '<br><b>'.$labelextra.':</b> '.$extrafields->showOutputField($key, $value, '', $this->table_element);
1040 1040
 					$count++;
1041 1041
 				}
1042 1042
 			}
1043 1043
 			$data['closedivextra'] = '</div>';
1044 1044
 		}
1045 1045
 
1046
-		$hookmanager->initHooks(array($this->element . 'dao'));
1046
+		$hookmanager->initHooks(array($this->element.'dao'));
1047 1047
 		$parameters = array(
1048 1048
 			'tooltipcontentarray' => &$data,
1049 1049
 			'params' => $params,
@@ -1545,7 +1545,7 @@  discard block
 block discarded – undo
1545 1545
 			$sql .= " AND ec.fk_c_type_contact IN (".$this->db->sanitize(implode(',', $arrayoftcids)).")";
1546 1546
 		}
1547 1547
 		if ($status >= 0) {
1548
-			$sql .= " AND t.statut = ".((int) $status);	// t is llx_user or llx_socpeople
1548
+			$sql .= " AND t.statut = ".((int) $status); // t is llx_user or llx_socpeople
1549 1549
 		}
1550 1550
 		if ($statusoflink >= 0) {
1551 1551
 			$sql .= " AND ec.statut = ".((int) $statusoflink);
@@ -1934,7 +1934,7 @@  discard block
 block discarded – undo
1934 1934
 		}
1935 1935
 
1936 1936
 		$sql = "SELECT rowid FROM ".$this->db->prefix().$this->table_element;
1937
-		$sql .= " WHERE ".$this->table_ref_field." LIKE '".$this->db->escape($ref)."'";	// no escapeforlike here
1937
+		$sql .= " WHERE ".$this->table_ref_field." LIKE '".$this->db->escape($ref)."'"; // no escapeforlike here
1938 1938
 		$sql .= " LIMIT 1";
1939 1939
 
1940 1940
 		$query = $this->db->query($sql);
@@ -2253,9 +2253,9 @@  discard block
 block discarded – undo
2253 2253
 
2254 2254
 		$oldvalue = null;
2255 2255
 		if ($trigkey) {
2256
-			$sql = "SELECT " . $field;
2257
-			$sql .= " FROM " . MAIN_DB_PREFIX . $table;
2258
-			$sql .= " WHERE " . $id_field . " = " . ((int) $id);
2256
+			$sql = "SELECT ".$field;
2257
+			$sql .= " FROM ".MAIN_DB_PREFIX.$table;
2258
+			$sql .= " WHERE ".$id_field." = ".((int) $id);
2259 2259
 
2260 2260
 			$resql = $this->db->query($sql);
2261 2261
 			if ($resql) {
@@ -2635,7 +2635,7 @@  discard block
 block discarded – undo
2635 2635
 		// Triggers
2636 2636
 		if (!$error && !$notrigger) {
2637 2637
 			// Call triggers
2638
-			$result = $this->call_trigger(strtoupper($this->element) . '_MODIFY', $user);
2638
+			$result = $this->call_trigger(strtoupper($this->element).'_MODIFY', $user);
2639 2639
 			if ($result < 0) {
2640 2640
 				$error++;
2641 2641
 			} //Do also here what you must do to rollback action if trigger fail
@@ -3014,7 +3014,7 @@  discard block
 block discarded – undo
3014 3014
 			$sql = 'UPDATE '.$this->db->prefix().$this->table_element;
3015 3015
 			$sql .= " SET ".$fieldname." = ".(($id > 0 || $id == '0') ? ((int) $id) : 'NULL');
3016 3016
 			if (in_array($this->table_element, array('propal', 'commande', 'societe'))) {
3017
-				$sql .= " , deposit_percent = " . (empty($deposit_percent) ? 'NULL' : "'".$this->db->escape((string) $deposit_percent)."'");
3017
+				$sql .= " , deposit_percent = ".(empty($deposit_percent) ? 'NULL' : "'".$this->db->escape((string) $deposit_percent)."'");
3018 3018
 			}
3019 3019
 			$sql .= ' WHERE rowid='.((int) $this->id);
3020 3020
 
@@ -3362,10 +3362,10 @@  discard block
 block discarded – undo
3362 3362
 		$sql = "SELECT count(rowid) FROM ".$this->db->prefix().$this->table_element_line;
3363 3363
 		$sql .= " WHERE ".$this->fk_element." = ".((int) $this->id);
3364 3364
 		if (!$renum) {
3365
-			$sql .= " AND " . $fieldposition . " = 0";
3365
+			$sql .= " AND ".$fieldposition." = 0";
3366 3366
 		}
3367 3367
 		if ($renum) {
3368
-			$sql .= " AND " . $fieldposition . " <> 0";
3368
+			$sql .= " AND ".$fieldposition." <> 0";
3369 3369
 		}
3370 3370
 
3371 3371
 		dol_syslog(get_class($this)."::line_order", LOG_DEBUG);
@@ -3386,7 +3386,7 @@  discard block
 block discarded – undo
3386 3386
 			if ($fk_parent_line) {
3387 3387
 				$sql .= ' AND fk_parent_line IS NULL';
3388 3388
 			}
3389
-			$sql .= " ORDER BY " . $fieldposition . " ASC, rowid " . $rowidorder;
3389
+			$sql .= " ORDER BY ".$fieldposition." ASC, rowid ".$rowidorder;
3390 3390
 
3391 3391
 			dol_syslog(get_class($this)."::line_order search all parent lines", LOG_DEBUG);
3392 3392
 			$resql = $this->db->query($sql);
@@ -3440,7 +3440,7 @@  discard block
 block discarded – undo
3440 3440
 		$sql = "SELECT rowid FROM ".$this->db->prefix().$this->table_element_line;
3441 3441
 		$sql .= " WHERE ".$this->fk_element." = ".((int) $this->id);
3442 3442
 		$sql .= ' AND fk_parent_line = '.((int) $id);
3443
-		$sql .= " ORDER BY " . $fieldposition . " ASC";
3443
+		$sql .= " ORDER BY ".$fieldposition." ASC";
3444 3444
 
3445 3445
 		dol_syslog(get_class($this)."::getChildrenOfLine search children lines for line ".$id, LOG_DEBUG);
3446 3446
 
@@ -3564,7 +3564,7 @@  discard block
 block discarded – undo
3564 3564
 
3565 3565
 			$sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) $rang);
3566 3566
 			$sql .= " WHERE ".$this->fk_element." = ".((int) $this->id);
3567
-			$sql .= " AND " . $fieldposition . " = " . ((int) ($rang - 1));
3567
+			$sql .= " AND ".$fieldposition." = ".((int) ($rang - 1));
3568 3568
 			if ($this->db->query($sql)) {
3569 3569
 				$sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) ($rang - 1));
3570 3570
 				$sql .= ' WHERE rowid = '.((int) $rowid);
@@ -3595,7 +3595,7 @@  discard block
 block discarded – undo
3595 3595
 
3596 3596
 			$sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) $rang);
3597 3597
 			$sql .= " WHERE ".$this->fk_element." = ".((int) $this->id);
3598
-			$sql .= " AND " . $fieldposition . " = " . ((int) ($rang + 1));
3598
+			$sql .= " AND ".$fieldposition." = ".((int) ($rang + 1));
3599 3599
 			if ($this->db->query($sql)) {
3600 3600
 				$sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) ($rang + 1));
3601 3601
 				$sql .= ' WHERE rowid = '.((int) $rowid);
@@ -3621,7 +3621,7 @@  discard block
 block discarded – undo
3621 3621
 			$fieldposition = 'position';
3622 3622
 		}
3623 3623
 
3624
-		$sql = "SELECT " . $fieldposition . " FROM ".$this->db->prefix().$this->table_element_line;
3624
+		$sql = "SELECT ".$fieldposition." FROM ".$this->db->prefix().$this->table_element_line;
3625 3625
 		$sql .= " WHERE rowid = ".((int) $rowid);
3626 3626
 
3627 3627
 		dol_syslog(get_class($this)."::getRangOfLine", LOG_DEBUG);
@@ -3649,7 +3649,7 @@  discard block
 block discarded – undo
3649 3649
 
3650 3650
 		$sql = "SELECT rowid FROM ".$this->db->prefix().$this->table_element_line;
3651 3651
 		$sql .= " WHERE ".$this->fk_element." = ".((int) $this->id);
3652
-		$sql .= " AND " . $fieldposition . " = ".((int) $rang);
3652
+		$sql .= " AND ".$fieldposition." = ".((int) $rang);
3653 3653
 		$resql = $this->db->query($sql);
3654 3654
 		if ($resql) {
3655 3655
 			$row = $this->db->fetch_row($resql);
@@ -3768,7 +3768,7 @@  discard block
 block discarded – undo
3768 3768
 			$newsuffix = '';
3769 3769
 		}
3770 3770
 		if (in_array($this->table_element, array('actioncomm', 'adherent', 'advtargetemailing', 'cronjob', 'establishment'))) {
3771
-			$fieldusermod =  "fk_user_mod";
3771
+			$fieldusermod = "fk_user_mod";
3772 3772
 		} elseif ($this->table_element == 'ecm_files') {
3773 3773
 			$fieldusermod = "fk_user_m";
3774 3774
 		} else {
@@ -3810,7 +3810,7 @@  discard block
 block discarded – undo
3810 3810
 						$trigger_name = 'EXPENSE_REPORT_MODIFY';
3811 3811
 						break;
3812 3812
 					default:
3813
-						$trigger_name = strtoupper($this->element) . '_MODIFY';
3813
+						$trigger_name = strtoupper($this->element).'_MODIFY';
3814 3814
 				}
3815 3815
 				$ret = $this->call_trigger($trigger_name, $user);
3816 3816
 				if ($ret < 0) {
@@ -4108,7 +4108,7 @@  discard block
 block discarded – undo
4108 4108
 			// Situations totals
4109 4109
 			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
4110 4110
 				'@phan-var-force Facture $this';
4111
-				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
4111
+				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
4112 4112
 				if ($this->type != Facture::TYPE_CREDIT_NOTE) {	// @phpstan-ignore-line
4113 4113
 					if (getDolGlobalInt('INVOICE_USE_SITUATION') != 2) {
4114 4114
 						$prev_sits = $this->get_prev_sits();
@@ -4234,19 +4234,19 @@  discard block
 block discarded – undo
4234 4234
 		$this->db->begin();
4235 4235
 		$error = 0;
4236 4236
 
4237
-		$sql = "INSERT INTO " . $this->db->prefix() . "element_element (";
4237
+		$sql = "INSERT INTO ".$this->db->prefix()."element_element (";
4238 4238
 		$sql .= "fk_source";
4239 4239
 		$sql .= ", sourcetype";
4240 4240
 		$sql .= ", fk_target";
4241 4241
 		$sql .= ", targettype";
4242 4242
 		$sql .= ") VALUES (";
4243 4243
 		$sql .= ((int) $origin_id);
4244
-		$sql .= ", '" . $this->db->escape($origin) . "'";
4245
-		$sql .= ", " . ((int) $this->id);
4246
-		$sql .= ", '" . $this->db->escape($targettype) . "'";
4244
+		$sql .= ", '".$this->db->escape($origin)."'";
4245
+		$sql .= ", ".((int) $this->id);
4246
+		$sql .= ", '".$this->db->escape($targettype)."'";
4247 4247
 		$sql .= ")";
4248 4248
 
4249
-		dol_syslog(get_class($this) . "::add_object_linked", LOG_DEBUG);
4249
+		dol_syslog(get_class($this)."::add_object_linked", LOG_DEBUG);
4250 4250
 		if ($this->db->query($sql)) {
4251 4251
 			if (!$notrigger) {
4252 4252
 				// Call trigger
@@ -4501,20 +4501,20 @@  discard block
 block discarded – undo
4501 4501
 		$this->db->begin();
4502 4502
 		$error = 0;
4503 4503
 
4504
-		$sql = "UPDATE " . $this->db->prefix() . "element_element SET ";
4504
+		$sql = "UPDATE ".$this->db->prefix()."element_element SET ";
4505 4505
 		if ($updatesource) {
4506
-			$sql .= "fk_source = " . ((int) $sourceid);
4507
-			$sql .= ", sourcetype = '" . $this->db->escape($sourcetype) . "'";
4508
-			$sql .= " WHERE fk_target = " . ((int) $this->id);
4509
-			$sql .= " AND targettype = '" . $this->db->escape($this->element) . "'";
4506
+			$sql .= "fk_source = ".((int) $sourceid);
4507
+			$sql .= ", sourcetype = '".$this->db->escape($sourcetype)."'";
4508
+			$sql .= " WHERE fk_target = ".((int) $this->id);
4509
+			$sql .= " AND targettype = '".$this->db->escape($this->element)."'";
4510 4510
 		} elseif ($updatetarget) {
4511
-			$sql .= "fk_target = " . ((int) $targetid);
4512
-			$sql .= ", targettype = '" . $this->db->escape($targettype) . "'";
4513
-			$sql .= " WHERE fk_source = " . ((int) $this->id);
4514
-			$sql .= " AND sourcetype = '" . $this->db->escape($this->element) . "'";
4511
+			$sql .= "fk_target = ".((int) $targetid);
4512
+			$sql .= ", targettype = '".$this->db->escape($targettype)."'";
4513
+			$sql .= " WHERE fk_source = ".((int) $this->id);
4514
+			$sql .= " AND sourcetype = '".$this->db->escape($this->element)."'";
4515 4515
 		}
4516 4516
 
4517
-		dol_syslog(get_class($this) . "::updateObjectLinked", LOG_DEBUG);
4517
+		dol_syslog(get_class($this)."::updateObjectLinked", LOG_DEBUG);
4518 4518
 		if ($this->db->query($sql)) {
4519 4519
 			if (!$notrigger) {
4520 4520
 				// Call trigger
@@ -4591,25 +4591,25 @@  discard block
 block discarded – undo
4591 4591
 		}
4592 4592
 
4593 4593
 		if (!$error) {
4594
-			$sql = "DELETE FROM " . $this->db->prefix() . "element_element";
4594
+			$sql = "DELETE FROM ".$this->db->prefix()."element_element";
4595 4595
 			$sql .= " WHERE";
4596 4596
 			if ($rowid > 0) {
4597
-				$sql .= " rowid = " . ((int) $rowid);
4597
+				$sql .= " rowid = ".((int) $rowid);
4598 4598
 			} else {
4599 4599
 				if ($deletesource) {
4600
-					$sql .= " fk_source = " . ((int) $sourceid) . " AND sourcetype = '" . $this->db->escape($sourcetype) . "'";
4601
-					$sql .= " AND fk_target = " . ((int) $this->id) . " AND targettype = '" . $this->db->escape($element) . "'";
4600
+					$sql .= " fk_source = ".((int) $sourceid)." AND sourcetype = '".$this->db->escape($sourcetype)."'";
4601
+					$sql .= " AND fk_target = ".((int) $this->id)." AND targettype = '".$this->db->escape($element)."'";
4602 4602
 				} elseif ($deletetarget) {
4603
-					$sql .= " fk_target = " . ((int) $targetid) . " AND targettype = '" . $this->db->escape($targettype) . "'";
4604
-					$sql .= " AND fk_source = " . ((int) $this->id) . " AND sourcetype = '" . $this->db->escape($element) . "'";
4603
+					$sql .= " fk_target = ".((int) $targetid)." AND targettype = '".$this->db->escape($targettype)."'";
4604
+					$sql .= " AND fk_source = ".((int) $this->id)." AND sourcetype = '".$this->db->escape($element)."'";
4605 4605
 				} else {
4606
-					$sql .= " (fk_source = " . ((int) $this->id) . " AND sourcetype = '" . $this->db->escape($element) . "')";
4606
+					$sql .= " (fk_source = ".((int) $this->id)." AND sourcetype = '".$this->db->escape($element)."')";
4607 4607
 					$sql .= " OR";
4608
-					$sql .= " (fk_target = " . ((int) $this->id) . " AND targettype = '" . $this->db->escape($element) . "')";
4608
+					$sql .= " (fk_target = ".((int) $this->id)." AND targettype = '".$this->db->escape($element)."')";
4609 4609
 				}
4610 4610
 			}
4611 4611
 
4612
-			dol_syslog(get_class($this) . "::deleteObjectLinked", LOG_DEBUG);
4612
+			dol_syslog(get_class($this)."::deleteObjectLinked", LOG_DEBUG);
4613 4613
 			if (!$this->db->query($sql)) {
4614 4614
 				$this->error = $this->db->lasterror();
4615 4615
 				$this->errors[] = $this->error;
@@ -4774,14 +4774,14 @@  discard block
 block discarded – undo
4774 4774
 			$sql .= ", date_validation = '".$this->db->idate(dol_now())."'";
4775 4775
 		}
4776 4776
 		$sql .= " WHERE rowid = ".((int) $elementId);
4777
-		$sql .= " AND ".$fieldstatus." <> ".((int) $status);	// We avoid update if status already correct
4777
+		$sql .= " AND ".$fieldstatus." <> ".((int) $status); // We avoid update if status already correct
4778 4778
 
4779 4779
 		dol_syslog(get_class($this)."::setStatut", LOG_DEBUG);
4780 4780
 		$resql = $this->db->query($sql);
4781 4781
 		if ($resql) {
4782 4782
 			$error = 0;
4783 4783
 
4784
-			$nb_rows_affected = $this->db->affected_rows($resql);	// should be 1 or 0 if status was already correct
4784
+			$nb_rows_affected = $this->db->affected_rows($resql); // should be 1 or 0 if status was already correct
4785 4785
 
4786 4786
 			if ($nb_rows_affected > 0) {
4787 4787
 				if (empty($trigkey)) {
@@ -4828,7 +4828,7 @@  discard block
 block discarded – undo
4828 4828
 					if ($fieldstatus == 'tosell') {
4829 4829
 						$this->status = $status;
4830 4830
 					} elseif ($fieldstatus == 'tobuy') {
4831
-						$this->status_buy = $status;	// @phpstan-ignore-line
4831
+						$this->status_buy = $status; // @phpstan-ignore-line
4832 4832
 					} else {
4833 4833
 						$this->status = $status;
4834 4834
 					}
@@ -4936,7 +4936,7 @@  discard block
 block discarded – undo
4936 4936
 			return -1;
4937 4937
 		}
4938 4938
 
4939
-		$arraytoscan = $this->childtables;		// array('tablename'=>array('fk_element'=>'parentfield'), ...) or array('tablename'=>array('parent'=>table_parent, 'parentkey'=>'nameoffieldforparentfkkey'), ...)
4939
+		$arraytoscan = $this->childtables; // array('tablename'=>array('fk_element'=>'parentfield'), ...) or array('tablename'=>array('parent'=>table_parent, 'parentkey'=>'nameoffieldforparentfkkey'), ...)
4940 4940
 		// For backward compatibility, we check if array is old format array('tablename1', 'tablename2', ...)
4941 4941
 		$tmparray = array_keys($this->childtables);
4942 4942
 		if (is_numeric($tmparray[0])) {
@@ -5981,7 +5981,7 @@  discard block
 block discarded – undo
5981 5981
 		} else {
5982 5982
 			// TODO: Try to set type above again
5983 5983
 			'@phan-var-force ModeleBarCode|ModeleExports|ModeleImports|ModelePDFAsset|ModelePDFContract|ModelePDFDeliveryOrder|ModelePDFEvaluation|ModelePDFFactures|ModelePDFFicheinter|ModelePDFMo|ModelePDFMovement|ModelePDFProduct|ModelePDFProjects|ModelePDFPropales|ModelePDFRecruitmentJobPosition|ModelePDFStock|ModelePDFStockTransfer|ModelePDFSupplierProposal|ModelePDFSuppliersInvoices|ModelePDFSuppliersOrders|ModelePDFSuppliersPayments|ModelePDFTask|ModelePDFTicket|ModelePDFUser|ModelePDFUserGroup|ModelePdfExpedition|ModelePdfReception|ModeleThirdPartyDoc $obj';
5984
-			$resultwritefile = $obj->write_file($this, $outputlangs, $srctemplatepath, $hidedetails, $hidedesc, $hideref, $moreparams);  // @phan-suppress-line-PhanTypeMismatchArgument
5984
+			$resultwritefile = $obj->write_file($this, $outputlangs, $srctemplatepath, $hidedetails, $hidedesc, $hideref, $moreparams); // @phan-suppress-line-PhanTypeMismatchArgument
5985 5985
 		}
5986 5986
 		// After call of write_file $obj->result['fullpath'] is set with generated file. It will be used to update the ECM database index.
5987 5987
 
@@ -6054,7 +6054,7 @@  discard block
 block discarded – undo
6054 6054
 			$setsharekey = false;
6055 6055
 			if ($this->element == 'propal' || $this->element == 'proposal') {
6056 6056
 				if (getDolGlobalInt("PROPOSAL_ALLOW_ONLINESIGN")) {
6057
-					$setsharekey = true;	// feature to make online signature is not set or set to on (default)
6057
+					$setsharekey = true; // feature to make online signature is not set or set to on (default)
6058 6058
 				}
6059 6059
 				if (getDolGlobalInt("PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD")) {
6060 6060
 					$setsharekey = true;
@@ -6114,7 +6114,7 @@  discard block
 block discarded – undo
6114 6114
 				$ecmfile->gen_or_uploaded = 'generated';
6115 6115
 				$ecmfile->description = ''; // indexed content
6116 6116
 				$ecmfile->keywords = ''; // keyword content
6117
-				$ecmfile->src_object_type = $this->table_element;	// $this->table_name is 'myobject' or 'mymodule_myobject'.
6117
+				$ecmfile->src_object_type = $this->table_element; // $this->table_name is 'myobject' or 'mymodule_myobject'.
6118 6118
 				$ecmfile->src_object_id   = $this->id;
6119 6119
 
6120 6120
 				$result = $ecmfile->create($user);
@@ -6266,8 +6266,8 @@  discard block
 block discarded – undo
6266 6266
 		// phpcs:enable
6267 6267
 		global $langs, $conf;
6268 6268
 
6269
-		if (!empty(self::TRIGGER_PREFIX) && strpos($triggerName, self::TRIGGER_PREFIX . '_') !== 0) {
6270
-			dol_print_error(null, 'The trigger "' . $triggerName . '" does not start with "' . self::TRIGGER_PREFIX . '_" as required.');
6269
+		if (!empty(self::TRIGGER_PREFIX) && strpos($triggerName, self::TRIGGER_PREFIX.'_') !== 0) {
6270
+			dol_print_error(null, 'The trigger "'.$triggerName.'" does not start with "'.self::TRIGGER_PREFIX.'_" as required.');
6271 6271
 			exit;
6272 6272
 		}
6273 6273
 		if (!is_object($langs)) {	// If lang was not defined, we set it. It is required by run_triggers().
@@ -6459,7 +6459,7 @@  discard block
 block discarded – undo
6459 6459
 		$savDisableCompute = $conf->disable_compute;
6460 6460
 		$conf->disable_compute = 1;
6461 6461
 
6462
-		$ret = $this->fetch($id);	/* @phpstan-ignore-line */
6462
+		$ret = $this->fetch($id); /* @phpstan-ignore-line */
6463 6463
 
6464 6464
 		$conf->disable_compute = $savDisableCompute;
6465 6465
 
@@ -6521,7 +6521,7 @@  discard block
 block discarded – undo
6521 6521
 		if (is_array($optionsArray) && count($optionsArray) > 0) {
6522 6522
 			$sql = "SELECT rowid";
6523 6523
 			foreach ($optionsArray as $name => $label) {
6524
-				if (empty($extrafields->attributes[$this->table_element]['type'][$name]) || (!in_array($extrafields->attributes[$this->table_element]['type'][$name], ['separate', 'point', 'multipts', 'linestrg','polygon']))) {
6524
+				if (empty($extrafields->attributes[$this->table_element]['type'][$name]) || (!in_array($extrafields->attributes[$this->table_element]['type'][$name], ['separate', 'point', 'multipts', 'linestrg', 'polygon']))) {
6525 6525
 					$sql .= ", ".$name;
6526 6526
 				}
6527 6527
 				// use geo sql fonction to read as text
@@ -6574,7 +6574,7 @@  discard block
 block discarded – undo
6574 6574
 					 **/
6575 6575
 					if (is_array($extrafields->attributes[$this->table_element]['label'])) {
6576 6576
 						foreach ($extrafields->attributes[$this->table_element]['label'] as $key => $val) {
6577
-							$this->array_options['options_' . $key] = null;
6577
+							$this->array_options['options_'.$key] = null;
6578 6578
 						}
6579 6579
 					}
6580 6580
 				}
@@ -6586,9 +6586,9 @@  discard block
 block discarded – undo
6586 6586
 						if (!empty($extrafields->attributes[$this->table_element]) && !empty($extrafields->attributes[$this->table_element]['computed'][$key])) {
6587 6587
 							//var_dump($conf->disable_compute);
6588 6588
 							if (empty($conf->disable_compute)) {
6589
-								global $objectoffield;        // We set a global variable to $objectoffield so
6590
-								$objectoffield = $this;        // we can use it inside computed formula
6591
-								$this->array_options['options_' . $key] = dol_eval($extrafields->attributes[$this->table_element]['computed'][$key], 1, 0, '2');
6589
+								global $objectoffield; // We set a global variable to $objectoffield so
6590
+								$objectoffield = $this; // we can use it inside computed formula
6591
+								$this->array_options['options_'.$key] = dol_eval($extrafields->attributes[$this->table_element]['computed'][$key], 1, 0, '2');
6592 6592
 							}
6593 6593
 						}
6594 6594
 					}
@@ -6773,7 +6773,7 @@  discard block
 block discarded – undo
6773 6773
 										// If old value encrypted in database is same than submitted new value, it means we don't change it, so we don't update.
6774 6774
 										if ($algo == 'dolcrypt') {	// dolibarr reversible encryption
6775 6775
 											if (!preg_match('/^dolcrypt:/', $this->array_options[$key])) {
6776
-												$new_array_options[$key] = dolEncrypt($this->array_options[$key]);	// warning, must be called when on the master
6776
+												$new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master
6777 6777
 											} else {
6778 6778
 												$new_array_options[$key] = $this->array_options[$key]; // Value is kept
6779 6779
 											}
@@ -6784,7 +6784,7 @@  discard block
 block discarded – undo
6784 6784
 										// If value has changed
6785 6785
 										if ($algo == 'dolcrypt') {	// dolibarr reversible encryption
6786 6786
 											if (!preg_match('/^dolcrypt:/', $this->array_options[$key])) {
6787
-												$new_array_options[$key] = dolEncrypt($this->array_options[$key]);	// warning, must be called when on the master
6787
+												$new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master
6788 6788
 											} else {
6789 6789
 												$new_array_options[$key] = $this->array_options[$key]; // Value is kept
6790 6790
 											}
@@ -6796,7 +6796,7 @@  discard block
 block discarded – undo
6796 6796
 									//var_dump('jjj'.$algo.' '.$this->oldcopy->array_options[$key].' -> '.$this->array_options[$key]);
6797 6797
 									// If this->oldcopy is not defined, we can't know if we change attribute or not, so we must keep value
6798 6798
 									if ($algo == 'dolcrypt' && !preg_match('/^dolcrypt:/', $this->array_options[$key])) {	// dolibarr reversible encryption
6799
-										$new_array_options[$key] = dolEncrypt($this->array_options[$key]);	// warning, must be called when on the master
6799
+										$new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master
6800 6800
 									} else {
6801 6801
 										$new_array_options[$key] = $this->array_options[$key]; // Value is kept
6802 6802
 									}
@@ -6841,9 +6841,9 @@  discard block
 block discarded – undo
6841 6841
 
6842 6842
 								$sqlFetchObject = "SELECT rowid FROM ".$this->db->prefix().$object->table_element;
6843 6843
 								if (is_numeric($value)) {
6844
-									$sqlFetchObject .= " WHERE rowid = " . (int) $value;
6844
+									$sqlFetchObject .= " WHERE rowid = ".(int) $value;
6845 6845
 								} else {
6846
-									$sqlFetchObject .= " WHERE ref = '" . $this->db->escape($value) . "'";
6846
+									$sqlFetchObject .= " WHERE ref = '".$this->db->escape($value)."'";
6847 6847
 								}
6848 6848
 
6849 6849
 								$obj = $this->db->getRow($sqlFetchObject);
@@ -7259,7 +7259,7 @@  discard block
 block discarded – undo
7259 7259
 								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.
7260 7260
 									if ($algo == 'dolcrypt') {	// dolibarr reversible encryption
7261 7261
 										if (!preg_match('/^dolcrypt:/', $this->array_options["options_".$key])) {
7262
-											$new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]);	// warning, must be called when on the master
7262
+											$new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]); // warning, must be called when on the master
7263 7263
 										} else {
7264 7264
 											$new_array_options["options_".$key] = $this->array_options["options_".$key]; // Value is kept
7265 7265
 										}
@@ -7279,7 +7279,7 @@  discard block
 block discarded – undo
7279 7279
 								}
7280 7280
 							} else {
7281 7281
 								if ($algo == 'dolcrypt' && !preg_match('/^dolcrypt:/', $this->array_options["options_".$key])) {	// dolibarr reversible encryption
7282
-									$new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]);	// warning, must be called when on the master
7282
+									$new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]); // warning, must be called when on the master
7283 7283
 								} else {
7284 7284
 									$new_array_options["options_".$key] = $this->array_options["options_".$key]; // Value is kept
7285 7285
 								}
@@ -7866,7 +7866,7 @@  discard block
 block discarded – undo
7866 7866
 				// 7 : sort field
7867 7867
 
7868 7868
 				// If there is filter
7869
-				if (! empty($InfoFieldList[4])) {
7869
+				if (!empty($InfoFieldList[4])) {
7870 7870
 					$pos = 0;
7871 7871
 					$parenthesisopen = 0;
7872 7872
 					while (substr($InfoFieldList[4], $pos, 1) !== '' && ($parenthesisopen || $pos == 0 || substr($InfoFieldList[4], $pos, 1) != ':')) {
@@ -7930,8 +7930,8 @@  discard block
 block discarded – undo
7930 7930
 					}
7931 7931
 
7932 7932
 					$sqlwhere = '';
7933
-					$sql = "SELECT " . $keyList;
7934
-					$sql .= " FROM " . $this->db->prefix() . $InfoFieldList[0];
7933
+					$sql = "SELECT ".$keyList;
7934
+					$sql .= " FROM ".$this->db->prefix().$InfoFieldList[0];
7935 7935
 
7936 7936
 					if (!empty($InfoFieldList[4])) {
7937 7937
 						// can use SELECT request
@@ -7949,11 +7949,11 @@  discard block
 block discarded – undo
7949 7949
 						// We have to join on extrafield table
7950 7950
 						$errstr = '';
7951 7951
 						if (strpos($InfoFieldList[4], 'extra') !== false) {
7952
-							$sql .= " as main, " . $this->db->sanitize($this->db->prefix() . $InfoFieldList[0]) . "_extrafields as extra";
7953
-							$sqlwhere .= " WHERE extra.fk_object = main." . $this->db->sanitize($InfoFieldList[2]);
7954
-							$sqlwhere .= " AND " . forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1);
7952
+							$sql .= " as main, ".$this->db->sanitize($this->db->prefix().$InfoFieldList[0])."_extrafields as extra";
7953
+							$sqlwhere .= " WHERE extra.fk_object = main.".$this->db->sanitize($InfoFieldList[2]);
7954
+							$sqlwhere .= " AND ".forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1);
7955 7955
 						} else {
7956
-							$sqlwhere .= " WHERE " . forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1);
7956
+							$sqlwhere .= " WHERE ".forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1);
7957 7957
 						}
7958 7958
 					} else {
7959 7959
 						$sqlwhere .= ' WHERE 1=1';
@@ -7974,7 +7974,7 @@  discard block
 block discarded – undo
7974 7974
 
7975 7975
 					// Some tables may have field, some other not. For the moment we disable it.
7976 7976
 					if (in_array($InfoFieldList[0], array('tablewithentity'))) {
7977
-						$sqlwhere .= " AND entity = " . ((int) $conf->entity);
7977
+						$sqlwhere .= " AND entity = ".((int) $conf->entity);
7978 7978
 					}
7979 7979
 					$sql .= $sqlwhere;
7980 7980
 
@@ -7984,10 +7984,10 @@  discard block
 block discarded – undo
7984 7984
 					} else {
7985 7985
 						$sql .= " ORDER BY ".$this->db->sanitize(implode(', ', $fields_label));
7986 7986
 					}
7987
-					$sql .= ' LIMIT ' . getDolGlobalInt('MAIN_EXTRAFIELDS_LIMIT_SELLIST_SQL', 1000);
7987
+					$sql .= ' LIMIT '.getDolGlobalInt('MAIN_EXTRAFIELDS_LIMIT_SELLIST_SQL', 1000);
7988 7988
 					// print $sql;
7989 7989
 
7990
-					dol_syslog(get_class($this) . '::showInputField type=sellist', LOG_DEBUG);
7990
+					dol_syslog(get_class($this).'::showInputField type=sellist', LOG_DEBUG);
7991 7991
 					$resql = $this->db->query($sql);
7992 7992
 					if ($resql) {
7993 7993
 						$out .= '<option value="0">&nbsp;</option>';
@@ -8003,7 +8003,7 @@  discard block
 block discarded – undo
8003 8003
 							if (count($fields_label) > 1) {
8004 8004
 								$notrans = true;
8005 8005
 								foreach ($fields_label as $field_toshow) {
8006
-									$labeltoshow .= $obj->$field_toshow . ' ';
8006
+									$labeltoshow .= $obj->$field_toshow.' ';
8007 8007
 								}
8008 8008
 							} else {
8009 8009
 								$labeltoshow = $obj->{$InfoFieldList[1]};
@@ -8014,12 +8014,12 @@  discard block
 block discarded – undo
8014 8014
 								foreach ($fields_label as $field_toshow) {
8015 8015
 									$translabel = $langs->trans($obj->$field_toshow);
8016 8016
 									if ($translabel != $obj->$field_toshow) {
8017
-										$labeltoshow = dol_trunc($translabel) . ' ';
8017
+										$labeltoshow = dol_trunc($translabel).' ';
8018 8018
 									} else {
8019
-										$labeltoshow = dol_trunc($obj->$field_toshow) . ' ';
8019
+										$labeltoshow = dol_trunc($obj->$field_toshow).' ';
8020 8020
 									}
8021 8021
 								}
8022
-								$out .= '<option value="' . $obj->rowid . '" selected>' . $labeltoshow . '</option>';
8022
+								$out .= '<option value="'.$obj->rowid.'" selected>'.$labeltoshow.'</option>';
8023 8023
 							} else {
8024 8024
 								if (!$notrans) {
8025 8025
 									$translabel = $langs->trans($obj->{$InfoFieldList[1]});
@@ -8033,25 +8033,25 @@  discard block
 block discarded – undo
8033 8033
 									$labeltoshow = '(not defined)';
8034 8034
 								}
8035 8035
 								if ($value == $obj->rowid) {
8036
-									$out .= '<option value="' . $obj->rowid . '" selected>' . $labeltoshow . '</option>';
8036
+									$out .= '<option value="'.$obj->rowid.'" selected>'.$labeltoshow.'</option>';
8037 8037
 								}
8038 8038
 
8039 8039
 								if (!empty($InfoFieldList[3]) && $parentField) {
8040
-									$parent = $parentName . ':' . $obj->{$parentField};
8040
+									$parent = $parentName.':'.$obj->{$parentField};
8041 8041
 									$isDependList = 1;
8042 8042
 								}
8043 8043
 
8044
-								$out .= '<option value="' . $obj->rowid . '"';
8044
+								$out .= '<option value="'.$obj->rowid.'"';
8045 8045
 								$out .= ($value == $obj->rowid ? ' selected' : '');
8046
-								$out .= (!empty($parent) ? ' parent="' . $parent . '"' : '');
8047
-								$out .= '>' . $labeltoshow . '</option>';
8046
+								$out .= (!empty($parent) ? ' parent="'.$parent.'"' : '');
8047
+								$out .= '>'.$labeltoshow.'</option>';
8048 8048
 							}
8049 8049
 
8050 8050
 							$i++;
8051 8051
 						}
8052 8052
 						$this->db->free($resql);
8053 8053
 					} else {
8054
-						print 'Error in request ' . $sql . ' ' . $this->db->lasterror() . '. Check setup of extra parameters.<br>';
8054
+						print 'Error in request '.$sql.' '.$this->db->lasterror().'. Check setup of extra parameters.<br>';
8055 8055
 					}
8056 8056
 				} else {
8057 8057
 					require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
@@ -8062,9 +8062,9 @@  discard block
 block discarded – undo
8062 8062
 					$data = $form->select_all_categories($categcode, '', 'parent', 64, $InfoFieldList[6], 1, 1);
8063 8063
 					$out .= '<option value="0">&nbsp;</option>';
8064 8064
 					foreach ($data as $data_key => $data_value) {
8065
-						$out .= '<option value="' . $data_key . '"';
8065
+						$out .= '<option value="'.$data_key.'"';
8066 8066
 						$out .= ($value == $data_key ? ' selected' : '');
8067
-						$out .= '>' . $data_value . '</option>';
8067
+						$out .= '>'.$data_value.'</option>';
8068 8068
 					}
8069 8069
 				}
8070 8070
 			}
@@ -8104,7 +8104,7 @@  discard block
 block discarded – undo
8104 8104
 				// 7 : sort field
8105 8105
 
8106 8106
 				// If there is a filter
8107
-				if (! empty($InfoFieldList[4])) {
8107
+				if (!empty($InfoFieldList[4])) {
8108 8108
 					$pos = 0;
8109 8109
 					$parenthesisopen = 0;
8110 8110
 					while (substr($InfoFieldList[4], $pos, 1) !== '' && ($parenthesisopen || $pos == 0 || substr($InfoFieldList[4], $pos, 1) != ':')) {
@@ -8170,8 +8170,8 @@  discard block
 block discarded – undo
8170 8170
 					}
8171 8171
 
8172 8172
 					$sqlwhere = '';
8173
-					$sql = "SELECT " . $keyList;
8174
-					$sql .= ' FROM ' . $this->db->prefix() . $InfoFieldList[0];
8173
+					$sql = "SELECT ".$keyList;
8174
+					$sql .= ' FROM '.$this->db->prefix().$InfoFieldList[0];
8175 8175
 
8176 8176
 					if (!empty($InfoFieldList[4])) {
8177 8177
 						// can use SELECT request
@@ -8189,11 +8189,11 @@  discard block
 block discarded – undo
8189 8189
 						// We have to join on extrafield table
8190 8190
 						$errstr = '';
8191 8191
 						if (strpos($InfoFieldList[4], 'extra') !== false) {
8192
-							$sql .= ' as main, ' . $this->db->sanitize($this->db->prefix() . $InfoFieldList[0]) . '_extrafields as extra';
8193
-							$sqlwhere .= " WHERE extra.fk_object = main." . $this->db->sanitize($InfoFieldList[2]);
8194
-							$sqlwhere .= " AND " . $InfoFieldList[4];
8192
+							$sql .= ' as main, '.$this->db->sanitize($this->db->prefix().$InfoFieldList[0]).'_extrafields as extra';
8193
+							$sqlwhere .= " WHERE extra.fk_object = main.".$this->db->sanitize($InfoFieldList[2]);
8194
+							$sqlwhere .= " AND ".$InfoFieldList[4];
8195 8195
 						} else {
8196
-							$sqlwhere .= " WHERE " . $InfoFieldList[4];
8196
+							$sqlwhere .= " WHERE ".$InfoFieldList[4];
8197 8197
 						}
8198 8198
 					} else {
8199 8199
 						$sqlwhere .= ' WHERE 1=1';
@@ -8214,14 +8214,14 @@  discard block
 block discarded – undo
8214 8214
 
8215 8215
 					// Some tables may have field, some other not. For the moment we disable it.
8216 8216
 					if (in_array($InfoFieldList[0], array('tablewithentity'))) {
8217
-						$sqlwhere .= " AND entity = " . ((int) $conf->entity);
8217
+						$sqlwhere .= " AND entity = ".((int) $conf->entity);
8218 8218
 					}
8219 8219
 					// $sql.=preg_replace('/^ AND /','',$sqlwhere);
8220 8220
 					// print $sql;
8221 8221
 
8222 8222
 					$sql .= $sqlwhere;
8223 8223
 
8224
-					dol_syslog(get_class($this) . '::showInputField type=chkbxlst', LOG_DEBUG);
8224
+					dol_syslog(get_class($this).'::showInputField type=chkbxlst', LOG_DEBUG);
8225 8225
 
8226 8226
 					$resql = $this->db->query($sql);
8227 8227
 					if ($resql) {
@@ -8240,7 +8240,7 @@  discard block
 block discarded – undo
8240 8240
 							if (count($fields_label) > 1) {
8241 8241
 								$notrans = true;
8242 8242
 								foreach ($fields_label as $field_toshow) {
8243
-									$labeltoshow .= $obj->$field_toshow . ' ';
8243
+									$labeltoshow .= $obj->$field_toshow.' ';
8244 8244
 								}
8245 8245
 							} else {
8246 8246
 								$labeltoshow = $obj->{$InfoFieldList[1]};
@@ -8251,9 +8251,9 @@  discard block
 block discarded – undo
8251 8251
 								foreach ($fields_label as $field_toshow) {
8252 8252
 									$translabel = $langs->trans($obj->$field_toshow);
8253 8253
 									if ($translabel != $obj->$field_toshow) {
8254
-										$labeltoshow = dol_trunc($translabel, 18) . ' ';
8254
+										$labeltoshow = dol_trunc($translabel, 18).' ';
8255 8255
 									} else {
8256
-										$labeltoshow = dol_trunc($obj->$field_toshow, 18) . ' ';
8256
+										$labeltoshow = dol_trunc($obj->$field_toshow, 18).' ';
8257 8257
 									}
8258 8258
 								}
8259 8259
 
@@ -8276,7 +8276,7 @@  discard block
 block discarded – undo
8276 8276
 								}
8277 8277
 
8278 8278
 								if (!empty($InfoFieldList[3]) && $parentField) {
8279
-									$parent = $parentName . ':' . $obj->{$parentField};
8279
+									$parent = $parentName.':'.$obj->{$parentField};
8280 8280
 									$isDependList = 1;
8281 8281
 								}
8282 8282
 
@@ -8287,9 +8287,9 @@  discard block
 block discarded – undo
8287 8287
 						}
8288 8288
 						$this->db->free($resql);
8289 8289
 
8290
-						$out = $form->multiselectarray($keyprefix . $key . $keysuffix, $data, $value_arr, 0, 0, $morecss, 0, '100%');
8290
+						$out = $form->multiselectarray($keyprefix.$key.$keysuffix, $data, $value_arr, 0, 0, $morecss, 0, '100%');
8291 8291
 					} else {
8292
-						print 'Error in request ' . $sql . ' ' . $this->db->lasterror() . '. Check setup of extra parameters.<br>';
8292
+						print 'Error in request '.$sql.' '.$this->db->lasterror().'. Check setup of extra parameters.<br>';
8293 8293
 					}
8294 8294
 				} else {
8295 8295
 					require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
@@ -8298,7 +8298,7 @@  discard block
 block discarded – undo
8298 8298
 						$categcode = Categorie::$MAP_ID_TO_CODE[(int) $InfoFieldList[5]];
8299 8299
 					}
8300 8300
 					$data = $form->select_all_categories($categcode, '', 'parent', 64, $InfoFieldList[6], 1, 1);
8301
-					$out = $form->multiselectarray($keyprefix . $key . $keysuffix, $data, $value_arr, 0, 0, $morecss, 0, '100%');
8301
+					$out = $form->multiselectarray($keyprefix.$key.$keysuffix, $data, $value_arr, 0, 0, $morecss, 0, '100%');
8302 8302
 				}
8303 8303
 			}
8304 8304
 		} elseif ($type == 'link') {
@@ -8333,7 +8333,7 @@  discard block
 block discarded – undo
8333 8333
 			// $val is already the record field found at same place than found by $valparent but already loaded and may have been modified by parent caller.
8334 8334
 
8335 8335
 			//$objectfield = $valparent;
8336
-			$objectfield = $val;			// Is better than using old method $valparent
8336
+			$objectfield = $val; // Is better than using old method $valparent
8337 8337
 
8338 8338
 			// @phan-suppress-next-line PhanTypeMismatchArgumentNullable
8339 8339
 			$out = $form->selectForForms($param_list_array[0], $keyprefix.$key.$keysuffix, (int) $value, $showempty, '', '', $morecss, $moreparam, 0, (empty($val['disabled']) ? 0 : 1), '', $objectfield);
@@ -8546,7 +8546,7 @@  discard block
 block discarded – undo
8546 8546
 			$value = $this->getLibStatut(3);
8547 8547
 		} elseif ($type == 'date') {
8548 8548
 			if (!empty($value)) {
8549
-				$value = dol_print_date($value, 'day');	// We suppose dates without time are always gmt (storage of course + output)
8549
+				$value = dol_print_date($value, 'day'); // We suppose dates without time are always gmt (storage of course + output)
8550 8550
 			} else {
8551 8551
 				$value = '';
8552 8552
 			}
@@ -8647,7 +8647,7 @@  discard block
 block discarded – undo
8647 8647
 			$value = isset($param['options'][(string) $value]) ? $param['options'][(string) $value] : '';
8648 8648
 			if (strpos($value, "|") !== false) {
8649 8649
 				$value = $langs->trans(explode('|', $value)[0]);
8650
-			} elseif (! is_numeric($value)) {
8650
+			} elseif (!is_numeric($value)) {
8651 8651
 				$value = $langs->trans($value);
8652 8652
 			}
8653 8653
 		} elseif ($type == 'sellist') {
@@ -8709,9 +8709,9 @@  discard block
 block discarded – undo
8709 8709
 									$translabel = $langs->trans($obj->$field_toshow);
8710 8710
 								}
8711 8711
 								if ($translabel != $field_toshow) {
8712
-									$value .= dol_trunc($translabel, 18) . ' ';
8712
+									$value .= dol_trunc($translabel, 18).' ';
8713 8713
 								} else {
8714
-									$value .= $obj->$field_toshow . ' ';
8714
+									$value .= $obj->$field_toshow.' ';
8715 8715
 								}
8716 8716
 							}
8717 8717
 						} else {
@@ -8727,7 +8727,7 @@  discard block
 block discarded – undo
8727 8727
 						}
8728 8728
 					}
8729 8729
 				} else {
8730
-					require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
8730
+					require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
8731 8731
 
8732 8732
 					$toprint = array();
8733 8733
 					$obj = $this->db->fetch_object($resql);
@@ -8735,7 +8735,7 @@  discard block
 block discarded – undo
8735 8735
 					$c->fetch($obj->rowid);
8736 8736
 					$ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text
8737 8737
 					foreach ($ways as $way) {
8738
-						$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #aaa"') . '>' . img_object('', 'category') . ' ' . $way . '</li>';
8738
+						$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #aaa"').'>'.img_object('', 'category').' '.$way.'</li>';
8739 8739
 					}
8740 8740
 					$value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
8741 8741
 				}
@@ -8751,11 +8751,11 @@  discard block
 block discarded – undo
8751 8751
 				$toprint = array();
8752 8752
 				foreach ($value_arr as $keyval => $valueval) {
8753 8753
 					if (!empty($valueval)) {
8754
-						$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . $param['options'][$valueval] . '</li>';
8754
+						$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$param['options'][$valueval].'</li>';
8755 8755
 					}
8756 8756
 				}
8757 8757
 				if (!empty($toprint)) {
8758
-					$value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>';
8758
+					$value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
8759 8759
 				}
8760 8760
 			}
8761 8761
 		} elseif ($type == 'chkbxlst') {
@@ -8810,9 +8810,9 @@  discard block
 block discarded – undo
8810 8810
 										$translabel = $langs->trans($obj->$field_toshow);
8811 8811
 									}
8812 8812
 									if ($translabel != $field_toshow) {
8813
-										$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . dol_trunc($translabel, 18) . '</li>';
8813
+										$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.dol_trunc($translabel, 18).'</li>';
8814 8814
 									} else {
8815
-										$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . $obj->$field_toshow . '</li>';
8815
+										$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$obj->$field_toshow.'</li>';
8816 8816
 									}
8817 8817
 								}
8818 8818
 							} else {
@@ -8821,15 +8821,15 @@  discard block
 block discarded – undo
8821 8821
 									$translabel = $langs->trans($obj->{$InfoFieldList[1]});
8822 8822
 								}
8823 8823
 								if ($translabel != $obj->{$InfoFieldList[1]}) {
8824
-									$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . dol_trunc($translabel, 18) . '</li>';
8824
+									$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.dol_trunc($translabel, 18).'</li>';
8825 8825
 								} else {
8826
-									$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . $obj->{$InfoFieldList[1]} . '</li>';
8826
+									$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$obj->{$InfoFieldList[1]}.'</li>';
8827 8827
 								}
8828 8828
 							}
8829 8829
 						}
8830 8830
 					}
8831 8831
 				} else {
8832
-					require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
8832
+					require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
8833 8833
 
8834 8834
 					$toprint = array();
8835 8835
 					while ($obj = $this->db->fetch_object($resql)) {
@@ -8838,7 +8838,7 @@  discard block
 block discarded – undo
8838 8838
 							$c->fetch($obj->rowid);
8839 8839
 							$ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text
8840 8840
 							foreach ($ways as $way) {
8841
-								$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #aaa"') . '>' . img_object('', 'category') . ' ' . $way . '</li>';
8841
+								$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #aaa"').'>'.img_object('', 'category').' '.$way.'</li>';
8842 8842
 							}
8843 8843
 						}
8844 8844
 					}
@@ -9008,7 +9008,7 @@  discard block
 block discarded – undo
9008 9008
 		global $langs;
9009 9009
 
9010 9010
 		if (!class_exists('Validate')) {
9011
-			require_once DOL_DOCUMENT_ROOT . '/core/class/validate.class.php';
9011
+			require_once DOL_DOCUMENT_ROOT.'/core/class/validate.class.php';
9012 9012
 		}
9013 9013
 
9014 9014
 		$this->clearFieldError($fieldKey);
@@ -9247,7 +9247,7 @@  discard block
 block discarded – undo
9247 9247
 				$out .= "\n";
9248 9248
 
9249 9249
 				$nbofextrafieldsshown = 0;
9250
-				$e = 0;	// var to manage the modulo (odd/even)
9250
+				$e = 0; // var to manage the modulo (odd/even)
9251 9251
 
9252 9252
 				$lastseparatorkeyfound = '';
9253 9253
 				$extrafields_collapse_num = '';
@@ -9285,9 +9285,9 @@  discard block
 block discarded – undo
9285 9285
 						continue; // <> -1 and <> 1 and <> 3 = not visible on forms, only on list
9286 9286
 					} elseif (($mode == 'edit') && !in_array(abs($visibility), array(1, 3, 4))) {
9287 9287
 						// We need to make sure, that the values of hidden extrafields are also part of $_POST. Otherwise, they would be empty after an update of the object. See also getOptionalsFromPost
9288
-						$ef_name = 'options_' . $key;
9288
+						$ef_name = 'options_'.$key;
9289 9289
 						$ef_value = $this->array_options[$ef_name];
9290
-						$out .= '<input type="hidden" name="' . $ef_name . '" id="' . $ef_name . '" value="' . $ef_value . '" />' . "\n";
9290
+						$out .= '<input type="hidden" name="'.$ef_name.'" id="'.$ef_name.'" value="'.$ef_value.'" />'."\n";
9291 9291
 						continue; // <> -1 and <> 1 and <> 3 = not visible on forms, only on list and <> 4 = not visible at the creation
9292 9292
 					} elseif ($mode == 'view' && empty($visibility)) {
9293 9293
 						continue;
@@ -10365,7 +10365,7 @@  discard block
 block discarded – undo
10365 10365
 						continue;
10366 10366
 					}
10367 10367
 				}
10368
-				$keys_with_alias[] = $alias . '.' . $fieldname;
10368
+				$keys_with_alias[] = $alias.'.'.$fieldname;
10369 10369
 			}
10370 10370
 			return implode(',', $keys_with_alias);
10371 10371
 		} else {
@@ -10506,7 +10506,7 @@  discard block
 block discarded – undo
10506 10506
 		if (!$error) {
10507 10507
 			$sql = "INSERT INTO ".$this->db->prefix().$this->table_element;
10508 10508
 			$sql .= " (".implode(", ", $keys).')';
10509
-			$sql .= " VALUES (".implode(", ", $values).")";		// $values can contains 'abc' or 123
10509
+			$sql .= " VALUES (".implode(", ", $values).")"; // $values can contains 'abc' or 123
10510 10510
 
10511 10511
 			$res = $this->db->query($sql);
10512 10512
 			if (!$res) {
@@ -10818,7 +10818,7 @@  discard block
 block discarded – undo
10818 10818
 
10819 10819
 		// Update extrafield
10820 10820
 		if (!$error) {
10821
-			$result = $this->insertExtraFields();	// This delete and reinsert extrafields
10821
+			$result = $this->insertExtraFields(); // This delete and reinsert extrafields
10822 10822
 			if ($result < 0) {
10823 10823
 				$error++;
10824 10824
 			}
@@ -11020,12 +11020,12 @@  discard block
 block discarded – undo
11020 11020
 				$error++;
11021 11021
 			} else {
11022 11022
 				while ($obj = $this->db->fetch_object($resql)) {
11023
-					$result = $this->fetch($obj->rowid);	// @phpstan-ignore-line
11023
+					$result = $this->fetch($obj->rowid); // @phpstan-ignore-line
11024 11024
 					if ($result < 0) {
11025 11025
 						$error++;
11026 11026
 						$this->errors[] = $this->error;
11027 11027
 					} else {
11028
-						$result = $this->delete($user);	// @phpstan-ignore-line
11028
+						$result = $this->delete($user); // @phpstan-ignore-line
11029 11029
 						if ($result < 0) {
11030 11030
 							$error++;
11031 11031
 							$this->errors[] = $this->error;
@@ -11191,7 +11191,7 @@  discard block
 block discarded – undo
11191 11191
 		);
11192 11192
 		foreach ($fields as $key => $value) {
11193 11193
 			if (array_key_exists($key, $this->fields)) {
11194
-				$this->{$key} = $value;		// @phpstan-ignore-line
11194
+				$this->{$key} = $value; // @phpstan-ignore-line
11195 11195
 			}
11196 11196
 		}
11197 11197
 
Please login to merge, or discard this patch.
htdocs/core/tpl/massactions_pre.tpl.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -82,14 +82,14 @@  discard block
 block discarded – undo
82 82
 if ($massaction == 'preclonetasks') {
83 83
 	$selected = '';
84 84
 	foreach (GETPOST('toselect') as $tmpselected) {
85
-		$selected .= '&selected[]=' . $tmpselected;
85
+		$selected .= '&selected[]='.$tmpselected;
86 86
 	}
87 87
 	$formquestion = array(
88 88
 		// TODO If list of project is long and project is not on a thirdparty, the combo may be very long.
89 89
 		// Solution: Allow only sameproject for cloning tasks ?
90
-		array('type' => 'other', 'name' => 'projectid', 'label' => $langs->trans('Project') .': ', 'value' => $form->selectProjects((string) $object->id, 'projectid', '', 0, 1, '', 0, array(), $object->socid, '1', 1, '', array(), 1)),
90
+		array('type' => 'other', 'name' => 'projectid', 'label' => $langs->trans('Project').': ', 'value' => $form->selectProjects((string) $object->id, 'projectid', '', 0, 1, '', 0, array(), $object->socid, '1', 1, '', array(), 1)),
91 91
 	);
92
-	print $form->formconfirm($_SERVER['PHP_SELF'] . '?id=' . $object->id . $selected, $langs->trans('ConfirmMassClone'), '', 'clonetasks', $formquestion, '', 1, 300, 590);
92
+	print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id.$selected, $langs->trans('ConfirmMassClone'), '', 'clonetasks', $formquestion, '', 1, 300, 590);
93 93
 }
94 94
 
95 95
 if ($massaction == 'preaffecttag' && isModEnabled('category')) {
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
 
156 156
 	$descConfirmPreUpdatePrice = $langs->trans("ConfirmUpdatePriceQuestion", count($toselect));
157 157
 	if (getDolGlobalString('PRODUIT_MULTIPRICES')) {
158
-		$descConfirmPreUpdatePrice = $langs->trans("ConfirmUpdatePriceQuestion", count($toselect) * getDolGlobalInt('PRODUIT_MULTIPRICES_LIMIT') .' ('.$langs->transnoentities('PricingRule').', '.$langs->transnoentities('MultiPricesNumPrices').')');
158
+		$descConfirmPreUpdatePrice = $langs->trans("ConfirmUpdatePriceQuestion", count($toselect) * getDolGlobalInt('PRODUIT_MULTIPRICES_LIMIT').' ('.$langs->transnoentities('PricingRule').', '.$langs->transnoentities('MultiPricesNumPrices').')');
159 159
 	}
160 160
 
161 161
 	print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmUpdatePrice"), $descConfirmPreUpdatePrice, "updateprice", $formquestion, 1, 0, 200, 500, 1);
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
 			$result = $objecttmp->fetch($toselectid);
231 231
 			if ($result > 0) {
232 232
 				$listofselectedid[$toselectid] = $toselectid;
233
-				$thirdpartyid = ($objecttmp->fk_soc ? $objecttmp->fk_soc : $objecttmp->socid);	// For proposal, order, invoice, conferenceorbooth, ...
233
+				$thirdpartyid = ($objecttmp->fk_soc ? $objecttmp->fk_soc : $objecttmp->socid); // For proposal, order, invoice, conferenceorbooth, ...
234 234
 				if (in_array($objecttmp->element, array('societe', 'conferenceorboothattendee'))) {
235 235
 					$thirdpartyid = $objecttmp->id;
236 236
 				} elseif ($objecttmp->element == 'contact') {
@@ -311,14 +311,14 @@  discard block
 block discarded – undo
311 311
 		$formmail->withfile = 0;
312 312
 		$formmail->withmaindocfile = 0; // Add a checkbox "Attach also main document"
313 313
 	} else {
314
-		$formmail->withfile = 1;    // $formmail->withfile = 2 to allow to upload files is not yet supported in mass action
314
+		$formmail->withfile = 1; // $formmail->withfile = 2 to allow to upload files is not yet supported in mass action
315 315
 		// Add a checkbox "Attach also main document"
316 316
 		if (isset($withmaindocfilemail)) {
317 317
 			$formmail->withmaindocfile = $withmaindocfilemail;
318 318
 		} else {    // Do an automatic definition of $formmail->withmaindocfile
319 319
 			$formmail->withmaindocfile = 1;
320 320
 			if ($objecttmp->element != 'societe') {
321
-				$formmail->withfile = '<span class="hideonsmartphone opacitymedium">' . $langs->trans("OnlyPDFattachmentSupported") . '</span>';
321
+				$formmail->withfile = '<span class="hideonsmartphone opacitymedium">'.$langs->trans("OnlyPDFattachmentSupported").'</span>';
322 322
 				$formmail->withmaindocfile = -1; // Add a checkbox "Attach also main document" but not checked by default
323 323
 			}
324 324
 		}
@@ -348,7 +348,7 @@  discard block
 block discarded – undo
348 348
 
349 349
 	// Tableau des parameters complementaires du post
350 350
 	$formmail->param['action'] = $action;
351
-	$formmail->param['models'] = $modelmail;	// the filter to know which kind of template emails to show. 'none' means no template suggested.
351
+	$formmail->param['models'] = $modelmail; // the filter to know which kind of template emails to show. 'none' means no template suggested.
352 352
 	$formmail->param['models_id'] = GETPOSTINT('modelmailselected') ? GETPOSTINT('modelmailselected') : '-1';
353 353
 	$formmail->param['id'] = implode(',', $arrayofselected);
354 354
 	// $formmail->param['returnurl']=$_SERVER["PHP_SELF"].'?id='.$object->id;
@@ -392,7 +392,7 @@  discard block
 block discarded – undo
392 392
 
393 393
 		foreach ($extrafields_list as $extraKey => $extraLabel) {
394 394
 			$outputShowOutputFields .= '<div class="mass-action-extrafield" data-extrafield="'.$extraKey.'" style="display:none;" >';
395
-			$outputShowOutputFields .= '<br><span>'. $langs->trans('NewValue').'</span>';
395
+			$outputShowOutputFields .= '<br><span>'.$langs->trans('NewValue').'</span>';
396 396
 			$outputShowOutputFields .= $extrafields->showInputField($extraKey, '', '', $keysuffix, '', '', $objecttmp, $objecttmp->table_element);
397 397
 			$outputShowOutputFields .= '</div>';
398 398
 		}
Please login to merge, or discard this patch.
htdocs/core/tpl/object_discounts.tpl.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -25,14 +25,14 @@
 block discarded – undo
25 25
  */
26 26
 
27 27
  /**
28
- * @var Object		$object
29
- * @var Form 		$form
30
- * @var Translate 	$langs
31
- * @var Societe		$thirdparty
32
- * @var	float		$absolute_discount		Amount of fixed discounts available
33
- * @var	float		$absolute_creditnote	Amount of credit notes available
34
- * @var int			$cannotApplyDiscount
35
- */
28
+  * @var Object		$object
29
+  * @var Form 		$form
30
+  * @var Translate 	$langs
31
+  * @var Societe		$thirdparty
32
+  * @var	float		$absolute_discount		Amount of fixed discounts available
33
+  * @var	float		$absolute_creditnote	Amount of credit notes available
34
+  * @var int			$cannotApplyDiscount
35
+  */
36 36
 
37 37
 print '<!-- BEGIN object_discounts.tpl.php -->'."\n";
38 38
 
Please login to merge, or discard this patch.