diff --git a/htdocs/adherents/agenda.php b/htdocs/adherents/agenda.php
index 0a6abcd4955..5aeb3a281cf 100644
--- a/htdocs/adherents/agenda.php
+++ b/htdocs/adherents/agenda.php
@@ -162,11 +162,11 @@ if ($object->id > 0) {
$newcardbutton = '';
- if (!empty($conf->agenda->enabled)) {
+ if (isModEnabled('agenda')) {
$newcardbutton .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']).($object->id > 0 ? '?id='.$object->id : '').'&origin=member&originid='.$id);
}
- if (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
+ if (isModEnabled('agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
print '
';
$param = '&id='.$id;
diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php
index 796e64223c4..e493cc02abe 100644
--- a/htdocs/admin/dict.php
+++ b/htdocs/admin/dict.php
@@ -488,7 +488,7 @@ $tabcond[2] = true;
$tabcond[3] = true;
$tabcond[4] = true;
$tabcond[5] = (!empty($conf->societe->enabled) || !empty($conf->adherent->enabled));
-$tabcond[6] = !empty($conf->agenda->enabled);
+$tabcond[6] = isModEnabled('agenda');
$tabcond[7] = !empty($conf->tax->enabled);
$tabcond[8] = !empty($conf->societe->enabled);
$tabcond[9] = true;
diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php
index abc434ed58f..3e7841befa7 100644
--- a/htdocs/admin/mails_templates.php
+++ b/htdocs/admin/mails_templates.php
@@ -226,7 +226,7 @@ if (!empty($conf->ticket->enabled) && !empty($user->rights->ticket->read)) {
if (!empty($conf->expensereport->enabled) && !empty($user->rights->expensereport->lire)) {
$elementList['expensereport_send'] = img_picto('', 'trip', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToTExpenseReport'));
}
-if (!empty($conf->agenda->enabled)) {
+if (isModEnabled('agenda')) {
$elementList['actioncomm_send'] = img_picto('', 'action', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToSendEventPush'));
}
if (!empty($conf->eventorganization->enabled) && !empty($user->rights->eventorganization->read)) {
diff --git a/htdocs/asset/agenda.php b/htdocs/asset/agenda.php
index 49a0c215701..3d40cf62328 100644
--- a/htdocs/asset/agenda.php
+++ b/htdocs/asset/agenda.php
@@ -179,7 +179,7 @@ if ($object->id > 0) {
print '
';
/*
* Actions commerciales a faire
*/
-if (!empty($conf->agenda->enabled)) {
+if (isModEnabled('agenda')) {
show_array_actions_to_do(10);
}
diff --git a/htdocs/contact/agenda.php b/htdocs/contact/agenda.php
index 98b6ccea3b1..5f07922b2e4 100644
--- a/htdocs/contact/agenda.php
+++ b/htdocs/contact/agenda.php
@@ -252,7 +252,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
$out = '';
$newcardbutton = '';
- if (!empty($conf->agenda->enabled)) {
+ if (isModEnabled('agenda')) {
$permok = $user->rights->agenda->myactions->create;
if ((!empty($objthirdparty->id) || !empty($objcon->id)) && $permok) {
if (is_object($objthirdparty) && get_class($objthirdparty) == 'Societe') {
@@ -267,7 +267,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
}
}
- if (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
+ if (isModEnabled('agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
print '
';
$param = '&id='.$id;
diff --git a/htdocs/contrat/agenda.php b/htdocs/contrat/agenda.php
index d654ac38d9f..70761162153 100644
--- a/htdocs/contrat/agenda.php
+++ b/htdocs/contrat/agenda.php
@@ -243,7 +243,7 @@ if ($id > 0) {
$newcardbutton = '';
- if (!empty($conf->agenda->enabled)) {
+ if (isModEnabled('agenda')) {
if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) {
$backtopage = $_SERVER['PHP_SELF'].'?id='.$object->id;
$out = '&origin='.$object->element.'&originid='.$object->id.'&backtopage='.urlencode($backtopage);
@@ -251,7 +251,7 @@ if ($id > 0) {
}
}
- if (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
+ if (isModEnabled('agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
print '
';
$param = '&id='.$id;
diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php
index fac32e62e5e..6ed0d623c40 100644
--- a/htdocs/core/class/html.formactions.class.php
+++ b/htdocs/core/class/html.formactions.class.php
@@ -226,7 +226,7 @@ class FormActions
}
$newcardbutton = '';
- if (!empty($conf->agenda->enabled) && !empty($user->rights->agenda->myactions->create)) {
+ if (isModEnabled('agenda') && !empty($user->rights->agenda->myactions->create)) {
$url = DOL_URL_ROOT.'/comm/action/card.php?action=create&token='.newToken().'&datep='.urlencode(dol_print_date(dol_now(), 'dayhourlog', 'tzuser')).'&origin='.urlencode($typeelement).'&originid='.((int) $object->id).((!empty($object->socid) && $object->socid > 0) ? '&socid='.((int) $object->socid) : ((!empty($socid) && $socid > 0) ? '&socid='.((int) $socid) : '')).($projectid > 0 ? '&projectid='.((int) $projectid) : '').($taskid > 0 ? '&taskid='.((int) $taskid) : '').'&backtopage='.urlencode($urlbacktopage);
$newcardbutton .= dolGetButtonTitle($langs->trans("AddEvent"), '', 'fa fa-plus-circle', $url);
}
diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php
index 37d206f0361..896921ac436 100644
--- a/htdocs/core/lib/company.lib.php
+++ b/htdocs/core/lib/company.lib.php
@@ -1410,7 +1410,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin
$sql = '';
- if (!empty($conf->agenda->enabled)) {
+ if (isModEnabled('agenda')) {
// Recherche histo sur actioncomm
if (is_object($objcon) && $objcon->id > 0) {
$sql = "SELECT DISTINCT a.id, a.label as label,";
diff --git a/htdocs/core/lib/contact.lib.php b/htdocs/core/lib/contact.lib.php
index 5a0c6c376fb..60c53ee7abc 100644
--- a/htdocs/core/lib/contact.lib.php
+++ b/htdocs/core/lib/contact.lib.php
@@ -133,7 +133,7 @@ function contact_prepare_head(Contact $object)
// Agenda / Events
$head[$tab][0] = DOL_URL_ROOT.'/contact/agenda.php?id='.$object->id;
$head[$tab][1] = $langs->trans("Events");
- if (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
+ if (isModEnabled('agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
$head[$tab][1] .= '/';
$head[$tab][1] .= $langs->trans("Agenda");
}
diff --git a/htdocs/core/lib/contract.lib.php b/htdocs/core/lib/contract.lib.php
index 885ddec7255..2d627532010 100644
--- a/htdocs/core/lib/contract.lib.php
+++ b/htdocs/core/lib/contract.lib.php
@@ -89,7 +89,7 @@ function contract_prepare_head(Contrat $object)
$head[$h][0] = DOL_URL_ROOT.'/contrat/agenda.php?id='.$object->id;
$head[$h][1] .= $langs->trans("Events");
- if (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
+ if (isModEnabled('agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
$head[$h][1] .= '/';
$head[$h][1] .= $langs->trans("Agenda");
}
diff --git a/htdocs/core/lib/fourn.lib.php b/htdocs/core/lib/fourn.lib.php
index 683b4b49912..2fd4ce3799a 100644
--- a/htdocs/core/lib/fourn.lib.php
+++ b/htdocs/core/lib/fourn.lib.php
@@ -223,7 +223,7 @@ function ordersupplier_prepare_head(CommandeFournisseur $object)
$head[$h][0] = DOL_URL_ROOT.'/fourn/commande/info.php?id='.$object->id;
$head[$h][1] .= $langs->trans("Events");
- if (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
+ if (isModEnabled('agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
$head[$h][1] .= '/';
$head[$h][1] .= $langs->trans("Agenda");
}
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index be1ef43b47d..1aeeac416b2 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -3352,7 +3352,7 @@ function dol_print_phone($phone, $countrycode = '', $cid = 0, $socid = 0, $addli
}
//if (($cid || $socid) && ! empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create)
- if (!empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create) {
+ if (isModEnabled('agenda') && $user->rights->agenda->myactions->create) {
$type = 'AC_TEL';
$link = '';
if ($addlink == 'AC_FAX') {
diff --git a/htdocs/core/lib/member.lib.php b/htdocs/core/lib/member.lib.php
index ed3b69752f1..677d8cfdaef 100644
--- a/htdocs/core/lib/member.lib.php
+++ b/htdocs/core/lib/member.lib.php
@@ -112,10 +112,10 @@ function member_prepare_head(Adherent $object)
$h++;
// Show agenda tab
- if (!empty($conf->agenda->enabled)) {
+ if (isModEnabled('agenda')) {
$head[$h][0] = DOL_URL_ROOT."/adherents/agenda.php?id=".$object->id;
$head[$h][1] = $langs->trans("Events");
- if (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
+ if (isModEnabled('agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
$head[$h][1] .= '/';
$head[$h][1] .= $langs->trans("Agenda");
}
diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php
index 117871b4712..12e1128ddfc 100644
--- a/htdocs/core/lib/product.lib.php
+++ b/htdocs/core/lib/product.lib.php
@@ -201,7 +201,7 @@ function product_prepare_head($object)
// Log
$head[$h][0] = DOL_URL_ROOT.'/product/agenda.php?id='.$object->id;
$head[$h][1] = $langs->trans("Events");
- if (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
+ if (isModEnabled('agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
$head[$h][1] .= '/';
$head[$h][1] .= $langs->trans("Agenda");
}
diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php
index 56aa24a8523..7f1b56bc8eb 100644
--- a/htdocs/core/lib/project.lib.php
+++ b/htdocs/core/lib/project.lib.php
@@ -312,7 +312,7 @@ function project_prepare_head(Project $project, $moreparam = '')
$head[$h][0] = DOL_URL_ROOT.'/projet/info.php?id='.$project->id;
$head[$h][1] = $langs->trans("Events");
- if (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
+ if (isModEnabled('agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
$head[$h][1] .= '/';
$head[$h][1] .= $langs->trans("Agenda");
}
diff --git a/htdocs/core/lib/resource.lib.php b/htdocs/core/lib/resource.lib.php
index 29cd8a5b089..f222857b9d8 100644
--- a/htdocs/core/lib/resource.lib.php
+++ b/htdocs/core/lib/resource.lib.php
@@ -87,7 +87,7 @@ function resource_prepare_head($object)
$head[$h][0] = DOL_URL_ROOT.'/resource/agenda.php?id='.$object->id;
$head[$h][1] = $langs->trans("Events");
- if (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
+ if (isModEnabled('agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
$head[$h][1] .= '/';
$head[$h][1] .= $langs->trans("Agenda");
}
diff --git a/htdocs/core/lib/ticket.lib.php b/htdocs/core/lib/ticket.lib.php
index 5b220553bfe..e1544e763df 100644
--- a/htdocs/core/lib/ticket.lib.php
+++ b/htdocs/core/lib/ticket.lib.php
@@ -126,7 +126,7 @@ function ticket_prepare_head($object)
$head[$h][0] = DOL_URL_ROOT.'/ticket/agenda.php?track_id='.$object->track_id;
}
$head[$h][1] = $langs->trans('Events');
- if (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
+ if (isModEnabled('agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
$head[$h][1] .= '/';
$head[$h][1] .= $langs->trans("Agenda");
}
@@ -304,7 +304,7 @@ function show_ticket_messaging($conf, $langs, $db, $filterobj, $objcon = '', $no
}
$sortfield_new = implode(',', $sortfield_new_list);
- if (!empty($conf->agenda->enabled)) {
+ if (isModEnabled('agenda')) {
// Search histo on actioncomm
if (is_object($objcon) && $objcon->id > 0) {
$sql = "SELECT DISTINCT a.id, a.label as label,";
@@ -565,7 +565,7 @@ function show_ticket_messaging($conf, $langs, $db, $filterobj, $objcon = '', $no
$out = info_admin($langs->trans("WarningModuleXDisabledSoYouMayMissEventHere", $langs->transnoentitiesnoconv("Module2400Name")), 0, 0, 'warning');
}
- if (!empty($conf->agenda->enabled) || (!empty($conf->mailing->enabled) && !empty($objcon->email))) {
+ if (isModEnabled('agenda') || (!empty($conf->mailing->enabled) && !empty($objcon->email))) {
$delay_warning = $conf->global->MAIN_DELAY_ACTIONS_TODO * 24 * 60 * 60;
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php
index dac412f92a6..25945c4e83d 100644
--- a/htdocs/core/lib/usergroups.lib.php
+++ b/htdocs/core/lib/usergroups.lib.php
@@ -72,7 +72,7 @@ function user_prepare_head(User $object)
$head[$h][2] = 'guisetup';
$h++;
- if (!empty($conf->agenda->enabled)) {
+ if (isModEnabled('agenda')) {
if (empty($conf->global->AGENDA_EXT_NB)) {
$conf->global->AGENDA_EXT_NB = 5;
}
diff --git a/htdocs/core/modules/modCategorie.class.php b/htdocs/core/modules/modCategorie.class.php
index 9e138c6ccef..c9a28863c97 100644
--- a/htdocs/core/modules/modCategorie.class.php
+++ b/htdocs/core/modules/modCategorie.class.php
@@ -157,7 +157,7 @@ class modCategorie extends DolibarrModules
if (!empty($conf->stock->enabled)) {
$typeexample .= ($typeexample ? " / " : "")."9=Warehouse";
}
- if (!empty($conf->agenda->enabled)) {
+ if (isModEnabled('agenda')) {
$typeexample .= ($typeexample ? " / " : "")."10=Agenda event";
}
if (!empty($conf->website->enabled)) {
diff --git a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php
index 69a7a3f6232..35979503d15 100644
--- a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php
+++ b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php
@@ -64,7 +64,7 @@ if (!empty($conf->ficheinter->enabled)) {
if (!empty($conf->deplacement->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/compta/deplacement/class/deplacement.class.php';
}
-if (!empty($conf->agenda->enabled)) {
+if (isModEnabled('agenda')) {
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
}
diff --git a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php
index fc83ab505d2..d439ae32ce5 100644
--- a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php
+++ b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php
@@ -65,7 +65,7 @@ if (!empty($conf->ficheinter->enabled)) {
if (!empty($conf->deplacement->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/compta/deplacement/class/deplacement.class.php';
}
-if (!empty($conf->agenda->enabled)) {
+if (isModEnabled('agenda')) {
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
}
diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php
index 8ad44d198a8..2d649589282 100644
--- a/htdocs/fourn/card.php
+++ b/htdocs/fourn/card.php
@@ -881,7 +881,7 @@ if ($object->id > 0) {
}
// Add action
- if (!empty($conf->agenda->enabled) && !empty($conf->global->MAIN_REPEATTASKONEACHTAB) && $object->status == 1) {
+ if (isModEnabled('agenda') && !empty($conf->global->MAIN_REPEATTASKONEACHTAB) && $object->status == 1) {
if ($user->rights->agenda->myactions->create) {
print dolGetButtonAction('', $langs->trans('AddAction'), 'default', DOL_URL_ROOT.'/comm/action/card.php?action=create&socid='.$object->id, '');
} else {
diff --git a/htdocs/fourn/commande/info.php b/htdocs/fourn/commande/info.php
index 6c64672ee84..728986f5a88 100644
--- a/htdocs/fourn/commande/info.php
+++ b/htdocs/fourn/commande/info.php
@@ -201,7 +201,7 @@ if ($permok) {
print '
';
-if (!empty($conf->agenda->enabled)) {
+if (isModEnabled('agenda')) {
if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) {
print '
id).'">'.$langs->trans("AddAction").'';
} else {
diff --git a/htdocs/hrm/evaluation_agenda.php b/htdocs/hrm/evaluation_agenda.php
index 87a09043a62..8d2d234dd43 100644
--- a/htdocs/hrm/evaluation_agenda.php
+++ b/htdocs/hrm/evaluation_agenda.php
@@ -198,7 +198,7 @@ if ($object->id > 0) {
print '
';
- if (!empty($conf->agenda->enabled)) {
+ if (isModEnabled('agenda')) {
if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) {
print '
'.$langs->trans("AddAction").'';
} else {
@@ -208,7 +208,7 @@ if ($object->id > 0) {
print '
';
- if (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
+ if (isModEnabled('agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
$param = '&id='.$object->id.'&socid='.$socid;
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
$param .= '&contextpage='.urlencode($contextpage);
diff --git a/htdocs/hrm/job_agenda.php b/htdocs/hrm/job_agenda.php
index 0d966e67416..b8008f009ea 100644
--- a/htdocs/hrm/job_agenda.php
+++ b/htdocs/hrm/job_agenda.php
@@ -189,14 +189,14 @@ if ($object->id > 0) {
}
- if (!empty($conf->agenda->enabled)) {
+ if (isModEnabled('agenda')) {
if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) {
$newcardbutton = '';
$newcardbutton .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out);
}
}
- if (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
+ if (isModEnabled('agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
$param = '&id='.$object->id.'&socid='.$socid;
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
$param .= '&contextpage='.urlencode($contextpage);
diff --git a/htdocs/hrm/position_agenda.php b/htdocs/hrm/position_agenda.php
index fda60a29259..24f2d9e32ef 100644
--- a/htdocs/hrm/position_agenda.php
+++ b/htdocs/hrm/position_agenda.php
@@ -197,7 +197,7 @@ if ($object->id > 0) {
print '
';
- if (!empty($conf->agenda->enabled)) {
+ if (isModEnabled('agenda')) {
if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) {
print '
'.$langs->trans("AddAction").'';
} else {
@@ -207,7 +207,7 @@ if ($object->id > 0) {
print '
';
- if (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
+ if (isModEnabled('agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
$param = '&id='.$object->id.'&socid='.$socid;
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
$param .= '&contextpage='.urlencode($contextpage);
diff --git a/htdocs/hrm/skill_agenda.php b/htdocs/hrm/skill_agenda.php
index d73271a4f26..e1947741bde 100644
--- a/htdocs/hrm/skill_agenda.php
+++ b/htdocs/hrm/skill_agenda.php
@@ -191,7 +191,7 @@ if ($object->id > 0) {
print '
';
- if (!empty($conf->agenda->enabled)) {
+ if (isModEnabled('agenda')) {
if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) {
print '
'.$langs->trans("AddAction").'';
} else {
@@ -201,7 +201,7 @@ if ($object->id > 0) {
print '
';
- if (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
+ if (isModEnabled('agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
$param = '&id='.$object->id.'&socid='.$socid;
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
$param .= '&contextpage='.urlencode($contextpage);
diff --git a/htdocs/index.php b/htdocs/index.php
index 5593eaffacf..d9bab584948 100644
--- a/htdocs/index.php
+++ b/htdocs/index.php
@@ -156,7 +156,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) {
require_once DOL_DOCUMENT_ROOT.'/core/class/workboardresponse.class.php';
// Number of actions to do (late)
- if (!empty($conf->agenda->enabled) && empty($conf->global->MAIN_DISABLE_BLOCK_AGENDA) && $user->rights->agenda->myactions->read) {
+ if (isModEnabled('agenda') && empty($conf->global->MAIN_DISABLE_BLOCK_AGENDA) && $user->rights->agenda->myactions->read) {
include_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
$board = new ActionComm($db);
$dashboardlines[$board->element] = $board->load_board($user);
diff --git a/htdocs/knowledgemanagement/knowledgerecord_agenda.php b/htdocs/knowledgemanagement/knowledgerecord_agenda.php
index 81750e720c7..003faa326d5 100644
--- a/htdocs/knowledgemanagement/knowledgerecord_agenda.php
+++ b/htdocs/knowledgemanagement/knowledgerecord_agenda.php
@@ -218,7 +218,7 @@ if ($object->id > 0) {
print '
';
- if (!empty($conf->agenda->enabled)) {
+ if (isModEnabled('agenda')) {
if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) {
print '
'.$langs->trans("AddAction").'';
} else {
@@ -228,7 +228,7 @@ if ($object->id > 0) {
print '
';
- if (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
+ if (isModEnabled('agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
$param = '&id='.$object->id.'&socid='.$socid;
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
$param .= '&contextpage='.urlencode($contextpage);
diff --git a/htdocs/modulebuilder/template/myobject_agenda.php b/htdocs/modulebuilder/template/myobject_agenda.php
index b40092f93a7..164af332ed8 100644
--- a/htdocs/modulebuilder/template/myobject_agenda.php
+++ b/htdocs/modulebuilder/template/myobject_agenda.php
@@ -279,7 +279,7 @@ if ($object->id > 0) {
print '
';
- if (!empty($conf->agenda->enabled)) {
+ if (isModEnabled('agenda')) {
if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) {
print '
'.$langs->trans("AddAction").'';
} else {
@@ -289,7 +289,7 @@ if ($object->id > 0) {
print '
';
- if (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
+ if (isModEnabled('agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
$param = '&id='.$object->id.'&socid='.$socid;
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
$param .= '&contextpage='.urlencode($contextpage);
diff --git a/htdocs/mrp/mo_agenda.php b/htdocs/mrp/mo_agenda.php
index e1b19d87ad0..3317ddcfd43 100644
--- a/htdocs/mrp/mo_agenda.php
+++ b/htdocs/mrp/mo_agenda.php
@@ -218,7 +218,7 @@ if ($object->id > 0) {
print '
';
- if (!empty($conf->agenda->enabled)) {
+ if (isModEnabled('agenda')) {
if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) {
print '
'.$langs->trans("AddAction").'';
} else {
@@ -228,7 +228,7 @@ if ($object->id > 0) {
print '
';
- if (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
+ if (isModEnabled('agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
$param = '&id='.$object->id.'&socid='.$socid;
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
$param .= '&contextpage='.urlencode($contextpage);
diff --git a/htdocs/partnership/partnership_agenda.php b/htdocs/partnership/partnership_agenda.php
index 4c68a83d4e2..9930093e6be 100644
--- a/htdocs/partnership/partnership_agenda.php
+++ b/htdocs/partnership/partnership_agenda.php
@@ -218,7 +218,7 @@ if ($object->id > 0) {
print '
';
- if (!empty($conf->agenda->enabled)) {
+ if (isModEnabled('agenda')) {
if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) {
print '
'.$langs->trans("AddAction").'';
} else {
@@ -228,7 +228,7 @@ if ($object->id > 0) {
print '
';
- if (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
+ if (isModEnabled('agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
$param = '&id='.$object->id.'&socid='.$socid;
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
$param .= '&contextpage='.urlencode($contextpage);
diff --git a/htdocs/product/agenda.php b/htdocs/product/agenda.php
index b595bd3b9cb..8ec76640871 100644
--- a/htdocs/product/agenda.php
+++ b/htdocs/product/agenda.php
@@ -187,7 +187,7 @@ if ($id > 0 || $ref) {
$out = '';
$morehtmlcenter = '';
- if (!empty($conf->agenda->enabled)) {
+ if (isModEnabled('agenda')) {
$permok = $user->rights->agenda->myactions->create;
if ((!empty($objproduct->id) || !empty($objcon->id)) && $permok) {
if (get_class($objproduct) == 'Product') {
@@ -200,7 +200,7 @@ if ($id > 0 || $ref) {
$morehtmlcenter = dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out, '', $linktocreatetimeBtnStatus);
}
- if (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
+ if (isModEnabled('agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
print '
';
$param = '&id='.$id;
diff --git a/htdocs/product/stock/stocktransfer/stocktransfer_agenda.php b/htdocs/product/stock/stocktransfer/stocktransfer_agenda.php
index ccbdf12e712..f9b992e2bde 100644
--- a/htdocs/product/stock/stocktransfer/stocktransfer_agenda.php
+++ b/htdocs/product/stock/stocktransfer/stocktransfer_agenda.php
@@ -214,7 +214,7 @@ if ($object->id > 0) {
print '
';
- if (!empty($conf->agenda->enabled)) {
+ if (isModEnabled('agenda')) {
if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) {
print '
'.$langs->trans("AddAction").'';
} else {
@@ -224,7 +224,7 @@ if ($object->id > 0) {
print '
';
- if (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
+ if (isModEnabled('agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
$param = '&id='.$object->id.'&socid='.$socid;
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage);
if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit);
diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php
index caad4374da0..5d463d6a186 100644
--- a/htdocs/projet/element.php
+++ b/htdocs/projet/element.php
@@ -73,7 +73,7 @@ if (!empty($conf->deplacement->enabled)) {
if (!empty($conf->expensereport->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
}
-if (!empty($conf->agenda->enabled)) {
+if (isModEnabled('agenda')) {
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
}
if (!empty($conf->don->enabled)) {
diff --git a/htdocs/projet/info.php b/htdocs/projet/info.php
index 9b0544bccf6..19897bf2859 100644
--- a/htdocs/projet/info.php
+++ b/htdocs/projet/info.php
@@ -167,7 +167,7 @@ if ($permok) {
//print '
';
$morehtmlcenter = '';
-if (!empty($conf->agenda->enabled)) {
+if (isModEnabled('agenda')) {
$addActionBtnRight = !empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create);
$morehtmlcenter .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out.'&socid='.$object->socid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id), '', $addActionBtnRight);
}
diff --git a/htdocs/recruitment/recruitmentcandidature_agenda.php b/htdocs/recruitment/recruitmentcandidature_agenda.php
index 74a48994f71..54ac648d1d0 100644
--- a/htdocs/recruitment/recruitmentcandidature_agenda.php
+++ b/htdocs/recruitment/recruitmentcandidature_agenda.php
@@ -218,7 +218,7 @@ if ($object->id > 0) {
print '
';
- if (!empty($conf->agenda->enabled)) {
+ if (isModEnabled('agenda')) {
if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) {
print '
'.$langs->trans("AddAction").'';
} else {
@@ -228,7 +228,7 @@ if ($object->id > 0) {
print '
';
- if (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
+ if (isModEnabled('agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
$param = '&id='.$object->id.'&socid='.$socid;
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
$param .= '&contextpage='.urlencode($contextpage);
diff --git a/htdocs/recruitment/recruitmentjobposition_agenda.php b/htdocs/recruitment/recruitmentjobposition_agenda.php
index 45c84005743..1391ddb132d 100644
--- a/htdocs/recruitment/recruitmentjobposition_agenda.php
+++ b/htdocs/recruitment/recruitmentjobposition_agenda.php
@@ -217,7 +217,7 @@ if ($object->id > 0) {
print '
';
- if (!empty($conf->agenda->enabled)) {
+ if (isModEnabled('agenda')) {
if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) {
print '
'.$langs->trans("AddAction").'';
} else {
@@ -227,7 +227,7 @@ if ($object->id > 0) {
print '
';
- if (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
+ if (isModEnabled('agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
$param = '&id='.$object->id.'&socid='.$socid;
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
$param .= '&contextpage='.urlencode($contextpage);
diff --git a/htdocs/resource/agenda.php b/htdocs/resource/agenda.php
index 363f334a7eb..cb13ce78e7d 100644
--- a/htdocs/resource/agenda.php
+++ b/htdocs/resource/agenda.php
@@ -164,7 +164,7 @@ if ($object->id > 0) {
print dol_get_fiche_end();
- if (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
+ if (isModEnabled('agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
$param = '&id='.$object->id.'&socid='.$socid;
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
$param .= '&contextpage='.urlencode($contextpage);
diff --git a/htdocs/societe/agenda.php b/htdocs/societe/agenda.php
index bebe542a6f9..89b69bda83c 100644
--- a/htdocs/societe/agenda.php
+++ b/htdocs/societe/agenda.php
@@ -157,13 +157,13 @@ if ($socid > 0) {
}
$newcardbutton = '';
- if (!empty($conf->agenda->enabled)) {
+ if (isModEnabled('agenda')) {
if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) {
$newcardbutton .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out);
}
}
- if (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
+ if (isModEnabled('agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
print '
';
$param = '&socid='.urlencode($socid);
diff --git a/htdocs/user/card.php b/htdocs/user/card.php
index f0b362b383e..254a3ea9e75 100644
--- a/htdocs/user/card.php
+++ b/htdocs/user/card.php
@@ -1154,7 +1154,7 @@ if ($action == 'create' || $action == 'adduserldap') {
}
// User color
- if (!empty($conf->agenda->enabled)) {
+ if (isModEnabled('agenda')) {
print '
| '.$langs->trans("ColorUser").' | ';
print '';
print $formother->selectColor(GETPOSTISSET('color') ?GETPOST('color', 'alphanohtml') : $object->color, 'color', null, 1, '', 'hideifnotset');
@@ -1605,7 +1605,7 @@ if ($action == 'create' || $action == 'adduserldap') {
print '';
// Color user
- if (!empty($conf->agenda->enabled)) {
+ if (isModEnabled('agenda')) {
print '| '.$langs->trans("ColorUser").' | ';
print '';
print $formother->showColor($object->color, '');
@@ -2544,7 +2544,7 @@ if ($action == 'create' || $action == 'adduserldap') {
}
// User color
- if (!empty($conf->agenda->enabled)) {
+ if (isModEnabled('agenda')) {
print ' | | '.$langs->trans("ColorUser").' | ';
print '';
if ($caneditfield) {
diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php
index f92afe53a4f..c2ea42e6c6a 100644
--- a/htdocs/user/param_ihm.php
+++ b/htdocs/user/param_ihm.php
@@ -204,7 +204,7 @@ if (!empty($conf->comptabilite->enabled) || !empty($conf->accounting->enabled))
if (!empty($conf->adherent->enabled)) {
$tmparray['adherents/index.php?mainmenu=members&leftmenu='] = 'MembersArea';
}
-if (!empty($conf->agenda->enabled)) {
+if (isModEnabled('agenda')) {
$tmparray['comm/action/index.php?mainmenu=agenda&leftmenu='] = 'Agenda';
}
if (!empty($conf->ticket->enabled)) {
| |