Browse Source

Merge pull request #24420 from atm-adrien/FIX_actionOwner_cant_see_his_events

FIX : Add the possibility to check events
Laurent Destailleur 2 years ago
parent
commit
f54383526e
2 changed files with 2 additions and 1 deletions
  1. 1 1
      htdocs/comm/action/class/actioncomm.class.php
  2. 1 0
      htdocs/comm/action/list.php

+ 1 - 1
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)) {

+ 1 - 0
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