diff --git a/core/lib/Thelia/Config/Resources/config.xml b/core/lib/Thelia/Config/Resources/config.xml index 54fd85794..a154db798 100755 --- a/core/lib/Thelia/Config/Resources/config.xml +++ b/core/lib/Thelia/Config/Resources/config.xml @@ -120,8 +120,8 @@
- - + + diff --git a/core/lib/Thelia/Config/Resources/routing/admin.xml b/core/lib/Thelia/Config/Resources/routing/admin.xml index cfdce8aeb..04c106684 100755 --- a/core/lib/Thelia/Config/Resources/routing/admin.xml +++ b/core/lib/Thelia/Config/Resources/routing/admin.xml @@ -688,11 +688,11 @@ - Thelia\Controller\Admin\ShippingConfigurationController::defaultAction + Thelia\Controller\Admin\AreaController::defaultAction - Thelia\Controller\Admin\ShippingConfigurationController::updateAction + Thelia\Controller\Admin\AreaController::updateAction \d+ diff --git a/core/lib/Thelia/Controller/Admin/ShippingConfigurationController.php b/core/lib/Thelia/Controller/Admin/AreaController.php similarity index 93% rename from core/lib/Thelia/Controller/Admin/ShippingConfigurationController.php rename to core/lib/Thelia/Controller/Admin/AreaController.php index 3ca6fec35..12958b4ff 100644 --- a/core/lib/Thelia/Controller/Admin/ShippingConfigurationController.php +++ b/core/lib/Thelia/Controller/Admin/AreaController.php @@ -25,11 +25,11 @@ namespace Thelia\Controller\Admin; use Thelia\Core\Event\TheliaEvents; /** - * Class ShippingConfigurationController + * Class AreaController * @package Thelia\Controller\Admin * @author Manuel Raynaud */ -class ShippingConfigurationController extends AbstractCrudController +class AreaController extends AbstractCrudController { /* public function indexAction() { @@ -51,14 +51,14 @@ class ShippingConfigurationController extends AbstractCrudController null, null, - 'admin.shipping.default', - 'admin.shipping.create', - 'admin.shipping.update', - 'admin.shipping.delete', + 'admin.area.default', + 'admin.area.create', + 'admin.area.update', + 'admin.area.delete', - TheliaEvents::SHIPPING_CREATE, - TheliaEvents::SHIPPING_UPDATE, - TheliaEvents::SHIPPING_DELETE + TheliaEvents::AREA_CREATE, + TheliaEvents::AREA_UPDATE, + TheliaEvents::AREA_DELETE ); } diff --git a/core/lib/Thelia/Core/Event/Area/AreaEvent.php b/core/lib/Thelia/Core/Event/Area/AreaEvent.php new file mode 100644 index 000000000..892d00843 --- /dev/null +++ b/core/lib/Thelia/Core/Event/Area/AreaEvent.php @@ -0,0 +1,66 @@ +. */ +/* */ +/*************************************************************************************/ + +namespace Thelia\Core\Event\Area; +use Thelia\Core\Event\ActionEvent; + + +/** + * Class AreaEvent + * @package Thelia\Core\Event\Shipping + * @author Manuel Raynaud + */ +class AreaEvent extends ActionEvent +{ + protected $area; + + public function __construct($area = null) + { + $this->area = $area; + } + + /** + * @param mixed $area + * + * @return $this + */ + public function setArea($area) + { + $this->area = $area; + + return $this; + } + + /** + * @return mixed + */ + public function getArea() + { + return $this->area; + } + + public function hasArea() + { + return null !== $this->area; + } +} \ No newline at end of file diff --git a/core/lib/Thelia/Core/Event/TheliaEvents.php b/core/lib/Thelia/Core/Event/TheliaEvents.php index 515ed8a25..9cc3beba9 100755 --- a/core/lib/Thelia/Core/Event/TheliaEvents.php +++ b/core/lib/Thelia/Core/Event/TheliaEvents.php @@ -234,9 +234,9 @@ final class TheliaEvents // -- SHIPPING CONFIGURATION MANAGEMENT - const SHIPPING_CREATE = 'action.createShipping'; - const SHIPPING_UPDATE = 'action.updateShipping'; - const SHIPPING_DELETE = 'action.deleteShipping'; + const AREA_CREATE = 'action.createArea'; + const AREA_UPDATE = 'action.updateArea'; + const AREA_DELETE = 'action.deleteArea'; // -- Categories Associated Content ---------------------------------------- diff --git a/core/lib/Thelia/Form/Shipping/ShippingCreateForm.php b/core/lib/Thelia/Form/Area/AreaCreateForm.php similarity index 95% rename from core/lib/Thelia/Form/Shipping/ShippingCreateForm.php rename to core/lib/Thelia/Form/Area/AreaCreateForm.php index 674777112..590001867 100644 --- a/core/lib/Thelia/Form/Shipping/ShippingCreateForm.php +++ b/core/lib/Thelia/Form/Area/AreaCreateForm.php @@ -21,18 +21,18 @@ /* */ /*************************************************************************************/ -namespace Thelia\Form\Shipping; +namespace Thelia\Form\Area; use Thelia\Core\Translation\Translator; use Symfony\Component\Validator\Constraints\NotBlank; use Thelia\Form\BaseForm; /** - * Class ShippingCreateForm + * Class AreaCreateForm * @package Thelia\Form\Shipping * @author Manuel Raynaud */ -class ShippingCreateForm extends BaseForm +class AreaCreateForm extends BaseForm { /** @@ -74,6 +74,6 @@ class ShippingCreateForm extends BaseForm */ public function getName() { - return 'thelia_shipping_creation'; + return 'thelia_area_creation'; } } \ No newline at end of file diff --git a/core/lib/Thelia/Form/Shipping/ShippingModificationForm.php b/core/lib/Thelia/Form/Area/AreaModificationForm.php similarity index 92% rename from core/lib/Thelia/Form/Shipping/ShippingModificationForm.php rename to core/lib/Thelia/Form/Area/AreaModificationForm.php index 018e44907..eefcb825a 100644 --- a/core/lib/Thelia/Form/Shipping/ShippingModificationForm.php +++ b/core/lib/Thelia/Form/Area/AreaModificationForm.php @@ -21,16 +21,17 @@ /* */ /*************************************************************************************/ -namespace Thelia\Form\Shipping; +namespace Thelia\Form\Area; use Symfony\Component\Validator\Constraints\GreaterThan; +use Thelia\Form\Area\AreaCreateForm; /** - * Class ShippingModificationForm + * Class AreaModificationForm * @package Thelia\Form\Shipping * @author Manuel Raynaud */ -class ShippingModificationForm extends ShippingCreateForm +class AreaModificationForm extends AreaCreateForm { public function buildForm() { @@ -43,6 +44,6 @@ class ShippingModificationForm extends ShippingCreateForm public function getName() { - return 'thelia_shipping_modification'; + return 'thelia_area_modification'; } } \ No newline at end of file