diff --git a/dev/tools/phan/baseline.txt b/dev/tools/phan/baseline.txt index dcfbfa73dda..6c27b5a85b5 100644 --- a/dev/tools/phan/baseline.txt +++ b/dev/tools/phan/baseline.txt @@ -9,7 +9,7 @@ */ return [ // # Issue statistics: - // PhanTypeMismatchArgument : 2450+ occurrences + // PhanTypeMismatchArgument : 2340+ occurrences // PhanUndeclaredProperty : 530+ occurrences // PhanTypeMismatchArgumentNullable : 430+ occurrences // PhanUndeclaredGlobalVariable : 190+ occurrences @@ -92,29 +92,20 @@ return [ 'htdocs/adherents/subscription.php' => ['PhanTypeMismatchArgument'], 'htdocs/adherents/type.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchProperty'], 'htdocs/adherents/vcard.php' => ['PhanTypeMismatchArgument'], - 'htdocs/admin/agenda_other.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/admin/agenda_other.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/admin/agenda_reminder.php' => ['PhanTypeMismatchArgumentNullable'], - 'htdocs/admin/bank.php' => ['PhanTypeMismatchArgument'], 'htdocs/admin/barcode.php' => ['PhanTypeMismatchArgument'], 'htdocs/admin/bom.php' => ['PhanTypeMismatchArgument'], - 'htdocs/admin/chequereceipts.php' => ['PhanTypeMismatchArgument'], 'htdocs/admin/company.php' => ['PhanTypeMismatchArgument'], - 'htdocs/admin/contract.php' => ['PhanTypeMismatchArgument'], 'htdocs/admin/defaultvalues.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/admin/delivery.php' => ['PhanTypeMismatchArgument'], 'htdocs/admin/dict.php' => ['PhanTypeMismatchArgument'], 'htdocs/admin/emailcollector_card.php' => ['PhanTypeMismatchArgument'], 'htdocs/admin/emailcollector_list.php' => ['PhanTypeMismatchArgument'], 'htdocs/admin/eventorganization.php' => ['PhanTypeMismatchArgument'], - 'htdocs/admin/expedition.php' => ['PhanTypeMismatchArgument'], - 'htdocs/admin/expensereport.php' => ['PhanTypeMismatchArgument'], 'htdocs/admin/expensereport_rules.php' => ['PhanTypeMismatchArgument'], 'htdocs/admin/external_rss.php' => ['PhanTypeMismatchArgument'], 'htdocs/admin/fckeditor.php' => ['PhanTypeMismatchArgument'], - 'htdocs/admin/fichinter.php' => ['PhanTypeMismatchArgument'], - 'htdocs/admin/holiday.php' => ['PhanTypeMismatchArgument'], 'htdocs/admin/hrm.php' => ['PhanTypeMismatchArgument'], - 'htdocs/admin/invoice.php' => ['PhanTypeMismatchArgument'], 'htdocs/admin/knowledgemanagement.php' => ['PhanTypeMismatchArgument'], 'htdocs/admin/mails.php' => ['PhanTypeMismatchArgument'], 'htdocs/admin/mails_emailing.php' => ['PhanTypeMismatchArgumentNullable'], @@ -124,32 +115,19 @@ return [ 'htdocs/admin/mails_ticket.php' => ['PhanTypeMismatchArgumentNullable'], 'htdocs/admin/menus/index.php' => ['PhanTypeMismatchArgument'], 'htdocs/admin/multicurrency.php' => ['PhanTypeMismatchArgument'], - 'htdocs/admin/order.php' => ['PhanTypeMismatchArgument'], - 'htdocs/admin/payment.php' => ['PhanTypeMismatchArgument'], 'htdocs/admin/paymentbybanktransfer.php' => ['PhanTypeMismatchArgument'], 'htdocs/admin/pdf_other.php' => ['PhanTypeMismatchArgument'], 'htdocs/admin/prelevement.php' => ['PhanTypeMismatchArgument'], - 'htdocs/admin/propal.php' => ['PhanTypeMismatchArgument'], 'htdocs/admin/receiptprinter.php' => ['PhanTypeMismatchArgument'], - 'htdocs/admin/reception_setup.php' => ['PhanTypeMismatchArgument'], 'htdocs/admin/remotestore/class/PSWebServiceLibrary.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], 'htdocs/admin/remotestore/class/dolistore.class.php' => ['PhanTypeMismatchArgument'], - 'htdocs/admin/stock.php' => ['PhanTypeMismatchArgument'], - 'htdocs/admin/stocktransfer.php' => ['PhanTypeMismatchArgument'], - 'htdocs/admin/supplier_invoice.php' => ['PhanTypeMismatchArgument'], - 'htdocs/admin/supplier_order.php' => ['PhanTypeMismatchArgument'], - 'htdocs/admin/supplier_payment.php' => ['PhanTypeMismatchArgument'], - 'htdocs/admin/supplier_proposal.php' => ['PhanTypeMismatchArgument'], 'htdocs/admin/system/filecheck.php' => ['PhanTypeMismatchArgument'], 'htdocs/admin/system/modules.php' => ['PhanTypeMismatchArgument'], 'htdocs/admin/taxes.php' => ['PhanTypeMismatchArgumentNullable'], 'htdocs/admin/ticket.php' => ['PhanTypeMismatchArgument'], 'htdocs/admin/tools/export.php' => ['PhanTypeMismatchArgument'], - 'htdocs/admin/user.php' => ['PhanTypeMismatchArgument'], - 'htdocs/admin/usergroup.php' => ['PhanTypeMismatchArgument'], 'htdocs/admin/webhook.php' => ['PhanTypeMismatchArgument'], 'htdocs/admin/website.php' => ['PhanTypeMismatchArgument'], - 'htdocs/admin/workstation.php' => ['PhanTypeMismatchArgument'], 'htdocs/api/class/api_access.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanUndeclaredProperty'], 'htdocs/api/class/api_documents.class.php' => ['PhanPluginDuplicateExpressionBinaryOp', 'PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgument'], 'htdocs/api/class/api_login.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgument'], @@ -442,7 +420,6 @@ return [ 'htdocs/core/modules/import/import_csv.modules.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchProperty'], 'htdocs/core/modules/import/import_xlsx.modules.php' => ['PhanTypeMismatchProperty'], 'htdocs/core/modules/mailings/eventorganization.modules.php' => ['PhanTypeMismatchArgument'], - 'htdocs/core/modules/mailings/modules_mailings.php' => ['PhanTypeMismatchArgument'], 'htdocs/core/modules/member/doc/pdf_standard_member.class.php' => ['PhanTypeMismatchArgument'], 'htdocs/core/modules/member/modules_cards.php' => ['PhanTypeMismatchArgument'], 'htdocs/core/modules/modAdherent.class.php' => ['PhanTypeMismatchArgument'], @@ -470,10 +447,10 @@ return [ 'htdocs/core/modules/oauth/github_oauthcallback.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php' => ['PhanTypeMismatchArgument'], 'htdocs/core/modules/printsheet/doc/pdf_tcpdflabel.class.php' => ['PhanTypeMismatchArgument'], - 'htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'], + 'htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php' => ['PhanUndeclaredProperty'], 'htdocs/core/modules/project/doc/pdf_beluga.modules.php' => ['PhanTypeMismatchArgument'], 'htdocs/core/modules/project/doc/pdf_timespent.modules.php' => ['PhanUndeclaredProperty'], - 'htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'], + 'htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php' => ['PhanUndeclaredProperty'], 'htdocs/core/modules/propale/doc/pdf_azur.modules.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'], 'htdocs/core/modules/propale/doc/pdf_cyan.modules.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'], 'htdocs/core/modules/reception/doc/pdf_squille.modules.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'], @@ -491,8 +468,6 @@ return [ 'htdocs/core/modules/workstation/mod_workstation_advanced.php' => ['PhanUndeclaredProperty'], 'htdocs/core/multicompany_page.php' => ['PhanTypeMismatchArgument'], 'htdocs/core/search_page.php' => ['PhanTypeMismatchArgument'], - 'htdocs/core/tpl/admin_extrafields_add.tpl.php' => ['PhanTypeMismatchArgument'], - 'htdocs/core/tpl/admin_extrafields_edit.tpl.php' => ['PhanTypeMismatchArgument'], 'htdocs/core/tpl/extrafields_list_array_fields.tpl.php' => ['PhanTypeMismatchArgument'], 'htdocs/core/tpl/extrafields_list_print_fields.tpl.php' => ['PhanTypeMismatchArgumentNullable'], 'htdocs/core/tpl/extrafields_view.tpl.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'], @@ -623,14 +598,13 @@ return [ 'htdocs/opensurvey/wizard/create_survey.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/partnership/class/api_partnerships.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgument'], 'htdocs/partnership/class/partnership.class.php' => ['PhanUndeclaredProperty'], - 'htdocs/partnership/core/modules/partnership/mod_partnership_advanced.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'], + 'htdocs/partnership/core/modules/partnership/mod_partnership_advanced.php' => ['PhanUndeclaredProperty'], 'htdocs/partnership/partnership_card.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/partnership/partnership_contact.php' => ['PhanTypeMismatchArgument'], 'htdocs/partnership/partnership_list.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'], 'htdocs/printing/index.php' => ['PhanUndeclaredProperty'], 'htdocs/product/admin/price_rules.php' => ['PhanTypeMismatchArgument'], - 'htdocs/product/admin/product.php' => ['PhanPluginEmptyStatementIf', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/product/admin/product_lot.php' => ['PhanTypeMismatchArgument'], + 'htdocs/product/admin/product.php' => ['PhanPluginEmptyStatementIf', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/product/admin/product_tools.php' => ['PhanTypeMismatchArgument'], 'htdocs/product/ajax/products.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/product/canvas/product/actions_card_product.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], @@ -671,7 +645,7 @@ return [ 'htdocs/product/stock/class/entrepot.class.php' => ['PhanUndeclaredProperty'], 'htdocs/product/stock/class/mouvementstock.class.php' => ['PhanTypeMismatchArgument'], 'htdocs/product/stock/info.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanTypeMismatchArgument', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], - 'htdocs/product/stock/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], + 'htdocs/product/stock/list.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], 'htdocs/product/stock/massstockmove.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], 'htdocs/product/stock/movement_card.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/product/stock/movement_list.php' => ['PhanPluginBothLiteralsBinaryOp', 'PhanPluginUndeclaredVariableIsset', 'PhanTypeMismatchArgument', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], @@ -693,7 +667,7 @@ return [ 'htdocs/projet/activity/perday.php' => ['PhanTypeMismatchArgument'], 'htdocs/projet/activity/permonth.php' => ['PhanTypeMismatchArgument'], 'htdocs/projet/activity/perweek.php' => ['PhanTypeMismatchArgument'], - 'htdocs/projet/admin/project.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/projet/admin/project.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/projet/admin/website.php' => ['PhanTypeMismatchArgument'], 'htdocs/projet/ajax/projects.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/projet/card.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredGlobalVariable'], @@ -762,8 +736,8 @@ return [ 'htdocs/reception/list.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgument', 'PhanUndeclaredProperty'], 'htdocs/reception/note.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredGlobalVariable'], 'htdocs/reception/stats/index.php' => ['PhanTypeMismatchArgument'], - 'htdocs/recruitment/admin/setup.php' => ['PhanEmptyForeach', 'PhanTypeMismatchArgument'], - 'htdocs/recruitment/admin/setup_candidatures.php' => ['PhanEmptyForeach', 'PhanTypeMismatchArgument'], + 'htdocs/recruitment/admin/setup.php' => ['PhanEmptyForeach'], + 'htdocs/recruitment/admin/setup_candidatures.php' => ['PhanEmptyForeach'], 'htdocs/recruitment/class/api_recruitments.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], 'htdocs/recruitment/class/recruitmentcandidature.class.php' => ['PhanUndeclaredProperty'], 'htdocs/recruitment/class/recruitmentjobposition.class.php' => ['PhanUndeclaredProperty'], @@ -826,7 +800,6 @@ return [ 'htdocs/supplier_proposal/list.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/supplier_proposal/note.php' => ['PhanTypeMismatchArgument'], 'htdocs/takepos/admin/bar.php' => ['PhanTypeMismatchArgument'], - 'htdocs/takepos/admin/setup.php' => ['PhanTypeMismatchArgument'], 'htdocs/takepos/admin/terminal.php' => ['PhanTypeMismatchArgument'], 'htdocs/takepos/ajax/ajax.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], 'htdocs/takepos/floors.php' => ['PhanTypeMismatchArgumentProbablyReal'], diff --git a/dev/tools/phan/config_fixer.php b/dev/tools/phan/config_fixer.php index 8f5df967bca..e9a0fa36763 100644 --- a/dev/tools/phan/config_fixer.php +++ b/dev/tools/phan/config_fixer.php @@ -14,7 +14,8 @@ $config = include __DIR__.DIRECTORY_SEPARATOR."config.php"; //require_once __DIR__.'/plugins/PriceFormFixer.php'; //require_once __DIR__.'/plugins/UrlEncodeStringifyFixer.php'; //require_once __DIR__.'/plugins/SelectDateFixer.php'; -require_once __DIR__.'/plugins/setPageOrientationFixer.php'; +//require_once __DIR__.'/plugins/setPageOrientationFixer.php'; +require_once __DIR__.'/plugins/textwithpictoFixer.php'; //require_once __DIR__.'/plugins/MultiCellFixer.php'; //require_once __DIR__.'/plugins/setAutoPageBreakFixer.php'; //require_once __DIR__.'/plugins/CellFixer.php'; diff --git a/dev/tools/phan/plugins/textwithpictoFixer.php b/dev/tools/phan/plugins/textwithpictoFixer.php new file mode 100644 index 00000000000..484b02cf675 --- /dev/null +++ b/dev/tools/phan/plugins/textwithpictoFixer.php @@ -0,0 +1,177 @@ + + * + * For 'price()', replace $form parameter that is '' with 0. + */ + +declare(strict_types=1); + +use ast\flags; +use Microsoft\PhpParser\Node\Expression\CallExpression; +use Microsoft\PhpParser\Node\QualifiedName; +use Phan\AST\TolerantASTConverter\NodeUtils; +use Phan\CodeBase; +use Phan\IssueInstance; +use Phan\Library\FileCacheEntry; +use Phan\Plugin\Internal\IssueFixingPlugin\FileEdit; +use Phan\Plugin\Internal\IssueFixingPlugin\FileEditSet; +use Phan\Plugin\Internal\IssueFixingPlugin\IssueFixer; +use Microsoft\PhpParser\Node\Expression\ArgumentExpression; +use Microsoft\PhpParser\Node\DelimitedList\ArgumentExpressionList; +use Microsoft\PhpParser\Node\StringLiteral; +use Microsoft\PhpParser\Node\NumericLiteral; +use Microsoft\PhpParser\Node\ReservedWord; +use Microsoft\PhpParser\Token; + +/** + * This is a prototype, there are various features it does not implement. + */ + +call_user_func(static function (): void { + /** + * @param $code_base @unused-param + * @return ?FileEditSet a representation of the edit to make to replace a call to a function alias with a call to the original function + */ + $fix = static function (CodeBase $code_base, FileCacheEntry $contents, IssueInstance $instance): ?FileEditSet { + + // Argument {INDEX} (${PARAMETER}) is {CODE} of type {TYPE}{DETAILS} but + // {FUNCTIONLIKE} takes {TYPE}{DETAILS} defined at {FILE}:{LINE} (the inferred real argument type has nothing in common with the parameter's phpdoc type) + + //htdocs\supplier_proposal\card.php:1705 PhanTypeMismatchArgumentProbablyReal Argument 3 ($h) is '' of type '' but \Form::selectDate() takes int (no real type) defined at htdocs\core\class\html.form.class.php:6799 (the inferred real argument type has nothing in common with the parameter's phpdoc type) + //htdocs\supplier_proposal\card.php:1705 PhanTypeMismatchArgumentProbablyReal Argument 4 ($m) is '' of type '' but \Form::selectDate() takes int (no real type) defined at htdocs\core\class\html.form.class.php:6799 (the inferred real argument type has nothing in common with the parameter's phpdoc type) + // var_dump($instance->getTemplateParameters()); + $argument_index = (string) $instance->getTemplateParameters()[0]; + $argument_name = (string) $instance->getTemplateParameters()[1]; + $argument_code = (string) $instance->getTemplateParameters()[2]; + $argument_type = (string) $instance->getTemplateParameters()[3]; + $functionlike = (string) $instance->getTemplateParameters()[4]; + $functiontype = (string) $instance->getTemplateParameters()[5]; + + $expected_functionlike = "\\Form::textwithpicto()"; + $expected_name = "textwithpicto"; + if ($functionlike !== $expected_functionlike) { + //print "$functionlike != '$expected_functionlike'".PHP_EOL; + return null; + } + + $toBoolReplaceArray = array("0" => "'info'","1" => "'help'"); + // Check if we fix any of this + if ( + ($argument_name === 'type' && in_array($argument_code, array_keys($toBoolReplaceArray))) + //|| ($argument_name === 'm' && $argument_code === "''") + //|| ($argument_name === 'empty' && $argument_code === "''") + ) { + $replacement = $toBoolReplaceArray[$argument_code]; + $argIdx = ($argument_index - 1) * 2; + $expectedStringValue = $argument_code; + } else { + print "ARG$argument_index:$argument_name CODE:$argument_name".PHP_EOL; + return null; + } + + // At this point we established that the notification + // matches some we fix. + + $line = $instance->getLine(); + + $edits = []; + foreach ($contents->getNodesAtLine($line) as $node) { + if (!$node instanceof ArgumentExpressionList) { + continue; + } + $arguments = $node->children; + if (count($arguments) <= $argIdx) { + // print "Arg Count is ".count($arguments)." - Skip $instance".PHP_EOL; + continue; + } + + $is_actual_call = $node->parent instanceof CallExpression; + if (!$is_actual_call) { + // print "Not actual call - Skip $instance".PHP_EOL; + continue; + } + + print "Actual call - $instance".PHP_EOL; + $callable = $node->parent; + + $callableExpression = $callable->callableExpression; + + if ($callableExpression instanceof Microsoft\PhpParser\Node\QualifiedName) { + $actual_name = $callableExpression->getResolvedName(); + } elseif ($callableExpression instanceof Microsoft\PhpParser\Node\Expression\MemberAccessExpression) { + $memberNameToken = $callableExpression->memberName; + $actual_name = (new NodeUtils($contents->getContents()))->tokenToString($memberNameToken); + } else { + print "Callable expression is ".get_class($callableExpression)."- Skip $instance".PHP_EOL; + continue; + } + + if ((string) $actual_name !== (string) $expected_name) { + // print "Name unexpected '$actual_name'!='$expected_name' - Skip $instance".PHP_EOL; + continue; + } + + foreach ($arguments as $i => $argument) { + if ($argument instanceof ArgumentExpression) { + // print "Type$i: ".get_class($argument->expression).PHP_EOL; + } + } + + $fieldValue = null; + + + $arg = $arguments[$argIdx]; + + if ( + $arg instanceof ArgumentExpression + && $arg->expression instanceof NumericLiteral + ) { + // Get the string value of the NumericLiteral + $fieldValue = (string) $arg->expression; + //print "Field is '$fieldValue'".PHP_EOL; + } elseif ($arg instanceof ArgumentExpression && $arg->expression instanceof ReservedWord) { + $child = $arg->expression->children; + if (!$child instanceof Token) { + continue; + } + $token_str = (new NodeUtils($contents->getContents()))->tokenToString($child); + print "$token_str KIND:".($child->kind ?? 'no kind')." ".get_class($child).PHP_EOL; + + if ($token_str !== 'null') { + continue; + } + + $fieldValue = ''; // Fake empty + } else { + // print "Expression is not expected type ".get_class($arg)."/".get_class($arg->expression)."- Skip $instance".PHP_EOL; + continue; + } + + if ($fieldValue !== $expectedStringValue) { + // print "Not replacing '$argument_name' which is '$fieldValue'/".get_class($arg)."/".get_class($arg->expression)."- Skip $instance".PHP_EOL; + continue; + } + + print "Fixture elem on $line - $actual_name(...'$fieldValue'...) - $instance".PHP_EOL; + + + + // Get the first argument (delimiter) + $argument_to_replace = $arg; + + $arg_start_pos = $argument_to_replace->getStartPosition(); + $arg_end_pos = $argument_to_replace->getEndPosition(); + + // Set edit instruction + $edits[] = new FileEdit($arg_start_pos, $arg_end_pos, $replacement); + } + if ($edits) { + return new FileEditSet($edits); + } + return null; + }; + IssueFixer::registerFixerClosure( + 'PhanTypeMismatchArgument', + $fix + ); +}); diff --git a/htdocs/adherents/admin/member.php b/htdocs/adherents/admin/member.php index 8bd3a2013ea..31a1597eeed 100644 --- a/htdocs/adherents/admin/member.php +++ b/htdocs/adherents/admin/member.php @@ -10,7 +10,7 @@ * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2020-2024 Frédéric France * Copyright (C) 2023 Waël Almoman - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify @@ -461,7 +461,7 @@ foreach ($dirmodels as $reldir) { print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; // Preview diff --git a/htdocs/admin/agenda_other.php b/htdocs/admin/agenda_other.php index 5f50050e53c..fddb1cf8566 100644 --- a/htdocs/admin/agenda_other.php +++ b/htdocs/admin/agenda_other.php @@ -5,7 +5,7 @@ * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2016 Charlie Benke * Copyright (C) 2017 Open-DSI - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -320,7 +320,7 @@ if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) { $htmltooltip .= '

'.$langs->trans("FeaturesSupported").':'; $htmltooltip .= '
'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1); print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; print ''; print ''.img_object($langs->trans("Preview"), 'pdf').''; diff --git a/htdocs/admin/bank.php b/htdocs/admin/bank.php index 2e1afa189cc..a01086727f0 100644 --- a/htdocs/admin/bank.php +++ b/htdocs/admin/bank.php @@ -3,7 +3,7 @@ * Copyright (C) 2010-2016 Juanjo Menent * Copyright (C) 2013-2018 Philippe Grand * Copyright (C) 2015 Jean-François Ferry - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -413,7 +413,7 @@ foreach ($dirmodels as $reldir) { //$htmltooltip .= '
' . $langs->trans("WatermarkOnDraftOrders") . ': ' . yn($module->option_draft_watermark, 1, 1); print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; // Preview diff --git a/htdocs/admin/bom.php b/htdocs/admin/bom.php index 1c4f0b4377a..de147fc81d3 100644 --- a/htdocs/admin/bom.php +++ b/htdocs/admin/bom.php @@ -1,6 +1,6 @@ - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -283,7 +283,7 @@ foreach ($dirmodels as $reldir) { } print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; print "\n"; @@ -420,7 +420,7 @@ foreach ($dirmodels as $reldir) { print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; // Preview diff --git a/htdocs/admin/chequereceipts.php b/htdocs/admin/chequereceipts.php index a26f0f33af2..75b0e216b27 100644 --- a/htdocs/admin/chequereceipts.php +++ b/htdocs/admin/chequereceipts.php @@ -3,7 +3,7 @@ * Copyright (C) 2010-2016 Juanjo Menent * Copyright (C) 2013-2018 Philippe Grand * Copyright (C) 2015 Jean-François Ferry - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -226,7 +226,7 @@ foreach ($dirmodels as $reldir) { } print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); if (getDolGlobalString('CHEQUERECEIPTS_ADDON').'.php' == $file) { // If module is the one used, we show existing errors if (!empty($module->error)) { diff --git a/htdocs/admin/contract.php b/htdocs/admin/contract.php index ae676a142fd..d9bd0289527 100644 --- a/htdocs/admin/contract.php +++ b/htdocs/admin/contract.php @@ -1,7 +1,7 @@ * Copyright (C) 2011-2018 Philippe Grand - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -316,7 +316,7 @@ foreach ($dirmodels as $reldir) { } print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; print ''; @@ -456,7 +456,7 @@ foreach ($dirmodels as $reldir) { print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; // Preview diff --git a/htdocs/admin/delivery.php b/htdocs/admin/delivery.php index fa05a39c472..95ef16efbad 100644 --- a/htdocs/admin/delivery.php +++ b/htdocs/admin/delivery.php @@ -8,7 +8,7 @@ * Copyright (C) 2011-2013 Juanjo Menent * Copyright (C) 2011-2018 Philippe Grand * Copyright (C) 2015 Claudio Aschieri - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -328,7 +328,7 @@ if (getDolGlobalString('MAIN_SUBMODULE_DELIVERY')) { } print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; print ''; @@ -456,7 +456,7 @@ if (getDolGlobalString('MAIN_SUBMODULE_DELIVERY')) { $htmltooltip .= '

'.$langs->trans("FeaturesSupported").':'; $htmltooltip .= '
'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1); print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; // Preview diff --git a/htdocs/admin/expedition.php b/htdocs/admin/expedition.php index 5ad30fc921f..1f03a708917 100644 --- a/htdocs/admin/expedition.php +++ b/htdocs/admin/expedition.php @@ -7,7 +7,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2011-2012 Juanjo Menent * Copyright (C) 2011-2018 Philippe Grand - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -272,7 +272,7 @@ foreach ($dirmodels as $reldir) { } print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; print ''; @@ -408,7 +408,7 @@ foreach ($dirmodels as $reldir) { $htmltooltip .= '
'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark, 1, 1); print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; // Preview diff --git a/htdocs/admin/expensereport.php b/htdocs/admin/expensereport.php index 31087976ffc..e9d5c01acd8 100644 --- a/htdocs/admin/expensereport.php +++ b/htdocs/admin/expensereport.php @@ -7,7 +7,7 @@ * Copyright (C) 2008 Raphael Bertrand (Resultic) * Copyright (C) 2011-2013 Juanjo Menent * Copyright (C) 2011-2022 Philippe Grand - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -298,7 +298,7 @@ foreach ($dirmodels as $reldir) { } print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; print "\n"; @@ -427,7 +427,7 @@ foreach ($dirmodels as $reldir) { $htmltooltip .= '
'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1); $htmltooltip .= '
'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark, 1, 1); print ''; - print $form->textwithpicto('', $htmltooltip, -1, 0); + print $form->textwithpicto('', $htmltooltip, -1, 'info'); print ''; // Preview diff --git a/htdocs/admin/fichinter.php b/htdocs/admin/fichinter.php index edcd0469c1a..18c72b62051 100644 --- a/htdocs/admin/fichinter.php +++ b/htdocs/admin/fichinter.php @@ -7,7 +7,7 @@ * Copyright (C) 2008 Raphael Bertrand (Resultic) * Copyright (C) 2011-2013 Juanjo Menent * Copyright (C) 2011-2018 Philippe Grand - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -364,7 +364,7 @@ foreach ($dirmodels as $reldir) { } } print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; print ''; @@ -503,7 +503,7 @@ foreach ($dirmodels as $reldir) { $htmltooltip .= '
'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1); $htmltooltip .= '
'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark, 1, 1); print ''; - print $form->textwithpicto('', $htmltooltip, -1, 0); + print $form->textwithpicto('', $htmltooltip, -1, 'info'); print ''; // Preview diff --git a/htdocs/admin/holiday.php b/htdocs/admin/holiday.php index b6fc587032d..4eb9e2f5dbd 100644 --- a/htdocs/admin/holiday.php +++ b/htdocs/admin/holiday.php @@ -3,7 +3,7 @@ * Copyright (C) 2011-2018 Philippe Grand * Copyright (C) 2018 Charlene Benke * Copyright (C) 2018-2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -274,7 +274,7 @@ foreach ($dirmodels as $reldir) { } print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; print ''; @@ -419,7 +419,7 @@ if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) { print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; // Preview diff --git a/htdocs/admin/hrm.php b/htdocs/admin/hrm.php index e80962f6d25..de8dfabaa18 100644 --- a/htdocs/admin/hrm.php +++ b/htdocs/admin/hrm.php @@ -4,7 +4,7 @@ * Copyright (C) 2021 Greg Rastklan * Copyright (C) 2021 Jean-Pascal BOUDET * Copyright (C) 2021 Grégory BLEMAND - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software: you can redistribute it and/or modify @@ -331,7 +331,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { } print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; print "\n"; @@ -471,7 +471,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { $htmltooltip .= '
'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1); print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; // Preview diff --git a/htdocs/admin/invoice.php b/htdocs/admin/invoice.php index e9dc88c9b96..1beac2929ee 100644 --- a/htdocs/admin/invoice.php +++ b/htdocs/admin/invoice.php @@ -7,7 +7,7 @@ * Copyright (C) 2012-2013 Juanjo Menent * Copyright (C) 2014 Teddy Andreotti <125155@supinfo.com> * Copyright (C) 2022 Anthony Berton - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * Copyright (C) 2024 Alexandre Spangaro * @@ -451,7 +451,7 @@ foreach ($dirmodels as $reldir) { } print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); if (getDolGlobalString('FACTURE_ADDON') . '.php' == $file) { // If module is the one used, we show existing errors if (!empty($module->error)) { @@ -608,7 +608,7 @@ foreach ($dirmodels as $reldir) { print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; // Preview diff --git a/htdocs/admin/knowledgemanagement.php b/htdocs/admin/knowledgemanagement.php index 7c7458a6901..953f7958bd7 100644 --- a/htdocs/admin/knowledgemanagement.php +++ b/htdocs/admin/knowledgemanagement.php @@ -1,6 +1,6 @@ - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software: you can redistribute it and/or modify @@ -450,7 +450,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { } print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; print "\n"; @@ -589,7 +589,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { $htmltooltip .= '
'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1); print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; // Preview diff --git a/htdocs/admin/order.php b/htdocs/admin/order.php index 38b4dd721cf..27e6f623a62 100644 --- a/htdocs/admin/order.php +++ b/htdocs/admin/order.php @@ -10,7 +10,7 @@ * Copyright (C) 2011-2016 Philippe Grand * Copyright (C) 2013 Florian Henry * Copyright (C) 2021-2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -368,7 +368,7 @@ foreach ($dirmodels as $reldir) { } print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; print "\n"; @@ -509,7 +509,7 @@ foreach ($dirmodels as $reldir) { print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; // Preview diff --git a/htdocs/admin/payment.php b/htdocs/admin/payment.php index f60bed8f0c9..f40c357e13e 100644 --- a/htdocs/admin/payment.php +++ b/htdocs/admin/payment.php @@ -1,7 +1,7 @@ * Copyright (C) 2020 Maxime DEMAREST - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -230,7 +230,7 @@ foreach ($dirmodels as $reldir) { } print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); if (getDolGlobalString('PAYMENT_ADDON') . '.php' == $file) { // If module is the one used, we show existing errors if (!empty($module->error)) { diff --git a/htdocs/admin/propal.php b/htdocs/admin/propal.php index 49ca75ee0a1..f9c26ab8616 100644 --- a/htdocs/admin/propal.php +++ b/htdocs/admin/propal.php @@ -7,7 +7,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2008 Raphael Bertrand (Resultic) * Copyright (C) 2011-2013 Juanjo Menent - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -346,7 +346,7 @@ foreach ($dirmodels as $reldir) { } print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; print "\n"; @@ -486,7 +486,7 @@ foreach ($dirmodels as $reldir) { print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; // Preview diff --git a/htdocs/admin/reception_setup.php b/htdocs/admin/reception_setup.php index 7c1c855dc0a..b783d9e07df 100644 --- a/htdocs/admin/reception_setup.php +++ b/htdocs/admin/reception_setup.php @@ -1,6 +1,6 @@ - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -279,7 +279,7 @@ foreach ($dirmodels as $reldir) { } print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; print ''; @@ -421,7 +421,7 @@ foreach ($dirmodels as $reldir) { $htmltooltip .= '
'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark, 1, 1); print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; // Preview diff --git a/htdocs/admin/stock.php b/htdocs/admin/stock.php index 952bccf2074..10df54ee44d 100644 --- a/htdocs/admin/stock.php +++ b/htdocs/admin/stock.php @@ -5,7 +5,7 @@ * Copyright (C) 2012-2013 Juanjo Menent * Copyright (C) 2013-2018 Philippe Grand * Copyright (C) 2013 Florian Henry - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -656,7 +656,7 @@ foreach ($dirmodels as $reldir) { print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; // Preview diff --git a/htdocs/admin/stocktransfer.php b/htdocs/admin/stocktransfer.php index 6a14e25c466..8dc65bc920e 100644 --- a/htdocs/admin/stocktransfer.php +++ b/htdocs/admin/stocktransfer.php @@ -2,7 +2,7 @@ /* Copyright (C) 2004-2017 Laurent Destailleur * Copyright (C) 2021 Gauthier VERDOL * Copyright (C) 2021 SuperAdmin - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software: you can redistribute it and/or modify @@ -337,7 +337,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { } print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; print "\n"; @@ -473,7 +473,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { $htmltooltip .= '
'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1); print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; // Preview diff --git a/htdocs/admin/supplier_invoice.php b/htdocs/admin/supplier_invoice.php index 8dab80b8157..b0c05b8bbea 100644 --- a/htdocs/admin/supplier_invoice.php +++ b/htdocs/admin/supplier_invoice.php @@ -6,7 +6,7 @@ * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2010-2013 Juanjo Menent * Copyright (C) 2011-2018 Philippe Grand - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -303,7 +303,7 @@ foreach ($dirmodels as $reldir) { } print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; print ''; @@ -441,7 +441,7 @@ foreach ($dirmodels as $reldir) { $htmltooltip .= '
'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1); $htmltooltip .= '
'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg, 1, 1); print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; print ''; print ''.img_object($langs->trans("Preview"), 'pdf').''; diff --git a/htdocs/admin/supplier_order.php b/htdocs/admin/supplier_order.php index ba4886573f3..c10d59f2939 100644 --- a/htdocs/admin/supplier_order.php +++ b/htdocs/admin/supplier_order.php @@ -6,7 +6,7 @@ * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2010-2013 Juanjo Menent * Copyright (C) 2011-2018 Philippe Grand - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -320,7 +320,7 @@ foreach ($dirmodels as $reldir) { } print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; print ''; @@ -446,7 +446,7 @@ foreach ($dirmodels as $reldir) { $htmltooltip .= '
'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1); $htmltooltip .= '
'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg, 1, 1); print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; print ''; print ''.img_object($langs->trans("Preview"), 'pdf').''; diff --git a/htdocs/admin/supplier_payment.php b/htdocs/admin/supplier_payment.php index 3419f734977..20d89893d8e 100644 --- a/htdocs/admin/supplier_payment.php +++ b/htdocs/admin/supplier_payment.php @@ -2,7 +2,7 @@ /* Copyright (C) 2015 Juanjo Menent * Copyright (C) 2016 Laurent Destailleur * Copyright (C) 2020 Maxime DEMAREST - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -307,7 +307,7 @@ foreach ($dirmodels as $reldir) { } print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); if (getDolGlobalString("PAYMENT_ADDON").'.php' == $file) { // If module is the one used, we show existing errors if (!empty($module->error)) { @@ -421,7 +421,7 @@ foreach ($dirmodels as $reldir) { $htmltooltip .= '

'.$langs->trans("FeaturesSupported").':'; $htmltooltip .= '
'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1); print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; print ''; print ''.img_object($langs->trans("Preview"), 'pdf').''; diff --git a/htdocs/admin/supplier_proposal.php b/htdocs/admin/supplier_proposal.php index 4c3fc9ee12c..c642ff20383 100644 --- a/htdocs/admin/supplier_proposal.php +++ b/htdocs/admin/supplier_proposal.php @@ -8,7 +8,7 @@ * Copyright (C) 2008 Raphael Bertrand (Resultic) * Copyright (C) 2011-2013 Juanjo Menent * Copyright (C) 2015 Jean-François Ferry - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -336,7 +336,7 @@ foreach ($dirmodels as $reldir) { } print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; print "\n"; @@ -475,7 +475,7 @@ foreach ($dirmodels as $reldir) { print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; // Preview diff --git a/htdocs/admin/user.php b/htdocs/admin/user.php index 0c957617ce1..8055e5fdcde 100644 --- a/htdocs/admin/user.php +++ b/htdocs/admin/user.php @@ -7,7 +7,7 @@ * Copyright (C) 2005-2011 Regis Houssin * Copyright (C) 2015 Juanjo Menent * Copyright (C) 2020-2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -317,7 +317,7 @@ foreach ($dirmodels as $reldir) { print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; // Preview diff --git a/htdocs/admin/usergroup.php b/htdocs/admin/usergroup.php index fbaa912385a..15939c806c2 100644 --- a/htdocs/admin/usergroup.php +++ b/htdocs/admin/usergroup.php @@ -6,7 +6,7 @@ * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2005-2011 Regis Houssin * Copyright (C) 2015 Juanjo Menent - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -236,7 +236,7 @@ foreach ($dirmodels as $reldir) { print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; // Preview diff --git a/htdocs/admin/workstation.php b/htdocs/admin/workstation.php index dc6017c33ed..b93b8e0bb0c 100644 --- a/htdocs/admin/workstation.php +++ b/htdocs/admin/workstation.php @@ -1,7 +1,7 @@ * Copyright (C) 2020 Gauthier VERDOL - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software: you can redistribute it and/or modify @@ -281,7 +281,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { } print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; print "\n"; @@ -415,7 +415,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { $htmltooltip .= '
'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1); print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; // Preview diff --git a/htdocs/asset/admin/setup.php b/htdocs/asset/admin/setup.php index 22e36b47bda..4930864aa71 100644 --- a/htdocs/asset/admin/setup.php +++ b/htdocs/asset/admin/setup.php @@ -1,7 +1,7 @@ * Copyright (C) 2018-2024 Alexandre Spangaro - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software: you can redistribute it and/or modify @@ -301,7 +301,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { } print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; print "\n"; @@ -439,7 +439,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { $htmltooltip .= '
'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1); print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; // Preview diff --git a/htdocs/core/modules/mailings/modules_mailings.php b/htdocs/core/modules/mailings/modules_mailings.php index 9605cbe9019..49818e9f766 100644 --- a/htdocs/core/modules/mailings/modules_mailings.php +++ b/htdocs/core/modules/mailings/modules_mailings.php @@ -2,7 +2,7 @@ /* Copyright (C) 2003-2004 Rodolphe Quiedeville * Copyright (C) 2004-2008 Laurent Destailleur * Copyright (C) 2004 Eric Seigne - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -111,7 +111,7 @@ class MailingTargets // This can't be abstract as it is used for some method } if ($this->tooltip && is_object($form)) { - $s .= ' '.$form->textwithpicto('', $langs->trans($this->tooltip), 1, 1); + $s .= ' '.$form->textwithpicto('', $langs->trans($this->tooltip), 1, 'help'); } return $s; } diff --git a/htdocs/core/tpl/admin_extrafields_add.tpl.php b/htdocs/core/tpl/admin_extrafields_add.tpl.php index 25452bca8db..7c770e4ea77 100644 --- a/htdocs/core/tpl/admin_extrafields_add.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_add.tpl.php @@ -3,6 +3,7 @@ * Copyright (C) 2012 Regis Houssin * Copyright (C) 2016 Charlie Benke * Copyright (C) 2018-2024 Frédéric France + * Copyright (C) 2025 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -194,12 +195,12 @@ print $formadmin->selectTypeOfFields('type', GETPOST('type', 'alpha')); - textwithpicto('', $langs->trans("ExtrafieldParamHelpselect"), 1, 0, '', 0, 2, 'helpvalue1')?> - textwithpicto('', $langs->trans("ExtrafieldParamHelpsellist").(getDolGlobalInt('MAIN_FEATUREES_LEVEL') > 0 ? '
'.$langs->trans("ExtrafieldParamHelpsellist2") : ''), 1, 0, '', 0, 2, 'helpvalue2')?>
- textwithpicto('', $langs->trans("ExtrafieldParamHelpsellist").(getDolGlobalInt('MAIN_FEATUREES_LEVEL') > 0 ? '
'.$langs->trans("ExtrafieldParamHelpsellist2") : ''), 1, 0, '', 0, 2, 'helpvalue3')?>
- textwithpicto('', $langs->trans("ExtrafieldParamHelplink").'

'.$langs->trans("Examples").':
'.$listofexamplesforlink, 1, 0, '', 0, 2, 'helpvalue4')?>
- textwithpicto('', $langs->trans("ExtrafieldParamHelpPassword"), 1, 0, '', 0, 2, 'helpvalue5')?> - textwithpicto('', $langs->trans("ExtrafieldParamHelpSeparator"), 1, 0, '', 0, 2, 'helpvalue6')?> + textwithpicto('', $langs->trans("ExtrafieldParamHelpselect"), 1, 'info', '', 0, 2, 'helpvalue1')?> + textwithpicto('', $langs->trans("ExtrafieldParamHelpsellist").(getDolGlobalInt('MAIN_FEATUREES_LEVEL') > 0 ? '
'.$langs->trans("ExtrafieldParamHelpsellist2") : ''), 1, 'info', '', 0, 2, 'helpvalue2')?>
+ textwithpicto('', $langs->trans("ExtrafieldParamHelpsellist").(getDolGlobalInt('MAIN_FEATUREES_LEVEL') > 0 ? '
'.$langs->trans("ExtrafieldParamHelpsellist2") : ''), 1, 'info', '', 0, 2, 'helpvalue3')?>
+ textwithpicto('', $langs->trans("ExtrafieldParamHelplink").'

'.$langs->trans("Examples").':
'.$listofexamplesforlink, 1, 'info', '', 0, 2, 'helpvalue4')?>
+ textwithpicto('', $langs->trans("ExtrafieldParamHelpPassword"), 1, 'info', '', 0, 2, 'helpvalue5')?> + textwithpicto('', $langs->trans("ExtrafieldParamHelpSeparator"), 1, 'info', '', 0, 2, 'helpvalue6')?> diff --git a/htdocs/core/tpl/admin_extrafields_edit.tpl.php b/htdocs/core/tpl/admin_extrafields_edit.tpl.php index 78e0e8a2da0..5ae58298924 100644 --- a/htdocs/core/tpl/admin_extrafields_edit.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_edit.tpl.php @@ -2,6 +2,7 @@ /* Copyright (C) 2010-2012 Laurent Destailleur * Copyright (C) 2012 Regis Houssin * Copyright (C) 2018-2024 Frédéric France + * Copyright (C) 2025 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -210,18 +211,18 @@ if (is_array($param)) { array('varchar', 'phone', 'mail', 'url', 'ip', 'select', 'password', 'text', 'html'), - 'double'=>array('double', 'price'), - 'price'=>array('double', 'price'), - 'text'=>array('text', 'html'), - 'html'=>array('text', 'html'), - 'password'=>array('password', 'varchar'), - 'mail'=>array('varchar', 'phone', 'mail', 'url', 'ip', 'select'), - 'url'=>array('varchar', 'phone', 'mail', 'url', 'ip', 'select'), - 'phone'=>array('varchar', 'phone', 'mail', 'url', 'ip', 'select'), - 'ip'=>array('varchar', 'phone', 'mail', 'url', 'ip', 'select'), - 'select'=>array('varchar', 'phone', 'mail', 'url', 'ip', 'select'), - 'date'=>array('date', 'datetime') + 'varchar' => array('varchar', 'phone', 'mail', 'url', 'ip', 'select', 'password', 'text', 'html'), + 'double' => array('double', 'price'), + 'price' => array('double', 'price'), + 'text' => array('text', 'html'), + 'html' => array('text', 'html'), + 'password' => array('password', 'varchar'), + 'mail' => array('varchar', 'phone', 'mail', 'url', 'ip', 'select'), + 'url' => array('varchar', 'phone', 'mail', 'url', 'ip', 'select'), + 'phone' => array('varchar', 'phone', 'mail', 'url', 'ip', 'select'), + 'ip' => array('varchar', 'phone', 'mail', 'url', 'ip', 'select'), + 'select' => array('varchar', 'phone', 'mail', 'url', 'ip', 'select'), + 'date' => array('date', 'datetime') ); /* Disabled because text is text on several lines, when varchar is text on 1 line, we should not be able to convert if ($size <= 255 && in_array($type, array('text', 'html'))) { @@ -256,12 +257,12 @@ if (in_array($type, array_keys($typewecanchangeinto))) { - textwithpicto('', $langs->trans("ExtrafieldParamHelpselect"), 1, 0, '', 0, 2, 'helpvalue1')?> - textwithpicto('', $langs->trans("ExtrafieldParamHelpsellist").(getDolGlobalInt('MAIN_FEATUREES_LEVEL') > 0 ? '
'.$langs->trans("ExtrafieldParamHelpsellist2") : ''), 1, 0, '', 0, 2, 'helpvalue2')?>
- textwithpicto('', $langs->trans("ExtrafieldParamHelpsellist").(getDolGlobalInt('MAIN_FEATUREES_LEVEL') > 0 ? '
'.$langs->trans("ExtrafieldParamHelpsellist2") : ''), 1, 0, '', 0, 2, 'helpvalue3')?>
- textwithpicto('', $langs->trans("ExtrafieldParamHelplink").'

'.$langs->trans("Examples").':
'.$listofexamplesforlink, 1, 0, '', 0, 2, 'helpvalue4')?>
- textwithpicto('', $langs->trans("ExtrafieldParamHelpPassword"), 1, 0, '', 0, 2, 'helpvalue5')?> - textwithpicto('', $langs->trans("ExtrafieldParamHelpSeparator"), 1, 0, '', 0, 2, 'helpvalue6')?> + textwithpicto('', $langs->trans("ExtrafieldParamHelpselect"), 1, 'info', '', 0, 2, 'helpvalue1')?> + textwithpicto('', $langs->trans("ExtrafieldParamHelpsellist").(getDolGlobalInt('MAIN_FEATUREES_LEVEL') > 0 ? '
'.$langs->trans("ExtrafieldParamHelpsellist2") : ''), 1, 'info', '', 0, 2, 'helpvalue2')?>
+ textwithpicto('', $langs->trans("ExtrafieldParamHelpsellist").(getDolGlobalInt('MAIN_FEATUREES_LEVEL') > 0 ? '
'.$langs->trans("ExtrafieldParamHelpsellist2") : ''), 1, 'info', '', 0, 2, 'helpvalue3')?>
+ textwithpicto('', $langs->trans("ExtrafieldParamHelplink").'

'.$langs->trans("Examples").':
'.$listofexamplesforlink, 1, 'info', '', 0, 2, 'helpvalue4')?>
+ textwithpicto('', $langs->trans("ExtrafieldParamHelpPassword"), 1, 'info', '', 0, 2, 'helpvalue5')?> + textwithpicto('', $langs->trans("ExtrafieldParamHelpSeparator"), 1, 'info', '', 0, 2, 'helpvalue6')?> diff --git a/htdocs/partnership/core/modules/partnership/mod_partnership_advanced.php b/htdocs/partnership/core/modules/partnership/mod_partnership_advanced.php index 1c677e2b282..c259be9cda6 100644 --- a/htdocs/partnership/core/modules/partnership/mod_partnership_advanced.php +++ b/htdocs/partnership/core/modules/partnership/mod_partnership_advanced.php @@ -4,7 +4,7 @@ * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2008 Raphael Bertrand (Resultic) * Copyright (C) 2019-2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -82,7 +82,7 @@ class mod_partnership_advanced extends ModeleNumRefPartnership // Parametrage du prefix $text .= ''.$langs->trans("Mask").':'; - $text .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $text .= ''.$form->textwithpicto('', $tooltip, 1, 'help').''; $text .= '  '; diff --git a/htdocs/product/admin/product.php b/htdocs/product/admin/product.php index 60757b73689..fcb51f0e773 100644 --- a/htdocs/product/admin/product.php +++ b/htdocs/product/admin/product.php @@ -9,7 +9,7 @@ * Copyright (C) 2012 Cedric Salvador * Copyright (C) 2016 Charlie Benke * Copyright (C) 2016 Ferran Marcet - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -69,7 +69,7 @@ $select_pricing_rules = array( 'PRODUCT_PRICE_UNIQ' => $langs->trans('PriceCatalogue'), // Unique price 'PRODUIT_MULTIPRICES' => $langs->trans('MultiPricesAbility'), // Several prices according to a customer level 'PRODUIT_CUSTOMER_PRICES' => $langs->trans('PriceByCustomer'), // Different price for each customer - 'PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES'=>$langs->trans('PriceByCustomeAndMultiPricesAbility'), // Different price for each customer and several prices according to a customer level + 'PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES' => $langs->trans('PriceByCustomeAndMultiPricesAbility'), // Different price for each customer and several prices according to a customer level ); $keyforparam = 'PRODUIT_CUSTOMER_PRICES_BY_QTY'; if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 1 || getDolGlobalString($keyforparam)) { @@ -504,7 +504,7 @@ foreach ($dirmodels as $reldir) { print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; // Preview diff --git a/htdocs/product/admin/product_lot.php b/htdocs/product/admin/product_lot.php index 0b777f04943..77b16d06800 100644 --- a/htdocs/product/admin/product_lot.php +++ b/htdocs/product/admin/product_lot.php @@ -1,6 +1,6 @@ - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -280,7 +280,7 @@ if (getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) { } print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; print "\n"; @@ -382,7 +382,7 @@ if (getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) { } print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; print "\n"; @@ -511,7 +511,7 @@ foreach ($dirmodels as $reldir) { print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; // Preview diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 323a650bbbb..deff2ccba3b 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -20,7 +20,7 @@ * Copyright (C) 2019-2020 Thibault FOUCART * Copyright (C) 2020 Pierre Ardoin * Copyright (C) 2022 Vincent de Grandpré - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -1513,7 +1513,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio $inherited_mask_lot = getDolGlobalString('LOT_ADVANCED_MASK'); $inherited_mask_sn = getDolGlobalString('SN_ADVANCED_MASK'); print ''; - print $form->textwithpicto('', $tooltip, 1, 1); + print $form->textwithpicto('', $tooltip, 1, 'help'); print '