diff --git a/Readme.md b/Readme.md
index abb8ccd30..fe90c50cc 100755
--- a/Readme.md
+++ b/Readme.md
@@ -22,7 +22,7 @@ Requirements
* gd
* curl
* safe_mode off
- * memory_limit at least 128M, preferably 256.
+ * memory_limit at least 150M, preferably 256.
* post_max_size 20M
* upload_max_filesize 2M
* apache 2
@@ -44,8 +44,10 @@ Installation
------------
``` bash
+$ git clone https://github.com/thelia/thelia.git
+$ cd thelia
$ curl -sS https://getcomposer.org/installer | php
-$ php composer.phar create-project thelia/thelia path/ dev-master
+$ php composer.phar install --prefer-dist --optimize-autoloader
```
Finish the installation using cli tools :
@@ -56,14 +58,6 @@ $ php Thelia thelia:install
You just have to follow all instructions.
-Documentation
--------------
-
-Thelia documentation is available at http://doc.thelia.net
-
-The documentation is also in beta version and some part can be obsolete cause to some refactor.
-
-
Contribute
----------
diff --git a/core/lib/Thelia/Action/BaseAction.php b/core/lib/Thelia/Action/BaseAction.php
index c376a78b7..1f04e12f6 100755
--- a/core/lib/Thelia/Action/BaseAction.php
+++ b/core/lib/Thelia/Action/BaseAction.php
@@ -30,6 +30,7 @@ use Thelia\Core\Event\UpdateSeoEvent;
use Thelia\Exception\UrlRewritingException;
use Thelia\Form\Exception\FormValidationException;
+use \Thelia\Model\Tools\UrlRewritingTrait;
class BaseAction
{
@@ -81,8 +82,8 @@ class BaseAction
/**
* Changes SEO Fields for an object.
*
- * @param ModelCriteria $query
- * @param UpdateSeoEvent $event
+ * @param ModelCriteria $query
+ * @param UpdateSeoEvent $event
*
* @return mixed
*/
@@ -104,7 +105,7 @@ class BaseAction
// Update the rewritten URL, if required
try {
$object->setRewrittenUrl($event->getLocale(), $event->getUrl());
- } catch (UrlRewritingException $e) {
+ } catch(UrlRewritingException $e) {
throw new FormValidationException($e->getMessage(), $e->getCode());
}
diff --git a/core/lib/Thelia/Action/Coupon.php b/core/lib/Thelia/Action/Coupon.php
index 4c76002ac..1b77eb488 100755
--- a/core/lib/Thelia/Action/Coupon.php
+++ b/core/lib/Thelia/Action/Coupon.php
@@ -28,7 +28,6 @@ use Thelia\Condition\ConditionFactory;
use Thelia\Condition\Implementation\ConditionInterface;
use Thelia\Core\Event\Coupon\CouponConsumeEvent;
use Thelia\Core\Event\Coupon\CouponCreateOrUpdateEvent;
-use Thelia\Core\Event\Order\OrderEvent;
use Thelia\Core\Event\TheliaEvents;
use Thelia\Core\HttpFoundation\Request;
use Thelia\Coupon\CouponFactory;
@@ -37,7 +36,6 @@ use Thelia\Condition\ConditionCollection;
use Thelia\Coupon\Type\CouponInterface;
use Thelia\Model\Coupon as CouponModel;
use Thelia\Model\CouponQuery;
-use Thelia\Model\OrderCoupon;
/**
* Created by JetBrains PhpStorm.
@@ -124,20 +122,23 @@ class Coupon extends BaseAction implements EventSubscriberInterface
$request->getSession()->setConsumedCoupons($consumedCoupons);
$totalDiscount = $couponManager->getDiscount();
+ // @todo insert false product in cart with the name of the coupon and the discount as negative price
+
+ // Decrement coupon quantity
+ // @todo move this part in after order event
+ $couponQuery = CouponQuery::create();
+ $couponModel = $couponQuery->findOneByCode($coupon->getCode());
+ $couponManager->decrementQuantity($couponModel);
$request
->getSession()
->getCart()
->setDiscount($totalDiscount)
->save();
- $request
- ->getSession()
- ->getOrder()
- ->setDiscount($totalDiscount)
- ->save();
}
}
+
$event->setIsValid($isValid);
$event->setDiscount($totalDiscount);
}
@@ -206,68 +207,6 @@ class Coupon extends BaseAction implements EventSubscriberInterface
$event->setCouponModel($coupon);
}
- /**
- * @param \Thelia\Core\Event\Order\OrderEvent $event
- */
- public function testFreePostage(OrderEvent $event)
- {
- /** @var CouponManager $couponManager */
- $couponManager = $this->container->get('thelia.coupon.manager');
-
- if($couponManager->isCouponRemovingPostage()) {
- $order = $event->getOrder();
-
- $order->setPostage(0);
-
- $event->setOrder($order);
-
- $event->stopPropagation();
- }
- }
-
- /**
- * @param \Thelia\Core\Event\Order\OrderEvent $event
- */
- public function afterOrder(OrderEvent $event)
- {
- $request = $this->container->get('request');
-
- /** @var CouponManager $couponManager */
- $couponManager = $this->container->get('thelia.coupon.manager');
-
- $consumedCoupons = $request->getSession()->getConsumedCoupons();
-
- if (is_array($consumedCoupons)) {
- foreach($consumedCoupons as $couponCode) {
- $couponQuery = CouponQuery::create();
- $couponModel = $couponQuery->findOneByCode($couponCode);
- $couponModel->setLocale($request->getSession()->getLang()->getLocale());
-
- /* decrease coupon quantity */
- $couponManager->decrementQuantity($couponModel);
-
- /* memorize coupon */
- $orderCoupon = new OrderCoupon();
- $orderCoupon->setOrder($event->getOrder())
- ->setCode($couponModel->getCode())
- ->setType($couponModel->getType())
- ->setAmount($couponModel->getAmount())
-
- ->setTitle($couponModel->getTitle())
- ->setShortDescription($couponModel->getShortDescription())
- ->setDescription($couponModel->getDescription())
-
- ->setExpirationDate($couponModel->getExpirationDate())
- ->setIsCumulative($couponModel->getIsCumulative())
- ->setIsRemovingPostage($couponModel->getIsRemovingPostage())
- ->setIsAvailableOnSpecialOffers($couponModel->getIsAvailableOnSpecialOffers())
- ->setSerializedConditions($couponModel->getSerializedConditions())
- ;
- $orderCoupon->save();
- }
- }
- }
-
/**
* Returns an array of event names this subscriber listens to.
*
@@ -294,9 +233,7 @@ class Coupon extends BaseAction implements EventSubscriberInterface
TheliaEvents::COUPON_CREATE => array("create", 128),
TheliaEvents::COUPON_UPDATE => array("update", 128),
TheliaEvents::COUPON_CONSUME => array("consume", 128),
- TheliaEvents::COUPON_CONDITION_UPDATE => array("updateCondition", 128),
- TheliaEvents::ORDER_SET_POSTAGE => array("testFreePostage", 256),
- TheliaEvents::ORDER_BEFORE_PAYMENT => array("afterOrder", 128),
+ TheliaEvents::COUPON_CONDITION_UPDATE => array("updateCondition", 128)
);
}
}
diff --git a/core/lib/Thelia/Action/MailingSystem.php b/core/lib/Thelia/Action/MailingSystem.php
index 2f62d749b..f46352d53 100644
--- a/core/lib/Thelia/Action/MailingSystem.php
+++ b/core/lib/Thelia/Action/MailingSystem.php
@@ -35,7 +35,7 @@ class MailingSystem extends BaseAction implements EventSubscriberInterface
*/
public function update(MailingSystemEvent $event)
{
- if ($event->getEnabled()) {
+ if($event->getEnabled()) {
ConfigQuery::enableSmtp();
} else {
ConfigQuery::disableSmtp();
diff --git a/core/lib/Thelia/Action/Order.php b/core/lib/Thelia/Action/Order.php
index 9d7daaba7..0699c14d1 100755
--- a/core/lib/Thelia/Action/Order.php
+++ b/core/lib/Thelia/Action/Order.php
@@ -30,7 +30,6 @@ use Thelia\Core\Event\Cart\CartEvent;
use Thelia\Core\Event\Order\OrderAddressEvent;
use Thelia\Core\Event\Order\OrderEvent;
use Thelia\Core\Event\TheliaEvents;
-use Thelia\Coupon\CouponManager;
use Thelia\Exception\TheliaProcessException;
use Thelia\Model\AddressQuery;
use Thelia\Model\ConfigQuery;
@@ -74,17 +73,6 @@ class Order extends BaseAction implements EventSubscriberInterface
$order = $event->getOrder();
$order->setDeliveryModuleId($event->getDeliveryModule());
-
- $event->setOrder($order);
- }
-
- /**
- * @param \Thelia\Core\Event\Order\OrderEvent $event
- */
- public function setPostage(OrderEvent $event)
- {
- $order = $event->getOrder();
-
$order->setPostage($event->getPostage());
$event->setOrder($order);
@@ -190,11 +178,6 @@ class Order extends BaseAction implements EventSubscriberInterface
OrderStatusQuery::create()->findOneByCode(OrderStatus::CODE_NOT_PAID)->getId()
);
- /* memorize discount */
- $placedOrder->setDiscount(
- $cart->getDiscount()
- );
-
$placedOrder->save($con);
/* fulfill order_products and decrease stock */
@@ -279,6 +262,8 @@ class Order extends BaseAction implements EventSubscriberInterface
}
}
+ /* discount @todo */
+
$con->commit();
$this->getDispatcher()->dispatch(TheliaEvents::ORDER_BEFORE_PAYMENT, new OrderEvent($placedOrder));
@@ -288,7 +273,7 @@ class Order extends BaseAction implements EventSubscriberInterface
$sessionOrder = new \Thelia\Model\Order();
$event->setOrder($sessionOrder);
$event->setPlacedOrder($placedOrder);
- $this->getSession()->setOrder($placedOrder);
+ $this->getSession()->setOrder($sessionOrder);
/* empty cart */
$this->getDispatcher()->dispatch(TheliaEvents::CART_CLEAR, new CartEvent($this->getCart($this->getRequest())));
@@ -305,7 +290,7 @@ class Order extends BaseAction implements EventSubscriberInterface
{
$contact_email = ConfigQuery::read('contact_email');
- if ($contact_email) {
+ if($contact_email) {
$message = MessageQuery::create()
->filterByName('order_confirmation')
@@ -427,7 +412,6 @@ class Order extends BaseAction implements EventSubscriberInterface
return array(
TheliaEvents::ORDER_SET_DELIVERY_ADDRESS => array("setDeliveryAddress", 128),
TheliaEvents::ORDER_SET_DELIVERY_MODULE => array("setDeliveryModule", 128),
- TheliaEvents::ORDER_SET_POSTAGE => array("setPostage", 128),
TheliaEvents::ORDER_SET_INVOICE_ADDRESS => array("setInvoiceAddress", 128),
TheliaEvents::ORDER_SET_PAYMENT_MODULE => array("setPaymentModule", 128),
TheliaEvents::ORDER_PAY => array("create", 128),
diff --git a/core/lib/Thelia/Action/Product.php b/core/lib/Thelia/Action/Product.php
index a5defe5cb..6d477855b 100644
--- a/core/lib/Thelia/Action/Product.php
+++ b/core/lib/Thelia/Action/Product.php
@@ -131,6 +131,7 @@ class Product extends BaseAction implements EventSubscriberInterface
return $this->genericUpdateSeo(ProductQuery::create(), $event);
}
+
/**
* Delete a product entry
*
diff --git a/core/lib/Thelia/Action/ProductSaleElement.php b/core/lib/Thelia/Action/ProductSaleElement.php
index 875dbcc1d..cad3be374 100644
--- a/core/lib/Thelia/Action/ProductSaleElement.php
+++ b/core/lib/Thelia/Action/ProductSaleElement.php
@@ -209,7 +209,8 @@ class ProductSaleElement extends BaseAction implements EventSubscriberInterface
if ($product->countSaleElements() <= 0) {
// If we just deleted the last PSE, create a default one
$product->createProductSaleElement($con, 0, 0, 0, $event->getCurrencyId(), true);
- } elseif ($pse->getIsDefault()) {
+ }
+ elseif ($pse->getIsDefault()) {
// If we deleted the default PSE, make the last created one the default
$pse = ProductSaleElementsQuery::create()
@@ -237,8 +238,8 @@ class ProductSaleElement extends BaseAction implements EventSubscriberInterface
*
* @param ProductCombinationGenerationEvent $event
*/
- public function generateCombinations(ProductCombinationGenerationEvent $event)
- {
+ public function generateCombinations(ProductCombinationGenerationEvent $event) {
+
$con = Propel::getWriteConnection(ProductSaleElementsTableMap::DATABASE_NAME);
$con->beginTransaction();
@@ -251,7 +252,7 @@ class ProductSaleElement extends BaseAction implements EventSubscriberInterface
$isDefault = true;
// Create all combinations
- foreach ($event->getCombinations() as $combinationAttributesAvIds) {
+ foreach($event->getCombinations() as $combinationAttributesAvIds) {
// Create the PSE
$saleElement = $event->getProduct()->createProductSaleElement(
@@ -275,7 +276,8 @@ class ProductSaleElement extends BaseAction implements EventSubscriberInterface
// Store all the stuff !
$con->commit();
- } catch (\Exception $ex) {
+ }
+ catch (\Exception $ex) {
$con->rollback();
@@ -286,9 +288,9 @@ class ProductSaleElement extends BaseAction implements EventSubscriberInterface
/**
* Create a combination for a given product sale element
*
- * @param ConnectionInterface $con the Propel connection
- * @param ProductSaleElement $salesElement the product sale element
- * @param unknown $combinationAttributes an array oif attributes av IDs
+ * @param ConnectionInterface $con the Propel connection
+ * @param ProductSaleElement $salesElement the product sale element
+ * @param unknown $combinationAttributes an array oif attributes av IDs
*/
protected function createCombination(ConnectionInterface $con, ProductSaleElements $salesElement, $combinationAttributes)
{
diff --git a/core/lib/Thelia/Command/AdminUpdatePasswordCommand.php b/core/lib/Thelia/Command/AdminUpdatePasswordCommand.php
index 690f4362b..cab25d13f 100644
--- a/core/lib/Thelia/Command/AdminUpdatePasswordCommand.php
+++ b/core/lib/Thelia/Command/AdminUpdatePasswordCommand.php
@@ -32,6 +32,7 @@ use Thelia\Core\Event\TheliaEvents;
use Thelia\Model\AdminQuery;
use Thelia\Tools\Password;
+
/**
* command line for updating admin password
*
@@ -71,15 +72,18 @@ class AdminUpdatePasswordCommand extends ContainerAwareCommand
{
$login = $input->getArgument('login');
+
if (null === $admin = AdminQuery::create()->filterByLogin($login)->findOne()) {
throw new \RuntimeException(sprintf('Admin with login %s does not exists', $login));
}
+
$password = $input->getOption('password') ?: Password::generateRandom();
$event = new AdministratorUpdatePasswordEvent($admin);
$event->setPassword($password);
+
$this->
getContainer()
->get('event_dispatcher')
@@ -95,3 +99,4 @@ class AdminUpdatePasswordCommand extends ContainerAwareCommand
}
}
+
diff --git a/core/lib/Thelia/Config/I18n/en_US.php b/core/lib/Thelia/Config/I18n/en_US.php
index 2b8b661c2..ce333ddb4 100644
--- a/core/lib/Thelia/Config/I18n/en_US.php
+++ b/core/lib/Thelia/Config/I18n/en_US.php
@@ -1,14 +1,14 @@
'Delivery module',
- 'Quantity' => 'Quantity',
- 'Product' => 'Product',
- 'Unit. price' => 'Unit. price',
- 'Tax' => 'Tax',
- 'Unit taxed price' => 'Unit taxed price',
- 'Taxed total' => 'Taxed total',
- 'Payment module' => 'Payment module',
- 'Postage' => 'Postage',
- 'Total' => 'Total',
+ 'Delivery module' => 'Delivery module',
+ 'Quantity' => 'Quantity',
+ 'Product' => 'Product',
+ 'Unit. price' => 'Unit. price',
+ 'Tax' => 'Tax',
+ 'Unit taxed price' => 'Unit taxed price',
+ 'Taxed total' => 'Taxed total',
+ 'Payment module' => 'Payment module',
+ 'Postage' => 'Postage',
+ 'Total' => 'Total',
);
diff --git a/core/lib/Thelia/Config/I18n/es_ES.php b/core/lib/Thelia/Config/I18n/es_ES.php
index 0a749d4c1..f1a85bd6a 100644
--- a/core/lib/Thelia/Config/I18n/es_ES.php
+++ b/core/lib/Thelia/Config/I18n/es_ES.php
@@ -1,36 +1,36 @@
'Combination builder',
- 'Title' => 'Title',
- 'City' => 'City',
- 'Zip code' => 'Zip code',
- 'Country' => 'Country',
- 'Phone' => 'Phone',
- 'Login' => 'Login',
- 'Password' => 'Password',
- 'Profile' => 'Profile',
- 'Postage' => 'Postage',
- 'Add to all product templates' => 'Add to all product templates',
- 'Quantity' => 'Quantity',
- 'Name' => 'Name',
- 'Value' => 'Value',
- 'Subject' => 'Subject',
- 'Company' => 'Company',
- 'Description' => 'Description',
- 'Language name' => 'Language name',
- 'ISO 639 Code' => 'ISO 639 Code',
- 'If a translation is missing or incomplete :' => 'If a translation is missing or incomplete :',
- 'Host' => 'Host',
- 'Port' => 'Port',
- 'Encryption' => 'Encryption',
- 'Username' => 'Username',
- 'Timeout' => 'Timeout',
- 'Source IP' => 'Source IP',
- 'Email address' => 'Email address',
- 'Firstname' => 'Firstname',
- 'Lastname' => 'Lastname',
- 'Additional address' => 'Additional address',
- 'Reference' => 'Reference',
- 'EAN Code' => 'EAN Code',
+ 'Combination builder' => 'Combination builder',
+ 'Title' => 'Title',
+ 'City' => 'City',
+ 'Zip code' => 'Zip code',
+ 'Country' => 'Country',
+ 'Phone' => 'Phone',
+ 'Login' => 'Login',
+ 'Password' => 'Password',
+ 'Profile' => 'Profile',
+ 'Postage' => 'Postage',
+ 'Add to all product templates' => 'Add to all product templates',
+ 'Quantity' => 'Quantity',
+ 'Name' => 'Name',
+ 'Value' => 'Value',
+ 'Subject' => 'Subject',
+ 'Company' => 'Company',
+ 'Description' => 'Description',
+ 'Language name' => 'Language name',
+ 'ISO 639 Code' => 'ISO 639 Code',
+ 'If a translation is missing or incomplete :' => 'If a translation is missing or incomplete :',
+ 'Host' => 'Host',
+ 'Port' => 'Port',
+ 'Encryption' => 'Encryption',
+ 'Username' => 'Username',
+ 'Timeout' => 'Timeout',
+ 'Source IP' => 'Source IP',
+ 'Email address' => 'Email address',
+ 'Firstname' => 'Firstname',
+ 'Lastname' => 'Lastname',
+ 'Additional address' => 'Additional address',
+ 'Reference' => 'Reference',
+ 'EAN Code' => 'EAN Code',
);
diff --git a/core/lib/Thelia/Config/I18n/fr_FR.php b/core/lib/Thelia/Config/I18n/fr_FR.php
index 188d6f90a..7eb24949a 100644
--- a/core/lib/Thelia/Config/I18n/fr_FR.php
+++ b/core/lib/Thelia/Config/I18n/fr_FR.php
@@ -23,4 +23,4 @@
return array(
-);
+);
\ No newline at end of file
diff --git a/core/lib/Thelia/Config/I18n/it_IT.php b/core/lib/Thelia/Config/I18n/it_IT.php
index 188d6f90a..7eb24949a 100644
--- a/core/lib/Thelia/Config/I18n/it_IT.php
+++ b/core/lib/Thelia/Config/I18n/it_IT.php
@@ -23,4 +23,4 @@
return array(
-);
+);
\ No newline at end of file
diff --git a/core/lib/Thelia/Config/Resources/loop.xml b/core/lib/Thelia/Config/Resources/loop.xml
index 0e5414ad8..c253b5fb4 100644
--- a/core/lib/Thelia/Config/Resources/loop.xml
+++ b/core/lib/Thelia/Config/Resources/loop.xml
@@ -28,7 +28,6 @@
-
diff --git a/core/lib/Thelia/Controller/Admin/AbstractCrudController.php b/core/lib/Thelia/Controller/Admin/AbstractCrudController.php
index 7e3f936fc..028d5ab15 100644
--- a/core/lib/Thelia/Controller/Admin/AbstractCrudController.php
+++ b/core/lib/Thelia/Controller/Admin/AbstractCrudController.php
@@ -443,6 +443,7 @@ abstract class AbstractCrudController extends BaseAdminController
$ex
);
+
//return $this->renderEditionTemplate();
}
diff --git a/core/lib/Thelia/Controller/Admin/AbstractSeoCrudController.php b/core/lib/Thelia/Controller/Admin/AbstractSeoCrudController.php
index 52c4bbda4..9918f8a2f 100644
--- a/core/lib/Thelia/Controller/Admin/AbstractSeoCrudController.php
+++ b/core/lib/Thelia/Controller/Admin/AbstractSeoCrudController.php
@@ -53,7 +53,7 @@ abstract class AbstractSeoCrudController extends AbstractCrudController
*
* @param string $visibilityToggleEventIdentifier the dispatched visibility toggle TheliaEvent identifier, or null if the object has no visible options. Example: TheliaEvents::MESSAGE_TOGGLE_VISIBILITY
* @param string $changePositionEventIdentifier the dispatched position change TheliaEvent identifier, or null if the object has no position. Example: TheliaEvents::MESSAGE_UPDATE_POSITION
- * @param string $updateSeoEventIdentifier the dispatched update SEO change TheliaEvent identifier, or null if the object has no SEO. Example: TheliaEvents::MESSAGE_UPDATE_SEO
+ * @param string $updateSeoEventIdentifier the dispatched update SEO change TheliaEvent identifier, or null if the object has no SEO. Example: TheliaEvents::MESSAGE_UPDATE_SEO
*/
public function __construct(
$objectName,
@@ -134,8 +134,7 @@ abstract class AbstractSeoCrudController extends AbstractCrudController
*
* @param unknown $object
*/
- protected function hydrateSeoForm($object)
- {
+ protected function hydrateSeoForm($object){
// The "SEO" tab form
$locale = $object->getLocale();
$data = array(
@@ -228,6 +227,8 @@ abstract class AbstractSeoCrudController extends AbstractCrudController
$ex
);
+
+
// At this point, the form has errors, and should be redisplayed.
return $this->renderEditionTemplate();
}
diff --git a/core/lib/Thelia/Controller/Admin/AddressController.php b/core/lib/Thelia/Controller/Admin/AddressController.php
index c818ba492..3e2812bd0 100644
--- a/core/lib/Thelia/Controller/Admin/AddressController.php
+++ b/core/lib/Thelia/Controller/Admin/AddressController.php
@@ -98,7 +98,7 @@ class AddressController extends AbstractCrudController
/**
* Fills in the form data array
*
- * @param unknown $object
+ * @param unknown $object
* @return multitype:NULL
*/
protected function createFormDataArray($object)
@@ -309,8 +309,7 @@ class AddressController extends AbstractCrudController
$this->redirectToEditionTemplate();
}
- protected function getCustomerId()
- {
+ protected function getCustomerId() {
if (null !== $address = $this->getExistingObject())
return $address->getCustomerId();
else
diff --git a/core/lib/Thelia/Controller/Admin/AttributeController.php b/core/lib/Thelia/Controller/Admin/AttributeController.php
index b058f060d..ce1ca3072 100644
--- a/core/lib/Thelia/Controller/Admin/AttributeController.php
+++ b/core/lib/Thelia/Controller/Admin/AttributeController.php
@@ -34,6 +34,7 @@ use Thelia\Form\AttributeModificationForm;
use Thelia\Form\AttributeCreationForm;
use Thelia\Core\Event\UpdatePositionEvent;
use Thelia\Model\AttributeAv;
+use Thelia\Model\AttributeAvQuery;
use Thelia\Core\Event\Attribute\AttributeAvUpdateEvent;
use Thelia\Core\Event\Attribute\AttributeEvent;
diff --git a/core/lib/Thelia/Controller/Admin/BaseAdminController.php b/core/lib/Thelia/Controller/Admin/BaseAdminController.php
index 1ef329dd1..abb9665f9 100755
--- a/core/lib/Thelia/Controller/Admin/BaseAdminController.php
+++ b/core/lib/Thelia/Controller/Admin/BaseAdminController.php
@@ -309,7 +309,6 @@ class BaseAdminController extends BaseController
{
// Check if the functionality is activated
if(!ConfigQuery::read("one_domain_foreach_lang", false))
-
return;
// If we don't have a locale value, use the locale value in the session
@@ -391,8 +390,8 @@ class BaseAdminController extends BaseController
* Render the given template, and returns the result as an Http Response.
*
* @param $templateName the complete template name, with extension
- * @param array $args the template arguments
- * @param int $status http code status
+ * @param array $args the template arguments
+ * @param int $status http code status
* @return \Thelia\Core\HttpFoundation\Response
*/
protected function render($templateName, $args = array(), $status = 200)
diff --git a/core/lib/Thelia/Controller/Admin/CategoryController.php b/core/lib/Thelia/Controller/Admin/CategoryController.php
index d2e0a0e9c..4f789244b 100755
--- a/core/lib/Thelia/Controller/Admin/CategoryController.php
+++ b/core/lib/Thelia/Controller/Admin/CategoryController.php
@@ -201,12 +201,15 @@ class CategoryController extends AbstractSeoCrudController
protected function redirectToListTemplateWithId($category_id)
{
- if ($category_id > 0) {
+ if($category_id > 0)
+ {
$this->redirectToRoute(
'admin.categories.default',
array('category_id' => $category_id)
);
- } else {
+ }
+ else
+ {
$this->redirectToRoute(
'admin.catalog'
);
diff --git a/core/lib/Thelia/Controller/Admin/ConfigStoreController.php b/core/lib/Thelia/Controller/Admin/ConfigStoreController.php
index 95d425edb..1a9172ec1 100644
--- a/core/lib/Thelia/Controller/Admin/ConfigStoreController.php
+++ b/core/lib/Thelia/Controller/Admin/ConfigStoreController.php
@@ -23,9 +23,11 @@
namespace Thelia\Controller\Admin;
+
use Thelia\Core\Security\Resource\AdminResources;
use Thelia\Core\Security\AccessManager;
use Thelia\Form\ConfigStoreForm;
+use Thelia\Log\Tlog;
use Thelia\Model\ConfigQuery;
/**
* Class ConfigStoreController
@@ -78,7 +80,7 @@ class ConfigStoreController extends BaseAdminController
$data = $form->getData();
// Update store
- foreach ($data as $name => $value) {
+ foreach($data as $name => $value) {
if(! in_array($name , array('success_url', 'error_message')))
ConfigQuery::write($name, $value, false);
}
diff --git a/core/lib/Thelia/Controller/Admin/CustomerController.php b/core/lib/Thelia/Controller/Admin/CustomerController.php
index 95f6451c9..a3239542c 100644
--- a/core/lib/Thelia/Controller/Admin/CustomerController.php
+++ b/core/lib/Thelia/Controller/Admin/CustomerController.php
@@ -23,14 +23,19 @@
namespace Thelia\Controller\Admin;
+use Propel\Runtime\Exception\PropelException;
use Thelia\Core\Security\Resource\AdminResources;
use Thelia\Core\Event\Customer\CustomerCreateOrUpdateEvent;
use Thelia\Core\Event\Customer\CustomerEvent;
use Thelia\Core\Event\TheliaEvents;
+use Thelia\Core\Security\AccessManager;
use Thelia\Form\CustomerCreateForm;
use Thelia\Form\CustomerUpdateForm;
+use Thelia\Form\Exception\FormValidationException;
use Thelia\Model\CustomerQuery;
+use Thelia\Core\Translation\Translator;
use Thelia\Tools\Password;
+use Thelia\Model\AddressQuery;
use Thelia\Model\Address;
/**
@@ -203,4 +208,4 @@ class CustomerController extends AbstractCrudController
{
$this->redirectToRoute("admin.customer.update.view", $this->getEditionArguments());
}
-}
+}
\ No newline at end of file
diff --git a/core/lib/Thelia/Controller/Admin/FeatureController.php b/core/lib/Thelia/Controller/Admin/FeatureController.php
index 5ae0aae7d..8ff3a972e 100644
--- a/core/lib/Thelia/Controller/Admin/FeatureController.php
+++ b/core/lib/Thelia/Controller/Admin/FeatureController.php
@@ -34,6 +34,7 @@ use Thelia\Form\FeatureModificationForm;
use Thelia\Form\FeatureCreationForm;
use Thelia\Core\Event\UpdatePositionEvent;
use Thelia\Model\FeatureAv;
+use Thelia\Model\FeatureAvQuery;
use Thelia\Core\Event\Feature\FeatureAvUpdateEvent;
use Thelia\Core\Event\Feature\FeatureEvent;
diff --git a/core/lib/Thelia/Controller/Admin/FileController.php b/core/lib/Thelia/Controller/Admin/FileController.php
index f123bfb94..aff1c2d63 100755
--- a/core/lib/Thelia/Controller/Admin/FileController.php
+++ b/core/lib/Thelia/Controller/Admin/FileController.php
@@ -584,7 +584,7 @@ class FileController extends BaseAdminController
);
}
- if (null === $message) {
+ if(null === $message) {
$message = $this->getTranslator()
->trans(
'Images deleted successfully',
@@ -638,7 +638,7 @@ class FileController extends BaseAdminController
) . $e->getMessage();
}
- if (null === $message) {
+ if(null === $message) {
$message = $this->getTranslator()
->trans(
'Image position updated',
@@ -692,7 +692,7 @@ class FileController extends BaseAdminController
) . $e->getMessage();
}
- if (null === $message) {
+ if(null === $message) {
$message = $this->getTranslator()
->trans(
'Document position updated',
diff --git a/core/lib/Thelia/Controller/Admin/HomeController.php b/core/lib/Thelia/Controller/Admin/HomeController.php
index d4458843d..0fcee29ca 100644
--- a/core/lib/Thelia/Controller/Admin/HomeController.php
+++ b/core/lib/Thelia/Controller/Admin/HomeController.php
@@ -42,7 +42,7 @@ class HomeController extends BaseAdminController
public function loadStatsAjaxAction()
{
if (null !== $response = $this->checkAuth(self::RESOURCE_CODE, array(), AccessManager::VIEW)) return $response;
-
+
$data = new \stdClass();
$data->title = "Stats on " . $this->getRequest()->query->get('month', date('m')) . "/" . $this->getRequest()->query->get('year', date('Y'));
@@ -88,6 +88,7 @@ class HomeController extends BaseAdminController
array(5)
);
+
$data->series = array(
$saleSeries,
$newCustomerSeries,
diff --git a/core/lib/Thelia/Controller/Admin/MessageController.php b/core/lib/Thelia/Controller/Admin/MessageController.php
index aebf29d04..fe8b655c7 100644
--- a/core/lib/Thelia/Controller/Admin/MessageController.php
+++ b/core/lib/Thelia/Controller/Admin/MessageController.php
@@ -31,6 +31,7 @@ use Thelia\Model\MessageQuery;
use Thelia\Form\MessageModificationForm;
use Thelia\Form\MessageCreationForm;
use Symfony\Component\Finder\Finder;
+use Thelia\Model\ConfigQuery;
use Thelia\Core\Template\TemplateHelper;
/**
@@ -163,8 +164,8 @@ class MessageController extends AbstractCrudController
return $this->render('messages');
}
- protected function listDirectoryContent($requiredExtension)
- {
+ protected function listDirectoryContent($requiredExtension) {
+
$list = array();
$dir = TemplateHelper::getInstance()->getActiveMailTemplate()->getAbsolutePath();
diff --git a/core/lib/Thelia/Controller/Admin/ModuleController.php b/core/lib/Thelia/Controller/Admin/ModuleController.php
index edd591ba4..031ae1f26 100644
--- a/core/lib/Thelia/Controller/Admin/ModuleController.php
+++ b/core/lib/Thelia/Controller/Admin/ModuleController.php
@@ -149,6 +149,7 @@ class ModuleController extends AbstractCrudController
->findOneById($this->getRequest()->get('module_id'));
}
+
protected function getObjectLabel($object)
{
return $object->getTitle();
@@ -217,11 +218,12 @@ class ModuleController extends AbstractCrudController
{
$module = ModuleQuery::create()->findOneByCode($module_code);
- if (null === $module) {
+ if(null === $module) {
throw new \InvalidArgumentException(sprintf("Module `%s` does not exists", $module_code));
}
if (null !== $response = $this->checkAuth(array(), $module_code, AccessManager::VIEW)) return $response;
+
return $this->render(
"module-configure",
array(
diff --git a/core/lib/Thelia/Controller/Admin/OrderController.php b/core/lib/Thelia/Controller/Admin/OrderController.php
index c04e2c93e..56d130f5d 100644
--- a/core/lib/Thelia/Controller/Admin/OrderController.php
+++ b/core/lib/Thelia/Controller/Admin/OrderController.php
@@ -27,6 +27,7 @@ use Thelia\Core\HttpFoundation\Response;
use Thelia\Core\Security\Resource\AdminResources;
use Thelia\Core\Event\Order\OrderAddressEvent;
use Thelia\Core\Event\Order\OrderEvent;
+use Thelia\Core\Event\PdfEvent;
use Thelia\Core\Event\TheliaEvents;
use Thelia\Core\Security\AccessManager;
use Thelia\Form\OrderUpdateAddress;
@@ -35,6 +36,7 @@ use Thelia\Model\Base\OrderAddressQuery;
use Thelia\Model\OrderQuery;
use Thelia\Model\OrderStatusQuery;
use Thelia\Tools\URL;
+use Thelia\Core\Template\TemplateHelper;
/**
* Class OrderController
@@ -201,18 +203,20 @@ class OrderController extends BaseAdminController
public function generateInvoicePdf($order_id)
{
if (null !== $response = $this->checkAuth(AdminResources::ORDER, array(), AccessManager::UPDATE)) return $response;
+
return $this->generateBackOfficeOrderPdf($order_id, ConfigQuery::read('pdf_invoice_file', 'invoice'));
}
public function generateDeliveryPdf($order_id)
{
if (null !== $response = $this->checkAuth(AdminResources::ORDER, array(), AccessManager::UPDATE)) return $response;
+
return $this->generateBackOfficeOrderPdf($order_id, ConfigQuery::read('pdf_delivery_file', 'delivery'));
}
private function generateBackOfficeOrderPdf($order_id, $fileName)
{
- if (null === $response = $this->generateOrderPdf($order_id, $fileName)) {
+ if(null === $response = $this->generateOrderPdf($order_id, $fileName)){
$this->redirect(URL::getInstance()->absoluteUrl($this->getRoute("admin.order.update.view", array(
'order_id' => $order_id
))));
@@ -221,4 +225,5 @@ class OrderController extends BaseAdminController
return $response;
}
+
}
diff --git a/core/lib/Thelia/Controller/Admin/ProductController.php b/core/lib/Thelia/Controller/Admin/ProductController.php
index 7b727f206..57ceb8fb4 100644
--- a/core/lib/Thelia/Controller/Admin/ProductController.php
+++ b/core/lib/Thelia/Controller/Admin/ProductController.php
@@ -72,6 +72,7 @@ use Thelia\Form\ProductCombinationGenerationForm;
use Thelia\TaxEngine\Calculator;
use Thelia\Tools\NumberFormat;
+
/**
* Manages products
*
@@ -1036,18 +1037,17 @@ class ProductController extends AbstractSeoCrudController
}
// Create combinations
- protected function combine($input, &$output, &$tmp)
- {
+ protected function combine($input, &$output, &$tmp) {
$current = array_shift($input);
if (count($input) > 0) {
- foreach ($current as $element) {
+ foreach($current as $element) {
$tmp[] = $element;
$this->combine($input, $output, $tmp);
array_pop($tmp);
}
} else {
- foreach ($current as $element) {
+ foreach($current as $element) {
$tmp[] = $element;
$output[] = $tmp;
array_pop($tmp);
@@ -1058,8 +1058,8 @@ class ProductController extends AbstractSeoCrudController
/**
* Build combinations from the combination output builder
*/
- public function buildCombinationsAction()
- {
+ public function buildCombinationsAction() {
+
// Check current user authorization
if (null !== $response = $this->checkAuth($this->resourceCode, array(), AccessManager::UPDATE)) return $response;
@@ -1082,7 +1082,7 @@ class ProductController extends AbstractSeoCrudController
// from the list of attribute_id:attributes_av ID from the form.
$combinations = $attributes_av_list = array();
- foreach ($data['attribute_av'] as $item) {
+ foreach($data['attribute_av'] as $item) {
list($attribute_id, $attribute_av_id) = explode(':', $item);
if (! isset($attributes_av_list[$attribute_id]))
diff --git a/core/lib/Thelia/Controller/Admin/SystemLogController.php b/core/lib/Thelia/Controller/Admin/SystemLogController.php
index 9dafd78f6..e61d619f0 100644
--- a/core/lib/Thelia/Controller/Admin/SystemLogController.php
+++ b/core/lib/Thelia/Controller/Admin/SystemLogController.php
@@ -23,6 +23,7 @@
namespace Thelia\Controller\Admin;
+
use Thelia\Core\Security\Resource\AdminResources;
use Thelia\Core\Security\AccessManager;
use Thelia\Form\SystemLogConfigurationForm;
@@ -42,7 +43,7 @@ class SystemLogController extends BaseAdminController
$destination_directories = Tlog::getInstance()->getDestinationsDirectories();
- foreach ($destination_directories as $dir) {
+ foreach($destination_directories as $dir) {
$this->loadDefinedDestinations($dir, $destinations);
}
@@ -57,8 +58,8 @@ class SystemLogController extends BaseAdminController
);
}
- protected function loadDefinedDestinations($directory, &$destinations)
- {
+ protected function loadDefinedDestinations($directory, &$destinations) {
+
try {
foreach (new \DirectoryIterator($directory) as $fileInfo) {
@@ -143,7 +144,7 @@ class SystemLogController extends BaseAdminController
$active_destinations = array();
- foreach ($destinations as $classname => $destination) {
+ foreach($destinations as $classname => $destination) {
if (isset($destination['active'])) {
$active_destinations[] = $destination['classname'];
@@ -152,7 +153,7 @@ class SystemLogController extends BaseAdminController
if (isset($configs[$classname])) {
// Update destinations configuration
- foreach ($configs[$classname] as $var => $value) {
+ foreach($configs[$classname] as $var => $value) {
ConfigQuery::write($var, $value, true, true);
}
}
diff --git a/core/lib/Thelia/Controller/Admin/TranslationsController.php b/core/lib/Thelia/Controller/Admin/TranslationsController.php
index e4fcfed23..cb7c3f072 100644
--- a/core/lib/Thelia/Controller/Admin/TranslationsController.php
+++ b/core/lib/Thelia/Controller/Admin/TranslationsController.php
@@ -23,8 +23,12 @@
namespace Thelia\Controller\Admin;
+
use Thelia\Core\Security\Resource\AdminResources;
use Thelia\Core\Security\AccessManager;
+use Thelia\Form\SystemLogConfigurationForm;
+use Thelia\Log\Tlog;
+use Thelia\Model\ConfigQuery;
use Thelia\Model\ModuleQuery;
use Thelia\Core\Template\TemplateHelper;
use Thelia\Core\Template\TemplateDefinition;
@@ -63,7 +67,7 @@ class TranslationsController extends BaseAdminController
if (! empty($item_id) || $item_to_translate == 'co') {
- switch ($item_to_translate) {
+ switch($item_to_translate) {
case 'mo' :
if (null !== $module = ModuleQuery::create()->findPk($item_id)) {
@@ -145,7 +149,8 @@ class TranslationsController extends BaseAdminController
$templateArguments['max_input_vars_warning'] = true;
$templateArguments['required_max_input_vars'] = $stringsCount;
$templateArguments['current_max_input_vars'] = ini_get('max_input_vars');
- } else {
+ }
+ else {
$templateArguments['all_strings'] = $all_strings;
}
}
@@ -157,12 +162,14 @@ class TranslationsController extends BaseAdminController
public function defaultAction()
{
if (null !== $response = $this->checkAuth(AdminResources::TRANSLATIONS, array(), AccessManager::VIEW)) return $response;
+
return $this->renderTemplate();
}
public function updateAction()
{
if (null !== $response = $this->checkAuth(AdminResources::LANGUAGE, array(), AccessManager::UPDATE)) return $response;
+
return $this->renderTemplate();
}
}
diff --git a/core/lib/Thelia/Controller/BaseController.php b/core/lib/Thelia/Controller/BaseController.php
index b90d98462..775861c32 100755
--- a/core/lib/Thelia/Controller/BaseController.php
+++ b/core/lib/Thelia/Controller/BaseController.php
@@ -61,7 +61,7 @@ abstract class BaseController extends ContainerAware
/**
* Return an empty response (after an ajax request, for example)
- * @param int $status
+ * @param int $status
* @return \Thelia\Core\HttpFoundation\Response
*/
protected function nullResponse($status = 200)
@@ -252,6 +252,7 @@ abstract class BaseController extends ContainerAware
}
+
}
/**
@@ -366,8 +367,8 @@ abstract class BaseController extends ContainerAware
* Render the given template, and returns the result as an Http Response.
*
* @param $templateName the complete template name, with extension
- * @param array $args the template arguments
- * @param int $status http code status
+ * @param array $args the template arguments
+ * @param int $status http code status
* @return \Thelia\Core\HttpFoundation\Response
*/
abstract protected function render($templateName, $args = array(), $status = 200);
diff --git a/core/lib/Thelia/Controller/Front/BaseFrontController.php b/core/lib/Thelia/Controller/Front/BaseFrontController.php
index 3e70364d4..07f434099 100755
--- a/core/lib/Thelia/Controller/Front/BaseFrontController.php
+++ b/core/lib/Thelia/Controller/Front/BaseFrontController.php
@@ -25,8 +25,10 @@ namespace Thelia\Controller\Front;
use Symfony\Component\Routing\Router;
use Thelia\Controller\BaseController;
use Thelia\Core\HttpFoundation\Response;
+use Thelia\Core\Security\Exception\AuthenticationException;
use Thelia\Core\Template\TemplateHelper;
use Thelia\Model\AddressQuery;
+use Thelia\Model\ConfigQuery;
use Thelia\Model\ModuleQuery;
use Thelia\Tools\Redirect;
use Thelia\Tools\URL;
@@ -104,8 +106,8 @@ class BaseFrontController extends BaseController
* Render the given template, and returns the result as an Http Response.
*
* @param $templateName the complete template name, with extension
- * @param array $args the template arguments
- * @param int $status http code status
+ * @param array $args the template arguments
+ * @param int $status http code status
* @return \Thelia\Core\HttpFoundation\Response
*/
protected function render($templateName, $args = array(), $status = 200)
diff --git a/core/lib/Thelia/Core/DependencyInjection/Compiler/TranslatorPass.php b/core/lib/Thelia/Core/DependencyInjection/Compiler/TranslatorPass.php
index 43f84ebd5..e007f9961 100644
--- a/core/lib/Thelia/Core/DependencyInjection/Compiler/TranslatorPass.php
+++ b/core/lib/Thelia/Core/DependencyInjection/Compiler/TranslatorPass.php
@@ -26,6 +26,7 @@ use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Reference;
+
/**
* Class TranslatorPass
* @package Thelia\Core\DependencyInjection\Compiler
@@ -49,11 +50,11 @@ class TranslatorPass implements CompilerPassInterface
$translator = $container->getDefinition('thelia.translator');
- foreach ($container->findTaggedServiceIds('translation.loader') as $id => $attributes) {
+ foreach($container->findTaggedServiceIds('translation.loader') as $id => $attributes) {
$translator->addMethodCall('addLoader', array($attributes[0]['alias'], new Reference($id)));
if (isset($attributes[0]['legacy-alias'])) {
$translator->addMethodCall('addLoader', array($attributes[0]['legacy-alias'], new Reference($id)));
}
}
}
-}
+}
\ No newline at end of file
diff --git a/core/lib/Thelia/Core/Event/Administrator/AdministratorUpdatePasswordEvent.php b/core/lib/Thelia/Core/Event/Administrator/AdministratorUpdatePasswordEvent.php
index 8cfe1ee02..f155a9dce 100644
--- a/core/lib/Thelia/Core/Event/Administrator/AdministratorUpdatePasswordEvent.php
+++ b/core/lib/Thelia/Core/Event/Administrator/AdministratorUpdatePasswordEvent.php
@@ -25,6 +25,7 @@ namespace Thelia\Core\Event\Administrator;
use Thelia\Core\Event\ActionEvent;
use Thelia\Model\Admin;
+
/**
* Class AdministratorUpdatePasswordEvent
* @package Thelia\Core\Event\Administrator
@@ -81,3 +82,4 @@ class AdministratorUpdatePasswordEvent extends ActionEvent
}
}
+
diff --git a/core/lib/Thelia/Core/Event/Customer/CustomerCreateOrUpdateEvent.php b/core/lib/Thelia/Core/Event/Customer/CustomerCreateOrUpdateEvent.php
index f35430c36..2c45942f3 100755
--- a/core/lib/Thelia/Core/Event/Customer/CustomerCreateOrUpdateEvent.php
+++ b/core/lib/Thelia/Core/Event/Customer/CustomerCreateOrUpdateEvent.php
@@ -23,6 +23,7 @@
namespace Thelia\Core\Event\Customer;
use Symfony\Component\EventDispatcher\Event;
+use Thelia\Core\Event\ActionEvent;
use Thelia\Model\Customer;
/**
diff --git a/core/lib/Thelia/Core/Event/Customer/CustomerLoginEvent.php b/core/lib/Thelia/Core/Event/Customer/CustomerLoginEvent.php
index 943eb5b64..0a046177e 100755
--- a/core/lib/Thelia/Core/Event/Customer/CustomerLoginEvent.php
+++ b/core/lib/Thelia/Core/Event/Customer/CustomerLoginEvent.php
@@ -23,6 +23,7 @@
namespace Thelia\Core\Event\Customer;
+use Thelia\Core\Event\ActionEvent;
use Thelia\Model\Customer;
class CustomerLoginEvent extends CustomerEvent
diff --git a/core/lib/Thelia/Core/Event/Message/MessageUpdateEvent.php b/core/lib/Thelia/Core/Event/Message/MessageUpdateEvent.php
index b1446bfce..6630b7c13 100644
--- a/core/lib/Thelia/Core/Event/Message/MessageUpdateEvent.php
+++ b/core/lib/Thelia/Core/Event/Message/MessageUpdateEvent.php
@@ -138,4 +138,4 @@ class MessageUpdateEvent extends MessageCreateEvent
return $this;
}
-}
+}
\ No newline at end of file
diff --git a/core/lib/Thelia/Core/Event/Product/ProductCombinationGenerationEvent.php b/core/lib/Thelia/Core/Event/Product/ProductCombinationGenerationEvent.php
index ba0fccb68..05b55d733 100644
--- a/core/lib/Thelia/Core/Event/Product/ProductCombinationGenerationEvent.php
+++ b/core/lib/Thelia/Core/Event/Product/ProductCombinationGenerationEvent.php
@@ -65,7 +65,6 @@ class ProductCombinationGenerationEvent extends ProductEvent
public function setReference($reference)
{
$this->reference = $reference;
-
return $this;
}
@@ -77,7 +76,6 @@ class ProductCombinationGenerationEvent extends ProductEvent
public function setPrice($price)
{
$this->price = $price;
-
return $this;
}
@@ -89,7 +87,6 @@ class ProductCombinationGenerationEvent extends ProductEvent
public function setWeight($weight)
{
$this->weight = $weight;
-
return $this;
}
@@ -101,7 +98,6 @@ class ProductCombinationGenerationEvent extends ProductEvent
public function setQuantity($quantity)
{
$this->quantity = $quantity;
-
return $this;
}
@@ -113,7 +109,6 @@ class ProductCombinationGenerationEvent extends ProductEvent
public function setSalePrice($sale_price)
{
$this->sale_price = $sale_price;
-
return $this;
}
@@ -125,7 +120,6 @@ class ProductCombinationGenerationEvent extends ProductEvent
public function setOnsale($onsale)
{
$this->onsale = $onsale;
-
return $this;
}
@@ -137,7 +131,6 @@ class ProductCombinationGenerationEvent extends ProductEvent
public function setIsnew($isnew)
{
$this->isnew = $isnew;
-
return $this;
}
@@ -149,7 +142,6 @@ class ProductCombinationGenerationEvent extends ProductEvent
public function setEanCode($ean_code)
{
$this->ean_code = $ean_code;
-
return $this;
return $this;
}
@@ -162,7 +154,6 @@ class ProductCombinationGenerationEvent extends ProductEvent
public function setCombinations($combinations)
{
$this->combinations = $combinations;
-
return $this;
}
-}
+}
\ No newline at end of file
diff --git a/core/lib/Thelia/Core/Event/Product/ProductSetTemplateEvent.php b/core/lib/Thelia/Core/Event/Product/ProductSetTemplateEvent.php
index 0e95abfba..af28ca73f 100644
--- a/core/lib/Thelia/Core/Event/Product/ProductSetTemplateEvent.php
+++ b/core/lib/Thelia/Core/Event/Product/ProductSetTemplateEvent.php
@@ -60,4 +60,4 @@ class ProductSetTemplateEvent extends ProductEvent
return $this;
}
-}
+}
\ No newline at end of file
diff --git a/core/lib/Thelia/Core/Event/ProductSaleElement/ProductSaleElementDeleteEvent.php b/core/lib/Thelia/Core/Event/ProductSaleElement/ProductSaleElementDeleteEvent.php
index 8f94b254b..811b02fca 100644
--- a/core/lib/Thelia/Core/Event/ProductSaleElement/ProductSaleElementDeleteEvent.php
+++ b/core/lib/Thelia/Core/Event/ProductSaleElement/ProductSaleElementDeleteEvent.php
@@ -22,6 +22,7 @@
/*************************************************************************************/
namespace Thelia\Core\Event\ProductSaleElement;
+use Thelia\Model\Product;
class ProductSaleElementDeleteEvent extends ProductSaleElementEvent
{
diff --git a/core/lib/Thelia/Core/Event/TheliaEvents.php b/core/lib/Thelia/Core/Event/TheliaEvents.php
index 69c05cf6d..b761cf775 100755
--- a/core/lib/Thelia/Core/Event/TheliaEvents.php
+++ b/core/lib/Thelia/Core/Event/TheliaEvents.php
@@ -370,7 +370,6 @@ final class TheliaEvents
*/
const ORDER_SET_DELIVERY_ADDRESS = "action.order.setDeliveryAddress";
const ORDER_SET_DELIVERY_MODULE = "action.order.setDeliveryModule";
- const ORDER_SET_POSTAGE = "action.order.setPostage";
const ORDER_SET_INVOICE_ADDRESS = "action.order.setInvoiceAddress";
const ORDER_SET_PAYMENT_MODULE = "action.order.setPaymentModule";
const ORDER_PAY = "action.order.pay";
diff --git a/core/lib/Thelia/Core/Event/UpdateSeoEvent.php b/core/lib/Thelia/Core/Event/UpdateSeoEvent.php
index cb287b869..caf46c1aa 100644
--- a/core/lib/Thelia/Core/Event/UpdateSeoEvent.php
+++ b/core/lib/Thelia/Core/Event/UpdateSeoEvent.php
@@ -184,4 +184,5 @@ class UpdateSeoEvent extends ActionEvent
return $this->object;
}
+
}
diff --git a/core/lib/Thelia/Core/EventListener/ViewListener.php b/core/lib/Thelia/Core/EventListener/ViewListener.php
index 1975eba45..e3eaa9577 100755
--- a/core/lib/Thelia/Core/EventListener/ViewListener.php
+++ b/core/lib/Thelia/Core/EventListener/ViewListener.php
@@ -30,10 +30,12 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpFoundation\Request;
use Thelia\Core\HttpFoundation\Response;
use Symfony\Component\Routing\Router;
+use Thelia\Core\HttpKernel\Exception\NotFountHttpException;
use Thelia\Core\Template\Exception\ResourceNotFoundException;
use Thelia\Core\Template\ParserInterface;
use Thelia\Core\Template\TemplateHelper;
use Thelia\Exception\OrderException;
+use Thelia\Model\ConfigQuery;
use Thelia\Tools\Redirect;
use Thelia\Tools\URL;
use Thelia\Core\Security\Exception\AuthenticationException;
diff --git a/core/lib/Thelia/Core/HttpFoundation/Response.php b/core/lib/Thelia/Core/HttpFoundation/Response.php
index e279215b8..277c16cc2 100644
--- a/core/lib/Thelia/Core/HttpFoundation/Response.php
+++ b/core/lib/Thelia/Core/HttpFoundation/Response.php
@@ -39,8 +39,8 @@ class Response extends BaseResponse
*
* @see \Thelia\Core\HttpFoundation\Response::sendContent()
*/
- public function sendContent()
- {
+ public function sendContent() {
+
Tlog::getInstance()->write($this->content);
parent::sendContent();
diff --git a/core/lib/Thelia/Core/HttpKernel/HttpCache/HttpCache.php b/core/lib/Thelia/Core/HttpKernel/HttpCache/HttpCache.php
index aceb6235f..b45f0f812 100644
--- a/core/lib/Thelia/Core/HttpKernel/HttpCache/HttpCache.php
+++ b/core/lib/Thelia/Core/HttpKernel/HttpCache/HttpCache.php
@@ -65,8 +65,7 @@ class HttpCache extends BaseHttpCache implements HttpKernelInterface
$request->getContent()
);
}
-
return parent::handle($request, $type, $catch);
}
-}
+}
\ No newline at end of file
diff --git a/core/lib/Thelia/Core/Security/SecurityContext.php b/core/lib/Thelia/Core/Security/SecurityContext.php
index 8512fac0e..e97a19877 100755
--- a/core/lib/Thelia/Core/Security/SecurityContext.php
+++ b/core/lib/Thelia/Core/Security/SecurityContext.php
@@ -177,7 +177,7 @@ class SecurityContext
continue;
}
- if (!array_key_exists('module', $userPermissions)) {
+ if(!array_key_exists('module', $userPermissions)) {
return false;
}
diff --git a/core/lib/Thelia/Core/Template/Assets/AssetManagerInterface.php b/core/lib/Thelia/Core/Template/Assets/AssetManagerInterface.php
index 6b947b3fb..205ce59ee 100644
--- a/core/lib/Thelia/Core/Template/Assets/AssetManagerInterface.php
+++ b/core/lib/Thelia/Core/Template/Assets/AssetManagerInterface.php
@@ -23,12 +23,10 @@
namespace Thelia\Core\Template\Assets;
-interface AssetManagerInterface
-{
+interface AssetManagerInterface {
/**
* Prepare an asset directory.
*
-<<<<<<< HEAD
* @param $sourceAssetsDirectory
* @param $webAssetsDirectoryBase
* @param $webAssetsTemplate
@@ -38,18 +36,12 @@ interface AssetManagerInterface
* @internal param string $source_assets_directory the full path to the source asstes directory
* @internal param string $web_assets_directory_base the base directory of the web based asset directory
* @internal param string $key the assets key : module name or 0 for base template
-=======
- * @param string $source_assets_directory the full path to the source asstes directory
- * @param string $web_assets_directory_base the base directory of the web based asset directory
- * @throws \RuntimeException if something goes wrong.
->>>>>>> cleanmaster
*/
public function prepareAssets($sourceAssetsDirectory, $webAssetsDirectoryBase, $webAssetsTemplate, $webAssetsKey);
/**
* Generates assets from $asset_path in $output_path, using $filters.
*
-<<<<<<< HEAD
* @param $assetSource
* @param $assetDirectoryBase
* @param $webAssetsDirectoryBase
@@ -65,25 +57,9 @@ interface AssetManagerInterface
*
* @internal param string $web_assets_directory_base the full disk path to the base assets output directory in the web space
* @internal param string $output_url the URL to the base assets output directory in the web space
-=======
- * @param string $asset_path the full path to the asset file (or file collection, e.g. *.less)
- *
- * @param string $web_assets_directory_base the full disk path to the base assets output directory in the web space
- * @param string $output_url the URL to the base assets output directory in the web space
- *
- * @param string $asset_type the asset type: css, js, ... The generated files will have this extension. Pass an empty string to use the asset source extension.
- * @param array $filters a list of filters, as defined below (see switch($filter_name) ...)
- *
- * @param boolean $debug the debug mode, true or false
->>>>>>> cleanmaster
*
* @internal param string $asset_type the asset type: css, js, ... The generated files will have this extension. Pass an empty string to use the asset source extension.
* @return string The URL to the generated asset file.
*/
-<<<<<<< HEAD
public function processAsset($assetSource, $assetDirectoryBase, $webAssetsDirectoryBase, $webAssetsTemplate, $webAssetsKey, $outputUrl, $assetType, $filters, $debug);
-}
-=======
- public function processAsset($asset_path, $web_assets_directory_base, $output_url, $asset_type, $filters, $debug);
-}
->>>>>>> cleanmaster
+}
\ No newline at end of file
diff --git a/core/lib/Thelia/Core/Template/Assets/AsseticAssetManager.php b/core/lib/Thelia/Core/Template/Assets/AsseticAssetManager.php
index 93130d5dd..ae210eee8 100755
--- a/core/lib/Thelia/Core/Template/Assets/AsseticAssetManager.php
+++ b/core/lib/Thelia/Core/Template/Assets/AsseticAssetManager.php
@@ -51,7 +51,7 @@ class AsseticAssetManager implements AssetManagerInterface
/**
* Create a stamp form the modification time of the content of the given directory and all of its subdirectories
*
- * @param string $directory ther directory name
+ * @param string $directory ther directory name
* @return string the stamp of this directory
*/
protected function getStamp($directory)
@@ -76,8 +76,7 @@ class AsseticAssetManager implements AssetManagerInterface
*
* @return bool
*/
- protected function isSourceFile(\SplFileInfo $fileInfo)
- {
+ protected function isSourceFile(\SplFileInfo $fileInfo) {
return in_array($fileInfo->getExtension(), $this->source_file_extensions);
}
@@ -85,14 +84,9 @@ class AsseticAssetManager implements AssetManagerInterface
* Recursively copy assets from the source directory to the destination
* directory in the web space, omitting source files.
*
-<<<<<<< HEAD
* @param Filesystem $fs
* @param string $from_directory the source
* @param string $to_directory the destination
-=======
- * @param string $from_directory the source
- * @param string $to_directory the destination
->>>>>>> cleanmaster
* @throws \RuntimeException if a problem occurs.
*/
protected function copyAssets(Filesystem $fs, $from_directory, $to_directory)
@@ -130,7 +124,6 @@ class AsseticAssetManager implements AssetManagerInterface
}
/**
-<<<<<<< HEAD
* Compute the destination directory path, from the source directory and the
* base directory of the web assets
*
@@ -140,34 +133,6 @@ class AsseticAssetManager implements AssetManagerInterface
*
* @internal param string $source_assets_directory the source directory
* @return the full path of the destination directory
-=======
- * Compite the assets path relative to the base template directory
- *
- * @param string $source_assets_directory the source directory
- * @param string $web_assets_directory_base base directory of the web assets
- * @return the full path of the destination directory
- */
- protected function getRelativeDirectoryPath($source_assets_directory, $web_assets_directory_base)
- {
- $source_assets_directory = realpath($source_assets_directory);
-
- // Remove base path from asset source path to get a path relative to the template base
- // and use it to create the destination path.
- return str_replace(
- realpath(THELIA_ROOT),
- '',
- $source_assets_directory
- );
- }
-
- /**
- * Compute the destination directory path, from the source directory and the
- * base directory of the web assets
- *
- * @param string $source_assets_directory the source directory
- * @param string $web_assets_directory_base base directory of the web assets
- * @return the full path of the destination directory
->>>>>>> cleanmaster
*/
protected function getDestinationDirectory($webAssetsDirectoryBase, $webAssetsTemplate, $webAssetsKey)
{
@@ -180,7 +145,6 @@ class AsseticAssetManager implements AssetManagerInterface
* the source directory. If any change is detected, the whole asset directory
* is copied in the web space.
*
-<<<<<<< HEAD
* @param string $sourceAssetsDirectory the full path to the source asstes directory
* @param string $webAssetsDirectoryBase the base directory of the web based asset directory
* @param $webAssetsTemplate
@@ -190,14 +154,6 @@ class AsseticAssetManager implements AssetManagerInterface
*/
public function prepareAssets($sourceAssetsDirectory, $webAssetsDirectoryBase, $webAssetsTemplate, $webAssetsKey) {
-=======
- * @param string $source_assets_directory the full path to the source asstes directory
- * @param string $web_assets_directory_base the base directory of the web based asset directory
- * @throws \RuntimeException if something goes wrong.
- */
- public function prepareAssets($source_assets_directory, $web_assets_directory_base)
- {
->>>>>>> cleanmaster
// Compute the absolute path of the output directory
$to_directory = $this->getDestinationDirectory($webAssetsDirectoryBase, $webAssetsTemplate, $webAssetsKey);
@@ -249,7 +205,8 @@ class AsseticAssetManager implements AssetManagerInterface
throw new \RuntimeException(
"Failed to create asset stamp file $stamp_file_path. Please check that your web server has the proper access rights to do that.");
}
-/* } else {
+/* }
+ else {
@fclose($fp);
}
*/
@@ -259,13 +216,13 @@ class AsseticAssetManager implements AssetManagerInterface
/**
* Decode the filters names, and initialize the Assetic FilterManager
*
- * @param FilterManager $filterManager the Assetic filter manager
- * @param string $filters a comma separated list of filter names
+ * @param FilterManager $filterManager the Assetic filter manager
+ * @param string $filters a comma separated list of filter names
* @throws \InvalidArgumentException if a wrong filter is passed
- * @return an array of filter names
+ * @return an array of filter names
*/
- protected function decodeAsseticFilters(FilterManager $filterManager, $filters)
- {
+ protected function decodeAsseticFilters(FilterManager $filterManager, $filters) {
+
if (!empty($filters)) {
$filter_list = explode(',', $filters);
@@ -304,7 +261,8 @@ class AsseticAssetManager implements AssetManagerInterface
break;
}
}
- } else {
+ }
+ else {
$filter_list = array();
}
@@ -314,7 +272,6 @@ class AsseticAssetManager implements AssetManagerInterface
/**
* Generates assets from $asset_path in $output_path, using $filters.
*
-<<<<<<< HEAD
* @param $assetSource
* @param $assetDirectoryBase
* @param string $webAssetsDirectoryBase the full path to the asset file (or file collection, e.g. *.less)
@@ -328,18 +285,6 @@ class AsseticAssetManager implements AssetManagerInterface
*
* @param boolean $debug true / false
*
-=======
- * @param string $asset_path the full path to the asset file (or file collection, e.g. *.less)
- *
- * @param string $web_assets_directory_base the full disk path to the base assets output directory in the web space
- * @param string $output_url the URL to the base assets output directory in the web space
- *
- * @param string $asset_type the asset type: css, js, ... The generated files will have this extension. Pass an empty string to use the asset source extension.
- * @param array $filters a list of filters, as defined below (see switch($filter_name) ...)
- *
- * @param boolean $debug true / false
- * @throws \InvalidArgumentException if an invalid filter name is found
->>>>>>> cleanmaster
* @return string The URL to the generated asset file.
*/
public function processAsset($assetSource, $assetDirectoryBase, $webAssetsDirectoryBase, $webAssetsTemplate, $webAssetsKey, $outputUrl, $assetType, $filters, $debug)
@@ -396,4 +341,4 @@ class AsseticAssetManager implements AssetManagerInterface
return rtrim($outputUrl, '/') . '/' . trim($outputRelativeWebPath, '/') . '/' . trim($assetFileDirectoryInAssetDirectory, '/') . '/' . ltrim($assetTargetFilename, '/');
}
-}
+}
\ No newline at end of file
diff --git a/core/lib/Thelia/Core/Template/Element/BaseLoop.php b/core/lib/Thelia/Core/Template/Element/BaseLoop.php
index db61c20c1..6d4e6ed92 100755
--- a/core/lib/Thelia/Core/Template/Element/BaseLoop.php
+++ b/core/lib/Thelia/Core/Template/Element/BaseLoop.php
@@ -277,6 +277,7 @@ abstract class BaseLoop
}
}
+
protected function searchArray(array $search, &$pagination = null)
{
if (false === $this->countable) {
@@ -285,7 +286,7 @@ abstract class BaseLoop
if ($this->getArgValue('page') !== null) {
$nbPage = ceil(count($search)/$this->getArgValue('limit'));
- if ($this->getArgValue('page') > $nbPage || $this->getArgValue('page') <= 0) {
+ if($this->getArgValue('page') > $nbPage || $this->getArgValue('page') <= 0) {
return array();
}
@@ -337,9 +338,9 @@ abstract class BaseLoop
*/
public function exec(&$pagination)
{
- if ($this instanceof PropelSearchLoopInterface) {
+ if($this instanceof PropelSearchLoopInterface) {
$searchModelCriteria = $this->buildModelCriteria();
- if (null === $searchModelCriteria) {
+ if(null === $searchModelCriteria) {
$results = array();
} else {
$results = $this->search(
@@ -349,7 +350,7 @@ abstract class BaseLoop
}
} elseif ($this instanceof ArraySearchLoopInterface) {
$searchArray = $this->buildArray();
- if (null === $searchArray) {
+ if(null === $searchArray) {
$results = array();
} else {
$results = $this->searchArray(
@@ -361,13 +362,13 @@ abstract class BaseLoop
$loopResult = new LoopResult($results);
- if (true === $this->countable) {
+ if(true === $this->countable) {
$loopResult->setCountable();
}
- if (true === $this->timestampable) {
+ if(true === $this->timestampable) {
$loopResult->setTimestamped();
}
- if (true === $this->versionable) {
+ if(true === $this->versionable) {
$loopResult->setVersioned();
}
@@ -381,29 +382,29 @@ abstract class BaseLoop
* - ArraySearchLoopInterface
*/
$searchInterface = false;
- if ($this instanceof PropelSearchLoopInterface) {
- if (true === $searchInterface) {
+ if($this instanceof PropelSearchLoopInterface) {
+ if(true === $searchInterface) {
throw new LoopException('Loop cannot implements multiple Search Interfaces : `PropelSearchLoopInterface`, `ArraySearchLoopInterface`', LoopException::MULTIPLE_SEARCH_INTERFACE);
}
$searchInterface = true;
}
- if ($this instanceof ArraySearchLoopInterface) {
- if (true === $searchInterface) {
+ if($this instanceof ArraySearchLoopInterface) {
+ if(true === $searchInterface) {
throw new LoopException('Loop cannot implements multiple Search Interfaces : `PropelSearchLoopInterface`, `ArraySearchLoopInterface`', LoopException::MULTIPLE_SEARCH_INTERFACE);
}
$searchInterface = true;
}
- if (false === $searchInterface) {
+ if(false === $searchInterface) {
throw new LoopException('Loop must implements one of the following interfaces : `PropelSearchLoopInterface`, `ArraySearchLoopInterface`', LoopException::SEARCH_INTERFACE_NOT_FOUND);
}
/* Only PropelSearch allows timestamp and version */
- if (!$this instanceof PropelSearchLoopInterface) {
- if (true === $this->timestampable) {
+ if(!$this instanceof PropelSearchLoopInterface) {
+ if(true === $this->timestampable) {
throw new LoopException("Loop must implements 'PropelSearchLoopInterface' to be timestampable", LoopException::NOT_TIMESTAMPED);
}
- if (true === $this->versionable) {
+ if(true === $this->versionable) {
throw new LoopException("Loop must implements 'PropelSearchLoopInterface' to be versionable", LoopException::NOT_VERSIONED);
}
}
diff --git a/core/lib/Thelia/Core/Template/Loop/Admin.php b/core/lib/Thelia/Core/Template/Loop/Admin.php
index d9c49ef80..ef5ce7e1f 100755
--- a/core/lib/Thelia/Core/Template/Loop/Admin.php
+++ b/core/lib/Thelia/Core/Template/Loop/Admin.php
@@ -33,6 +33,7 @@ use Thelia\Core\Template\Loop\Argument\ArgumentCollection;
use Thelia\Core\Template\Loop\Argument\Argument;
use Thelia\Model\AdminQuery;
+use Thelia\Type;
/**
*
diff --git a/core/lib/Thelia/Core/Template/Loop/AssociatedContent.php b/core/lib/Thelia/Core/Template/Loop/AssociatedContent.php
index 4ae41c3b6..9411b1dbd 100755
--- a/core/lib/Thelia/Core/Template/Loop/AssociatedContent.php
+++ b/core/lib/Thelia/Core/Template/Loop/AssociatedContent.php
@@ -48,7 +48,7 @@ class AssociatedContent extends Content
{
protected $contentId;
protected $contentPosition;
-
+
/**
* @return ArgumentCollection
*/
diff --git a/core/lib/Thelia/Core/Template/Loop/Auth.php b/core/lib/Thelia/Core/Template/Loop/Auth.php
index 0cb7a5e88..072193f34 100755
--- a/core/lib/Thelia/Core/Template/Loop/Auth.php
+++ b/core/lib/Thelia/Core/Template/Loop/Auth.php
@@ -88,7 +88,7 @@ class Auth extends BaseLoop implements ArraySearchLoopInterface
$module = $this->getModule();
$access = $this->getAccess();
- if (null !== $module) {
+ if(null !== $module) {
$in = true;
}
diff --git a/core/lib/Thelia/Core/Template/Loop/BaseSpecificModule.php b/core/lib/Thelia/Core/Template/Loop/BaseSpecificModule.php
index ae7226152..c1bc483f9 100644
--- a/core/lib/Thelia/Core/Template/Loop/BaseSpecificModule.php
+++ b/core/lib/Thelia/Core/Template/Loop/BaseSpecificModule.php
@@ -24,6 +24,7 @@
namespace Thelia\Core\Template\Loop;
use Propel\Runtime\ActiveQuery\Criteria;
use Thelia\Core\Template\Element\BaseI18nLoop;
+use Thelia\Core\Template\Element\LoopResult;
use Thelia\Core\Template\Element\PropelSearchLoopInterface;
use Thelia\Core\Template\Loop\Argument\Argument;
use Thelia\Core\Template\Loop\Argument\ArgumentCollection;
diff --git a/core/lib/Thelia/Core/Template/Loop/Cart.php b/core/lib/Thelia/Core/Template/Loop/Cart.php
index 32c6d9ff2..88b5a53d4 100755
--- a/core/lib/Thelia/Core/Template/Loop/Cart.php
+++ b/core/lib/Thelia/Core/Template/Loop/Cart.php
@@ -58,7 +58,7 @@ class Cart extends BaseLoop implements ArraySearchLoopInterface
{
$cart = $this->getCart($this->request);
- if (null === $cart) {
+ if(null === $cart) {
return array();
}
@@ -81,7 +81,7 @@ class Cart extends BaseLoop implements ArraySearchLoopInterface
{
$taxCountry = TaxEngine::getInstance($this->request->getSession())->getDeliveryCountry();
- foreach ($loopResult->getResultDataCollection() as $cartItem) {
+ foreach($loopResult->getResultDataCollection() as $cartItem) {
$product = $cartItem->getProduct();
$productSaleElement = $cartItem->getProductSaleElements();
diff --git a/core/lib/Thelia/Core/Template/Loop/CategoryPath.php b/core/lib/Thelia/Core/Template/Loop/CategoryPath.php
index d70654d0b..1b7f68f22 100755
--- a/core/lib/Thelia/Core/Template/Loop/CategoryPath.php
+++ b/core/lib/Thelia/Core/Template/Loop/CategoryPath.php
@@ -125,9 +125,9 @@ class CategoryPath extends BaseI18nLoop implements ArraySearchLoopInterface
public function parseResults(LoopResult $loopResult)
{
- foreach ($loopResult->getResultDataCollection() as $result) {
+ foreach($loopResult->getResultDataCollection() as $result) {
$loopResultRow = new LoopResultRow($result);
- foreach ($result as $output => $outputValue) {
+ foreach($result as $output => $outputValue) {
$loopResultRow->set($output, $outputValue);
}
$loopResult->addRow($loopResultRow);
diff --git a/core/lib/Thelia/Core/Template/Loop/CategoryTree.php b/core/lib/Thelia/Core/Template/Loop/CategoryTree.php
index 35a9569f9..3c3c3ffe0 100755
--- a/core/lib/Thelia/Core/Template/Loop/CategoryTree.php
+++ b/core/lib/Thelia/Core/Template/Loop/CategoryTree.php
@@ -99,9 +99,9 @@ class CategoryTree extends BaseI18nLoop implements ArraySearchLoopInterface
public function parseResults(LoopResult $loopResult)
{
- foreach ($loopResult->getResultDataCollection() as $result) {
+ foreach($loopResult->getResultDataCollection() as $result) {
$loopResultRow = new LoopResultRow($result);
- foreach ($result as $output => $outputValue) {
+ foreach($result as $output => $outputValue) {
$loopResultRow->set($output, $outputValue);
}
$loopResult->addRow($loopResultRow);
diff --git a/core/lib/Thelia/Core/Template/Loop/Coupon.php b/core/lib/Thelia/Core/Template/Loop/Coupon.php
index 622a3a18c..e211103da 100755
--- a/core/lib/Thelia/Core/Template/Loop/Coupon.php
+++ b/core/lib/Thelia/Core/Template/Loop/Coupon.php
@@ -24,6 +24,7 @@
namespace Thelia\Core\Template\Loop;
use Propel\Runtime\ActiveQuery\Criteria;
+use Propel\Runtime\Util\PropelModelPager;
use Thelia\Condition\ConditionFactory;
use Thelia\Condition\Implementation\ConditionInterface;
use Thelia\Core\HttpFoundation\Request;
diff --git a/core/lib/Thelia/Core/Template/Loop/Currency.php b/core/lib/Thelia/Core/Template/Loop/Currency.php
index 3d7a5631e..82aebeb32 100755
--- a/core/lib/Thelia/Core/Template/Loop/Currency.php
+++ b/core/lib/Thelia/Core/Template/Loop/Currency.php
@@ -158,7 +158,6 @@ class Currency extends BaseI18nLoop implements PropelSearchLoopInterface
}
/* perform search */
-
return $search;
}
diff --git a/core/lib/Thelia/Core/Template/Loop/Customer.php b/core/lib/Thelia/Core/Template/Loop/Customer.php
index d4b8effb0..f955cd217 100755
--- a/core/lib/Thelia/Core/Template/Loop/Customer.php
+++ b/core/lib/Thelia/Core/Template/Loop/Customer.php
@@ -36,6 +36,9 @@ use Thelia\Core\Template\Loop\Argument\Argument;
use Thelia\Model\CustomerQuery;
use Thelia\Type\TypeCollection;
use Thelia\Type;
+use Thelia\Model\OrderQuery;
+use Thelia\Model\Map\OrderAddressTableMap;
+use Thelia\Model\Map\OrderTableMap;
/**
*
@@ -205,6 +208,7 @@ class Customer extends BaseLoop implements SearchLoopInterface, PropelSearchLoop
$search->orderByCreatedAt(Criteria::DESC);
break;
+
}
}
diff --git a/core/lib/Thelia/Core/Template/Loop/Delivery.php b/core/lib/Thelia/Core/Template/Loop/Delivery.php
index 93c73bb17..f671f1ca9 100644
--- a/core/lib/Thelia/Core/Template/Loop/Delivery.php
+++ b/core/lib/Thelia/Core/Template/Loop/Delivery.php
@@ -74,8 +74,8 @@ class Delivery extends BaseSpecificModule
try {
$postage = $moduleInstance->getPostage($country);
- } catch (OrderException $e) {
- switch ($e->getCode()) {
+ } catch(OrderException $e) {
+ switch($e->getCode()) {
case OrderException::DELIVERY_MODULE_UNAVAILABLE:
/* do not show this delivery module */
continue(2);
diff --git a/core/lib/Thelia/Core/Template/Loop/Folder.php b/core/lib/Thelia/Core/Template/Loop/Folder.php
index fa561b3fb..84dee9f82 100755
--- a/core/lib/Thelia/Core/Template/Loop/Folder.php
+++ b/core/lib/Thelia/Core/Template/Loop/Folder.php
@@ -126,6 +126,7 @@ class Folder extends BaseI18nLoop implements PropelSearchLoopInterface
if ($visible !== BooleanOrBothType::ANY) $search->filterByVisible($visible ? 1 : 0);
+
$orders = $this->getOrder();
foreach ($orders as $order) {
diff --git a/core/lib/Thelia/Core/Template/Loop/FolderPath.php b/core/lib/Thelia/Core/Template/Loop/FolderPath.php
index b50d7c55d..92c42f890 100644
--- a/core/lib/Thelia/Core/Template/Loop/FolderPath.php
+++ b/core/lib/Thelia/Core/Template/Loop/FolderPath.php
@@ -135,9 +135,9 @@ class FolderPath extends BaseI18nLoop implements ArraySearchLoopInterface
public function parseResults(LoopResult $loopResult)
{
- foreach ($loopResult->getResultDataCollection() as $result) {
+ foreach($loopResult->getResultDataCollection() as $result) {
$loopResultRow = new LoopResultRow($result);
- foreach ($result as $output => $outputValue) {
+ foreach($result as $output => $outputValue) {
$loopResultRow->set($output, $outputValue);
}
$loopResult->addRow($loopResultRow);
diff --git a/core/lib/Thelia/Core/Template/Loop/FolderTree.php b/core/lib/Thelia/Core/Template/Loop/FolderTree.php
index 851b6d8ff..9598f7a5c 100644
--- a/core/lib/Thelia/Core/Template/Loop/FolderTree.php
+++ b/core/lib/Thelia/Core/Template/Loop/FolderTree.php
@@ -100,9 +100,9 @@ class FolderTree extends BaseI18nLoop implements ArraySearchLoopInterface
public function parseResults(LoopResult $loopResult)
{
- foreach ($loopResult->getResultDataCollection() as $result) {
+ foreach($loopResult->getResultDataCollection() as $result) {
$loopResultRow = new LoopResultRow($result);
- foreach ($result as $output => $outputValue) {
+ foreach($result as $output => $outputValue) {
$loopResultRow->set($output, $outputValue);
}
$loopResult->addRow($loopResultRow);
diff --git a/core/lib/Thelia/Core/Template/Loop/Image.php b/core/lib/Thelia/Core/Template/Loop/Image.php
index def24ae2a..b207deb29 100755
--- a/core/lib/Thelia/Core/Template/Loop/Image.php
+++ b/core/lib/Thelia/Core/Template/Loop/Image.php
@@ -236,6 +236,7 @@ class Image extends BaseI18nLoop implements PropelSearchLoopInterface
$search->filterById($exclude, Criteria::NOT_IN);
// echo "sql=".$search->toString();
+
return $search;
}
diff --git a/core/lib/Thelia/Core/Template/Loop/Module.php b/core/lib/Thelia/Core/Template/Loop/Module.php
index c3f544382..db947f730 100755
--- a/core/lib/Thelia/Core/Template/Loop/Module.php
+++ b/core/lib/Thelia/Core/Template/Loop/Module.php
@@ -196,19 +196,19 @@ class Module extends BaseI18nLoop implements PropelSearchLoopInterface
/* first test if module defines it's own config route */
$routerId = "router." . $module->getBaseDir();
- if ($this->container->has($routerId)) {
+ if($this->container->has($routerId)) {
try {
- if ($this->container->get($routerId)->match('/admin/module/' . $module->getCode())) {
+ if($this->container->get($routerId)->match('/admin/module/' . $module->getCode())) {
$hasConfigurationInterface = true;
}
- } catch (ResourceNotFoundException $e) {
+ } catch(ResourceNotFoundException $e) {
/* $hasConfigurationInterface stays false */
}
}
/* if not ; test if it uses admin inclusion : module_configuration.html */
- if (false === $hasConfigurationInterface) {
- if (file_exists( sprintf("%s/AdminIncludes/%s.html", $module->getAbsoluteBaseDir(), "module_configuration"))) {
+ if(false === $hasConfigurationInterface) {
+ if(file_exists( sprintf("%s/AdminIncludes/%s.html", $module->getAbsoluteBaseDir(), "module_configuration"))) {
$hasConfigurationInterface = true;
}
}
diff --git a/core/lib/Thelia/Core/Template/Loop/Order.php b/core/lib/Thelia/Core/Template/Loop/Order.php
index 3fb04d60c..5f12fa1eb 100755
--- a/core/lib/Thelia/Core/Template/Loop/Order.php
+++ b/core/lib/Thelia/Core/Template/Loop/Order.php
@@ -46,7 +46,7 @@ use Thelia\Type;
*/
class Order extends BaseLoop implements SearchLoopInterface, PropelSearchLoopInterface
{
- protected $countable = true;
+ protected $countable = true;
protected $timestampable = true;
protected $versionable = false;
@@ -175,6 +175,7 @@ class Order extends BaseLoop implements SearchLoopInterface, PropelSearchLoopInt
}
return $search;
+
}
public function parseResults(LoopResult $loopResult)
@@ -201,7 +202,6 @@ class Order extends BaseLoop implements SearchLoopInterface, PropelSearchLoopInt
->set("STATUS", $order->getStatusId())
->set("LANG", $order->getLangId())
->set("POSTAGE", $order->getPostage())
- ->set("DISCOUNT", $order->getDiscount())
->set("TOTAL_TAX", $tax)
->set("TOTAL_AMOUNT", $amount - $tax)
->set("TOTAL_TAXED_AMOUNT", $amount)
diff --git a/core/lib/Thelia/Core/Template/Loop/OrderCoupon.php b/core/lib/Thelia/Core/Template/Loop/OrderCoupon.php
deleted file mode 100755
index 80e24c487..000000000
--- a/core/lib/Thelia/Core/Template/Loop/OrderCoupon.php
+++ /dev/null
@@ -1,116 +0,0 @@
-. */
-/* */
-/**********************************************************************************/
-
-namespace Thelia\Core\Template\Loop;
-
-use Propel\Runtime\ActiveQuery\Criteria;
-use Thelia\Condition\ConditionFactory;
-use Thelia\Condition\Implementation\ConditionInterface;
-use Thelia\Core\HttpFoundation\Request;
-use Thelia\Core\Template\Element\BaseLoop;
-use Thelia\Core\Template\Element\LoopResult;
-use Thelia\Core\Template\Element\LoopResultRow;
-use Thelia\Core\Template\Element\PropelSearchLoopInterface;
-use Thelia\Core\Template\Loop\Argument\Argument;
-use Thelia\Core\Template\Loop\Argument\ArgumentCollection;
-use Thelia\Model\OrderCouponQuery;
-use Thelia\Model\OrderQuery;
-use Thelia\Type;
-
-/**
- *
- * OrderCoupon loop
- *
- *
- * Class OrderCoupon
- * @package Thelia\Core\Template\Loop
- * @author Etienne Roudeix
- */
-class OrderCoupon extends BaseLoop implements PropelSearchLoopInterface
-{
- /**
- * Define all args used in your loop
- *
- * @return ArgumentCollection
- */
- protected function getArgDefinitions()
- {
- return new ArgumentCollection(
- Argument::createIntTypeArgument('order', null, true)
- );
- }
-
- public function buildModelCriteria()
- {
- $search = OrderCouponQuery::create();
-
- $order = $this->getOrder();
-
- $search->filterByOrderId($order, Criteria::EQUAL);
-
- $search->orderById(Criteria::ASC);
-
- return $search;
-
- }
-
- public function parseResults(LoopResult $loopResult)
- {
- $conditionFactory = $this->container->get('thelia.condition.factory');
-
- /** @var OrderCoupon $orderCoupon */
- foreach ($loopResult->getResultDataCollection() as $orderCoupon) {
- $loopResultRow = new LoopResultRow($orderCoupon);
- $conditions = $conditionFactory->unserializeConditionCollection(
- $orderCoupon->getSerializedConditions()
- );
-
- $now = time();
- $datediff = $orderCoupon->getExpirationDate()->getTimestamp() - $now;
- $daysLeftBeforeExpiration = floor($datediff/(60*60*24));
-
- $cleanedConditions = array();
-
- foreach ($conditions->getConditions() as $condition) {
- $cleanedConditions[] = $condition->getToolTip();
- }
- $loopResultRow->set("ID", $orderCoupon->getId())
- ->set("CODE", $orderCoupon->getCode())
- ->set("TITLE", $orderCoupon->getTitle())
- ->set("SHORT_DESCRIPTION", $orderCoupon->getShortDescription())
- ->set("DESCRIPTION", $orderCoupon->getDescription())
- ->set("EXPIRATION_DATE", $orderCoupon->getExpirationDate( OrderQuery::create()->findPk($this->getOrder())->getLangId() ))
- ->set("USAGE_LEFT", $orderCoupon->getMaxUsage())
- ->set("IS_CUMULATIVE", $orderCoupon->getIsCumulative())
- ->set("IS_REMOVING_POSTAGE", $orderCoupon->getIsRemovingPostage())
- ->set("IS_AVAILABLE_ON_SPECIAL_OFFERS", $orderCoupon->getIsAvailableOnSpecialOffers())
- ->set("AMOUNT", $orderCoupon->getAmount())
- ->set("APPLICATION_CONDITIONS", $cleanedConditions)
- ->set("DAY_LEFT_BEFORE_EXPIRATION", $daysLeftBeforeExpiration)
- ;
- $loopResult->addRow($loopResultRow);
- }
-
- return $loopResult;
- }
-}
diff --git a/core/lib/Thelia/Core/Template/Loop/OrderProduct.php b/core/lib/Thelia/Core/Template/Loop/OrderProduct.php
index 8e201f31c..f36162099 100755
--- a/core/lib/Thelia/Core/Template/Loop/OrderProduct.php
+++ b/core/lib/Thelia/Core/Template/Loop/OrderProduct.php
@@ -72,7 +72,7 @@ class OrderProduct extends BaseLoop implements PropelSearchLoopInterface
$search->orderById(Criteria::ASC);
return $search;
-
+
}
public function parseResults(LoopResult $loopResult)
diff --git a/core/lib/Thelia/Core/Template/Loop/OrderProductAttributeCombination.php b/core/lib/Thelia/Core/Template/Loop/OrderProductAttributeCombination.php
index bb018ec98..f248159c5 100755
--- a/core/lib/Thelia/Core/Template/Loop/OrderProductAttributeCombination.php
+++ b/core/lib/Thelia/Core/Template/Loop/OrderProductAttributeCombination.php
@@ -87,7 +87,7 @@ class OrderProductAttributeCombination extends BaseI18nLoop implements PropelSea
}
return $search;
-
+
}
public function parseResults(LoopResult $loopResult)
diff --git a/core/lib/Thelia/Core/Template/Loop/ProductTemplate.php b/core/lib/Thelia/Core/Template/Loop/ProductTemplate.php
index 4d6491509..ea1d94262 100644
--- a/core/lib/Thelia/Core/Template/Loop/ProductTemplate.php
+++ b/core/lib/Thelia/Core/Template/Loop/ProductTemplate.php
@@ -103,4 +103,4 @@ class ProductTemplate extends BaseI18nLoop implements PropelSearchLoopInterface
return $loopResult;
}
-}
+}
\ No newline at end of file
diff --git a/core/lib/Thelia/Core/Template/Loop/Profile.php b/core/lib/Thelia/Core/Template/Loop/Profile.php
index 8b21d2fe0..bddcf856c 100755
--- a/core/lib/Thelia/Core/Template/Loop/Profile.php
+++ b/core/lib/Thelia/Core/Template/Loop/Profile.php
@@ -33,6 +33,7 @@ use Thelia\Core\Template\Loop\Argument\ArgumentCollection;
use Thelia\Core\Template\Loop\Argument\Argument;
use Thelia\Model\ProfileQuery;
+use Thelia\Type;
/**
*
diff --git a/core/lib/Thelia/Core/Template/Loop/Template.php b/core/lib/Thelia/Core/Template/Loop/Template.php
index f3b4a05f9..7050aa34a 100644
--- a/core/lib/Thelia/Core/Template/Loop/Template.php
+++ b/core/lib/Thelia/Core/Template/Loop/Template.php
@@ -23,12 +23,19 @@
namespace Thelia\Core\Template\Loop;
+use Propel\Runtime\ActiveQuery\Criteria;
+use Thelia\Core\Security\AccessManager;
+use Thelia\Core\Template\Element\BaseI18nLoop;
use Thelia\Core\Template\Element\LoopResult;
use Thelia\Core\Template\Element\LoopResultRow;
+use Thelia\Core\Template\Element\PropelSearchLoopInterface;
use Thelia\Core\Template\Loop\Argument\ArgumentCollection;
use Thelia\Core\Template\Loop\Argument\Argument;
+use Thelia\Model\ModuleQuery;
+
+use Thelia\Module\BaseModule;
use Thelia\Type;
use Thelia\Core\Template\TemplateHelper;
use Thelia\Core\Template\TemplateDefinition;
@@ -65,14 +72,8 @@ class Template extends BaseLoop implements ArraySearchLoopInterface
);
}
-<<<<<<< HEAD
public function buildArray() {
$type = $this->getArg('template-type')->getValue();
-=======
- public function buildArray()
- {
- $type = $this->getArg(template_type);
->>>>>>> cleanmaster
if ($type == 'front-office')
$templateType = TemplateDefinition::FRONT_OFFICE;
@@ -103,4 +104,4 @@ class Template extends BaseLoop implements ArraySearchLoopInterface
return $loopResult;
}
-}
+}
\ No newline at end of file
diff --git a/core/lib/Thelia/Core/Template/Smarty/Assets/SmartyAssetsManager.php b/core/lib/Thelia/Core/Template/Smarty/Assets/SmartyAssetsManager.php
index 5deb6e9d0..6e78f0d7f 100755
--- a/core/lib/Thelia/Core/Template/Smarty/Assets/SmartyAssetsManager.php
+++ b/core/lib/Thelia/Core/Template/Smarty/Assets/SmartyAssetsManager.php
@@ -23,11 +23,8 @@
namespace Thelia\Core\Template\Smarty\Assets;
-<<<<<<< HEAD
use Thelia\Core\Template\Assets\AsseticHelper;
use Thelia\Core\Template\TemplateDefinition;
-=======
->>>>>>> cleanmaster
use Thelia\Tools\URL;
use Thelia\Core\Template\Assets\AssetManagerInterface;
@@ -45,9 +42,9 @@ class SmartyAssetsManager
/**
* Creates a new SmartyAssetsManager instance
*
- * @param AssetManagerInterface $assetsManager an asset manager instance
- * @param string $web_root the disk path to the web root (with final /)
- * @param string $path_relative_to_web_root the path (relative to web root) where the assets will be generated
+ * @param AssetManagerInterface $assetsManager an asset manager instance
+ * @param string $web_root the disk path to the web root (with final /)
+ * @param string $path_relative_to_web_root the path (relative to web root) where the assets will be generated
*/
public function __construct(AssetManagerInterface $assetsManager, $web_root, $path_relative_to_web_root)
{
@@ -59,7 +56,6 @@ class SmartyAssetsManager
public function prepareAssets($assets_directory, \Smarty_Internal_Template $template)
{
-<<<<<<< HEAD
self::$assetsDirectory = $assets_directory;
$smartyParser = $template->smarty;
@@ -74,9 +70,6 @@ class SmartyAssetsManager
foreach($templateDirectories[$templateDefinition->getName()] as $key => $directory) {
$tpl_path = $directory . DS . self::$assetsDirectory;
-=======
- $tpl_dir = dirname($template->source->filepath);
->>>>>>> cleanmaster
$asset_dir_absolute_path = realpath($tpl_path);
@@ -144,4 +137,4 @@ class SmartyAssetsManager
return $content;
}
}
-}
+}
\ No newline at end of file
diff --git a/core/lib/Thelia/Core/Template/Smarty/Plugins/AdminUtilities.php b/core/lib/Thelia/Core/Template/Smarty/Plugins/AdminUtilities.php
index 8b8ee8ef1..78e1c8f5b 100644
--- a/core/lib/Thelia/Core/Template/Smarty/Plugins/AdminUtilities.php
+++ b/core/lib/Thelia/Core/Template/Smarty/Plugins/AdminUtilities.php
@@ -27,6 +27,8 @@ use Thelia\Core\Template\Smarty\SmartyPluginDescriptor;
use Thelia\Core\Template\Smarty\AbstractSmartyPlugin;
use Thelia\Tools\URL;
use Thelia\Core\Security\SecurityContext;
+use Thelia\Model\Config;
+use Thelia\Model\ConfigQuery;
use Thelia\Core\Template\TemplateHelper;
/**
@@ -43,8 +45,8 @@ class AdminUtilities extends AbstractSmartyPlugin
$this->securityContext = $securityContext;
}
- protected function fetch_snippet($smarty, $templateName, $variablesArray)
- {
+ protected function fetch_snippet($smarty, $templateName, $variablesArray) {
+
$data = '';
$snippet_path = sprintf('%s/%s/%s.html',
@@ -97,6 +99,7 @@ class AdminUtilities extends AbstractSmartyPlugin
$module === null ? array() : array($module),
array($access))
) {
+
return $this->fetch_snippet($smarty, 'includes/admin-utilities-position-block', array(
'admin_utilities_go_up_url' => URL::getInstance()->absoluteUrl($path, array('mode' => 'up', $url_parameter => $id)),
'admin_utilities_in_place_edit_class' => $in_place_edit_class,
diff --git a/core/lib/Thelia/Core/Template/Smarty/Plugins/Assets.php b/core/lib/Thelia/Core/Template/Smarty/Plugins/Assets.php
index e4a5c866f..e4c220ed5 100755
--- a/core/lib/Thelia/Core/Template/Smarty/Plugins/Assets.php
+++ b/core/lib/Thelia/Core/Template/Smarty/Plugins/Assets.php
@@ -56,11 +56,10 @@ class Assets extends AbstractSmartyPlugin
{
try {
return $this->assetManager->processSmartyPluginCall('js', $params, $content, $template, $repeat);
- } catch (\Exception $e) {
+ } catch(\Exception $e) {
$catchException = $this->getNormalizedParam($params, array('catchException'));
- if ($catchException == "true") {
+ if($catchException == "true") {
$repeat = false;
-
return null;
} else {
throw $e;
diff --git a/core/lib/Thelia/Core/Template/Smarty/Plugins/DataAccessFunctions.php b/core/lib/Thelia/Core/Template/Smarty/Plugins/DataAccessFunctions.php
index 236f6b8be..eab83e140 100755
--- a/core/lib/Thelia/Core/Template/Smarty/Plugins/DataAccessFunctions.php
+++ b/core/lib/Thelia/Core/Template/Smarty/Plugins/DataAccessFunctions.php
@@ -212,8 +212,6 @@ class DataAccessFunctions extends AbstractSmartyPlugin
switch ($attribute) {
case 'postage':
return $order->getPostage();
- case 'discount':
- return $order->getDiscount();
case 'delivery_address':
return $order->chosenDeliveryAddress;
case 'invoice_address':
@@ -269,69 +267,69 @@ class DataAccessFunctions extends AbstractSmartyPlugin
$includeShipping = true;
}
- if ($params['startDate'] == 'today') {
+ if($params['startDate'] == 'today') {
$startDate = new \DateTime();
$startDate->setTime(0, 0, 0);
- } elseif ($params['startDate'] == 'yesterday') {
+ } elseif($params['startDate'] == 'yesterday') {
$startDate = new \DateTime();
$startDate->setTime(0, 0, 0);
$startDate->modify('-1 day');
- } elseif ($params['startDate'] == 'this_month') {
+ } elseif($params['startDate'] == 'this_month') {
$startDate = new \DateTime();
$startDate->modify('first day of this month');
$startDate->setTime(0, 0, 0);
- } elseif ($params['startDate'] == 'last_month') {
+ } elseif($params['startDate'] == 'last_month') {
$startDate = new \DateTime();
$startDate->modify('first day of last month');
$startDate->setTime(0, 0, 0);
- } elseif ($params['startDate'] == 'this_year') {
+ } elseif($params['startDate'] == 'this_year') {
$startDate = new \DateTime();
$startDate->modify('first day of January this year');
$startDate->setTime(0, 0, 0);
- } elseif ($params['startDate'] == 'last_year') {
+ } elseif($params['startDate'] == 'last_year') {
$startDate = new \DateTime();
$startDate->modify('first day of December last year');
$startDate->setTime(0, 0, 0);
} else {
try {
$startDate = new \DateTime($params['startDate']);
- } catch (\Exception $e) {
+ } catch(\Exception $e) {
throw new \InvalidArgumentException(sprintf("invalid startDate attribute '%s' in stats access function", $params['startDate']));
}
}
- if ($params['endDate'] == 'today') {
+ if($params['endDate'] == 'today') {
$endDate = new \DateTime();
$endDate->setTime(0, 0, 0);
- } elseif ($params['endDate'] == 'yesterday') {
+ } elseif($params['endDate'] == 'yesterday') {
$endDate = new \DateTime();
$endDate->setTime(0, 0, 0);
$endDate->modify('-1 day');
- } elseif ($params['endDate'] == 'this_month') {
+ } elseif($params['endDate'] == 'this_month') {
$endDate = new \DateTime();
$endDate->modify('last day of this month');
$endDate->setTime(0, 0, 0);
- } elseif ($params['endDate'] == 'last_month') {
+ } elseif($params['endDate'] == 'last_month') {
$endDate = new \DateTime();
$endDate->modify('last day of last month');
$endDate->setTime(0, 0, 0);
- } elseif ($params['endDate'] == 'this_year') {
+ } elseif($params['endDate'] == 'this_year') {
$endDate = new \DateTime();
$endDate->modify('last day of December this year');
$endDate->setTime(0, 0, 0);
- } elseif ($params['endDate'] == 'last_year') {
+ } elseif($params['endDate'] == 'last_year') {
$endDate = new \DateTime();
$endDate->modify('last day of January last year');
$endDate->setTime(0, 0, 0);
} else {
try {
$endDate = new \DateTime($params['endDate']);
- } catch (\Exception $e) {
+ } catch(\Exception $e) {
throw new \InvalidArgumentException(sprintf("invalid endDate attribute '%s' in stats access function", $params['endDate']));
}
}
- switch ($params['key']) {
+ switch( $params['key'] ) {
case 'sales' :
return OrderQuery::getSaleStats($startDate, $endDate, $includeShipping);
case 'orders' :
diff --git a/core/lib/Thelia/Core/Template/Smarty/Plugins/Esi.php b/core/lib/Thelia/Core/Template/Smarty/Plugins/Esi.php
index cfa3788bd..453335740 100644
--- a/core/lib/Thelia/Core/Template/Smarty/Plugins/Esi.php
+++ b/core/lib/Thelia/Core/Template/Smarty/Plugins/Esi.php
@@ -28,6 +28,7 @@ use Thelia\Core\Template\Smarty\AbstractSmartyPlugin;
use Thelia\Core\Template\Smarty\an;
use Thelia\Core\Template\Smarty\SmartyPluginDescriptor;
+
/**
* Class Esi
* @package Thelia\Core\Template\Smarty\Plugins
@@ -52,7 +53,7 @@ class Esi extends AbstractSmartyPlugin
$ignore_errors = $this->getParam($params, 'ignore_errors');
$comment = $this->getParam($params, 'comment');
- if (null === $path) {
+ if(null === $path) {
return;
}
@@ -78,4 +79,4 @@ class Esi extends AbstractSmartyPlugin
new SmartyPluginDescriptor('function', 'render_esi', $this, 'renderEsi')
);
}
-}
+}
\ No newline at end of file
diff --git a/core/lib/Thelia/Core/Template/Smarty/Plugins/Module.php b/core/lib/Thelia/Core/Template/Smarty/Plugins/Module.php
index 4c92ee85c..9b86410de 100755
--- a/core/lib/Thelia/Core/Template/Smarty/Plugins/Module.php
+++ b/core/lib/Thelia/Core/Template/Smarty/Plugins/Module.php
@@ -48,7 +48,7 @@ class Module extends AbstractSmartyPlugin
/**
* Process theliaModule template inclusion function
*
- * @param unknown $params
+ * @param unknown $params
* @param \Smarty_Internal_Template $template
* @internal param \Thelia\Core\Template\Smarty\Plugins\unknown $smarty
*
@@ -60,7 +60,7 @@ class Module extends AbstractSmartyPlugin
if (false !== $location = $this->getParam($params, 'location', false)) {
- if ($this->debug === true && $this->request->get('SHOW_INCLUDE')) {
+ if($this->debug === true && $this->request->get('SHOW_INCLUDE')) {
echo sprintf('%s
', $location);
}
@@ -70,7 +70,7 @@ class Module extends AbstractSmartyPlugin
foreach ($modules as $module) {
- if (null !== $moduleLimit && $moduleLimit != $module->getCode()) {
+ if(null !== $moduleLimit && $moduleLimit != $module->getCode()) {
continue;
}
diff --git a/core/lib/Thelia/Core/Template/Smarty/SmartyParser.php b/core/lib/Thelia/Core/Template/Smarty/SmartyParser.php
index 9d3ff3fe0..4203d8270 100755
--- a/core/lib/Thelia/Core/Template/Smarty/SmartyParser.php
+++ b/core/lib/Thelia/Core/Template/Smarty/SmartyParser.php
@@ -14,13 +14,9 @@ use Thelia\Core\Template\Smarty\AbstractSmartyPlugin;
use Thelia\Core\Template\Exception\ResourceNotFoundException;
use Thelia\Core\Template\ParserContext;
use Thelia\Core\Template\TemplateDefinition;
-<<<<<<< HEAD
use Thelia\Model\ConfigQuery;
use Thelia\Core\Template\TemplateHelper;
use Imagine\Exception\InvalidArgumentException;
-=======
-use Thelia\Core\Translation\Translator;
->>>>>>> cleanmaster
/**
*
@@ -75,6 +71,7 @@ class SmartyParser extends Smarty implements ParserInterface
$this->setCompileDir($compile_dir);
$this->setCacheDir($cache_dir);
+
$this->debugging = $debug;
// Prevent smarty ErrorException: Notice: Undefined index bla bla bla...
@@ -82,7 +79,7 @@ class SmartyParser extends Smarty implements ParserInterface
// Si on n'est pas en mode debug, activer le cache, avec une lifetime de 15mn, et en vérifiant que les templates sources n'ont pas été modifiés.
- if ($debug) {
+ if($debug) {
$this->setCaching(Smarty::CACHING_OFF);
$this->setForceCompile(true);
} else {
@@ -91,6 +88,7 @@ class SmartyParser extends Smarty implements ParserInterface
//$this->enableSecurity();
+
// The default HTTP status
$this->status = 200;
@@ -167,7 +165,6 @@ class SmartyParser extends Smarty implements ParserInterface
$this->setConfigDir($configDirectory);
/* add modules template directories */
-<<<<<<< HEAD
$this->addTemplateDirectory(
$templateDefinition->getType(),
$templateDefinition->getName(),
@@ -181,32 +178,6 @@ class SmartyParser extends Smarty implements ParserInterface
foreach($this->templateDirectories[$templateDefinition->getType()][$templateDefinition->getName()] as $key => $directory) {
$this->addTemplateDir($directory, $key);
}
-=======
- switch ($templateDefinition->getType()) {
- case TemplateDefinition::FRONT_OFFICE:
- /* do not pass array directly to addTemplateDir since we cant control on keys */
- if (isset($this->frontOfficeTemplateDirectories[$templateDefinition->getName()])) {
- foreach ($this->frontOfficeTemplateDirectories[$templateDefinition->getName()] as $key => $directory) {
- $this->addTemplateDir($directory, $key);
- }
- }
- break;
-
- case TemplateDefinition::BACK_OFFICE:
- /* do not pass array directly to addTemplateDir since we cant control on keys */
- if (isset($this->backOfficeTemplateDirectories[$templateDefinition->getName()])) {
- foreach ($this->backOfficeTemplateDirectories[$templateDefinition->getName()] as $key => $directory) {
- $this->addTemplateDir($directory, $key);
- }
- }
- break;
-
- case TemplateDefinition::PDF:
- break;
-
- default:
- break;
->>>>>>> cleanmaster
}
}
@@ -215,20 +186,7 @@ class SmartyParser extends Smarty implements ParserInterface
return $this->templateDefinition;
}
-<<<<<<< HEAD
public function getTemplate()
-=======
- /**
- * Return a rendered template, either from file or ftom a string
- *
- * @param string $resourceType either 'string' (rendering from a string) or 'file' (rendering a file)
- * @param string $resourceContent the resource content (a text, or a template file name)
- * @param array $parameters an associative array of names / value pairs
- *
- * @return string the rendered template text
- */
- protected function internalRenderer($resourceType, $resourceContent, array $parameters)
->>>>>>> cleanmaster
{
return $this->templateDefinition->getPath();
}
@@ -242,35 +200,17 @@ class SmartyParser extends Smarty implements ParserInterface
*/
public function render($realTemplateName, array $parameters = array())
{
-<<<<<<< HEAD
if(false === $this->templateExists($realTemplateName)) {
throw new ResourceNotFoundException();
}
// Assign the parserContext variables
foreach ($this->parserContext as $var => $value) {
$this->assign($var, $value);
-=======
- if (false === $this->templateExists($realTemplateName)) {
- throw new ResourceNotFoundException(Translator::getInstance()->trans("Template file %file cannot be found.", array('%file', $realTemplateName)));
->>>>>>> cleanmaster
}
$this->assign($parameters);
-<<<<<<< HEAD
return $this->fetch(sprintf("file:%s", $realTemplateName));
-=======
- /**
- * Return a rendered template text
- *
- * @param string $templateText the template text
- * @param array $parameters an associative array of names / value pairs
- * @return string the rendered template text
- */
- public function renderString($templateText, array $parameters = array())
- {
- return $this->internalRenderer('string', $templateText, $parameters);
->>>>>>> cleanmaster
}
/**
diff --git a/core/lib/Thelia/Core/Template/TemplateDefinition.php b/core/lib/Thelia/Core/Template/TemplateDefinition.php
index 54923acfe..7aa549ac0 100644
--- a/core/lib/Thelia/Core/Template/TemplateDefinition.php
+++ b/core/lib/Thelia/Core/Template/TemplateDefinition.php
@@ -57,12 +57,13 @@ class TemplateDefinition
*/
protected $type;
+
public function __construct($name, $type)
{
$this->name = $name;
$this->type = $type;
- switch ($type) {
+ switch($type) {
case TemplateDefinition::FRONT_OFFICE:
$this->path = self::FRONT_OFFICE_SUBDIR . $name;
break;
@@ -89,17 +90,14 @@ class TemplateDefinition
public function setName($name)
{
$this->name = $name;
-
return $this;
}
- public function getI18nPath()
- {
+ public function getI18nPath() {
return $this->getPath() . DS . 'I18n';
}
- public function getAbsoluteI18nPath()
- {
+ public function getAbsoluteI18nPath() {
return THELIA_TEMPLATE_DIR . $this->getI18nPath();
}
@@ -108,8 +106,7 @@ class TemplateDefinition
return $this->path;
}
- public function getAbsolutePath()
- {
+ public function getAbsolutePath() {
return THELIA_TEMPLATE_DIR . $this->getPath();
}
@@ -118,15 +115,13 @@ class TemplateDefinition
return $this->getPath() . DS . 'configs';
}
- public function getAbsoluteConfigPath()
- {
+ public function getAbsoluteConfigPath() {
return THELIA_TEMPLATE_DIR . $this->getConfigPath();
}
public function setPath($path)
{
$this->path = $path;
-
return $this;
}
@@ -138,10 +133,8 @@ class TemplateDefinition
public function setType($type)
{
$this->type = $type;
-
return $this;
}
-<<<<<<< HEAD
/**
* Returns an iterator on the standard templates subdir names
@@ -149,7 +142,4 @@ class TemplateDefinition
public static function getStandardTemplatesSubdirsIterator() {
return new \ArrayIterator(self::$standardTemplatesSubdirs);
}
-}
-=======
-}
->>>>>>> cleanmaster
+}
\ No newline at end of file
diff --git a/core/lib/Thelia/Core/Template/TemplateHelper.php b/core/lib/Thelia/Core/Template/TemplateHelper.php
index b7c8fcddd..175f83b42 100644
--- a/core/lib/Thelia/Core/Template/TemplateHelper.php
+++ b/core/lib/Thelia/Core/Template/TemplateHelper.php
@@ -40,17 +40,16 @@ class TemplateHelper
private function __construct() {}
- public static function getInstance()
- {
+ public static function getInstance() {
if (self::$instance == null) self::$instance = new TemplateHelper();
+
return self::$instance;
}
/**
* @return TemplateDefinition
*/
- public function getActiveMailTemplate()
- {
+ public function getActiveMailTemplate() {
return new TemplateDefinition(
ConfigQuery::read('active-mail-template', 'default'),
TemplateDefinition::EMAIL
@@ -60,8 +59,7 @@ class TemplateHelper
/**
* @return TemplateDefinition
*/
- public function getActivePdfTemplate()
- {
+ public function getActivePdfTemplate() {
return new TemplateDefinition(
ConfigQuery::read('active-pdf-template', 'default'),
TemplateDefinition::PDF
@@ -71,8 +69,7 @@ class TemplateHelper
/**
* @return TemplateDefinition
*/
- public function getActiveAdminTemplate()
- {
+ public function getActiveAdminTemplate() {
return new TemplateDefinition(
ConfigQuery::read('active-admin-template', 'default'),
TemplateDefinition::BACK_OFFICE
@@ -82,15 +79,13 @@ class TemplateHelper
/**
* @return TemplateDefinition
*/
- public function getActiveFrontTemplate()
- {
+ public function getActiveFrontTemplate() {
return new TemplateDefinition(
ConfigQuery::read('active-front-template', 'default'),
TemplateDefinition::FRONT_OFFICE
);
}
-<<<<<<< HEAD
/**
* Returns an array which contains all standard template definitions
*/
@@ -114,18 +109,6 @@ class TemplateHelper
$list = $exclude = array();
$tplIterator = TemplateDefinition::getStandardTemplatesSubdirsIterator();
-=======
- public function getList($templateType)
- {
- $list = $exclude = array();
-
- if ($templateType == TemplateDefinition::BACK_OFFICE) {
- $baseDir = THELIA_TEMPLATE_DIR.TemplateDefinition::BACK_OFFICE_SUBDIR;
- } elseif ($templateType == TemplateDefinition::PDF) {
- $baseDir = THELIA_TEMPLATE_DIR.TemplateDefinition::PDF_SUBDIR;
- } else {
- $baseDir = THELIA_TEMPLATE_DIR.TemplateDefinition::FRONT_OFFICE_SUBDIR;
->>>>>>> cleanmaster
foreach($tplIterator as $type => $subdir) {
@@ -151,6 +134,7 @@ class TemplateHelper
}
}
+
protected function normalize_path($path)
{
$path = str_replace(
@@ -171,27 +155,28 @@ class TemplateHelper
* 'translation' => the text translation, or an empty string if none available.
* 'dollar' => true if the translatable text contains a $
*
- * @param string $directory the path to the directory to examine
- * @param string $walkMode type of file scanning: WALK_MODE_PHP or WALK_MODE_TEMPLATE
- * @param \Thelia\Core\Translation\Translator $translator the current translator
- * @param string $currentLocale the current locale
- * @param array $strings the list of strings
- * @throws \InvalidArgumentException if $walkMode contains an invalid value
- * @return number the total number of translatable texts
+ * @param string $directory the path to the directory to examine
+ * @param string $walkMode type of file scanning: WALK_MODE_PHP or WALK_MODE_TEMPLATE
+ * @param \Thelia\Core\Translation\Translator $translator the current translator
+ * @param string $currentLocale the current locale
+ * @param array $strings the list of strings
+ * @throws \InvalidArgumentException if $walkMode contains an invalid value
+ * @return number the total number of translatable texts
*/
- public function walkDir($directory, $walkMode, Translator $translator, $currentLocale, &$strings)
- {
+ public function walkDir($directory, $walkMode, Translator $translator, $currentLocale, &$strings) {
+
$num_texts = 0;
if ($walkMode == self::WALK_MODE_PHP) {
$prefix = '\-\>[\s]*trans[\s]*\(';
$allowed_exts = array('php');
- } elseif ($walkMode == self::WALK_MODE_TEMPLATE) {
+ } else if ($walkMode == self::WALK_MODE_TEMPLATE) {
$prefix = '\{intl[\s]l=';
$allowed_exts = array('html', 'tpl', 'xml');
- } else {
+ }
+ else {
throw new \InvalidArgumentException(
Translator::getInstance()->trans('Invalid value for walkMode parameter: %value', array('%value' => $walkMode))
);
@@ -225,15 +210,18 @@ class TemplateHelper
Tlog::getInstance()->debug("Strings found: ", $matches[2]);
- foreach ($matches[2] as $match) {
+ foreach($matches[2] as $match) {
$hash = md5($match);
- if (isset($strings[$hash])) {
- if (! in_array($short_path, $strings[$hash]['files'])) {
+ if (isset($strings[$hash]))
+ {
+ if (! in_array($short_path, $strings[$hash]['files']))
+ {
$strings[$hash]['files'][] = $short_path;
}
- } else {
+ }
+ else {
$num_texts++;
// remove \'
@@ -285,7 +273,9 @@ class TemplateHelper
fwrite($fp, ");\n");
@fclose($fp);
- } else {
+ }
+ else
+ {
throw new \RuntimeException(
Translator::getInstance()->trans(
'Failed to open translation file %file. Please be sure that this file is writable by your Web server',
diff --git a/core/lib/Thelia/Core/Thelia.php b/core/lib/Thelia/Core/Thelia.php
index acc6ba1f6..3fb205433 100755
--- a/core/lib/Thelia/Core/Thelia.php
+++ b/core/lib/Thelia/Core/Thelia.php
@@ -49,6 +49,7 @@ use Thelia\Config\DefinePropel;
use Thelia\Core\Template\TemplateDefinition;
use Thelia\Core\TheliaContainerBuilder;
use Thelia\Core\DependencyInjection\Loader\XmlFileLoader;
+use Thelia\Model\ConfigQuery;
use Symfony\Component\Config\FileLocator;
use Propel\Runtime\Propel;
@@ -175,7 +176,7 @@ class Thelia extends Kernel
->depth(0)
->in(THELIA_ROOT . "/core/lib/Thelia/Config/Resources");
- foreach ($finder as $file) {
+ foreach($finder as $file) {
$loader->load($file->getBaseName());
}
@@ -197,11 +198,6 @@ class Thelia extends Kernel
$definition
);
-<<<<<<< HEAD
-=======
- $code = ucfirst($module->getCode());
-
->>>>>>> cleanmaster
$loader = new XmlFileLoader($container, new FileLocator($module->getAbsoluteConfigPath()));
$loader->load("config.xml");
diff --git a/core/lib/Thelia/Core/TheliaHttpKernel.php b/core/lib/Thelia/Core/TheliaHttpKernel.php
index 6449d0648..ed4dd672b 100755
--- a/core/lib/Thelia/Core/TheliaHttpKernel.php
+++ b/core/lib/Thelia/Core/TheliaHttpKernel.php
@@ -215,7 +215,7 @@ class TheliaHttpKernel extends HttpKernel
protected function initSession(Request $request)
{
- if (null === self::$session) {
+ if(null === self::$session) {
$storage = new Session\Storage\NativeSessionStorage();
if (Model\ConfigQuery::read("session_config.default")) {
diff --git a/core/lib/Thelia/Core/Translation/Translator.php b/core/lib/Thelia/Core/Translation/Translator.php
index fc1c75de2..775ef7ad8 100755
--- a/core/lib/Thelia/Core/Translation/Translator.php
+++ b/core/lib/Thelia/Core/Translation/Translator.php
@@ -40,7 +40,7 @@ class Translator extends BaseTranslator
public function getLocale()
{
- if ($this->container->isScopeActive('request') && $this->container->has('request')) {
+ if($this->container->isScopeActive('request') && $this->container->has('request')) {
return $this->container->get('request')->getSession()->getLang()->getLocale();
}
diff --git a/core/lib/Thelia/Coupon/CouponManager.php b/core/lib/Thelia/Coupon/CouponManager.php
index 17d85b8cb..c4eff7888 100644
--- a/core/lib/Thelia/Coupon/CouponManager.php
+++ b/core/lib/Thelia/Coupon/CouponManager.php
@@ -82,8 +82,15 @@ class CouponManager
if (count($this->coupons) > 0) {
$couponsKept = $this->sortCoupons($this->coupons);
+ $isRemovingPostage = $this->isCouponRemovingPostage($couponsKept);
+
$discount = $this->getEffect($couponsKept);
+ if ($isRemovingPostage) {
+ $postage = $this->facade->getCheckoutPostagePrice();
+ $discount += $postage;
+ }
+
// Just In Case test
$checkoutTotalPrice = $this->facade->getCartTotalPrice();
if ($discount >= $checkoutTotalPrice) {
@@ -96,24 +103,23 @@ class CouponManager
/**
* Check if there is a Coupon removing Postage
+ *
+ * @param array $couponsKept Array of CouponInterface sorted
+ *
* @return bool
*/
- public function isCouponRemovingPostage()
+ protected function isCouponRemovingPostage(array $couponsKept)
{
- if (count($this->coupons) == 0) {
- return false;
- }
-
- $couponsKept = $this->sortCoupons($this->coupons);
+ $isRemovingPostage = false;
/** @var CouponInterface $coupon */
foreach ($couponsKept as $coupon) {
if ($coupon->isRemovingPostage()) {
- return true;
+ $isRemovingPostage = true;
}
}
- return false;
+ return $isRemovingPostage;
}
/**
diff --git a/core/lib/Thelia/Form/CustomerProfileUpdateForm.php b/core/lib/Thelia/Form/CustomerProfileUpdateForm.php
index 6f44ecc92..3bf0c372a 100755
--- a/core/lib/Thelia/Form/CustomerProfileUpdateForm.php
+++ b/core/lib/Thelia/Form/CustomerProfileUpdateForm.php
@@ -23,6 +23,7 @@
namespace Thelia\Form;
use Symfony\Component\Validator\ExecutionContextInterface;
+use Thelia\Core\Translation\Translator;
use Thelia\Model\CustomerQuery;
/**
diff --git a/core/lib/Thelia/Form/MailingSystemModificationForm.php b/core/lib/Thelia/Form/MailingSystemModificationForm.php
index 709c19144..8334777ab 100644
--- a/core/lib/Thelia/Form/MailingSystemModificationForm.php
+++ b/core/lib/Thelia/Form/MailingSystemModificationForm.php
@@ -23,6 +23,7 @@
namespace Thelia\Form;
use Symfony\Component\Validator\Constraints;
+use Symfony\Component\Validator\Constraints\NotBlank;
use Symfony\Component\Validator\ExecutionContextInterface;
use Thelia\Core\Translation\Translator;
use Thelia\Model\ProfileQuery;
diff --git a/core/lib/Thelia/Form/ProductCombinationGenerationForm.php b/core/lib/Thelia/Form/ProductCombinationGenerationForm.php
index 1ca633ccd..8e4b155b9 100644
--- a/core/lib/Thelia/Form/ProductCombinationGenerationForm.php
+++ b/core/lib/Thelia/Form/ProductCombinationGenerationForm.php
@@ -23,6 +23,7 @@
namespace Thelia\Form;
use Symfony\Component\Validator\Constraints\GreaterThan;
+use Symfony\Component\Validator\Constraints\NotBlank;
use Thelia\Model\Currency;
use Thelia\Core\Translation\Translator;
@@ -87,4 +88,4 @@ class ProductCombinationGenerationForm extends BaseForm
{
return 'thelia_product_combination_generation_form';
}
-}
+}
\ No newline at end of file
diff --git a/core/lib/Thelia/Form/ProductModificationForm.php b/core/lib/Thelia/Form/ProductModificationForm.php
index d2819737c..9dce2e4e5 100644
--- a/core/lib/Thelia/Form/ProductModificationForm.php
+++ b/core/lib/Thelia/Form/ProductModificationForm.php
@@ -25,6 +25,7 @@ namespace Thelia\Form;
use Symfony\Component\Validator\Constraints\GreaterThan;
use Thelia\Core\Translation\Translator;
+
class ProductModificationForm extends ProductCreationForm
{
use StandardDescriptionFieldsTrait;
diff --git a/core/lib/Thelia/Form/SeoFieldsTrait.php b/core/lib/Thelia/Form/SeoFieldsTrait.php
index 95ce487fc..5b3270793 100644
--- a/core/lib/Thelia/Form/SeoFieldsTrait.php
+++ b/core/lib/Thelia/Form/SeoFieldsTrait.php
@@ -35,7 +35,7 @@ trait SeoFieldsTrait
/**
* Add seo meta title, meta description and meta keywords fields
*
- * @param array $exclude name of the fields that should not be added to the form
+ * @param array $exclude name of the fields that should not be added to the form
*/
protected function addSeoFields($exclude = array())
{
diff --git a/core/lib/Thelia/Form/SystemLogConfigurationForm.php b/core/lib/Thelia/Form/SystemLogConfigurationForm.php
index f4eb62285..9ba9e6cf2 100644
--- a/core/lib/Thelia/Form/SystemLogConfigurationForm.php
+++ b/core/lib/Thelia/Form/SystemLogConfigurationForm.php
@@ -23,6 +23,8 @@
namespace Thelia\Form;
use Symfony\Component\Validator\Constraints;
+use Thelia\Model\ConfigQuery;
+use Symfony\Component\Validator\ExecutionContextInterface;
use Thelia\Log\Tlog;
use Thelia\Core\Translation\Translator;
diff --git a/core/lib/Thelia/Install/CheckPermission.php b/core/lib/Thelia/Install/CheckPermission.php
index efdaf6f04..6a9a5245e 100644
--- a/core/lib/Thelia/Install/CheckPermission.php
+++ b/core/lib/Thelia/Install/CheckPermission.php
@@ -58,7 +58,7 @@ class CheckPermission extends BaseInstall
/** @var array Minimum server configuration necessary */
protected $minServerConfigurationNecessary = array(
- 'memory_limit' => 134217728,
+ 'memory_limit' => 157286400,
'post_max_size' => 20971520,
'upload_max_filesize' => 2097152
);
diff --git a/core/lib/Thelia/Log/Destination/TlogDestinationFile.php b/core/lib/Thelia/Log/Destination/TlogDestinationFile.php
index 08b7aab66..80aa3ec25 100755
--- a/core/lib/Thelia/Log/Destination/TlogDestinationFile.php
+++ b/core/lib/Thelia/Log/Destination/TlogDestinationFile.php
@@ -138,4 +138,4 @@ class TlogDestinationFile extends AbstractTlogDestination
$this->fh = false;
}
-}
+}
\ No newline at end of file
diff --git a/core/lib/Thelia/Log/Destination/TlogDestinationJavascriptConsole.php b/core/lib/Thelia/Log/Destination/TlogDestinationJavascriptConsole.php
index e1f3444a5..546ab488c 100644
--- a/core/lib/Thelia/Log/Destination/TlogDestinationJavascriptConsole.php
+++ b/core/lib/Thelia/Log/Destination/TlogDestinationJavascriptConsole.php
@@ -25,29 +25,27 @@ namespace Thelia\Log\Destination;
use Thelia\Log\AbstractTlogDestination;
-class TlogDestinationJavascriptConsole extends AbstractTlogDestination
-{
- public function getTitle()
- {
- return "Browser's Javascript console";
- }
+class TlogDestinationJavascriptConsole extends AbstractTlogDestination {
- public function getDescription()
- {
- return "The Thelia logs are displayed in your browser's Javascript console.";
- }
+ public function getTitle() {
+ return "Browser's Javascript console";
+ }
- public function write(&$res)
- {
- $content = ''."\n";
+ $content = ''."\n";
+
+ if (preg_match("|