Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch '2.05' of git@github.com:LimeSurvey/LimeSurvey.git into …
…2.05
  • Loading branch information
Shnoulle committed Oct 14, 2013
2 parents 8f5dd6a + b598e38 commit f73d72d
Show file tree
Hide file tree
Showing 762 changed files with 4,345 additions and 2,344 deletions.
2 changes: 1 addition & 1 deletion application/config/tcpdf.php
Expand Up @@ -127,7 +127,7 @@
* of a two-element array containing the width and the height.
************************************************************/

$tcpdf['page_format'] = 'LETTER';
$tcpdf['page_format'] = 'A4';


/************************************************************
Expand Down
2 changes: 1 addition & 1 deletion application/controllers/UploaderController.php
Expand Up @@ -13,7 +13,7 @@
* $Id$
*/

class UploaderController extends AdminController {
class UploaderController extends SurveyController {
function run($actionID)
{
$surveyid= $_SESSION['LEMsid'];
Expand Down
2 changes: 2 additions & 0 deletions application/controllers/admin/export.php
Expand Up @@ -1040,6 +1040,8 @@ public function showquexmlsurvey()
Yii::import("application.libraries.admin.quexmlpdf", TRUE);
$quexmlpdf = new quexmlpdf($this->getController());

$quexmlpdf->setLanguage($surveyprintlang);

set_time_limit(120);

$noheader = TRUE;
Expand Down
2 changes: 1 addition & 1 deletion application/controllers/admin/globalsettings.php
Expand Up @@ -87,7 +87,7 @@ private function _displaySettings()
$data['sUpdateNotification'] = getGlobalSetting('updatenotification');
Yii::app()->loadLibrary('Date_Time_Converter');
$dateformatdetails = getDateFormatData(Yii::app()->session['dateformat']);
$datetimeobj = new date_time_converter(getGlobalSetting("updatelastcheck"), 'Y-m-d H:i:s');
$datetimeobj = new date_time_converter(dateShift(getGlobalSetting("updatelastcheck"),'Y-m-d H:i:s',getGlobalSetting('timeadjust')), 'Y-m-d H:i:s');
$data['updatelastcheck']=$datetimeobj->convert($dateformatdetails['phpdate'] . " H:i:s");

$data['updateavailable'] = (getGlobalSetting("updateavailable") && Yii::app()->getConfig("updatable"));
Expand Down
2 changes: 1 addition & 1 deletion application/controllers/admin/participantsaction.php
Expand Up @@ -1309,7 +1309,7 @@ function uploadCSV()
if (!empty($attname)) {
$bData = array('participant_id' => $aData,
'attribute_id' => $attid,
'value' => $writearray[strtolower($attname]));
'value' => $writearray[strtolower($attname)]);
ParticipantAttribute::model()->updateParticipantAttributeValue($bData);
} else {
//If the value is empty, don't write the value
Expand Down
4 changes: 2 additions & 2 deletions application/controllers/admin/printablesurvey.php
Expand Up @@ -1753,15 +1753,15 @@ private function _array_filter_help($qidattributes, $surveyprintlang, $surveyid)
{
$newquestiontext = Question::model()->findByAttributes(array('title' => $qidattributes['array_filter'], 'language' => $surveyprintlang, 'sid' => $surveyid))->getAttribute('question');
$output .= "\n<p class='extrahelp'>
".sprintf($clang->gT("Only answer this question for the items you selected in question %s ('%s')"),$qidattributes['array_filter'], flattenText(breakToNewline($newquestiontext['question'])))."
".sprintf($clang->gT("Only answer this question for the items you selected in question %s ('%s')"),$qidattributes['array_filter'], flattenText(breakToNewline($newquestiontext)))."
</p>\n";
}
if(!empty($qidattributes['array_filter_exclude']))
{
$newquestiontext = Question::model()->findByAttributes(array('title' => $qidattributes['array_filter_exclude'], 'language' => $surveyprintlang, 'sid' => $surveyid))->getAttribute('question');

$output .= "\n <p class='extrahelp'>
".sprintf($clang->gT("Only answer this question for the items you did not select in question %s ('%s')"),$qidattributes['array_filter_exclude'], breakToNewline($newquestiontext['question']))."
".sprintf($clang->gT("Only answer this question for the items you did not select in question %s ('%s')"),$qidattributes['array_filter_exclude'], breakToNewline($newquestiontext))."
</p>\n";
}
return $output;
Expand Down
12 changes: 7 additions & 5 deletions application/controllers/admin/translate.php
Expand Up @@ -118,8 +118,8 @@ private function _translateSave($iSurveyID, $tolang, $baselang, $tab_names)
{
$id1 = Yii::app()->getRequest()->getPost("{$type}_id1_{$i}");
$id2 = Yii::app()->getRequest()->getPost("{$type}_id2_{$i}");

$this->query($type, 'queryupdate', $iSurveyID, $tolang, $baselang, $id1, $id2, $new);
$iScaleID = Yii::app()->getRequest()->getPost("{$type}_scaleid_{$i}");
$this->query($type, 'queryupdate', $iSurveyID, $tolang, $baselang, $id1, $id2, $iScaleID, $new);
}
}
$i++;
Expand Down Expand Up @@ -578,6 +578,7 @@ private function setupTranslateFields($type)
'dbColumn' => 'answer',
'id1' => 'qid',
'id2' => 'code',
'scaleid' => 'scale_id',
'gid' => FALSE,
'qid' => TRUE,
'description' => $clang->gT("Answer options"),
Expand Down Expand Up @@ -740,7 +741,7 @@ private function setupTranslateFields($type)
return $aData;
}

private function query($type, $action, $iSurveyID, $tolang, $baselang, $id1 = "", $id2 = "", $new = "")
private function query($type, $action, $iSurveyID, $tolang, $baselang, $id1 = "", $id2 = "", $iScaleID="", $new = "")
{
$amTypeOptions = array();
switch ($action)
Expand Down Expand Up @@ -818,8 +819,7 @@ private function query($type, $action, $iSurveyID, $tolang, $baselang, $id1 = ""
case 'subquestion':
return Question::model()->updateByPk(array('qid'=>$id1, 'language'=>$tolang),array('question' => $new), 'sid=:sid', array(':sid'=>$iSurveyID));
case 'answer':
return Answer::model()->updateByPk(array('qid'=>$id1, 'code'=>$id2, 'language'=>$tolang, 'scale_id'=>0),array('answer' => $new));
// @todo: FIXME for dual scale answer options
return Answer::model()->updateByPk(array('qid'=>$id1, 'code'=>$id2, 'language'=>$tolang, 'scale_id'=>$iScaleID),array('answer' => $new));
}

}
Expand Down Expand Up @@ -878,6 +878,7 @@ private function displayTranslateFields($iSurveyID, $gid, $qid, $type, $amTypeOp

$value1 = ( ! empty($amTypeOptions["id1"]) ) ? $rowfrom[$amTypeOptions["id1"]] : "";
$value2 = ( ! empty($amTypeOptions["id2"]) ) ? $rowfrom[$amTypeOptions["id2"]] : "";
$iScaleID = ( ! empty($amTypeOptions["scaleid"]) ) ? $rowfrom[$amTypeOptions["scaleid"]] : "";

// Display text in original language
// Display text in foreign language. Save a copy in type_oldvalue_i to identify changes before db update
Expand Down Expand Up @@ -908,6 +909,7 @@ private function displayTranslateFields($iSurveyID, $gid, $qid, $type, $amTypeOp
$translateoutput .= CHtml::openTag('td');
$translateoutput .= CHtml::hiddenField("{$type}_id1_{$i}", $value1);
$translateoutput .= CHtml::hiddenField("{$type}_id2_{$i}", $value2);
if ($iScaleID!='') $translateoutput .= CHtml::hiddenField("{$type}_scaleid_{$i}", $iScaleID);

$nrows = max($this->calc_nrows($textfrom), $this->calc_nrows($textto));

Expand Down
5 changes: 2 additions & 3 deletions application/controllers/survey/index.php
Expand Up @@ -695,9 +695,9 @@ function _loadRequiredHelpersAndLibraries()

function _loadLimesurveyLang($mvSurveyIdOrBaseLang)
{
if ( is_numeric($mvSurveyIdOrBaseLang) && Survey::model()->find($mvSurveyIdOrBaseLang))
if ( is_numeric($mvSurveyIdOrBaseLang) && Survey::model()->findByPk($mvSurveyIdOrBaseLang))
{
$baselang = Survey::model()->find($mvSurveyIdOrBaseLang)->language;
$baselang = Survey::model()->findByPk($mvSurveyIdOrBaseLang)->language;
}
elseif (!empty($mvSurveyIdOrBaseLang))
{
Expand All @@ -707,7 +707,6 @@ function _loadLimesurveyLang($mvSurveyIdOrBaseLang)
{
$baselang = Yii::app()->getConfig('defaultlang');
}

Yii::import("application.libraries.Limesurvey_lang");

return new Limesurvey_lang($baselang);
Expand Down
8 changes: 4 additions & 4 deletions application/helpers/export_helper.php
Expand Up @@ -1039,7 +1039,7 @@ function quexml_create_multi(&$question,$qid,$varname,$scale_id = false,$free =
else
$response->appendChild(QueXMLCreateFree($free['f'],$free['len'],$Row['question']));

$response->setAttribute("varName",$varname . QueXMLCleanup($Row['title']));
$response->setAttribute("varName",QueXMLCleanup($Row['title']));

$question->appendChild($response);
}
Expand Down Expand Up @@ -1105,7 +1105,7 @@ function quexml_create_subQuestions(&$question,$qid,$varname,$use_answers = fals
$subQuestion = $dom->createElement("subQuestion");
$text = $dom->createElement("text",QueXMLCleanup($Row['question'],''));
$subQuestion->appendChild($text);
$subQuestion->setAttribute("varName",$varname . QueXMLCleanup($Row['title']));
$subQuestion->setAttribute("varName",$varname .'_'. QueXMLCleanup($Row['title']));
$question->appendChild($subQuestion);
}

Expand Down Expand Up @@ -1344,8 +1344,8 @@ function quexml_export($surveyi, $quexmllan)
$question->appendChild($response);
break;
case "S": //SHORT FREE TEXT
// default is fieldlength of 25 characters.
$response->appendChild(QueXMLCreateFree("text",quexml_get_lengthth($qid,"maximum_chars","25"),""));
// default is fieldlength of 24 characters.
$response->appendChild(QueXMLCreateFree("text",quexml_get_lengthth($qid,"maximum_chars","24"),""));
$question->appendChild($response);
break;
case "T": //LONG FREE TEXT
Expand Down
24 changes: 23 additions & 1 deletion application/libraries/admin/quexmlpdf.php
Expand Up @@ -40,6 +40,11 @@ class quexmlpdf extends pdf {
*/
const INCH_IN_MM = 25.4;

/**
* Language for translation
*/
protected $language = "en";

/**
* Pixels per inch of exported document
*
Expand Down Expand Up @@ -715,6 +720,12 @@ class quexmlpdf extends pdf {
*/
protected $sectionHeight = 18;

public function setLanguage($language)
{
if (!empty($language))
$this->language = $language;
}

/**
* Return the length of the longest word
*
Expand Down Expand Up @@ -1325,6 +1336,8 @@ public function getQuestionnaireId()
*/
public function createqueXML($quexml)
{
$clang = new limesurvey_lang($this->language);

$xml = new SimpleXMLElement($quexml);

$q = array();
Expand Down Expand Up @@ -1356,7 +1369,7 @@ public function createqueXML($quexml)
{
$stmp = array();
$sl = $this->numberToLetter($scount);
$stmp['title'] = "Section " . $sl;
$stmp['title'] = $clang->gT("Section") . " " . $sl;
$stmp['info'] = "";
$stmp['text'] = "";

Expand Down Expand Up @@ -1695,6 +1708,15 @@ protected function createQuestion($question)

$bgtype = 3; //box group type temp set to 3 (text)

// question with > 1 responses and >1 subquestions --> matrix question --> need to come up with unique variable names
if (count($question['responses'])>1)
{
foreach ($subquestions as $index=>$sv)
{
$subquestions[$index]['varname']=$subquestions[$index]['varname'].'_'.$varname;
}
}

switch ($type)
{
case 'fixed':
Expand Down
23 changes: 12 additions & 11 deletions application/models/Token.php
Expand Up @@ -137,17 +137,19 @@ public function rules()

public function scopes()
{
return array(
'incomplete' => array(
'condition' => 'completed = "N"'
),
'usable' => array(
'condition' => 'usesleft > 0 AND COALESCE(validuntil, NOW()) >= NOW() AND COALESCE(validfrom, NOW()) <= NOW()'
),
'editable' => array(
'condition' => 'COALESCE(validuntil, NOW()) >= NOW() AND COALESCE(validfrom, NOW()) <= NOW()'
$now = date('Y-m-d H:i:s');

return array(
'incomplete' => array(
'condition' => 'completed = "N"'
),
array(
'condition' => "COALESCE(validuntil, '$now') >= '$now' AND COALESCE(validfrom, '$now') <= '$now'"
),
array(
'condition' => "usesleft > 0 AND COALESCE(validuntil, '$now') >= '$now' AND COALESCE(validfrom, '$now') <= '$now'"
)
);
);
}
public function summary()
{
Expand All @@ -167,7 +169,6 @@ public function tableName()
{
return '{{tokens_' . $this->id . '}}';
}

}

?>
2 changes: 1 addition & 1 deletion application/views/admin/globalSettings_view.php
Expand Up @@ -211,7 +211,7 @@
<?php $dateformatdata=getDateFormatData(Yii::app()->session['dateformat']); ?>
<li><label for='timeadjust'><?php $clang->eT("Time difference (in hours):"); ?></label>
<span><input type='text' size='10' id='timeadjust' name='timeadjust' value="<?php echo htmlspecialchars(str_replace(array('+',' hours',' minutes'),array('','',''),getGlobalSetting('timeadjust'))/60); ?>" />
<?php echo $clang->gT("Server time:").' '.convertDateTimeFormat(date('Y-m-d H:i:s'),'Y-m-d H:i:s',$dateformatdata['phpdate'].' H:i')." - ". $clang->gT("Corrected time :").' '.convertDateTimeFormat(dateShift(date("Y-m-d H:i:s"), 'Y-m-d H:i:s', getGlobalSetting('timeadjust')),'Y-m-d H:i:s',$dateformatdata['phpdate'].' H:i'); ?>
<?php echo $clang->gT("Server time:").' '.convertDateTimeFormat(date('Y-m-d H:i:s'),'Y-m-d H:i:s',$dateformatdata['phpdate'].' H:i')." - ". $clang->gT("Corrected time:").' '.convertDateTimeFormat(dateShift(date("Y-m-d H:i:s"), 'Y-m-d H:i:s', getGlobalSetting('timeadjust')),'Y-m-d H:i:s',$dateformatdata['phpdate'].' H:i'); ?>
</span></li>

<li><label for='iSessionExpirationTime'><?php $clang->eT("Session lifetime (seconds):"); ?></label>
Expand Down
2 changes: 0 additions & 2 deletions styles/darkblue/adminstyle.css
Expand Up @@ -356,8 +356,6 @@ textarea {
}

.listboxtemplates {
margin-top: 10px;
height: 20px;
color: #333;
width: 180px;
}
Expand Down
2 changes: 0 additions & 2 deletions styles/gringegreen/adminstyle.css
Expand Up @@ -356,8 +356,6 @@ textarea {
}

.listboxtemplates {
margin-top: 10px;
height: 20px;
color: #333;
width: 180px;
}
Expand Down
2 changes: 1 addition & 1 deletion third_party/ckeditor/.htaccess
@@ -1,5 +1,5 @@
#
# Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
# Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
# For licensing, see LICENSE.html or http://ckeditor.com/license
#

Expand Down
26 changes: 24 additions & 2 deletions third_party/ckeditor/CHANGES.html
@@ -1,6 +1,6 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!--
Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
-->
<html xmlns="http://www.w3.org/1999/xhtml">
Expand Down Expand Up @@ -34,6 +34,28 @@
<h1>
CKEditor Changelog
</h1>
<h3>
CKEditor 3.6.6.1</h3>
<p>
Fixed issues:</p>
<ul>
<li>Security update: Added protection against XSS attack and possible path disclosure in PHP sample.</li>
</ul>
<h3>
CKEditor 3.6.6</h3>
<p>
Fixed issues:</p>
<ul>
<li><a href="http://dev.ckeditor.com/ticket/9866">#9866</a> : [IE10] The full toolbar is displayed in two lines in RTL environment.</li>
<li><a href="http://dev.ckeditor.com/ticket/9483">#9483</a> : [IE10] Fixed script error on float panel opening.</li>
<li><a href="http://dev.ckeditor.com/ticket/6410">#6410</a> : SCAYT will show no suggestions when appropriate, instead of not appearing.</li>
<li><a href="http://dev.ckeditor.com/ticket/7533">#7533</a>, <a href="http://dev.ckeditor.com/ticket/9439">#9439</a> : Fixed SCAYT issues with setData().</li>
<li><a href="http://dev.ckeditor.com/ticket/9167">#9167</a> : Improper HTML transformations happening on specific cases.</li>
<li><a href="http://dev.ckeditor.com/ticket/9553">#9553</a> : Properly handle dash values in the style field of dialogs.</li>
<li><a href="http://dev.ckeditor.com/ticket/9787">#9787</a> : [IE9] onChange wasn't fired for checkboxes in dialogs.</li>
<li><a href="http://dev.ckeditor.com/ticket/8888">#8888</a> : It was not possible to scroll dialogs on very small viewports.</li>
<li><a href="http://dev.ckeditor.com/ticket/9594">#9594</a> : The TAB key was having no effect on focused read-only editor.</li>
</ul>
<h3>
CKEditor 3.6.5</h3>
<p>
Expand Down Expand Up @@ -1568,7 +1590,7 @@ <h3>
CKEditor - The text editor for Internet - <a href="http://ckeditor.com/">http://ckeditor.com</a>
</p>
<p id="copy">
Copyright &copy; 2003-2012, <a href="http://cksource.com/">CKSource</a> - Frederico
Copyright &copy; 2003-2013, <a href="http://cksource.com/">CKSource</a> - Frederico
Knabben. All rights reserved.
</p>
</div>
Expand Down
4 changes: 2 additions & 2 deletions third_party/ckeditor/INSTALL.html
@@ -1,6 +1,6 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!--
Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
-->
<html xmlns="http://www.w3.org/1999/xhtml">
Expand Down Expand Up @@ -84,7 +84,7 @@ <h3>
CKEditor - The text editor for Internet - <a href="http://ckeditor.com/">http://ckeditor.com</a>
</p>
<p id="copy">
Copyright &copy; 2003-2012, <a href="http://cksource.com/">CKSource</a> - Frederico
Copyright &copy; 2003-2013, <a href="http://cksource.com/">CKSource</a> - Frederico
Knabben. All rights reserved.
</p>
</div>
Expand Down
4 changes: 2 additions & 2 deletions third_party/ckeditor/LICENSE.html
Expand Up @@ -7,7 +7,7 @@
==========================
CKEditor - The text editor for Internet - http://ckeditor.com
Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
Licensed under the terms of any of the following licenses at your
choice:
Expand Down Expand Up @@ -1279,7 +1279,7 @@ <h1>
<p>
<strong>CKEditor&trade;</strong> - The text editor for Internet&trade; - <a href="http://ckeditor.com">
http://ckeditor.com</a><br />
Copyright &copy; 2003-2012, <a href="http://cksource.com/">CKSource</a> - Frederico Knabben. All rights reserved.
Copyright &copy; 2003-2013, <a href="http://cksource.com/">CKSource</a> - Frederico Knabben. All rights reserved.
</p>
<p>
Licensed under the terms of any of the following licenses at your choice:
Expand Down
4 changes: 2 additions & 2 deletions third_party/ckeditor/_samples/adobeair/application.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<!--
Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
-->
<application xmlns="http://ns.adobe.com/air/application/1.0">
Expand All @@ -9,7 +9,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
<version>1.0</version>
<filename>CKEditor AIR Samples</filename>
<description>This is a sample AIR application of CKEditor.</description>
<copyright>Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.</copyright>
<copyright>Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.</copyright>
<initialWindow>
<content>_samples/adobeair/sample.html</content>
<title>CKEditor - Adobe AIR Sample</title>
Expand Down

0 comments on commit f73d72d

Please sign in to comment.