This commit is contained in:
Manuel Raynaud
2013-10-25 10:07:21 +02:00
parent 22caf28f80
commit 2c030f910b
91 changed files with 219 additions and 761 deletions

View File

@@ -23,11 +23,9 @@
namespace Thelia\Action; namespace Thelia\Action;
use Propel\Runtime\ActiveQuery\Criteria;
use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Thelia\Core\Event\Administrator\AdministratorEvent; use Thelia\Core\Event\Administrator\AdministratorEvent;
use Thelia\Core\Event\TheliaEvents; use Thelia\Core\Event\TheliaEvents;
use Thelia\Core\Security\AccessManager;
use Thelia\Model\Admin as AdminModel; use Thelia\Model\Admin as AdminModel;
use Thelia\Model\AdminQuery; use Thelia\Model\AdminQuery;

View File

@@ -34,7 +34,6 @@ use Thelia\Model\ConfigQuery;
use Thelia\Model\LangQuery; use Thelia\Model\LangQuery;
use Thelia\Model\Lang as LangModel; use Thelia\Model\Lang as LangModel;
/** /**
* Class Lang * Class Lang
* @package Thelia\Action * @package Thelia\Action

View File

@@ -29,7 +29,6 @@ use Thelia\Action\BaseAction;
use Thelia\Model\NewsletterQuery; use Thelia\Model\NewsletterQuery;
use Thelia\Model\Newsletter as NewsletterModel; use Thelia\Model\Newsletter as NewsletterModel;
/** /**
* Class Newsletter * Class Newsletter
* @package Thelia\Action * @package Thelia\Action

View File

@@ -52,14 +52,6 @@ use Thelia\Core\Event\Product\ProductSetTemplateEvent;
use Thelia\Model\ProductSaleElementsQuery; use Thelia\Model\ProductSaleElementsQuery;
use Thelia\Core\Event\Product\ProductDeleteCategoryEvent; use Thelia\Core\Event\Product\ProductDeleteCategoryEvent;
use Thelia\Core\Event\Product\ProductAddCategoryEvent; use Thelia\Core\Event\Product\ProductAddCategoryEvent;
use Thelia\Model\AttributeAvQuery;
use Thelia\Model\AttributeCombination;
use Thelia\Core\Event\Product\ProductSaleElementCreateEvent;
use Propel\Runtime\Propel;
use Thelia\Model\Map\ProductTableMap;
use Thelia\Core\Event\Product\ProductSaleElementDeleteEvent;
use Thelia\Model\ProductPrice;
use Thelia\Model\ProductSaleElements;
use Thelia\Core\Event\Product\ProductAddAccessoryEvent; use Thelia\Core\Event\Product\ProductAddAccessoryEvent;
use Thelia\Core\Event\Product\ProductDeleteAccessoryEvent; use Thelia\Core\Event\Product\ProductDeleteAccessoryEvent;

View File

@@ -25,9 +25,6 @@ namespace Thelia\Action;
use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Thelia\Model\ProductQuery;
use Thelia\Model\Product as ProductModel;
use Thelia\Core\Event\TheliaEvents; use Thelia\Core\Event\TheliaEvents;
use Thelia\Core\Event\ProductSaleElement\ProductSaleElementCreateEvent; use Thelia\Core\Event\ProductSaleElement\ProductSaleElementCreateEvent;
use Thelia\Model\Map\ProductSaleElementsTableMap; use Thelia\Model\Map\ProductSaleElementsTableMap;
@@ -69,8 +66,7 @@ class ProductSaleElement extends BaseAction implements EventSubscriberInterface
if ($salesElement == null) { if ($salesElement == null) {
// Create a new default product sale element // Create a new default product sale element
$salesElement = $event->getProduct()->createDefaultProductSaleElement($con, 0, 0, $event->getCurrencyId(), true); $salesElement = $event->getProduct()->createDefaultProductSaleElement($con, 0, 0, $event->getCurrencyId(), true);
} } else {
else {
// This (new) one is the default // This (new) one is the default
$salesElement->setIsDefault(true)->save($con); $salesElement->setIsDefault(true)->save($con);
} }
@@ -98,8 +94,7 @@ class ProductSaleElement extends BaseAction implements EventSubscriberInterface
// Store all the stuff ! // Store all the stuff !
$con->commit(); $con->commit();
} } catch (\Exception $ex) {
catch (\Exception $ex) {
$con->rollback(); $con->rollback();
@@ -170,8 +165,7 @@ class ProductSaleElement extends BaseAction implements EventSubscriberInterface
->setPromoPrice($event->getSalePrice()) ->setPromoPrice($event->getSalePrice())
->setPrice($event->getPrice()) ->setPrice($event->getPrice())
; ;
} } else {
else {
// Do not store the price. // Do not store the price.
$productPrice $productPrice
->setPromoPrice(0) ->setPromoPrice(0)
@@ -183,8 +177,7 @@ class ProductSaleElement extends BaseAction implements EventSubscriberInterface
// Store all the stuff ! // Store all the stuff !
$con->commit(); $con->commit();
} } catch (\Exception $ex) {
catch (\Exception $ex) {
$con->rollback(); $con->rollback();
@@ -214,8 +207,7 @@ class ProductSaleElement extends BaseAction implements EventSubscriberInterface
if ($product->countSaleElements() <= 0) { if ($product->countSaleElements() <= 0) {
// If we just deleted the last PSE, create a default one // If we just deleted the last PSE, create a default one
$product->createDefaultProductSaleElement($con, 0, 0, $event->getCurrencyId(), true); $product->createDefaultProductSaleElement($con, 0, 0, $event->getCurrencyId(), true);
} } elseif ($pse->getIsDefault()) {
else if ($pse->getIsDefault()) {
// If we deleted the default PSE, make the last created one the default // If we deleted the default PSE, make the last created one the default
$pse = ProductSaleElementsQuery::create() $pse = ProductSaleElementsQuery::create()
@@ -229,8 +221,7 @@ class ProductSaleElement extends BaseAction implements EventSubscriberInterface
// Store all the stuff ! // Store all the stuff !
$con->commit(); $con->commit();
} } catch (\Exception $ex) {
catch (\Exception $ex) {
$con->rollback(); $con->rollback();

View File

@@ -23,7 +23,6 @@
namespace Thelia\Action; namespace Thelia\Action;
use Propel\Runtime\ActiveQuery\Criteria;
use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Thelia\Core\Event\Profile\ProfileEvent; use Thelia\Core\Event\Profile\ProfileEvent;
use Thelia\Core\Event\TheliaEvents; use Thelia\Core\Event\TheliaEvents;

View File

@@ -23,7 +23,6 @@
namespace Thelia\Action; namespace Thelia\Action;
use Propel\Runtime\ActiveQuery\Criteria;
use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Thelia\Core\Event\Tax\TaxEvent; use Thelia\Core\Event\Tax\TaxEvent;
use Thelia\Core\Event\TheliaEvents; use Thelia\Core\Event\TheliaEvents;

View File

@@ -27,7 +27,6 @@ use Propel\Runtime\ActiveQuery\Criteria;
use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Thelia\Core\Event\Tax\TaxRuleEvent; use Thelia\Core\Event\Tax\TaxRuleEvent;
use Thelia\Core\Event\TheliaEvents; use Thelia\Core\Event\TheliaEvents;
use Thelia\Model\Map\TaxRuleTableMap;
use Thelia\Model\TaxRuleCountry; use Thelia\Model\TaxRuleCountry;
use Thelia\Model\TaxRuleCountryQuery; use Thelia\Model\TaxRuleCountryQuery;
use Thelia\Model\TaxRule as TaxRuleModel; use Thelia\Model\TaxRule as TaxRuleModel;

View File

@@ -23,7 +23,6 @@
namespace Thelia\Controller\Admin; namespace Thelia\Controller\Admin;
use Thelia\Core\Security\AccessManager;
use Thelia\Core\Security\Resource\AdminResources; use Thelia\Core\Security\Resource\AdminResources;
use Thelia\Core\Event\Administrator\AdministratorEvent; use Thelia\Core\Event\Administrator\AdministratorEvent;
use Thelia\Core\Event\TheliaEvents; use Thelia\Core\Event\TheliaEvents;
@@ -31,7 +30,6 @@ use Thelia\Form\AdministratorCreationForm;
use Thelia\Form\AdministratorModificationForm; use Thelia\Form\AdministratorModificationForm;
use Thelia\Model\AdminQuery; use Thelia\Model\AdminQuery;
class AdministratorController extends AbstractCrudController class AdministratorController extends AbstractCrudController
{ {
public function __construct() public function __construct()
@@ -158,7 +156,6 @@ class AdministratorController extends AbstractCrudController
return $object->getId(); return $object->getId();
} }
protected function renderListTemplate($currentOrder) protected function renderListTemplate($currentOrder)
{ {
// We always return to the feature edition form // We always return to the feature edition form

View File

@@ -25,7 +25,6 @@ namespace Thelia\Controller\Admin;
use Propel\Runtime\Exception\PropelException; use Propel\Runtime\Exception\PropelException;
use Thelia\Core\Security\Resource\AdminResources; use Thelia\Core\Security\Resource\AdminResources;
use Thelia\Core\Event\Customer\CustomerAddressEvent;
use Thelia\Core\Event\Customer\CustomerCreateOrUpdateEvent; use Thelia\Core\Event\Customer\CustomerCreateOrUpdateEvent;
use Thelia\Core\Event\Customer\CustomerEvent; use Thelia\Core\Event\Customer\CustomerEvent;
use Thelia\Core\Event\TheliaEvents; use Thelia\Core\Event\TheliaEvents;

View File

@@ -41,7 +41,6 @@ use Thelia\Form\Lang\LangUrlForm;
use Thelia\Model\ConfigQuery; use Thelia\Model\ConfigQuery;
use Thelia\Model\LangQuery; use Thelia\Model\LangQuery;
/** /**
* Class LangController * Class LangController
* @package Thelia\Controller\Admin * @package Thelia\Controller\Admin
@@ -53,7 +52,6 @@ class LangController extends BaseAdminController
public function defaultAction() public function defaultAction()
{ {
if (null !== $response = $this->checkAuth(AdminResources::LANGUAGE, AccessManager::VIEW)) return $response; if (null !== $response = $this->checkAuth(AdminResources::LANGUAGE, AccessManager::VIEW)) return $response;
return $this->renderDefault(); return $this->renderDefault();
} }

View File

@@ -47,7 +47,6 @@ class MessageController extends AbstractCrudController
AdminResources::MESSAGE, AdminResources::MESSAGE,
TheliaEvents::MESSAGE_CREATE, TheliaEvents::MESSAGE_CREATE,
TheliaEvents::MESSAGE_UPDATE, TheliaEvents::MESSAGE_UPDATE,
TheliaEvents::MESSAGE_DELETE, TheliaEvents::MESSAGE_DELETE,

View File

@@ -54,7 +54,6 @@ use Thelia\Core\Event\ProductSaleElement\ProductSaleElementCreateEvent;
use Thelia\Model\AttributeQuery; use Thelia\Model\AttributeQuery;
use Thelia\Model\AttributeAvQuery; use Thelia\Model\AttributeAvQuery;
use Thelia\Form\ProductSaleElementUpdateForm; use Thelia\Form\ProductSaleElementUpdateForm;
use Thelia\Model\ProductSaleElements;
use Thelia\Model\ProductPriceQuery; use Thelia\Model\ProductPriceQuery;
use Thelia\Form\ProductDefaultSaleElementUpdateForm; use Thelia\Form\ProductDefaultSaleElementUpdateForm;
use Thelia\Model\ProductPrice; use Thelia\Model\ProductPrice;
@@ -62,8 +61,6 @@ use Thelia\Model\Currency;
use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\JsonResponse;
use Thelia\TaxEngine\Calculator; use Thelia\TaxEngine\Calculator;
use Thelia\Model\Country; use Thelia\Model\Country;
use Thelia\Model\CountryQuery;
use Thelia\Model\TaxRuleQuery;
use Thelia\Tools\NumberFormat; use Thelia\Tools\NumberFormat;
use Thelia\Model\Product; use Thelia\Model\Product;
use Thelia\Model\CurrencyQuery; use Thelia\Model\CurrencyQuery;
@@ -189,8 +186,8 @@ class ProductController extends AbstractCrudController
return $event->hasProduct(); return $event->hasProduct();
} }
protected function updatePriceFromDefaultCurrency($productPrice, $saleElement, $defaultCurrency, $currentCurrency) { protected function updatePriceFromDefaultCurrency($productPrice, $saleElement, $defaultCurrency, $currentCurrency)
{
// Get price for default currency // Get price for default currency
$priceForDefaultCurrency = ProductPriceQuery::create() $priceForDefaultCurrency = ProductPriceQuery::create()
->filterByCurrency($defaultCurrency) ->filterByCurrency($defaultCurrency)
@@ -206,7 +203,8 @@ class ProductController extends AbstractCrudController
} }
} }
protected function appendValue(&$array, $key, $value) { protected function appendValue(&$array, $key, $value)
{
if (! isset($array[$key])) $array[$key] = array(); if (! isset($array[$key])) $array[$key] = array();
$array[$key][] = $value; $array[$key][] = $value;
@@ -277,8 +275,7 @@ class ProductController extends AbstractCrudController
"isdefault" => $saleElement->getIsDefault() > 0 ? 1 : 0, "isdefault" => $saleElement->getIsDefault() > 0 ? 1 : 0,
"ean_code" => $saleElement->getEanCode() "ean_code" => $saleElement->getEanCode()
); );
} } else {
else {
if ($saleElement->getIsDefault()) { if ($saleElement->getIsDefault()) {
$combinationPseData['default_pse'] = $saleElement->getId(); $combinationPseData['default_pse'] = $saleElement->getId();
@@ -871,8 +868,7 @@ class ProductController extends AbstractCrudController
try { try {
$this->dispatch(TheliaEvents::PRODUCT_ADD_PRODUCT_SALE_ELEMENT, $event); $this->dispatch(TheliaEvents::PRODUCT_ADD_PRODUCT_SALE_ELEMENT, $event);
} } catch (\Exception $ex) {
catch (\Exception $ex) {
// Any error // Any error
return $this->errorPage($ex); return $this->errorPage($ex);
} }
@@ -895,8 +891,7 @@ class ProductController extends AbstractCrudController
try { try {
$this->dispatch(TheliaEvents::PRODUCT_DELETE_PRODUCT_SALE_ELEMENT, $event); $this->dispatch(TheliaEvents::PRODUCT_DELETE_PRODUCT_SALE_ELEMENT, $event);
} } catch (\Exception $ex) {
catch (\Exception $ex) {
// Any error // Any error
return $this->errorPage($ex); return $this->errorPage($ex);
} }
@@ -983,8 +978,7 @@ class ProductController extends AbstractCrudController
$this->processSingleProductSaleElementUpdate($tmp_data); $this->processSingleProductSaleElementUpdate($tmp_data);
} }
} } else {
else {
// No need to preprocess data // No need to preprocess data
$this->processSingleProductSaleElementUpdate($data); $this->processSingleProductSaleElementUpdate($data);
} }
@@ -996,12 +990,10 @@ class ProductController extends AbstractCrudController
// Redirect to the success URL // Redirect to the success URL
$this->redirect($changeForm->getSuccessUrl()); $this->redirect($changeForm->getSuccessUrl());
} } catch (FormValidationException $ex) {
catch (FormValidationException $ex) {
// Form cannot be validated // Form cannot be validated
$error_msg = $this->createStandardFormValidationErrorMessage($ex); $error_msg = $this->createStandardFormValidationErrorMessage($ex);
} } catch (\Exception $ex) {
catch (\Exception $ex) {
// Any other error // Any other error
$error_msg = $ex->getMessage(); $error_msg = $ex->getMessage();
} }
@@ -1016,7 +1008,8 @@ class ProductController extends AbstractCrudController
/** /**
* Process the change of product's PSE list. * Process the change of product's PSE list.
*/ */
public function updateProductSaleElementsAction() { public function updateProductSaleElementsAction()
{
return $this->processProductSaleElementUpdate( return $this->processProductSaleElementUpdate(
new ProductSaleElementUpdateForm($this->getRequest()) new ProductSaleElementUpdateForm($this->getRequest())
); );
@@ -1025,7 +1018,8 @@ class ProductController extends AbstractCrudController
/** /**
* Update default product sale element (not attached to any combination) * Update default product sale element (not attached to any combination)
*/ */
public function updateProductDefaultSaleElementAction() { public function updateProductDefaultSaleElementAction()
{
return $this->processProductSaleElementUpdate( return $this->processProductSaleElementUpdate(
new ProductDefaultSaleElementUpdateForm($this->getRequest()) new ProductDefaultSaleElementUpdateForm($this->getRequest())
); );
@@ -1035,8 +1029,8 @@ class ProductController extends AbstractCrudController
* Invoked through Ajax; this method calculates the taxed price from the unaxed price, and * Invoked through Ajax; this method calculates the taxed price from the unaxed price, and
* vice versa. * vice versa.
*/ */
public function priceCaclulator() { public function priceCaclulator()
{
$return_price = 0; $return_price = 0;
$price = floatval($this->getRequest()->get('price', 0)); $price = floatval($this->getRequest()->get('price', 0));
@@ -1048,11 +1042,9 @@ class ProductController extends AbstractCrudController
if ($action == 'to_tax') { if ($action == 'to_tax') {
$return_price = $this->computePrice($price, 'without_tax', $product); $return_price = $this->computePrice($price, 'without_tax', $product);
} } elseif ($action == 'from_tax') {
else if ($action == 'from_tax') {
$return_price = $this->computePrice($price, 'with_tax', $product); $return_price = $this->computePrice($price, 'with_tax', $product);
} } else {
else {
$return_price = $price; $return_price = $price;
} }
@@ -1069,8 +1061,8 @@ class ProductController extends AbstractCrudController
* *
* @return \Symfony\Component\HttpFoundation\JsonResponse * @return \Symfony\Component\HttpFoundation\JsonResponse
*/ */
public function loadConvertedPrices() { public function loadConvertedPrices()
{
$product_sale_element_id = intval($this->getRequest()->get('product_sale_element_id', 0)); $product_sale_element_id = intval($this->getRequest()->get('product_sale_element_id', 0));
$currency_id = intval($this->getRequest()->get('currency_id', 0)); $currency_id = intval($this->getRequest()->get('currency_id', 0));
@@ -1119,8 +1111,8 @@ class ProductController extends AbstractCrudController
* @param Product $product * @param Product $product
* @return Ambigous <unknown, number> * @return Ambigous <unknown, number>
*/ */
protected function computePrice($price, $price_type, Product $product, $convert = false) { protected function computePrice($price, $price_type, Product $product, $convert = false)
{
$calc = new Calculator(); $calc = new Calculator();
$calc->load( $calc->load(
@@ -1130,11 +1122,9 @@ class ProductController extends AbstractCrudController
if ($price_type == 'without_tax') { if ($price_type == 'without_tax') {
$return_price = $calc->getTaxedPrice($price); $return_price = $calc->getTaxedPrice($price);
} } elseif ($price_type == 'with_tax') {
else if ($price_type == 'with_tax') {
$return_price = $calc->getUntaxedPrice($price); $return_price = $calc->getUntaxedPrice($price);
} } else {
else {
$return_price = $price; $return_price = $price;
} }

View File

@@ -29,7 +29,6 @@ use Thelia\Core\Event\Profile\ProfileEvent;
use Thelia\Core\Event\TheliaEvents; use Thelia\Core\Event\TheliaEvents;
use Thelia\Form\ProfileCreationForm; use Thelia\Form\ProfileCreationForm;
use Thelia\Form\ProfileModificationForm; use Thelia\Form\ProfileModificationForm;
use Thelia\Form\ProfileProfileListUpdateForm;
use Thelia\Form\ProfileUpdateModuleAccessForm; use Thelia\Form\ProfileUpdateModuleAccessForm;
use Thelia\Form\ProfileUpdateResourceAccessForm; use Thelia\Form\ProfileUpdateResourceAccessForm;
use Thelia\Model\ProfileQuery; use Thelia\Model\ProfileQuery;

View File

@@ -28,7 +28,6 @@ use Thelia\Core\Event\Tax\TaxEvent;
use Thelia\Core\Event\TheliaEvents; use Thelia\Core\Event\TheliaEvents;
use Thelia\Form\TaxCreationForm; use Thelia\Form\TaxCreationForm;
use Thelia\Form\TaxModificationForm; use Thelia\Form\TaxModificationForm;
use Thelia\Form\TaxTaxListUpdateForm;
use Thelia\Model\TaxQuery; use Thelia\Model\TaxQuery;
class TaxController extends AbstractCrudController class TaxController extends AbstractCrudController
@@ -200,7 +199,6 @@ class TaxController extends AbstractCrudController
{ {
$type = $formData['type']; $type = $formData['type'];
} }
protected function getRequirements($type, $formData) protected function getRequirements($type, $formData)

View File

@@ -196,15 +196,13 @@ class BaseController extends ContainerAware
$errorMessage = null; $errorMessage = null;
if ($form->get("error_message")->getData() != null) { if ($form->get("error_message")->getData() != null) {
$errorMessage = $form->get("error_message")->getData(); $errorMessage = $form->get("error_message")->getData();
} } else {
else {
$errorMessage = sprintf("Missing or invalid data: %s", $this->getErrorMessages($form)); $errorMessage = sprintf("Missing or invalid data: %s", $this->getErrorMessages($form));
} }
throw new FormValidationException($errorMessage); throw new FormValidationException($errorMessage);
} }
} } else {
else {
throw new FormValidationException(sprintf("Wrong form method, %s expected.", $expectedMethod)); throw new FormValidationException(sprintf("Wrong form method, %s expected.", $expectedMethod));
} }
} }
@@ -229,8 +227,7 @@ class BaseController extends ContainerAware
{ {
if ($form != null) { if ($form != null) {
$url = $form->getSuccessUrl(); $url = $form->getSuccessUrl();
} } else {
else {
$url = $this->getRequest()->get("success_url"); $url = $this->getRequest()->get("success_url");
} }

View File

@@ -67,7 +67,6 @@ class CartController extends BaseFrontController
$request->attributes->set('_view', "includes/mini-cart"); $request->attributes->set('_view', "includes/mini-cart");
} }
if ($message) { if ($message) {
$cartAdd->setErrorMessage($message); $cartAdd->setErrorMessage($message);
$this->getParserContext()->addForm($cartAdd); $this->getParserContext()->addForm($cartAdd);

View File

@@ -26,7 +26,6 @@ use Thelia\Form\ContactForm;
use Thelia\Form\Exception\FormValidationException; use Thelia\Form\Exception\FormValidationException;
use Thelia\Model\ConfigQuery; use Thelia\Model\ConfigQuery;
/** /**
* Class ContactController * Class ContactController
* @package Thelia\Controller\Front * @package Thelia\Controller\Front

View File

@@ -24,21 +24,11 @@ namespace Thelia\Controller\Front;
use Propel\Runtime\Exception\PropelException; use Propel\Runtime\Exception\PropelException;
use Thelia\Core\Event\Coupon\CouponConsumeEvent; use Thelia\Core\Event\Coupon\CouponConsumeEvent;
use Thelia\Exception\TheliaProcessException;
use Thelia\Form\CouponCode; use Thelia\Form\CouponCode;
use Thelia\Form\Exception\FormValidationException; use Thelia\Form\Exception\FormValidationException;
use Thelia\Core\Event\Order\OrderEvent;
use Thelia\Core\Event\TheliaEvents; use Thelia\Core\Event\TheliaEvents;
use Symfony\Component\HttpFoundation\Request;
use Thelia\Form\OrderDelivery;
use Thelia\Form\OrderPayment;
use Thelia\Log\Tlog; use Thelia\Log\Tlog;
use Thelia\Model\AddressQuery;
use Thelia\Model\AreaDeliveryModuleQuery;
use Thelia\Model\Base\OrderQuery;
use Thelia\Model\ModuleQuery;
use Thelia\Model\Order; use Thelia\Model\Order;
use Thelia\Tools\URL;
/** /**
* Class CouponController * Class CouponController

View File

@@ -51,7 +51,6 @@ class CustomerController extends BaseFrontController
{ {
use \Thelia\Cart\CartTrait; use \Thelia\Cart\CartTrait;
public function newPasswordAction() public function newPasswordAction()
{ {
if (! $this->getSecurityContext()->hasCustomerUser()) { if (! $this->getSecurityContext()->hasCustomerUser()) {
@@ -156,7 +155,6 @@ class CustomerController extends BaseFrontController
$this->getParserContext()->addForm($customerProfilUpdateForm); $this->getParserContext()->addForm($customerProfilUpdateForm);
} }
public function updatePasswordAction() public function updatePasswordAction()
{ {
if ($this->getSecurityContext()->hasCustomerUser()) { if ($this->getSecurityContext()->hasCustomerUser()) {

View File

@@ -23,7 +23,6 @@
namespace Thelia\Controller\Front; namespace Thelia\Controller\Front;
/** /**
* Class Mail * Class Mail
* @package Thelia\Controller\Front * @package Thelia\Controller\Front

View File

@@ -27,7 +27,6 @@ use Thelia\Core\Event\Newsletter\NewsletterEvent;
use Thelia\Core\Event\TheliaEvents; use Thelia\Core\Event\TheliaEvents;
use Thelia\Form\NewsletterForm; use Thelia\Form\NewsletterForm;
/** /**
* Class NewsletterController * Class NewsletterController
* @package Thelia\Controller\Front * @package Thelia\Controller\Front
@@ -50,8 +49,7 @@ class NewsletterController extends BaseFrontController
$this->getRequest()->getSession()->getLang()->getLocale() $this->getRequest()->getSession()->getLang()->getLocale()
); );
if (null !== $customer = $this->getSecurityContext()->getCustomerUser()) if (null !== $customer = $this->getSecurityContext()->getCustomerUser()) {
{
$event->setFirstname($customer->getFirstname()); $event->setFirstname($customer->getFirstname());
$event->setLastname($customer->getLastname()); $event->setLastname($customer->getLastname());
} }

View File

@@ -23,7 +23,6 @@
namespace Thelia\Core\Event\Lang; namespace Thelia\Core\Event\Lang;
/** /**
* Class LangCreateEvent * Class LangCreateEvent
* @package Thelia\Core\Event\Lang * @package Thelia\Core\Event\Lang
@@ -137,5 +136,4 @@ class LangCreateEvent extends LangEvent
return $this->title; return $this->title;
} }
} }

View File

@@ -24,7 +24,6 @@
namespace Thelia\Core\Event\Lang; namespace Thelia\Core\Event\Lang;
use Thelia\Core\Event\ActionEvent; use Thelia\Core\Event\ActionEvent;
/** /**
* Class LangDefaultBehaviorEvent * Class LangDefaultBehaviorEvent
* @package Thelia\Core\Event\Lang * @package Thelia\Core\Event\Lang
@@ -37,7 +36,7 @@ class LangDefaultBehaviorEvent extends ActionEvent
*/ */
protected $defaultBehavior; protected $defaultBehavior;
function __construct($defaultBehavior) public function __construct($defaultBehavior)
{ {
$this->defaultBehavior = $defaultBehavior; $this->defaultBehavior = $defaultBehavior;
} }
@@ -58,7 +57,4 @@ class LangDefaultBehaviorEvent extends ActionEvent
return $this->defaultBehavior; return $this->defaultBehavior;
} }
} }

View File

@@ -23,7 +23,6 @@
namespace Thelia\Core\Event\Lang; namespace Thelia\Core\Event\Lang;
/** /**
* Class LangDeleteEvent * Class LangDeleteEvent
* @package Thelia\Core\Event\Lang * @package Thelia\Core\Event\Lang
@@ -39,7 +38,7 @@ class LangDeleteEvent extends LangEvent
/** /**
* @param int $lang_id * @param int $lang_id
*/ */
function __construct($lang_id) public function __construct($lang_id)
{ {
$this->lang_id = $lang_id; $this->lang_id = $lang_id;
} }

View File

@@ -25,7 +25,6 @@ namespace Thelia\Core\Event\Lang;
use Thelia\Core\Event\ActionEvent; use Thelia\Core\Event\ActionEvent;
use Thelia\Model\Lang; use Thelia\Model\Lang;
/** /**
* Class LangEvent * Class LangEvent
* @package Thelia\Core\Event\Lang * @package Thelia\Core\Event\Lang
@@ -38,7 +37,7 @@ class LangEvent extends ActionEvent
*/ */
protected $lang; protected $lang;
function __construct(Lang $lang = null) public function __construct(Lang $lang = null)
{ {
$this->lang = $lang; $this->lang = $lang;
} }
@@ -70,7 +69,4 @@ class LangEvent extends ActionEvent
return null !== $this->lang; return null !== $this->lang;
} }
} }

