Conflicts:
	core/lib/Thelia/Core/Template/Smarty/Assets/SmartyAssetsManager.php
This commit is contained in:
gmorel
2014-03-04 12:02:12 +01:00
647 changed files with 22954 additions and 24395 deletions

View File

@@ -1,7 +1,19 @@
#2.0.0-beta5
#2.0.0
- coupons effect are recalculated after each product's cart modification
#2.0.0-RC1
- Remove container from BaseAction.
- fix sending mail on order creation
- less files in default templates are already compile in css.
- less files in default templates are already compiled in css.
- all validator message are translated
- type argument is now a default argument and used for generating loop cache
- fix total amount without discount in backoffice. Fix #235
- description is not required anymore in coupon form. Fix #233
- Do not allow to cumulate the same coupon many times. Fix #217
- colissimo module is now fully configurable
- test suite are executed on PHP 5.4, 5.5, 5.6 and HHVM. Thelia is not fully compatible with HHVM
- add new attributes to loop pager (http://doc.thelia.net/en/documentation/loop/index.html#page-loop)
- we created a new github repo dedicated for modules : https://github.com/thelia-modules
#2.0.0-beta4
- Tinymce is now a dedicated module. You need to activate it.

View File

@@ -45,7 +45,7 @@ Installation
``` bash
$ curl -sS https://getcomposer.org/installer | php
$ php composer.phar create-project thelia/thelia path/ 2.0.0-beta4
$ php composer.phar create-project thelia/thelia path/ 2.0.0-RC1
```
Finish the installation using cli tools :

View File

@@ -22,7 +22,6 @@
/*************************************************************************************/
namespace Thelia\Action;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Propel\Runtime\ActiveQuery\ModelCriteria;
use Thelia\Core\Event\UpdatePositionEvent;
@@ -64,7 +63,7 @@ class BaseAction
* @param ModelCriteria $query
* @param UpdateSeoEvent $event
*
* @return mixed an SEOxxx object
* @return mixed an SEOxxx object
* @throws FormValidationException if a rewritten URL cannot be created
*/
protected function genericUpdateSeo(ModelCriteria $query, UpdateSeoEvent $event)
@@ -94,4 +93,4 @@ class BaseAction
return $object;
}
}
}

View File

@@ -23,7 +23,6 @@
namespace Thelia\Action;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Thelia\Core\Event\Cart\CartEvent;

View File

@@ -23,8 +23,6 @@
namespace Thelia\Action;
use Propel\Runtime\ServiceContainer\ServiceContainerInterface;
use Symfony\Component\DependencyInjection\Container;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Thelia\Condition\ConditionFactory;
use Thelia\Condition\Implementation\ConditionInterface;
@@ -163,6 +161,22 @@ class Coupon extends BaseAction implements EventSubscriberInterface
$event->setDiscount($totalDiscount);
}
public function updateOrderDiscount($event)
{
$discount = $this->couponManager->getDiscount();
$this->request
->getSession()
->getCart()
->setDiscount($discount)
->save();
$this->request
->getSession()
->getOrder()
->setDiscount($discount);
}
/**
* Call the Model and delegate the create or delete action
* Feed the Event with the updated model
@@ -312,6 +326,9 @@ class Coupon extends BaseAction implements EventSubscriberInterface
TheliaEvents::COUPON_CONDITION_UPDATE => array("updateCondition", 128),
TheliaEvents::ORDER_SET_POSTAGE => array("testFreePostage", 256),
TheliaEvents::ORDER_BEFORE_PAYMENT => array("afterOrder", 128),
TheliaEvents::CART_ADDITEM => array("updateOrderDiscount", 10),
TheliaEvents::CART_UPDATEITEM => array("updateOrderDiscount", 10),
TheliaEvents::CART_DELETEITEM => array("updateOrderDiscount", 10),
);
}
}

View File

@@ -155,11 +155,11 @@ class Module extends BaseAction implements EventSubscriberInterface
/**
* Call the payment method of the payment module of the given order
*
* @param OrderPaymentEvent $event
* @param OrderPaymentEvent $event
* @throws \RuntimeException if no payment module can be found.
*/
public function pay(OrderPaymentEvent $event) {
public function pay(OrderPaymentEvent $event)
{
$order = $event->getOrder();
/* call pay method */

View File

@@ -47,12 +47,16 @@ class Newsletter extends BaseAction implements EventSubscriberInterface
->setLastname($event->getLastname())
->setLocale($event->getLocale())
->save();
$event->setNewsletter($newsletter);
}
public function unsubscribe(NewsletterEvent $event)
{
if (null !== $nl = NewsletterQuery::create()->findPk($event->getId())) {
$nl->delete();
$event->setNewsletter($nl);
}
}
@@ -64,6 +68,8 @@ class Newsletter extends BaseAction implements EventSubscriberInterface
->setLastname($event->getLastname())
->setLocale($event->getLocale())
->save();
$event->setNewsletter($nl);
}
}

View File

