';
if (isModEnabled('agenda')) {
- if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) {
+ if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) {
print '
';
diff --git a/htdocs/bookcal/booking_agenda.php b/htdocs/bookcal/booking_agenda.php
index dec1ebee921..7b65b510103 100644
--- a/htdocs/bookcal/booking_agenda.php
+++ b/htdocs/bookcal/booking_agenda.php
@@ -280,7 +280,7 @@ if ($object->id > 0) {
print '
';
if (isModEnabled('agenda')) {
- if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) {
+ if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) {
print '
'.$langs->trans("AddAction").'';
} else {
print '
'.$langs->trans("AddAction").'';
diff --git a/htdocs/bookcal/class/availabilities.class.php b/htdocs/bookcal/class/availabilities.class.php
index cfbfc8eed88..3ccc4542670 100644
--- a/htdocs/bookcal/class/availabilities.class.php
+++ b/htdocs/bookcal/class/availabilities.class.php
@@ -74,7 +74,7 @@ class Availabilities extends CommonObject
* Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)"
* 'label' the translation key.
* 'picto' is code of a picto to show before value in forms
- * 'enabled' is a condition when the field must be managed (Example: 1 or '$conf->global->MY_SETUP_PARAM' or '!empty($conf->multicurrency->enabled)' ...)
+ * 'enabled' is a condition when the field must be managed (Example: 1 or '$conf->global->MY_SETUP_PARAM' or 'isModEnabled('multicurrency')' ...)
* 'position' is the sort order of field.
* 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0).
* 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing)
diff --git a/htdocs/bookcal/class/booking.class.php b/htdocs/bookcal/class/booking.class.php
index a74cb87a43d..98cb5077844 100644
--- a/htdocs/bookcal/class/booking.class.php
+++ b/htdocs/bookcal/class/booking.class.php
@@ -74,7 +74,7 @@ class Booking extends CommonObject
* Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)"
* 'label' the translation key.
* 'picto' is code of a picto to show before value in forms
- * 'enabled' is a condition when the field must be managed (Example: 1 or '$conf->global->MY_SETUP_PARAM' or '!empty($conf->multicurrency->enabled)' ...)
+ * 'enabled' is a condition when the field must be managed (Example: 1 or '$conf->global->MY_SETUP_PARAM' or 'isModEnabled('multicurrency')' ...)
* 'position' is the sort order of field.
* 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0).
* 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing)
diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php
index 11b8330b64c..f0399fa6350 100644
--- a/htdocs/comm/action/card.php
+++ b/htdocs/comm/action/card.php
@@ -159,7 +159,7 @@ if ($user->socid && $socid) {
$result = restrictedArea($user, 'societe', $socid);
}
-$usercancreate = $user->rights->agenda->allactions->create || (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->create);
+$usercancreate = $user->hasRight('agenda', 'allactions', 'create') || (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->create);
/*
@@ -218,7 +218,7 @@ if (empty($reshook) && (GETPOST('addassignedtouser') || GETPOST('updateassignedt
}
// Link to a project
-if (empty($reshook) && $action == 'classin' && ($user->rights->agenda->allactions->create ||
+if (empty($reshook) && $action == 'classin' && ($user->hasRight('agenda', 'allactions', 'create') ||
(($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->create))) {
//$object->fetch($id);
$object->setProject(GETPOST('projectid', 'int'));
@@ -1093,7 +1093,7 @@ if (empty($reshook) && GETPOST('actionmove', 'alpha') == 'mupdate') {
// Actions to delete doc
$upload_dir = $conf->agenda->dir_output.'/'.dol_sanitizeFileName($object->ref);
-$permissiontoadd = ($user->rights->agenda->allactions->create || (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->read));
+$permissiontoadd = ($user->hasRight('agenda', 'allactions', 'create') || (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->read));
if (empty($reshook)) {
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
}
@@ -2466,14 +2466,14 @@ if ($id > 0) {
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
if (empty($reshook)) {
if ($action != 'edit') {
- if ($user->rights->agenda->allactions->create ||
+ if ($user->hasRight('agenda', 'allactions', 'create') ||
(($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->create)) {
print '
';
} else {
print '
';
}
- if ($user->rights->agenda->allactions->create ||
+ if ($user->hasRight('agenda', 'allactions', 'create') ||
(($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->create)) {
print '
';
} else {
diff --git a/htdocs/comm/action/class/api_agendaevents.class.php b/htdocs/comm/action/class/api_agendaevents.class.php
index 8c13709b250..c0accf82866 100644
--- a/htdocs/comm/action/class/api_agendaevents.class.php
+++ b/htdocs/comm/action/class/api_agendaevents.class.php
@@ -210,7 +210,7 @@ class AgendaEvents extends DolibarrApi
if (!DolibarrApiAccess::$user->rights->agenda->myactions->create) {
throw new RestException(401, "Insufficient rights to create your Agenda Event");
}
- if (!DolibarrApiAccess::$user->rights->agenda->allactions->create && DolibarrApiAccess::$user->id != $request_data['userownerid']) {
+ if (!DolibarrApiAccess::$user->hasRight('agenda', 'allactions', 'create') && DolibarrApiAccess::$user->id != $request_data['userownerid']) {
throw new RestException(401, "Insufficient rights to create an Agenda Event for owner id ".$request_data['userownerid'].' Your id is '.DolibarrApiAccess::$user->id);
}
@@ -249,7 +249,7 @@ class AgendaEvents extends DolibarrApi
if (!DolibarrApiAccess::$user->rights->agenda->myactions->create) {
throw new RestException(401, "Insufficient rights to create your Agenda Event");
}
- if (!DolibarrApiAccess::$user->rights->agenda->allactions->create && DolibarrApiAccess::$user->id != $request_data['userownerid']) {
+ if (!DolibarrApiAccess::$user->hasRight('agenda', 'allactions', 'create') && DolibarrApiAccess::$user->id != $request_data['userownerid']) {
throw new RestException(401, "Insufficient rights to create an Agenda Event for owner id ".$request_data['userownerid'].' Your id is '.DolibarrApiAccess::$user->id);
}
diff --git a/htdocs/comm/action/document.php b/htdocs/comm/action/document.php
index 82cc7584c07..c37920f0d99 100644
--- a/htdocs/comm/action/document.php
+++ b/htdocs/comm/action/document.php
@@ -92,7 +92,7 @@ if ($user->socid && $socid) {
$result = restrictedArea($user, 'societe', $socid);
}
-$usercancreate = $user->rights->agenda->allactions->create || (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->create);
+$usercancreate = $user->hasRight('agenda', 'allactions', 'create') || (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->create);
$permissiontoadd = $usercancreate;
@@ -305,7 +305,7 @@ if ($object->id > 0) {
$modulepart = 'actions';
- $permissiontoadd = $user->rights->agenda->myactions->create || $user->rights->agenda->allactions->create;
+ $permissiontoadd = $user->rights->agenda->myactions->create || $user->hasRight('agenda', 'allactions', 'create');
$param = '&id='.$object->id;
include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
} else {
diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php
index ab814957e5b..5b51d48392b 100644
--- a/htdocs/comm/action/index.php
+++ b/htdocs/comm/action/index.php
@@ -540,7 +540,7 @@ $viewmode .= '
'; // To add a space before t
$newcardbutton = '';
$newparam = '';
-if ($user->rights->agenda->myactions->create || $user->rights->agenda->allactions->create) {
+if ($user->rights->agenda->myactions->create || $user->hasRight('agenda', 'allactions', 'create')) {
$tmpforcreatebutton = dol_getdate(dol_now(), true);
$newparam .= '&month='.((int) $month).'&year='.((int) $tmpforcreatebutton['year']).'&mode='.urlencode($mode);
@@ -1703,7 +1703,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
$curtime = dol_mktime(0, 0, 0, $month, $day, $year);
$urltoshow = DOL_URL_ROOT.'/comm/action/index.php?mode=show_day&day='.str_pad($day, 2, "0", STR_PAD_LEFT).'&month='.str_pad($month, 2, "0", STR_PAD_LEFT).'&year='.$year.$newparam;
$urltocreate = '';
- if ($user->rights->agenda->myactions->create || $user->rights->agenda->allactions->create) {
+ if ($user->rights->agenda->myactions->create || $user->hasRight('agenda', 'allactions', 'create')) {
$newparam .= '&month='.str_pad($month, 2, "0", STR_PAD_LEFT).'&year='.$year;
$hourminsec = '100000';
$urltocreate = DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.sprintf("%04d%02d%02d", $year, $month, $day).$hourminsec.'&backtopage='.urlencode($_SERVER["PHP_SELF"].($newparam ? '?'.$newparam : ''));
@@ -1722,7 +1722,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
}
print '';
print '
';
- if ($user->rights->agenda->myactions->create || $user->rights->agenda->allactions->create) {
+ if ($user->rights->agenda->myactions->create || $user->hasRight('agenda', 'allactions', 'create')) {
print '
'; // Explicit link, usefull for nojs interfaces
print img_picto($langs->trans("NewAction"), 'edit_add.png');
print '';
@@ -1849,7 +1849,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
$cssclass .= ' movable cursormove';
}
} else {
- if ($user->rights->agenda->allactions->create ||
+ if ($user->hasRight('agenda', 'allactions', 'create') ||
(($event->authorid == $user->id || $event->userownerid == $user->id) && $user->rights->agenda->myactions->create)) {
$cssclass .= " movable cursormove";
} else {
diff --git a/htdocs/comm/action/info.php b/htdocs/comm/action/info.php
index d4588223b26..21651bb7446 100644
--- a/htdocs/comm/action/info.php
+++ b/htdocs/comm/action/info.php
@@ -53,7 +53,7 @@ if ($user->socid && $socid) {
$result = restrictedArea($user, 'societe', $socid);
}
-$usercancreate = $user->rights->agenda->allactions->create || (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->create);
+$usercancreate = $user->hasRight('agenda', 'allactions', 'create') || (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->create);
/*
diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php
index 5eb538d4e62..4be3195561e 100644
--- a/htdocs/comm/action/list.php
+++ b/htdocs/comm/action/list.php
@@ -700,7 +700,7 @@ $url = DOL_URL_ROOT.'/comm/action/card.php?action=create';
$url .= '&datep='.sprintf("%04d%02d%02d", $tmpforcreatebutton['year'], $tmpforcreatebutton['mon'], $tmpforcreatebutton['mday']).$hourminsec;
$url .= '&backtopage='.urlencode($_SERVER["PHP_SELF"].($newparam ? '?'.$newparam : ''));
-$newcardbutton = dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', $url, '', $user->rights->agenda->myactions->create || $user->rights->agenda->allactions->create);
+$newcardbutton = dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', $url, '', $user->rights->agenda->myactions->create || $user->hasRight('agenda', 'allactions', 'create'));
$param .= '&mode='.$mode;
diff --git a/htdocs/comm/action/pertype.php b/htdocs/comm/action/pertype.php
index 61092df5665..ce33d0f40b2 100644
--- a/htdocs/comm/action/pertype.php
+++ b/htdocs/comm/action/pertype.php
@@ -479,7 +479,7 @@ if (empty($reshook)) {
$newcardbutton = '';
-if ($user->rights->agenda->myactions->create || $user->rights->agenda->allactions->create) {
+if ($user->rights->agenda->myactions->create || $user->hasRight('agenda', 'allactions', 'create')) {
$tmpforcreatebutton = dol_getdate(dol_now(), true);
$newparam .= '&month='.str_pad($month, 2, "0", STR_PAD_LEFT).'&year='.$tmpforcreatebutton['year'];
diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php
index 5c5ef948c30..bd35fc16e7d 100644
--- a/htdocs/comm/action/peruser.php
+++ b/htdocs/comm/action/peruser.php
@@ -475,7 +475,7 @@ if (empty($reshook)) {
$newparam = '';
$newcardbutton = '';
-if ($user->rights->agenda->myactions->create || $user->rights->agenda->allactions->create) {
+if ($user->rights->agenda->myactions->create || $user->hasRight('agenda', 'allactions', 'create')) {
$tmpforcreatebutton = dol_getdate(dol_now(), true);
$newparam .= '&month='.urlencode(str_pad($month, 2, "0", STR_PAD_LEFT)).'&year='.urlencode($tmpforcreatebutton['year']);
diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php
index 36c98a495ec..9d221411d9c 100644
--- a/htdocs/compta/facture/card.php
+++ b/htdocs/compta/facture/card.php
@@ -3066,7 +3066,7 @@ if ($action == 'create') {
$remise_percent = (!empty($expesrc->remise_percent) ? $expesrc->remise_percent : (!empty($soc->remise_percent) ? $soc->remise_percent : 0));
$remise_absolue = (!empty($expesrc->remise_absolue) ? $expesrc->remise_absolue : (!empty($soc->remise_absolue) ? $soc->remise_absolue : 0));
- if (!empty($conf->multicurrency->enabled)) {
+ if (isModEnabled('multicurrency')) {
$currency_code = (!empty($expesrc->currency_code) ? $expesrc->currency_code : (!empty($soc->currency_code) ? $soc->currency_code : $objectsrc->multicurrency_code));
$currency_tx = (!empty($expesrc->currency_tx) ? $expesrc->currency_tx : (!empty($soc->currency_tx) ? $soc->currency_tx : $objectsrc->currency_tx));
}
diff --git a/htdocs/contact/agenda.php b/htdocs/contact/agenda.php
index 29706f48b49..2f5dea5535a 100644
--- a/htdocs/contact/agenda.php
+++ b/htdocs/contact/agenda.php
@@ -81,7 +81,7 @@ if (GETPOST('actioncode', 'array')) {
$actioncode = '0';
}
} else {
- $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT));
+ $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT'));
}
$search_agenda_label = GETPOST('search_agenda_label');
@@ -266,7 +266,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
$out .= '&datep='.urlencode(dol_print_date(dol_now(), 'dayhourlog'));
}
- if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) {
+ if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) {
$newcardbutton .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out);
}
}
diff --git a/htdocs/contrat/agenda.php b/htdocs/contrat/agenda.php
index 3a3c5440b30..c3fa3756655 100644
--- a/htdocs/contrat/agenda.php
+++ b/htdocs/contrat/agenda.php
@@ -41,7 +41,7 @@ if (GETPOST('actioncode', 'array')) {
$actioncode = '0';
}
} else {
- $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT));
+ $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT'));
}
$search_agenda_label = GETPOST('search_agenda_label');
@@ -234,7 +234,7 @@ if ($id > 0) {
$newcardbutton = '';
if (isModEnabled('agenda')) {
- if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) {
+ if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) {
$backtopage = $_SERVER['PHP_SELF'].'?id='.$object->id;
$out = '&origin='.$object->element.'&originid='.$object->id.'&backtopage='.urlencode($backtopage);
$newcardbutton .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out);
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index 00defaf909c..d1d408656af 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -12061,7 +12061,7 @@ function show_actions_messaging($conf, $langs, $db, $filterobj, $objcon = '', $n
$out .= $actionstatic->getNomUrl(1, -1, 'valignmiddle').' ';
}
- if (!empty($user->rights->agenda->allactions->create) ||
+ if ($user->hasRight('agenda', 'allactions', 'create') ||
(($actionstatic->authorid == $user->id || $actionstatic->userownerid == $user->id) && !empty($user->rights->agenda->myactions->create))) {
$out .= '
';
}
diff --git a/htdocs/core/lib/propal.lib.php b/htdocs/core/lib/propal.lib.php
index 9d1401ea47a..3d380a3904a 100644
--- a/htdocs/core/lib/propal.lib.php
+++ b/htdocs/core/lib/propal.lib.php
@@ -42,7 +42,7 @@ function propal_prepare_head($object)
$head[$h][2] = 'comm';
$h++;
- if ((empty($conf->commande->enabled) && ((isModEnabled("expedition") && !empty($conf->expedition_bon->enabled) && $user->rights->expedition->lire)
+ if ((empty($conf->commande->enabled) && ((isModEnabled("expedition") && isModEnabled('expedition_bon') && $user->rights->expedition->lire)
|| (isModEnabled("expedition") && !empty($conf->delivery_note->enabled) && $user->rights->expedition->delivery->lire)))) {
$langs->load("sendings");
$text = '';
diff --git a/htdocs/core/modules/modAgenda.class.php b/htdocs/core/modules/modAgenda.class.php
index d9858a017e0..38debb8633a 100644
--- a/htdocs/core/modules/modAgenda.class.php
+++ b/htdocs/core/modules/modAgenda.class.php
@@ -241,7 +241,7 @@ class modAgenda extends DolibarrModules
'url'=>'/comm/action/card.php?mainmenu=agenda&leftmenu=agenda&action=create',
'langs'=>'commercial',
'position'=>101,
- 'perms'=>'($user->rights->agenda->myactions->create||$user->rights->agenda->allactions->create)',
+ 'perms'=>'($user->hasRight("agenda", "myactions", "create")||$user->hasRight("agenda", "allactions", "create"))',
'enabled'=>'$conf->agenda->enabled',
'target'=>'',
'user'=>2
diff --git a/htdocs/delivery/card.php b/htdocs/delivery/card.php
index b98b75015ab..3a269cc89bb 100644
--- a/htdocs/delivery/card.php
+++ b/htdocs/delivery/card.php
@@ -38,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
if (isModEnabled("product") || isModEnabled("service")) {
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
}
-if (!empty($conf->expedition_bon->enabled)) {
+if (isModEnabled('expedition_bon')) {
require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php';
}
if (isModEnabled('stock')) {
diff --git a/htdocs/fourn/commande/info.php b/htdocs/fourn/commande/info.php
index fc3918a32f3..2ec9450bcfa 100644
--- a/htdocs/fourn/commande/info.php
+++ b/htdocs/fourn/commande/info.php
@@ -196,7 +196,7 @@ if ($permok) {
print '
';
if (isModEnabled('agenda')) {
- if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) {
+ if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) {
print '
id).'">'.$langs->trans("AddAction").'';
} else {
print '
'.$langs->trans("AddAction").'';
diff --git a/htdocs/hrm/establishment/info.php b/htdocs/hrm/establishment/info.php
index 641c53e0f70..3bfbe912279 100644
--- a/htdocs/hrm/establishment/info.php
+++ b/htdocs/hrm/establishment/info.php
@@ -42,7 +42,7 @@ if (GETPOST('actioncode', 'array')) {
$actioncode = '0';
}
} else {
- $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT));
+ $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT'));
}
$search_agenda_label = GETPOST('search_agenda_label');
diff --git a/htdocs/hrm/evaluation_agenda.php b/htdocs/hrm/evaluation_agenda.php
index cc314bd9bce..76d48597c00 100644
--- a/htdocs/hrm/evaluation_agenda.php
+++ b/htdocs/hrm/evaluation_agenda.php
@@ -53,7 +53,7 @@ if (GETPOST('actioncode', 'array')) {
$actioncode = '0';
}
} else {
- $actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT));
+ $actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT'));
}
$search_agenda_label = GETPOST('search_agenda_label');
@@ -200,7 +200,7 @@ if ($object->id > 0) {
print '
';
if (isModEnabled('agenda')) {
- if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) {
+ if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) {
print '
'.$langs->trans("AddAction").'';
} else {
print '
'.$langs->trans("AddAction").'';
diff --git a/htdocs/hrm/job_agenda.php b/htdocs/hrm/job_agenda.php
index 1da6b4948b1..9809aea6ec1 100644
--- a/htdocs/hrm/job_agenda.php
+++ b/htdocs/hrm/job_agenda.php
@@ -52,7 +52,7 @@ if (GETPOST('actioncode', 'array')) {
$actioncode = '0';
}
} else {
- $actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT));
+ $actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT'));
}
$search_agenda_label = GETPOST('search_agenda_label');
@@ -191,7 +191,7 @@ if ($object->id > 0) {
if (isModEnabled('agenda')) {
- if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) {
+ if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) {
$newcardbutton = '';
$newcardbutton .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out);
}
diff --git a/htdocs/hrm/position_agenda.php b/htdocs/hrm/position_agenda.php
index 846202e26a0..12d10825fad 100644
--- a/htdocs/hrm/position_agenda.php
+++ b/htdocs/hrm/position_agenda.php
@@ -53,7 +53,7 @@ if (GETPOST('actioncode', 'array')) {
$actioncode = '0';
}
} else {
- $actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT));
+ $actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT'));
}
$search_agenda_label = GETPOST('search_agenda_label');
@@ -200,7 +200,7 @@ if ($object->id > 0) {
print '
';
if (isModEnabled('agenda')) {
- if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) {
+ if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) {
print '
'.$langs->trans("AddAction").'';
} else {
print '
'.$langs->trans("AddAction").'';
diff --git a/htdocs/hrm/skill_agenda.php b/htdocs/hrm/skill_agenda.php
index a24f3a4caa2..73d3ad17610 100644
--- a/htdocs/hrm/skill_agenda.php
+++ b/htdocs/hrm/skill_agenda.php
@@ -52,7 +52,7 @@ if (GETPOST('actioncode', 'array')) {
$actioncode = '0';
}
} else {
- $actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT));
+ $actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT'));
}
$search_agenda_label = GETPOST('search_agenda_label');
@@ -194,7 +194,7 @@ if ($object->id > 0) {
print '
';
if (isModEnabled('agenda')) {
- if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) {
+ if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) {
print '
'.$langs->trans("AddAction").'';
} else {
print '
'.$langs->trans("AddAction").'';
diff --git a/htdocs/knowledgemanagement/knowledgerecord_agenda.php b/htdocs/knowledgemanagement/knowledgerecord_agenda.php
index b293a2dbdd7..f5a71f0ccc2 100644
--- a/htdocs/knowledgemanagement/knowledgerecord_agenda.php
+++ b/htdocs/knowledgemanagement/knowledgerecord_agenda.php
@@ -49,7 +49,7 @@ if (GETPOST('actioncode', 'array')) {
$actioncode = '0';
}
} else {
- $actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT));
+ $actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT'));
}
$search_agenda_label = GETPOST('search_agenda_label');
@@ -221,7 +221,7 @@ if ($object->id > 0) {
print '
';
if (isModEnabled('agenda')) {
- if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) {
+ if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) {
print '
'.$langs->trans("AddAction").'';
} else {
print '
'.$langs->trans("AddAction").'';
diff --git a/htdocs/modulebuilder/template/myobject_agenda.php b/htdocs/modulebuilder/template/myobject_agenda.php
index d7b84707b95..fab00847eab 100644
--- a/htdocs/modulebuilder/template/myobject_agenda.php
+++ b/htdocs/modulebuilder/template/myobject_agenda.php
@@ -95,7 +95,7 @@ if (GETPOST('actioncode', 'array')) {
$actioncode = '0';
}
} else {
- $actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT));
+ $actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT'));
}
$search_agenda_label = GETPOST('search_agenda_label');
@@ -280,7 +280,7 @@ if ($object->id > 0) {
print '
';
if (isModEnabled('agenda')) {
- if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) {
+ if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) {
print '
'.$langs->trans("AddAction").'';
} else {
print '
'.$langs->trans("AddAction").'';
diff --git a/htdocs/mrp/mo_agenda.php b/htdocs/mrp/mo_agenda.php
index ac944acc066..75db1a21476 100644
--- a/htdocs/mrp/mo_agenda.php
+++ b/htdocs/mrp/mo_agenda.php
@@ -50,7 +50,7 @@ if (GETPOST('actioncode', 'array')) {
$actioncode = '0';
}
} else {
- $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT));
+ $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT'));
}
$search_agenda_label = GETPOST('search_agenda_label');
@@ -219,7 +219,7 @@ if ($object->id > 0) {
print '
';
if (isModEnabled('agenda')) {
- if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) {
+ if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) {
print '
'.$langs->trans("AddAction").'';
} else {
print '
'.$langs->trans("AddAction").'';
diff --git a/htdocs/partnership/partnership_agenda.php b/htdocs/partnership/partnership_agenda.php
index 20b3d5a8a2c..360e5b71ade 100644
--- a/htdocs/partnership/partnership_agenda.php
+++ b/htdocs/partnership/partnership_agenda.php
@@ -49,7 +49,7 @@ if (GETPOST('actioncode', 'array')) {
$actioncode = '0';
}
} else {
- $actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT));
+ $actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT'));
}
$search_agenda_label = GETPOST('search_agenda_label');
@@ -227,7 +227,7 @@ if ($object->id > 0) {
print '
';
if (isModEnabled('agenda')) {
- if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) {
+ if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) {
print '
'.$langs->trans("AddAction").'';
} else {
print '
'.$langs->trans("AddAction").'';
diff --git a/htdocs/product/agenda.php b/htdocs/product/agenda.php
index c0ecdb2ad0f..e21089730b8 100644
--- a/htdocs/product/agenda.php
+++ b/htdocs/product/agenda.php
@@ -43,7 +43,7 @@ if (GETPOST('actioncode', 'array')) {
$actioncode = '0';
}
} else {
- $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT));
+ $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT'));
}
$search_agenda_label = GETPOST('search_agenda_label');
@@ -197,7 +197,7 @@ if ($id > 0 || $ref) {
$out .= (!empty($objcon->id) ? '&contactid='.$objcon->id : '').'&backtopage='.$_SERVER["PHP_SELF"].'?id='.$object->id.'&percentage=-1';
}
- $linktocreatetimeBtnStatus = !empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create);
+ $linktocreatetimeBtnStatus = !empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create');
$morehtmlcenter = dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out, '', $linktocreatetimeBtnStatus);
}
diff --git a/htdocs/product/list.php b/htdocs/product/list.php
index 14d43e038f1..411ab569a0b 100644
--- a/htdocs/product/list.php
+++ b/htdocs/product/list.php
@@ -210,7 +210,7 @@ $alias_product_perentity = empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED) ?
$arrayfields = array(
'p.rowid'=>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-2, 'noteditable'=>1, 'notnull'=> 1, 'index'=>1, 'position'=>1, 'comment'=>'Id', 'css'=>'left'),
'p.ref'=>array('label'=>"Ref", 'checked'=>1, 'position'=>10),
- //'pfp.ref_fourn'=>array('label'=>$langs->trans("RefSupplier"), 'checked'=>1, 'enabled'=>(!empty($conf->barcode->enabled))),
+ //'pfp.ref_fourn'=>array('label'=>$langs->trans("RefSupplier"), 'checked'=>1, 'enabled'=>(isModEnabled('barcode'))),
'thumbnail'=>array('label'=>'Photo', 'checked'=>0, 'position'=>10),
'p.label'=>array('label'=>"Label", 'checked'=>1, 'position'=>10),
'p.fk_product_type'=>array('label'=>"Type", 'checked'=>0, 'enabled'=>(isModEnabled("product") && isModEnabled("service")), 'position'=>11),
diff --git a/htdocs/product/stock/stocktransfer/stocktransfer_agenda.php b/htdocs/product/stock/stocktransfer/stocktransfer_agenda.php
index b62dfa5b00d..2f06badf2cc 100644
--- a/htdocs/product/stock/stocktransfer/stocktransfer_agenda.php
+++ b/htdocs/product/stock/stocktransfer/stocktransfer_agenda.php
@@ -45,7 +45,7 @@ if (GETPOST('actioncode', 'array')) {
$actioncode = GETPOST('actioncode', 'array', 3);
if (!count($actioncode)) $actioncode = '0';
} else {
- $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT));
+ $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT'));
}
$search_agenda_label = GETPOST('search_agenda_label');
@@ -201,7 +201,7 @@ if ($object->id > 0) {
print '
';
if (isModEnabled('agenda')) {
- if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) {
+ if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) {
print '
'.$langs->trans("AddAction").'';
} else {
print '
'.$langs->trans("AddAction").'';
diff --git a/htdocs/projet/agenda.php b/htdocs/projet/agenda.php
index a3c120d0a23..65d73751423 100644
--- a/htdocs/projet/agenda.php
+++ b/htdocs/projet/agenda.php
@@ -59,7 +59,7 @@ if (GETPOST('actioncode', 'array')) {
$actioncode = '0';
}
} else {
- $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT));
+ $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT'));
}
$search_agenda_label = GETPOST('search_agenda_label');
@@ -196,7 +196,7 @@ if (!empty($object->id)) {
// Show link to add event
if (isModEnabled('agenda')) {
- $addActionBtnRight = !empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create);
+ $addActionBtnRight = !empty($user->rights->agenda->myactions->create) || $user->hasRight('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/projet/messaging.php b/htdocs/projet/messaging.php
index 7fe5b4a0b9d..b266b87700d 100644
--- a/htdocs/projet/messaging.php
+++ b/htdocs/projet/messaging.php
@@ -59,7 +59,7 @@ if (GETPOST('actioncode', 'array')) {
$actioncode = '0';
}
} else {
- $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT));
+ $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT'));
}
$search_agenda_label = GETPOST('search_agenda_label');
@@ -196,7 +196,7 @@ if (!empty($object->id)) {
// Show link to add event
if (isModEnabled('agenda')) {
- $addActionBtnRight = !empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create);
+ $addActionBtnRight = !empty($user->rights->agenda->myactions->create) || $user->hasRight('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 04118f55572..0cb1e3a4f1f 100644
--- a/htdocs/recruitment/recruitmentcandidature_agenda.php
+++ b/htdocs/recruitment/recruitmentcandidature_agenda.php
@@ -48,7 +48,7 @@ if (GETPOST('actioncode', 'array')) {
$actioncode = '0';
}
} else {
- $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT));
+ $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT'));
}
$search_agenda_label = GETPOST('search_agenda_label');
@@ -221,7 +221,7 @@ if ($object->id > 0) {
print '
';
if (isModEnabled('agenda')) {
- if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) {
+ if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) {
print '
'.$langs->trans("AddAction").'';
} else {
print '
'.$langs->trans("AddAction").'';
diff --git a/htdocs/recruitment/recruitmentjobposition_agenda.php b/htdocs/recruitment/recruitmentjobposition_agenda.php
index f2f4d37484b..9a3a0e2fe7d 100644
--- a/htdocs/recruitment/recruitmentjobposition_agenda.php
+++ b/htdocs/recruitment/recruitmentjobposition_agenda.php
@@ -47,7 +47,7 @@ if (GETPOST('actioncode', 'array')) {
$actioncode = '0';
}
} else {
- $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT));
+ $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT'));
}
$search_agenda_label = GETPOST('search_agenda_label');
@@ -218,7 +218,7 @@ if ($object->id > 0) {
print '
';
if (isModEnabled('agenda')) {
- if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) {
+ if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) {
print '
'.$langs->trans("AddAction").'';
} else {
print '
'.$langs->trans("AddAction").'';
diff --git a/htdocs/resource/agenda.php b/htdocs/resource/agenda.php
index 8fddadcce11..a9378cefe1d 100644
--- a/htdocs/resource/agenda.php
+++ b/htdocs/resource/agenda.php
@@ -51,7 +51,7 @@ if (GETPOST('actioncode', 'array')) {
$actioncode = '0';
}
} else {
- $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT));
+ $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT'));
}
$search_agenda_label = GETPOST('search_agenda_label');
diff --git a/htdocs/societe/agenda.php b/htdocs/societe/agenda.php
index 9e6c10a0ccd..9df581a6999 100644
--- a/htdocs/societe/agenda.php
+++ b/htdocs/societe/agenda.php
@@ -43,7 +43,7 @@ if (GETPOST('actioncode', 'array')) {
$actioncode = '0';
}
} else {
- $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT));
+ $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT'));
}
$search_agenda_label = GETPOST('search_agenda_label');
@@ -178,7 +178,7 @@ if ($socid > 0) {
// $morehtmlright .= dolGetButtonTitle($langs->trans('TicketAddMessage'), '', 'fa fa-comment-dots', $url, 'add-new-ticket-title-button', $btnstatus);
if (isModEnabled('agenda')) {
- if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) {
+ if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) {
$morehtmlright .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out);
}
}
diff --git a/htdocs/societe/messaging.php b/htdocs/societe/messaging.php
index c73d6ffe0b1..10a34c48dec 100644
--- a/htdocs/societe/messaging.php
+++ b/htdocs/societe/messaging.php
@@ -43,7 +43,7 @@ if (GETPOST('actioncode', 'array')) {
$actioncode = '0';
}
} else {
- $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT));
+ $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT'));
}
$search_agenda_label = GETPOST('search_agenda_label');
@@ -178,7 +178,7 @@ if ($socid > 0) {
// $morehtmlright .= dolGetButtonTitle($langs->trans('TicketAddMessage'), '', 'fa fa-comment-dots', $url, 'add-new-ticket-title-button', $btnstatus);
if (isModEnabled('agenda')) {
- if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) {
+ if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) {
$morehtmlright .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out);
}
}
diff --git a/htdocs/ticket/agenda.php b/htdocs/ticket/agenda.php
index 9111faedcb7..fb92fd44f33 100644
--- a/htdocs/ticket/agenda.php
+++ b/htdocs/ticket/agenda.php
@@ -68,7 +68,7 @@ if (GETPOST('actioncode', 'array')) {
$actioncode = '0';
}
} else {
- $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT));
+ $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT'));
}
$search_agenda_label = GETPOST('search_agenda_label');
diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php
index f00d4223878..47f793f71ae 100755
--- a/htdocs/ticket/card.php
+++ b/htdocs/ticket/card.php
@@ -71,7 +71,7 @@ if (GETPOST('actioncode', 'array')) {
$actioncode = '0';
}
} else {
- $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT));
+ $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT'));
}
$search_agenda_label = GETPOST('search_agenda_label');
diff --git a/htdocs/ticket/messaging.php b/htdocs/ticket/messaging.php
index bd06bd32e94..ee919d99314 100644
--- a/htdocs/ticket/messaging.php
+++ b/htdocs/ticket/messaging.php
@@ -68,7 +68,7 @@ if (GETPOST('actioncode', 'array')) {
$actioncode = '0';
}
} else {
- $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT));
+ $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT'));
}
$search_agenda_label = GETPOST('search_agenda_label');
diff --git a/htdocs/webhook/target_agenda.php b/htdocs/webhook/target_agenda.php
index 17b9842c238..bf9cee2ec72 100644
--- a/htdocs/webhook/target_agenda.php
+++ b/htdocs/webhook/target_agenda.php
@@ -46,7 +46,7 @@ if (GETPOST('actioncode', 'array')) {
$actioncode = '0';
}
} else {
- $actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT));
+ $actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT'));
}
$search_agenda_label = GETPOST('search_agenda_label');
@@ -233,7 +233,7 @@ if ($object->id > 0) {
print '
';
if (isModEnabled('agenda')) {
- if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) {
+ if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) {
print '
'.$langs->trans("AddAction").'';
} else {
print '
'.$langs->trans("AddAction").'';
diff --git a/htdocs/workstation/workstation_agenda.php b/htdocs/workstation/workstation_agenda.php
index 777da58f92c..7739cec620e 100644
--- a/htdocs/workstation/workstation_agenda.php
+++ b/htdocs/workstation/workstation_agenda.php
@@ -223,7 +223,7 @@ if ($object->id > 0) {
print '
';
if (!empty($conf->agenda->enabled)) {
- if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) {
+ if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) {
print '
'.$langs->trans("AddAction").'';
} else {
print '
'.$langs->trans("AddAction").'';