From afdebbc94dac3ac6bb1148a3838d465bf3f6e85e Mon Sep 17 00:00:00 2001 From: Adam Zammit Date: Fri, 8 Mar 2013 15:09:42 +1100 Subject: [PATCH 1/2] Allow for sample name to be edited --- admin/samplelist.php | 47 ++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 45 insertions(+), 2 deletions(-) diff --git a/admin/samplelist.php b/admin/samplelist.php index 890fb0bf..3cfe3266 100644 --- a/admin/samplelist.php +++ b/admin/samplelist.php @@ -44,6 +44,21 @@ include_once(dirname(__FILE__).'/../db.inc.php'); */ include_once(dirname(__FILE__).'/../functions/functions.xhtml.php'); + + +if (isset($_POST['submitr'])) +{ + $sample_import_id = intval($_POST['sample_import_id']); + + $sql = "UPDATE sample_import + SET description = " . $db->qstr($_POST['description']) . " + WHERE sample_import_id = $sample_import_id"; + + $db->Execute($sql); + + $_GET['rename'] = $sample_import_id; +} + if (isset($_POST['submit'])) { $sample_import_id = intval($_POST['sample_import_id']); @@ -67,6 +82,33 @@ if (isset($_POST['submit'])) $_GET['edit'] = $sample_import_id; } +if (isset($_GET['rename'])) +{ + xhtml_head(T_("Rename"),true,array("../css/table.css")); + + $sample_import_id = intval($_GET['rename']); + + $sql = "SELECT description + FROM sample_import + WHERE sample_import_id = $sample_import_id"; + + $rs = $db->GetOne($sql); + + print "

" . T_("Rename") . ": " . $rs. "

"; + echo "

" . T_("Go back") . "

"; + + ?> +
+
+
+
"/>
+
+ " . T_("Deidentify") . "') as did, + CONCAT('" . T_("Rename") . "') as rname, description FROM sample_import"; @@ -144,8 +187,8 @@ $rs = $db->GetAll($sql); xhtml_head(T_("Sample list"),true,array("../css/table.css")); -$columns = array("description","enabledisable","did"); -$titles = array(T_("Sample"),T_("Enable/Disable"),T_("Deidentify")); +$columns = array("description","enabledisable","did","rname"); +$titles = array(T_("Sample"),T_("Enable/Disable"),T_("Deidentify"),T_("Rename")); xhtml_table($rs,$columns,$titles); From 17dcb4928b287e12ce6a2430292781827db4fac2 Mon Sep 17 00:00:00 2001 From: Adam Zammit Date: Fri, 8 Mar 2013 15:29:13 +1100 Subject: [PATCH 2/2] Don't refer to files outside the tree if not used by an interviewer --- include/limesurvey/common_functions.php | 26 +++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/include/limesurvey/common_functions.php b/include/limesurvey/common_functions.php index 2bf25636..ac99a223 100644 --- a/include/limesurvey/common_functions.php +++ b/include/limesurvey/common_functions.php @@ -4227,13 +4227,27 @@ function getHeader($meta = false) $js_header_includes = array_unique($js_header_includes); $css_header_includes = array_unique($css_header_includes); - $js_header_includes[] = '/../../js/popup.js'; //queXS Addition - include_once("quexs.php"); - if (AUTO_LOGOUT_MINUTES !== false) - { - $js_header_includes[] = $rooturl . "/../../js/childnap.js"; //queXS Addition - } + $interviewer=returnglobal('interviewer'); + if (!empty($interviewer) || (isset($_SESSION['interviewer']) && $_SESSION['interviewer'] == true)) + { + $interviewer = true; + $_SESSION['interviewer'] = true; + } + else + { + $interviewer = false; + } + if ($interviewer) + { + $js_header_includes[] = '/../../js/popup.js'; //queXS Addition + include_once("quexs.php"); + if (AUTO_LOGOUT_MINUTES !== false) + { + $js_header_includes[] = $rooturl . "/../../js/childnap.js"; //queXS Addition + } + } + if (isset($_SESSION['s_lang']) && $_SESSION['s_lang']) { $surveylanguage= $_SESSION['s_lang'];