@@ -26,7 +26,6 @@ namespace Thelia\Action;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Thelia\Cart\CartTrait;
use Thelia\Core\Event\Cart\CartEvent;
use Thelia\Core\Event\Order\OrderAddressEvent;
use Thelia\Core\Event\Order\OrderEvent;
use Thelia\Core\Event\Order\OrderManualEvent;
@@ -53,7 +52,6 @@ use Thelia\Model\OrderStatus;
use Thelia\Model\OrderStatusQuery;
use Thelia\Tools\I18n;
/**
*
* Class Order
@@ -157,7 +155,6 @@ class Order extends BaseAction implements EventSubscriberInterface
$con->beginTransaction();
$placedOrder = $sessionOrder->copy();
$placedOrder->setDispatcher($dispatcher);
@@ -307,8 +304,8 @@ class Order extends BaseAction implements EventSubscriberInterface
/**
* Create an order outside of the front-office context, e.g. manually from the back-office.
*/
public function createManual(OrderManualEvent $event) {
public function createManual(OrderManualEvent $event)
{
$placedOrder = $this->createOrder(
$event->getDispatcher(),
$event->getOrder(),
@@ -339,7 +336,6 @@ class Order extends BaseAction implements EventSubscriberInterface
$event->getDispatcher()->dispatch(TheliaEvents::ORDER_BEFORE_PAYMENT, new OrderEvent($placedOrder));
/* but memorize placed order */
$event->setOrder(new \Thelia\Model\Order());
$event->setPlacedOrder($placedOrder);

View File

@@ -73,8 +73,8 @@ class Product extends BaseAction implements EventSubscriberInterface
->setDispatcher($event->getDispatcher())
->setRef($event->getRef())
->setTitle($event->getTitle())
->setLocale($event->getLocale())
->setTitle($event->getTitle())
->setVisible($event->getVisible())
// Set the default tax rule to this product
@@ -163,6 +163,8 @@ class Product extends BaseAction implements EventSubscriberInterface
->setVisible($product->getVisible() ? false : true)
->save()
;
$event->setProduct($product);
}
/**
@@ -293,6 +295,10 @@ class Product extends BaseAction implements EventSubscriberInterface
// Create a new default product sale element
$product->createProductSaleElement($con, 0, 0, 0, $event->getCurrencyId(), true);
$product->clearProductSaleElementss();
$event->setProduct($product);
// Store all the stuff !
$con->commit();

View File

@@ -43,7 +43,7 @@ class ShippingZone extends BaseAction implements EventSubscriberInterface
$areaDelivery
->setAreaId($event->getAreaId())
->setDeliveryModuleId($event->getShoppingZoneId())
->setDeliveryModuleId($event->getShippingZoneId())
->save();
}
@@ -51,13 +51,13 @@ class ShippingZone extends BaseAction implements EventSubscriberInterface
{
$areaDelivery = AreaDeliveryModuleQuery::create()
->filterByAreaId($event->getAreaId())
->filterByDeliveryModuleId($event->getShoppingZoneId())
->filterByDeliveryModuleId($event->getShippingZoneId())
->findOne();
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()));
throw new \RuntimeException(sprintf('areaDeliveryModule not found with area_id = %d and delivery_module_id = %d', $event->getAreaId(), $event->getShippingZoneId()));
}
}

View File

@@ -45,7 +45,7 @@ trait CartTrait
*
* search if cart already exists in session. If not try to create a new one or duplicate an old one.
*
* @param EventDispatcherInterface $dispatcher the event dispatcher
* @param EventDispatcherInterface $dispatcher the event dispatcher
* @param \Symfony\Component\HttpFoundation\Request $request
* @return \Thelia\Model\Cart
*/

View File

@@ -29,7 +29,6 @@ use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Filesystem\Exception\IOException;
use Thelia\Core\Event\Cache\CacheEvent;
use Thelia\Core\Event\TheliaEvents;

View File

@@ -23,8 +23,6 @@
namespace Thelia\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Thelia\Core\Event\Image\ImageEvent;

View File

@@ -27,7 +27,6 @@ use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Thelia\Model\Admin;
class CreateAdminUser extends ContainerAwareCommand

View File

@@ -27,7 +27,6 @@ use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Thelia\Core\Security\Resource\AdminResources;
use Thelia\Model\Map\ResourceI18nTableMap;

View File

@@ -198,4 +198,34 @@ return array(
'mailing system modification' => 'mailing system modification',
'shipping area name' => 'shipping area name',
'time format' => 'time format',
'This value should not be blank.' => 'This value should not be blank.',
'A user already exists with this email address. Please login or if you\'ve forgotten your password, go to Reset Your Password.' => 'A user already exists with this email address. Please login or if you\'ve forgotten your password, go to Reset Your Password.',
'Administrator ID not found' => 'Administrator ID not found',
'This login already exists' => 'This login already exists',
'password confirmation is not the same as password field' => 'password confirmation is not the same as password field',
'password must be composed of at least 4 characters' => 'password must be composed of at least 4 characters',
'this product id does not exists : %d' => 'this product id does not exists : %d',
'This product_sale_elements_id does not exists for this product : %d' => 'This product_sale_elements_id does not exists for this product : %d',
'quantity value is not valid' => 'quantity value is not valid',
'Please accept the Terms and conditions in order to register.' => 'Please accept the Terms and conditions in order to register.',
'This email already exists.' => 'This email already exists.',
'This email does not exists' => 'This email does not exists',
'Your current password does not match.' => 'Your current password does not match.',
'Module ID not found' => 'Module ID not found',
'You are already registered!' => 'You are already registered!',
'Address ID not found' => 'Address ID not found',
'Delivery module ID not found' => 'Delivery module ID not found',
'delivery module %s is not a Thelia\Module\DeliveryModuleInterface' => 'delivery module %s is not a Thelia\Module\DeliveryModuleInterface',
'Order address ID not found' => 'Order address ID not found',
'Title ID not found' => 'Title ID not found',
'Country ID not found' => 'Country ID not found',
'Profile `code` already exists' => 'Profile `code` already exists',
'Profile ID not found' => 'Profile ID not found',
'The TaxEngine should be passed to this form before using it.' => 'The TaxEngine should be passed to this form before using it.',
'Tax rule ID not found' => 'Tax rule ID not found',
'Tax list is not valid JSON' => 'Tax list is not valid JSON',
'Bad tax list JSON' => 'Bad tax list JSON',
'Tax ID not found in tax list JSON' => 'Tax ID not found in tax list JSON',
'Please check your input: %s' => 'Please check your input: %s',
'Sorry, an error occured: %s' => 'Sorry, an error occured: %s',
);

View File

@@ -197,4 +197,34 @@ return array(
'mailing system modification' => 'Modification du système d\'envoi de mail.',
'shipping area name' => 'Nom de la zone de livraison',
'time format' => 'Format d\'heure',
'This value should not be blank.' => 'Cette valeur ne doit pas être vide.',
'A user already exists with this email address. Please login or if you\'ve forgotten your password, go to Reset Your Password.' => 'Un utilisateur existe déjà avec cette adresse email. Connectez-vous ou demandez une réinitialisation de votre mot de passe.',
'Administrator ID not found' => 'ID de l\'administrateur not trouvé',
'This login already exists' => 'Cet identifiant existe déjà',
'password confirmation is not the same as password field' => 'le mot de passe de confirmation n\'est pas le même que le champ mot de passe',
'password must be composed of at least 4 characters' => 'le mot de passe doit être composé d\'au moins 4 caractères',
'this product id does not exists : %d' => 'l\'id du produit %d n\'existe pas',
'This product_sale_elements_id does not exists for this product : %d' => 'Le product_sale_elements_id n\'existe pas pour ce produit : %d',
'quantity value is not valid' => 'la valeur de la quantité n\'est pas valide',
'Please accept the Terms and conditions in order to register.' => 'Veuillez accepter les termes et conditions pour vous inscrire.',
'This email already exists.' => 'Cette adresse email existe déjà',
'This email does not exists' => 'Cette adresse email n\'existe pas',
'Your current password does not match.' => 'Votre mot de passe actuel ne correspond pas',
'Module ID not found' => 'Id du module non trouvé',
'You are already registered!' => 'Vous êtes déjà enregistré !',
'Address ID not found' => 'ID de l\'adresse non trouvé',
'Delivery module ID not found' => 'Id du module de livraison non trouvé',
'delivery module %s is not a Thelia\Module\DeliveryModuleInterface' => 'le module de livraison %s n\'est pas un Thelia\Module\DeliveryModuleInterface',
'Order address ID not found' => 'ID de l\'adresse de la commande non trouvé',
'Title ID not found' => 'ID de la civilité non trouvé',
'Country ID not found' => 'ID du pays non trouvé',
'Profile `code` already exists' => 'Le `code` du profil existe déjà',
'Profile ID not found' => 'ID du profil non trouvé',
'The TaxEngine should be passed to this form before using it.' => 'Le moteur de taxe doit être passé au formulaire avant d\'être utilisé.',
'Tax rule ID not found' => 'ID de la règle de taxe non trouvé',
'Tax list is not valid JSON' => 'Le JSON de la liste des taxes n\'est pas valide',
'Bad tax list JSON' => 'Mauvais JSON de la liste des taxes',
'Tax ID not found in tax list JSON' => 'ID de la taxe non trouvé dans le JSON de la liste des taxes',
'Please check your input: %s' => 'Veuillez vérifier votre saisie: %s',
'Sorry, an error occured: %s' => 'Désolé, une erreur est survenue: %s',
);

View File

@@ -57,6 +57,11 @@
<service id="translation.loader.ini" class="%translation.loader.ini.class%">
<tag name="translation.loader" alias="ini" />
</service>
<service id="validators.translator" class="Thelia\Core\EventListener\RequestListener">
<argument type="service" id="thelia.translator"/>
<tag name="kernel.event_subscriber"/>
</service>
</services>
</config>

View File

@@ -248,8 +248,8 @@ class BaseAdminController extends BaseController
* @throws MissingMandatoryParametersException When some parameters are missing that are mandatory for the route
* @throws InvalidParameterException When a parameter value for a placeholder is not correct because
* it does not match the requirement
* @throws \InvalidArgumentException When the router doesn't exist
* @return string The generated URL
* @throws \InvalidArgumentException When the router doesn't exist
* @return string The generated URL
*
* @see \Thelia\Controller\BaseController::getRouteFromRouter()
*/

View File

@@ -23,7 +23,6 @@
namespace Thelia\Controller\Admin;
use Thelia\Core\Security\Resource\AdminResources;
use Thelia\Core\Event\Category\CategoryDeleteEvent;
use Thelia\Core\Event\TheliaEvents;

View File

@@ -98,7 +98,6 @@ class CouponController extends BaseAdminController
{
$this->checkAuth(AdminResources::COUPON, array(), AccessManager::VIEW);
$coupon = CouponQuery::create()->findPk($couponId);
if ($coupon === null) {

View File

@@ -32,7 +32,6 @@ use Thelia\Form\CustomerCreateForm;
use Thelia\Form\CustomerUpdateForm;
use Thelia\Model\CustomerQuery;
/**
* Class CustomerController
* @package Thelia\Controller\Admin

View File

@@ -841,8 +841,6 @@ class FileController extends BaseAdminController
$model->setPostscriptum($data['postscriptum']);
}
$imageCreateEvent->setModelImage($model);
return $imageCreateEvent;

View File

@@ -23,7 +23,6 @@
namespace Thelia\Controller\Admin;
use Thelia\Core\Security\Resource\AdminResources;
use Thelia\Core\Event\Order\OrderAddressEvent;
use Thelia\Core\Event\Order\OrderEvent;
@@ -46,7 +45,6 @@ class OrderController extends BaseAdminController
public function indexAction()
{
if (null !== $response = $this->checkAuth(AdminResources::ORDER, array(), AccessManager::VIEW)) return $response;
return $this->render("orders", array(
"display_order" => 20,
"orders_order" => $this->getListOrderFromSession("orders", "orders_order", "create-date-reverse")

View File

@@ -32,7 +32,6 @@ use Thelia\Core\Security\Exception\AuthenticationException;
use Thelia\Model\Lang;
use Thelia\Model\LangQuery;
use Thelia\Core\Event\TheliaEvents;
use Thelia\Core\Security\Authentication\AdminTokenAuthenticator;
@@ -75,8 +74,8 @@ class SessionController extends BaseAdminController
return $this->render("login");
}
protected function applyUserLocale(Admin $user) {
protected function applyUserLocale(Admin $user)
{
// Set the current language according to Admin locale preference
$locale = $user->getLocale();

View File

@@ -51,8 +51,8 @@ class TaxRuleController extends AbstractCrudController
);
}
public function defaultAction() {
public function defaultAction()
{
// In the tax rule template we use the TaxCreationForm.
//
// The TaxCreationForm require the TaxEngine, but we cannot pass it from the Parser Form plugin,

View File

@@ -293,8 +293,8 @@ abstract class BaseController extends ContainerAware
* @throws MissingMandatoryParametersException When some parameters are missing that are mandatory for the route
* @throws InvalidParameterException When a parameter value for a placeholder is not correct because
* it does not match the requirement
* @throws \InvalidArgumentException When the router doesn't exist
* @return string The generated URL
* @throws \InvalidArgumentException When the router doesn't exist
* @return string The generated URL
*/
protected function getRouteFromRouter($routerName, $routeId, $parameters = array(), $referenceType = Router::ABSOLUTE_URL)
{

View File

@@ -24,7 +24,6 @@
namespace Thelia\Core\Event;
use Thelia\Model\Accessory;
use Thelia\Core\Event\ActionEvent;
class AccessoryEvent extends ActionEvent
{

View File

@@ -134,6 +134,7 @@ class AdministratorEvent extends ActionEvent
public function setLocale($locale)
{
$this->locale = $locale;
return $this;
}
@@ -141,4 +142,4 @@ class AdministratorEvent extends ActionEvent
{
return $this->locale;
}
}
}

View File

@@ -23,8 +23,6 @@
namespace Thelia\Core\Event\Attribute;
use Thelia\Core\Event\Attribute\AttributeAvEvent;
class AttributeAvCreateEvent extends AttributeAvEvent
{
protected $title;

View File

@@ -23,8 +23,6 @@
namespace Thelia\Core\Event\Attribute;
use Thelia\Core\Event\Attribute\AttributeAvEvent;
class AttributeAvDeleteEvent extends AttributeAvEvent
{
protected $attributeAv_id;

View File

@@ -23,8 +23,6 @@
namespace Thelia\Core\Event\Attribute;
use Thelia\Core\Event\Attribute\AttributeAvCreateEvent;
class AttributeAvUpdateEvent extends AttributeAvCreateEvent
{
protected $attributeAv_id;

View File

@@ -23,8 +23,6 @@
namespace Thelia\Core\Event\Attribute;
use Thelia\Core\Event\Attribute\AttributeEvent;
class AttributeCreateEvent extends AttributeEvent
{
protected $title;

View File

@@ -23,8 +23,6 @@
namespace Thelia\Core\Event\Attribute;
use Thelia\Core\Event\Attribute\AttributeEvent;
class AttributeDeleteEvent extends AttributeEvent
{
protected $attribute_id;

View File

@@ -23,8 +23,6 @@
namespace Thelia\Core\Event\Attribute;
use Thelia\Core\Event\Attribute\AttributeCreateEvent;
class AttributeUpdateEvent extends AttributeCreateEvent
{
protected $attribute_id;

View File

@@ -48,6 +48,7 @@ class CartEvent extends ActionEvent
public function setAppend($append)
{
$this->append = $append;
return $this;
}
@@ -65,6 +66,7 @@ class CartEvent extends ActionEvent
public function setCartItem($cartItem)
{
$this->cartItem = $cartItem;
return $this;
}
@@ -82,6 +84,7 @@ class CartEvent extends ActionEvent
public function setNewness($newness)
{
$this->newness = $newness;
return $this;
}
@@ -99,6 +102,7 @@ class CartEvent extends ActionEvent
public function setProduct($product)
{
$this->product = $product;
return $this;
}
@@ -116,6 +120,7 @@ class CartEvent extends ActionEvent
public function setProductSaleElementsId($productSaleElementsId)
{
$this->productSaleElementsId = $productSaleElementsId;
return $this;
}
@@ -133,6 +138,7 @@ class CartEvent extends ActionEvent
public function setQuantity($quantity)
{
$this->quantity = $quantity;
return $this;
}
@@ -151,4 +157,4 @@ class CartEvent extends ActionEvent
{
return $this->cart;
}
}
}

View File

@@ -23,7 +23,6 @@
namespace Thelia\Core\Event\Category;
use Thelia\Core\Event\Category\CategoryEvent;
use Thelia\Model\Category;
class CategoryAddContentEvent extends CategoryEvent

View File

@@ -23,8 +23,6 @@
namespace Thelia\Core\Event\Category;
use Thelia\Core\Event\Category\CategoryEvent;
class CategoryCreateEvent extends CategoryEvent
{
protected $title;

View File

@@ -23,7 +23,6 @@
namespace Thelia\Core\Event\Category;
use Thelia\Core\Event\Category\CategoryEvent;
use Thelia\Model\Category;
class CategoryDeleteContentEvent extends CategoryEvent

View File

@@ -23,8 +23,6 @@
namespace Thelia\Core\Event\Category;
use Thelia\Core\Event\Category\CategoryEvent;
class CategoryDeleteEvent extends CategoryEvent
{
public function __construct($category_id)

View File

@@ -23,8 +23,6 @@
namespace Thelia\Core\Event\Category;
use Thelia\Core\Event\Category\CategoryEvent;
class CategoryToggleVisibilityEvent extends CategoryEvent
{
}

View File

@@ -23,8 +23,6 @@
namespace Thelia\Core\Event\Category;
use Thelia\Core\Event\Category\CategoryCreateEvent;
class CategoryUpdateEvent extends CategoryCreateEvent
{
protected $category_id;

View File

@@ -23,8 +23,6 @@
namespace Thelia\Core\Event\Config;
use Thelia\Core\Event\Config\ConfigEvent;
class ConfigCreateEvent extends ConfigEvent
{
protected $event_name;

View File

@@ -23,8 +23,6 @@
namespace Thelia\Core\Event\Config;
use Thelia\Core\Event\Config\ConfigEvent;
class ConfigDeleteEvent extends ConfigEvent
{
protected $config_id;

View File

@@ -23,8 +23,6 @@
namespace Thelia\Core\Event\Config;
use Thelia\Core\Event\Config\ConfigCreateEvent;
class ConfigUpdateEvent extends ConfigCreateEvent
{
protected $config_id;

View File

@@ -87,10 +87,10 @@ class CouponCreateOrUpdateEvent extends ActionEvent
/**
* Constructor
*
* @param string $code Coupon Code
* @param string $serviceId Coupon Service id
* @param string $title Coupon title
* @param array $effects Coupon effects ready to be serialized
* @param string $code Coupon Code
* @param string $serviceId Coupon Service id
* @param string $title Coupon title
* @param array $effects Coupon effects ready to be serialized
* 'amount' key is mandatory and reflects
* the amount deduced from the cart
* @param string $shortDescription Coupon short description
@@ -256,9 +256,9 @@ class CouponCreateOrUpdateEvent extends ActionEvent
/**
* Set effects ready to be serialized
*
* @param array $effects Effect ready to be serialized
* Needs at least the key 'amount'
* with the amount removed from the cart
* @param array $effects Effect ready to be serialized
* Needs at least the key 'amount'
* with the amount removed from the cart
* @throws \Thelia\Model\Exception\InvalidArgumentException
*/
public function setEffects(array $effects)

View File

@@ -23,8 +23,6 @@
namespace Thelia\Core\Event\Currency;
use Thelia\Core\Event\Currency\CurrencyEvent;
class CurrencyCreateEvent extends CurrencyEvent
{
protected $currency_name;

View File

@@ -23,8 +23,6 @@
namespace Thelia\Core\Event\Currency;
use Thelia\Core\Event\Currency\CurrencyEvent;
class CurrencyDeleteEvent extends CurrencyEvent
{
protected $currency_id;

View File

@@ -23,8 +23,6 @@
namespace Thelia\Core\Event\Currency;
use Thelia\Core\Event\Currency\CurrencyCreateEvent;
class CurrencyUpdateEvent extends CurrencyCreateEvent
{
protected $currency_id;

View File

@@ -68,8 +68,8 @@ class CustomerCreateOrUpdateEvent extends CustomerEvent
* @param string $email
* @param string $password plain password, don't put hash password, it will hashes again
* @param $lang
* @param int $reseller if customer is a reseller
* @param int $sponsor customer's id sponsor
* @param int $reseller if customer is a reseller
* @param int $sponsor customer's id sponsor
* @param float $discount
* @param string $company
* @param string $ref

View File

@@ -23,8 +23,6 @@
namespace Thelia\Core\Event;
use Thelia\Core\Event\ActionEvent;
class DefaultActionEvent extends ActionEvent
{
}

View File

@@ -66,7 +66,7 @@ class DocumentCreateOrUpdateEvent extends ActionEvent
*
* @param string $documentType Document type
* ex : FileManager::TYPE_CATEGORY
* @param int $parentId Document parent id
* @param int $parentId Document parent id
*/
public function __construct($documentType, $parentId)
{

View File

@@ -23,8 +23,6 @@
namespace Thelia\Core\Event\Feature;
use Thelia\Core\Event\Feature\FeatureAvEvent;
class FeatureAvCreateEvent extends FeatureAvEvent
{
protected $title;

View File

@@ -23,8 +23,6 @@
namespace Thelia\Core\Event\Feature;
use Thelia\Core\Event\Feature\FeatureAvEvent;
class FeatureAvDeleteEvent extends FeatureAvEvent
{
protected $featureAv_id;

View File

@@ -23,8 +23,6 @@
namespace Thelia\Core\Event\Feature;
use Thelia\Core\Event\Feature\FeatureAvCreateEvent;
class FeatureAvUpdateEvent extends FeatureAvCreateEvent
{
protected $featureAv_id;

View File

@@ -23,8 +23,6 @@
namespace Thelia\Core\Event\Feature;
use Thelia\Core\Event\Feature\FeatureEvent;
class FeatureCreateEvent extends FeatureEvent
{
protected $title;

View File

@@ -23,8 +23,6 @@
namespace Thelia\Core\Event\Feature;
use Thelia\Core\Event\Feature\FeatureEvent;
class FeatureDeleteEvent extends FeatureEvent
{
protected $feature_id;

View File

@@ -23,8 +23,6 @@
namespace Thelia\Core\Event\Feature;
use Thelia\Core\Event\Feature\FeatureCreateEvent;
class FeatureUpdateEvent extends FeatureCreateEvent
{
protected $feature_id;

View File

@@ -22,7 +22,6 @@
/*************************************************************************************/
namespace Thelia\Core\Event\FeatureProduct;
use Thelia\Core\Event\FeatureProduct\FeatureProductEvent;
use Thelia\Model\FeatureProduct;
class FeatureProductDeleteEvent extends FeatureProductEvent

View File

@@ -22,7 +22,6 @@
/*************************************************************************************/
namespace Thelia\Core\Event\FeatureProduct;
use Thelia\Core\Event\FeatureProduct\FeatureProductEvent;
use Thelia\Model\FeatureProduct;
class FeatureProductUpdateEvent extends FeatureProductEvent

View File

@@ -22,7 +22,6 @@
/*************************************************************************************/
namespace Thelia\Core\Event\Folder;
use Thelia\Core\Event\Folder\FolderEvent;
/**
* Class FolderCreateEvent

View File

@@ -22,7 +22,6 @@
/*************************************************************************************/
namespace Thelia\Core\Event\Folder;
use Thelia\Core\Event\Folder\FolderEvent;
/**
* Class FolderDeleteEvent

View File

@@ -22,7 +22,6 @@
/*************************************************************************************/
namespace Thelia\Core\Event\Folder;
use Thelia\Core\Event\Folder\FolderEvent;
/**
* Class FolderToggleVisibilityEvent

View File

@@ -22,7 +22,6 @@
/*************************************************************************************/
namespace Thelia\Core\Event\Folder;
use Thelia\Core\Event\Folder\FolderCreateEvent;
/**
* Class FolderUpdateEvent

View File

@@ -63,8 +63,8 @@ class ImageCreateOrUpdateEvent extends ActionEvent
* Constructor
*
* @param string $imageType Image type
* ex : FileManager::TYPE_CATEGORY
* @param int $parentId Image parent id
* ex : FileManager::TYPE_CATEGORY
* @param int $parentId Image parent id
*/
public function __construct($imageType, $parentId)
{
@@ -90,8 +90,6 @@ class ImageCreateOrUpdateEvent extends ActionEvent
return $this->locale;
}
/**
* Set Image to save
*

View File

@@ -53,7 +53,7 @@ class ImageDeleteEvent extends ActionEvent
*
* @param CategoryImage|ProductImage|ContentImage|FolderImage $imageToDelete Image about to be deleted
* @param string $imageType Image type
* ex : FileManager::TYPE_CATEGORY
* ex : FileManager::TYPE_CATEGORY
*/
public function __construct($imageToDelete, $imageType)
{

View File

@@ -23,8 +23,6 @@
namespace Thelia\Core\Event\Message;
use Thelia\Core\Event\Message\MessageEvent;
class MessageCreateEvent extends MessageEvent
{
protected $message_name;

View File

@@ -23,8 +23,6 @@
namespace Thelia\Core\Event\Message;
use Thelia\Core\Event\Message\MessageEvent;
class MessageDeleteEvent extends MessageEvent
{
protected $message_id;

View File

@@ -22,7 +22,6 @@
/*************************************************************************************/
namespace Thelia\Core\Event\Message;
use Thelia\Core\Event\Message\MessageCreateEvent;
class MessageUpdateEvent extends MessageCreateEvent
{

View File

@@ -56,12 +56,36 @@ class NewsletterEvent extends ActionEvent
*/
protected $locale;
/**
* @var \Thelia\Model\Newsletter
*/
protected $newsletter;
public function __construct($email, $locale)
{
$this->email = $email;
$this->locale = $locale;
}
/**
* @param \Thelia\Model\Newsletter $newsletter
*/
public function setNewsletter($newsletter)
{
$this->newsletter = $newsletter;
return $this;
}
/**
* @return \Thelia\Model\Newsletter
*/
public function getNewsletter()
{
return $this->newsletter;
}
/**
* @param string $email
*
@@ -148,6 +172,8 @@ class NewsletterEvent extends ActionEvent
public function setId($id)
{
$this->id = $id;
return $this;
}
/**

View File

@@ -214,7 +214,7 @@ class OrderEvent extends ActionEvent
}
/**
* @param Response $response
* @param Response $response
* @return $this
*/
public function setResponse(Response $response)

View File

@@ -56,6 +56,7 @@ class OrderManualEvent extends OrderEvent
public function setOrder(Order $order)
{
$this->order = $order;
return $this;
}
@@ -65,6 +66,7 @@ class OrderManualEvent extends OrderEvent
public function setPlacedOrder(Order $order)
{
$this->placedOrder = $order;
return $this;
}
@@ -74,6 +76,7 @@ class OrderManualEvent extends OrderEvent
public function setInvoiceAddress($address)
{
$this->invoiceAddress = $address;
return $this;
}
@@ -83,6 +86,7 @@ class OrderManualEvent extends OrderEvent
public function setDeliveryAddress($address)
{
$this->deliveryAddress = $address;
return $this;
}
@@ -92,6 +96,7 @@ class OrderManualEvent extends OrderEvent
public function setDeliveryModule($module)
{
$this->deliveryModule = $module;
return $this;
}
@@ -101,6 +106,7 @@ class OrderManualEvent extends OrderEvent
public function setPaymentModule($module)
{
$this->paymentModule = $module;
return $this;
}
@@ -110,6 +116,7 @@ class OrderManualEvent extends OrderEvent
public function setPostage($postage)
{
$this->postage = $postage;
return $this;
}
@@ -119,6 +126,7 @@ class OrderManualEvent extends OrderEvent
public function setRef($ref)
{
$this->ref = $ref;
return $this;
}
@@ -128,6 +136,7 @@ class OrderManualEvent extends OrderEvent
public function setStatus($status)
{
$this->status = $status;
return $this;
}
@@ -227,6 +236,7 @@ class OrderManualEvent extends OrderEvent
public function setCurrency($currency)
{
$this->currency = $currency;
return $this;
}
@@ -238,6 +248,7 @@ class OrderManualEvent extends OrderEvent
public function setLang($lang)
{
$this->lang = $lang;
return $this;
}
@@ -249,6 +260,7 @@ class OrderManualEvent extends OrderEvent
public function setCart($cart)
{
$this->cart = $cart;
return $this;
}
@@ -260,6 +272,7 @@ class OrderManualEvent extends OrderEvent
public function setCustomer($customer)
{
$this->customer = $customer;
return $this;
}

View File

@@ -44,7 +44,8 @@ class OrderPaymentEvent extends ActionEvent
*/
protected $response;
public function __construct(Order $order) {
public function __construct(Order $order)
{
$this->order = $order;
}
@@ -79,5 +80,4 @@ class OrderPaymentEvent extends ActionEvent
return null !== $this->response;
}
}
}

View File

@@ -23,8 +23,6 @@
namespace Thelia\Core\Event\Product;
use Thelia\Core\Event\Product\ProductEvent;
class ProductToggleVisibilityEvent extends ProductEvent
{
}

View File

@@ -23,8 +23,6 @@
namespace Thelia\Core\Event\Product;
use Thelia\Core\Event\Product\ProductCreateEvent;
class ProductUpdateEvent extends ProductCreateEvent
{
protected $product_id;

View File

@@ -64,6 +64,8 @@ class ProfileEvent extends ActionEvent
public function setId($id)
{
$this->id = $id;
return $this;
}
public function getId()
@@ -74,6 +76,8 @@ class ProfileEvent extends ActionEvent
public function setCode($code)
{
$this->code = $code;
return $this;
}
public function getCode()
@@ -84,6 +88,8 @@ class ProfileEvent extends ActionEvent
public function setChapo($chapo)
{
$this->chapo = $chapo;
return $this;
}
public function getChapo()
@@ -94,6 +100,8 @@ class ProfileEvent extends ActionEvent
public function setDescription($description)
{
$this->description = $description;
return $this;
}
public function getDescription()
@@ -104,6 +112,8 @@ class ProfileEvent extends ActionEvent
public function setLocale($locale)
{
$this->locale = $locale;
return $this;
}
public function getLocale()
@@ -114,6 +124,8 @@ class ProfileEvent extends ActionEvent
public function setPostscriptum($postscriptum)
{
$this->postscriptum = $postscriptum;
return $this;
}
public function getPostscriptum()
@@ -124,6 +136,8 @@ class ProfileEvent extends ActionEvent
public function setTitle($title)
{
$this->title = $title;
return $this;
}
public function getTitle()
@@ -134,6 +148,8 @@ class ProfileEvent extends ActionEvent
public function setResourceAccess($resourceAccess)
{
$this->resourceAccess = $resourceAccess;
return $this;
}
public function getResourceAccess()
@@ -144,6 +160,8 @@ class ProfileEvent extends ActionEvent
public function setModuleAccess($moduleAccess)
{
$this->moduleAccess = $moduleAccess;
return $this;
}
public function getModuleAccess()

View File

@@ -32,12 +32,12 @@ use Thelia\Core\Event\ActionEvent;
class ShippingZoneAddAreaEvent extends ActionEvent
{
protected $area_id;
protected $shopping_zone_id;
protected $shipping_zone_id;
public function __construct($area_id, $shopping_zone_id)
public function __construct($area_id, $shipping_zone_id)
{
$this->area_id = $area_id;
$this->shopping_zone_id = $shopping_zone_id;
$this->shipping_zone_id = $shipping_zone_id;
}
/**
@@ -65,9 +65,9 @@ class ShippingZoneAddAreaEvent extends ActionEvent
*
* @return $this
*/
public function setShoppingZoneId($shopping_zone_id)
public function setShippingZoneId($shipping_zone_id)
{
$this->shopping_zone_id = $shopping_zone_id;
$this->shipping_zone_id = $shipping_zone_id;
return $this;
}
@@ -75,9 +75,9 @@ class ShippingZoneAddAreaEvent extends ActionEvent
/**
* @return mixed
*/
public function getShoppingZoneId()
public function getShippingZoneId()
{
return $this->shopping_zone_id;
return $this->shipping_zone_id;
}
}

View File

@@ -23,7 +23,6 @@
namespace Thelia\Core\Event\Template;
use Thelia\Core\Event\Template\TemplateEvent;
use Thelia\Model\Template;
class TemplateAddAttributeEvent extends TemplateEvent
{

View File

@@ -23,7 +23,6 @@
namespace Thelia\Core\Event\Template;
use Thelia\Core\Event\Template\TemplateEvent;
use Thelia\Model\Template;
class TemplateAddFeatureEvent extends TemplateEvent
{

View File

@@ -23,8 +23,6 @@
namespace Thelia\Core\Event\Template;
use Thelia\Core\Event\Template\TemplateEvent;
class TemplateCreateEvent extends TemplateEvent
{
protected $template_name;

View File

@@ -23,7 +23,6 @@
namespace Thelia\Core\Event\Template;
use Thelia\Core\Event\Template\TemplateEvent;
use Thelia\Model\Template;
class TemplateDeleteAttributeEvent extends TemplateEvent

View File

@@ -23,8 +23,6 @@
namespace Thelia\Core\Event\Template;
use Thelia\Core\Event\Template\TemplateEvent;
class TemplateDeleteEvent extends TemplateEvent
{
protected $template_id;

View File

@@ -23,7 +23,6 @@
namespace Thelia\Core\Event\Template;
use Thelia\Core\Event\Template\TemplateEvent;
use Thelia\Model\Template;
class TemplateDeleteFeatureEvent extends TemplateEvent

View File

@@ -23,8 +23,6 @@
namespace Thelia\Core\Event\Template;
use Thelia\Core\Event\Template\TemplateCreateEvent;
class TemplateUpdateEvent extends TemplateCreateEvent
{
protected $template_id;

View File

@@ -0,0 +1,93 @@
<?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\Core\EventListener;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\HttpKernel\KernelEvents;
use Thelia\Core\Translation\Translator;
/**
* Class RequestListener
* @package Thelia\Core\EventListener
* @author manuel raynaud <mraynaud@openstudio.fr>
*/
class RequestListener implements EventSubscriberInterface
{
protected $translator;
public function __construct(Translator $translator)
{
$this->translator = $translator;
}
public function registerValidatorTranslator(GetResponseEvent $event)
{
$request = $event->getRequest();
$lang = $request->getSession()->getLang();
$vendorDir = THELIA_ROOT . "/core/vendor";
$vendorFormDir = $vendorDir . '/symfony/form/Symfony/Component/Form';
$vendorValidatorDir =
$vendorDir . '/symfony/validator/Symfony/Component/Validator';
$this->translator->addResource(
'xlf',
sprintf($vendorFormDir . '/Resources/translations/validators.%s.xlf', $lang->getCode()),
$lang->getLocale(),
'validators'
);
$this->translator->addResource(
'xlf',
sprintf($vendorValidatorDir . '/Resources/translations/validators.%s.xlf', $lang->getCode()),
$lang->getLocale(),
'validators'
);
}
/**
* Returns an array of event names this subscriber wants to listen to.
*
* The array keys are event names and the value can be:
*
* * The method name to call (priority defaults to 0)
* * An array composed of the method name to call and the priority
* * An array of arrays composed of the method names to call and respective
* priorities, or 0 if unset
*
* For instance:
*
* * array('eventName' => 'methodName')
* * array('eventName' => array('methodName', $priority))
* * array('eventName' => array(array('methodName1', $priority), array('methodName2'))
*
* @return array The event names to listen to
*
* @api
*/
public static function getSubscribedEvents()
{
return array(
KernelEvents::REQUEST => array("registerValidatorTranslator", 128)
);
}
}

View File

@@ -26,7 +26,6 @@ namespace Thelia\Core\Security\Authentication;
use Symfony\Component\HttpFoundation\Request;
use Thelia\Core\Security\UserProvider\AdminUserProvider;
use Thelia\Form\AdminLogin;

View File

@@ -23,7 +23,6 @@
namespace Thelia\Core\Security\Authentication;
use Thelia\Core\Security\UserProvider\TokenUserProvider;
use Thelia\Core\Security\Exception\TokenAuthenticationException;

View File

@@ -23,7 +23,6 @@
namespace Thelia\Core\Security\Authentication;
use Symfony\Component\HttpFoundation\Request;
use Thelia\Core\Security\UserProvider\UserProviderInterface;

View File

@@ -23,7 +23,6 @@
namespace Thelia\Core\Security\UserProvider;
use Thelia\Model\AdminQuery;
class AdminUserProvider implements UserProviderInterface

View File

@@ -23,7 +23,6 @@
namespace Thelia\Core\Security\UserProvider;
use Thelia\Model\CustomerQuery;
class CustomerUserProvider implements UserProviderInterface
{

View File

@@ -23,7 +23,6 @@
namespace Thelia\Core\Template\Element;
use Thelia\Core\Template\Loop\Argument\Argument;
use Propel\Runtime\ActiveQuery\ModelCriteria;
use Thelia\Model\Tools\ModelCriteriaTools;

View File

@@ -95,6 +95,7 @@ abstract class BaseLoop
$defaultArgs = array(
Argument::createBooleanTypeArgument('backend_context', false),
Argument::createBooleanTypeArgument('force_return', false),
Argument::createAnyTypeArgument('type'),
);
if (true === $this->countable) {
@@ -336,8 +337,7 @@ abstract class BaseLoop
public function count()
{
$hash = $this->args->getHash();
if(false === isset(self::$cacheCount[$hash]))
{
if (false === isset(self::$cacheCount[$hash])) {
$count = 0;
if ($this instanceof PropelSearchLoopInterface) {
$searchModelCriteria = $this->buildModelCriteria();
@@ -367,8 +367,7 @@ abstract class BaseLoop
public function exec(&$pagination)
{
$hash = $this->args->getHash();
if(false === isset(self::$cacheLoopResult[$hash]))
{
if (false === isset(self::$cacheLoopResult[$hash])) {
if ($this instanceof PropelSearchLoopInterface) {
$searchModelCriteria = $this->buildModelCriteria();
if (null === $searchModelCriteria) {

View File

@@ -26,7 +26,6 @@ namespace Thelia\Core\Template\Element;
use Propel\Runtime\Collection\ObjectCollection;
use Propel\Runtime\Util\PropelModelPager;
class LoopResult implements \Iterator
{
private $position;
@@ -152,7 +151,7 @@ class LoopResult implements \Iterator
* Checks if current position is valid
* @link http://php.net/manual/en/iterator.valid.php
* @return boolean The return value will be casted to boolean and then evaluated.
* Returns true on success or false on failure.
* Returns true on success or false on failure.
*/
public function valid()
{

View File

@@ -23,8 +23,6 @@
namespace Thelia\Core\Template\Loop;
use Propel\Runtime\ActiveQuery\Criteria;
use Thelia\Core\Template\Element\LoopResult;

View File

@@ -127,7 +127,7 @@ class ArgumentCollection implements \Iterator
* Checks if current position is valid
* @link http://php.net/manual/en/iterator.valid.php
* @return boolean The return value will be casted to boolean and then evaluated.
* Returns true on success or false on failure.
* Returns true on success or false on failure.
*/
public function valid()
{

View File

@@ -23,8 +23,6 @@
namespace Thelia\Core\Template\Loop;
use Propel\Runtime\ActiveQuery\Criteria;
use Thelia\Core\Template\Element\LoopResult;

View File

@@ -194,7 +194,6 @@ class Category extends BaseI18nLoop implements PropelSearchLoopInterface
{
foreach ($loopResult->getResultDataCollection() as $category) {
/*
* no cause pagination lost :
* if ($this->getNotEmpty() && $category->countAllProducts() == 0) continue;
@@ -254,7 +253,6 @@ class Category extends BaseI18nLoop implements PropelSearchLoopInterface
;
}
$loopResult->addRow($loopResultRow);
}

View File

@@ -30,7 +30,6 @@ use Thelia\Model\CountryQuery;
use Thelia\Module\BaseModule;
use Thelia\Module\DeliveryModuleInterface;
/**
* Class Delivery
* @package Thelia\Core\Template\Loop

View File

@@ -87,7 +87,6 @@ class Lang extends BaseLoop implements PropelSearchLoopInterface
$search->filterById($exclude, Criteria::NOT_IN);
}
$orders = $this->getOrder();
foreach ($orders as $order) {

View File

@@ -46,7 +46,7 @@ abstract class AbstractSmartyPlugin
$array = explode(',', $commaSeparatedValues);
if (array_walk($array, function(&$item) {
if (array_walk($array, function (&$item) {
$item = strtoupper(trim($item));
})) {
return $array;

Some files were not shown because too many files have changed in this diff Show More