diff --git a/Config/module.xml b/Config/module.xml index 77617af..65e068c 100644 --- a/Config/module.xml +++ b/Config/module.xml @@ -13,7 +13,7 @@ en_US fr_FR - 1.2.4 + 1.2.5 Julien Chanséaume julien@thelia.net diff --git a/Config/routing.xml b/Config/routing.xml index a3f2bad..75c5cbf 100644 --- a/Config/routing.xml +++ b/Config/routing.xml @@ -12,4 +12,7 @@ StockAlert\Controller\StockAlertBackOfficeController::configuration + + StockAlert\Controller\StockAlertBackOfficeController::deleteEmail + diff --git a/Controller/StockAlertBackOfficeController.php b/Controller/StockAlertBackOfficeController.php index 7c6fff6..c8bca29 100644 --- a/Controller/StockAlertBackOfficeController.php +++ b/Controller/StockAlertBackOfficeController.php @@ -13,10 +13,14 @@ namespace StockAlert\Controller; +use StockAlert\Model\RestockingAlert; +use StockAlert\Model\RestockingAlertQuery; use StockAlert\StockAlert; +use Symfony\Component\HttpFoundation\RedirectResponse; use Thelia\Controller\Admin\BaseAdminController; use Thelia\Form\Exception\FormValidationException; use Thelia\Model\ConfigQuery; +use Thelia\Tools\URL; /** * Class StockAlertBackOfficeController @@ -61,4 +65,14 @@ public function configuration() ] ); } + + public function deleteEmail() + { + $restockingAlertId = $this->getRequest()->get("id"); + if ($restockingAlertId) { + $restockingAlert = RestockingAlertQuery::create()->filterById($restockingAlertId)->findOne(); + $restockingAlert->delete(); + } + return new RedirectResponse(URL::getInstance()->absoluteUrl($this->getSession()->getReturnToUrl())); + } } diff --git a/templates/backOffice/default/configuration.html b/templates/backOffice/default/configuration.html index a8561a2..3d5e049 100644 --- a/templates/backOffice/default/configuration.html +++ b/templates/backOffice/default/configuration.html @@ -50,7 +50,7 @@
{intl d='stockalert.bo.default' l='List of current subscriptions.'}
- {$limit={$smarty.get.limit|default:100}} + {$limit={$smarty.get.limit|default:10}} {$page={$smarty.get.page|default:1}} {if {count type="restocking-alert"} < $limit * $page} @@ -66,7 +66,7 @@ {intl d='stockalert.bo.default' l='Date'} {intl d='stockalert.bo.default' l='Email'} {intl d='stockalert.bo.default' l='Product'} - {*{intl l='Actions'}*} + {intl l='Actions'} @@ -81,6 +81,9 @@ {/loop} {/loop} + + + {/loop}