mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-09 19:18:22 +01:00
Use isModEnabled
This commit is contained in:
@@ -68,7 +68,7 @@ $conditions = array(
|
|||||||
'USERSIGN' => 1,
|
'USERSIGN' => 1,
|
||||||
'MAILING' => isModEnabled('mailing'),
|
'MAILING' => isModEnabled('mailing'),
|
||||||
'MAIL' => (isModEnabled('facture') || isModEnabled("propal") || isModEnabled('commande')),
|
'MAIL' => (isModEnabled('facture') || isModEnabled("propal") || isModEnabled('commande')),
|
||||||
'TICKET' => !empty($conf->ticket->enabled),
|
'TICKET' => isModEnabled('ticket'),
|
||||||
);
|
);
|
||||||
// Picto
|
// Picto
|
||||||
$picto = array(
|
$picto = array(
|
||||||
|
|||||||
@@ -222,7 +222,7 @@ if ((isModEnabled("fournisseur") && !empty($user->rights->fournisseur->facture->
|
|||||||
if (isModEnabled('contrat') && !empty($user->rights->contrat->lire)) {
|
if (isModEnabled('contrat') && !empty($user->rights->contrat->lire)) {
|
||||||
$elementList['contract'] = img_picto('', 'contract', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendContract'));
|
$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'));
|
$elementList['ticket_send'] = img_picto('', 'ticket', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToTicket'));
|
||||||
}
|
}
|
||||||
if (isModEnabled('expensereport') && !empty($user->rights->expensereport->lire)) {
|
if (isModEnabled('expensereport') && !empty($user->rights->expensereport->lire)) {
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ $workflowcodes = array(
|
|||||||
'WORKFLOW_TICKET_CREATE_INTERVENTION' => array (
|
'WORKFLOW_TICKET_CREATE_INTERVENTION' => array (
|
||||||
'family'=>'create',
|
'family'=>'create',
|
||||||
'position'=>25,
|
'position'=>25,
|
||||||
'enabled'=>(!empty($conf->ticket->enabled) && isModEnabled('ficheinter')),
|
'enabled'=>(isModEnabled('ticket') && isModEnabled('ficheinter')),
|
||||||
'picto'=>'ticket'
|
'picto'=>'ticket'
|
||||||
),
|
),
|
||||||
|
|
||||||
@@ -174,13 +174,13 @@ $workflowcodes = array(
|
|||||||
'WORKFLOW_TICKET_LINK_CONTRACT' => array(
|
'WORKFLOW_TICKET_LINK_CONTRACT' => array(
|
||||||
'family' => 'link_ticket',
|
'family' => 'link_ticket',
|
||||||
'position' => 75,
|
'position' => 75,
|
||||||
'enabled' => !empty($conf->ticket->enabled) && !empty($conf->contract->enabled),
|
'enabled' => isModEnabled('ticket') && !empty($conf->contract->enabled),
|
||||||
'picto' => 'ticket'
|
'picto' => 'ticket'
|
||||||
),
|
),
|
||||||
'WORKFLOW_TICKET_USE_PARENT_COMPANY_CONTRACTS' => array(
|
'WORKFLOW_TICKET_USE_PARENT_COMPANY_CONTRACTS' => array(
|
||||||
'family' => 'link_ticket',
|
'family' => 'link_ticket',
|
||||||
'position' => 76,
|
'position' => 76,
|
||||||
'enabled' => !empty($conf->ticket->enabled) && !empty($conf->contract->enabled),
|
'enabled' => isModEnabled('ticket') && !empty($conf->contract->enabled),
|
||||||
'picto' => 'ticket'
|
'picto' => 'ticket'
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -7404,7 +7404,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
|
|||||||
$substitutionarray['__MEMBER_NOTE_PRIVATE__'] = '__MEMBER_NOTE_PRIVATE__';*/
|
$substitutionarray['__MEMBER_NOTE_PRIVATE__'] = '__MEMBER_NOTE_PRIVATE__';*/
|
||||||
}
|
}
|
||||||
// add variables subtitutions ticket
|
// 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_TRACKID__'] = '__TICKET_TRACKID__';
|
||||||
$substitutionarray['__TICKET_SUBJECT__'] = '__TICKET_SUBJECT__';
|
$substitutionarray['__TICKET_SUBJECT__'] = '__TICKET_SUBJECT__';
|
||||||
$substitutionarray['__TICKET_TYPE__'] = '__TICKET_TYPE__';
|
$substitutionarray['__TICKET_TYPE__'] = '__TICKET_TYPE__';
|
||||||
|
|||||||
@@ -433,7 +433,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers
|
|||||||
if ($action == 'TICKET_CREATE') {
|
if ($action == 'TICKET_CREATE') {
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||||
// Auto link contract
|
// 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);
|
$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]);
|
$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
|
// 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 = new Fichinter($this->db);
|
||||||
$fichinter->socid = (int) $object->fk_soc;
|
$fichinter->socid = (int) $object->fk_soc;
|
||||||
$fichinter->fk_project = $projectid;
|
$fichinter->fk_project = $projectid;
|
||||||
|
|||||||
Reference in New Issue
Block a user