Commit 81c6ce0d authored by Chenu Denis's avatar Chenu Denis

[feature] 4.X compatibility version (check on 4.4.0-RC2)

parent b5e64281
<?xml version="1.0" encoding="UTF-8"?>
<config>
<metadata>
<name>matomoPublicTrack</name>
<type>plugin</type>
<creationDate>2019-10-29</creationDate>
<last_update>2021-01-11</last_update>
<author>Denis Chenu</author>
<authorUrl>https://www.sondages.pro</authorUrl>
<version>0.3.2</version>
<license>GPL</license>
<description><![CDATA[Add matomo script and img in public part with possibility to use custom variables and custom dimensuions from survey data. A companion plugin for matomo exist to save automatically survey id and response id.]]></description>
</metadata>
<compatibility>
<version>3</version>
<version>4</version>
</compatibility>
<updaters disabled="disabled">
</updaters>
</config>
......@@ -5,7 +5,7 @@
* @author Denis Chenu <denis@sondages.pro>
* @copyright 2019-2020 Denis Chenu <http://www.sondages.pro>
* @license GPL v3
* @version 0.3.1
* @version 0.3.2
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -249,10 +249,11 @@ class matomoPublicTrack extends PluginBase
$aData['lang'] = array(
'Matomo settings for this survey' => $this->gT('Matomo settings for this survey'),
);
$surveyViewController = (version_compare(App()->getConfig('versionnumber'), '4', "<")) ? 'admin/survey/sa/view' : 'surveyAdministration/view';
$aData['form'] = array(
'action' => Yii::app()->createUrl('admin/pluginhelper/sa/sidebody', array('plugin' => get_class($this),'method' => 'actionSaveSettings','surveyId' => $surveyId)),
'reset' => Yii::app()->createUrl('admin/pluginhelper/sa/sidebody', array('plugin' => get_class($this),'method' => 'actionSettings','surveyId' => $surveyId)),
'close' => Yii::app()->createUrl('admin/survey/sa/view', array('surveyId' => $surveyId)),
'action' => Yii::app()->createUrl('admin/pluginhelper/sa/sidebody', array('plugin' => get_class($this),'method' => 'actionSaveSettings','surveyid' => $surveyId)),
'reset' => Yii::app()->createUrl('admin/pluginhelper/sa/sidebody', array('plugin' => get_class($this),'method' => 'actionSettings','surveyid' => $surveyId)),
'close' => Yii::app()->createUrl($surveyViewController, array('surveyid' => $surveyId)),
);
$aSettings=array();
......@@ -377,10 +378,11 @@ class matomoPublicTrack extends PluginBase
$customDimensions = (array) App()->getRequest()->getPost('customDimensions', null);
$this->set('customDimensions', $customDimensions, 'Survey', $surveyId);
if (App()->getRequest()->getPost('save'.get_class($this)) == 'redirect') {
$redirectUrl = Yii::app()->createUrl('admin/survey/sa/view', array('surveyId' => $surveyId));
$surveyViewController = (version_compare(App()->getConfig('versionnumber'), '4', "<")) ? 'admin/survey/sa/view' : 'surveyAdministration/view';
$redirectUrl = App()->createUrl($surveyViewController, array('surveyid' => $surveyId));
Yii::app()->getRequest()->redirect($redirectUrl);
}
$redirectUrl = Yii::app()->createUrl('admin/pluginhelper/sa/sidebody', array('plugin' => get_class($this),'method' => 'actionSettings','surveyId' => $surveyId));
$redirectUrl = Yii::app()->createUrl('admin/pluginhelper/sa/sidebody', array('plugin' => get_class($this),'method' => 'actionSettings','surveyid' => $surveyId));
Yii::app()->getRequest()->redirect($redirectUrl, true, 303);
}
/**
......
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