Skip to content

Commit

Permalink
Fixed issue: Printable version not properly handling old templates
Browse files Browse the repository at this point in the history
  • Loading branch information
c-schmitz committed Aug 24, 2016
1 parent 4069cea commit d33659f
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions application/controllers/admin/printablesurvey.php
Expand Up @@ -1495,12 +1495,12 @@ function index($surveyid, $lang = null)
}

$question['QUESTION_TYPE_HELP'] = self::_star_replace($question['QUESTION_TYPE_HELP']);
$group['QUESTIONS'] .= self::_populate_template( 'question' , $question);
$group['QUESTIONS'] .= self::_populate_template( $oTemplate, 'question' , $question);

}
if ($bGroupHasVisibleQuestions)
{
$survey_output['GROUPS'] .= self::_populate_template( 'group' , $group );
$survey_output['GROUPS'] .= self::_populate_template( $oTemplate, 'group' , $group );
}
}

Expand Down Expand Up @@ -1577,7 +1577,7 @@ function index($surveyid, $lang = null)

// END recursive empty tag stripping.

echo self::_populate_template( 'survey' , $survey_output );
echo self::_populate_template( $oTemplate, 'survey' , $survey_output );
}// End print
}

Expand All @@ -1594,9 +1594,9 @@ function index($surveyid, $lang = null)
* How:
* @param string $template
*/
private function _populate_template( $template , $input , $line = '')
private function _populate_template( $oTemplate, $template , $input , $line = '')
{
$full_path = PRINT_TEMPLATE_DIR.'views/print_'.$template.'.pstpl';
$full_path = $oTemplate->viewPath.DIRECTORY_SEPARATOR.'print_'.$template.'.pstpl';
$full_constant = 'TEMPLATE'.$template.'.pstpl';
if(!defined($full_constant))
{
Expand Down Expand Up @@ -1747,13 +1747,13 @@ private function _array_filter_help($qidattributes, $sLanguageCode, $surveyid)
$aFilter=explode(';',$qidattributes['array_filter']);
$output .= "\n<p class='extrahelp'>";
foreach ($aFilter as $sFilter)
{
{
$oQuestion=Question::model()->findByAttributes(array('title' => $sFilter, 'language' => $sLanguageCode, 'sid' => $surveyid));
if ($oQuestion)
{
$sNewQuestionText = flattenText(breakToNewline($oQuestion->getAttribute('question')));
$output .= sprintf(gT("Only answer this question for the items you selected in question %s ('%s')"),$qidattributes['array_filter'], $sNewQuestionText );

}
}
$output .= "</p>\n";
Expand All @@ -1772,7 +1772,7 @@ private function _array_filter_help($qidattributes, $sLanguageCode, $surveyid)
}
}
$output .= "</p>\n";
}
}
return $output;
}

Expand Down

0 comments on commit d33659f

Please sign in to comment.