Skip to content

Commit

Permalink
Fixed bug #3271: Exportvv doesn't filter incomplete answers even if r…
Browse files Browse the repository at this point in the history
…equested. Fixed the bug and updated terminology to match browse and statistics functions.

git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/limesurvey@7029 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
jcleeland committed Jun 5, 2009
1 parent a4a3a35 commit 2a2fce9
Showing 1 changed file with 22 additions and 8 deletions.
30 changes: 22 additions & 8 deletions admin/vvexport.php
Expand Up @@ -29,15 +29,23 @@
}
if (!$subaction == "export")
{
if (incompleteAnsFilterstate() === true)
if(incompleteAnsFilterstate() == "inc")
{
$selecthide="";
$selectshow="";
$selectinc="selected='selected'";
}
elseif (incompleteAnsFilterstate() == "filter")
{
$selecthide="selected='selected'";
$selectshow="";
$selectinc="";
}
else
{
$selecthide="";
$selectshow="selected='selected'";
$selectinc="";
}

$vvoutput = "<br /><form method='post' action='admin.php?action=vvexport&sid=$surveyid'>"
Expand All @@ -50,22 +58,24 @@
." <td><input type='text' size='10' value='$surveyid' name='sid' readonly='readonly' /></td>"
."</tr>"
."<tr>"
." <td align='right'>".$clang->gT("Filter incomplete answers")." </td>"
." <td align='right'>".$clang->gT("Export").":</td>"
." <td><select name='filterinc'>\n"
." <option value='filter' $selecthide>".$clang->gT("Enable")."</option>\n"
." <option value='show' $selectshow>".$clang->gT("Disable")."</option>\n"
." <option value='filter' $selecthide>".$clang->gT("Completed Records Only")."</option>\n"
." <option value='show' $selectshow>".$clang->gT("All Records")."</option>\n"
." <option value='incomplete' $selectinc>".$clang->gT("Incomplete Records Only")."</option>\n"
." </select></td>\n"
."</tr>"
."<tr>"
." <td align='right'>".$clang->gT("File Extension")." </td>\n"
." <td><input type='text' name='extension' size='3' value='csv'></td>\n"
." <td align='right'>".$clang->gT("File Extension").": </td>\n"
." <td><input type='text' name='extension' size='3' value='csv'><span style='font-size: 7pt'>*</span></td>\n"
."</tr>\n"
."<tr>"
." <td colspan='2' align='center'>"
." <input type='submit' value='".$clang->gT("Export Responses")."' />&nbsp;"
." <input type='hidden' name='subaction' value='export' />"
." </td>"
."</tr>"
."<tr><td colspan='2' align='center' style='padding: 10px 0 10px 5px'><span style='font-size: 7pt'>* For easy opening in MS Excel, change the extension to 'tab' or 'txt'</span></td></tr>\n"
."<tr><td colspan='2' align='center'>[<a href='$scriptname?action=browse&amp;sid=$surveyid'>".$clang->gT("Return to Survey Administration")."</a>]</td></tr>"
."</table>";
}
Expand Down Expand Up @@ -103,9 +113,13 @@
$vvoutput = $firstline."\n";
$vvoutput .= $secondline."\n";
$query = "SELECT * FROM $surveytable";
if (incompleteAnsFilterstate() === true)
if (incompleteAnsFilterstate() == "inc")
{
$query .= " WHERE submitdate IS NULL ";
}
elseif (incompleteAnsFilterstate() == "filter")
{
$query .= " WHERE submitdate is not null ";
$query .= " WHERE submitdate >= ".$connect->DBDate('1980-01-01'). " ";
}
$result = db_execute_assoc($query) or safe_die("Error:<br />$query<br />".$connect->ErrorMsg()); //Checked

Expand Down

0 comments on commit 2a2fce9

Please sign in to comment.