Skip to content

Commit

Permalink
Localisation updates (changing text to _DEFINE's)
Browse files Browse the repository at this point in the history
git-svn-id: file:///Users/Shitiz/Downloads/lssvn/trunk/unstable@369 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
jcleeland committed Jun 17, 2003
1 parent 638070e commit 6dbcafa
Show file tree
Hide file tree
Showing 3 changed files with 150 additions and 175 deletions.
131 changes: 61 additions & 70 deletions group.php
Expand Up @@ -35,9 +35,9 @@
*/

//Move current step
if ($_POST['move'] == " << prev ") {$_SESSION['step'] = $_POST['thisstep']-1;}
if ($_POST['move'] == " next >> ") {$_SESSION['step'] = $_POST['thisstep']+1;}
if ($_POST['move'] == " last ") {$_SESSION['step'] = $_POST['thisstep']+1;}
if ($_POST['move'] == " << "._PREV." ") {$_SESSION['step'] = $_POST['thisstep']-1;}
if ($_POST['move'] == " "._NEXT." >> ") {$_SESSION['step'] = $_POST['thisstep']+1;}
if ($_POST['move'] == " "._LAST." ") {$_SESSION['step'] = $_POST['thisstep']+1;}

//CONVERT POSTED ANSWERS TO SESSION VARIABLES
if ($_POST['fieldnames'])
Expand All @@ -64,9 +64,9 @@
if ($$multiname == $$multiname2) //so far all multiple choice options are unanswered
{
//The number of questions not answered is equal to the number of questions
if ($_POST['move'] == " << prev ") {$_SESSION['step'] = $_POST['thisstep'];}
if ($_POST['move'] == " next >> ") {$_SESSION['step'] = $_POST['thisstep'];}
if ($_POST['move'] == " last ") {$_SESSION['step'] = $_POST['thisstep']; $_POST['move'] == " next >> ";}
if ($_POST['move'] == " << "._PREV." ") {$_SESSION['step'] = $_POST['thisstep'];}
if ($_POST['move'] == " "._NEXT." >> ") {$_SESSION['step'] = $_POST['thisstep'];}
if ($_POST['move'] == " "._LAST." ") {$_SESSION['step'] = $_POST['thisstep']; $_POST['move'] == " "._NEXT." >> ";}
$notanswered[]=substr($multiname, 5, strlen($multiname));
$$multiname=0;
$$multiname2=0;
Expand All @@ -83,9 +83,9 @@
elseif (!$_POST[$multiname])
{
//One of the mandatory questions hasn't been asnwered
if ($_POST['move'] == " << prev ") {$_SESSION['step'] = $_POST['thisstep'];}
if ($_POST['move'] == " next >> ") {$_SESSION['step'] = $_POST['thisstep'];}
if ($_POST['move'] == " last ") {$_SESSION['step'] = $_POST['thisstep']; $_POST['move'] == " next >> ";}
if ($_POST['move'] == " << "._PREV." ") {$_SESSION['step'] = $_POST['thisstep'];}
if ($_POST['move'] == " "._NEXT." >> ") {$_SESSION['step'] = $_POST['thisstep'];}
if ($_POST['move'] == " "._LAST." ") {$_SESSION['step'] = $_POST['thisstep']; $_POST['move'] == " "._NEXT." >> ";}
$notanswered[]=$mfns[$mi];
}
else
Expand All @@ -101,9 +101,9 @@
if ($$multiname == $$multiname2) //so far all multiple choice options are unanswered
{
//The number of questions not answered is equal to the number of questions
if ($_POST['move'] == " << prev ") {$_SESSION['step'] = $_POST['thisstep'];}
if ($_POST['move'] == " next >> ") {$_SESSION['step'] = $_POST['thisstep'];}
if ($_POST['move'] == " last ") {$_SESSION['step'] = $_POST['thisstep']; $_POST['move'] == " next >> ";}
if ($_POST['move'] == " << "._PREV." ") {$_SESSION['step'] = $_POST['thisstep'];}
if ($_POST['move'] == " "._NEXT." >> ") {$_SESSION['step'] = $_POST['thisstep'];}
if ($_POST['move'] == " "._LAST." ") {$_SESSION['step'] = $_POST['thisstep']; $_POST['move'] == " "._NEXT." >> ";}
$notanswered[]=substr($multiname, 5, strlen($multiname));
$$multiname="";
$$multiname2="";
Expand All @@ -125,9 +125,9 @@
if ($$multiname == $$multiname2) //For this lot all multiple choice options are unanswered
{
//The number of questions not answered is equal to the number of questions
if ($_POST['move'] == " << prev ") {$_SESSION['step'] = $_POST['thisstep'];}
if ($_POST['move'] == " next >> ") {$_SESSION['step'] = $_POST['thisstep'];}
if ($_POST['move'] == " last ") {$_SESSION['step'] = $_POST['thisstep']; $_POST['move'] == " next >> ";}
if ($_POST['move'] == " << "._PREV." ") {$_SESSION['step'] = $_POST['thisstep'];}
if ($_POST['move'] == " "._NEXT." >> ") {$_SESSION['step'] = $_POST['thisstep'];}
if ($_POST['move'] == " "._LAST." ") {$_SESSION['step'] = $_POST['thisstep']; $_POST['move'] == " "._NEXT." >> ";}
$notanswered[]=substr($multiname, 5, strlen($multiname));
$$multiname=0;
$$multiname2=0;
Expand All @@ -144,9 +144,9 @@
}
elseif ($_POST[$dccm] == "on" && !$_POST[$multiname]) //Question is on, there is no answer, but it's a multiple
{
if ($_POST['move'] == " << prev ") {$_SESSION['step'] = $_POST['thisstep'];}
if ($_POST['move'] == " next >> ") {$_SESSION['step'] = $_POST['thisstep'];}
if ($_POST['move'] == " last ") {$_SESSION['step'] = $_POST['thisstep']; $_POST['move'] == " next >> ";}
if ($_POST['move'] == " << "._PREV." ") {$_SESSION['step'] = $_POST['thisstep'];}
if ($_POST['move'] == " "._NEXT." >> ") {$_SESSION['step'] = $_POST['thisstep'];}
if ($_POST['move'] == " "._LAST." ") {$_SESSION['step'] = $_POST['thisstep']; $_POST['move'] == " "._NEXT." >> ";}
$notanswered[]=$cmfns[$mi];
}
elseif ($_POST[$dccm] == "on")
Expand All @@ -162,16 +162,16 @@
if ($$multiname == $$multiname2) //so far all multiple choice options are unanswered
{
//The number of questions not answered is equal to the number of questions
if ($_POST['move'] == " << prev ") {$_SESSION['step'] = $_POST['thisstep'];}
if ($_POST['move'] == " next >> ") {$_SESSION['step'] = $_POST['thisstep'];}
if ($_POST['move'] == " last ") {$_SESSION['step'] = $_POST['thisstep']; $_POST['move'] == " next >> ";}
if ($_POST['move'] == " << "._PREV." ") {$_SESSION['step'] = $_POST['thisstep'];}
if ($_POST['move'] == " "._NEXT." >> ") {$_SESSION['step'] = $_POST['thisstep'];}
if ($_POST['move'] == " "._LAST." ") {$_SESSION['step'] = $_POST['thisstep']; $_POST['move'] == " "._NEXT." >> ";}
$notanswered[]=substr($multiname, 5, strlen($multiname));
}
}
}

//SUBMIT
if ($_POST['move'] == " submit ")
if ($_POST['move'] == " "._SUBMIT." ")
{
foreach(file("$thistpl/startpage.pstpl") as $op)
{
Expand Down Expand Up @@ -207,29 +207,27 @@
}
else
{
echo "<br /><center><font face='verdana' size='2'><font color='red'><b>Error:</b></font><br /><br />\n";
echo "Cannot submit results - there are none to submit.<br /><br />\n";
echo "<font size='1'>This error can occur if you have already submitted your responses<br />\n";
echo "and pressed 'refresh' on your browser. In this case, your responses have<br />\n";
echo "already been saved.";
echo "<br /><center><font face='verdana' size='2'><font color='red'><b>"._ERROR."</b></font><br /><br />\n";
echo _BADSUBMIT1."<br /><br />\n";
echo "<font size='1'>"._BADSUBMIT2."<br />\n";
echo "</font></center><br /><br />";
exit;
}
//COMMIT CHANGES TO DATABASE
if ($surveyactive != "Y")
{
$completed = "<br /><b><font size='2' color='red'>Did Not Save!</b></font><br /><br />\n\n";
$completed .= "Your survey responses have not been recorded. This survey is not yet active.<br /><br />\n";
$completed .= "<a href='$PHP_SELF?sid=$sid&move=clearall'>Clear responses</a><br /><br />\n";
$completed = "<br /><b><font size='2' color='red'>"._DIDNOTSAVE."</b></font><br /><br />\n\n";
$completed .= _NOTACTIVE1."<br /><br />\n";
$completed .= "<a href='$PHP_SELF?sid=$sid&move=clearall'>"._CLEARRESP."</a><br /><br />\n";
$completed .= "<font size='1'>$subquery</font>\n";
}
else
{
if (mysql_query($subquery))
{
$completed = "<br /><b><font size='2'><font color='green'>Thank you.</b></font><br /><br />\n\n";
$completed .= "Your survey responses have been recorded.<br />\n";
$completed .= "<a href='javascript:window.close()'>Close this window</a></font><br /><br />\n";
$completed = "<br /><b><font size='2'><font color='green'>"._THANKS."</b></font><br /><br />\n\n";
$completed .= _SURVEYREC."<br />\n";
$completed .= "<a href='javascript:window.close()'>"._CLOSEWIN."</a></font><br /><br />\n";
if ($_POST['token'])
{
$utquery = "UPDATE tokens_$sid SET completed='Y' WHERE token='{$_POST['token']}'";
Expand All @@ -241,7 +239,7 @@
$headers = "From: $surveyadminemail\r\n";
$headers .= "X-Mailer: $sitename Email Inviter";
$to = $cnfrow['email'];
$subject = "Confirmation: $surveyname Survey Completed";
$subject = _CONFIRMATION.": $surveyname "._SURVEYCPL;
$message="";
foreach (file("$thistpl/confirmationemail.pstpl") as $ce)
{
Expand Down Expand Up @@ -270,27 +268,26 @@
}
else
{
$completed = "<br /><b><font size='2' color='red'>Did Not Save!</b></font><br /><br />\n\n";
$completed .= "An unexpected error has occurred and your responses cannot be saved.<br /><br />\n";
$completed = "<br /><b><font size='2' color='red'>"._DIDNOTSAVE."</b></font><br /><br />\n\n";
$completed .= _DIDNOTSAVE2."<br /><br />\n";
if ($adminemail)
{
$completed .= "Your responses have not been lost and have been emailed to the survey administrator ";
$completed .= "and will be entered into our database at a later point.<br /><br />\n";
$email="An error occurred saving a response to survey id $sid\n\n";
$email .= "DATA TO BE ENTERED:\n";
$completed .= _DIDNOTSAVE3."<br /><br />\n";
$email=_DNSAVEEMAIL1." $sid\n\n";
$email .= DNSAVEEMAIL2.":\n";
foreach ($_SESSION['insertarray'] as $value)
{
$email .= "$value: {$_SESSION[$value]}\n";
}
$email .= "\nSQL CODE THAT FAILED:\n";
$email .= "\n"._DNSAVEEMAIL3.":\n";
$email .= "$subquery\n\n";
$email .= "ERROR MESSAGE:\n";
$email .= _DNSAVEEMAIL4.":\n";
$email .= mysql_error()."\n\n";
mail($surveyadminemail, "ERROR SAVING", $email);
mail($surveyadminemail, _DNSAVEEMAIL5, $email);
}
else
{
$completed .= "<a href='javascript:location.reload()'>Try to submit again</a><br /><br />\n";
$completed .= "<a href='javascript:location.reload()'>"._SUBMITAGAIN."</a><br /><br />\n";
}
}
}
Expand All @@ -309,7 +306,7 @@
}

//LAST PHASE
if ($_POST['move'] == " last " && !$notanswered)
if ($_POST['move'] == " "._LAST." " && !$notanswered)
{
//READ TEMPLATES, INSERT DATA AND PRESENT PAGE
if ($surveyprivate != "N")
Expand Down Expand Up @@ -365,7 +362,7 @@
echo templatereplace($op);
}
echo "\t<center><br />\n";
echo "\tSorry. There is no matching survey.<br />&nbsp;\n";
echo "\t"._SURVEYNOEXIST."<br />&nbsp;\n";
foreach(file("$thistpl/endpage.pstpl") as $op)
{
echo templatereplace($op);
Expand Down Expand Up @@ -396,17 +393,15 @@
echo templatereplace($op);
}
echo "\t<center><br />\n";
echo "\tThis survey titled <b>$surveyname</b> is a controlled survey. You need a valid\n";
echo "\ttoken to participate.<br /><br />\n";
echo "\tIf you have been issued with a token, please enter it in the box below and click\n";
echo "\tcontinue.<br />&nbsp;\n";
echo "\t"._NOTOKEN1."<br /><br />\n";
echo "\t"._NOTOKEN2."<br />&nbsp;\n";
echo "\t<table align='center'>";
echo "\t<form method='get' action='{$_SERVER['PHP_SELF']}'>\n";
echo "\t<input type='hidden' name='sid' value='$sid'>\n";
echo "\t\t<tr>\n";
echo "\t\t\t<td align='center' valign='middle'>\n";
echo "\t\t\tToken: <input class='text' type='text' name='token'>\n";
echo "\t\t\t<input class='submit' type='submit' value='Continue'>\n";
echo "\t\t\t"._TOKEN.": <input class='text' type='text' name='token'>\n";
echo "\t\t\t<input class='submit' type='submit' value='"._CONTINUE."'>\n";
echo "\t\t\t</td>\n";
echo "\t\t</tr>\n";
echo "\t</form>\n";
Expand Down Expand Up @@ -437,12 +432,10 @@
echo "\t".templatereplace($op);
}
echo "\t<center><br />\n";
echo "\tThis survey, titled <b>$surveyname</b>, is a controlled survey. You need a valid\n";
echo "\ttoken to participate.<br /><br />\n";
echo "\tThe token you have provided is either not valid, or has already been used. Please\n";
echo "\tcontact $surveyadminname at <a href='mailto:$surveyadminemail'>$surveyadminemail</a>\n";
echo "\tfor more information.<br /><br />\n";
echo "\t<a href='javascript:window.close()'>Close this window</a><br />&nbsp;\n";
echo "\t"._NOTOKEN1."<br /><br />\n";
echo "\t"._NOTOKEN3."\n";
echo "\t"._FURTHERINFO." $surveyadminname (<a href='mailto:$surveyadminemail'>$surveyadminemail</a>)<br /><br />\n";
echo "\t<a href='javascript:window.close()'>"._CLOSEWIN."</a><br />&nbsp;\n";
foreach(file("$thistpl/endpage.pstpl") as $op)
{
echo templatereplace($op);
Expand Down Expand Up @@ -478,11 +471,9 @@
echo "\t".templatereplace($op);
}
echo "\t<center><br />\n";
echo "\tThis survey, titled <b>$surveyname</b>, does not yet have any questions and cannot\n";
echo "\tbe tested or completed.<br /><br />\n";
echo "\tContact $surveyadminname at <a href='mailto:$surveyadminemail'>$surveyadminemail</a>\n";
echo "\tfor more information.<br /><br />\n";
echo "\t<a href='javascript:window.close()'>Close this window</a><br />&nbsp;\n";
echo "\t"._NOQUESTIONS."<br /><br />\n";
echo "\t"._FURTHERINFO." $surveyadminname (<a href='mailto:$surveyadminemail'>$surveyadminemail</a>)<br /><br />\n";
echo "\t<a href='javascript:window.close()'>"._CLOSEWIN."</a><br />&nbsp;\n";
foreach(file("$thistpl/endpage.pstpl") as $op)
{
echo templatereplace($op);
Expand Down Expand Up @@ -584,7 +575,7 @@
}
if ($surveyactive != "Y")
{
echo "\t\t<center><font color='red' size='2'>This survey is not currently active. You will not be able to save your responses.</font></center>\n";
echo "\t\t<center><font color='red' size='2'>"._NOTACTIVE."</font></center>\n";
}
foreach(file("$thistpl/endpage.pstpl") as $op)
{
Expand Down Expand Up @@ -752,7 +743,7 @@
}
echo "\n";

if ($surveyactive != "Y") {echo "\t\t<center><font color='red' size='2'>This survey is not currently active. You will not be able to save your responses.</font></center>\n";}
if ($surveyactive != "Y") {echo "\t\t<center><font color='red' size='2'>"._NOTACTIVE."</font></center>\n";}
foreach(file("$thistpl/endpage.pstpl") as $op)
{
echo templatereplace($op);
Expand Down Expand Up @@ -800,15 +791,15 @@ function surveymover()
{
global $sid;
if ($_SESSION['step'] > 0)
{$surveymover .= "<input class='submit' type='submit' value=' << prev ' name='move' />\n";}
{$surveymover .= "<input class='submit' type='submit' value=' << "._PREV." ' name='move' />\n";}
if ($_SESSION['step'] && (!$_SESSION['totalsteps'] || ($_SESSION['step'] < $_SESSION['totalsteps'])))
{$surveymover .= "\t\t\t\t\t<input class='submit' type='submit' value=' next >> ' name='move' />\n";}
{$surveymover .= "\t\t\t\t\t<input class='submit' type='submit' value=' "._NEXT." >> ' name='move' />\n";}
if (!$_SESSION['step'])
{$surveymover .= "\t\t\t\t\t<input class='submit' type='submit' value=' next >> ' name='move' />\n";}
{$surveymover .= "\t\t\t\t\t<input class='submit' type='submit' value=' "._NEXT." >> ' name='move' />\n";}
if ($_SESSION['step'] && ($_SESSION['step'] == $_SESSION['totalsteps']) && $presentinggroupdescription == "yes")
{$surveymover .= "\t\t\t\t\t<input class='submit' type='submit' value=' next >> ' name='move' />\n";}
{$surveymover .= "\t\t\t\t\t<input class='submit' type='submit' value=' "._NEXT." >> ' name='move' />\n";}
if ($_SESSION['step'] && ($_SESSION['step'] == $_SESSION['totalsteps']) && !$presentinggroupdescription)
{$surveymover .= "\t\t\t\t\t<input class='submit' type='submit' value=' last ' name='move' />\n";}
{$surveymover .= "\t\t\t\t\t<input class='submit' type='submit' value=' "._LAST." ' name='move' />\n";}
return $surveymover;
}

Expand Down

0 comments on commit 6dbcafa

Please sign in to comment.