mirror of
https://github.com/ACSPRI/queXS
synced 2024-04-02 12:12:16 +00:00
Merging the Limesurvey 1.91+ branch of queXS in to the trunk
This commit is contained in:
@@ -1,17 +1,17 @@
|
||||
<?php
|
||||
/*
|
||||
* LimeSurvey
|
||||
* Copyright (C) 2007 The LimeSurvey Project Team / Carsten Schmitz
|
||||
* All rights reserved.
|
||||
* License: GNU/GPL License v2 or later, see LICENSE.php
|
||||
* LimeSurvey is free software. This version may have been modified pursuant
|
||||
* to the GNU General Public License, and as distributed it includes or
|
||||
* is derivative of works licensed under the GNU General Public License or
|
||||
* other free or open source software licenses.
|
||||
* See COPYRIGHT.php for copyright notices and details.
|
||||
*
|
||||
* $Id: saved.php 6853 2009-05-15 12:51:09Z c_schmitz $
|
||||
*/
|
||||
* LimeSurvey
|
||||
* Copyright (C) 2007 The LimeSurvey Project Team / Carsten Schmitz
|
||||
* All rights reserved.
|
||||
* License: GNU/GPL License v2 or later, see LICENSE.php
|
||||
* LimeSurvey is free software. This version may have been modified pursuant
|
||||
* to the GNU General Public License, and as distributed it includes or
|
||||
* is derivative of works licensed under the GNU General Public License or
|
||||
* other free or open source software licenses.
|
||||
* See COPYRIGHT.php for copyright notices and details.
|
||||
*
|
||||
* $Id: saved.php 10925 2011-09-02 14:12:02Z c_schmitz $
|
||||
*/
|
||||
|
||||
include_once("login_check.php");
|
||||
|
||||
@@ -29,82 +29,89 @@ $surveytable = db_table_name("survey_".$surveyid);
|
||||
|
||||
if ($subaction == "delete" && $surveyid && $scid)
|
||||
{
|
||||
$query = "DELETE FROM {$dbprefix}saved_control
|
||||
$query = "DELETE FROM {$dbprefix}saved_control
|
||||
WHERE scid=$scid
|
||||
AND sid=$surveyid
|
||||
";
|
||||
if ($result = $connect->Execute($query))
|
||||
{
|
||||
//If we were succesful deleting the saved_control entry,
|
||||
//then delete the rest
|
||||
$query = "DELETE FROM {$surveytable} WHERE id={$srid}";
|
||||
$result = $connect->Execute($query) or die("Couldn't delete");
|
||||
if ($result = $connect->Execute($query))
|
||||
{
|
||||
//If we were succesful deleting the saved_control entry,
|
||||
//then delete the rest
|
||||
$query = "DELETE FROM {$surveytable} WHERE id={$srid}";
|
||||
$result = $connect->Execute($query) or die("Couldn't delete");
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
$savedsurveyoutput .= "Couldn't delete<br />$query<br />".$connect->ErrorMsg();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$savedsurveyoutput .= "Couldn't delete<br />$query<br />".$connect->ErrorMsg();
|
||||
}
|
||||
}
|
||||
$js_admin_includes[]='../scripts/jquery/jquery.tablesorter.min.js';
|
||||
$js_admin_includes[]='scripts/saved.js';
|
||||
|
||||
$savedsurveyoutput .= "<table><tr><td></td></tr></table>\n"
|
||||
."<table width='99%' align='center' class='menubar'>\n";
|
||||
$savedsurveyoutput .= "\t<tr><td colspan='2' height='4' class='settingcaption'><strong>"
|
||||
. $clang->gT("Browse Saved Responses").":</strong> ".$thissurvey['name']."</td></tr>\n";
|
||||
$savedsurveyoutput .= "<div class='menubar'>\n"
|
||||
. "<div class='menubar-title ui-widget-header'><span style='font-weight:bold;'>\n";
|
||||
$savedsurveyoutput .= $clang->gT("Saved Responses")."</span> ".$thissurvey['name']." (ID: $surveyid)</div>\n"
|
||||
. "<div class='menubar-main'>\n"
|
||||
. "<div class='menubar-left'>\n";
|
||||
$savedsurveyoutput .= savedmenubar();
|
||||
$savedsurveyoutput .= "</table>\n";
|
||||
$savedsurveyoutput .= "<table><tr><td></td></tr></table>\n"
|
||||
."<table width='99%' align='center' style='border: 1px solid #555555' cellpadding='1' cellspacing='0'>\n";
|
||||
$savedsurveyoutput .= "<tr><td>";
|
||||
$savedsurveyoutput .= "</div></div></div>\n";
|
||||
$savedsurveyoutput .= "<div class='header ui-widget-header'>".$clang->gT("Saved Responses:") . " ". getSavedCount($surveyid)."</div><p>";
|
||||
|
||||
showSavedList($surveyid);
|
||||
|
||||
|
||||
switch ($subaction)
|
||||
{
|
||||
case "all":
|
||||
case "delete":
|
||||
$savedsurveyoutput .= "<center>".$setfont.$clang->gT("Saved Responses:") . " ". getSavedCount($surveyid)."</font></center>";
|
||||
showSavedList($surveyid);
|
||||
break;
|
||||
default:
|
||||
$savedsurveyoutput .= "<center>".$setfont.$clang->gT("Saved Responses:") . " ". getSavedCount($surveyid)."</font></center>";
|
||||
}
|
||||
$savedsurveyoutput .= "</td></tr></table><br /> \n";
|
||||
|
||||
function showSavedList($surveyid)
|
||||
{
|
||||
global $dbprefix, $connect, $clang, $savedsurveyoutput, $scriptname, $surveytable;
|
||||
$query = "SELECT scid, srid, identifier, ip, saved_date, email, access_code\n"
|
||||
."FROM {$dbprefix}saved_control\n"
|
||||
."WHERE sid=$surveyid\n"
|
||||
."ORDER BY saved_date desc";
|
||||
$result = db_execute_assoc($query) or safe_die ("Couldn't summarise saved entries<br />$query<br />".$connect->ErrorMsg());
|
||||
if ($result->RecordCount() > 0)
|
||||
{
|
||||
$savedsurveyoutput .= "<table class='outlinetable' cellspacing='0' align='center'>\n";
|
||||
$savedsurveyoutput .= "<tr><th>SCID</th><th>"
|
||||
.$clang->gT("Identifier")."</th><th>"
|
||||
.$clang->gT("IP Address")."</th><th>"
|
||||
.$clang->gT("Date Saved")."</th><th>"
|
||||
.$clang->gT("Email Address")."</th><th>"
|
||||
.$clang->gT("Action")."</th>"
|
||||
."</tr>\n";
|
||||
while($row=$result->FetchRow())
|
||||
{
|
||||
$savedsurveyoutput .= "<tr>
|
||||
global $dbprefix, $connect, $clang, $savedsurveyoutput, $scriptname, $imageurl, $surrows;
|
||||
$query = "SELECT scid, srid, identifier, ip, saved_date, email, access_code\n"
|
||||
."FROM {$dbprefix}saved_control\n"
|
||||
."WHERE sid=$surveyid\n"
|
||||
."ORDER BY saved_date desc";
|
||||
$result = db_execute_assoc($query) or safe_die ("Couldn't summarise saved entries<br />$query<br />".$connect->ErrorMsg());
|
||||
if ($result->RecordCount() > 0)
|
||||
{
|
||||
$savedsurveyoutput .= "<table class='browsetable' align='center'>\n";
|
||||
$savedsurveyoutput .= "<thead><tr><th>SCID</th><th>"
|
||||
.$clang->gT("Actions")."</th><th>"
|
||||
.$clang->gT("Identifier")."</th><th>"
|
||||
.$clang->gT("IP address")."</th><th>"
|
||||
.$clang->gT("Date Saved")."</th><th>"
|
||||
.$clang->gT("Email address")."</th>"
|
||||
."</tr></thead><tbody>\n";
|
||||
while($row=$result->FetchRow())
|
||||
{
|
||||
$savedsurveyoutput .= "<tr>
|
||||
<td>".$row['scid']."</td>
|
||||
<td>".$row['identifier']."</td>
|
||||
<td>".$row['ip']."</td>
|
||||
<td>".$row['saved_date']."</td>
|
||||
<td><a href='mailto:".$row['email']."'>".$row['email']."</td>
|
||||
<td align='center'>
|
||||
[<a href='$scriptname?action=saved&sid=$surveyid&subaction=delete&scid=".$row['scid']."&srid=".$row['srid']."'"
|
||||
." onclick='return confirm(\"".$clang->gT("Are you sure you want to delete this entry?","js")."\")'"
|
||||
.">".$clang->gT("Delete")."</a>]
|
||||
[<a href='".$scriptname."?action=dataentry&subaction=edit&id=".$row['srid']."&sid={$surveyid}&surveytable={$surveytable}'>".$clang->gT("Edit")."</a>]
|
||||
</td>
|
||||
<td align='center'>";
|
||||
|
||||
if (bHasSurveyPermission($surveyid,'responses','update'))
|
||||
{
|
||||
$savedsurveyoutput .="<input style='height: 16; width: 16px; font-size: 8; font-family: verdana' type='image' src='$imageurl/token_edit.png' title='"
|
||||
.$clang->gT("Edit entry")."' onclick=\"window.open('{$scriptname}?action=dataentry&subaction=edit&id={$row['srid']}&sid={$surveyid}', '_self')\" />";
|
||||
}
|
||||
if (bHasSurveyPermission($surveyid,'responses','delete'))
|
||||
{
|
||||
$savedsurveyoutput .="<input style='height: 16; width: 16px; font-size: 8; font-family: verdana' type='image' src='{$imageurl}/token_delete.png' title='"
|
||||
.$clang->gT("Delete entry")."' onclick=\"if (confirm('".$clang->gT("Are you sure you want to delete this entry?","js")."')) {".get2post("{$scriptname}?action=saved&sid=$surveyid&subaction=delete&scid={$row['scid']}&srid={$row['srid']}")."}\" />";
|
||||
}
|
||||
else
|
||||
{
|
||||
// $savedsurveyoutput .= "[<a href='{$scriptname}?action=dataentry&subaction=edit&id={$row['srid']}&sid={$surveyid}'>".$clang->gT("View")."</a>]";
|
||||
|
||||
}
|
||||
|
||||
$savedsurveyoutput .="</td>
|
||||
<td>".$row['identifier']."</td>
|
||||
<td>".$row['ip']."</td>
|
||||
<td>".$row['saved_date']."</td>
|
||||
<td><a href='mailto:".$row['email']."'>".$row['email']."</td>
|
||||
|
||||
</tr>\n";
|
||||
} // while
|
||||
$savedsurveyoutput .= "</table><br /> \n";
|
||||
}
|
||||
} // while
|
||||
$savedsurveyoutput .= "</tbody></table><br /> \n";
|
||||
}
|
||||
}
|
||||
|
||||
// [<a href='saved.php?sid=$surveyid&action=remind&scid=".$row['scid']."'>".$clang->gT("Remind")."</a>]
|
||||
@@ -112,26 +119,21 @@ function showSavedList($surveyid)
|
||||
|
||||
function savedmenubar()
|
||||
{
|
||||
global $surveyid, $scriptname, $imagefiles, $clang;
|
||||
//BROWSE MENU BAR
|
||||
if (!isset($surveyoptions)) {$surveyoptions="";}
|
||||
$surveyoptions .= "\t<tr>\n"
|
||||
. "\t\t<td>\n"
|
||||
. "\t\t\t<a href='$scriptname?sid=$surveyid' onmouseout=\"hideTooltip()\" " .
|
||||
"onmouseover=\"showTooltip(event,'".$clang->gT("Return to Survey Administration", "js")."')\" >" .
|
||||
"<img name='Administration' src='$imagefiles/home.png' title='' align='left'></a>\n"
|
||||
. "\t\t\t<img src='$imagefiles/blank.gif' alt='' width='11' border='0' hspace='0' align='left'>\n"
|
||||
. "\t\t\t<img src='$imagefiles/seperator.gif' alt='' border='0' hspace='0' align='left'>\n"
|
||||
. "\t\t\t<a href='$scriptname?action=saved&sid=$surveyid' onmouseout=\"hideTooltip()\" " .
|
||||
"onmouseover=\"showTooltip(event,'".$clang->gT("Show summary information", "js")."')\">" .
|
||||
"<img name='SurveySummary' src='$imagefiles/summary.png' title='' align='left'></a>\n"
|
||||
. "\t\t\t<a href='$scriptname?action=saved&sid=$surveyid&subaction=all' onmouseout=\"hideTooltip()\" onmouseover=\"showTooltip(event,'".$clang->gT("Display Responses", "js")."')\">" .
|
||||
"<img name='ViewAll' src='$imagefiles/document.png' title='' align='left'></a>\n"
|
||||
//. "\t\t\t<input type='image' name='ViewLast' src='$imagefiles/viewlast.png' title='"
|
||||
//. $clang->gT("Display Last 50 Responses")."' align='left' onclick=\"window.open('saved.php?sid=$surveyid&action=all&limit=50&order=desc', '_self')\">\n"
|
||||
. "\t\t\t<img src='$imagefiles/seperator.gif' border='0' hspace='0' align='left' alt=''>\n"
|
||||
. "\t\t</td>\n"
|
||||
. "\t</tr>\n";
|
||||
return $surveyoptions;
|
||||
global $surveyid, $scriptname, $imageurl, $clang;
|
||||
//BROWSE MENU BAR
|
||||
if (!isset($surveyoptions)) {$surveyoptions="";}
|
||||
$surveyoptions .= "<a href='$scriptname?sid=$surveyid' title='".$clang->gTview("Return to survey administration")."' >" .
|
||||
"<img name='Administration' src='$imageurl/home.png' alt='".$clang->gT("Return to survey administration")."' align='left'></a>\n";
|
||||
/* . "\t\t\t<img src='$imageurl/blank.gif' alt='' width='11' border='0' hspace='0' align='left'>\n"
|
||||
. "\t\t\t<img src='$imageurl/seperator.gif' alt='' border='0' hspace='0' align='left'>\n"
|
||||
. "\t\t\t<a href='$scriptname?action=saved&sid=$surveyid' " .
|
||||
"title='".$clang->gTview("Show summary information")."'>" .
|
||||
"<img name='SurveySummary' src='$imageurl/summary.png' alt='".$clang->gT("Show summary information")."' align='left'></a>\n"
|
||||
. "\t\t\t<a href='$scriptname?action=saved&sid=$surveyid&subaction=all' title='".$clang->gTview("Display Responses")."'>"
|
||||
. "<img name='ViewAll' src='$imageurl/document.png' alt='".$clang->gT("Display Responses")."' align='left'></a>\n"
|
||||
//. "\t\t\t<input type='image' name='ViewLast' src='$imageurl/viewlast.png' title='"
|
||||
//. $clang->gT("Display Last 50 Responses")."' align='left' onclick=\"window.open('saved.php?sid=$surveyid&action=all&limit=50&order=desc', '_self')\">\n"
|
||||
. "\t\t\t<img src='$imageurl/seperator.gif' border='0' hspace='0' align='left' alt=''>\n";*/
|
||||
return $surveyoptions;
|
||||
}
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user