From 4e93b2e0ca74926b6db9d2cb60fb02a1b6dd5c86 Mon Sep 17 00:00:00 2001
From: azammitdcarf \n\t\t".$clang->gT("Make a comment on your choice here:")."\n";
if(isset($_POST['printableexport'])){$pdf->intopdf("Make a comment on your choice here:");}
- $question['ANSWER'] .= "\t\t".input_type_image('textarea',$clang->gT("Make a comment on your choice here:"),50,8)."\n\t
{$query}
\n".$connect->ErrorMsg());
@@ -1561,7 +1575,6 @@ function XMLImportSurvey($sFullFilepath,$sXMLdata=NULL,$sNewSurveyName=NULL,$iDe
GiveAllSurveyPermissions($_SESSION['loginID'],$newsid);
if ($bTranslateInsertansTags)
{
- $aOldNewFieldmap=aReverseTranslateFieldnames($oldsid,$newsid,$aGIDReplacements,$aQIDReplacements);
TranslateInsertansTags($newsid,$oldsid,$aOldNewFieldmap);
}
diff --git a/include/limesurvey/admin/integritycheck.php b/include/limesurvey/admin/integritycheck.php
index 2c2fed55..dee6053f 100644
--- a/include/limesurvey/admin/integritycheck.php
+++ b/include/limesurvey/admin/integritycheck.php
@@ -28,27 +28,30 @@ if($_SESSION['USER_RIGHT_CONFIGURATOR'] == 1)
. "\n"
. "\n";
-
+
/****** Plainly delete survey permissions if the survey or user does not exist ***/
-
+
$connect->query("delete FROM {$dbprefix}survey_permissions where sid not in (select sid from {$dbprefix}surveys)");
$connect->query("delete FROM {$dbprefix}survey_permissions where uid not in (select uid from {$dbprefix}users)");
-
+
+ // Silently fix subquestions
+ fixSubquestions();
+
/***** Check for activate survey tables with missing survey entry **/
-
+
$sQuery = db_select_tables_like("{$dbprefix}survey\_%");
$aResult = db_execute_num($sQuery) or safe_die("Couldn't get list of conditions from database
\n";
@@ -858,8 +858,8 @@ while ($degrow = $degresult->FetchRow())
$question['QUESTION_TYPE_HELP'] = $clang->gT("Please choose *only one* of the following:");
$question['ANSWER'] .= "\n\t
$query
".$connect->ErrorMsg());
while ($aRow=$aResult->FetchRow())
{
- $tablename=substr($aRow[0],strlen($dbprefix));
+ $tablename=substr($aRow[0],strlen($dbprefix));
if ($tablename=='survey_permissions') continue;
- $iSurveyID=substr($tablename,strpos($tablename,'_')+1);
+ $iSurveyID=substr($tablename,strpos($tablename,'_')+1);
$qquery="SELECT sid FROM {$dbprefix}surveys WHERE sid='{$iSurveyID}'";
$qresult=$connect->Execute($qquery) or safe_die ("Couldn't check questions table for qids
$qquery
".$connect->ErrorMsg());
$qcount=$qresult->RecordCount();
if ($qcount==0)
{
- $date = date('YmdHis').rand(1,1000);
+ $date = date('YmdHis').rand(1,1000);
$sOldTable = "survey_{$iSurveyID}";
$sNewTable = "old_survey_{$iSurveyID}_$date";
@@ -63,24 +66,24 @@ if($_SESSION['USER_RIGHT_CONFIGURATOR'] == 1)
$setsequence="ALTER TABLE $sNewTable ALTER COLUMN id SET DEFAULT nextval('{$sNewTable}_id_seq'::regclass);";
$deactivateresult = $connect->Execute($setsequence) or die ("Couldn't make backup of the survey table. Please try again. The database reported the following error:
".htmlspecialchars($connect->ErrorMsg())."
Survey was not deactivated either.
".$clang->gT("Main Admin Screen")."");
}
-
+
}
}
/***** Check for activate token tables with missing survey entry **/
-
+
$sQuery = db_select_tables_like("{$dbprefix}tokens\_%");
$aResult = db_execute_num($sQuery) or safe_die("Couldn't get list of token tables from database
$query
".$connect->ErrorMsg());
while ($aRow=$aResult->FetchRow())
{
- $tablename=substr($aRow[0],strlen($dbprefix));
- $iSurveyID=substr($tablename,strpos($tablename,'_')+1);
+ $tablename=substr($aRow[0],strlen($dbprefix));
+ $iSurveyID=substr($tablename,strpos($tablename,'_')+1);
$qquery="SELECT sid FROM {$dbprefix}surveys WHERE sid='{$iSurveyID}'";
$qresult=$connect->Execute($qquery) or safe_die ("Couldn't check survey table for sid
$qquery
".$connect->ErrorMsg());
$qcount=$qresult->RecordCount();
if ($qcount==0)
{
- $date = date('YmdHis').rand(1,1000);
+ $date = date('YmdHis').rand(1,1000);
$sOldTable = "tokens_{$iSurveyID}";
$sNewTable = "old_tokens_{$iSurveyID}_$date";
$deactivatequery = db_rename_table( db_table_name_nq($sOldTable), db_table_name_nq($sNewTable));
@@ -98,11 +101,11 @@ if($_SESSION['USER_RIGHT_CONFIGURATOR'] == 1)
} else {
$deactivateresult = $connect->Execute($deactivatequery) or die ("Couldn't deactivate because:
\n".htmlspecialchars($connect->ErrorMsg())." - Query: ".htmlspecialchars($deactivatequery)."
\nAdmin\n");
}
-
+
}
}
-
-
+
+
/**********************************************************************/
/* CHECK CONDITIONS */
/**********************************************************************/
@@ -179,7 +182,7 @@ if($_SESSION['USER_RIGHT_CONFIGURATOR'] == 1)
/**********************************************************************/
$sQuery = "SELECT * FROM {$dbprefix}defaultvalues where qid not in (select qid from {$dbprefix}questions)";
$result = db_execute_assoc($sQuery) or safe_die($connect->ErrorMsg());
- $iCountDefaultValues=$result->RecordCount();
+ $iCountDefaultValues=$result->RecordCount();
if ($iCountDefaultValues>0) {
$integritycheck .= "
".$clang->gT("No database action required");
} else {
@@ -579,17 +582,17 @@ if($_SESSION['USER_RIGHT_CONFIGURATOR'] == 1)
{
$integritycheck .= "\n";
}
-
+
if ($iCountQuotas>0)
{
$integritycheck .= "\n";
}
-
+
if ($iCountDefaultValues>0)
{
$integritycheck .= "\n";
}
-
+
if (isset($oldsdelete)) {
foreach($oldsdelete as $olds) {
$integritycheck .= "\n";
@@ -752,15 +755,15 @@ if($_SESSION['USER_RIGHT_CONFIGURATOR'] == 1)
$sSQL = "delete FROM {$dbprefix}quota where sid not in (select sid from {$dbprefix}surveys)";
$result = $connect->Execute($sSQL) or safe_die ("Couldn't delete quotas ($sSQL)
".$connect->ErrorMsg());
}
-
-
+
+
if (isset($bQuotaLanguageSettingsDelete) && $bQuotaLanguageSettingsDelete==1)
{
$integritycheck .= $clang->gT("Deleting orphaned language settings.")."
\n";
$sSQL = "delete FROM {$dbprefix}quota_languagesettings where quotals_quota_id not in (select id from {$dbprefix}quota)";
$result = $connect->Execute($sSQL) or safe_die ("Couldn't delete quotas ($sSQL)
".$connect->ErrorMsg());
}
-
+
if (isset($oldsdelete)) {
$integritycheck .= $clang->gT("Deleting old survey result tables").":
\n";
foreach ($oldsdelete as $olds) {
@@ -790,7 +793,7 @@ if($_SESSION['USER_RIGHT_CONFIGURATOR'] == 1)
}
$integritycheck .= "
\n";
}
-
+
if (isset($sldelete)) {
$integritycheck .= $clang->gT("Deleting survey language settings").":
\n"
."".$clang->gT("Check Again")."
\n"
."
\n";
-
+
}
$surveyid=false;
diff --git a/include/limesurvey/admin/printablesurvey.php b/include/limesurvey/admin/printablesurvey.php
index 8cf7cb57..bd4c8637 100644
--- a/include/limesurvey/admin/printablesurvey.php
+++ b/include/limesurvey/admin/printablesurvey.php
@@ -136,7 +136,7 @@ if(isset($showsgqacode) && $showsgqacode == true)
}
else
{
- $surveyname = $surveyname;
+ $surveyname = "";
}
$survey_output = array(
@@ -493,7 +493,7 @@ while ($degrow = $degresult->FetchRow())
{
$explanation .= $clang->gT("Answer was")." ";
}
- $explanation .= " `".$distinctrow['value']."`";
+ $explanation .= " ".$distinctrow['value'];
}
if(!$distinctrow['cqid']) { // cqid == 0 ==> token attribute match
$tokenData = GetTokenFieldsAndNames($surveyid);
@@ -531,7 +531,7 @@ while ($degrow = $degresult->FetchRow())
{
$explanation .= $clang->gT("is")." ";
}
- $explanation .= " `".$distinctrow['value']."`";
+ $answer_section = $distinctrow['value'];
}
$conquery="SELECT cid, cqid, q.title,\n"
@@ -838,7 +838,7 @@ while ($degrow = $degresult->FetchRow())
{
$pdfoutput .=" o ".$i." ";
// $printablesurveyoutput .="\t\t\t$i \n";
- $question['ANSWER'] .="\t\t\n";
- $question['ANSWER'] .= "\t\t
\n";
if(isset($_POST['printableexport'])){$pdf->intopdf($clang->gT("Please choose *only one* of the following:"));}
@@ -911,15 +911,19 @@ while ($degrow = $degresult->FetchRow())
list ($category, $answer) = explode($optCategorySeparator,$dearow['answer']);
if ($category != '')
{
- $dearow['answer'] = "($category) $answer";
+ $dearow['answer'] = "($category) $answer ".addsgqacode("(".$dearow['code'].")");
}
else
{
- $dearow['answer'] = $answer;
+ $dearow['answer'] = $answer.addsgqacode(" (".$dearow['code'].")");
}
+ $question['ANSWER'] .= "\t".$wrapper['item-start']."\t\t".input_type_image('radio' , $dearow['answer'])."\n\t\t\t".$dearow['answer']."\n".$wrapper['item-end'];
+ }
+ else
+ {
+ $question['ANSWER'] .= "\t".$wrapper['item-start']."\t\t".input_type_image('radio' , $dearow['answer'])."\n\t\t\t".$dearow['answer'].addsgqacode(" (".$dearow['code'].")")."\n".$wrapper['item-end'];
}
- $question['ANSWER'] .= "\t".$wrapper['item-start']."\t\t".input_type_image('radio' , $dearow['answer'])."\n\t\t\t".$dearow['answer']."\n".$wrapper['item-end'];
if(isset($_POST['printableexport'])){$pdf->intopdf(" o ".$dearow['answer']);}
++$rowcounter;
@@ -942,7 +946,7 @@ while ($degrow = $degresult->FetchRow())
if(trim($qidattributes["other_replace_text"])=='')
{$qidattributes["other_replace_text"]="Other";}
// $printablesurveyoutput .="\t".$wrapper['item-start']."\t\t".input_type_image('radio' , $clang->gT("Other"))."\n\t\t\t".$clang->gT("Other")."\n\t\t\t\n".$wrapper['item-end'];
- $question['ANSWER'] .= $wrapper['item-start-other'].input_type_image('radio',$clang->gT($qidattributes["other_replace_text"])).' '.$clang->gT($qidattributes["other_replace_text"])."\n\t\t\t".input_type_image('other')."\n".$wrapper['item-end'];
+ $question['ANSWER'] .= $wrapper['item-start-other'].input_type_image('radio',$clang->gT($qidattributes["other_replace_text"])).' '.$clang->gT($qidattributes["other_replace_text"]).addsgqacode(" (-oth-)")."\n\t\t\t".input_type_image('other').addsgqacode(" (".$deqrow['sid']."X".$deqrow['gid']."X".$deqrow['qid']."other)")."\n".$wrapper['item-end'];
if(isset($_POST['printableexport'])){$pdf->intopdf(" o ".$clang->gT($qidattributes["other_replace_text"]).": ________");}
}
$question['ANSWER'] .= $wrapper['whole-end'];
@@ -958,14 +962,14 @@ while ($degrow = $degresult->FetchRow())
$question['ANSWER'] = "\t\n";
while ($dearow = $dearesult->FetchRow())
{
- $question['ANSWER'] .= "\t\t
\n";
$question['ANSWER'] .= "\t
| - | 1 | -2 | -3 | -4 | -5 | +1".addsgqacode(" (1)")." | +2".addsgqacode(" (2)")." | +3".addsgqacode(" (3)")." | +4".addsgqacode(" (4)")." | +5".addsgqacode(" (5)")." |
|---|
| \n"; for ($i=1; $i<=10; $i++) { - $question['ANSWER'] .= "\t\t\t | $i | \n"; + $question['ANSWER'] .= "\t\t\t$i".addsgqacode(" ($i)")." | \n"; } $question['ANSWER'] .= "\t||||
|---|---|---|---|---|---|---|
| - | '.$clang->gT("Yes").' | -'.$clang->gT("Uncertain").' | -'.$clang->gT("No").' | +'.$clang->gT("Yes").addsgqacode(" (Y)").' | +'.$clang->gT("Uncertain").addsgqacode(" (U)").' | +'.$clang->gT("No").addsgqacode(" (N)").' |
| - | '.$clang->gT("Increase").' | -'.$clang->gT("Same").' | -'.$clang->gT("Decrease").' | +'.$clang->gT("Increase").addsgqacode(" (I)").' | +'.$clang->gT("Same").addsgqacode(" (S)").' | +'.$clang->gT("Decrease").addsgqacode(" (D)").' | {$frow['answer']} | \n"; + $printablesurveyoutput2 .="\t\t\t{$frow['answer']}".addsgqacode(" (".$frow['code'].")")." | \n"; $myheader2 .= ""; $pdfoutput[0][$l1+1]=$frow['answer']; $l1++; @@ -1708,7 +1711,7 @@ while ($degrow = $degresult->FetchRow()) $scale2array = array(); while ($frow1 = $fresult1->FetchRow()) { - $printablesurveyoutput2 .="\t\t\t | {$frow1['answer']} | \n"; + $printablesurveyoutput2 .="\t\t\t{$frow1['answer']}".addsgqacode(" (".$frow1['code'].")")." | \n"; $pdfoutput[1][$l2]=$frow['answer']; //add current question code @@ -1806,7 +1809,7 @@ while ($degrow = $degresult->FetchRow()) { $question['ANSWER'] .= "\t\t
| {$mearow['answer']} | \n"; + $question['ANSWER'] .= "\t\t\t{$mearow['answer']}".addsgqacode(" (".$mearow['code'].")")." | \n"; //$printablesurveyoutput .="\t\t\t\t\t"; $pdfoutput[$a][0]=$mearow['answer']; for ($i=1; $i<=$fcount; $i++) diff --git a/include/limesurvey/admin/remotecontrol/lsrc.testclient.php b/include/limesurvey/admin/remotecontrol/lsrc.testclient.php index fce49bc0..cc34570d 100644 --- a/include/limesurvey/admin/remotecontrol/lsrc.testclient.php +++ b/include/limesurvey/admin/remotecontrol/lsrc.testclient.php @@ -20,6 +20,8 @@ //// errors are ok, but warnings have nothing to say (in this case, sometimes warnings are useful!) //ini_set("error_reporting", "E_ALL & ~E_WARNING"); +die('Test client is deactivated for security reasons. Open lsrc.testclient.php and comment this line to activate the test client.'); + include_once("lsrc.client.php"); /** * initiate the testclient object diff --git a/include/limesurvey/admin/scripts/admin_core.js b/include/limesurvey/admin/scripts/admin_core.js index 03fd5846..604bcc9c 100644 --- a/include/limesurvey/admin/scripts/admin_core.js +++ b/include/limesurvey/admin/scripts/admin_core.js @@ -1,6 +1,7 @@ //$Id: admin_core.js 10855 2011-08-26 13:30:41Z mot3 $ $(document).ready(function(){ + setupAllTabs(); if(typeof(userdateformat) !== 'undefined') { $(".popupdate").datepicker({ dateFormat: userdateformat, diff --git a/include/limesurvey/admin/scripts/emailtemplates.js b/include/limesurvey/admin/scripts/emailtemplates.js index 51721bb3..3607b751 100644 --- a/include/limesurvey/admin/scripts/emailtemplates.js +++ b/include/limesurvey/admin/scripts/emailtemplates.js @@ -10,8 +10,8 @@ $(document).ready(function(){ /** * This function loads each FCKeditor only when the tab is clicked and only if it is not already loaded */ -function loadHTMLEditor(event, ui) -{ +function loadHTMLEditor(event, ui) +{ if (typeof ui.panel.selector != 'undefined') { sSelector=ui.panel.selector; @@ -22,18 +22,18 @@ function loadHTMLEditor(event, ui) } if ($(sSelector+' iframe').size()==0) { - sCKEditorInstanceName='oFCKeditor_'+$(sSelector+' textarea').attr('id').replace(/-/i, "_"); + sCKEditorInstanceName='oFCKeditor_'+$(sSelector+' textarea').attr('id').replace(/-/g, "_"); eval("if (typeof "+sCKEditorInstanceName+" != 'undefined')"+sCKEditorInstanceName+".ReplaceTextarea();"); } } function fillin(tofield, fromfield) { - if (confirm(sReplaceTextConfirmation)) + if (confirm(sReplaceTextConfirmation)) { if (document.getElementById(tofield).readOnly == false) - { - $('#'+tofield).val($('#'+fromfield).val()); + { + $('#'+tofield).val($('#'+fromfield).val()); } updateCKeditor(tofield,$('#'+fromfield).val()); diff --git a/include/limesurvey/admin/statistics.php b/include/limesurvey/admin/statistics.php index 56909939..a8d160fe 100644 --- a/include/limesurvey/admin/statistics.php +++ b/include/limesurvey/admin/statistics.php @@ -61,8 +61,7 @@ $maxchars = 50; -//don't call this script directly! -if (isset($_REQUEST['homedir'])) {die('You cannot start this script directly');} +include_once("login_check.php"); //some includes, the progressbar is used to show a progressbar while generating the graphs //include_once("login_check.php"); @@ -409,7 +408,7 @@ foreach ($filters as $flt) } $statisticsoutput .= "\t\t | ||||
| "; $statisticsoutput .= "\n" @@ -620,7 +619,7 @@ foreach ($filters as $flt) ."\t\t\t\t\t" ."\t\t\t\t | \n"; $counter2++; @@ -759,7 +758,7 @@ foreach ($filters as $flt) $statisticsoutput .= " />"; $statisticsoutput .= showSpeaker($niceqtext) ."||||||
| "; //heading $statisticsoutput .= "\n" ."\t\t\t\t\n\t\t\t\t | \n"; $counter2++; } @@ -970,44 +969,44 @@ foreach ($filters as $flt) { $myfield2 = $myfield . "$row[0]"; $statisticsoutput .= "\n"; - + if ($counter2 == 4) {$statisticsoutput .= "\t\t\t\t||||||
| "
." \n" ."\t\t\t\t\n\t\t\t\t | \n";
$counter2++;
-
+
//add to array
}
@@ -1028,36 +1027,36 @@ foreach ($filters as $flt)
{
$myfield2 = $myfield . "$row[0]";
$statisticsoutput .= "\n";
-
+
if ($counter2 == 4) {$statisticsoutput .= "\t\t\t\t||||||
| "
." \n" ."\t\t\t\t\n\t\t\t\t | \n";
$counter2++;
@@ -1189,26 +1188,26 @@ foreach ($filters as $flt)
{
$myfield2 = $myfield . "$row[0]";
$statisticsoutput .= "\n";
-
+
if ($counter2 == 4)
{
$statisticsoutput .= "\t\t\t\t||||||
| "
." \n"; - + /* * when hoovering the speaker symbol we show the whole question * @@ -1223,13 +1222,13 @@ foreach ($filters as $flt) */ $fquery = "SELECT * FROM ".db_table_name("answers")." WHERE qid={$flt[0]} AND language='{$language}' ORDER BY sortorder, code"; $fresult = db_execute_assoc($fquery); - + //for debugging only: //$statisticsoutput .= $fquery; - + //creating form $statisticsoutput .= "\t\t\t\t\n\t\t\t\t | \n";
$counter2++;
-
+
//add fields to main array
}
@@ -1277,7 +1276,7 @@ foreach ($filters as $flt)
{
//adjust layout depending on counter
if ($counter2 == 4) {$statisticsoutput .= "\t\t\t\t||||||
| "
." \n" ."\t\t\t\t\n\t\t\t\t | \n";
$counter2++;
-
+
//add averything to main array
}
@@ -1374,7 +1373,7 @@ foreach ($filters as $flt)
//check if there is a dualscale_headerA/B
$dshquery = "SELECT value FROM ".db_table_name("question_attributes")." WHERE qid={$flt[0]} AND attribute='dualscale_headerA'";
$dshresult = db_execute_num($dshquery) or safe_die ("Couldn't get dualscale header!