fix php8 warnings

This commit is contained in:
Frédéric France 2022-08-31 22:12:25 +02:00
parent e71692e745
commit 00da52ef8c
10 changed files with 16 additions and 16 deletions

View File

@ -2061,7 +2061,7 @@ class Adherent extends CommonObject
$err = 0;
// mailman
if (!empty($conf->global->ADHERENT_USE_MAILMAN) && !empty($conf->mailmanspip->enabled)) {
if (!empty($conf->global->ADHERENT_USE_MAILMAN) && isModEnabled('mailmanspip')) {
$result = $mailmanspip->add_to_mailman($this);
if ($result < 0) {
@ -2081,7 +2081,7 @@ class Adherent extends CommonObject
}
// spip
if (!empty($conf->global->ADHERENT_USE_SPIP) && !empty($conf->mailmanspip->enabled)) {
if (!empty($conf->global->ADHERENT_USE_SPIP) && isModEnabled('mailmanspip')) {
$result = $mailmanspip->add_to_spip($this);
if ($result < 0) {
$this->errors[] = $mailmanspip->error;
@ -2132,7 +2132,7 @@ class Adherent extends CommonObject
}
}
if ($conf->global->ADHERENT_USE_SPIP && !empty($conf->mailmanspip->enabled)) {
if ($conf->global->ADHERENT_USE_SPIP && isModEnabled('mailmanspip')) {
$result = $mailmanspip->del_to_spip($this);
if ($result < 0) {
$this->errors[] = $mailmanspip->error;

View File

@ -644,7 +644,7 @@ if ($conf->banque->enabled) {
print '<tr class="oddeven"><td>';
print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_ORDER").'</td><td>&nbsp;</td><td class="center">';
if (! empty($conf->use_javascript_ajax)) {
if (!empty($conf->use_javascript_ajax)) {
print ajax_constantonoff('BANK_ASK_PAYMENT_BANK_DURING_ORDER');
} else {
if (empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_ORDER)) {
@ -664,7 +664,7 @@ if ($conf->banque->enabled) {
if (isModEnabled('stock')) {
print '<tr class="oddeven"><td>';
print $langs->trans("WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER").'</td><td>&nbsp;</td><td class="center">';
if (! empty($conf->use_javascript_ajax)) {
if (!empty($conf->use_javascript_ajax)) {
print ajax_constantonoff('WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER');
} else {
if (empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER)) {

View File

@ -146,7 +146,7 @@ print "</tr>\n";
print '<tr class="oddeven"><td width="200"><input type="radio" name="accounting_mode" value="RECETTES-DEPENSES"'.($accounting_mode != 'CREANCES-DETTES' ? ' checked' : '').'> '.$langs->trans('OptionModeTrue').'</td>';
print '<td colspan="2">'.nl2br($langs->trans('OptionModeTrueDesc'));
// Write info on way to count VAT
//if (! empty($conf->global->MAIN_MODULE_COMPTABILITE))
//if (!empty($conf->global->MAIN_MODULE_COMPTABILITE))
//{
// // print "<br>\n";
// // print nl2br($langs->trans('OptionModeTrueInfoModuleComptabilite'));

View File

@ -100,7 +100,7 @@ print '<div class="fichecenter"><div class="fichethirdleft">';
/* BEGIN MODULEBUILDER DRAFT MYOBJECT
// Draft MyObject
if (! empty($conf->mymodule->enabled) && $user->rights->mymodule->read)
if (isModEnabled('mymodule') && $user->rights->mymodule->read)
{
$langs->load("orders");
@ -181,7 +181,7 @@ $max = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT;
/* BEGIN MODULEBUILDER LASTMODIFIED MYOBJECT
// Last modified myobject
if (! empty($conf->mymodule->enabled) && $user->rights->mymodule->read)
if (isModEnabled('mymodule') && $user->rights->mymodule->read)
{
$sql = "SELECT s.rowid, s.ref, s.label, s.date_creation, s.tms";
$sql.= " FROM ".MAIN_DB_PREFIX."mymodule_myobject as s";

View File

@ -190,7 +190,7 @@ if ($object->id) {
// Thirdparty
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : '');
// Project
if (! empty($conf->project->enabled))
if (!empty($conf->project->enabled))
{
$langs->load("projects");
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
@ -211,7 +211,7 @@ if ($object->id) {
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
}
} else {
if (! empty($object->fk_project)) {
if (!empty($object->fk_project)) {
$proj = new Project($db);
$proj->fetch($object->fk_project);
$morehtmlref .= ': '.$proj->getNomUrl();

View File

@ -223,7 +223,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
// Thirdparty
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $soc->getNomUrl(1);
// Project
if (! empty($conf->project->enabled))
if (!empty($conf->project->enabled))
{
$langs->load("projects");
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
@ -245,7 +245,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
}
}
} else {
if (! empty($object->fk_project)) {
if (!empty($object->fk_project)) {
$proj = new Project($db);
$proj->fetch($object->fk_project);
$morehtmlref.='<a href="'.DOL_URL_ROOT.'/projet/card.php?id=' . $object->fk_project . '" title="' . $langs->trans('ShowProject') . '">';

View File

@ -86,7 +86,7 @@ class FactureTest extends PHPUnit\Framework\TestCase
if (!isModEnabled('facture')) {
print __METHOD__." module customer invoice must be enabled.\n"; die(1);
}
if (! empty($conf->ecotaxdeee->enabled)) {
if (!empty($conf->ecotaxdeee->enabled)) {
print __METHOD__." ecotaxdeee module must not be enabled.\n"; die(1);
}

View File

@ -38,7 +38,7 @@ if (empty($user->id)) {
}
$conf->global->MAIN_DISABLE_ALL_MAILS=1;
if (! empty($conf->global->MAIN_ROUNDING_RULE_TOT)) {
if (!empty($conf->global->MAIN_ROUNDING_RULE_TOT)) {
print "Parameter MAIN_ROUNDING_RULE_TOT must be set to 0 or not set.\n";
exit(1);
}

View File

@ -87,7 +87,7 @@ class SocieteTest extends PHPUnit\Framework\TestCase
print "\n".__METHOD__." third party ref checker must be setup to 'mod_codeclient_monkey' not to '".$conf->global->SOCIETE_CODECLIENT_ADDON."'.\n"; die(1);
}
if (! empty($conf->global->MAIN_DISABLEPROFIDRULES)) {
if (!empty($conf->global->MAIN_DISABLEPROFIDRULES)) {
print "\n".__METHOD__." constant MAIN_DISABLEPROFIDRULES must be empty (if a module set it, disable module).\n"; die(1);
}

View File

@ -82,7 +82,7 @@ class UserTest extends PHPUnit\Framework\TestCase
{
global $conf,$user,$langs,$db;
if (! empty($conf->global->MAIN_MODULE_LDAP)) {
if (!empty($conf->global->MAIN_MODULE_LDAP)) {
print "\n".__METHOD__." module LDAP must be disabled.\n"; die(1);
}