PHRAS-4078_ExpiringRight-to-core (#4526)

* wip do not merge

* fix event EXPORT_CREATE for basket download

* fix bad conf (not a worker)

* fix bad table name
This commit is contained in:
jygaulier
2024-07-17 17:11:55 +02:00
committed by GitHub
parent 0d970a2a4e
commit 1979ad0f79
8 changed files with 1141 additions and 1 deletions

View File

@@ -67,6 +67,12 @@ class DownloadController extends Controller
$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 @@ class DownloadController extends Controller
$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;