Commit 4d13adf9 authored by Chenu Denis's avatar Chenu Denis
Browse files

[feature] allow to update only tokens

parent d70918d3
......@@ -5,7 +5,7 @@
* @author Denis Chenu <denis@sondages.pro>
* @copyright 2020-2022 Denis Chenu <http://www.sondages.pro>
* @license GPL v3
* @version 0.23.1
* @version 0.24.2
*
* 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
......@@ -1125,6 +1125,7 @@ class TokenUsersListAndManage extends PluginBase
'settings' => $this->translate("Settings of Token management"),
'attributes' => $this->translate("Attributes definition and settings of Token management."),
'tokens' => $this->translate("Attributes definition, settings of Token management and participants table"),
'onlytokens' => $this->translate("Only participants table."),
),
);
$aSettings[$this->translate('Childs token attribute update')]['tokenAttributeSetChildrensAction'] = array(
......@@ -1136,6 +1137,15 @@ class TokenUsersListAndManage extends PluginBase
. '</button>'
. '</div>'
);
//~ $aSettings[$this->translate('Childs token attribute update')]['tokenAttributeExporttChildrensAction'] = array(
//~ 'type' => 'info',
//~ 'content' => '<div class="col-md-6 col-md-offset-6">'
//~ . '<p class="text-warning"><strong>' . $this->translate("Warning") . '</strong> ' . $this->translate('This update child survey and can delete attribute information and token') . '</p>'
//~ . '<button type="submit" name="saveTokenUsersListAndManage" value="tokenAttributeSetChildrensAction" class="btn btn-default"><i class="fa fa-check-circle-o " aria-hidden="true"></i>'
//~ . $this->translate("Save and set attributes to child survey")
//~ . '</button>'
//~ . '</div>'
//~ );
}
}
/* Basic settings (on this surey) */
......@@ -1515,24 +1525,26 @@ class TokenUsersListAndManage extends PluginBase
return;
}
/* settings */
$this->set(
"tokenAttributeGroup",
$this->get('tokenAttributeGroup', 'Survey', $surveyId, ''),
'Survey',
$childSurveyId
);
$this->set(
"tokenAttributeGroupManager",
$this->get('tokenAttributeGroupManager', 'Survey', $surveyId, ''),
'Survey',
$childSurveyId
);
$this->set(
"tokenAttributeRestricted",
$this->get('tokenAttributeRestricted', 'Survey', $surveyId, ''),
'Survey',
$childSurveyId
);
if ($action != 'onlytokens') {
$this->set(
"tokenAttributeGroup",
$this->get('tokenAttributeGroup', 'Survey', $surveyId, ''),
'Survey',
$childSurveyId
);
$this->set(
"tokenAttributeGroupManager",
$this->get('tokenAttributeGroupManager', 'Survey', $surveyId, ''),
'Survey',
$childSurveyId
);
$this->set(
"tokenAttributeRestricted",
$this->get('tokenAttributeRestricted', 'Survey', $surveyId, ''),
'Survey',
$childSurveyId
);
}
/* */
if($action == 'attributes' || $action == 'tokens') {
......@@ -1567,7 +1579,7 @@ class TokenUsersListAndManage extends PluginBase
if (!Survey::model()->findByPk($surveyId)->hasTokensTable) {
return;
}
if($action == 'tokens') {
if($action == 'tokens' || $action == 'onlytokens') {
Token::model($childSurveyId)->deleteAll();
$parentTable = "{{tokens_{$surveyId}}}";
$chieldTable = "{{tokens_{$childSurveyId}}}";
......
......@@ -8,7 +8,7 @@
<author>Denis Chenu</author>
<authorUrl>https://www.sondages.pro/</authorUrl>
<supportUrl>https://support.sondages.pro/</supportUrl>
<version>0.24.0</version>
<version>0.24.2</version>
<license>GNU Affero General Public License v3.0</license>
<description><![CDATA[Token Users List And Manage.]]></description>
</metadata>
......
Supports Markdown
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