diff --git a/htdocs/comm/action/class/api_agendaevents.class.php b/htdocs/comm/action/class/api_agendaevents.class.php
index e7745f1d5fd..8c13709b250 100644
--- a/htdocs/comm/action/class/api_agendaevents.class.php
+++ b/htdocs/comm/action/class/api_agendaevents.class.php
@@ -124,7 +124,7 @@ class AgendaEvents extends DolibarrApi
if (!DolibarrApiAccess::$user->rights->societe->client->voir && !$socid) {
$search_sale = DolibarrApiAccess::$user->id;
}
- if (empty($conf->societe->enabled)) {
+ if (!isModEnabled('societe')) {
$search_sale = 0; // If module thirdparty not enabled, sale representative is something that does not exists
}
diff --git a/htdocs/don/card.php b/htdocs/don/card.php
index c867418cfbb..bf9ba2e6388 100644
--- a/htdocs/don/card.php
+++ b/htdocs/don/card.php
@@ -460,7 +460,7 @@ if ($action == 'create') {
print $form->selectyesno("public", $public_donation, 1);
print "\n";
- if (empty($conf->societe->enabled) || empty($conf->global->DONATION_USE_THIRDPARTIES)) {
+ if (!isModEnabled('societe') || empty($conf->global->DONATION_USE_THIRDPARTIES)) {
print "
".'| '.$langs->trans("Company").' | |
';
print "".'| '.$langs->trans("Lastname").' | |
';
print "".'| '.$langs->trans("Firstname").' | |
';
diff --git a/htdocs/ecm/index_auto.php b/htdocs/ecm/index_auto.php
index 4ffe606c79e..49bd25d0b90 100644
--- a/htdocs/ecm/index_auto.php
+++ b/htdocs/ecm/index_auto.php
@@ -314,7 +314,7 @@ if (!empty($conf->global->ECM_AUTO_TREE_ENABLED)) {
$rowspan++; $sectionauto[] = array('position'=>10, 'level'=>1, 'module'=>'product', 'test'=>(isModEnabled("product") || isModEnabled("service")), 'label'=>$langs->trans("ProductsAndServices"), 'desc'=>$langs->trans("ECMDocsByProducts"));
}
if (isModEnabled("societe")) {
- $rowspan++; $sectionauto[] = array('position'=>20, 'level'=>1, 'module'=>'company', 'test'=>$conf->societe->enabled, 'label'=>$langs->trans("ThirdParties"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("ThirdParties")));
+ $rowspan++; $sectionauto[] = array('position'=>20, 'level'=>1, 'module'=>'company', 'test'=>isModEnabled('societe'), 'label'=>$langs->trans("ThirdParties"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("ThirdParties")));
}
if (isModEnabled("propal")) {
$rowspan++; $sectionauto[] = array('position'=>30, 'level'=>1, 'module'=>'propal', 'test'=>$conf->propal->enabled, 'label'=>$langs->trans("Proposals"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Proposals")));
diff --git a/htdocs/ecm/search.php b/htdocs/ecm/search.php
index d04983fff11..6bbca0026e1 100644
--- a/htdocs/ecm/search.php
+++ b/htdocs/ecm/search.php
@@ -117,7 +117,7 @@ if (isModEnabled("product") || isModEnabled("service")) {
$langs->load("products"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'product', 'test'=>(isModEnabled("product") || isModEnabled("service")), 'label'=>$langs->trans("ProductsAndServices"), 'desc'=>$langs->trans("ECMDocsByProducts"));
}
if (isModEnabled("societe")) {
- $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'company', 'test'=>$conf->societe->enabled, 'label'=>$langs->trans("ThirdParties"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("ThirdParties")));
+ $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'company', 'test'=>isModEnabled('societe'), 'label'=>$langs->trans("ThirdParties"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("ThirdParties")));
}
if (isModEnabled("propal")) {
$rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'propal', 'test'=>$conf->propal->enabled, 'label'=>$langs->trans("Proposals"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Proposals")));
diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php
index c1e18d60309..7cfb66288e1 100644
--- a/htdocs/projet/list.php
+++ b/htdocs/projet/list.php
@@ -199,7 +199,7 @@ foreach ($object->fields as $key => $val) {
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
// Add non object fields to fields for list
-$arrayfields['s.nom'] = array('label'=>$langs->trans("ThirdParty"), 'checked'=>1, 'position'=>21, 'enabled'=>(empty($conf->societe->enabled) ? 0 : 1));
+$arrayfields['s.nom'] = array('label'=>$langs->trans("ThirdParty"), 'checked'=>1, 'position'=>21, 'enabled'=>(!isModEnabled('societe') ? 0 : 1));
$arrayfields['s.name_alias'] = array('label'=>"AliasNameShort", 'checked'=>0, 'position'=>22);
$arrayfields['commercial'] = array('label'=>$langs->trans("SaleRepresentativesOfThirdParty"), 'checked'=>0, 'position'=>23);
$arrayfields['c.assigned'] = array('label'=>$langs->trans("AssignedTo"), 'checked'=>-1, 'position'=>120);
diff --git a/htdocs/societe/class/api_thirdparties.class.php b/htdocs/societe/class/api_thirdparties.class.php
index a7b78174cf1..f2357c96a16 100644
--- a/htdocs/societe/class/api_thirdparties.class.php
+++ b/htdocs/societe/class/api_thirdparties.class.php
@@ -550,7 +550,7 @@ class Thirdparties extends DolibarrApi
{
global $conf;
- if (empty($conf->societe->enabled)) {
+ if (!isModEnabled('societe')) {
throw new RestException(501, 'Module "Thirdparties" needed for this request');
}