This commit is contained in:
Manuel Raynaud
2013-09-30 10:35:34 +02:00
parent 43b5a129f7
commit c65ec67bdf
168 changed files with 577 additions and 818 deletions

View File

@@ -33,11 +33,7 @@ use Thelia\Core\Event\TheliaEvents;
use Thelia\Core\Event\Attribute\AttributeUpdateEvent;
use Thelia\Core\Event\Attribute\AttributeCreateEvent;
use Thelia\Core\Event\Attribute\AttributeDeleteEvent;
use Thelia\Model\ConfigQuery;
use Thelia\Model\AttributeAv;
use Thelia\Model\AttributeAvQuery;
use Thelia\Core\Event\UpdatePositionEvent;
use Thelia\Core\Event\Category\CategoryEvent;
use Thelia\Core\Event\Attribute\AttributeEvent;
use Thelia\Model\AttributeTemplate;
use Thelia\Model\AttributeTemplateQuery;

View File

@@ -33,7 +33,6 @@ use Thelia\Core\Event\TheliaEvents;
use Thelia\Core\Event\Attribute\AttributeAvUpdateEvent;
use Thelia\Core\Event\Attribute\AttributeAvCreateEvent;
use Thelia\Core\Event\Attribute\AttributeAvDeleteEvent;
use Thelia\Model\ConfigQuery;
use Thelia\Core\Event\UpdatePositionEvent;
class AttributeAv extends BaseAction implements EventSubscriberInterface
@@ -115,7 +114,6 @@ class AttributeAv extends BaseAction implements EventSubscriberInterface
return $this->genericUpdatePosition(AttributeAvQuery::create(), $event);
}
/**
* {@inheritDoc}
*/

View File

@@ -24,7 +24,6 @@ namespace Thelia\Action;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Thelia\Model\AdminLog;
use Propel\Runtime\ActiveQuery\PropelQuery;
use Propel\Runtime\ActiveQuery\ModelCriteria;
use Thelia\Core\Event\UpdatePositionEvent;
@@ -50,7 +49,6 @@ class BaseAction
return $this->container->get('event_dispatcher');
}
/**
* Changes object position, selecting absolute ou relative change.
*

View File

@@ -23,10 +23,7 @@
namespace Thelia\Action;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Thelia\Core\Event\CachedFileEvent;
use Thelia\Model\ConfigQuery;
use Thelia\Tools\URL;
/**
@@ -50,7 +47,7 @@ abstract class BaseCachedFile extends BaseAction
/**
* @return string root of the file cache directory in web space
*/
protected abstract function getCacheDirFromWebRoot();
abstract protected function getCacheDirFromWebRoot();
/**
* Clear the file cache. Is a subdirectory is specified, only this directory is cleared.

View File

@@ -33,7 +33,6 @@ use Thelia\Core\Event\TheliaEvents;
use Thelia\Core\Event\Category\CategoryUpdateEvent;
use Thelia\Core\Event\Category\CategoryCreateEvent;
use Thelia\Core\Event\Category\CategoryDeleteEvent;
use Thelia\Model\ConfigQuery;
use Thelia\Core\Event\UpdatePositionEvent;
use Thelia\Core\Event\Category\CategoryToggleVisibilityEvent;
use Thelia\Core\Event\Category\CategoryAddContentEvent;
@@ -139,8 +138,8 @@ class Category extends BaseAction implements EventSubscriberInterface
return $this->genericUpdatePosition(CategoryQuery::create(), $event);
}
public function addContent(CategoryAddContentEvent $event) {
public function addContent(CategoryAddContentEvent $event)
{
if (CategoryAssociatedContentQuery::create()
->filterByContentId($event->getContentId())
->filterByCategory($event->getCategory())->count() <= 0) {
@@ -156,8 +155,8 @@ class Category extends BaseAction implements EventSubscriberInterface
}
}
public function removeContent(CategoryDeleteContentEvent $event) {
public function removeContent(CategoryDeleteContentEvent $event)
{
$content = CategoryAssociatedContentQuery::create()
->filterByContentId($event->getContentId())
->filterByCategory($event->getCategory())->findOne()
@@ -170,7 +169,6 @@ class Category extends BaseAction implements EventSubscriberInterface
}
}
/**
* {@inheritDoc}
*/

View File

@@ -31,8 +31,6 @@ use Thelia\Core\Event\TheliaEvents;
use Thelia\Core\Event\UpdatePositionEvent;
use Thelia\Model\ContentQuery;
use Thelia\Model\Content as ContentModel;
use Thelia\Model\FolderQuery;
/**
* Class Content
@@ -85,8 +83,7 @@ class Content extends BaseAction implements EventSubscriberInterface
if (null !== $content = ContentQuery::create()->findPk($event->getObjectId())) {
$content->setDispatcher($this->getDispatcher());
switch($event->getMode())
{
switch ($event->getMode()) {
case UpdatePositionEvent::POSITION_ABSOLUTE:
$content->changeAbsolutePosition($event->getPosition());
break;
@@ -124,7 +121,6 @@ class Content extends BaseAction implements EventSubscriberInterface
}
}
/**
* Returns an array of event names this subscriber wants to listen to.
*

View File

@@ -33,11 +33,7 @@ use Thelia\Model\ConfigQuery;
use Thelia\Tools\FileManager;
use Thelia\Tools\URL;
use Imagine\Document\ImagineInterface;
use Imagine\Document\DocumentInterface;
use Imagine\Document\Box;
use Imagine\Document\Color;
use Imagine\Document\Point;
use Thelia\Exception\DocumentException;
use Thelia\Core\Event\TheliaEvents;
@@ -80,7 +76,8 @@ class Document extends BaseCachedFile implements EventSubscriberInterface
/**
* @return string root of the document cache directory in web space
*/
protected function getCacheDirFromWebRoot() {
protected function getCacheDirFromWebRoot()
{
return ConfigQuery::read('document_cache_dir_from_web_root', 'cache');
}

View File

@@ -33,11 +33,7 @@ use Thelia\Core\Event\TheliaEvents;
use Thelia\Core\Event\Feature\FeatureUpdateEvent;
use Thelia\Core\Event\Feature\FeatureCreateEvent;
use Thelia\Core\Event\Feature\FeatureDeleteEvent;
use Thelia\Model\ConfigQuery;
use Thelia\Model\FeatureAv;
use Thelia\Model\FeatureAvQuery;
use Thelia\Core\Event\UpdatePositionEvent;
use Thelia\Core\Event\Category\CategoryEvent;
use Thelia\Core\Event\Feature\FeatureEvent;
use Thelia\Model\FeatureTemplate;
use Thelia\Model\FeatureTemplateQuery;

View File

@@ -33,7 +33,6 @@ use Thelia\Core\Event\TheliaEvents;
use Thelia\Core\Event\Feature\FeatureAvUpdateEvent;
use Thelia\Core\Event\Feature\FeatureAvCreateEvent;
use Thelia\Core\Event\Feature\FeatureAvDeleteEvent;
use Thelia\Model\ConfigQuery;
use Thelia\Core\Event\UpdatePositionEvent;
class FeatureAv extends BaseAction implements EventSubscriberInterface
@@ -115,7 +114,6 @@ class FeatureAv extends BaseAction implements EventSubscriberInterface
return $this->genericUpdatePosition(FeatureAvQuery::create(), $event);
}
/**
* {@inheritDoc}
*/

View File

