Skip to content

Commit

Permalink
Fixed Restart Survey with newtest, and preserve language
Browse files Browse the repository at this point in the history
git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/phpsurveyor@2463 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
David Olivier committed Feb 28, 2007
1 parent a5f40c2 commit f56b3d9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
12 changes: 10 additions & 2 deletions common.php
Expand Up @@ -1683,7 +1683,7 @@ function templatereplace($line)
global $completed, $register_errormsg;
global $notanswered, $privacy, $surveyid;
global $publicurl, $templatedir, $token;
global $assessments;
global $assessments, $s_lang;
global $errormsg, $clang;

if (strpos ($line,"</head>"))
Expand Down Expand Up @@ -1850,7 +1850,15 @@ function templatereplace($line)
}

if (strpos($line, "{ANSWERSCLEARED}") !== false) $line=str_replace("{ANSWERSCLEARED}", $clang->gT("Answers Cleared"), $line);
if (strpos($line, "{RESTART}") !== false) $line=str_replace("{RESTART}", "<a href='{$_SERVER['PHP_SELF']}?sid=$surveyid&amp;token=".returnglobal('token')."'>".$clang->gT("Restart this Survey")."</a>", $line);
if (strpos($line, "{RESTART}") !== false)
{
if ($thissurvey['active'] == "N")
{
$line=str_replace("{RESTART}", "<a href='{$_SERVER['PHP_SELF']}?sid=$surveyid&amp;newtest=Y&amp;lang=".$s_lang."'>".$clang->gT("Restart this Survey")."</a>", $line);
} else {
$line=str_replace("{RESTART}", "<a href='{$_SERVER['PHP_SELF']}?sid=$surveyid&amp;token=".returnglobal('token')."&amp;lang=".$s_lang."'>".$clang->gT("Restart this Survey")."</a>", $line);
}
}
if (strpos($line, "{CLOSEWINDOW}") !== false) $line=str_replace("{CLOSEWINDOW}", "<a href='javascript:%20self.close()'>".$clang->gT("Close this Window")."</a>", $line);

$savereturn = "<a href='index.php?sid=$surveyid";
Expand Down
3 changes: 3 additions & 0 deletions index.php
Expand Up @@ -123,6 +123,8 @@
}
}

if (isset($_GET['newtest']) && $_GET['newtest'] = "Y") unset($_GET['token']);

//GET BASIC INFORMATION ABOUT THIS SURVEY
$thissurvey=getSurveyInfo($surveyid, $_SESSION['s_lang']);

Expand Down Expand Up @@ -312,6 +314,7 @@
//CLEAR SESSION IF REQUESTED
if (isset($_GET['move']) && $_GET['move'] == "clearall")
{
$s_lang = $_SESSION['s_lang'];
session_unset();
session_destroy();
sendcacheheaders();
Expand Down

0 comments on commit f56b3d9

Please sign in to comment.