Skip to content

Commit

Permalink
Removed call to api.addons.prestashop.com
Browse files Browse the repository at this point in the history
  • Loading branch information
Progi1984 committed Apr 5, 2022
1 parent 88ed1f9 commit 4f9e179
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 92 deletions.
56 changes: 0 additions & 56 deletions classes/APIFAQClass.php

This file was deleted.

54 changes: 43 additions & 11 deletions psgdpr.php
Original file line number Diff line number Diff line change
Expand Up @@ -314,18 +314,51 @@ public function loadAsset()
}

/**
* FAQ API
*/

/**
* @return bool
* @return array
*/
public function loadFaq()
{
$api = new APIFAQ();
$faq = $api->getData($this->module_key, $this->version);

return $faq;
return [
[
'title' => $this->trans('Data accessibility'),
'blocks' => [
[
'question' => $this->trans('How can a customer retrieve all of his personal data?'),
'answer' => $this->trans('From his customer account, a new tab called My Personal Data is available and your customer can retrieve all of his personal data collected by your shop and installed modules, in PDF or CSV format.'),
],
],
],
[
'title' => $this->trans('Customer consent'),
'blocks' => [
[
'question' => $this->trans('There is no consent confirmation checkbox in the contact form. Isn\'t this a requirement?'),
'answer' => $this->trans('No, it is not a requirement as the customer gives consent by clicking on the Submit message button. Only a message is required to give your customers more information about the use of personal data on your website. We are currently working on a new version of the contact form, it will be available really soon for your online store.'),
],
],
],
[
'title' => $this->trans('Data erasure'),
'blocks' => [
[
'question' => $this->trans('How will a customer ask for all of his personal data to be deleted ?'),
'answer' => $this->trans('The customer will send a message from the contact form for any rectification and erasure requests, justifying his request.'),
],
[
'question' => $this->trans('There is no Remove Data button in the customer account. Isn\'t this a requirement?'),
'answer' => $this->trans('No, the Remove Data button in the customer account is not an obligation. For the data erasure requests, your customers can request data removal only under certain circumstances, that is the reason why we decided not to include an automatic Remove Data button in their customer account.\n\nThey can, however, contact you anytime via your contact form, in this case, you can review their request and once you accept it, you will be able to remove their personal data directly in the configuration page of our Official GDPR Compliance module.'),
],
[
'question' => $this->trans('How to remove the personal data of a customer?'),
'answer' => $this->trans('If the request is valid, from the Personal Data Management tab of this module, any customer can be found by typing the first few letters of his name or email address in the search bar.\nBefore deleting any data, we recommend you to download all the invoices of the involved customer. After deleting the data with the “Remove data” button, the customer’s orders can’t be legally deleted, they just won’t be linked to any account. This allows you to keep precise statistics of your shop.'),
],
[
'question' => $this->trans('After removing all personal data of a customer from my database, what will happen to his orders?'),
'answer' => $this->trans('Due to other legal obligations, his orders will still be stocked but they are no longer associated with the customer.\nOnly the name, shipping, and billing information must be kept in the order details page for legal reasons, invoicing, and accounting.\nAccording to the Rec.30;Art.7(1)(c)'),
],
],
],
];
}

