Skip to content

Commit

Permalink
Fixed issue #5962: View Response Details does not work correctly if r…
Browse files Browse the repository at this point in the history
…esponses are filtered
  • Loading branch information
c-schmitz committed Mar 30, 2012
1 parent 1371faf commit 28440ff
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions admin/browse.php
Expand Up @@ -187,21 +187,17 @@

$nfncount = count($fnames)-1;
//SHOW INDIVIDUAL RECORD
$idquery = "SELECT * FROM $surveytable ";
$idquery = "SELECT * FROM {$surveytable} s";
if ($surveyinfo['anonymized'] == "N" && db_tables_exist($tokentable))
$idquery .= "LEFT JOIN $tokentable ON $surveytable.token = $tokentable.token ";
$idquery .= "LEFT JOIN {$tokentable} t ON s.token = t.token ";
if (incompleteAnsFilterstate() == "inc")
$idquery .= " WHERE (submitdate = ".$connect->DBDate('1980-01-01'). " OR submitdate IS NULL) AND ";
elseif (incompleteAnsFilterstate() == "filter")
$idquery .= " WHERE submitdate >= ".$connect->DBDate('1980-01-01'). " AND ";
else
$idquery .= " WHERE ";
if ($id < 1) { $id = 1; }
if (isset($_SESSION['sql']) && $_SESSION['sql'])
{
$idquery .= $_SESSION['sql'];
}
else {$idquery .= "$surveytable.id = $id";}
$idquery .= " s.id = $id";
$idresult = db_execute_assoc($idquery) or safe_die ("Couldn't get entry<br />\n$idquery<br />\n".$connect->ErrorMsg());
while ($idrow = $idresult->FetchRow())
{
Expand Down

2 comments on commit 28440ff

@TMSWhite
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs to be ported to Yii?

@c-schmitz
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Please sign in to comment.