Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
TonisOrmisson committed Jul 3, 2017
2 parents 6784ecd + 12c8b86 commit 4a91ce3
Show file tree
Hide file tree
Showing 1,125 changed files with 180,506 additions and 18,360 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Expand Up @@ -54,5 +54,12 @@ Thumbs.db
.buildpath
*.un~
launch.json
# ignore plugins directory by default except LS plugin
# if you want to add a new distributed plugin : add the directory here
/plugins/*
!/plugins/index.html
!/plugins/Demo/
!/plugins/AuditLog/
enabletests


14 changes: 10 additions & 4 deletions application/config/internal.php
Expand Up @@ -43,6 +43,7 @@
// Third party path
'third_party' => realpath(__DIR__ . '/../../third_party'),
'core' => realpath(__DIR__ . '/../../assets/packages'),
'fonts' => realpath(__DIR__ . '/../../fonts'),

// yiistrap configuration
'bootstrap' => realpath(__DIR__ . '/../extensions/bootstrap'),
Expand All @@ -58,6 +59,8 @@
// This line just point application.vendor.Twig to application/third_party/Twig
// @see: ETwigViewRenderer::$twigPathAlias
'application.vendor.Twig'=>'application.third_party.Twig',
// 'CaptchaExtendedAction' => realpath(__DIR__ . '/../extensions/captchaExtended/CaptchaExtendedAction.php'),
// 'CaptchaExtendedValidator' => realpath(__DIR__ . '/../extensions/captchaExtended/CaptchaExtendedValidator.php')
),

'modules'=>array(
Expand All @@ -84,12 +87,13 @@
'application.models.*',
'application.controllers.*',
'application.modules.*',

'bootstrap.helpers.*',
'bootstrap.widgets.*',
'bootstrap.behaviors.*',
'yiiwheels.widgets.select2.WhSelect2',
'third_party.Twig.*'
'third_party.Twig.*',
'ext.captchaExtended.CaptchaExtendedAction',
'ext.captchaExtended.CaptchaExtendedValidator'

),
'preload' => array ('log'),
Expand Down Expand Up @@ -214,6 +218,8 @@
'registerGeneralScript' => 'LS_Twig_Extension::registerGeneralScript',
'registerTemplateScript' => 'LS_Twig_Extension::registerTemplateScript',
'registerScript' => 'LS_Twig_Extension::registerScript',
'unregisterPackage' => 'LS_Twig_Extension::unregisterPackage',
'listCoreScripts' => 'LS_Twig_Extension::listCoreScripts',
'getAllQuestionClasses' => 'LS_Twig_Extension::getAllQuestionClasses',
'intval' => 'intval',
'empty' => 'empty',
Expand All @@ -237,7 +243,7 @@
),

'sandboxConfig' => array(
'tags' => array('if', 'for', 'set', 'autoescape'),
'tags' => array('if', 'for', 'set', 'autoescape', 'block'),
'filters' => array('escape', 'raw', 't', 'merge', 'length', 'gT', 'keys'),
'methods' => array(
'ETwigViewRendererStaticClassProxy' => array("encode", "textfield", "form", "link", "emailField", "beginForm", "endForm", "dropDownList", "htmlButton", "passwordfield" ),
Expand All @@ -248,7 +254,7 @@
'ETwigViewRendererYiiCoreStaticClassesProxy' => array("Html"),
'LSYii_Application' => array("request"),
),
'functions' => array('include', 'dump', 'flatEllipsizeText', 'getLanguageData', 'array_flip', 'array_intersect_key', 'registerPublicCssFile', 'registerTemplateCssFile', 'registerGeneralScript', 'registerTemplateScript', 'registerScript', 'getAllQuestionClasses','intval', 'count', 'empty', 'reset', 'renderCaptcha', 'getPost','getParam', 'getQuery', 'isset', 'str_replace', 'assetPublish', 'image', 'sprintf', 'gT' ),
'functions' => array('include', 'dump', 'flatEllipsizeText', 'getLanguageData', 'array_flip', 'array_intersect_key', 'registerPublicCssFile', 'registerTemplateCssFile', 'registerGeneralScript', 'registerTemplateScript', 'registerScript', 'unregisterPackage', 'listCoreScripts', 'getAllQuestionClasses','intval', 'count', 'empty', 'reset', 'renderCaptcha', 'getPost','getParam', 'getQuery', 'isset', 'str_replace', 'assetPublish', 'image', 'sprintf', 'gT' ),
),

),
Expand Down
4 changes: 2 additions & 2 deletions application/config/packages.php
Expand Up @@ -65,8 +65,8 @@
),

'bootstrap-rtl'=>array( /* Adding boostrap rtl package */
'devBaseUrl' => 'assets/packages/bootstrap-rtl/',
'basePath' => 'core.bootstrap-rtl',
'devBaseUrl' => 'assets/packages/bootstrap/',
'basePath' => 'core.bootstrap',
'css'=> array(
'bootstrap-rtl.css',
),
Expand Down
34 changes: 25 additions & 9 deletions application/config/third_party.php
Expand Up @@ -8,7 +8,7 @@
/* This allow us to use minified version according to debug */
$debug = isset($userConfig['config']['debug']) ? $userConfig['config']['debug'] : 0;
/* To add more easily min version : config > 2 , seems really an core dev issue to fix bootstrap.js ;) */
$minVersion = ($debug>2) ? "":".min";
$minVersion = ($debug>0) ? "":".min";
/* Please : comment the reason, mantis bug link: ajax don't need any package if i don't make error */
/* Ajax must renderPartial (better : always return json) and never render and don't registerScript (IMHO) / Shnoulle on 2016-11-16 */
if(isset($_GET['isAjax'])){
Expand All @@ -19,6 +19,7 @@

// jQuery
'jquery' => array(
'devBaseUrl' => 'third_party/jquery',
'basePath' => 'third_party.jquery',
'js' => array(
'jquery-3.1.1'.$minVersion.'.js',
Expand All @@ -27,16 +28,17 @@
),
// Bootstrap
// This package replace the Yiistrap register() function
// Then instead of using the composer dependency system for templates (will be used for LS3)
// Then instead of using the composer dependency system for templates
// We can use the package dependency system (easier for now)
'bootstrap' => array(
'basePath' => 'bootstrap',
'devBaseUrl' => 'assets/packages/bootstrap/',
'basePath' => 'core.bootstrap',
'css'=> array(
'css/bootstrap.css',/* Admin need it, not public */
'css/yiistrap.css',
'bootstrap'.$minVersion.'.css',/* Admin need it, not public */
'yiistrap'.$minVersion.'.css',
),
'js'=>array(
'js/bootstrap'.$minVersion.'.js'
'bootstrap'.$minVersion.'.js'
),
'depends' => array(
'jquery',
Expand All @@ -59,14 +61,16 @@

'fontawesome' => array(
//'basePath' => 'third_party.bootstrap', // Need fix third_party alias
'basePath' => 'third_party.fontawesome',
'devBaseUrl' => 'fonts/fontawesome/',
'basePath' => 'fonts.fontawesome',
'css'=> array(
'css/font-awesome.min.css',
'css/font-awesome'.$minVersion.'.css',
),
),

// jQuery UI
'jqueryui' => array(
'devBaseUrl' => 'third_party/jquery-ui',
'basePath' => 'third_party.jquery-ui',
'js' => array(
'jquery-ui'.$minVersion.'.js',
Expand Down Expand Up @@ -188,6 +192,7 @@

// Ace
'ace' => array(
'devBaseUrl' => 'third_party/ace',
'basePath' => 'third_party.ace',
'js' => array(
'ace.js'
Expand All @@ -199,6 +204,7 @@

// jQuery Ace
'jquery-ace' => array(
'devBaseUrl' => 'third_party/jquery-ace',
'basePath' => 'third_party.jquery-ace',
'js' => array(
'jquery.ace.js',
Expand Down Expand Up @@ -232,6 +238,7 @@

// Decimal.js calculate in js
'decimal' => array(
'devBaseUrl' => 'third_party/decimal',
'basePath' => 'third_party.decimal',
'js' => array(
'decimal.js'
Expand Down Expand Up @@ -370,5 +377,14 @@
'jquery.autocomplete'.$minVersion.'.js'
),
),

'jszip' => array(
'basePath' => 'third_party.jszip',
'js' => array(
'jszip.js',
'fileSaver.js',
),
'depends' => array(
'jquery',
)
)
);
4 changes: 2 additions & 2 deletions application/config/version.php
Expand Up @@ -13,8 +13,8 @@

$config['versionnumber'] = '3.0.0-alpha'; //The current version of this branch
$config['masterversion'] = '2.62.2'; //The current masters version merged into this branch
$config['dbversionnumber'] = 263;
$config['dbversionnumber'] = 292;
$config['buildnumber'] = '';
$config['updatable'] = true;
$config['assetsversionnumber'] = '2647';
$config['assetsversionnumber'] = '2671';
return $config;
5 changes: 5 additions & 0 deletions application/controllers/InstallerController.php
Expand Up @@ -885,6 +885,11 @@ function check_DirectoryWriteable($directory, &$data, $base, $keyError, $bRecurs
if (!check_PHPFunction('mb_convert_encoding', $aData['mbstringPresent']))
$bProceed = false;

// zlib library check
if (!check_PHPFunction('zlib_get_coding_type', $aData['zlibPresent'])) {
$bProceed = false;
}

// JSON library check
if (!check_PHPFunction('json_encode', $aData['bJSONPresent']))
$bProceed = false;
Expand Down
46 changes: 45 additions & 1 deletion application/controllers/OptoutController.php 100644 → 100755
Expand Up @@ -24,11 +24,55 @@ class OptoutController extends LSYii_Controller {
public $layout = 'bare';
public $defaultAction = 'tokens';


function actiontokens()
{


$iSurveyID = Yii::app()->request->getQuery('surveyid');
$sLanguageCode = Yii::app()->request->getQuery('langcode');
$sToken = Token::sanitizeToken(Yii::app()->request->getQuery('token'));

Yii::app()->loadHelper('database');
Yii::app()->loadHelper('sanitize');

//IF there is no survey id, redirect back to the default public page
if (!$iSurveyID){
$this->redirect(array('/'));
}

$iSurveyID = (int)$iSurveyID; //Make sure it's an integer (protect from SQL injects)
//Check that there is a SID
// Get passed language from form, so that we dont lose this!
if (!isset($sLanguageCode) || $sLanguageCode == "" || !$sLanguageCode)
{
$sBaseLanguage = Survey::model()->findByPk($iSurveyID)->language;
}
else
{
$sBaseLanguage = sanitize_languagecode($sLanguageCode);
}

Yii::app()->setLanguage($sBaseLanguage);

$aSurveyInfo=getSurveyInfo($iSurveyID,$sBaseLanguage);

if ($aSurveyInfo==false || !tableExists("{{tokens_{$iSurveyID}}}")){
throw new CHttpException(404, "The survey in which you are trying to participate does not seem to exist. It may have been deleted or the link you were given is outdated or incorrect.");
}else{
$sMessage = "<p>".gT('Please confirm that you want to opt out of this survey by clicking the button below.').'<br>'. gT("After confirmation you won't receive any invitations or reminders for this survey anymore.")."</p>";
$sMessage .= '<p><a href="'.Yii::app()->createUrl('optout/removetokens', array('surveyid'=>$iSurveyID, 'langcode'=> $sBaseLanguage, 'token' => $sToken )).'" class="btn btn-default btn-lg">'.gT("I confirm").'</a><p>';
$this->_renderHtml($sMessage, $aSurveyInfo, $iSurveyID);
}


}

/**
* This function is run when opting out of an individual token table. The other function /optout/participants
* opts the user out of ALL survey invitations from the system
*/
function actiontokens()
function actionremovetokens()
{
$iSurveyID=Yii::app()->request->getQuery('surveyid');
$sLanguageCode=Yii::app()->request->getQuery('langcode');
Expand Down
6 changes: 3 additions & 3 deletions application/controllers/RegisterController.php
Expand Up @@ -48,8 +48,8 @@ public function actions()
{
return array(
'captcha' => array(
'class' => 'CCaptchaAction',
'backColor'=>0xf6f6f6
'class' => 'CaptchaExtendedAction',
'mode'=>CaptchaExtendedAction::MODE_MATH
)
);
}
Expand Down Expand Up @@ -471,7 +471,7 @@ private function display($iSurveyId)
$oTemplate = Template::model()->getInstance('', $iSurveyId);
Yii::app()->clientScript->registerPackage( 'survey-template' );

$this->sTemplate=$oTemplate->name;
$this->sTemplate=$oTemplate->sTemplateName;
if(!$this->sMessage){
$this->aGlobalData['languagechanger']=makeLanguageChangerSurvey($sLanguage); // Only show language changer shown the form is shown, not after submission
$this->aReplacementData['content']=self::getRegisterForm($iSurveyId);
Expand Down
5 changes: 3 additions & 2 deletions application/controllers/SurveyController.php
Expand Up @@ -80,8 +80,9 @@ public function actions()
'uploader' => 'application.controllers.uploader',
'verification' => 'application.controllers.verification',
'captcha' => array(
'class' => 'CCaptchaAction',
'backColor'=>0xf6f6f6
'class'=>'CaptchaExtendedAction',
// if needed, modify settings
'mode'=>CaptchaExtendedAction::MODE_MATH,
)
);
}
Expand Down
7 changes: 3 additions & 4 deletions application/controllers/SurveysController.php
Expand Up @@ -31,7 +31,7 @@ public function actionPublicList($lang = null)
//$oTemplate->registerAssets();


$this->sTemplate = $oTemplate->name;
$this->sTemplate = $oTemplate->sTemplateName;
//Yii::app()->clientScript->registerPackage( 'survey-template' );
//Yii::app()->clientScript->registerPackage( 'survey-template-'.$oTemplate->sTemplateName );
//var_dump('survey-template-'.$oTemplate->sTemplateName);
Expand Down Expand Up @@ -70,7 +70,7 @@ public function actionError()
{
$oTemplate = Template::model()->getInstance(Yii::app()->getConfig("defaulttemplate"));

$this->sTemplate = $oTemplate->name;
$this->sTemplate = $oTemplate->sTemplateName;

$error = Yii::app()->errorHandler->error;
if ($error){
Expand All @@ -81,5 +81,4 @@ public function actionError()
}
}

}
?>
}

0 comments on commit 4a91ce3

Please sign in to comment.