Merge pull request #36699 from W1W1-M/fix-document-api-agenda-event-list-download

FIX document API agenda event list and download
This commit is contained in:
Laurent Destailleur
2025-12-22 19:08:55 +01:00
committed by GitHub
3 changed files with 36 additions and 18 deletions

View File

@@ -587,8 +587,8 @@ class Documents extends DolibarrApi
throw new RestException(500, 'Error while fetching object: '.$object->error);
}
$upload_dir = $conf->product->multidir_output[$object->entity ?? $conf->entity].'/'.get_exdir(0, 0, 0, 1, $object, 'product');
} elseif ($modulepart == 'agenda' || $modulepart == 'action' || $modulepart == 'event') {
$upload_dir = getMultidirOutput($object) . '/'.dol_sanitizeFileName($object->ref);
} elseif ($modulepart == 'agenda' || $modulepart == 'action' || $modulepart == 'event' || $modulepart == 'actioncomm') {
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
if (!DolibarrApiAccess::$user->hasRight('agenda', 'myactions', 'read') && !DolibarrApiAccess::$user->hasRight('agenda', 'allactions', 'read')) {