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

@@ -24,14 +24,12 @@
namespace Thelia\Controller\Admin;
use Thelia\Core\Event\Address\AddressCreateOrUpdateEvent;
use Thelia\Core\Event\Address\AddressEvent;
use Thelia\Core\Event\Customer\CustomerCreateOrUpdateEvent;
use Thelia\Core\Event\TheliaEvents;
use Thelia\Form\AddressCreateForm;
use Thelia\Form\AddressUpdateForm;
use Thelia\Model\AddressQuery;
use Thelia\Model\CustomerQuery;
/**
* Class AddressController
* @package Thelia\Controller\Admin
@@ -78,7 +76,7 @@ class AddressController extends AbstractCrudController
$this->dispatch(TheliaEvents::ADDRESS_DEFAULT, $addressEvent);
$this->adminLogAppend(sprintf("address %d for customer %d removal", $address_id, $address->getCustomerId()));
} catch(\Exception $e) {
} catch (\Exception $e) {
\Thelia\Log\Tlog::getInstance()->error(sprintf("error during address removal with message %s", $e->getMessage()));
}
@@ -176,8 +174,6 @@ class AddressController extends AbstractCrudController
$formData["is_default"]
);
return $event;
}
@@ -279,8 +275,8 @@ class AddressController extends AbstractCrudController
/**
* Put in this method post object delete processing if required.
*
* @param \Thelia\Core\Event\AddressEvent $deleteEvent the delete event
* @return Response a response, or null to continue normal processing
* @param \Thelia\Core\Event\AddressEvent $deleteEvent the delete event
* @return Response a response, or null to continue normal processing
*/
protected function performAdditionalDeleteAction($deleteEvent)
{
@@ -291,8 +287,8 @@ class AddressController extends AbstractCrudController
/**
* Put in this method post object creation processing if required.
*
* @param AddressCreateOrUpdateEvent $createEvent the create event
* @return Response a response, or null to continue normal processing
* @param AddressCreateOrUpdateEvent $createEvent the create event
* @return Response a response, or null to continue normal processing
*/
protected function performAdditionalCreateAction($createEvent)
{
@@ -303,4 +299,4 @@ class AddressController extends AbstractCrudController
{
$this->redirectToEditionTemplate();
}
}
}

View File

@@ -378,8 +378,8 @@ class BaseAdminController extends BaseController
* Render the given template, and returns the result as a string.
*
* @param $templateName the complete template name, with extension
* @param array $args the template arguments
* @param null $templateDir
* @param array $args the template arguments
* @param null $templateDir
*
* @return \Symfony\Component\HttpFoundation\Response
*/

View File

@@ -243,7 +243,7 @@ class CountryController extends AbstractCrudController
try {
$this->dispatch(TheliaEvents::COUNTRY_TOGGLE_DEFAULT, $toogleDefaultEvent);
if($toogleDefaultEvent->hasCountry()) {
if ($toogleDefaultEvent->hasCountry()) {
return $this->nullResponse();
}
} catch (\Exception $ex) {

View File

@@ -25,14 +25,11 @@ namespace Thelia\Controller\Admin;
use Propel\Runtime\Exception\PropelException;
use Symfony\Component\Form\Form;
use Thelia\Core\Event\Address\AddressEvent;
use Thelia\Core\Event\Customer\CustomerAddressEvent;
use Thelia\Core\Event\Customer\CustomerCreateOrUpdateEvent;
use Thelia\Core\Event\Customer\CustomerEvent;
use Thelia\Core\Event\TheliaEvents;
use Thelia\Form\CustomerModification;
use Thelia\Form\Exception\FormValidationException;
use Thelia\Model\AddressQuery;
use Thelia\Model\CustomerQuery;
use Thelia\Core\Translation\Translator;
@@ -57,8 +54,6 @@ class CustomerController extends BaseAdminController
));
}
/**
* update customer action
*

View File

@@ -59,7 +59,7 @@ class ModuleController extends BaseAdminController
$event = new ModuleToggleActivationEvent($module_id);
$this->dispatch(TheliaEvents::MODULE_TOGGLE_ACTIVATION, $event);
if(null === $event->getModule()) {
if (null === $event->getModule()) {
throw new \LogicException(
$this->getTranslator()->trans("No %obj was updated.", array('%obj' => 'Module')));
}
@@ -67,9 +67,8 @@ class ModuleController extends BaseAdminController
$message = $e->getMessage();
}
if($this->getRequest()->isXmlHttpRequest()) {
if($message) {
if ($this->getRequest()->isXmlHttpRequest()) {
if ($message) {
$response = $this->jsonResponse(json_encode(array(
"error" => $message
)), 500);

View File

@@ -211,7 +211,6 @@ class OrderController extends BaseAdminController
{
if (null !== $response = $this->checkAuth("admin.order.update")) return $response;
$html = $this->renderRaw(
$fileName,
array(
@@ -227,7 +226,7 @@ class OrderController extends BaseAdminController
$this->dispatch(TheliaEvents::GENERATE_PDF, $pdfEvent);
if($pdfEvent->hasPdf()) {
if ($pdfEvent->hasPdf()) {
return Response::create($pdfEvent->getPdf(), 200,
array(
'Content-type' => "application/pdf",

View File

@@ -140,5 +140,4 @@ class ShippingZoneController extends BaseAdminController
return $this->getRequest()->get('shipping_zone_id', 0);
}
}

View File

@@ -199,8 +199,8 @@ class TaxRuleController extends AbstractCrudController
/**
* Put in this method post object creation processing if required.
*
* @param TaxRuleEvent $createEvent the create event
* @return Response a response, or null to continue normal processing
* @param TaxRuleEvent $createEvent the create event
* @return Response a response, or null to continue normal processing
*/
protected function performAdditionalCreateAction($createEvent)
{
@@ -284,4 +284,4 @@ class TaxRuleController extends AbstractCrudController
// At this point, the form has errors, and should be redisplayed.
return $this->renderEditionTemplate();
}
}
}