diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 31b4d3c7cd6..aefc94e85f4 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -435,8 +435,10 @@ if (empty($reshook) && $action == 'update') if ($p2hour == -1) $p2hour='0'; if ($p2min == -1) $p2min='0'; - //$object->fetch($id); - //$object->fetch_userassigned(); + $object->fetch($id); + $object->fetch_optionals(); + $object->fetch_userassigned(); + $object->oldcopy = clone $object; $datep=dol_mktime($fulldayevent?'00':$aphour, $fulldayevent?'00':$apmin, 0, $_POST["apmonth"], $_POST["apday"], $_POST["apyear"]); $datef=dol_mktime($fulldayevent?'23':$p2hour, $fulldayevent?'59':$p2min, $fulldayevent?'59':'0', $_POST["p2month"], $_POST["p2day"], $_POST["p2year"]); @@ -622,7 +624,10 @@ if (empty($reshook) && $action == 'update') */ if (empty($reshook) && $action == 'confirm_delete' && GETPOST("confirm") == 'yes') { - //$object->fetch($id); + $object->fetch($id); + $object->fetch_optionals(); + $object->fetch_userassigned(); + $object->oldcopy = clone $object; if ($user->rights->agenda->myactions->delete || $user->rights->agenda->allactions->delete) diff --git a/htdocs/comm/action/class/api_agendaevents.class.php b/htdocs/comm/action/class/api_agendaevents.class.php index 833f97b3b6b..3f21e94f53d 100644 --- a/htdocs/comm/action/class/api_agendaevents.class.php +++ b/htdocs/comm/action/class/api_agendaevents.class.php @@ -237,6 +237,11 @@ class AgendaEvents extends DolibarrApi } $result = $this->actioncomm->fetch($id); + if ($result) { + $this->actioncomm->fetch_optionals(); + $this->actioncomm->fetch_userassigned(); + $this->actioncomm->oldcopy = clone $this->actioncomm; + } if ( ! $result ) { throw new RestException(404, 'actioncomm not found'); } @@ -270,6 +275,11 @@ class AgendaEvents extends DolibarrApi } $result = $this->actioncomm->fetch($id); + if ($result) { + $this->actioncomm->fetch_optionals(); + $this->actioncomm->fetch_userassigned(); + $this->actioncomm->oldcopy = clone $this->actioncomm; + } if(! DolibarrApiAccess::$user->rights->agenda->allactions->delete && DolibarrApiAccess::$user->id != $this->actioncomm->userownerid) { throw new RestException(401, "Insuffisant rights to delete an Agenda Event of owner id ".$request_data['userownerid'].' Your id is '.DolibarrApiAccess::$user->id);