This commit is contained in:
Manuel Raynaud
2013-10-18 09:28:17 +02:00
parent 12b5a81364
commit 52ed89f1aa
70 changed files with 136 additions and 244 deletions

View File

@@ -34,7 +34,6 @@ use Thelia\Model\CountryQuery;
use Thelia\Action\BaseAction;
use Thelia\Model\Area as AreaModel;
/**
* Class Area
* @package Thelia\Action
@@ -97,7 +96,6 @@ class Area extends BaseAction implements EventSubscriberInterface
$event->setArea($area);
}
/**
* Returns an array of event names this subscriber wants to listen to.
*
@@ -128,4 +126,4 @@ class Area extends BaseAction implements EventSubscriberInterface
TheliaEvents::AREA_CREATE => array('create', 128)
);
}
}
}

View File

@@ -27,7 +27,6 @@ use Symfony\Component\Filesystem\Filesystem;
use Thelia\Core\Event\Cache\CacheEvent;
use Thelia\Core\Event\TheliaEvents;
/**
* Class Cache
* @package Thelia\Action
@@ -42,7 +41,6 @@ class Cache extends BaseAction implements EventSubscriberInterface
$directoryBrowser = new \DirectoryIterator($dir);
$fs = new Filesystem();
$fs->remove($dir);
@@ -74,4 +72,4 @@ class Cache extends BaseAction implements EventSubscriberInterface
TheliaEvents::CACHE_CLEAR => array('cacheClear', 128)
);
}
}
}

View File

@@ -160,7 +160,7 @@ class Content extends BaseAction implements EventSubscriberInterface
->filterByFolderId($event->getFolderId())
->findOne();
if(null !== $contentFolder) {
if (null !== $contentFolder) {
$contentFolder->delete();
}
}

View File

@@ -32,7 +32,6 @@ use Thelia\Core\Event\TheliaEvents;
use Thelia\Model\Country as CountryModel;
use Thelia\Model\CountryQuery;
/**
* Class Country
* @package Thelia\Action
@@ -85,15 +84,13 @@ class Country extends BaseAction implements EventSubscriberInterface
public function toggleDefault(CountryToggleDefaultEvent $event)
{
if( null !== $country = CountryQuery::create()->findPk($event->getCountryId()))
{
if ( null !== $country = CountryQuery::create()->findPk($event->getCountryId())) {
$country->toggleDefault();
$event->setCountry($country);
}
}
/**
* Returns an array of event names this subscriber wants to listen to.
*
@@ -123,4 +120,4 @@ class Country extends BaseAction implements EventSubscriberInterface
TheliaEvents::COUNTRY_TOGGLE_DEFAULT => array('toggleDefault', 128)
);
}
}
}

View File

@@ -25,7 +25,6 @@ namespace Thelia\Action;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Thelia\Core\Event\ActionEvent;
use Thelia\Core\Event\Customer\CustomerAddressEvent;
use Thelia\Core\Event\Customer\CustomerCreateOrUpdateEvent;
use Thelia\Core\Event\Customer\CustomerEvent;
use Thelia\Core\Event\TheliaEvents;

View File

@@ -29,7 +29,6 @@ use Thelia\Core\Event\TheliaEvents;
use Thelia\Model\ModuleQuery;
use Thelia\Module\BaseModule;
/**
* Class Module
* @package Thelia\Action
@@ -45,16 +44,16 @@ class Module extends BaseAction implements EventSubscriberInterface
$moduleInstance = $moduleClass->newInstance();
if( method_exists($moduleInstance, 'setContainer')) {
if ( method_exists($moduleInstance, 'setContainer')) {
$moduleInstance->setContainer($this->container);
if($module->getActivate() == BaseModule::IS_ACTIVATED) {
if ($module->getActivate() == BaseModule::IS_ACTIVATED) {
$moduleInstance->deActivate($module);
} else {
$moduleInstance->activate($module);
}
}
if($module->isModified()) {
if ($module->isModified()) {
$event->setModule($module);
}
@@ -95,4 +94,4 @@ class Module extends BaseAction implements EventSubscriberInterface
TheliaEvents::MODULE_TOGGLE_ACTIVATION => array('toggleActivation', 128)
);
}
}
}

View File

@@ -26,7 +26,6 @@ use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Thelia\Core\Event\PdfEvent;
use Thelia\Core\Event\TheliaEvents;
/**
* Class Pdf
* @package Thelia\Action
@@ -72,4 +71,4 @@ class Pdf extends BaseAction implements EventSubscriberInterface
TheliaEvents::GENERATE_PDF => array("generatePdf", 128)
);
}
}
}

View File

@@ -29,7 +29,6 @@ use Thelia\Core\Event\TheliaEvents;
use Thelia\Model\AreaDeliveryModule;
use Thelia\Model\AreaDeliveryModuleQuery;
/**
* Class ShippingZone
* @package Thelia\Action
@@ -55,7 +54,7 @@ class ShippingZone extends BaseAction implements EventSubscriberInterface
->filterByDeliveryModuleId($event->getShoppingZoneId())
->findOne();
if($areaDelivery) {
if ($areaDelivery) {
$areaDelivery->delete();
} else {
throw new \RuntimeException(sprintf('areaDeliveryModule not found with area_id = %d and delivery_module_id = %d', $event->getAreaId(), $event->getShoppingZoneId()));
@@ -89,4 +88,4 @@ class ShippingZone extends BaseAction implements EventSubscriberInterface
TheliaEvents::SHIPPING_ZONE_REMOVE_AREA => array('removeArea', 128),
);
}
}
}

View File

@@ -68,8 +68,6 @@ class TaxRule extends BaseAction implements EventSubscriberInterface
->save()
;
$event->setTaxRule($taxRule);
}
}
@@ -90,12 +88,12 @@ class TaxRule extends BaseAction implements EventSubscriberInterface
->delete();
/* for each country */
foreach($event->getCountryList() as $country) {
foreach ($event->getCountryList() as $country) {
$position = 1;
/* on applique les nouvelles regles */
foreach($taxList as $tax) {
if(is_array($tax)) {
foreach($tax as $samePositionTax) {
foreach ($taxList as $tax) {
if (is_array($tax)) {
foreach ($tax as $samePositionTax) {
$taxModel = new TaxRuleCountry();
$taxModel->setTaxRule($taxRule)
->setCountryId($country)