diff --git a/htdocs/ticket/messaging.php b/htdocs/ticket/messaging.php
index df829a010ec..0abbf568c26 100644
--- a/htdocs/ticket/messaging.php
+++ b/htdocs/ticket/messaging.php
@@ -171,7 +171,7 @@ if ($object->fk_user_create > 0) {
}
// Thirdparty
-if (!empty($conf->societe->enabled)) {
+if (isModEnabled('societe')) {
$morehtmlref .= '
'.$langs->trans('ThirdParty');
/*if ($action != 'editcustomer' && $object->fk_statut < 8 && !$user->socid && $user->rights->ticket->write) {
$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('Edit'), 1) . '';
@@ -185,7 +185,7 @@ if (!empty($conf->societe->enabled)) {
}
// Project
-if (!empty($conf->project->enabled)) {
+if (isModEnabled('project')) {
$langs->load("projects");
$morehtmlref .= '
'.$langs->trans('Project');
if ($user->rights->ticket->write) {