Skip to content

Commit

Permalink
Merge pull request #8 from esatisfaction/fix/1.6-control-panel-message
Browse files Browse the repository at this point in the history
Update control panel with messages
  • Loading branch information
esat-platforms authored Sep 13, 2018
2 parents aaba132 + 0a05af3 commit 045a0b3
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 31 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG-1.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,9 @@ in all versions (major and minor)
To get the diff for a specific change, go to https://github.com/esatisfaction/esat-prestashop/commit/XXX where
XXX is the change hash

* 1.0.1 (2018-09-13)
* Fix issues with manually sending on/off switch behavior
* Provide more messages in the admin panel header
* Remove authentication token as required field
* 1.0.0 (2018-09-07)
* Brand new version for new e-satisfaction platform
2 changes: 1 addition & 1 deletion config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<module>
<name>esatisfaction</name>
<displayName><![CDATA[E-satisfaction Module]]></displayName>
<version><![CDATA[1.0.0]]></version>
<version><![CDATA[1.0.1]]></version>
<description><![CDATA[Adds the code necessary to gather customer satisfaction data]]></description>
<author><![CDATA[e-satisfaction SA]]></author>
<tab><![CDATA[analytics_stats]]></tab>
Expand Down
9 changes: 2 additions & 7 deletions esatisfaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* @author e-satisfaction SA
* @copyright 2018 e-satisfaction SA
* @license https://opensource.org/licenses
* @version 1.0.0
* @version 1.0.1
*/

class Esatisfaction extends Module
Expand All @@ -26,7 +26,7 @@ public function __construct()
{
$this->name = 'esatisfaction';
$this->tab = 'other';
$this->version = '1.0.0';
$this->version = '1.0.1';
$this->author = 'e-satisfaction SA';
$this->tab = 'analytics_stats';
$this->need_instance = 0;
Expand Down Expand Up @@ -90,10 +90,6 @@ public function getContent()
$output .= $this->displayError($this->l('Site Id cannot be empty'));
}

if (!$auth || empty($auth)) {
$output .= $this->displayError($this->l('Site Auth cannot be empty'));
}

if (empty($output)) {
Configuration::updateValue('ESATISFACTION_APP_ID', $app_id);
Configuration::updateValue('ESATISFACTION_AUTH', $auth);
Expand Down Expand Up @@ -388,7 +384,6 @@ public function displayForm()
'label' => $this->l('Token'),
'name' => 'ESATISFACTION_AUTH',
'size' => 45,
'required' => true,
),
),
'submit' => array(
Expand Down
39 changes: 20 additions & 19 deletions views/js/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,28 @@
* @author e-satisfaction SA
* @copyright 2018 e-satisfaction SA
* @license https://opensource.org/licenses
* @version 1.0.0
* @version 1.0.1
*/
(function ($) {
$(document).on('ready', function () {
// Initialize display of manual statuses
showHideManualSettings();

jQuery(document).ready(function () {
// Listen on change
$('input[type=radio][name=manual_send]').on('change', function () {
showHideManualSettings();
});

$('input[type=radio][name=manual_send]').change(function () {
if (this.value == '1') {
$('#fieldset_3_3').slideDown(400);
$('#fieldset_4_4').slideDown(400);
}
else if (this.value == '0') {
$('#fieldset_3_3').slideUp(400);
$('#fieldset_4_4').slideUp(400);
function showHideManualSettings() {
if ($('input[type=radio][name=manual_send]:checked').val() === '1') {
$('#fieldset_3_3').slideDown(400);
$('#fieldset_4_4').slideDown(400);
$('#fieldset_5_5').slideDown(400);
} else {
$('#fieldset_3_3').slideUp(400);
$('#fieldset_4_4').slideUp(400);
$('#fieldset_5_5').slideUp(400);
}
}
});

if ($('input[type=radio][name=manual_send]').val() = '1') {
$('#fieldset_3_3').slideDown(400);
$('#fieldset_4_4').slideDown(400);
} else {
$('#fieldset_3_3').slideUp(400);
$('#fieldset_4_4').slideUp(400);
}
});
})(jQuery);
18 changes: 14 additions & 4 deletions views/templates/admin/configure.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,18 @@
<img src="{$icon|escape:'htmlall':'UTF-8'}" alt="{$name|escape:'htmlall':'UTF-8'}">
</div>
<div class="col-lg-12">
<h2>Questionnaire container</h2>
<p>Place the following element/container on the section where the questionnaire should appear: </p>
<p style="background: #ececec">&nbsp;<br><b>&lt;div id="esat-checkout-questionnaire-container"/&gt;</b><br>&nbsp;</p>
<h2>Checkout Questionnaire container</h2>
<p>On your e-satisfaction.com Questionnaire Distribution (integration tab), set the integration type to
<b>embedded</b> and the position to <b>#esat-checkout-questionnaire-container</b>.</p>
<h2>Manually Send After-delivery and Store Pickup</h2>
<p>By default, e-satisfaction sends the after-delivery questionnaire after 10 days. If you wish to send your questionnaires manually,
you should turn on the manual send switch and fill in the values accordingly.</p>
<h2>Authentication Token</h2>
<p>If you select manual send, you should provide a user authentication token so that we can make API calls to e-satisfaction API.
To retrieve a user token, go to your
<a href="https://app.e-satisfaction.com/user/settings/" target="_blank">User Settings</a> and create a new token in the
<b>Authentication Tokens panel</b>.
Copy your token and paste it in the proper field here.
</p>
</div>
</div>
</div>

0 comments on commit 045a0b3

Please sign in to comment.