Skip to content

Commit

Permalink
Fixed issue #8267: Conditions in print view are incorrect and duplica…
Browse files Browse the repository at this point in the history
…ted when referring to certain question types
  • Loading branch information
c-schmitz committed Oct 23, 2013
1 parent 97873fb commit 1dd7cee
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions application/controllers/admin/printablesurvey.php
Expand Up @@ -235,7 +235,7 @@ function index($surveyid, $lang = null)
$x=0;

$conditions1="qid={$deqrow['qid']} AND scenario={$scenariorow['scenario']}";
$distinctresult=Conditions::model()->getSomeConditions(array('cqid','method', 'cfieldname', 'value'), $conditions1, array('cqid'),array('cqid', 'method','cfieldname','value'));
$distinctresult=Condition::model()->getSomeConditions(array('cqid','method', 'cfieldname'), $conditions1, array('cqid'),array('cqid', 'method','cfieldname'));

//Loop through each condition for a particular scenario.
foreach ($distinctresult->readAll() as $distinctrow)
Expand Down Expand Up @@ -285,13 +285,6 @@ function index($surveyid, $lang = null)
{
$sExplanation .= $clang->gT("Answer was")." ";
}
if($distinctrow['value'] == '') {
$sExplanation .= ' '.$clang->gT("Not selected").' ';
}
//If question type is numerical or multi-numerical, show the actual value - otherwise, don't.
if($subresult['type'] == 'N' || $subresult['type'] == 'K') {
$sExplanation .= ' '.$distinctrow['value']. ' ';
}
}
if(!$distinctrow['cqid']) { // cqid == 0 ==> token attribute match
$tokenData = getTokenFieldsAndNames($surveyid);
Expand Down Expand Up @@ -360,6 +353,7 @@ function index($surveyid, $lang = null)
case "B":
case ":":
case ";":
case "5":
$conditions[]=$conrow['value'];
break;
case "C":
Expand Down Expand Up @@ -430,6 +424,7 @@ function index($surveyid, $lang = null)
$conditions = array_unique($conditions);
break;
case "N":
case "K":
$conditions[]=$value;
break;
case "F":
Expand Down

0 comments on commit 1dd7cee

Please sign in to comment.