Fix permission on button

This commit is contained in:
Laurent Destailleur 2020-04-19 15:50:32 +02:00
parent 4bbe307b41
commit 7b68d4260c

View File

@ -203,7 +203,7 @@ class FormActions
if ($typeelement == 'project') $projectid = $object->id;
$newcardbutton = '';
if (!empty($conf->agenda->enabled))
if (!empty($conf->agenda->enabled) && ! empty($user->rights->agenda->myactions->create))
{
$newcardbutton .= dolGetButtonTitle($langs->trans("AddEvent"), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.dol_print_date(dol_now(), 'dayhourlog').'&origin='.$typeelement.'&originid='.$object->id.($object->socid > 0 ? '&socid='.$object->socid : ($socid > 0 ? '&socid='.$socid : '')).($projectid > 0 ? '&projectid='.$projectid : '').'&backtopage='.urlencode($urlbacktopage));
}