diff --git a/contao/dca/tl_survey_condition.php b/contao/dca/tl_survey_condition.php index 2f74c1f..eba57b1 100644 --- a/contao/dca/tl_survey_condition.php +++ b/contao/dca/tl_survey_condition.php @@ -5,8 +5,6 @@ declare(strict_types=1); use Contao\DC_Table; use Mummert\SurveyBundle\EventListener\SurveyDcaListener; -$guardCallback = [SurveyDcaListener::class, 'guardConditionSave']; - $GLOBALS['TL_DCA']['tl_survey_condition'] = [ 'config' => [ 'dataContainer' => DC_Table::class, @@ -16,7 +14,6 @@ $GLOBALS['TL_DCA']['tl_survey_condition'] = [ [SurveyDcaListener::class, 'touchSurveyConditionParent'], ], 'ondelete_callback' => [ - [SurveyDcaListener::class, 'guardConditionDelete'], [SurveyDcaListener::class, 'touchSurveyConditionParent'], ], 'sql' => [ @@ -32,7 +29,7 @@ $GLOBALS['TL_DCA']['tl_survey_condition'] = [ 'sorting' => [ 'mode' => 4, 'fields' => ['id'], - 'headerFields' => ['title', 'alias', 'published', 'isLocked'], + 'headerFields' => ['title', 'alias', 'published'], 'panelLayout' => 'sort,search,limit', ], 'label' => [ @@ -71,14 +68,12 @@ $GLOBALS['TL_DCA']['tl_survey_condition'] = [ 'inputType' => 'select', 'options_callback' => [SurveyDcaListener::class, 'getQuestionOptions'], 'eval' => ['mandatory' => true, 'includeBlankOption' => true, 'chosen' => true, 'tl_class' => 'w50'], - 'save_callback' => [$guardCallback], 'sql' => 'int(10) unsigned NOT NULL default 0', ], 'answerValue' => [ 'label' => &$GLOBALS['TL_LANG']['tl_survey_condition']['answerValue'], 'inputType' => 'text', 'eval' => ['mandatory' => true, 'maxlength' => 255, 'tl_class' => 'w50'], - 'save_callback' => [$guardCallback], 'sql' => "varchar(255) NOT NULL default ''", ], 'targetQuestion' => [ @@ -86,7 +81,6 @@ $GLOBALS['TL_DCA']['tl_survey_condition'] = [ 'inputType' => 'select', 'options_callback' => [SurveyDcaListener::class, 'getQuestionOptions'], 'eval' => ['mandatory' => true, 'includeBlankOption' => true, 'chosen' => true, 'tl_class' => 'clr'], - 'save_callback' => [$guardCallback], 'sql' => 'int(10) unsigned NOT NULL default 0', ], ], diff --git a/contao/dca/tl_survey_content.php b/contao/dca/tl_survey_content.php index 5356d4d..9cd7133 100644 --- a/contao/dca/tl_survey_content.php +++ b/contao/dca/tl_survey_content.php @@ -5,8 +5,6 @@ declare(strict_types=1); use Contao\DC_Table; use Mummert\SurveyBundle\EventListener\SurveyDcaListener; -$guardCallback = [SurveyDcaListener::class, 'guardContentSave']; - $GLOBALS['TL_DCA']['tl_survey_content'] = [ 'config' => [ 'dataContainer' => DC_Table::class, @@ -19,7 +17,6 @@ $GLOBALS['TL_DCA']['tl_survey_content'] = [ [SurveyDcaListener::class, 'resolveSurveyContentPalette'], ], 'ondelete_callback' => [ - [SurveyDcaListener::class, 'guardContentDelete'], [SurveyDcaListener::class, 'touchSurveyContentParent'], ], 'sql' => [ @@ -35,7 +32,7 @@ $GLOBALS['TL_DCA']['tl_survey_content'] = [ 'sorting' => [ 'mode' => 4, 'fields' => ['sorting'], - 'headerFields' => ['title', 'alias', 'published', 'isLocked'], + 'headerFields' => ['title', 'alias', 'published'], 'child_record_class' => 'survey-question-record', 'panelLayout' => 'sort,search,limit', ], @@ -83,21 +80,18 @@ $GLOBALS['TL_DCA']['tl_survey_content'] = [ 'options' => ['yes_no_maybe', 'text', 'range', 'choice'], 'reference' => &$GLOBALS['TL_LANG']['tl_survey_content']['types'], 'eval' => ['mandatory' => true, 'includeBlankOption' => true, 'submitOnChange' => true, 'chosen' => true, 'tl_class' => 'w50'], - 'save_callback' => [$guardCallback], 'sql' => "varchar(32) NOT NULL default ''", ], 'question' => [ 'label' => &$GLOBALS['TL_LANG']['tl_survey_content']['question'], 'inputType' => 'text', 'eval' => ['mandatory' => true, 'maxlength' => 255, 'tl_class' => 'clr'], - 'save_callback' => [$guardCallback], 'sql' => "varchar(255) NOT NULL default ''", ], 'description' => [ 'label' => &$GLOBALS['TL_LANG']['tl_survey_content']['description'], 'inputType' => 'textarea', 'eval' => ['tl_class' => 'clr'], - 'save_callback' => [$guardCallback], 'sql' => 'text NULL', ], 'mandatory' => [ @@ -105,7 +99,6 @@ $GLOBALS['TL_DCA']['tl_survey_content'] = [ 'inputType' => 'checkbox', 'default' => '1', 'eval' => ['tl_class' => 'w50 m12'], - 'save_callback' => [$guardCallback], 'sql' => "char(1) NOT NULL default ''", ], 'published' => [ @@ -113,14 +106,12 @@ $GLOBALS['TL_DCA']['tl_survey_content'] = [ 'inputType' => 'checkbox', 'default' => '1', 'eval' => ['tl_class' => 'w50 m12'], - 'save_callback' => [$guardCallback], 'sql' => "char(1) NOT NULL default ''", ], 'allowMaybe' => [ 'label' => &$GLOBALS['TL_LANG']['tl_survey_content']['allowMaybe'], 'inputType' => 'checkbox', 'eval' => ['tl_class' => 'w50 m12 clr'], - 'save_callback' => [$guardCallback], 'sql' => "char(1) NOT NULL default ''", ], 'jumpOnYes' => [ @@ -128,7 +119,6 @@ $GLOBALS['TL_DCA']['tl_survey_content'] = [ 'inputType' => 'select', 'options_callback' => [SurveyDcaListener::class, 'getQuestionOptionsForContent'], 'eval' => ['includeBlankOption' => true, 'chosen' => true, 'tl_class' => 'w50 clr'], - 'save_callback' => [$guardCallback], 'sql' => 'int(10) unsigned NOT NULL default 0', ], 'jumpOnNo' => [ @@ -136,105 +126,90 @@ $GLOBALS['TL_DCA']['tl_survey_content'] = [ 'inputType' => 'select', 'options_callback' => [SurveyDcaListener::class, 'getQuestionOptionsForContent'], 'eval' => ['includeBlankOption' => true, 'chosen' => true, 'tl_class' => 'w50'], - 'save_callback' => [$guardCallback], 'sql' => 'int(10) unsigned NOT NULL default 0', ], 'allowMultiple' => [ 'label' => &$GLOBALS['TL_LANG']['tl_survey_content']['allowMultiple'], 'inputType' => 'checkbox', 'eval' => ['tl_class' => 'w50 m12 clr'], - 'save_callback' => [$guardCallback], 'sql' => "char(1) NOT NULL default ''", ], 'answerOption1' => [ 'label' => &$GLOBALS['TL_LANG']['tl_survey_content']['answerOption1'], 'inputType' => 'text', 'eval' => ['maxlength' => 255, 'tl_class' => 'w50 clr'], - 'save_callback' => [$guardCallback], 'sql' => "varchar(255) NOT NULL default ''", ], 'answerOption2' => [ 'label' => &$GLOBALS['TL_LANG']['tl_survey_content']['answerOption2'], 'inputType' => 'text', 'eval' => ['maxlength' => 255, 'tl_class' => 'w50'], - 'save_callback' => [$guardCallback], 'sql' => "varchar(255) NOT NULL default ''", ], 'answerOption3' => [ 'label' => &$GLOBALS['TL_LANG']['tl_survey_content']['answerOption3'], 'inputType' => 'text', 'eval' => ['maxlength' => 255, 'tl_class' => 'w50 clr'], - 'save_callback' => [$guardCallback], 'sql' => "varchar(255) NOT NULL default ''", ], 'answerOption4' => [ 'label' => &$GLOBALS['TL_LANG']['tl_survey_content']['answerOption4'], 'inputType' => 'text', 'eval' => ['maxlength' => 255, 'tl_class' => 'w50'], - 'save_callback' => [$guardCallback], 'sql' => "varchar(255) NOT NULL default ''", ], 'answerOption5' => [ 'label' => &$GLOBALS['TL_LANG']['tl_survey_content']['answerOption5'], 'inputType' => 'text', 'eval' => ['maxlength' => 255, 'tl_class' => 'w50 clr'], - 'save_callback' => [$guardCallback], 'sql' => "varchar(255) NOT NULL default ''", ], 'answerOption6' => [ 'label' => &$GLOBALS['TL_LANG']['tl_survey_content']['answerOption6'], 'inputType' => 'text', 'eval' => ['maxlength' => 255, 'tl_class' => 'w50'], - 'save_callback' => [$guardCallback], 'sql' => "varchar(255) NOT NULL default ''", ], 'answerOption7' => [ 'label' => &$GLOBALS['TL_LANG']['tl_survey_content']['answerOption7'], 'inputType' => 'text', 'eval' => ['maxlength' => 255, 'tl_class' => 'w50 clr'], - 'save_callback' => [$guardCallback], 'sql' => "varchar(255) NOT NULL default ''", ], 'answerOption8' => [ 'label' => &$GLOBALS['TL_LANG']['tl_survey_content']['answerOption8'], 'inputType' => 'text', 'eval' => ['maxlength' => 255, 'tl_class' => 'w50'], - 'save_callback' => [$guardCallback], 'sql' => "varchar(255) NOT NULL default ''", ], 'answerOption9' => [ 'label' => &$GLOBALS['TL_LANG']['tl_survey_content']['answerOption9'], 'inputType' => 'text', 'eval' => ['maxlength' => 255, 'tl_class' => 'w50 clr'], - 'save_callback' => [$guardCallback], 'sql' => "varchar(255) NOT NULL default ''", ], 'answerOption10' => [ 'label' => &$GLOBALS['TL_LANG']['tl_survey_content']['answerOption10'], 'inputType' => 'text', 'eval' => ['maxlength' => 255, 'tl_class' => 'w50'], - 'save_callback' => [$guardCallback], 'sql' => "varchar(255) NOT NULL default ''", ], 'rangeMin' => [ 'label' => &$GLOBALS['TL_LANG']['tl_survey_content']['rangeMin'], 'inputType' => 'text', 'eval' => ['rgxp' => 'digit', 'tl_class' => 'w50'], - 'save_callback' => [$guardCallback], 'sql' => 'int(10) NOT NULL default 0', ], 'rangeMax' => [ 'label' => &$GLOBALS['TL_LANG']['tl_survey_content']['rangeMax'], 'inputType' => 'text', 'eval' => ['rgxp' => 'digit', 'tl_class' => 'w50'], - 'save_callback' => [$guardCallback], 'sql' => 'int(10) NOT NULL default 10', ], 'rangeStep' => [ 'label' => &$GLOBALS['TL_LANG']['tl_survey_content']['rangeStep'], 'inputType' => 'text', 'eval' => ['rgxp' => 'digit', 'tl_class' => 'w50'], - 'save_callback' => [$guardCallback], 'sql' => 'int(10) unsigned NOT NULL default 1', ], ], diff --git a/contao/dca/tl_survey_editor.php b/contao/dca/tl_survey_editor.php index 974b01c..22a3dfd 100644 --- a/contao/dca/tl_survey_editor.php +++ b/contao/dca/tl_survey_editor.php @@ -28,7 +28,7 @@ $GLOBALS['TL_DCA']['tl_survey_editor'] = [ 'sorting' => [ 'mode' => 4, 'fields' => ['member'], - 'headerFields' => ['title', 'alias', 'isLocked'], + 'headerFields' => ['title', 'alias'], 'panelLayout' => 'sort,search,limit', ], 'label' => [ diff --git a/contao/templates/frontend/member_survey_edit.html.twig b/contao/templates/frontend/member_survey_edit.html.twig index 4687abe..84c54e2 100644 --- a/contao/templates/frontend/member_survey_edit.html.twig +++ b/contao/templates/frontend/member_survey_edit.html.twig @@ -56,7 +56,6 @@