Skip to content

Commit

Permalink
Fixed issue #5403: Actually hide questions in Print Answers if they h…
Browse files Browse the repository at this point in the history
…ave attribute 'hidden' - patch kindly provided by ronvdburg

Fixed issue #5402: Actually hide questions in Printable Survey if they have attribute 'hidden' - patch kindly provided by ronvdburg

git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/limesurvey@10835 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
c-schmitz committed Aug 24, 2011
1 parent 51f4aa2 commit c5542dc
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
9 changes: 8 additions & 1 deletion admin/printablesurvey.php
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,8 @@ function star_replace($input)
,'QUESTIONS' => '' // templated formatted content if $question is appended to this at the end of processing each question.
);

// A group can have only hidden questions. In that case you don't want to see the group's header/description either.
$bGroupHasVisibleQuestions = false;

if(isset($_POST['printableexport'])){$pdf->titleintopdf($degrow['group_name'],$degrow['description']);}

Expand All @@ -413,6 +415,8 @@ function star_replace($input)
{
continue;
}
$bGroupHasVisibleQuestions = true;

//GET ANY CONDITIONS THAT APPLY TO THIS QUESTION

$printablesurveyoutput = '';
Expand Down Expand Up @@ -1829,7 +1833,10 @@ function star_replace($input)
$group['QUESTIONS'] .= populate_template( 'question' , $question);

}
$survey_output['GROUPS'] .= populate_template( 'group' , $group );
if ($bGroupHasVisibleQuestions)
{
$survey_output['GROUPS'] .= populate_template( 'group' , $group );
}
}

$survey_output['THEREAREXQUESTIONS'] = str_replace( '{NUMBEROFQUESTIONS}' , $total_questions , $clang->gT('There are {NUMBEROFQUESTIONS} questions in this survey'));
Expand Down
8 changes: 8 additions & 0 deletions common_functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -7553,6 +7553,14 @@ function aGetFullResponseTable($iSurveyID,$iResponseID,$sLanguageCode)
$oldqid = 0;
foreach ($aFieldMap as $sKey=>$fname)
{
if (!empty($fname['qid']))
{
$attributes = getQuestionAttributes($fname['qid']);
if (getQuestionAttributeValue($attributes, 'hidden') == 1)
{
continue;
}
}
$question = $fname['question'];
$subquestion='';
if (isset($fname['gid']) && !empty($fname['gid'])) {
Expand Down

0 comments on commit c5542dc

Please sign in to comment.