View File

@@ -23,7 +23,6 @@
namespace Thelia\Core\Event\Lang; namespace Thelia\Core\Event\Lang;
/** /**
* Class LangToggleDefaultEvent * Class LangToggleDefaultEvent
* @package Thelia\Core\Event\Lang * @package Thelia\Core\Event\Lang
@@ -39,7 +38,7 @@ class LangToggleDefaultEvent extends LangEvent
/** /**
* @param int $lang_id * @param int $lang_id
*/ */
function __construct($lang_id) public function __construct($lang_id)
{ {
$this->lang_id = $lang_id; $this->lang_id = $lang_id;
} }
@@ -64,6 +63,4 @@ class LangToggleDefaultEvent extends LangEvent
return $this->lang_id; return $this->lang_id;
} }
} }

View File

@@ -23,7 +23,6 @@
namespace Thelia\Core\Event\Lang; namespace Thelia\Core\Event\Lang;
/** /**
* Class LangUpdateEvent * Class LangUpdateEvent
* @package Thelia\Core\Event\Lang * @package Thelia\Core\Event\Lang
@@ -39,12 +38,11 @@ class LangUpdateEvent extends LangCreateEvent
/** /**
* @param int $id * @param int $id
*/ */
function __construct($id) public function __construct($id)
{ {
$this->id = $id; $this->id = $id;
} }
/** /**
* @param int $id * @param int $id
* *
@@ -65,5 +63,4 @@ class LangUpdateEvent extends LangCreateEvent
return $this->id; return $this->id;
} }
} }

View File

@@ -23,7 +23,6 @@
namespace Thelia\Core\Event\Module; namespace Thelia\Core\Event\Module;
/** /**
* Class ModuleDeleteEvent * Class ModuleDeleteEvent
* @package Thelia\Core\Event\Module * @package Thelia\Core\Event\Module
@@ -36,7 +35,7 @@ class ModuleDeleteEvent extends ModuleEvent
*/ */
protected $module_id; protected $module_id;
function __construct($module_id) public function __construct($module_id)
{ {
$this->module_id = $module_id; $this->module_id = $module_id;
} }
@@ -57,5 +56,4 @@ class ModuleDeleteEvent extends ModuleEvent
return $this->module_id; return $this->module_id;
} }
} }

