"; */
$i++;
}
@@ -380,32 +380,72 @@ function edit($surveyid,$gid)
}
- /**
- * questiongroup::organize()
- * Load ordering of question group screen.
- * @return
- */
- function organize($surveyid)
+ /**
+ * questiongroup::organize()
+ * Load ordering of question group screen.
+ * @return
+ */
+ function organize($iSurveyID)
{
- $surveyid= (int)$surveyid;
- $this->load->model('groups_model');
- $aGrouplist=$this->groups_model->getGroups($surveyid);
- foreach($aGrouplist as $aGroup)
- {
+ $iSurveyID= (int)$iSurveyID;
+ $this->load->model('groups_model');
+ $this->load->model('questions_model');
+
+ if ($this->input->post('orgdata') && bHasSurveyPermission($iSurveyID,'surveycontent','update'))
+ {
+ $AOrgData=array();
+ parse_str($this->input->post('orgdata'),$AOrgData);
+ $grouporder=0;
+ foreach($AOrgData['list'] as $ID=>$parent)
+ {
+ if ($parent=='root' && $ID[0]=='g'){
+ $this->groups_model->update(array('group_order'=>$grouporder),array('gid'=>(int)substr($ID,1)));
+ $grouporder++;
+ }
+ elseif ($ID[0]=='q')
+ {
+ if (!isset($questionorder[(int)substr($parent,1)])) $questionorder[(int)substr($parent,1)]=0;
+ $this->questions_model->update(array('question_order'=>$questionorder[(int)substr($parent,1)],'gid'=>(int)substr($parent,1)),array('qid'=>(int)substr($ID,1)));
+ $this->questions_model->update(array('gid'=>(int)substr($parent,1)),array('parent_qid'=>(int)substr($ID,1)));
+ $questionorder[(int)substr($parent,1)]++;
+ }
+ }
+ $this->session->set_userdata('flashmessage', $this->limesurvey_lang->gT("The new question group/question order was successfully saved."));
+ redirect('admin/survey/view/'.$iSurveyID);
+ }
+ $sBaseLanguage=GetBaseLanguageFromSurveyID($iSurveyID);
+ self::_js_admin_includes(base_url().'scripts/jquery/jquery.ui.nestedSortable.js');
+ self::_js_admin_includes(base_url().'scripts/admin/organize.js');
- }
+ $aGrouplist=$this->groups_model->getGroups($iSurveyID);
+ foreach($aGrouplist as $iGID=>$aGroup)
+ {
+ $oQuestionData=$this->questions_model->getQuestions($iSurveyID,$aGroup['gid'],$sBaseLanguage);
+ $aGrouplist[$iGID]['questions']=$oQuestionData->result_array();
+ }
+ $aViewData['aGroupsAndQuestions']=$aGrouplist;
+ $aViewData['clang']=$this->limesurvey_lang;
+ $aViewData['surveyid']=$iSurveyID;
+ $css_admin_includes[] = $this->config->item('styleurl')."admin/default/superfish.css";
+ $this->config->set_item("css_admin_includes", $css_admin_includes);
+ self::_getAdminHeader();
+ self::_showadminmenu();
+ self::_surveybar($iSurveyID);
+ $this->load->view('admin/survey/organizeGroupsAndQuestions_view',$aViewData);
+ self::_loadEndScripts();
+ self::_getAdminFooter("http://docs.limesurvey.org", $this->limesurvey_lang->gT("LimeSurvey online manual"));
}
/**
- * questiongroup::order()
- * Load ordering of question group screen.
- * @return
- */
+ * questiongroup::order()
+ * Load ordering of question group screen.
+ * @return
+ */
function order($surveyid)
{
- $surveyid = sanitize_int($surveyid);
+ $surveyid = sanitize_int($surveyid);
$clang = $this->limesurvey_lang;
$css_admin_includes[] = $this->config->item('styleurl')."admin/default/superfish.css";
@@ -675,4 +715,4 @@ function order($surveyid)
- }
\ No newline at end of file
+}
\ No newline at end of file
diff --git a/application/controllers/admin/templates.php b/application/controllers/admin/templates.php
index b1d9f6b6dd8..ae0995378dd 100644
--- a/application/controllers/admin/templates.php
+++ b/application/controllers/admin/templates.php
@@ -430,6 +430,7 @@ function templaterename()
*/
function templatecopy()
{
+ $clang = $this->limesurvey_lang;
if ($this->input->post('action') == "templatecopy" && $this->input->post('newname') && $this->input->post('copydir')) {
//Copies all the files from one template directory to a new one
//This is a security issue because it is allowing copying from get variables...
diff --git a/application/helpers/replacements_helper.php b/application/helpers/replacements_helper.php
index 1fae9fe12a9..80ee9cb7aa8 100644
--- a/application/helpers/replacements_helper.php
+++ b/application/helpers/replacements_helper.php
@@ -1,18 +1,18 @@
=>
- * @param boolean $anonymized Determines if token data is being used or just replaced with blanks
- * @param questionNum - needed to support dynamic JavaScript-based tailoring within questions
- * @return string Text with replaced strings
- */
+* This function replaces keywords in a text and is mainly intended for templates
+* If you use this functions put your replacement strings into the $replacements variable
+* instead of using global variables
+* NOTE - Don't do any embedded replacements in this function. Create the array of replacement values and
+* they will be done in batch at the end
+*
+* @param mixed $line Text to search in
+* @param mixed $replacements Array of replacements: Array( =>
+* @param boolean $anonymized Determines if token data is being used or just replaced with blanks
+* @param questionNum - needed to support dynamic JavaScript-based tailoring within questions
+* @return string Text with replaced strings
+*/
function templatereplace($line, $replacements=array(),&$redata=array(), $debugSrc='Unspecified', $anonymized=false, $questionNum=NULL)
{
$CI =& get_instance();
@@ -21,60 +21,60 @@ function templatereplace($line, $replacements=array(),&$redata=array(), $debugSr
global $clienttoken,$token,$sitename,$move,$showXquestions,$showqnumcode,$questioncode,$register_errormsg;
global $s_lang,$errormsg,$saved_id, $totalBoilerplatequestions, $relativeurl, $languagechanger,$captchapath,$loadname;
*/
- /*
- $allowedvars = array('surveylist', 'sitename', 'clienttoken', 'rooturl', 'thissurvey', 'imageurl', 'defaulttemplate',
- 'percentcomplete', 'move', 'groupname', 'groupdescription', 'question', 'showXquestions',
- 'showgroupinfo', 'showqnumcode', 'questioncode', 'answer', 'navigator', 'help', 'totalquestions',
- 'surveyformat', 'completed', 'register_errormsg', 'notanswered', 'privacy', 'surveyid', 'publicurl',
- 'templatedir', 'token', 'assessments', 's_lang', 'errormsg', 'clang', 'saved_id', 'usertemplaterootdir',
- 'totalBoilerplatequestions', 'relativeurl', 'languagechanger', 'printoutput', 'captchapath', 'loadname');
+ /*
+ $allowedvars = array('surveylist', 'sitename', 'clienttoken', 'rooturl', 'thissurvey', 'imageurl', 'defaulttemplate',
+ 'percentcomplete', 'move', 'groupname', 'groupdescription', 'question', 'showXquestions',
+ 'showgroupinfo', 'showqnumcode', 'questioncode', 'answer', 'navigator', 'help', 'totalquestions',
+ 'surveyformat', 'completed', 'register_errormsg', 'notanswered', 'privacy', 'surveyid', 'publicurl',
+ 'templatedir', 'token', 'assessments', 's_lang', 'errormsg', 'clang', 'saved_id', 'usertemplaterootdir',
+ 'totalBoilerplatequestions', 'relativeurl', 'languagechanger', 'printoutput', 'captchapath', 'loadname');
*/
$allowedvars = array(
- 'answer',
- 'assessments',
- 'captchapath',
- 'clienttoken',
- 'completed',
- 'errormsg',
- 'groupdescription',
- 'groupname',
- 'help',
- 'imageurl',
- 'languagechanger',
- 'loadname',
- 'move',
- 'navigator',
- 'percentcomplete',
- 'privacy',
- 'question',
- 'register_errormsg',
- 'relativeurl',
- 's_lang',
- 'saved_id',
- 'showgroupinfo',
- 'showqnumcode',
- 'showXquestions',
- 'sitename',
- 'surveylist',
- 'templatedir',
- 'thissurvey',
- 'token',
- 'totalBoilerplatequestions',
- 'totalquestions',
+ 'answer',
+ 'assessments',
+ 'captchapath',
+ 'clienttoken',
+ 'completed',
+ 'errormsg',
+ 'groupdescription',
+ 'groupname',
+ 'help',
+ 'imageurl',
+ 'languagechanger',
+ 'loadname',
+ 'move',
+ 'navigator',
+ 'percentcomplete',
+ 'privacy',
+ 'question',
+ 'register_errormsg',
+ 'relativeurl',
+ 's_lang',
+ 'saved_id',
+ 'showgroupinfo',
+ 'showqnumcode',
+ 'showXquestions',
+ 'sitename',
+ 'surveylist',
+ 'templatedir',
+ 'thissurvey',
+ 'token',
+ 'totalBoilerplatequestions',
+ 'totalquestions',
);
$varsPassed = array();
- foreach($allowedvars as $var)
- {
- if(isset($redata[$var])) {
+ foreach($allowedvars as $var)
+ {
+ if(isset($redata[$var])) {
$$var = $redata[$var];
$varsPassed[] = $var;
}
- }
+ }
if (count($varsPassed) > 0) {
log_message('debug', 'templatereplace() called from ' . $debugSrc . ' contains: ' . implode(', ', $varsPassed));
}
-// extract($redata); // creates variables for each of the keys in the array
+ // extract($redata); // creates variables for each of the keys in the array
// Local over-rides in case not set above
if (!isset($showgroupinfo)) { $showgroupinfo = 'Y'; }
@@ -95,13 +95,13 @@ function templatereplace($line, $replacements=array(),&$redata=array(), $debugSr
$clang = $CI->limesurvey_lang;
$CI->load->helper('surveytranslator');
$questiondetails = array('sid' => 0, 'gid' => 0, 'qid' => 0, 'aid' =>0);
- if(isset($question) && isset($question['sgq'])) $questiondetails=getsidgidqidaidtype($question['sgq']); //Gets an array containing SID, GID, QID, AID and Question Type)
+ if(isset($question) && isset($question['sgq'])) $questiondetails=getsidgidqidaidtype($question['sgq']); //Gets an array containing SID, GID, QID, AID and Question Type)
if (isset($thissurvey['sid'])) {
$surveyid = $thissurvey['sid'];
}
- // lets sanitize the survey template
+ // lets sanitize the survey template
if(isset($thissurvey['templatedir']))
{
$templatename=$thissurvey['templatedir'];
@@ -111,13 +111,13 @@ function templatereplace($line, $replacements=array(),&$redata=array(), $debugSr
$templatename=$CI->config->item('defaulttemplate');
}
$templatename=validate_templatedir($templatename);
- if(!isset($templatedir)) $templatedir = sGetTemplatePath($templatename);
- if(!isset($templateurl)) $templateurl = sGetTemplateURL($templatename)."/";
+ if(!isset($templatedir)) $templatedir = sGetTemplatePath($templatename);
+ if(!isset($templateurl)) $templateurl = sGetTemplateURL($templatename)."/";
if (stripos ($line,""))
{
$line=str_ireplace("",
- "\n"
+ "\n"
.use_firebug()
."\t", $line);
}
@@ -162,11 +162,11 @@ function templatereplace($line, $replacements=array(),&$redata=array(), $debugSr
}
if (
- $showgroupinfo == 'both' ||
- $showgroupinfo == 'name' ||
- ($showgroupinfo == 'choose' && !isset($thissurvey['showgroupinfo'])) ||
- ($showgroupinfo == 'choose' && $thissurvey['showgroupinfo'] == 'B') ||
- ($showgroupinfo == 'choose' && $thissurvey['showgroupinfo'] == 'N')
+ $showgroupinfo == 'both' ||
+ $showgroupinfo == 'name' ||
+ ($showgroupinfo == 'choose' && !isset($thissurvey['showgroupinfo'])) ||
+ ($showgroupinfo == 'choose' && $thissurvey['showgroupinfo'] == 'B') ||
+ ($showgroupinfo == 'choose' && $thissurvey['showgroupinfo'] == 'N')
)
{
$_groupname = isset($groupname) ? $groupname : '';
@@ -176,11 +176,11 @@ function templatereplace($line, $replacements=array(),&$redata=array(), $debugSr
$_groupname = '';
};
if (
- $showgroupinfo == 'both' ||
- $showgroupinfo == 'description' ||
- ($showgroupinfo == 'choose' && !isset($thissurvey['showgroupinfo'])) ||
- ($showgroupinfo == 'choose' && $thissurvey['showgroupinfo'] == 'B') ||
- ($showgroupinfo == 'choose' && $thissurvey['showgroupinfo'] == 'D')
+ $showgroupinfo == 'both' ||
+ $showgroupinfo == 'description' ||
+ ($showgroupinfo == 'choose' && !isset($thissurvey['showgroupinfo'])) ||
+ ($showgroupinfo == 'choose' && $thissurvey['showgroupinfo'] == 'B') ||
+ ($showgroupinfo == 'choose' && $thissurvey['showgroupinfo'] == 'D')
)
{
$_groupdescription = isset($groupdescription) ? $groupdescription : '';
@@ -222,11 +222,11 @@ function templatereplace($line, $replacements=array(),&$redata=array(), $debugSr
};
if (
- $showqnumcode == 'both' ||
- $showqnumcode == 'number' ||
- ($showqnumcode == 'choose' && !isset($thissurvey['showqnumcode'])) ||
- ($showqnumcode == 'choose' && $thissurvey['showqnumcode'] == 'B') ||
- ($showqnumcode == 'choose' && $thissurvey['showqnumcode'] == 'N')
+ $showqnumcode == 'both' ||
+ $showqnumcode == 'number' ||
+ ($showqnumcode == 'choose' && !isset($thissurvey['showqnumcode'])) ||
+ ($showqnumcode == 'choose' && $thissurvey['showqnumcode'] == 'B') ||
+ ($showqnumcode == 'choose' && $thissurvey['showqnumcode'] == 'N')
)
{
$_question_number = $question['number'];
@@ -236,11 +236,11 @@ function templatereplace($line, $replacements=array(),&$redata=array(), $debugSr
$_question_number = '';
};
if (
- $showqnumcode == 'both' ||
- $showqnumcode == 'code' ||
- ($showqnumcode == 'choose' && !isset($thissurvey['showqnumcode'])) ||
- ($showqnumcode == 'choose' && $thissurvey['showqnumcode'] == 'B') ||
- ($showqnumcode == 'choose' && $thissurvey['showqnumcode'] == 'C')
+ $showqnumcode == 'both' ||
+ $showqnumcode == 'code' ||
+ ($showqnumcode == 'choose' && !isset($thissurvey['showqnumcode'])) ||
+ ($showqnumcode == 'choose' && $thissurvey['showqnumcode'] == 'B') ||
+ ($showqnumcode == 'choose' && $thissurvey['showqnumcode'] == 'C')
)
{
$_question_code = $question['code'];
@@ -253,9 +253,9 @@ function templatereplace($line, $replacements=array(),&$redata=array(), $debugSr
if(!isset($totalquestions)) $totalquestions = 0;
$_totalquestionsAsked = $totalquestions - $totalBoilerplatequestions;
if (
- $showXquestions == 'show' ||
- ($showXquestions == 'choose' && !isset($thissurvey['showXquestions'])) ||
- ($showXquestions == 'choose' && $thissurvey['showXquestions'] == 'Y')
+ $showXquestions == 'show' ||
+ ($showXquestions == 'choose' && !isset($thissurvey['showXquestions'])) ||
+ ($showXquestions == 'choose' && $thissurvey['showXquestions'] == 'Y')
)
{
if ($_totalquestionsAsked < 1)
@@ -269,7 +269,7 @@ function templatereplace($line, $replacements=array(),&$redata=array(), $debugSr
else
{
$_therearexquestions = $clang->gT("There are {NUMBEROFQUESTIONS} questions in this survey."); //Note this line MUST be before {NUMBEROFQUESTIONS}
- };
+ };
}
else
{
@@ -315,7 +315,7 @@ function templatereplace($line, $replacements=array(),&$redata=array(), $debugSr
else
{
$_linkreplace = "{$thissurvey['surveyls_url']}";
- }
+ }
}
else
{
@@ -324,7 +324,7 @@ function templatereplace($line, $replacements=array(),&$redata=array(), $debugSr
if (isset($surveyid)) {
$_clearall = "gT("Are you sure you want to clear all your responses?", 'js') . "')) {\nwindow.open('".$CI->config->item('publicurl')."/index.php?sid=$surveyid&move=clearall&lang=" . $s_lang;
+ . "onclick=\"if (confirm('" . $clang->gT("Are you sure you want to clear all your responses?", 'js') . "')) {\nwindow.open('".$CI->config->item('publicurl')."/index.php?sid=$surveyid&move=clearall&lang=" . $s_lang;
if (returnglobal('token'))
{
$_clearall .= "&token=" . urlencode(trim(sanitize_token(strip_tags(returnglobal('token')))));
@@ -353,12 +353,12 @@ function templatereplace($line, $replacements=array(),&$redata=array(), $debugSr
if ($thissurvey['tokenanswerspersistence'] != 'Y')
{
$_saveall = "\t\t\t"
- . "\n\t\t\t"; // Show Save So Far button
+ . "\n\t\t\t"; // Show Save So Far button
}
else
{
$_saveall = "\t\t\t"; // Show Save So Far button
- };
+ };
}
elseif (!isset($_SESSION['step']) || !$_SESSION['step'])
{ //First page, show LOAD
@@ -377,12 +377,12 @@ function templatereplace($line, $replacements=array(),&$redata=array(), $debugSr
}
else
{
- $_saveall = ""; // Show Save So Far button
+ $_saveall = ""; // Show Save So Far button
}
}
else
{
- $_saveall = "";
+ $_saveall = "";
}
$_templatecss = "\n";
@@ -391,7 +391,7 @@ function templatereplace($line, $replacements=array(),&$redata=array(), $debugSr
$_templatecss.="\n";
}
- if(!isset($help)) $help = "";
+ if(!isset($help)) $help = "";
if (FlattenText($help, true) != '')
{
if (!isset($helpicon))
@@ -432,13 +432,13 @@ function templatereplace($line, $replacements=array(),&$redata=array(), $debugSr
$_restart.="'>".$clang->gT("Restart this Survey")."";
}
else if (isset($surveyid))
- {
- $restart_extra = "";
- $restart_token = returnglobal('token');
- if (!empty($restart_token)) $restart_extra .= "/token/".urlencode($restart_token);
- else $restart_extra = "/newtest/Y";
- if (!empty($_GET['lang'])) $restart_extra .= "/lang/".returnglobal('lang');
- $_restart = "".$clang->gT("Restart this Survey")."";
+ {
+ $restart_extra = "";
+ $restart_token = returnglobal('token');
+ if (!empty($restart_token)) $restart_extra .= "/token/".urlencode($restart_token);
+ else $restart_extra = "/newtest/Y";
+ if (!empty($_GET['lang'])) $restart_extra .= "/lang/".returnglobal('lang');
+ $_restart = "".$clang->gT("Restart this Survey")."";
}
else
{
@@ -475,19 +475,19 @@ function templatereplace($line, $replacements=array(),&$redata=array(), $debugSr
$_saveform .= html_escape(auto_unescape($_POST['savename']));
}
$_saveform .= "' />\n"
- . "
" . $clang->gT("Password") . ":
" . $clang->gT("Password") . ":
" . $clang->gT("Repeat Password") . ":
" . $clang->gT("Repeat Password") . ":
" . $clang->gT("Your Email") . ":
" . $clang->gT("Your Email") . ":
gT("Security Question") . ":
\n";
}
$_saveform .= "
\n"
- . "
\n"
- . "";
+ . "
\n"
+ . "";
// Load Form
$_loadform = "
" . $clang->gT("Saved name") . ":
\n"
- . "
" . $clang->gT("Password") . ":
" . $clang->gT("Password") . ":
" . $clang->gT("Security Question") . ":
\n";
}
$_loadform .="
\n"
- . "
\n";
+ . "
\n";
// Registration Form
if (isset($surveyid))
@@ -537,23 +537,23 @@ function templatereplace($line, $replacements=array(),&$redata=array(), $debugSr
$_registerform .= "\n";
$_registerform.="
\n"
- . "
"
- . $clang->gT("First name") . ":
"
- . "
"
+ . $clang->gT("First name") . ":
"
+ . "
" . $clang->gT("Last name") . ":
\n"
- . "
" . $clang->gT("Last name") . ":
\n"
+ . "
" . $clang->gT("Email address") . ":
\n"
- . "
" . $clang->gT("Email address") . ":
\n"
+ . "
gT("Security Question") . ":
\n";
}
$_registerform .= "
"
- . "
\n"
- . "
\n"
- . "\n";
+ . "\n"
+ . "\n"
+ . "\n";
}
else
{
@@ -585,83 +585,83 @@ function templatereplace($line, $replacements=array(),&$redata=array(), $debugSr
}
- // Set the array of replacement variables here - don't include curly braces
- $coreReplacements = array();
+ // Set the array of replacement variables here - don't include curly braces
+ $coreReplacements = array();
$coreReplacements['AID'] = isset($questiondetails['aid']) ? $questiondetails['aid'] : '';
- $coreReplacements['ANSWER'] = isset($answer) ? $answer : ''; // global
- $coreReplacements['ANSWERSCLEARED'] = $clang->gT("Answers Cleared");
- $coreReplacements['ASSESSMENTS'] = isset($assessments) ? $assessments : ''; // global
- $coreReplacements['ASSESSMENT_CURRENT_TOTAL'] = $_assessment_current_total;
- $coreReplacements['ASSESSMENT_HEADING'] = $clang->gT("Your Assessment");
- $coreReplacements['CHECKJAVASCRIPT'] = "";
- $coreReplacements['CLEARALL'] = $_clearall;
- $coreReplacements['CLOSEWINDOW'] = "".$clang->gT("Close this window")."";
- $coreReplacements['COMPLETED'] = isset($completed) ? $completed : ''; // global
- $coreReplacements['DATESTAMP'] = $_datestamp;
- $coreReplacements['EXPIRY'] = $_dateoutput;
+ $coreReplacements['ANSWER'] = isset($answer) ? $answer : ''; // global
+ $coreReplacements['ANSWERSCLEARED'] = $clang->gT("Answers Cleared");
+ $coreReplacements['ASSESSMENTS'] = isset($assessments) ? $assessments : ''; // global
+ $coreReplacements['ASSESSMENT_CURRENT_TOTAL'] = $_assessment_current_total;
+ $coreReplacements['ASSESSMENT_HEADING'] = $clang->gT("Your Assessment");
+ $coreReplacements['CHECKJAVASCRIPT'] = "";
+ $coreReplacements['CLEARALL'] = $_clearall;
+ $coreReplacements['CLOSEWINDOW'] = "".$clang->gT("Close this window")."";
+ $coreReplacements['COMPLETED'] = isset($completed) ? $completed : ''; // global
+ $coreReplacements['DATESTAMP'] = $_datestamp;
+ $coreReplacements['EXPIRY'] = $_dateoutput;
$coreReplacements['GID'] = isset($questiondetails['gid']) ? $questiondetails['gid']: '';
- $coreReplacements['GROUPDESCRIPTION'] = $_groupdescription;
- $coreReplacements['GROUPNAME'] = $_groupname;
- $coreReplacements['LANG'] = $clang->getlangcode();
- $coreReplacements['LANGUAGECHANGER'] = isset($languagechanger) ? $languagechanger : ''; // global
- $coreReplacements['LOADERROR'] = isset($errormsg) ? $errormsg : ''; // global
- $coreReplacements['LOADFORM'] = $_loadform;
- $coreReplacements['LOADHEADING'] = $clang->gT("Load A Previously Saved Survey");
- $coreReplacements['LOADMESSAGE'] = $clang->gT("You can load a survey that you have previously saved from this screen.")." ".$clang->gT("Type in the 'name' you used to save the survey, and the password.")." ";
- $coreReplacements['NAVIGATOR'] = isset($navigator) ? $navigator : ''; // global
- $coreReplacements['NOSURVEYID'] = (isset($surveylist))?$surveylist['nosid']:'';
- $coreReplacements['NUMBEROFQUESTIONS'] = $_totalquestionsAsked;
- $coreReplacements['PERCENTCOMPLETE'] = isset($percentcomplete) ? $percentcomplete : ''; // global
- $coreReplacements['PRIVACY'] = isset($privacy) ? $privacy : ''; // global
- $coreReplacements['PRIVACYMESSAGE'] = "".$clang->gT("A Note On Privacy")." ".$clang->gT("This survey is anonymous.")." ".$clang->gT("The record kept of your survey responses does not contain any identifying information about you unless a specific question in the survey has asked for this. If you have responded to a survey that used an identifying token to allow you to access the survey, you can rest assured that the identifying token is not kept with your responses. It is managed in a separate database, and will only be updated to indicate that you have (or haven't) completed this survey. There is no way of matching identification tokens with survey responses in this survey.");
+ $coreReplacements['GROUPDESCRIPTION'] = $_groupdescription;
+ $coreReplacements['GROUPNAME'] = $_groupname;
+ $coreReplacements['LANG'] = $clang->getlangcode();
+ $coreReplacements['LANGUAGECHANGER'] = isset($languagechanger) ? $languagechanger : ''; // global
+ $coreReplacements['LOADERROR'] = isset($errormsg) ? $errormsg : ''; // global
+ $coreReplacements['LOADFORM'] = $_loadform;
+ $coreReplacements['LOADHEADING'] = $clang->gT("Load A Previously Saved Survey");
+ $coreReplacements['LOADMESSAGE'] = $clang->gT("You can load a survey that you have previously saved from this screen.")." ".$clang->gT("Type in the 'name' you used to save the survey, and the password.")." ";
+ $coreReplacements['NAVIGATOR'] = isset($navigator) ? $navigator : ''; // global
+ $coreReplacements['NOSURVEYID'] = (isset($surveylist))?$surveylist['nosid']:'';
+ $coreReplacements['NUMBEROFQUESTIONS'] = $_totalquestionsAsked;
+ $coreReplacements['PERCENTCOMPLETE'] = isset($percentcomplete) ? $percentcomplete : ''; // global
+ $coreReplacements['PRIVACY'] = isset($privacy) ? $privacy : ''; // global
+ $coreReplacements['PRIVACYMESSAGE'] = "".$clang->gT("A Note On Privacy")." ".$clang->gT("This survey is anonymous.")." ".$clang->gT("The record kept of your survey responses does not contain any identifying information about you unless a specific question in the survey has asked for this. If you have responded to a survey that used an identifying token to allow you to access the survey, you can rest assured that the identifying token is not kept with your responses. It is managed in a separate database, and will only be updated to indicate that you have (or haven't) completed this survey. There is no way of matching identification tokens with survey responses in this survey.");
$coreReplacements['QID'] = isset($questiondetails['qid']) ? $questiondetails['qid'] : '';
- $coreReplacements['QUESTION'] = $_question;
- $coreReplacements['QUESTIONHELP'] = $_questionhelp;
- $coreReplacements['QUESTIONHELPPLAINTEXT'] = strip_tags(addslashes($help)); // global
- $coreReplacements['QUESTION_CLASS'] = $_question_class;
- $coreReplacements['QUESTION_CODE'] = $_question_code;
- $coreReplacements['QUESTION_ESSENTIALS'] = $_question_essentials;
- $coreReplacements['QUESTION_FILE_VALID_MESSAGE'] = $_question_file_valid_message;
- $coreReplacements['QUESTION_HELP'] = $_question_help;
- $coreReplacements['QUESTION_INPUT_ERROR_CLASS'] = $_question_input_error_class;
- $coreReplacements['QUESTION_MANDATORY'] = $_question_mandatory;
- $coreReplacements['QUESTION_MAN_CLASS'] = $_question_man_class;
- $coreReplacements['QUESTION_MAN_MESSAGE'] = $_question_man_message;
- $coreReplacements['QUESTION_NUMBER'] = $_question_number;
- $coreReplacements['QUESTION_TEXT'] = $_question_text;
- $coreReplacements['QUESTION_VALID_MESSAGE'] = $_question_valid_message;
- $coreReplacements['REGISTERERROR'] = isset($register_errormsg) ? $register_errormsg : ''; // global
- $coreReplacements['REGISTERFORM'] = $_registerform;
- $coreReplacements['REGISTERMESSAGE1'] = $clang->gT("You must be registered to complete this survey");
- $coreReplacements['REGISTERMESSAGE2'] = $clang->gT("You may register for this survey if you wish to take part.")." \n".$clang->gT("Enter your details below, and an email containing the link to participate in this survey will be sent immediately.");
- $coreReplacements['RESTART'] = $_restart;
- $coreReplacements['RETURNTOSURVEY'] = $_return_to_survey;
- $coreReplacements['SAVE'] = $_saveall;
- $coreReplacements['SAVEALERT'] = $_savealert;
- $coreReplacements['SAVEDID'] = isset($saved_id) ? $saved_id : ''; // global
- $coreReplacements['SAVEERROR'] = isset($errormsg) ? $errormsg : ''; // global - same as LOADERROR
- $coreReplacements['SAVEFORM'] = $_saveform;
- $coreReplacements['SAVEHEADING'] = $clang->gT("Save Your Unfinished Survey");
- $coreReplacements['SAVEMESSAGE'] = $clang->gT("Enter a name and password for this survey and click save below.")." \n".$clang->gT("Your survey will be saved using that name and password, and can be completed later by logging in with the same name and password.")."
\n".$clang->gT("If you give an email address, an email containing the details will be sent to you.")."
\n".$clang->gT("After having clicked the save button you can either close this browser window or continue filling out the survey.");
- $coreReplacements['SGQ'] = $_question_sgq;
- $coreReplacements['SID'] = (isset($surveyid) ? $surveyid : (isset($questiondetails['sid']) ? $questiondetails['sid'] : ''));
- $coreReplacements['SITENAME'] = isset($sitename) ? $sitename : ''; // global
- $coreReplacements['SUBMITBUTTON'] = $_submitbutton;
- $coreReplacements['SUBMITCOMPLETE'] = "".$clang->gT("Thank you!")."
".$clang->gT("You have completed answering the questions in this survey.")."
".$clang->gT("Click on 'Submit' now to complete the process and save your answers.");
- $coreReplacements['SUBMITREVIEW'] = $_strreview;
- $coreReplacements['SURVEYCONTACT'] = $surveycontact;
- $coreReplacements['SURVEYDESCRIPTION'] = (isset($thissurvey['description']) ? $thissurvey['description'] : '');
- $coreReplacements['SURVEYFORMAT'] = isset($surveyformat) ? $surveyformat : ''; // global
- $coreReplacements['SURVEYLANGAGE'] = $clang->langcode;
- $coreReplacements['SURVEYLIST'] = (isset($surveylist))?$surveylist['list']:'';
- $coreReplacements['SURVEYLISTHEADING'] = (isset($surveylist))?$surveylist['listheading']:'';
- $coreReplacements['SURVEYNAME'] = (isset($thissurvey['name']) ? $thissurvey['name'] : '');
- $coreReplacements['TEMPLATECSS'] = $_templatecss;
- $coreReplacements['TEMPLATEURL'] = $templateurl;
- $coreReplacements['THEREAREXQUESTIONS'] = $_therearexquestions;
- if (!$anonymized) $coreReplacements['TOKEN'] = $_token;
- $coreReplacements['URL'] = $_linkreplace;
- $coreReplacements['WELCOME'] = (isset($thissurvey['welcome']) ? $thissurvey['welcome'] : '');
+ $coreReplacements['QUESTION'] = $_question;
+ $coreReplacements['QUESTIONHELP'] = $_questionhelp;
+ $coreReplacements['QUESTIONHELPPLAINTEXT'] = strip_tags(addslashes($help)); // global
+ $coreReplacements['QUESTION_CLASS'] = $_question_class;
+ $coreReplacements['QUESTION_CODE'] = $_question_code;
+ $coreReplacements['QUESTION_ESSENTIALS'] = $_question_essentials;
+ $coreReplacements['QUESTION_FILE_VALID_MESSAGE'] = $_question_file_valid_message;
+ $coreReplacements['QUESTION_HELP'] = $_question_help;
+ $coreReplacements['QUESTION_INPUT_ERROR_CLASS'] = $_question_input_error_class;
+ $coreReplacements['QUESTION_MANDATORY'] = $_question_mandatory;
+ $coreReplacements['QUESTION_MAN_CLASS'] = $_question_man_class;
+ $coreReplacements['QUESTION_MAN_MESSAGE'] = $_question_man_message;
+ $coreReplacements['QUESTION_NUMBER'] = $_question_number;
+ $coreReplacements['QUESTION_TEXT'] = $_question_text;
+ $coreReplacements['QUESTION_VALID_MESSAGE'] = $_question_valid_message;
+ $coreReplacements['REGISTERERROR'] = isset($register_errormsg) ? $register_errormsg : ''; // global
+ $coreReplacements['REGISTERFORM'] = $_registerform;
+ $coreReplacements['REGISTERMESSAGE1'] = $clang->gT("You must be registered to complete this survey");
+ $coreReplacements['REGISTERMESSAGE2'] = $clang->gT("You may register for this survey if you wish to take part.")." \n".$clang->gT("Enter your details below, and an email containing the link to participate in this survey will be sent immediately.");
+ $coreReplacements['RESTART'] = $_restart;
+ $coreReplacements['RETURNTOSURVEY'] = $_return_to_survey;
+ $coreReplacements['SAVE'] = $_saveall;
+ $coreReplacements['SAVEALERT'] = $_savealert;
+ $coreReplacements['SAVEDID'] = isset($saved_id) ? $saved_id : ''; // global
+ $coreReplacements['SAVEERROR'] = isset($errormsg) ? $errormsg : ''; // global - same as LOADERROR
+ $coreReplacements['SAVEFORM'] = $_saveform;
+ $coreReplacements['SAVEHEADING'] = $clang->gT("Save Your Unfinished Survey");
+ $coreReplacements['SAVEMESSAGE'] = $clang->gT("Enter a name and password for this survey and click save below.")." \n".$clang->gT("Your survey will be saved using that name and password, and can be completed later by logging in with the same name and password.")."
\n".$clang->gT("If you give an email address, an email containing the details will be sent to you.")."
\n".$clang->gT("After having clicked the save button you can either close this browser window or continue filling out the survey.");
+ $coreReplacements['SGQ'] = $_question_sgq;
+ $coreReplacements['SID'] = (isset($surveyid) ? $surveyid : (isset($questiondetails['sid']) ? $questiondetails['sid'] : ''));
+ $coreReplacements['SITENAME'] = isset($sitename) ? $sitename : ''; // global
+ $coreReplacements['SUBMITBUTTON'] = $_submitbutton;
+ $coreReplacements['SUBMITCOMPLETE'] = "".$clang->gT("Thank you!")."
".$clang->gT("You have completed answering the questions in this survey.")."
".$clang->gT("Click on 'Submit' now to complete the process and save your answers.");
+ $coreReplacements['SUBMITREVIEW'] = $_strreview;
+ $coreReplacements['SURVEYCONTACT'] = $surveycontact;
+ $coreReplacements['SURVEYDESCRIPTION'] = (isset($thissurvey['description']) ? $thissurvey['description'] : '');
+ $coreReplacements['SURVEYFORMAT'] = isset($surveyformat) ? $surveyformat : ''; // global
+ $coreReplacements['SURVEYLANGAGE'] = $clang->langcode;
+ $coreReplacements['SURVEYLIST'] = (isset($surveylist))?$surveylist['list']:'';
+ $coreReplacements['SURVEYLISTHEADING'] = (isset($surveylist))?$surveylist['listheading']:'';
+ $coreReplacements['SURVEYNAME'] = (isset($thissurvey['name']) ? $thissurvey['name'] : '');
+ $coreReplacements['TEMPLATECSS'] = $_templatecss;
+ $coreReplacements['TEMPLATEURL'] = $templateurl;
+ $coreReplacements['THEREAREXQUESTIONS'] = $_therearexquestions;
+ if (!$anonymized) $coreReplacements['TOKEN'] = $_token;
+ $coreReplacements['URL'] = $_linkreplace;
+ $coreReplacements['WELCOME'] = (isset($thissurvey['welcome']) ? $thissurvey['welcome'] : '');
if (!is_null($replacements) && is_array($replacements))
{
@@ -679,38 +679,38 @@ function templatereplace($line, $replacements=array(),&$redata=array(), $debugSr
}
/**
- * insertAnsReplace() takes a string and looks for any {INSERTANS:xxxx} variables
- * which it then, one by one, substitutes the SGQA code with the relevant answer
- * from the session array containing responses
- *
- * The operations of this function were previously in the templatereplace function
- * but have been moved to a function of their own to make it available
- * to other areas of the script.
- *
- * @param mixed $line string - the string to iterate, and then return
- *
- * @return string This string is returned containing the substituted responses
- *
- */
+* insertAnsReplace() takes a string and looks for any {INSERTANS:xxxx} variables
+* which it then, one by one, substitutes the SGQA code with the relevant answer
+* from the session array containing responses
+*
+* The operations of this function were previously in the templatereplace function
+* but have been moved to a function of their own to make it available
+* to other areas of the script.
+*
+* @param mixed $line string - the string to iterate, and then return
+*
+* @return string This string is returned containing the substituted responses
+*
+*/
function insertansReplace($line)
{
return $line;
}
/**
- * tokenReplace() takes a string and looks for any {TOKEN:xxxx} variables
- * which it then, one by one, substitutes the TOKEN code with the relevant token
- * from the session array containing token information
- *
- * The operations of this function were previously in the templatereplace function
- * but have been moved to a function of their own to make it available
- * to other areas of the script.
- *
- * @param mixed $line string - the string to iterate, and then return
- *
- * @return string This string is returned containing the substituted responses
- *
- */
+* tokenReplace() takes a string and looks for any {TOKEN:xxxx} variables
+* which it then, one by one, substitutes the TOKEN code with the relevant token
+* from the session array containing token information
+*
+* The operations of this function were previously in the templatereplace function
+* but have been moved to a function of their own to make it available
+* to other areas of the script.
+*
+* @param mixed $line string - the string to iterate, and then return
+*
+* @return string This string is returned containing the substituted responses
+*
+*/
function tokenReplace($line)
{
return $line;
@@ -735,15 +735,15 @@ function ReplaceFields ($text,$fieldsarray, $bReplaceInsertans=false)
/**
- * passthruReplace() takes a string and looks for {PASSTHRU:myarg} variables
- * which it then substitutes for parameter data sent in the initial URL and stored
- * in the session array containing responses
- *
- * @param mixed $line string - the string to iterate, and then return
- * @param mixed $thissurvey string - the string containing the surveyinformation
- * @return string This string is returned containing the substituted responses
- *
- */
+* passthruReplace() takes a string and looks for {PASSTHRU:myarg} variables
+* which it then substitutes for parameter data sent in the initial URL and stored
+* in the session array containing responses
+*
+* @param mixed $line string - the string to iterate, and then return
+* @param mixed $thissurvey string - the string containing the surveyinformation
+* @return string This string is returned containing the substituted responses
+*
+*/
function PassthruReplace($line, $thissurvey)
{
while (strpos($line,"{PASSTHRU:") !== false)
diff --git a/application/views/admin/participants/blacklist_view.php b/application/views/admin/participants/blacklist_view.php
index c4ba809450f..2347b66db31 100644
--- a/application/views/admin/participants/blacklist_view.php
+++ b/application/views/admin/participants/blacklist_view.php
@@ -4,7 +4,7 @@
gT("Blacklist Control") ?>
" />
" />
@@ -16,96 +16,96 @@
-
-
-
-
Blacklist Control
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
Blacklist Control
+
+
+
+
+
+
+
+
+
+
+
-
-gT("You have successfully blacklisted from any survey on this server");
- }
- else if($blacklist == 'N')
- {
- echo $clang->gT("You have successfully un-blacklisted from any survey on this server");
- }
- }
- else if($is_participant)
- {
- if($blacklist == 'Y')
- {
- echo $clang->gT("You have already been blacklisted from any survey on this server");
- }
- else if($blacklist == 'N')
- {
- echo $clang->gT("You have already been un-blacklisted from any survey on this server");
- }
-
- }
- else if(!$is_survey)
- {
- echo $clang->gT("Survey is no longer active");
- }
- else
- {
- echo $clang->gT("The URL you are trying to use is either modified, or you have been removed from this server");
- }
-
-}
-else if($local == 1)
-{
- if($is_participant && $is_updated)
- {
- if($blacklist == 'Y')
- {
- echo $clang->gT("You have successfully blacklisted from this survey");
- }
- else if($blacklist == 'N')
- {
- echo $clang->gT("You have successfully un-blacklisted from this survey");
- }
- }
- else if($is_participant)
- {
- if($blacklist == 'Y')
- {
- echo $clang->gT("You have already been blacklisted from this survey");
- }
- else if($blacklist == 'N')
- {
- echo $clang->gT("You have already been un-blacklisted from this survey");
- }
-
- }
- else
- {
- echo $clang->gT("The URL you are trying to use is either modified, or you have been removed from this server");
-
- }
-
-}
-else
-{
- echo $clang->gT("You have successfully blacklisted from this survey");
-}
-?>
-
+
+ gT("You have successfully blacklisted from any survey on this server");
+ }
+ else if($blacklist == 'N')
+ {
+ echo $clang->gT("You have successfully un-blacklisted from any survey on this server");
+ }
+ }
+ else if($is_participant)
+ {
+ if($blacklist == 'Y')
+ {
+ echo $clang->gT("You have already been blacklisted from any survey on this server");
+ }
+ else if($blacklist == 'N')
+ {
+ echo $clang->gT("You have already been un-blacklisted from any survey on this server");
+ }
+
+ }
+ else if(!$is_survey)
+ {
+ echo $clang->gT("Survey is no longer active");
+ }
+ else
+ {
+ echo $clang->gT("The URL you are trying to use is either modified, or you have been removed from this server");
+ }
+
+ }
+ else if($local == 1)
+ {
+ if($is_participant && $is_updated)
+ {
+ if($blacklist == 'Y')
+ {
+ echo $clang->gT("You have successfully blacklisted from this survey");
+ }
+ else if($blacklist == 'N')
+ {
+ echo $clang->gT("You have successfully un-blacklisted from this survey");
+ }
+ }
+ else if($is_participant)
+ {
+ if($blacklist == 'Y')
+ {
+ echo $clang->gT("You have already been blacklisted from this survey");
+ }
+ else if($blacklist == 'N')
+ {
+ echo $clang->gT("You have already been un-blacklisted from this survey");
+ }
+
+ }
+ else
+ {
+ echo $clang->gT("The URL you are trying to use is either modified, or you have been removed from this server");
+
+ }
+
+ }
+ else
+ {
+ echo $clang->gT("You have successfully blacklisted from this survey");
+ }
+ ?>
+
+ if (bHasSurveyPermission($surveyid,'surveysettings','update'))
+ {?>
@@ -31,19 +31,19 @@
-
-
-
-
-
+
+
+
+
+
-
+
diff --git a/application/views/admin/survey/listSurveys_view.php b/application/views/admin/survey/listSurveys_view.php
index 134b1dc0879..154705dd753 100644
--- a/application/views/admin/survey/listSurveys_view.php
+++ b/application/views/admin/survey/listSurveys_view.php
@@ -5,116 +5,122 @@
sConfirmationArchiveMessage='eT("This function creates a ZIP archive of several survey archives and can take some time - please be patient! Do you want to contine?",'js');?>';
+
diff --git a/application/views/admin/survey/organizeGroupsAndQuestions.php b/application/views/admin/survey/organizeGroupsAndQuestions.php
new file mode 100644
index 00000000000..10b5c686adf
--- /dev/null
+++ b/application/views/admin/survey/organizeGroupsAndQuestions.php
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/application/views/admin/survey/organizeGroupsAndQuestions_view.php b/application/views/admin/survey/organizeGroupsAndQuestions_view.php
new file mode 100644
index 00000000000..06863a787f1
--- /dev/null
+++ b/application/views/admin/survey/organizeGroupsAndQuestions_view.php
@@ -0,0 +1,26 @@
+
\ No newline at end of file
diff --git a/application/views/admin/survey/subview/tabPanelIntegration_view.php b/application/views/admin/survey/subview/tabPanelIntegration_view.php
index 351f9a5a2bf..b4b89531fe9 100644
--- a/application/views/admin/survey/subview/tabPanelIntegration_view.php
+++ b/application/views/admin/survey/subview/tabPanelIntegration_view.php
@@ -16,8 +16,8 @@
-
-
-
+
+
+
\ No newline at end of file
diff --git a/application/views/admin/survey/surveybar_view.php b/application/views/admin/survey/surveybar_view.php
index 245ac58196e..a5c9d936104 100644
--- a/application/views/admin/survey/surveybar_view.php
+++ b/application/views/admin/survey/surveybar_view.php
@@ -65,18 +65,7 @@