Fix phan report

This commit is contained in:
Laurent Destailleur 2024-01-12 22:12:55 +01:00
parent f773fa2dbd
commit a3e354c9b0
8 changed files with 14 additions and 15 deletions

View File

@ -1335,8 +1335,8 @@ class FormTicket
//var_dump($keytoavoidconflict);
if (GETPOST('mode', 'alpha') == 'init' || (GETPOST('modelselected') && GETPOST('modelmailselected', 'alpha') && GETPOST('modelmailselected', 'alpha') != '-1')) {
if (!empty($arraydefaultmessage->joinfiles) && !empty($this->param['fileinit']) && is_array($this->param['fileinit'])) {
foreach ($this->param['fileinit'] as $file) {
$formmail->add_attached_files($file, basename($file), dol_mimetype($file));
foreach ($this->param['fileinit'] as $path) {
$formmail->add_attached_files($path, basename($path), dol_mimetype($path));
}
}
}

View File

@ -819,7 +819,7 @@ class RssParser
* @param string $ent
* @param string|false $base
* @param string $sysID
* @param string[false $pubID
* @param string|false $pubID
* @return bool
function extEntHandler($parser, $ent, $base, $sysID, $pubID) {
print 'extEntHandler ran';

View File

@ -322,7 +322,6 @@ if (!empty($force_install_noedit)) {
}
// Version min of database
$versionbasemin = explode('.', $class::VERSIONMIN);
$note = '('.$class::LABEL.' >= '.$class::VERSIONMIN.')';
// Switch to mysql if mysqli is not present

View File

@ -470,7 +470,7 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen
$thirdparty->email = ($emailcompany ? $emailcompany : $email);
// Load object modCodeTiers
$module = (getDolGlobalString('SOCIETE_CODECLIENT_ADDON') ? $conf->global->SOCIETE_CODECLIENT_ADDON : 'mod_codeclient_leopard');
$module = getDolGlobalString('SOCIETE_CODECLIENT_ADDON', 'mod_codeclient_leopard');
if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') {
$module = substr($module, 0, dol_strlen($module) - 4);
}

View File

@ -260,7 +260,7 @@ if (empty($reshook) && $action == 'add') {
$thirdparty->email = ($emailcompany ? $emailcompany : $email);
// Load object modCodeTiers
$module = (getDolGlobalString('SOCIETE_CODECLIENT_ADDON') ? $conf->global->SOCIETE_CODECLIENT_ADDON : 'mod_codeclient_leopard');
$module = getDolGlobalString('SOCIETE_CODECLIENT_ADDON', 'mod_codeclient_leopard');
if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') {
$module = substr($module, 0, dol_strlen($module) - 4);
}
@ -330,7 +330,7 @@ if (empty($reshook) && $action == 'add') {
$thirdparty->fournisseur = 1;
// Load object modCodeFournisseur
$module = (getDolGlobalString('SOCIETE_CODECLIENT_ADDON') ? $conf->global->SOCIETE_CODECLIENT_ADDON : 'mod_codeclient_leopard');
$module = getDolGlobalString('SOCIETE_CODECLIENT_ADDON', 'mod_codeclient_leopard');
if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') {
$module = substr($module, 0, dol_strlen($module) - 4);
}
@ -341,7 +341,7 @@ if (empty($reshook) && $action == 'add') {
break;
}
}
$modCodeFournisseur = new $module();
$modCodeFournisseur = new $module($db);
if (empty($tmpcode) && !empty($modCodeFournisseur->code_auto)) {
$tmpcode = $modCodeFournisseur->getNextValue($thirdparty, 1);
}

View File

@ -261,7 +261,7 @@ if (empty($reshook) && $action == 'add') {
$thirdparty->email = ($emailcompany ? $emailcompany : $email);
// Load object modCodeTiers
$module = (getDolGlobalString('SOCIETE_CODECLIENT_ADDON') ? $conf->global->SOCIETE_CODECLIENT_ADDON : 'mod_codeclient_leopard');
$module = getDolGlobalString('SOCIETE_CODECLIENT_ADDON', 'mod_codeclient_leopard');
if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') {
$module = substr($module, 0, dol_strlen($module) - 4);
}
@ -330,7 +330,7 @@ if (empty($reshook) && $action == 'add') {
$thirdparty->fournisseur = 1;
// Load object modCodeFournisseur
$module = (getDolGlobalString('SOCIETE_CODECLIENT_ADDON') ? $conf->global->SOCIETE_CODECLIENT_ADDON : 'mod_codeclient_leopard');
$module = getDolGlobalString('SOCIETE_CODECLIENT_ADDON', 'mod_codeclient_leopard');
if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') {
$module = substr($module, 0, dol_strlen($module) - 4);
}
@ -341,7 +341,7 @@ if (empty($reshook) && $action == 'add') {
break;
}
}
$modCodeFournisseur = new $module();
$modCodeFournisseur = new $module($db);
if (empty($tmpcode) && !empty($modCodeFournisseur->code_auto)) {
$tmpcode = $modCodeFournisseur->getNextValue($thirdparty, 1);
}

View File

@ -153,7 +153,7 @@ abstract class ActionsCardCommon
}
// Load object modCodeClient
$module = (getDolGlobalString('SOCIETE_CODECLIENT_ADDON') ? $conf->global->SOCIETE_CODECLIENT_ADDON : 'mod_codeclient_leopard');
$module = getDolGlobalString('SOCIETE_CODECLIENT_ADDON', 'mod_codeclient_leopard');
if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') {
$module = substr($module, 0, dol_strlen($module) - 4);
}

View File

@ -905,7 +905,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
}
// Load object modCodeTiers
$module = (getDolGlobalString('SOCIETE_CODECLIENT_ADDON') ? $conf->global->SOCIETE_CODECLIENT_ADDON : 'mod_codeclient_leopard');
$module = getDolGlobalString('SOCIETE_CODECLIENT_ADDON', 'mod_codeclient_leopard');
if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') {
$module = substr($module, 0, dol_strlen($module) - 4);
}
@ -918,7 +918,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
}
$modCodeClient = new $module($db);
// Load object modCodeFournisseur
$module = (getDolGlobalString('SOCIETE_CODECLIENT_ADDON') ? $conf->global->SOCIETE_CODECLIENT_ADDON : 'mod_codeclient_leopard');
$module = getDolGlobalString('SOCIETE_CODECLIENT_ADDON', 'mod_codeclient_leopard');
if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') {
$module = substr($module, 0, dol_strlen($module) - 4);
}
@ -1800,7 +1800,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
$head = societe_prepare_head($object);
// Load object modCodeTiers
$module = (getDolGlobalString('SOCIETE_CODECLIENT_ADDON') ? $conf->global->SOCIETE_CODECLIENT_ADDON : 'mod_codeclient_leopard');
$module = getDolGlobalString('SOCIETE_CODECLIENT_ADDON', 'mod_codeclient_leopard');
if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') {
$module = substr($module, 0, dol_strlen($module) - 4);
}