View File

@@ -24,7 +24,6 @@
namespace Thelia\Core\Event\Newsletter; namespace Thelia\Core\Event\Newsletter;
use Thelia\Core\Event\ActionEvent; use Thelia\Core\Event\ActionEvent;
/** /**
* Class NewsletterEvent * Class NewsletterEvent
* @package Thelia\Core\Event\Newsletter * @package Thelia\Core\Event\Newsletter
@@ -57,7 +56,7 @@ class NewsletterEvent extends ActionEvent
*/ */
protected $locale; protected $locale;
function __construct($email, $locale) public function __construct($email, $locale)
{ {
$this->email = $email; $this->email = $email;
$this->locale = $locale; $this->locale = $locale;
@@ -159,8 +158,4 @@ class NewsletterEvent extends ActionEvent
return $this->id; return $this->id;
} }
} }

View File

@@ -24,7 +24,6 @@
namespace Thelia\Core\Event\ProductSaleElement; namespace Thelia\Core\Event\ProductSaleElement;
use Thelia\Model\Product; use Thelia\Model\Product;
use Thelia\Core\Event\Product\ProductEvent;
class ProductSaleElementCreateEvent extends ProductSaleElementEvent class ProductSaleElementCreateEvent extends ProductSaleElementEvent
{ {
@@ -65,15 +64,16 @@ class ProductSaleElementCreateEvent extends ProductSaleElementEvent
return $this; return $this;
} }
public function getProduct() { public function getProduct()
{
return $this->product; return $this->product;
} }
public function setProduct($product) { public function setProduct($product)
{
$this->product = $product; $this->product = $product;
return $this; return $this;
} }
} }

