From 6844d603ff898d46bed757b6a3a3e4557946ddfa Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Mon, 29 Aug 2022 09:23:15 +0200 Subject: [PATCH 1/6] update code --- htdocs/comm/action/class/api_agendaevents.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 } From bc421ce1608aac9941ccf3e31110a9d085870d6a Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Mon, 29 Aug 2022 09:25:33 +0200 Subject: [PATCH 2/6] update code --- htdocs/don/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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").''; From 16646006603f3194ae0e1a3e9a0828db5aced354 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Mon, 29 Aug 2022 09:26:32 +0200 Subject: [PATCH 3/6] update code --- htdocs/ecm/index_auto.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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"))); From 455c41cacb388a02dcfa8a3f736de4de68143eae Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Mon, 29 Aug 2022 09:27:24 +0200 Subject: [PATCH 4/6] update code --- htdocs/ecm/search.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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"))); From 0632855be6cf3f5518f4c58ffe01c4cc3100c876 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Mon, 29 Aug 2022 09:29:11 +0200 Subject: [PATCH 5/6] update code --- htdocs/projet/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); From f1e8ee671e464a51c14b09bbff11dceeba1e9ec3 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Mon, 29 Aug 2022 09:29:56 +0200 Subject: [PATCH 6/6] update code --- htdocs/societe/class/api_thirdparties.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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'); }