Remove blockcustomerprivacy

This commit is contained in:
Abhishek Kumar
2022-04-27 11:19:04 +05:30
parent f0eee3e4fb
commit e138da02b5
15 changed files with 0 additions and 547 deletions

View File

@@ -62,7 +62,6 @@
<module action="enable" name="blockcart"/>
<module action="enable" name="blockuserinfo"/>
<module action="disable" name="blockcmsinfo"/>
<module action="disable" name="blockcustomerprivacy"/>
<module action="disable" name="blocklayered"/>
<module action="disable" name="blocklink"/>
<module action="disable" name="pscleaner"/>

View File

@@ -2088,7 +2088,6 @@ class AdminThemesControllerCore extends AdminController
'blockcart',
'blockcmsinfo',
'blockcurrencies',
'blockcustomerprivacy',
'blocklanguages',
'blocklayered',
'blocklink',

View File

@@ -1,4 +0,0 @@
2014-04-22 18:57:11 +0200 // Changelog updated
2014-03-24 11:43:28 +0100 / MO blockcustomerprivacy : ps_versions_compliancy modified (1.5.6.1 => 1.6)
2014-03-24 11:02:09 +0100 // MO blockcustomerprivacy/ : ps_versions_compliancy added
2014-03-20 14:22:37 +0100 Initial commit

View File

