From 7fac86a5af2f1d745d7291b676a1a1402e78b003 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 9 Jul 2012 12:54:27 +0200 Subject: [PATCH] Fix: avoid warnings --- htdocs/admin/company.php | 38 ++++++++++++++++++++++++++------------ htdocs/admin/modules.php | 4 ++-- 2 files changed, 28 insertions(+), 14 deletions(-) diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index 1cb0eb49773..a1f3d8773b7 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -39,7 +39,9 @@ $action=GETPOST('action'); $langs->load("admin"); $langs->load("companies"); -if (!$user->admin) accessforbidden(); +if (! $user->admin) accessforbidden(); + +$message=''; /* @@ -683,7 +685,7 @@ else print ''.$langs->trans("Web").'' . dol_print_url($conf->global->MAIN_INFO_SOCIETE_WEB,'_blank',80) . ''; // Barcode - if ($conf->barcode->enabled) + if (! empty($conf->barcode->enabled)) { $var=!$var; print ''.$langs->trans("Gencod").'' . $conf->global->MAIN_INFO_SOCIETE_GENCOD . ''; @@ -715,7 +717,7 @@ else print ''; $var=!$var; - print ''.$langs->trans("Note").'' . nl2br($conf->global->MAIN_INFO_SOCIETE_NOTE) . ''; + print ''.$langs->trans("Note").'' . (! empty($conf->global->MAIN_INFO_SOCIETE_NOTE) ? nl2br($conf->global->MAIN_INFO_SOCIETE_NOTE) : '') . ''; print ''; @@ -746,10 +748,12 @@ else { $var=!$var; print ''.$langs->transcountry("ProfId1",$mysoc->country_code).''; - if ($langs->transcountry("ProfId1",$mysoc->country_code) != '-') + if (! empty($conf->global->MAIN_INFO_SIREN)) { print $conf->global->MAIN_INFO_SIREN; - if ($conf->global->MAIN_INFO_SIREN && $mysoc->country_code == 'FR') print '   '.$langs->trans("Check").''; + if ($mysoc->country_code == 'FR') print '   '.$langs->trans("Check").''; + } else { + print ' '; } print ''; } @@ -759,9 +763,11 @@ else { $var=!$var; print ''.$langs->transcountry("ProfId2",$mysoc->country_code).''; - if ($langs->transcountry("ProfId2",$mysoc->country_code) != '-') + if (! empty($conf->global->MAIN_INFO_SIRET)) { print $conf->global->MAIN_INFO_SIRET; + } else { + print ' '; } print ''; } @@ -771,9 +777,11 @@ else { $var=!$var; print ''.$langs->transcountry("ProfId3",$mysoc->country_code).''; - if ($langs->transcountry("ProfId3",$mysoc->country_code) != '-') + if (! empty($conf->global->MAIN_INFO_APE)) { print $conf->global->MAIN_INFO_APE; + } else { + print ' '; } print ''; } @@ -783,9 +791,11 @@ else { $var=!$var; print ''.$langs->transcountry("ProfId4",$mysoc->country_code).''; - if ($langs->transcountry("ProfId4",$mysoc->country_code) != '-') + if (! empty($conf->global->MAIN_INFO_RCS)) { print $conf->global->MAIN_INFO_RCS; + } else { + print ' '; } print ''; } @@ -795,9 +805,11 @@ else { $var=!$var; print ''.$langs->transcountry("ProfId5",$mysoc->country_code).''; - if ($langs->transcountry("ProfId5",$mysoc->country_code) != '-') + if (! empty($conf->global->MAIN_INFO_PROFID5)) { print $conf->global->MAIN_INFO_PROFID5; + } else { + print ' '; } print ''; } @@ -807,9 +819,11 @@ else { $var=!$var; print ''.$langs->transcountry("ProfId6",$mysoc->country_code).''; - if ($langs->transcountry("ProfId6",$mysoc->country_code) != '-') + if (! empty($conf->global->MAIN_INFO_PROFID6)) { print $conf->global->MAIN_INFO_PROFID6; + } else { + print ' '; } print ''; } @@ -818,7 +832,7 @@ else $var=!$var; print ''.$langs->trans("VATIntra").''; print ''; - if ($conf->global->MAIN_INFO_TVAINTRA) + if (! empty($conf->global->MAIN_INFO_TVAINTRA)) { $s=''; $s.=$conf->global->MAIN_INFO_TVAINTRA; @@ -826,7 +840,7 @@ else if (empty($conf->global->MAIN_DISABLEVATCHECK)) { $s.='   '; - if ($conf->use_javascript_ajax) + if (! empty($conf->use_javascript_ajax)) { print "\n"; print '