Replace CSV export with PDF export
CI / Deploy / test (push) Successful in 53s
CI / Deploy / deploy (push) Skipped

The results export is now a PDF (Dompdf) with all interactive slides.
By default private slides (anonymous/internal feedback) only show their
number of participants; ?internal=1 creates the complete version incl.
their answers, marked as confidential on every page.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
gnilebeinandClaude Opus 5.5 committed 2026-11-08 19:21:10 +01:00
1 parent 5cd1be1cf8
commit d1facd32a6
21 files changed
+1102 -110

No files matched your search

+23
View File
@@ -7,6 +7,7 @@ use App\Model\Entity\Poll;
use App\Model\Entity\Slide;
use App\Model\Table\PollsTable;
use App\Model\Table\SlidesTable;
use App\View\PdfView;
use Cake\ORM\TableRegistry;
/**
@@ -85,4 +86,26 @@ trait PlenarioTestTrait
return $table;
}
/**
* Requests the PDF export (needs IntegrationTestTrait) and returns the HTML it was rendered from,
* since the PDF itself is compressed and not searchable.
*
* @param string $token Admin token
* @param bool $internal Complete version incl. internal content
* @return string
*/
protected function exportHtml(string $token, bool $internal = false): string
{
$this->get("/admin/$token/export.pdf" . ($internal ? '?internal=1' : ''));
$this->assertResponseOk();
$this->assertContentType('application/pdf');
$this->assertStringStartsWith('%PDF-', (string)$this->_response->getBody());
$view = new PdfView();
$view->set($this->_controller->viewBuilder()->getVars());
$view->setTemplatePath('Admin');
return $view->renderHtml('export');
}
}