Skip to content

Commit

Permalink
Dev Merging changes from stable branch up to rev 9255
Browse files Browse the repository at this point in the history
git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/limesurvey_dev@9585 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
c-schmitz committed Dec 6, 2010
1 parent d552b30 commit 52ae575
Show file tree
Hide file tree
Showing 10 changed files with 73 additions and 56 deletions.
6 changes: 3 additions & 3 deletions admin/html.php
Expand Up @@ -680,8 +680,8 @@
. "<td align='left'> {$surveyinfo['admin']} ({$surveyinfo['adminemail']})</td></tr>\n";
if (trim($surveyinfo['faxto'])!='')
{
$surveysummary="<tr><td align='right' valign='top'><strong>"
. $clang->gT("Fax To:")."</strong></td>\n<td align='left'>{$surveyinfo['faxto']}";
$surveysummary .="<tr><td align='right' valign='top'><strong>"
. $clang->gT("Fax to:")."</strong></td>\n<td align='left'>{$surveyinfo['faxto']}";
$surveysummary .= "</td></tr>\n";
}
$surveysummary .= "<tr><td align='right' valign='top'><strong>"
Expand Down Expand Up @@ -2086,7 +2086,7 @@ function showadminmenu()

// list surveys
$adminmenu .= "<a href=\"#\" onclick=\"window.open('{$scriptname}?action=listsurveys', '_top')\" title=\"".$clang->gTview("List Surveys")."\" >\n"
."<img src='{$imageurl}/surveylist.png' name='ListSurveys' alt='".$clang->gT("List Surveys")."' onclick=\"window.open('$scriptname?action=listsurveys', '_top')\" />"
."<img src='$imageurl/surveylist.png' name='ListSurveys' alt='".$clang->gT("List Surveys")."' />"
."</a>" ;

