From 46fd70b267eff48b0c7954e07c7cbdaa2d40e4f9 Mon Sep 17 00:00:00 2001 From: lLefevre Date: Tue, 27 Dec 2011 15:46:21 +0000 Subject: [PATCH] [-] BO : #PSTEST-210 : deleted customers git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@11799 b9a71923-0436-4b27-9f14-aed3839534dd --- .../themes/template/customers/list_header.tpl | 56 +++++++++++++++++++ .../admin/AdminCustomersController.php | 26 +++------ translations/fr/admin.php | 5 ++ 3 files changed, 68 insertions(+), 19 deletions(-) create mode 100644 admin-dev/themes/template/customers/list_header.tpl diff --git a/admin-dev/themes/template/customers/list_header.tpl b/admin-dev/themes/template/customers/list_header.tpl new file mode 100644 index 000000000..734417328 --- /dev/null +++ b/admin-dev/themes/template/customers/list_header.tpl @@ -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 +* @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} +
+
{l s='How do you want to delete your customer(s)?'} + {l s='You have two ways to delete a customer, please choose what you want to do.'} +

+ + +

+

+ + +

+ {foreach $POST as $key => $value} + {if is_array($value)} + {foreach $value as $val} + + {/foreach} + {else} + + {/if} + {/foreach} +
+
+
+
 
+ {/if} +{/block} diff --git a/controllers/admin/AdminCustomersController.php b/controllers/admin/AdminCustomersController.php index 472edf923..366e17c7e 100644 --- a/controllers/admin/AdminCustomersController.php +++ b/controllers/admin/AdminCustomersController.php @@ -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 diff --git a/translations/fr/admin.php b/translations/fr/admin.php index e5f8a18e6..263c2add8 100644 --- a/translations/fr/admin.php +++ b/translations/fr/admin.php @@ -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';