@@ -79,12 +79,12 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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:float,custom_x:float,custom_y:float}>', |
| 230 | 230 | 'action' => 'string', |
@@ -283,7 +283,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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, except in api_* |
| 465 | 465 | // 'PhanPluginUnknownArrayMethodReturnType', // All fixed, except in api_* |
| 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 |
||
| 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 | ]; |
@@ -62,15 +62,15 @@ discard block |
||
| 62 | 62 | function getArrayOfEmoji() |
| 63 | 63 | { |
| 64 | 64 | $arrayofcommonemoji = array( |
| 65 | - 'misc' => array('2600', '26FF'), // Miscellaneous Symbols |
|
| 66 | - 'ding' => array('2700', '27BF'), // Dingbats |
|
| 67 | - '????' => array('9989', '9989'), // Variation Selectors |
|
| 68 | - 'vars' => array('FE00', 'FE0F'), // Variation Selectors |
|
| 69 | - 'pict' => array('1F300', '1F5FF'), // Miscellaneous Symbols and Pictographs |
|
| 70 | - 'emot' => array('1F600', '1F64F'), // Emoticons |
|
| 71 | - 'tran' => array('1F680', '1F6FF'), // Transport and Map Symbols |
|
| 72 | - 'flag' => array('1F1E0', '1F1FF'), // Flags (note: may be 1F1E6 instead of 1F1E0) |
|
| 73 | - 'supp' => array('1F900', '1F9FF'), // Supplemental Symbols and Pictographs |
|
| 65 | + 'misc' => array('2600', '26FF'), // Miscellaneous Symbols |
|
| 66 | + 'ding' => array('2700', '27BF'), // Dingbats |
|
| 67 | + '????' => array('9989', '9989'), // Variation Selectors |
|
| 68 | + 'vars' => array('FE00', 'FE0F'), // Variation Selectors |
|
| 69 | + 'pict' => array('1F300', '1F5FF'), // Miscellaneous Symbols and Pictographs |
|
| 70 | + 'emot' => array('1F600', '1F64F'), // Emoticons |
|
| 71 | + 'tran' => array('1F680', '1F6FF'), // Transport and Map Symbols |
|
| 72 | + 'flag' => array('1F1E0', '1F1FF'), // Flags (note: may be 1F1E6 instead of 1F1E0) |
|
| 73 | + 'supp' => array('1F900', '1F9FF'), // Supplemental Symbols and Pictographs |
|
| 74 | 74 | ); |
| 75 | 75 | |
| 76 | 76 | return $arrayofcommonemoji; |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | //print "before decoding $val\n"; |
| 133 | 133 | do { |
| 134 | 134 | $oldval = $val; |
| 135 | - $val = html_entity_decode($val, ENT_QUOTES | ENT_HTML5); // Decode ':', ''', '	', '&NewLine', ... |
|
| 135 | + $val = html_entity_decode($val, ENT_QUOTES | ENT_HTML5); // Decode ':', ''', '	', '&NewLine', ... |
|
| 136 | 136 | // Sometimes we have entities without the ; at end so html_entity_decode does not work but entities is still interpreted by browser. |
| 137 | 137 | $val = preg_replace_callback( |
| 138 | 138 | '/&#(x?[0-9][0-9a-f]+;?)/i', |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | * @param string[] $m |
| 141 | 141 | * @return string |
| 142 | 142 | */ |
| 143 | - static function ($m) { |
|
| 143 | + static function($m) { |
|
| 144 | 144 | // Decode 'n', ... |
| 145 | 145 | return realCharForNumericEntities($m); |
| 146 | 146 | }, |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | $inj += preg_match('/user\s*\(/i', $val); // avoid to use function user() or mysql_user() that return current database login |
| 182 | 182 | $inj += preg_match('/information_schema/i', $val); // avoid to use request that read information_schema database |
| 183 | 183 | $inj += preg_match('/<svg/i', $val); // <svg can be allowed in POST |
| 184 | - $inj += preg_match('/update[^&=\w].*set.+=/i', $val); // the [^&=\w] test is to avoid error when request is like action=update&...set... or &updatemodule=...set... |
|
| 184 | + $inj += preg_match('/update[^&=\w].*set.+=/i', $val); // the [^&=\w] test is to avoid error when request is like action=update&...set... or &updatemodule=...set... |
|
| 185 | 185 | $inj += preg_match('/union.+select/i', $val); |
| 186 | 186 | } |
| 187 | 187 | if ($type == 3) { |
@@ -438,7 +438,7 @@ discard block |
||
| 438 | 438 | session_set_cookie_params($sessioncookieparams); |
| 439 | 439 | } |
| 440 | 440 | session_name($sessionname); |
| 441 | - dol_session_start(); // This call the open and read of session handler |
|
| 441 | + dol_session_start(); // This call the open and read of session handler |
|
| 442 | 442 | //exit; // this exist generates a call to write and close |
| 443 | 443 | } |
| 444 | 444 | |
@@ -466,11 +466,11 @@ discard block |
||
| 466 | 466 | if (!$ok) { |
| 467 | 467 | if (session_id() && isset($_SESSION["dol_login"]) && !in_array($_SESSION["dol_login"], explode(';', getDolGlobalString('MAIN_ONLY_LOGIN_ALLOWED')))) { |
| 468 | 468 | print 'Sorry, your application is offline.'."\n"; |
| 469 | - print 'You are logged with user "'.$_SESSION["dol_login"].'" and only administrator users (' . str_replace(';', ', ', getDolGlobalString('MAIN_ONLY_LOGIN_ALLOWED')).') is allowed to connect for the moment.'."\n"; |
|
| 469 | + print 'You are logged with user "'.$_SESSION["dol_login"].'" and only administrator users ('.str_replace(';', ', ', getDolGlobalString('MAIN_ONLY_LOGIN_ALLOWED')).') is allowed to connect for the moment.'."\n"; |
|
| 470 | 470 | $nexturl = DOL_URL_ROOT.'/user/logout.php?token='.newToken(); |
| 471 | 471 | print 'Please try later or <a href="'.$nexturl.'">click here to disconnect and change login user</a>...'."\n"; |
| 472 | 472 | } else { |
| 473 | - print 'Sorry, your application is offline. Only administrator users (' . str_replace(';', ', ', getDolGlobalString('MAIN_ONLY_LOGIN_ALLOWED')).') is allowed to connect for the moment.'."\n"; |
|
| 473 | + print 'Sorry, your application is offline. Only administrator users ('.str_replace(';', ', ', getDolGlobalString('MAIN_ONLY_LOGIN_ALLOWED')).') is allowed to connect for the moment.'."\n"; |
|
| 474 | 474 | $nexturl = DOL_URL_ROOT.'/'; |
| 475 | 475 | print 'Please try later or <a href="'.$nexturl.'">click here to change login user</a>...'."\n"; |
| 476 | 476 | } |
@@ -686,7 +686,7 @@ discard block |
||
| 686 | 686 | print "Access to this page this way (POST method or GET with a sensible value for 'action' parameter) is refused by CSRF protection in main.inc.php. Token not provided.\n"; |
| 687 | 687 | print "If you access your server behind a proxy using url rewriting and the parameter is provided by caller, you might check that all HTTP header are propagated (or add the line \$dolibarr_nocsrfcheck=1 into your conf.php file or MAIN_SECURITY_CSRF_WITH_TOKEN to 0"; |
| 688 | 688 | if (getDolGlobalString('MAIN_SECURITY_CSRF_WITH_TOKEN')) { |
| 689 | - print " instead of " . getDolGlobalString('MAIN_SECURITY_CSRF_WITH_TOKEN'); |
|
| 689 | + print " instead of ".getDolGlobalString('MAIN_SECURITY_CSRF_WITH_TOKEN'); |
|
| 690 | 690 | } |
| 691 | 691 | print " into setup).\n"; |
| 692 | 692 | } |
@@ -714,7 +714,7 @@ discard block |
||
| 714 | 714 | unset($_GET['action']); |
| 715 | 715 | unset($_GET['confirmmassaction']); |
| 716 | 716 | unset($_GET['massaction']); |
| 717 | - unset($_GET['token']); // TODO Make a redirect if we have a token in url to remove it ? |
|
| 717 | + unset($_GET['token']); // TODO Make a redirect if we have a token in url to remove it ? |
|
| 718 | 718 | if (isset($savid)) { |
| 719 | 719 | $_POST['id'] = ((int) $savid); |
| 720 | 720 | } |
@@ -736,18 +736,18 @@ discard block |
||
| 736 | 736 | foreach ($disabled_modules as $module) { |
| 737 | 737 | if ($module) { |
| 738 | 738 | if (empty($conf->$module)) { |
| 739 | - $conf->$module = new stdClass(); // To avoid warnings |
|
| 739 | + $conf->$module = new stdClass(); // To avoid warnings |
|
| 740 | 740 | } |
| 741 | 741 | |
| 742 | - $conf->$module->enabled = false; // Old usage |
|
| 742 | + $conf->$module->enabled = false; // Old usage |
|
| 743 | 743 | unset($conf->modules[$module]); |
| 744 | 744 | |
| 745 | 745 | foreach ($modulepartkeys as $modulepartkey) { |
| 746 | 746 | unset($conf->modules_parts[$modulepartkey][$module]); |
| 747 | 747 | } |
| 748 | 748 | if ($module == 'fournisseur') { // Special case |
| 749 | - $conf->supplier_order->enabled = 0; // Old usage |
|
| 750 | - $conf->supplier_invoice->enabled = 0; // Old usage |
|
| 749 | + $conf->supplier_order->enabled = 0; // Old usage |
|
| 750 | + $conf->supplier_invoice->enabled = 0; // Old usage |
|
| 751 | 751 | unset($conf->modules['supplier_order']); |
| 752 | 752 | unset($conf->modules['supplier_invoice']); |
| 753 | 753 | } |
@@ -883,12 +883,12 @@ discard block |
||
| 883 | 883 | if (is_object($captchaobj) && method_exists($captchaobj, 'validateCodeAfterLoginSubmit')) { |
| 884 | 884 | $ok = $captchaobj->validateCodeAfterLoginSubmit(); // @phan-suppress-current-line PhanUndeclaredMethod |
| 885 | 885 | } else { |
| 886 | - $_SESSION["dol_loginmesg"] = 'Error, the captcha handler '.get_class($captchaobj).' does not have any method validateCodeAfterLoginSubmit()'; |
|
| 886 | + $_SESSION["dol_loginmesg"] = 'Error, the captcha handler '.get_class($captchaobj).' does not have any method validateCodeAfterLoginSubmit()'; |
|
| 887 | 887 | $test = false; |
| 888 | 888 | $error++; |
| 889 | 889 | } |
| 890 | 890 | } else { |
| 891 | - $_SESSION["dol_loginmesg"] = 'Error, the captcha handler class '.$classname.' was not found after the include'; |
|
| 891 | + $_SESSION["dol_loginmesg"] = 'Error, the captcha handler class '.$classname.' was not found after the include'; |
|
| 892 | 892 | $test = false; |
| 893 | 893 | $error++; |
| 894 | 894 | } |
@@ -932,7 +932,7 @@ discard block |
||
| 932 | 932 | |
| 933 | 933 | $allowedmethodtopostusername = 3; |
| 934 | 934 | if (defined('MAIN_AUTHENTICATION_POST_METHOD')) { |
| 935 | - $allowedmethodtopostusername = constant('MAIN_AUTHENTICATION_POST_METHOD'); // Note a value of 2 is not compatible with some authentication methods that put username as GET parameter |
|
| 935 | + $allowedmethodtopostusername = constant('MAIN_AUTHENTICATION_POST_METHOD'); // Note a value of 2 is not compatible with some authentication methods that put username as GET parameter |
|
| 936 | 936 | } |
| 937 | 937 | // TODO Remove use of $_COOKIE['login_dolibarr'] by replacing line with $usertotest = GETPOST("username", "alpha", $allowedmethodtopostusername); ? |
| 938 | 938 | $usertotest = (!empty($_COOKIE['login_dolibarr']) ? preg_replace('/[^a-zA-Z0-9_@\-\.]/', '', $_COOKIE['login_dolibarr']) : GETPOST("username", "alpha", $allowedmethodtopostusername)); |
@@ -1074,7 +1074,7 @@ discard block |
||
| 1074 | 1074 | } |
| 1075 | 1075 | |
| 1076 | 1076 | // Show login form |
| 1077 | - dol_loginfunction($langs, $conf, (!empty($mysoc) ? $mysoc : '')); // This include http headers |
|
| 1077 | + dol_loginfunction($langs, $conf, (!empty($mysoc) ? $mysoc : '')); // This include http headers |
|
| 1078 | 1078 | } |
| 1079 | 1079 | exit; |
| 1080 | 1080 | } |
@@ -1432,7 +1432,7 @@ discard block |
||
| 1432 | 1432 | } else { |
| 1433 | 1433 | // We may have NOLOGIN set, but NOREQUIREUSER not |
| 1434 | 1434 | if (!empty($user) && method_exists($user, 'loadDefaultValues') && !defined('NODEFAULTVALUES')) { |
| 1435 | - $user->loadDefaultValues(); // Load default values for everybody (works even if $user->id = 0 |
|
| 1435 | + $user->loadDefaultValues(); // Load default values for everybody (works even if $user->id = 0 |
|
| 1436 | 1436 | } |
| 1437 | 1437 | } |
| 1438 | 1438 | |
@@ -1624,7 +1624,7 @@ discard block |
||
| 1624 | 1624 | |
| 1625 | 1625 | if (!empty(GETPOST('seteventmessages', 'alpha'))) { |
| 1626 | 1626 | $message = GETPOST('seteventmessages', 'alpha'); |
| 1627 | - $messages = explode(',', $message); |
|
| 1627 | + $messages = explode(',', $message); |
|
| 1628 | 1628 | foreach ($messages as $key => $msg) { |
| 1629 | 1629 | $tmp = explode(':', $msg); |
| 1630 | 1630 | setEventMessages($tmp[0], null, !empty($tmp[1]) ? $tmp[1] : 'mesgs'); |
@@ -1935,7 +1935,7 @@ discard block |
||
| 1935 | 1935 | } |
| 1936 | 1936 | |
| 1937 | 1937 | if (getDolGlobalString('THEME_ELDY_TOPMENU_BACK1')) { |
| 1938 | - print '<meta name="theme-color" content="rgb(' . getDolGlobalString('THEME_ELDY_TOPMENU_BACK1').')">'."\n"; |
|
| 1938 | + print '<meta name="theme-color" content="rgb('.getDolGlobalString('THEME_ELDY_TOPMENU_BACK1').')">'."\n"; |
|
| 1939 | 1939 | } |
| 1940 | 1940 | |
| 1941 | 1941 | // Auto refresh page |
@@ -2023,9 +2023,9 @@ discard block |
||
| 2023 | 2023 | $jquerytheme = getDolGlobalString('MAIN_USE_JQUERY_THEME'); |
| 2024 | 2024 | } |
| 2025 | 2025 | if (constant('JS_JQUERY_UI')) { |
| 2026 | - print '<link rel="stylesheet" type="text/css" href="' . JS_JQUERY_UI . 'css/' . $jquerytheme . '/jquery-ui.min.css' . ($ext ? '?' . $ext : '') . '">' . "\n"; // Forced JQuery |
|
| 2026 | + print '<link rel="stylesheet" type="text/css" href="'.JS_JQUERY_UI.'css/'.$jquerytheme.'/jquery-ui.min.css'.($ext ? '?'.$ext : '').'">'."\n"; // Forced JQuery |
|
| 2027 | 2027 | } else { |
| 2028 | - print '<link rel="stylesheet" type="text/css" href="' . DOL_URL_ROOT . '/includes/jquery/css/' . $jquerytheme . '/jquery-ui.css' . ($ext ? '?' . $ext : '') . '">' . "\n"; // JQuery |
|
| 2028 | + print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/css/'.$jquerytheme.'/jquery-ui.css'.($ext ? '?'.$ext : '').'">'."\n"; // JQuery |
|
| 2029 | 2029 | } |
| 2030 | 2030 | } |
| 2031 | 2031 | if (!defined('DISABLE_JQUERY_JNOTIFY')) { |
@@ -2058,7 +2058,7 @@ discard block |
||
| 2058 | 2058 | |
| 2059 | 2059 | if (!defined('DISABLE_CSS_DEFAULT_THEME')) { |
| 2060 | 2060 | print '<!-- Includes CSS for Dolibarr theme -->'."\n"; |
| 2061 | - print '<link rel="stylesheet" type="text/css" href="' . $themepath . $themeparam . '">' . "\n"; |
|
| 2061 | + print '<link rel="stylesheet" type="text/css" href="'.$themepath.$themeparam.'">'."\n"; |
|
| 2062 | 2062 | } |
| 2063 | 2063 | |
| 2064 | 2064 | if (getDolGlobalString('MAIN_FIX_FLASH_ON_CHROME')) { |
@@ -2129,9 +2129,9 @@ discard block |
||
| 2129 | 2129 | } |
| 2130 | 2130 | if (!defined('DISABLE_JQUERY_UI')) { |
| 2131 | 2131 | if (defined('JS_JQUERY_UI') && constant('JS_JQUERY_UI')) { |
| 2132 | - print '<script nonce="' . getNonce() . '" src="' . JS_JQUERY_UI . 'jquery-ui.min.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n"; |
|
| 2132 | + print '<script nonce="'.getNonce().'" src="'.JS_JQUERY_UI.'jquery-ui.min.js'.($ext ? '?'.$ext : '').'"></script>'."\n"; |
|
| 2133 | 2133 | } else { |
| 2134 | - print '<script nonce="' . getNonce() . '" src="' . DOL_URL_ROOT . '/includes/jquery/js/jquery-ui.min.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n"; |
|
| 2134 | + print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/js/jquery-ui.min.js'.($ext ? '?'.$ext : '').'"></script>'."\n"; |
|
| 2135 | 2135 | } |
| 2136 | 2136 | } |
| 2137 | 2137 | // jQuery jnotify |
@@ -2226,7 +2226,7 @@ discard block |
||
| 2226 | 2226 | // Global js function |
| 2227 | 2227 | print '<!-- Includes JS of Dolibarr -->'."\n"; |
| 2228 | 2228 | if (!defined('DISABLE_LIB_HEAD_JS')) { |
| 2229 | - print '<script nonce="' . getNonce() . '" src="' . DOL_URL_ROOT . '/core/js/lib_head.js.php?lang=' . $langs->defaultlang . ($ext ? '&' . $ext : '') . '"></script>' . "\n"; |
|
| 2229 | + print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/core/js/lib_head.js.php?lang='.$langs->defaultlang.($ext ? '&'.$ext : '').'"></script>'."\n"; |
|
| 2230 | 2230 | } |
| 2231 | 2231 | |
| 2232 | 2232 | // Leaflet |
@@ -2277,7 +2277,7 @@ discard block |
||
| 2277 | 2277 | print $head."\n"; |
| 2278 | 2278 | } |
| 2279 | 2279 | if (getDolGlobalString('MAIN_HTML_HEADER')) { |
| 2280 | - print getDolGlobalString('MAIN_HTML_HEADER') . "\n"; |
|
| 2280 | + print getDolGlobalString('MAIN_HTML_HEADER')."\n"; |
|
| 2281 | 2281 | } |
| 2282 | 2282 | |
| 2283 | 2283 | $parameters = array(); |
@@ -2420,7 +2420,7 @@ discard block |
||
| 2420 | 2420 | |
| 2421 | 2421 | $toprightmenu .= '</div>'; |
| 2422 | 2422 | |
| 2423 | - $toprightmenu .= '</div>'."\n"; // end div class="login_block_tools" |
|
| 2423 | + $toprightmenu .= '</div>'."\n"; // end div class="login_block_tools" |
|
| 2424 | 2424 | |
| 2425 | 2425 | |
| 2426 | 2426 | // Add block for other tools |
@@ -3171,7 +3171,7 @@ discard block |
||
| 3171 | 3171 | $langs->load(explode('@', $item['name'])[1]); |
| 3172 | 3172 | $dropDownQuickAddHtml .= ' |
| 3173 | 3173 | <a class="dropdown-item quickadd-item" href="'.DOL_URL_ROOT.$item['url'].'" title="'.$langs->trans(explode('@', $item['title'])[0]).'"> |
| 3174 | - '. img_picto('', $item['picto'], 'style="width:18px;"') . ' ' . $langs->trans(explode('@', $item['name'])[0]) . '</a> |
|
| 3174 | + '. img_picto('', $item['picto'], 'style="width:18px;"').' '.$langs->trans(explode('@', $item['name'])[0]).'</a> |
|
| 3175 | 3175 | '; |
| 3176 | 3176 | } |
| 3177 | 3177 | |
@@ -3290,7 +3290,7 @@ discard block |
||
| 3290 | 3290 | */ |
| 3291 | 3291 | function top_menu_search() |
| 3292 | 3292 | { |
| 3293 | - global $langs, $conf, $db, $user, $hookmanager; // used by htdocs/core/ajax/selectsearchbox.php |
|
| 3293 | + global $langs, $conf, $db, $user, $hookmanager; // used by htdocs/core/ajax/selectsearchbox.php |
|
| 3294 | 3294 | |
| 3295 | 3295 | $html = ''; |
| 3296 | 3296 | |
@@ -4056,7 +4056,7 @@ discard block |
||
| 4056 | 4056 | $forceping = GETPOST('forceping', 'alpha'); |
| 4057 | 4057 | if (($_SERVER["PHP_SELF"] == DOL_URL_ROOT.'/index.php') || $forceping) { |
| 4058 | 4058 | //print '<!-- instance_unique_id='.$conf->file->instance_unique_id.' MAIN_FIRST_PING_OK_ID='.$conf->global->MAIN_FIRST_PING_OK_ID.' -->'; |
| 4059 | - $hash_unique_id = dol_hash('dolibarr'.$conf->file->instance_unique_id, 'sha256'); // Note: if the global salt changes, this hash changes too so ping may be counted twice. We don't mind. It is for statistics purpose only. |
|
| 4059 | + $hash_unique_id = dol_hash('dolibarr'.$conf->file->instance_unique_id, 'sha256'); // Note: if the global salt changes, this hash changes too so ping may be counted twice. We don't mind. It is for statistics purpose only. |
|
| 4060 | 4060 | |
| 4061 | 4061 | if (!getDolGlobalString('MAIN_FIRST_PING_OK_DATE') |
| 4062 | 4062 | || (!empty($conf->file->instance_unique_id) && ($hash_unique_id != $conf->global->MAIN_FIRST_PING_OK_ID) && (getDolGlobalString('MAIN_FIRST_PING_OK_ID') != 'disabled')) |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | // Extra fields |
| 167 | -include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_array_fields.tpl.php'; |
|
| 167 | +include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; |
|
| 168 | 168 | |
| 169 | 169 | $object->fields = dol_sort_array($object->fields, 'position'); |
| 170 | 170 | $arrayfields = dol_sort_array($arrayfields, 'position'); |
@@ -493,7 +493,7 @@ discard block |
||
| 493 | 493 | if ($searchCategoryUserOperator == 0) { |
| 494 | 494 | $searchCategoryUserSqlList[] = " EXISTS (SELECT ck.fk_user FROM ".MAIN_DB_PREFIX."categorie_user as ck WHERE u.rowid = ck.fk_user AND ck.fk_categorie = ".((int) $searchCategoryUser).")"; |
| 495 | 495 | } else { |
| 496 | - $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryUser); |
|
| 496 | + $listofcategoryid .= ($listofcategoryid ? ', ' : '').((int) $searchCategoryUser); |
|
| 497 | 497 | } |
| 498 | 498 | } |
| 499 | 499 | } |
@@ -1238,7 +1238,7 @@ discard block |
||
| 1238 | 1238 | if ($api_key) { |
| 1239 | 1239 | if ($canreadsecretapi) { |
| 1240 | 1240 | print '<span class="opacitymedium">'; |
| 1241 | - print showValueWithClipboardCPButton($object->api_key, 1, dol_trunc($api_key, 3)); // TODO Add an option to also reveal the hash, not only copy paste |
|
| 1241 | + print showValueWithClipboardCPButton($object->api_key, 1, dol_trunc($api_key, 3)); // TODO Add an option to also reveal the hash, not only copy paste |
|
| 1242 | 1242 | print '</span>'; |
| 1243 | 1243 | } else { |
| 1244 | 1244 | print '<span class="opacitymedium">'.$langs->trans("Hidden").'</span>'; |
@@ -650,7 +650,7 @@ |
||
| 650 | 650 | if (!empty($object->accountancy_code_user_general) && $object->accountancy_code_user_general != '-1') { |
| 651 | 651 | print ' ('; |
| 652 | 652 | } |
| 653 | - $accountingAccountByDefault = $langs->trans("AccountingAccountByDefaultShort") . ": " . length_accountg(getDolGlobalString('SALARIES_ACCOUNTING_ACCOUNT_PAYMENT')); |
|
| 653 | + $accountingAccountByDefault = $langs->trans("AccountingAccountByDefaultShort").": ".length_accountg(getDolGlobalString('SALARIES_ACCOUNTING_ACCOUNT_PAYMENT')); |
|
| 654 | 654 | print(getDolGlobalString('SALARIES_ACCOUNTING_ACCOUNT_PAYMENT') ? $accountingAccountByDefault : ''); |
| 655 | 655 | if (!empty($object->accountancy_code_user_general) && $object->accountancy_code_user_general != '-1') { |
| 656 | 656 | print ')'; |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | if (!is_string($objecttype) || empty($objecttype)) { |
| 132 | 132 | $objecttype = 'thirdparty'; |
| 133 | 133 | } |
| 134 | -'@phan-var-force string $objecttype'; // Help phan that suggests $objecttype can be null |
|
| 134 | +'@phan-var-force string $objecttype'; // Help phan that suggests $objecttype can be null |
|
| 135 | 135 | |
| 136 | 136 | require_once DOL_DOCUMENT_ROOT."/core/class/extrafields.class.php"; |
| 137 | 137 | require_once DOL_DOCUMENT_ROOT."/core/class/html.form.class.php"; |
@@ -235,7 +235,7 @@ discard block |
||
| 235 | 235 | } |
| 236 | 236 | |
| 237 | 237 | // Fetch optionals attributes and labels |
| 238 | -$extrafields->fetch_name_optionals_label('all'); // We load all extrafields definitions for all objects |
|
| 238 | +$extrafields->fetch_name_optionals_label('all'); // We load all extrafields definitions for all objects |
|
| 239 | 239 | //$extrafields->fetch_name_optionals_label($object->table_element_line); |
| 240 | 240 | |
| 241 | 241 | $search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); |
@@ -248,7 +248,7 @@ discard block |
||
| 248 | 248 | |
| 249 | 249 | // If string is not an universal filter string, we try to convert it into universal filter syntax string |
| 250 | 250 | $errorstr = ''; |
| 251 | -forgeSQLFromUniversalSearchCriteria($search_component_params_input, $errorstr); // Try conversion UFS->SQL |
|
| 251 | +forgeSQLFromUniversalSearchCriteria($search_component_params_input, $errorstr); // Try conversion UFS->SQL |
|
| 252 | 252 | //var_dump($errorstr); |
| 253 | 253 | if ($errorstr) { |
| 254 | 254 | $value = $search_component_params_input; |
@@ -260,14 +260,14 @@ discard block |
||
| 260 | 260 | $crits = explode(' ', trim($value)); // the string after the name of the field. Explode on each AND |
| 261 | 261 | $res = ''; |
| 262 | 262 | |
| 263 | - $i1 = 0; // count the nb of and criteria added (all fields / criteria) |
|
| 263 | + $i1 = 0; // count the nb of and criteria added (all fields / criteria) |
|
| 264 | 264 | foreach ($crits as $crit) { // Loop on each AND criteria |
| 265 | 265 | $crit = trim($crit); |
| 266 | 266 | |
| 267 | - $i2 = 0; // count the nb of valid criteria added for this first criteria |
|
| 267 | + $i2 = 0; // count the nb of valid criteria added for this first criteria |
|
| 268 | 268 | $newres = ''; |
| 269 | 269 | $tmpcrits = explode('|', $crit); |
| 270 | - $i3 = 0; // count the nb of valid criteria added for this current field |
|
| 270 | + $i3 = 0; // count the nb of valid criteria added for this current field |
|
| 271 | 271 | foreach ($tmpcrits as $tmpcrit) { |
| 272 | 272 | if ($tmpcrit !== '0' && empty($tmpcrit)) { |
| 273 | 273 | continue; |
@@ -285,8 +285,8 @@ discard block |
||
| 285 | 285 | } |
| 286 | 286 | } |
| 287 | 287 | |
| 288 | - $field = preg_replace('/(:[!<>=\s]+:|:in:|:notin:|:like:|:notlike:).*$/', '', $tmpcrit); // the name of the field |
|
| 289 | - $tmpcrit = preg_replace('/^.*(:[!<>=\s]+:|:in:|:notin:|:like:|:notlike:)/', '\1', $tmpcrit); // the condition after the name of the field |
|
| 288 | + $field = preg_replace('/(:[!<>=\s]+:|:in:|:notin:|:like:|:notlike:).*$/', '', $tmpcrit); // the name of the field |
|
| 289 | + $tmpcrit = preg_replace('/^.*(:[!<>=\s]+:|:in:|:notin:|:like:|:notlike:)/', '\1', $tmpcrit); // the condition after the name of the field |
|
| 290 | 290 | //var_dump($field); var_dump($tmpcrit); var_dump($i3); |
| 291 | 291 | |
| 292 | 292 | $newres .= (($i2 > 0 || $i3 > 0) ? ' OR ' : ''); |
@@ -667,7 +667,7 @@ discard block |
||
| 667 | 667 | foreach ($arrayofmesures as $key => $val) { |
| 668 | 668 | $simplearrayofmesures[$key] = $arrayofmesures[$key]['label']; |
| 669 | 669 | } |
| 670 | - print $form->multiselectarray('search_measures', $simplearrayofmesures, $search_measures, 0, 0, 'minwidth300 widthcentpercentminusx', 1, 0, '', '', $langs->transnoentitiesnoconv("Measures")); // Fill the array $arrayofmeasures with possible fields |
|
| 670 | + print $form->multiselectarray('search_measures', $simplearrayofmesures, $search_measures, 0, 0, 'minwidth300 widthcentpercentminusx', 1, 0, '', '', $langs->transnoentitiesnoconv("Measures")); // Fill the array $arrayofmeasures with possible fields |
|
| 671 | 671 | print '</div>'; |
| 672 | 672 | |
| 673 | 673 | // XAxis |
@@ -675,14 +675,14 @@ discard block |
||
| 675 | 675 | print '<div class="divadvancedsearchfield">'; |
| 676 | 676 | print '<div class="inline-block"><span class="fas fa-ruler-combined paddingright pictofixedwidth" title="'.dol_escape_htmltag($langs->trans("XAxis")).'"></span><span class="fas fa-caret-down caretdownaxis" title="'.dol_escape_htmltag($langs->trans("XAxis")).'"></span></div>'; |
| 677 | 677 | //var_dump($arrayofxaxis); |
| 678 | - print $formother->selectXAxisField($object, $search_xaxis, $arrayofxaxis, $langs->trans("XAxis"), 'minwidth300 maxwidth400 widthcentpercentminusx'); // Fill the array $arrayofxaxis with possible fields |
|
| 678 | + print $formother->selectXAxisField($object, $search_xaxis, $arrayofxaxis, $langs->trans("XAxis"), 'minwidth300 maxwidth400 widthcentpercentminusx'); // Fill the array $arrayofxaxis with possible fields |
|
| 679 | 679 | print '</div>'; |
| 680 | 680 | |
| 681 | 681 | // Group by |
| 682 | 682 | $count = 0; |
| 683 | 683 | print '<div class="divadvancedsearchfield">'; |
| 684 | 684 | print '<div class="inline-block opacitymedium"><span class="fas fa-ruler-horizontal paddingright pictofixedwidth" title="'.dol_escape_htmltag($langs->trans("GroupBy")).'"></span></div>'; |
| 685 | - print $formother->selectGroupByField($object, $search_groupby, $arrayofgroupby, 'minwidth250 maxwidth300 widthcentpercentminusx', $langs->trans("GroupBy")); // Fill the array $arrayofgroupby with possible fields |
|
| 685 | + print $formother->selectGroupByField($object, $search_groupby, $arrayofgroupby, 'minwidth250 maxwidth300 widthcentpercentminusx', $langs->trans("GroupBy")); // Fill the array $arrayofgroupby with possible fields |
|
| 686 | 686 | print '</div>'; |
| 687 | 687 | |
| 688 | 688 | |
@@ -844,7 +844,7 @@ discard block |
||
| 844 | 844 | //var_dump($arrayofgroupby); |
| 845 | 845 | $tmpforloop = dolExplodeIntoArray($arrayofxaxis[$val]['tablefromt'], ','); |
| 846 | 846 | foreach ($tmpforloop as $tmptable => $tmptablealias) { |
| 847 | - if (! in_array($tmptable, $listoftablesalreadyadded)) { // We do not add join for main table and tables already added |
|
| 847 | + if (!in_array($tmptable, $listoftablesalreadyadded)) { // We do not add join for main table and tables already added |
|
| 848 | 848 | $tmpforexplode = explode('__', $tmptablealias); |
| 849 | 849 | $endpart = end($tmpforexplode); |
| 850 | 850 | $parenttableandfield = preg_replace('/__'.$endpart.'$/', '', $tmptablealias).'.'.$endpart; |
@@ -871,7 +871,7 @@ discard block |
||
| 871 | 871 | //var_dump($arrayofgroupby[$val]); var_dump($tmpval); |
| 872 | 872 | $tmpforloop = dolExplodeIntoArray($arrayofgroupby[$val]['tablefromt'], ','); |
| 873 | 873 | foreach ($tmpforloop as $tmptable => $tmptablealias) { |
| 874 | - if (! in_array($tmptable, $listoftablesalreadyadded)) { // We do not add join for main table and tables already added |
|
| 874 | + if (!in_array($tmptable, $listoftablesalreadyadded)) { // We do not add join for main table and tables already added |
|
| 875 | 875 | $tmpforexplode = explode('__', $tmptablealias); |
| 876 | 876 | $endpart = end($tmpforexplode); |
| 877 | 877 | $parenttableandfield = preg_replace('/__'.$endpart.'$/', '', $tmptablealias).'.'.$endpart; |
@@ -898,7 +898,7 @@ discard block |
||
| 898 | 898 | //var_dump($arrayofgroupby); |
| 899 | 899 | $tmpforloop = dolExplodeIntoArray($arrayofmesures[$val]['tablefromt'], ','); |
| 900 | 900 | foreach ($tmpforloop as $tmptable => $tmptablealias) { |
| 901 | - if (! in_array($tmptable, $listoftablesalreadyadded)) { // We do not add join for main table and tables already added |
|
| 901 | + if (!in_array($tmptable, $listoftablesalreadyadded)) { // We do not add join for main table and tables already added |
|
| 902 | 902 | $tmpforexplode = explode('__', $tmptablealias); |
| 903 | 903 | $endpart = end($tmpforexplode); |
| 904 | 904 | $parenttableandfield = preg_replace('/__'.$endpart.'$/', '', $tmptablealias).'.'.$endpart; |
@@ -932,7 +932,7 @@ discard block |
||
| 932 | 932 | $tmpval = explode('.', $val); |
| 933 | 933 | $tmpforloop = dolExplodeIntoArray($arrayoffilterfields[$val]['tablefromt'], ','); |
| 934 | 934 | foreach ($tmpforloop as $tmptable => $tmptablealias) { |
| 935 | - if (! in_array($tmptable, $listoftablesalreadyadded)) { // We do not add join for main table and tables already added |
|
| 935 | + if (!in_array($tmptable, $listoftablesalreadyadded)) { // We do not add join for main table and tables already added |
|
| 936 | 936 | $tmpforexplode = explode('__', $tmptablealias); |
| 937 | 937 | $endpart = end($tmpforexplode); |
| 938 | 938 | $parenttableandfield = preg_replace('/__'.$endpart.'$/', '', $tmptablealias).'.'.$endpart; |
@@ -968,9 +968,9 @@ discard block |
||
| 968 | 968 | * @param array<int, string> $matches |
| 969 | 969 | * @return string SQL filter condition |
| 970 | 970 | */ |
| 971 | - function (array $matches): string { |
|
| 971 | + function(array $matches): string { |
|
| 972 | 972 | global $db; |
| 973 | - $column = $matches[1] . '.' . $matches[2]; |
|
| 973 | + $column = $matches[1].'.'.$matches[2]; |
|
| 974 | 974 | $operator = $matches[3]; |
| 975 | 975 | $year = (int) $matches[4]; |
| 976 | 976 | $month = (int) $matches[5]; |