View File

@@ -23,7 +23,6 @@
namespace Thelia\Core\Event\ProductSaleElement; namespace Thelia\Core\Event\ProductSaleElement;
use Thelia\Model\Product; use Thelia\Model\Product;
use Thelia\Core\Event\Product\ProductEvent;
class ProductSaleElementDeleteEvent extends ProductSaleElementEvent class ProductSaleElementDeleteEvent extends ProductSaleElementEvent
{ {
@@ -58,6 +57,7 @@ class ProductSaleElementDeleteEvent extends ProductSaleElementEvent
public function setCurrencyId($currency_id) public function setCurrencyId($currency_id)
{ {
$this->currency_id = $currency_id; $this->currency_id = $currency_id;
return $this; return $this;
} }

View File

@@ -22,9 +22,7 @@
/*************************************************************************************/ /*************************************************************************************/
namespace Thelia\Core\Event\ProductSaleElement; namespace Thelia\Core\Event\ProductSaleElement;
use Thelia\Core\Event\Product\ProductCreateEvent;
use Thelia\Model\Product; use Thelia\Model\Product;
use Thelia\Core\Event\Product\ProductEvent;
class ProductSaleElementUpdateEvent extends ProductSaleElementEvent class ProductSaleElementUpdateEvent extends ProductSaleElementEvent
{ {
@@ -217,6 +215,7 @@ class ProductSaleElementUpdateEvent extends ProductSaleElementEvent
public function setFromDefaultCurrency($from_default_currency) public function setFromDefaultCurrency($from_default_currency)
{ {
$this->from_default_currency = $from_default_currency; $this->from_default_currency = $from_default_currency;
return $this; return $this;
} }

View File

@@ -552,7 +552,6 @@ final class TheliaEvents
const TAX_UPDATE = "action.updateTax"; const TAX_UPDATE = "action.updateTax";
const TAX_DELETE = "action.deleteTax"; const TAX_DELETE = "action.deleteTax";
// -- Profile management --------------------------------------------- // -- Profile management ---------------------------------------------
const PROFILE_CREATE = "action.createProfile"; const PROFILE_CREATE = "action.createProfile";

View File

@@ -23,13 +23,6 @@
namespace Thelia\Core\Security; namespace Thelia\Core\Security;
use Propel\Runtime\ActiveQuery\Criteria;
use Thelia\Core\Security\Resource\AdminResources;
use Thelia\Core\Security\User\UserInterface;
use Thelia\Core\HttpFoundation\Request;
use Thelia\Model\ProfileQuery;
use Thelia\Model\ProfileResourceQuery;
/** /**
* A simple security manager, in charge of checking user * A simple security manager, in charge of checking user
* *
@@ -49,7 +42,7 @@ class AccessManager
self::DELETE => false, self::DELETE => false,
); );
static protected $accessPows = array( protected static $accessPows = array(
self::VIEW => 3, self::VIEW => 3,
self::CREATE => 2, self::CREATE => 2,
self::UPDATE => 1, self::UPDATE => 1,
@@ -75,7 +68,7 @@ class AccessManager
} }
static public function getMaxAccessValue() public static function getMaxAccessValue()
{ {
return pow(2, current(array_slice( self::$accessPows, -1, 1, true ))) - 1; return pow(2, current(array_slice( self::$accessPows, -1, 1, true ))) - 1;
} }
@@ -106,7 +99,6 @@ class AccessManager
} }
} }
public function getAccessValue() public function getAccessValue()
{ {
return $this->accessValue; return $this->accessValue;

View File

@@ -23,7 +23,7 @@
namespace Thelia\Core\Security\Exception; namespace Thelia\Core\Security\Exception;
class ResourceException extends \RuntimeException class RessourceException extends \RuntimeException
{ {
const UNKNOWN_EXCEPTION = 0; const UNKNOWN_EXCEPTION = 0;

View File

@@ -33,9 +33,9 @@ use Thelia\Core\Security\Exception\ResourceException;
*/ */
final class AdminResources final class AdminResources
{ {
static private $selfReflection = null; private static $selfReflection = null;
static public function retrieve($name) public static function retrieve($name)
{ {
$constantName = strtoupper($name); $constantName = strtoupper($name);

View File

@@ -23,12 +23,9 @@
namespace Thelia\Core\Security; namespace Thelia\Core\Security;
use Propel\Runtime\ActiveQuery\Criteria;
use Thelia\Core\Security\Resource\AdminResources; use Thelia\Core\Security\Resource\AdminResources;
use Thelia\Core\Security\User\UserInterface; use Thelia\Core\Security\User\UserInterface;
use Thelia\Core\HttpFoundation\Request; use Thelia\Core\HttpFoundation\Request;
use Thelia\Model\ProfileQuery;
use Thelia\Model\ProfileResourceQuery;
/** /**
* A simple security manager, in charge of checking user * A simple security manager, in charge of checking user

View File

@@ -27,7 +27,6 @@ use Propel\Runtime\ActiveQuery\Criteria;
use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Thelia\Core\Template\Element\Exception\SearchLoopException;
use Thelia\Core\Template\Loop\Argument\Argument; use Thelia\Core\Template\Loop\Argument\Argument;
use Propel\Runtime\ActiveQuery\ModelCriteria; use Propel\Runtime\ActiveQuery\ModelCriteria;
use Thelia\Core\Security\SecurityContext; use Thelia\Core\Security\SecurityContext;

View File

@@ -22,8 +22,6 @@
/*************************************************************************************/ /*************************************************************************************/
namespace Thelia\Core\Template\Element; namespace Thelia\Core\Template\Element;
use Symfony\Component\Validator\ExecutionContextInterface;
/** /**
* *
* @author Etienne Roudeix <eroudeix@openstudio.fr> * @author Etienne Roudeix <eroudeix@openstudio.fr>

View File

@@ -24,7 +24,6 @@
namespace Thelia\Core\Template\Loop; namespace Thelia\Core\Template\Loop;
use Propel\Runtime\ActiveQuery\Criteria; use Propel\Runtime\ActiveQuery\Criteria;
use Thelia\Core\Template\Element\BaseI18nLoop;
use Thelia\Core\Template\Element\BaseLoop; use Thelia\Core\Template\Element\BaseLoop;
use Thelia\Core\Template\Element\LoopResult; use Thelia\Core\Template\Element\LoopResult;
use Thelia\Core\Template\Element\LoopResultRow; use Thelia\Core\Template\Element\LoopResultRow;
@@ -34,7 +33,6 @@ use Thelia\Core\Template\Loop\Argument\Argument;
use Thelia\Model\AdminQuery; use Thelia\Model\AdminQuery;
use Thelia\Type; use Thelia\Type;
use Thelia\Type\BooleanOrBothType;
/** /**
* *

View File

@@ -16,7 +16,6 @@ use Thelia\Core\Template\Loop\Argument\Argument;
use Thelia\Core\Template\Loop\Argument\ArgumentCollection; use Thelia\Core\Template\Loop\Argument\ArgumentCollection;
use Thelia\Model\CountryQuery; use Thelia\Model\CountryQuery;
use Thelia\Type; use Thelia\Type;
use Thelia\Type\TypeCollection;
class Cart extends BaseLoop class Cart extends BaseLoop
{ {

View File

@@ -33,7 +33,6 @@ use Thelia\Core\Template\Loop\Argument\Argument;
use Thelia\Model\FolderQuery; use Thelia\Model\FolderQuery;
use Thelia\Model\Map\ContentTableMap; use Thelia\Model\Map\ContentTableMap;
use Thelia\Model\ContentFolderQuery;
use Thelia\Model\ContentQuery; use Thelia\Model\ContentQuery;
use Thelia\Type\TypeCollection; use Thelia\Type\TypeCollection;
use Thelia\Type; use Thelia\Type;

View File

@@ -32,7 +32,6 @@ use Thelia\Core\Template\Element\SearchLoopInterface;
use Thelia\Core\Template\Loop\Argument\ArgumentCollection; use Thelia\Core\Template\Loop\Argument\ArgumentCollection;
use Thelia\Core\Template\Loop\Argument\Argument; use Thelia\Core\Template\Loop\Argument\Argument;
use Thelia\Model\CustomerQuery; use Thelia\Model\CustomerQuery;
use Thelia\Model\OrderAddress;
use Thelia\Model\OrderAddressQuery; use Thelia\Model\OrderAddressQuery;
use Thelia\Model\OrderQuery; use Thelia\Model\OrderQuery;
use Thelia\Type\TypeCollection; use Thelia\Type\TypeCollection;

View File

@@ -26,7 +26,6 @@ namespace Thelia\Core\Template\Loop;
use Propel\Runtime\ActiveQuery\Criteria; use Propel\Runtime\ActiveQuery\Criteria;
use Propel\Runtime\ActiveQuery\Join; use Propel\Runtime\ActiveQuery\Join;
use Thelia\Core\Template\Element\BaseI18nLoop; use Thelia\Core\Template\Element\BaseI18nLoop;
use Thelia\Core\Template\Element\BaseLoop;
use Thelia\Core\Template\Element\LoopResult; use Thelia\Core\Template\Element\LoopResult;
use Thelia\Core\Template\Element\LoopResultRow; use Thelia\Core\Template\Element\LoopResultRow;
@@ -35,7 +34,6 @@ use Thelia\Core\Template\Loop\Argument\ArgumentCollection;
use Thelia\Core\Template\Loop\Argument\Argument; use Thelia\Core\Template\Loop\Argument\Argument;
use Thelia\Exception\TaxEngineException; use Thelia\Exception\TaxEngineException;
use Thelia\Model\Base\ProductSaleElementsQuery;
use Thelia\Model\CategoryQuery; use Thelia\Model\CategoryQuery;
use Thelia\Model\CountryQuery; use Thelia\Model\CountryQuery;
use Thelia\Model\CurrencyQuery; use Thelia\Model\CurrencyQuery;

View File

@@ -33,7 +33,6 @@ use Thelia\Core\Template\Loop\Argument\Argument;
use Thelia\Model\ProfileQuery; use Thelia\Model\ProfileQuery;
use Thelia\Type; use Thelia\Type;
use Thelia\Type\BooleanOrBothType;
/** /**
* *

View File

@@ -34,7 +34,6 @@ use Thelia\Core\Template\Loop\Argument\Argument;
use Thelia\Model\ResourceQuery; use Thelia\Model\ResourceQuery;
use Thelia\Type; use Thelia\Type;
use Thelia\Type\BooleanOrBothType;
/** /**
* *

View File

@@ -178,8 +178,6 @@ class TaxRuleCountry extends BaseI18nLoop
; ;
} }
$loopResult->addRow($loopResultRow); $loopResult->addRow($loopResultRow);
} }

View File

@@ -24,7 +24,6 @@
namespace Thelia\Core\Template; namespace Thelia\Core\Template;
use Thelia\Core\Thelia; use Thelia\Core\Thelia;
use Thelia\Model\ConfigQuery;
use Thelia\Core\HttpFoundation\Request; use Thelia\Core\HttpFoundation\Request;
use Thelia\Form\BaseForm; use Thelia\Form\BaseForm;
/** /**

View File

@@ -60,8 +60,8 @@ use Symfony\Component\Form\Extension\Core\View\ChoiceView;
*/ */
class Form extends AbstractSmartyPlugin class Form extends AbstractSmartyPlugin
{ {
static private $taggedFieldsStack = null; private static $taggedFieldsStack = null;
static private $taggedFieldsStackPosition = null; private static $taggedFieldsStackPosition = null;
protected $request; protected $request;
protected $parserContext; protected $parserContext;
@@ -113,8 +113,7 @@ class Form extends AbstractSmartyPlugin
$template->assign("form_error", $instance->hasError() ? true : false); $template->assign("form_error", $instance->hasError() ? true : false);
$template->assign("form_error_message", $instance->getErrorMessage()); $template->assign("form_error_message", $instance->getErrorMessage());
} } else {
else {
return $content; return $content;
} }
} }
@@ -127,7 +126,6 @@ class Form extends AbstractSmartyPlugin
$template->assign("checked", isset($fieldVars['checked']) ? $fieldVars['checked'] : false); $template->assign("checked", isset($fieldVars['checked']) ? $fieldVars['checked'] : false);
//data //data
$template->assign("data", $fieldVars['data']); $template->assign("data", $fieldVars['data']);
@@ -182,7 +180,6 @@ class Form extends AbstractSmartyPlugin
if ($formFieldType instanceof TheliaType) { if ($formFieldType instanceof TheliaType) {
$template->assign("formType", $formFieldView->vars['type']); $template->assign("formType", $formFieldView->vars['type']);
switch ($formFieldView->vars['type']) { switch ($formFieldView->vars['type']) {
case "choice": case "choice":
if (!isset($formFieldView->vars['options']['choices']) || !is_array($formFieldView->vars['options']['choices'])) { if (!isset($formFieldView->vars['options']['choices']) || !is_array($formFieldView->vars['options']['choices'])) {
@@ -223,18 +220,15 @@ class Form extends AbstractSmartyPlugin
$val = $value[$key]; $val = $value[$key];
$this->assignFieldValues($template, $name, $val, $formFieldView->vars, $value_count); $this->assignFieldValues($template, $name, $val, $formFieldView->vars, $value_count);
} } else {
else {
throw new \InvalidArgumentException(sprintf("Missing or empty parameter 'value_key' for field '%s'", $formFieldView->vars["name"])); throw new \InvalidArgumentException(sprintf("Missing or empty parameter 'value_key' for field '%s'", $formFieldView->vars["name"]));
} }
} } else {
else {
$this->assignFieldValues($template, $formFieldView->vars["full_name"], $formFieldView->vars["value"], $formFieldView->vars); $this->assignFieldValues($template, $formFieldView->vars["full_name"], $formFieldView->vars["value"], $formFieldView->vars);
} }
$formFieldView->setRendered(); $formFieldView->setRendered();
} } else {
else {
return $content; return $content;
} }
} }
@@ -322,8 +316,7 @@ class Form extends AbstractSmartyPlugin
if ($repeat) { if ($repeat) {
$this->assignFieldErrorVars($template, $errors); $this->assignFieldErrorVars($template, $errors);
} } else {
else {
return $content; return $content;
} }
} }

View File

@@ -8,7 +8,6 @@ use \Symfony\Component\EventDispatcher\EventDispatcherInterface;
use \Smarty; use \Smarty;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\HttpException;
use Thelia\Core\Template\ParserInterface; use Thelia\Core\Template\ParserInterface;
use Thelia\Core\Template\Smarty\AbstractSmartyPlugin; use Thelia\Core\Template\Smarty\AbstractSmartyPlugin;

View File

@@ -25,12 +25,9 @@ namespace Thelia\Form;
use Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraints;
use Symfony\Component\Validator\Constraints\NotBlank; use Symfony\Component\Validator\Constraints\NotBlank;
use Symfony\Component\Validator\ExecutionContextInterface; use Symfony\Component\Validator\ExecutionContextInterface;
use Thelia\Core\Security\AccessManager;
use Thelia\Core\Security\Resource\AdminResources;
use Thelia\Core\Translation\Translator; use Thelia\Core\Translation\Translator;
use Thelia\Model\AdminQuery; use Thelia\Model\AdminQuery;
use Thelia\Model\ProfileQuery; use Thelia\Model\ProfileQuery;
use Thelia\Model\ConfigQuery;
class AdministratorCreationForm extends BaseForm class AdministratorCreationForm extends BaseForm
{ {

View File

@@ -25,7 +25,6 @@ namespace Thelia\Form;
use Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraints;
use Symfony\Component\Validator\ExecutionContextInterface; use Symfony\Component\Validator\ExecutionContextInterface;
use Thelia\Core\Translation\Translator;
use Thelia\Model\AdminQuery; use Thelia\Model\AdminQuery;
class AdministratorModificationForm extends AdministratorCreationForm class AdministratorModificationForm extends AdministratorCreationForm

View File

@@ -27,7 +27,6 @@ use Symfony\Component\Validator\Constraints\Email;
use Symfony\Component\Validator\Constraints\NotBlank; use Symfony\Component\Validator\Constraints\NotBlank;
use Thelia\Core\Translation\Translator; use Thelia\Core\Translation\Translator;
/** /**
* Class ContactForm * Class ContactForm
* @package Thelia\Form * @package Thelia\Form

View File

@@ -23,8 +23,6 @@
namespace Thelia\Form; namespace Thelia\Form;
use Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraints;
use Thelia\Model\ModuleQuery;
use Thelia\Module\BaseModule;
/** /**
* Class CouponCode * Class CouponCode

View File

@@ -27,7 +27,6 @@ use Symfony\Component\Validator\Constraints\Date;
use Symfony\Component\Validator\Constraints\GreaterThanOrEqual; use Symfony\Component\Validator\Constraints\GreaterThanOrEqual;
use Symfony\Component\Validator\Constraints\NotBlank; use Symfony\Component\Validator\Constraints\NotBlank;
use Symfony\Component\Validator\Constraints\NotEqualTo; use Symfony\Component\Validator\Constraints\NotEqualTo;
use Symfony\Component\Validator\Constraints\Range;
/** /**
* Created by JetBrains PhpStorm. * Created by JetBrains PhpStorm.

View File

@@ -26,7 +26,6 @@ use Symfony\Component\Validator\Constraints;
use Symfony\Component\Validator\ExecutionContextInterface; use Symfony\Component\Validator\ExecutionContextInterface;
use Thelia\Model\ConfigQuery; use Thelia\Model\ConfigQuery;
use Thelia\Core\Translation\Translator; use Thelia\Core\Translation\Translator;
use Thelia\Model\CustomerQuery;
/** /**
* Class CustomerPasswordUpdateForm * Class CustomerPasswordUpdateForm

View File

@@ -22,11 +22,8 @@
/*************************************************************************************/ /*************************************************************************************/
namespace Thelia\Form; namespace Thelia\Form;
use Symfony\Component\Validator\Constraints;
use Symfony\Component\Validator\ExecutionContextInterface; use Symfony\Component\Validator\ExecutionContextInterface;
use Thelia\Model\CustomerQuery; use Thelia\Model\CustomerQuery;
use Thelia\Model\ConfigQuery;
use Thelia\Core\Translation\Translator;
/** /**
* Class CustomerProfilUpdateForm * Class CustomerProfilUpdateForm
@@ -69,7 +66,6 @@ class CustomerProfilUpdateForm extends CustomerCreateForm
)); ));
} }
/** /**
* @param $value * @param $value
* @param ExecutionContextInterface $context * @param ExecutionContextInterface $context

View File

@@ -26,7 +26,6 @@ use Symfony\Component\Validator\Constraints\NotBlank;
use Thelia\Form\BaseForm; use Thelia\Form\BaseForm;
use Thelia\Core\Translation\Translator; use Thelia\Core\Translation\Translator;
/** /**
* Class LangCreateForm * Class LangCreateForm
* @package Thelia\Form\Lang * @package Thelia\Form\Lang

View File

@@ -24,11 +24,9 @@
namespace Thelia\Form\Lang; namespace Thelia\Form\Lang;
use Symfony\Component\Validator\Constraints\NotBlank; use Symfony\Component\Validator\Constraints\NotBlank;
use Symfony\Component\Validator\Constraints\Range;
use Thelia\Form\BaseForm; use Thelia\Form\BaseForm;
use Thelia\Core\Translation\Translator; use Thelia\Core\Translation\Translator;
/** /**
* Class LangDefaultBehaviorForm * Class LangDefaultBehaviorForm
* @package Thelia\Form\Lang * @package Thelia\Form\Lang

View File

@@ -25,7 +25,6 @@ namespace Thelia\Form\Lang;
use Symfony\Component\Validator\Constraints\GreaterThan; use Symfony\Component\Validator\Constraints\GreaterThan;
use Symfony\Component\Validator\Constraints\NotBlank; use Symfony\Component\Validator\Constraints\NotBlank;
/** /**
* Class LangUpdateForm * Class LangUpdateForm
* @package Thelia\Form\Lang * @package Thelia\Form\Lang

View File

@@ -24,7 +24,6 @@
namespace Thelia\Form\Lang; namespace Thelia\Form\Lang;
use Thelia\Core\Event\ActionEvent; use Thelia\Core\Event\ActionEvent;
/** /**
* Class LangUrlEvent * Class LangUrlEvent
* @package Thelia\Form\Lang * @package Thelia\Form\Lang

View File

@@ -26,7 +26,6 @@ use Symfony\Component\Validator\Constraints\NotBlank;
use Thelia\Form\BaseForm; use Thelia\Form\BaseForm;
use Thelia\Model\LangQuery; use Thelia\Model\LangQuery;
/** /**
* Class LangUrlForm * Class LangUrlForm
* @package Thelia\Form\Lang * @package Thelia\Form\Lang

View File

@@ -30,7 +30,6 @@ use Symfony\Component\Validator\ExecutionContextInterface;
use Thelia\Core\Translation\Translator; use Thelia\Core\Translation\Translator;
use Thelia\Model\NewsletterQuery; use Thelia\Model\NewsletterQuery;
/** /**
* Class NewsletterForm * Class NewsletterForm
* @package Thelia\Form * @package Thelia\Form

View File

@@ -26,7 +26,6 @@ use Symfony\Component\Validator\Constraints;
use Symfony\Component\Validator\Constraints\NotBlank; use Symfony\Component\Validator\Constraints\NotBlank;
use Symfony\Component\Validator\ExecutionContextInterface; use Symfony\Component\Validator\ExecutionContextInterface;
use Thelia\Core\Security\AccessManager; use Thelia\Core\Security\AccessManager;
use Thelia\Core\Translation\Translator;
use Thelia\Model\ProfileQuery; use Thelia\Model\ProfileQuery;
use Thelia\Model\ModuleQuery; use Thelia\Model\ModuleQuery;

View File

@@ -26,7 +26,6 @@ use Symfony\Component\Validator\Constraints;
use Symfony\Component\Validator\Constraints\NotBlank; use Symfony\Component\Validator\Constraints\NotBlank;
use Symfony\Component\Validator\ExecutionContextInterface; use Symfony\Component\Validator\ExecutionContextInterface;
use Thelia\Core\Security\AccessManager; use Thelia\Core\Security\AccessManager;
use Thelia\Core\Translation\Translator;
use Thelia\Model\ProfileQuery; use Thelia\Model\ProfileQuery;
use Thelia\Model\ResourceQuery; use Thelia\Model\ResourceQuery;

View File

@@ -148,7 +148,6 @@ abstract class BaseModule extends ContainerAware
); );
} }
/* browse the directory */ /* browse the directory */
$imagePosition = 1; $imagePosition = 1;
foreach ($directoryBrowser as $directoryContent) { foreach ($directoryBrowser as $directoryContent) {

View File

@@ -1,47 +0,0 @@
<?php
/**********************************************************************************/
/* */
/* Thelia */
/* */
/* Copyright (c) OpenStudio */
/* email : info@thelia.net */
/* web : http://www.thelia.net */
/* */
/* This program is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 3 of the License */
/* */
/* This program is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* */
/**********************************************************************************/
namespace Thelia\Coupon;
/**
* Created by JetBrains PhpStorm.
* Date: 8/19/13
* Time: 3:24 PM
*
* Unit Test BaseFacade Class
*
* @package Coupon
* @author Guillaume MOREL <gmorel@openstudio.fr>
*
*/
class CouponBaseAdapterTest extends \PHPUnit_Framework_TestCase
{
public function testSomething()
{
// Stop here and mark this test as incomplete.
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
}
}

View File

@@ -1,48 +0,0 @@
<?php
/**********************************************************************************/
/* */
/* Thelia */
/* */
/* Copyright (c) OpenStudio */
/* email : info@thelia.net */
/* web : http://www.thelia.net */
/* */
/* This program is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 3 of the License */
/* */
/* This program is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* */
/**********************************************************************************/
namespace Thelia\Coupon;
require_once 'CouponManagerTest.php';
/**
* Created by JetBrains PhpStorm.
* Date: 8/19/13
* Time: 3:24 PM
*
* Unit Test CouponFactory Class
*
* @package Coupon
* @author Guillaume MOREL <gmorel@openstudio.fr>
*
*/
class CouponFactoryTest extends \PHPUnit_Framework_TestCase
{
public function testSomething()
{
// Stop here and mark this test as incomplete.
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
}
}

View File

@@ -1,48 +0,0 @@
<?php
/**********************************************************************************/
/* */
/* Thelia */
/* */
/* Copyright (c) OpenStudio */
/* email : info@thelia.net */
/* web : http://www.thelia.net */
/* */
/* This program is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 3 of the License */
/* */
/* This program is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* */
/**********************************************************************************/
namespace Thelia\Coupon;
/**
* Created by JetBrains PhpStorm.
* Date: 8/19/13
* Time: 3:24 PM
*
* Unit Test CouponManager Class
*
* @package Coupon
* @author Guillaume MOREL <gmorel@openstudio.fr>
*
*/
class CouponManagerTest extends \PHPUnit_Framework_TestCase
{
public function testSomething()
{
// Stop here and mark this test as incomplete.
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
}
}

View File

@@ -1,46 +0,0 @@
<?php
/**********************************************************************************/
/* */
/* Thelia */
/* */
/* Copyright (c) OpenStudio */
/* email : info@thelia.net */
/* web : http://www.thelia.net */
/* */
/* This program is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 3 of the License */
/* */
/* This program is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* */
/**********************************************************************************/
namespace Thelia\Coupon;
/**
* Created by JetBrains PhpStorm.
* Date: 8/19/13
* Time: 3:24 PM
*
* Unit Test ConditionCollection Class
*
* @package Coupon
* @author Guillaume MOREL <gmorel@openstudio.fr>
*
*/
class CouponRuleCollectionTest extends \PHPUnit_Framework_TestCase
{
public function testSomething()
{
// Stop here and mark this test as incomplete.
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
}
}

View File

@@ -1,73 +0,0 @@
<?php
/**********************************************************************************/
/* */
/* Thelia */
/* */
/* Copyright (c) OpenStudio */
/* email : info@thelia.net */
/* web : http://www.thelia.net */
/* */
/* This program is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 3 of the License */
/* */
/* This program is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* */
/**********************************************************************************/
namespace Thelia\Coupon;
use Thelia\Coupon\RuleOrganizer;
/**
* Created by JetBrains PhpStorm.
* Date: 8/19/13
* Time: 3:24 PM
*
* Unit Test RuleOrganizer Class
*
* @package Coupon
* @author Guillaume MOREL <gmorel@openstudio.fr>
*
*/
class RuleOrganizerTest extends \PHPUnit_Framework_TestCase
{
/**
* @var RuleOrganizer
*/
protected $object;
/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*/
protected function setUp()
{
$this->object = new RuleOrganizer();
}
/**
* Tears down the fixture, for example, closes a network connection.
* This method is called after a test is executed.
*/
protected function tearDown()
{
}
/**
* @covers Thelia\Coupon\RuleOrganizer::organize
* @todo Implement testOrganize().
*/
public function testOrganize()
{
// Remove the following lines when you implement this test.
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
}
}

View File

@@ -1,65 +0,0 @@
<?php
/**********************************************************************************/
/* */
/* Thelia */
/* */
/* Copyright (c) OpenStudio */
/* email : info@thelia.net */
/* web : http://www.thelia.net */
/* */
/* This program is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 3 of the License */
/* */
/* This program is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* */
/**********************************************************************************/
namespace Thelia\Coupon;
//require_once '../CouponManagerTest.php';
/**
* Created by JetBrains PhpStorm.
* Date: 8/19/13
* Time: 3:24 PM
*
* Unit Test RemoveXAmount Class
*
* @package Coupon
* @author Guillaume MOREL <gmorel@openstudio.fr>
*
*/
class RemoveXAmountTest extends \PHPUnit_Framework_TestCase
{
/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*/
protected function setUp()
{
}
public function testSomething()
{
// Stop here and mark this test as incomplete.
$this->markTestIncomplete(
'This coupon has not been implemented yet.'
);
}
/**
* Tears down the fixture, for example, closes a network connection.
* This method is called after a test is executed.
*/
protected function tearDown()
{
}
}

View File

@@ -1,67 +0,0 @@
<?php
/**********************************************************************************/
/* */
/* Thelia */
/* */
/* Copyright (c) OpenStudio */
/* email : info@thelia.net */
/* web : http://www.thelia.net */
/* */
/* This program is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 3 of the License */
/* */
/* This program is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* */
/**********************************************************************************/
namespace Thelia\Coupon;
use PHPUnit_Framework_TestCase;
//require_once '../CouponManagerTest.php';
/**
* Created by JetBrains PhpStorm.
* Date: 8/19/13
* Time: 3:24 PM
*
* Unit Test RemoveXPercent Class
*
* @package Coupon
* @author Guillaume MOREL <gmorel@openstudio.fr>
*
*/
class RemoveXPercentTest extends \PHPUnit_Framework_TestCase
{
/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*/
protected function setUp()
{
}
public function testSomething()
{
$this->markTestIncomplete(
'This coupon has not been implemented yet.'
);
}
/**
* Tears down the fixture, for example, closes a network connection.
* This method is called after a test is executed.
*/
protected function tearDown()
{
}
}

View File

@@ -30,7 +30,7 @@ class FileManagerTest extends \PHPUnit_Framework_TestCase
/** /**
* @covers Thelia\Tools\FileManager::copyUploadedFile * @covers Thelia\Tools\FileManager::copyUploadedFile
*/ */
public function testCopyUploadedFile() /* public function testCopyUploadedFile()
{ {
$this->markTestIncomplete( $this->markTestIncomplete(
'This test has not been implemented yet : Mock issue' 'This test has not been implemented yet : Mock issue'
@@ -103,13 +103,13 @@ class FileManagerTest extends \PHPUnit_Framework_TestCase
$actual = $fileManager->copyUploadedFile(24, FileManager::TYPE_PRODUCT, $stubProductImage, $stubUploadedFile, $newUploadedFiles, FileManager::FILE_TYPE_IMAGES); $actual = $fileManager->copyUploadedFile(24, FileManager::TYPE_PRODUCT, $stubProductImage, $stubUploadedFile, $newUploadedFiles, FileManager::FILE_TYPE_IMAGES);
$this->assertCount(1, $actual); $this->assertCount(1, $actual);
} }*/
/** /**
* @covers Thelia\Tools\FileManager::copyUploadedFile * @covers Thelia\Tools\FileManager::copyUploadedFile
* @expectedException \Thelia\Exception\ImageException * @expectedException \Thelia\Exception\ImageException
*/ */
public function testCopyUploadedFileExceptionImageException() /*public function testCopyUploadedFileExceptionImageException()
{ {
$this->markTestIncomplete( $this->markTestIncomplete(
'This test has not been implemented yet : Mock issue' 'This test has not been implemented yet : Mock issue'
@@ -181,7 +181,7 @@ class FileManagerTest extends \PHPUnit_Framework_TestCase
$actual = $fileManager->copyUploadedFile(24, FileManager::TYPE_PRODUCT, $stubProductImage, $stubUploadedFile, $newUploadedFiles, FileManager::FILE_TYPE_DOCUMENTS); $actual = $fileManager->copyUploadedFile(24, FileManager::TYPE_PRODUCT, $stubProductImage, $stubUploadedFile, $newUploadedFiles, FileManager::FILE_TYPE_DOCUMENTS);
} }*/
/** /**
* @covers Thelia\Tools\FileManager::saveImage * @covers Thelia\Tools\FileManager::saveImage
@@ -650,23 +650,23 @@ class FileManagerTest extends \PHPUnit_Framework_TestCase
/** /**
* @covers Thelia\Tools\FileManager::getImageForm * @covers Thelia\Tools\FileManager::getImageForm
*/ */
public function testGetImageForm() /* public function testGetImageForm()
{ {
// Mock issue // Mock issue
$this->markTestIncomplete( $this->markTestIncomplete(
'This test has not been implemented yet.' 'This test has not been implemented yet.'
); );
} }*/
/** /**
* @covers Thelia\Tools\FileManager::getDocumentForm * @covers Thelia\Tools\FileManager::getDocumentForm
*/ */
public function testGetDocumentForm() /* public function testGetDocumentForm()
{ {
// Mock issue // Mock issue
$this->markTestIncomplete( $this->markTestIncomplete(
'This test has not been implemented yet.' 'This test has not been implemented yet.'
); );
} }*/
/** /**
* @covers Thelia\Tools\FileManager::getUploadDir * @covers Thelia\Tools\FileManager::getUploadDir
@@ -879,21 +879,21 @@ class FileManagerTest extends \PHPUnit_Framework_TestCase
/** /**
* @covers Thelia\Tools\FileManager::adminLogAppend * @covers Thelia\Tools\FileManager::adminLogAppend
*/ */
public function testAdminLogAppend() /* public function testAdminLogAppend()
{ {
$this->markTestIncomplete( $this->markTestIncomplete(
'This test has not been implemented yet.' 'This test has not been implemented yet.'
); );
} }*/
/** /**
* @covers Thelia\Tools\FileManager::deleteFile * @covers Thelia\Tools\FileManager::deleteFile
*/ */
public function testDeleteFile() /* public function testDeleteFile()
{ {
// @todo see http://tech.vg.no/2011/03/09/mocking-the-file-system-using-phpunit-and-vfsstream/ // @todo see http://tech.vg.no/2011/03/09/mocking-the-file-system-using-phpunit-and-vfsstream/
$this->markTestIncomplete( $this->markTestIncomplete(
'This test has not been implemented yet.' 'This test has not been implemented yet.'
); );
} }*/
} }

View File

@@ -46,7 +46,6 @@ class NumberFormat
if ($decimals == null) $decimals = $lang->getDecimals(); if ($decimals == null) $decimals = $lang->getDecimals();
if ($decPoint == null) $decPoint = $lang->getDecimalSeparator(); if ($decPoint == null) $decPoint = $lang->getDecimalSeparator();
if ($thousandsSep == null) $thousandsSep = $lang->getThousandsSeparator(); if ($thousandsSep == null) $thousandsSep = $lang->getThousandsSeparator();
return number_format($number, $decimals, $decPoint, $thousandsSep); return number_format($number, $decimals, $decPoint, $thousandsSep);
} }
} }