/**
Expand All @@ -344,7 +377,6 @@ public function getContent()
$id_lang = $this->context->language->id;
$id_shop = $this->context->shop->id;

$faq = $this->loadFaq(); // load faq from addons api
$this->loadAsset(); // load js and css
$this->postProcess(); // execute submit form

Expand Down Expand Up @@ -417,7 +449,7 @@ public function getContent()
'id_lang' => $id_lang,
'psgdpr_adminController' => $adminController,
'adminControllerInvoices' => $adminControllerInvoices,
'apifaq' => $faq,
'faq' => $this->loadFaq(),
'doc' => $doc,
'youtubeLink' => $youtubeLink,
'cmspage' => $CMS,
Expand Down
6 changes: 5 additions & 1 deletion views/css/faq.css
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,15 @@
float:left;
width:20%;
}
.helpContentLeft > .left img {
max-width: 100%;
}
.helpContentLeft > .right {
float:left;
width:66%;
width:80%;
text-align: justify;
text-justify: inter-word;
padding: 0 5%;
}
.helpContentRight {
float:right;
Expand Down
Binary file removed views/img/carnet.png
Binary file not shown.
8 changes: 2 additions & 6 deletions views/templates/admin/menu.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@
<a href="#" class="list-group-item" v-bind:class="{ 'active': isActive('dataConfig') }" v-on:click="makeActive('dataConfig')"><i class="fa fa-user-secret"></i> {l s='Personal data management' mod='psgdpr'}</a>
<a href="#" class="list-group-item" v-bind:class="{ 'active': isActive('dataConsent') }" v-on:click="makeActive('dataConsent')"><i class="fa fa-check-square"></i> {l s='Consent checkbox customization' mod='psgdpr'}</a>
<a href="#" class="list-group-item" v-bind:class="{ 'active': isActive('customerActivity') }" v-on:click="makeActive('customerActivity')"><i class="fa fa-user-circle"></i> {l s='Customer activity tracking' mod='psgdpr'}</a>
{if ($apifaq != '')}
<a href="#" class="list-group-item" v-bind:class="{ 'active': isActive('faq') }" v-on:click="makeActive('faq')"><i class="fa fa-question-circle"></i> {l s='Help' mod='psgdpr'}</a>
{/if}
<a href="#" class="list-group-item" v-bind:class="{ 'active': isActive('faq') }" v-on:click="makeActive('faq')"><i class="fa fa-question-circle"></i> {l s='Help' mod='psgdpr'}</a>
</div>
<div class="list-group" v-on:click.prevent>
<a class="list-group-item" style="text-align:center"><i class="icon-info"></i> {l s='Version' mod='psgdpr'} {$module_version|escape:'htmlall':'UTF-8'} | <i class="icon-info"></i> PrestaShop {$ps_version|escape:'htmlall':'UTF-8'}</a>
Expand All @@ -53,9 +51,7 @@
</div>

<div id="faq" class="psgdpr_menu addons-hide">
{if ($apifaq != '')}
{include file="./tabs/help.tpl"}
{/if}
{include file="./tabs/help.tpl"}
</div>

</div>
Expand Down
12 changes: 2 additions & 10 deletions views/templates/admin/tabs/getStarted.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
<h3>{l s='More information about GDPR' mod='psgdpr'}</h3>

<div class="row">
<div class="col-lg-1"></div>
<div class="col-lg-2"></div>
<a href="http://ec.europa.eu/justice/article-29/structure/data-protection-authorities/" target="_blank">
<div class="col-lg-2">
<div class="psgdpr-card-useful-link">
Expand All @@ -86,14 +86,6 @@
</div>
</div>
</a>
<a href="https://addons.prestashop.com/en/free-prestashop-modules/31944-gdpr-whitepaper-.html" target="_blank">
<div class="col-lg-2">
<div class="psgdpr-card-useful-link">
<img src="{$img_path|escape:'htmlall':'UTF-8'}carnet.png">
<h4 class="card-link">{l s='PrestaShop GDPR whitepaper' mod='psgdpr'}</h4>
</div>
</div>
</a>
<a href="{$doc|escape:'htmlall':'UTF-8'}" target="_blank">
<div class="col-lg-2">
<div class="psgdpr-card-useful-link">
Expand All @@ -118,7 +110,7 @@
</div>
</div>
</a>
<div class="col-lg-1"></div>
<div class="col-lg-2"></div>
</div>

<div role="alert" data-alert="info" class="alert alert-info">
Expand Down
14 changes: 6 additions & 8 deletions views/templates/admin/tabs/help.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,15 @@
<br><br>
<div class="tab-pane panel" id="faq">
<div class="panel-heading"><i class="icon-question"></i> {l s='FAQ' mod='psgdpr'}</div>
{foreach from=$apifaq item=categorie name='faq'}
<span class="faq-h1">{$categorie->title|escape:'htmlall':'UTF-8'}</span>
{foreach from=$faq item=category name='faq'}
<span class="faq-h1">{$category.title|escape:'htmlall':'UTF-8'}</span>
<ul>
{foreach from=$categorie->blocks item=QandA}
{if !empty($QandA->question)}
{foreach from=$category.blocks item=qa}
{if !empty($qa.question)}
<li>
<span class="faq-h2"><i class="icon-info-circle"></i> {$QandA->question|escape:'htmlall':'UTF-8'}</span>
<span class="faq-h2"><i class="icon-info-circle"></i> {$qa.question|escape:'htmlall':'UTF-8'}</span>
<p class="faq-text hide">
{$QandA->answer|escape:'htmlall':'UTF-8'|replace:"\n":"<br />"}
{$qa.answer|escape:'htmlall':'UTF-8'|replace:"\n":"<br />"}
</p>
</li>
{/if}
Expand All @@ -90,8 +90,6 @@
{if !$smarty.foreach.faq.last}<hr/>{/if}
{/foreach}
</div>
{l s='You couldn\'t find any answer to your question ?' mod='psgdpr'}
<b><a href="http://addons.prestashop.com/contact-form.php" target="_blank">{l s='Contact us on PrestaShop Addons' mod='psgdpr'}</a></b>
</div>
</div>
</div>
Expand Down

0 comments on commit 4f9e179

Please sign in to comment.