diff --git a/dev/tools/phan/baseline.txt b/dev/tools/phan/baseline.txt index aceda22aa52f1..b180a5d9434e7 100644 --- a/dev/tools/phan/baseline.txt +++ b/dev/tools/phan/baseline.txt @@ -9,11 +9,11 @@ */ return [ // # Issue statistics: - // PhanUndeclaredProperty : 770+ occurrences - // PhanPluginUnknownPropertyType : 710+ occurrences - // PhanPossiblyUndeclaredGlobalVariable : 600+ occurrences + // PhanUndeclaredProperty : 640+ occurrences + // PhanPluginUnknownPropertyType : 630+ occurrences + // PhanPossiblyUndeclaredGlobalVariable : 580+ occurrences // PhanTypeMismatchArgumentProbablyReal : 400+ occurrences - // PhanUndeclaredGlobalVariable : 380+ occurrences + // PhanUndeclaredGlobalVariable : 350+ occurrences // PhanPluginUnknownArrayMethodReturnType : 300+ occurrences // PhanPluginUnknownArrayMethodParamType : 250+ occurrences // PhanPossiblyUndeclaredVariable : 200+ occurrences @@ -29,22 +29,22 @@ return [ // PhanTypeInvalidDimOffset : 35+ occurrences // PhanTypeMismatchDimFetch : 30+ occurrences // PhanPluginUnknownObjectMethodCall : 15+ occurrences - // PhanTypeComparisonFromArray : 15+ occurrences // PhanUndeclaredConstant : 15+ occurrences // PhanUndeclaredMethod : 15+ occurrences // PhanEmptyForeach : 10+ occurrences // PhanPluginConstantVariableNull : 10+ occurrences // PhanPossiblyNullTypeMismatchProperty : 10+ occurrences // PhanTypeArraySuspiciousNull : 10+ occurrences + // PhanTypeComparisonFromArray : 10+ occurrences // PhanTypeMismatchDimFetchNullable : 10+ occurrences // PhanPluginBothLiteralsBinaryOp : 8 occurrences // PhanPluginSuspiciousParamPosition : 8 occurrences // PhanPluginDuplicateExpressionBinaryOp : 7 occurrences // PhanParamTooMany : 5 occurrences // PhanPluginDuplicateArrayKey : 4 occurrences - // PhanTypeExpectedObjectPropAccessButGotNull : 4 occurrences // PhanEmptyFQSENInClasslike : 3 occurrences // PhanInvalidFQSENInClasslike : 3 occurrences + // PhanTypeExpectedObjectPropAccessButGotNull : 3 occurrences // PhanAccessMethodProtected : 1 occurrence // PhanTypeConversionFromArray : 1 occurrence @@ -293,7 +293,7 @@ return [ 'htdocs/core/class/html.formldap.class.php' => ['PhanPluginUnknownArrayMethodParamType'], 'htdocs/core/class/html.formmail.class.php' => ['PhanUndeclaredProperty'], 'htdocs/core/class/html.formmargin.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanUndeclaredProperty'], - 'htdocs/core/class/html.formprojet.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownPropertyType', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/core/class/html.formprojet.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownPropertyType'], 'htdocs/core/class/html.formsetup.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayPropertyType'], 'htdocs/core/class/html.formwebsite.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownPropertyType'], 'htdocs/core/class/ldap.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownArrayPropertyType', 'PhanPossiblyUndeclaredVariable'], @@ -430,14 +430,12 @@ return [ 'htdocs/core/tpl/filemanager.tpl.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeExpectedObjectPropAccess', 'PhanUndeclaredGlobalVariable'], 'htdocs/core/tpl/formlayoutai.tpl.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanUndeclaredGlobalVariable'], 'htdocs/core/tpl/list_print_total.tpl.php' => ['PhanPluginUndeclaredVariableIsset'], - 'htdocs/core/tpl/login.tpl.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], 'htdocs/core/tpl/massactions_pre.tpl.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/core/tpl/notes.tpl.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], 'htdocs/core/tpl/object_discounts.tpl.php' => ['PhanTypeMismatchArgumentNullableInternal', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/core/tpl/objectline_create.tpl.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], - 'htdocs/core/tpl/objectline_edit.tpl.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/core/tpl/objectline_title.tpl.php' => ['PhanUndeclaredProperty'], - 'htdocs/core/tpl/objectline_view.tpl.php' => ['PhanTypeExpectedObjectPropAccessButGotNull', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], + 'htdocs/core/tpl/objectline_view.tpl.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/core/tpl/onlinepaymentlinks.tpl.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/core/tpl/passwordforgotten.tpl.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/core/tpl/passwordreset.tpl.php' => ['PhanUndeclaredGlobalVariable'], @@ -445,7 +443,7 @@ return [ 'htdocs/core/tpl/resource_view.tpl.php' => ['PhanUndeclaredProperty'], 'htdocs/core/triggers/dolibarrtriggers.class.php' => ['PhanPluginUnknownArrayPropertyType'], 'htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php' => ['PhanPossiblyUndeclaredVariable', 'PhanUndeclaredProperty'], - 'htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php' => ['PhanTypeComparisonFromArray', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], + 'htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php' => ['PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], 'htdocs/core/triggers/interface_50_modMailmanspip_Mailmanspipsynchro.class.php' => ['PhanUndeclaredProperty'], 'htdocs/core/triggers/interface_50_modNotification_Notification.class.php' => ['PhanPluginUnknownArrayMethodReturnType'], 'htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeExpectedObjectPropAccess'], @@ -781,24 +779,20 @@ return [ 'htdocs/salaries/paiement_salary.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], 'htdocs/salaries/virement_request.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], 'htdocs/societe/admin/societe.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredMethod'], - 'htdocs/societe/ajax/ajaxcompanies.php' => ['PhanUndeclaredProperty'], 'htdocs/societe/ajax/company.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], 'htdocs/societe/checkvat/checkVatPopup.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/societe/class/api_contacts.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty'], 'htdocs/societe/class/api_thirdparties.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], 'htdocs/societe/class/client.class.php' => ['PhanPluginUnknownArrayPropertyType'], - 'htdocs/societe/class/companybankaccount.class.php' => ['PhanPluginUnknownPropertyType'], - 'htdocs/societe/class/companypaymentmode.class.php' => ['PhanPluginUnknownPropertyType'], 'htdocs/societe/class/societeaccount.class.php' => ['PhanPluginUnknownPropertyType'], 'htdocs/societe/consumption.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/societe/list.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/societe/paymentmodes.php' => ['PhanPossiblyNullTypeMismatchProperty', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeExpectedObjectPropAccess', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanUndeclaredGlobalVariable'], + 'htdocs/societe/paymentmodes.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeExpectedObjectPropAccess', 'PhanUndeclaredGlobalVariable'], 'htdocs/societe/price.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/societe/tpl/linesalesrepresentative.tpl.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/societe/website.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/stripe/ajax/ajax.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/stripe/class/actions_stripe.class.php' => ['PhanPluginBothLiteralsBinaryOp', 'PhanPluginSuspiciousParamPosition', 'PhanPluginUnknownArrayMethodParamType', 'PhanUndeclaredProperty'], - 'htdocs/stripe/class/stripe.class.php' => ['PhanPluginConstantVariableNull', 'PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredVariable', 'PhanTypeExpectedObjectPropAccess', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], + 'htdocs/stripe/class/actions_stripe.class.php' => ['PhanPluginBothLiteralsBinaryOp', 'PhanPluginSuspiciousParamPosition'], + 'htdocs/stripe/class/stripe.class.php' => ['PhanPluginConstantVariableNull', 'PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredVariable', 'PhanTypeExpectedObjectPropAccess', 'PhanTypeMismatchProperty'], 'htdocs/supplier_proposal/card.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/supplier_proposal/class/api_supplier_proposals.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanUndeclaredProperty'], 'htdocs/supplier_proposal/class/supplier_proposal.class.php' => ['PhanUndeclaredProperty'], diff --git a/dev/tools/phan/config_extended.php b/dev/tools/phan/config_extended.php index 521c0347d7348..70087113db3fb 100644 --- a/dev/tools/phan/config_extended.php +++ b/dev/tools/phan/config_extended.php @@ -97,6 +97,7 @@ 'PhanPluginUnknownArrayMethodParamType', // this option costs more time to be supported than it solves time 'PhanPluginUnknownArrayMethodReturnType', // this option costs more time to be supported than it solves time + 'PhanTypeSuspiciousNonTraversableForeach', // Reports on `foreach ($object as $key => $value)` which works without php notices, so we ignore it because this is intentional in the code. ]; return $config; diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 8e5ed262fe419..256f89219cdf2 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -3179,6 +3179,7 @@ public function sendReminderForExpiredSubscription($daysbeforeendlist = '10') $actioncomm->errors_to = ''; $actioncomm->fk_element = $adherent->id; + $actioncomm->elementid = $adherent->id; $actioncomm->elementtype = $adherent->element; $actioncomm->extraparams = $extraparams; diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 7fb4704f38261..989a42524c384 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -1,7 +1,7 @@ * Copyright (C) 2003 Jean-Louis Bergamo - * Copyright (C) 2004-2017 Laurent Destailleur + * Copyright (C) 2004-2024 Laurent Destailleur * Copyright (C) 2004 Eric Seigne * Copyright (C) 2005-2017 Regis Houssin * Copyright (C) 2011-2023 Juanjo Menent @@ -229,13 +229,68 @@ } } + dol_syslog("Uncompress of module file is a success."); + + // Load module into $objMod + /* + $modulesdir = array($modulenamedir.'/core/modules/'); + foreach ($modulesdir as $dir) { + // Load modules attributes in arrays (name, numero, orders) from dir directory + //print $dir."\n
"; + dol_syslog("Scan directory ".$dir." for module descriptor files (modXXX.class.php)"); + $handle = @opendir($dir); + if (is_resource($handle)) { + while (($file = readdir($handle)) !== false) { + print $dir." ".$file."\n
"; + if (is_readable($dir.$file) && substr($file, 0, 3) == 'mod' && substr($file, dol_strlen($file) - 10) == '.class.php') { + $modName = substr($file, 0, dol_strlen($file) - 10); + if ($modName) { + try { + $res = include_once $dir.$file; // A class already exists in a different file will send a non catchable fatal error. + $modName = substr($file, 0, dol_strlen($file) - 10); + if ($modName) { + if (class_exists($modName)) { + $objMod = new $modName($db); + '@phan-var-force DolibarrModules $objMod'; + + //var_dump($objMod); + } + } + } catch(Exception $e) { + // Nothing done + } + } + } + } + } + } + */ + + // Check if module is in the remote malware list if (!$error) { - // TODO Make more test + if (GETPOST('checkforcompliance') == 'on') { + try { + $res = include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; + $dolibarrmodule = new DolibarrModules($db); + $checkRes = $dolibarrmodule->checkForcompliance($modulename); + + if (!is_numeric($checkRes) && $checkRes != '') { + $langs->load("errors"); + setEventMessages($modulename.' : '.$langs->trans($checkRes), null, 'errors'); + } + + $error++; + } catch (Exception $e) { + // Nothing done + } + } } - dol_syslog("Uncompress of module file is a success."); + if (!$error) { + // TODO Make more test ??? + } - // We check if this is a metapackage + // We check if this is a metapackage (and wecomplete with child packages) $modulenamearrays = array(); if (dol_is_file($modulenamedir.'/metapackage.conf')) { // This is a meta package @@ -245,32 +300,34 @@ $modulenamearrays[$modulename] = $modulename; //var_dump($modulenamearrays);exit; - // Lop on each package of the metapackage - foreach ($modulenamearrays as $modulenameval) { - if (strpos($modulenameval, '#') === 0) { - continue; // Discard comments - } - if (strpos($modulenameval, '//') === 0) { - continue; // Discard comments - } - if (!trim($modulenameval)) { - continue; - } - - // Now we install the module - if (!$error) { - @dol_delete_dir_recursive($dirins.'/'.$modulenameval); // delete the target directory - $submodulenamedir = $conf->admin->dir_temp.'/'.$tmpdir.'/'.$modulenameval; - if (!dol_is_dir($submodulenamedir)) { - $submodulenamedir = $conf->admin->dir_temp.'/'.$tmpdir.'/htdocs/'.$modulenameval; + // Lop on each packages (can have several if package is a metapackage) + if (! $error) { + foreach ($modulenamearrays as $modulenameval) { + if (strpos($modulenameval, '#') === 0) { + continue; // Discard comments } - dol_syslog("We copy now directory ".$submodulenamedir." into target dir ".$dirins.'/'.$modulenameval); - $result = dolCopyDir($submodulenamedir, $dirins.'/'.$modulenameval, '0444', 1); - if ($result <= 0) { - dol_syslog('Failed to call dolCopyDir result='.$result." with param ".$submodulenamedir." and ".$dirins.'/'.$modulenameval, LOG_WARNING); - $langs->load("errors"); - setEventMessages($langs->trans("ErrorFailToCopyDir", $submodulenamedir, $dirins.'/'.$modulenameval), null, 'errors'); - $error++; + if (strpos($modulenameval, '//') === 0) { + continue; // Discard comments + } + if (!trim($modulenameval)) { + continue; + } + + // Now we install the module + if (!$error) { + @dol_delete_dir_recursive($dirins.'/'.$modulenameval); // delete the target directory + $submodulenamedir = $conf->admin->dir_temp.'/'.$tmpdir.'/'.$modulenameval; + if (!dol_is_dir($submodulenamedir)) { + $submodulenamedir = $conf->admin->dir_temp.'/'.$tmpdir.'/htdocs/'.$modulenameval; + } + dol_syslog("We copy now directory ".$submodulenamedir." into target dir ".$dirins.'/'.$modulenameval); + $result = dolCopyDir($submodulenamedir, $dirins.'/'.$modulenameval, '0444', 1); + if ($result <= 0) { + dol_syslog('Failed to call dolCopyDir result='.$result." with param ".$submodulenamedir." and ".$dirins.'/'.$modulenameval, LOG_WARNING); + $langs->load("errors"); + setEventMessages($langs->trans("ErrorFailToCopyDir", $submodulenamedir, $dirins.'/'.$modulenameval), null, 'errors'); + $error++; + } } } } @@ -294,8 +351,6 @@ $message = $langs->trans("SetupIsReadyForUse", $redirectUrl, $langs->transnoentitiesnoconv("Home").' - '.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("Modules")); setEventMessages($message, null, 'warnings'); - header('Location: ' . $redirectUrl); - exit; } } elseif ($action == 'install' && !$allowonlineinstall) { httponly_accessforbidden("You try to bypass the protection to disallow deployment of an external module. Hack attempt ?"); @@ -654,7 +709,7 @@ $moreforfilter = '
'; $moreforfilter .= '
'; } - //Select mail models is same action as presend + // Select mail models is same action as presend if (GETPOST('modelselected')) { $action = 'presend'; } diff --git a/htdocs/salaries/class/paymentsalary.class.php b/htdocs/salaries/class/paymentsalary.class.php index 6426937056089..2f15018a85c6b 100644 --- a/htdocs/salaries/class/paymentsalary.class.php +++ b/htdocs/salaries/class/paymentsalary.class.php @@ -1,8 +1,8 @@ - * Copyright (C) 2014 Juanjo Menent - * Copyright (C) 2021 Gauthier VERDOL - * Copyright (C) 2024 Frédéric France +/* Copyright (C) 2011-2024 Alexandre Spangaro + * Copyright (C) 2014 Juanjo Menent + * Copyright (C) 2021 Gauthier VERDOL + * Copyright (C) 2024 Frédéric France * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify @@ -366,6 +366,7 @@ public function fetch($id) $this->datec = $this->db->jdate($obj->datec); $this->tms = $this->db->jdate($obj->tms); $this->datepaye = $this->db->jdate($obj->datep); + $this->datep = $this->db->jdate($obj->datep); $this->amount = $obj->amount; $this->fk_typepayment = $obj->fk_typepayment; $this->num_paiement = $obj->num_payment; diff --git a/htdocs/salaries/payment_salary/card.php b/htdocs/salaries/payment_salary/card.php index 95696e6ef7d6b..c20466fcb7053 100644 --- a/htdocs/salaries/payment_salary/card.php +++ b/htdocs/salaries/payment_salary/card.php @@ -1,12 +1,12 @@ - * Copyright (C) 2004-2014 Laurent Destailleur - * Copyright (C) 2005 Marc Barilley / Ocebo - * Copyright (C) 2005-2009 Regis Houssin - * Copyright (C) 2021 Gauthier VERDOL - * Copyright (C) 2024 MDW - * Copyright (C) 2024 Alexandre SPANGARO - * Copyright (C) 2024 Frédéric France +/* Copyright (C) 2004 Rodolphe Quiedeville + * Copyright (C) 2004-2014 Laurent Destailleur + * Copyright (C) 2005 Marc Barilley / Ocebo + * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2021 Gauthier VERDOL + * Copyright (C) 2024 MDW + * Copyright (C) 2024 Alexandre SPANGARO + * Copyright (C) 2024 Frédéric France * * 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 diff --git a/htdocs/salaries/virement_request.php b/htdocs/salaries/virement_request.php index a2733f878b49d..e3c85b76ca421 100644 --- a/htdocs/salaries/virement_request.php +++ b/htdocs/salaries/virement_request.php @@ -1,9 +1,10 @@ - * Copyright (C) 2015 Charlie BENKE - * Copyright (C) 2017-2019 Alexandre Spangaro +/* Copyright (C) 2005-2015 Laurent Destailleur + * Copyright (C) 2015 Charlie BENKE + * Copyright (C) 2017-2019 Alexandre Spangaro * Copyright (C) 2021 Gauthier VERDOL - * Copyright (C) 2024 MDW + * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France * * 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 diff --git a/htdocs/societe/class/companybankaccount.class.php b/htdocs/societe/class/companybankaccount.class.php index 006eaad69c0f3..acca367fb615a 100644 --- a/htdocs/societe/class/companybankaccount.class.php +++ b/htdocs/societe/class/companybankaccount.class.php @@ -166,13 +166,34 @@ class CompanyBankAccount extends Account * @var string label */ public $label; + /** + * @var string + */ public $code_banque; + /** + * @var string + */ public $code_guichet; + /** + * @var string + */ public $number; + /** + * @var string + */ public $cle_rib; + /** + * @var string + */ public $bic; + /** + * @var string + */ public $iban_prefix; + /** + * @var string + */ public $bank; /** @@ -185,6 +206,9 @@ class CompanyBankAccount extends Account */ public $fk_country; + /** + * @var string + */ public $country_code; /** @@ -213,22 +237,58 @@ class CompanyBankAccount extends Account * @var string */ public $frstrecur; + /** + * @var string + */ public $import_key; + /** + * @var string + */ public $last_four; + /** + * @var string + */ public $card_type; + /** + * @var string + */ public $cvn; + /** + * @var int + */ public $exp_date_month; + /** + * @var int + */ public $exp_date_year; + /** + * @var int + */ public $approved; /** * @var string email */ public $email; + /** + * @var int|string + */ public $ending_date; + /** + * @var float + */ public $max_total_amount_of_all_payments; + /** + * @var string + */ public $preapproval_key; + /** + * @var int|string + */ public $starting_date; + /** + * @var float + */ public $total_amount_of_all_payments; @@ -302,7 +362,7 @@ public function __construct(DoliDB $db) /** * Create bank information record. * - * @param $user User + * @param ?User $user User * @param int<0,1> $notrigger 1=Disable triggers * @return int Return integer <0 if KO, > 0 if OK (ID of newly created company bank account information) */ diff --git a/htdocs/societe/class/companypaymentmode.class.php b/htdocs/societe/class/companypaymentmode.class.php index f8ac46a6598aa..86d39b2d4a9f4 100644 --- a/htdocs/societe/class/companypaymentmode.class.php +++ b/htdocs/societe/class/companypaymentmode.class.php @@ -131,46 +131,129 @@ class CompanyPaymentMode extends CommonObject */ public $label; + /** + * @var ?string + */ public $bank; + /** + * @var string + */ public $code_banque; + /** + * @var string + */ public $code_guichet; + /** + * @var string + */ public $number; + /** + * @var string + */ public $cle_rib; + /** + * @var string + */ public $bic; /** * @var string iban - * @deprecated + * @deprecated Use $iban_prefix * @see $iban_prefix */ public $iban; /** - * iban_prefix - * @var string + * @var string IBAN prefix */ public $iban_prefix; + /** + * @var string + */ public $domiciliation; + /** + * @var string + */ public $proprio; + /** + * @var string + */ public $owner_address; + /** + * @var int + */ public $default_rib; + /** + * @var string + */ public $rum; + /** + * @var int + */ public $date_rum; + /** + * @var string + */ public $frstrecur; + /** + * @var string + */ public $type; + /** + * @var string + */ public $last_four; + /** + * @var string + */ public $card_type; + /** + * @var ?string + */ public $cvn; + /** + * @var int + */ public $exp_date_month; + /** + * @var int + */ public $exp_date_year; + /** + * @var string + */ public $country_code; + /** + * @var int + */ public $approved; + /** + * @var string + */ public $email; + /** + * @var float + */ public $max_total_amount_of_all_payments; + /** + * @var string + */ public $preapproval_key; + /** + * @var float + */ public $total_amount_of_all_payments; + /** + * @var string + */ public $stripe_card_ref; // External system payment mode ID + /** + * @var string + */ public $stripe_account; // External system customer ID + /** + * @var string + */ public $ext_payment_site; // External system 'StripeLive', 'StripeTest', 'StancerLive', 'StancerTest', ... /** @@ -178,16 +261,25 @@ class CompanyPaymentMode extends CommonObject */ public $status; + /** + * @var int + */ public $starting_date; + /** + * @var int + */ public $ending_date; /** * Date creation record (datec) * - * @var integer + * @var int */ public $datec; + /** + * @var string + */ public $import_key; // END MODULEBUILDER PROPERTIES @@ -348,11 +440,11 @@ public function delete(User $user, $notrigger = 0) /** * Return a link to the object card (with optionally the picto) * - * @param int $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto) - * @param string $option On what the link point to ('nolink', ...) - * @param int $notooltip 1=Disable tooltip - * @param string $morecss Add more css on link - * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking + * @param int<0,2> $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto) + * @param string $option On what the link point to ('nolink', ...) + * @param int<0,1> $notooltip 1=Disable tooltip + * @param string $morecss Add more css on link + * @param int<-1,1> $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking * @return string String with URL */ public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss = '', $save_lastsearch_value = -1) @@ -417,9 +509,9 @@ public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss /** * Set a Payment mode as Default * - * @param int $id Payment mode ID - * @param int $alltypes 1=The default is for all payment types instead of per type - * @return int 0 if KO, 1 if OK + * @param int $id Payment mode ID + * @param int<0,1> $alltypes 1=The default is for all payment types instead of per type + * @return int 0 if KO, 1 if OK */ public function setAsDefault($id = 0, $alltypes = 0) { @@ -475,8 +567,8 @@ public function setAsDefault($id = 0, $alltypes = 0) /** * Return label of the status * - * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto - * @return string Label of status + * @param int<0,6> $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto + * @return string Label of status */ public function getLibStatut($mode = 0) { @@ -487,8 +579,8 @@ public function getLibStatut($mode = 0) /** * Return the status * - * @param int $status Id status - * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto + * @param int $status Id status + * @param int<0,6> $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto * @return string Label of status */ public function LibStatut($status, $mode = 0) diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 219cbdc01764b..9a298fcc8e102 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -1931,6 +1931,7 @@ $userstatic->user_mobile = $val['user_mobile']; $userstatic->job = $val['job']; $userstatic->gender = $val['gender']; + $userstatic->statut = $val['statut']; print ($nbofsalesrepresentative < 2) ? $userstatic->getNomUrl(-1, '', 0, 0, 12) : $userstatic->getNomUrl(-2); $j++; if ($j < $nbofsalesrepresentative) { diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php index 4ab780cfabfd3..dfecc621994c9 100644 --- a/htdocs/societe/paymentmodes.php +++ b/htdocs/societe/paymentmodes.php @@ -94,10 +94,12 @@ $stripeacc = null; // Stripe Account $stripecu = null; // Remote stripe customer +$servicestatus = 0; +$site_account = 'UnknownSiteAccount'; + // Init Stripe objects if (isModEnabled('stripe')) { $service = 'StripeTest'; - $servicestatus = 0; if (getDolGlobalString('STRIPE_LIVE') && !GETPOST('forcesandbox', 'alpha')) { $service = 'StripeLive'; $servicestatus = 1; @@ -168,7 +170,8 @@ } if (!$error) { - $companybankaccount->oldcopy = dol_clone($companybankaccount, 2); + $cbClassName = get_class($companybankaccount); + $cbClassName::$oldcopy = dol_clone($companybankaccount, 2); $companybankaccount->socid = $object->id; @@ -246,7 +249,8 @@ $companypaymentmode->fetch($id); if (!$error) { - $companybankaccount->oldcopy = dol_clone($companybankaccount, 2); + $cbClassName = get_class($companybankaccount); + $cbClassName::$oldcopy = dol_clone($companybankaccount, 2); $companypaymentmode->fk_soc = $object->id; @@ -905,7 +909,7 @@ // @phan-suppress-next-line PhanPluginSuspiciousParamPosition $companybankaccount->fetch(0, '', $object->id); // @phan-suppress-next-line PhanPluginSuspiciousParamPosition - $companypaymentmode->fetch(0, null, $object->id, 'card'); + $companypaymentmode->fetch(0, '', $object->id, 'card'); } else { $companybankaccount->fetch($id); $companypaymentmode->fetch($id); @@ -1142,6 +1146,7 @@ // Get list of remote payment modes $listofsources = array(); + $customerstripe = null; if (isset($stripe) && is_object($stripe)) { try { $customerstripe = $stripe->customerStripe($object, $stripeacc, $servicestatus); @@ -1631,14 +1636,14 @@ // } elseif ($val == 'IBAN') { // $string .= $rib->iban.' ';*/ //} - } - if (!empty($rib->label) && $rib->number) { - if (!checkBanForAccount($rib)) { - $string .= ' '.img_picto($langs->trans("ValueIsNotValid"), 'warning'); - } else { - $string .= ' '.img_picto($langs->trans("ValueIsValid"), 'info'); + if (!empty($rib->label) && $rib->number) { + if (!checkBanForAccount($rib)) { + $string .= ' '.img_picto($langs->trans("ValueIsNotValid"), 'warning'); + } else { + $string .= ' '.img_picto($langs->trans("ValueIsValid"), 'info'); + } } - } + } // EndFor $rib_list as $rib print ''; print $string; print ''; @@ -1721,7 +1726,7 @@ if ($conf->browser->layout == 'phone') { $morecss = 'maxwidth100'; } - $out .= $formadmin->select_language($defaultlang, 'lang_idrib'.$rib->id, 0, 0, 0, 0, 0, $morecss); + $out .= $formadmin->select_language($defaultlang, 'lang_idrib'.$rib->id, 0, array(), 0, 0, 0, $morecss); } // Button $out .= 'fetch(0, null, $object->id, 'ban'); + $result = $companypaymentmodetemp->fetch(0, '', $object->id, 'ban'); include_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmfiles.class.php'; $ecmfile = new EcmFiles($db); @@ -1991,6 +1996,9 @@ foreach ($bankaccount->getFieldsToShow(1) as $val) { $require = false; $tooltip = ''; + $name = 'Unset'; + $size = 8; + $content = 'NoContent'; if ($val == 'BankCode') { $name = 'code_banque'; $size = 8; @@ -2028,6 +2036,7 @@ print ''; print ''; if ($tooltip) { + // $tooltip looks like $tooltiptrigger so: @phan-suppress-next-line PhanPluginSuspiciousParamOrder print $form->textwithpicto($langs->trans($val), $tooltip, 4, 'help', '', 0, 3, $name); } else { print $langs->trans($val); @@ -2163,6 +2172,9 @@ foreach ($companybankaccount->getFieldsToShow(1) as $val) { $require = false; $tooltip = ''; + $size = 8; + $name = 'Unknown'; + $content = 'NoContent'; if ($val == 'BankCode') { $name = 'code_banque'; $size = 8; @@ -2199,6 +2211,7 @@ print ''; if ($tooltip) { + // tooltip lookslike tooltip trigger so @phan-suppress-next-line PhanPluginSuspiciousParamOrder print $form->textwithpicto($langs->trans($val), $tooltip, 4, 'help', '', 0, 3, $name); } else { print $langs->trans($val); diff --git a/htdocs/stripe/ajax/ajax.php b/htdocs/stripe/ajax/ajax.php index e7b9da70a3a77..dadc639f0d9eb 100644 --- a/htdocs/stripe/ajax/ajax.php +++ b/htdocs/stripe/ajax/ajax.php @@ -110,7 +110,7 @@ $stripe = new Stripe($db); $customer = $stripe->customerStripe($object->thirdparty, $stripeacc, $servicestatus, 1); - $intent = $stripe->getPaymentIntent($json_obj->amount, $object->multicurrency_code, null, 'Stripe payment: '.$fulltag.(is_object($object) ? ' ref='.$object->ref : ''), $object, $customer, $stripeacc, $servicestatus, 1, 'terminal', false, null, 0, 1); + $intent = $stripe->getPaymentIntent($json_obj->amount, $object->multicurrency_code, '', 'Stripe payment: '.$fulltag.(is_object($object) ? ' ref='.$object->ref : ''), $object, $customer, $stripeacc, $servicestatus, 1, 'terminal', false, null, 0, 1); echo json_encode(array('client_secret' => $intent->client_secret)); } catch (Error $e) { diff --git a/htdocs/stripe/class/actions_stripe.class.php b/htdocs/stripe/class/actions_stripe.class.php index 2f833af13361b..7dbf68d7fb9e7 100644 --- a/htdocs/stripe/class/actions_stripe.class.php +++ b/htdocs/stripe/class/actions_stripe.class.php @@ -59,10 +59,10 @@ public function __construct($db) /** * formObjectOptions * - * @param array $parameters Parameters - * @param CommonObject $object Object - * @param string $action Action - * @return int + * @param array $parameters Parameters + * @param CommonObject $object Object + * @param string $action Action + * @return int */ public function formObjectOptions($parameters, &$object, &$action) { @@ -82,6 +82,7 @@ public function formObjectOptions($parameters, &$object, &$action) } if (is_object($object) && $object->element == 'societe') { + '@phan-var-force Societe $object'; $this->resprints .= ''; $this->resprints .= ''; } elseif ($object instanceof CommonObject && $object->element == 'member') { + '@phan-var-force Adherent $object'; $this->resprints .= '
'; $this->resprints .= $langs->trans('StripeCustomer'); @@ -99,6 +100,7 @@ public function formObjectOptions($parameters, &$object, &$action) } $this->resprints .= '
'; $this->resprints .= ''; } elseif ($object instanceof CommonObject && $object->element == 'adherent_type') { + '@phan-var-force Adherent $object'; $this->resprints .= '
'; $this->resprints .= $langs->trans('StripeCustomer'); @@ -133,6 +135,7 @@ public function formObjectOptions($parameters, &$object, &$action) } $this->resprints .= '
'; $this->resprints .= '
'; $this->resprints .= $langs->trans('PlanStripe'); @@ -157,9 +160,9 @@ public function formObjectOptions($parameters, &$object, &$action) /** * addMoreActionsButtons * - * @param array $parameters Parameters - * @param Object $object Object - * @param string $action action + * @param array $parameters Parameters + * @param Object $object Object + * @param string $action action * @return int 0 */ public function addMoreActionsButtons($parameters, &$object, &$action) diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index 89fa5273b8880..c828c929bc777 100644 --- a/htdocs/stripe/class/stripe.class.php +++ b/htdocs/stripe/class/stripe.class.php @@ -170,13 +170,13 @@ public function getStripeCustomerAccount($id, $status = 0, $site_account = '') * Get the Stripe customer of a thirdparty (with option to create it in Stripe if not linked yet). * Search on site_account = 0 or = $stripearrayofkeysbyenv[$status]['publishable_key'] * - * @param CommonObject $object Object thirdparty to check, or create on stripe (create on stripe also update the stripe_account table for current entity). Used for AdherentType and Societe. - * @param string $key ''=Use common API. If not '', it is the Stripe connect account 'acc_....' to use Stripe connect - * @param int $status Status (0=test, 1=live) - * @param int $createifnotlinkedtostripe 1=Create the stripe customer and the link if the thirdparty is not yet linked to a stripe customer + * @param Societe|Adherent $object Object thirdparty to check, or create on stripe (create on stripe also update the stripe_account table for current entity). Used for AdherentType and Societe. + * @param string $key ''=Use common API. If not '', it is the Stripe connect account 'acc_....' to use Stripe connect + * @param int<0,1> $status Status (0=test, 1=live) + * @param int<0,1> $createifnotlinkedtostripe 1=Create the stripe customer and the link if the thirdparty is not yet linked to a stripe customer * @return \Stripe\Customer|null Stripe Customer or null if not found */ - public function customerStripe(CommonObject $object, $key = '', $status = 0, $createifnotlinkedtostripe = 0) + public function customerStripe($object, $key = '', $status = 0, $createifnotlinkedtostripe = 0) { global $conf, $user; @@ -1362,7 +1362,7 @@ public function createPaymentStripe($amount, $currency, $origin, $item, $source, $charge = \Stripe\Charge::create($paymentarray, array("idempotency_key" => "$description", "stripe_account" => "$account")); } } - '@phan-var-force stdclass|\Stripe\Charge $charge'; + '@phan-var-force stdClass|\Stripe\Charge $charge'; if (isset($charge->id)) { } @@ -1377,7 +1377,7 @@ public function createPaymentStripe($amount, $currency, $origin, $item, $source, } elseif ($charge->source->type == 'three_d_secure') { $stripe = new Stripe($this->db); $src = \Stripe\Source::retrieve("".$charge->source->three_d_secure->card, array( - "stripe_account" => $stripe->getStripeAccount($service) + "stripe_account" => $stripe->getStripeAccount($service) )); $return->message = $src->card->brand." ....".$src->card->last4; } else { diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index 55828d2594e8e..3af0a18669e13 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -598,7 +598,7 @@ function CloseBill() { if (!empty($conf->global->TAKEPOS_FORBID_SALES_TO_DEFAULT_CUSTOMER)) { echo "customerAnchorTag = document.querySelector('a[id=\"customer\"]'); "; echo "if (customerAnchorTag && customerAnchorTag.innerText.trim() === '".$langs->trans("Customer")."') { "; - echo "alert('".$langs->trans("NoClientErrorMessage")."'); "; + echo "alert('".dol_escape_js($langs->trans("NoClientErrorMessage"))."'); "; echo "return; } \n"; } ?> diff --git a/htdocs/ticket/class/ticketstats.class.php b/htdocs/ticket/class/ticketstats.class.php index a491775376ec8..3ec67e15f238b 100644 --- a/htdocs/ticket/class/ticketstats.class.php +++ b/htdocs/ticket/class/ticketstats.class.php @@ -1,6 +1,7 @@ - * Copyright (C) 2024 MDW +/* Copyright (C) 2016 Jean-François Ferry + * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France * * 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 @@ -35,12 +36,15 @@ class TicketStats extends Stats */ public $table_element; + /** + * @var int thirdparty ID + */ public $socid; - public $userid; - public $from; - public $field; - public $where; + /** + * @var int User ID + */ + public $userid; /** * Constructor @@ -106,7 +110,7 @@ public function getNbByMonth($year, $format = 0) $sql .= $this->db->order('dm', 'DESC'); $res = $this->_getNbByMonth($year, $sql, $format); - //var_dump($res);print '
'; + return $res; } @@ -127,7 +131,7 @@ public function getAmountByMonth($year, $format = 0) $sql .= $this->db->order('dm', 'DESC'); $res = $this->_getAmountByMonth($year, $sql, $format); - //var_dump($res);print '
'; + return $res; } diff --git a/htdocs/user/passwordforgotten.php b/htdocs/user/passwordforgotten.php index 6ebf7baafcc85..646886f579d15 100644 --- a/htdocs/user/passwordforgotten.php +++ b/htdocs/user/passwordforgotten.php @@ -1,9 +1,9 @@ - * Copyright (C) 2008-2012 Regis Houssin - * Copyright (C) 2008-2011 Juanjo Menent - * Copyright (C) 2014 Teddy Andreotti <125155@supinfo.com> - * Copyright (C) 2024 MDW +/* Copyright (C) 2007-2011 Laurent Destailleur + * Copyright (C) 2008-2012 Regis Houssin + * Copyright (C) 2008-2011 Juanjo Menent + * Copyright (C) 2014 Teddy Andreotti <125155@supinfo.com> + * Copyright (C) 2024 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 @@ -186,8 +186,18 @@ $title = getDolGlobalString('MAIN_APPLICATION_TITLE'); } -// Select templates -if (file_exists(DOL_DOCUMENT_ROOT."/theme/".$conf->theme."/tpl/passwordforgotten.tpl.php")) { +// Select templates dir +$template_dir = ''; +if (!empty($conf->modules_parts['tpl'])) { // Using this feature slow down application + $dirtpls = array_merge($conf->modules_parts['tpl'], array('/core/tpl/')); + foreach ($dirtpls as $reldir) { + $tmp = dol_buildpath($reldir.'passwordforgotten.tpl.php'); + if (file_exists($tmp)) { + $template_dir = preg_replace('/passwordforgotten\.tpl\.php$/', '', $tmp); + break; + } + } +} elseif (file_exists(DOL_DOCUMENT_ROOT."/theme/".$conf->theme."/tpl/passwordforgotten.tpl.php")) { $template_dir = DOL_DOCUMENT_ROOT."/theme/".$conf->theme."/tpl/"; } else { $template_dir = DOL_DOCUMENT_ROOT."/core/tpl/"; diff --git a/htdocs/webportal/class/webportalinvoice.class.php b/htdocs/webportal/class/webportalinvoice.class.php index 8cd151e30c48e..955d844494c1c 100644 --- a/htdocs/webportal/class/webportalinvoice.class.php +++ b/htdocs/webportal/class/webportalinvoice.class.php @@ -113,6 +113,9 @@ class WebPortalInvoice extends Facture ); //public $rowid; //public $ref; + /** + * @var int date invoice + */ public $datef; //public $date_lim_reglement; //public $total_ht; diff --git a/htdocs/webportal/class/webportalmember.class.php b/htdocs/webportal/class/webportalmember.class.php index 1926d5579d3f0..922eeddeee5da 100644 --- a/htdocs/webportal/class/webportalmember.class.php +++ b/htdocs/webportal/class/webportalmember.class.php @@ -142,6 +142,9 @@ class WebPortalMember extends Adherent 'status' => array('type' => 'smallint(6)', 'label' => 'Status', 'enabled' => 1, 'visible' => 5, 'notnull' => 1, 'position' => 500, 'arrayofkeyval' => self::ARRAY_STATUS_LABEL, 'showonheader' => 1,), ); + /** + * @var int + */ public $rowid; //public $ref; //public $lastname; @@ -159,6 +162,9 @@ class WebPortalMember extends Adherent //public $url; //public $socialnetworks; //public $login; + /** + * @var int + */ public $fk_adherent_type; //public $morphy; //public $societe; diff --git a/htdocs/zapier/class/hook.class.php b/htdocs/zapier/class/hook.class.php index f4d23edea3c02..e716d4563adf7 100644 --- a/htdocs/zapier/class/hook.class.php +++ b/htdocs/zapier/class/hook.class.php @@ -355,26 +355,10 @@ public function createFromClone(User $user, $fromid) public function fetch($id, $ref = null) { $result = $this->fetchCommon($id, $ref); - if ($result > 0 && !empty($this->table_element_line)) { - //$this->fetchLines(); - } + return $result; } - /** - * Load object lines in memory from the database - * - * @return int Return integer <0 if KO, 0 if not found, >0 if OK - */ - /*public function fetchLines() - { - $this->lines=array(); - - // Load lines with object MyObjectLine - - return count($this->lines)?1:0; - }*/ - /** * Load list of objects in memory from the database. * @@ -385,7 +369,7 @@ public function fetch($id, $ref = null) * @param string $filter Filter as an Universal Search string. * Example: '((client:=:1) OR ((client:>=:2) AND (client:<=:3))) AND (client:!=:8) AND (nom:like:'a%')' * @param string $filtermode No more used - * @return array|int int <0 if KO, array of pages if OK + * @return Hook[]|int int <0 if KO, array of pages if OK */ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, $filter = '', $filtermode = 'AND') { diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 6f87c5244eb63..ed685c31da3f9 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -85,7 +85,6 @@ parameters: - '#(?:convertSecondToTime) expects int, float\|string given#' - '#(?:Comm(?:(?:ande::updateline|on(?:Invoice::getLibStatut|StickerGenerator::(?:Set_Char_Size|_Croix|convertMetric)))\(\))|Facture(?:(?:::update|FournisseurRec::add)line\(\))|(?:Holiday::addLogCP|Loan::getLibStatut|SupplierProposal::updateline)\(\)|c(?:alcul_price_total|onvert(?:DurationtoHour|SecondToTime))|dol_time_plus_duree|pdf_(?:azur::_tableau_(?:(?:info|tot)\(\))|ban(?:::_tableau\(\)|k)|c(?:anelle::_tableau_(?:(?:tot|versements)\(\))|ornas::_tableau_(?:(?:info|tot)\(\))|rabe::_tableau_(?:(?:info|tot|versements)\(\))|yan::draw(?:(?:Info|Total)Table\(\)))|e(?:agle(?:(?:::_tableau_tot|_proforma::drawTotalTable)\(\))|instein::_tableau_(?:(?:info|tot)\(\))|ratosthene::draw(?:(?:Info|Total)Table\(\))|spadon::_tableau_tot\(\))|muscadet::_tableau_(?:(?:info|tot)\(\))|octopus::(?:_table(?:(?:FirstPage|au)\(\))|draw(?:(?:Info|Total)Table\(\)))|page(?:foot|head)|(?:rouget::_tableau_tot|s(?:epamandate::_tableau(?:_info)?|ponge::draw(?:(?:Info|Total)Table)|quille::_tableau_tot|t(?:andard_(?:e(?:(?:valuation|xpensereport)::_tableau|xpensereport::tablePayments)|(?:myobjec|supplierpaymen)t::_tableau|supplierpayment::_tableau_cheque)|orm::_tableau_info|rato::tabSignature))|t(?:cpdflabel::writeBarcode|yphon::_tableau_info)|vinci::_tableau_info)\(\)|w(?:atermark|rite(?:LinkedObjects|linedesc))|zenith::_tableau_tot\(\))|usleep) expects int, float given\.#' - - '#::saveboxorder\(\) expects int, array#' - '#(?:dol_(?:mktime|remove_file_process)|fetchObjectByElement|print_actions_filter) expects int, array\|string given\.#' - '# (CSMSFile) constructor expects int, array\|string given.#' @@ -93,10 +92,8 @@ parameters: - '#(?:(?:Asset::addDepreciationL|Facture(?:(?:(?:Fournisseur)?::add|Fournisseur::update)l))ine\(\)|calcul_price_total|dol_convertToWord|(?:loanCalcMonthlyPaymen|print_paypal_redirec)t) expects float, string given.#' - '#EvalMath::trigger\(\) expects string\|null,#' - '#(?:F(?:acture(?:(?:Fournisseur)?Rec::addline\(\))|ichinterRec::addLineRec\(\))|dolMd2Html|setEventMessages) expects string\|null,#' - - '# (envoi_mail|sendEmailTo) expects string, \(float\|int\) given.#' - '#::printStdColumnContent\(\) expects string, float(\|(int|array)(\<.*\>)?)* given.#' - '#::HTML2OpenIDServer\(\) expects string, array given.#' - - '#create_line\(\) expects string, float given.#' - '# dol_stringtotime expects string, DateTime given.#' - '#expects string, bool\|mysqli_result\|resource given.#' - '#( |::)((multi)?selectarray)\(\) expects array#' @@ -104,7 +101,6 @@ parameters: - '#::(_validateMyObject|select_company)\(\) expects array,) string given\.#' + - '# (Workstation|WorkstationResource|WorkstationUserGroup|Zapier)::.* has no value type specified in iterable type array\.#' internalErrorsCountLimit: 50 cache: diff --git a/scripts/contracts/email_expire_services_to_customers.php b/scripts/contracts/email_expire_services_to_customers.php index 6b7e5e0942149..c9b027c369142 100755 --- a/scripts/contracts/email_expire_services_to_customers.php +++ b/scripts/contracts/email_expire_services_to_customers.php @@ -1,11 +1,11 @@ #!/usr/bin/env php - * Copyright (C) 2005-2013 Laurent Destailleur - * Copyright (C) 2013 Juanjo Menent - * Copyright (C) 2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2005 Rodolphe Quiedeville + * Copyright (C) 2005-2013 Laurent Destailleur + * Copyright (C) 2013 Juanjo Menent + * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 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 @@ -155,7 +155,7 @@ if ($startbreak) { // Break onto sales representative (new email or cid) if (dol_strlen($oldemail) && $oldemail != 'none' && empty($trackthirdpartiessent[$oldsid.'|'.$oldemail])) { - sendEmailTo($mode, $oldemail, $message, $total, $oldlang, $oldtarget, (int) $duration_value); + sendEmailTo($mode, $oldemail, $message, price2num($total), $oldlang, $oldtarget, (int) $duration_value); $trackthirdpartiessent[$oldsid.'|'.$oldemail] = 'contact id '.$oldcid; } else { if ($oldemail != 'none') { @@ -209,7 +209,7 @@ // If there are remaining messages to send in the buffer if ($foundtoprocess) { if (dol_strlen($oldemail) && $oldemail != 'none' && empty($trackthirdpartiessent[$oldsid.'|'.$oldemail])) { // Break onto email (new email) - sendEmailTo($mode, $oldemail, $message, $total, $oldlang, $oldtarget, (int) $duration_value); + sendEmailTo($mode, $oldemail, $message, price2num($total), $oldlang, $oldtarget, (int) $duration_value); $trackthirdpartiessent[$oldsid.'|'.$oldemail] = 'contact id '.$oldcid; } else { if ($oldemail != 'none') { diff --git a/scripts/invoices/email_unpaid_invoices_to_representatives.php b/scripts/invoices/email_unpaid_invoices_to_representatives.php index a5b176c4f7287..ce4347d8ebc5f 100755 --- a/scripts/invoices/email_unpaid_invoices_to_representatives.php +++ b/scripts/invoices/email_unpaid_invoices_to_representatives.php @@ -125,7 +125,7 @@ if (($obj->email != $oldemail || $obj->uid != $olduid) || $oldemail == 'none') { // Break onto sales representative (new email or uid) if (dol_strlen($oldemail) && $oldemail != 'none') { - envoi_mail($mode, $oldemail, $message, $total, $oldlang, $oldsalerepresentative); + envoi_mail($mode, $oldemail, $message, price2num($total), $oldlang, $oldsalerepresentative); } else { if ($oldemail != 'none') { print "- No email sent for ".$oldsalerepresentative.", total: ".$total."\n"; @@ -173,7 +173,7 @@ // If there are remaining messages to send in the buffer if ($foundtoprocess) { if (dol_strlen($oldemail) && $oldemail != 'none') { // Break onto email (new email) - envoi_mail($mode, $oldemail, $message, $total, $oldlang, $oldsalerepresentative); + envoi_mail($mode, $oldemail, $message, price2num($total), $oldlang, $oldsalerepresentative); } else { if ($oldemail != 'none') { print "- No email sent for ".$oldsalerepresentative.", total: ".$total."\n";