@@ -76,12 +76,12 @@ discard block |
||
76 | 76 | 'bom' => 'Bom', |
77 | 77 | 'bookcal' => 'BookCal', |
78 | 78 | 'bookmark' => 'Bookmark', |
79 | - 'cashdesk' => null, // TODO: fill in proper class |
|
79 | + 'cashdesk' => null, // TODO: fill in proper class |
|
80 | 80 | 'category' => 'Categorie', |
81 | 81 | 'clicktodial' => 'ClickToDial', |
82 | 82 | 'collab' => 'Collab', |
83 | 83 | 'comptabilite' => 'Comptabilite', |
84 | - 'contact' => null, // TODO: fill in proper class |
|
84 | + 'contact' => null, // TODO: fill in proper class |
|
85 | 85 | 'contract' => 'Contrat', |
86 | 86 | 'cron' => 'Cron', |
87 | 87 | 'datapolicy' => 'DataPolicy', |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | 'don' => 'Don', |
94 | 94 | 'dynamicprices' => 'DynamicPrices', |
95 | 95 | 'ecm' => 'ECM', |
96 | - 'ecotax' => null, // TODO: External module ? |
|
96 | + 'ecotax' => null, // TODO: External module ? |
|
97 | 97 | 'emailcollector' => 'EmailCollector', |
98 | 98 | 'eventorganization' => 'EventOrganization', |
99 | 99 | 'expensereport' => 'ExpenseReport', |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | 'fournisseur' => 'Fournisseur', |
105 | 105 | 'ftp' => 'FTP', |
106 | 106 | 'geoipmaxmind' => 'GeoIPMaxmind', |
107 | - 'google' => null, // External ? |
|
107 | + 'google' => null, // External ? |
|
108 | 108 | 'gravatar' => 'Gravatar', |
109 | 109 | 'holiday' => 'Holiday', |
110 | 110 | 'hrm' => 'HRM', |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | 'ldap' => 'Ldap', |
119 | 119 | 'loan' => 'Loan', |
120 | 120 | 'mailing' => 'Mailing', |
121 | - 'mailman' => null, // Same module as mailmanspip -> MailmanSpip ?? |
|
121 | + 'mailman' => null, // Same module as mailmanspip -> MailmanSpip ?? |
|
122 | 122 | 'mailmanspip' => 'MailmanSpip', |
123 | 123 | 'margin' => 'Margin', |
124 | 124 | 'member' => 'Adherent', |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | 'notification' => 'Notification', |
132 | 132 | 'numberwords' => null, // Not provided by default, no module tests |
133 | 133 | 'oauth' => 'OAuth', |
134 | - 'openstreetmap' => null, // External module? |
|
134 | + 'openstreetmap' => null, // External module? |
|
135 | 135 | 'opensurvey' => 'OpenSurvey', |
136 | 136 | 'order' => 'Commande', |
137 | 137 | 'partnership' => 'Partnership', |
@@ -158,8 +158,8 @@ discard block |
||
158 | 158 | 'stock' => 'Stock', |
159 | 159 | 'stocktransfer' => 'StockTransfer', |
160 | 160 | 'stripe' => 'Stripe', |
161 | - 'supplier_invoice' => null, // Special case, uses invoice |
|
162 | - 'supplier_order' => null, // Special case, uses invoice |
|
161 | + 'supplier_invoice' => null, // Special case, uses invoice |
|
162 | + 'supplier_order' => null, // Special case, uses invoice |
|
163 | 163 | 'supplier_proposal' => 'SupplierProposal', |
164 | 164 | 'syslog' => 'Syslog', |
165 | 165 | 'takepos' => 'TakePos', |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | // 'processes' => 6, |
222 | 222 | 'backward_compatibility_checks' => false, |
223 | 223 | 'simplify_ast' => true, |
224 | - 'analyzed_file_extensions' => ['php','inc'], |
|
224 | + 'analyzed_file_extensions' => ['php', 'inc'], |
|
225 | 225 | 'globals_type_map' => [ |
226 | 226 | '_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}>', |
227 | 227 | 'action' => 'string', |
@@ -275,7 +275,7 @@ discard block |
||
275 | 275 | 'shmkeys' => 'array<string,int>', // memory.lib |
276 | 276 | 'shmoffset' => 'int', // memory.lib |
277 | 277 | 'user' => '\User', |
278 | - 'website' => 'string', // See discussion https://github.com/Dolibarr/dolibarr/pull/28891#issuecomment-2002268334 // Disable because Phan infers Website type |
|
278 | + 'website' => 'string', // See discussion https://github.com/Dolibarr/dolibarr/pull/28891#issuecomment-2002268334 // Disable because Phan infers Website type |
|
279 | 279 | 'websitepage' => '\WebSitePage', |
280 | 280 | 'websitepagefile' => 'string', |
281 | 281 | // 'object' => '\CommonObject', // Deprecated, not enabled because conflicts with $object assignments |
@@ -299,7 +299,7 @@ discard block |
||
299 | 299 | // your application should be included in this list. |
300 | 300 | 'directory_list' => [ |
301 | 301 | 'htdocs', |
302 | - PHAN_DIR . '/stubs/', |
|
302 | + PHAN_DIR.'/stubs/', |
|
303 | 303 | ], |
304 | 304 | |
305 | 305 | // A directory list that defines files that will be excluded |
@@ -317,7 +317,7 @@ discard block |
||
317 | 317 | 'htdocs/includes/', |
318 | 318 | 'htdocs/install/doctemplates/websites/', |
319 | 319 | 'htdocs/core/class/lessc.class.php', // External library |
320 | - PHAN_DIR . '/stubs/', |
|
320 | + PHAN_DIR.'/stubs/', |
|
321 | 321 | ], |
322 | 322 | //'exclude_file_regex' => '@^vendor/.*/(tests?|Tests?)/@', |
323 | 323 | 'exclude_file_regex' => '@^(' // @phpstan-ignore-line |
@@ -334,7 +334,7 @@ discard block |
||
334 | 334 | .'|htdocs/includes/stripe/.*' // @phpstan-ignore-line |
335 | 335 | .'|htdocs/conf/conf.php' // @phpstan-ignore-line |
336 | 336 | // .'|htdocs/[^h].*/.*' // For testing @phpstan-ignore-line |
337 | - .')@', // @phpstan-ignore-line |
|
337 | + .')@', // @phpstan-ignore-line |
|
338 | 338 | |
339 | 339 | // A list of plugin files to execute. |
340 | 340 | // Plugins which are bundled with Phan can be added here by providing their name |
@@ -350,14 +350,14 @@ discard block |
||
350 | 350 | '/^isModEnabled$/' => [0, $moduleNameRegex, 'UnknownModuleName'], |
351 | 351 | // Note: trick to have different key for same regex: |
352 | 352 | '/^isModEnable[d]$/' => [0, $deprecatedModuleNameRegex, "DeprecatedModuleName"], |
353 | - '/^sanitizeVal$/' => [1, $sanitizeRegex,"UnknownSanitizeType"], |
|
354 | - '/^checkVal$/' => [1, $sanitizeRegex,"UnknownCheckValSanitizeType"], |
|
355 | - '/^\\\\ExtraFields::addExtraField$/' => [2, $extraFieldTypeRegex,"UnknownExtrafieldTypeBack"], |
|
356 | - '/^dol_now$/' => [0, '{^(?:auto|gmt|tz(?:server|ref|user(?:rel)?))$}',"InvalidDolNowArgument"], |
|
357 | - '/^dol_mktime$/' => [6, '{^(?:|0|1|auto|gmt|tz(?:server|ref|user(?:rel)?|,[+a-zA-Z-/]+))$}',"InvalidDolMktimeArgument"], // '', 0, 1 match bool and int values |
|
358 | - '/^dol_print_date$/' => [2, '{^(?:|0|1|auto|gmt|tz(?:server|user(?:rel)?))$}',"InvalidDolMktimeArgument"], // '', 0, 1 match bool and int values |
|
359 | - '/^GETPOSTFLOAT$/' => [1, '{^(?:|M[UTS]|C[UT]|\d+)$}',"InvalidGetPostFloatRounding"], |
|
360 | - '/^price2num$/' => [1, '{^(?:|M[UTS]|C[UT]|\d+)$}',"InvalidPrice2NumRounding"], |
|
353 | + '/^sanitizeVal$/' => [1, $sanitizeRegex, "UnknownSanitizeType"], |
|
354 | + '/^checkVal$/' => [1, $sanitizeRegex, "UnknownCheckValSanitizeType"], |
|
355 | + '/^\\\\ExtraFields::addExtraField$/' => [2, $extraFieldTypeRegex, "UnknownExtrafieldTypeBack"], |
|
356 | + '/^dol_now$/' => [0, '{^(?:auto|gmt|tz(?:server|ref|user(?:rel)?))$}', "InvalidDolNowArgument"], |
|
357 | + '/^dol_mktime$/' => [6, '{^(?:|0|1|auto|gmt|tz(?:server|ref|user(?:rel)?|,[+a-zA-Z-/]+))$}', "InvalidDolMktimeArgument"], // '', 0, 1 match bool and int values |
|
358 | + '/^dol_print_date$/' => [2, '{^(?:|0|1|auto|gmt|tz(?:server|user(?:rel)?))$}', "InvalidDolMktimeArgument"], // '', 0, 1 match bool and int values |
|
359 | + '/^GETPOSTFLOAT$/' => [1, '{^(?:|M[UTS]|C[UT]|\d+)$}', "InvalidGetPostFloatRounding"], |
|
360 | + '/^price2num$/' => [1, '{^(?:|M[UTS]|C[UT]|\d+)$}', "InvalidPrice2NumRounding"], |
|
361 | 361 | ], |
362 | 362 | 'plugins' => [ |
363 | 363 | __DIR__.'/plugins/NoVarDumpPlugin.php', |
@@ -418,42 +418,42 @@ discard block |
||
418 | 418 | // Dolibarr uses a lot of internal deprecated stuff, not reporting |
419 | 419 | 'PhanDeprecatedProperty', |
420 | 420 | |
421 | - 'PhanCompatibleNegativeStringOffset', // return false positive |
|
422 | - 'PhanPluginConstantVariableBool', // a lot of false positive, in most cases, we want to keep the code as it is |
|
421 | + 'PhanCompatibleNegativeStringOffset', // return false positive |
|
422 | + 'PhanPluginConstantVariableBool', // a lot of false positive, in most cases, we want to keep the code as it is |
|
423 | 423 | // 'PhanPluginUnknownArrayPropertyType', // Helps find missing array keys or mismatches, remaining occurrences are likely unused properties |
424 | - 'PhanTypeArraySuspiciousNullable', // About 440 occurrences |
|
424 | + 'PhanTypeArraySuspiciousNullable', // About 440 occurrences |
|
425 | 425 | // 'PhanTypeInvalidDimOffset', // Helps identify missing array indexes in types or reference to unset indexes |
426 | 426 | 'PhanTypeObjectUnsetDeclaredProperty', |
427 | - 'PhanTypePossiblyInvalidDimOffset', // a lot of false positive, in most cases, we want to keep the code as it is |
|
427 | + 'PhanTypePossiblyInvalidDimOffset', // a lot of false positive, in most cases, we want to keep the code as it is |
|
428 | 428 | // 'PhanPluginUnknownArrayFunctionReturnType', // a lot of false positive, in most cases, we want to keep the code as it is |
429 | 429 | |
430 | - 'PhanPluginWhitespaceTab', // Dolibarr uses tabs |
|
431 | - 'PhanPluginCanUsePHP71Void', // Dolibarr is maintaining 7.0 compatibility |
|
432 | - 'PhanPluginShortArray', // Dolibarr uses array() |
|
433 | - 'PhanPluginShortArrayList', // Dolibarr uses array() |
|
430 | + 'PhanPluginWhitespaceTab', // Dolibarr uses tabs |
|
431 | + 'PhanPluginCanUsePHP71Void', // Dolibarr is maintaining 7.0 compatibility |
|
432 | + 'PhanPluginShortArray', // Dolibarr uses array() |
|
433 | + 'PhanPluginShortArrayList', // Dolibarr uses array() |
|
434 | 434 | // Fixers From PHPDocToRealTypesPlugin: |
435 | - 'PhanPluginCanUseParamType', // Fixer - Report/Add types in the function definition (function abc(string $var) (adds string) |
|
436 | - 'PhanPluginCanUseReturnType', // Fixer - Report/Add return types in the function definition (function abc(string $var) (adds string) |
|
437 | - 'PhanPluginCanUseNullableParamType', // Fixer - Report/Add nullable parameter types in the function definition |
|
438 | - 'PhanPluginCanUseNullableReturnType', // Fixer - Report/Add nullable return types in the function definition |
|
435 | + 'PhanPluginCanUseParamType', // Fixer - Report/Add types in the function definition (function abc(string $var) (adds string) |
|
436 | + 'PhanPluginCanUseReturnType', // Fixer - Report/Add return types in the function definition (function abc(string $var) (adds string) |
|
437 | + 'PhanPluginCanUseNullableParamType', // Fixer - Report/Add nullable parameter types in the function definition |
|
438 | + 'PhanPluginCanUseNullableReturnType', // Fixer - Report/Add nullable return types in the function definition |
|
439 | 439 | |
440 | - 'PhanPluginNonBoolBranch', // Not essential - 31240+ occurrences |
|
441 | - 'PhanPluginNumericalComparison', // Not essential - 19870+ occurrences |
|
442 | - 'PhanTypeMismatchArgument', // Also reported by phpstan < lvl6 - 12300+ occurrences |
|
443 | - 'PhanPluginNonBoolInLogicalArith', // Not essential - 11040+ occurrences |
|
444 | - 'PhanPluginConstantVariableScalar', // Not essential - 5180+ occurrences |
|
440 | + 'PhanPluginNonBoolBranch', // Not essential - 31240+ occurrences |
|
441 | + 'PhanPluginNumericalComparison', // Not essential - 19870+ occurrences |
|
442 | + 'PhanTypeMismatchArgument', // Also reported by phpstan < lvl6 - 12300+ occurrences |
|
443 | + 'PhanPluginNonBoolInLogicalArith', // Not essential - 11040+ occurrences |
|
444 | + 'PhanPluginConstantVariableScalar', // Not essential - 5180+ occurrences |
|
445 | 445 | 'PhanPluginDuplicateAdjacentStatement', |
446 | - 'PhanPluginDuplicateConditionalTernaryDuplication', // 2750+ occurrences |
|
447 | - 'PhanPluginDuplicateConditionalNullCoalescing', // Not essential - 990+ occurrences |
|
448 | - 'PhanPluginRedundantAssignmentInGlobalScope', // Not essential, a lot of false warning |
|
449 | - 'PhanPluginRedundantAssignment', // Not essential, useless |
|
450 | - 'PhanPluginDuplicateCatchStatementBody', // Requires PHP7.1 - 50+ occurrences |
|
446 | + 'PhanPluginDuplicateConditionalTernaryDuplication', // 2750+ occurrences |
|
447 | + 'PhanPluginDuplicateConditionalNullCoalescing', // Not essential - 990+ occurrences |
|
448 | + 'PhanPluginRedundantAssignmentInGlobalScope', // Not essential, a lot of false warning |
|
449 | + 'PhanPluginRedundantAssignment', // Not essential, useless |
|
450 | + 'PhanPluginDuplicateCatchStatementBody', // Requires PHP7.1 - 50+ occurrences |
|
451 | 451 | |
452 | 452 | // 'PhanPluginUnknownArrayMethodParamType', // Too many troubles to manage. Is enabled in config_extended only. |
453 | 453 | // 'PhanPluginUnknownArrayMethodReturnType', // Too many troubles to manage. Is enabled in config_extended only. |
454 | 454 | // 'PhanUndeclaredGlobalVariable', // Helps identify variables that are not set/defined - add '@phan-var-force TYPE $varname' in tpl or includes to help type the variable |
455 | 455 | // 'PhanPluginUnknownObjectMethodCall', // False positive for some class. Is enabled in config_extended only. |
456 | - 'PhanTypeSuspiciousNonTraversableForeach', // Reports on `foreach ($object as $key => $value)` which works without php notices, so we ignore it because this is intentional in the code. |
|
456 | + 'PhanTypeSuspiciousNonTraversableForeach', // Reports on `foreach ($object as $key => $value)` which works without php notices, so we ignore it because this is intentional in the code. |
|
457 | 457 | ], |
458 | 458 | // You can put relative paths to internal stubs in this config option. |
459 | 459 | // Phan will continue using its detailed type annotations, |
@@ -472,31 +472,31 @@ discard block |
||
472 | 472 | //'xdebug' => 'vendor/phan/phan/.phan/internal_stubs/xdebug.phan_php', |
473 | 473 | //'memcached' => PHAN_DIR . '/your_internal_stubs_folder_name/memcached.phan_php', |
474 | 474 | //'PDO' => PHAN_DIR . '/stubs/PDO.phan_php', |
475 | - 'brotli' => PHAN_DIR . '/stubs/brotli.phan_php', |
|
476 | - 'curl' => PHAN_DIR . '/stubs/curl.phan_php', |
|
477 | - 'calendar' => PHAN_DIR . '/stubs/calendar.phan_php', |
|
478 | - 'fileinfo' => PHAN_DIR . '/stubs/fileinfo.phan_php', |
|
479 | - 'ftp' => PHAN_DIR . '/stubs/ftp.phan_php', |
|
480 | - 'gd' => PHAN_DIR . '/stubs/gd.phan_php', |
|
481 | - 'geoip' => PHAN_DIR . '/stubs/geoip.phan_php', |
|
482 | - 'imagick' => PHAN_DIR . '/stubs/imagick.phan_php', |
|
483 | - 'imap' => PHAN_DIR . '/stubs/imap.phan_php', |
|
484 | - 'intl' => PHAN_DIR . '/stubs/intl.phan_php', |
|
485 | - 'ldap' => PHAN_DIR . '/stubs/ldap.phan_php', |
|
486 | - 'mcrypt' => PHAN_DIR . '/stubs/mcrypt.phan_php', |
|
487 | - 'memcache' => PHAN_DIR . '/stubs/memcache.phan_php', |
|
488 | - 'memcached' => PHAN_DIR . '/stubs/memcached.phan_php', |
|
489 | - 'mysqli' => PHAN_DIR . '/stubs/mysqli.phan_php', |
|
490 | - 'pdo_cubrid' => PHAN_DIR . '/stubs/pdo_cubrid.phan_php', |
|
491 | - 'pdo_mysql' => PHAN_DIR . '/stubs/pdo_mysql.phan_php', |
|
492 | - 'pdo_pgsql' => PHAN_DIR . '/stubs/pdo_pgsql.phan_php', |
|
493 | - 'pdo_sqlite' => PHAN_DIR . '/stubs/pdo_sqlite.phan_php', |
|
494 | - 'pgsql' => PHAN_DIR . '/stubs/pgsql.phan_php', |
|
495 | - 'session' => PHAN_DIR . '/stubs/session.phan_php', |
|
496 | - 'simplexml' => PHAN_DIR . '/stubs/SimpleXML.phan_php', |
|
497 | - 'soap' => PHAN_DIR . '/stubs/soap.phan_php', |
|
498 | - 'sockets' => PHAN_DIR . '/stubs/sockets.phan_php', |
|
499 | - 'tidy' => PHAN_DIR . '/stubs/tidy.phan_php', |
|
500 | - 'zip' => PHAN_DIR . '/stubs/zip.phan_php', |
|
475 | + 'brotli' => PHAN_DIR.'/stubs/brotli.phan_php', |
|
476 | + 'curl' => PHAN_DIR.'/stubs/curl.phan_php', |
|
477 | + 'calendar' => PHAN_DIR.'/stubs/calendar.phan_php', |
|
478 | + 'fileinfo' => PHAN_DIR.'/stubs/fileinfo.phan_php', |
|
479 | + 'ftp' => PHAN_DIR.'/stubs/ftp.phan_php', |
|
480 | + 'gd' => PHAN_DIR.'/stubs/gd.phan_php', |
|
481 | + 'geoip' => PHAN_DIR.'/stubs/geoip.phan_php', |
|
482 | + 'imagick' => PHAN_DIR.'/stubs/imagick.phan_php', |
|
483 | + 'imap' => PHAN_DIR.'/stubs/imap.phan_php', |
|
484 | + 'intl' => PHAN_DIR.'/stubs/intl.phan_php', |
|
485 | + 'ldap' => PHAN_DIR.'/stubs/ldap.phan_php', |
|
486 | + 'mcrypt' => PHAN_DIR.'/stubs/mcrypt.phan_php', |
|
487 | + 'memcache' => PHAN_DIR.'/stubs/memcache.phan_php', |
|
488 | + 'memcached' => PHAN_DIR.'/stubs/memcached.phan_php', |
|
489 | + 'mysqli' => PHAN_DIR.'/stubs/mysqli.phan_php', |
|
490 | + 'pdo_cubrid' => PHAN_DIR.'/stubs/pdo_cubrid.phan_php', |
|
491 | + 'pdo_mysql' => PHAN_DIR.'/stubs/pdo_mysql.phan_php', |
|
492 | + 'pdo_pgsql' => PHAN_DIR.'/stubs/pdo_pgsql.phan_php', |
|
493 | + 'pdo_sqlite' => PHAN_DIR.'/stubs/pdo_sqlite.phan_php', |
|
494 | + 'pgsql' => PHAN_DIR.'/stubs/pgsql.phan_php', |
|
495 | + 'session' => PHAN_DIR.'/stubs/session.phan_php', |
|
496 | + 'simplexml' => PHAN_DIR.'/stubs/SimpleXML.phan_php', |
|
497 | + 'soap' => PHAN_DIR.'/stubs/soap.phan_php', |
|
498 | + 'sockets' => PHAN_DIR.'/stubs/sockets.phan_php', |
|
499 | + 'tidy' => PHAN_DIR.'/stubs/tidy.phan_php', |
|
500 | + 'zip' => PHAN_DIR.'/stubs/zip.phan_php', |
|
501 | 501 | ], |
502 | 502 | ]; |
@@ -29,15 +29,15 @@ discard block |
||
29 | 29 | |
30 | 30 | // Load Dolibarr environment |
31 | 31 | require '../main.inc.php'; |
32 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php'; |
|
33 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php'; |
|
34 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; |
|
35 | -require_once DOL_DOCUMENT_ROOT . '/hrm/class/position.class.php'; |
|
36 | -require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php'; |
|
37 | -require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_position.lib.php'; |
|
38 | -require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_job.lib.php'; |
|
39 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; |
|
40 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; |
|
32 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; |
|
33 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; |
|
34 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; |
|
35 | +require_once DOL_DOCUMENT_ROOT.'/hrm/class/position.class.php'; |
|
36 | +require_once DOL_DOCUMENT_ROOT.'/hrm/class/job.class.php'; |
|
37 | +require_once DOL_DOCUMENT_ROOT.'/hrm/lib/hrm_position.lib.php'; |
|
38 | +require_once DOL_DOCUMENT_ROOT.'/hrm/lib/hrm_job.lib.php'; |
|
39 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; |
|
40 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; |
|
41 | 41 | |
42 | 42 | |
43 | 43 | /** |
@@ -52,12 +52,12 @@ discard block |
||
52 | 52 | // Load translation files required by the page |
53 | 53 | $langs->loadLangs(array("hrm", "other", 'products')); |
54 | 54 | |
55 | -$action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... |
|
55 | +$action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... |
|
56 | 56 | $massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) |
57 | 57 | $show_files = GETPOSTINT('show_files'); // Show files area generated by bulk actions ? |
58 | -$confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation |
|
59 | -$cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button |
|
60 | -$toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list |
|
58 | +$confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation |
|
59 | +$cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button |
|
60 | +$toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list |
|
61 | 61 | $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'jobpositionlist'; // To manage different context of search |
62 | 62 | $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') |
63 | 63 | $backtopage = GETPOST('backtopage', 'alpha'); |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; |
76 | 76 | $sortfield = GETPOST('sortfield', 'aZ09comma'); |
77 | 77 | $sortorder = GETPOST('sortorder', 'aZ09comma'); |
78 | -$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); |
|
78 | +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); |
|
79 | 79 | if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { |
80 | 80 | // If $page is not defined, or '' or -1 or if we click on clear filters |
81 | 81 | $page = 0; |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | $object = new Job($db); |
90 | 90 | $objectposition = new Position($db); |
91 | 91 | $extrafields = new ExtraFields($db); |
92 | -$diroutputmassaction = $conf->hrm->dir_output . '/temp/massgeneration/' . $user->id; |
|
92 | +$diroutputmassaction = $conf->hrm->dir_output.'/temp/massgeneration/'.$user->id; |
|
93 | 93 | $hookmanager->initHooks(array('jobpositioncard', 'globalcard')); // Note that conf->hooks_modules contains array |
94 | 94 | |
95 | 95 | |
@@ -101,8 +101,8 @@ discard block |
||
101 | 101 | |
102 | 102 | // Default sort order (if not yet defined by previous GETPOST) |
103 | 103 | if (!$sortfield) { |
104 | - reset($objectposition->fields); // Reset is required to avoid key() to return null. |
|
105 | - $sortfield = "t." . key($objectposition->fields); // Set here default search field. By default 1st field in definition. |
|
104 | + reset($objectposition->fields); // Reset is required to avoid key() to return null. |
|
105 | + $sortfield = "t.".key($objectposition->fields); // Set here default search field. By default 1st field in definition. |
|
106 | 106 | } |
107 | 107 | if (!$sortorder) { |
108 | 108 | $sortorder = "ASC"; |
@@ -112,12 +112,12 @@ discard block |
||
112 | 112 | $search_all = GETPOST('search_all', 'alphanohtml'); |
113 | 113 | $search = array(); |
114 | 114 | foreach ($objectposition->fields as $key => $val) { |
115 | - if (GETPOST('search_' . $key, 'alpha') !== '') { |
|
116 | - $search[$key] = GETPOST('search_' . $key, 'alpha'); |
|
115 | + if (GETPOST('search_'.$key, 'alpha') !== '') { |
|
116 | + $search[$key] = GETPOST('search_'.$key, 'alpha'); |
|
117 | 117 | } |
118 | 118 | if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { |
119 | - $search[$key . '_dtstart'] = dol_mktime(0, 0, 0, GETPOSTINT('search_' . $key . '_dtstartmonth'), GETPOSTINT('search_' . $key . '_dtstartday'), GETPOSTINT('search_' . $key . '_dtstartyear')); |
|
120 | - $search[$key . '_dtend'] = dol_mktime(23, 59, 59, GETPOSTINT('search_' . $key . '_dtendmonth'), GETPOSTINT('search_' . $key . '_dtendday'), GETPOSTINT('search_' . $key . '_dtendyear')); |
|
119 | + $search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOSTINT('search_'.$key.'_dtstartmonth'), GETPOSTINT('search_'.$key.'_dtstartday'), GETPOSTINT('search_'.$key.'_dtstartyear')); |
|
120 | + $search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOSTINT('search_'.$key.'_dtendmonth'), GETPOSTINT('search_'.$key.'_dtendday'), GETPOSTINT('search_'.$key.'_dtendyear')); |
|
121 | 121 | } |
122 | 122 | } |
123 | 123 | |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | $fieldstosearchall = array(); |
126 | 126 | foreach ($objectposition->fields as $key => $val) { |
127 | 127 | if (!empty($val['searchall'])) { |
128 | - $fieldstosearchall['t.' . $key] = $val['label']; |
|
128 | + $fieldstosearchall['t.'.$key] = $val['label']; |
|
129 | 129 | } |
130 | 130 | } |
131 | 131 | |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | // If $val['visible']==0, then we never show the field |
136 | 136 | if (!empty($val['visible'])) { |
137 | 137 | $visible = (int) dol_eval((string) $val['visible'], 1, 1, '1'); |
138 | - $arrayfields['t.' . $key] = array( |
|
138 | + $arrayfields['t.'.$key] = array( |
|
139 | 139 | 'label' => $val['label'], |
140 | 140 | 'checked' => (($visible < 0) ? 0 : 1), |
141 | 141 | 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | } |
146 | 146 | } |
147 | 147 | // Extra fields |
148 | -include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_array_fields.tpl.php'; |
|
148 | +include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; |
|
149 | 149 | |
150 | 150 | $objectposition->fields = dol_sort_array($objectposition->fields, 'position'); |
151 | 151 | $arrayfields = dol_sort_array($arrayfields, 'position'); |
@@ -154,13 +154,13 @@ discard block |
||
154 | 154 | |
155 | 155 | |
156 | 156 | // Load object |
157 | -include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. |
|
157 | +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. |
|
158 | 158 | |
159 | 159 | // Permissions |
160 | 160 | $permissiontoread = $user->hasRight('hrm', 'all', 'read'); |
161 | 161 | $permissiontoadd = $user->hasRight('hrm', 'all', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php |
162 | 162 | $permissiontodelete = $user->hasRight('hrm', 'all', 'delete'); |
163 | -$upload_dir = $conf->hrm->multidir_output[isset($object->entity) ? $object->entity : 1] . '/position'; |
|
163 | +$upload_dir = $conf->hrm->multidir_output[isset($object->entity) ? $object->entity : 1].'/position'; |
|
164 | 164 | |
165 | 165 | // Security check (enable the most restrictive one) |
166 | 166 | //if ($user->socid > 0) accessforbidden(); |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | $backurlforlist = dol_buildpath('/hrm/position_list.php', 1); |
191 | 191 | $idBacktoPage = GETPOST('fk_job', 'aZ09'); |
192 | 192 | if ($idBacktoPage > 0) { |
193 | - $backtopage = dol_buildpath('/hrm/position.php', 1) . '?id=' . $idBacktoPage; |
|
193 | + $backtopage = dol_buildpath('/hrm/position.php', 1).'?id='.$idBacktoPage; |
|
194 | 194 | } |
195 | 195 | if (empty($backtopage) || ($cancel && empty($id))) { |
196 | 196 | if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) { |
@@ -198,9 +198,9 @@ discard block |
||
198 | 198 | $backtopage = $backurlforlist; |
199 | 199 | } else { |
200 | 200 | if ($fk_job > 0) { |
201 | - $backtopage = dol_buildpath('/hrm/position.php', 1) . '?fk_job=' . ($fk_job > 0 ? $fk_job : '__ID__'); |
|
201 | + $backtopage = dol_buildpath('/hrm/position.php', 1).'?fk_job='.($fk_job > 0 ? $fk_job : '__ID__'); |
|
202 | 202 | } else { |
203 | - $backtopage = dol_buildpath('/hrm/position_card.php', 1) . '?id=__ID__'; |
|
203 | + $backtopage = dol_buildpath('/hrm/position_card.php', 1).'?id=__ID__'; |
|
204 | 204 | } |
205 | 205 | } |
206 | 206 | } |
@@ -213,15 +213,15 @@ discard block |
||
213 | 213 | $object = new Position($db); |
214 | 214 | |
215 | 215 | // Selection of new fields |
216 | - include DOL_DOCUMENT_ROOT . '/core/actions_changeselectedfields.inc.php'; |
|
216 | + include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; |
|
217 | 217 | |
218 | 218 | // Purge search criteria |
219 | 219 | if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers |
220 | 220 | foreach ($object->fields as $key => $val) { |
221 | 221 | $search[$key] = ''; |
222 | 222 | if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { |
223 | - $search[$key . '_dtstart'] = ''; |
|
224 | - $search[$key . '_dtend'] = ''; |
|
223 | + $search[$key.'_dtstart'] = ''; |
|
224 | + $search[$key.'_dtend'] = ''; |
|
225 | 225 | } |
226 | 226 | } |
227 | 227 | $toselect = array(); |
@@ -236,9 +236,9 @@ discard block |
||
236 | 236 | $objectclass = 'Position'; |
237 | 237 | $objectlabel = 'Position'; |
238 | 238 | $uploaddir = $conf->hrm->dir_output; |
239 | - include DOL_DOCUMENT_ROOT . '/core/actions_massactions.inc.php'; |
|
239 | + include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; |
|
240 | 240 | |
241 | - include DOL_DOCUMENT_ROOT . '/core/actions_addupdatedelete.inc.php'; |
|
241 | + include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php'; |
|
242 | 242 | |
243 | 243 | $object = $job; |
244 | 244 | } |
@@ -260,29 +260,29 @@ discard block |
||
260 | 260 | $object = new Position($db); |
261 | 261 | // Fetch optionals attributes and labels |
262 | 262 | $extrafields->fetch_name_optionals_label($object->table_element); |
263 | - print load_fiche_titre($langs->trans("NewObject", $langs->transnoentitiesnoconv("Position")), '', 'object_' . $object->picto); |
|
263 | + print load_fiche_titre($langs->trans("NewObject", $langs->transnoentitiesnoconv("Position")), '', 'object_'.$object->picto); |
|
264 | 264 | |
265 | - print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">'; |
|
266 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
265 | + print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">'; |
|
266 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
267 | 267 | print '<input type="hidden" name="action" value="add">'; |
268 | 268 | if ($backtopage) { |
269 | - print '<input type="hidden" name="backtopage" value="' . $backtopage . '">'; |
|
269 | + print '<input type="hidden" name="backtopage" value="'.$backtopage.'">'; |
|
270 | 270 | } |
271 | 271 | if ($backtopageforcancel) { |
272 | - print '<input type="hidden" name="backtopageforcancel" value="' . $backtopageforcancel . '">'; |
|
272 | + print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">'; |
|
273 | 273 | } |
274 | 274 | |
275 | 275 | print dol_get_fiche_head(array(), ''); |
276 | 276 | |
277 | - print '<table class="border centpercent tableforfieldcreate">' . "\n"; |
|
277 | + print '<table class="border centpercent tableforfieldcreate">'."\n"; |
|
278 | 278 | |
279 | 279 | // Common attributes |
280 | - include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_add.tpl.php'; |
|
280 | + include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_add.tpl.php'; |
|
281 | 281 | |
282 | 282 | // Other attributes |
283 | - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_add.tpl.php'; |
|
283 | + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php'; |
|
284 | 284 | |
285 | - print '</table>' . "\n"; |
|
285 | + print '</table>'."\n"; |
|
286 | 286 | |
287 | 287 | print dol_get_fiche_end(); |
288 | 288 | |
@@ -294,10 +294,10 @@ discard block |
||
294 | 294 | } |
295 | 295 | if ($job->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'))) { |
296 | 296 | if ($backtopage) { |
297 | - print '<input type="hidden" name="backtopage" value="' . $backtopage . '">'; |
|
297 | + print '<input type="hidden" name="backtopage" value="'.$backtopage.'">'; |
|
298 | 298 | } |
299 | 299 | if ($backtopageforcancel) { |
300 | - print '<input type="hidden" name="backtopageforcancel" value="' . $backtopageforcancel . '">'; |
|
300 | + print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">'; |
|
301 | 301 | } |
302 | 302 | |
303 | 303 | // Part to show record |
@@ -310,7 +310,7 @@ discard block |
||
310 | 310 | |
311 | 311 | // Object card |
312 | 312 | // ------------------------------------------------------------ |
313 | - $linkback = '<a href="' . dol_buildpath('/hrm/position_list.php', 1) . '?restore_lastsearch_values=1' . (!empty($fk_job) ? '&fk_job=' . $fk_job : '') . '">' . $langs->trans("BackToList") . '</a>'; |
|
313 | + $linkback = '<a href="'.dol_buildpath('/hrm/position_list.php', 1).'?restore_lastsearch_values=1'.(!empty($fk_job) ? '&fk_job='.$fk_job : '').'">'.$langs->trans("BackToList").'</a>'; |
|
314 | 314 | |
315 | 315 | $morehtmlref = '<div class="refid">'; |
316 | 316 | $morehtmlref .= $object->label; |
@@ -322,17 +322,17 @@ discard block |
||
322 | 322 | print '<div class="fichecenter">'; |
323 | 323 | print '<div class="fichehalfleft">'; |
324 | 324 | print '<div class="underbanner clearboth"></div>'; |
325 | - print '<table class="border centpercent tableforfield">' . "\n"; |
|
325 | + print '<table class="border centpercent tableforfield">'."\n"; |
|
326 | 326 | |
327 | 327 | // Common attributes |
328 | 328 | //$keyforbreak='fieldkeytoswitchonsecondcolumn'; // We change column just before this field |
329 | 329 | //unset($object->fields['fk_project']); // Hide field already shown in banner |
330 | 330 | //unset($object->fields['fk_soc']); // Hide field already shown in banner |
331 | 331 | $object->fields['label']['visible'] = 0; // Already in banner |
332 | - include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_view.tpl.php'; |
|
332 | + include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php'; |
|
333 | 333 | |
334 | 334 | // Other attributes. Fields from hook formObjectOptions and Extrafields. |
335 | - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; |
|
335 | + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; |
|
336 | 336 | |
337 | 337 | print '</table>'; |
338 | 338 | print '</div>'; |
@@ -355,7 +355,7 @@ discard block |
||
355 | 355 | // Add fields from extrafields |
356 | 356 | if (!empty($extrafields->attributes[$object->table_element]['label'])) { |
357 | 357 | foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { |
358 | - $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef." . $key . " as options_" . $key . ', ' : ''); |
|
358 | + $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key.', ' : ''); |
|
359 | 359 | } |
360 | 360 | } |
361 | 361 | // Add fields from hooks |
@@ -363,20 +363,20 @@ discard block |
||
363 | 363 | $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook |
364 | 364 | $sql .= $hookmanager->resPrint; |
365 | 365 | $sql = preg_replace('/,\s*$/', '', $sql); |
366 | - $sql .= " FROM " . MAIN_DB_PREFIX . $object->table_element . " as t"; |
|
366 | + $sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t"; |
|
367 | 367 | if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { |
368 | - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . $object->table_element . "_extrafields as ef on (t.rowid = ef.fk_object)"; |
|
368 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (t.rowid = ef.fk_object)"; |
|
369 | 369 | } |
370 | 370 | // Add table from hooks |
371 | 371 | $parameters = array(); |
372 | 372 | $reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object); // Note that $action and $object may have been modified by hook |
373 | 373 | $sql .= $hookmanager->resPrint; |
374 | 374 | if ($object->ismultientitymanaged == 1) { |
375 | - $sql .= " WHERE t.entity IN (" . getEntity($object->element) . ")"; |
|
375 | + $sql .= " WHERE t.entity IN (".getEntity($object->element).")"; |
|
376 | 376 | } else { |
377 | 377 | $sql .= " WHERE 1 = 1"; |
378 | 378 | } |
379 | - $sql .= " AND t.fk_job = " . ((int) $fk_job) . " "; |
|
379 | + $sql .= " AND t.fk_job = ".((int) $fk_job)." "; |
|
380 | 380 | |
381 | 381 | foreach ($search as $key => $val) { |
382 | 382 | if (array_key_exists($key, $object->fields)) { |
@@ -398,10 +398,10 @@ discard block |
||
398 | 398 | $columnName = preg_replace('/(_dtstart|_dtend)$/', '', $key); |
399 | 399 | if (preg_match('/^(date|timestamp|datetime)/', $object->fields[$columnName]['type'])) { |
400 | 400 | if (preg_match('/_dtstart$/', $key)) { |
401 | - $sql .= " AND t." . $columnName . " >= '" . $db->idate($search[$key]) . "'"; |
|
401 | + $sql .= " AND t.".$columnName." >= '".$db->idate($search[$key])."'"; |
|
402 | 402 | } |
403 | 403 | if (preg_match('/_dtend$/', $key)) { |
404 | - $sql .= " AND t." . $columnName . " <= '" . $db->idate($search[$key]) . "'"; |
|
404 | + $sql .= " AND t.".$columnName." <= '".$db->idate($search[$key])."'"; |
|
405 | 405 | } |
406 | 406 | } |
407 | 407 | } |
@@ -412,7 +412,7 @@ discard block |
||
412 | 412 | } |
413 | 413 | //$sql.= dolSqlDateFilter("t.field", $search_xxxday, $search_xxxmonth, $search_xxxyear); |
414 | 414 | // Add where from extra fields |
415 | - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_search_sql.tpl.php'; |
|
415 | + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; |
|
416 | 416 | // Add where from hooks |
417 | 417 | $parameters = array(); |
418 | 418 | $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object); // Note that $action and $object may have been modified by hook |
@@ -451,15 +451,15 @@ discard block |
||
451 | 451 | if ($num == 1 && getDolGlobalString('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) { |
452 | 452 | $obj = $db->fetch_object($resql); |
453 | 453 | $id = $obj->rowid; |
454 | - header("Location: " . dol_buildpath('/hrm/position.php', 1) . '?id=' . $id); |
|
454 | + header("Location: ".dol_buildpath('/hrm/position.php', 1).'?id='.$id); |
|
455 | 455 | exit; |
456 | 456 | } |
457 | 457 | |
458 | 458 | $arrayofselected = is_array($toselect) ? $toselect : array(); |
459 | 459 | |
460 | - $param = 'fk_job=' . $fk_job; |
|
460 | + $param = 'fk_job='.$fk_job; |
|
461 | 461 | if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { |
462 | - $param .= '&contextpage=' . urlencode($contextpage); |
|
462 | + $param .= '&contextpage='.urlencode($contextpage); |
|
463 | 463 | } |
464 | 464 | if ($limit > 0 && $limit != $conf->liste_limit) { |
465 | 465 | $param .= '&limit='.((int) $limit); |
@@ -467,17 +467,17 @@ discard block |
||
467 | 467 | foreach ($search as $key => $val) { |
468 | 468 | if (is_array($search[$key]) && count($search[$key])) { |
469 | 469 | foreach ($search[$key] as $skey) { |
470 | - $param .= '&search_' . $key . '[]=' . urlencode($skey); |
|
470 | + $param .= '&search_'.$key.'[]='.urlencode($skey); |
|
471 | 471 | } |
472 | 472 | } else { |
473 | - $param .= '&search_' . $key . '=' . urlencode($search[$key]); |
|
473 | + $param .= '&search_'.$key.'='.urlencode($search[$key]); |
|
474 | 474 | } |
475 | 475 | } |
476 | 476 | if ($optioncss != '') { |
477 | - $param .= '&optioncss=' . urlencode($optioncss); |
|
477 | + $param .= '&optioncss='.urlencode($optioncss); |
|
478 | 478 | } |
479 | 479 | // Add $param from extra fields |
480 | - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_search_param.tpl.php'; |
|
480 | + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; |
|
481 | 481 | // Add $param from hooks |
482 | 482 | $parameters = array('param' => &$param); |
483 | 483 | $reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object); // Note that $action and $object may have been modified by hook |
@@ -491,43 +491,43 @@ discard block |
||
491 | 491 | //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), |
492 | 492 | ); |
493 | 493 | if ($permissiontodelete) { |
494 | - $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"') . $langs->trans("Delete"); |
|
494 | + $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); |
|
495 | 495 | } |
496 | 496 | if (GETPOSTINT('nomassaction') || in_array($massaction, array('presend', 'predelete'))) { |
497 | 497 | $arrayofmassactions = array(); |
498 | 498 | } |
499 | 499 | $massactionbutton = $form->selectMassAction('', $arrayofmassactions); |
500 | 500 | |
501 | - print '<form method="POST" id="searchFormList" action="' . $_SERVER["PHP_SELF"] . '?fk_job=' . $fk_job . '">' . "\n"; |
|
501 | + print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'?fk_job='.$fk_job.'">'."\n"; |
|
502 | 502 | if ($optioncss != '') { |
503 | - print '<input type="hidden" name="optioncss" value="' . $optioncss . '">'; |
|
503 | + print '<input type="hidden" name="optioncss" value="'.$optioncss.'">'; |
|
504 | 504 | } |
505 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
505 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
506 | 506 | print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">'; |
507 | 507 | print '<input type="hidden" name="action" value="list">'; |
508 | - print '<input type="hidden" name="massaction" value="' . $massaction . '">'; |
|
509 | - print '<input type="hidden" name="sortfield" value="' . $sortfield . '">'; |
|
510 | - print '<input type="hidden" name="sortorder" value="' . $sortorder . '">'; |
|
511 | - print '<input type="hidden" name="page" value="' . $page . '">'; |
|
512 | - print '<input type="hidden" name="contextpage" value="' . $contextpage . '">'; |
|
508 | + print '<input type="hidden" name="massaction" value="'.$massaction.'">'; |
|
509 | + print '<input type="hidden" name="sortfield" value="'.$sortfield.'">'; |
|
510 | + print '<input type="hidden" name="sortorder" value="'.$sortorder.'">'; |
|
511 | + print '<input type="hidden" name="page" value="'.$page.'">'; |
|
512 | + print '<input type="hidden" name="contextpage" value="'.$contextpage.'">'; |
|
513 | 513 | |
514 | 514 | $newcardbutton = ''; |
515 | 515 | $newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', dol_buildpath('/hrm/position.php', 1).'?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']).'&fk_job='.((int) $fk_job), '', $permissiontoadd); |
516 | 516 | |
517 | - print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'object_' . $object->picto, 0, $newcardbutton, '', $limit, 0, 0, 1); |
|
517 | + print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'object_'.$object->picto, 0, $newcardbutton, '', $limit, 0, 0, 1); |
|
518 | 518 | |
519 | 519 | // Add code for pre mass action (confirmation or email presend form) |
520 | 520 | $topicmail = "SendPositionRef"; |
521 | 521 | $modelmail = "position"; |
522 | 522 | $objecttmp = new Position($db); |
523 | - $trackid = 'xxxx' . $object->id; |
|
524 | - include DOL_DOCUMENT_ROOT . '/core/tpl/massactions_pre.tpl.php'; |
|
523 | + $trackid = 'xxxx'.$object->id; |
|
524 | + include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php'; |
|
525 | 525 | |
526 | 526 | if ($search_all) { |
527 | 527 | foreach ($fieldstosearchall as $key => $val) { |
528 | 528 | $fieldstosearchall[$key] = $langs->trans($val); |
529 | 529 | } |
530 | - print '<div class="divsearchfieldfilter">' . $langs->trans("FilterOnInto", $search_all) . implode(', ', $fieldstosearchall) . '</div>'; |
|
530 | + print '<div class="divsearchfieldfilter">'.$langs->trans("FilterOnInto", $search_all).implode(', ', $fieldstosearchall).'</div>'; |
|
531 | 531 | } |
532 | 532 | |
533 | 533 | $moreforfilter = ''; |
@@ -554,7 +554,7 @@ discard block |
||
554 | 554 | $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); |
555 | 555 | |
556 | 556 | print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table |
557 | - print '<table class="tagtable nobottomiftotal liste' . ($moreforfilter ? " listwithfilterbefore" : "") . '">' . "\n"; |
|
557 | + print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n"; |
|
558 | 558 | |
559 | 559 | // Fields title search |
560 | 560 | // -------------------------------------------------------------------- |
@@ -562,35 +562,35 @@ discard block |
||
562 | 562 | foreach ($object->fields as $key => $val) { |
563 | 563 | $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']); |
564 | 564 | if ($key == 'status') { |
565 | - $cssforfield .= ($cssforfield ? ' ' : '') . 'center'; |
|
565 | + $cssforfield .= ($cssforfield ? ' ' : '').'center'; |
|
566 | 566 | } elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) { |
567 | - $cssforfield .= ($cssforfield ? ' ' : '') . 'center'; |
|
567 | + $cssforfield .= ($cssforfield ? ' ' : '').'center'; |
|
568 | 568 | } elseif (in_array($val['type'], array('timestamp'))) { |
569 | - $cssforfield .= ($cssforfield ? ' ' : '') . 'nowrap'; |
|
569 | + $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; |
|
570 | 570 | } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) { |
571 | - $cssforfield .= ($cssforfield ? ' ' : '') . 'right'; |
|
571 | + $cssforfield .= ($cssforfield ? ' ' : '').'right'; |
|
572 | 572 | } |
573 | - if (!empty($arrayfields['t.' . $key]['checked'])) { |
|
574 | - print '<td class="liste_titre' . ($cssforfield ? ' ' . $cssforfield : '') . '">'; |
|
573 | + if (!empty($arrayfields['t.'.$key]['checked'])) { |
|
574 | + print '<td class="liste_titre'.($cssforfield ? ' '.$cssforfield : '').'">'; |
|
575 | 575 | if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) { |
576 | - print $form->selectarray('search_' . $key, $val['arrayofkeyval'], (isset($search[$key]) ? $search[$key] : ''), $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth100', 1); |
|
576 | + print $form->selectarray('search_'.$key, $val['arrayofkeyval'], (isset($search[$key]) ? $search[$key] : ''), $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth100', 1); |
|
577 | 577 | } elseif ((strpos($val['type'], 'integer:') === 0) || (strpos($val['type'], 'sellist:') === 0)) { |
578 | 578 | print $object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] : ''), '', '', 'search_', 'maxwidth125', 1); |
579 | 579 | } elseif (!preg_match('/^(date|timestamp|datetime)/', $val['type'])) { |
580 | - print '<input type="text" class="flat maxwidth75" name="search_' . $key . '" value="' . dol_escape_htmltag(isset($search[$key]) ? $search[$key] : '') . '">'; |
|
580 | + print '<input type="text" class="flat maxwidth75" name="search_'.$key.'" value="'.dol_escape_htmltag(isset($search[$key]) ? $search[$key] : '').'">'; |
|
581 | 581 | } elseif (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { |
582 | 582 | print '<div class="nowrap">'; |
583 | - print $form->selectDate($search[$key . '_dtstart'] ? $search[$key . '_dtstart'] : '', "search_" . $key . "_dtstart", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From')); |
|
583 | + print $form->selectDate($search[$key.'_dtstart'] ? $search[$key.'_dtstart'] : '', "search_".$key."_dtstart", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From')); |
|
584 | 584 | print '</div>'; |
585 | 585 | print '<div class="nowrap">'; |
586 | - print $form->selectDate($search[$key . '_dtend'] ? $search[$key . '_dtend'] : '', "search_" . $key . "_dtend", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to')); |
|
586 | + print $form->selectDate($search[$key.'_dtend'] ? $search[$key.'_dtend'] : '', "search_".$key."_dtend", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to')); |
|
587 | 587 | print '</div>'; |
588 | 588 | } |
589 | 589 | print '</td>'; |
590 | 590 | } |
591 | 591 | } |
592 | 592 | // Extra fields |
593 | - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_search_input.tpl.php'; |
|
593 | + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; |
|
594 | 594 | |
595 | 595 | // Fields from hook |
596 | 596 | $parameters = array('arrayfields' => $arrayfields); |
@@ -601,7 +601,7 @@ discard block |
||
601 | 601 | $searchpicto = $form->showFilterButtons(); |
602 | 602 | print $searchpicto; |
603 | 603 | print '</td>'; |
604 | - print '</tr>' . "\n"; |
|
604 | + print '</tr>'."\n"; |
|
605 | 605 | |
606 | 606 | |
607 | 607 | // Fields title label |
@@ -610,27 +610,27 @@ discard block |
||
610 | 610 | foreach ($object->fields as $key => $val) { |
611 | 611 | $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']); |
612 | 612 | if ($key == 'status') { |
613 | - $cssforfield .= ($cssforfield ? ' ' : '') . 'center'; |
|
613 | + $cssforfield .= ($cssforfield ? ' ' : '').'center'; |
|
614 | 614 | } elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) { |
615 | - $cssforfield .= ($cssforfield ? ' ' : '') . 'center'; |
|
615 | + $cssforfield .= ($cssforfield ? ' ' : '').'center'; |
|
616 | 616 | } elseif (in_array($val['type'], array('timestamp'))) { |
617 | - $cssforfield .= ($cssforfield ? ' ' : '') . 'nowrap'; |
|
617 | + $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; |
|
618 | 618 | } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) { |
619 | - $cssforfield .= ($cssforfield ? ' ' : '') . 'right'; |
|
619 | + $cssforfield .= ($cssforfield ? ' ' : '').'right'; |
|
620 | 620 | } |
621 | - if (!empty($arrayfields['t.' . $key]['checked'])) { |
|
622 | - print getTitleFieldOfList($arrayfields['t.' . $key]['label'], 0, $_SERVER['PHP_SELF'], 't.' . $key, '', $param, ($cssforfield ? 'class="' . $cssforfield . '"' : ''), $sortfield, $sortorder, ($cssforfield ? $cssforfield . ' ' : '')) . "\n"; |
|
621 | + if (!empty($arrayfields['t.'.$key]['checked'])) { |
|
622 | + print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($cssforfield ? 'class="'.$cssforfield.'"' : ''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.' ' : ''))."\n"; |
|
623 | 623 | } |
624 | 624 | } |
625 | 625 | // Extra fields |
626 | - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_search_title.tpl.php'; |
|
626 | + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; |
|
627 | 627 | // Hook fields |
628 | 628 | $parameters = array('arrayfields' => $arrayfields, 'param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder); |
629 | 629 | $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook |
630 | 630 | print $hookmanager->resPrint; |
631 | 631 | // Action column |
632 | - print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ') . "\n"; |
|
633 | - print '</tr>' . "\n"; |
|
632 | + print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n"; |
|
633 | + print '</tr>'."\n"; |
|
634 | 634 | |
635 | 635 | // Detect if we need a fetch on each output line |
636 | 636 | $needToFetchEachLine = 0; |
@@ -662,24 +662,24 @@ discard block |
||
662 | 662 | foreach ($object->fields as $key => $val) { |
663 | 663 | $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']); |
664 | 664 | if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) { |
665 | - $cssforfield .= ($cssforfield ? ' ' : '') . 'center'; |
|
665 | + $cssforfield .= ($cssforfield ? ' ' : '').'center'; |
|
666 | 666 | } elseif ($key == 'status') { |
667 | - $cssforfield .= ($cssforfield ? ' ' : '') . 'center'; |
|
667 | + $cssforfield .= ($cssforfield ? ' ' : '').'center'; |
|
668 | 668 | } |
669 | 669 | |
670 | 670 | if (in_array($val['type'], array('timestamp'))) { |
671 | - $cssforfield .= ($cssforfield ? ' ' : '') . 'nowrap'; |
|
671 | + $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; |
|
672 | 672 | } elseif ($key == 'ref') { |
673 | - $cssforfield .= ($cssforfield ? ' ' : '') . 'nowrap'; |
|
673 | + $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; |
|
674 | 674 | } |
675 | 675 | |
676 | 676 | if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('rowid', 'status')) && empty($val['arrayofkeyval'])) { |
677 | - $cssforfield .= ($cssforfield ? ' ' : '') . 'right'; |
|
677 | + $cssforfield .= ($cssforfield ? ' ' : '').'right'; |
|
678 | 678 | } |
679 | 679 | //if (in_array($key, array('fk_soc', 'fk_user', 'fk_warehouse'))) $cssforfield = 'tdoverflowmax100'; |
680 | 680 | |
681 | - if (!empty($arrayfields['t.' . $key]['checked'])) { |
|
682 | - print '<td' . ($cssforfield ? ' class="' . $cssforfield . '"' : '') . '>'; |
|
681 | + if (!empty($arrayfields['t.'.$key]['checked'])) { |
|
682 | + print '<td'.($cssforfield ? ' class="'.$cssforfield.'"' : '').'>'; |
|
683 | 683 | if ($key == 'status') { |
684 | 684 | print $object->getLibStatut(5); |
685 | 685 | } elseif ($key == 'rowid') { |
@@ -693,20 +693,20 @@ discard block |
||
693 | 693 | } |
694 | 694 | if (!empty($val['isameasure']) && $val['isameasure'] == 1) { |
695 | 695 | if (!$i) { |
696 | - $totalarray['pos'][$totalarray['nbfield']] = 't.' . $key; |
|
696 | + $totalarray['pos'][$totalarray['nbfield']] = 't.'.$key; |
|
697 | 697 | } |
698 | 698 | if (!isset($totalarray['val'])) { |
699 | 699 | $totalarray['val'] = array(); |
700 | 700 | } |
701 | - if (!isset($totalarray['val']['t.' . $key])) { |
|
702 | - $totalarray['val']['t.' . $key] = 0; |
|
701 | + if (!isset($totalarray['val']['t.'.$key])) { |
|
702 | + $totalarray['val']['t.'.$key] = 0; |
|
703 | 703 | } |
704 | - $totalarray['val']['t.' . $key] += $object->$key; |
|
704 | + $totalarray['val']['t.'.$key] += $object->$key; |
|
705 | 705 | } |
706 | 706 | } |
707 | 707 | } |
708 | 708 | // Extra fields |
709 | - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_print_fields.tpl.php'; |
|
709 | + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; |
|
710 | 710 | // Fields from hook |
711 | 711 | $parameters = array('arrayfields' => $arrayfields, 'object' => $object, 'obj' => $obj, 'i' => $i, 'totalarray' => &$totalarray); |
712 | 712 | $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook |
@@ -718,20 +718,20 @@ discard block |
||
718 | 718 | if (in_array($object->id, $arrayofselected)) { |
719 | 719 | $selected = 1; |
720 | 720 | } |
721 | - print '<input id="cb' . $object->id . '" class="flat checkforselect" type="checkbox" name="toselect[]" value="' . $object->id . '"' . ($selected ? ' checked="checked"' : '') . '>'; |
|
721 | + print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>'; |
|
722 | 722 | } |
723 | 723 | print '</td>'; |
724 | 724 | if (!$i) { |
725 | 725 | $totalarray['nbfield']++; |
726 | 726 | } |
727 | 727 | |
728 | - print '</tr>' . "\n"; |
|
728 | + print '</tr>'."\n"; |
|
729 | 729 | |
730 | 730 | $i++; |
731 | 731 | } |
732 | 732 | |
733 | 733 | // Show total line |
734 | - include DOL_DOCUMENT_ROOT . '/core/tpl/list_print_total.tpl.php'; |
|
734 | + include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php'; |
|
735 | 735 | |
736 | 736 | // If no record found |
737 | 737 | if ($num == 0) { |
@@ -741,7 +741,7 @@ discard block |
||
741 | 741 | $colspan++; |
742 | 742 | } |
743 | 743 | } |
744 | - print '<tr><td colspan="' . $colspan . '"><span class="opacitymedium">' . $langs->trans("NoRecordFound") . '</span></td></tr>'; |
|
744 | + print '<tr><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>'; |
|
745 | 745 | } |
746 | 746 | |
747 | 747 | |
@@ -751,10 +751,10 @@ discard block |
||
751 | 751 | $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object); // Note that $action and $object may have been modified by hook |
752 | 752 | print $hookmanager->resPrint; |
753 | 753 | |
754 | - print '</table>' . "\n"; |
|
755 | - print '</div>' . "\n"; |
|
754 | + print '</table>'."\n"; |
|
755 | + print '</div>'."\n"; |
|
756 | 756 | |
757 | - print '</form>' . "\n"; |
|
757 | + print '</form>'."\n"; |
|
758 | 758 | |
759 | 759 | if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { |
760 | 760 | $hidegeneratedfilelistifempty = 1; |
@@ -762,11 +762,11 @@ discard block |
||
762 | 762 | $hidegeneratedfilelistifempty = 0; |
763 | 763 | } |
764 | 764 | |
765 | - require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php'; |
|
765 | + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; |
|
766 | 766 | $formfile = new FormFile($db); |
767 | 767 | |
768 | 768 | // Show list of available documents |
769 | - $urlsource = $_SERVER['PHP_SELF'] . '?sortfield=' . $sortfield . '&sortorder=' . $sortorder; |
|
769 | + $urlsource = $_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder; |
|
770 | 770 | $urlsource .= str_replace('&', '&', $param); |
771 | 771 | |
772 | 772 | $filedir = $diroutputmassaction; |
@@ -734,7 +734,7 @@ |
||
734 | 734 | // Trick because nusoap does not store data with same structure if there is one or several lines |
735 | 735 | $arrayoflines = array(); |
736 | 736 | if (isset($order['lines']['line'][0])) { |
737 | - $arrayoflines = $order['lines']['line']; // @phan-suppress-current-line PhanTypeInvalidDimOffset |
|
737 | + $arrayoflines = $order['lines']['line']; // @phan-suppress-current-line PhanTypeInvalidDimOffset |
|
738 | 738 | } else { |
739 | 739 | $arrayoflines = $order['lines']; |
740 | 740 | } |
@@ -1248,7 +1248,7 @@ discard block |
||
1248 | 1248 | $list[$tab->elementtype][$tab->name]['computed'] = $tab->fieldcomputed; |
1249 | 1249 | $list[$tab->elementtype][$tab->name]['unique'] = $tab->fieldunique; |
1250 | 1250 | $list[$tab->elementtype][$tab->name]['required'] = $tab->fieldrequired; |
1251 | - $list[$tab->elementtype][$tab->name]['param'] = ($tab->param ? jsonOrUnserialize($tab->param) : ''); // This may be a string encoded with serialise() or json_encode() |
|
1251 | + $list[$tab->elementtype][$tab->name]['param'] = ($tab->param ? jsonOrUnserialize($tab->param) : ''); // This may be a string encoded with serialise() or json_encode() |
|
1252 | 1252 | $list[$tab->elementtype][$tab->name]['pos'] = $tab->pos; |
1253 | 1253 | $list[$tab->elementtype][$tab->name]['alwayseditable'] = $tab->alwayseditable; |
1254 | 1254 | $list[$tab->elementtype][$tab->name]['perms'] = $tab->perms; |
@@ -1358,7 +1358,7 @@ discard block |
||
1358 | 1358 | $answer[$tab->elementtype][$tab->name]['computed'] = $tab->fieldcomputed; |
1359 | 1359 | $answer[$tab->elementtype][$tab->name]['unique'] = $tab->fieldunique; |
1360 | 1360 | $answer[$tab->elementtype][$tab->name]['required'] = $tab->fieldrequired; |
1361 | - $answer[$tab->elementtype][$tab->name]['param'] = ($tab->param ? jsonOrUnserialize($tab->param) : ''); // This may be a string encoded with serialise() or json_encode() |
|
1361 | + $answer[$tab->elementtype][$tab->name]['param'] = ($tab->param ? jsonOrUnserialize($tab->param) : ''); // This may be a string encoded with serialise() or json_encode() |
|
1362 | 1362 | $answer[$tab->elementtype][$tab->name]['pos'] = $tab->pos; |
1363 | 1363 | $answer[$tab->elementtype][$tab->name]['alwayseditable'] = $tab->alwayseditable; |
1364 | 1364 | $answer[$tab->elementtype][$tab->name]['perms'] = $tab->perms; |
@@ -2477,7 +2477,7 @@ discard block |
||
2477 | 2477 | throw new RestException(500, $langs->trans('XmlNotFound').': /install/'.$xmlshortfile); |
2478 | 2478 | } |
2479 | 2479 | } else { |
2480 | - $xmlarray = getURLContent($xmlremote, 'GET', '', 1, array(), array('http', 'https'), 0); // Accept http or https links on external remote server only. Same is used into filecheck.php. |
|
2480 | + $xmlarray = getURLContent($xmlremote, 'GET', '', 1, array(), array('http', 'https'), 0); // Accept http or https links on external remote server only. Same is used into filecheck.php. |
|
2481 | 2481 | |
2482 | 2482 | // Return array('content'=>response,'curl_error_no'=>errno,'curl_error_msg'=>errmsg...) |
2483 | 2483 | if (!$xmlarray['curl_error_no'] && $xmlarray['http_code'] != '400' && $xmlarray['http_code'] != '404') { |
@@ -2658,7 +2658,7 @@ discard block |
||
2658 | 2658 | $out .= '<tr class="oddeven">'; |
2659 | 2659 | $out .= '<td>'.$i.'</td>'."\n"; |
2660 | 2660 | $out .= '<td>'.dol_escape_htmltag($file['filename']).'</td>'."\n"; |
2661 | - $out .= '<td class="center">'.$file['expectedmd5'].'</td>'."\n"; // @phan-suppress-current-line PhanTypeInvalidDimOffset,PhanTypeSuspiciousStringExpression |
|
2661 | + $out .= '<td class="center">'.$file['expectedmd5'].'</td>'."\n"; // @phan-suppress-current-line PhanTypeInvalidDimOffset,PhanTypeSuspiciousStringExpression |
|
2662 | 2662 | $out .= '<td class="center">'.$file['md5'].'</td>'."\n"; |
2663 | 2663 | $size = dol_filesize(DOL_DOCUMENT_ROOT.'/'.$file['filename']); |
2664 | 2664 | $totalsize += $size; |
@@ -183,32 +183,32 @@ discard block |
||
183 | 183 | $this->position = $positionmax + 1; |
184 | 184 | } |
185 | 185 | if ($error) { |
186 | - dol_syslog(__METHOD__ . ' ' . $this->errorsToString(), LOG_ERR); |
|
186 | + dol_syslog(__METHOD__.' '.$this->errorsToString(), LOG_ERR); |
|
187 | 187 | return -1; |
188 | 188 | } |
189 | 189 | |
190 | 190 | $this->db->begin(); |
191 | 191 | |
192 | - $sql = "INSERT INTO " . MAIN_DB_PREFIX . $this->table_element . " ("; |
|
192 | + $sql = "INSERT INTO ".MAIN_DB_PREFIX.$this->table_element." ("; |
|
193 | 193 | $sql .= " fk_product_attribute, ref, value, entity, position"; |
194 | 194 | $sql .= ")"; |
195 | 195 | $sql .= " VALUES ("; |
196 | - $sql .= " " . ((int) $this->fk_product_attribute); |
|
197 | - $sql .= ", '" . $this->db->escape($this->ref) . "'"; |
|
198 | - $sql .= ", '" . $this->db->escape($this->value) . "'"; |
|
199 | - $sql .= ", " . ((int) $this->entity); |
|
200 | - $sql .= ", " . ((int) $this->position); |
|
196 | + $sql .= " ".((int) $this->fk_product_attribute); |
|
197 | + $sql .= ", '".$this->db->escape($this->ref)."'"; |
|
198 | + $sql .= ", '".$this->db->escape($this->value)."'"; |
|
199 | + $sql .= ", ".((int) $this->entity); |
|
200 | + $sql .= ", ".((int) $this->position); |
|
201 | 201 | $sql .= ")"; |
202 | 202 | |
203 | 203 | dol_syslog(__METHOD__, LOG_DEBUG); |
204 | 204 | $resql = $this->db->query($sql); |
205 | 205 | if (!$resql) { |
206 | - $this->errors[] = "Error " . $this->db->lasterror(); |
|
206 | + $this->errors[] = "Error ".$this->db->lasterror(); |
|
207 | 207 | $error++; |
208 | 208 | } |
209 | 209 | |
210 | 210 | if (!$error) { |
211 | - $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . $this->table_element); |
|
211 | + $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX.$this->table_element); |
|
212 | 212 | $result = $this->insertExtraFields(); |
213 | 213 | if ($result < 0) { |
214 | 214 | $error++; |
@@ -253,20 +253,20 @@ discard block |
||
253 | 253 | $error++; |
254 | 254 | } |
255 | 255 | if ($error) { |
256 | - dol_syslog(__METHOD__ . ' ' . $this->errorsToString(), LOG_ERR); |
|
256 | + dol_syslog(__METHOD__.' '.$this->errorsToString(), LOG_ERR); |
|
257 | 257 | return -1; |
258 | 258 | } |
259 | 259 | |
260 | 260 | $sql = "SELECT rowid, fk_product_attribute, ref, value"; |
261 | - $sql .= " FROM " . MAIN_DB_PREFIX . $this->table_element; |
|
262 | - $sql .= " WHERE rowid = " . ((int) $id); |
|
263 | - $sql .= " AND entity IN (" . getEntity('product') . ")"; |
|
261 | + $sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element; |
|
262 | + $sql .= " WHERE rowid = ".((int) $id); |
|
263 | + $sql .= " AND entity IN (".getEntity('product').")"; |
|
264 | 264 | |
265 | 265 | dol_syslog(__METHOD__, LOG_DEBUG); |
266 | 266 | $resql = $this->db->query($sql); |
267 | 267 | if (!$resql) { |
268 | - $this->errors[] = "Error " . $this->db->lasterror(); |
|
269 | - dol_syslog(__METHOD__ . ' ' . $this->errorsToString(), LOG_ERR); |
|
268 | + $this->errors[] = "Error ".$this->db->lasterror(); |
|
269 | + dol_syslog(__METHOD__.' '.$this->errorsToString(), LOG_ERR); |
|
270 | 270 | return -1; |
271 | 271 | } |
272 | 272 | |
@@ -297,15 +297,15 @@ discard block |
||
297 | 297 | { |
298 | 298 | $return = array(); |
299 | 299 | |
300 | - $sql = "SELECT v.fk_product_attribute, v.rowid, v.ref, v.value FROM " . MAIN_DB_PREFIX . "product_attribute_value v "; |
|
300 | + $sql = "SELECT v.fk_product_attribute, v.rowid, v.ref, v.value FROM ".MAIN_DB_PREFIX."product_attribute_value v "; |
|
301 | 301 | |
302 | - $sql .= "WHERE v.fk_product_attribute = " . ((int) $prodattr_id); |
|
302 | + $sql .= "WHERE v.fk_product_attribute = ".((int) $prodattr_id); |
|
303 | 303 | |
304 | 304 | if ($only_used) { |
305 | 305 | $sql .= " AND EXISTS (SELECT c2v.fk_prod_attr_val "; |
306 | - $sql .= "FROM " . MAIN_DB_PREFIX . "product_attribute_combination2val c2v "; |
|
307 | - $sql .= "LEFT JOIN " . MAIN_DB_PREFIX . "product_attribute_combination c ON c.rowid = c2v.fk_prod_combination "; |
|
308 | - $sql .= "LEFT JOIN " . MAIN_DB_PREFIX . "product p ON p.rowid = c.fk_product_child"; |
|
306 | + $sql .= "FROM ".MAIN_DB_PREFIX."product_attribute_combination2val c2v "; |
|
307 | + $sql .= "LEFT JOIN ".MAIN_DB_PREFIX."product_attribute_combination c ON c.rowid = c2v.fk_prod_combination "; |
|
308 | + $sql .= "LEFT JOIN ".MAIN_DB_PREFIX."product p ON p.rowid = c.fk_product_child"; |
|
309 | 309 | $sql .= " WHERE c2v.rowid IS NOT NULL AND p.tosell = 1 AND c2v.fk_prod_attr_val = v.rowid)"; |
310 | 310 | } |
311 | 311 | |
@@ -364,25 +364,25 @@ discard block |
||
364 | 364 | $error++; |
365 | 365 | } |
366 | 366 | if ($error) { |
367 | - dol_syslog(__METHOD__ . ' ' . $this->errorsToString(), LOG_ERR); |
|
367 | + dol_syslog(__METHOD__.' '.$this->errorsToString(), LOG_ERR); |
|
368 | 368 | return -1; |
369 | 369 | } |
370 | 370 | |
371 | 371 | $this->db->begin(); |
372 | 372 | |
373 | - $sql = "UPDATE " . MAIN_DB_PREFIX . $this->table_element . " SET"; |
|
373 | + $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element." SET"; |
|
374 | 374 | |
375 | - $sql .= " fk_product_attribute = " . ((int) $this->fk_product_attribute); |
|
376 | - $sql .= ", ref = '" . $this->db->escape($this->ref) . "'"; |
|
377 | - $sql .= ", value = '" . $this->db->escape($this->value) . "'"; |
|
378 | - $sql .= ", position = " . ((int) $this->position); |
|
375 | + $sql .= " fk_product_attribute = ".((int) $this->fk_product_attribute); |
|
376 | + $sql .= ", ref = '".$this->db->escape($this->ref)."'"; |
|
377 | + $sql .= ", value = '".$this->db->escape($this->value)."'"; |
|
378 | + $sql .= ", position = ".((int) $this->position); |
|
379 | 379 | |
380 | - $sql .= " WHERE rowid = " . ((int) $this->id); |
|
380 | + $sql .= " WHERE rowid = ".((int) $this->id); |
|
381 | 381 | |
382 | 382 | dol_syslog(__METHOD__, LOG_DEBUG); |
383 | 383 | $resql = $this->db->query($sql); |
384 | 384 | if (!$resql) { |
385 | - $this->errors[] = "Error " . $this->db->lasterror(); |
|
385 | + $this->errors[] = "Error ".$this->db->lasterror(); |
|
386 | 386 | $error++; |
387 | 387 | } |
388 | 388 | |
@@ -425,7 +425,7 @@ discard block |
||
425 | 425 | $error++; |
426 | 426 | } |
427 | 427 | if ($error) { |
428 | - dol_syslog(__METHOD__ . ' ' . $this->errorsToString(), LOG_ERR); |
|
428 | + dol_syslog(__METHOD__.' '.$this->errorsToString(), LOG_ERR); |
|
429 | 429 | return -1; |
430 | 430 | } |
431 | 431 | |
@@ -449,12 +449,12 @@ discard block |
||
449 | 449 | } |
450 | 450 | |
451 | 451 | if (!$error) { |
452 | - $sql = "DELETE FROM " . MAIN_DB_PREFIX . $this->table_element . " WHERE rowid = " . ((int) $this->id); |
|
452 | + $sql = "DELETE FROM ".MAIN_DB_PREFIX.$this->table_element." WHERE rowid = ".((int) $this->id); |
|
453 | 453 | |
454 | 454 | dol_syslog(__METHOD__, LOG_DEBUG); |
455 | 455 | $resql = $this->db->query($sql); |
456 | 456 | if (!$resql) { |
457 | - $this->errors[] = "Error " . $this->db->lasterror(); |
|
457 | + $this->errors[] = "Error ".$this->db->lasterror(); |
|
458 | 458 | $error++; |
459 | 459 | } |
460 | 460 | } |
@@ -482,8 +482,8 @@ discard block |
||
482 | 482 | public function getMaxAttributesValuesPosition($fk_product_attribute) |
483 | 483 | { |
484 | 484 | // Search the last position of attributes |
485 | - $sql = "SELECT max(position) FROM " . MAIN_DB_PREFIX . $this->table_element; |
|
486 | - $sql .= " WHERE entity IN (" . getEntity('product') . ")"; |
|
485 | + $sql = "SELECT max(position) FROM ".MAIN_DB_PREFIX.$this->table_element; |
|
486 | + $sql .= " WHERE entity IN (".getEntity('product').")"; |
|
487 | 487 | $sql .= ' AND fk_product_attribute='.(int) $fk_product_attribute; |
488 | 488 | dol_syslog(__METHOD__, LOG_DEBUG); |
489 | 489 | $resql = $this->db->query($sql); |
@@ -513,16 +513,16 @@ discard block |
||
513 | 513 | $error++; |
514 | 514 | } |
515 | 515 | if ($error) { |
516 | - dol_syslog(__METHOD__ . ' ' . $this->errorsToString(), LOG_ERR); |
|
516 | + dol_syslog(__METHOD__.' '.$this->errorsToString(), LOG_ERR); |
|
517 | 517 | return -1; |
518 | 518 | } |
519 | 519 | |
520 | - $sql = "SELECT COUNT(*) AS nb FROM " . MAIN_DB_PREFIX . "product_attribute_combination2val WHERE fk_prod_attr_val = " . ((int) $this->id); |
|
520 | + $sql = "SELECT COUNT(*) AS nb FROM ".MAIN_DB_PREFIX."product_attribute_combination2val WHERE fk_prod_attr_val = ".((int) $this->id); |
|
521 | 521 | |
522 | 522 | dol_syslog(__METHOD__, LOG_DEBUG); |
523 | 523 | $resql = $this->db->query($sql); |
524 | 524 | if (!$resql) { |
525 | - $this->errors[] = "Error " . $this->db->lasterror(); |
|
525 | + $this->errors[] = "Error ".$this->db->lasterror(); |
|
526 | 526 | return -1; |
527 | 527 | } |
528 | 528 |
@@ -66,7 +66,7 @@ |
||
66 | 66 | |
67 | 67 | $type = $object->type; |
68 | 68 | if (is_numeric($type)) { |
69 | - $type = Categorie::$MAP_ID_TO_CODE[(int) $type]; // For backward compatibility |
|
69 | + $type = Categorie::$MAP_ID_TO_CODE[(int) $type]; // For backward compatibility |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | // Security check |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | } |
185 | 185 | } |
186 | 186 | if (GETPOST('target') == 'remote') { |
187 | - $xmlarray = getURLContent($xmlremote, 'GET', '', 1, array(), array('http', 'https'), 0); // Accept http or https links on external remote server only. Same is used into api_setup.class.php. |
|
187 | + $xmlarray = getURLContent($xmlremote, 'GET', '', 1, array(), array('http', 'https'), 0); // Accept http or https links on external remote server only. Same is used into api_setup.class.php. |
|
188 | 188 | |
189 | 189 | // Return array('content'=>response,'curl_error_no'=>errno,'curl_error_msg'=>errmsg...) |
190 | 190 | if (!$xmlarray['curl_error_no'] && $xmlarray['http_code'] != '400' && $xmlarray['http_code'] != '404') { |
@@ -393,7 +393,7 @@ discard block |
||
393 | 393 | $out .= ' '.$form->textwithpicto('', $htmltext, 1, 'help', '', 0, 2, 'helprm'.$i); |
394 | 394 | } |
395 | 395 | $out .= '</td>'."\n"; |
396 | - $out .= '<td class="center">'.dol_escape_htmltag($file['expectedmd5']).'</td>'."\n"; // @phan-suppress-current-line PhanTypeInvalidDimOffset |
|
396 | + $out .= '<td class="center">'.dol_escape_htmltag($file['expectedmd5']).'</td>'."\n"; // @phan-suppress-current-line PhanTypeInvalidDimOffset |
|
397 | 397 | $out .= '<td class="center">'.dol_escape_htmltag($file['md5']).'</td>'."\n"; |
398 | 398 | $size = dol_filesize(DOL_DOCUMENT_ROOT.'/'.$file['filename']); |
399 | 399 | $totalsize += $size; |
@@ -128,10 +128,10 @@ discard block |
||
128 | 128 | |
129 | 129 | if (!$error) { |
130 | 130 | setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); |
131 | - $action = ''; // To avoid to execute next actions |
|
131 | + $action = ''; // To avoid to execute next actions |
|
132 | 132 | } else { |
133 | 133 | setEventMessages($langs->trans("Error"), null, 'errors'); |
134 | - $action = ''; // To avoid to execute next actions |
|
134 | + $action = ''; // To avoid to execute next actions |
|
135 | 135 | } |
136 | 136 | } |
137 | 137 | |
@@ -146,10 +146,10 @@ discard block |
||
146 | 146 | |
147 | 147 | if (!$error) { |
148 | 148 | setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); |
149 | - $action = ''; // To avoid to execute next actions |
|
149 | + $action = ''; // To avoid to execute next actions |
|
150 | 150 | } else { |
151 | 151 | setEventMessages($langs->trans("Error"), null, 'errors'); |
152 | - $action = ''; // To avoid to execute next actions |
|
152 | + $action = ''; // To avoid to execute next actions |
|
153 | 153 | } |
154 | 154 | } |
155 | 155 | |
@@ -356,7 +356,7 @@ discard block |
||
356 | 356 | /** @var FormAccounting $formaccounting */ |
357 | 357 | print $formaccounting->select_account($conf->global->DONATION_ACCOUNTINGACCOUNT, 'DONATION_ACCOUNTINGACCOUNT', 1, array(), 1, 1); |
358 | 358 | } else { |
359 | - print '<input type="text" size="10" id="DONATION_ACCOUNTINGACCOUNT" name="DONATION_ACCOUNTINGACCOUNT" value="' . getDolGlobalString('DONATION_ACCOUNTINGACCOUNT').'">'; |
|
359 | + print '<input type="text" size="10" id="DONATION_ACCOUNTINGACCOUNT" name="DONATION_ACCOUNTINGACCOUNT" value="'.getDolGlobalString('DONATION_ACCOUNTINGACCOUNT').'">'; |
|
360 | 360 | } |
361 | 361 | print '</td><td class="center">'; |
362 | 362 | print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'" />'; |
@@ -369,7 +369,7 @@ discard block |
||
369 | 369 | |
370 | 370 | print '<tr class="oddeven"><td colspan="2">'; |
371 | 371 | print $langs->trans("FreeTextOnDonations").' '.img_info($langs->trans("AddCRIfTooLong")).'<br>'; |
372 | -print '<textarea name="DONATION_MESSAGE" class="flat" cols="80">' . getDolGlobalString('DONATION_MESSAGE').'</textarea>'; |
|
372 | +print '<textarea name="DONATION_MESSAGE" class="flat" cols="80">'.getDolGlobalString('DONATION_MESSAGE').'</textarea>'; |
|
373 | 373 | print '</td><td class="center">'; |
374 | 374 | print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'" />'; |
375 | 375 | print "</td></tr>\n"; |
@@ -102,8 +102,8 @@ discard block |
||
102 | 102 | $object = new Contrat($db); |
103 | 103 | $extrafields = new ExtraFields($db); |
104 | 104 | $ret = 0; |
105 | -$pu_ht = null; // Init for static analysis |
|
106 | -$pu_ttc = null; // Init for static analysis |
|
105 | +$pu_ht = null; // Init for static analysis |
|
106 | +$pu_ttc = null; // Init for static analysis |
|
107 | 107 | |
108 | 108 | // Load object |
109 | 109 | if ($id > 0 || !empty($ref) && $action != 'add') { |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | $permissionnote = $user->hasRight('contrat', 'creer'); // Used by the include of actions_setnotes.inc.php |
126 | 126 | $permissiondellink = $user->hasRight('contrat', 'creer'); // Used by the include of actions_dellink.inc.php |
127 | 127 | $permissiontodelete = ($user->hasRight('contrat', 'creer') && $object->status == $object::STATUS_DRAFT) || $user->hasRight('contrat', 'supprimer'); |
128 | -$permissiontoadd = $user->hasRight('contrat', 'creer'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php |
|
128 | +$permissiontoadd = $user->hasRight('contrat', 'creer'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php |
|
129 | 129 | $permissiontoedit = $permissiontoadd; |
130 | 130 | $permissiontoactivate = $user->hasRight('contrat', 'activer'); |
131 | 131 | $error = 0; |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | |
171 | 171 | include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be 'include', not 'include_once' |
172 | 172 | |
173 | - include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be 'include', not 'include_once' |
|
173 | + include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be 'include', not 'include_once' |
|
174 | 174 | |
175 | 175 | if ($action == 'confirm_active' && $confirm == 'yes' && $permissiontoactivate) { |
176 | 176 | $date_start = ''; |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | } elseif ($action == 'confirm_sign' && $confirm == 'yes' && $user->hasRight('contract', 'creer')) { |
194 | 194 | $result = $object->setSignedStatus($user, GETPOSTINT('signed_status'), 0, 'CONTRACT_MODIFY'); |
195 | 195 | if ($result >= 0) { |
196 | - header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id); |
|
196 | + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); |
|
197 | 197 | exit; |
198 | 198 | } else { |
199 | 199 | $mesg = $object->error; |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | } elseif ($action == 'confirm_unsign' && $confirm == 'yes' && $user->hasRight('contract', 'creer')) { |
202 | 202 | $result = $object->setSignedStatus($user, Contrat::$SIGNED_STATUSES['STATUS_NO_SIGNATURE'], 0, 'CONTRACT_MODIFY'); |
203 | 203 | if ($result >= 0) { |
204 | - header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id); |
|
204 | + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); |
|
205 | 205 | exit; |
206 | 206 | } else { |
207 | 207 | $mesg = $object->error; |
@@ -332,7 +332,7 @@ discard block |
||
332 | 332 | |
333 | 333 | $classname = ucfirst($subelement); |
334 | 334 | $srcobject = new $classname($db); |
335 | - '@phan-var-force Commande|Propal|Facture $srcobject'; // Can be other class, but CommonObject is too Generic |
|
335 | + '@phan-var-force Commande|Propal|Facture $srcobject'; // Can be other class, but CommonObject is too Generic |
|
336 | 336 | |
337 | 337 | dol_syslog("Try to find source object origin=".$object->origin." originid=".$object->origin_id." to add lines"); |
338 | 338 | $result = $srcobject->fetch($object->origin_id); |
@@ -567,8 +567,8 @@ discard block |
||
567 | 567 | $result = $prodcustprice->fetchAll('', '', 0, 0, $filter); |
568 | 568 | if ($result) { |
569 | 569 | if (count($prodcustprice->lines) > 0) { |
570 | - $price_min = price($prodcustprice->lines[0]->price_min); |
|
571 | - $price_min_ttc = price($prodcustprice->lines[0]->price_min_ttc); |
|
570 | + $price_min = price($prodcustprice->lines[0]->price_min); |
|
571 | + $price_min_ttc = price($prodcustprice->lines[0]->price_min_ttc); |
|
572 | 572 | /*$tva_tx = $prodcustprice->lines[0]->tva_tx; |
573 | 573 | if ($prodcustprice->lines[0]->default_vat_code && !preg_match('/\(.*\)/', $tva_tx)) { |
574 | 574 | $tva_tx .= ' ('.$prodcustprice->lines[0]->default_vat_code.')'; |
@@ -754,7 +754,7 @@ discard block |
||
754 | 754 | } |
755 | 755 | $objectline->fetch_optionals(); |
756 | 756 | |
757 | - $objectline->oldcopy = dol_clone($objectline, 2); // @phan-suppress-current-line PhanTypeMismatchProperty |
|
757 | + $objectline->oldcopy = dol_clone($objectline, 2); // @phan-suppress-current-line PhanTypeMismatchProperty |
|
758 | 758 | } else { |
759 | 759 | $objectline = null; |
760 | 760 | } |
@@ -803,7 +803,7 @@ discard block |
||
803 | 803 | // update price_ht with discount |
804 | 804 | // TODO Use object->updateline instead objectline->update |
805 | 805 | |
806 | - $price_ht = price2num(GETPOST('elprice'), 'MU'); |
|
806 | + $price_ht = price2num(GETPOST('elprice'), 'MU'); |
|
807 | 807 | $remise_percent = price2num(GETPOST('elremise_percent'), '', 2); |
808 | 808 | if ($remise_percent > 0) { |
809 | 809 | $remise = round(((float) $price_ht * (float) $remise_percent / 100), 2); |
@@ -910,7 +910,7 @@ discard block |
||
910 | 910 | } elseif ($action == 'confirm_activate' && $confirm == 'yes' && $user->hasRight('contrat', 'creer')) { |
911 | 911 | $date_start = dol_mktime(12, 0, 0, GETPOSTINT('d_startmonth'), GETPOSTINT('d_startday'), GETPOSTINT('d_startyear')); |
912 | 912 | $date_end = dol_mktime(12, 0, 0, GETPOSTINT('d_endmonth'), GETPOSTINT('d_endday'), GETPOSTINT('d_endyear')); |
913 | - $comment = GETPOST('comment', 'alpha'); |
|
913 | + $comment = GETPOST('comment', 'alpha'); |
|
914 | 914 | $result = $object->activateAll($user, $date_start, 0, $comment, $date_end); |
915 | 915 | if ($result < 0) { |
916 | 916 | setEventMessages($object->error, $object->errors, 'errors'); |
@@ -1472,7 +1472,7 @@ discard block |
||
1472 | 1472 | $morehtmlref .= '<div class="refidno">'; |
1473 | 1473 | // Ref customer |
1474 | 1474 | $morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_customer', $object->ref_customer, $object, $user->hasRight('contrat', 'creer'), 'string', '', 0, 1); |
1475 | - $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_customer', $object->ref_customer, $object, $user->hasRight('contrat', 'creer'), 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':' . getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1, 'getFormatedCustomerRef'); |
|
1475 | + $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_customer', $object->ref_customer, $object, $user->hasRight('contrat', 'creer'), 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':'.getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1, 'getFormatedCustomerRef'); |
|
1476 | 1476 | // Ref supplier |
1477 | 1477 | $morehtmlref .= '<br>'; |
1478 | 1478 | $morehtmlref .= $form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->hasRight('contrat', 'creer'), 'string', '', 0, 1); |
@@ -1566,7 +1566,7 @@ discard block |
||
1566 | 1566 | } |
1567 | 1567 | |
1568 | 1568 | |
1569 | - $arrayothercontracts = $object->getListOfContracts('others'); // array or -1 if technical error |
|
1569 | + $arrayothercontracts = $object->getListOfContracts('others'); // array or -1 if technical error |
|
1570 | 1570 | |
1571 | 1571 | /* |
1572 | 1572 | * Lines of contracts |
@@ -1819,7 +1819,7 @@ discard block |
||
1819 | 1819 | print $objp->label ? ' - '.dol_trunc($objp->label, 32) : ''; |
1820 | 1820 | print '<input type="hidden" name="idprod" value="'.$currentLineProductId.'">'; |
1821 | 1821 | } else { |
1822 | - $senderissupplier = 0; // @TODO Option to allow purchased products ? |
|
1822 | + $senderissupplier = 0; // @TODO Option to allow purchased products ? |
|
1823 | 1823 | if (empty($senderissupplier)) { |
1824 | 1824 | print $form->select_produits($currentLineProductId, 'idprod', '', 0, 0, 1, 2, '', 0, array(), 0, 1, 0, 'minwidth250onall maxwidth500 widthcentpercentminusx'); |
1825 | 1825 | } else { |
@@ -2316,9 +2316,9 @@ discard block |
||
2316 | 2316 | // Sign |
2317 | 2317 | if ($object->status > Contrat::STATUS_DRAFT) { |
2318 | 2318 | if ($object->signed_status != Contrat::$SIGNED_STATUSES['STATUS_SIGNED_ALL']) { |
2319 | - print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=sign&token=' . newToken() . '">' . $langs->trans("ContractSign") . '</a></div>'; |
|
2319 | + print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=sign&token='.newToken().'">'.$langs->trans("ContractSign").'</a></div>'; |
|
2320 | 2320 | } else { |
2321 | - print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=unsign&token=' . newToken() . '">' . $langs->trans("ContractUnsign") . '</a></div>'; |
|
2321 | + print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=unsign&token='.newToken().'">'.$langs->trans("ContractUnsign").'</a></div>'; |
|
2322 | 2322 | } |
2323 | 2323 | } |
2324 | 2324 |