Add anonymous export option

This commit is contained in:
Nicolas Le Goff
2012-10-24 16:16:49 +02:00
parent a0327024a5
commit 103e46891a
3 changed files with 15 additions and 5 deletions

View File

@@ -15,7 +15,6 @@ use Silex\Application;
use Silex\ControllerProviderInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\KernelEvents;
class DoDownload implements ControllerProviderInterface
{
@@ -124,7 +123,8 @@ class DoDownload implements ControllerProviderInterface
'module' => _('Export'),
'list' => $list,
'records' => $records,
'token' => $token
'token' => $token,
'anonymous' => $request->query->get('anonymous', false)
)));
}
@@ -166,7 +166,13 @@ class DoDownload implements ControllerProviderInterface
}
$app->finish(function ($request, $response) use ($list, $app) {
\set_export::log_download($app, $list, $request->request->get('type'));
\set_export::log_download(
$app,
$list,
$request->request->get('type'),
(null !== $request->request->get('anonymous') ? true : false),
(isset($list['email']) ? $list['email'] : '')
);
});
$response = \set_export::stream_file(

View File

@@ -274,7 +274,7 @@ class Export implements ControllerProviderInterface
$remaingEmails = $destMails;
$url = $app['phraseanet.registry']->get('GV_ServerName') . 'mail-export/' . $token . '/';
$url = $app['phraseanet.registry']->get('GV_ServerName') . 'download/' . $token . '/prepare/?anonymous';
$from = array(
'name' => $app['phraseanet.user']->get_display_name(),

View File

@@ -83,7 +83,11 @@
</div>
<div style="display:none">
<form name="download" action="{{ path('document_download', {'token': token}) }}" method="post" target="file_frame"></form>
<form name="download" action="{{ path('document_download', {'token': token}) }}" method="post" target="file_frame">
{% if anonymous %}
<input type="hidden" name="anonymous" value="1" />
{% endif%}
</form>
<iframe name="file_frame"></iframe>
</div>