Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/LimeSurvey/LimeSurvey.git
Browse files Browse the repository at this point in the history
…into master_fix-10001
  • Loading branch information
Shnoulle committed Nov 18, 2015
2 parents 4d80388 + 435ab56 commit 576b168
Show file tree
Hide file tree
Showing 853 changed files with 77,706 additions and 34,708 deletions.
3 changes: 1 addition & 2 deletions application/config/third_party.php
Expand Up @@ -58,8 +58,7 @@
//'css/smoothness/jquery-ui-1.10.0.custom.min.css'
),
'depends' => array(
'jquery',
'bootstrap'
'jquery'
)
),
'jquery-bindWithDelay' => array(
Expand Down
9 changes: 6 additions & 3 deletions application/controllers/AdminController.php
Expand Up @@ -26,6 +26,7 @@ class AdminController extends LSYii_Controller
protected function _init()
{
parent::_init();

App()->getComponent('bootstrap');
$this->_sessioncontrol();
App()->getClientScript()->registerScriptFile(Yii::app()->getConfig('adminscripts') . "admin_core.js");
Expand Down Expand Up @@ -125,15 +126,16 @@ protected function _sessioncontrol()
*/
public function run($action)
{

// Check if the DB is up to date
if (Yii::app()->db->schema->getTable('{{surveys}}'))
{
$sDBVersion = getGlobalSetting('DBVersion');
if ((int) $sDBVersion < Yii::app()->getConfig('dbversionnumber') && $action != 'update' && $action != 'authentication')
$this->redirect(array('/admin/update/sa/db'));
if ((int) $sDBVersion < Yii::app()->getConfig('dbversionnumber') && $action != 'databaseupdate' && $action != 'authentication')
$this->redirect(array('/admin/databaseupdate/sa/db'));
}

if ($action != "update" && $action != "db")
if ($action != "databaseupdate" && $action != "db")
if (empty($this->user_id) && $action != "authentication" && $action != "remotecontrol")
{
if (!empty($action) && $action != 'index')
Expand Down Expand Up @@ -183,6 +185,7 @@ public function getActionClasses()
'checkintegrity' => 'checkintegrity',
'conditions' => 'conditionsaction',
'database' => 'database',
'databaseupdate' => 'databaseupdate',
'dataentry' => 'dataentry',
'dumpdb' => 'dumpdb',
'emailtemplates' => 'emailtemplates',
Expand Down
4 changes: 2 additions & 2 deletions application/controllers/UploaderController.php
Expand Up @@ -295,8 +295,8 @@ function run($actionID)
errorMaxReached: '" . gT('The maximum number of files has been uploaded. You may return back to survey.','js') . "',
errorTooMuch: '" . gT('The maximum number of files has been uploaded. You may return back to survey.','js') . "',
errorNeedMoreConfirm: '" . gT("You need to upload %s more files for this question.\nAre you sure you want to exit?",'js') . "',
deleteFile : '".gt('Delete','js') . "',
editFile : '".gt('Edit','js') . "',
deleteFile : '".gT('Delete','js') . "',
editFile : '".gT('Edit','js') . "',
};
";
$aSurveyInfo=getSurveyInfo($surveyid, $sLanguage);
Expand Down
64 changes: 32 additions & 32 deletions application/controllers/admin/ExpressionValidate.php
Expand Up @@ -83,7 +83,7 @@ public function quota($iSurveyId,$quota,$lang=null)
'aExpressions'=>$aExpressions,
);
$this->getController()->layout=$this->layout;
$this->getController()->pageTitle=gt("Validate quota");
$this->getController()->pageTitle=gT("Validate quota");

$this->getController()->render("/admin/expressions/validationList", $aData);
}
Expand All @@ -107,61 +107,61 @@ public function email($iSurveyId,$lang)
'invitation'=>array(
'subject'=>array(
'attribute'=>'surveyls_email_invite_subj',
'title'=>gt('Invitation email subject'),
'title'=>gT('Invitation email subject'),
),
'message'=>array(
'attribute'=>'surveyls_email_invite',
'title'=>gt('Invitation email body'),
'title'=>gT('Invitation email body'),
),
),
'reminder'=>array(
'subject'=>array(
'attribute'=>'surveyls_email_remind_subj',
'title'=>gt('Reminder email subject'),
'title'=>gT('Reminder email subject'),
),
'message'=>array(
'attribute'=>'surveyls_email_remind',
'title'=>gt('Reminder email body'),
'title'=>gT('Reminder email body'),
),
),
'confirmation'=>array(
'subject'=>array(
'attribute'=>'surveyls_email_confirm_subj',
'title'=>gt('Confirmation email subject'),
'title'=>gT('Confirmation email subject'),
),
'message'=>array(
'attribute'=>'surveyls_email_confirm',
'title'=>gt('Confirmation email body'),
'title'=>gT('Confirmation email body'),
),
),
'registration'=>array(
'subject'=>array(
'attribute'=>'surveyls_email_register_subj',
'title'=>gt('Registration email subject'),
'title'=>gT('Registration email subject'),
),
'message'=>array(
'attribute'=>'surveyls_email_register',
'title'=>gt('Registration email body'),
'title'=>gT('Registration email body'),
),
),
'admin_notification'=>array(
'subject'=>array(
'attribute'=>'email_admin_notification_subj',
'title'=>gt('Basic admin notification subject'),
'title'=>gT('Basic admin notification subject'),
),
'message'=>array(
'attribute'=>'email_admin_notification',
'title'=>gt('Basic admin notification body'),
'title'=>gT('Basic admin notification body'),
),
),
'admin_detailed_notification'=>array(
'subject'=>array(
'attribute'=>'email_admin_responses_subj',
'title'=>gt('Detailed admin notification subject'),
'title'=>gT('Detailed admin notification subject'),
),
'message'=>array(
'attribute'=>'email_admin_responses',
'title'=>gt('Detailed admin notification body'),
'title'=>gT('Detailed admin notification body'),
),
),
);
Expand All @@ -176,12 +176,12 @@ public function email($iSurveyId,$lang)
$aReplacement["SURVEYDESCRIPTION"] = gT("Description of the survey");
// Replaced when sending email with Survey
$aAttributes = getTokenFieldsAndNames($iSurveyId,true);
$aReplacement["TOKEN"] = gt("Token code for this participant");
$aReplacement["TOKEN:EMAIL"] = gt("Email from the token");
$aReplacement["TOKEN:FIRSTNAME"] = gt("First name from token");
$aReplacement["TOKEN:LASTNAME"] = gt("Last name from token");
$aReplacement["TOKEN:TOKEN"] = gt("Token code for this participant");
$aReplacement["TOKEN:LANGUAGE"] = gt("language of token");
$aReplacement["TOKEN"] = gT("Token code for this participant");
$aReplacement["TOKEN:EMAIL"] = gT("Email from the token");
$aReplacement["TOKEN:FIRSTNAME"] = gT("First name from token");
$aReplacement["TOKEN:LASTNAME"] = gT("Last name from token");
$aReplacement["TOKEN:TOKEN"] = gT("Token code for this participant");
$aReplacement["TOKEN:LANGUAGE"] = gT("language of token");
foreach ($aAttributes as $sAttribute=>$aAttribute)
{
$aReplacement['TOKEN:'.strtoupper($sAttribute).'']=sprintf(gT("Token attribute: %s"), $aAttribute['description']);
Expand All @@ -193,23 +193,23 @@ public function email($iSurveyId,$lang)
case 'reminder' :
case 'registration' :
// Replaced when sending email (registration too ?)
$aReplacement["EMAIL"] = gt("Email from the token");
$aReplacement["FIRSTNAME"] = gt("First name from token");
$aReplacement["LASTNAME"] = gt("Last name from token");
$aReplacement["LANGUAGE"] = gt("language of token");
$aReplacement["OPTOUTURL"] = gt("URL for a respondent to opt-out of this survey");
$aReplacement["OPTINURL"] = gt("URL for a respondent to opt-in to this survey");
$aReplacement["SURVEYURL"] = gt("URL of the survey");
$aReplacement["EMAIL"] = gT("Email from the token");
$aReplacement["FIRSTNAME"] = gT("First name from token");
$aReplacement["LASTNAME"] = gT("Last name from token");
$aReplacement["LANGUAGE"] = gT("language of token");
$aReplacement["OPTOUTURL"] = gT("URL for a respondent to opt-out of this survey");
$aReplacement["OPTINURL"] = gT("URL for a respondent to opt-in to this survey");
$aReplacement["SURVEYURL"] = gT("URL of the survey");
foreach ($aAttributes as $sAttribute=>$aAttribute)
{
$aReplacement['' . strtoupper($sAttribute) . ''] = sprintf(gT("Token attribute: %s"), $aAttribute['description']);
}
break;
case 'confirmation' :
$aReplacement["EMAIL"] = gt("Email from the token");
$aReplacement["FIRSTNAME"] = gt("First name from token");
$aReplacement["LASTNAME"] = gt("Last name from token");
$aReplacement["SURVEYURL"] = gt("URL of the survey");
$aReplacement["EMAIL"] = gT("Email from the token");
$aReplacement["FIRSTNAME"] = gT("First name from token");
$aReplacement["LASTNAME"] = gT("Last name from token");
$aReplacement["SURVEYURL"] = gT("URL of the survey");
foreach ($aAttributes as $sAttribute=>$aAttribute)
{
$aReplacement['' . strtoupper($sAttribute) . ''] = sprintf(gT("Token attribute: %s"), $aAttribute['description']);
Expand All @@ -226,7 +226,7 @@ public function email($iSurveyId,$lang)
// $moveResult = LimeExpressionManager::NavigateForwards(); // Seems OK without, nut need $LEM::StartSurvey
break;
default:
throw new CHttpException(400,gt('Invalid type.'));
throw new CHttpException(400,gT('Invalid type.'));
break;
}

Expand All @@ -245,7 +245,7 @@ public function email($iSurveyId,$lang)
}
$aData['aExpressions']=$aExpressions;
$this->getController()->layout=$this->layout;
$this->getController()->pageTitle=sprintf(gt("Validate expression in email : %s"),$sType);
$this->getController()->pageTitle=sprintf(gT("Validate expression in email : %s"),$sType);

