Files
survey-bundle/contao/dca/tl_survey_answer.php
T
Claude Fable 5 833a8964cf Add topic sections, ordered inserts, rich-text descriptions and grouped results (Ausbaustufe 3)
- section content type with structure service, reader context and grouped results/PDF/Excel
- new questions append at the end (backend oncreate) and per-section add buttons
- rich-text descriptions: Quill 2 (frontend), reduced TinyMCE (backend), server-side whitelist sanitizer
- externalize inline assets, bundle Chart.js locally, harden debug access, validate range bounds

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-22 07:57:40 +02:00

72 lines
2.2 KiB
PHP

<?php
declare(strict_types=1);
use Contao\DC_Table;
$GLOBALS['TL_DCA']['tl_survey_answer'] = [
'config' => [
'dataContainer' => DC_Table::class,
'ptable' => 'tl_survey_submission',
'closed' => true,
'notCreatable' => true,
'notEditable' => true,
'notCopyable' => true,
'sql' => [
'keys' => [
'id' => 'primary',
'pid' => 'index',
'submission' => 'index',
'question' => 'index',
],
],
],
'list' => [
'sorting' => [
'mode' => 4,
'fields' => ['id'],
'headerFields' => ['token', 'startedAt', 'completedAt'],
'panelLayout' => 'sort,search,limit',
],
'label' => [
'fields' => ['question', 'questionType', 'value'],
'showColumns' => true,
],
'operations' => [
'show' => [
'href' => 'act=show',
'icon' => 'show.svg',
],
],
],
'fields' => [
'id' => ['sql' => 'int(10) unsigned NOT NULL auto_increment'],
'tstamp' => ['sql' => 'int(10) unsigned NOT NULL default 0'],
'pid' => ['sql' => 'int(10) unsigned NOT NULL default 0'],
'submission' => ['sql' => 'int(10) unsigned NOT NULL default 0'],
'question' => [
'label' => &$GLOBALS['TL_LANG']['tl_survey_answer']['question'],
'sql' => 'int(10) unsigned NOT NULL default 0',
],
'questionType' => [
'label' => &$GLOBALS['TL_LANG']['tl_survey_answer']['questionType'],
'sql' => "varchar(32) NOT NULL default ''",
],
'questionLabel' => [
'sql' => "varchar(255) NOT NULL default ''",
],
'questionDescription' => [
'sql' => 'text NULL',
],
'questionSorting' => [
'sql' => 'int(10) unsigned NOT NULL default 0',
],
'questionSection' => [
'sql' => "varchar(255) NOT NULL default ''",
],
'value' => [
'label' => &$GLOBALS['TL_LANG']['tl_survey_answer']['value'],
'sql' => 'text NULL',
],
],
];