From 6a0978580e25410c39662512a6f7399f7dda3b51 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 29 Aug 2022 10:47:01 +0200 Subject: [PATCH 01/99] Use IsModEnabled --- htdocs/ticket/agenda.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/ticket/agenda.php b/htdocs/ticket/agenda.php index 72c19c217b3..e0d06759d77 100644 --- a/htdocs/ticket/agenda.php +++ b/htdocs/ticket/agenda.php @@ -170,7 +170,7 @@ if (!empty($object->origin_email)) { } // 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) . ''; @@ -184,7 +184,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) { From 5a2fb2c3f4e258689891c6313b173de6f7abb3ca Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 29 Aug 2022 10:47:07 +0200 Subject: [PATCH 02/99] Use IsModEnabled --- htdocs/ticket/card.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index 13dffc545aa..589f7ca0590 100644 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -34,12 +34,12 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; -if (!empty($conf->project->enabled)) { +if (isModEnabled('project')) { include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; } -if (!empty($conf->contrat->enabled)) { +if (isModEnabled('contrat')) { include_once DOL_DOCUMENT_ROOT.'/core/lib/contract.lib.php'; include_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/class/html.formcontract.class.php'; @@ -698,7 +698,7 @@ if (empty($reshook)) { $userstat = new User($db); $form = new Form($db); $formticket = new FormTicket($db); -if (!empty($conf->project->enabled)) { +if (isModEnabled('project')) { $formproject = new FormProjets($db); } @@ -940,7 +940,7 @@ if ($action == 'create' || $action == 'presend') { } // Thirdparty - if (!empty($conf->societe->enabled)) { + if (isModEnabled('societe')) { $morehtmlref .= '
'.$langs->trans('ThirdParty').' '; if ($action != 'editcustomer' && $object->status < 8 && !$user->socid && $user->rights->ticket->write) { $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('Edit'), 0).' : '; @@ -953,7 +953,7 @@ if ($action == 'create' || $action == 'presend') { } // Project - if (!empty($conf->project->enabled)) { + if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->ticket->write) { @@ -1107,7 +1107,7 @@ if ($action == 'create' || $action == 'presend') { print ''; // Timing (Duration sum of linked fichinter) - if (!empty($conf->ficheinter->enabled)) { + if (isModEnabled('ficheinter')) { $object->fetchObjectLinked(); $num = count($object->linkedObjects); $timing = 0; From 2e518940b1793258f55c518a0f5817ce8ac0b278 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 29 Aug 2022 10:47:15 +0200 Subject: [PATCH 03/99] Use IsModEnabled --- htdocs/ticket/class/cticketcategory.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/ticket/class/cticketcategory.class.php b/htdocs/ticket/class/cticketcategory.class.php index aa971d9a5d5..dd8b75292ad 100644 --- a/htdocs/ticket/class/cticketcategory.class.php +++ b/htdocs/ticket/class/cticketcategory.class.php @@ -189,7 +189,7 @@ class CTicketCategory extends CommonObject if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid'])) { $this->fields['rowid']['visible'] = 0; } - if (empty($conf->multicompany->enabled) && isset($this->fields['entity'])) { + if (!isModEnabled('multicompany') && isset($this->fields['entity'])) { $this->fields['entity']['enabled'] = 0; } From 7edd4e78eb97b4d63dc8ec0808c2c4f9b7a1a8e5 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 29 Aug 2022 10:47:19 +0200 Subject: [PATCH 04/99] Use IsModEnabled --- htdocs/ticket/class/ticket.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 70c2eb05ea9..3d506c9951d 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -1816,7 +1816,7 @@ class Ticket extends CommonObject $error = 0; // Valid and close fichinter linked - if (!empty($conf->ficheinter->enabled) && !empty($conf->global->WORKFLOW_TICKET_CLOSE_INTERVENTION)) { + if (isModEnabled('ficheinter') && !empty($conf->global->WORKFLOW_TICKET_CLOSE_INTERVENTION)) { dol_syslog("We have closed the ticket, so we close all linked interventions"); $this->fetchObjectLinked($this->id, $this->element, null, 'fichinter'); if ($this->linkedObjectsIds) { From 1f3fd455707428802f025fdc89c9d46112207833 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 29 Aug 2022 10:47:23 +0200 Subject: [PATCH 05/99] Use IsModEnabled --- htdocs/ticket/contact.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/ticket/contact.php b/htdocs/ticket/contact.php index d32ab88eb1c..f41734e9fac 100644 --- a/htdocs/ticket/contact.php +++ b/htdocs/ticket/contact.php @@ -210,7 +210,7 @@ if ($id > 0 || !empty($track_id) || !empty($ref)) { } // 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) . ''; @@ -224,7 +224,7 @@ if ($id > 0 || !empty($track_id) || !empty($ref)) { } // Project - if (!empty($conf->project->enabled)) { + if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->ticket->write) { From 186bd8b73110752b986cc596bac3ae7ec7703c64 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 29 Aug 2022 10:47:26 +0200 Subject: [PATCH 06/99] Use IsModEnabled --- htdocs/ticket/document.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/ticket/document.php b/htdocs/ticket/document.php index 234c5e92918..fc7c50d5d70 100644 --- a/htdocs/ticket/document.php +++ b/htdocs/ticket/document.php @@ -145,7 +145,7 @@ if ($object->id) { } // 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) . ''; @@ -159,7 +159,7 @@ if ($object->id) { } // Project - if (!empty($conf->project->enabled)) { + if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->ticket->write) { From bf735600bf68d0da71848f005a624888bc97a87c Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 29 Aug 2022 10:47:38 +0200 Subject: [PATCH 07/99] Use isModEnabled --- htdocs/ticket/messaging.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) { From 78c2d859f4c9724ac1665a8877cd821d6d51342d Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 29 Aug 2022 10:52:37 +0200 Subject: [PATCH 08/99] Use isModEnabled --- htdocs/salaries/admin/salaries.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/salaries/admin/salaries.php b/htdocs/salaries/admin/salaries.php index f69e17336c6..5343d4831ba 100644 --- a/htdocs/salaries/admin/salaries.php +++ b/htdocs/salaries/admin/salaries.php @@ -27,7 +27,7 @@ require '../../main.inc.php'; // Class require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/salaries.lib.php'; -if (!empty($conf->accounting->enabled)) { +if (isModEnabled('accounting')) { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php'; } @@ -83,7 +83,7 @@ if (preg_match('/^(set|del)_?([A-Z_]+)$/', $action, $reg)) { llxHeader('', $langs->trans('SalariesSetup')); $form = new Form($db); -if (!empty($conf->accounting->enabled)) { +if (isModEnabled('accounting')) { $formaccounting = new FormAccounting($db); } @@ -119,7 +119,7 @@ foreach ($list as $key) { // Value print ''; - if (!empty($conf->accounting->enabled)) { + if (isModEnabled('accounting')) { print $formaccounting->select_account(getDolGlobalString($key), $key, 1, '', 1, 1); } else { print ''; From be043fb088973af7c4daf2fb866e910ebe14ebcd Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 29 Aug 2022 10:52:45 +0200 Subject: [PATCH 09/99] Use isModEnabled --- htdocs/salaries/card.php | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/htdocs/salaries/card.php b/htdocs/salaries/card.php index 7d57575dacd..a849b00a282 100644 --- a/htdocs/salaries/card.php +++ b/htdocs/salaries/card.php @@ -35,14 +35,14 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/salaries.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -if (!empty($conf->project->enabled)) { +if (isModEnabled('projet')) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } // Load translation files required by the page $langs->loadLangs(array("compta", "banks", "bills", "users", "salaries", "hrm", "trips")); -if (!empty($conf->project->enabled)) { +if (isModEnabled('projet')) { $langs->load("projects"); } @@ -260,7 +260,7 @@ if ($action == 'add' && empty($cancel)) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Amount")), null, 'errors'); $error++; } - if (!empty($conf->banque->enabled) && !empty($auto_create_paiement) && !$object->accountid > 0) { + if (isModEnabled('banque') && !empty($auto_create_paiement) && !$object->accountid > 0) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("BankAccount")), null, 'errors'); $error++; } @@ -441,7 +441,7 @@ if ($action == "update_extras" && !empty($user->rights->salaries->read)) { $form = new Form($db); $formfile = new FormFile($db); -if (!empty($conf->project->enabled)) $formproject = new FormProjets($db); +if (isModEnabled('projet')) $formproject = new FormProjets($db); $title = $langs->trans('Salary')." - ".$langs->trans('Card'); $help_url = ""; @@ -559,7 +559,7 @@ if ($action == 'create') { print ''; // Project - if (!empty($conf->project->enabled)) { + if (isModEnabled('projet')) { $formproject = new FormProjets($db); print ''.$langs->trans("Project").''; @@ -583,7 +583,7 @@ if ($action == 'create') { print ''."\n"; // Date payment // Bank - if (!empty($conf->banque->enabled)) { + if (isModEnabled('banque')) { print ''; print $form->editfieldkey('BankAccount', 'selectaccountid', '', $object, 0, 'string', '', 1).''; print img_picto('', 'bank_account', 'class="paddingrighonly"'); @@ -610,7 +610,7 @@ if ($action == 'create') { print ''; // Number - if (!empty($conf->banque->enabled)) { + if (isModEnabled('banque')) { // Number print '