diff --git a/contao/dca/tl_survey_content.php b/contao/dca/tl_survey_content.php index 74155c5..bb38876 100644 --- a/contao/dca/tl_survey_content.php +++ b/contao/dca/tl_survey_content.php @@ -73,7 +73,7 @@ $GLOBALS['TL_DCA']['tl_survey_content'] = [ ], 'palettes' => [ 'default' => '{question_legend},type,question,description;{settings_legend},mandatory,published', - 'yes_no_maybe' => '{question_legend},type,question,description;{settings_legend},mandatory,published,allowMaybe,jumpOnYes,jumpOnNo', + 'yes_no_maybe' => '{question_legend},type,question,description;{settings_legend},mandatory,published,allowMaybe,showThumbs,jumpOnYes,jumpOnNo', 'text' => '{question_legend},type,question,description;{settings_legend},mandatory,published', 'range' => '{question_legend},type,question,description;{settings_legend},mandatory,published,rangeMin,rangeMax,rangeStep', 'choice' => '{question_legend},type,question,description;{settings_legend},mandatory,published,allowMultiple,answerOption1,answerOption2,answerOption3,answerOption4,answerOption5,answerOption6,answerOption7,answerOption8,answerOption9,answerOption10', @@ -111,7 +111,8 @@ $GLOBALS['TL_DCA']['tl_survey_content'] = [ 'mandatory' => [ 'label' => &$GLOBALS['TL_LANG']['tl_survey_content']['mandatory'], 'inputType' => 'checkbox', - 'default' => '1', + // Neue Fragen sind bewusst freiwillig; Pflicht wird aktiv angehakt + // (Kundenentscheidung 09/2026, Pretest-Punkt 3). 'eval' => ['tl_class' => 'w50 m12'], 'sql' => "char(1) NOT NULL default ''", ], @@ -128,6 +129,12 @@ $GLOBALS['TL_DCA']['tl_survey_content'] = [ 'eval' => ['tl_class' => 'w50 m12 clr'], 'sql' => "char(1) NOT NULL default ''", ], + 'showThumbs' => [ + 'label' => &$GLOBALS['TL_LANG']['tl_survey_content']['showThumbs'], + 'inputType' => 'checkbox', + 'eval' => ['tl_class' => 'w50 m12'], + 'sql' => "char(1) NOT NULL default ''", + ], 'jumpOnYes' => [ 'label' => &$GLOBALS['TL_LANG']['tl_survey_content']['jumpOnYes'], 'inputType' => 'select', diff --git a/contao/languages/de/tl_survey_content.php b/contao/languages/de/tl_survey_content.php index 817461b..15e8b31 100644 --- a/contao/languages/de/tl_survey_content.php +++ b/contao/languages/de/tl_survey_content.php @@ -15,6 +15,7 @@ $GLOBALS['TL_LANG']['tl_survey_content']['settings_legend'] = 'Einstellungen'; $GLOBALS['TL_LANG']['tl_survey_content']['mandatory'] = ['Pflichtfrage', 'Diese Frage muss beantwortet werden.']; $GLOBALS['TL_LANG']['tl_survey_content']['published'] = ['Aktiv', 'Die Frage wird in der Umfrage angezeigt.']; $GLOBALS['TL_LANG']['tl_survey_content']['allowMaybe'] = ['Vielleicht anbieten', 'Ergänzt die Ja-Nein-Frage um die Antwortmöglichkeit Vielleicht.']; +$GLOBALS['TL_LANG']['tl_survey_content']['showThumbs'] = ['Antworten als Daumen darstellen', 'Zeigt bei Ja/Nein/Vielleicht zusätzlich Daumen-Symbole an (z. B. für Befragungen mit Kindern). Gespeichert und ausgewertet werden weiterhin die Antworten Ja, Nein und Vielleicht.']; $GLOBALS['TL_LANG']['tl_survey_content']['jumpOnYes'] = ['Zur Frage springen bei Auswahl ja', 'Springt bei der Antwort Ja direkt zu dieser Frage.']; $GLOBALS['TL_LANG']['tl_survey_content']['jumpOnNo'] = ['Zur Frage springen bei Auswahl nein', 'Springt bei der Antwort Nein direkt zu dieser Frage.']; $GLOBALS['TL_LANG']['tl_survey_content']['allowMultiple'] = ['Multiple-Choice aktivieren', 'Erlaubt mehrere Antworten statt einer einzelnen Auswahl.']; diff --git a/contao/languages/en/tl_survey_content.php b/contao/languages/en/tl_survey_content.php index 968c3cd..837f95a 100644 --- a/contao/languages/en/tl_survey_content.php +++ b/contao/languages/en/tl_survey_content.php @@ -15,6 +15,7 @@ $GLOBALS['TL_LANG']['tl_survey_content']['settings_legend'] = 'Settings'; $GLOBALS['TL_LANG']['tl_survey_content']['mandatory'] = ['Required question', 'This question must be answered.']; $GLOBALS['TL_LANG']['tl_survey_content']['published'] = ['Active', 'The question is shown in the survey.']; $GLOBALS['TL_LANG']['tl_survey_content']['allowMaybe'] = ['Offer maybe', 'Adds the Maybe answer option to the yes-no question.']; +$GLOBALS['TL_LANG']['tl_survey_content']['showThumbs'] = ['Show thumb icons', 'Displays thumb icons for yes/no/maybe answers (e.g. for surveys with children). Answers are still stored and evaluated as yes, no and maybe.']; $GLOBALS['TL_LANG']['tl_survey_content']['jumpOnYes'] = ['Jump to question on yes', 'Jumps directly to this question when the answer is Yes.']; $GLOBALS['TL_LANG']['tl_survey_content']['jumpOnNo'] = ['Jump to question on no', 'Jumps directly to this question when the answer is No.']; $GLOBALS['TL_LANG']['tl_survey_content']['allowMultiple'] = ['Enable multiple choice', 'Allows multiple answers instead of a single selection.']; diff --git a/contao/templates/frontend/_survey_question_form.html.twig b/contao/templates/frontend/_survey_question_form.html.twig index 1160991..f5580dc 100644 --- a/contao/templates/frontend/_survey_question_form.html.twig +++ b/contao/templates/frontend/_survey_question_form.html.twig @@ -31,6 +31,7 @@ +
diff --git a/contao/templates/frontend/show_survey.html.twig b/contao/templates/frontend/show_survey.html.twig index 09484b6..8133bb0 100644 --- a/contao/templates/frontend/show_survey.html.twig +++ b/contao/templates/frontend/show_survey.html.twig @@ -79,9 +79,16 @@ {% set answerChildren = surveyForm.answer is defined ? surveyForm.answer|filter(child => child.vars.value is not defined or child.vars.value != '__no_answer__') : [] %} {% set noAnswerChildren = surveyForm.answer is defined ? surveyForm.answer|filter(child => child.vars.value is defined and child.vars.value == '__no_answer__') : [] %} {% if question.type == 'yes_no_maybe' %} + {# Reine Darstellungsoption: gespeichert wird weiterhin yes/no/maybe. #} + {% set showThumbIcons = '1' == question.showThumbs %}
{% for child in answerChildren %}