Pass submission to finished action.

This commit is contained in:
Will Rossiter 2014-07-12 09:43:52 +12:00
parent 83069113d1
commit c77830bd2f

View File

@ -1053,6 +1053,10 @@ JS
} }
} }
if(!$this->DisableSaveSubmissions) {
Session::set('userformssubmission'. $this->ID, $submittedForm->ID);
}
return $this->redirect($this->Link('finished') . $referrer); return $this->redirect($this->Link('finished') . $referrer);
} }
@ -1063,6 +1067,12 @@ JS
* @return ViewableData * @return ViewableData
*/ */
public function finished() { public function finished() {
$submission = Session::get('userformssubmission'. $this->ID);
if($submission) {
$submission = SubmittedForm::get()->byId($submission);
}
$referrer = isset($_GET['referrer']) ? urldecode($_GET['referrer']) : null; $referrer = isset($_GET['referrer']) ? urldecode($_GET['referrer']) : null;
$formProcessed = Session::get('FormProcessed'); $formProcessed = Session::get('FormProcessed');
@ -1083,8 +1093,8 @@ JS
Session::clear('FormProcessed'); Session::clear('FormProcessed');
return $this->customise(array( return $this->customise(array(
'Content' => $this->customise( 'Content' => $this->customise(array(
array( 'Submission' => $submission,
'Link' => $referrer 'Link' => $referrer
))->renderWith('ReceivedFormSubmission'), ))->renderWith('ReceivedFormSubmission'),
'Form' => '', 'Form' => '',