@@ -1,27 +0,0 @@
{* 2007-2016 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2016 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
<div id="{$privacy_id}">
<p>{$privacy_message}</p>
</div>

View File

@@ -1,272 +0,0 @@
<?php
/*
* 2007-2016 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2016 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
if (!defined('_PS_VERSION_'))
exit;
class Blockcustomerprivacy extends Module
{
public function __construct()
{
$this->name = 'blockcustomerprivacy';
if (version_compare(_PS_VERSION_, '1.4.0.0') >= 0)
$this->tab = 'front_office_features';
else
$this->tab = 'Blocks';
$this->version = '2.0.2';
$this->author = 'PrestaShop';
$this->need_instance = 0;
$this->bootstrap = true;
parent::__construct();
$this->displayName = $this->l('Customer data privacy block');
$this->description = $this->l('Adds a block displaying a message about a customer\'s privacy data.');
$this->ps_versions_compliancy = array('min' => '1.6', 'max' => '1.6.99.99');
$this->_html = '';
}
public function install()
{
$return = (parent::install()
&& $this->registerHook('createAccountForm')
&& $this->registerHook('displayCustomerIdentityForm')
&& $this->registerHook('actionBeforeSubmitAccount'));
include 'fixtures.php'; // get Fixture array
$languages = Language::getLanguages();
$conf_keys = array('CUSTPRIV_MSG_AUTH', 'CUSTPRIV_MSG_IDENTITY');
foreach ($conf_keys as $conf_key)
foreach ($languages as $lang)
{
if (isset($fixtures[$conf_key][$lang['language_code']]))
Configuration::updateValue($conf_key, array(
$lang['id_lang'] => $fixtures[$conf_key][$lang['language_code']]
));
else
Configuration::updateValue($conf_key, array(
$lang['id_lang'] => 'The personal data you provide is used to answer queries, process orders or allow access to specific information. You have the right to modify and delete all the personal information found in the "My Account" page.'
));
}
return $return;
}
public function uninstall()
{
return ($this->unregisterHook('createAccountForm')
&& $this->unregisterHook('displayCustomerIdentityForm')
&& $this->unregisterHook('actionBeforeSubmitAccount')
&& parent::uninstall());
}
public function getContent()
{
if (Tools::isSubmit('submitCustPrivMess'))
{
$message_trads = array('auth' => array(), 'identity' => array());
foreach ($_POST as $key => $value)
if (preg_match('/CUSTPRIV_MSG_AUTH_/i', $key))
{
$id_lang = preg_split('/CUSTPRIV_MSG_AUTH_/i', $key);
$message_trads['auth'][(int)$id_lang[1]] = $value;
}
elseif (preg_match('/CUSTPRIV_MSG_IDENTITY_/i', $key))
{
$id_lang = preg_split('/CUSTPRIV_MSG_IDENTITY_/i', $key);
$message_trads['identity'][(int)$id_lang[1]] = $value;
}
Configuration::updateValue('CUSTPRIV_MSG_AUTH', $message_trads['auth'], true);
Configuration::updateValue('CUSTPRIV_MSG_IDENTITY', $message_trads['identity'], true);
Configuration::updateValue('CUSTPRIV_AUTH_PAGE', (int)Tools::getValue('CUSTPRIV_AUTH_PAGE'));
Configuration::updateValue('CUSTPRIV_IDENTITY_PAGE', (int)Tools::getValue('CUSTPRIV_IDENTITY_PAGE'));
$this->_clearCache('blockcustomerprivacy.tpl');
$this->_clearCache('blockcustomerprivacy-simple.tpl');
$this->_html .= $this->displayConfirmation($this->l('Configuration updated'));
}
$this->_html .= $this->renderForm();
return $this->_html;
}
public function checkConfig($switch_key, $msg_key)
{
if (!$this->active)
return false;
if (!Configuration::get($switch_key))
return false;
$message = Configuration::get($msg_key, $this->context->language->id);
if (empty($message))
return false;
return true;
}
public function hookActionBeforeSubmitAccount($params)
{
if (!$this->checkConfig('CUSTPRIV_AUTH_PAGE', 'CUSTPRIV_MSG_AUTH'))
return;
if (!Tools::getValue('customer_privacy'))
$this->context->controller->errors[] = $this->l('If you agree to the terms in the Customer Data Privacy message, please click the check box below.');
}
public function hookCreateAccountForm($params)
{
if (!$this->checkConfig('CUSTPRIV_AUTH_PAGE', 'CUSTPRIV_MSG_AUTH'))
return;
if (!$this->isCached('blockcustomerprivacy.tpl', $this->getCacheId()))
$this->smarty->assign('privacy_message', Configuration::get('CUSTPRIV_MSG_AUTH', $this->context->language->id));
return $this->display(__FILE__, 'blockcustomerprivacy.tpl', $this->getCacheId());
}
public function hookDisplayCustomerIdentityForm($params)
{
if (!$this->checkConfig('CUSTPRIV_IDENTITY_PAGE', 'CUSTPRIV_MSG_IDENTITY'))
return;
if (!$this->isCached('blockcustomerprivacy-simple.tpl', $this->getCacheId()))
{
$this->smarty->assign(array(
'privacy_message' => Configuration::get('CUSTPRIV_MSG_IDENTITY', $this->context->language->id),
'privacy_id' => "blockcustomerprivacy-simple",
));
}
return $this->display(__FILE__, 'blockcustomerprivacy-simple.tpl', $this->getCacheId());
}
public function renderForm()
{
$fields_form = array(
'form' => array(
'legend' => array(
'title' => $this->l('Settings'),
'icon' => 'icon-cogs'
),
'input' => array(
array(
'type' => 'switch',
'label' => $this->l('Display on account creation form'),
'name' => 'CUSTPRIV_AUTH_PAGE',
'values' => array(
array(
'id' => 'active_on',
'value' => 1,
'label' => $this->l('Enabled')
),
array(
'id' => 'active_off',
'value' => 0,
'label' => $this->l('Disabled')
)
),
),
array(
'type' => 'textarea',
'lang' => true,
'autoload_rte' => true,
'label' => $this->l('Customer data privacy message for account creation form:'),
'name' => 'CUSTPRIV_MSG_AUTH',
'desc' => $this->l('The customer data privacy message will be displayed in the account creation form.').'<br>'.$this->l('Tip: If the customer privacy message is too long to be written directly in the form, you can add a link to one of your pages. This can easily be created via the "CMS" page under the "Preferences" menu.')
),
array(
'type' => 'switch',
'label' => $this->l('Display in customer area'),
'name' => 'CUSTPRIV_IDENTITY_PAGE',
'values' => array(
array(
'id' => 'active_on',
'value' => 1,
'label' => $this->l('Enabled')
),
array(
'id' => 'active_off',
'value' => 0,
'label' => $this->l('Disabled')
)
),
),
array(
'type' => 'textarea',
'lang' => true,
'autoload_rte' => true,
'label' => $this->l('Customer data privacy message for customer area:'),
'name' => 'CUSTPRIV_MSG_IDENTITY',
'desc' => $this->l('The customer data privacy message will be displayed in the "Personal information" page, in the customer area.').'<br>'.$this->l('Tip: If the customer privacy message is too long to be written directly on the page, you can add a link to one of your other pages. This can easily be created via the "CMS" page under the "Preferences" menu.')
),
),
'submit' => array(
'title' => $this->l('Save'),
)
),
);
$helper = new HelperForm();
$helper->show_toolbar = false;
$helper->table = $this->table;
$lang = new Language((int)Configuration::get('PS_LANG_DEFAULT'));
$helper->default_form_language = $lang->id;
$helper->allow_employee_form_lang = Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG') ? Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG') : 0;
$this->fields_form = array();
$helper->identifier = $this->identifier;
$helper->submit_action = 'submitCustPrivMess';
$helper->currentIndex = $this->context->link->getAdminLink('AdminModules', false).'&configure='.$this->name.'&tab_module='.$this->tab.'&module_name='.$this->name;
$helper->token = Tools::getAdminTokenLite('AdminModules');
$helper->tpl_vars = array(
'fields_value' => $this->getConfigFieldsValues(),
'languages' => $this->context->controller->getLanguages(),
'id_language' => $this->context->language->id
);
return $helper->generateForm(array($fields_form));
}
public function getConfigFieldsValues()
{
$return = array();
$return['CUSTPRIV_AUTH_PAGE'] = (int)Configuration::get('CUSTPRIV_AUTH_PAGE');
$return['CUSTPRIV_IDENTITY_PAGE'] = (int)Configuration::get('CUSTPRIV_IDENTITY_PAGE');
$languages = Language::getLanguages(false);
foreach ($languages as $lang)
$return['CUSTPRIV_MSG_AUTH'][(int)$lang['id_lang']] = Tools::getValue('CUSTPRIV_MSG_AUTH_'.(int)$lang['id_lang'], Configuration::get('CUSTPRIV_MSG_AUTH', (int)$lang['id_lang']));
foreach ($languages as $lang)
$return['CUSTPRIV_MSG_IDENTITY'][(int)$lang['id_lang']] = Tools::getValue('CUSTPRIV_MSG_IDENTITY_'.(int)$lang['id_lang'], Configuration::get('CUSTPRIV_MSG_IDENTITY', (int)$lang['id_lang']));
return $return;
}
}

View File

@@ -1,32 +0,0 @@
{* 2007-2016 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2016 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
<div class="error_customerprivacy" style="color:red;"></div>
<fieldset class="account_creation customerprivacy">
<h3>{l s='Customer data privacy' mod='blockcustomerprivacy'}</h3>
<p class="required">
<input type="checkbox" value="1" id="customer_privacy" name="customer_privacy" style="float:left;margin: 15px;" autocomplete="off"/>
</p>
<label for="customer_privacy">{$privacy_message}</label>
</fieldset>

View File

@@ -1,10 +0,0 @@
<?php
$fixtures = array(
"CUSTPRIV_MSG_AUTH" => array(
'fr-fr' => "Conformément aux dispositions de la loi du n°78-17 du 6 janvier 1978, vous disposez d'un droit d'accès, de rectification et d'opposition sur les données nominatives vous concernant.",
),
"CUSTPRIV_MSG_IDENTITY" => array(
'fr-fr' => "Conformément aux dispositions de la loi du n°78-17 du 6 janvier 1978, vous disposez d'un droit d'accès, de rectification et d'opposition sur les données nominatives vous concernant.",
),
);

View File

@@ -1,35 +0,0 @@
<?php
/*
* 2007-2016 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2016 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: ../");
exit;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1023 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

View File

@@ -1,35 +0,0 @@
<?php
/*
* 2007-2016 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2016 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: ../");
exit;

View File

@@ -1,35 +0,0 @@
<?php
/*
* 2007-2016 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2016 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: ../../");
exit;

View File

@@ -1,22 +0,0 @@
<?php
if (!defined('_PS_VERSION_'))
exit;
function upgrade_module_2_0_0($object)
{
$return = true;
$return &= $object->registerHook('displayCustomerIdentityForm');
$return &= $object->unregisterHook('header');
$langs = Language::getLanguages(false);
$old_messages = array();
foreach ($langs as $l)
$old_messages[$l['id_lang']] = Configuration::get('CUSTPRIV_MESSAGE', $l['id_lang']);
Configuration::updateValue('CUSTPRIV_MESSAGE', $old_messages);
Configuration::updateValue('CUSTPRIV_MESSAGE', $old_messages);
return $return;
}

View File

@@ -1,38 +0,0 @@
{* 2007-2017 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2017 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
<div class="error_customerprivacy" style="color:red;"></div>
<fieldset class="account_creation customerprivacy">
<h3 class="page-subheading">
{l s='Customer data privacy' mod='blockcustomerprivacy'}
</h3>
<div style="width:21px; float:left;">
<div class="required checkbox">
<input type="checkbox" value="1" id="customer_privacy" name="customer_privacy" autocomplete="off"/>
</div>
</div>
<div style="width: 92%; float: left; margin-top: 8px;">
<label for="customer_privacy" style="font-weight: normal;">{$privacy_message}</label>
</div>
</fieldset>

View File

@@ -1,35 +0,0 @@
<?php
/*
* 2007-2017 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2017 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: ../");
exit;