From c42a0c5b035d40a74a804fcf6c757f9107984e61 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 28 Jan 2013 14:40:15 +0100 Subject: [PATCH] Fix: removed warning --- htdocs/admin/company.php | 6 ++--- htdocs/core/menus/standard/eldy.lib.php | 16 +++++------ htdocs/main.inc.php | 2 +- htdocs/societe/class/societe.class.php | 35 +++++++++++++------------ 4 files changed, 30 insertions(+), 29 deletions(-) diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index bc61dad4aed..28336d2966a 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -646,13 +646,13 @@ else print ''; $var=!$var; - print ''.$langs->trans("CompanyAddress").'' . nl2br($conf->global->MAIN_INFO_SOCIETE_ADRESSE) . ''; + print ''.$langs->trans("CompanyAddress").'' . nl2br(empty($conf->global->MAIN_INFO_SOCIETE_ADRESSE)?'':$conf->global->MAIN_INFO_SOCIETE_ADRESSE) . ''; $var=!$var; - print ''.$langs->trans("CompanyZip").'' . $conf->global->MAIN_INFO_SOCIETE_CP . ''; + print ''.$langs->trans("CompanyZip").'' . (empty($conf->global->MAIN_INFO_SOCIETE_CP)?'':$conf->global->MAIN_INFO_SOCIETE_CP) . ''; $var=!$var; - print ''.$langs->trans("CompanyTown").'' . $conf->global->MAIN_INFO_SOCIETE_VILLE . ''; + print ''.$langs->trans("CompanyTown").'' . (empty($conf->global->MAIN_INFO_SOCIETE_VILLE)?'':$conf->global->MAIN_INFO_SOCIETE_VILLE) . ''; $var=!$var; print ''.$langs->trans("CompanyCountry").''; diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 67b6b816ea9..c837de7c9fb 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -68,7 +68,7 @@ function print_eldy_menu($db,$atarget,$type_user) // Third parties - $tmpentry=array('enabled'=>($conf->societe->enabled || $conf->fournisseur->enabled), 'perms'=>($user->rights->societe->lire || $user->rights->fournisseur->lire), 'module'=>'societe|fournisseur'); + $tmpentry=array('enabled'=>(! empty($conf->societe->enabled) || ! empty($conf->fournisseur->enabled)), 'perms'=>(! empty($user->rights->societe->lire) || ! empty($user->rights->fournisseur->lire)), 'module'=>'societe|fournisseur'); $showmode=dol_eldy_showmenu($type_user, $tmpentry, $listofmodulesforexternal); if ($showmode) { @@ -110,7 +110,7 @@ function print_eldy_menu($db,$atarget,$type_user) } // Products-Services - $tmpentry=array('enabled'=>($conf->product->enabled || $conf->service->enabled), 'perms'=>($user->rights->produit->lire || $user->rights->service->lire), 'module'=>'product|service'); + $tmpentry=array('enabled'=>(! empty($conf->product->enabled) || ! empty($conf->service->enabled)), 'perms'=>(! empty($user->rights->produit->lire) || ! empty($user->rights->service->lire)), 'module'=>'product|service'); $showmode=dol_eldy_showmenu($type_user, $tmpentry, $listofmodulesforexternal); if ($showmode) { @@ -160,7 +160,7 @@ function print_eldy_menu($db,$atarget,$type_user) if (! empty($conf->fournisseur->enabled)) $menuqualified++; if (! empty($conf->contrat->enabled)) $menuqualified++; if (! empty($conf->ficheinter->enabled)) $menuqualified++; - $tmpentry=array('enabled'=>$menuqualified, 'perms'=>($user->rights->societe->lire || $user->rights->societe->contact->lire), 'module'=>'propal|commande|fournisseur|contrat|ficheinter'); + $tmpentry=array('enabled'=>$menuqualified, 'perms'=>(! empty($user->rights->societe->lire) || ! empty($user->rights->societe->contact->lire)), 'module'=>'propal|commande|fournisseur|contrat|ficheinter'); $showmode=dol_eldy_showmenu($type_user, $tmpentry, $listofmodulesforexternal); if ($showmode) { @@ -201,7 +201,7 @@ function print_eldy_menu($db,$atarget,$type_user) // Financial $tmpentry=array('enabled'=>(! empty($conf->comptabilite->enabled) || ! empty($conf->accounting->enabled) || ! empty($conf->facture->enabled) || ! empty($conf->deplacement->enabled) || ! empty($conf->don->enabled) || ! empty($conf->tax->enabled)), - 'perms'=>($user->rights->compta->resultat->lire || $user->rights->accounting->plancompte->lire || $user->rights->facture->lire || $user->rights->deplacement->lire || $user->rights->don->lire || $user->rights->tax->charges->lire), + 'perms'=>(! empty($user->rights->compta->resultat->lire) || ! empty($user->rights->accounting->plancompte->lire) || ! empty($user->rights->facture->lire) || ! empty($user->rights->deplacement->lire) || ! empty($user->rights->don->lire) || ! empty($user->rights->tax->charges->lire)), 'module'=>'comptabilite|accounting|facture|deplacement|don|tax'); $showmode=dol_eldy_showmenu($type_user, $tmpentry, $listofmodulesforexternal); if ($showmode) @@ -243,7 +243,7 @@ function print_eldy_menu($db,$atarget,$type_user) // Bank $tmpentry=array('enabled'=>(! empty($conf->banque->enabled) || ! empty($conf->prelevement->enabled)), - 'perms'=>($user->rights->banque->lire || $user->rights->prelevement->lire), + 'perms'=>(! empty($user->rights->banque->lire) || ! empty($user->rights->prelevement->lire)), 'module'=>'banque|prelevement'); $showmode=dol_eldy_showmenu($type_user, $tmpentry, $listofmodulesforexternal); if ($showmode) @@ -286,7 +286,7 @@ function print_eldy_menu($db,$atarget,$type_user) // Projects $tmpentry=array('enabled'=>(! empty($conf->projet->enabled)), - 'perms'=>($user->rights->projet->lire), + 'perms'=>(! empty($user->rights->projet->lire)), 'module'=>'projet'); $showmode=dol_eldy_showmenu($type_user, $tmpentry, $listofmodulesforexternal); if ($showmode) @@ -328,7 +328,7 @@ function print_eldy_menu($db,$atarget,$type_user) // Tools $tmpentry=array('enabled'=>(! empty($conf->mailing->enabled) || ! empty($conf->export->enabled) || ! empty($conf->import->enabled)), - 'perms'=>($user->rights->mailing->lire || $user->rights->export->lire || $user->rights->import->run), + 'perms'=>(! empty($user->rights->mailing->lire) || ! empty($user->rights->export->lire) || ! empty($user->rights->import->run)), 'module'=>'mailing|export|import'); $showmode=dol_eldy_showmenu($type_user, $tmpentry, $listofmodulesforexternal); if ($showmode) @@ -400,7 +400,7 @@ function print_eldy_menu($db,$atarget,$type_user) // Members $tmpentry=array('enabled'=>(! empty($conf->adherent->enabled)), - 'perms'=>($user->rights->adherent->lire), + 'perms'=>(! empty($user->rights->adherent->lire)), 'module'=>'adherent'); $showmode=dol_eldy_showmenu($type_user, $tmpentry, $listofmodulesforexternal); if ($showmode) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index ec82c9e7e41..2695a2fd3d0 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1347,7 +1347,7 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a && $_SESSION["dol_authmode"] != 'http') { $logouttext .='trans('Logout'), 'logout.png', 'class="login"'); $logouttext .=''; diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 269f428a61a..db147ffde86 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -2504,17 +2504,18 @@ class Societe extends CommonObject global $langs; $this->id=0; - $this->name=(! empty($conf->global->MAIN_INFO_SOCIETE_NOM))?$conf->global->MAIN_INFO_SOCIETE_NOM:''; - $this->nom=$this->name; // deprecated - $this->address=(! empty($conf->global->MAIN_INFO_SOCIETE_ADRESSE))?$conf->global->MAIN_INFO_SOCIETE_ADRESSE:''; - $this->adresse=$this->address; // deprecated - $this->zip=(! empty($conf->global->MAIN_INFO_SOCIETE_CP))?$conf->global->MAIN_INFO_SOCIETE_CP:''; - $this->cp=$this->zip; // deprecated - $this->town=(! empty($conf->global->MAIN_INFO_SOCIETE_VILLE))?$conf->global->MAIN_INFO_SOCIETE_VILLE:''; - $this->ville=$this->town; // deprecated - $this->state_id=$conf->global->MAIN_INFO_SOCIETE_DEPARTEMENT; + $this->name=empty($conf->global->MAIN_INFO_SOCIETE_NOM)?'':$conf->global->MAIN_INFO_SOCIETE_NOM; + $this->address=empty($conf->global->MAIN_INFO_SOCIETE_ADRESSE)?'':$conf->global->MAIN_INFO_SOCIETE_ADRESSE; + $this->zip=empty($conf->global->MAIN_INFO_SOCIETE_CP)?'':$conf->global->MAIN_INFO_SOCIETE_CP; + $this->town=empty($conf->global->MAIN_INFO_SOCIETE_VILLE)?'':$conf->global->MAIN_INFO_SOCIETE_VILLE; + $this->state_id=empty($conf->global->MAIN_INFO_SOCIETE_DEPARTEMENT)?'':$conf->global->MAIN_INFO_SOCIETE_DEPARTEMENT; $this->note=empty($conf->global->MAIN_INFO_SOCIETE_NOTE)?'':$conf->global->MAIN_INFO_SOCIETE_NOTE; - + + $this->nom=$this->name; // deprecated + $this->adresse=$this->address; // deprecated + $this->cp=$this->zip; // deprecated + $this->ville=$this->town; // deprecated + // We define country_id, country_code and country $country_id=$country_code=$country_label=''; if (! empty($conf->global->MAIN_INFO_SOCIETE_PAYS)) @@ -2553,13 +2554,13 @@ class Societe extends CommonObject $this->idprof4=empty($conf->global->MAIN_INFO_RCS)?'':$conf->global->MAIN_INFO_RCS; $this->idprof5=empty($conf->global->MAIN_INFO_PROFID5)?'':$conf->global->MAIN_INFO_PROFID5; $this->idprof6=empty($conf->global->MAIN_INFO_PROFID6)?'':$conf->global->MAIN_INFO_PROFID6; - $this->tva_intra=(! empty($conf->global->MAIN_INFO_TVAINTRA))?$conf->global->MAIN_INFO_TVAINTRA:''; // VAT number, not necessarly INTRA. - $this->capital=(! empty($conf->global->MAIN_INFO_CAPITAL))?$conf->global->MAIN_INFO_CAPITAL:''; - $this->forme_juridique_code=$conf->global->MAIN_INFO_SOCIETE_FORME_JURIDIQUE; - $this->email=(! empty($conf->global->MAIN_INFO_SOCIETE_MAIL))?$conf->global->MAIN_INFO_SOCIETE_MAIL:''; - $this->logo=(! empty($conf->global->MAIN_INFO_SOCIETE_LOGO))?$conf->global->MAIN_INFO_SOCIETE_LOGO:''; - $this->logo_small=(! empty($conf->global->MAIN_INFO_SOCIETE_LOGO_SMALL))?$conf->global->MAIN_INFO_SOCIETE_LOGO_SMALL:''; - $this->logo_mini=(! empty($conf->global->MAIN_INFO_SOCIETE_LOGO_MINI))?$conf->global->MAIN_INFO_SOCIETE_LOGO_MINI:''; + $this->tva_intra=empty($conf->global->MAIN_INFO_TVAINTRA)?'':$conf->global->MAIN_INFO_TVAINTRA; // VAT number, not necessarly INTRA. + $this->capital=empty($conf->global->MAIN_INFO_CAPITAL)?'':$conf->global->MAIN_INFO_CAPITAL; + $this->forme_juridique_code=empty($conf->global->MAIN_INFO_SOCIETE_FORME_JURIDIQUE)?'':$conf->global->MAIN_INFO_SOCIETE_FORME_JURIDIQUE; + $this->email=empty($conf->global->MAIN_INFO_SOCIETE_MAIL)?'':$conf->global->MAIN_INFO_SOCIETE_MAIL; + $this->logo=empty($conf->global->MAIN_INFO_SOCIETE_LOGO)?'':$conf->global->MAIN_INFO_SOCIETE_LOGO; + $this->logo_small=empty($conf->global->MAIN_INFO_SOCIETE_LOGO_SMALL)?'':$conf->global->MAIN_INFO_SOCIETE_LOGO_SMALL; + $this->logo_mini=empty($conf->global->MAIN_INFO_SOCIETE_LOGO_MINI)?'':$conf->global->MAIN_INFO_SOCIETE_LOGO_MINI; // Define if company use vat or not (Do not use conf->global->FACTURE_TVAOPTION anymore) $this->tva_assuj=((isset($conf->global->FACTURE_TVAOPTION) && $conf->global->FACTURE_TVAOPTION=='franchise')?0:1);