mirror of
https://github.com/silverstripe/silverstripe-userforms.git
synced 2024-10-22 17:05:42 +02:00
Pass submission to finished action.
This commit is contained in:
parent
83069113d1
commit
c77830bd2f
@ -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' => '',
|
||||||
|
Loading…
Reference in New Issue
Block a user