@@ -32,15 +32,13 @@ use Thelia\Core\Event\UpdatePositionEvent;
use Thelia\Model\FolderQuery;
use Thelia\Model\Folder as FolderModel;
/**
* Class Folder
* @package Thelia\Action
* @author Manuel Raynaud <mraynaud@openstudio.fr>
*/
class Folder extends BaseAction implements EventSubscriberInterface {
class Folder extends BaseAction implements EventSubscriberInterface
{
public function update(FolderUpdateEvent $event)
{
@@ -106,8 +104,7 @@ class Folder extends BaseAction implements EventSubscriberInterface {
if (null !== $folder = FolderQuery::create()->findPk($event->getObjectId())) {
$folder->setDispatcher($this->getDispatcher());
switch($event->getMode())
{
switch ($event->getMode()) {
case UpdatePositionEvent::POSITION_ABSOLUTE:
$folder->changeAbsolutePosition($event->getPosition());
break;

View File

@@ -23,19 +23,12 @@
namespace Thelia\Action;
use Propel\Runtime\ActiveRecord\ActiveRecordInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpFoundation\File\UploadedFile;
use Thelia\Core\Event\Image\ImageCreateOrUpdateEvent;
use Thelia\Core\Event\ImagesCreateOrUpdateEvent;
use Thelia\Core\Event\Image\ImageDeleteEvent;
use Thelia\Core\Event\Image\ImageEvent;
use Thelia\Model\CategoryImage;
use Thelia\Model\ConfigQuery;
use Thelia\Model\ContentImage;
use Thelia\Model\FolderImage;
use Thelia\Model\ProductImage;
use Thelia\Tools\FileManager;
use Thelia\Tools\URL;
@@ -88,12 +81,11 @@ class Image extends BaseCachedFile implements EventSubscriberInterface
const EXACT_RATIO_WITH_CROP = 2;
const KEEP_IMAGE_RATIO = 3;
/**
* @return string root of the image cache directory in web space
*/
protected function getCacheDirFromWebRoot() {
protected function getCacheDirFromWebRoot()
{
return ConfigQuery::read('image_cache_dir_from_web_root', 'cache');
}

View File

@@ -23,13 +23,11 @@
namespace Thelia\Action;
use Propel\Runtime\ActiveQuery\ModelCriteria;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Thelia\Core\Event\Order\OrderAddressEvent;
use Thelia\Core\Event\Order\OrderEvent;
use Thelia\Core\Event\TheliaEvents;
use Thelia\Exception\OrderException;
use Thelia\Exception\TheliaProcessException;
use Thelia\Model\AddressQuery;
use Thelia\Model\OrderProductAttributeCombination;
@@ -39,7 +37,6 @@ use Thelia\Model\OrderStatus;
use Thelia\Model\Map\OrderTableMap;
use Thelia\Model\OrderAddress;
use Thelia\Model\OrderStatusQuery;
use Thelia\Model\ConfigQuery;
use Thelia\Tools\I18n;
/**

View File

@@ -33,7 +33,6 @@ use Thelia\Core\Event\TheliaEvents;
use Thelia\Core\Event\Product\ProductUpdateEvent;
use Thelia\Core\Event\Product\ProductCreateEvent;
use Thelia\Core\Event\Product\ProductDeleteEvent;
use Thelia\Model\ConfigQuery;
use Thelia\Core\Event\UpdatePositionEvent;
use Thelia\Core\Event\Product\ProductToggleVisibilityEvent;
use Thelia\Core\Event\Product\ProductAddContentEvent;
@@ -41,21 +40,16 @@ use Thelia\Core\Event\Product\ProductDeleteContentEvent;
use Thelia\Model\ProductAssociatedContent;
use Thelia\Model\ProductAssociatedContentQuery;
use Thelia\Model\ProductCategory;
use Thelia\Model\TaxRule;
use Thelia\Model\TaxRuleQuery;
use Thelia\Model\TaxQuery;
use Thelia\Model\AccessoryQuery;
use Thelia\Model\Accessory;
use Thelia\Core\Event\FeatureProduct\FeatureProductUpdateEvent;
use Thelia\Model\FeatureProduct;
use Thelia\Model\FeatureQuery;
use Thelia\Core\Event\FeatureProduct\FeatureProductDeleteEvent;
use Thelia\Model\FeatureProductQuery;
use Thelia\Model\ProductCategoryQuery;
use Thelia\Core\Event\Product\ProductSetTemplateEvent;
use Thelia\Model\AttributeCombinationQuery;
use Thelia\Model\ProductSaleElementsQuery;
use Propel\Runtime\ActiveQuery\PropelQuery;
use Thelia\Core\Event\Product\ProductDeleteCategoryEvent;
use Thelia\Core\Event\Product\ProductAddCategoryEvent;
use Thelia\Model\AttributeAvQuery;
@@ -181,8 +175,8 @@ class Product extends BaseAction implements EventSubscriberInterface
return $this->genericUpdatePosition(ProductQuery::create(), $event);
}
public function addContent(ProductAddContentEvent $event) {
public function addContent(ProductAddContentEvent $event)
{
if (ProductAssociatedContentQuery::create()
->filterByContentId($event->getContentId())
->filterByProduct($event->getProduct())->count() <= 0) {
@@ -198,8 +192,8 @@ class Product extends BaseAction implements EventSubscriberInterface
}
}
public function removeContent(ProductDeleteContentEvent $event) {
public function removeContent(ProductDeleteContentEvent $event)
{
$content = ProductAssociatedContentQuery::create()
->filterByContentId($event->getContentId())
->filterByProduct($event->getProduct())->findOne()
@@ -212,8 +206,8 @@ class Product extends BaseAction implements EventSubscriberInterface
;
}
public function addCategory(ProductAddCategoryEvent $event) {
public function addCategory(ProductAddCategoryEvent $event)
{
if (ProductCategoryQuery::create()
->filterByProduct($event->getProduct())
->filterByCategoryId($event->getCategoryId())
@@ -230,8 +224,8 @@ class Product extends BaseAction implements EventSubscriberInterface
}
}
public function removeCategory(ProductDeleteCategoryEvent $event) {
public function removeCategory(ProductDeleteCategoryEvent $event)
{
$productCategory = ProductCategoryQuery::create()
->filterByProduct($event->getProduct())
->filterByCategoryId($event->getCategoryId())
@@ -240,8 +234,8 @@ class Product extends BaseAction implements EventSubscriberInterface
if ($productCategory != null) $productCategory->delete();
}
public function addAccessory(ProductAddAccessoryEvent $event) {
public function addAccessory(ProductAddAccessoryEvent $event)
{
if (AccessoryQuery::create()
->filterByAccessory($event->getAccessoryId())
->filterByProductId($event->getProduct()->getId())->count() <= 0) {
@@ -257,8 +251,8 @@ class Product extends BaseAction implements EventSubscriberInterface
}
}
public function removeAccessory(ProductDeleteAccessoryEvent $event) {
public function removeAccessory(ProductDeleteAccessoryEvent $event)
{
$accessory = AccessoryQuery::create()
->filterByAccessory($event->getAccessoryId())
->filterByProductId($event->getProduct()->getId())->findOne()
@@ -271,8 +265,8 @@ class Product extends BaseAction implements EventSubscriberInterface
;
}
public function setProductTemplate(ProductSetTemplateEvent $event) {
public function setProductTemplate(ProductSetTemplateEvent $event)
{
$product = $event->getProduct();
// Delete all product feature relations
@@ -310,8 +304,8 @@ class Product extends BaseAction implements EventSubscriberInterface
return $this->genericUpdatePosition(ProductAssociatedContentQuery::create(), $event);
}
public function updateFeatureProductValue(FeatureProductUpdateEvent $event) {
public function updateFeatureProductValue(FeatureProductUpdateEvent $event)
{
// If the feature is not free text, it may have one ore more values.
// If the value exists, we do not change it
// If the value does not exists, we create it.
@@ -343,8 +337,7 @@ class Product extends BaseAction implements EventSubscriberInterface
if ($event->getIsTextValue() == true) {
$featureProduct->setFreeTextValue($event->getFeatureValue());
}
else {
} else {
$featureProduct->setFeatureAvId($event->getFeatureValue());
}
@@ -353,8 +346,8 @@ class Product extends BaseAction implements EventSubscriberInterface
$event->setFeatureProduct($featureProduct);
}
public function deleteFeatureProductValue(FeatureProductDeleteEvent $event) {
public function deleteFeatureProductValue(FeatureProductDeleteEvent $event)
{
$featureProduct = FeatureProductQuery::create()
->filterByProductId($event->getProductId())
->filterByFeatureId($event->getFeatureId())
@@ -362,8 +355,8 @@ class Product extends BaseAction implements EventSubscriberInterface
;
}
public function createProductCombination(ProductCreateCombinationEvent $event) {
public function createProductCombination(ProductCreateCombinationEvent $event)
{
$con = Propel::getWriteConnection(ProductTableMap::DATABASE_NAME);
$con->beginTransaction();
@@ -417,8 +410,7 @@ class Product extends BaseAction implements EventSubscriberInterface
// Store all the stuff !
$con->commit();
}
catch(\Exception $ex) {
} catch (\Exception $ex) {
$con->rollback();
@@ -426,8 +418,8 @@ class Product extends BaseAction implements EventSubscriberInterface
}
}
public function deleteProductCombination(ProductDeleteCombinationEvent $event) {
public function deleteProductCombination(ProductDeleteCombinationEvent $event)
{
if (null !== $pse = ProductSaleElementsQuery::create()->findPk($event->getProductSaleElementId())) {
$pse->delete();
}

View File

@@ -33,14 +33,7 @@ use Thelia\Core\Event\TheliaEvents;
use Thelia\Core\Event\Template\TemplateUpdateEvent;
use Thelia\Core\Event\Template\TemplateCreateEvent;
use Thelia\Core\Event\Template\TemplateDeleteEvent;
use Thelia\Model\ConfigQuery;
use Thelia\Model\TemplateAv;
use Thelia\Model\TemplateAvQuery;
use Thelia\Core\Event\UpdatePositionEvent;
use Thelia\Core\Event\Category\CategoryEvent;
use Thelia\Core\Event\Template\TemplateEvent;
use Thelia\Model\TemplateTemplate;
use Thelia\Model\TemplateTemplateQuery;
use Thelia\Model\ProductQuery;
use Thelia\Core\Event\Template\TemplateAddAttributeEvent;
use Thelia\Core\Event\Template\TemplateDeleteAttributeEvent;
@@ -121,8 +114,8 @@ class Template extends BaseAction implements EventSubscriberInterface
}
}
public function addAttribute(TemplateAddAttributeEvent $event) {
public function addAttribute(TemplateAddAttributeEvent $event)
{
if (null === AttributeTemplateQuery::create()->filterByAttributeId($event->getAttributeId())->filterByTemplate($event->getTemplate())->findOne()) {
$attribute_template = new AttributeTemplate();
@@ -155,8 +148,8 @@ class Template extends BaseAction implements EventSubscriberInterface
return $this->genericUpdatePosition(FeatureTemplateQuery::create(), $event);
}
public function deleteAttribute(TemplateDeleteAttributeEvent $event) {
public function deleteAttribute(TemplateDeleteAttributeEvent $event)
{
$attribute_template = AttributeTemplateQuery::create()
->filterByAttributeId($event->getAttributeId())
->filterByTemplate($event->getTemplate())->findOne()
@@ -165,8 +158,8 @@ class Template extends BaseAction implements EventSubscriberInterface
if ($attribute_template !== null) $attribute_template->delete();
}
public function addFeature(TemplateAddFeatureEvent $event) {
public function addFeature(TemplateAddFeatureEvent $event)
{
if (null === FeatureTemplateQuery::create()->filterByFeatureId($event->getFeatureId())->filterByTemplate($event->getTemplate())->findOne()) {
$feature_template = new FeatureTemplate();
@@ -179,8 +172,8 @@ class Template extends BaseAction implements EventSubscriberInterface
}
}
public function deleteFeature(TemplateDeleteFeatureEvent $event) {
public function deleteFeature(TemplateDeleteFeatureEvent $event)
{
$feature_template = FeatureTemplateQuery::create()
->filterByFeatureId($event->getFeatureId())
->filterByTemplate($event->getTemplate())->findOne()

View File

@@ -77,6 +77,7 @@ class CacheClear extends ContainerAwareCommand
// throws same exception code for does not exist and permission denied ...
if (!file_exists($dir)) {
$output->writeln(sprintf("<info>%s cache dir already clear</info>", $dir));
return;
}

View File

@@ -25,12 +25,9 @@ namespace Thelia\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\Filesystem\Exception\IOException;
use Thelia\Command\ContainerAwareCommand;
use Thelia\Model\ModuleQuery;
/**

View File

@@ -25,7 +25,6 @@ namespace Thelia\Controller\Admin;
use Thelia\Form\Exception\FormValidationException;
use Thelia\Core\Event\UpdatePositionEvent;
use Thelia\Core\Event\ToggleVisibilityEvent;
/**
* An abstract CRUD controller for Thelia ADMIN, to manage basic CRUD operations on a givent object.
@@ -53,7 +52,6 @@ abstract class AbstractCrudController extends BaseAdminController
protected $visibilityToggleEventIdentifier;
protected $changePositionEventIdentifier;
/**
* @param string $objectName the lower case object name. Example. "message"
*
@@ -109,94 +107,93 @@ abstract class AbstractCrudController extends BaseAdminController
/**
* Return the creation form for this object
*/
protected abstract function getCreationForm();
abstract protected function getCreationForm();
/**
* Return the update form for this object
*/
protected abstract function getUpdateForm();
abstract protected function getUpdateForm();
/**
* Hydrate the update form for this object, before passing it to the update template
*
* @param unknown $object
*/
protected abstract function hydrateObjectForm($object);
abstract protected function hydrateObjectForm($object);
/**
* Creates the creation event with the provided form data
*
* @param unknown $formData
*/
protected abstract function getCreationEvent($formData);
abstract protected function getCreationEvent($formData);
/**
* Creates the update event with the provided form data
*
* @param unknown $formData
*/
protected abstract function getUpdateEvent($formData);
abstract protected function getUpdateEvent($formData);
/**
* Creates the delete event with the provided form data
*/
protected abstract function getDeleteEvent();
abstract protected function getDeleteEvent();
/**
* Return true if the event contains the object, e.g. the action has updated the object in the event.
*
* @param unknown $event
*/
protected abstract function eventContainsObject($event);
abstract protected function eventContainsObject($event);
/**
* Get the created object from an event.
*
* @param unknown $createEvent
*/
protected abstract function getObjectFromEvent($event);
abstract protected function getObjectFromEvent($event);
/**
* Load an existing object from the database
*/
protected abstract function getExistingObject();
abstract protected function getExistingObject();
/**
* Returns the object label form the object event (name, title, etc.)
*
* @param unknown $object
*/
protected abstract function getObjectLabel($object);
abstract protected function getObjectLabel($object);
/**
* Returns the object ID from the object
*
* @param unknown $object
*/
protected abstract function getObjectId($object);
abstract protected function getObjectId($object);
/**
* Render the main list template
*
* @param unknown $currentOrder, if any, null otherwise.
*/
protected abstract function renderListTemplate($currentOrder);
abstract protected function renderListTemplate($currentOrder);
/**
* Render the edition template
*/
protected abstract function renderEditionTemplate();
abstract protected function renderEditionTemplate();
/**
* Redirect to the edition template
*/
protected abstract function redirectToEditionTemplate();
abstract protected function redirectToEditionTemplate();
/**
* Redirect to the list template
*/
protected abstract function redirectToListTemplate();
abstract protected function redirectToListTemplate();
protected function createUpdatePositionEvent($positionChangeMode, $positionValue)
{
@@ -282,7 +279,6 @@ abstract class AbstractCrudController extends BaseAdminController
public function defaultAction()
{
if (null !== $response = $this->checkAuth($this->viewPermissionIdentifier)) return $response;
return $this->renderList();
}
@@ -329,16 +325,13 @@ abstract class AbstractCrudController extends BaseAdminController
// Redirect to the success URL
$this->redirect($successUrl);
}
else {
} else {
return $response;
}
}
catch (FormValidationException $ex) {
} catch (FormValidationException $ex) {
// Form cannot be validated
$error_msg = $this->createStandardFormValidationErrorMessage($ex);
}
catch (\Exception $ex) {
} catch (\Exception $ex) {
// Any other error
$error_msg = $ex->getMessage();
}
@@ -423,16 +416,13 @@ abstract class AbstractCrudController extends BaseAdminController
// Redirect to the success URL
$this->redirect($changeForm->getSuccessUrl());
}
else {
} else {
return $response;
}
}
catch (FormValidationException $ex) {
} catch (FormValidationException $ex) {
// Form cannot be validated
$error_msg = $this->createStandardFormValidationErrorMessage($ex);
}
catch (\Exception $ex) {
} catch (\Exception $ex) {
// Any other error
$error_msg = $ex->getMessage();
}
@@ -469,8 +459,7 @@ abstract class AbstractCrudController extends BaseAdminController
$event = $this->createUpdatePositionEvent($mode, $position);
$this->dispatch($this->changePositionEventIdentifier, $event);
}
catch (\Exception $ex) {
} catch (\Exception $ex) {
// Any error
return $this->errorPage($ex);
}
@@ -479,14 +468,13 @@ abstract class AbstractCrudController extends BaseAdminController
if ($response == null) {
$this->redirectToListTemplate();
}
else {
} else {
return $response;
}
}
protected function genericUpdatePositionAction($object, $eventName, $doFinalRedirect = true) {
protected function genericUpdatePositionAction($object, $eventName, $doFinalRedirect = true)
{
// Check current user authorization
if (null !== $response = $this->checkAuth($this->updatePermissionIdentifier)) return $response;
@@ -507,8 +495,7 @@ abstract class AbstractCrudController extends BaseAdminController
$event = new UpdatePositionEvent($object->getId(), $mode, $position);
$this->dispatch($eventName, $event);
}
catch (\Exception $ex) {
} catch (\Exception $ex) {
// Any error
return $this->errorPage($ex);
}

View File

@@ -23,10 +23,6 @@
namespace Thelia\Controller\Admin;
use Thelia\Core\Security\Authentication\AdminTokenAuthenticator;
use Thelia\Model\ConfigQuery;
use Thelia\Core\Security\Exception\TokenAuthenticationException;
class AdminController extends BaseAdminController
{
public function indexAction()

View File

@@ -262,8 +262,7 @@ class AttributeController extends AbstractCrudController
$this->dispatch($eventType, $event);
}
}
catch (\Exception $ex) {
} catch (\Exception $ex) {
// Any error
return $this->errorPage($ex);
}

View File

@@ -293,7 +293,6 @@ class BaseAdminController extends BaseController
return $this->getCurrentEditionLang()->getLocale();
}
/**
* Return the current list order identifier for a given object name,
* updating in using the current request.
@@ -305,8 +304,8 @@ class BaseAdminController extends BaseController
*
* @return String the current liste order.
*/
protected function getListOrderFromSession($objectName, $requestParameterName, $defaultListOrder, $updateSession = true) {
protected function getListOrderFromSession($objectName, $requestParameterName, $defaultListOrder, $updateSession = true)
{
$order = $defaultListOrder;
$orderSessionIdentifier = sprintf("admin.%s.currentListOrder", $objectName);
@@ -318,7 +317,6 @@ class BaseAdminController extends BaseController
);
if ($updateSession) $this->getSession()->set($orderSessionIdentifier, $order);
return $order;
}
@@ -353,8 +351,8 @@ class BaseAdminController extends BaseController
/** Clear the remember me cookie.
*
*/
protected function clearRememberMeCookie() {
protected function clearRememberMeCookie()
{
$ctp = new CookieTokenProvider();
$cookieName = ConfigQuery::read('admin_remember_me_cookie_name', 'armcn');

View File

@@ -24,7 +24,6 @@
namespace Thelia\Controller\Admin;
use Symfony\Component\HttpFoundation\Response;
use Thelia\Log\Tlog;
use Thelia\Core\Event\Category\CategoryDeleteEvent;
use Thelia\Core\Event\TheliaEvents;
use Thelia\Core\Event\Category\CategoryUpdateEvent;
@@ -36,7 +35,6 @@ use Thelia\Core\Event\UpdatePositionEvent;
use Thelia\Core\Event\Category\CategoryToggleVisibilityEvent;
use Thelia\Core\Event\Category\CategoryDeleteContentEvent;
use Thelia\Core\Event\Category\CategoryAddContentEvent;
use Thelia\Model\CategoryAssociatedContent;
use Thelia\Model\FolderQuery;
use Thelia\Model\ContentQuery;
use Propel\Runtime\ActiveQuery\Criteria;
@@ -49,7 +47,8 @@ use Thelia\Model\CategoryAssociatedContentQuery;
*/
class CategoryController extends AbstractCrudController
{
public function __construct() {
public function __construct()
{
parent::__construct(
'category',
'manual',
@@ -68,15 +67,18 @@ class CategoryController extends AbstractCrudController
);
}
protected function getCreationForm() {
protected function getCreationForm()
{
return new CategoryCreationForm($this->getRequest());
}
protected function getUpdateForm() {
protected function getUpdateForm()
{
return new CategoryModificationForm($this->getRequest());
}
protected function getCreationEvent($formData) {
protected function getCreationEvent($formData)
{
$createEvent = new CategoryCreateEvent();
$createEvent
@@ -89,7 +91,8 @@ class CategoryController extends AbstractCrudController
return $createEvent;
}
protected function getUpdateEvent($formData) {
protected function getUpdateEvent($formData)
{
$changeEvent = new CategoryUpdateEvent($formData['id']);
// Create and dispatch the change event
@@ -107,8 +110,8 @@ class CategoryController extends AbstractCrudController
return $changeEvent;
}
protected function createUpdatePositionEvent($positionChangeMode, $positionValue) {
protected function createUpdatePositionEvent($positionChangeMode, $positionValue)
{
return new UpdatePositionEvent(
$this->getRequest()->get('category_id', null),
$positionChangeMode,
@@ -116,16 +119,18 @@ class CategoryController extends AbstractCrudController
);
}
protected function getDeleteEvent() {
protected function getDeleteEvent()
{
return new CategoryDeleteEvent($this->getRequest()->get('category_id', 0));
}
protected function eventContainsObject($event) {
protected function eventContainsObject($event)
{
return $event->hasCategory();
}
protected function hydrateObjectForm($object) {
protected function hydrateObjectForm($object)
{
// Prepare the data that will hydrate the form
$data = array(
'id' => $object->getId(),
@@ -143,21 +148,25 @@ class CategoryController extends AbstractCrudController
return new CategoryModificationForm($this->getRequest(), "form", $data);
}
protected function getObjectFromEvent($event) {
protected function getObjectFromEvent($event)
{
return $event->hasCategory() ? $event->getCategory() : null;
}
protected function getExistingObject() {
protected function getExistingObject()
{
return CategoryQuery::create()
->joinWithI18n($this->getCurrentEditionLocale())
->findOneById($this->getRequest()->get('category_id', 0));
}
protected function getObjectLabel($object) {
protected function getObjectLabel($object)
{
return $object->getTitle();
}
protected function getObjectId($object) {
protected function getObjectId($object)
{
return $object->getId();
}
@@ -170,8 +179,8 @@ class CategoryController extends AbstractCrudController
);
}
protected function renderListTemplate($currentOrder) {
protected function renderListTemplate($currentOrder)
{
// Get product order
$product_order = $this->getListOrderFromSession('product', 'product_order', 'manual');
@@ -183,19 +192,21 @@ class CategoryController extends AbstractCrudController
));
}
protected function redirectToListTemplate() {
protected function redirectToListTemplate()
{
$this->redirectToRoute(
'admin.categories.default',
array('category_id' => $this->getRequest()->get('category_id', 0))
);
}
protected function renderEditionTemplate() {
protected function renderEditionTemplate()
{
return $this->render('category-edit', $this->getEditionArguments());
}
protected function redirectToEditionTemplate() {
protected function redirectToEditionTemplate()
{
$this->redirectToRoute("admin.categories.update", $this->getEditionArguments());
}
@@ -257,8 +268,8 @@ class CategoryController extends AbstractCrudController
return null;
}
public function getAvailableRelatedContentAction($categoryId, $folderId) {
public function getAvailableRelatedContentAction($categoryId, $folderId)
{
$result = array();
$folders = FolderQuery::create()->filterById($folderId)->find();
@@ -282,8 +293,8 @@ class CategoryController extends AbstractCrudController
return $this->jsonResponse(json_encode($result));
}
public function addRelatedContentAction() {
public function addRelatedContentAction()
{
// Check current user authorization
if (null !== $response = $this->checkAuth("admin.categories.update")) return $response;
@@ -298,8 +309,7 @@ class CategoryController extends AbstractCrudController
try {
$this->dispatch(TheliaEvents::CATEGORY_ADD_CONTENT, $event);
}
catch (\Exception $ex) {
} catch (\Exception $ex) {
// Any error
return $this->errorPage($ex);
}
@@ -341,8 +351,8 @@ class CategoryController extends AbstractCrudController
$this->redirectToEditionTemplate();
}
public function deleteRelatedContentAction() {
public function deleteRelatedContentAction()
{
// Check current user authorization
if (null !== $response = $this->checkAuth("admin.categories.update")) return $response;
@@ -357,8 +367,7 @@ class CategoryController extends AbstractCrudController
try {
$this->dispatch(TheliaEvents::CATEGORY_REMOVE_CONTENT, $event);
}
catch (\Exception $ex) {
} catch (\Exception $ex) {
// Any error
return $this->errorPage($ex);
}

View File

@@ -30,7 +30,6 @@ use Thelia\Core\Event\Config\ConfigCreateEvent;
use Thelia\Model\ConfigQuery;
use Thelia\Form\ConfigModificationForm;
use Thelia\Form\ConfigCreationForm;
use Thelia\Core\Event\UpdatePositionEvent;
/**
* Manages variables
@@ -39,7 +38,8 @@ use Thelia\Core\Event\UpdatePositionEvent;
*/
class ConfigController extends AbstractCrudController
{
public function __construct() {
public function __construct()
{
parent::__construct(
'variable',
'name',
@@ -58,15 +58,18 @@ class ConfigController extends AbstractCrudController
);
}
protected function getCreationForm() {
protected function getCreationForm()
{
return new ConfigCreationForm($this->getRequest());
}
protected function getUpdateForm() {
protected function getUpdateForm()
{
return new ConfigModificationForm($this->getRequest());
}
protected function getCreationEvent($data) {
protected function getCreationEvent($data)
{
$createEvent = new ConfigCreateEvent();
$createEvent
@@ -78,11 +81,11 @@ class ConfigController extends AbstractCrudController
->setSecured($data['secured'])
;
return $createEvent;
}
protected function getUpdateEvent($data) {
protected function getUpdateEvent($data)
{
$changeEvent = new ConfigUpdateEvent($data['id']);
// Create and dispatch the change event
@@ -101,16 +104,18 @@ class ConfigController extends AbstractCrudController
return $changeEvent;
}
protected function getDeleteEvent() {
protected function getDeleteEvent()
{
return new ConfigDeleteEvent($this->getRequest()->get('variable_id'));
}
protected function eventContainsObject($event) {
protected function eventContainsObject($event)
{
return $event->hasConfig();
}
protected function hydrateObjectForm($object) {
protected function hydrateObjectForm($object)
{
// Prepare the data that will hydrate the form
$data = array(
'id' => $object->getId(),
@@ -129,40 +134,48 @@ class ConfigController extends AbstractCrudController
return new ConfigModificationForm($this->getRequest(), "form", $data);
}
protected function getObjectFromEvent($event) {
protected function getObjectFromEvent($event)
{
return $event->hasConfig() ? $event->getConfig() : null;
}
protected function getExistingObject() {
protected function getExistingObject()
{
return ConfigQuery::create()
->joinWithI18n($this->getCurrentEditionLocale())
->findOneById($this->getRequest()->get('variable_id'));
}
protected function getObjectLabel($object) {
protected function getObjectLabel($object)
{
return $object->getName();
}
protected function getObjectId($object) {
protected function getObjectId($object)
{
return $object->getId();
}
protected function renderListTemplate($currentOrder) {
protected function renderListTemplate($currentOrder)
{
return $this->render('variables', array('order' => $currentOrder));
}
protected function renderEditionTemplate() {
protected function renderEditionTemplate()
{
return $this->render('variable-edit', array('variable_id' => $this->getRequest()->get('variable_id')));
}
protected function redirectToEditionTemplate() {
protected function redirectToEditionTemplate()
{
$this->redirectToRoute(
"admin.configuration.variables.update",
array('variable_id' => $this->getRequest()->get('variable_id'))
);
}
protected function redirectToListTemplate() {
protected function redirectToListTemplate()
{
$this->redirectToRoute('admin.configuration.variables.default');
}

View File

@@ -32,7 +32,6 @@ use Thelia\Form\ContentCreationForm;
use Thelia\Form\ContentModificationForm;
use Thelia\Model\ContentQuery;
/**
* Class ContentController
* @package Thelia\Controller\Admin

View File

@@ -31,7 +31,6 @@ use Thelia\Core\Event\Condition\ConditionCreateOrUpdateEvent;
use Thelia\Core\Event\Coupon\CouponConsumeEvent;
use Thelia\Core\Event\Coupon\CouponCreateOrUpdateEvent;
use Thelia\Core\Event\TheliaEvents;
use Thelia\Core\Translation\Translator;
use Thelia\Coupon\CouponManager;
use Thelia\Coupon\ConditionCollection;
use Thelia\Coupon\Type\CouponInterface;
@@ -299,7 +298,6 @@ var_dump($coupon->getIsRemovingPostage());;
);
}
/**
* Manage Coupons read display
*
@@ -613,6 +611,4 @@ var_dump($coupon->getIsRemovingPostage());;
// }
// }
}

View File

@@ -39,7 +39,8 @@ use Thelia\Core\Event\UpdatePositionEvent;
*/
class CurrencyController extends AbstractCrudController
{
public function __construct() {
public function __construct()
{
parent::__construct(
'currency',
'manual',
@@ -58,15 +59,18 @@ class CurrencyController extends AbstractCrudController
);
}
protected function getCreationForm() {
protected function getCreationForm()
{
return new CurrencyCreationForm($this->getRequest());
}
protected function getUpdateForm() {
protected function getUpdateForm()
{
return new CurrencyModificationForm($this->getRequest());
}
protected function getCreationEvent($formData) {
protected function getCreationEvent($formData)
{
$createEvent = new CurrencyCreateEvent();
$createEvent
@@ -80,7 +84,8 @@ class CurrencyController extends AbstractCrudController
return $createEvent;
}
protected function getUpdateEvent($formData) {
protected function getUpdateEvent($formData)
{
$changeEvent = new CurrencyUpdateEvent($formData['id']);
// Create and dispatch the change event
@@ -95,8 +100,8 @@ class CurrencyController extends AbstractCrudController
return $changeEvent;
}
protected function createUpdatePositionEvent($positionChangeMode, $positionValue) {
protected function createUpdatePositionEvent($positionChangeMode, $positionValue)
{
return new UpdatePositionEvent(
$this->getRequest()->get('currency_id', null),
$positionChangeMode,
@@ -104,16 +109,18 @@ class CurrencyController extends AbstractCrudController
);
}
protected function getDeleteEvent() {
protected function getDeleteEvent()
{
return new CurrencyDeleteEvent($this->getRequest()->get('currency_id'));
}
protected function eventContainsObject($event) {
protected function eventContainsObject($event)
{
return $event->hasCurrency();
}
protected function hydrateObjectForm($object) {
protected function hydrateObjectForm($object)
{
// Prepare the data that will hydrate the form
$data = array(
'id' => $object->getId(),
@@ -128,44 +135,51 @@ class CurrencyController extends AbstractCrudController
return new CurrencyModificationForm($this->getRequest(), "form", $data);
}
protected function getObjectFromEvent($event) {
protected function getObjectFromEvent($event)
{
return $event->hasCurrency() ? $event->getCurrency() : null;
}
protected function getExistingObject() {
protected function getExistingObject()
{
return CurrencyQuery::create()
->joinWithI18n($this->getCurrentEditionLocale())
->findOneById($this->getRequest()->get('currency_id'));
}
protected function getObjectLabel($object) {
protected function getObjectLabel($object)
{
return $object->getName();
}
protected function getObjectId($object) {
protected function getObjectId($object)
{
return $object->getId();
}
protected function renderListTemplate($currentOrder) {
protected function renderListTemplate($currentOrder)
{
return $this->render('currencies', array('order' => $currentOrder));
}
protected function renderEditionTemplate() {
protected function renderEditionTemplate()
{
return $this->render('currency-edit', array('currency_id' => $this->getRequest()->get('currency_id')));
}
protected function redirectToEditionTemplate() {
protected function redirectToEditionTemplate()
{
$this->redirectToRoute(
"admin.configuration.currencies.update",
array('currency_id' => $this->getRequest()->get('currency_id'))
);
}
protected function redirectToListTemplate() {
protected function redirectToListTemplate()
{
$this->redirectToRoute('admin.configuration.currencies.default');
}
/**
* Update currencies rates
*/

View File

@@ -48,7 +48,6 @@ class CustomerController extends BaseAdminController
public function viewAction($customer_id)
{
if (null !== $response = $this->checkAuth("admin.customer.view")) return $response;
return $this->render("customer-edit", array(
"customer_id" => $customer_id
));

View File

@@ -262,8 +262,7 @@ class FeatureController extends AbstractCrudController
$this->dispatch($eventType, $event);
}
}
catch (\Exception $ex) {
} catch (\Exception $ex) {
// Any error
return $this->errorPage($ex);
}

View File

@@ -25,15 +25,12 @@ namespace Thelia\Controller\Admin;
use Propel\Runtime\Exception\PropelException;
use Symfony\Component\HttpFoundation\File\UploadedFile;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Router;
use Thelia\Core\Event\Document\DocumentCreateOrUpdateEvent;
use Thelia\Core\Event\Document\DocumentDeleteEvent;
use Thelia\Core\Event\Image\ImageCreateOrUpdateEvent;
use Thelia\Core\Event\Image\ImageDeleteEvent;
use Thelia\Core\Event\TheliaEvents;
use Thelia\Core\Translation\Translator;
use Thelia\Form\Exception\FormValidationException;
use Thelia\Log\Tlog;
use Thelia\Model\CategoryDocument;
@@ -62,7 +59,6 @@ use Thelia\Tools\Rest\ResponseRest;
class FileController extends BaseAdminController
{
/**
* Manage how a image collection has to be saved
*
@@ -126,14 +122,12 @@ class FileController extends BaseAdminController
$imageCreateOrUpdateEvent->setUploadedFile($fileBeingUploaded);
$imageCreateOrUpdateEvent->setParentName($parentModel->getTitle());
// Dispatch Event to the Action
$this->dispatch(
TheliaEvents::IMAGE_SAVE,
$imageCreateOrUpdateEvent
);
return new ResponseRest(array('status' => true, 'message' => ''));
}
}
@@ -192,14 +186,12 @@ class FileController extends BaseAdminController
$documentCreateOrUpdateEvent->setUploadedFile($fileBeingUploaded);
$documentCreateOrUpdateEvent->setParentName($parentModel->getTitle());
// Dispatch Event to the Action
$this->dispatch(
TheliaEvents::DOCUMENT_SAVE,
$documentCreateOrUpdateEvent
);
return new ResponseRest(array('status' => true, 'message' => ''));
}
}
@@ -676,5 +668,4 @@ class FileController extends BaseAdminController
return $documentCreateEvent;
}
}

View File

@@ -81,8 +81,8 @@ class FolderController extends AbstractCrudController
*
* @param \Thelia\Model\Folder $object
*/
protected function hydrateObjectForm($object) {
protected function hydrateObjectForm($object)
{
// Prepare the data that will hydrate the form
$data = array(
'id' => $object->getId(),
@@ -162,8 +162,8 @@ class FolderController extends AbstractCrudController
* @param $positionValue
* @return UpdatePositionEvent|void
*/
protected function createUpdatePositionEvent($positionChangeMode, $positionValue) {
protected function createUpdatePositionEvent($positionChangeMode, $positionValue)
{
return new UpdatePositionEvent(
$this->getRequest()->get('folder_id', null),
$positionChangeMode,
@@ -196,7 +196,8 @@ class FolderController extends AbstractCrudController
/**
* Load an existing object from the database
*/
protected function getExistingObject() {
protected function getExistingObject()
{
return FolderQuery::create()
->joinWithI18n($this->getCurrentEditionLocale())
->findOneById($this->getRequest()->get('folder_id', 0));
@@ -207,7 +208,8 @@ class FolderController extends AbstractCrudController
*
* @param unknown $object
*/
protected function getObjectLabel($object) {
protected function getObjectLabel($object)
{
return $object->getTitle();
}
@@ -226,8 +228,8 @@ class FolderController extends AbstractCrudController
*
* @param unknown $currentOrder, if any, null otherwise.
*/
protected function renderListTemplate($currentOrder) {
protected function renderListTemplate($currentOrder)
{
// Get content order
$content_order = $this->getListOrderFromSession('content', 'content_order', 'manual');
@@ -239,12 +241,11 @@ class FolderController extends AbstractCrudController
));
}
/**
* Render the edition template
*/
protected function renderEditionTemplate() {
protected function renderEditionTemplate()
{
return $this->render('folder-edit', $this->getEditionArguments());
}

View File

@@ -38,7 +38,6 @@ class ModuleController extends BaseAdminController
public function updateAction($module_id)
{
return $this->render("module-edit", array(
"module_id" => $module_id
));

View File

@@ -26,7 +26,6 @@ namespace Thelia\Controller\Admin;
use Thelia\Core\Event\Order\OrderAddressEvent;
use Thelia\Core\Event\Order\OrderEvent;
use Thelia\Core\Event\TheliaEvents;
use Thelia\Core\Translation\Translator;
use Thelia\Form\OrderUpdateAddress;
use Thelia\Model\Base\OrderAddressQuery;
use Thelia\Model\OrderQuery;
@@ -48,7 +47,6 @@ class OrderController extends BaseAdminController
public function viewAction($order_id)
{
return $this->render("order-edit", array(
"order_id" => $order_id
));

View File

@@ -34,7 +34,6 @@ use Thelia\Core\Event\UpdatePositionEvent;
use Thelia\Core\Event\Product\ProductToggleVisibilityEvent;
use Thelia\Core\Event\Product\ProductDeleteContentEvent;
use Thelia\Core\Event\Product\ProductAddContentEvent;
use Thelia\Model\ProductAssociatedContent;
use Thelia\Model\FolderQuery;
use Thelia\Model\ContentQuery;
use Propel\Runtime\ActiveQuery\Criteria;
@@ -76,8 +75,8 @@ class ProductController extends AbstractCrudController
/**
* Attributes ajax tab loading
*/
public function loadAttributesAjaxTabAction() {
public function loadAttributesAjaxTabAction()
{
return $this->render(
'ajax/product-attributes-tab',
array(
@@ -89,8 +88,8 @@ class ProductController extends AbstractCrudController
/**
* Related information ajax tab loading
*/
public function loadRelatedAjaxTabAction() {
public function loadRelatedAjaxTabAction()
{
return $this->render(
'ajax/product-related-tab',
array(
@@ -229,7 +228,8 @@ class ProductController extends AbstractCrudController
);
}
protected function getCategoryId() {
protected function getCategoryId()
{
// Trouver le category_id, soit depuis la reques, souit depuis le produit courant
$category_id = $this->getRequest()->get('category_id', null);
@@ -366,8 +366,7 @@ class ProductController extends AbstractCrudController
try {
$this->dispatch(TheliaEvents::PRODUCT_ADD_CONTENT, $event);
}
catch (\Exception $ex) {
} catch (\Exception $ex) {
// Any error
return $this->errorPage($ex);
}
@@ -393,8 +392,7 @@ class ProductController extends AbstractCrudController
try {
$this->dispatch(TheliaEvents::PRODUCT_REMOVE_CONTENT, $event);
}
catch (\Exception $ex) {
} catch (\Exception $ex) {
// Any error
return $this->errorPage($ex);
}
@@ -403,7 +401,6 @@ class ProductController extends AbstractCrudController
$this->redirectToEditionTemplate();
}
// -- Accessories management ----------------------------------------------
public function getAvailableAccessoriesAction($productId, $categoryId)
@@ -447,8 +444,7 @@ class ProductController extends AbstractCrudController
try {
$this->dispatch(TheliaEvents::PRODUCT_ADD_ACCESSORY, $event);
}
catch (\Exception $ex) {
} catch (\Exception $ex) {
// Any error
return $this->errorPage($ex);
}
@@ -473,8 +469,7 @@ class ProductController extends AbstractCrudController
try {
$this->dispatch(TheliaEvents::PRODUCT_REMOVE_ACCESSORY, $event);
}
catch (\Exception $ex) {
} catch (\Exception $ex) {
// Any error
return $this->errorPage($ex);
}
@@ -514,7 +509,8 @@ class ProductController extends AbstractCrudController
*
* @param unknown $productId
*/
public function setProductTemplateAction($productId) {
public function setProductTemplateAction($productId)
{
// Check current user authorization
if (null !== $response = $this->checkAuth('admin.products.update')) return $response;
@@ -536,8 +532,8 @@ class ProductController extends AbstractCrudController
/**
* Update product attributes and features
*/
public function updateAttributesAndFeaturesAction($productId) {
public function updateAttributesAndFeaturesAction($productId)
{
$product = ProductQuery::create()->findPk($productId);
if ($product != null) {
@@ -610,8 +606,8 @@ class ProductController extends AbstractCrudController
$this->redirectToListTemplate();
}
public function addAdditionalCategoryAction() {
public function addAdditionalCategoryAction()
{
// Check current user authorization
if (null !== $response = $this->checkAuth("admin.products.update")) return $response;
@@ -626,8 +622,7 @@ class ProductController extends AbstractCrudController
try {
$this->dispatch(TheliaEvents::PRODUCT_ADD_CATEGORY, $event);
}
catch (\Exception $ex) {
} catch (\Exception $ex) {
// Any error
return $this->errorPage($ex);
}
@@ -636,8 +631,8 @@ class ProductController extends AbstractCrudController
$this->redirectToEditionTemplate();
}
public function deleteAdditionalCategoryAction() {
public function deleteAdditionalCategoryAction()
{
// Check current user authorization
if (null !== $response = $this->checkAuth("admin.products.update")) return $response;
@@ -652,8 +647,7 @@ class ProductController extends AbstractCrudController
try {
$this->dispatch(TheliaEvents::PRODUCT_REMOVE_CATEGORY, $event);
}
catch (\Exception $ex) {
} catch (\Exception $ex) {
// Any error
return $this->errorPage($ex);
}
@@ -664,8 +658,8 @@ class ProductController extends AbstractCrudController
// -- Product combination management ---------------------------------------
public function getAttributeValuesAction($productId, $attributeId) {
public function getAttributeValuesAction($productId, $attributeId)
{
$result = array();
// Get attribute for this product
@@ -689,8 +683,8 @@ class ProductController extends AbstractCrudController
return $this->jsonResponse(json_encode($result));
}
public function addAttributeValueToCombinationAction($productId, $attributeAvId, $combination) {
public function addAttributeValueToCombinationAction($productId, $attributeAvId, $combination)
{
$result = array();
// Get attribute for this product
@@ -734,8 +728,8 @@ class ProductController extends AbstractCrudController
/**
* A a new combination to a product
*/
public function addCombinationAction() {
public function addCombinationAction()
{
// Check current user authorization
if (null !== $response = $this->checkAuth("admin.products.update")) return $response;
@@ -747,8 +741,7 @@ class ProductController extends AbstractCrudController
try {
$this->dispatch(TheliaEvents::PRODUCT_ADD_COMBINATION, $event);
}
catch (\Exception $ex) {
} catch (\Exception $ex) {
// Any error
return $this->errorPage($ex);
}
@@ -760,8 +753,8 @@ class ProductController extends AbstractCrudController
/**
* A a new combination to a product
*/
public function deleteCombinationAction() {
public function deleteCombinationAction()
{
// Check current user authorization
if (null !== $response = $this->checkAuth("admin.products.update")) return $response;
@@ -772,8 +765,7 @@ class ProductController extends AbstractCrudController
try {
$this->dispatch(TheliaEvents::PRODUCT_DELETE_COMBINATION, $event);
}
catch (\Exception $ex) {
} catch (\Exception $ex) {
// Any error
return $this->errorPage($ex);
}

View File

@@ -31,9 +31,7 @@ use Thelia\Tools\URL;
use Thelia\Tools\Redirect;
use Thelia\Core\Event\TheliaEvents;
use Thelia\Core\Security\Authentication\AdminTokenAuthenticator;
use Thelia\Core\Security\UserProvider\TokenProvider;
use Symfony\Component\HttpFoundation\Cookie;
use Thelia\Core\Security\UserProvider\CookieTokenProvider;
use Thelia\Core\Security\Exception\TokenAuthenticationException;
class SessionController extends BaseAdminController
@@ -59,8 +57,7 @@ class SessionController extends BaseAdminController
// Render the home page
return $this->render("home");
}
catch (TokenAuthenticationException $ex) {
} catch (TokenAuthenticationException $ex) {
$this->adminLogAppend("Token based authentication failed.");
// Clear the cookie

View File

@@ -38,7 +38,6 @@ class ShippingConfigurationController extends BaseAdminController
public function updateAction($shipping_configuration_id)
{
return $this->render("shipping-configuration-edit", array(
"shipping_configuration_id" => $shipping_configuration_id
));

View File

@@ -38,7 +38,6 @@ class ShippingZoneController extends BaseAdminController
public function updateAction($shipping_zones_id)
{
return $this->render("shipping-zones-edit", array(
"shipping_zones_id" => $shipping_zones_id
));

View File

@@ -30,10 +30,6 @@ use Thelia\Core\Event\Template\TemplateCreateEvent;
use Thelia\Model\TemplateQuery;
use Thelia\Form\TemplateModificationForm;
use Thelia\Form\TemplateCreationForm;
use Thelia\Core\Event\UpdatePositionEvent;
use Thelia\Model\TemplateAv;
use Thelia\Model\TemplateAvQuery;
use Thelia\Core\Event\Template\TemplateEvent;
use Thelia\Core\Event\Template\TemplateDeleteAttributeEvent;
use Thelia\Core\Event\Template\TemplateAddAttributeEvent;
use Thelia\Core\Event\Template\TemplateAddFeatureEvent;
@@ -41,7 +37,6 @@ use Thelia\Core\Event\Template\TemplateDeleteFeatureEvent;
use Thelia\Model\FeatureTemplateQuery;
use Thelia\Model\AttributeTemplateQuery;
/**
* Manages product templates
*
@@ -102,7 +97,6 @@ class TemplateController extends AbstractCrudController
;
// Add feature and attributes list
return $changeEvent;
}
@@ -199,22 +193,24 @@ class TemplateController extends AbstractCrudController
return null;
}
public function getAjaxFeaturesAction() {
public function getAjaxFeaturesAction()
{
return $this->render(
'ajax/template-feature-list',
array('template_id' => $this->getRequest()->get('template_id'))
);
}
public function getAjaxAttributesAction() {
public function getAjaxAttributesAction()
{
return $this->render(
'ajax/template-attribute-list',
array('template_id' => $this->getRequest()->get('template_id'))
);
}
public function addAttributeAction() {
public function addAttributeAction()
{
// Check current user authorization
if (null !== $response = $this->checkAuth("admin.configuration.template.attribute.add")) return $response;
@@ -237,8 +233,8 @@ class TemplateController extends AbstractCrudController
$this->redirectToEditionTemplate();
}
public function deleteAttributeAction() {
public function deleteAttributeAction()
{
// Check current user authorization
if (null !== $response = $this->checkAuth("admin.configuration.template.attribute.delete")) return $response;
@@ -257,8 +253,8 @@ class TemplateController extends AbstractCrudController
$this->redirectToEditionTemplate();
}
public function updateAttributePositionAction() {
public function updateAttributePositionAction()
{
// Find attribute_template
$attributeTemplate = AttributeTemplateQuery::create()
->filterByTemplateId($this->getRequest()->get('template_id', null))
@@ -272,8 +268,8 @@ class TemplateController extends AbstractCrudController
);
}
public function addFeatureAction() {
public function addFeatureAction()
{
// Check current user authorization
if (null !== $response = $this->checkAuth("admin.configuration.template.feature.add")) return $response;
@@ -296,8 +292,8 @@ class TemplateController extends AbstractCrudController
$this->redirectToEditionTemplate();
}
public function deleteFeatureAction() {
public function deleteFeatureAction()
{
// Check current user authorization
if (null !== $response = $this->checkAuth("admin.configuration.template.feature.delete")) return $response;
@@ -316,8 +312,8 @@ class TemplateController extends AbstractCrudController
$this->redirectToEditionTemplate();
}
public function updateFeaturePositionAction() {
public function updateFeaturePositionAction()
{
// Find feature_template
$featureTemplate = FeatureTemplateQuery::create()
->filterByTemplateId($this->getRequest()->get('template_id', null))

View File

@@ -300,6 +300,7 @@ class BaseController extends ContainerAware
public function getMailer()
{
$mailer = $this->container->get('mailer');
return $mailer->getSwiftMailer();
}
}

View File

@@ -30,7 +30,6 @@ use Thelia\Form\AddressUpdateForm;
use Thelia\Form\Exception\FormValidationException;
use Thelia\Model\AddressQuery;
use Thelia\Model\Customer;
use Thelia\Tools\URL;
/**
* Class AddressController
@@ -51,10 +50,8 @@ class AddressController extends BaseFrontController
$this->checkAuth();
$this->checkXmlHttpRequest();
}
/**
* Create controller.
* Check if customer is logged in
@@ -117,7 +114,6 @@ class AddressController extends BaseFrontController
$addressUpdate = new AddressUpdateForm($request);
try {
$customer = $this->getSecurityContext()->getCustomerUser();

View File

@@ -34,7 +34,6 @@ use Thelia\Log\Tlog;
use Thelia\Model\AddressQuery;
use Thelia\Model\AreaDeliveryModuleQuery;
use Thelia\Model\Base\OrderQuery;
use Thelia\Model\CountryQuery;
use Thelia\Model\ModuleQuery;
use Thelia\Model\Order;
use Thelia\Tools\URL;

View File

@@ -244,8 +244,6 @@ class AddressCreateOrUpdateEvent extends ActionEvent
return $this->isDefault;
}
/**
* @param \Thelia\Model\Customer $customer
*/

View File

@@ -23,7 +23,6 @@
namespace Thelia\Core\Event\Content;
/**
* Class ContentCreateEvent
* @package Thelia\Core\Event\Content
@@ -76,9 +75,6 @@ class ContentCreateEvent extends ContentEvent
return $this->default_folder;
}
/**
* @param mixed $visible
*
@@ -119,6 +115,4 @@ class ContentCreateEvent extends ContentEvent
return $this->title;
}
}

View File

@@ -23,7 +23,6 @@
namespace Thelia\Core\Event\Content;
/**
* Class ContentDeleteEvent
* @package Thelia\Core\Event\Content
@@ -35,7 +34,7 @@ class ContentDeleteEvent extends ContentEvent
protected $folder_id;
function __construct($content_id)
public function __construct($content_id)
{
$this->content_id = $content_id;
}
@@ -70,5 +69,4 @@ class ContentDeleteEvent extends ContentEvent
return $this->folder_id;
}
}

View File

@@ -25,7 +25,6 @@ namespace Thelia\Core\Event\Content;
use Thelia\Core\Event\ActionEvent;
use Thelia\Model\Content;
/**
* Class ContentEvent
* @package Thelia\Core\Event\Content
@@ -38,7 +37,7 @@ class ContentEvent extends ActionEvent
*/
protected $content;
function __construct(Content $content = null)
public function __construct(Content $content = null)
{
$this->content = $content;
}

View File

@@ -23,7 +23,6 @@
namespace Thelia\Core\Event\Content;
/**
* Class ContentToggleVisibilityEvent
* @package Thelia\Core\Event\Content

View File

@@ -23,7 +23,6 @@
namespace Thelia\Core\Event\Content;
/**
* Class ContentUpdateEvent
* @package Thelia\Core\Event\Content
@@ -39,7 +38,7 @@ class ContentUpdateEvent extends ContentCreateEvent
protected $url;
function __construct($content_id)
public function __construct($content_id)
{
$this->content_id = $content_id;
}
@@ -144,7 +143,4 @@ class ContentUpdateEvent extends ContentCreateEvent
return $this->url;
}
}

View File

@@ -214,5 +214,4 @@ class DocumentCreateOrUpdateEvent extends ActionEvent
return $this->oldModelDocument;
}
}

View File

@@ -109,5 +109,4 @@ class DocumentDeleteEvent extends ActionEvent
return $this->documentToDelete;
}
}

View File

@@ -24,13 +24,13 @@
namespace Thelia\Core\Event\Folder;
use Thelia\Core\Event\Folder\FolderEvent;
/**
* Class FolderCreateEvent
* @package Thelia\Core\Event
* @author Manuel Raynaud <mraynaud@openstudio.fr>
*/
class FolderCreateEvent extends FolderEvent {
class FolderCreateEvent extends FolderEvent
{
protected $title;
protected $parent;
protected $locale;
@@ -117,5 +117,4 @@ class FolderCreateEvent extends FolderEvent {
return $this->visible;
}
}

View File

@@ -24,14 +24,13 @@
namespace Thelia\Core\Event\Folder;
use Thelia\Core\Event\Folder\FolderEvent;
/**
* Class FolderDeleteEvent
* @package Thelia\Core\Event
* @author Manuel Raynaud <mraynaud@openstudio.fr>
*/
class FolderDeleteEvent extends FolderEvent{
class FolderDeleteEvent extends FolderEvent
{
/**
* @var int folder id
*/
@@ -40,7 +39,7 @@ class FolderDeleteEvent extends FolderEvent{
/**
* @param int $folder_id
*/
function __construct($folder_id)
public function __construct($folder_id)
{
$this->folder_id = $folder_id;
}
@@ -61,5 +60,4 @@ class FolderDeleteEvent extends FolderEvent{
return $this->folder_id;
}
}

View File

@@ -25,20 +25,19 @@ namespace Thelia\Core\Event\Folder;
use Thelia\Core\Event\ActionEvent;
use Thelia\Model\Folder;
/**
* Class FolderEvent
* @package Thelia\Core\Event
* @author Manuel Raynaud <mraynaud@openstudio.fr>
*/
class FolderEvent extends ActionEvent {
class FolderEvent extends ActionEvent
{
/**
* @var \Thelia\Model\Folder
*/
protected $folder;
function __construct(Folder $folder = null)
public function __construct(Folder $folder = null)
{
$this->folder = $folder;
}

View File

@@ -24,12 +24,11 @@
namespace Thelia\Core\Event\Folder;
use Thelia\Core\Event\Folder\FolderEvent;
/**
* Class FolderToggleVisibilityEvent
* @package Thelia\Core\Event
* @author Manuel Raynaud <mraynaud@openstudio.fr>
*/
class FolderToggleVisibilityEvent extends FolderEvent {
class FolderToggleVisibilityEvent extends FolderEvent
{
}

View File

@@ -24,13 +24,13 @@
namespace Thelia\Core\Event\Folder;
use Thelia\Core\Event\Folder\FolderCreateEvent;
/**
* Class FolderUpdateEvent
* @package Thelia\Core\Event
* @author Manuel Raynaud <mraynaud@openstudio.fr>
*/
class FolderUpdateEvent extends FolderCreateEvent {
class FolderUpdateEvent extends FolderCreateEvent
{
protected $folder_id;
protected $chapo;
@@ -39,7 +39,7 @@ class FolderUpdateEvent extends FolderCreateEvent {
protected $url;
function __construct($folder_id)
public function __construct($folder_id)
{
$this->folder_id = $folder_id;
}

View File

@@ -23,14 +23,13 @@
namespace Thelia\Core\Event;
/**
* Class GenerateRewrittenUrlEvent
* @package Thelia\Core\Event
* @author Manuel Raynaud <mraynaud@openstudio.fr>
*/
class GenerateRewrittenUrlEvent extends ActionEvent {
class GenerateRewrittenUrlEvent extends ActionEvent
{
protected $object;
protected $locale;

View File

@@ -210,5 +210,4 @@ class ImageCreateOrUpdateEvent extends ActionEvent
return $this->oldModelImage;
}
}

View File

@@ -109,5 +109,4 @@ class ImageDeleteEvent extends ActionEvent
return $this->imageToDelete;
}
}

View File

@@ -23,14 +23,13 @@
namespace Thelia\Core\Event;
/**
* Class LostPasswordEvent
* @package Thelia\Core\Event
* @author Manuel Raynaud <mraynaud@openstudio.fr>
*/
class LostPasswordEvent extends ActionEvent {
class LostPasswordEvent extends ActionEvent
{
protected $email;
public function __construct($email)
@@ -46,6 +45,4 @@ class LostPasswordEvent extends ActionEvent {
return $this->email;
}
}

View File

@@ -23,13 +23,13 @@
namespace Thelia\Core\Event;
/**
* Class MailTransporterEvent
* @package Thelia\Core\Event
* @author Manuel Raynaud <mraynaud@openstudio.fr>
*/
class MailTransporterEvent extends ActionEvent {
class MailTransporterEvent extends ActionEvent
{
/**
* @var \Swift_Transport
*/

View File

@@ -46,6 +46,7 @@ class ProductCreateEvent extends ProductEvent
public function setRef($ref)
{
$this->ref = $ref;
return $this;
}
@@ -57,6 +58,7 @@ class ProductCreateEvent extends ProductEvent
public function setTitle($title)
{
$this->title = $title;
return $this;
}
@@ -68,6 +70,7 @@ class ProductCreateEvent extends ProductEvent
public function setLocale($locale)
{
$this->locale = $locale;
return $this;
}
@@ -79,6 +82,7 @@ class ProductCreateEvent extends ProductEvent
public function setDefaultCategory($default_category)
{
$this->default_category = $default_category;
return $this;
}
@@ -90,6 +94,7 @@ class ProductCreateEvent extends ProductEvent
public function setVisible($visible)
{
$this->visible = $visible;
return $this;
}
@@ -101,6 +106,7 @@ class ProductCreateEvent extends ProductEvent
public function setBasePrice($basePrice)
{
$this->basePrice = $basePrice;
return $this;
}
@@ -112,6 +118,7 @@ class ProductCreateEvent extends ProductEvent
public function setBaseWeight($baseWeight)
{
$this->baseWeight = $baseWeight;
return $this;
}
@@ -123,6 +130,7 @@ class ProductCreateEvent extends ProductEvent
public function setTaxRuleId($taxRuleId)
{
$this->taxRuleId = $taxRuleId;
return $this;
}
@@ -134,6 +142,7 @@ class ProductCreateEvent extends ProductEvent
public function setCurrencyId($currencyId)
{
$this->currencyId = $currencyId;
return $this;
}
}

View File

@@ -24,7 +24,6 @@
namespace Thelia\Core\Event\Product;
use Thelia\Core\Event\ProductEvent;
use Thelia\Model\Product;
use Thelia\Core\Event\ActionEvent;
class ProductSetTemplateEvent extends ProductEvent
{

View File

@@ -57,6 +57,7 @@ class TemplateUpdateEvent extends TemplateCreateEvent
public function setFeatureList($feature_list)
{
$this->feature_list = $feature_list;
return $this;
}
@@ -68,6 +69,7 @@ class TemplateUpdateEvent extends TemplateCreateEvent
public function setAttributeList($attribute_list)
{
$this->attribute_list = $attribute_list;
return $this;
}
}

View File

@@ -331,7 +331,6 @@ final class TheliaEvents
const ORDER_PRODUCT_BEFORE_CREATE = "action.orderProduct.beforeCreate";
const ORDER_PRODUCT_AFTER_CREATE = "action.orderProduct.afterCreate";
/**
* Sent on image processing
*/
@@ -571,7 +570,6 @@ final class TheliaEvents
const BEFORE_DELETEATTRIBUTE_AV = "action.before_deleteAttributeAv";
const AFTER_DELETEATTRIBUTE_AV = "action.after_deleteAttributeAv";
// -- Features values management ----------------------------------------
const FEATURE_AV_CREATE = "action.createFeatureAv";

View File

@@ -51,10 +51,10 @@ class Session extends BaseSession
public function getLang($forceDefault = true)
{
$lang = $this->get("thelia.current.lang");
if(null === $lang && $forceDefault)
{
if (null === $lang && $forceDefault) {
$lang = Lang::getDefaultLanguage();
}
return $lang;
}
@@ -74,10 +74,10 @@ class Session extends BaseSession
{
$currency = $this->get("thelia.current.currency");
if(null === $currency && $forceDefault)
{
if (null === $currency && $forceDefault) {
$currency = Currency::getDefaultCurrency();
}
return $currency;
}
@@ -108,6 +108,7 @@ class Session extends BaseSession
if (null === $lang) {
$lang = Lang::getDefaultLanguage();
}
return $lang;
}
@@ -230,7 +231,6 @@ class Session extends BaseSession
// -- Order ------------------------------------------------------------------
public function setOrder(Order $order)
{
$this->set("thelia.order", $order);
@@ -246,7 +246,6 @@ class Session extends BaseSession
return $this->get("thelia.order");
}
/**
* Set consumed coupons by the Customer
*

View File

@@ -20,15 +20,15 @@
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* */
/*************************************************************************************/
namespace Thelia\Core\HttpKernel\Exceptions;
namespace Thelia\Core\HttpKernel\Exception;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException as BaseNotFountHttpException;
/**
* Class NotFountHttpException
* @author Manuel Raynaud <mraynaud@openstudio.fr>
*/
class NotFountHttpException extends BaseNotFountHttpException {
class NotFountHttpException extends BaseNotFountHttpException
{
protected $adminContext = false;
public function __construct($message = null, \Exception $previous = null, $code = 0, $adminContext = false)

View File

@@ -24,7 +24,6 @@
namespace Thelia\Core\Security\Authentication;
use Thelia\Core\Security\Authentication\AuthenticatorInterface;
use Thelia\Core\Security\UserProvider\UserProviderInterface;
use Thelia\Core\Security\UserProvider\TokenUserProvider;
use Thelia\Core\Security\Exception\TokenAuthenticationException;
@@ -51,7 +50,6 @@ class TokenAuthenticator implements AuthenticatorInterface
$user = $this->userProvider->getUser($keyData);
if ($user === null) throw new TokenAuthenticationException("No user matches the provided token");
return $user;
}
}

View File

@@ -6,8 +6,8 @@ use Thelia\Core\Security\User\UserInterface;
class TokenProvider
{
public function encodeKey(UserInterface $user) {
public function encodeKey(UserInterface $user)
{
// Always set a new token in the user environment
$user->setToken(uniqid());
@@ -15,7 +15,8 @@ class TokenProvider
array($user->getUsername(), $user->getToken(), $user->getSerial())));
}
public function decodeKey($key) {
public function decodeKey($key)
{
$data = unserialize(base64_decode($key));
return array(

View File

@@ -23,13 +23,12 @@
namespace Thelia\Core\Security\UserProvider;
use Thelia\Model\Admin;
use Thelia\Model\AdminQuery;
class AdminTokenUserProvider extends TokenUserProvider
{
public function getUser($dataArray) {
public function getUser($dataArray)
{
return AdminQuery::create()
->filterByLogin($dataArray['username'])
->filterByRememberMeSerial($dataArray['serial'])

View File

@@ -23,13 +23,12 @@
namespace Thelia\Core\Security\UserProvider;
use Thelia\Action\Customer;
use Thelia\Model\CustomerQuery;
class CustomerTokenUserProvider extends TokenUserProvider
{
public function getUser($dataArray) {
public function getUser($dataArray)
{
return CustomerQuery::create()
->filterByEmail($dataArray['username'])
->filterByRememberMeSerial($dataArray['serial'])

View File

@@ -23,10 +23,9 @@
namespace Thelia\Core\Security\UserProvider;
use Thelia\Core\Security\User\UserInterface;
use Thelia\Core\Security\Token\TokenProvider;
abstract class TokenUserProvider extends TokenProvider implements UserProviderInterface
{
public abstract function getUser($key);
abstract public function getUser($key);
}

View File

@@ -31,17 +31,12 @@ use Thelia\Core\Template\Element\LoopResultRow;
use Thelia\Core\Template\Loop\Argument\ArgumentCollection;
use Thelia\Core\Template\Loop\Argument\Argument;
use Thelia\Model\Base\CategoryQuery;
use Thelia\Model\Base\ProductCategoryQuery;
use Thelia\Model\Base\AttributeQuery;
use Thelia\Model\Map\ProductCategoryTableMap;
use Thelia\Type\TypeCollection;
use Thelia\Type;
use Thelia\Type\BooleanOrBothType;
use Thelia\Model\ProductQuery;
use Thelia\Model\TemplateQuery;
use Thelia\Model\AttributeTemplateQuery;
use Thelia\Core\Translation\Translator;
use Thelia\Model\Map\AttributeTemplateTableMap;
/**
*
@@ -138,8 +133,7 @@ class Attribute extends BaseI18nLoop
;
$use_attribute_pos = false;
}
else if (null !== $exclude_template) {
} elseif (null !== $exclude_template) {
// Join with attribute_template table to get position
$exclude_attributes = AttributeTemplateQuery::create()->filterByTemplateId($exclude_template)->select('attribute_id')->find();

View File

@@ -37,7 +37,6 @@ use Thelia\Coupon\Type\CouponInterface;
use Thelia\Model\Coupon as MCoupon;
use Thelia\Model\CouponQuery;
use Thelia\Type;
use Thelia\Type\BooleanOrBothType;
/**
* Created by JetBrains PhpStorm.

View File

@@ -265,8 +265,7 @@ class Document extends BaseI18nLoop
;
$loopResult->addRow($loopResultRow);
}
catch (\Exception $ex) {
} catch (\Exception $ex) {
// Ignore the result and log an error
Tlog::getInstance()->addError("Failed to process document in document loop: ", $this->args);
}

View File

@@ -31,11 +31,8 @@ use Thelia\Core\Template\Element\LoopResultRow;
use Thelia\Core\Template\Loop\Argument\ArgumentCollection;
use Thelia\Core\Template\Loop\Argument\Argument;
use Thelia\Model\CategoryQuery;
use Thelia\Model\FeatureI18nQuery;
use Thelia\Model\ProductCategoryQuery;
use Thelia\Model\FeatureQuery;
use Thelia\Model\Map\ProductCategoryTableMap;
use Thelia\Model\ProductQuery;
use Thelia\Type\TypeCollection;
use Thelia\Type;
@@ -204,7 +201,6 @@ class Feature extends BaseI18nLoop
}
/* perform search */
$features = $this->search($search, $pagination);

View File

@@ -318,8 +318,7 @@ class Image extends BaseI18nLoop
;
$loopResult->addRow($loopResultRow);
}
catch (\Exception $ex) {
} catch (\Exception $ex) {
// Ignore the result and log an error
Tlog::getInstance()->addError("Failed to process image in image loop: ", $this->args);
}

View File

@@ -31,10 +31,7 @@ use Thelia\Core\Template\Element\LoopResultRow;
use Thelia\Core\Template\Loop\Argument\ArgumentCollection;
use Thelia\Core\Template\Loop\Argument\Argument;
use Thelia\Model\AddressQuery;
use Thelia\Model\OrderAddressQuery;
use Thelia\Type\TypeCollection;
use Thelia\Type;
/**
*

View File

@@ -31,13 +31,7 @@ use Thelia\Core\Template\Element\LoopResultRow;
use Thelia\Core\Template\Loop\Argument\ArgumentCollection;
use Thelia\Core\Template\Loop\Argument\Argument;
use Thelia\Exception\TaxEngineException;
use Thelia\Model\Base\OrderProductQuery;
use Thelia\Model\CountryQuery;
use Thelia\Model\CurrencyQuery;
use Thelia\Model\Map\OrderProductTableMap;
use Thelia\Type\TypeCollection;
use Thelia\Type;
/**
*
@@ -76,7 +70,6 @@ class OrderProduct extends BaseLoop
->withColumn('SUM(`opt`.PROMO_AMOUNT)', 'TOTAL_PROMO_TAX')
->groupById();
$order = $this->getOrder();
$search->filterByOrderId($order, Criteria::EQUAL);

View File

@@ -32,8 +32,6 @@ use Thelia\Core\Template\Loop\Argument\ArgumentCollection;
use Thelia\Core\Template\Loop\Argument\Argument;
use Thelia\Model\Base\OrderProductAttributeCombinationQuery;
use Thelia\Model\Map\AttributeAvTableMap;
use Thelia\Model\Map\AttributeTableMap;
use Thelia\Type\TypeCollection;
use Thelia\Type;

View File

@@ -25,7 +25,6 @@ namespace Thelia\Core\Template\Loop;
use Propel\Runtime\ActiveQuery\Criteria;
use Thelia\Core\Template\Element\LoopResult;
use Thelia\Core\Template\Element\LoopResultRow;
use Thelia\Core\Template\Loop\Argument\Argument;
use Thelia\Module\BaseModule;
/**

View File

@@ -31,13 +31,8 @@ use Thelia\Core\Template\Element\LoopResultRow;
use Thelia\Core\Template\Loop\Argument\ArgumentCollection;
use Thelia\Core\Template\Loop\Argument\Argument;
use Thelia\Model\Base\CategoryQuery;
use Thelia\Model\Base\ProductCategoryQuery;
use Thelia\Model\Base\TemplateQuery;
use Thelia\Model\Map\ProductCategoryTableMap;
use Thelia\Type\TypeCollection;
use Thelia\Type;
use Thelia\Type\BooleanOrBothType;
/**
*

View File

@@ -332,7 +332,6 @@ class DataAccessFunctions extends AbstractSmartyPlugin
*/
public function getPluginDescriptors()
{
return array(
new SmartyPluginDescriptor('function', 'admin', $this, 'adminDataAccess'),
new SmartyPluginDescriptor('function', 'customer', $this, 'customerDataAccess'),

View File

@@ -22,13 +22,9 @@
/*************************************************************************************/
namespace Thelia\Core\Template\Smarty\Plugins;
use Symfony\Component\Form\FormView;
use Thelia\Form\BaseForm;
use Thelia\Core\Template\Element\Exception\ElementNotFoundException;
use Symfony\Component\HttpFoundation\Request;
use Thelia\Core\Template\Smarty\SmartyPluginDescriptor;
use Thelia\Core\Template\Smarty\AbstractSmartyPlugin;
use Thelia\Core\Template\ParserContext;
/**
* Created by JetBrains PhpStorm.

View File

@@ -168,8 +168,7 @@ $val = $value[$key];
$this->assignFieldValues($template, $name, $val, $formFieldView->vars);
}
}
}
else {
} else {
$this->assignFieldValues($template, $formFieldView->vars["full_name"], $fieldVars["value"], $formFieldView->vars);
}
*/

View File

@@ -247,6 +247,7 @@ class TheliaLoop extends AbstractSmartyPlugin
// Find pagination
$pagination = self::getPagination($loopName);
if ($pagination === null) { // loop gas no result
return '';
}

View File

@@ -23,14 +23,8 @@
namespace Thelia\Core\Template\Smarty\Plugins;
use Thelia\Core\HttpFoundation\Request;
use Thelia\Core\Template\Smarty\SmartyPluginDescriptor;
use Thelia\Core\Template\Smarty\AbstractSmartyPlugin;
use Thelia\Core\Security\SecurityContext;
use Thelia\Core\Security\Exception\AuthenticationException;
use Thelia\Exception\OrderException;
use Thelia\Model\AddressQuery;
use Thelia\Model\ModuleQuery;
class Type extends AbstractSmartyPlugin
{

View File

@@ -55,11 +55,9 @@ class UrlGenerator extends AbstractSmartyPlugin
if ($file !== null) {
$path = $file;
$mode = URL::PATH_TO_FILE;
}
else if ($path !== null) {
} elseif ($path !== null) {
$mode = URL::WITH_INDEX_PAGE;
}
else {
} else {
throw \InvalidArgumentException(Translator::getInstance()->trans("Please specify either 'path' or 'file' parameter in {url} function."));
}
@@ -74,7 +72,6 @@ class UrlGenerator extends AbstractSmartyPlugin
if ($noamp == null) $url = str_replace('&', '&amp;', $url);
if ($target != null) $url .= '#'.$target;
return $url;
}

View File

@@ -87,7 +87,6 @@ class Thelia extends Kernel
$con->useDebug(true);
}
}
/**

View File

@@ -23,8 +23,6 @@
namespace Thelia\Form;
use Symfony\Component\Validator\Constraints;
use Thelia\Model\CurrencyQuery;
use Symfony\Component\Validator\ExecutionContextInterface;
use Symfony\Component\Validator\Constraints\NotBlank;
use Thelia\Core\Translation\Translator;

View File

@@ -23,8 +23,6 @@
namespace Thelia\Form;
use Symfony\Component\Validator\Constraints;
use Thelia\Model\CurrencyQuery;
use Symfony\Component\Validator\ExecutionContextInterface;
use Symfony\Component\Validator\Constraints\NotBlank;
use Thelia\Core\Translation\Translator;

View File

@@ -23,10 +23,6 @@
namespace Thelia\Form;
use Symfony\Component\Validator\Constraints;
use Thelia\Model\CurrencyQuery;
use Symfony\Component\Validator\ExecutionContextInterface;
use Symfony\Component\Validator\Constraints\NotBlank;
use Thelia\Core\Translation\Translator;
use Symfony\Component\Validator\Constraints\GreaterThan;
class AttributeModificationForm extends AttributeCreationForm

View File

@@ -22,10 +22,7 @@
/*************************************************************************************/
namespace Thelia\Form;
use Thelia\Core\Translation\Translator;
use Thelia\Form\Image\DocumentModification;
use Thelia\Form\Image\ImageModification;
/**
* Created by JetBrains PhpStorm.

View File

@@ -22,8 +22,6 @@
/*************************************************************************************/
namespace Thelia\Form;
use Thelia\Core\Translation\Translator;
use Thelia\Form\Image\ImageModification;
/**

View File

@@ -22,10 +22,7 @@
/*************************************************************************************/
namespace Thelia\Form;
use Thelia\Core\Translation\Translator;
use Thelia\Form\Image\DocumentModification;
use Thelia\Form\Image\ImageModification;
/**
* Created by JetBrains PhpStorm.

View File

@@ -22,8 +22,6 @@
/*************************************************************************************/
namespace Thelia\Form;
use Thelia\Core\Translation\Translator;
use Thelia\Form\Image\ImageModification;
/**

View File

@@ -33,7 +33,8 @@ use Thelia\Form\StandardDescriptionFieldsTrait;
* @package Thelia\Form
* @author manuel raynaud <mraynaud@openstudio.fr>
*/
class ContentModificationForm extends ContentCreationForm {
class ContentModificationForm extends ContentCreationForm
{
use StandardDescriptionFieldsTrait;
protected function buildForm()

View File

@@ -24,7 +24,6 @@
namespace Thelia\Form;
use Symfony\Component\Validator\Constraints\Date;
use Symfony\Component\Validator\Constraints\DateTime;
use Symfony\Component\Validator\Constraints\GreaterThanOrEqual;
use Symfony\Component\Validator\Constraints\NotBlank;
use Symfony\Component\Validator\Constraints\NotEqualTo;

View File

@@ -35,8 +35,8 @@ use Thelia\Model\CustomerQuery;
* @package Thelia\Form
* @author Manuel Raynaud <mraynaud@openstudio.fr>
*/
class CustomerLostPasswordForm extends BaseForm {
class CustomerLostPasswordForm extends BaseForm
{
/**
*
* in this function you add all the fields you need for your Form.

View File

@@ -23,8 +23,6 @@
namespace Thelia\Form;
use Symfony\Component\Validator\Constraints;
use Thelia\Model\CurrencyQuery;
use Symfony\Component\Validator\ExecutionContextInterface;
use Symfony\Component\Validator\Constraints\NotBlank;
use Thelia\Core\Translation\Translator;

View File

@@ -23,8 +23,6 @@
namespace Thelia\Form;
use Symfony\Component\Validator\Constraints;
use Thelia\Model\CurrencyQuery;
use Symfony\Component\Validator\ExecutionContextInterface;
use Symfony\Component\Validator\Constraints\NotBlank;
use Thelia\Core\Translation\Translator;

View File

@@ -23,10 +23,6 @@
namespace Thelia\Form;
use Symfony\Component\Validator\Constraints;
use Thelia\Model\CurrencyQuery;
use Symfony\Component\Validator\ExecutionContextInterface;
use Symfony\Component\Validator\Constraints\NotBlank;
use Thelia\Core\Translation\Translator;
use Symfony\Component\Validator\Constraints\GreaterThan;
class FeatureModificationForm extends FeatureCreationForm

View File

@@ -22,10 +22,7 @@
/*************************************************************************************/
namespace Thelia\Form;
use Thelia\Core\Translation\Translator;
use Thelia\Form\Image\DocumentModification;
use Thelia\Form\Image\ImageModification;
/**
* Created by JetBrains PhpStorm.

View File

@@ -22,8 +22,6 @@
/*************************************************************************************/
namespace Thelia\Form;
use Thelia\Core\Translation\Translator;
use Thelia\Form\Image\ImageModification;
/**

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