Commit c0d15981 authored by Chenu Denis's avatar Chenu Denis

[fix] Deactivate for 3.0 (allowing auto update)

parent ac6060cb
...@@ -3,6 +3,8 @@ maintenanceMode ...@@ -3,6 +3,8 @@ maintenanceMode
Set you LimeSurvey instance on maintenance mode, for any purpose, update a survey, update instance .... Set you LimeSurvey instance on maintenance mode, for any purpose, update a survey, update instance ....
Limesurvey lesser 2 compatible version
## Usage ## Usage
In the plugin settings : you find different settings, the most important are the Date / time for maintenance mode. Just set a date with time here : the website are close to public. In the plugin settings : you find different settings, the most important are the Date / time for maintenance mode. Just set a date with time here : the website are close to public.
...@@ -15,11 +17,11 @@ You need [renderMessage](https://framagit.org/SondagePro-LimeSurvey-plugin/rende ...@@ -15,11 +17,11 @@ You need [renderMessage](https://framagit.org/SondagePro-LimeSurvey-plugin/rende
### Via GIT ### Via GIT
- Go to your LimeSurvey Directory - Go to your LimeSurvey Directory
- Clone in plugins/maintenanceMode directory - Clone in plugins/maintenanceMode directory and set to LimeSurvey2 branch
### Via ZIP dowload ### Via ZIP dowload
- Download <http://extensions.sondages.pro/IMG/auto/maintenanceMode.zip> - Download <http://extensions.sondages.pro/IMG/auto/maintenanceMode_ls2.zip>
- Extract : `unzip maintenanceMode.zip` - Extract : `unzip maintenanceMode_ls2.zip`
- Move the directory to plugins/ directory inside LimeSUrvey - Move the directory to plugins/ directory inside LimeSUrvey
## Translation ## Translation
...@@ -29,7 +31,7 @@ The file must be in locale/yourlanguagecode/messages.po, a modele.po is on local ...@@ -29,7 +31,7 @@ The file must be in locale/yourlanguagecode/messages.po, a modele.po is on local
## Home page & Copyright ## Home page & Copyright
- HomePage <http://extension.sondages.pro/> - HomePage <http://extension.sondages.pro/>
- Copyright © 2017 Denis Chenu <http://sondages.pro> - Copyright © 2017-2018 Denis Chenu <http://sondages.pro>
Distributed under [AFFERO GNU GENERAL PUBLIC LICENSE Version 3](http://www.gnu.org/licenses/agpl.txt) licence. Distributed under [AFFERO GNU GENERAL PUBLIC LICENSE Version 3](http://www.gnu.org/licenses/agpl.txt) licence.
If you need a more permissive Licence [contact](http://extensions.sondages.pro/about/contact.html). If you need a more permissive Licence [contact](http://extensions.sondages.pro/about/contact.html).
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* @copyright 2017-2018 Denis Chenu <http://www.sondages.pro> * @copyright 2017-2018 Denis Chenu <http://www.sondages.pro>
* @license AGPL v3 * @license AGPL v3
* @version 0.1.1 * @version 0.1.2
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by * it under the terms of the GNU Affero General Public License as published by
...@@ -61,9 +61,12 @@ class maintenanceMode extends PluginBase { ...@@ -61,9 +61,12 @@ class maintenanceMode extends PluginBase {
); );
public function init() public function init()
{ {
if(intval(App()->getConfig('versionnumber')) >= 3) {
return;
}
$this->subscribe('beforeControllerAction'); $this->subscribe('beforeControllerAction');
$this->subscribe('beforeSurveyPage','beforeControllerAction'); $this->subscribe('beforeSurveyPage','beforeControllerAction');
/* diable login (2.6) for admin */ /* disable login (2.6) for admin */
$this->subscribe('newUserSession'); $this->subscribe('newUserSession');
$this->subscribe('beforeTokenEmail'); $this->subscribe('beforeTokenEmail');
$this->subscribe('beforeActivate'); $this->subscribe('beforeActivate');
...@@ -92,6 +95,14 @@ class maintenanceMode extends PluginBase { ...@@ -92,6 +95,14 @@ class maintenanceMode extends PluginBase {
*/ */
public function getPluginSettings($getValues=true) public function getPluginSettings($getValues=true)
{ {
if(intval(App()->getConfig('versionnumber')) >= 3) {
return array(
'disabled' => array(
'type' => 'info',
'content'=> CHtml::tag("div",array('class'=>'alert alert-danger'),$this->gT('This plugin is not compatible with your version of LimeSurvey. Plugin deactivated')),
),
);
}
$pluginSettings= parent::getPluginSettings($getValues); $pluginSettings= parent::getPluginSettings($getValues);
$apiVersion = \renderMessage\messageHelper::rmLsApiVersion(); $apiVersion = \renderMessage\messageHelper::rmLsApiVersion();
$aDateFormatData = getDateFormatData(Yii::app()->session['dateformat']); $aDateFormatData = getDateFormatData(Yii::app()->session['dateformat']);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment