+ */
class CustomerCreateOrUpdateEvent extends ActionEvent
{
//base parameters for creating new customer
diff --git a/core/lib/Thelia/Core/Event/TheliaEvents.php b/core/lib/Thelia/Core/Event/TheliaEvents.php
index 4cbaad675..f712dd7ae 100755
--- a/core/lib/Thelia/Core/Event/TheliaEvents.php
+++ b/core/lib/Thelia/Core/Event/TheliaEvents.php
@@ -71,6 +71,11 @@ final class TheliaEvents
*/
const CUSTOMER_UPDATEACCOUNT = "action.updateCustomer";
+ /**
+ * sent on customer removal
+ */
+ const CUSTOMER_DELETEACCOUNT = "action.deleteCustomer";
+
/**
* sent when a customer need a new password
*/
@@ -103,6 +108,16 @@ final class TheliaEvents
*/
const AFTER_UPDATECUSTOMER = "action.after_updateCustomer";
+ /**
+ * sent just before customer removal
+ */
+ const BEFORE_DELETECUSTOMER = "action.before_updateCustomer";
+
+ /**
+ * sent just after customer removal
+ */
+ const AFTER_DELETECUSTOMER = "action.after_deleteCustomer";
+
// -- ADDRESS MANAGEMENT ---------------------------------------------------------
/**
* sent for address creation
diff --git a/core/lib/Thelia/Model/Customer.php b/core/lib/Thelia/Model/Customer.php
index bb30d18e2..f839d5f5b 100755
--- a/core/lib/Thelia/Model/Customer.php
+++ b/core/lib/Thelia/Model/Customer.php
@@ -246,7 +246,7 @@ class Customer extends BaseCustomer implements UserInterface
*/
public function preDelete(ConnectionInterface $con = null)
{
- $this->dispatchEvent(TheliaEvents::BEFORE_DELETECONFIG, new CustomerEvent($this));
+ $this->dispatchEvent(TheliaEvents::BEFORE_DELETECUSTOMER, new CustomerEvent($this));
return true;
}
@@ -255,6 +255,6 @@ class Customer extends BaseCustomer implements UserInterface
*/
public function postDelete(ConnectionInterface $con = null)
{
- $this->dispatchEvent(TheliaEvents::AFTER_DELETECONFIG, new CustomerEvent($this));
+ $this->dispatchEvent(TheliaEvents::AFTER_DELETECUSTOMER, new CustomerEvent($this));
}
}
diff --git a/templates/admin/default/customers.html b/templates/admin/default/customers.html
index c0fe81973..799115bf3 100644
--- a/templates/admin/default/customers.html
+++ b/templates/admin/default/customers.html
@@ -260,7 +260,8 @@
{* Delete confirmation dialog *}
{capture "delete_customer_dialog"}
-
+
+
{/capture}
{include
@@ -271,7 +272,18 @@
dialog_message = {intl l="Do you really want to delete this customer ?"}
form_action = {url path='/admin/customer/delete'}
- form_content = {$smarty.capture.delete_dialog nofilter}
+ form_content = {$smarty.capture.delete_customer_dialog nofilter}
+ form_id = "form_delete_customer"
}
+{/block}
+
+{block name="javascript-initialization"}
+
+
+
{/block}
\ No newline at end of file
diff --git a/templates/admin/default/includes/generic-confirm-dialog.html b/templates/admin/default/includes/generic-confirm-dialog.html
index b5f3ad700..be1f4b63d 100644
--- a/templates/admin/default/includes/generic-confirm-dialog.html
+++ b/templates/admin/default/includes/generic-confirm-dialog.html
@@ -14,6 +14,7 @@ Parameters:
form_action = the form action URL, subtitted by a click on OK button
form_method = the form method, default "POST"
form_content = the form content
+ form_id = the form id
*}
@@ -28,7 +29,7 @@ Parameters:
{$dialog_message nofilter}
-