// db backup & label editor
Expand Down
11 changes: 6 additions & 5 deletions admin/statistics.php
Expand Up @@ -462,10 +462,8 @@
Y - Yes/No
! - List (Dropdown) )
*/
if ($flt[2] != "A" && $flt[2] != "B" && $flt[2] != "C" && $flt[2] != "E" &&
$flt[2] != "F" && $flt[2] != "H" && $flt[2] != "T" && $flt[2] != "U" &&
$flt[2] != "S" && $flt[2] != "D" && $flt[2] != "R" && $flt[2] != "Q" && $flt[2] != "1" &&
$flt[2] != "X" && $flt[2] != "K" && $flt[2] != ":" && $flt[2] != ";") //Have to make an exception for these types!
if ($flt[2]=='M' || $flt[2]=='P' || $flt[2]=='N' || $flt[2]=='L'
|| $flt[2]=='G' || $flt[2]=='I' || $flt[2]=='O' || $flt[2]=='Y' || $flt[2]=='!') //Have to make an exception for these types!
{

$statisticsoutput .= "\t\t\t\t<td align='center'>";
Expand All @@ -492,7 +490,10 @@
*
* Auto-check the question types mentioned above
*/
if (isset($summary) && (array_search("{$surveyid}X{$flt[1]}X{$flt[0]}", $summary) !== FALSE || array_search("M{$surveyid}X{$flt[1]}X{$flt[0]}", $summary) !== FALSE || array_search("N{$surveyid}X{$flt[1]}X{$flt[0]}", $summary) !== FALSE))
if (isset($summary) && (array_search("{$surveyid}X{$flt[1]}X{$flt[0]}", $summary) !== FALSE
|| array_search("M{$surveyid}X{$flt[1]}X{$flt[0]}", $summary) !== FALSE
|| array_search("P{$surveyid}X{$flt[1]}X{$flt[0]}", $summary) !== FALSE
|| array_search("N{$surveyid}X{$flt[1]}X{$flt[0]}", $summary) !== FALSE))
{$statisticsoutput .= " checked='checked'";}

//show speaker symbol which contains full question text
Expand Down
62 changes: 30 additions & 32 deletions admin/statistics_function.php
Expand Up @@ -60,37 +60,29 @@
//don't call this script directly!
if (isset($_REQUEST['homedir'])) {die('You cannot start this script directly');}

//some includes, the progressbar is used to show a progressbar while generating the graphs
//if($casEnabled)
//{
// include_once("login_check_cas.php");
//}
//else
//{

//}

//require_once('classes/core/class.progressbar.php');




// // LimeSurvey translation Object
// require_once($rootdir.'/classes/core/language.php');
// $clang = new limesurvey_lang($defaultlang);




//generate_statistics('999','all',0,'pdf','F');

/**
* Generates statistics
*
* @param int $surveyid The survey id
* @param mixed $allfields
* @param mixed $q2show
* @param mixed $usegraph
* @param string $outputType Optional - Can be xls, html or pdf - Defaults to pdf
* @param string $pdfOutput Sets the target for the PDF output: DD=File download , F=Save file to local disk
* @param string $statlangcode Lamguage for statistics
* @param mixed $browse Show browse buttons
* @return buffer
*/
function generate_statistics($surveyid, $allfields, $q2show='all', $usegraph=0, $outputType='pdf', $pdfOutput='I',$statlangcode=null, $browse = true)
{
//$allfields ="";
global $connect, $dbprefix, $clang,
$rooturl, $rootdir, $homedir, $homeurl, $tempdir, $tempurl, $scriptname, $imagedir,
$chartfontfile, $chartfontsize, $admintheme, $pdfdefaultfont, $pdffontsize;

$fieldmap=createFieldMap($surveyid, "full");

if (is_null($statlangcode))
{
$statlang=$clang;
Expand Down Expand Up @@ -283,6 +275,13 @@ function generate_statistics($surveyid, $allfields, $q2show='all', $usegraph=0,
// creates array of post variable names
for (reset($_POST); $key=key($_POST); next($_POST)) { $postvars[]=$key;}

$aQuestionMap=array();
foreach ($fieldmap as $field)
{
if(isset($field['qid']) && $field['qid']!='')
$aQuestionMap[]=$field['sid'].'X'.$field['gid'].'X'.$field['qid'];
}

/*
* Iterate through postvars to create "nice" data for SQL later.
*
Expand All @@ -293,7 +292,7 @@ function generate_statistics($surveyid, $allfields, $q2show='all', $usegraph=0,
foreach ($postvars as $pv)
{
//Only do this if there is actually a value for the $pv
if (in_array($pv, $allfields) || in_array(substr($pv,0,-1), $allfields))
if (in_array($pv, $allfields) || in_array(substr($pv,1),$aQuestionMap) || in_array($pv,$aQuestionMap))
{
$firstletter=substr($pv,0,1);
/*
Expand Down Expand Up @@ -329,10 +328,11 @@ function generate_statistics($surveyid, $allfields, $q2show='all', $usegraph=0,
//P - Multiple Options with comments
elseif ($firstletter == "M" || $firstletter == "P")
{
$mselects=array();
//create a list out of the $pv array
list($lsid, $lgid, $lqid) = explode("X", $pv);

$aquery="SELECT question FROM ".db_table_name("questions")." WHERE parent_qid=$lqid AND language='{$language}' ORDER BY question_order";
$aquery="SELECT title FROM ".db_table_name("questions")." WHERE parent_qid=$lqid AND language='{$language}' and scale_id=0 ORDER BY question_order";
$aresult=db_execute_num($aquery) or safe_die ("Couldn't get subquestions<br />$aquery<br />".$connect->ErrorMsg());

// go through every possible answer
Expand Down Expand Up @@ -658,7 +658,7 @@ function generate_statistics($surveyid, $allfields, $q2show='all', $usegraph=0,
}

//1. Get list of answers
$query="SELECT title, question FROM ".db_table_name("questions")." WHERE parent_qid='$qqid' AND language='{$language}' ORDER BY question_order";
$query="SELECT title, question FROM ".db_table_name("questions")." WHERE parent_qid='$qqid' AND language='{$language}' and scale_id=0 ORDER BY question_order";
$result=db_execute_num($query) or safe_die("Couldn't get list of subquestions for multitype<br />$query<br />".$connect->ErrorMsg());

//loop through multiple answers
Expand All @@ -685,7 +685,6 @@ function generate_statistics($surveyid, $allfields, $q2show='all', $usegraph=0,
//T - Long Free Text
elseif ($firstletter == "T" || $firstletter == "S") //Short and long text
{
$fieldmap=createFieldMap($surveyid, "full");

//search for key
$fld = substr($rt, 1, strlen($rt));
Expand Down Expand Up @@ -1480,11 +1479,7 @@ function generate_statistics($surveyid, $allfields, $q2show='all', $usegraph=0,
// NICE SIMPLE SINGLE OPTION ANSWERS
else
{
//get database fields for this survey
$fieldmap=createFieldMap($surveyid, "full");
//print_r($fieldmap);
//search for key
$fld =
$fielddata=$fieldmap[$rt];
//print_r($fielddata);
//get SGQA IDs
Expand Down Expand Up @@ -1732,6 +1727,9 @@ function generate_statistics($surveyid, $allfields, $q2show='all', $usegraph=0,

case "1": //array (dual scale)

$sSubquestionQuery = "SELECT question FROM ".db_table_name("questions")." WHERE parent_qid='$qiqid' AND title='$qanswer' AND language='{$language}' ORDER BY question_order";
$sSubquestion=FlattenText($connect->GetOne($sSubquestionQuery));

//get question attributes
$qidattributes=getQuestionAttributes($qqid);

Expand Down Expand Up @@ -1789,7 +1787,7 @@ function generate_statistics($surveyid, $allfields, $q2show='all', $usegraph=0,
}

//adapt title and question
$qtitle = $qtitle." [".$qanswer."][".$labelno."]";
$qtitle = $qtitle." [".$sSubquestion."][".$labelno."]";
$qquestion = $qastring .$labelheader;
break;

Expand Down
16 changes: 6 additions & 10 deletions qanda.php
Expand Up @@ -2810,20 +2810,16 @@ function do_ranking($ia)
. "<strong>&nbsp;&nbsp;<label for='CHOICES_{$ia[0]}'>".$clang->gT("Your Choices").":</label></strong><br />\n"
. "&nbsp;".$choicelist
. "\t&nbsp;</td>\n";
if (isset($maxselectlength) && $maxselectlength > 60)
$maxselectlength=$maxselectlength+2;
if ($maxselectlength > 60)
{
$ranklist = str_replace("<input class=\"text\"", "<input size='60' class='text'", $ranklist);
$answer .= "</tr>\n<tr>\n"
. "\t<td align='left' class='output'>\n"
. "\t<table border='0' cellspacing='1' cellpadding='0'>\n"
. "\t<tr><td></td><td><strong>".$clang->gT("Your Ranking").":</strong></td></tr>\n";
$maxselectlength=60;
}
else
{
$answer .= "\t<td style=\"text-align:left; white-space:nowrap;\" class=\"rank output\">\n"
$ranklist = str_replace("<input class=\"text\"", "<input size='{$maxselectlength}' class='text'", $ranklist);
$answer .= "\t<td style=\"text-align:left; white-space:nowrap;\" class='rank output'>\n"
. "\t<table border='0' cellspacing='1' cellpadding='0'>\n"
. "\t<tr><td></td><td><strong>".$clang->gT("Your Ranking").":</strong></td></tr>\n";
}

$answer .= $ranklist
. "\t</table>\n"
. "\t</td>\n"
Expand Down
6 changes: 3 additions & 3 deletions templates/basic/navigator.pstpl
@@ -1,7 +1,7 @@
<table class="navigator-table">
<tr>
<td align="left" nowrap="nowrap" width="33%">{CLEARALL}</td>
<td align="center" nowrap="nowrap" width="33%">{SAVE}</td>
<td align="right" nowrap="nowrap" width="33%">{NAVIGATOR}</td>
<td class="clear-all" align="left" nowrap="nowrap" width="33%">{CLEARALL}</td>
<td class="save-all" align="center" nowrap="nowrap" width="33%">{SAVE}</td>
<td class="submit-buttons" align="right" nowrap="nowrap" width="33%">{NAVIGATOR}</td>
</tr>
</table>
2 changes: 1 addition & 1 deletion templates/basic/privacy.pstpl
@@ -1,5 +1,5 @@
<table class="privacy-table">
<tr>
<td>{PRIVACYMESSAGE}</font></td>
<td class="privacy-message">{PRIVACYMESSAGE}</font></td>
</tr>
</table>
15 changes: 15 additions & 0 deletions templates/basic/template.css
Expand Up @@ -236,6 +236,15 @@ table.question tr.array1:hover,table.question tr.array2:hover {
padding: 8px;
}

.submit-buttons {
}

.clear-all {
}

.save-all {
}

.privacy-table {
margin: 0 auto;
width: 75%;
Expand Down Expand Up @@ -275,6 +284,12 @@ table.question tr.array1:hover,table.question tr.array2:hover {
text-align: center;
}

.survey-description {
}

.welcome-text {
}

.survey-list-table {
width: 100%;
margin: 0 auto;
Expand Down
2 changes: 1 addition & 1 deletion templates/basic/welcome.pstpl
Expand Up @@ -18,7 +18,7 @@
<td colspan="2" align="center">
<table class="welcome-table" width="80%">
<tr>
<td>{WELCOME}<br /> <br /></td>
<td class-"welcome-text">{WELCOME}<br /> <br /></td>
</tr>
</table>
</td>
Expand Down
3 changes: 2 additions & 1 deletion templates/bluengrey/save.pstpl
@@ -1,4 +1,5 @@
<div id='savetable'><center>
<div id='savetable'>
<center>
<span class="save-error">{SAVEERROR}</span>
<h3 class="save-heading">{SAVEHEADING}</h3>
<br />
Expand Down
6 changes: 6 additions & 0 deletions templates/bluengrey/template.css
Expand Up @@ -363,6 +363,9 @@ td.answertext {
margin:6px auto;
}

.welcome-text {
}

.x-questions {
color: #333333;
font-size: 0.8em;
Expand All @@ -374,6 +377,9 @@ td.answertext {
.clear-all {
}

.save-all {
}

.assessment-table {
margin: 0 auto;
width: 75%;
Expand Down

0 comments on commit 52ae575

Please sign in to comment.