From d862b40f3ddbcc2cedf261e3cd692b0d02194fdf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 5 Sep 2024 14:25:14 +0200 Subject: [PATCH 1/2] Fix warning --- htdocs/core/lib/company.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 14fa5b0cb17..77d24c891b5 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -904,7 +904,7 @@ function show_projects($conf, $langs, $db, $object, $backtopage = '', $nocreatel print ''; if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { print ''; - $selectedfields = (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); + $selectedfields = (is_array($arrayofmassactions) && count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print $selectedfields; print ''; } From ea599f1264c35462e2a0cef9ae611319f0f99fec Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 5 Sep 2024 14:58:56 +0200 Subject: [PATCH 2/2] Debug v20 Fix can't create an event --- htdocs/comm/action/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 755013df254..33d8fc55429 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -156,7 +156,7 @@ $TDurationTypes = array('y' => $langs->trans('Years'), 'm' => $langs->trans('Mon $result = restrictedArea($user, 'agenda', $object, 'actioncomm&societe', 'myactions|allactions', 'fk_soc', 'id'); -$usercancreate = $user->hasRight('agenda', 'allactions', 'create') || (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->hasRight('agenda', 'myactions', 'create')); +$usercancreate = $user->hasRight('agenda', 'allactions', 'create') || ((empty($object->id) || $object->authorid == $user->id || $object->userownerid == $user->id) && $user->hasRight('agenda', 'myactions', 'create')); /*