2
0
mirror of https://github.com/ACSPRI/queXS synced 2024-04-02 12:12:16 +00:00

Automatically create tokens table when activating (as is required by queXS)

This commit is contained in:
azammitdcarf
2012-05-01 00:39:11 +00:00
parent 7af9984693
commit 04bbeb6c0b
3 changed files with 13 additions and 6 deletions

View File

@@ -80,5 +80,11 @@ if (!isset($_POST['ok']) || !$_POST['ok'])
else
{
$activateoutput = activateSurvey($postsid,$surveyid);
//also activate tokens queXS addition
if(bHasSurveyPermission($surveyid,'tokens','read'))
{
$_POST['createtable'] = 'Y';
$_SESSION['FileManagerContext']="edit:emailsettings:$surveyid";
include('tokens.php');
}
}

View File

@@ -473,9 +473,10 @@ function activateSurvey($postsid,$surveyid, $scriptname='admin.php')
else
{
$activateoutput .= $clang->gT("This survey is now active, and responses can be recorded.")."<br /><br />\n";
$activateoutput .= "<strong>".$clang->gT("Open-access mode").":</strong> ".$clang->gT("No invitation code is needed to complete the survey.")."<br />".$clang->gT("You can switch to the closed-access mode by initialising a token table with the button below.")."<br /><br />\n";
$activateoutput .= "<input type='submit' value='".$clang->gT("Switch to closed-access mode")."' onclick=\"".get2post("$scriptname?action=tokens&amp;sid={$postsid}&amp;createtable=Y")."\" />\n";
$activateoutput .= "<input type='submit' value='".$clang->gT("No, thanks.")."' onclick=\"".get2post("$scriptname?sid={$postsid}")."\" />\n";
//queXS removal
// $activateoutput .= "<strong>".$clang->gT("Open-access mode").":</strong> ".$clang->gT("No invitation code is needed to complete the survey.")."<br />".$clang->gT("You can switch to the closed-access mode by initialising a token table with the button below.")."<br /><br />\n";
// $activateoutput .= "<input type='submit' value='".$clang->gT("Switch to closed-access mode")."' onclick=\"".get2post("$scriptname?action=tokens&amp;sid={$postsid}&amp;createtable=Y")."\" />\n";
// $activateoutput .= "<input type='submit' value='".$clang->gT("No, thanks.")."' onclick=\"".get2post("$scriptname?sid={$postsid}")."\" />\n";
}
$activateoutput .= "</div><br />&nbsp;\n";
$lsrcOutput = true;

View File

@@ -494,7 +494,7 @@ if (!$tokenexists) //If no tokens table exists
$tokenoutput .= "\t</div><p>\n"
.$clang->gT("A token table has been created for this survey.")." (\"".$dbprefix."tokens_$surveyid\")<br /><br />\n"
."<input type='submit' value='"
.$clang->gT("Continue")."' onclick=\"window.open('$scriptname?action=tokens&amp;sid=$surveyid', '_self')\" />\n";
.$clang->gT("Continue")."' onclick=\"window.open('$scriptname?sid=$surveyid', '_self')\" />\n";
}
return;
}
@@ -3286,4 +3286,4 @@ function getLine($file)
return $buffer;
}
?>
?>