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

Added referral function (requires addition to database)

This commit is contained in:
root
2013-09-11 15:02:59 +10:00
parent d23409f110
commit 98f246dd03
6 changed files with 280 additions and 8 deletions

View File

@@ -66,6 +66,7 @@ if (isset($_POST['import_file']))
$ras =0;
$rws = 0;
$testing = 0;
$referral = 0;
$rs = 0;
$lime_sid = 0;
$respsc = 0;
@@ -74,6 +75,7 @@ if (isset($_POST['import_file']))
if (isset($_POST['rws'])) $rws = 1;
if (isset($_POST['testing'])) $testing = 1;
if (isset($_POST['respsc'])) $respsc = 1;
if (isset($_POST['referral'])) $respsc = 1;
if ($_POST['selectrs'] != "none") $rs = 1;
$name = $db->qstr($_POST['description'],get_magic_quotes_gpc());
@@ -93,8 +95,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,self_complete)
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,$respsc)";
$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,self_complete,referral)
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,$respsc,$referral)";
$rs = $db->Execute($sql);
@@ -193,6 +195,7 @@ $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 operators to generate referrals?"); ?> <input name="referral" 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>

View File

@@ -225,9 +225,11 @@ if (isset($_POST['update']) && isset($_GET['modify']))
$rws = 0;
$rs = 0;
$respsc = 0;
$referral = 0;
if (isset($_POST['ras'])) $ras = 1;
if (isset($_POST['rws'])) $rws = 1;
if (isset($_POST['respsc'])) $respsc = 1;
if (isset($_POST['referral'])) $referral = 1;
$name = $db->qstr(html_entity_decode($_POST['description']));
if (isset($_POST['rs_intro']))
@@ -242,7 +244,7 @@ if (isset($_POST['update']) && isset($_GET['modify']))
$rs_project_end = $db->qstr(html_entity_decode($_POST['rs_project_end'],true));
$sql = "UPDATE questionnaire
SET description = $name, info = $info, rs_project_end = $rs_project_end, restrict_appointments_shifts = '$ras', restrict_work_shifts = '$rws', self_complete = $respsc
SET description = $name, info = $info, rs_project_end = $rs_project_end, restrict_appointments_shifts = '$ras', restrict_work_shifts = '$rws', self_complete = $respsc, referral = $referral
WHERE questionnaire_id = '$questionnaire_id'";
$db->Execute($sql);
@@ -302,7 +304,7 @@ if (isset($_GET['modify']))
$rs = $db->GetRow($sql);
$testing = $rws = $ras = $rsc = "checked=\"checked\"";
$referral = $testing = $rws = $ras = $rsc = "checked=\"checked\"";
$rscd = "";
$aio = $qbq = $gat = "";
@@ -314,6 +316,7 @@ if (isset($_GET['modify']))
if ($rs['restrict_appointments_shifts'] != 1) $ras = "";
if ($rs['restrict_work_shifts'] != 1) $rws = "";
if ($rs['testing'] != 1) $testing = "";
if ($rs['referral'] != 1) $referral = "";
if ($rs['self_complete'] == 0)
{
$rsc = "";
@@ -329,6 +332,7 @@ if (isset($_GET['modify']))
<p><?php echo T_("Restrict appointments to shifts?"); ?> <input name="ras" type="checkbox" <?php echo $ras; ?>/></p>
<p><?php echo T_("Restrict work to shifts?"); ?> <input name="rws" type="checkbox" <?php echo $rws; ?>/></p>
<p><?php echo T_("Questionnaire for testing only?"); ?> <input name="testing" type="checkbox" disabled="true" <?php echo $testing; ?>/></p>
<p><?php echo T_("Allow operators to generate referrals?"); ?> <input name="referral" type="checkbox" <?php echo $referral; ?>/></p>
<p><?php echo T_("Allow for respondent self completion via email invitation?"); ?> <input name="respsc" type="checkbox" <?php echo $rsc ?> onchange="if(this.checked==true) show(this,'limesc'); else hide(this,'limesc');" /></p>
<div id='limesc' <?php echo $rscd; ?>>
<p><?php echo T_("Questionnaire display mode for respondent");?>: <select name="lime_mode"><option <?php echo $aio;?> value="survey"><?php echo T_("All in one"); ?></option><option <?php echo $qbq; ?> value="question"><?php echo T_("Question by question"); ?></option><option <?php echo $gat; ?> value="group"><?php echo T_("Group at a time"); ?></option></select></p>