diff --git a/htdocs/contact/exportimport.php b/htdocs/contact/exportimport.php index 7c76ce296be..1a6b254eed5 100644 --- a/htdocs/contact/exportimport.php +++ b/htdocs/contact/exportimport.php @@ -68,18 +68,21 @@ print ''.$langs->trans("Lastname").' / '.$langs->trans("Labe print ''.$langs->trans("Firstname").''.$contact->firstname.''; // Company -if ($contact->socid > 0) +if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) { - $objsoc = new Societe($db); - $objsoc->fetch($contact->socid); + if ($contact->socid > 0) + { + $objsoc = new Societe($db); + $objsoc->fetch($contact->socid); - print ''.$langs->trans("Company").''.$objsoc->getNomUrl(1).''; -} -else -{ - print ''.$langs->trans("Company").''; - print $langs->trans("ContactNotLinkedToCompany"); - print ''; + print ''.$langs->trans("Company").''.$objsoc->getNomUrl(1).''; + } + else + { + print ''.$langs->trans("Company").''; + print $langs->trans("ContactNotLinkedToCompany"); + print ''; + } } // Civility diff --git a/htdocs/contact/fiche.php b/htdocs/contact/fiche.php index f9b4de345e9..4bbd7c3fe56 100644 --- a/htdocs/contact/fiche.php +++ b/htdocs/contact/fiche.php @@ -476,22 +476,25 @@ else print ''.$langs->trans("Firstname").'firstname).'">'; // Company - if ($socid > 0) - { - print ''.$langs->trans("Company").''; - print ''; - print $objsoc->getNomUrl(1); - print ''; - print ''; - print ''; - } - else { - print ''.$langs->trans("Company").''; - print $form->select_societes(isset($_POST["socid"])?$_POST["socid"]:'','socid','',1); - //print $form->select_societes('','socid',''); - //print $langs->trans("ContactNotLinkedToCompany"); - print ''; - } + if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) + { + if ($socid > 0) + { + print ''.$langs->trans("Company").''; + print ''; + print $objsoc->getNomUrl(1); + print ''; + print ''; + print ''; + } + else { + print ''.$langs->trans("Company").''; + print $form->select_societes(isset($_POST["socid"])?$_POST["socid"]:'','socid','',1); + //print $form->select_societes('','socid',''); + //print $langs->trans("ContactNotLinkedToCompany"); + print ''; + } + } // Civility print ''.$langs->trans("UserTitle").''; @@ -650,11 +653,14 @@ else print ''.$langs->trans("Firstname").'firstname).'">'; // Company - print ''.$langs->trans("Company").''; - print ''; - print $form->select_societes(isset($_POST["socid"])?$_POST["socid"]:($object->socid?$object->socid:-1),'socid','',1); - print ''; - print ''; + if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) + { + print ''.$langs->trans("Company").''; + print ''; + print $form->select_societes(isset($_POST["socid"])?$_POST["socid"]:($object->socid?$object->socid:-1),'socid','',1); + print ''; + print ''; + } // Civility print ''.$langs->trans("UserTitle").''; @@ -824,17 +830,20 @@ else print ''.$langs->trans("Firstname").''.$object->firstname.''; // Company - print ''.$langs->trans("Company").''; - if ($object->socid > 0) - { - $objsoc->fetch($object->socid); - print $objsoc->getNomUrl(1); - } - else - { - print $langs->trans("ContactNotLinkedToCompany"); - } - print ''; + if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) + { + print ''.$langs->trans("Company").''; + if ($object->socid > 0) + { + $objsoc->fetch($object->socid); + print $objsoc->getNomUrl(1); + } + else + { + print $langs->trans("ContactNotLinkedToCompany"); + } + print ''; + } // Civility print ''.$langs->trans("UserTitle").''; diff --git a/htdocs/contact/index.php b/htdocs/contact/index.php index 3ac9795ae23..0317aa6f793 100644 --- a/htdocs/contact/index.php +++ b/htdocs/contact/index.php @@ -227,7 +227,7 @@ if ($result) print ''; print_liste_field_titre($langs->trans("Lastname"),"index.php","p.name", $begin, $param, '', $sortfield,$sortorder); print_liste_field_titre($langs->trans("Firstname"),"index.php","p.firstname", $begin, $param, '', $sortfield,$sortorder); - print_liste_field_titre($langs->trans("Company"),"index.php","s.nom", $begin, $param, '', $sortfield,$sortorder); + if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) print_liste_field_titre($langs->trans("Company"),"index.php","s.nom", $begin, $param, '', $sortfield,$sortorder); print_liste_field_titre($langs->trans("Phone"),"index.php","p.phone", $begin, $param, '', $sortfield,$sortorder); if ($_GET["view"] == 'phone') { @@ -251,10 +251,13 @@ if ($result) print ''; print ''; print ''; - print ''; - print ''; - print ''; - print ' '; + if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) + { + print ''; + print ''; + print ''; + } + print ' '; if ($_GET["view"] == 'phone') { print ''; @@ -302,17 +305,20 @@ if ($result) print ''.dol_trunc($obj->firstname,20).''; // Company - print ''; - if ($obj->socid) + if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) { - print ''; - print img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($obj->nom,20).''; + print ''; + if ($obj->socid) + { + print ''; + print img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($obj->nom,20).''; + } + else + { + print ' '; + } + print ''; } - else - { - print ' '; - } - print ''; // Phone print ''; diff --git a/htdocs/contact/perso.php b/htdocs/contact/perso.php index 560a35d7546..5bb30b6686f 100644 --- a/htdocs/contact/perso.php +++ b/htdocs/contact/perso.php @@ -107,18 +107,21 @@ if ($_GET["action"] == 'edit') print ''.$langs->trans("Firstname").''.$contact->prenom.''; // Company - if ($contact->socid > 0) + if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) { - $objsoc = new Societe($db); - $objsoc->fetch($contact->socid); + if ($contact->socid > 0) + { + $objsoc = new Societe($db); + $objsoc->fetch($contact->socid); - print ''.$langs->trans("Company").''.$objsoc->getNomUrl(1).''; - } - else - { - print ''.$langs->trans("Company").''; - print $langs->trans("ContactNotLinkedToCompany"); - print ''; + print ''.$langs->trans("Company").''.$objsoc->getNomUrl(1).''; + } + else + { + print ''.$langs->trans("Company").''; + print $langs->trans("ContactNotLinkedToCompany"); + print ''; + } } // Civility @@ -170,19 +173,22 @@ else print ''.$langs->trans("Firstname").''.$contact->firstname.''; // Company - if ($contact->socid > 0) + if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) { - $objsoc = new Societe($db); - $objsoc->fetch($contact->socid); + if ($contact->socid > 0) + { + $objsoc = new Societe($db); + $objsoc->fetch($contact->socid); - print ''.$langs->trans("Company").''.$objsoc->getNomUrl(1).''; - } + print ''.$langs->trans("Company").''.$objsoc->getNomUrl(1).''; + } - else - { - print ''.$langs->trans("Company").''; - print $langs->trans("ContactNotLinkedToCompany"); - print ''; + else + { + print ''.$langs->trans("Company").''; + print $langs->trans("ContactNotLinkedToCompany"); + print ''; + } } // Civility