@@ -85,6 +85,7 @@ public function setMemberManager(IMemberManager $manager)
8585 'AddEntity ' ,
8686 'EditEntity ' ,
8787 'DeleteEntity ' ,
88+ 'RenderSurveyEnd ' ,
8889 ];
8990
9091 static $ url_handlers = [
@@ -97,6 +98,7 @@ public function setMemberManager(IMemberManager $manager)
9798 'GET SurveyStepForm ' => 'SurveyStepForm ' ,
9899 'POST SurveyDynamicEntityStepForm ' => 'SurveyDynamicEntityStepForm ' ,
99100 'GET SurveyDynamicEntityStepForm ' => 'SurveyDynamicEntityStepForm ' ,
101+ 'GET thank-you-end ' => 'RenderSurveyEnd ' ,
100102 'GET $STEP_SLUG ' => 'RenderSurvey ' ,
101103 'POST $Action//$ID/$OtherID ' => 'handleAction ' ,
102104 ];
@@ -322,9 +324,9 @@ public function RenderSurvey(SS_HTTPRequest $request)
322324 $ this ->survey_manager ->sendFinalStepEmail (new SurveyThankYouEmailSenderService , $ current_survey );
323325 }
324326
325- return $ this ->customise (array (
327+ return $ this ->customise ([
326328 'Survey ' => $ current_survey ,
327- )) ->renderWith (array ( 'Surveys_CurrentSurveyContainer ' , 'SurveyPage ' ) );
329+ ]) ->renderWith ([ 'Surveys_CurrentSurveyContainer ' , 'SurveyPage ' ] );
328330 }
329331 catch (NotFoundEntityException $ ex1 ){
330332 SS_Log::log ($ ex1 , SS_Log::WARN );
@@ -336,6 +338,15 @@ public function RenderSurvey(SS_HTTPRequest $request)
336338 }
337339 }
338340
341+ public function RenderSurveyEnd (SS_HTTPRequest $ request ){
342+ $ current_survey = $ this ->getCurrentSurveyInstance ();
343+
344+ return $ this ->customise ([
345+ 'Survey ' => $ current_survey ,
346+ 'SurveyReportPage ' => SurveyReportPage::getLive ()
347+ ])->renderWith (['UserSurveyPage_ThankYou ' , 'SurveyPage ' ]);
348+ }
349+
339350 /**
340351 * @param $step_name
341352 * @return string
@@ -498,7 +509,8 @@ public function NextStep($data, $form)
498509 $ this ->survey_manager ->sendFinalStepEmail (new SurveyThankYouEmailSenderService , $ current_survey );
499510
500511 $ this ->survey_manager ->completeSurvey ($ current_step );
501- $ form ->sessionMessage (GetTextTemplateHelpers::_t ("survey_ui " , "Thank you for your submission !!! " ), 'good ' );
512+
513+ return $ this ->redirect ($ this ->Link ().'thank-you-end ' );
502514 }
503515 SS_Log::log (sprintf ("end current step %s " , $ current_survey ->currentStep ()->Template ()->Name ), SS_Log::DEBUG );
504516 return $ this ->redirect ($ this ->Link ().$ next_step ->template ()->title ());
0 commit comments