$this->getController()->render("/admin/expressions/validationList", $aData);
}
Expand Down
4 changes: 2 additions & 2 deletions application/controllers/admin/conditionsaction.php
Expand Up @@ -816,8 +816,8 @@ function index($subaction, $iSurveyID=null, $gid=null, $qid=null)
$attr = getQuestionAttributeValues($rows['qid']);
$sLanguage=Survey::model()->findByPk($iSurveyID)->language;
// dualscale_header are allways set, but can be empty
$label1 = empty($attr['dualscale_headerA'][$sLanguage]) ? gt('Scale 1') : $attr['dualscale_headerA'][$sLanguage];
$label2 = empty($attr['dualscale_headerB'][$sLanguage]) ? gt('Scale 2') : $attr['dualscale_headerB'][$sLanguage];
$label1 = empty($attr['dualscale_headerA'][$sLanguage]) ? gT('Scale 1') : $attr['dualscale_headerA'][$sLanguage];
$label2 = empty($attr['dualscale_headerB'][$sLanguage]) ? gT('Scale 2') : $attr['dualscale_headerB'][$sLanguage];
$shortanswer = "{$arows['title']}: [" . strip_tags($arows['question']) . "][$label1]";
$shortquestion = $rows['title'].":$shortanswer ".strip_tags($rows['question']);
$cquestions[] = array($shortquestion, $rows['qid'], $rows['type'], $rows['sid'].$X.$rows['gid'].$X.$rows['qid'].$arows['title']."#0");
Expand Down
50 changes: 50 additions & 0 deletions application/controllers/admin/databaseupdate.php
@@ -0,0 +1,50 @@
<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*
* LimeSurvey
* Copyright (C) 2007-2011 The LimeSurvey Project Team / Carsten Schmitz
* All rights reserved.
* License: GNU/GPL License v2 or later, see LICENSE.php
* LimeSurvey is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*
*
*
*/

/**
* Update Database Controller
*
* @package LimeSurvey
* @subpackage Backend
*
* This controller must be accessible by unlogged user (in case of modifications of {{permissions}} blocking the login )
*
*/
class databaseupdate extends Survey_Common_Action
{
/**
* Update database
*/
public function db($continue = null)
{
Yii::app()->loadHelper("update/update");
if(isset($continue) && $continue=="yes")
{
$aViewUrls['output'] = CheckForDBUpgrades($continue);
$aData['display']['header'] = false;
}
else
{
$aData['display']['header'] = true;
$aViewUrls['output'] = CheckForDBUpgrades();
}

$aData['updatedbaction'] = true;

$this->_renderWrappedTemplate('update', $aViewUrls, $aData);
}
}

0 comments on commit 576b168

Please sign in to comment.