Skip to content

Commit

Permalink
Merge branch '2.05' of github.com:LimeSurvey/LimeSurvey into 2.05
Browse files Browse the repository at this point in the history
  • Loading branch information
SamMousa committed Jul 22, 2013
2 parents 5011e6b + f346fea commit c12f391
Show file tree
Hide file tree
Showing 12 changed files with 37 additions and 13 deletions.
4 changes: 3 additions & 1 deletion application/controllers/admin/remotecontrol.php
Expand Up @@ -99,6 +99,8 @@ public function test()
Yii::app()->loadLibrary('jsonRPCClient');
$client = new jsonRPCClient($serverUrl);
}
else die('RPC interface not activated in global settings');


$sSessionKey= $client->call('get_session_key', array('admin','password'));
if (is_array($sSessionKey)) {echo $sSessionKey['status']; die();}
Expand Down Expand Up @@ -160,4 +162,4 @@ public function test()
}


}
}
5 changes: 5 additions & 0 deletions application/controllers/admin/surveyadmin.php
Expand Up @@ -306,6 +306,11 @@ public function deactivate($iSurveyID = null)
$iSurveyID = Yii::app()->request->getPost('sid', $iSurveyID);
$iSurveyID = sanitize_int($iSurveyID);
$clang = $this->getController()->lang;
if (!tableExists('survey_'.$iSurveyID))
{
$_SESSION['flashmessage'] = $clang->gT("Error: Response table does not exist. Survey cannot be deactivated.");
$this->getController()->redirect($this->getController()->createUrl("admin/survey/sa/view/surveyid/{$iSurveyID}"));
}
$date = date('YmdHis'); //'His' adds 24hours+minutes to name to allow multiple deactiviations in a day

if (empty($_POST['ok']))
Expand Down
6 changes: 3 additions & 3 deletions application/controllers/admin/templates.php
Expand Up @@ -197,18 +197,18 @@ private function _templateFixes($templatename)
if(strpos($content, "{TEMPLATEJS}")===false)
{
$templateFixes['success']=false;
$templateFixes['details']['templatejs']="Unable to adding {TEMPLATEJS} placeholder, please control your startpage.pstpl.";
$templateFixes['details']['templatejs']=$clang->gT("Unable to add {TEMPLATEJS} placeholder, please check your startpage.pstpl.");
}
else
{
$templateFixes['details']['templatejs']="Placeholder {TEMPLATEJS} added to your startpage.pstpl.";
$templateFixes['details']['templatejs']=$clang->gT("Placeholder {TEMPLATEJS} added to your startpage.pstpl.");
}
}
}
else
{
$templateFixes['success']=false;
$templateFixes['details']['templatejs']="Unable to find startpage.pstpl to add {TEMPLATEJS} placeholder, please control your template.";
$templateFixes['details']['templatejs']=$clang->gT("Unable to find startpage.pstpl to add {TEMPLATEJS} placeholder, please check your template.");
}
return $templateFixes;
}
Expand Down
2 changes: 1 addition & 1 deletion application/core/LSYii_Application.php
Expand Up @@ -109,7 +109,7 @@ public function __construct($config = null)
'getSurveys_json',
'remotecontrol'
),
'enableCsrfValidation'=>false, // Enable to activate CSRF protection
'enableCsrfValidation'=>true, // CSRF protection
'enableCookieValidation'=>false // Enable to activate cookie protection
));

Expand Down
2 changes: 1 addition & 1 deletion application/helpers/SurveyRuntimeHelper.php
Expand Up @@ -679,7 +679,7 @@ function run($surveyid,$args) {
}

$redata['completed'] = implode("\n", $blocks) ."\n". $redata['completed'];

$redata['thissurvey']['surveyls_url'] = $thissurvey['surveyls_url'];

echo templatereplace(file_get_contents($sTemplatePath."completed.pstpl"), array('completed' => $completed), $redata);
echo "\n";
Expand Down
2 changes: 2 additions & 0 deletions application/helpers/admin/htmleditor_helper.php
Expand Up @@ -133,6 +133,8 @@ function getEditor($fieldtype,$fieldname,$fieldtext, $surveyID=null,$gID=null,$q

if ( ($fieldtype == 'email-inv' ||
$fieldtype == 'email-reg' ||
$fieldtype == 'email-admin-notification' ||
$fieldtype == 'email-admin-resp' ||
$fieldtype == 'email-conf' ||
$fieldtype == 'email-rem' ) &&
getEmailFormat($surveyID) != 'html')
Expand Down
6 changes: 3 additions & 3 deletions application/helpers/frontend_helper.php
Expand Up @@ -1429,10 +1429,10 @@ function buildsurveysession($surveyid,$preview=false)
echo '<div id="wrapper"><p id="tokenmessage">'.$clang->gT("This is a controlled survey. You need a valid token to participate.")."<br />";
echo $clang->gT("If you have been issued a token, please enter it in the box below and click continue.")."</p>
<script type='text/javascript'>var focus_element='#token';</script>"
.CHtml::form(array("/survey/index/sid/{$surveyid}"), 'post', array('id'=>'tokenform'))."
.CHtml::form(array("/survey/index/sid/{$surveyid}"), 'post', array('id'=>'tokenform','autocomplete'=>'off'))."
<ul>
<li>";?>
<label for='token'><?php $clang->eT("Token:");?></label><input class='text <?php echo $kpclass?>' id='token' type='text' name='token' />
<label for='token'><?php $clang->eT("Token:");?></label><input class='text <?php echo $kpclass?>' id='token' type='password' name='token' value='' />
<?php
echo "<input type='hidden' name='sid' value='".$surveyid."' id='sid' />
<input type='hidden' name='lang' value='".$templang."' id='lang' />";
Expand Down Expand Up @@ -1602,7 +1602,7 @@ function buildsurveysession($surveyid,$preview=false)
<input type='hidden' name='loadpass' value='".htmlspecialchars($_GET['loadpass'])."' id='loadpass' />";
}

