From 1d59cdc41b346b88e0b27616190e2fb5e5267ef7 Mon Sep 17 00:00:00 2001 From: Adrien Raze Date: Mon, 3 Apr 2023 10:13:11 +0200 Subject: [PATCH] FIX : Add the possibility to events oxwner to check their events from the list when the perm "Read the actions (events or tasks) of others" is not active --- htdocs/comm/action/class/actioncomm.class.php | 2 +- htdocs/comm/action/list.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index cf45a7d70d0..d930ea96b2c 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -1566,7 +1566,7 @@ class ActionComm extends CommonObject } $canread = 0; - if ($user->rights->agenda->myactions->read && $this->authorid == $user->id) { + if ($user->rights->agenda->myactions->read && ($this->authorid == $user->id || $this->userownerid == $user->id)) { $canread = 1; // Can read my event } if ($user->rights->agenda->myactions->read && array_key_exists($user->id, $this->userassigned)) { diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index c9f0f31391f..bd1f628f55c 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -917,6 +917,7 @@ while ($i < $imaxinloop) { $actionstatic->datep = $db->jdate($obj->dp); $actionstatic->percentage = $obj->percent; $actionstatic->authorid = $obj->fk_user_author; + $actionstatic->userownerid = $obj->fk_user_action; // Initialize $this->userassigned && this->socpeopleassigned array && this->userownerid // but only if we need it