From 546fd178f726bb2005380d7298c8f9b9808bf068 Mon Sep 17 00:00:00 2001 From: Adam Zammit Date: Wed, 20 Feb 2013 16:34:44 +1100 Subject: [PATCH] Allow for modification of respondent self completion of active questionnaire --- admin/questionnairelist.php | 44 +++++++++++++++++++++++++++++++++---- 1 file changed, 40 insertions(+), 4 deletions(-) diff --git a/admin/questionnairelist.php b/admin/questionnairelist.php index f90ebdd4..2ef8c271 100644 --- a/admin/questionnairelist.php +++ b/admin/questionnairelist.php @@ -86,9 +86,22 @@ if (isset($_POST['update']) && isset($_GET['modify'])) $ras =0; $rws = 0; $rs = 0; + $respsc = 0; if (isset($_POST['ras'])) $ras = 1; if (isset($_POST['rws'])) $rws = 1; + if (isset($_POST['respsc'])) $respsc = 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(html_entity_decode($_POST['description'])); if (isset($_POST['rs_intro'])) { @@ -102,7 +115,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' + SET description = $name, info = $info, rs_project_end = $rs_project_end, restrict_appointments_shifts = '$ras', restrict_work_shifts = '$rws', lime_mode = $lime_mode, lime_template = $lime_template, lime_endurl = $lime_endurl WHERE questionnaire_id = '$questionnaire_id'"; $db->Execute($sql); @@ -119,7 +132,7 @@ if (isset($_POST['update']) && isset($_GET['modify'])) } -xhtml_head(T_("Questionnaire list"),true,array("../css/table.css")); +xhtml_head(T_("Questionnaire list"),true,array("../css/table.css"),array("../js/new.js")); if (isset($_GET['modify'])) @@ -150,11 +163,17 @@ if (isset($_GET['modify'])) $rs = $db->GetRow($sql); - $testing = $rws = $ras = "checked=\"checked\""; - + $testing = $rws = $ras = $rsc = "checked=\"checked\""; + $rscd = ""; + if ($rs['restrict_appointments_shifts'] != 1) $ras = ""; if ($rs['restrict_work_shifts'] != 1) $rws = ""; if ($rs['testing'] != 1) $testing = ""; + if (empty($rs['lime_mode'])) + { + $rsc = ""; + $rscd = "style='display:none;'"; + } echo "

" . $rs['description'] . "

"; echo "

" . T_("Go back") . "

"; @@ -165,6 +184,23 @@ if (isset($_GET['modify']))

/>

/>

/>

+

onchange="if(this.checked==true) show(this,'limesc'); else hide(this,'limesc');" />

+
> +

:

+

:

+

:

+

editor("rs_intro",$rs['rs_intro'],$ckeditorConfig);?>

editor("rs_project_intro",$rs['rs_project_intro'],$ckeditorConfig);?>