echo '<label for="token">'.$clang->gT("Token")."</label><input class='text' type='text' id='token' name='token'></li>";
echo '<label for="token">'.$clang->gT("Token")."</label><input class='text' type='password' id='token' name='token'></li>";
}
else
{
Expand Down
16 changes: 12 additions & 4 deletions application/helpers/qanda_helper.php
Expand Up @@ -155,7 +155,7 @@ function retrieveAnswers($ia)
$values=do_ranking($ia);
if (count($values[1]) > 1 && $aQuestionAttributes['hide_tip']==0)
{
$question_text['help'] = $clang->gT("Click on an item in the list on the left, starting with your highest ranking item, moving through to your lowest ranking item.");
$question_text['help'] = $clang->gT("Double-click or drag-and-drop items in the left list to move them to the right - your highest ranking item should be on the top right, moving through to your lowest ranking item.");
}
break;
case 'M': //Multiple choice checkbox
Expand Down Expand Up @@ -1208,13 +1208,21 @@ function do_date($ia)
}
}

$answer .= '<input class="text" type="text" size="10" name="'.$ia[1].'" style="display: none" id="answer'.$ia[1].'" value="'.$_SESSION['survey_'.Yii::app()->getConfig('surveyID')][$ia[1]].'" maxlength="10" alt="'.$clang->gT('Answer').'" onchange="'.$checkconditionFunction.'(this.value, this.name, this.type)" />
// Format the date for output
if (trim($_SESSION['survey_'.Yii::app()->getConfig('surveyID')][$ia[1]])!='')
{
$datetimeobj = new Date_Time_Converter($_SESSION['survey_'.Yii::app()->getConfig('surveyID')][$ia[1]] , "Y-m-d H:i");
$dateoutput = $datetimeobj->convert($dateformatdetails['phpdate']);
}
else
{
$dateoutput='';
}
$answer .= '<input class="text" type="text" size="10" name="'.$ia[1].'" style="display: none" id="answer'.$ia[1].'" value="'.htmlspecialchars($dateoutput,ENT_QUOTES,'utf-8').'" maxlength="10" alt="'.$clang->gT('Answer').'" onchange="'.$checkconditionFunction.'(this.value, this.name, this.type)" />
</p>';
$answer .= '<input type="hidden" name="qattribute_answer[]" value="'.$ia[1].'" />
<input type="hidden" id="qattribute_answer'.$ia[1].'" name="qattribute_answer'.$ia[1].'" />
<input type="hidden" id="dateformat'.$ia[1].'" value="'.$dateformatdetails['jsdate'].'"/>';


}
else
{
Expand Down
7 changes: 7 additions & 0 deletions application/helpers/surveytranslator_helper.php
Expand Up @@ -125,6 +125,13 @@ function getLanguageData($bOrderByNative=false,$sLanguageCode='en') {
$supportedLanguages['bg']['dateformat'] = 1;
$supportedLanguages['bg']['radixpoint'] = 0;

// Catalan
$supportedLanguages['ca-valencia']['description'] = $clang->gT('Catalan (Valencian)');
$supportedLanguages['ca-valencia']['nativedescription'] = 'Catal&#224; (Valencià)';
$supportedLanguages['ca-valencia']['rtl'] = false;
$supportedLanguages['ca-valencia']['dateformat'] = 1;
$supportedLanguages['ca-valencia']['radixpoint'] = 1;

// Catalan
$supportedLanguages['ca']['description'] = $clang->gT('Catalan');
$supportedLanguages['ca']['nativedescription'] = 'Catal&#224;';
Expand Down
Binary file added locale/ca-valencia/LC_MESSAGES/ca-valencia.mo
Binary file not shown.
Empty file.
Empty file added locale/ca-valencia/index.html
Empty file.

0 comments on commit c12f391

Please sign in to comment.