diff --git a/htdocs/admin/fckeditor.php b/htdocs/admin/fckeditor.php index f997c44ef6e..dd4748a99f1 100644 --- a/htdocs/admin/fckeditor.php +++ b/htdocs/admin/fckeditor.php @@ -68,7 +68,7 @@ $conditions = array( 'USERSIGN' => 1, 'MAILING' => isModEnabled('mailing'), 'MAIL' => (isModEnabled('facture') || isModEnabled("propal") || isModEnabled('commande')), - 'TICKET' => !empty($conf->ticket->enabled), + 'TICKET' => isModEnabled('ticket'), ); // Picto $picto = array( diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index 37ca91adf2b..02eef8a00d3 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -222,7 +222,7 @@ if ((isModEnabled("fournisseur") && !empty($user->rights->fournisseur->facture-> if (isModEnabled('contrat') && !empty($user->rights->contrat->lire)) { $elementList['contract'] = img_picto('', 'contract', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendContract')); } -if (!empty($conf->ticket->enabled) && !empty($user->rights->ticket->read)) { +if (isModEnabled('ticket') && !empty($user->rights->ticket->read)) { $elementList['ticket_send'] = img_picto('', 'ticket', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToTicket')); } if (isModEnabled('expensereport') && !empty($user->rights->expensereport->lire)) { diff --git a/htdocs/admin/workflow.php b/htdocs/admin/workflow.php index b48e907045f..8111b9e7b97 100644 --- a/htdocs/admin/workflow.php +++ b/htdocs/admin/workflow.php @@ -75,7 +75,7 @@ $workflowcodes = array( 'WORKFLOW_TICKET_CREATE_INTERVENTION' => array ( 'family'=>'create', 'position'=>25, - 'enabled'=>(!empty($conf->ticket->enabled) && isModEnabled('ficheinter')), + 'enabled'=>(isModEnabled('ticket') && isModEnabled('ficheinter')), 'picto'=>'ticket' ), @@ -174,13 +174,13 @@ $workflowcodes = array( 'WORKFLOW_TICKET_LINK_CONTRACT' => array( 'family' => 'link_ticket', 'position' => 75, - 'enabled' => !empty($conf->ticket->enabled) && !empty($conf->contract->enabled), + 'enabled' => isModEnabled('ticket') && !empty($conf->contract->enabled), 'picto' => 'ticket' ), 'WORKFLOW_TICKET_USE_PARENT_COMPANY_CONTRACTS' => array( 'family' => 'link_ticket', 'position' => 76, - 'enabled' => !empty($conf->ticket->enabled) && !empty($conf->contract->enabled), + 'enabled' => isModEnabled('ticket') && !empty($conf->contract->enabled), 'picto' => 'ticket' ), ); diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 90bf079f687..a6b76fdc909 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -7404,7 +7404,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, $substitutionarray['__MEMBER_NOTE_PRIVATE__'] = '__MEMBER_NOTE_PRIVATE__';*/ } // add variables subtitutions ticket - if (!empty($conf->ticket->enabled) && (!is_object($object) || $object->element == 'ticket')) { + if (isModEnabled('ticket') && (!is_object($object) || $object->element == 'ticket')) { $substitutionarray['__TICKET_TRACKID__'] = '__TICKET_TRACKID__'; $substitutionarray['__TICKET_SUBJECT__'] = '__TICKET_SUBJECT__'; $substitutionarray['__TICKET_TYPE__'] = '__TICKET_TYPE__'; diff --git a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php index 05717961076..267232a4a6b 100644 --- a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php +++ b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php @@ -433,7 +433,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers if ($action == 'TICKET_CREATE') { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); // Auto link contract - if (!empty($conf->contract->enabled) && !empty($conf->ticket->enabled) && isModEnabled('ficheinter') && !empty($conf->workflow->enabled) && !empty($conf->global->WORKFLOW_TICKET_LINK_CONTRACT) && !empty($conf->global->TICKET_PRODUCT_CATEGORY) && !empty($object->fk_soc)) { + if (!empty($conf->contract->enabled) && isModEnabled('ticket') && isModEnabled('ficheinter') && !empty($conf->workflow->enabled) && !empty($conf->global->WORKFLOW_TICKET_LINK_CONTRACT) && !empty($conf->global->TICKET_PRODUCT_CATEGORY) && !empty($object->fk_soc)) { $societe = new Societe($this->db); $company_ids = (empty($conf->global->WORKFLOW_TICKET_USE_PARENT_COMPANY_CONTRACTS)) ? [$object->fk_soc] : $societe->getParentsForCompany($object->fk_soc, [$object->fk_soc]); @@ -463,7 +463,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers } } // Automatically create intervention - if (isModEnabled('ficheinter') && !empty($conf->ticket->enabled) && !empty($conf->workflow->enabled) && !empty($conf->global->WORKFLOW_TICKET_CREATE_INTERVENTION)) { + if (isModEnabled('ficheinter') && isModEnabled('ticket') && !empty($conf->workflow->enabled) && !empty($conf->global->WORKFLOW_TICKET_CREATE_INTERVENTION)) { $fichinter = new Fichinter($this->db); $fichinter->socid = (int) $object->fk_soc; $fichinter->fk_project = $projectid;