Skip to content

Commit

Permalink
Fixed issue 13180: Variables don't work in END_URL
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisGac committed Jan 26, 2018
1 parent d9d1f48 commit 4a8c028
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
15 changes: 13 additions & 2 deletions application/helpers/SurveyRuntimeHelper.php
Expand Up @@ -75,7 +75,6 @@ class SurveyRuntimeHelper
// Boolean helpers
private $okToShowErrors; // true if we must show error in page : it's a submited ($_POST) page and show the same page again for some reason


// Group
private $gid;
private $groupname;
Expand Down Expand Up @@ -219,7 +218,7 @@ public function run($surveyid, $args)
$upload_file = true;
}
} //end iteration
}
}
}

if ($this->sSurveyMode != 'survey' && isset($this->aSurveyInfo['showprogress']) && $this->aSurveyInfo['showprogress'] == 'Y') {
Expand Down Expand Up @@ -1146,6 +1145,18 @@ private function moveSubmitIfNeeded()
$this->aSurveyInfo['aCompleted']['sPluginHTML'] = implode("\n", $blocks)."\n";
$this->aSurveyInfo['aCompleted']['sSurveylsUrl'] = $this->aSurveyInfo['surveyls_url'];

$aStandardsReplacementFields = array();
if (strpos($this->aSurveyInfo['surveyls_url'], "{") !== false) {
// process string anyway so that it can be pretty-printed
$aStandardsReplacementFields = getStandardsReplacementFields($this->aSurveyInfo);

$this->aSurveyInfo['surveyls_url'] = LimeExpressionManager::ProcessString( $this->aSurveyInfo['surveyls_url'], null, $aStandardsReplacementFields);

}

$this->aSurveyInfo['aCompleted']['sSurveylsUrl'] = $this->aSurveyInfo['surveyls_url'];



$this->aSurveyInfo['aLEM']['debugvalidation']['show'] = false;
if (($this->LEMdebugLevel & LEM_DEBUG_VALIDATION_SUMMARY) == LEM_DEBUG_VALIDATION_SUMMARY) {
Expand Down
10 changes: 6 additions & 4 deletions application/helpers/replacements_helper.php
Expand Up @@ -434,10 +434,12 @@ function getStandardsReplacementFields($thissurvey)
$_datestamp = '-';
}

$_assessment_current_total = '';
if (!empty($thissurvey['aAssessments'])){
$_assessment_current_total = $thissurvey['aAssessments']['total'];
}else{
$_assessment_current_total = '';
if (!empty($thissurvey['aAssessments']['total'])){
$_assessment_current_total = $thissurvey['aAssessments']['total'];
}

}


Expand Down Expand Up @@ -476,7 +478,7 @@ function getStandardsReplacementFields($thissurvey)
$coreReplacements['WELCOME'] = (isset($thissurvey['welcome']) ? $thissurvey['welcome'] : '');
$coreReplacements['CLOSE_TRANSLATION'] = gT('Close');
$coreReplacements['ASSESSMENT_CURRENT_TOTAL'] = $_assessment_current_total;

return $coreReplacements;
}

Expand Down

0 comments on commit 4a8c028

Please sign in to comment.