diff --git a/lib/Alchemy/Phrasea/Controller/Prod/DownloadController.php b/lib/Alchemy/Phrasea/Controller/Prod/DownloadController.php index 075cecb66b..7fa80cfc72 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/DownloadController.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/DownloadController.php @@ -67,6 +67,12 @@ public function checkDownload(Request $request) $list['include_report'] = $request->request->get('include_report') === 'INCLUDE_REPORT'; $list['include_businessfields'] = (bool)$request->request->get('businessfields'); + $lst = []; + foreach ($list['files'] as $file) { + $lst[] = $this->getApplicationBox()->get_collection($file['base_id'])->get_databox()->get_sbas_id() . '_' . $file['record_id']; + } + $lst = join(';', $lst); + $token = $this->getTokenManipulator()->createDownloadToken($this->getAuthenticatedUser(), serialize($list)); $this->getDispatcher()->dispatch(PhraseaEvents::EXPORT_CREATE, new ExportEvent( @@ -136,6 +142,12 @@ public function listDownloadAsync(Request $request) $records[sprintf('%s_%s', $sbasId, $file['record_id'])] = $record; } + $lst = []; + foreach ($list['files'] as $file) { + $lst[] = $this->getApplicationBox()->get_collection($file['base_id'])->get_databox()->get_sbas_id() . '_' . $file['record_id']; + } + $lst = join(';', $lst); + $token = $this->getTokenManipulator()->createDownloadToken($this->getAuthenticatedUser(), serialize($list)); $pusher_auth_key =$this->getConf()->get(['download_async', 'enabled'], false) ? $this->getConf()->get(['externalservice', 'pusher', 'auth_key'], '') : null;