From 14b328bc8958af57f7bf03b879970fa6a9116ee3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 9 Jun 2023 13:39:41 +0200 Subject: [PATCH 1/4] use user hasRight --- htdocs/accountancy/expensereport/card.php | 2 +- htdocs/accountancy/expensereport/lines.php | 2 +- htdocs/accountancy/expensereport/list.php | 2 +- htdocs/accountancy/journal/bankjournal.php | 2 +- htdocs/accountancy/journal/expensereportsjournal.php | 2 +- htdocs/accountancy/journal/purchasesjournal.php | 2 +- htdocs/accountancy/journal/sellsjournal.php | 2 +- htdocs/accountancy/journal/variousjournal.php | 2 +- htdocs/accountancy/supplier/card.php | 2 +- htdocs/accountancy/supplier/index.php | 4 ++-- htdocs/accountancy/supplier/lines.php | 2 +- 11 files changed, 12 insertions(+), 12 deletions(-) diff --git a/htdocs/accountancy/expensereport/card.php b/htdocs/accountancy/expensereport/card.php index 63848372044..880e696354d 100644 --- a/htdocs/accountancy/expensereport/card.php +++ b/htdocs/accountancy/expensereport/card.php @@ -48,7 +48,7 @@ if (!isModEnabled('accounting')) { if ($user->socid > 0) { accessforbidden(); } -if (empty($user->rights->accounting->mouvements->lire)) { +if (!$user->hasRight('accounting', 'mouvements', 'lire')) { accessforbidden(); } diff --git a/htdocs/accountancy/expensereport/lines.php b/htdocs/accountancy/expensereport/lines.php index c523df85326..9f1fe74d0ea 100644 --- a/htdocs/accountancy/expensereport/lines.php +++ b/htdocs/accountancy/expensereport/lines.php @@ -87,7 +87,7 @@ if (!isModEnabled('accounting')) { if ($user->socid > 0) { accessforbidden(); } -if (empty($user->rights->accounting->mouvements->lire)) { +if (!$user->hasRight('accounting', 'mouvements', 'lire')) { accessforbidden(); } diff --git a/htdocs/accountancy/expensereport/list.php b/htdocs/accountancy/expensereport/list.php index 67d8be1b38a..5a417cef7a9 100644 --- a/htdocs/accountancy/expensereport/list.php +++ b/htdocs/accountancy/expensereport/list.php @@ -104,7 +104,7 @@ if (!isModEnabled('accounting')) { if ($user->socid > 0) { accessforbidden(); } -if (empty($user->rights->accounting->mouvements->lire)) { +if (!$user->hasRight('accounting', 'mouvements', 'lire')) { accessforbidden(); } diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index 41c88e00c4f..68e8b5c94ef 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -90,7 +90,7 @@ if (!isModEnabled('accounting')) { if ($user->socid > 0) { accessforbidden(); } -if (empty($user->rights->accounting->mouvements->lire)) { +if (!$user->hasRight('accounting', 'mouvements', 'lire')) { accessforbidden(); } diff --git a/htdocs/accountancy/journal/expensereportsjournal.php b/htdocs/accountancy/journal/expensereportsjournal.php index 514edeb4528..bed71d9d27b 100644 --- a/htdocs/accountancy/journal/expensereportsjournal.php +++ b/htdocs/accountancy/journal/expensereportsjournal.php @@ -64,7 +64,7 @@ if (!isModEnabled('accounting')) { if ($user->socid > 0) { accessforbidden(); } -if (empty($user->rights->accounting->mouvements->lire)) { +if (!$user->hasRight('accounting', 'mouvements', 'lire')) { accessforbidden(); } diff --git a/htdocs/accountancy/journal/purchasesjournal.php b/htdocs/accountancy/journal/purchasesjournal.php index fdce681f7ef..6d6c875cf85 100644 --- a/htdocs/accountancy/journal/purchasesjournal.php +++ b/htdocs/accountancy/journal/purchasesjournal.php @@ -68,7 +68,7 @@ if (!isModEnabled('accounting')) { if ($user->socid > 0) { accessforbidden(); } -if (empty($user->rights->accounting->mouvements->lire)) { +if (!$user->hasRight('accounting', 'mouvements', 'lire')) { accessforbidden(); } diff --git a/htdocs/accountancy/journal/sellsjournal.php b/htdocs/accountancy/journal/sellsjournal.php index 3f7b4ecdeb5..7cae93566c6 100644 --- a/htdocs/accountancy/journal/sellsjournal.php +++ b/htdocs/accountancy/journal/sellsjournal.php @@ -70,7 +70,7 @@ if (!isModEnabled('accounting')) { if ($user->socid > 0) { accessforbidden(); } -if (empty($user->rights->accounting->mouvements->lire)) { +if (!$user->hasRight('accounting', 'mouvements', 'lire')) { accessforbidden(); } diff --git a/htdocs/accountancy/journal/variousjournal.php b/htdocs/accountancy/journal/variousjournal.php index 621683ea4cb..a2e9d362aad 100644 --- a/htdocs/accountancy/journal/variousjournal.php +++ b/htdocs/accountancy/journal/variousjournal.php @@ -90,7 +90,7 @@ if (!isModEnabled('accounting')) { if ($user->socid > 0) { accessforbidden(); } -if (empty($user->rights->accounting->mouvements->lire)) { +if (!$user->hasRight('accounting', 'mouvements', 'lire')) { accessforbidden(); } diff --git a/htdocs/accountancy/supplier/card.php b/htdocs/accountancy/supplier/card.php index b393c0f54ce..bc7393c4bbd 100644 --- a/htdocs/accountancy/supplier/card.php +++ b/htdocs/accountancy/supplier/card.php @@ -48,7 +48,7 @@ if (!isModEnabled('accounting')) { if ($user->socid > 0) { accessforbidden(); } -if (empty($user->rights->accounting->mouvements->lire)) { +if (!$user->hasRight('accounting', 'mouvements', 'lire')) { accessforbidden(); } diff --git a/htdocs/accountancy/supplier/index.php b/htdocs/accountancy/supplier/index.php index d6df336d979..8fdff8628d2 100644 --- a/htdocs/accountancy/supplier/index.php +++ b/htdocs/accountancy/supplier/index.php @@ -45,7 +45,7 @@ if (!isModEnabled('accounting')) { if ($user->socid > 0) { accessforbidden(); } -if (empty($user->rights->accounting->bind->write)) { +if (!$user->hasRight('accounting', 'bind', 'write')) { accessforbidden(); } @@ -82,7 +82,7 @@ if (!isModEnabled('accounting')) { if ($user->socid > 0) { accessforbidden(); } -if (empty($user->rights->accounting->mouvements->lire)) { +if (!$user->hasRight('accounting', 'mouvements', 'lire')) { accessforbidden(); } diff --git a/htdocs/accountancy/supplier/lines.php b/htdocs/accountancy/supplier/lines.php index 06fd0369f03..cd3269431ad 100644 --- a/htdocs/accountancy/supplier/lines.php +++ b/htdocs/accountancy/supplier/lines.php @@ -97,7 +97,7 @@ if (!isModEnabled('accounting')) { if ($user->socid > 0) { accessforbidden(); } -if (empty($user->rights->accounting->mouvements->lire)) { +if (!$user->hasRight('accounting', 'mouvements', 'lire')) { accessforbidden(); } From bb2c112f763cbcd677943018559e2e80b5c55c3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 9 Jun 2023 13:45:19 +0200 Subject: [PATCH 2/4] use isModEnabled --- htdocs/admin/eventorganization.php | 2 +- htdocs/admin/webhook.php | 2 +- htdocs/asset/admin/setup.php | 2 +- htdocs/categories/edit.php | 2 +- htdocs/comm/action/card.php | 2 +- htdocs/core/class/doleditor.class.php | 2 +- htdocs/core/class/html.formsetup.class.php | 2 +- htdocs/product/stock/card.php | 4 ++-- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/admin/eventorganization.php b/htdocs/admin/eventorganization.php index 0d10602b1c4..2ffb966828b 100644 --- a/htdocs/admin/eventorganization.php +++ b/htdocs/admin/eventorganization.php @@ -230,7 +230,7 @@ if ($action == 'edit') { print "\n"; } elseif ($val['type']== 'html') { require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php'; - $doleditor = new DolEditor($constname, getDolGlobalString($constname), '', 160, 'dolibarr_notes', '', false, false, $conf->fckeditor->enabled, ROWS_5, '90%'); + $doleditor = new DolEditor($constname, getDolGlobalString($constname), '', 160, 'dolibarr_notes', '', false, false, isModEnabled('fckeditor'), ROWS_5, '90%'); $doleditor->Create(); } elseif ($val['type'] == 'yesno') { print $form->selectyesno($constname, getDolGlobalString($constname), 1); diff --git a/htdocs/admin/webhook.php b/htdocs/admin/webhook.php index 8c109a042b6..00a3c85f8c7 100644 --- a/htdocs/admin/webhook.php +++ b/htdocs/admin/webhook.php @@ -226,7 +226,7 @@ if ($action == 'edit') { print "\n"; } elseif ($val['type']== 'html') { require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php'; - $doleditor = new DolEditor($constname, getDolGlobalString($constname), '', 160, 'dolibarr_notes', '', false, false, $conf->fckeditor->enabled, ROWS_5, '90%'); + $doleditor = new DolEditor($constname, getDolGlobalString($constname), '', 160, 'dolibarr_notes', '', false, false, isModEnabled('fckeditor'), ROWS_5, '90%'); $doleditor->Create(); } elseif ($val['type'] == 'yesno') { print $form->selectyesno($constname, getDolGlobalString($constname), 1); diff --git a/htdocs/asset/admin/setup.php b/htdocs/asset/admin/setup.php index 4d0a553d1e6..7b5704b3d7a 100644 --- a/htdocs/asset/admin/setup.php +++ b/htdocs/asset/admin/setup.php @@ -477,7 +477,7 @@ if ($action == 'edit') { print "\n"; } elseif ($val['type']== 'html') { require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php'; - $doleditor = new DolEditor($constname, getDolGlobalString($constname), '', 160, 'dolibarr_notes', '', false, false, $conf->fckeditor->enabled, ROWS_5, '90%'); + $doleditor = new DolEditor($constname, getDolGlobalString($constname), '', 160, 'dolibarr_notes', '', false, false, isModEnabled('fckeditor'), ROWS_5, '90%'); $doleditor->Create(); } elseif ($val['type'] == 'yesno') { print $form->selectyesno($constname, getDolGlobalString($constname), 1); diff --git a/htdocs/categories/edit.php b/htdocs/categories/edit.php index caacc986cc5..b21d0a1c27c 100644 --- a/htdocs/categories/edit.php +++ b/htdocs/categories/edit.php @@ -166,7 +166,7 @@ print ''; print ''.$langs->trans("Description").''; print ''; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; -$doleditor = new DolEditor('description', $object->description, '', 200, 'dolibarr_notes', '', false, true, $conf->fckeditor->enabled, ROWS_6, '90%'); +$doleditor = new DolEditor('description', $object->description, '', 200, 'dolibarr_notes', '', false, true, isModEnabled('fckeditor'), ROWS_6, '90%'); $doleditor->Create(); print ''; diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 158cfc3aef0..5d9995bfaba 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -2016,7 +2016,7 @@ if ($id > 0) { print ''.$langs->trans("Description").''; // Editeur wysiwyg require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor = new DolEditor('note', $object->note_private, '', 120, 'dolibarr_notes', 'In', true, true, $conf->fckeditor->enabled, ROWS_4, '90%'); + $doleditor = new DolEditor('note', $object->note_private, '', 120, 'dolibarr_notes', 'In', true, true, isModEnabled('fckeditor'), ROWS_4, '90%'); $doleditor->Create(); print ''; diff --git a/htdocs/core/class/doleditor.class.php b/htdocs/core/class/doleditor.class.php index bb63c1dd927..973db087e06 100644 --- a/htdocs/core/class/doleditor.class.php +++ b/htdocs/core/class/doleditor.class.php @@ -90,7 +90,7 @@ class DolEditor $this->readonly = $readonly; // Check if extended editor is ok. If not we force textarea - if ((empty($conf->fckeditor->enabled) && $okforextendededitor != 'ace') || empty($okforextendededitor)) { + if ((!isModEnabled('fckeditor') && $okforextendededitor != 'ace') || empty($okforextendededitor)) { $this->tool = 'textarea'; } if ($okforextendededitor === 'ace') { diff --git a/htdocs/core/class/html.formsetup.class.php b/htdocs/core/class/html.formsetup.class.php index a3908df0adb..0b56169cf33 100644 --- a/htdocs/core/class/html.formsetup.class.php +++ b/htdocs/core/class/html.formsetup.class.php @@ -900,7 +900,7 @@ class FormSetupItem { global $conf; require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php'; - $doleditor = new DolEditor($this->confKey, $this->fieldValue, '', 160, 'dolibarr_notes', '', false, false, $conf->fckeditor->enabled, ROWS_5, '90%'); + $doleditor = new DolEditor($this->confKey, $this->fieldValue, '', 160, 'dolibarr_notes', '', false, false, isModEnabled('fckeditor'), ROWS_5, '90%'); return $doleditor->Create(1); } diff --git a/htdocs/product/stock/card.php b/htdocs/product/stock/card.php index bb8b15d7c10..fee0352bd40 100644 --- a/htdocs/product/stock/card.php +++ b/htdocs/product/stock/card.php @@ -330,7 +330,7 @@ if ($action == 'create') { print ''.$langs->trans("Description").''; // Editeur wysiwyg require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor = new DolEditor('desc', (!empty($object->description) ? $object->description : ''), '', 180, 'dolibarr_notes', 'In', false, true, empty($conf->fckeditor->enabled) ? '' : $conf->fckeditor->enabled, ROWS_5, '90%'); + $doleditor = new DolEditor('desc', (!empty($object->description) ? $object->description : ''), '', 180, 'dolibarr_notes', 'In', false, true, isModEnabled('fckeditor'), ROWS_5, '90%'); $doleditor->Create(); print ''; @@ -900,7 +900,7 @@ if ($action == 'create') { print ''.$langs->trans("Description").''; // Editeur wysiwyg require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor = new DolEditor('desc', $object->description, '', 180, 'dolibarr_notes', 'In', false, true, $conf->fckeditor->enabled, ROWS_5, '90%'); + $doleditor = new DolEditor('desc', $object->description, '', 180, 'dolibarr_notes', 'In', false, true, isModEnabled('fckeditor'), ROWS_5, '90%'); $doleditor->Create(); print ''; From d66ed4adf9dddb6a483c5aa73916f92b2824ce24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 9 Jun 2023 13:47:07 +0200 Subject: [PATCH 3/4] use isModEnabled --- htdocs/expedition/dispatch.php | 2 +- htdocs/loan/note.php | 4 ++-- htdocs/loan/schedule.php | 2 +- htdocs/partnership/partnership_agenda.php | 2 +- htdocs/partnership/partnership_contact.php | 2 +- htdocs/partnership/partnership_document.php | 2 +- htdocs/partnership/partnership_note.php | 2 +- htdocs/product/inventory/card.php | 2 +- htdocs/product/inventory/inventory.php | 2 +- htdocs/product/stock/card.php | 10 +++++----- htdocs/product/stock/info.php | 2 +- htdocs/product/stock/movement_card.php | 4 ++-- htdocs/product/stock/movement_list.php | 6 +++--- htdocs/product/stock/product.php | 4 ++-- .../stock/stocktransfer/stocktransfer_agenda.php | 2 +- .../product/stock/stocktransfer/stocktransfer_card.php | 2 +- .../stock/stocktransfer/stocktransfer_contact.php | 2 +- .../stock/stocktransfer/stocktransfer_document.php | 2 +- .../product/stock/stocktransfer/stocktransfer_note.php | 2 +- htdocs/product/stock/tpl/stockcorrection.tpl.php | 2 +- htdocs/reception/card.php | 8 ++++---- htdocs/reception/contact.php | 4 ++-- htdocs/reception/dispatch.php | 2 +- htdocs/reception/document.php | 4 ++-- htdocs/reception/note.php | 4 ++-- htdocs/recruitment/recruitmentcandidature_agenda.php | 2 +- htdocs/recruitment/recruitmentcandidature_card.php | 2 +- htdocs/recruitment/recruitmentcandidature_document.php | 2 +- htdocs/recruitment/recruitmentcandidature_list.php | 2 +- htdocs/recruitment/recruitmentcandidature_note.php | 2 +- htdocs/recruitment/recruitmentjobposition_agenda.php | 2 +- .../recruitmentjobposition_applications.php | 2 +- htdocs/recruitment/recruitmentjobposition_card.php | 2 +- htdocs/recruitment/recruitmentjobposition_document.php | 2 +- htdocs/recruitment/recruitmentjobposition_note.php | 2 +- htdocs/supplier_proposal/card.php | 6 +++--- htdocs/supplier_proposal/contact.php | 2 +- htdocs/supplier_proposal/document.php | 4 ++-- htdocs/supplier_proposal/info.php | 4 ++-- htdocs/supplier_proposal/list.php | 2 +- htdocs/supplier_proposal/note.php | 4 ++-- htdocs/user/param_ihm.php | 2 +- htdocs/website/websiteaccount_card.php | 2 +- 43 files changed, 63 insertions(+), 63 deletions(-) diff --git a/htdocs/expedition/dispatch.php b/htdocs/expedition/dispatch.php index 055cff0352e..5707b3474ef 100644 --- a/htdocs/expedition/dispatch.php +++ b/htdocs/expedition/dispatch.php @@ -382,7 +382,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref .= '
'.$object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->project->enabled)) { + if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
'; if (0) { // Do not change on reception diff --git a/htdocs/loan/note.php b/htdocs/loan/note.php index b3ae1a0d8de..96ef500d642 100644 --- a/htdocs/loan/note.php +++ b/htdocs/loan/note.php @@ -31,7 +31,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/loan/class/loan.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/loan.lib.php'; -if (!empty($conf->project->enabled)) { +if (isModEnabled('project')) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -93,7 +93,7 @@ if ($id > 0) { $morehtmlref .= $form->editfieldkey("Label", 'label', $object->label, $object, 0, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("Label", 'label', $object->label, $object, 0, 'string', '', null, null, '', 1); // Project - if (!empty($conf->project->enabled)) { + if (isModEnabled('project')) { $langs->loadLangs(array("projects")); $morehtmlref .= '
'.$langs->trans('Project').' : '; if ($user->rights->loan->write) { diff --git a/htdocs/loan/schedule.php b/htdocs/loan/schedule.php index 61d763b693e..510ec062269 100644 --- a/htdocs/loan/schedule.php +++ b/htdocs/loan/schedule.php @@ -150,7 +150,7 @@ $morehtmlref = '
'; $morehtmlref .= $form->editfieldkey("Label", 'label', $object->label, $object, 0, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("Label", 'label', $object->label, $object, 0, 'string', '', null, null, '', 1); // Project -if (!empty($conf->project->enabled)) { +if (isModEnabled('project')) { $langs->loadLangs(array("projects")); $morehtmlref .= '
'.$langs->trans('Project').' : '; if ($user->rights->loan->write) { diff --git a/htdocs/partnership/partnership_agenda.php b/htdocs/partnership/partnership_agenda.php index f4b8275a8f6..64a5c0ea5c2 100644 --- a/htdocs/partnership/partnership_agenda.php +++ b/htdocs/partnership/partnership_agenda.php @@ -158,7 +158,7 @@ if ($object->id > 0) { // Thirdparty $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (!empty($conf->project->enabled)) { + if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref.='
'.$langs->trans('Project') . ' '; if ($permissiontoadd) { diff --git a/htdocs/partnership/partnership_contact.php b/htdocs/partnership/partnership_contact.php index 270645c0d52..415b24c3fdf 100644 --- a/htdocs/partnership/partnership_contact.php +++ b/htdocs/partnership/partnership_contact.php @@ -141,7 +141,7 @@ if ($object->id) { // Thirdparty $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (!empty($conf->project->enabled)) + if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref.='
'.$langs->trans('Project') . ' '; diff --git a/htdocs/partnership/partnership_document.php b/htdocs/partnership/partnership_document.php index 8651590e37a..481bf2793de 100644 --- a/htdocs/partnership/partnership_document.php +++ b/htdocs/partnership/partnership_document.php @@ -136,7 +136,7 @@ if ($object->id) { // Thirdparty $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (!empty($conf->project->enabled)) + if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref.='
'.$langs->trans('Project') . ' '; diff --git a/htdocs/partnership/partnership_note.php b/htdocs/partnership/partnership_note.php index 3fc15e362ac..e75e28e273e 100644 --- a/htdocs/partnership/partnership_note.php +++ b/htdocs/partnership/partnership_note.php @@ -115,7 +115,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (!empty($conf->project->enabled)) + if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref.='
'.$langs->trans('Project') . ' '; diff --git a/htdocs/product/inventory/card.php b/htdocs/product/inventory/card.php index 874c1918de2..7db7f5af6a4 100644 --- a/htdocs/product/inventory/card.php +++ b/htdocs/product/inventory/card.php @@ -314,7 +314,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Thirdparty $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . $soc->getNomUrl(1); // Project - if (!empty($conf->project->enabled)) + if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref.='
'.$langs->trans('Project') . ' '; diff --git a/htdocs/product/inventory/inventory.php b/htdocs/product/inventory/inventory.php index f6a852b0c63..8f595abcc53 100644 --- a/htdocs/product/inventory/inventory.php +++ b/htdocs/product/inventory/inventory.php @@ -493,7 +493,7 @@ $morehtmlref.=$form->editfieldval("RefBis", 'ref_client', $object->ref_client, $ // Thirdparty $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . $soc->getNomUrl(1); // Project -if (!empty($conf->project->enabled)) +if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref.='
'.$langs->trans('Project') . ' '; diff --git a/htdocs/product/stock/card.php b/htdocs/product/stock/card.php index fee0352bd40..1fcd4e11792 100644 --- a/htdocs/product/stock/card.php +++ b/htdocs/product/stock/card.php @@ -39,7 +39,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; -if (!empty($conf->project->enabled)) { +if (isModEnabled('project')) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } @@ -280,7 +280,7 @@ $form = new Form($db); $formproduct = new FormProduct($db); $formcompany = new FormCompany($db); $formfile = new FormFile($db); -if (!empty($conf->project->enabled)) { +if (isModEnabled('project')) { $formproject = new FormProjets($db); } @@ -318,7 +318,7 @@ if ($action == 'create') { print ''; // Project - if (!empty($conf->project->enabled)) { + if (isModEnabled('project')) { $langs->load('projects'); print ''.$langs->trans('Project').''; print img_picto('', 'project').$formproject->select_projects(($socid > 0 ? $socid : -1), $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500'); @@ -440,7 +440,7 @@ if ($action == 'create') { $morehtmlref .= $langs->trans("LocationSummary").' : '.$object->lieu; // Project - if (!empty($conf->project->enabled)) { + if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
'.img_picto('', 'project').' '.$langs->trans('Project').' '; if ($usercancreate) { @@ -887,7 +887,7 @@ if ($action == 'create') { print ''; // Project - if (!empty($conf->project->enabled)) { + if (isModEnabled('project')) { $projectid = $object->fk_project; $langs->load('projects'); print ''.$langs->trans('Project').''; diff --git a/htdocs/product/stock/info.php b/htdocs/product/stock/info.php index 29965516498..6bed56acd0d 100644 --- a/htdocs/product/stock/info.php +++ b/htdocs/product/stock/info.php @@ -60,7 +60,7 @@ $morehtmlref = '
'; $morehtmlref .= $langs->trans("LocationSummary").' : '.$object->lieu; // Project -if (!empty($conf->project->enabled)) { +if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
'.img_picto('', 'project').' '.$langs->trans('Project').' '; if ($usercancreate) { diff --git a/htdocs/product/stock/movement_card.php b/htdocs/product/stock/movement_card.php index 571ff25a753..7cc649428c2 100644 --- a/htdocs/product/stock/movement_card.php +++ b/htdocs/product/stock/movement_card.php @@ -38,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/stock.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; -if (!empty($conf->project->enabled)) { +if (isModEnabled('project')) { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -426,7 +426,7 @@ $userstatic = new User($db); $form = new Form($db); $formother = new FormOther($db); $formproduct = new FormProduct($db); -if (!empty($conf->project->enabled)) { +if (isModEnabled('project')) { $formproject = new FormProjets($db); } diff --git a/htdocs/product/stock/movement_list.php b/htdocs/product/stock/movement_list.php index 92bf74fa104..e0366f48eb2 100644 --- a/htdocs/product/stock/movement_list.php +++ b/htdocs/product/stock/movement_list.php @@ -39,7 +39,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/stock.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; -if (!empty($conf->project->enabled)) { +if (isModEnabled('project')) { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -593,7 +593,7 @@ if ($action == "transfert_stock" && !$cancel) { $form = new Form($db); $formproduct = new FormProduct($db); -if (!empty($conf->project->enabled)) { +if (isModEnabled('project')) { $formproject = new FormProjets($db); } $productlot = new ProductLot($db); @@ -795,7 +795,7 @@ if ($object->id > 0) { $morehtmlref .= $langs->trans("LocationSummary").' : '.$object->lieu; // Project - if (!empty($conf->project->enabled)) { + if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
'.img_picto('', 'project').' '.$langs->trans('Project').' '; if ($usercancreate && 1 == 2) { diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index 7befa095142..7047ca7391c 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -43,7 +43,7 @@ require_once DOL_DOCUMENT_ROOT.'/product/stock/class/productstockentrepot.class. if (isModEnabled('productbatch')) { require_once DOL_DOCUMENT_ROOT.'/product/class/productbatch.class.php'; } -if (!empty($conf->project->enabled)) { +if (isModEnabled('project')) { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -531,7 +531,7 @@ if ($action == 'updateline' && GETPOST('save') == $langs->trans("Save")) { $form = new Form($db); $formproduct = new FormProduct($db); -if (!empty($conf->project->enabled)) { +if (isModEnabled('project')) { $formproject = new FormProjets($db); } diff --git a/htdocs/product/stock/stocktransfer/stocktransfer_agenda.php b/htdocs/product/stock/stocktransfer/stocktransfer_agenda.php index 55545a6868c..1f416982b66 100644 --- a/htdocs/product/stock/stocktransfer/stocktransfer_agenda.php +++ b/htdocs/product/stock/stocktransfer/stocktransfer_agenda.php @@ -135,7 +135,7 @@ if ($object->id > 0) { // Thirdparty $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (!empty($conf->project->enabled)) + if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref.='
'.$langs->trans('Project') . ' '; diff --git a/htdocs/product/stock/stocktransfer/stocktransfer_card.php b/htdocs/product/stock/stocktransfer/stocktransfer_card.php index 171408df070..5dade5dc874 100644 --- a/htdocs/product/stock/stocktransfer/stocktransfer_card.php +++ b/htdocs/product/stock/stocktransfer/stocktransfer_card.php @@ -563,7 +563,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $morehtmlref .= $langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : '').'
'; } // Project - if (!empty($conf->project->enabled)) { + if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref.=$langs->trans('Project') . ' '; if ($permissiontoadd) { diff --git a/htdocs/product/stock/stocktransfer/stocktransfer_contact.php b/htdocs/product/stock/stocktransfer/stocktransfer_contact.php index 045af2dd42a..7265fd992a1 100644 --- a/htdocs/product/stock/stocktransfer/stocktransfer_contact.php +++ b/htdocs/product/stock/stocktransfer/stocktransfer_contact.php @@ -134,7 +134,7 @@ if ($object->id > 0) { $morehtmlref .= '
' . $langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1, 'customer'); } // Project - if (!empty($conf->project->enabled)) { + if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->stocktransfer->stocktransfer->write) { diff --git a/htdocs/product/stock/stocktransfer/stocktransfer_document.php b/htdocs/product/stock/stocktransfer/stocktransfer_document.php index 7220581bc52..d4d3bc2d91d 100644 --- a/htdocs/product/stock/stocktransfer/stocktransfer_document.php +++ b/htdocs/product/stock/stocktransfer/stocktransfer_document.php @@ -122,7 +122,7 @@ if ($object->id) { // Thirdparty $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (!empty($conf->project->enabled)) + if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref.='
'.$langs->trans('Project') . ' '; diff --git a/htdocs/product/stock/stocktransfer/stocktransfer_note.php b/htdocs/product/stock/stocktransfer/stocktransfer_note.php index 2176af2803a..0aee6e59124 100644 --- a/htdocs/product/stock/stocktransfer/stocktransfer_note.php +++ b/htdocs/product/stock/stocktransfer/stocktransfer_note.php @@ -95,7 +95,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (!empty($conf->project->enabled)) + if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref.='
'.$langs->trans('Project') . ' '; diff --git a/htdocs/product/stock/tpl/stockcorrection.tpl.php b/htdocs/product/stock/tpl/stockcorrection.tpl.php index 793c0dcd1e4..e13ac6d7c23 100644 --- a/htdocs/product/stock/tpl/stockcorrection.tpl.php +++ b/htdocs/product/stock/tpl/stockcorrection.tpl.php @@ -182,7 +182,7 @@ if (ismodEnabled('productbatch') && print ''; print ''.$langs->trans("UnitPurchaseValue").''; print ''; -if (!empty($conf->project->enabled)) { +if (isModEnabled('project')) { print ''.$langs->trans('Project').''; print ''; print img_picto('', 'project'); diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index f1b7d98b5b3..7692c44c82a 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -56,7 +56,7 @@ require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.dispatch.class if (isModEnabled('productbatch')) { require_once DOL_DOCUMENT_ROOT.'/product/class/productbatch.class.php'; } -if (!empty($conf->project->enabled)) { +if (isModEnabled('project')) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } @@ -742,7 +742,7 @@ llxHeader('', $title, 'Reception'); $form = new Form($db); $formfile = new FormFile($db); $formproduct = new FormProduct($db); -if (!empty($conf->project->enabled)) { +if (isModEnabled('project')) { $formproject = new FormProjets($db); } @@ -829,7 +829,7 @@ if ($action == 'create') { print ''; // Project - if (!empty($conf->project->enabled)) { + if (isModEnabled('project')) { $projectid = GETPOST('projectid', 'int') ?GETPOST('projectid', 'int') : 0; if (empty($projectid) && !empty($objectsrc->fk_project)) { $projectid = $objectsrc->fk_project; @@ -1422,7 +1422,7 @@ if ($action == 'create') { // Thirdparty $morehtmlref .= '
'.$object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->project->enabled)) { + if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
'; if (0) { // Do not change on reception diff --git a/htdocs/reception/contact.php b/htdocs/reception/contact.php index 57bfa8bbf4d..e33885d0d51 100644 --- a/htdocs/reception/contact.php +++ b/htdocs/reception/contact.php @@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/reception.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; -if (!empty($conf->project->enabled)) { +if (isModEnabled('project')) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } @@ -164,7 +164,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref .= '
'.$object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->project->enabled)) { + if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
'; if (0) { // Do not change on reception diff --git a/htdocs/reception/dispatch.php b/htdocs/reception/dispatch.php index 9c0842442ca..112a6d51cd0 100644 --- a/htdocs/reception/dispatch.php +++ b/htdocs/reception/dispatch.php @@ -354,7 +354,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref .= '
'.$object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->project->enabled)) { + if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
'; if (0) { // Do not change on reception diff --git a/htdocs/reception/document.php b/htdocs/reception/document.php index 6641cfaecf6..3acadddec74 100644 --- a/htdocs/reception/document.php +++ b/htdocs/reception/document.php @@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/reception.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/reception/class/reception.class.php'; -if (!empty($conf->project->enabled)) { +if (isModEnabled('project')) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; @@ -155,7 +155,7 @@ if ($id > 0 || !empty($ref)) { $morehtmlref .= '
'.$object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->project->enabled)) { + if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
'; if (0) { // Do not change on reception diff --git a/htdocs/reception/note.php b/htdocs/reception/note.php index 3f83d8d2b2f..b227a3e4a43 100644 --- a/htdocs/reception/note.php +++ b/htdocs/reception/note.php @@ -28,7 +28,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/reception/class/reception.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/reception.lib.php'; -if (!empty($conf->project->enabled)) { +if (isModEnabled('project')) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } @@ -136,7 +136,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref .= '
'.$object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->project->enabled)) { + if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
'; if (0) { // Do not change on reception diff --git a/htdocs/recruitment/recruitmentcandidature_agenda.php b/htdocs/recruitment/recruitmentcandidature_agenda.php index b01a7233f76..4c047eae251 100644 --- a/htdocs/recruitment/recruitmentcandidature_agenda.php +++ b/htdocs/recruitment/recruitmentcandidature_agenda.php @@ -154,7 +154,7 @@ if ($object->id > 0) { $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); */ // Project - /*if (!empty($conf->project->enabled)) + /*if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= $langs->trans('Project') . ' '; diff --git a/htdocs/recruitment/recruitmentcandidature_card.php b/htdocs/recruitment/recruitmentcandidature_card.php index af6983e26c6..5a6f8a58443 100644 --- a/htdocs/recruitment/recruitmentcandidature_card.php +++ b/htdocs/recruitment/recruitmentcandidature_card.php @@ -442,7 +442,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Thirdparty $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (!empty($conf->project->enabled)) + if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project') . ' '; diff --git a/htdocs/recruitment/recruitmentcandidature_document.php b/htdocs/recruitment/recruitmentcandidature_document.php index 8b4b7fbdcd2..4517eeabd04 100644 --- a/htdocs/recruitment/recruitmentcandidature_document.php +++ b/htdocs/recruitment/recruitmentcandidature_document.php @@ -130,7 +130,7 @@ if ($object->id) { $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); */ // Project - /*if (!empty($conf->project->enabled)) + /*if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= $langs->trans('Project') . ' '; diff --git a/htdocs/recruitment/recruitmentcandidature_list.php b/htdocs/recruitment/recruitmentcandidature_list.php index a878aab0c22..77577627dce 100644 --- a/htdocs/recruitment/recruitmentcandidature_list.php +++ b/htdocs/recruitment/recruitmentcandidature_list.php @@ -432,7 +432,7 @@ if ($jobposition->id > 0 && (empty($action) || ($action != 'edit' && $action != $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); */ // Project - if (!empty($conf->project->enabled)) { + if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= $langs->trans('Project').' '; if ($permissiontoadd) { diff --git a/htdocs/recruitment/recruitmentcandidature_note.php b/htdocs/recruitment/recruitmentcandidature_note.php index b26d4310688..931f7d0627a 100644 --- a/htdocs/recruitment/recruitmentcandidature_note.php +++ b/htdocs/recruitment/recruitmentcandidature_note.php @@ -105,7 +105,7 @@ if ($id > 0 || !empty($ref)) { $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); */ // Project - /*if (!empty($conf->project->enabled)) + /*if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= $langs->trans('Project') . ' '; diff --git a/htdocs/recruitment/recruitmentjobposition_agenda.php b/htdocs/recruitment/recruitmentjobposition_agenda.php index 3e365a350ca..30aa43ad6cd 100644 --- a/htdocs/recruitment/recruitmentjobposition_agenda.php +++ b/htdocs/recruitment/recruitmentjobposition_agenda.php @@ -152,7 +152,7 @@ if ($object->id > 0) { $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); */ // Project - if (!empty($conf->project->enabled)) { + if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= $langs->trans('Project').' '; if ($permissiontoadd) { diff --git a/htdocs/recruitment/recruitmentjobposition_applications.php b/htdocs/recruitment/recruitmentjobposition_applications.php index 0447ace7979..76250a20b8d 100644 --- a/htdocs/recruitment/recruitmentjobposition_applications.php +++ b/htdocs/recruitment/recruitmentjobposition_applications.php @@ -222,7 +222,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); */ // Project - if (!empty($conf->project->enabled)) { + if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= $langs->trans('Project').' '; if ($permissiontoadd) { diff --git a/htdocs/recruitment/recruitmentjobposition_card.php b/htdocs/recruitment/recruitmentjobposition_card.php index 3555a75d030..9b47b7fe71d 100644 --- a/htdocs/recruitment/recruitmentjobposition_card.php +++ b/htdocs/recruitment/recruitmentjobposition_card.php @@ -322,7 +322,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); */ // Project - if (!empty($conf->project->enabled)) { + if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= $langs->trans('Project').' '; if ($permissiontoadd) { diff --git a/htdocs/recruitment/recruitmentjobposition_document.php b/htdocs/recruitment/recruitmentjobposition_document.php index 55c8785073a..aa8630f7108 100644 --- a/htdocs/recruitment/recruitmentjobposition_document.php +++ b/htdocs/recruitment/recruitmentjobposition_document.php @@ -131,7 +131,7 @@ if ($object->id) { $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); */ // Project - if (!empty($conf->project->enabled)) { + if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= $langs->trans('Project').' '; if ($permissiontoadd) { diff --git a/htdocs/recruitment/recruitmentjobposition_note.php b/htdocs/recruitment/recruitmentjobposition_note.php index d4eb1f05615..f6e5eec721d 100644 --- a/htdocs/recruitment/recruitmentjobposition_note.php +++ b/htdocs/recruitment/recruitmentjobposition_note.php @@ -108,7 +108,7 @@ if ($id > 0 || !empty($ref)) { $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); */ // Project - if (!empty($conf->project->enabled)) { + if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= $langs->trans('Project').' '; if ($permissiontoadd) { diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index cd0f51df4d3..53482cb18b8 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -45,7 +45,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/modules/supplier_proposal/modules_supplier require_once DOL_DOCUMENT_ROOT.'/core/lib/supplier_proposal.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; -if (!empty($conf->project->enabled)) { +if (isModEnabled('project')) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } @@ -1173,7 +1173,7 @@ $formother = new FormOther($db); $formfile = new FormFile($db); $formmargin = new FormMargin($db); $companystatic = new Societe($db); -if (!empty($conf->project->enabled)) { +if (isModEnabled('project')) { $formproject = new FormProjets($db); } @@ -1361,7 +1361,7 @@ if ($action == 'create') { print ""; // Project - if (!empty($conf->project->enabled)) { + if (isModEnabled('project')) { $langs->load("projects"); $formproject = new FormProjets($db); diff --git a/htdocs/supplier_proposal/contact.php b/htdocs/supplier_proposal/contact.php index 04d4e03b052..5b303182419 100644 --- a/htdocs/supplier_proposal/contact.php +++ b/htdocs/supplier_proposal/contact.php @@ -137,7 +137,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref .= $object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->project->enabled)) { + if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
'; if (0) { diff --git a/htdocs/supplier_proposal/document.php b/htdocs/supplier_proposal/document.php index dbd58b49921..319724679f3 100644 --- a/htdocs/supplier_proposal/document.php +++ b/htdocs/supplier_proposal/document.php @@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/supplier_proposal.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -if (!empty($conf->project->enabled)) { +if (isModEnabled('project')) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } // Load translation files required by the page @@ -123,7 +123,7 @@ if ($object->id > 0) { // Thirdparty $morehtmlref .= $object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->project->enabled)) { + if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
'; if (0) { diff --git a/htdocs/supplier_proposal/info.php b/htdocs/supplier_proposal/info.php index bcf38168692..3dd6060f528 100644 --- a/htdocs/supplier_proposal/info.php +++ b/htdocs/supplier_proposal/info.php @@ -29,7 +29,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/supplier_proposal.lib.php'; -if (!empty($conf->project->enabled)) { +if (isModEnabled('project')) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -74,7 +74,7 @@ $morehtmlref = '
'; // Thirdparty $morehtmlref .= $object->thirdparty->getNomUrl(1); // Project -if (!empty($conf->project->enabled)) { +if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
'; if (0) { diff --git a/htdocs/supplier_proposal/list.php b/htdocs/supplier_proposal/list.php index 3105a88450b..dcc9070a1d2 100644 --- a/htdocs/supplier_proposal/list.php +++ b/htdocs/supplier_proposal/list.php @@ -42,7 +42,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formpropal.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php'; -if (!empty($conf->project->enabled)) { +if (isModEnabled('project')) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } diff --git a/htdocs/supplier_proposal/note.php b/htdocs/supplier_proposal/note.php index bc65f6450fb..147b1299e22 100644 --- a/htdocs/supplier_proposal/note.php +++ b/htdocs/supplier_proposal/note.php @@ -30,7 +30,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/supplier_proposal.lib.php'; -if (!empty($conf->project->enabled)) { +if (isModEnabled('project')) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } // Load translation files required by the page @@ -109,7 +109,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref .= $object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->project->enabled)) { + if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
'; if ($usercancreate) { diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php index 3bd180989b3..800ae0f1e8f 100644 --- a/htdocs/user/param_ihm.php +++ b/htdocs/user/param_ihm.php @@ -193,7 +193,7 @@ $tmparray['index.php'] = array('label'=>'Dashboard', 'picto'=>'graph'); if (isModEnabled("societe")) { $tmparray['societe/index.php?mainmenu=companies&leftmenu='] = array('label'=>'ThirdPartiesArea', 'picto'=>'company'); } -if (!empty($conf->project->enabled)) { +if (isModEnabled('project')) { $tmparray['projet/index.php?mainmenu=project&leftmenu='] = array('label'=>'ProjectsArea', 'picto'=>'project'); if (getDolGlobalString('PROJECT_USE_OPPORTUNITIES')) { $tmparray['projet/list.php?mainmenu=project&leftmenu=&search_usage_opportunity=1&search_status=99&search_opp_status=openedopp&contextpage=lead'] = array('label'=>'ListOpenLeads', 'picto'=>'project'); diff --git a/htdocs/website/websiteaccount_card.php b/htdocs/website/websiteaccount_card.php index a9fabffba3c..f7658a28a97 100644 --- a/htdocs/website/websiteaccount_card.php +++ b/htdocs/website/websiteaccount_card.php @@ -226,7 +226,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Thirdparty $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . $soc->getNomUrl(1); // Project - if (!empty($conf->project->enabled)) + if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref.='
'.$langs->trans('Project') . ' '; From d55ae5dbd22d6b68bd447492d76e013f1223dae2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 9 Jun 2023 13:53:58 +0200 Subject: [PATCH 4/4] use isModEnabled --- htdocs/admin/mails_templates.php | 2 +- htdocs/admin/system/security.php | 6 +++--- htdocs/compta/paiement.php | 2 +- htdocs/fourn/facture/paiement.php | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index 6b7e40ce84a..8469814f919 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -236,7 +236,7 @@ if (isModEnabled('agenda')) { if (isModEnabled('eventorganization') && !empty($user->rights->eventorganization->read)) { $elementList['conferenceorbooth'] = img_picto('', 'action', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendEventOrganization')); } -if (!empty($conf->partnership->enabled) && !empty($user->rights->partnership->read)) { +if (isModEnabled('partnership') && !empty($user->rights->partnership->read)) { $elementList['partnership_send'] = img_picto('', 'partnership', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToPartnership')); } diff --git a/htdocs/admin/system/security.php b/htdocs/admin/system/security.php index cc564fdc5d4..7a64b89bccb 100644 --- a/htdocs/admin/system/security.php +++ b/htdocs/admin/system/security.php @@ -539,14 +539,14 @@ print '
'; print '
'; print load_fiche_titre($langs->trans("API"), '', 'folder'); -if (empty($conf->api->enabled) && empty($conf->webservices->enabled)) { +if (!isModEnabled('api') && !isModEnabled('webservices')) { print $langs->trans("APIsAreNotEnabled"); } else { - if (!empty($conf->webservices->enabled)) { + if (isModEnabled('webservices')) { print $langs->trans('YouEnableDeprecatedWSAPIsUseRESTAPIsInstead')."
\n"; print '
'; } - if (!empty($conf->api->enabled)) { + if (isModEnabled('api')) { print 'API_ENDPOINT_RULES = '.getDolGlobalString('API_ENDPOINT_RULES', ''.$langs->trans("Undefined").'   ('.$langs->trans("Example").': login:0,users:0,setup:1,status:1,tickets:1,...)')."
\n"; print '
'; } diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php index 1828c5d053b..a8675ceb018 100644 --- a/htdocs/compta/paiement.php +++ b/htdocs/compta/paiement.php @@ -360,7 +360,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie // Invoice with Paypal transaction // TODO add hook here - if (!empty($conf->paypalplus->enabled) && $conf->global->PAYPAL_ENABLE_TRANSACTION_MANAGEMENT && !empty($facture->ref_ext)) { + if (isModEnabled('paypalplus') && $conf->global->PAYPAL_ENABLE_TRANSACTION_MANAGEMENT && !empty($facture->ref_ext)) { if (!empty($conf->global->PAYPAL_BANK_ACCOUNT)) { $accountid = $conf->global->PAYPAL_BANK_ACCOUNT; } diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index 4f49d0166e5..dce1b8c63b5 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -723,7 +723,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print ''; print price($sign * $remaintopay); - if (!empty($conf->paymentbybanktransfer->enabled)) { + if (isModEnabled('paymentbybanktransfer')) { $numdirectdebitopen = 0; $totaldirectdebit = 0; $sql = "SELECT COUNT(pfd.rowid) as nb, SUM(pfd.amount) as amount";