fix minor bug
This commit is contained in:
@@ -59,8 +59,6 @@ class Currency extends BaseAction implements EventSubscriberInterface
|
|||||||
*/
|
*/
|
||||||
public function update(CurrencyUpdateEvent $event)
|
public function update(CurrencyUpdateEvent $event)
|
||||||
{
|
{
|
||||||
$search = CurrencyQuery::create();
|
|
||||||
|
|
||||||
if (null !== $currency = CurrencyQuery::create()->findPk($event->getCurrencyId())) {
|
if (null !== $currency = CurrencyQuery::create()->findPk($event->getCurrencyId())) {
|
||||||
|
|
||||||
$currency
|
$currency
|
||||||
|
|||||||
@@ -302,7 +302,7 @@ class Order extends BaseAction implements EventSubscriberInterface
|
|||||||
*/
|
*/
|
||||||
public function createManual(OrderManualEvent $event)
|
public function createManual(OrderManualEvent $event)
|
||||||
{
|
{
|
||||||
$placedOrder = $this->createOrder(
|
$this->createOrder(
|
||||||
$event->getDispatcher(),
|
$event->getDispatcher(),
|
||||||
$event->getOrder(),
|
$event->getOrder(),
|
||||||
$event->getCurrency(),
|
$event->getCurrency(),
|
||||||
|
|||||||
0
core/lib/Thelia/Command/ModuleDeactivateCommand.php
Executable file → Normal file
0
core/lib/Thelia/Command/ModuleDeactivateCommand.php
Executable file → Normal file
@@ -33,9 +33,7 @@ use Thelia\Form\Exception\FormValidationException;
|
|||||||
use Thelia\Log\Tlog;
|
use Thelia\Log\Tlog;
|
||||||
use Thelia\Model\Coupon;
|
use Thelia\Model\Coupon;
|
||||||
use Thelia\Model\CouponQuery;
|
use Thelia\Model\CouponQuery;
|
||||||
use Thelia\Model\Lang;
|
|
||||||
use Thelia\Model\LangQuery;
|
use Thelia\Model\LangQuery;
|
||||||
use Thelia\Tools\I18n;
|
|
||||||
use Thelia\Tools\Rest\ResponseRest;
|
use Thelia\Tools\Rest\ResponseRest;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -263,8 +261,7 @@ class CouponController extends BaseAdminController
|
|||||||
|
|
||||||
$html = $condition->drawBackOfficeInputs();
|
$html = $condition->drawBackOfficeInputs();
|
||||||
$serviceId = $condition->getServiceId();
|
$serviceId = $condition->getServiceId();
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$html = '';
|
$html = '';
|
||||||
$serviceId = '';
|
$serviceId = '';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ use Thelia\Core\Event\ProductSaleElement\ProductSaleElementCreateEvent;
|
|||||||
use Thelia\Core\Security\Resource\AdminResources;
|
use Thelia\Core\Security\Resource\AdminResources;
|
||||||
use Thelia\Core\Security\AccessManager;
|
use Thelia\Core\Security\AccessManager;
|
||||||
|
|
||||||
|
use Thelia\Form\Exception\FormValidationException;
|
||||||
use Thelia\Model\AccessoryQuery;
|
use Thelia\Model\AccessoryQuery;
|
||||||
use Thelia\Model\CategoryQuery;
|
use Thelia\Model\CategoryQuery;
|
||||||
use Thelia\Model\FeatureQuery;
|
use Thelia\Model\FeatureQuery;
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ use Thelia\Core\Security\AccessManager;
|
|||||||
use Thelia\Core\Security\Resource\AdminResources;
|
use Thelia\Core\Security\Resource\AdminResources;
|
||||||
use Thelia\Core\Event\Profile\ProfileEvent;
|
use Thelia\Core\Event\Profile\ProfileEvent;
|
||||||
use Thelia\Core\Event\TheliaEvents;
|
use Thelia\Core\Event\TheliaEvents;
|
||||||
|
use Thelia\Form\Exception\FormValidationException;
|
||||||
use Thelia\Form\ProfileCreationForm;
|
use Thelia\Form\ProfileCreationForm;
|
||||||
use Thelia\Form\ProfileModificationForm;
|
use Thelia\Form\ProfileModificationForm;
|
||||||
use Thelia\Form\ProfileUpdateModuleAccessForm;
|
use Thelia\Form\ProfileUpdateModuleAccessForm;
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ class SessionController extends BaseAdminController
|
|||||||
/**
|
/**
|
||||||
* we have tou find a way to send cookie
|
* we have tou find a way to send cookie
|
||||||
*/
|
*/
|
||||||
if (intval($adminLoginForm->getForm()->get('remember_me')->getData()) > 0) {
|
if (intval($form->get('remember_me')->getData()) > 0) {
|
||||||
// If a remember me field if present and set in the form, create
|
// If a remember me field if present and set in the form, create
|
||||||
// the cookie thant store "remember me" information
|
// the cookie thant store "remember me" information
|
||||||
$this->createAdminRememberMeCookie($user);
|
$this->createAdminRememberMeCookie($user);
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ use Thelia\Core\Security\Resource\AdminResources;
|
|||||||
use Thelia\Core\Event\Tax\TaxRuleEvent;
|
use Thelia\Core\Event\Tax\TaxRuleEvent;
|
||||||
use Thelia\Core\Event\TheliaEvents;
|
use Thelia\Core\Event\TheliaEvents;
|
||||||
use Thelia\Core\Security\AccessManager;
|
use Thelia\Core\Security\AccessManager;
|
||||||
|
use Thelia\Form\Exception\FormValidationException;
|
||||||
use Thelia\Form\TaxRuleCreationForm;
|
use Thelia\Form\TaxRuleCreationForm;
|
||||||
use Thelia\Form\TaxRuleModificationForm;
|
use Thelia\Form\TaxRuleModificationForm;
|
||||||
use Thelia\Form\TaxRuleTaxListUpdateForm;
|
use Thelia\Form\TaxRuleTaxListUpdateForm;
|
||||||
|
|||||||
@@ -182,6 +182,4 @@ class LangCreateEvent extends LangEvent
|
|||||||
return $this->thousands_separator;
|
return $this->thousands_separator;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ class ProductSaleElementEvent extends ActionEvent
|
|||||||
{
|
{
|
||||||
public $product_sale_element = null;
|
public $product_sale_element = null;
|
||||||
|
|
||||||
public function __construct(ProductSaleElement $product_sale_element = null)
|
public function __construct(ProductSaleElements $product_sale_element = null)
|
||||||
{
|
{
|
||||||
$this->product_sale_element = $product_sale_element;
|
$this->product_sale_element = $product_sale_element;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,71 +0,0 @@
|
|||||||
<?php
|
|
||||||
/*************************************************************************************/
|
|
||||||
/* This file is part of the Thelia package. */
|
|
||||||
/* */
|
|
||||||
/* Copyright (c) OpenStudio */
|
|
||||||
/* email : dev@thelia.net */
|
|
||||||
/* web : http://www.thelia.net */
|
|
||||||
/* */
|
|
||||||
/* For the full copyright and license information, please view the LICENSE.txt */
|
|
||||||
/* file that was distributed with this source code. */
|
|
||||||
/*************************************************************************************/
|
|
||||||
|
|
||||||
namespace Thelia\Core\Factory;
|
|
||||||
|
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* *
|
|
||||||
* try to instanciate the good action class
|
|
||||||
*
|
|
||||||
* Class ActionEventFactory
|
|
||||||
* @package Thelia\Core\Factory
|
|
||||||
* @author Manuel Raynaud <mraynaud@openstudio.fr>
|
|
||||||
*/
|
|
||||||
class ActionEventFactory
|
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var \Symfony\Component\HttpFoundation\Request
|
|
||||||
*/
|
|
||||||
protected $request;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
protected $action;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* array(
|
|
||||||
* "action.addCart" => "Thelia\Core\Event\CartAction"
|
|
||||||
* )
|
|
||||||
*
|
|
||||||
* @var array key are action name and value the Event class to dispatch
|
|
||||||
*/
|
|
||||||
protected $className;
|
|
||||||
|
|
||||||
protected $defaultClassName = "Thelia\Core\Event\DefaultActionEvent";
|
|
||||||
|
|
||||||
public function __construct(Request $request, $action, $className)
|
|
||||||
{
|
|
||||||
$this->request = $request;
|
|
||||||
$this->action = $action;
|
|
||||||
$this->className = $className;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function createActionEvent()
|
|
||||||
{
|
|
||||||
if (array_key_exists($this->action, $this->className)) {
|
|
||||||
$class = new \ReflectionClass($this->className[$this->action]);
|
|
||||||
// return $class->newInstance($this->request, $this->action);
|
|
||||||
} else {
|
|
||||||
$class = new \ReflectionClass($this->defaultClassName);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($class->isSubclassOf("Thelia\Core\Event\ActionEvent") === false) {
|
|
||||||
throw new \RuntimeException("%s must be a subclass of Thelia\Core\Event\ActionEvent", $class->getName());
|
|
||||||
}
|
|
||||||
|
|
||||||
return $class->newInstance($this->request, $this->action);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -62,7 +62,7 @@ class OrderCoupon extends BaseLoop implements PropelSearchLoopInterface
|
|||||||
|
|
||||||
public function parseResults(LoopResult $loopResult)
|
public function parseResults(LoopResult $loopResult)
|
||||||
{
|
{
|
||||||
$conditionFactory = $this->container->get('thelia.condition.factory');
|
$this->container->get('thelia.condition.factory');
|
||||||
|
|
||||||
/** @var OrderCoupon $orderCoupon */
|
/** @var OrderCoupon $orderCoupon */
|
||||||
foreach ($loopResult->getResultDataCollection() as $orderCoupon) {
|
foreach ($loopResult->getResultDataCollection() as $orderCoupon) {
|
||||||
|
|||||||
@@ -857,7 +857,7 @@ class Product extends BaseI18nLoop implements PropelSearchLoopInterface, SearchL
|
|||||||
|
|
||||||
$visible = $this->getVisible();
|
$visible = $this->getVisible();
|
||||||
|
|
||||||
if ($visible !== BooleanOrBothType::ANY) $search->filterByVisible($visible ? 1 : 0);
|
if ($visible !== Type\BooleanOrBothType::ANY) $search->filterByVisible($visible ? 1 : 0);
|
||||||
|
|
||||||
$exclude = $this->getExclude();
|
$exclude = $this->getExclude();
|
||||||
|
|
||||||
|
|||||||
@@ -96,8 +96,6 @@ class TheliaLoop extends AbstractSmartyPlugin
|
|||||||
|
|
||||||
$loop = $this->createLoopInstance($params);
|
$loop = $this->createLoopInstance($params);
|
||||||
|
|
||||||
$dummy = null;
|
|
||||||
|
|
||||||
return $loop->count();
|
return $loop->count();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -354,7 +354,8 @@ abstract class CouponAbstract implements CouponInterface
|
|||||||
*
|
*
|
||||||
* @return string HTML string
|
* @return string HTML string
|
||||||
*/
|
*/
|
||||||
public function drawBackOfficeInputs() {
|
public function drawBackOfficeInputs()
|
||||||
|
{
|
||||||
return $this->facade->getParser()->render('coupon/type-fragments/remove-x.html', [
|
return $this->facade->getParser()->render('coupon/type-fragments/remove-x.html', [
|
||||||
'label' => $this->getInputName(),
|
'label' => $this->getInputName(),
|
||||||
'fieldName' => self::INPUT_AMOUNT_NAME,
|
'fieldName' => self::INPUT_AMOUNT_NAME,
|
||||||
|
|||||||
@@ -145,7 +145,7 @@ class CouponCreationForm extends BaseForm
|
|||||||
/**
|
/**
|
||||||
* Validate a date entered with the default Language date format.
|
* Validate a date entered with the default Language date format.
|
||||||
*
|
*
|
||||||
* @param string $value
|
* @param string $value
|
||||||
* @param ExecutionContextInterface $context
|
* @param ExecutionContextInterface $context
|
||||||
*/
|
*/
|
||||||
public function checkLocalizedDate($value, ExecutionContextInterface $context)
|
public function checkLocalizedDate($value, ExecutionContextInterface $context)
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ use Thelia\Model\Base\AreaDeliveryModuleQuery as BaseAreaDeliveryModuleQuery;
|
|||||||
class AreaDeliveryModuleQuery extends BaseAreaDeliveryModuleQuery
|
class AreaDeliveryModuleQuery extends BaseAreaDeliveryModuleQuery
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
public function findByCountryAndModule(Country $country, Module $module)
|
public function findByCountryAndModule(Country $country, Module $module)
|
||||||
{
|
{
|
||||||
$response = null;
|
$response = null;
|
||||||
|
|||||||
@@ -56,9 +56,21 @@ class Content extends BaseContent
|
|||||||
|
|
||||||
public function setDefaultFolder($folderId)
|
public function setDefaultFolder($folderId)
|
||||||
{
|
{
|
||||||
/* ContentFolderQuery::create()
|
// Unset previous category
|
||||||
->filterByContentId($this->getId)
|
ContentFolderQuery::create()
|
||||||
->update(array("DefaultFolder" => 0));*/
|
->filterByContentId($this->getId())
|
||||||
|
->filterByDefaultFolder(true)
|
||||||
|
->find()
|
||||||
|
->setByDefault(false)
|
||||||
|
->save();
|
||||||
|
|
||||||
|
// Set new default category
|
||||||
|
ContentFolderQuery::create()
|
||||||
|
->filterByContentId($this->getId())
|
||||||
|
->filterByFolderId($folderId)
|
||||||
|
->find()
|
||||||
|
->setByDefault(true)
|
||||||
|
->save();
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,10 +23,8 @@
|
|||||||
|
|
||||||
namespace Thelia\Model;
|
namespace Thelia\Model;
|
||||||
|
|
||||||
use Propel\Runtime\Propel;
|
|
||||||
use Thelia\Model\Base\Coupon as BaseCoupon;
|
use Thelia\Model\Base\Coupon as BaseCoupon;
|
||||||
use Thelia\Model\Exception\InvalidArgumentException;
|
use Thelia\Model\Exception\InvalidArgumentException;
|
||||||
use Thelia\Model\Map\CouponTableMap;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to provide an effect (mostly a discount)
|
* Used to provide an effect (mostly a discount)
|
||||||
|
|||||||
@@ -172,7 +172,7 @@ class Product extends BaseProduct
|
|||||||
$this->setTaxRuleId($taxRuleId);
|
$this->setTaxRuleId($taxRuleId);
|
||||||
|
|
||||||
// Create the default product sale element of this product
|
// Create the default product sale element of this product
|
||||||
$sale_elements = $this->createProductSaleElement($con, $baseWeight, $basePrice, $basePrice, $priceCurrencyId, true);
|
$this->createProductSaleElement($con, $baseWeight, $basePrice, $basePrice, $priceCurrencyId, true);
|
||||||
|
|
||||||
// Store all the stuff !
|
// Store all the stuff !
|
||||||
$con->commit();
|
$con->commit();
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace Thelia\Model;
|
namespace Thelia\Model;
|
||||||
|
|
||||||
|
use Propel\Runtime\Exception\PropelException;
|
||||||
use Thelia\Model\Base\ProductSaleElements as BaseProductSaleElements;
|
use Thelia\Model\Base\ProductSaleElements as BaseProductSaleElements;
|
||||||
use Thelia\Model\Tools\ProductPriceTools;
|
use Thelia\Model\Tools\ProductPriceTools;
|
||||||
use Thelia\TaxEngine\Calculator;
|
use Thelia\TaxEngine\Calculator;
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace Thelia\Model;
|
namespace Thelia\Model;
|
||||||
|
|
||||||
|
use Propel\Runtime\Exception\PropelException;
|
||||||
use Thelia\Exception\TaxEngineException;
|
use Thelia\Exception\TaxEngineException;
|
||||||
use Thelia\Model\Base\Tax as BaseTax;
|
use Thelia\Model\Base\Tax as BaseTax;
|
||||||
use Thelia\Model\Tools\ModelEventDispatcherTrait;
|
use Thelia\Model\Tools\ModelEventDispatcherTrait;
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ trait PositionManagementTrait
|
|||||||
$result->setDispatcher($this->getDispatcher())->setPosition($my_position)->save($cnx);
|
$result->setDispatcher($this->getDispatcher())->setPosition($my_position)->save($cnx);
|
||||||
|
|
||||||
$cnx->commit();
|
$cnx->commit();
|
||||||
} catch (Exception $e) {
|
} catch (\Exception $e) {
|
||||||
$cnx->rollback();
|
$cnx->rollback();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -185,7 +185,7 @@ trait PositionManagementTrait
|
|||||||
;
|
;
|
||||||
|
|
||||||
$cnx->commit();
|
$cnx->commit();
|
||||||
} catch (Exception $e) {
|
} catch (\Exception $e) {
|
||||||
$cnx->rollback();
|
$cnx->rollback();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,7 +44,6 @@ class ContentTest extends BaseLoopTestor
|
|||||||
$content = ContentQuery::create()->findOne();
|
$content = ContentQuery::create()->findOne();
|
||||||
if (null === $content) {
|
if (null === $content) {
|
||||||
$content = new \Thelia\Model\Content();
|
$content = new \Thelia\Model\Content();
|
||||||
$content->setDefaultFolder(0);
|
|
||||||
$content->setVisible(1);
|
$content->setVisible(1);
|
||||||
$content->setTitle('foo');
|
$content->setTitle('foo');
|
||||||
$content->save();
|
$content->save();
|
||||||
|
|||||||
Reference in New Issue
Block a user