From d87419f3dbdfdf50aa00bd3e4735520de35c0489 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 22 Jan 2020 13:34:07 +0100 Subject: [PATCH] FIX #11957 --- htdocs/comm/action/class/actioncomm.class.php | 6 +++++- htdocs/comm/action/index.php | 9 +++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 95cbd6beb7a..01f38eb531f 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -1393,7 +1393,11 @@ class ActionComm extends CommonObject if (!empty($conf->dol_no_mouse_hover)) $notooltip = 1; // Force disable tooltips - if ((!$user->rights->agenda->allactions->read && $this->authorid != $user->id) || (!$user->rights->agenda->myactions->read && $this->authorid == $user->id)) + $canread = 0; + if ($user->rights->agenda->myactions->read && $this->authorid == $user->id) $canread = 1; // Can read my event + if ($user->rights->agenda->myactions->read && array_key_exists($user->id, $this->userassigned)) $canread = 1; // Can read my event i am assigned + if ($user->rights->agenda->allactions->read) $canread = 1; // Can read all event of other + if (! $canread) { $option = 'nolink'; } diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index c4750ef54db..a9a832ea6b4 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -1568,13 +1568,12 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa $titletoshow = $daterange; $titletoshow .= ($titletoshow ? ' ' : '').($event->label ? $event->label : $event->libelle); - if ($event->type_code == 'ICALEVENT') print $titletoshow; - else - { + if ($event->type_code != 'ICALEVENT') { $savlabel = $event->label ? $event->label : $event->libelle; $event->label = $titletoshow; $event->libelle = $titletoshow; - print $event->getNomUrl(0, $maxnbofchar, 'cal_event', '', 0, 0); + // Note: List of users are inside $event->userassigned. Link may be clickable depending on permissions of user. + $titletoshow = $event->getNomUrl(0, $maxnbofchar, 'cal_event', '', 0, 0); $event->label = $savlabel; $event->libelle = $savlabel; } @@ -1595,6 +1594,8 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa $listofusertoshow .= $cacheusers[$tmpid]->getNomUrl(-3, '', 0, 0, 0, 0, '', 'paddingright valigntextbottom'); } + + print $titletoshow; print $listofusertoshow; if ($event->type_code == 'ICALEVENT') print '
('.dol_trunc($event->icalname, $maxnbofchar).')';