[-] BO : #PSTEST-210 : deleted customers

This commit is contained in:
lLefevre
2011-12-27 15:46:21 +00:00
parent d5a281f832
commit b1b2c080e0
3 changed files with 68 additions and 19 deletions
@@ -0,0 +1,56 @@
{*
* 2007-2011 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-2011 PrestaShop SA
* @version Release: $Revision: 10891 $
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
{extends file="helper/list/list_header.tpl"}
{block name=leadin}
{if isset($delete_customer) && $delete_customer}
<form action="{$REQUEST_URI}" method="post">
<fieldset><legend>{l s='How do you want to delete your customer(s)?'}</legend>
{l s='You have two ways to delete a customer, please choose what you want to do.'}
<p>
<input type="radio" name="deleteMode" value="real" id="deleteMode_real" />
<label for="deleteMode_real" style="float:none">{l s='I want to delete my customer(s) for real, all data will be removed from the database. A customer with the same e-mail address will be able to register again.'}</label>
</p>
<p>
<input type="radio" name="deleteMode" value="deleted" id="deleteMode_deleted" />
<label for="deleteMode_deleted" style="float:none">{l s='I don\'t want my customer(s) to register again. The customer(s) will be removed from this list but all data will be kept in the database.'}</label>
</p>
{foreach $POST as $key => $value}
{if is_array($value)}
{foreach $value as $val}
<input type="hidden" name="{$key}[]" value="{$val}" />
{/foreach}
{else}
<input type="hidden" name="{$key}" value="{$value}" />
{/if}
{/foreach}
<br /><input type="submit" class="button" value="{l s=' Delete '}" />
</fieldset>
</form>
<div class="clear">&nbsp;</div>
{/if}
{/block}
+7 -19
View File
@@ -195,6 +195,13 @@ class AdminCustomersControllerCore extends AdminController
LIMIT 1
) as connect';
if (Tools::isSubmit('submitBulkdelete'.$this->table) OR Tools::isSubmit('delete'.$this->table))
$this->tpl_list_vars = array(
'delete_customer' => true,
'REQUEST_URI' => $_SERVER['REQUEST_URI'],
'POST' => $_POST
);
return parent::renderList();
}
@@ -705,25 +712,6 @@ class AdminCustomersControllerCore extends AdminController
parent::processDelete($token);
}
public function processBulkDelete($token)
{
if ($this->delete_mode == 'real')
{
$this->deleted = false;
foreach (Tools::getValue('customerBox') as $id_customer)
Discount::deleteByIdCustomer((int)$id_customer);
}
elseif ($this->delete_mode == 'deleted')
$this->deleted = true;
else
{
$this->_errors[] = Tools::displayError('Unknown delete mode:'.' '.$this->deleted);
return;
}
parent::processBulkDelete($token);
}
public function processSave($token)
{
// Check that the new email is not already in use
+5
View File
@@ -3133,6 +3133,11 @@ $_LANGADM['AdminCustomers1cfa0271ea62618c3bb70c2eb60642d2'] = 'Jour de paiement
$_LANGADM['AdminCustomersec316ccad05b9ac5c3e07d0f1007ab0d'] = 'Risque :';
$_LANGADM['AdminCustomers38fb7d24e0d60a048f540ecb18e13376'] = 'Enregistrer';
$_LANGADM['AdminCustomers14542f5997c4a02d4276da364657f501'] = 'Lien direct';
$_LANGADM['AdminCustomers45d3153df3f835bbf6a68c2302e494d7'] = 'Comment souhaitez-vous supprimer ce(s) client(s) ?';
$_LANGADM['AdminCustomers7b4d23148ad2c2f32f217ae0640a375c'] = 'Vous avez 2 méthodes pour supprimer un client, choisissez celle qui vous convient le mieux. ';
$_LANGADM['AdminCustomers7c02e576ed6029a3a1d64700cc43ebf7'] = 'Je veux supprimer mon ou mes client(s) complètement, toutes les données seront supprimées de la base de données. Un client avec la même adresses e-mail pourra se ré-inscrire.';
$_LANGADM['AdminCustomersaa9000a0aa27a0920d69744960520677'] = 'Je ne veux pas que mon ou mes client(s) puissent s\'inscrire à nouveau. Le(s) client(s) seront supprimé(s) de cette liste mais les données seront conservées en base de données.';
$_LANGADM['AdminCustomersceece2e4b93f9a5a091e1c64120ff5bd'] = 'Supprimer';
$_LANGADM['AdminCustomers56eec78925570b01dc23134175172985'] = 'Votre note a été sauvegardée';
$_LANGADM['AdminCustomersf81f334947c006163040911e694fc3ec'] = 'Erreur : votre note n\'est pas valide';
$_LANGADM['AdminCustomers2f38713e640e4bd37998f94e968a55f7'] = 'Erreur : impossible de sauvegarder votre note';