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

Added respondent self completion details to new questionnaire's (need to add to modify)

This commit is contained in:
Adam Zammit
2013-01-30 16:24:26 +11:00
parent 01cd69c0fc
commit bc56e10311

View File

@@ -68,12 +68,25 @@ if (isset($_POST['import_file']))
$testing = 0;
$rs = 0;
$lime_sid = 0;
$respsc = 0;
$lime_rs_sid = "NULL";
if (isset($_POST['ras'])) $ras = 1;
if (isset($_POST['rws'])) $rws = 1;
if (isset($_POST['testing'])) $testing = 1;
if (isset($_POST['respsc'])) $respsc = 1;
if ($_POST['selectrs'] != "none") $rs = 1;
$lime_mode = "NULL";
$lime_template = "NULL";
$lime_endurl = "NULL";
if ($respsc == 1)
{
$lime_mode = $db->qstr($_POST['lime_mode'],get_magic_quotes_gpc());
$lime_template = $db->qstr($_POST['lime_template'],get_magic_quotes_gpc());
$lime_endurl = $db->qstr($_POST['lime_endurl'],get_magic_quotes_gpc());
}
$name = $db->qstr($_POST['description'],get_magic_quotes_gpc());
$rs_intro = $db->qstr(html_entity_decode($_POST['rs_intro'],get_magic_quotes_gpc()));
$rs_project_intro = $db->qstr(html_entity_decode($_POST['rs_project_intro'],get_magic_quotes_gpc()));
@@ -91,8 +104,8 @@ if (isset($_POST['import_file']))
$lime_rs_sid = bigintval($_POST['selectrs']);
}
$sql = "INSERT INTO questionnaire (questionnaire_id,description,lime_sid,restrict_appointments_shifts,restrict_work_shifts,respondent_selection,rs_intro,rs_project_intro,rs_project_end,rs_callback,rs_answeringmachine,testing,lime_rs_sid,info)
VALUES (NULL,$name,'$lime_sid','$ras','$rws','$rs',$rs_intro,$rs_project_intro,$rs_project_end,$rs_callback,$rs_answeringmachine,'$testing',$lime_rs_sid,$info)";
$sql = "INSERT INTO questionnaire (questionnaire_id,description,lime_sid,restrict_appointments_shifts,restrict_work_shifts,respondent_selection,rs_intro,rs_project_intro,rs_project_end,rs_callback,rs_answeringmachine,testing,lime_rs_sid,info,lime_mode,lime_template,lime_endurl)
VALUES (NULL,$name,'$lime_sid','$ras','$rws','$rs',$rs_intro,$rs_project_intro,$rs_project_end,$rs_callback,$rs_answeringmachine,'$testing',$lime_rs_sid,$info,$lime_mode,$lime_template,$lime_endurl)";
$rs = $db->Execute($sql);
@@ -179,6 +192,23 @@ $ckeditorConfig = array("toolbar" => array(array("tokens","-","Source"),
<p><?php echo T_("Restrict appointments to shifts?"); ?> <input name="ras" type="checkbox" checked="checked"/></p>
<p><?php echo T_("Restrict work to shifts?"); ?> <input name="rws" type="checkbox" checked="checked"/></p>
<p><?php echo T_("Questionnaire for testing only?"); ?> <input name="testing" type="checkbox"/></p>
<p><?php echo T_("Allow for respondent self completion via email invitation?"); ?> <input name="respsc" type="checkbox" onchange="if(this.checked==true) show(this,'limesc'); else hide(this,'limesc');" /></p>
<div id='limesc' style='display:none;'>
<p><?php echo T_("Questionnaire display mode for respondent");?>: <select name="lime_mode"><option value="survey"><?php echo T_("All in one"); ?></option><option value="question"><?php echo T_("Question by question"); ?></option><option value="group"><?php echo T_("Group at a time"); ?></option></select></p>
<p><?php echo T_("Limesurvey template for respondent");?>: <select name="lime_template">
<?php
if ($handle = opendir(dirname(__FILE__)."/../include/limesurvey/templates")) {
while (false !== ($entry = readdir($handle))) {
if ($entry != "." && $entry != ".." && is_dir(dirname(__FILE__)."/../include/limesurvey/templates/" . $entry)){
echo "<option value=\"$entry\">$entry</option>";
}
}
closedir($handle);
}
?>
</select></p>
<p><?php echo T_("URL to forward respondents on self completion");?>: <input name="lime_endurl" type="text" value="http://www.acspri.org.au/"/></p>
</div>
<div id='rstext' style='display:none;'>
<p><?php echo T_("Respondent selection introduction:"); echo $CKEditor->editor("rs_intro","",$ckeditorConfig);?></p>
<p><?php echo T_("Respondent selection project introduction:"); echo $CKEditor->editor("rs_project_intro","",$ckeditorConfig);?></p>