forked from Wavyzz/dolibarr
Use isModEnabled
This commit is contained in:
@@ -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(
|
||||
|
||||
@@ -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)) {
|
||||
|
||||
@@ -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'
|
||||
),
|
||||
);
|
||||
|
||||
@@ -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__';
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user