Clean up obsolete survey editor and DCA code

This commit is contained in:
Jürgen Mummert
2026-06-07 22:16:37 +02:00
parent 497b4f962d
commit b7bcdd8372
10 changed files with 6 additions and 95 deletions
+1 -7
View File
@@ -5,8 +5,6 @@ declare(strict_types=1);
use Contao\DC_Table; use Contao\DC_Table;
use Mummert\SurveyBundle\EventListener\SurveyDcaListener; use Mummert\SurveyBundle\EventListener\SurveyDcaListener;
$guardCallback = [SurveyDcaListener::class, 'guardConditionSave'];
$GLOBALS['TL_DCA']['tl_survey_condition'] = [ $GLOBALS['TL_DCA']['tl_survey_condition'] = [
'config' => [ 'config' => [
'dataContainer' => DC_Table::class, 'dataContainer' => DC_Table::class,
@@ -16,7 +14,6 @@ $GLOBALS['TL_DCA']['tl_survey_condition'] = [
[SurveyDcaListener::class, 'touchSurveyConditionParent'], [SurveyDcaListener::class, 'touchSurveyConditionParent'],
], ],
'ondelete_callback' => [ 'ondelete_callback' => [
[SurveyDcaListener::class, 'guardConditionDelete'],
[SurveyDcaListener::class, 'touchSurveyConditionParent'], [SurveyDcaListener::class, 'touchSurveyConditionParent'],
], ],
'sql' => [ 'sql' => [
@@ -32,7 +29,7 @@ $GLOBALS['TL_DCA']['tl_survey_condition'] = [
'sorting' => [ 'sorting' => [
'mode' => 4, 'mode' => 4,
'fields' => ['id'], 'fields' => ['id'],
'headerFields' => ['title', 'alias', 'published', 'isLocked'], 'headerFields' => ['title', 'alias', 'published'],
'panelLayout' => 'sort,search,limit', 'panelLayout' => 'sort,search,limit',
], ],
'label' => [ 'label' => [
@@ -71,14 +68,12 @@ $GLOBALS['TL_DCA']['tl_survey_condition'] = [
'inputType' => 'select', 'inputType' => 'select',
'options_callback' => [SurveyDcaListener::class, 'getQuestionOptions'], 'options_callback' => [SurveyDcaListener::class, 'getQuestionOptions'],
'eval' => ['mandatory' => true, 'includeBlankOption' => true, 'chosen' => true, 'tl_class' => 'w50'], 'eval' => ['mandatory' => true, 'includeBlankOption' => true, 'chosen' => true, 'tl_class' => 'w50'],
'save_callback' => [$guardCallback],
'sql' => 'int(10) unsigned NOT NULL default 0', 'sql' => 'int(10) unsigned NOT NULL default 0',
], ],
'answerValue' => [ 'answerValue' => [
'label' => &$GLOBALS['TL_LANG']['tl_survey_condition']['answerValue'], 'label' => &$GLOBALS['TL_LANG']['tl_survey_condition']['answerValue'],
'inputType' => 'text', 'inputType' => 'text',
'eval' => ['mandatory' => true, 'maxlength' => 255, 'tl_class' => 'w50'], 'eval' => ['mandatory' => true, 'maxlength' => 255, 'tl_class' => 'w50'],
'save_callback' => [$guardCallback],
'sql' => "varchar(255) NOT NULL default ''", 'sql' => "varchar(255) NOT NULL default ''",
], ],
'targetQuestion' => [ 'targetQuestion' => [
@@ -86,7 +81,6 @@ $GLOBALS['TL_DCA']['tl_survey_condition'] = [
'inputType' => 'select', 'inputType' => 'select',
'options_callback' => [SurveyDcaListener::class, 'getQuestionOptions'], 'options_callback' => [SurveyDcaListener::class, 'getQuestionOptions'],
'eval' => ['mandatory' => true, 'includeBlankOption' => true, 'chosen' => true, 'tl_class' => 'clr'], 'eval' => ['mandatory' => true, 'includeBlankOption' => true, 'chosen' => true, 'tl_class' => 'clr'],
'save_callback' => [$guardCallback],
'sql' => 'int(10) unsigned NOT NULL default 0', 'sql' => 'int(10) unsigned NOT NULL default 0',
], ],
], ],
+1 -26
View File
@@ -5,8 +5,6 @@ declare(strict_types=1);
use Contao\DC_Table; use Contao\DC_Table;
use Mummert\SurveyBundle\EventListener\SurveyDcaListener; use Mummert\SurveyBundle\EventListener\SurveyDcaListener;
$guardCallback = [SurveyDcaListener::class, 'guardContentSave'];
$GLOBALS['TL_DCA']['tl_survey_content'] = [ $GLOBALS['TL_DCA']['tl_survey_content'] = [
'config' => [ 'config' => [
'dataContainer' => DC_Table::class, 'dataContainer' => DC_Table::class,
@@ -19,7 +17,6 @@ $GLOBALS['TL_DCA']['tl_survey_content'] = [
[SurveyDcaListener::class, 'resolveSurveyContentPalette'], [SurveyDcaListener::class, 'resolveSurveyContentPalette'],
], ],
'ondelete_callback' => [ 'ondelete_callback' => [
[SurveyDcaListener::class, 'guardContentDelete'],
[SurveyDcaListener::class, 'touchSurveyContentParent'], [SurveyDcaListener::class, 'touchSurveyContentParent'],
], ],
'sql' => [ 'sql' => [
@@ -35,7 +32,7 @@ $GLOBALS['TL_DCA']['tl_survey_content'] = [
'sorting' => [ 'sorting' => [
'mode' => 4, 'mode' => 4,
'fields' => ['sorting'], 'fields' => ['sorting'],
'headerFields' => ['title', 'alias', 'published', 'isLocked'], 'headerFields' => ['title', 'alias', 'published'],
'child_record_class' => 'survey-question-record', 'child_record_class' => 'survey-question-record',
'panelLayout' => 'sort,search,limit', 'panelLayout' => 'sort,search,limit',
], ],
@@ -83,21 +80,18 @@ $GLOBALS['TL_DCA']['tl_survey_content'] = [
'options' => ['yes_no_maybe', 'text', 'range', 'choice'], 'options' => ['yes_no_maybe', 'text', 'range', 'choice'],
'reference' => &$GLOBALS['TL_LANG']['tl_survey_content']['types'], 'reference' => &$GLOBALS['TL_LANG']['tl_survey_content']['types'],
'eval' => ['mandatory' => true, 'includeBlankOption' => true, 'submitOnChange' => true, 'chosen' => true, 'tl_class' => 'w50'], 'eval' => ['mandatory' => true, 'includeBlankOption' => true, 'submitOnChange' => true, 'chosen' => true, 'tl_class' => 'w50'],
'save_callback' => [$guardCallback],
'sql' => "varchar(32) NOT NULL default ''", 'sql' => "varchar(32) NOT NULL default ''",
], ],
'question' => [ 'question' => [
'label' => &$GLOBALS['TL_LANG']['tl_survey_content']['question'], 'label' => &$GLOBALS['TL_LANG']['tl_survey_content']['question'],
'inputType' => 'text', 'inputType' => 'text',
'eval' => ['mandatory' => true, 'maxlength' => 255, 'tl_class' => 'clr'], 'eval' => ['mandatory' => true, 'maxlength' => 255, 'tl_class' => 'clr'],
'save_callback' => [$guardCallback],
'sql' => "varchar(255) NOT NULL default ''", 'sql' => "varchar(255) NOT NULL default ''",
], ],
'description' => [ 'description' => [
'label' => &$GLOBALS['TL_LANG']['tl_survey_content']['description'], 'label' => &$GLOBALS['TL_LANG']['tl_survey_content']['description'],
'inputType' => 'textarea', 'inputType' => 'textarea',
'eval' => ['tl_class' => 'clr'], 'eval' => ['tl_class' => 'clr'],
'save_callback' => [$guardCallback],
'sql' => 'text NULL', 'sql' => 'text NULL',
], ],
'mandatory' => [ 'mandatory' => [
@@ -105,7 +99,6 @@ $GLOBALS['TL_DCA']['tl_survey_content'] = [
'inputType' => 'checkbox', 'inputType' => 'checkbox',
'default' => '1', 'default' => '1',
'eval' => ['tl_class' => 'w50 m12'], 'eval' => ['tl_class' => 'w50 m12'],
'save_callback' => [$guardCallback],
'sql' => "char(1) NOT NULL default ''", 'sql' => "char(1) NOT NULL default ''",
], ],
'published' => [ 'published' => [
@@ -113,14 +106,12 @@ $GLOBALS['TL_DCA']['tl_survey_content'] = [
'inputType' => 'checkbox', 'inputType' => 'checkbox',
'default' => '1', 'default' => '1',
'eval' => ['tl_class' => 'w50 m12'], 'eval' => ['tl_class' => 'w50 m12'],
'save_callback' => [$guardCallback],
'sql' => "char(1) NOT NULL default ''", 'sql' => "char(1) NOT NULL default ''",
], ],
'allowMaybe' => [ 'allowMaybe' => [
'label' => &$GLOBALS['TL_LANG']['tl_survey_content']['allowMaybe'], 'label' => &$GLOBALS['TL_LANG']['tl_survey_content']['allowMaybe'],
'inputType' => 'checkbox', 'inputType' => 'checkbox',
'eval' => ['tl_class' => 'w50 m12 clr'], 'eval' => ['tl_class' => 'w50 m12 clr'],
'save_callback' => [$guardCallback],
'sql' => "char(1) NOT NULL default ''", 'sql' => "char(1) NOT NULL default ''",
], ],
'jumpOnYes' => [ 'jumpOnYes' => [
@@ -128,7 +119,6 @@ $GLOBALS['TL_DCA']['tl_survey_content'] = [
'inputType' => 'select', 'inputType' => 'select',
'options_callback' => [SurveyDcaListener::class, 'getQuestionOptionsForContent'], 'options_callback' => [SurveyDcaListener::class, 'getQuestionOptionsForContent'],
'eval' => ['includeBlankOption' => true, 'chosen' => true, 'tl_class' => 'w50 clr'], 'eval' => ['includeBlankOption' => true, 'chosen' => true, 'tl_class' => 'w50 clr'],
'save_callback' => [$guardCallback],
'sql' => 'int(10) unsigned NOT NULL default 0', 'sql' => 'int(10) unsigned NOT NULL default 0',
], ],
'jumpOnNo' => [ 'jumpOnNo' => [
@@ -136,105 +126,90 @@ $GLOBALS['TL_DCA']['tl_survey_content'] = [
'inputType' => 'select', 'inputType' => 'select',
'options_callback' => [SurveyDcaListener::class, 'getQuestionOptionsForContent'], 'options_callback' => [SurveyDcaListener::class, 'getQuestionOptionsForContent'],
'eval' => ['includeBlankOption' => true, 'chosen' => true, 'tl_class' => 'w50'], 'eval' => ['includeBlankOption' => true, 'chosen' => true, 'tl_class' => 'w50'],
'save_callback' => [$guardCallback],
'sql' => 'int(10) unsigned NOT NULL default 0', 'sql' => 'int(10) unsigned NOT NULL default 0',
], ],
'allowMultiple' => [ 'allowMultiple' => [
'label' => &$GLOBALS['TL_LANG']['tl_survey_content']['allowMultiple'], 'label' => &$GLOBALS['TL_LANG']['tl_survey_content']['allowMultiple'],
'inputType' => 'checkbox', 'inputType' => 'checkbox',
'eval' => ['tl_class' => 'w50 m12 clr'], 'eval' => ['tl_class' => 'w50 m12 clr'],
'save_callback' => [$guardCallback],
'sql' => "char(1) NOT NULL default ''", 'sql' => "char(1) NOT NULL default ''",
], ],
'answerOption1' => [ 'answerOption1' => [
'label' => &$GLOBALS['TL_LANG']['tl_survey_content']['answerOption1'], 'label' => &$GLOBALS['TL_LANG']['tl_survey_content']['answerOption1'],
'inputType' => 'text', 'inputType' => 'text',
'eval' => ['maxlength' => 255, 'tl_class' => 'w50 clr'], 'eval' => ['maxlength' => 255, 'tl_class' => 'w50 clr'],
'save_callback' => [$guardCallback],
'sql' => "varchar(255) NOT NULL default ''", 'sql' => "varchar(255) NOT NULL default ''",
], ],
'answerOption2' => [ 'answerOption2' => [
'label' => &$GLOBALS['TL_LANG']['tl_survey_content']['answerOption2'], 'label' => &$GLOBALS['TL_LANG']['tl_survey_content']['answerOption2'],
'inputType' => 'text', 'inputType' => 'text',
'eval' => ['maxlength' => 255, 'tl_class' => 'w50'], 'eval' => ['maxlength' => 255, 'tl_class' => 'w50'],
'save_callback' => [$guardCallback],
'sql' => "varchar(255) NOT NULL default ''", 'sql' => "varchar(255) NOT NULL default ''",
], ],
'answerOption3' => [ 'answerOption3' => [
'label' => &$GLOBALS['TL_LANG']['tl_survey_content']['answerOption3'], 'label' => &$GLOBALS['TL_LANG']['tl_survey_content']['answerOption3'],
'inputType' => 'text', 'inputType' => 'text',
'eval' => ['maxlength' => 255, 'tl_class' => 'w50 clr'], 'eval' => ['maxlength' => 255, 'tl_class' => 'w50 clr'],
'save_callback' => [$guardCallback],
'sql' => "varchar(255) NOT NULL default ''", 'sql' => "varchar(255) NOT NULL default ''",
], ],
'answerOption4' => [ 'answerOption4' => [
'label' => &$GLOBALS['TL_LANG']['tl_survey_content']['answerOption4'], 'label' => &$GLOBALS['TL_LANG']['tl_survey_content']['answerOption4'],
'inputType' => 'text', 'inputType' => 'text',
'eval' => ['maxlength' => 255, 'tl_class' => 'w50'], 'eval' => ['maxlength' => 255, 'tl_class' => 'w50'],
'save_callback' => [$guardCallback],
'sql' => "varchar(255) NOT NULL default ''", 'sql' => "varchar(255) NOT NULL default ''",
], ],
'answerOption5' => [ 'answerOption5' => [
'label' => &$GLOBALS['TL_LANG']['tl_survey_content']['answerOption5'], 'label' => &$GLOBALS['TL_LANG']['tl_survey_content']['answerOption5'],
'inputType' => 'text', 'inputType' => 'text',
'eval' => ['maxlength' => 255, 'tl_class' => 'w50 clr'], 'eval' => ['maxlength' => 255, 'tl_class' => 'w50 clr'],
'save_callback' => [$guardCallback],
'sql' => "varchar(255) NOT NULL default ''", 'sql' => "varchar(255) NOT NULL default ''",
], ],
'answerOption6' => [ 'answerOption6' => [
'label' => &$GLOBALS['TL_LANG']['tl_survey_content']['answerOption6'], 'label' => &$GLOBALS['TL_LANG']['tl_survey_content']['answerOption6'],
'inputType' => 'text', 'inputType' => 'text',
'eval' => ['maxlength' => 255, 'tl_class' => 'w50'], 'eval' => ['maxlength' => 255, 'tl_class' => 'w50'],
'save_callback' => [$guardCallback],
'sql' => "varchar(255) NOT NULL default ''", 'sql' => "varchar(255) NOT NULL default ''",
], ],
'answerOption7' => [ 'answerOption7' => [
'label' => &$GLOBALS['TL_LANG']['tl_survey_content']['answerOption7'], 'label' => &$GLOBALS['TL_LANG']['tl_survey_content']['answerOption7'],
'inputType' => 'text', 'inputType' => 'text',
'eval' => ['maxlength' => 255, 'tl_class' => 'w50 clr'], 'eval' => ['maxlength' => 255, 'tl_class' => 'w50 clr'],
'save_callback' => [$guardCallback],
'sql' => "varchar(255) NOT NULL default ''", 'sql' => "varchar(255) NOT NULL default ''",
], ],
'answerOption8' => [ 'answerOption8' => [
'label' => &$GLOBALS['TL_LANG']['tl_survey_content']['answerOption8'], 'label' => &$GLOBALS['TL_LANG']['tl_survey_content']['answerOption8'],
'inputType' => 'text', 'inputType' => 'text',
'eval' => ['maxlength' => 255, 'tl_class' => 'w50'], 'eval' => ['maxlength' => 255, 'tl_class' => 'w50'],
'save_callback' => [$guardCallback],
'sql' => "varchar(255) NOT NULL default ''", 'sql' => "varchar(255) NOT NULL default ''",
], ],
'answerOption9' => [ 'answerOption9' => [
'label' => &$GLOBALS['TL_LANG']['tl_survey_content']['answerOption9'], 'label' => &$GLOBALS['TL_LANG']['tl_survey_content']['answerOption9'],
'inputType' => 'text', 'inputType' => 'text',
'eval' => ['maxlength' => 255, 'tl_class' => 'w50 clr'], 'eval' => ['maxlength' => 255, 'tl_class' => 'w50 clr'],
'save_callback' => [$guardCallback],
'sql' => "varchar(255) NOT NULL default ''", 'sql' => "varchar(255) NOT NULL default ''",
], ],
'answerOption10' => [ 'answerOption10' => [
'label' => &$GLOBALS['TL_LANG']['tl_survey_content']['answerOption10'], 'label' => &$GLOBALS['TL_LANG']['tl_survey_content']['answerOption10'],
'inputType' => 'text', 'inputType' => 'text',
'eval' => ['maxlength' => 255, 'tl_class' => 'w50'], 'eval' => ['maxlength' => 255, 'tl_class' => 'w50'],
'save_callback' => [$guardCallback],
'sql' => "varchar(255) NOT NULL default ''", 'sql' => "varchar(255) NOT NULL default ''",
], ],
'rangeMin' => [ 'rangeMin' => [
'label' => &$GLOBALS['TL_LANG']['tl_survey_content']['rangeMin'], 'label' => &$GLOBALS['TL_LANG']['tl_survey_content']['rangeMin'],
'inputType' => 'text', 'inputType' => 'text',
'eval' => ['rgxp' => 'digit', 'tl_class' => 'w50'], 'eval' => ['rgxp' => 'digit', 'tl_class' => 'w50'],
'save_callback' => [$guardCallback],
'sql' => 'int(10) NOT NULL default 0', 'sql' => 'int(10) NOT NULL default 0',
], ],
'rangeMax' => [ 'rangeMax' => [
'label' => &$GLOBALS['TL_LANG']['tl_survey_content']['rangeMax'], 'label' => &$GLOBALS['TL_LANG']['tl_survey_content']['rangeMax'],
'inputType' => 'text', 'inputType' => 'text',
'eval' => ['rgxp' => 'digit', 'tl_class' => 'w50'], 'eval' => ['rgxp' => 'digit', 'tl_class' => 'w50'],
'save_callback' => [$guardCallback],
'sql' => 'int(10) NOT NULL default 10', 'sql' => 'int(10) NOT NULL default 10',
], ],
'rangeStep' => [ 'rangeStep' => [
'label' => &$GLOBALS['TL_LANG']['tl_survey_content']['rangeStep'], 'label' => &$GLOBALS['TL_LANG']['tl_survey_content']['rangeStep'],
'inputType' => 'text', 'inputType' => 'text',
'eval' => ['rgxp' => 'digit', 'tl_class' => 'w50'], 'eval' => ['rgxp' => 'digit', 'tl_class' => 'w50'],
'save_callback' => [$guardCallback],
'sql' => 'int(10) unsigned NOT NULL default 1', 'sql' => 'int(10) unsigned NOT NULL default 1',
], ],
], ],
+1 -1
View File
@@ -28,7 +28,7 @@ $GLOBALS['TL_DCA']['tl_survey_editor'] = [
'sorting' => [ 'sorting' => [
'mode' => 4, 'mode' => 4,
'fields' => ['member'], 'fields' => ['member'],
'headerFields' => ['title', 'alias', 'isLocked'], 'headerFields' => ['title', 'alias'],
'panelLayout' => 'sort,search,limit', 'panelLayout' => 'sort,search,limit',
], ],
'label' => [ 'label' => [
@@ -56,7 +56,6 @@
<div class="survey-card survey-editor-meta-card"> <div class="survey-card survey-editor-meta-card">
{{ form_start(surveyForm, {action: metadataFormActionUrl, attr: {class: 'survey-form-grid', id: surveyMetaFormId, 'data-survey-dirty-form': '1'}}) }} {{ form_start(surveyForm, {action: metadataFormActionUrl, attr: {class: 'survey-form-grid', id: surveyMetaFormId, 'data-survey-dirty-form': '1'}}) }}
<input type="hidden" name="REQUEST_TOKEN" value="{{ contao.request_token }}"> <input type="hidden" name="REQUEST_TOKEN" value="{{ contao.request_token }}">
<input type="hidden" name="{{ surveyForm.published.vars.full_name }}" value="0">
{{ form_widget(surveyForm._token) }} {{ form_widget(surveyForm._token) }}
{{ form_errors(surveyForm) }} {{ form_errors(surveyForm) }}
<label class="survey-label">{{ 'survey.edit.label_survey_title'|trans }}{{ form_widget(surveyForm.title) }}{{ form_errors(surveyForm.title) }}</label> <label class="survey-label">{{ 'survey.edit.label_survey_title'|trans }}{{ form_widget(surveyForm.title) }}{{ form_errors(surveyForm.title) }}</label>
@@ -76,7 +76,7 @@ final class MemberSurveyEditController extends AbstractFrontendModuleController
$surveyForm = $this->formFactory->createNamed('survey_meta', SurveyEditorType::class, $survey instanceof SurveyModel ? SurveyEditorData::fromModel($survey) : new SurveyEditorData()); $surveyForm = $this->formFactory->createNamed('survey_meta', SurveyEditorType::class, $survey instanceof SurveyModel ? SurveyEditorData::fromModel($survey) : new SurveyEditorData());
$surveyForm->handleRequest($request); $surveyForm->handleRequest($request);
if ($surveyForm->isSubmitted() && $surveyForm->isValid()) { if ($surveyForm->isSubmitted() && $surveyForm->isValid() && (!$survey instanceof SurveyModel || '1' !== (string) $survey->published)) {
try { try {
if ($survey instanceof SurveyModel) { if ($survey instanceof SurveyModel) {
$this->surveyEditorService->updateSurvey($survey, $memberId, $surveyForm->getData()); $this->surveyEditorService->updateSurvey($survey, $memberId, $surveyForm->getData());
@@ -92,6 +92,8 @@ final class MemberSurveyEditController extends AbstractFrontendModuleController
} catch (\Throwable $exception) { } catch (\Throwable $exception) {
$this->addFlash('error', $exception->getMessage()); $this->addFlash('error', $exception->getMessage());
} }
} elseif ($surveyForm->isSubmitted() && $survey instanceof SurveyModel && '1' === (string) $survey->published) {
$this->addFlash('error', 'Die Metadaten können nach der Veröffentlichung im Frontend nicht mehr geändert werden.');
} }
if (!$survey instanceof SurveyModel) { if (!$survey instanceof SurveyModel) {
-23
View File
@@ -242,16 +242,6 @@ final class SurveyDcaListener
return $surveyId > 0 ? $this->surveyEditorRepository->findMemberIdsBySurvey($surveyId) : []; return $surveyId > 0 ? $this->surveyEditorRepository->findMemberIdsBySurvey($surveyId) : [];
} }
public function guardContentSave(mixed $value, DataContainer $dataContainer): mixed
{
return $value;
}
public function guardConditionSave(mixed $value, DataContainer $dataContainer): mixed
{
return $value;
}
public function guardEditorSave(mixed $value, DataContainer $dataContainer): mixed public function guardEditorSave(mixed $value, DataContainer $dataContainer): mixed
{ {
$surveyId = $this->resolveSurveyId('tl_survey_editor', $dataContainer); $surveyId = $this->resolveSurveyId('tl_survey_editor', $dataContainer);
@@ -389,10 +379,6 @@ final class SurveyDcaListener
$this->surveyRepository->refreshListMetadata($surveyId); $this->surveyRepository->refreshListMetadata($surveyId);
} }
public function guardContentDelete(DataContainer $dataContainer): void
{
}
public function touchSurveyContentParent(DataContainer $dataContainer): void public function touchSurveyContentParent(DataContainer $dataContainer): void
{ {
$surveyId = $this->resolveSurveyId('tl_survey_content', $dataContainer); $surveyId = $this->resolveSurveyId('tl_survey_content', $dataContainer);
@@ -402,10 +388,6 @@ final class SurveyDcaListener
} }
} }
public function guardConditionDelete(DataContainer $dataContainer): void
{
}
public function touchSurveyConditionParent(DataContainer $dataContainer): void public function touchSurveyConditionParent(DataContainer $dataContainer): void
{ {
$surveyId = $this->resolveSurveyId('tl_survey_condition', $dataContainer); $surveyId = $this->resolveSurveyId('tl_survey_condition', $dataContainer);
@@ -424,11 +406,6 @@ final class SurveyDcaListener
} }
} }
public function guardSurveyStructureSave(mixed $value, DataContainer $dataContainer): mixed
{
return $value;
}
public function resolveSurveyContentPalette(string $palette, DataContainer $dataContainer): string public function resolveSurveyContentPalette(string $palette, DataContainer $dataContainer): string
{ {
$type = (string) ($dataContainer->activeRecord->type ?? ''); $type = (string) ($dataContainer->activeRecord->type ?? '');
-3
View File
@@ -10,14 +10,12 @@ final class SurveyEditorData
{ {
public string $title = ''; public string $title = '';
public string $description = ''; public string $description = '';
public bool $published = false;
public static function fromModel(SurveyModel $survey): self public static function fromModel(SurveyModel $survey): self
{ {
$data = new self(); $data = new self();
$data->title = (string) $survey->title; $data->title = (string) $survey->title;
$data->description = (string) $survey->description; $data->description = (string) $survey->description;
$data->published = '1' === (string) $survey->published;
return $data; return $data;
} }
@@ -30,7 +28,6 @@ final class SurveyEditorData
return [ return [
'title' => $this->title, 'title' => $this->title,
'description' => $this->description, 'description' => $this->description,
'published' => $this->published,
]; ];
} }
} }
-5
View File
@@ -6,7 +6,6 @@ namespace Mummert\SurveyBundle\Form;
use Mummert\SurveyBundle\Form\Model\SurveyEditorData; use Mummert\SurveyBundle\Form\Model\SurveyEditorData;
use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType; use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\Extension\Core\Type\TextType; use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\FormBuilderInterface;
@@ -29,10 +28,6 @@ final class SurveyEditorType extends AbstractType
'empty_data' => '', 'empty_data' => '',
'attr' => ['rows' => 5], 'attr' => ['rows' => 5],
]) ])
->add('published', CheckboxType::class, [
'label' => 'Veröffentlicht',
'required' => false,
])
; ;
} }
-14
View File
@@ -24,34 +24,20 @@ survey:
login_required: "Dieses Frontendmodul ist für eingeloggte Mitglieder gedacht. Nutzen Sie den normalen Contao-Mitgliederlogin auf einer geschützten Seite." login_required: "Dieses Frontendmodul ist für eingeloggte Mitglieder gedacht. Nutzen Sie den normalen Contao-Mitgliederlogin auf einer geschützten Seite."
entry_not_allowed: "Diese Seite kann nicht direkt geöffnet werden. Bitte wechseln Sie über die Umfragen-Liste in den Bearbeitungsmodus." entry_not_allowed: "Diese Seite kann nicht direkt geöffnet werden. Bitte wechseln Sie über die Umfragen-Liste in den Bearbeitungsmodus."
create_title: "Neue Umfrage erstellen" create_title: "Neue Umfrage erstellen"
create_text: "Die Umfrage wird nach dem Anlegen automatisch dem eingeloggten Mitglied zugewiesen."
label_title: "Titel" label_title: "Titel"
label_survey_title: "Titel der Umfrage" label_survey_title: "Titel der Umfrage"
label_description: "Beschreibung" label_description: "Beschreibung"
publish_directly: "Direkt veröffentlichen"
create_submit: "Umfrage erstellen" create_submit: "Umfrage erstellen"
back_to_list: "Zur Liste" back_to_list: "Zur Liste"
public_view_open: "Öffentliche Ansicht öffnen"
copy_public_link: "Öffentlichen Link kopieren"
copy_public_link_success: "Link kopiert"
public_link: "Öffentlicher Link"
no_public_page: "Noch keine öffentliche Seite hinterlegt."
status: "Status"
editors: "Bearbeitende" editors: "Bearbeitende"
editors_count: "%count% Mitglied(er)" editors_count: "%count% Mitglied(er)"
published: "veröffentlicht" published: "veröffentlicht"
draft: "Entwurf" draft: "Entwurf"
locked: "gesperrt" locked: "gesperrt"
structure_locked: "Die Fragen dieser Umfrage sind gesperrt, weil die Umfrage veröffentlicht wurde oder bereits erste Teilnahmen vorliegen. Die Metadaten können weiter gepflegt werden." structure_locked: "Die Fragen dieser Umfrage sind gesperrt, weil die Umfrage veröffentlicht wurde oder bereits erste Teilnahmen vorliegen. Die Metadaten können weiter gepflegt werden."
published_readonly: "Diese Umfrage ist veröffentlicht. Die Bearbeitung im Frontend ist deshalb deaktiviert. Änderungen sind weiterhin im Backend möglich."
metadata: "Umfrage-Metadaten"
publish_survey: "Umfrage veröffentlichen"
publish_help: "Umfrage veröffentlichen. Danach sind keine Änderungen mehr möglich."
publish_confirm: "Sind Sie wirklich sicher? Nachdem die Umfrage veröffentlicht wurde sind keine Änderungen mehr möglich!" publish_confirm: "Sind Sie wirklich sicher? Nachdem die Umfrage veröffentlicht wurde sind keine Änderungen mehr möglich!"
deactivate_survey: "Umfrage vorübergehend deaktivieren" deactivate_survey: "Umfrage vorübergehend deaktivieren"
activate_survey: "Umfrage wieder aktivieren" activate_survey: "Umfrage wieder aktivieren"
deactivate_help: "Die veröffentlichte Umfrage wird vorübergehend offline genommen. Fragen bleiben weiter gesperrt."
activate_help: "Die veröffentlichte Umfrage wird wieder öffentlich erreichbar gemacht. Fragen bleiben weiter gesperrt."
save: "Speichern" save: "Speichern"
save_metadata: "Metadaten speichern" save_metadata: "Metadaten speichern"
save_this_question: "Diese Frage speichern" save_this_question: "Diese Frage speichern"
-14
View File
@@ -24,34 +24,20 @@ survey:
login_required: "This frontend module is intended for logged-in members. Please use the regular Contao member login on a protected page." login_required: "This frontend module is intended for logged-in members. Please use the regular Contao member login on a protected page."
entry_not_allowed: "This page cannot be opened directly. Please switch to edit mode via the survey list." entry_not_allowed: "This page cannot be opened directly. Please switch to edit mode via the survey list."
create_title: "Create new survey" create_title: "Create new survey"
create_text: "The survey will automatically be assigned to the logged-in member after creation."
label_title: "Title" label_title: "Title"
label_survey_title: "Survey title" label_survey_title: "Survey title"
label_description: "Description" label_description: "Description"
publish_directly: "Publish immediately"
create_submit: "Create survey" create_submit: "Create survey"
back_to_list: "Back to list" back_to_list: "Back to list"
public_view_open: "Open public view"
copy_public_link: "Copy public link"
copy_public_link_success: "Link copied"
public_link: "Public link"
no_public_page: "No public page configured yet."
status: "Status"
editors: "Editors" editors: "Editors"
editors_count: "%count% member(s)" editors_count: "%count% member(s)"
published: "published" published: "published"
draft: "draft" draft: "draft"
locked: "locked" locked: "locked"
structure_locked: "The questions of this survey are locked because the survey was published or first participations already exist. The metadata can still be maintained." structure_locked: "The questions of this survey are locked because the survey was published or first participations already exist. The metadata can still be maintained."
published_readonly: "This survey is published. Frontend editing is therefore disabled. Changes are still possible in the backend."
metadata: "Survey metadata"
publish_survey: "Publish survey"
publish_help: "Publish survey. No further changes will be possible afterwards."
publish_confirm: "Are you really sure? After the survey has been published, no further changes will be possible!" publish_confirm: "Are you really sure? After the survey has been published, no further changes will be possible!"
deactivate_survey: "Temporarily deactivate survey" deactivate_survey: "Temporarily deactivate survey"
activate_survey: "Reactivate survey" activate_survey: "Reactivate survey"
deactivate_help: "The published survey is temporarily taken offline. Questions remain locked."
activate_help: "The published survey is made publicly reachable again. Questions remain locked."
save: "Save" save: "Save"
save_metadata: "Save metadata" save_metadata: "Save metadata"
save_this_question: "Save this question" save_this_question: "Save this question"