NEW add agenda documents in API REST
This commit is contained in:
parent
64517d4c0b
commit
e1dabe3924
@ -356,6 +356,22 @@ class Documents extends DolibarrApi
|
||||
|
||||
$upload_dir = $conf->facture->dir_output . "/" . get_exdir(0, 0, 0, 1, $object, 'invoice');
|
||||
}
|
||||
else if ($modulepart == 'agenda' || $modulepart == 'action' || $modulepart == 'event')
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
|
||||
|
||||
if (!DolibarrApiAccess::$user->rights->agenda->myactions->read && !DolibarrApiAccess::$user->rights->agenda->allactions->read) {
|
||||
throw new RestException(401);
|
||||
}
|
||||
|
||||
$object = new ActionComm($this->db);
|
||||
$result=$object->fetch($id, $ref);
|
||||
if ( ! $result ) {
|
||||
throw new RestException(404, 'Event not found');
|
||||
}
|
||||
|
||||
$upload_dir = $conf->agenda->dir_output.'/'.dol_sanitizeFileName($object->ref);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new RestException(500, 'Modulepart '.$modulepart.' not implemented yet.');
|
||||
|
||||
Loading…
Reference in New Issue
Block a user