From aa74d2ac38cb398ce9ae3ea3ded9a1ea037035f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 4 Sep 2018 23:53:37 +0200 Subject: [PATCH] Update api_agendaevents.class.php --- htdocs/comm/action/class/api_agendaevents.class.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/comm/action/class/api_agendaevents.class.php b/htdocs/comm/action/class/api_agendaevents.class.php index dedc515f61c..677e477cd89 100644 --- a/htdocs/comm/action/class/api_agendaevents.class.php +++ b/htdocs/comm/action/class/api_agendaevents.class.php @@ -219,7 +219,7 @@ class AgendaEvents extends DolibarrApi /** - * Update Agenda Event general fields (won't touch lines of expensereport) + * Update Agenda Event general fields * * @param int $id Id of Agenda Event to update * @param array $request_data Datas @@ -236,20 +236,20 @@ class AgendaEvents extends DolibarrApi throw new RestException(401, "Insuffisant rights to create an Agenda Event for owner id ".$request_data['userownerid'].' Your id is '.DolibarrApiAccess::$user->id); } - $result = $this->expensereport->fetch($id); + $result = $this->actioncomm->fetch($id); if ( ! $result ) { - throw new RestException(404, 'expensereport not found'); + throw new RestException(404, 'actioncomm not found'); } - if ( ! DolibarrApi::_checkAccessToResource('expensereport',$this->expensereport->id)) { + if ( ! DolibarrApi::_checkAccessToResource('actioncomm',$this->actioncomm->id)) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } foreach($request_data as $field => $value) { if ($field == 'id') continue; - $this->expensereport->$field = $value; + $this->actioncomm->$field = $value; } - if ($this->expensereport->update($id, DolibarrApiAccess::$user,1,'','','update')) + if ($this->actioncomm->update($id, DolibarrApiAccess::$user,1,'','','update')) return $this->get($id); return false;