diff --git a/core/lib/Thelia/Action/Address.php b/core/lib/Thelia/Action/Address.php index f6c6a81ad..2195d946f 100644 --- a/core/lib/Thelia/Action/Address.php +++ b/core/lib/Thelia/Action/Address.php @@ -73,11 +73,8 @@ class Address extends BaseAction implements EventSubscriberInterface $con = Propel::getWriteConnection(AddressTableMap::DATABASE_NAME); $con->beginTransaction(); try { - if ($addressModel->isNew()) { - $addressModel->setLabel($event->getLabel()); - } - $addressModel + ->setLabel($event->getLabel()) ->setTitleId($event->getTitle()) ->setFirstname($event->getFirstname()) ->setLastname($event->getLastname()) diff --git a/core/lib/Thelia/Action/Customer.php b/core/lib/Thelia/Action/Customer.php index 464f7cf20..9fee8b69e 100755 --- a/core/lib/Thelia/Action/Customer.php +++ b/core/lib/Thelia/Action/Customer.php @@ -60,7 +60,7 @@ class Customer extends BaseAction implements EventSubscriberInterface } - public function updateProfil(CustomerCreateOrUpdateEvent $event) + public function updateProfile(CustomerCreateOrUpdateEvent $event) { $customer = $event->getCustomer(); @@ -166,7 +166,7 @@ class Customer extends BaseAction implements EventSubscriberInterface return array( TheliaEvents::CUSTOMER_CREATEACCOUNT => array('create', 128), TheliaEvents::CUSTOMER_UPDATEACCOUNT => array('modify', 128), - TheliaEvents::CUSTOMER_UPDATEPROFIL => array('updateProfil', 128), + TheliaEvents::CUSTOMER_UPDATEPROFILE => array('updateProfile', 128), TheliaEvents::CUSTOMER_LOGOUT => array('logout', 128), TheliaEvents::CUSTOMER_LOGIN => array('login', 128), TheliaEvents::CUSTOMER_DELETEACCOUNT => array('delete', 128), diff --git a/core/lib/Thelia/Config/Resources/form.xml b/core/lib/Thelia/Config/Resources/form.xml index dda9be749..ecd530b69 100644 --- a/core/lib/Thelia/Config/Resources/form.xml +++ b/core/lib/Thelia/Config/Resources/form.xml @@ -9,7 +9,7 @@
- + diff --git a/core/lib/Thelia/Config/Resources/routing/front.xml b/core/lib/Thelia/Config/Resources/routing/front.xml index cf7797cc9..4d811599c 100755 --- a/core/lib/Thelia/Config/Resources/routing/front.xml +++ b/core/lib/Thelia/Config/Resources/routing/front.xml @@ -110,6 +110,7 @@ + Thelia\Controller\Front\CartController::changeItem Thelia\Controller\Front\CartController::changeItem cart diff --git a/core/lib/Thelia/Controller/Front/AddressController.php b/core/lib/Thelia/Controller/Front/AddressController.php index 6ab6e72e8..77af4991e 100644 --- a/core/lib/Thelia/Controller/Front/AddressController.php +++ b/core/lib/Thelia/Controller/Front/AddressController.php @@ -156,17 +156,51 @@ class AddressController extends BaseFrontController public function deleteAction($address_id) { $this->checkAuth(); + $error_message = false; $customer = $this->getSecurityContext()->getCustomerUser(); $address = AddressQuery::create()->findPk($address_id); if (!$address || $customer->getId() != $address->getCustomerId()) { - $this->redirectToRoute('default'); + // If Ajax Request + if ($this->getRequest()->isXmlHttpRequest()) { + return $this->jsonResponse(json_encode(array( + "success" => false, + "message" => "Error during address deletion process" + ))); + } else { + $this->redirectToRoute('default'); + } } - $this->dispatch(TheliaEvents::ADDRESS_DELETE, new AddressEvent($address)); + try { + $this->dispatch(TheliaEvents::ADDRESS_DELETE, new AddressEvent($address)); + } catch (\Exception $e) { + $error_message = $e->getMessage(); + } - $this->redirectToRoute('default', array('view'=>'account')); + \Thelia\Log\Tlog::getInstance()->error(sprintf('Error during address deletion : %s', $error_message)); + + + // If Ajax Request + if ($this->getRequest()->isXmlHttpRequest()) { + if ($error_message) { + $response = $this->jsonResponse(json_encode(array( + "success" => false, + "message" => $error_message + ))); + } else { + $response = $this->jsonResponse(json_encode(array( + "success" => true, + "message" => "" + )));; + } + + return $response; + + } else { + $this->redirectToRoute('default', array('view'=>'account')); + } } protected function createAddressEvent($form) diff --git a/core/lib/Thelia/Controller/Front/BaseFrontController.php b/core/lib/Thelia/Controller/Front/BaseFrontController.php index 5892194a4..369006aeb 100755 --- a/core/lib/Thelia/Controller/Front/BaseFrontController.php +++ b/core/lib/Thelia/Controller/Front/BaseFrontController.php @@ -56,7 +56,7 @@ class BaseFrontController extends BaseController public function checkAuth() { if ($this->getSecurityContext()->hasCustomerUser() === false) { - $this->redirectToRoute('default', array('view'=>'login')); + $this->redirectToRoute('customer.login.process'); } } diff --git a/core/lib/Thelia/Controller/Front/CustomerController.php b/core/lib/Thelia/Controller/Front/CustomerController.php index f9ebde9e6..2bb01a94a 100755 --- a/core/lib/Thelia/Controller/Front/CustomerController.php +++ b/core/lib/Thelia/Controller/Front/CustomerController.php @@ -33,7 +33,7 @@ use Thelia\Form\CustomerCreateForm; use Thelia\Form\CustomerLogin; use Thelia\Form\CustomerLostPasswordForm; use Thelia\Form\CustomerPasswordUpdateForm; -use Thelia\Form\CustomerProfilUpdateForm; +use Thelia\Form\CustomerProfileUpdateForm; use Thelia\Form\Exception\FormValidationException; use Thelia\Model\Customer; use Thelia\Core\Event\TheliaEvents; @@ -149,10 +149,10 @@ class CustomerController extends BaseFrontController 'newsletter' => null !== NewsletterQuery::create()->findOneByEmail($customer->getEmail()), ); - $customerProfilUpdateForm = new CustomerProfilUpdateForm($this->getRequest(), 'form', $data); + $customerProfileUpdateForm = new CustomerProfileUpdateForm($this->getRequest(), 'form', $data); // Pass it to the parser - $this->getParserContext()->addForm($customerProfilUpdateForm); + $this->getParserContext()->addForm($customerProfileUpdateForm); } public function updatePasswordAction() @@ -169,7 +169,7 @@ class CustomerController extends BaseFrontController $customerChangeEvent = $this->createEventInstance($form->getData()); $customerChangeEvent->setCustomer($customer); - $this->dispatch(TheliaEvents::CUSTOMER_UPDATEPROFIL, $customerChangeEvent); + $this->dispatch(TheliaEvents::CUSTOMER_UPDATEPROFILE, $customerChangeEvent); $this->redirectSuccess($customerPasswordUpdateForm); @@ -198,17 +198,17 @@ class CustomerController extends BaseFrontController $message = false; - $customerProfilUpdateForm = new CustomerProfilUpdateForm($this->getRequest()); + $customerProfileUpdateForm = new CustomerProfileUpdateForm($this->getRequest()); try { $customer = $this->getSecurityContext()->getCustomerUser(); $newsletterOldEmail = $customer->getEmail(); - $form = $this->validateForm($customerProfilUpdateForm, "post"); + $form = $this->validateForm($customerProfileUpdateForm, "post"); $customerChangeEvent = $this->createEventInstance($form->getData()); $customerChangeEvent->setCustomer($customer); - $this->dispatch(TheliaEvents::CUSTOMER_UPDATEPROFIL, $customerChangeEvent); + $this->dispatch(TheliaEvents::CUSTOMER_UPDATEPROFILE, $customerChangeEvent); $updatedCustomer = $customerChangeEvent->getCustomer(); @@ -234,7 +234,7 @@ class CustomerController extends BaseFrontController $this->processLogin($updatedCustomer); - $this->redirectSuccess($customerProfilUpdateForm); + $this->redirectSuccess($customerProfileUpdateForm); } catch (FormValidationException $e) { $message = sprintf("Please check your input: %s", $e->getMessage()); @@ -245,10 +245,10 @@ class CustomerController extends BaseFrontController if ($message !== false) { Tlog::getInstance()->error(sprintf("Error during customer modification process : %s.", $message)); - $customerProfilUpdateForm->setErrorMessage($message); + $customerProfileUpdateForm->setErrorMessage($message); $this->getParserContext() - ->addForm($customerProfilUpdateForm) + ->addForm($customerProfileUpdateForm) ->setGeneralError($message) ; } @@ -276,7 +276,7 @@ class CustomerController extends BaseFrontController // If User is a new customer if ($form->get('account')->getData() == 0 && !$form->get("email")->getErrors()) { - $this->redirectToRoute("default", array("view" => "register","email" => $form->get("email")->getData())); + $this->redirectToRoute("customer.create.process", array("email" => $form->get("email")->getData())); } else { try { diff --git a/core/lib/Thelia/Core/Event/TheliaEvents.php b/core/lib/Thelia/Core/Event/TheliaEvents.php index f72668fc3..6dbe89e10 100755 --- a/core/lib/Thelia/Core/Event/TheliaEvents.php +++ b/core/lib/Thelia/Core/Event/TheliaEvents.php @@ -72,9 +72,9 @@ final class TheliaEvents const CUSTOMER_UPDATEACCOUNT = "action.updateCustomer"; /** - * sent on customer account update profil + * sent on customer account update profile */ - const CUSTOMER_UPDATEPROFIL = "action.updateProfilCustomer"; + const CUSTOMER_UPDATEPROFILE = "action.updateProfileCustomer"; /** * sent on customer removal diff --git a/core/lib/Thelia/Core/Template/Element/ArraySearchLoopInterface.php b/core/lib/Thelia/Core/Template/Element/ArraySearchLoopInterface.php new file mode 100644 index 000000000..f33b8505e --- /dev/null +++ b/core/lib/Thelia/Core/Template/Element/ArraySearchLoopInterface.php @@ -0,0 +1,38 @@ +. */ +/* */ +/*************************************************************************************/ +namespace Thelia\Core\Template\Element; + +/** + * + * @author Etienne Roudeix + * + */ +interface ArraySearchLoopInterface +{ + /** + * this method returns an array + * + * @return array + */ + public function buildArray(); +} diff --git a/core/lib/Thelia/Core/Template/Element/BaseI18nLoop.php b/core/lib/Thelia/Core/Template/Element/BaseI18nLoop.php index 557c64901..aff1d9188 100644 --- a/core/lib/Thelia/Core/Template/Element/BaseI18nLoop.php +++ b/core/lib/Thelia/Core/Template/Element/BaseI18nLoop.php @@ -36,6 +36,8 @@ use Thelia\Model\Tools\ModelCriteriaTools; */ abstract class BaseI18nLoop extends BaseLoop { + protected $locale; + /** * Define common loop arguments * @@ -65,9 +67,7 @@ abstract class BaseI18nLoop extends BaseLoop { /* manage translations */ - $fr = $this->getForce_return(); - - return ModelCriteriaTools::getI18n( + $this->locale = ModelCriteriaTools::getI18n( $this->getBackend_context(), $this->getLang(), $search, diff --git a/core/lib/Thelia/Core/Template/Element/BaseLoop.php b/core/lib/Thelia/Core/Template/Element/BaseLoop.php index 6b6f44146..7344843ed 100755 --- a/core/lib/Thelia/Core/Template/Element/BaseLoop.php +++ b/core/lib/Thelia/Core/Template/Element/BaseLoop.php @@ -27,6 +27,7 @@ use Propel\Runtime\ActiveQuery\Criteria; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\EventDispatcher\EventDispatcherInterface; +use Thelia\Core\Template\Element\Exception\LoopException; use Thelia\Core\Template\Loop\Argument\Argument; use Propel\Runtime\ActiveQuery\ModelCriteria; use Thelia\Core\Security\SecurityContext; @@ -62,9 +63,9 @@ abstract class BaseLoop protected $args; - public $countable = true; - public $timestampable = false; - public $versionable = false; + protected $countable = true; + protected $timestampable = false; + protected $versionable = false; /** * Create a new Loop @@ -73,6 +74,8 @@ abstract class BaseLoop */ public function __construct(ContainerInterface $container) { + $this->checkInterface(); + $this->container = $container; $this->request = $container->get('request'); @@ -240,6 +243,9 @@ abstract class BaseLoop */ protected function search(ModelCriteria $search, &$pagination = null) { + if (false === $this->countable) { + return $search->find(); + } if ($this instanceof SearchLoopInterface) { $searchTerm = $this->getSearch_term(); $searchIn = $this->getSearch_in(); @@ -271,6 +277,29 @@ abstract class BaseLoop } } + + protected function searchArray(array $search, &$pagination = null) + { + if (false === $this->countable) { + return $search; + } + if ($this->getArgValue('page') !== null) { + + $nbPage = ceil(count($search)/$this->getArgValue('limit')); + if($this->getArgValue('page') > $nbPage || $this->getArgValue('page') <= 0) { + return array(); + } + + $firstItem = ($this->getArgValue('page')-1) * $this->getArgValue('limit') + 1; + + return array_slice($search, $firstItem, $firstItem + $this->getArgValue('limit'), false); + + } else { + return array_slice($search, $this->getArgValue('offset'), $this->getArgValue('limit'), false); + + } + } + /** * @param ModelCriteria $search * @@ -304,18 +333,84 @@ abstract class BaseLoop } /** - * - * this function have to be implement in your own loop class. - * - * All loops parameters can be accessible via getter. - * - * for example, ref parameter is accessible through getRef method - * * @param $pagination - * * @return LoopResult */ - abstract public function exec(&$pagination); + public function exec(&$pagination) + { + if($this instanceof PropelSearchLoopInterface) { + $searchModelCriteria = $this->buildModelCriteria(); + if(null === $searchModelCriteria) { + $results = array(); + } else { + $results = $this->search( + $searchModelCriteria, + $pagination + ); + } + } elseif ($this instanceof ArraySearchLoopInterface) { + $searchArray = $this->buildArray(); + if(null === $searchArray) { + $results = array(); + } else { + $results = $this->searchArray( + $searchArray, + $pagination + ); + } + } + + $loopResult = new LoopResult($results); + + if(true === $this->countable) { + $loopResult->setCountable(); + } + if(true === $this->timestampable) { + $loopResult->setTimestamped(); + } + if(true === $this->versionable) { + $loopResult->setVersioned(); + } + + return $this->parseResults($loopResult); + } + + protected function checkInterface() + { + /* Must implement either : + * - PropelSearchLoopInterface + * - ArraySearchLoopInterface + */ + $searchInterface = false; + if($this instanceof PropelSearchLoopInterface) { + if(true === $searchInterface) { + throw new LoopException('Loop cannot implements multiple Search Interfaces : `PropelSearchLoopInterface`, `ArraySearchLoopInterface`', LoopException::MULTIPLE_SEARCH_INTERFACE); + } + $searchInterface = true; + } + if($this instanceof ArraySearchLoopInterface) { + if(true === $searchInterface) { + throw new LoopException('Loop cannot implements multiple Search Interfaces : `PropelSearchLoopInterface`, `ArraySearchLoopInterface`', LoopException::MULTIPLE_SEARCH_INTERFACE); + } + $searchInterface = true; + } + + if(false === $searchInterface) { + throw new LoopException('Loop must implements one of the following interfaces : `PropelSearchLoopInterface`, `ArraySearchLoopInterface`', LoopException::SEARCH_INTERFACE_NOT_FOUND); + } + + /* Only PropelSearch allows timestamp and version */ + if(!$this instanceof PropelSearchLoopInterface) { + if(true === $this->timestampable) { + throw new LoopException("Loop must implements 'PropelSearchLoopInterface' to be timestampable", LoopException::NOT_TIMESTAMPED); + } + if(true === $this->versionable) { + throw new LoopException("Loop must implements 'PropelSearchLoopInterface' to be versionable", LoopException::NOT_VERSIONED); + } + } + } + + abstract public function parseResults(LoopResult $loopResult); /** * diff --git a/core/lib/Thelia/Core/Template/Element/Exception/LoopException.php b/core/lib/Thelia/Core/Template/Element/Exception/LoopException.php new file mode 100644 index 000000000..cc6340df3 --- /dev/null +++ b/core/lib/Thelia/Core/Template/Element/Exception/LoopException.php @@ -0,0 +1,46 @@ +. */ +/* */ +/*************************************************************************************/ + +namespace Thelia\Core\Template\Element\Exception; + +class LoopException extends \RuntimeException +{ + const UNKNOWN_EXCEPTION = 0; + + const NOT_TIMESTAMPED = 100; + const NOT_VERSIONED = 101; + + const MULTIPLE_SEARCH_INTERFACE = 400; + const SEARCH_INTERFACE_NOT_FOUND = 404; + + public function __construct($message, $code = null, $arguments = array(), $previous = null) + { + if (is_array($arguments)) { + $this->arguments = $arguments; + } + if ($code === null) { + $code = self::UNKNOWN_EXCEPTION; + } + parent::__construct($message, $code, $previous); + } +} diff --git a/core/lib/Thelia/Core/Template/Element/LoopResult.php b/core/lib/Thelia/Core/Template/Element/LoopResult.php index 3ca1e91d3..af24a4bda 100755 --- a/core/lib/Thelia/Core/Template/Element/LoopResult.php +++ b/core/lib/Thelia/Core/Template/Element/LoopResult.php @@ -32,14 +32,40 @@ class LoopResult implements \Iterator private $position; protected $collection = array(); - public $modelCollection = null; + public $resultsCollection = null; - public function __construct($modelCollection = null) + protected $versioned = false; + protected $timestamped = false; + protected $countable = false; + + public function __construct($resultsCollection) { $this->position = 0; - if ($modelCollection instanceof ObjectCollection || $modelCollection instanceof PropelModelPager || is_array($modelCollection)) { - $this->modelCollection = $modelCollection; - } + $this->resultsCollection = $resultsCollection; + } + + /** + * @param boolean $countable + */ + public function setCountable($countable = true) + { + $this->countable = true === $countable; + } + + /** + * @param boolean $timestamped + */ + public function setTimestamped($timestamped = true) + { + $this->timestamped = true === $timestamped; + } + + /** + * @param boolean $versioned + */ + public function setVersioned($versioned = true) + { + $this->versioned = true === $versioned; } public function isEmpty() @@ -49,6 +75,21 @@ class LoopResult implements \Iterator public function addRow(LoopResultRow $row) { + if (true === $this->versioned) { + foreach ($this->getVersionOutputs() as $output) { + $row->set($output[0], $row->model->$output[1]()); + } + } + if (true === $this->timestamped) { + foreach ($this->getTimestampOutputs() as $output) { + $row->set($output[0], $row->model->$output[1]()); + } + } + if (true === $this->countable) { + $row->set('LOOP_COUNT', 1 + $this->getCount()); + $row->set('LOOP_TOTAL', $this->getResultDataCollectionCount()); + } + $this->collection[] = $row; } @@ -57,17 +98,22 @@ class LoopResult implements \Iterator return count($this->collection); } - public function getModelCollectionCount() + public function getResultDataCollectionCount() { - if ($this->modelCollection instanceof ObjectCollection || $this->modelCollection instanceof PropelModelPager) { - return $this->modelCollection->count(); - } elseif (is_array($this->modelCollection)) { - return count($this->modelCollection); + if ($this->resultsCollection instanceof ObjectCollection || $this->resultsCollection instanceof PropelModelPager) { + return $this->resultsCollection->count(); + } elseif (is_array($this->resultsCollection)) { + return count($this->resultsCollection); } else { return 0; } } + public function getResultDataCollection() + { + return $this->resultsCollection; + } + /** * (PHP 5 >= 5.0.0)
* Return the current element @@ -123,4 +169,21 @@ class LoopResult implements \Iterator { $this->position = 0; } + + protected function getTimestampOutputs() + { + return array( + array('CREATE_DATE', 'getCreatedAt'), + array('UPDATE_DATE', 'getUpdatedAt'), + ); + } + + protected function getVersionOutputs() + { + return array( + array('VERSION', 'getVersion'), + array('VERSION_DATE', 'getVersionCreatedAt'), + array('VERSION_AUTHOR', 'getVersionCreatedBy'), + ); + } } diff --git a/core/lib/Thelia/Core/Template/Element/LoopResultRow.php b/core/lib/Thelia/Core/Template/Element/LoopResultRow.php index 9c4f93586..d908c92c3 100755 --- a/core/lib/Thelia/Core/Template/Element/LoopResultRow.php +++ b/core/lib/Thelia/Core/Template/Element/LoopResultRow.php @@ -30,28 +30,12 @@ class LoopResultRow protected $substitution = array(); public $model = null; - public $loopResult; - public $versionable = false; - public $timestampable = false; - public $countable = false; - - public function __construct($loopResult = null, $model = null, $versionable = false, $timestampable = false, $countable = true) + public function __construct($model = null) { if ($model instanceof ActiveRecordInterface) { $this->model = $model; - - $this->versionable = $versionable; - $this->timestampable = $timestampable; } - - if ($loopResult instanceof LoopResult) { - $this->loopResult = $loopResult; - - $this->countable = $countable; - } - - $this->assignDefaultOutputs(); } public function set($key, $value) @@ -75,39 +59,4 @@ class LoopResultRow { return array_keys($this->substitution); } - - protected function getTimestampOutputs() - { - return array( - array('CREATE_DATE', 'getCreatedAt'), - array('UPDATE_DATE', 'getUpdatedAt'), - ); - } - - protected function getVersionOutputs() - { - return array( - array('VERSION', 'getVersion'), - array('VERSION_DATE', 'getVersionCreatedAt'), - array('VERSION_AUTHOR', 'getVersionCreatedBy'), - ); - } - - protected function assignDefaultOutputs() - { - if (true === $this->versionable) { - foreach ($this->getVersionOutputs() as $output) { - $this->set($output[0], $this->model->$output[1]()); - } - } - if (true === $this->timestampable) { - foreach ($this->getTimestampOutputs() as $output) { - $this->set($output[0], $this->model->$output[1]()); - } - } - if (true === $this->countable) { - $this->set('LOOP_COUNT', 1 + $this->loopResult->getCount()); - $this->set('LOOP_TOTAL', $this->loopResult->getModelCollectionCount()); - } - } } diff --git a/core/lib/Thelia/Core/Template/Element/PropelSearchLoopInterface.php b/core/lib/Thelia/Core/Template/Element/PropelSearchLoopInterface.php new file mode 100644 index 000000000..7bcb5614c --- /dev/null +++ b/core/lib/Thelia/Core/Template/Element/PropelSearchLoopInterface.php @@ -0,0 +1,38 @@ +. */ +/* */ +/*************************************************************************************/ +namespace Thelia\Core\Template\Element; + +/** + * + * @author Etienne Roudeix + * + */ +interface PropelSearchLoopInterface +{ + /** + * this method returns a Propel ModelCriteria + * + * @return \Propel\Runtime\ActiveQuery\ModelCriteria + */ + public function buildModelCriteria(); +} diff --git a/core/lib/Thelia/Core/Template/Loop/Accessory.php b/core/lib/Thelia/Core/Template/Loop/Accessory.php index 6b15a6715..8a7a80e27 100755 --- a/core/lib/Thelia/Core/Template/Loop/Accessory.php +++ b/core/lib/Thelia/Core/Template/Loop/Accessory.php @@ -45,6 +45,9 @@ use Thelia\Type; */ class Accessory extends Product { + protected $accessoryId; + protected $accessoryPosition; + /** * @return ArgumentCollection */ @@ -64,12 +67,7 @@ class Accessory extends Product return $argumentCollection; } - /** - * @param $pagination - * - * @return \Thelia\Core\Template\Element\LoopResult - */ - public function exec(&$pagination) + public function buildModelCriteria() { $search = AccessoryQuery::create(); @@ -93,40 +91,45 @@ class Accessory extends Product $accessories = $this->search($search); - $accessoryIdList = array(0); - $accessoryPosition = $accessoryId = array(); + $this->accessoryIdList = array(0); + $this->accessoryPosition = $this->accessoryId = array(); foreach ($accessories as $accessory) { $accessoryProductId = $accessory->getAccessory(); - array_push($accessoryIdList, $accessoryProductId); + array_push($this->accessoryIdList, $accessoryProductId); - $accessoryPosition[$accessoryProductId] = $accessory->getPosition(); - $accessoryId[$accessoryProductId] = $accessory->getId(); + $this->accessoryPosition[$accessoryProductId] = $accessory->getPosition(); + $this->accessoryId[$accessoryProductId] = $accessory->getId(); } $receivedIdList = $this->getId(); /* if an Id list is receive, loop will only match accessories from this list */ if ($receivedIdList === null) { - $this->args->get('id')->setValue( implode(',', $accessoryIdList) ); + $this->args->get('id')->setValue( implode(',', $this->accessoryIdList) ); } else { - $this->args->get('id')->setValue( implode(',', array_intersect($receivedIdList, $accessoryIdList)) ); + $this->args->get('id')->setValue( implode(',', array_intersect($receivedIdList, $this->accessoryIdList)) ); } - $loopResult = parent::exec($pagination); + return parent::buildModelCriteria(); + } - foreach ($loopResult as $loopResultRow) { + public function parseResults(LoopResult $results) + { + $results = parent::parseResults($results); + + foreach ($results as $loopResultRow) { $accessoryProductId = $loopResultRow->get('ID'); $loopResultRow - ->set("ID" , $accessoryId[$accessoryProductId]) - ->set("POSITION", $accessoryPosition[$accessoryProductId]) + ->set("ID" , $this->accessoryId[$accessoryProductId]) + ->set("POSITION", $this->accessoryPosition[$accessoryProductId]) ; } - return $loopResult; + return $results; } } diff --git a/core/lib/Thelia/Core/Template/Loop/Address.php b/core/lib/Thelia/Core/Template/Loop/Address.php index 5fe20b0e4..8bb4f4f9c 100755 --- a/core/lib/Thelia/Core/Template/Loop/Address.php +++ b/core/lib/Thelia/Core/Template/Loop/Address.php @@ -28,6 +28,7 @@ use Thelia\Core\Template\Element\BaseLoop; use Thelia\Core\Template\Element\LoopResult; use Thelia\Core\Template\Element\LoopResultRow; +use Thelia\Core\Template\Element\PropelSearchLoopInterface; use Thelia\Core\Template\Loop\Argument\ArgumentCollection; use Thelia\Core\Template\Loop\Argument\Argument; @@ -44,9 +45,9 @@ use Thelia\Type; * @package Thelia\Core\Template\Loop * @author Etienne Roudeix */ -class Address extends BaseLoop +class Address extends BaseLoop implements PropelSearchLoopInterface { - public $timestampable = true; + protected $timestampable = true; /** * @return ArgumentCollection @@ -80,12 +81,7 @@ class Address extends BaseLoop ); } - /** - * @param $pagination - * - * @return \Thelia\Core\Template\Element\LoopResult - */ - public function exec(&$pagination) + public function buildModelCriteria() { $search = AddressQuery::create(); @@ -100,7 +96,7 @@ class Address extends BaseLoop if ($customer === 'current') { $currentCustomer = $this->securityContext->getCustomerUser(); if ($currentCustomer === null) { - return new LoopResult(); + return null; } else { $search->filterByCustomerId($currentCustomer->getId(), Criteria::EQUAL); } @@ -122,12 +118,14 @@ class Address extends BaseLoop $search->filterById($exclude, Criteria::NOT_IN); } - $addresses = $this->search($search, $pagination); + return $search; - $loopResult = new LoopResult($addresses); + } - foreach ($addresses as $address) { - $loopResultRow = new LoopResultRow($loopResult, $address, $this->versionable, $this->timestampable, $this->countable); + public function parseResults(LoopResult $loopResult) + { + foreach ($loopResult->getResultDataCollection() as $address) { + $loopResultRow = new LoopResultRow($address); $loopResultRow ->set("ID", $address->getId()) ->set("LABEL", $address->getLabel()) diff --git a/core/lib/Thelia/Core/Template/Loop/Admin.php b/core/lib/Thelia/Core/Template/Loop/Admin.php index 581f6faed..ef5ce7e1f 100755 --- a/core/lib/Thelia/Core/Template/Loop/Admin.php +++ b/core/lib/Thelia/Core/Template/Loop/Admin.php @@ -28,6 +28,7 @@ use Thelia\Core\Template\Element\BaseLoop; use Thelia\Core\Template\Element\LoopResult; use Thelia\Core\Template\Element\LoopResultRow; +use Thelia\Core\Template\Element\PropelSearchLoopInterface; use Thelia\Core\Template\Loop\Argument\ArgumentCollection; use Thelia\Core\Template\Loop\Argument\Argument; @@ -43,9 +44,9 @@ use Thelia\Type; * @package Thelia\Core\Template\Loop * @author Etienne Roudeix */ -class Admin extends BaseLoop +class Admin extends BaseLoop implements PropelSearchLoopInterface { - public $timestampable = true; + protected $timestampable = true; /** * @return ArgumentCollection @@ -58,12 +59,7 @@ class Admin extends BaseLoop ); } - /** - * @param $pagination - * - * @return \Thelia\Core\Template\Element\LoopResult - */ - public function exec(&$pagination) + public function buildModelCriteria() { $search = AdminQuery::create(); @@ -81,13 +77,14 @@ class Admin extends BaseLoop $search->orderByFirstname(Criteria::ASC); - /* perform search */ - $admins = $this->search($search, $pagination); + return $search; - $loopResult = new LoopResult($admins); + } - foreach ($admins as $admin) { - $loopResultRow = new LoopResultRow($loopResult, $admin, $this->versionable, $this->timestampable, $this->countable); + public function parseResults(LoopResult $loopResult) + { + foreach ($loopResult->getResultDataCollection() as $admin) { + $loopResultRow = new LoopResultRow($admin); $loopResultRow->set("ID", $admin->getId()) ->set("PROFILE",$admin->getProfileId()) ->set("FIRSTNAME",$admin->getFirstname()) @@ -99,5 +96,6 @@ class Admin extends BaseLoop } return $loopResult; + } } diff --git a/core/lib/Thelia/Core/Template/Loop/Area.php b/core/lib/Thelia/Core/Template/Loop/Area.php index 524777d08..6ac3b1518 100644 --- a/core/lib/Thelia/Core/Template/Loop/Area.php +++ b/core/lib/Thelia/Core/Template/Loop/Area.php @@ -26,6 +26,7 @@ use Propel\Runtime\ActiveQuery\Criteria; use Thelia\Core\Template\Element\BaseLoop; use Thelia\Core\Template\Element\LoopResult; use Thelia\Core\Template\Element\LoopResultRow; +use Thelia\Core\Template\Element\PropelSearchLoopInterface; use Thelia\Core\Template\Loop\Argument\Argument; use Thelia\Core\Template\Loop\Argument\ArgumentCollection; use Thelia\Model\AreaQuery; @@ -35,9 +36,9 @@ use Thelia\Model\AreaQuery; * @package Thelia\Core\Template\Loop * @author Manuel Raynaud */ -class Area extends BaseLoop +class Area extends BaseLoop implements PropelSearchLoopInterface { - public $timestampable = true; + protected $timestampable = true; /** * @@ -80,19 +81,7 @@ class Area extends BaseLoop ); } - /** - * - * this function have to be implement in your own loop class. - * - * All loops parameters can be accessible via getter. - * - * for example, ref parameter is accessible through getRef method - * - * @param $pagination - * - * @return mixed - */ - public function exec(&$pagination) + public function buildModelCriteria() { $id = $this->getId(); @@ -117,14 +106,14 @@ class Area extends BaseLoop ->where('`without_zone`.delivery_module_id '.Criteria::ISNULL); } - //echo $search->toString(); exit; + return $search; - $areas = $this->search($search, $pagination); + } - $loopResult = new LoopResult($areas); - - foreach ($areas as $area) { - $loopResultRow = new LoopResultRow($loopResult, $area, $this->versionable, $this->timestampable, $this->countable); + public function parseResults(LoopResult $loopResult) + { + foreach ($loopResult->getResultDataCollection() as $area) { + $loopResultRow = new LoopResultRow($area); $loopResultRow ->set('ID', $area->getId()) @@ -136,6 +125,7 @@ class Area extends BaseLoop } return $loopResult; + } } diff --git a/core/lib/Thelia/Core/Template/Loop/AssociatedContent.php b/core/lib/Thelia/Core/Template/Loop/AssociatedContent.php index 6fc41fc9b..9411b1dbd 100755 --- a/core/lib/Thelia/Core/Template/Loop/AssociatedContent.php +++ b/core/lib/Thelia/Core/Template/Loop/AssociatedContent.php @@ -46,6 +46,9 @@ use Thelia\Type; */ class AssociatedContent extends Content { + protected $contentId; + protected $contentPosition; + /** * @return ArgumentCollection */ @@ -68,16 +71,8 @@ class AssociatedContent extends Content return $argumentCollection; } - /** - * @param $pagination - * - * @return LoopResult - * @throws \InvalidArgumentException - */ - public function exec(&$pagination) + public function buildModelCriteria() { - // - $product = $this->getProduct(); $category = $this->getCategory(); @@ -136,16 +131,15 @@ class AssociatedContent extends Content $associatedContentIdList = array(0); - $contentIdList = array(0); - $contentPosition = $contentId = array(); + $this->contentPosition = $this->contentId = array(); foreach ($associatedContents as $associatedContent) { $associatedContentId = $associatedContent->getContentId(); array_push($associatedContentIdList, $associatedContentId); - $contentPosition[$associatedContentId] = $associatedContent->getPosition(); - $contentId[$associatedContentId] = $associatedContent->getId(); + $this->contentPosition[$associatedContentId] = $associatedContent->getPosition(); + $this->contentId[$associatedContentId] = $associatedContent->getId(); } $receivedIdList = $this->getId(); @@ -157,18 +151,23 @@ class AssociatedContent extends Content $this->args->get('id')->setValue( implode(',', array_intersect($receivedIdList, $associatedContentIdList)) ); } - $loopResult = parent::exec($pagination); + return parent::buildModelCriteria(); + } - foreach ($loopResult as $loopResultRow) { + public function parseResults(LoopResult $results) + { + $results = parent::parseResults($results); + + foreach ($results as $loopResultRow) { $relatedContentId = $loopResultRow->get('ID'); $loopResultRow - ->set("ID" , $contentId[$relatedContentId]) - ->set("POSITION", $contentPosition[$relatedContentId]) + ->set("ID" , $this->contentId[$relatedContentId]) + ->set("POSITION", $this->contentPosition[$relatedContentId]) ; } - return $loopResult; + return $results; } } diff --git a/core/lib/Thelia/Core/Template/Loop/Attribute.php b/core/lib/Thelia/Core/Template/Loop/Attribute.php index daad80979..97b540f96 100755 --- a/core/lib/Thelia/Core/Template/Loop/Attribute.php +++ b/core/lib/Thelia/Core/Template/Loop/Attribute.php @@ -28,6 +28,7 @@ use Thelia\Core\Template\Element\BaseI18nLoop; use Thelia\Core\Template\Element\LoopResult; use Thelia\Core\Template\Element\LoopResultRow; +use Thelia\Core\Template\Element\PropelSearchLoopInterface; use Thelia\Core\Template\Loop\Argument\ArgumentCollection; use Thelia\Core\Template\Loop\Argument\Argument; @@ -47,9 +48,11 @@ use Thelia\Model\Map\AttributeTemplateTableMap; * @package Thelia\Core\Template\Loop * @author Etienne Roudeix */ -class Attribute extends BaseI18nLoop +class Attribute extends BaseI18nLoop implements PropelSearchLoopInterface { - public $timestampable = true; + protected $useAttributePosistion; + + protected $timestampable = true; /** * @return ArgumentCollection @@ -72,12 +75,7 @@ class Attribute extends BaseI18nLoop ); } - /** - * @param $pagination - * - * @return \Thelia\Core\Template\Element\LoopResult - */ - public function exec(&$pagination) + public function buildModelCriteria() { $search = AttributeQuery::create(); @@ -86,7 +84,7 @@ class Attribute extends BaseI18nLoop $lang = $this->getLang(); /* manage translations */ - $locale = $this->configureI18nProcessing($search); + $this->configureI18nProcessing($search); $id = $this->getId(); @@ -104,7 +102,7 @@ class Attribute extends BaseI18nLoop $template = $this->getTemplate(); $exclude_template = $this->getExcludeTemplate(); - $use_attribute_pos = true; + $this->useAttributePosistion = true; if (null !== $product) { // Find all template assigned to the products. @@ -132,7 +130,7 @@ class Attribute extends BaseI18nLoop ->filterByTemplate(TemplateQuery::create()->findById($template), Criteria::IN) ; - $use_attribute_pos = false; + $this->useAttributePosistion = false; } elseif (null !== $exclude_template) { // Join with attribute_template table to get position @@ -144,7 +142,7 @@ class Attribute extends BaseI18nLoop ->filterById($exclude_attributes, Criteria::NOT_IN) ; - $use_attribute_pos = false; + $this->useAttributePosistion = false; } $orders = $this->getOrder(); @@ -164,13 +162,13 @@ class Attribute extends BaseI18nLoop $search->addDescendingOrderByColumn('i18n_TITLE'); break; case "manual": - if ($use_attribute_pos) + if ($this->useAttributePosistion) $search->orderByPosition(Criteria::ASC); else $search->addAscendingOrderByColumn(AttributeTemplateTableMap::POSITION); break; case "manual_reverse": - if ($use_attribute_pos) + if ($this->useAttributePosistion) $search->orderByPosition(Criteria::DESC); else $search->addDescendingOrderByColumn(AttributeTemplateTableMap::POSITION); @@ -178,26 +176,28 @@ class Attribute extends BaseI18nLoop } } - /* perform search */ - $attributes = $this->search($search, $pagination); + return $search; - $loopResult = new LoopResult($attributes); + } - foreach ($attributes as $attribute) { - $loopResultRow = new LoopResultRow($loopResult, $attribute, $this->versionable, $this->timestampable, $this->countable); + public function parseResults(LoopResult $loopResult) + { + foreach ($loopResult->getResultDataCollection() as $attribute) { + $loopResultRow = new LoopResultRow($attribute); $loopResultRow->set("ID", $attribute->getId()) ->set("IS_TRANSLATED",$attribute->getVirtualColumn('IS_TRANSLATED')) - ->set("LOCALE",$locale) + ->set("LOCALE",$this->locale) ->set("TITLE",$attribute->getVirtualColumn('i18n_TITLE')) ->set("CHAPO", $attribute->getVirtualColumn('i18n_CHAPO')) ->set("DESCRIPTION", $attribute->getVirtualColumn('i18n_DESCRIPTION')) ->set("POSTSCRIPTUM", $attribute->getVirtualColumn('i18n_POSTSCRIPTUM')) - ->set("POSITION", $use_attribute_pos ? $attribute->getPosition() : $attribute->getVirtualColumn('position')) + ->set("POSITION", $this->useAttributePosistion ? $attribute->getPosition() : $attribute->getVirtualColumn('position')) ; $loopResult->addRow($loopResultRow); } return $loopResult; + } } diff --git a/core/lib/Thelia/Core/Template/Loop/AttributeAvailability.php b/core/lib/Thelia/Core/Template/Loop/AttributeAvailability.php index 10c1dda00..81f01f6da 100755 --- a/core/lib/Thelia/Core/Template/Loop/AttributeAvailability.php +++ b/core/lib/Thelia/Core/Template/Loop/AttributeAvailability.php @@ -28,6 +28,7 @@ use Thelia\Core\Template\Element\BaseI18nLoop; use Thelia\Core\Template\Element\LoopResult; use Thelia\Core\Template\Element\LoopResultRow; +use Thelia\Core\Template\Element\PropelSearchLoopInterface; use Thelia\Core\Template\Loop\Argument\ArgumentCollection; use Thelia\Core\Template\Loop\Argument\Argument; @@ -43,9 +44,9 @@ use Thelia\Type; * @package Thelia\Core\Template\Loop * @author Etienne Roudeix */ -class AttributeAvailability extends BaseI18nLoop +class AttributeAvailability extends BaseI18nLoop implements PropelSearchLoopInterface { - public $timestampable = true; + protected $timestampable = true; /** * @return ArgumentCollection @@ -66,17 +67,12 @@ class AttributeAvailability extends BaseI18nLoop ); } - /** - * @param $pagination - * - * @return \Thelia\Core\Template\Element\LoopResult - */ - public function exec(&$pagination) + public function buildModelCriteria() { $search = AttributeAvQuery::create(); /* manage translations */ - $locale = $this->configureI18nProcessing($search); + $this->configureI18nProcessing($search); $id = $this->getId(); @@ -121,18 +117,19 @@ class AttributeAvailability extends BaseI18nLoop } } - /* perform search */ - $attributesAv = $this->search($search, $pagination); + return $search; - $loopResult = new LoopResult($attributesAv); + } - foreach ($attributesAv as $attributeAv) { - $loopResultRow = new LoopResultRow($loopResult, $attributeAv, $this->versionable, $this->timestampable, $this->countable); + public function parseResults(LoopResult $loopResult) + { + foreach ($loopResult->getResultDataCollection() as $attributeAv) { + $loopResultRow = new LoopResultRow($attributeAv); $loopResultRow ->set("ID" , $attributeAv->getId()) ->set("ATTRIBUTE_ID" , $attributeAv->getAttributeId()) ->set("IS_TRANSLATED", $attributeAv->getVirtualColumn('IS_TRANSLATED')) - ->set("LOCALE" , $locale) + ->set("LOCALE" , $this->locale) ->set("TITLE" , $attributeAv->getVirtualColumn('i18n_TITLE')) ->set("CHAPO" , $attributeAv->getVirtualColumn('i18n_CHAPO')) ->set("DESCRIPTION" , $attributeAv->getVirtualColumn('i18n_DESCRIPTION')) @@ -144,5 +141,6 @@ class AttributeAvailability extends BaseI18nLoop } return $loopResult; + } } diff --git a/core/lib/Thelia/Core/Template/Loop/AttributeCombination.php b/core/lib/Thelia/Core/Template/Loop/AttributeCombination.php index f2af0887d..7fad6bd34 100755 --- a/core/lib/Thelia/Core/Template/Loop/AttributeCombination.php +++ b/core/lib/Thelia/Core/Template/Loop/AttributeCombination.php @@ -28,6 +28,7 @@ use Thelia\Core\Template\Element\BaseI18nLoop; use Thelia\Core\Template\Element\LoopResult; use Thelia\Core\Template\Element\LoopResultRow; +use Thelia\Core\Template\Element\PropelSearchLoopInterface; use Thelia\Core\Template\Loop\Argument\ArgumentCollection; use Thelia\Core\Template\Loop\Argument\Argument; @@ -45,9 +46,9 @@ use Thelia\Type; * @package Thelia\Core\Template\Loop * @author Etienne Roudeix */ -class AttributeCombination extends BaseI18nLoop +class AttributeCombination extends BaseI18nLoop implements PropelSearchLoopInterface { - public $timestampable = true; + protected $timestampable = true; /** * @return ArgumentCollection @@ -66,17 +67,12 @@ class AttributeCombination extends BaseI18nLoop ); } - /** - * @param $pagination - * - * @return \Thelia\Core\Template\Element\LoopResult - */ - public function exec(&$pagination) + public function buildModelCriteria() { $search = AttributeCombinationQuery::create(); /* manage attribute translations */ - $locale = $this->configureI18nProcessing( + $this->configureI18nProcessing( $search, array('TITLE', 'CHAPO', 'DESCRIPTION', 'POSTSCRIPTUM'), AttributeTableMap::TABLE_NAME, @@ -84,7 +80,7 @@ class AttributeCombination extends BaseI18nLoop ); /* manage attributeAv translations */ - $locale = $this->configureI18nProcessing( + $this->configureI18nProcessing( $search, array('TITLE', 'CHAPO', 'DESCRIPTION', 'POSTSCRIPTUM'), AttributeAvTableMap::TABLE_NAME, @@ -108,15 +104,17 @@ class AttributeCombination extends BaseI18nLoop } } - $attributeCombinations = $this->search($search, $pagination); + return $search; - $loopResult = new LoopResult($attributeCombinations); + } - foreach ($attributeCombinations as $attributeCombination) { - $loopResultRow = new LoopResultRow($loopResult, $attributeCombination, $this->versionable, $this->timestampable, $this->countable); + public function parseResults(LoopResult $loopResult) + { + foreach ($loopResult->getResultDataCollection() as $attributeCombination) { + $loopResultRow = new LoopResultRow($attributeCombination); $loopResultRow - ->set("LOCALE",$locale) + ->set("LOCALE",$this->locale) ->set("ATTRIBUTE_TITLE", $attributeCombination->getVirtualColumn(AttributeTableMap::TABLE_NAME . '_i18n_TITLE')) ->set("ATTRIBUTE_CHAPO", $attributeCombination->getVirtualColumn(AttributeTableMap::TABLE_NAME . '_i18n_CHAPO')) ->set("ATTRIBUTE_DESCRIPTION", $attributeCombination->getVirtualColumn(AttributeTableMap::TABLE_NAME . '_i18n_DESCRIPTION')) @@ -130,5 +128,6 @@ class AttributeCombination extends BaseI18nLoop } return $loopResult; + } } diff --git a/core/lib/Thelia/Core/Template/Loop/Auth.php b/core/lib/Thelia/Core/Template/Loop/Auth.php index cdb668978..ef466d3e9 100755 --- a/core/lib/Thelia/Core/Template/Loop/Auth.php +++ b/core/lib/Thelia/Core/Template/Loop/Auth.php @@ -24,6 +24,7 @@ namespace Thelia\Core\Template\Loop; use Thelia\Core\Security\AccessManager; +use Thelia\Core\Template\Element\ArraySearchLoopInterface; use Thelia\Core\Template\Element\BaseLoop; use Thelia\Core\Template\Element\LoopResult; use Thelia\Core\Template\Element\LoopResultRow; @@ -40,7 +41,7 @@ use Thelia\Type\TypeCollection; * * @author Franck Allimant */ -class Auth extends BaseLoop +class Auth extends BaseLoop implements ArraySearchLoopInterface { public function getArgDefinitions() { @@ -69,19 +70,17 @@ class Auth extends BaseLoop ); } - /** - * @param $pagination - * - * @return LoopResult - */ - public function exec(&$pagination) + public function buildArray() + { + return array(); + } + + public function parseResults(LoopResult $loopResult) { $roles = $this->getRole(); $resource = $this->getResource(); $access = $this->getAccess(); - $loopResult = new LoopResult(); - try { if (true === $this->securityContext->isGranted($roles, $resource === null ? array() : $resource, $access === null ? array() : $access)) { diff --git a/core/lib/Thelia/Core/Template/Loop/BaseSpecificModule.php b/core/lib/Thelia/Core/Template/Loop/BaseSpecificModule.php index 6f5f23707..c1bc483f9 100644 --- a/core/lib/Thelia/Core/Template/Loop/BaseSpecificModule.php +++ b/core/lib/Thelia/Core/Template/Loop/BaseSpecificModule.php @@ -24,6 +24,8 @@ namespace Thelia\Core\Template\Loop; use Propel\Runtime\ActiveQuery\Criteria; use Thelia\Core\Template\Element\BaseI18nLoop; +use Thelia\Core\Template\Element\LoopResult; +use Thelia\Core\Template\Element\PropelSearchLoopInterface; use Thelia\Core\Template\Loop\Argument\Argument; use Thelia\Core\Template\Loop\Argument\ArgumentCollection; use Thelia\Model\ModuleQuery; @@ -32,9 +34,9 @@ use Thelia\Model\ModuleQuery; * @package Thelia\Core\Template\Loop * @author Manuel Raynaud */ -class BaseSpecificModule extends BaseI18nLoop +abstract class BaseSpecificModule extends BaseI18nLoop implements PropelSearchLoopInterface { - public $timestampable = true; + protected $timestampable = true; /** * @@ -76,19 +78,7 @@ class BaseSpecificModule extends BaseI18nLoop ); } - /** - * - * this function have to be implement in your own loop class. - * - * All loops parameters can be accesible via getter. - * - * for example, ref parameter is accessible through getRef method - * - * @param $pagination - * - * @return \Thelia\Model\ModuleQuery - */ - public function exec(&$pagination) + public function buildModelCriteria() { $search = ModuleQuery::create(); @@ -102,7 +92,12 @@ class BaseSpecificModule extends BaseI18nLoop $search->filterById($exclude, Criteria::NOT_IN); } + $this->configureI18nProcessing($search); + + $search->filterByType($this->getModuleType(), Criteria::EQUAL); + return $search; } + abstract protected function getModuleType(); } diff --git a/core/lib/Thelia/Core/Template/Loop/Cart.php b/core/lib/Thelia/Core/Template/Loop/Cart.php index e54675a29..f6b4c6a01 100755 --- a/core/lib/Thelia/Core/Template/Loop/Cart.php +++ b/core/lib/Thelia/Core/Template/Loop/Cart.php @@ -9,15 +9,15 @@ namespace Thelia\Core\Template\Loop; +use Thelia\Core\Template\Element\ArraySearchLoopInterface; use Thelia\Core\Template\Element\BaseLoop; use Thelia\Core\Template\Element\LoopResult; use Thelia\Core\Template\Element\LoopResultRow; -use Thelia\Core\Template\Loop\Argument\Argument; use Thelia\Core\Template\Loop\Argument\ArgumentCollection; use Thelia\Model\CountryQuery; use Thelia\Type; -class Cart extends BaseLoop +class Cart extends BaseLoop implements ArraySearchLoopInterface { use \Thelia\Cart\CartTrait; /** @@ -41,80 +41,29 @@ class Cart extends BaseLoop */ protected function getArgDefinitions() { - return new ArgumentCollection( - Argument::createIntTypeArgument('limit'), - Argument::createAnyTypeArgument('position') - ); + return new ArgumentCollection(); } - /** - * - * this function have to be implement in your own loop class. - * - * All your parameters are defined in defineArgs() and can be accessible like a class property. - * - * example : - * - * public function defineArgs() - * { - * return array ( - * "ref", - * "id" => "optional", - * "stock" => array( - * "optional", - * "default" => 10 - * ) - * ); - * } - * - * you can retrieve ref value using $this->ref - * - * @param $pagination - * - * @return mixed - */ - public function exec(&$pagination) + public function buildArray() { - $cart = $this->getCart($this->request); - $cartItems = $cart->getCartItems(); - $result = new LoopResult($cartItems); - - if ($cart === null) { - return $result; + if(null === $cart) { + return array(); } - $limit = $this->getLimit(); - - $countCartItems = count($cartItems); - - if ($limit <= 0 || $limit >= $countCartItems) { - $limit = $countCartItems; - } - - $position = $this->getPosition(); - - if (isset($position)) { - if ($position == "first") { - $limit = 1; - $cartItems = array($cartItems[0]); - } elseif ($position == "last") { - $limit = 1; - $cartItems = array(end($cartItems)); - } - - // @TODO : if the position is a number - } + return iterator_to_array($cart->getCartItems()); + } + public function parseResults(LoopResult $loopResult) + { $taxCountry = CountryQuery::create()->findPk(64); // @TODO : make it magic; - for ($i=0; $i<$limit; $i ++) { - $cartItem = $cartItems[$i]; + foreach($loopResult->getResultDataCollection() as $cartItem) { $product = $cartItem->getProduct(); $productSaleElement = $cartItem->getProductSaleElements(); - $loopResultRow = new LoopResultRow($result, $cartItem, $this->versionable, $this->timestampable, $this->countable); + $loopResultRow = new LoopResultRow(); $loopResultRow->set("ITEM_ID", $cartItem->getId()); $loopResultRow->set("TITLE", $product->getTitle()); @@ -130,10 +79,11 @@ class Cart extends BaseLoop ->set("PROMO_TAXED_PRICE", $cartItem->getTaxedPromoPrice($taxCountry)) ->set("IS_PROMO", $cartItem->getPromo() === 1 ? 1 : 0); $loopResultRow->set("PRODUCT_SALE_ELEMENTS_ID", $productSaleElement->getId()); - $result->addRow($loopResultRow); + + $loopResult->addRow($loopResultRow); } - return $result; + return $loopResult; } /** diff --git a/core/lib/Thelia/Core/Template/Loop/Category.php b/core/lib/Thelia/Core/Template/Loop/Category.php index 7de04c739..b03f6dbb0 100755 --- a/core/lib/Thelia/Core/Template/Loop/Category.php +++ b/core/lib/Thelia/Core/Template/Loop/Category.php @@ -28,6 +28,7 @@ use Thelia\Core\Template\Element\BaseI18nLoop; use Thelia\Core\Template\Element\LoopResult; use Thelia\Core\Template\Element\LoopResultRow; +use Thelia\Core\Template\Element\PropelSearchLoopInterface; use Thelia\Core\Template\Loop\Argument\ArgumentCollection; use Thelia\Core\Template\Loop\Argument\Argument; @@ -61,10 +62,10 @@ use Thelia\Model\ProductQuery; * @author Manuel Raynaud * @author Etienne Roudeix */ -class Category extends BaseI18nLoop +class Category extends BaseI18nLoop implements PropelSearchLoopInterface { - public $timestampable = true; - public $versionable = true; + protected $timestampable = true; + protected $versionable = true; /** * @return ArgumentCollection @@ -90,17 +91,12 @@ class Category extends BaseI18nLoop ); } - /** - * @param $pagination - * - * @return \Thelia\Core\Template\Element\LoopResult - */ - public function exec(&$pagination) + public function buildModelCriteria() { $search = CategoryQuery::create(); /* manage translations */ - $locale = $this->configureI18nProcessing($search); + $this->configureI18nProcessing($search); $id = $this->getId(); @@ -184,16 +180,16 @@ class Category extends BaseI18nLoop } } - /* perform search */ - $categories = $this->search($search, $pagination); - /* @todo */ $notEmpty = $this->getNot_empty(); - $loopResult = new LoopResult($categories); + return $search; - foreach ($categories as $category) { + } + public function parseResults(LoopResult $loopResult) + { + foreach ($loopResult->getResultDataCollection() as $category) { // Find previous and next category $previous = CategoryQuery::create() ->filterByParent($category->getParent()) @@ -214,18 +210,18 @@ class Category extends BaseI18nLoop * if ($this->getNotEmpty() && $category->countAllProducts() == 0) continue; */ - $loopResultRow = new LoopResultRow($loopResult, $category, $this->versionable, $this->timestampable, $this->countable); + $loopResultRow = new LoopResultRow($category); $loopResultRow ->set("ID", $category->getId()) ->set("IS_TRANSLATED",$category->getVirtualColumn('IS_TRANSLATED')) - ->set("LOCALE",$locale) + ->set("LOCALE",$this->locale) ->set("TITLE", $category->getVirtualColumn('i18n_TITLE')) ->set("CHAPO", $category->getVirtualColumn('i18n_CHAPO')) ->set("DESCRIPTION", $category->getVirtualColumn('i18n_DESCRIPTION')) ->set("POSTSCRIPTUM", $category->getVirtualColumn('i18n_POSTSCRIPTUM')) ->set("PARENT", $category->getParent()) - ->set("URL", $category->getUrl($locale)) + ->set("URL", $category->getUrl($this->locale)) ->set("PRODUCT_COUNT", $category->countAllProducts()) ->set("CHILD_COUNT", $category->countChild()) ->set("VISIBLE", $category->getVisible() ? "1" : "0") @@ -236,11 +232,12 @@ class Category extends BaseI18nLoop ->set("PREVIOUS", $previous != null ? $previous->getId() : -1) ->set("NEXT" , $next != null ? $next->getId() : -1) - ; + ; $loopResult->addRow($loopResultRow); } return $loopResult; + } } diff --git a/core/lib/Thelia/Core/Template/Loop/CategoryPath.php b/core/lib/Thelia/Core/Template/Loop/CategoryPath.php index 0582ad3ee..1b7f68f22 100755 --- a/core/lib/Thelia/Core/Template/Loop/CategoryPath.php +++ b/core/lib/Thelia/Core/Template/Loop/CategoryPath.php @@ -23,6 +23,7 @@ namespace Thelia\Core\Template\Loop; +use Thelia\Core\Template\Element\ArraySearchLoopInterface; use Thelia\Core\Template\Element\BaseI18nLoop; use Thelia\Core\Template\Element\LoopResult; use Thelia\Core\Template\Element\LoopResultRow; @@ -54,7 +55,7 @@ use Thelia\Type\BooleanOrBothType; * @package Thelia\Core\Template\Loop * @author Franck Allimant */ -class CategoryPath extends BaseI18nLoop +class CategoryPath extends BaseI18nLoop implements ArraySearchLoopInterface { /** * @return ArgumentCollection @@ -69,19 +70,14 @@ class CategoryPath extends BaseI18nLoop ); } - /** - * @param $pagination (ignored) - * - * @return \Thelia\Core\Template\Element\LoopResult - */ - public function exec(&$pagination) + public function buildArray() { $id = $this->getCategory(); $visible = $this->getVisible(); $search = CategoryQuery::create(); - $locale = $this->configureI18nProcessing($search, array('TITLE')); + $this->configureI18nProcessing($search, array('TITLE')); $search->filterById($id); if ($visible != BooleanOrBothType::ANY) $search->filterByVisible($visible); @@ -95,16 +91,12 @@ class CategoryPath extends BaseI18nLoop if ($category != null) { - $loopResultRow = new LoopResultRow(); - - $loopResultRow - ->set("TITLE",$category->getVirtualColumn('i18n_TITLE')) - ->set("URL", $category->getUrl($locale)) - ->set("ID", $category->getId()) - ->set("LOCALE",$locale) - ; - - $results[] = $loopResultRow; + $results[] = array( + "ID" => $category->getId(), + "TITLE" => $category->getVirtualColumn('i18n_TITLE'), + "URL" => $category->getUrl($this->locale), + "LOCALE" => $this->locale, + ); $parent = $category->getParent(); @@ -128,11 +120,18 @@ class CategoryPath extends BaseI18nLoop } while ($category != null && $parent > 0); // Reverse list and build the final result - $results = array_reverse($results); + return array_reverse($results); + } - $loopResult = new LoopResult(); - - foreach($results as $result) $loopResult->addRow($result); + public function parseResults(LoopResult $loopResult) + { + foreach($loopResult->getResultDataCollection() as $result) { + $loopResultRow = new LoopResultRow($result); + foreach($result as $output => $outputValue) { + $loopResultRow->set($output, $outputValue); + } + $loopResult->addRow($loopResultRow); + } return $loopResult; } diff --git a/core/lib/Thelia/Core/Template/Loop/CategoryTree.php b/core/lib/Thelia/Core/Template/Loop/CategoryTree.php index b7c262649..3c3c3ffe0 100755 --- a/core/lib/Thelia/Core/Template/Loop/CategoryTree.php +++ b/core/lib/Thelia/Core/Template/Loop/CategoryTree.php @@ -23,6 +23,7 @@ namespace Thelia\Core\Template\Loop; use Propel\Runtime\ActiveQuery\Criteria; +use Thelia\Core\Template\Element\ArraySearchLoopInterface; use Thelia\Core\Template\Element\LoopResult; use Thelia\Core\Template\Element\LoopResultRow; @@ -45,7 +46,7 @@ use Thelia\Core\Template\Element\BaseI18nLoop; * @package Thelia\Core\Template\Loop * @author Franck Allimant */ -class CategoryTree extends BaseI18nLoop +class CategoryTree extends BaseI18nLoop implements ArraySearchLoopInterface { /** * @return ArgumentCollection @@ -59,13 +60,13 @@ class CategoryTree extends BaseI18nLoop } // changement de rubrique - protected function buildCategoryTree($parent, $visible, $level, $previousLevel, $max_level, $exclude, LoopResult &$loopResult) + protected function buildCategoryTree($parent, $visible, $level, $previousLevel, $max_level, $exclude, &$resultsList) { if ($level > $max_level) return; $search = CategoryQuery::create(); - $locale = $this->configureI18nProcessing($search, array( + $this->configureI18nProcessing($search, array( 'TITLE' )); @@ -81,41 +82,45 @@ class CategoryTree extends BaseI18nLoop foreach ($results as $result) { - $loopResultRow = new LoopResultRow(); + $resultsList[] = array( + "ID" => $result->getId(), + "TITLE" => $result->getVirtualColumn('i18n_TITLE'), + "PARENT" => $result->getParent(), + "URL" => $result->getUrl($this->locale), + "VISIBLE" => $result->getVisible() ? "1" : "0", + "LEVEL" => $level, + 'CHILD_COUNT' => $result->countChild(), + 'PREV_LEVEL' => $previousLevel, + ); - $loopResultRow - ->set("ID", $result->getId()) - ->set("TITLE", $result->getVirtualColumn('i18n_TITLE')) - ->set("PARENT", $result->getParent()) - ->set("URL", $result->getUrl($locale)) - ->set("VISIBLE", $result->getVisible() ? "1" : "0") - ->set("LEVEL", $level) - ->set('CHILD_COUNT', $result->countChild()) - ->set('PREV_LEVEL', $previousLevel) - ; - - $loopResult->addRow($loopResultRow); - - $this->buildCategoryTree($result->getId(), $visible, 1 + $level, $level, $max_level, $exclude, $loopResult); + $this->buildCategoryTree($result->getId(), $visible, 1 + $level, $level, $max_level, $exclude, $resultsList); } } - /** - * @param $pagination (ignored) - * - * @return \Thelia\Core\Template\Element\LoopResult - */ - public function exec(&$pagination) + public function parseResults(LoopResult $loopResult) + { + foreach($loopResult->getResultDataCollection() as $result) { + $loopResultRow = new LoopResultRow($result); + foreach($result as $output => $outputValue) { + $loopResultRow->set($output, $outputValue); + } + $loopResult->addRow($loopResultRow); + } + + return $loopResult; + } + + public function buildArray() { $id = $this->getCategory(); $depth = $this->getDepth(); $visible = $this->getVisible(); $exclude = $this->getExclude(); - $loopResult = new LoopResult(); + $resultsList = array(); - $this->buildCategoryTree($id, $visible, 0, 0, $depth, $exclude, $loopResult); + $this->buildCategoryTree($id, $visible, 0, 0, $depth, $exclude, $resultsList); - return $loopResult; + return $resultsList; } } diff --git a/core/lib/Thelia/Core/Template/Loop/Config.php b/core/lib/Thelia/Core/Template/Loop/Config.php index 78f53489b..f656c6d51 100644 --- a/core/lib/Thelia/Core/Template/Loop/Config.php +++ b/core/lib/Thelia/Core/Template/Loop/Config.php @@ -28,6 +28,7 @@ use Thelia\Core\Template\Element\BaseI18nLoop; use Thelia\Core\Template\Element\LoopResult; use Thelia\Core\Template\Element\LoopResultRow; +use Thelia\Core\Template\Element\PropelSearchLoopInterface; use Thelia\Core\Template\Loop\Argument\Argument; use Thelia\Core\Template\Loop\Argument\ArgumentCollection; @@ -48,9 +49,9 @@ use Thelia\Type\EnumListType; * @package Thelia\Core\Template\Loop * @author Franck Allimant */ -class Config extends BaseI18nLoop +class Config extends BaseI18nLoop implements PropelSearchLoopInterface { - public $timestampable = true; + protected $timestampable = true; /** * @return ArgumentCollection @@ -80,20 +81,16 @@ class Config extends BaseI18nLoop ); } - /** - * @param $pagination (ignored) - * - * @return \Thelia\Core\Template\Element\LoopResult - */ - public function exec(&$pagination) + public function buildModelCriteria() { $id = $this->getId(); $name = $this->getVariable(); $secured = $this->getSecured(); + $exclude = $this->getExclude(); $search = ConfigQuery::create(); - $locale = $this->configureI18nProcessing($search); + $this->configureI18nProcessing($search); if (! is_null($id)) $search->filterById($id); @@ -145,20 +142,21 @@ class Config extends BaseI18nLoop } } - $results = $this->search($search, $pagination); + return $search; - $loopResult = new LoopResult($results); + } - foreach ($results as $result) { - - $loopResultRow = new LoopResultRow($loopResult, $result, $this->versionable, $this->timestampable, $this->countable); + public function parseResults(LoopResult $loopResult) + { + foreach ($loopResult->getResultDataCollection() as $result) { + $loopResultRow = new LoopResultRow($result); $loopResultRow ->set("ID" , $result->getId()) ->set("NAME" , $result->getName()) ->set("VALUE" , $result->getValue()) ->set("IS_TRANSLATED", $result->getVirtualColumn('IS_TRANSLATED')) - ->set("LOCALE" , $locale) + ->set("LOCALE" , $this->locale) ->set("TITLE" , $result->getVirtualColumn('i18n_TITLE')) ->set("CHAPO" , $result->getVirtualColumn('i18n_CHAPO')) ->set("DESCRIPTION" , $result->getVirtualColumn('i18n_DESCRIPTION')) @@ -171,5 +169,6 @@ class Config extends BaseI18nLoop } return $loopResult; + } } diff --git a/core/lib/Thelia/Core/Template/Loop/Content.php b/core/lib/Thelia/Core/Template/Loop/Content.php index 3770d700d..e40e95815 100755 --- a/core/lib/Thelia/Core/Template/Loop/Content.php +++ b/core/lib/Thelia/Core/Template/Loop/Content.php @@ -28,6 +28,7 @@ use Thelia\Core\Template\Element\BaseI18nLoop; use Thelia\Core\Template\Element\LoopResult; use Thelia\Core\Template\Element\LoopResultRow; +use Thelia\Core\Template\Element\PropelSearchLoopInterface; use Thelia\Core\Template\Loop\Argument\ArgumentCollection; use Thelia\Core\Template\Loop\Argument\Argument; @@ -47,10 +48,10 @@ use Thelia\Type\BooleanOrBothType; * @package Thelia\Core\Template\Loop * @author Etienne Roudeix */ -class Content extends BaseI18nLoop +class Content extends BaseI18nLoop implements PropelSearchLoopInterface { - public $timestampable = true; - public $versionable = true; + protected $timestampable = true; + protected $versionable = true; /** * @return ArgumentCollection @@ -77,19 +78,13 @@ class Content extends BaseI18nLoop ); } - /** - * @param $pagination - * - * @return LoopResult - * @throws \InvalidArgumentException - */ - public function exec(&$pagination) + public function buildModelCriteria() { $search = ContentQuery::create(); /* manage translations */ - $locale = $this->configureI18nProcessing($search); + $this->configureI18nProcessing($search); $id = $this->getId(); @@ -205,26 +200,25 @@ class Content extends BaseI18nLoop ); } - /* perform search */ - $search->groupBy(ContentTableMap::ID); + return $search; - $contents = $this->search($search, $pagination); + } - $loopResult = new LoopResult($contents); - - foreach ($contents as $content) { - $loopResultRow = new LoopResultRow($loopResult, $content, $this->versionable, $this->timestampable, $this->countable); + public function parseResults(LoopResult $loopResult) + { + foreach ($loopResult->getResultDataCollection() as $content) { + $loopResultRow = new LoopResultRow($content); $loopResultRow->set("ID", $content->getId()) ->set("IS_TRANSLATED",$content->getVirtualColumn('IS_TRANSLATED')) - ->set("LOCALE",$locale) + ->set("LOCALE",$this->locale) ->set("TITLE",$content->getVirtualColumn('i18n_TITLE')) ->set("CHAPO", $content->getVirtualColumn('i18n_CHAPO')) ->set("DESCRIPTION", $content->getVirtualColumn('i18n_DESCRIPTION')) ->set("POSTSCRIPTUM", $content->getVirtualColumn('i18n_POSTSCRIPTUM')) ->set("POSITION", $content->getPosition()) ->set("DEFAULT_FOLDER", $content->getDefaultFolderId()) - ->set("URL", $content->getUrl($locale)) + ->set("URL", $content->getUrl($this->locale)) ->set("VISIBLE", $content->getVisible()) ; @@ -232,6 +226,7 @@ class Content extends BaseI18nLoop } return $loopResult; + } } diff --git a/core/lib/Thelia/Core/Template/Loop/Country.php b/core/lib/Thelia/Core/Template/Loop/Country.php index 87e45cb47..8676e03af 100755 --- a/core/lib/Thelia/Core/Template/Loop/Country.php +++ b/core/lib/Thelia/Core/Template/Loop/Country.php @@ -28,6 +28,7 @@ use Thelia\Core\Template\Element\BaseI18nLoop; use Thelia\Core\Template\Element\LoopResult; use Thelia\Core\Template\Element\LoopResultRow; +use Thelia\Core\Template\Element\PropelSearchLoopInterface; use Thelia\Core\Template\Loop\Argument\ArgumentCollection; use Thelia\Core\Template\Loop\Argument\Argument; @@ -42,9 +43,9 @@ use Thelia\Model\CountryQuery; * @package Thelia\Core\Template\Loop * @author Etienne Roudeix */ -class Country extends BaseI18nLoop +class Country extends BaseI18nLoop implements PropelSearchLoopInterface { - public $timestampable = true; + protected $timestampable = true; /** * @return ArgumentCollection @@ -59,17 +60,12 @@ class Country extends BaseI18nLoop ); } - /** - * @param $pagination - * - * @return \Thelia\Core\Template\Element\LoopResult - */ - public function exec(&$pagination) + public function buildModelCriteria() { $search = CountryQuery::create(); /* manage translations */ - $locale = $this->configureI18nProcessing($search); + $this->configureI18nProcessing($search); $id = $this->getId(); @@ -99,16 +95,17 @@ class Country extends BaseI18nLoop $search->addAscendingOrderByColumn('i18n_TITLE'); - /* perform search */ - $countries = $this->search($search, $pagination); + return $search; - $loopResult = new LoopResult($countries); + } - foreach ($countries as $country) { - $loopResultRow = new LoopResultRow($loopResult, $country, $this->versionable, $this->timestampable, $this->countable); + public function parseResults(LoopResult $loopResult) + { + foreach ($loopResult->getResultDataCollection() as $country) { + $loopResultRow = new LoopResultRow($country); $loopResultRow->set("ID", $country->getId()) ->set("IS_TRANSLATED",$country->getVirtualColumn('IS_TRANSLATED')) - ->set("LOCALE",$locale) + ->set("LOCALE",$this->locale) ->set("TITLE",$country->getVirtualColumn('i18n_TITLE')) ->set("CHAPO", $country->getVirtualColumn('i18n_CHAPO')) ->set("DESCRIPTION", $country->getVirtualColumn('i18n_DESCRIPTION')) @@ -118,11 +115,12 @@ class Country extends BaseI18nLoop ->set("ISOALPHA3", $country->getIsoalpha3()) ->set("IS_DEFAULT", $country->getByDefault() ? "1" : "0") ->set("IS_SHOP_COUNTRY", $country->getShopCountry() ? "1" : "0") - ; + ; $loopResult->addRow($loopResultRow); } return $loopResult; + } } diff --git a/core/lib/Thelia/Core/Template/Loop/Coupon.php b/core/lib/Thelia/Core/Template/Loop/Coupon.php index 61e3b2762..f11fd0e9a 100755 --- a/core/lib/Thelia/Core/Template/Loop/Coupon.php +++ b/core/lib/Thelia/Core/Template/Loop/Coupon.php @@ -31,6 +31,7 @@ use Thelia\Core\HttpFoundation\Request; use Thelia\Core\Template\Element\BaseI18nLoop; use Thelia\Core\Template\Element\LoopResult; use Thelia\Core\Template\Element\LoopResultRow; +use Thelia\Core\Template\Element\PropelSearchLoopInterface; use Thelia\Core\Template\Loop\Argument\Argument; use Thelia\Core\Template\Loop\Argument\ArgumentCollection; use Thelia\Coupon\Type\CouponInterface; @@ -49,7 +50,7 @@ use Thelia\Type; * @author Guillaume MOREL * */ -class Coupon extends BaseI18nLoop +class Coupon extends BaseI18nLoop implements PropelSearchLoopInterface { /** * Define all args used in your loop @@ -64,19 +65,12 @@ class Coupon extends BaseI18nLoop ); } - /** - * Execute Loop - * - * @param PropelModelPager $pagination Pagination manager - * - * @return \Thelia\Core\Template\Element\LoopResult - */ - public function exec(&$pagination) + public function buildModelCriteria() { $search = CouponQuery::create(); /* manage translations */ - $locale = $this->configureI18nProcessing($search, array('TITLE', 'DESCRIPTION', 'SHORT_DESCRIPTION')); + $this->configureI18nProcessing($search, array('TITLE', 'DESCRIPTION', 'SHORT_DESCRIPTION')); $id = $this->getId(); $isEnabled = $this->getIsEnabled(); @@ -89,10 +83,11 @@ class Coupon extends BaseI18nLoop $search->filterByIsEnabled($isEnabled ? true : false); } - // Perform search - $coupons = $this->search($search, $pagination); + return $search; + } - $loopResult = new LoopResult(); + public function parseResults(LoopResult $loopResult) + { /** @var ConditionFactory $conditionFactory */ $conditionFactory = $this->container->get('thelia.condition.factory'); @@ -102,8 +97,8 @@ class Coupon extends BaseI18nLoop $lang = $request->getSession()->getLang(); /** @var MCoupon $coupon */ - foreach ($coupons as $coupon) { - $loopResultRow = new LoopResultRow(); + foreach ($loopResult->getResultDataCollection() as $coupon) { + $loopResultRow = new LoopResultRow($coupon); $conditions = $conditionFactory->unserializeConditionCollection( $coupon->getSerializedConditions() ); @@ -136,7 +131,7 @@ class Coupon extends BaseI18nLoop } $loopResultRow->set("ID", $coupon->getId()) ->set("IS_TRANSLATED", $coupon->getVirtualColumn('IS_TRANSLATED')) - ->set("LOCALE", $locale) + ->set("LOCALE", $this->locale) ->set("CODE", $coupon->getCode()) ->set("TITLE", $coupon->getVirtualColumn('i18n_TITLE')) ->set("SHORT_DESCRIPTION", $coupon->getVirtualColumn('i18n_SHORT_DESCRIPTION')) diff --git a/core/lib/Thelia/Core/Template/Loop/Currency.php b/core/lib/Thelia/Core/Template/Loop/Currency.php index a1f936300..82aebeb32 100755 --- a/core/lib/Thelia/Core/Template/Loop/Currency.php +++ b/core/lib/Thelia/Core/Template/Loop/Currency.php @@ -28,6 +28,7 @@ use Thelia\Core\Template\Element\BaseI18nLoop; use Thelia\Core\Template\Element\LoopResult; use Thelia\Core\Template\Element\LoopResultRow; +use Thelia\Core\Template\Element\PropelSearchLoopInterface; use Thelia\Core\Template\Loop\Argument\ArgumentCollection; use Thelia\Core\Template\Loop\Argument\Argument; @@ -44,9 +45,9 @@ use Thelia\Type\EnumListType; * @package Thelia\Core\Template\Loop * @author Etienne Roudeix */ -class Currency extends BaseI18nLoop +class Currency extends BaseI18nLoop implements PropelSearchLoopInterface { - public $timestampable = true; + protected $timestampable = true; /** * @return ArgumentCollection @@ -76,17 +77,12 @@ class Currency extends BaseI18nLoop ); } - /** - * @param $pagination - * - * @return \Thelia\Core\Template\Element\LoopResult - */ - public function exec(&$pagination) + public function buildModelCriteria() { $search = CurrencyQuery::create(); /* manage translations */ - $locale = $this->configureI18nProcessing($search, array('NAME')); + $this->configureI18nProcessing($search, array('NAME')); $id = $this->getId(); @@ -162,17 +158,18 @@ class Currency extends BaseI18nLoop } /* perform search */ - $currencies = $this->search($search, $pagination); + return $search; - $loopResult = new LoopResult($currencies); + } - foreach ($currencies as $currency) { - - $loopResultRow = new LoopResultRow($loopResult, $currency, $this->versionable, $this->timestampable, $this->countable); + public function parseResults(LoopResult $loopResult) + { + foreach ($loopResult->getResultDataCollection() as $currency) { + $loopResultRow = new LoopResultRow($currency); $loopResultRow ->set("ID" , $currency->getId()) ->set("IS_TRANSLATED" , $currency->getVirtualColumn('IS_TRANSLATED')) - ->set("LOCALE" , $locale) + ->set("LOCALE" , $this->locale) ->set("NAME" , $currency->getVirtualColumn('i18n_NAME')) ->set("ISOCODE" , $currency->getCode()) ->set("SYMBOL" , $currency->getSymbol()) @@ -185,5 +182,6 @@ class Currency extends BaseI18nLoop } return $loopResult; + } } diff --git a/core/lib/Thelia/Core/Template/Loop/Customer.php b/core/lib/Thelia/Core/Template/Loop/Customer.php index 6c0a022a8..949103556 100755 --- a/core/lib/Thelia/Core/Template/Loop/Customer.php +++ b/core/lib/Thelia/Core/Template/Loop/Customer.php @@ -28,6 +28,7 @@ use Thelia\Core\Template\Element\BaseLoop; use Thelia\Core\Template\Element\LoopResult; use Thelia\Core\Template\Element\LoopResultRow; +use Thelia\Core\Template\Element\PropelSearchLoopInterface; use Thelia\Core\Template\Element\SearchLoopInterface; use Thelia\Core\Template\Loop\Argument\ArgumentCollection; use Thelia\Core\Template\Loop\Argument\Argument; @@ -45,9 +46,9 @@ use Thelia\Type; * @package Thelia\Core\Template\Loop * @author Etienne Roudeix */ -class Customer extends BaseLoop implements SearchLoopInterface +class Customer extends BaseLoop implements SearchLoopInterface, PropelSearchLoopInterface { - public $timestampable = true; + protected $timestampable = true; /** * @return ArgumentCollection @@ -109,12 +110,7 @@ class Customer extends BaseLoop implements SearchLoopInterface } } - /** - * @param $pagination - * - * @return \Thelia\Core\Template\Element\LoopResult - */ - public function exec(&$pagination) + public function buildModelCriteria() { $search = CustomerQuery::create(); @@ -123,7 +119,7 @@ class Customer extends BaseLoop implements SearchLoopInterface if ($current === true) { $currentCustomer = $this->securityContext->getCustomerUser(); if ($currentCustomer === null) { - return new LoopResult(); + return null; } else { $search->filterById($currentCustomer->getId(), Criteria::EQUAL); } @@ -155,12 +151,14 @@ class Customer extends BaseLoop implements SearchLoopInterface $search->filterBySponsor($sponsor, Criteria::EQUAL); } - $customers = $this->search($search, $pagination); + return $search; - $loopResult = new LoopResult($customers); + } - foreach ($customers as $customer) { - $loopResultRow = new LoopResultRow($loopResult, $customer, $this->versionable, $this->timestampable, $this->countable); + public function parseResults(LoopResult $loopResult) + { + foreach ($loopResult->getResultDataCollection() as $customer) { + $loopResultRow = new LoopResultRow($customer); $loopResultRow->set("ID", $customer->getId()); $loopResultRow->set("REF", $customer->getRef()); $loopResultRow->set("TITLE", $customer->getTitleId()); @@ -175,5 +173,6 @@ class Customer extends BaseLoop implements SearchLoopInterface } return $loopResult; + } } diff --git a/core/lib/Thelia/Core/Template/Loop/Delivery.php b/core/lib/Thelia/Core/Template/Loop/Delivery.php index 3a0c5cb31..e5c56797d 100644 --- a/core/lib/Thelia/Core/Template/Loop/Delivery.php +++ b/core/lib/Thelia/Core/Template/Loop/Delivery.php @@ -22,7 +22,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; @@ -33,6 +32,7 @@ use Thelia\Module\BaseModule; * Class Delivery * @package Thelia\Core\Template\Loop * @author Manuel Raynaud + * @author Etienne Roudeix */ class Delivery extends BaseSpecificModule { @@ -48,14 +48,8 @@ class Delivery extends BaseSpecificModule return $collection; } - public function exec(&$pagination) + public function parseResults(LoopResult $loopResult) { - $search = parent::exec($pagination); - /* manage translations */ - $locale = $this->configureI18nProcessing($search); - - $search->filterByType(BaseModule::DELIVERY_MODULE_TYPE, Criteria::EQUAL); - $countryId = $this->getCountry(); if (null !== $countryId) { $country = CountryQuery::create()->findPk($countryId); @@ -66,13 +60,8 @@ class Delivery extends BaseSpecificModule $country = CountryQuery::create()->findOneByByDefault(1); } - /* perform search */ - $deliveryModules = $this->search($search, $pagination); - - $loopResult = new LoopResult($deliveryModules); - - foreach ($deliveryModules as $deliveryModule) { - $loopResultRow = new LoopResultRow($loopResult, $deliveryModule, $this->versionable, $this->timestampable, $this->countable); + foreach ($loopResult->getResultDataCollection() as $deliveryModule) { + $loopResultRow = new LoopResultRow($deliveryModule); $moduleReflection = new \ReflectionClass($deliveryModule->getFullNamespace()); if ($moduleReflection->isSubclassOf("Thelia\Module\DeliveryModuleInterface") === false) { @@ -97,4 +86,9 @@ class Delivery extends BaseSpecificModule return $loopResult; } + + protected function getModuleType() + { + return BaseModule::DELIVERY_MODULE_TYPE; + } } diff --git a/core/lib/Thelia/Core/Template/Loop/Document.php b/core/lib/Thelia/Core/Template/Loop/Document.php index 9f99a6fa4..ff57c62c7 100644 --- a/core/lib/Thelia/Core/Template/Loop/Document.php +++ b/core/lib/Thelia/Core/Template/Loop/Document.php @@ -23,6 +23,7 @@ namespace Thelia\Core\Template\Loop; use Thelia\Core\Template\Element\BaseI18nLoop; +use Thelia\Core\Template\Element\PropelSearchLoopInterface; use Thelia\Core\Template\Loop\Argument\Argument; use Thelia\Core\Event\Document\DocumentEvent; use Thelia\Core\Event\TheliaEvents; @@ -41,9 +42,12 @@ use Thelia\Log\Tlog; * * @author Franck Allimant */ -class Document extends BaseI18nLoop +class Document extends BaseI18nLoop implements PropelSearchLoopInterface { - public $timestampable = true; + protected $objectType; + protected $objectId; + + protected $timestampable = true; /** * @var array Possible document sources @@ -195,18 +199,15 @@ class Document extends BaseI18nLoop return $search; } - /** - * @param unknown $pagination - */ - public function exec(&$pagination) + public function buildModelCriteria() { // Select the proper query to use, and get the object type - $object_type = $object_id = null; + $this->objectType = $this->objectId = null; - $search = $this->getSearchQuery($object_type, $object_id); + $search = $this->getSearchQuery($this->objectType, $this->objectId); /* manage translations */ - $locale = $this->configureI18nProcessing($search); + $this->configureI18nProcessing($search); $id = $this->getId(); @@ -221,14 +222,13 @@ class Document extends BaseI18nLoop // Create document processing event $event = new DocumentEvent($this->request); - // echo "sql=".$search->toString(); + return $search; - $results = $this->search($search, $pagination); - - $loopResult = new LoopResult($results); - - foreach ($results as $result) { + } + public function parseResults(LoopResult $loopResult) + { + foreach ($loopResult->getResultDataCollection() as $result) { // Create document processing event $event = new DocumentEvent($this->request); @@ -236,22 +236,22 @@ class Document extends BaseI18nLoop $source_filepath = sprintf("%s%s/%s/%s", THELIA_ROOT, ConfigQuery::read('documents_library_path', 'local/media/documents'), - $object_type, + $this->objectType, $result->getFile() - ); + ); $event->setSourceFilepath($source_filepath); - $event->setCacheSubdirectory($object_type); + $event->setCacheSubdirectory($this->objectType); try { // Dispatch document processing event $this->dispatcher->dispatch(TheliaEvents::DOCUMENT_PROCESS, $event); - $loopResultRow = new LoopResultRow($loopResult, $result, $this->versionable, $this->timestampable, $this->countable); + $loopResultRow = new LoopResultRow($result); $loopResultRow ->set("ID" , $result->getId()) - ->set("LOCALE" , $locale) + ->set("LOCALE" , $this->locale) ->set("DOCUMENT_URL" , $event->getFileUrl()) ->set("DOCUMENT_PATH" , $event->getDocumentPath()) ->set("ORIGINAL_DOCUMENT_PATH", $source_filepath) @@ -260,8 +260,8 @@ class Document extends BaseI18nLoop ->set("DESCRIPTION" , $result->getVirtualColumn('i18n_DESCRIPTION')) ->set("POSTSCRIPTUM" , $result->getVirtualColumn('i18n_POSTSCRIPTUM')) ->set("POSITION" , $result->getPosition()) - ->set("OBJECT_TYPE" , $object_type) - ->set("OBJECT_ID" , $object_id) + ->set("OBJECT_TYPE" , $this->objectType) + ->set("OBJECT_ID" , $this->objectId) ; $loopResult->addRow($loopResultRow); @@ -272,5 +272,6 @@ class Document extends BaseI18nLoop } return $loopResult; + } } diff --git a/core/lib/Thelia/Core/Template/Loop/Feature.php b/core/lib/Thelia/Core/Template/Loop/Feature.php index 89b338b0f..6f7f12c71 100755 --- a/core/lib/Thelia/Core/Template/Loop/Feature.php +++ b/core/lib/Thelia/Core/Template/Loop/Feature.php @@ -28,6 +28,7 @@ use Thelia\Core\Template\Element\BaseI18nLoop; use Thelia\Core\Template\Element\LoopResult; use Thelia\Core\Template\Element\LoopResultRow; +use Thelia\Core\Template\Element\PropelSearchLoopInterface; use Thelia\Core\Template\Loop\Argument\ArgumentCollection; use Thelia\Core\Template\Loop\Argument\Argument; @@ -50,9 +51,11 @@ use Thelia\Model\Map\FeatureTemplateTableMap; * @package Thelia\Core\Template\Loop * @author Etienne Roudeix */ -class Feature extends BaseI18nLoop +class Feature extends BaseI18nLoop implements PropelSearchLoopInterface { - public $timestampable = true; + protected $useFeaturePosition; + + protected $timestampable = true; /** * @return ArgumentCollection @@ -77,17 +80,12 @@ class Feature extends BaseI18nLoop ); } - /** - * @param $pagination - * - * @return \Thelia\Core\Template\Element\LoopResult - */ - public function exec(&$pagination) + public function buildModelCriteria() { $search = FeatureQuery::create(); /* manage translations */ - $locale = $this->configureI18nProcessing($search); + $this->configureI18nProcessing($search); $id = $this->getId(); @@ -109,7 +107,7 @@ class Feature extends BaseI18nLoop $template = $this->getTemplate(); $exclude_template = $this->getExcludeTemplate(); - $use_feature_pos = true; + $this->useFeaturePosition = true; if (null !== $product) { // Find all template assigned to the products. @@ -137,7 +135,7 @@ class Feature extends BaseI18nLoop ->filterByTemplate(TemplateQuery::create()->findById($template), Criteria::IN) ; - $use_feature_pos = false; + $this->useFeaturePosition = false; } if (null !== $exclude_template) { @@ -149,7 +147,7 @@ class Feature extends BaseI18nLoop ->filterById($exclude_features, Criteria::NOT_IN) ; - $use_feature_pos = false; + $this->useFeaturePosition = false; } $title = $this->getTitle(); @@ -186,13 +184,13 @@ class Feature extends BaseI18nLoop $search->addDescendingOrderByColumn('i18n_TITLE'); break; case "manual": - if ($use_feature_pos) + if ($this->useFeaturePosition) $search->orderByPosition(Criteria::ASC); else $search->addAscendingOrderByColumn(FeatureTemplateTableMap::POSITION); break; case "manual_reverse": - if ($use_feature_pos) + if ($this->useFeaturePosition) $search->orderByPosition(Criteria::DESC); else $search->addDescendingOrderByColumn(FeatureTemplateTableMap::POSITION); @@ -201,26 +199,28 @@ class Feature extends BaseI18nLoop } - /* perform search */ - $features = $this->search($search, $pagination); + return $search; - $loopResult = new LoopResult($features); + } - foreach ($features as $feature) { - $loopResultRow = new LoopResultRow($loopResult, $feature, $this->versionable, $this->timestampable, $this->countable); + public function parseResults(LoopResult $loopResult) + { + foreach ($loopResult->getResultDataCollection() as $feature) { + $loopResultRow = new LoopResultRow($feature); $loopResultRow->set("ID", $feature->getId()) ->set("IS_TRANSLATED",$feature->getVirtualColumn('IS_TRANSLATED')) - ->set("LOCALE",$locale) + ->set("LOCALE",$this->locale) ->set("TITLE",$feature->getVirtualColumn('i18n_TITLE')) ->set("CHAPO", $feature->getVirtualColumn('i18n_CHAPO')) ->set("DESCRIPTION", $feature->getVirtualColumn('i18n_DESCRIPTION')) ->set("POSTSCRIPTUM", $feature->getVirtualColumn('i18n_POSTSCRIPTUM')) - ->set("POSITION", $use_feature_pos ? $feature->getPosition() : $feature->getVirtualColumn('position')) + ->set("POSITION", $this->useFeaturePosition ? $feature->getPosition() : $feature->getVirtualColumn('position')) ; $loopResult->addRow($loopResultRow); } return $loopResult; + } } diff --git a/core/lib/Thelia/Core/Template/Loop/FeatureAvailability.php b/core/lib/Thelia/Core/Template/Loop/FeatureAvailability.php index 093cea24a..96c65713d 100755 --- a/core/lib/Thelia/Core/Template/Loop/FeatureAvailability.php +++ b/core/lib/Thelia/Core/Template/Loop/FeatureAvailability.php @@ -28,6 +28,7 @@ use Thelia\Core\Template\Element\BaseI18nLoop; use Thelia\Core\Template\Element\LoopResult; use Thelia\Core\Template\Element\LoopResultRow; +use Thelia\Core\Template\Element\PropelSearchLoopInterface; use Thelia\Core\Template\Loop\Argument\ArgumentCollection; use Thelia\Core\Template\Loop\Argument\Argument; @@ -43,9 +44,9 @@ use Thelia\Type; * @package Thelia\Core\Template\Loop * @author Etienne Roudeix */ -class FeatureAvailability extends BaseI18nLoop +class FeatureAvailability extends BaseI18nLoop implements PropelSearchLoopInterface { - public $timestampable = true; + protected $timestampable = true; /** * @return ArgumentCollection @@ -66,17 +67,12 @@ class FeatureAvailability extends BaseI18nLoop ); } - /** - * @param $pagination - * - * @return \Thelia\Core\Template\Element\LoopResult - */ - public function exec(&$pagination) + public function buildModelCriteria() { $search = FeatureAvQuery::create(); /* manage translations */ - $locale = $this->configureI18nProcessing($search); + $this->configureI18nProcessing($search); $id = $this->getId(); @@ -115,16 +111,17 @@ class FeatureAvailability extends BaseI18nLoop } } - /* perform search */ - $featuresAv = $this->search($search, $pagination); + return $search; - $loopResult = new LoopResult($featuresAv); + } - foreach ($featuresAv as $featureAv) { - $loopResultRow = new LoopResultRow($loopResult, $featureAv, $this->versionable, $this->timestampable, $this->countable); + public function parseResults(LoopResult $loopResult) + { + foreach ($loopResult->getResultDataCollection() as $featureAv) { + $loopResultRow = new LoopResultRow($featureAv); $loopResultRow->set("ID", $featureAv->getId()) ->set("IS_TRANSLATED",$featureAv->getVirtualColumn('IS_TRANSLATED')) - ->set("LOCALE",$locale) + ->set("LOCALE",$this->locale) ->set("TITLE",$featureAv->getVirtualColumn('i18n_TITLE')) ->set("CHAPO", $featureAv->getVirtualColumn('i18n_CHAPO')) ->set("DESCRIPTION", $featureAv->getVirtualColumn('i18n_DESCRIPTION')) @@ -135,5 +132,6 @@ class FeatureAvailability extends BaseI18nLoop } return $loopResult; + } } diff --git a/core/lib/Thelia/Core/Template/Loop/FeatureValue.php b/core/lib/Thelia/Core/Template/Loop/FeatureValue.php index 8ae8b0f4f..1547202f7 100755 --- a/core/lib/Thelia/Core/Template/Loop/FeatureValue.php +++ b/core/lib/Thelia/Core/Template/Loop/FeatureValue.php @@ -28,6 +28,7 @@ use Thelia\Core\Template\Element\BaseI18nLoop; use Thelia\Core\Template\Element\LoopResult; use Thelia\Core\Template\Element\LoopResultRow; +use Thelia\Core\Template\Element\PropelSearchLoopInterface; use Thelia\Core\Template\Loop\Argument\ArgumentCollection; use Thelia\Core\Template\Loop\Argument\Argument; @@ -45,9 +46,9 @@ use Thelia\Type; * @package Thelia\Core\Template\Loop * @author Etienne Roudeix */ -class FeatureValue extends BaseI18nLoop +class FeatureValue extends BaseI18nLoop implements PropelSearchLoopInterface { - public $timestampable = true; + protected $timestampable = true; /** * @return ArgumentCollection @@ -70,17 +71,12 @@ class FeatureValue extends BaseI18nLoop ); } - /** - * @param $pagination - * - * @return \Thelia\Core\Template\Element\LoopResult - */ - public function exec(&$pagination) + public function buildModelCriteria() { $search = FeatureProductQuery::create(); // manage featureAv translations - $locale = $this->configureI18nProcessing( + $this->configureI18nProcessing( $search, array('TITLE', 'CHAPO', 'DESCRIPTION', 'POSTSCRIPTUM'), FeatureAvTableMap::TABLE_NAME, @@ -127,13 +123,14 @@ class FeatureValue extends BaseI18nLoop } } - $featureValues = $this->search($search, $pagination); + return $search; - $loopResult = new LoopResult($featureValues); + } - foreach ($featureValues as $featureValue) { - - $loopResultRow = new LoopResultRow($loopResult, $featureValue, $this->versionable, $this->timestampable, $this->countable); + public function parseResults(LoopResult $loopResult) + { + foreach ($loopResult->getResultDataCollection() as $featureValue) { + $loopResultRow = new LoopResultRow($featureValue); $loopResultRow ->set("ID" , $featureValue->getId()) @@ -144,7 +141,7 @@ class FeatureValue extends BaseI18nLoop ->set("IS_FREE_TEXT" , is_null($featureValue->getFeatureAvId()) ? 1 : 0) ->set("IS_FEATURE_AV" , is_null($featureValue->getFeatureAvId()) ? 0 : 1) - ->set("LOCALE" , $locale) + ->set("LOCALE" , $this->locale) ->set("TITLE" , $featureValue->getVirtualColumn(FeatureAvTableMap::TABLE_NAME . '_i18n_TITLE')) ->set("CHAPO" , $featureValue->getVirtualColumn(FeatureAvTableMap::TABLE_NAME . '_i18n_CHAPO')) ->set("DESCRIPTION" , $featureValue->getVirtualColumn(FeatureAvTableMap::TABLE_NAME . '_i18n_DESCRIPTION')) @@ -157,5 +154,6 @@ class FeatureValue extends BaseI18nLoop } return $loopResult; + } } diff --git a/core/lib/Thelia/Core/Template/Loop/Feed.php b/core/lib/Thelia/Core/Template/Loop/Feed.php index 11f872432..0fc5ab686 100755 --- a/core/lib/Thelia/Core/Template/Loop/Feed.php +++ b/core/lib/Thelia/Core/Template/Loop/Feed.php @@ -23,13 +23,13 @@ namespace Thelia\Core\Template\Loop; +use Thelia\Core\Template\Element\ArraySearchLoopInterface; use Thelia\Core\Template\Element\BaseLoop; use Thelia\Core\Template\Element\LoopResult; use Thelia\Core\Template\Element\LoopResultRow; use Thelia\Core\Template\Loop\Argument\ArgumentCollection; use Thelia\Core\Template\Loop\Argument\Argument; -use Thelia\Tools\DateTimeFormat; /** * @@ -37,7 +37,7 @@ use Thelia\Tools\DateTimeFormat; * * @author Franck Allimant */ -class Feed extends BaseLoop +class Feed extends BaseLoop implements ArraySearchLoopInterface { public function getArgDefinitions() { @@ -47,12 +47,7 @@ class Feed extends BaseLoop ); } - /** - * - * - * @return \Thelia\Core\Template\Element\LoopResult - */ - public function exec(&$pagination) + public function buildArray() { $cachedir = THELIA_ROOT . 'cache/feeds'; @@ -72,26 +67,15 @@ class Feed extends BaseLoop $items = $feed->get_items(); - $limit = min(count($items), $this->getLimit()); + return $items; - $indexes = array(); - for ($idx = 0; $idx < $limit; $idx++) { - $indexes[] = $idx; - } + } - $loopResult = new LoopResult($indexes); + public function parseResults(LoopResult $loopResult) + { + foreach ($loopResult->getResultDataCollection() as $item) { - foreach ($indexes as $idx) { - - $item = $items[$idx]; - - $link = $item->get_permalink(); - - $title = $item->get_title(); - $author = $item->get_author(); - $description = $item->get_description(); - - $loopResultRow = new LoopResultRow($loopResult, null, $this->versionable, $this->timestampable, $this->countable); + $loopResultRow = new LoopResultRow(); $loopResultRow ->set("URL" , $item->get_permalink()) diff --git a/core/lib/Thelia/Core/Template/Loop/Folder.php b/core/lib/Thelia/Core/Template/Loop/Folder.php index c59a3e95c..071c88dd3 100755 --- a/core/lib/Thelia/Core/Template/Loop/Folder.php +++ b/core/lib/Thelia/Core/Template/Loop/Folder.php @@ -28,6 +28,7 @@ use Thelia\Core\Template\Element\BaseI18nLoop; use Thelia\Core\Template\Element\LoopResult; use Thelia\Core\Template\Element\LoopResultRow; +use Thelia\Core\Template\Element\PropelSearchLoopInterface; use Thelia\Core\Template\Loop\Argument\ArgumentCollection; use Thelia\Core\Template\Loop\Argument\Argument; @@ -43,10 +44,10 @@ use Thelia\Type\BooleanOrBothType; * @package Thelia\Core\Template\Loop * @author Etienne Roudeix */ -class Folder extends BaseI18nLoop +class Folder extends BaseI18nLoop implements PropelSearchLoopInterface { - public $timestampable = true; - public $versionable = true; + protected $timestampable = true; + protected $versionable = true; /** * @return ArgumentCollection @@ -71,17 +72,12 @@ class Folder extends BaseI18nLoop ); } - /** - * @param $pagination - * - * @return \Thelia\Core\Template\Element\LoopResult - */ - public function exec(&$pagination) + public function buildModelCriteria() { $search = FolderQuery::create(); /* manage translations */ - $locale = $this->configureI18nProcessing($search); + $this->configureI18nProcessing($search); $id = $this->getId(); @@ -148,33 +144,28 @@ class Folder extends BaseI18nLoop } } - /* perform search */ - $folders = $this->search($search, $pagination); - /* @todo */ $notEmpty = $this->getNot_empty(); - $loopResult = new LoopResult($folders); + return $search; - foreach ($folders as $folder) { + } - /* - * no cause pagination lost : - * if ($notEmpty && $folder->countAllProducts() == 0) continue; - */ - - $loopResultRow = new LoopResultRow($loopResult, $folder, $this->versionable, $this->timestampable, $this->countable); + public function parseResults(LoopResult $loopResult) + { + foreach ($loopResult->getResultDataCollection() as $folder) { + $loopResultRow = new LoopResultRow($folder); $loopResultRow ->set("ID", $folder->getId()) ->set("IS_TRANSLATED",$folder->getVirtualColumn('IS_TRANSLATED')) - ->set("LOCALE",$locale) + ->set("LOCALE",$this->locale) ->set("TITLE",$folder->getVirtualColumn('i18n_TITLE')) ->set("CHAPO", $folder->getVirtualColumn('i18n_CHAPO')) ->set("DESCRIPTION", $folder->getVirtualColumn('i18n_DESCRIPTION')) ->set("POSTSCRIPTUM", $folder->getVirtualColumn('i18n_POSTSCRIPTUM')) ->set("PARENT", $folder->getParent()) - ->set("URL", $folder->getUrl($locale)) + ->set("URL", $folder->getUrl($this->locale)) ->set("CHILD_COUNT", $folder->countChild()) ->set("CONTENT_COUNT", $folder->countAllContents()) ->set("VISIBLE", $folder->getVisible() ? "1" : "0") @@ -185,5 +176,6 @@ class Folder extends BaseI18nLoop } return $loopResult; + } } diff --git a/core/lib/Thelia/Core/Template/Loop/FolderPath.php b/core/lib/Thelia/Core/Template/Loop/FolderPath.php index 2b9a52b0d..ce5ea9526 100644 --- a/core/lib/Thelia/Core/Template/Loop/FolderPath.php +++ b/core/lib/Thelia/Core/Template/Loop/FolderPath.php @@ -22,6 +22,7 @@ /*************************************************************************************/ namespace Thelia\Core\Template\Loop; +use Thelia\Core\Template\Element\ArraySearchLoopInterface; use Thelia\Core\Template\Element\BaseI18nLoop; use Thelia\Core\Template\Element\LoopResult; use Thelia\Core\Template\Element\LoopResultRow; @@ -35,9 +36,8 @@ use Thelia\Type\BooleanOrBothType; * @package Thelia\Core\Template\Loop * @author Manuel Raynaud */ -class FolderPath extends BaseI18nLoop +class FolderPath extends BaseI18nLoop implements ArraySearchLoopInterface { - /** * * define all args used in your loop @@ -80,26 +80,14 @@ class FolderPath extends BaseI18nLoop ); } - /** - * - * this function have to be implement in your own loop class. - * - * All loops parameters can be accessible via getter. - * - * for example, ref parameter is accessible through getRef method - * - * @param $pagination - * - * @return mixed - */ - public function exec(&$pagination) + public function buildArray() { $id = $this->getFolder(); $visible = $this->getVisible(); $search = FolderQuery::create(); - $locale = $this->configureI18nProcessing($search, array('TITLE')); + $this->configureI18nProcessing($search, array('TITLE')); $search->filterById($id); if ($visible != BooleanOrBothType::ANY) $search->filterByVisible($visible); @@ -113,16 +101,12 @@ class FolderPath extends BaseI18nLoop if ($folder != null) { - $loopResultRow = new LoopResultRow(); - - $loopResultRow - ->set("TITLE",$folder->getVirtualColumn('i18n_TITLE')) - ->set("URL", $folder->getUrl($locale)) - ->set("ID", $folder->getId()) - ->set("LOCALE",$locale) - ; - - $results[] = $loopResultRow; + $results[] = array( + "ID" => $result->getId(), + "TITLE" => $result->getVirtualColumn('i18n_TITLE'), + "URL" => $result->getUrl($this->locale), + "LOCALE" => $this->locale, + ); $parent = $folder->getParent(); @@ -146,13 +130,19 @@ class FolderPath extends BaseI18nLoop } while ($folder != null && $parent > 0); // Reverse list and build the final result - $results = array_reverse($results); + return array_reverse($results); + } - $loopResult = new LoopResult(); - - foreach($results as $result) $loopResult->addRow($result); + public function parseResults(LoopResult $loopResult) + { + foreach($loopResult->getResultDataCollection() as $result) { + $loopResultRow = new LoopResultRow($result); + foreach($result as $output => $outputValue) { + $loopResultRow->set($output, $outputValue); + } + $loopResult->addRow($loopResultRow); + } return $loopResult; } - } diff --git a/core/lib/Thelia/Core/Template/Loop/FolderTree.php b/core/lib/Thelia/Core/Template/Loop/FolderTree.php index 9549f2467..9598f7a5c 100644 --- a/core/lib/Thelia/Core/Template/Loop/FolderTree.php +++ b/core/lib/Thelia/Core/Template/Loop/FolderTree.php @@ -23,6 +23,7 @@ namespace Thelia\Core\Template\Loop; use Propel\Runtime\ActiveQuery\Criteria; +use Thelia\Core\Template\Element\ArraySearchLoopInterface; use Thelia\Core\Template\Element\LoopResult; use Thelia\Core\Template\Element\LoopResultRow; @@ -45,7 +46,7 @@ use Thelia\Core\Template\Element\BaseI18nLoop; * @package Thelia\Core\Template\Loop * @author Franck Allimant */ -class FolderTree extends BaseI18nLoop +class FolderTree extends BaseI18nLoop implements ArraySearchLoopInterface { /** * @return ArgumentCollection @@ -61,13 +62,13 @@ class FolderTree extends BaseI18nLoop } // changement de rubrique - protected function buildFolderTree($parent, $visible, $level, $max_level, $exclude, LoopResult &$loopResult) + protected function buildFolderTree($parent, $visible, $level, $max_level, $exclude, &$resultsList) { if ($level > $max_level) return; $search = FolderQuery::create(); - $locale = $this->configureI18nProcessing($search, array( + $this->configureI18nProcessing($search, array( 'TITLE' )); @@ -83,36 +84,44 @@ class FolderTree extends BaseI18nLoop foreach ($results as $result) { - $loopResultRow = new LoopResultRow(); + $resultsList[] = array( + "ID" => $result->getId(), + "TITLE" => $result->getVirtualColumn('i18n_TITLE'), + "PARENT" => $result->getParent(), + "URL" => $result->getUrl($this->locale), + "VISIBLE" => $result->getVisible() ? "1" : "0", + "LEVEL" => $level, + 'CHILD_COUNT' => $result->countChild(), + ); - $loopResultRow - ->set("ID", $result->getId())->set("TITLE", $result->getVirtualColumn('i18n_TITLE')) - ->set("PARENT", $result->getParent())->set("URL", $result->getUrl($locale)) - ->set("VISIBLE", $result->getVisible() ? "1" : "0")->set("LEVEL", $level) - ; - - $loopResult->addRow($loopResultRow); - - $this->buildFolderTree($result->getId(), $visible, 1 + $level, $max_level, $exclude, $loopResult); + $this->buildFolderTree($result->getId(), $visible, 1 + $level, $max_level, $exclude, $resultsList); } } - /** - * @param $pagination (ignored) - * - * @return \Thelia\Core\Template\Element\LoopResult - */ - public function exec(&$pagination) + public function parseResults(LoopResult $loopResult) + { + foreach($loopResult->getResultDataCollection() as $result) { + $loopResultRow = new LoopResultRow($result); + foreach($result as $output => $outputValue) { + $loopResultRow->set($output, $outputValue); + } + $loopResult->addRow($loopResultRow); + } + + return $loopResult; + } + + public function buildArray() { $id = $this->getFolder(); $depth = $this->getDepth(); $visible = $this->getVisible(); $exclude = $this->getExclude(); - $loopResult = new LoopResult(); + $resultsList = array(); - $this->buildFolderTree($id, $visible, 0, $depth, $exclude, $loopResult); + $this->buildFolderTree($id, $visible, 0, $depth, $exclude, $resultsList); - return $loopResult; + return $resultsList; } } diff --git a/core/lib/Thelia/Core/Template/Loop/Image.php b/core/lib/Thelia/Core/Template/Loop/Image.php index b20b161a3..b207deb29 100755 --- a/core/lib/Thelia/Core/Template/Loop/Image.php +++ b/core/lib/Thelia/Core/Template/Loop/Image.php @@ -23,6 +23,7 @@ namespace Thelia\Core\Template\Loop; use Thelia\Core\Template\Element\BaseI18nLoop; +use Thelia\Core\Template\Element\PropelSearchLoopInterface; use Thelia\Core\Template\Loop\Argument\Argument; use Thelia\Core\Event\Image\ImageEvent; use Thelia\Core\Event\TheliaEvents; @@ -41,9 +42,12 @@ use Thelia\Log\Tlog; * * @author Franck Allimant */ -class Image extends BaseI18nLoop +class Image extends BaseI18nLoop implements PropelSearchLoopInterface { - public $timestampable = true; + protected $objectType; + protected $objectId; + + protected $timestampable = true; /** * @var array Possible image sources @@ -210,19 +214,16 @@ class Image extends BaseI18nLoop return $search; } - /** - * @param unknown $pagination - */ - public function exec(&$pagination) + public function buildModelCriteria() { // Select the proper query to use, and get the object type - $object_type = $object_id = null; + $this->objectType = $this->objectId = null; - $search = $this->getSearchQuery($object_type, $object_id); + $search = $this->getSearchQuery($this->objectType, $this->objectId); /* manage translations */ - $locale = $this->configureI18nProcessing($search); + $this->configureI18nProcessing($search); $id = $this->getId(); @@ -234,6 +235,14 @@ class Image extends BaseI18nLoop if (!is_null($exclude)) $search->filterById($exclude, Criteria::NOT_IN); + // echo "sql=".$search->toString(); + + return $search; + + } + + public function parseResults(LoopResult $loopResult) + { // Create image processing event $event = new ImageEvent($this->request); @@ -264,16 +273,11 @@ class Image extends BaseI18nLoop } - // echo "sql=".$search->toString(); - - $results = $this->search($search, $pagination); - - $loopResult = new LoopResult($results); - - foreach ($results as $result) { - + foreach ($loopResult->getResultDataCollection() as $result) { // Create image processing event - $event = new ImageEvent($this->request); + + // ERO : following is duplicated, guess it's useless at this point + //$event = new ImageEvent($this->request); // Setup required transformations if (! is_null($width)) $event->setWidth($width); @@ -288,22 +292,22 @@ class Image extends BaseI18nLoop $source_filepath = sprintf("%s%s/%s/%s", THELIA_ROOT, ConfigQuery::read('images_library_path', 'local/media/images'), - $object_type, + $this->objectType, $result->getFile() - ); + ); $event->setSourceFilepath($source_filepath); - $event->setCacheSubdirectory($object_type); + $event->setCacheSubdirectory($this->objectType); try { // Dispatch image processing event $this->dispatcher->dispatch(TheliaEvents::IMAGE_PROCESS, $event); - $loopResultRow = new LoopResultRow($loopResult, $result, $this->versionable, $this->timestampable, $this->countable); + $loopResultRow = new LoopResultRow($result); $loopResultRow ->set("ID" , $result->getId()) - ->set("LOCALE" ,$locale) + ->set("LOCALE" ,$this->locale) ->set("IMAGE_URL" , $event->getFileUrl()) ->set("ORIGINAL_IMAGE_URL" , $event->getOriginalFileUrl()) ->set("IMAGE_PATH" , $event->getCacheFilepath()) @@ -313,8 +317,8 @@ class Image extends BaseI18nLoop ->set("DESCRIPTION" , $result->getVirtualColumn('i18n_DESCRIPTION')) ->set("POSTSCRIPTUM" , $result->getVirtualColumn('i18n_POSTSCRIPTUM')) ->set("POSITION" , $result->getPosition()) - ->set("OBJECT_TYPE" , $object_type) - ->set("OBJECT_ID" , $object_id) + ->set("OBJECT_TYPE" , $this->objectType) + ->set("OBJECT_ID" , $this->objectId) ; $loopResult->addRow($loopResultRow); @@ -325,5 +329,6 @@ class Image extends BaseI18nLoop } return $loopResult; + } } diff --git a/core/lib/Thelia/Core/Template/Loop/Lang.php b/core/lib/Thelia/Core/Template/Loop/Lang.php index 52a866d30..f473b8589 100755 --- a/core/lib/Thelia/Core/Template/Loop/Lang.php +++ b/core/lib/Thelia/Core/Template/Loop/Lang.php @@ -28,6 +28,7 @@ use Thelia\Core\Template\Element\BaseLoop; use Thelia\Core\Template\Element\LoopResult; use Thelia\Core\Template\Element\LoopResultRow; +use Thelia\Core\Template\Element\PropelSearchLoopInterface; use Thelia\Core\Template\Loop\Argument\Argument; use Thelia\Model\LangQuery; @@ -43,9 +44,9 @@ use Thelia\Core\Template\Loop\Argument\ArgumentCollection; * @package Thelia\Core\Template\Loop * @author Franck Allimant */ -class Lang extends BaseLoop +class Lang extends BaseLoop implements PropelSearchLoopInterface { - public $timestampable = true; + protected $timestampable = true; /** * @return ArgumentCollection @@ -59,12 +60,7 @@ class Lang extends BaseLoop ); } - /** - * @param $pagination (ignored) - * - * @return \Thelia\Core\Template\Element\LoopResult - */ - public function exec(&$pagination) + public function buildModelCriteria() { $id = $this->getId(); $exclude = $this->getExclude(); @@ -84,13 +80,14 @@ class Lang extends BaseLoop $search->orderByPosition(Criteria::ASC); - $results = $this->search($search, $pagination); + return $search; - $loopResult = new LoopResult($results); + } - foreach ($results as $result) { - - $loopResultRow = new LoopResultRow($loopResult, $result, $this->versionable, $this->timestampable, $this->countable); + public function parseResults(LoopResult $loopResult) + { + foreach ($loopResult->getResultDataCollection() as $result) { + $loopResultRow = new LoopResultRow($result); $loopResultRow ->set("ID", $result->getId()) @@ -108,5 +105,6 @@ class Lang extends BaseLoop } return $loopResult; + } } diff --git a/core/lib/Thelia/Core/Template/Loop/Message.php b/core/lib/Thelia/Core/Template/Loop/Message.php index bea662572..4594dd4d2 100644 --- a/core/lib/Thelia/Core/Template/Loop/Message.php +++ b/core/lib/Thelia/Core/Template/Loop/Message.php @@ -28,6 +28,7 @@ use Thelia\Core\Template\Element\BaseI18nLoop; use Thelia\Core\Template\Element\LoopResult; use Thelia\Core\Template\Element\LoopResultRow; +use Thelia\Core\Template\Element\PropelSearchLoopInterface; use Thelia\Core\Template\Loop\Argument\Argument; use Thelia\Core\Template\Loop\Argument\ArgumentCollection; @@ -46,9 +47,9 @@ use Thelia\Type\BooleanOrBothType; * @package Thelia\Core\Template\Loop * @author Franck Allimant */ -class Message extends BaseI18nLoop +class Message extends BaseI18nLoop implements PropelSearchLoopInterface { - public $timestampable = true; + protected $timestampable = true; /** * @return ArgumentCollection @@ -64,20 +65,16 @@ class Message extends BaseI18nLoop ); } - /** - * @param $pagination (ignored) - * - * @return \Thelia\Core\Template\Element\LoopResult - */ - public function exec(&$pagination) + public function buildModelCriteria() { $id = $this->getId(); $name = $this->getVariable(); $secured = $this->getSecured(); + $exclude = $this->getExclude(); $search = MessageQuery::create(); - $locale = $this->configureI18nProcessing($search, array( + $this->configureI18nProcessing($search, array( 'TITLE', 'SUBJECT', 'TEXT_MESSAGE', @@ -100,19 +97,20 @@ class Message extends BaseI18nLoop $search->orderByName(Criteria::ASC); - $results = $this->search($search, $pagination); + return $search; - $loopResult = new LoopResult($results); + } - foreach ($results as $result) { - - $loopResultRow = new LoopResultRow($loopResult, $result, $this->versionable, $this->timestampable, $this->countable); + public function parseResults(LoopResult $loopResult) + { + foreach ($loopResult->getResultDataCollection() as $result) { + $loopResultRow = new LoopResultRow($result); $loopResultRow ->set("ID" , $result->getId()) ->set("NAME" , $result->getName()) ->set("IS_TRANSLATED", $result->getVirtualColumn('IS_TRANSLATED')) - ->set("LOCALE" , $locale) + ->set("LOCALE" , $this->locale) ->set("TITLE" , $result->getVirtualColumn('i18n_TITLE')) ->set("SUBJECT" , $result->getVirtualColumn('i18n_SUBJECT')) ->set("TEXT_MESSAGE" , $result->getVirtualColumn('i18n_TEXT_MESSAGE')) @@ -124,5 +122,6 @@ class Message extends BaseI18nLoop } return $loopResult; + } } diff --git a/core/lib/Thelia/Core/Template/Loop/Module.php b/core/lib/Thelia/Core/Template/Loop/Module.php index 1c07d7d5f..786990b66 100755 --- a/core/lib/Thelia/Core/Template/Loop/Module.php +++ b/core/lib/Thelia/Core/Template/Loop/Module.php @@ -29,6 +29,7 @@ use Thelia\Core\Template\Element\BaseI18nLoop; use Thelia\Core\Template\Element\LoopResult; use Thelia\Core\Template\Element\LoopResultRow; +use Thelia\Core\Template\Element\PropelSearchLoopInterface; use Thelia\Core\Template\Loop\Argument\ArgumentCollection; use Thelia\Core\Template\Loop\Argument\Argument; @@ -46,9 +47,9 @@ use Thelia\Type; * @package Thelia\Core\Template\Loop * @author Etienne Roudeix */ -class Module extends BaseI18nLoop +class Module extends BaseI18nLoop implements PropelSearchLoopInterface { - public $timestampable = true; + protected $timestampable = true; /** * @return ArgumentCollection @@ -79,17 +80,12 @@ class Module extends BaseI18nLoop ); } - /** - * @param $pagination - * - * @return \Thelia\Core\Template\Element\LoopResult - */ - public function exec(&$pagination) + public function buildModelCriteria() { $search = ModuleQuery::create(); /* manage translations */ - $locale = $this->configureI18nProcessing($search); + $this->configureI18nProcessing($search); $id = $this->getId(); @@ -131,16 +127,17 @@ class Module extends BaseI18nLoop $search->orderByPosition(); - /* perform search */ - $modules = $this->search($search, $pagination); + return $search; - $loopResult = new LoopResult($modules); + } - foreach ($modules as $module) { - $loopResultRow = new LoopResultRow($loopResult, $module, $this->versionable, $this->timestampable, $this->countable); + public function parseResults(LoopResult $loopResult) + { + foreach ($loopResult->getResultDataCollection() as $module) { + $loopResultRow = new LoopResultRow($module); $loopResultRow->set("ID", $module->getId()) ->set("IS_TRANSLATED",$module->getVirtualColumn('IS_TRANSLATED')) - ->set("LOCALE",$locale) + ->set("LOCALE",$this->locale) ->set("TITLE",$module->getVirtualColumn('i18n_TITLE')) ->set("CHAPO", $module->getVirtualColumn('i18n_CHAPO')) ->set("DESCRIPTION", $module->getVirtualColumn('i18n_DESCRIPTION')) @@ -151,7 +148,7 @@ class Module extends BaseI18nLoop ->set("CLASS", $module->getFullNamespace()) ->set("POSITION", $module->getPosition()); - if (null !== $profile) { + if (null !== $this->getProfile()) { $accessValue = $module->getVirtualColumn('access'); $manager = new AccessManager($accessValue); @@ -165,5 +162,6 @@ class Module extends BaseI18nLoop } return $loopResult; + } } diff --git a/core/lib/Thelia/Core/Template/Loop/Order.php b/core/lib/Thelia/Core/Template/Loop/Order.php index e10b8a5cb..5f12fa1eb 100755 --- a/core/lib/Thelia/Core/Template/Loop/Order.php +++ b/core/lib/Thelia/Core/Template/Loop/Order.php @@ -28,6 +28,7 @@ use Thelia\Core\Template\Element\BaseLoop; use Thelia\Core\Template\Element\LoopResult; use Thelia\Core\Template\Element\LoopResultRow; +use Thelia\Core\Template\Element\PropelSearchLoopInterface; use Thelia\Core\Template\Element\SearchLoopInterface; use Thelia\Core\Template\Loop\Argument\ArgumentCollection; use Thelia\Core\Template\Loop\Argument\Argument; @@ -43,11 +44,11 @@ use Thelia\Type; * @author Franck Allimant * @author Etienne Roudeix */ -class Order extends BaseLoop implements SearchLoopInterface +class Order extends BaseLoop implements SearchLoopInterface, PropelSearchLoopInterface { - public $countable = true; - public $timestampable = true; - public $versionable = false; + protected $countable = true; + protected $timestampable = true; + protected $versionable = false; public function getArgDefinitions() { @@ -131,12 +132,7 @@ class Order extends BaseLoop implements SearchLoopInterface } } - /** - * @param $pagination - * - * @return LoopResult - */ - public function exec(&$pagination) + public function buildModelCriteria() { $search = OrderQuery::create(); @@ -151,7 +147,7 @@ class Order extends BaseLoop implements SearchLoopInterface if ($customer === 'current') { $currentCustomer = $this->securityContext->getCustomerUser(); if ($currentCustomer === null) { - return new LoopResult(); + return null; } else { $search->filterByCustomerId($currentCustomer->getId(), Criteria::EQUAL); } @@ -178,14 +174,16 @@ class Order extends BaseLoop implements SearchLoopInterface } } - $orders = $this->search($search, $pagination); + return $search; - $loopResult = new LoopResult($orders); + } - foreach ($orders as $order) { + public function parseResults(LoopResult $loopResult) + { + foreach ($loopResult->getResultDataCollection() as $order) { $tax = 0; $amount = $order->getTotalAmount($tax); - $loopResultRow = new LoopResultRow($loopResult, $order, $this->versionable, $this->timestampable, $this->countable); + $loopResultRow = new LoopResultRow($order); $loopResultRow ->set("ID", $order->getId()) ->set("REF", $order->getRef()) @@ -213,5 +211,6 @@ class Order extends BaseLoop implements SearchLoopInterface } return $loopResult; + } } diff --git a/core/lib/Thelia/Core/Template/Loop/OrderAddress.php b/core/lib/Thelia/Core/Template/Loop/OrderAddress.php index 38dcb0239..4898a7217 100755 --- a/core/lib/Thelia/Core/Template/Loop/OrderAddress.php +++ b/core/lib/Thelia/Core/Template/Loop/OrderAddress.php @@ -28,6 +28,7 @@ use Thelia\Core\Template\Element\BaseLoop; use Thelia\Core\Template\Element\LoopResult; use Thelia\Core\Template\Element\LoopResultRow; +use Thelia\Core\Template\Element\PropelSearchLoopInterface; use Thelia\Core\Template\Loop\Argument\ArgumentCollection; use Thelia\Core\Template\Loop\Argument\Argument; @@ -42,9 +43,9 @@ use Thelia\Model\OrderAddressQuery; * @package Thelia\Core\Template\Loop * @author Etienne Roudeix */ -class OrderAddress extends BaseLoop +class OrderAddress extends BaseLoop implements PropelSearchLoopInterface { - public $timestampable = true; + protected $timestampable = true; /** * @return ArgumentCollection @@ -56,12 +57,7 @@ class OrderAddress extends BaseLoop ); } - /** - * @param $pagination - * - * @return \Thelia\Core\Template\Element\LoopResult - */ - public function exec(&$pagination) + public function buildModelCriteria() { $search = OrderAddressQuery::create(); @@ -69,12 +65,14 @@ class OrderAddress extends BaseLoop $search->filterById($id, Criteria::IN); - $orderAddresses = $this->search($search, $pagination); + return $search; - $loopResult = new LoopResult($orderAddresses); + } - foreach ($orderAddresses as $orderAddress) { - $loopResultRow = new LoopResultRow($loopResult, $orderAddress, $this->versionable, $this->timestampable, $this->countable); + public function parseResults(LoopResult $loopResult) + { + foreach ($loopResult->getResultDataCollection() as $orderAddress) { + $loopResultRow = new LoopResultRow($orderAddress); $loopResultRow ->set("ID", $orderAddress->getId()) ->set("TITLE", $orderAddress->getCustomerTitleId()) @@ -94,5 +92,6 @@ class OrderAddress extends BaseLoop } return $loopResult; + } } diff --git a/core/lib/Thelia/Core/Template/Loop/OrderProduct.php b/core/lib/Thelia/Core/Template/Loop/OrderProduct.php index f12bbed70..f36162099 100755 --- a/core/lib/Thelia/Core/Template/Loop/OrderProduct.php +++ b/core/lib/Thelia/Core/Template/Loop/OrderProduct.php @@ -28,6 +28,7 @@ use Thelia\Core\Template\Element\BaseLoop; use Thelia\Core\Template\Element\LoopResult; use Thelia\Core\Template\Element\LoopResultRow; +use Thelia\Core\Template\Element\PropelSearchLoopInterface; use Thelia\Core\Template\Loop\Argument\ArgumentCollection; use Thelia\Core\Template\Loop\Argument\Argument; @@ -41,9 +42,9 @@ use Thelia\Model\Base\OrderProductQuery; * @package Thelia\Core\Template\Loop * @author Etienne Roudeix */ -class OrderProduct extends BaseLoop +class OrderProduct extends BaseLoop implements PropelSearchLoopInterface { - public $timestampable = true; + protected $timestampable = true; /** * @return ArgumentCollection @@ -55,13 +56,7 @@ class OrderProduct extends BaseLoop ); } - /** - * @param $pagination - * - * @return \Thelia\Core\Template\Element\LoopResult - * @throws \InvalidArgumentException - */ - public function exec(&$pagination) + public function buildModelCriteria() { $search = OrderProductQuery::create(); @@ -76,44 +71,47 @@ class OrderProduct extends BaseLoop $search->orderById(Criteria::ASC); - $products = $this->search($search, $pagination); + return $search; + + } - $loopResult = new LoopResult($products); + public function parseResults(LoopResult $loopResult) + { + foreach ($loopResult->getResultDataCollection() as $orderProduct) { + $loopResultRow = new LoopResultRow($orderProduct); - foreach ($products as $product) { - $loopResultRow = new LoopResultRow($loopResult, $product, $this->versionable, $this->timestampable, $this->countable); + $price = $orderProduct->getPrice(); + $taxedPrice = $price + round($orderProduct->getVirtualColumn('TOTAL_TAX'), 2); + $promoPrice = $orderProduct->getPromoPrice(); + $taxedPromoPrice = $promoPrice + round($orderProduct->getVirtualColumn('TOTAL_PROMO_TAX'), 2); - $price = $product->getPrice(); - $taxedPrice = $price + round($product->getVirtualColumn('TOTAL_TAX'), 2); - $promoPrice = $product->getPromoPrice(); - $taxedPromoPrice = $promoPrice + round($product->getVirtualColumn('TOTAL_PROMO_TAX'), 2); - - $loopResultRow->set("ID", $product->getId()) - ->set("REF", $product->getProductRef()) - ->set("PRODUCT_SALE_ELEMENTS_REF", $product->getProductSaleElementsRef()) - ->set("WAS_NEW", $product->getWasNew() === 1 ? 1 : 0) - ->set("WAS_IN_PROMO", $product->getWasInPromo() === 1 ? 1 : 0) - ->set("WEIGHT", $product->getWeight()) - ->set("TITLE", $product->getTitle()) - ->set("CHAPO", $product->getChapo()) - ->set("DESCRIPTION", $product->getDescription()) - ->set("POSTSCRIPTUM", $product->getPostscriptum()) - ->set("QUANTITY", $product->getQuantity()) + $loopResultRow->set("ID", $orderProduct->getId()) + ->set("REF", $orderProduct->getProductRef()) + ->set("PRODUCT_SALE_ELEMENTS_REF", $orderProduct->getProductSaleElementsRef()) + ->set("WAS_NEW", $orderProduct->getWasNew() === 1 ? 1 : 0) + ->set("WAS_IN_PROMO", $orderProduct->getWasInPromo() === 1 ? 1 : 0) + ->set("WEIGHT", $orderProduct->getWeight()) + ->set("TITLE", $orderProduct->getTitle()) + ->set("CHAPO", $orderProduct->getChapo()) + ->set("DESCRIPTION", $orderProduct->getDescription()) + ->set("POSTSCRIPTUM", $orderProduct->getPostscriptum()) + ->set("QUANTITY", $orderProduct->getQuantity()) ->set("PRICE", $price) ->set("PRICE_TAX", $taxedPrice - $price) ->set("TAXED_PRICE", $taxedPrice) ->set("PROMO_PRICE", $promoPrice) ->set("PROMO_PRICE_TAX", $taxedPromoPrice - $promoPrice) ->set("TAXED_PROMO_PRICE", $taxedPromoPrice) - ->set("TAX_RULE_TITLE", $product->getTaxRuleTitle()) - ->set("TAX_RULE_DESCRIPTION", $product->getTaxRuledescription()) - ->set("PARENT", $product->getParent()) - ->set("EAN_CODE", $product->getEanCode()) + ->set("TAX_RULE_TITLE", $orderProduct->getTaxRuleTitle()) + ->set("TAX_RULE_DESCRIPTION", $orderProduct->getTaxRuledescription()) + ->set("PARENT", $orderProduct->getParent()) + ->set("EAN_CODE", $orderProduct->getEanCode()) ; $loopResult->addRow($loopResultRow); } return $loopResult; + } } diff --git a/core/lib/Thelia/Core/Template/Loop/OrderProductAttributeCombination.php b/core/lib/Thelia/Core/Template/Loop/OrderProductAttributeCombination.php index 623d0bae5..f248159c5 100755 --- a/core/lib/Thelia/Core/Template/Loop/OrderProductAttributeCombination.php +++ b/core/lib/Thelia/Core/Template/Loop/OrderProductAttributeCombination.php @@ -28,6 +28,7 @@ use Thelia\Core\Template\Element\BaseI18nLoop; use Thelia\Core\Template\Element\LoopResult; use Thelia\Core\Template\Element\LoopResultRow; +use Thelia\Core\Template\Element\PropelSearchLoopInterface; use Thelia\Core\Template\Loop\Argument\ArgumentCollection; use Thelia\Core\Template\Loop\Argument\Argument; @@ -43,9 +44,9 @@ use Thelia\Type; * @package Thelia\Core\Template\Loop * @author Etienne Roudeix */ -class OrderProductAttributeCombination extends BaseI18nLoop +class OrderProductAttributeCombination extends BaseI18nLoop implements PropelSearchLoopInterface { - public $timestampable = true; + protected $timestampable = true; /** * @return ArgumentCollection @@ -64,12 +65,7 @@ class OrderProductAttributeCombination extends BaseI18nLoop ); } - /** - * @param $pagination - * - * @return \Thelia\Core\Template\Element\LoopResult - */ - public function exec(&$pagination) + public function buildModelCriteria() { $search = OrderProductAttributeCombinationQuery::create(); @@ -90,28 +86,30 @@ class OrderProductAttributeCombination extends BaseI18nLoop } } - $attributeCombinations = $this->search($search, $pagination); + return $search; + + } - $loopResult = new LoopResult($attributeCombinations); - - foreach ($attributeCombinations as $attributeCombination) { - $loopResultRow = new LoopResultRow($loopResult, $attributeCombination, $this->versionable, $this->timestampable, $this->countable); + public function parseResults(LoopResult $loopResult) + { + foreach ($loopResult->getResultDataCollection() as $orderAttributeCombination) { + $loopResultRow = new LoopResultRow($orderAttributeCombination); $loopResultRow - ->set("LOCALE",$locale) - ->set("ATTRIBUTE_TITLE", $attributeCombination->getAttributeTitle()) - ->set("ATTRIBUTE_CHAPO", $attributeCombination->getAttributeChapo()) - ->set("ATTRIBUTE_DESCRIPTION", $attributeCombination->getAttributeDescription()) - ->set("ATTRIBUTE_POSTSCRIPTUM", $attributeCombination->getAttributePostscriptum()) - ->set("ATTRIBUTE_AVAILABILITY_TITLE", $attributeCombination->getAttributeAvTitle()) - ->set("ATTRIBUTE_AVAILABILITY_CHAPO", $attributeCombination->getAttributeAvChapo()) - ->set("ATTRIBUTE_AVAILABILITY_DESCRIPTION", $attributeCombination->getAttributeAvDescription()) - ->set("ATTRIBUTE_AVAILABILITY_POSTSCRIPTUM", $attributeCombination->getAttributeAvPostscriptum()) + ->set("ATTRIBUTE_TITLE", $orderAttributeCombination->getAttributeTitle()) + ->set("ATTRIBUTE_CHAPO", $orderAttributeCombination->getAttributeChapo()) + ->set("ATTRIBUTE_DESCRIPTION", $orderAttributeCombination->getAttributeDescription()) + ->set("ATTRIBUTE_POSTSCRIPTUM", $orderAttributeCombination->getAttributePostscriptum()) + ->set("ATTRIBUTE_AVAILABILITY_TITLE", $orderAttributeCombination->getAttributeAvTitle()) + ->set("ATTRIBUTE_AVAILABILITY_CHAPO", $orderAttributeCombination->getAttributeAvChapo()) + ->set("ATTRIBUTE_AVAILABILITY_DESCRIPTION", $orderAttributeCombination->getAttributeAvDescription()) + ->set("ATTRIBUTE_AVAILABILITY_POSTSCRIPTUM", $orderAttributeCombination->getAttributeAvPostscriptum()) ; $loopResult->addRow($loopResultRow); } return $loopResult; + } } diff --git a/core/lib/Thelia/Core/Template/Loop/OrderStatus.php b/core/lib/Thelia/Core/Template/Loop/OrderStatus.php index 0f0d144c4..f45a1d99b 100755 --- a/core/lib/Thelia/Core/Template/Loop/OrderStatus.php +++ b/core/lib/Thelia/Core/Template/Loop/OrderStatus.php @@ -28,6 +28,7 @@ use Thelia\Core\Template\Element\BaseI18nLoop; use Thelia\Core\Template\Element\LoopResult; use Thelia\Core\Template\Element\LoopResultRow; +use Thelia\Core\Template\Element\PropelSearchLoopInterface; use Thelia\Core\Template\Loop\Argument\ArgumentCollection; use Thelia\Core\Template\Loop\Argument\Argument; @@ -42,9 +43,9 @@ use Thelia\Model\OrderStatusQuery; * @package Thelia\Core\Template\Loop * @author Etienne Roudeix */ -class OrderStatus extends BaseI18nLoop +class OrderStatus extends BaseI18nLoop implements PropelSearchLoopInterface { - public $timestampable = true; + protected $timestampable = true; /** * @return ArgumentCollection @@ -56,17 +57,12 @@ class OrderStatus extends BaseI18nLoop ); } - /** - * @param $pagination - * - * @return \Thelia\Core\Template\Element\LoopResult - */ - public function exec(&$pagination) + public function buildModelCriteria() { $search = OrderStatusQuery::create(); /* manage translations */ - $locale = $this->configureI18nProcessing($search); + $this->configureI18nProcessing($search); $id = $this->getId(); @@ -74,16 +70,17 @@ class OrderStatus extends BaseI18nLoop $search->filterById($id, Criteria::IN); } - /* perform search */ - $orderStatusList = $this->search($search, $pagination); + return $search; - $loopResult = new LoopResult($orderStatusList); + } - foreach ($orderStatusList as $orderStatus) { - $loopResultRow = new LoopResultRow($loopResult, $orderStatus, $this->versionable, $this->timestampable, $this->countable); + public function parseResults(LoopResult $loopResult) + { + foreach ($loopResult->getResultDataCollection() as $orderStatus) { + $loopResultRow = new LoopResultRow($orderStatus); $loopResultRow->set("ID", $orderStatus->getId()) ->set("IS_TRANSLATED",$orderStatus->getVirtualColumn('IS_TRANSLATED')) - ->set("LOCALE",$locale) + ->set("LOCALE",$this->locale) ->set("CODE", $orderStatus->getCode()) ->set("TITLE", $orderStatus->getVirtualColumn('i18n_TITLE')) ->set("CHAPO", $orderStatus->getVirtualColumn('i18n_CHAPO')) @@ -95,5 +92,6 @@ class OrderStatus extends BaseI18nLoop } return $loopResult; + } } diff --git a/core/lib/Thelia/Core/Template/Loop/Payment.php b/core/lib/Thelia/Core/Template/Loop/Payment.php index ca0aaa18f..0fde890a9 100644 --- a/core/lib/Thelia/Core/Template/Loop/Payment.php +++ b/core/lib/Thelia/Core/Template/Loop/Payment.php @@ -22,9 +22,9 @@ /*************************************************************************************/ 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\Element\PropelSearchLoopInterface; use Thelia\Module\BaseModule; /** @@ -32,7 +32,7 @@ use Thelia\Module\BaseModule; * @package Thelia\Core\Template\Loop * @author Etienne Roudeix */ -class Payment extends BaseSpecificModule +class Payment extends BaseSpecificModule implements PropelSearchLoopInterface { public function getArgDefinitions() @@ -42,21 +42,10 @@ class Payment extends BaseSpecificModule return $collection; } - public function exec(&$pagination) + public function parseResults(LoopResult $loopResult) { - $search = parent::exec($pagination); - /* manage translations */ - $locale = $this->configureI18nProcessing($search); - - $search->filterByType(BaseModule::PAYMENT_MODULE_TYPE, Criteria::EQUAL); - - /* perform search */ - $paymentModules = $this->search($search, $pagination); - - $loopResult = new LoopResult($paymentModules); - - foreach ($paymentModules as $paymentModule) { - $loopResultRow = new LoopResultRow($loopResult, $paymentModule, $this->versionable, $this->timestampable, $this->countable); + foreach ($loopResult->getResultDataCollection() as $paymentModule) { + $loopResultRow = new LoopResultRow($paymentModule); $moduleReflection = new \ReflectionClass($paymentModule->getFullNamespace()); if ($moduleReflection->isSubclassOf("Thelia\Module\PaymentModuleInterface") === false) { @@ -80,4 +69,9 @@ class Payment extends BaseSpecificModule return $loopResult; } + + protected function getModuleType() + { + return BaseModule::PAYMENT_MODULE_TYPE; + } } diff --git a/core/lib/Thelia/Core/Template/Loop/Product.php b/core/lib/Thelia/Core/Template/Loop/Product.php index 5ddc6da10..09aff4479 100755 --- a/core/lib/Thelia/Core/Template/Loop/Product.php +++ b/core/lib/Thelia/Core/Template/Loop/Product.php @@ -29,6 +29,7 @@ use Thelia\Core\Template\Element\BaseI18nLoop; use Thelia\Core\Template\Element\LoopResult; use Thelia\Core\Template\Element\LoopResultRow; +use Thelia\Core\Template\Element\PropelSearchLoopInterface; use Thelia\Core\Template\Element\SearchLoopInterface; use Thelia\Core\Template\Loop\Argument\ArgumentCollection; use Thelia\Core\Template\Loop\Argument\Argument; @@ -52,10 +53,10 @@ use Thelia\Type; * @package Thelia\Core\Template\Loop * @author Etienne Roudeix */ -class Product extends BaseI18nLoop implements SearchLoopInterface +class Product extends BaseI18nLoop implements PropelSearchLoopInterface, SearchLoopInterface { - public $timestampable = true; - public $versionable = true; + protected $timestampable = true; + protected $versionable = true; /** * @return ArgumentCollection @@ -161,17 +162,11 @@ class Product extends BaseI18nLoop implements SearchLoopInterface } } - /** - * @param $pagination - * - * @return \Thelia\Core\Template\Element\LoopResult - * @throws \InvalidArgumentException - */ - public function exec(&$pagination) + public function buildModelCriteria() { $complex = $this->getComplex(); if (true === $complex) { - return $this->execComplex($pagination); + return $this->buildComplex(); } $currencyId = $this->getCurrency(); @@ -227,7 +222,7 @@ class Product extends BaseI18nLoop implements SearchLoopInterface } /* manage translations */ - $locale = $this->configureI18nProcessing($search); + $this->configureI18nProcessing($search); $id = $this->getId(); @@ -459,16 +454,21 @@ class Product extends BaseI18nLoop implements SearchLoopInterface } } - /* perform search */ - $products = $this->search($search, $pagination); + return $search; + } - $loopResult = new LoopResult($products); + public function parseResults(LoopResult $loopResult) + { + $complex = $this->getComplex(); + if (true === $complex) { + return $this->parseComplex($loopResult); + } $taxCountry = CountryQuery::create()->findPk(64); // @TODO : make it magic - foreach ($products as $product) { + foreach ($loopResult->getResultDataCollection() as $product) { - $loopResultRow = new LoopResultRow($loopResult, $product, $this->versionable, $this->timestampable, $this->countable); + $loopResultRow = new LoopResultRow($product); $price = $product->getVirtualColumn('price'); try { @@ -512,12 +512,12 @@ class Product extends BaseI18nLoop implements SearchLoopInterface ->set("ID" , $product->getId()) ->set("REF" , $product->getRef()) ->set("IS_TRANSLATED" , $product->getVirtualColumn('IS_TRANSLATED')) - ->set("LOCALE" , $locale) + ->set("LOCALE" , $this->locale) ->set("TITLE" , $product->getVirtualColumn('i18n_TITLE')) ->set("CHAPO" , $product->getVirtualColumn('i18n_CHAPO')) ->set("DESCRIPTION" , $product->getVirtualColumn('i18n_DESCRIPTION')) ->set("POSTSCRIPTUM" , $product->getVirtualColumn('i18n_POSTSCRIPTUM')) - ->set("URL" , $product->getUrl($locale)) + ->set("URL" , $product->getUrl($this->locale)) ->set("BEST_PRICE" , $product->getVirtualColumn('is_promo') ? $promoPrice : $price) ->set("BEST_PRICE_TAX" , $taxedPrice - $product->getVirtualColumn('is_promo') ? $taxedPromoPrice - $promoPrice : $taxedPrice - $price) ->set("BEST_TAXED_PRICE" , $product->getVirtualColumn('is_promo') ? $taxedPromoPrice : $taxedPrice) @@ -551,13 +551,7 @@ class Product extends BaseI18nLoop implements SearchLoopInterface return $loopResult; } - /** - * @param $pagination - * - * @return \Thelia\Core\Template\Element\LoopResult - * @throws \InvalidArgumentException - */ - public function execComplex(&$pagination) + public function buildComplex() { $currencyId = $this->getCurrency(); if (null !== $currencyId) { @@ -575,7 +569,7 @@ class Product extends BaseI18nLoop implements SearchLoopInterface $search = ProductQuery::create(); /* manage translations */ - $locale = $this->configureI18nProcessing($search); + $this->configureI18nProcessing($search); $attributeNonStrictMatch = $this->getAttribute_non_strict_match(); $isPSELeftJoinList = array(); @@ -978,16 +972,18 @@ class Product extends BaseI18nLoop implements SearchLoopInterface } } - /* perform search */ - $products = $this->search($search, $pagination); + return $search; + } - $loopResult = new LoopResult($products); + public function parseComplex(LoopResult $results) + { + $loopResult = new LoopResult($results); $taxCountry = CountryQuery::create()->findPk(64); // @TODO : make it magic - foreach ($products as $product) { + foreach ($loopResult->getResultDataCollection() as $product) { - $loopResultRow = new LoopResultRow($loopResult, $product, $this->versionable, $this->timestampable, $this->countable); + $loopResultRow = new LoopResultRow($product); $price = $product->getRealLowestPrice(); @@ -1023,12 +1019,12 @@ class Product extends BaseI18nLoop implements SearchLoopInterface ->set("ID" , $product->getId()) ->set("REF" , $product->getRef()) ->set("IS_TRANSLATED" , $product->getVirtualColumn('IS_TRANSLATED')) - ->set("LOCALE" , $locale) + ->set("LOCALE" , $this->locale) ->set("TITLE" , $product->getVirtualColumn('i18n_TITLE')) ->set("CHAPO" , $product->getVirtualColumn('i18n_CHAPO')) ->set("DESCRIPTION" , $product->getVirtualColumn('i18n_DESCRIPTION')) ->set("POSTSCRIPTUM" , $product->getVirtualColumn('i18n_POSTSCRIPTUM')) - ->set("URL" , $product->getUrl($locale)) + ->set("URL" , $product->getUrl($this->locale)) ->set("BEST_PRICE" , $price) ->set("BEST_PRICE_TAX" , $taxedPrice - $price) ->set("BEST_TAXED_PRICE" , $taxedPrice) diff --git a/core/lib/Thelia/Core/Template/Loop/ProductSaleElements.php b/core/lib/Thelia/Core/Template/Loop/ProductSaleElements.php index b48b0359e..da2929c70 100755 --- a/core/lib/Thelia/Core/Template/Loop/ProductSaleElements.php +++ b/core/lib/Thelia/Core/Template/Loop/ProductSaleElements.php @@ -28,6 +28,7 @@ use Thelia\Core\Template\Element\BaseLoop; use Thelia\Core\Template\Element\LoopResult; use Thelia\Core\Template\Element\LoopResultRow; +use Thelia\Core\Template\Element\PropelSearchLoopInterface; use Thelia\Core\Template\Loop\Argument\ArgumentCollection; use Thelia\Core\Template\Loop\Argument\Argument; @@ -49,9 +50,9 @@ use Thelia\Type; * @package Thelia\Core\Template\Loop * @author Etienne Roudeix */ -class ProductSaleElements extends BaseLoop +class ProductSaleElements extends BaseLoop implements PropelSearchLoopInterface { - public $timestampable = true; + protected $timestampable = true; /** * @return ArgumentCollection @@ -77,13 +78,7 @@ class ProductSaleElements extends BaseLoop ); } - /** - * @param $pagination - * - * @return \Thelia\Core\Template\Element\LoopResult - * @throws \InvalidArgumentException - */ - public function exec(&$pagination) + public function buildModelCriteria() { $search = ProductSaleElementsQuery::create(); @@ -144,14 +139,16 @@ class ProductSaleElements extends BaseLoop $search->groupById(); - $PSEValues = $this->search($search, $pagination); + return $search; - $loopResult = new LoopResult($PSEValues); + } + public function parseResults(LoopResult $loopResult) + { $taxCountry = CountryQuery::create()->findPk(64); // @TODO : make it magic - foreach ($PSEValues as $PSEValue) { - $loopResultRow = new LoopResultRow($loopResult, $PSEValue, $this->versionable, $this->timestampable, $this->countable); + foreach ($loopResult->getResultDataCollection() as $PSEValue) { + $loopResultRow = new LoopResultRow($PSEValue); $price = $PSEValue->getPrice(); try { @@ -189,5 +186,6 @@ class ProductSaleElements extends BaseLoop } return $loopResult; + } } diff --git a/core/lib/Thelia/Core/Template/Loop/ProductTemplate.php b/core/lib/Thelia/Core/Template/Loop/ProductTemplate.php index 175ff0f91..ea1d94262 100644 --- a/core/lib/Thelia/Core/Template/Loop/ProductTemplate.php +++ b/core/lib/Thelia/Core/Template/Loop/ProductTemplate.php @@ -28,6 +28,7 @@ use Thelia\Core\Template\Element\BaseI18nLoop; use Thelia\Core\Template\Element\LoopResult; use Thelia\Core\Template\Element\LoopResultRow; +use Thelia\Core\Template\Element\PropelSearchLoopInterface; use Thelia\Core\Template\Loop\Argument\ArgumentCollection; use Thelia\Core\Template\Loop\Argument\Argument; @@ -42,13 +43,13 @@ use Thelia\Model\Base\TemplateQuery; * @package Thelia\Core\Template\Loop * @author Etienne Roudeix */ -class ProductTemplate extends BaseI18nLoop +class ProductTemplate extends BaseI18nLoop implements PropelSearchLoopInterface { - public $timestampable = true; + protected $timestampable = true; /** - * @return ArgumentCollection - */ + * @return ArgumentCollection + */ protected function getArgDefinitions() { return new ArgumentCollection( @@ -57,12 +58,7 @@ class ProductTemplate extends BaseI18nLoop ); } - /** - * @param $pagination - * - * @return \Thelia\Core\Template\Element\LoopResult - */ - public function exec(&$pagination) + public function buildModelCriteria() { $search = TemplateQuery::create(); @@ -71,7 +67,7 @@ class ProductTemplate extends BaseI18nLoop $lang = $this->getLang(); /* manage translations */ - $locale = $this->configureI18nProcessing($search, $columns = array('NAME')); + $this->configureI18nProcessing($search, $columns = array('NAME')); $id = $this->getId(); @@ -85,19 +81,21 @@ class ProductTemplate extends BaseI18nLoop $search->filterById($exclude, Criteria::NOT_IN); } - /* perform search */ - $templates = $this->search($search, $pagination); + return $search; - $loopResult = new LoopResult($templates); + } - foreach ($templates as $template) { - $loopResultRow = new LoopResultRow($loopResult, $template, $this->versionable, $this->timestampable, $this->countable); + public function parseResults(LoopResult $loopResult) + { + foreach ($loopResult->getResultDataCollection() as $template) { + + $loopResultRow = new LoopResultRow($template); $loopResultRow ->set("ID", $template->getId()) ->set("IS_TRANSLATED" , $template->getVirtualColumn('IS_TRANSLATED')) - ->set("LOCALE" , $locale) - ->set("NAME" , $template->getVirtualColumn('i18n_NAME')) + ->set("LOCALE" , $this->locale) + ->set("NAME" , $template->getVirtualColumn('i18n_NAME')) ; $loopResult->addRow($loopResultRow); @@ -105,4 +103,4 @@ class ProductTemplate extends BaseI18nLoop return $loopResult; } -} +} \ No newline at end of file diff --git a/core/lib/Thelia/Core/Template/Loop/Profile.php b/core/lib/Thelia/Core/Template/Loop/Profile.php index bb2e4a7b5..bddcf856c 100755 --- a/core/lib/Thelia/Core/Template/Loop/Profile.php +++ b/core/lib/Thelia/Core/Template/Loop/Profile.php @@ -28,6 +28,7 @@ use Thelia\Core\Template\Element\BaseI18nLoop; use Thelia\Core\Template\Element\LoopResult; use Thelia\Core\Template\Element\LoopResultRow; +use Thelia\Core\Template\Element\PropelSearchLoopInterface; use Thelia\Core\Template\Loop\Argument\ArgumentCollection; use Thelia\Core\Template\Loop\Argument\Argument; @@ -43,9 +44,9 @@ use Thelia\Type; * @package Thelia\Core\Template\Loop * @author Etienne Roudeix */ -class Profile extends BaseI18nLoop +class Profile extends BaseI18nLoop implements PropelSearchLoopInterface { - public $timestampable = true; + protected $timestampable = true; /** * @return ArgumentCollection @@ -57,17 +58,12 @@ class Profile extends BaseI18nLoop ); } - /** - * @param $pagination - * - * @return \Thelia\Core\Template\Element\LoopResult - */ - public function exec(&$pagination) + public function buildModelCriteria() { $search = ProfileQuery::create(); /* manage translations */ - $locale = $this->configureI18nProcessing($search); + $this->configureI18nProcessing($search); $id = $this->getId(); @@ -77,16 +73,17 @@ class Profile extends BaseI18nLoop $search->orderById(Criteria::ASC); - /* perform search */ - $profiles = $this->search($search, $pagination); + return $search; - $loopResult = new LoopResult($profiles); + } - foreach ($profiles as $profile) { - $loopResultRow = new LoopResultRow($loopResult, $profile, $this->versionable, $this->timestampable, $this->countable); + public function parseResults(LoopResult $loopResult) + { + foreach ($loopResult->getResultDataCollection() as $profile) { + $loopResultRow = new LoopResultRow($profile); $loopResultRow->set("ID", $profile->getId()) ->set("IS_TRANSLATED",$profile->getVirtualColumn('IS_TRANSLATED')) - ->set("LOCALE",$locale) + ->set("LOCALE",$this->locale) ->set("CODE",$profile->getCode()) ->set("TITLE",$profile->getVirtualColumn('i18n_TITLE')) ->set("CHAPO", $profile->getVirtualColumn('i18n_CHAPO')) diff --git a/core/lib/Thelia/Core/Template/Loop/Resource.php b/core/lib/Thelia/Core/Template/Loop/Resource.php index 41400dc65..d1975d73f 100755 --- a/core/lib/Thelia/Core/Template/Loop/Resource.php +++ b/core/lib/Thelia/Core/Template/Loop/Resource.php @@ -29,6 +29,7 @@ use Thelia\Core\Template\Element\BaseI18nLoop; use Thelia\Core\Template\Element\LoopResult; use Thelia\Core\Template\Element\LoopResultRow; +use Thelia\Core\Template\Element\PropelSearchLoopInterface; use Thelia\Core\Template\Loop\Argument\ArgumentCollection; use Thelia\Core\Template\Loop\Argument\Argument; @@ -44,9 +45,9 @@ use Thelia\Type; * @package Thelia\Core\Template\Loop * @author Etienne Roudeix */ -class Resource extends BaseI18nLoop +class Resource extends BaseI18nLoop implements PropelSearchLoopInterface { - public $timestampable = true; + protected $timestampable = true; /** * @return ArgumentCollection @@ -64,17 +65,12 @@ class Resource extends BaseI18nLoop ); } - /** - * @param $pagination - * - * @return \Thelia\Core\Template\Element\LoopResult - */ - public function exec(&$pagination) + public function buildModelCriteria() { $search = ResourceQuery::create(); /* manage translations */ - $locale = $this->configureI18nProcessing($search); + $this->configureI18nProcessing($search); $profile = $this->getProfile(); @@ -92,16 +88,17 @@ class Resource extends BaseI18nLoop $search->orderById(Criteria::ASC); - /* perform search */ - $resources = $this->search($search, $pagination); + return $search; - $loopResult = new LoopResult($resources); + } - foreach ($resources as $resource) { - $loopResultRow = new LoopResultRow($loopResult, $resource, $this->versionable, $this->timestampable, $this->countable); + public function parseResults(LoopResult $loopResult) + { + foreach ($loopResult->getResultDataCollection() as $resource) { + $loopResultRow = new LoopResultRow($resource); $loopResultRow->set("ID", $resource->getId()) ->set("IS_TRANSLATED",$resource->getVirtualColumn('IS_TRANSLATED')) - ->set("LOCALE",$locale) + ->set("LOCALE",$this->locale) ->set("CODE",$resource->getCode()) ->set("TITLE",$resource->getVirtualColumn('i18n_TITLE')) ->set("CHAPO", $resource->getVirtualColumn('i18n_CHAPO')) @@ -109,7 +106,7 @@ class Resource extends BaseI18nLoop ->set("POSTSCRIPTUM", $resource->getVirtualColumn('i18n_POSTSCRIPTUM')) ; - if (null !== $profile) { + if (null !== $this->getProfile()) { $accessValue = $resource->getVirtualColumn('access'); $manager = new AccessManager($accessValue); @@ -123,5 +120,6 @@ class Resource extends BaseI18nLoop } return $loopResult; + } } diff --git a/core/lib/Thelia/Core/Template/Loop/Tax.php b/core/lib/Thelia/Core/Template/Loop/Tax.php index e97b9c7d5..bc57f5593 100644 --- a/core/lib/Thelia/Core/Template/Loop/Tax.php +++ b/core/lib/Thelia/Core/Template/Loop/Tax.php @@ -28,6 +28,7 @@ use Thelia\Core\Template\Element\BaseI18nLoop; use Thelia\Core\Template\Element\LoopResult; use Thelia\Core\Template\Element\LoopResultRow; +use Thelia\Core\Template\Element\PropelSearchLoopInterface; use Thelia\Core\Template\Loop\Argument\ArgumentCollection; use Thelia\Core\Template\Loop\Argument\Argument; @@ -45,9 +46,9 @@ use Thelia\Model\TaxQuery; * @package Thelia\Core\Template\Loop * @author Etienne Roudeix */ -class Tax extends BaseI18nLoop +class Tax extends BaseI18nLoop implements PropelSearchLoopInterface { - public $timestampable = true; + protected $timestampable = true; /** * @return ArgumentCollection @@ -70,17 +71,12 @@ class Tax extends BaseI18nLoop ); } - /** - * @param $pagination - * - * @return \Thelia\Core\Template\Element\LoopResult - */ - public function exec(&$pagination) + public function buildModelCriteria() { $search = TaxQuery::create(); /* manage translations */ - $locale = $this->configureI18nProcessing($search, array('TITLE', 'DESCRIPTION')); + $this->configureI18nProcessing($search, array('TITLE', 'DESCRIPTION')); $id = $this->getId(); @@ -142,21 +138,21 @@ class Tax extends BaseI18nLoop } } - /* perform search */ - $taxes = $this->search($search, $pagination); + return $search; - $loopResult = new LoopResult($taxes); + } - foreach ($taxes as $tax) { - - $loopResultRow = new LoopResultRow($loopResult, $tax, $this->versionable, $this->timestampable, $this->countable); + public function parseResults(LoopResult $loopResult) + { + foreach ($loopResult->getResultDataCollection() as $tax) { + $loopResultRow = new LoopResultRow($tax); $loopResultRow ->set("ID" , $tax->getId()) ->set("TYPE" , $tax->getType()) ->set("REQUIREMENTS" , $tax->getRequirements()) ->set("IS_TRANSLATED" , $tax->getVirtualColumn('IS_TRANSLATED')) - ->set("LOCALE" , $locale) + ->set("LOCALE" , $this->locale) ->set("TITLE" , $tax->getVirtualColumn('i18n_TITLE')) ->set("DESCRIPTION" , $tax->getVirtualColumn('i18n_DESCRIPTION')) ; @@ -165,5 +161,6 @@ class Tax extends BaseI18nLoop } return $loopResult; + } } diff --git a/core/lib/Thelia/Core/Template/Loop/TaxRule.php b/core/lib/Thelia/Core/Template/Loop/TaxRule.php index e1c30d177..be90cc5ac 100644 --- a/core/lib/Thelia/Core/Template/Loop/TaxRule.php +++ b/core/lib/Thelia/Core/Template/Loop/TaxRule.php @@ -28,6 +28,7 @@ use Thelia\Core\Template\Element\BaseI18nLoop; use Thelia\Core\Template\Element\LoopResult; use Thelia\Core\Template\Element\LoopResultRow; +use Thelia\Core\Template\Element\PropelSearchLoopInterface; use Thelia\Core\Template\Loop\Argument\ArgumentCollection; use Thelia\Core\Template\Loop\Argument\Argument; @@ -44,9 +45,9 @@ use Thelia\Model\TaxRuleQuery; * @package Thelia\Core\Template\Loop * @author Etienne Roudeix */ -class TaxRule extends BaseI18nLoop +class TaxRule extends BaseI18nLoop implements PropelSearchLoopInterface { - public $timestampable = true; + protected $timestampable = true; /** * @return ArgumentCollection @@ -66,17 +67,12 @@ class TaxRule extends BaseI18nLoop ); } - /** - * @param $pagination - * - * @return \Thelia\Core\Template\Element\LoopResult - */ - public function exec(&$pagination) + public function buildModelCriteria() { $search = TaxRuleQuery::create(); /* manage translations */ - $locale = $this->configureI18nProcessing($search, array('TITLE', 'DESCRIPTION')); + $this->configureI18nProcessing($search, array('TITLE', 'DESCRIPTION')); $id = $this->getId(); @@ -109,27 +105,28 @@ class TaxRule extends BaseI18nLoop } } - /* perform search */ - $tax_rules = $this->search($search, $pagination); + return $search; - $loopResult = new LoopResult($tax_rules); + } - foreach ($tax_rules as $tax_rule) { - - $loopResultRow = new LoopResultRow($loopResult, $tax_rule, $this->versionable, $this->timestampable, $this->countable); + public function parseResults(LoopResult $loopResult) + { + foreach ($loopResult->getResultDataCollection() as $taxRule) { + $loopResultRow = new LoopResultRow($taxRule); $loopResultRow - ->set("ID" , $tax_rule->getId()) - ->set("IS_TRANSLATED" , $tax_rule->getVirtualColumn('IS_TRANSLATED')) - ->set("LOCALE" , $locale) - ->set("TITLE" , $tax_rule->getVirtualColumn('i18n_TITLE')) - ->set("DESCRIPTION" , $tax_rule->getVirtualColumn('i18n_DESCRIPTION')) - ->set("IS_DEFAULT" , $tax_rule->getIsDefault() ? '1' : '0') + ->set("ID" , $taxRule->getId()) + ->set("IS_TRANSLATED" , $taxRule->getVirtualColumn('IS_TRANSLATED')) + ->set("LOCALE" , $this->locale) + ->set("TITLE" , $taxRule->getVirtualColumn('i18n_TITLE')) + ->set("DESCRIPTION" , $taxRule->getVirtualColumn('i18n_DESCRIPTION')) + ->set("IS_DEFAULT" , $taxRule->getIsDefault() ? '1' : '0') ; $loopResult->addRow($loopResultRow); } return $loopResult; + } } diff --git a/core/lib/Thelia/Core/Template/Loop/TaxRuleCountry.php b/core/lib/Thelia/Core/Template/Loop/TaxRuleCountry.php index 83539fef6..0c32a51df 100644 --- a/core/lib/Thelia/Core/Template/Loop/TaxRuleCountry.php +++ b/core/lib/Thelia/Core/Template/Loop/TaxRuleCountry.php @@ -29,6 +29,7 @@ use Thelia\Core\Template\Element\BaseI18nLoop; use Thelia\Core\Template\Element\LoopResult; use Thelia\Core\Template\Element\LoopResultRow; +use Thelia\Core\Template\Element\PropelSearchLoopInterface; use Thelia\Core\Template\Loop\Argument\ArgumentCollection; use Thelia\Core\Template\Loop\Argument\Argument; @@ -49,9 +50,11 @@ use Thelia\Model\TaxRuleCountryQuery; * @package Thelia\Core\Template\Loop * @author Etienne Roudeix */ -class TaxRuleCountry extends BaseI18nLoop +class TaxRuleCountry extends BaseI18nLoop implements PropelSearchLoopInterface { - public $timestampable = true; + protected $taxCountForOriginCountry; + + protected $timestampable = true; /** * @return ArgumentCollection @@ -71,12 +74,7 @@ class TaxRuleCountry extends BaseI18nLoop ); } - /** - * @param $pagination - * - * @return \Thelia\Core\Template\Element\LoopResult - */ - public function exec(&$pagination) + public function buildModelCriteria() { $search = TaxRuleCountryQuery::create(); @@ -86,9 +84,9 @@ class TaxRuleCountry extends BaseI18nLoop $taxRule = $this->getTax_rule(); if ($ask === 'countries') { - $taxCountForOriginCountry = TaxRuleCountryQuery::create()->filterByCountryId($country)->count(); + $this->taxCountForOriginCountry = TaxRuleCountryQuery::create()->filterByCountryId($country)->count(); - if ($taxCountForOriginCountry > 0) { + if ($this->taxCountForOriginCountry > 0) { $search->groupByCountryId(); $originalCountryJoin = new Join(); @@ -101,7 +99,7 @@ class TaxRuleCountry extends BaseI18nLoop $search->addJoinObject($originalCountryJoin, 's_to_o'); $search->where('`origin`.`COUNTRY_ID`' . Criteria::EQUAL . '?', $country, \PDO::PARAM_INT); - $search->having('COUNT(*)=?', $taxCountForOriginCountry, \PDO::PARAM_INT); + $search->having('COUNT(*)=?', $this->taxCountForOriginCountry, \PDO::PARAM_INT); $search->filterByTaxRuleId($taxRule); @@ -142,17 +140,17 @@ class TaxRuleCountry extends BaseI18nLoop $search->orderByPosition(Criteria::ASC); } - /* perform search */ - $taxRuleCountries = $this->search($search, $pagination); + return $search; - $loopResult = new LoopResult($taxRuleCountries); + } - foreach ($taxRuleCountries as $taxRuleCountry) { + public function parseResults(LoopResult $loopResult) + { + foreach ($loopResult->getResultDataCollection() as $taxRuleCountry) { + $loopResultRow = new LoopResultRow($taxRuleCountry); - $loopResultRow = new LoopResultRow($loopResult, $taxRuleCountry, $this->versionable, $this->timestampable, $this->countable); - - if ($ask === 'countries') { - if ($taxCountForOriginCountry > 0) { + if ($this->getAsk() === 'countries') { + if ($this->taxCountForOriginCountry > 0) { $loopResultRow ->set("COUNTRY" , $taxRuleCountry->getCountryId()) ->set("COUNTRY_TITLE" , $taxRuleCountry->getVirtualColumn(CountryTableMap::TABLE_NAME . '_i18n_TITLE')) @@ -167,7 +165,7 @@ class TaxRuleCountry extends BaseI18nLoop ->set("COUNTRY_DESCRIPTION" , $taxRuleCountry->getVirtualColumn('i18n_DESCRIPTION')) ->set("COUNTRY_POSTSCRIPTUM" , $taxRuleCountry->getVirtualColumn('i18n_POSTSCRIPTUM')); } - } elseif ($ask === 'taxes') { + } elseif ($this->getAsk() === 'taxes') { $loopResultRow ->set("TAX_RULE" , $taxRuleCountry->getTaxRuleId()) ->set("COUNTRY" , $taxRuleCountry->getCountryId()) @@ -182,5 +180,6 @@ class TaxRuleCountry extends BaseI18nLoop } return $loopResult; + } } diff --git a/core/lib/Thelia/Core/Template/Loop/Template.php b/core/lib/Thelia/Core/Template/Loop/Template.php index b53c4d816..7560926d8 100644 --- a/core/lib/Thelia/Core/Template/Loop/Template.php +++ b/core/lib/Thelia/Core/Template/Loop/Template.php @@ -29,6 +29,7 @@ use Thelia\Core\Template\Element\BaseI18nLoop; use Thelia\Core\Template\Element\LoopResult; use Thelia\Core\Template\Element\LoopResultRow; +use Thelia\Core\Template\Element\PropelSearchLoopInterface; use Thelia\Core\Template\Loop\Argument\ArgumentCollection; use Thelia\Core\Template\Loop\Argument\Argument; @@ -38,6 +39,8 @@ use Thelia\Module\BaseModule; use Thelia\Type; use Thelia\Core\Template\TemplateHelper; use Thelia\Core\Template\TemplateDefinition; +use Thelia\Core\Template\Element\BaseLoop; +use Thelia\Core\Template\Element\ArraySearchLoopInterface; /** * @@ -47,9 +50,9 @@ use Thelia\Core\Template\TemplateDefinition; * * @author Franck Allimant */ -class Template extends BaseI18nLoop +class Template extends BaseLoop implements ArraySearchLoopInterface { - /** + /** * @return ArgumentCollection */ protected function getArgDefinitions() @@ -68,13 +71,7 @@ class Template extends BaseI18nLoop ); } - /** - * @param $pagination - * - * @return \Thelia\Core\Template\Element\LoopResult - */ - public function exec(&$pagination) - { + public function buildArray() { $type = $this->getArg(template_type); if ($type == 'front-office') @@ -84,13 +81,14 @@ class Template extends BaseI18nLoop else if ($type == 'pdf') $templateType = TemplateDefinition::PDF; - $templates = TemplateHelper::getInstance()->getList($templateType); + return TemplateHelper::getInstance()->getList($templateType); + } - $loopResult = new LoopResult(); + public function parseResults(LoopResult $loopResult) + { + foreach ($loopResult->getResultDataCollection() as $template) { - foreach ($templates as $template) { - - $loopResultRow = new LoopResultRow($loopResult); + $loopResultRow = new LoopResultRow($template); $loopResultRow ->set("NAME" , $template->getName()) diff --git a/core/lib/Thelia/Core/Template/Loop/Title.php b/core/lib/Thelia/Core/Template/Loop/Title.php index 3cd59d665..51d482892 100755 --- a/core/lib/Thelia/Core/Template/Loop/Title.php +++ b/core/lib/Thelia/Core/Template/Loop/Title.php @@ -28,6 +28,7 @@ use Thelia\Core\Template\Element\BaseI18nLoop; use Thelia\Core\Template\Element\LoopResult; use Thelia\Core\Template\Element\LoopResultRow; +use Thelia\Core\Template\Element\PropelSearchLoopInterface; use Thelia\Core\Template\Loop\Argument\ArgumentCollection; use Thelia\Core\Template\Loop\Argument\Argument; @@ -42,9 +43,9 @@ use Thelia\Model\CustomerTitleQuery; * @package Thelia\Core\Template\Loop * @author Etienne Roudeix */ -class Title extends BaseI18nLoop +class Title extends BaseI18nLoop implements PropelSearchLoopInterface { - public $timestampable = true; + protected $timestampable = true; /** * @return ArgumentCollection @@ -56,17 +57,12 @@ class Title extends BaseI18nLoop ); } - /** - * @param $pagination - * - * @return \Thelia\Core\Template\Element\LoopResult - */ - public function exec(&$pagination) + public function buildModelCriteria() { $search = CustomerTitleQuery::create(); /* manage translations */ - $locale = $this->configureI18nProcessing($search, array('SHORT', 'LONG')); + $this->configureI18nProcessing($search, array('SHORT', 'LONG')); $id = $this->getId(); @@ -76,16 +72,17 @@ class Title extends BaseI18nLoop $search->orderByPosition(); - /* perform search */ - $titles = $this->search($search, $pagination); + return $search; - $loopResult = new LoopResult($titles); + } - foreach ($titles as $title) { - $loopResultRow = new LoopResultRow($loopResult, $title, $this->versionable, $this->timestampable, $this->countable); + public function parseResults(LoopResult $loopResult) + { + foreach ($loopResult->getResultDataCollection() as $title) { + $loopResultRow = new LoopResultRow($title); $loopResultRow->set("ID", $title->getId()) ->set("IS_TRANSLATED",$title->getVirtualColumn('IS_TRANSLATED')) - ->set("LOCALE",$locale) + ->set("LOCALE",$this->locale) ->set("DEFAULT", $title->getByDefault()) ->set("SHORT", $title->getVirtualColumn('i18n_SHORT')) ->set("LONG", $title->getVirtualColumn('i18n_LONG')) @@ -95,5 +92,6 @@ class Title extends BaseI18nLoop } return $loopResult; + } } diff --git a/core/lib/Thelia/Form/CustomerProfilUpdateForm.php b/core/lib/Thelia/Form/CustomerProfileUpdateForm.php similarity index 95% rename from core/lib/Thelia/Form/CustomerProfilUpdateForm.php rename to core/lib/Thelia/Form/CustomerProfileUpdateForm.php index 471c12432..c7ebd2c43 100755 --- a/core/lib/Thelia/Form/CustomerProfilUpdateForm.php +++ b/core/lib/Thelia/Form/CustomerProfileUpdateForm.php @@ -23,14 +23,15 @@ namespace Thelia\Form; use Symfony\Component\Validator\ExecutionContextInterface; +use Thelia\Core\Translation\Translator; use Thelia\Model\CustomerQuery; /** - * Class CustomerProfilUpdateForm + * Class CustomerProfileUpdateForm * @package Thelia\Form * @author Christophe Laffont */ -class CustomerProfilUpdateForm extends CustomerCreateForm +class CustomerProfileUpdateForm extends CustomerCreateForm { protected function buildForm() @@ -81,6 +82,6 @@ class CustomerProfilUpdateForm extends CustomerCreateForm public function getName() { - return "thelia_customer_profil_update"; + return "thelia_customer_profile_update"; } } diff --git a/core/lib/Thelia/Module/schema/module/module.xsd b/core/lib/Thelia/Module/schema/module/module.xsd index bcd7bd292..7336c751c 100644 --- a/core/lib/Thelia/Module/schema/module/module.xsd +++ b/core/lib/Thelia/Module/schema/module/module.xsd @@ -33,9 +33,9 @@ - + - + @@ -52,13 +52,13 @@ - + Les plugins qui doivent déjà être présents - + diff --git a/templates/admin/default/I18n/fr_FR.php b/templates/admin/default/I18n/fr_FR.php index 6884502b9..2de503905 100755 --- a/templates/admin/default/I18n/fr_FR.php +++ b/templates/admin/default/I18n/fr_FR.php @@ -1,808 +1,808 @@ '', - 'Back-office home' => '', - 'Thelia Back Office' => '', - 'Version %ver' => '', - 'View site' => '', - 'View shop' => '', - 'Profil' => '', - 'Close administation session' => '', - 'Logout' => '', - 'Home' => '', - 'Customers' => '', - 'Orders' => '', - 'All orders' => '', - 'Catalog' => '', - 'Folders' => '', - 'Coupons' => '', - 'Configuration' => '', - 'Modules' => '', - 'Search' => '', - 'Thelia, solution e-commerce libre' => '', - 'Dashboard' => '', - 'Sales' => '', - 'New customers' => '', - 'First orders' => '', - 'Aborted orders' => '', - 'Shop Informations' => '', - 'Categories' => '', - 'Products' => '', - 'Online products' => '', - 'Offline products' => '', - 'Pending orders' => '', - 'In process orderst' => '', - 'Shipped orders' => '', - 'Canceled orders' => '', - 'Sales statistics' => '', - 'Today' => '', - 'This month' => '', - 'This year' => '', - 'Overall sales' => '', - 'Sales excluding shipping' => '', - 'Yesterday sales' => '', - 'Waiting orders' => '', - 'In process orders' => '', - 'Average cart' => '', - 'Previous month sales' => '', - 'Previous year sales' => '', - 'Thelia informations' => '', - 'Current version' => '', - 'Latest version available' => '', - 'News' => '', - 'Click here' => '', - '© Thelia 2013' => '', - 'Édité par OpenStudio' => '', - 'Forum Thelia' => '', - 'Contributions Thelia' => '', - 'Customer' => '', - 'Customers list' => '', - 'Add a new Customer' => '', - 'customer ref' => '', - 'firstname & lastname' => '', - 'last order' => '', - 'order amount' => '', - 'Actions' => '', - 'Edit this customer' => '', - 'Send a mail to this customer' => '', - 'Delete this customer and all his orders' => '', - 'Company Name' => '', - 'Company' => '', - 'Title' => '', - 'First Name' => '', - 'Firstname' => '', - 'Last Name' => '', - 'Lastname' => '', - 'Street Address' => '', - 'Address' => '', - 'Address Line 2' => '', - 'Additional address' => '', - 'Address Line 3' => '', - 'Zip code' => '', - 'City' => '', - 'Country' => '', - 'Email Address' => '', - 'Email address' => '', - 'Create a new customer' => '', - 'Create this customer' => '', - 'Cancel' => '', - 'OK' => '', - 'Delete customer' => '', - 'Do you really want to delete this customer ?' => '', - 'No' => '', - 'Yes' => '', - 'Thelia configuration' => '', - 'Product catalog configuration' => '', - 'Product templates' => '', - 'Product attributes' => '', - 'Product features' => '', - 'Mailing templates' => '', - 'Currencies' => '', - 'Taxes rules' => '', - 'Shipping configuration' => '', - 'Countries' => '', - 'Shipping zones' => '', - 'System parameters' => '', - 'Modules activation' => '', - 'System variables' => '', - 'Administration profiles' => '', - 'Administrators' => '', - 'Languages & URLs' => '', - 'Mailing system' => '', - 'Administration logs' => '', - 'System logs' => '', - 'Thelia System Variables' => '', - 'Thelia system variables' => '', - 'Add a new variable' => '', - 'Save chages' => '', - 'Save changes' => '', - 'Purpose' => '', - 'Name' => '', - 'Value' => '', - 'Action' => '', - 'Change this variable' => '', - 'Cancel changes and revert to original value' => '', - 'Delete this variable' => '', - 'Name *' => '', - 'Variable name' => '', - 'Value *' => '', - 'Variable value' => '', - 'Purpose *' => '', - 'Variable purpose' => '', - 'English' => '', - 'Enter here the category name in the default language (%title)' => '', - 'Create a new variable' => '', - 'Create this variable' => '', - 'Delete a variable' => '', - 'Do you really want to delete this variable ?' => '', - 'Coupon' => '', - 'Browse' => '', - 'Coupons : ' => '', - 'List' => '', - 'Create a new coupon' => '', - 'Enabled coupons' => '', - 'Code' => '', - 'Days before expiration' => '', - 'Usage left' => '', - 'Edit' => '', - 'Unlimited' => '', - 'Disabled coupons' => '', - 'Expiration date' => '', - 'Update coupon' => '', - 'Update' => '', - 'Code :' => '', - 'code' => '', - 'Title :' => '', - 'title' => '', - 'Is enabled' => '', - 'Is available on special offers' => '', - 'Is cumulative' => '', - 'Is removing postage' => '', - 'Expiration date :' => '', - 'yyyy-mm-dd' => '', - 'Is unlimited' => '', - 'Max usage :' => '', - 'max usage' => '', - 'Type :' => '', - 'Please select a coupon type' => '', - 'Amount :' => '', - '14.50' => '', - 'Short description :' => '', - 'short description' => '', - 'Long description :' => '', - 'long description' => '', - 'Save your modifications' => '', - 'Conditions' => '', - 'Delete' => '', - 'And' => '', - 'Save this condition' => '', - 'Condition\'s category :' => '', - 'Please select a condition category' => '', - 'Files manager' => '', - 'Please retry' => '', - 'Please select another condition' => '', - 'Edit a customer' => '', - 'Editing customer "%name"' => '', - 'Edit customer thelia thelia' => '', - 'Save' => '', - 'Save and close' => '', - 'Customer informations' => '', - 'Default address' => '', - 'Other addresses' => '', - 'Add a new address' => '', - 'Phone' => '', - 'cell phone' => '', - 'Edit this address' => '', - 'Use this address by default' => '', - 'orders for this customer' => '', - 'Order n°' => '', - 'Date & Hour' => '', - 'Amount' => '', - 'Status' => '', - 'Sorry, customer ID=1 was not found.' => '', - 'Address label' => '', - 'Label' => '', - 'Create an address' => '', - 'Create this address' => '', - 'Use address by default' => '', - 'Do you really want to use this address by default ?' => '', - 'Delete address' => '', - 'Do you really want to delete this address ?' => '', - 'Edit an address' => '', - 'Edit this order' => '', - 'Cancel this order' => '', - 'Delete an order' => '', - 'Do you really want to cancel this order ?' => '', - 'Edit an order' => '', - 'Ordered products' => '', - 'Invoice and Delivery' => '', - 'Cart' => '', - 'Product' => '', - 'Unit. price' => '', - 'Tax' => '', - 'Unit taxed price' => '', - 'Quantity' => '', - 'Taxed total' => '', - 'Total without discount' => '', - 'Discount' => '', - 'Coupon code' => '', - 'Total including discount' => '', - 'Postage' => '', - 'Total' => '', - 'Payment information' => '', - 'Payment module' => '', - 'Transaction reference' => '', - 'Delivery module' => '', - 'tracking reference' => '', - 'Description' => '', - 'Invoice informations' => '', - 'Download invoice as PDF' => '', - 'PDF | Invoice' => '', - 'Edit invoice address' => '', - 'Invoice reference' => '', - 'Invoice date' => '', - 'Street address' => '', - 'Delivery address' => '', - 'Download purchase order as PDF' => '', - 'PDF | Purchase order' => '', - 'Edit delivery address' => '', - 'Compagny' => '', - 'Edit order address' => '', - 'Confirm changes' => '', - 'Top level categories' => '', - 'Add a new category' => '', - 'ID' => '', - 'Category title' => '', - 'Online' => '', - 'Position' => '', - 'Browse this category' => '', - 'Edit this category' => '', - 'Delete this category and all its contents' => '', - 'This category has no sub-categories. To create a new one, click the + button above.' => '', - 'This category has no sub-categories.' => '', - 'Top level Products' => '', - 'Add a new product' => '', - 'Reference' => '', - 'Product title' => '', - 'This category doesn\'t contains any products. To add a new product, click the + button above.' => '', - 'Create a new category' => '', - 'Create this category' => '', - 'Enter here the product reference' => '', - 'Enter here the product name in the default language (%title)' => '', - 'Product price' => '', - 'Enter here the product price in the default currency (%title)' => '', - 'Select a tax tule' => '', - 'Select here the tax applicable to this product' => '', - 'Product weight' => '', - 'Kg' => '', - 'Enter here the product weight, in Kilogrammes' => '', - 'Create a new product' => '', - 'Create this product' => '', - 'Delete category' => '', - 'Do you really want to delete this category and all its content ?' => '', - 'Delete product' => '', - 'Do you really want to delete this product ?' => '', - 'Enter new category position' => '', - 'Enter new product position' => '', - 'Edit category' => '', - 'Editing %cat' => '', - 'Edit category %title' => '', - 'Preview category page' => '', - 'Edit next category' => '', - 'General description' => '', - 'Associations' => '', - 'Images' => '', - 'Documents' => '', - 'Edit information in %lng' => '', - 'Français' => '', - 'castellano' => '', - 'Italiano' => '', - 'Close' => '', - 'Category title *' => '', - 'Summary' => '', - 'A short description, used when a summary or an introduction is required' => '', - 'Short description' => '', - 'Detailed description' => '', - 'The detailed description.' => '', - 'Conclusion' => '', - 'A short post-description information' => '', - 'Short conclusion' => '', - 'Rewriten URL *' => '', - 'Rewritten URL' => '', - 'Rewriten URL' => '', - 'Parent category *' => '', - 'Top level' => '', - 'Visibility' => '', - 'Category created on %date_create. Last modification: %date_change' => '', - 'Related content' => '', - 'You can attach here some content to this category' => '', - 'Select a folder...' => '', - 'Select a folder to get its content' => '', - 'Select a folder content...' => '', - 'Select a content and click (+) to add it to this category' => '', - 'No available content in this folder' => '', - 'No folders found' => '', - 'Content title' => '', - 'This category contains no contents' => '', - 'Send files' => '', - 'Drop files to upload' => '', - 'Browse files' => '', - 'Update this image' => '', - 'There is no images attached to this %type.' => '', - 'Can\'t load images, please refresh this page.' => '', - 'There is no documents attached to this %type.' => '', - 'Can\'t load documents, please refresh this page.' => '', - 'Remove related content' => '', - 'Do you really want to remove this related content ?' => '', - '(edit)' => '', - 'Categories in %cat' => '', - 'Products in %cat' => '', - 'Edit this product' => '', - 'Delete this product' => '', - 'Edit product' => '', - 'Editing %title' => '', - 'Edit product %title' => '', - 'Preview product page' => '', - 'General' => '', - 'Details' => '', - 'Attributes & Features' => '', - 'Product reference' => '', - 'Product title *' => '', - 'Default product category *' => '', - 'You can attach this product to more categories in the details tab.' => '', - 'Product created on %date_create. Last modification: %date_change' => '', - 'Edit prices in %curr' => '', - 'Attribute Combinations' => '', - 'Quickly create combinations using the combination builder' => '', - 'Combination builder' => '', - 'Add a new combination' => '', - 'EAN Code' => '', - 'Price
w/o taxes (%currency)' => '', - 'Price
w/ taxes (%currency)' => '', - 'Weight
(Kg)' => '', - 'Default' => '', - 'Sale' => '', - 'New' => '', - 'Sale price
w/o taxes (%currency)' => '', - 'Sale price
w/ taxes (%currency)' => '', - 'Delete this combination' => '', - 'Attribute' => '', - 'Select an attribute...' => '', - 'Select an attribute and click (+) to view available values' => '', - 'Select an attribute value...' => '', - 'Select a value click (+) to add it to the combination' => '', - 'No available value for this attribute' => '', - 'To remove a value from the combination, select it and click "remove"' => '', - 'Remove selected values' => '', - 'Create a new combination' => '', - 'Create this combination' => '', - 'Delete a combination' => '', - 'Do you really want to delete this combination ?' => '', - 'Select attribute values to combine. You may enter a default value for some of the fields of the generated combinations.' => '', - 'Price excl. taxes' => '', - 'Combination reference' => '', - 'Combination EAN Code' => '', - 'Current quantity' => '', - '0 combinations' => '', - 'Create combinations' => '', - 'Please wait, loading' => '', - 'Failed to get converted prices. Please try again.' => '', - 'Failed to get prices. Please try again.' => '', - 'Existing combinations will be deleted. Do you want to continue ?' => '', - 'To use features or attributes on this product, please select a product template. You can define product templates in the configuration section of the administration.' => '', - 'Current product template' => '', - 'Do not use a product template' => '', - 'Apply' => '', - 'Product Attributes' => '', - 'You can change template attributes and their positions in the template configuration page.' => '', - 'Attribute Name' => '', - 'This product template does not contains any features' => '', - 'Product Features' => '', - 'You can change templates features and their positions in the template configuration page.' => '', - 'Feature Name' => '', - 'Feature value for this product' => '', - 'Use Ctrl+click to select more than one value. You can also clear selected values.' => '', - 'Enter here the feature value as free text' => '', - 'Feature value' => '', - 'Top level folders' => '', - 'Add a new folder' => '', - 'Folder title' => '', - 'Browse this folder' => '', - 'Edit this folder' => '', - 'Delete this folder and all its contents' => '', - 'This folder has no sub-folders. To create a new one, click the + button above.' => '', - 'This folder has no sub-folders.' => '', - 'Top level Contents' => '', - 'Add a new content' => '', - 'This folder doesn\'t contains any contents. To add a new content, click the + button above.' => '', - 'Enter here the folder name in the default language (%title)' => '', - 'Create a new folder' => '', - 'Create this folder' => '', - 'Enter here the content name in the default language (%title)' => '', - 'Create a new content' => '', - 'Create this content' => '', - 'Delete folder' => '', - 'Do you really want to delete this folder and all its content ?' => '', - 'Delete content' => '', - 'Do you really want to delete this content ?' => '', - 'Enter new folder position' => '', - 'Enter new content position' => '', - 'An error occured' => '', - 'Oops! An Error Occurred' => '', - 'Go to administration home' => '', - 'Folders in %fold' => '', - 'Contents in %fold' => '', - 'Edit this content' => '', - 'Delete this content' => '', - 'Edit content' => '', - 'Edit content %title' => '', - 'Preview folder page' => '', - 'Content title *' => '', - 'Default folder *' => '', - 'Folder created on %date_create. Last modification: %date_change' => '', - 'Additional Folders' => '', - 'A content could be attached to more than one folder. Select here the additional fodlers for this content.' => '', - 'You can change the default folder (%title) in the "General" tab.' => '', - ' (default)' => '', - 'Select a folder and click (+) to add it to the additional folder list' => '', - 'No Folders found' => '', - 'This product doesn\'t belong to any additional folder.' => '', - 'Remove associated folder' => '', - 'Do you really want to remove the content from this folder ?' => '', - 'Remove the product from this category' => '', - 'Coupon : ' => '', - 'days left' => '', - 'May be cumulative' => '', - 'Won\'t remove postage' => '', - 'Will be available on special offers' => '', - 'Application field' => '', - 'Do you really want to enable this element ?' => '', - 'Confirmation' => '', - 'Confirm' => '', - 'Create coupon' => '', - 'Create' => '', - 'Please save your Coupon in oder to affect it some conditions' => '', - 'Do you really want to delete this element ?' => '', - 'Thelia Product Templates' => '', - 'Thelia product templates' => '', - 'Add a new product template' => '', - 'Change this template' => '', - 'Change this product template' => '', - 'Delete this product template' => '', - 'No product template has been created yet. Click the + button to create one.' => '', - 'Template Name *' => '', - 'Template title' => '', - 'Enter here the template name in the default language (English)' => '', - 'Create a new product template' => '', - 'Create this product template' => '', - 'Delete template' => '', - 'Do you really want to delete this template ? It will be removed from all products.' => '', - 'Select an feature...' => '', - 'Select an feature and click (+) to add it to this template' => '', - 'Feature title' => '', - 'Delete this feature' => '', - 'This template contains no features' => '', - 'Remove feature' => '', - 'Do you really want to remove this feature from the template ?' => '', - 'Thelia Product Attributes' => '', - 'Thelia product attributes' => '', - 'Add a new product attribute' => '', - 'Change this attribute' => '', - 'Remove this attribute from all product templates' => '', - 'Add this attribute to all product templates' => '', - 'Change this product attribute' => '', - 'Delete this product attribute' => '', - 'No product attribute has been created yet. Click the + button to create one.' => '', - 'Title *' => '', - 'Attribute title' => '', - 'Enter here the attribute name in the default language (English)' => '', - 'Check this box if you want to add this attributes to all product templates' => '', - 'Create a new attribute' => '', - 'Create this attribute' => '', - 'Delete attribute' => '', - 'Do you really want to delete this attribute ? It will be removed from all product templates.' => '', - 'Add to all product templates' => '', - 'Do you really want to add this attribute to all product templates ?' => '', - 'Remove from all product templates' => '', - 'Do you really want to remove this attribute from all product templates ? You\'ll loose all product related data for this attribute.' => '', - 'Enter new attribute position' => '', - 'Edit an attribute' => '', - 'Attributes' => '', - 'Editing attribute "%name"' => '', - 'Edit attribute en_US : Officiis cumque.' => '', - 'Attribute information' => '', - 'Attribute values' => '', - 'Enter here all possible attribute values.' => '', - 'Delete this value' => '', - 'No value has been created yet. Click the + button to create one.' => '', - 'Sorry, attribute ID=1 was not found.' => '', - 'Enter here the value in the current edit language (English)' => '', - 'Create a new attribute value' => '', - 'Create this value' => '', - 'Delete attribute value' => '', - 'Do you really want to delete this attribute value ?' => '', - 'Enter new value position' => '', - 'Thelia Product Features' => '', - 'Thelia product features' => '', - 'Add a new product feature' => '', - 'Change this feature' => '', - 'Remove this feature from all product templates' => '', - 'Add this feature to all product templates' => '', - 'Change this product feature' => '', - 'Delete this product feature' => '', - 'No product feature has been created yet. Click the + button to create one.' => '', - 'Enter here the feature name in the default language (English)' => '', - 'Check this box if you want to add this features to all product templates' => '', - 'Create a new feature' => '', - 'Create this feature' => '', - 'Delete feature' => '', - 'Do you really want to delete this feature ? It will be removed from all product templates.' => '', - 'Do you really want to add this feature to all product templates ?' => '', - 'Do you really want to remove this feature from all product templates ? You\'ll loose all product related data for this feature.' => '', - 'Enter new feature position' => '', - 'Edit a feature' => '', - 'Features' => '', - 'Editing feature "%name"' => '', - 'Edit feature en_US : Consectetur omnis.' => '', - 'Feature information' => '', - 'Feature values' => '', - 'Enter here all possible feature values. To get a free text feature in product forms, don\'t add any value.' => '', - 'Sorry, feature ID=1 was not found.' => '', - 'Create a new feature value' => '', - 'Delete feature value' => '', - 'Do you really want to delete this feature value ?' => '', - 'Thelia Mailing Templates' => '', - 'Thelia mailing templates' => '', - 'Add a new mailing template' => '', - 'Change this mailing template' => '', - 'Delete this mailing template' => '', - 'No mailing template has been created yet. Click the + button to create one.' => '', - 'Mailing template name' => '', - 'Mailing template purpose' => '', - 'Enter here the mailing template purpose in the default language (English)' => '', - 'Create a new mailing template' => '', - 'Create this mailing template' => '', - 'Delete mailing template' => '', - 'Do you really want to delete this mailing template ?' => '', - 'Edit a mailing template' => '', - 'Editing mailing template "%name"' => '', - 'Edit mailing template order_confirmation' => '', - 'Prevent mailing template modification or deletion, except for super-admin' => '', - 'Message subject *' => '', - 'Subject' => '', - 'HTML Message' => '', - 'The mailing template in HTML format.' => '', - 'Text Message' => '', - 'The mailing template in text-only format.' => '', - 'Message created on %date_create. Last modification: %date_change' => '', - 'Sorry, message ID=1 was not found.' => '', - 'Update rates' => '', - 'Add a new currency' => '', - 'ISO 4217 Code' => '', - 'More information about ISO 4217' => '', - 'Symbol' => '', - 'Rate in €' => '', - 'Change this currency' => '', - 'Delete this currency' => '', - 'No currency has been created yet. Click the + button to create one.' => '', - 'Currency name' => '', - 'Enter here the currency name in the default language (English)' => '', - 'ISO 4217 code *' => '', - 'ISO 4217 code' => '', - 'Symbol *' => '', - 'Currency symbol' => '', - 'Rate from € *' => '', - 'Currency rate' => '', - 'Rate' => '', - 'The rate from Euro (Price in Euro * rate = Price in this currency)' => '', - 'Create a new currency' => '', - 'Create this currency' => '', - 'Delete currency' => '', - 'Do you really want to delete this currency ?' => '', - 'Enter new currency position' => '', - 'Edit a currency' => '', - 'Editing currency "%name"' => '', - 'Edit currency Euro' => '', - 'Currency ISO 4217 Code' => '', - 'The symbol, such as $, £, €...' => '', - 'Rate from Euro' => '', - 'Sorry, currency ID=1 was not found.' => '', - 'In order to manges your shop taxes you can manage' => '', - 'taxes' => '', - 'and' => '', - 'tax rules' => '', - 'Taxes define the amount of money which is add to a bought product.' => '', - 'Example :' => '', - 'French 19.6% VAT is a tax which add a 19.6% tax to the product price.' => '', - 'Ecotax is a tax wich add a defined amount (throug a product feature) to the product price.' => '', - 'Tax rules are combination of different taxes.' => '', - 'French 19.6% VAT with ecotax is the applicance of the ecotax (on the product price) then the applicance of the 19.6% tax (on the product price + the ecotax amount).' => '', - 'you can combine taxes in tax rules and chose if they are applied one after the other or at the same time : it allows to apply taxes on an already taxed price or not.' => '', - 'Taxes' => '', - 'Create a new tax' => '', - 'Change this tax' => '', - 'Delete this tax' => '', - 'Create a new tax rule' => '', - 'Change this tax rule' => '', - 'Set as default tax rule' => '', - 'Delete this tax rule' => '', - 'Type' => '', - 'amount' => '', - 'feature' => '', - 'percent' => '', - 'Delete tax' => '', - 'Do you really want to delete this tax ?' => '', - 'Delete tax rule' => '', - 'Do you really want to delete this tax rule ?' => '', - 'Edit a tax' => '', - 'Editing tax' => '', - 'Tax created on %date_create. Last modification: %date_change' => '', - 'Edit a tax rule' => '', - 'Editing tax rule' => '', - 'Tax rule created on %date_create. Last modification: %date_change' => '', - 'Manage taxes' => '', - 'Choose a country' => '', - 'Countries that have the same tax rule' => '', - 'NONE' => '', - 'Manage the tax rule taxes appliance order' => '', - 'Add tax to this group' => '', - 'Drop tax here to create a tax group' => '', - 'Drop tax here to delete from group' => '', - 'Tax rule taxes will be update for the following countries :' => '', - 'uncheck all' => '', - 'Update tax rule taxes' => '', - 'Edit tax rule taxes' => '', - 'Add a new country' => '', - 'Shop' => '', - 'N° ISO' => '', - 'ISO Code' => '', - 'Change this country' => '', - 'Delete this country' => '', - 'No country has been created yet. Click the + button to create one.' => '', - 'Country title *' => '', - 'Country title' => '', - 'Country area' => '', - 'ISO Code *' => '', - 'Alpha code 2 *' => '', - 'Alpha code 2' => '', - 'Alpha code 3 *' => '', - 'Alpha code 3' => '', - 'Create a new country' => '', - 'Create this country' => '', - 'Delete country' => '', - 'Do you really want to delete this country ?' => '', - 'Error' => '', - 'Impossible to change default country. Please contact your administrator or try later' => '', - 'Edit a country' => '', - 'Editing country "%name"' => '', - 'Edit country ' => '', - '' => '', - 'Country short description' => '', - 'Country description' => '', - 'Sorry, country ID=190 was not found.' => '', - 'Edit country Afghanistan' => '', - 'Sorry, country ID=1 was not found.' => '', - 'Thelia Shipping zones' => '', - 'Change this shipping zone' => '', - 'Edit a shipping zone' => '', - 'Editing shipping zone "%name"' => '', - 'Edit shipping zone %title' => '', - 'Add' => '', - 'Zones' => '', - 'Delete this zone' => '', - 'Remove zone' => '', - 'Do you really want to remove this zone ?' => '', - 'Thelia Shipping configuration' => '', - 'Add a new shipping configuration' => '', - 'Change this shipping configuration' => '', - 'Delete this shipping configuration' => '', - 'Shipping configuration name' => '', - 'Create a new shipping configuration' => '', - 'Create this shipping configuration' => '', - 'Delete shipping configuration' => '', - 'Do you really want to delete this shipping configuration ?' => '', - 'Edit a shipping configuration' => '', - 'Editing shipping configuration "%name"' => '', - 'Edit shipping configuration %title' => '', - 'Add this country' => '', - 'No area defined with this id' => '', - 'Remove country' => '', - 'Do you really want to remove this country ?' => '', - 'Classic modules' => '', - 'classic modules' => '', - 'Enable/Disable' => '', - 'Deactivate %title module' => '', - 'deactivation' => '', - 'Edit this module' => '', - 'Delete this module' => '', - 'Delivery modules' => '', - 'Payment modules' => '', - 'Delete a module' => '', - 'Do you really want to delete this module ?' => '', - 'Edit a system variable' => '', - 'Editing variable "%name"' => '', - 'Edit variable active-template' => '', - 'Prevent variable modification or deletion, except for super-admin' => '', - 'Variable created on %date_create. Last modification: %date_change' => '', - 'Sorry, variable ID=3 was not found.' => '', - 'Profiles' => '', - 'Create a new profile' => '', - 'Profile Code' => '', - 'Profile code' => '', - 'Postscriptum' => '', - 'Delete profile' => '', - 'Do you really want to delete this profile ?' => '', - 'You can\'t delete this profile' => '', - 'They are some administrator which are linked to this profile. Please edit/remove them before deleting this profile.' => '', - 'Create a new administrator' => '', - 'Login' => '', - 'FirstName' => '', - 'LastName' => '', - 'Profile' => '', - 'Superadministrator' => '', - 'Change this administrator' => '', - 'Password' => '', - 'Password confirmation' => '', - 'Leave empty to keep current password' => '', - 'Update a new administrator' => '', - 'Delete administrator' => '', - 'Do you really want to delete this administrator ?' => '', - 'You can\'t delete this administrator' => '', - 'They are some administrator which are linked to this administrator. Please edit/remove them before deleting this administrator.' => '', - 'Thelia Languages' => '', - 'Languages' => '', - 'Languages management' => '', - 'Add a new language' => '', - 'Language name' => '', - 'ISO 639 Code' => '', - 'Locale' => '', - 'date form' => '', - 'time form' => '', - 'Change this language' => '', - 'Delete this language' => '', - 'Parameters' => '', - 'If a translation is missing or incomplete :' => '', - 'Using a domain or subdomain for each language' => '', - 'activate' => '', - 'Language title' => '', - 'language locale' => '', - 'en_US' => '', - 'date format' => '', - 'd-m-Y' => '', - 'time format' => '', - 'H:i:s' => '', - 'Create a new language' => '', - 'Create this language' => '', - 'Delete language' => '', - 'Do you really want to delete this language ?' => '', - 'Impossible to change default languages. Please contact your administrator or try later' => '', - 'Edit a language' => '', - 'Edit this language' => '', - 'deactivate' => '', - 'Thelia Mailing System' => '', - 'Configuration mailing system' => '', - 'Enable remote SMTP use : ' => '', - 'Host :' => '', - 'Host' => '', - 'Port :' => '', - 'Port' => '', - 'Encryption :' => '', - 'Encryption' => '', - 'Username :' => '', - 'Username' => '', - 'Password :' => '', - 'Auth Mode :' => '', - 'Auth Mode' => '', - 'Timeout :' => '', - 'Timeout' => '', - 'Source IP :' => '', - 'Source IP' => '', - 'Show logs' => '', - 'Period' => '', - 'From' => '', - 'To' => '', - 'Resources' => '', - 'company' => '', + 'Lire la suite' => 'Lire la suite', + 'Back-office home' => 'Accueil administration', + 'Thelia Back Office' => 'Thelia Back Office', + 'Version %ver' => 'Version %ver', + 'View site' => 'Voir le site', + 'View shop' => 'Voir la boutique', + 'Profil' => 'Profile', + 'Close administation session' => 'Quitter l\'interface d\'administration', + 'Logout' => 'Se déconnecter', + 'Home' => 'Accueil', + 'Customers' => 'Clients', + 'Orders' => 'Commandes', + 'All orders' => 'Toutes les commandes', + 'Catalog' => 'Catalogue', + 'Folders' => 'Dossier', + 'Coupons' => 'Codes Promo', + 'Configuration' => 'Configuration', + 'Modules' => 'Modules', + 'Search' => 'Recherche', + 'Thelia, solution e-commerce libre' => 'Thelia, solution e-commerce libre', + 'Dashboard' => 'Tableau de bord', + 'Sales' => 'Ventes', + 'New customers' => 'Nouveaux clients', + 'First orders' => 'Premières commandes', + 'Aborted orders' => 'Paniers abandonnés', + 'Shop Informations' => 'Informations sur le magasin', // pas très beau + 'Categories' => 'Catégories', + 'Products' => 'Produits', + 'Online products' => 'Produits en ligne', + 'Offline products' => 'Produits hors ligne', + 'Pending orders' => 'Commandes en attente', + 'In process orderst' => 'Commandes en traitement', // In process orderst ATTENTION FAUTE enlever le t à ordres + 'Shipped orders' => 'Commandes envoyées', + 'Canceled orders' => 'Commandes annulées', + 'Sales statistics' => 'Statistiques de vente', + 'Today' => 'Aujourd\'hui', + 'This month' => 'Ce mois', + 'This year' => 'Cette année', + 'Overall sales' => 'Total des ventes', + 'Sales excluding shipping' => 'Ventes hors frais de port', // ou Chiffre d'affaires non? + 'Yesterday sales' => 'Ventes de la veille', + 'Waiting orders' => 'Commandes en attente', + 'In process orders' => 'Commandes en traitement', + 'Average cart' => 'Panier moyen', + 'Previous month sales' => 'Ventes du mois précédent', + 'Previous year sales' => 'Ventes de l\année précédente', + 'Thelia informations' => 'Informations Thelia', + 'Current version' => 'Version en cours', + 'Latest version available' => 'Dernière version disponible', + 'News' => 'Actualités', + 'Click here' => 'Cliquez ici', + '© Thelia 2013' => '© Thelia 2013', + 'Édité par OpenStudio' => 'Édité par OpenStudio', + 'Forum Thelia' => 'Forum Thelia', + 'Contributions Thelia' => 'Contributions Thelia', + 'Customer' => 'Client', // vraiment au singulier ? + 'Customers list' => 'Liste des clients', + 'Add a new Customer' => 'Ajouter un client', + 'customer ref' => 'ref client', + 'firstname & lastname' => 'Prénom & nom', + 'last order' => 'Dernière commande', + 'order amount' => 'Montant de la commande', + 'Actions' => 'Actions', + 'Edit this customer' => 'Modifier ce client', + 'Send a mail to this customer' => 'Contacter ce client par mail', + 'Delete this customer and all his orders' => 'Supprimer ce client et toutes ses commandes', + 'Company Name' => 'Entreprise', + 'Company' => 'Entreprise', + 'Title' => 'Civilité', + 'First Name' => 'Prénom', + 'Firstname' => 'Prénom', + 'Last Name' => 'Nom', + 'Lastname' => 'Nom', + 'Street Address' => 'Rue', + 'Address' => 'Adresse', + 'Address Line 2' => 'Adresse suite', + 'Additional address' => 'Adresse complémentaire', + 'Address Line 3' => 'Adresse suite', + 'Zip code' => 'Code posta', + 'City' => 'Ville', + 'Country' => 'Pays', + 'Email Address' => 'Adresse e-mail', + 'Email address' => 'Adresse e-mail', + 'Create a new customer' => 'Ajouter un client', + 'Create this customer' => 'Ajouter ce client', + 'Cancel' => 'Annuler', + 'OK' => 'OK', + 'Delete customer' => 'Supprimer ce client', + 'Do you really want to delete this customer ?' => 'Voulez-vous supprimer ce client ? ', + 'No' => 'No', + 'Yes' => 'Yes', + 'Thelia configuration' => 'Configuration thelia', + 'Product catalog configuration' => 'Configuration du catalogue produit', + 'Product templates' => 'Template produit', + 'Product attributes' => 'Attributs produit', + 'Product features' => 'Caractéristiques produit', + 'Mailing templates' => 'Template e-mail', + 'Currencies' => 'Monnaie', + 'Taxes rules' => 'Règles de taxes', + 'Shipping configuration' => 'Configuration du transport', + 'Countries' => 'Pays', + 'Shipping zones' => 'Zones de livraison', + 'System parameters' => 'Paramètres système ', + 'Modules activation' => 'Activation du modules', + 'System variables' => 'Gestion des variables', // ? + 'Administration profiles' => 'Gestion des administrateurs', // + 'Administrators' => 'Administrateurs', + 'Languages & URLs' => 'Langues et URLs', + 'Mailing system' => 'Envoi des e-mails', + 'Administration logs' => 'Gestion des logs', + 'System logs' => 'Journal des logs', + 'Thelia System Variables' => 'Variables Thelia',// pas sure du tout + 'Thelia system variables' => 'Variables Thelia', + 'Add a new variable' => 'Ajouter une variable', + 'Save chages' => 'Enregistrer les modifications', // attention faute sur Changes + 'Save changes' => 'Enregistrer les modifications', + 'Purpose' => 'Objet', // ? + 'Name' => 'Nom', + 'Value' => 'Valeur', + 'Action' => 'Action', + 'Change this variable' => 'Modifier cette variable', + 'Cancel changes and revert to original value' => 'Annuler les modifications et revenir à la version antérieure', + 'Delete this variable' => 'Supprimer cette variable', + 'Name *' => 'Nom *', + 'Variable name' => 'Nom de la variable', + 'Value *' => 'Valeur *', + 'Variable value' => 'Valeur de la variable', + 'Purpose *' => 'Objet *', + 'Variable purpose' => 'Objet de la variable', + 'English' => 'Anglais', + 'Enter here the category name in the default language (%title)' => 'Entrer ici le nom de la catégorie dans la langue par défaut (%title)', + 'Create a new variable' => 'Créer une nouvelle variable', + 'Create this variable' => 'Ajouter cette variable', + 'Delete a variable' => 'Supprimer une variable', + 'Do you really want to delete this variable ?' => 'Voulez-vous vraiment supprimer cette variable ?', + 'Coupon' => 'Code promo', + 'Browse' => 'Parcourir', + 'Coupons : ' => 'Codes promo', + 'List' => 'Liste', + 'Create a new coupon' => 'Créer un nouveau code promo', + 'Enabled coupons' => 'Codes promo disponibles', + 'Code' => 'Code', + 'Days before expiration' => 'Jours de validité', + 'Usage left' => 'Utilisation restante', // ??? + 'Edit' => 'Editer', + 'Unlimited' => 'Illimité', + 'Disabled coupons' => 'Codes désactivés', + 'Expiration date' => 'Date de fin', + 'Update coupon' => 'Mettre à jour le code', + 'Update' => 'Mettre à jour', + 'Code :' => 'Code', + 'code' => 'code', + 'Title :' => 'Titre', + 'title' => 'titre', + 'Is enabled' => 'Est valide', + 'Is available on special offers' => 'Est valide sur les offres promotionnelles', + 'Is cumulative' => 'Est cumulable', + 'Is removing postage' => 'Offre les frais de port', + 'Expiration date :' => 'Date de fin de validité', + 'yyyy-mm-dd' => 'jjjj--mm--aa', + 'Is unlimited' => 'Est illimité', + 'Max usage :' => 'Utilisations max', + 'max usage' => 'utilisations max', + 'Type :' => 'Type', + 'Please select a coupon type' => 'Merci d\'entrer le type de code', + 'Amount :' => 'Montant', + '14.50' => '14.50', + 'Short description :' => 'Description courte', + 'short description' => 'description court', + 'Long description :' => 'Description longue', + 'long description' => 'description longue', + 'Save your modifications' => 'Enregistrer les modifications', + 'Conditions' => 'Conditions', + 'Delete' => 'Supprimer', + 'And' => 'Et', + 'Save this condition' => 'Enregistrer cette condition', + 'Condition\'s category :' => 'Type de condition', + 'Please select a condition category' => 'Merci d\'entrer le type de condition', + 'Files manager' => '',//??? + 'Please retry' => 'Merci de réessayer', + 'Please select another condition' => 'Merci de sélectionner une autre condition', + 'Edit a customer' => 'Editer un client', + 'Editing customer "%name"' => 'Edition du client "%name"', + 'Edit customer thelia thelia' => '', // normal que ce soit en dur ça?? + 'Save' => ' Enregistrer', + 'Save and close' => 'Enregistrer et fermer', + 'Customer informations' => 'Informations client', + 'Default address' => 'Adresse par défaut', + 'Other addresses' => 'Autres adresses', + 'Add a new address' => 'Ajouter une nouvelle adresse', + 'Phone' => 'Téléphone', + 'cell phone' => 'Tel portable', + 'Edit this address' => 'Modifier cette adresse', + 'Use this address by default' => 'Utiliser comme adresse par défaut', + 'orders for this customer' => 'commandes pour ce client', + 'Order n°' => 'Commande n° ', + 'Date & Hour' => 'Date et heure', + 'Amount' => 'Montant', + 'Status' => 'Statut', + 'Sorry, customer ID=1 was not found.' => 'Désolée, le client ID=1 n\'a pas été trouvé.',// normal le ID=1 ? + 'Address label' => 'libellé de l\'adresse', + 'Label' => 'Libellé', + 'Create an address' => 'Créer une adresse', + 'Create this address' => 'Créer cette adresse', + 'Use address by default' => 'Utiliser comme adresse par défaut', + 'Do you really want to use this address by default ?' => 'Voulez-vous vraiment utiliser cette adresse comme adresse par défaut ?', + 'Delete address' => 'Supprimer l\'adresse', + 'Do you really want to delete this address ?' => 'Voulez-vous vraiment supprimer cette adresse ? ', + 'Edit an address' => 'Editer une adresse', + 'Edit this order' => 'Editer cette commande ', + 'Cancel this order' => 'Annuler cette commande', + 'Delete an order' => 'Supprimer une commande', + 'Do you really want to cancel this order ?' => 'Voulez-vous vraiment sup primer cette commande ? ', + 'Edit an order' => 'Editer une commande', + 'Ordered products' => 'Produits commandés', + 'Invoice and Delivery' => 'Livraison et facturation', + 'Cart' => 'Panier', + 'Product' => 'Produit', + 'Unit. price' => 'Prix unitaire', + 'Tax' => 'Taxes', + 'Unit taxed price' => 'Prix unitaire TTC', // ? + 'Quantity' => 'Quantité', + 'Taxed total' => 'Montant total des taxes', + 'Total without discount' => 'Montant total hors remises', + 'Discount' => 'Remise', + 'Coupon code' => 'Code promo', + 'Total including discount' => 'Total avec remise', + 'Postage' => 'Frais de livraison', + 'Total' => 'Total', + 'Payment information' => 'Informations de paiement', + 'Payment module' => 'Module de paiement', + 'Transaction reference' => 'Référence de la transaction', + 'Delivery module' => 'Module de livraison', + 'tracking reference' => 'Reference Tracking', + 'Description' => 'Description', + 'Invoice informations' => 'Informations de facturation', + 'Download invoice as PDF' => 'Télécharger la facture au format PDF', + 'PDF | Invoice' => 'Facure PDF', + 'Edit invoice address' => 'Editer l\'adresse de facturation', + 'Invoice reference' => 'Facture ref',// + 'Invoice date' => 'Facture date',// + 'Street address' => 'Adresse', + 'Delivery address' => 'Adresse de livraison', + 'Download purchase order as PDF' => 'Télécharger le bon de commande au format PDF', + 'PDF | Purchase order' => 'Bon de commande PDF', + 'Edit delivery address' => 'Editer l\'adresse de livraison', + 'Compagny' => 'Entreprise', // faute + 'Edit order address' => 'Editer l\'adresse de commande ', // ? + 'Confirm changes' => 'Valider les modifications', + 'Top level categories' => 'Catégories de niveau 1 ', + 'Add a new category' => 'Ajouter une catégorie', + 'ID' => 'ID', + 'Category title' => 'Titre de la catégorie', + 'Online' => 'En ligne', + 'Position' => 'Position', + 'Browse this category' => 'Parcourir cette catégorie', + 'Edit this category' => 'Editer cette catégorie', + 'Delete this category and all its contents' => 'Supprimer cette catégorie et tout ce qu\'elle contient ? ', + 'This category has no sub-categories. To create a new one, click the + button above.' => 'Cette catégorie n\'a pas de sous-catégorie. Pour en créer une nouvelle, cliquez sur le bouton + ci-dessus.', + 'This category has no sub-categories.' => 'Cette catégorie n\'a pas de sous-catégorie.', + 'Top level Products' => 'Produits mis en avant',// ? + 'Add a new product' => 'Ajouter un nouveau produit', + 'Reference' => 'Reference', + 'Product title' => 'Titre du produit', + 'This category doesn\'t contains any products. To add a new product, click the + button above.' => 'Cette catégorie n\'a aucun produit. Pour créer un nouveau product, cliques sur le bouton + ci-dessus. ', // attention faute : doesn't contain pas contains + 'Create a new category' => 'Créer une catégorie', + 'Create this category' => 'Créer cette catégorie', + 'Enter here the product reference' => 'Entrez ici la nouvelle référence produit', + 'Enter here the product name in the default language (%title)' => 'Entrez ici le nom du produit dans la langue par défaut (%title)', + 'Product price' => 'Prix du produit', + 'Enter here the product price in the default currency (%title)' => 'ntrez ici le prix du produit dans la langue par défaut (%title)', + 'Select a tax tule' => 'Sélectionnez une règle de taxes', + 'Select here the tax applicable to this product' => 'Sélectionnez ici la taxe applicable sur ce produit', + 'Product weight' => 'Poids du produit', + 'Kg' => 'Kg', + 'Enter here the product weight, in Kilogrammes' => 'Entrez ici le poids du produit, en Kilogrammes', + 'Create a new product' => 'Créer un nouveau produit', + 'Create this product' => 'Créer ce produit', + 'Delete category' => 'Supprimer cette catégorie', + 'Do you really want to delete this category and all its content ?' => 'Voulez-vous vraiment supprimer cette catégorie et tout ce qu\'elle contient ?', + 'Delete product' => 'Supprimer ce produit', + 'Do you really want to delete this product ?' => 'Voulez-vous vraiment supprimer ce produit ?', + 'Enter new category position' => 'Classement de la catégorie ', // ? + 'Enter new product position' => 'Classement du produit', + 'Edit category' => 'Editer la catégorie', + 'Editing %cat' => 'Edition de %cat', + 'Edit category %title' => 'Editer le titre de la catégorie : %title', + 'Preview category page' => '', + 'Edit next category' => '', + 'General description' => '', + 'Associations' => '', + 'Images' => '', + 'Documents' => '', + 'Edit information in %lng' => '', + 'Français' => '', + 'castellano' => '', + 'Italiano' => '', + 'Close' => '', + 'Category title *' => '', + 'Summary' => '', + 'A short description, used when a summary or an introduction is required' => '', + 'Short description' => '', + 'Detailed description' => '', + 'The detailed description.' => '', + 'Conclusion' => '', + 'A short post-description information' => '', + 'Short conclusion' => '', + 'Rewriten URL *' => '', + 'Rewritten URL' => '', + 'Rewriten URL' => '', + 'Parent category *' => '', + 'Top level' => '', + 'Visibility' => '', + 'Category created on %date_create. Last modification: %date_change' => '', + 'Related content' => '', + 'You can attach here some content to this category' => '', + 'Select a folder...' => '', + 'Select a folder to get its content' => '', + 'Select a folder content...' => '', + 'Select a content and click (+) to add it to this category' => '', + 'No available content in this folder' => '', + 'No folders found' => '', + 'Content title' => '', + 'This category contains no contents' => '', + 'Send files' => '', + 'Drop files to upload' => '', + 'Browse files' => '', + 'Update this image' => '', + 'There is no images attached to this %type.' => '', + 'Can\'t load images, please refresh this page.' => '', + 'There is no documents attached to this %type.' => '', + 'Can\'t load documents, please refresh this page.' => '', + 'Remove related content' => '', + 'Do you really want to remove this related content ?' => '', + '(edit)' => '', + 'Categories in %cat' => '', + 'Products in %cat' => '', + 'Edit this product' => '', + 'Delete this product' => '', + 'Edit product' => '', + 'Editing %title' => '', + 'Edit product %title' => '', + 'Preview product page' => '', + 'General' => '', + 'Details' => '', + 'Attributes & Features' => '', + 'Product reference' => '', + 'Product title *' => '', + 'Default product category *' => '', + 'You can attach this product to more categories in the details tab.' => '', + 'Product created on %date_create. Last modification: %date_change' => '', + 'Edit prices in %curr' => '', + 'Attribute Combinations' => '', + 'Quickly create combinations using the combination builder' => '', + 'Combination builder' => '', + 'Add a new combination' => '', + 'EAN Code' => '', + 'Price
w/o taxes (%currency)' => '', + 'Price
w/ taxes (%currency)' => '', + 'Weight
(Kg)' => '', + 'Default' => '', + 'Sale' => '', + 'New' => '', + 'Sale price
w/o taxes (%currency)' => '', + 'Sale price
w/ taxes (%currency)' => '', + 'Delete this combination' => '', + 'Attribute' => '', + 'Select an attribute...' => '', + 'Select an attribute and click (+) to view available values' => '', + 'Select an attribute value...' => '', + 'Select a value click (+) to add it to the combination' => '', + 'No available value for this attribute' => '', + 'To remove a value from the combination, select it and click "remove"' => '', + 'Remove selected values' => '', + 'Create a new combination' => '', + 'Create this combination' => '', + 'Delete a combination' => '', + 'Do you really want to delete this combination ?' => '', + 'Select attribute values to combine. You may enter a default value for some of the fields of the generated combinations.' => '', + 'Price excl. taxes' => '', + 'Combination reference' => '', + 'Combination EAN Code' => '', + 'Current quantity' => '', + '0 combinations' => '', + 'Create combinations' => '', + 'Please wait, loading' => '', + 'Failed to get converted prices. Please try again.' => '', + 'Failed to get prices. Please try again.' => '', + 'Existing combinations will be deleted. Do you want to continue ?' => '', + 'To use features or attributes on this product, please select a product template. You can define product templates in the configuration section of the administration.' => '', + 'Current product template' => '', + 'Do not use a product template' => '', + 'Apply' => '', + 'Product Attributes' => '', + 'You can change template attributes and their positions in the template configuration page.' => '', + 'Attribute Name' => '', + 'This product template does not contains any features' => '', + 'Product Features' => '', + 'You can change templates features and their positions in the template configuration page.' => '', + 'Feature Name' => '', + 'Feature value for this product' => '', + 'Use Ctrl+click to select more than one value. You can also clear selected values.' => '', + 'Enter here the feature value as free text' => '', + 'Feature value' => '', + 'Top level folders' => '', + 'Add a new folder' => '', + 'Folder title' => '', + 'Browse this folder' => '', + 'Edit this folder' => '', + 'Delete this folder and all its contents' => '', + 'This folder has no sub-folders. To create a new one, click the + button above.' => '', + 'This folder has no sub-folders.' => '', + 'Top level Contents' => '', + 'Add a new content' => '', + 'This folder doesn\'t contains any contents. To add a new content, click the + button above.' => '', + 'Enter here the folder name in the default language (%title)' => '', + 'Create a new folder' => '', + 'Create this folder' => '', + 'Enter here the content name in the default language (%title)' => '', + 'Create a new content' => '', + 'Create this content' => '', + 'Delete folder' => '', + 'Do you really want to delete this folder and all its content ?' => '', + 'Delete content' => '', + 'Do you really want to delete this content ?' => '', + 'Enter new folder position' => '', + 'Enter new content position' => '', + 'An error occured' => '', + 'Oops! An Error Occurred' => '', + 'Go to administration home' => '', + 'Folders in %fold' => '', + 'Contents in %fold' => '', + 'Edit this content' => '', + 'Delete this content' => '', + 'Edit content' => '', + 'Edit content %title' => '', + 'Preview folder page' => '', + 'Content title *' => '', + 'Default folder *' => '', + 'Folder created on %date_create. Last modification: %date_change' => '', + 'Additional Folders' => '', + 'A content could be attached to more than one folder. Select here the additional fodlers for this content.' => '', + 'You can change the default folder (%title) in the "General" tab.' => '', + ' (default)' => '', + 'Select a folder and click (+) to add it to the additional folder list' => '', + 'No Folders found' => '', + 'This product doesn\'t belong to any additional folder.' => '', + 'Remove associated folder' => '', + 'Do you really want to remove the content from this folder ?' => '', + 'Remove the product from this category' => '', + 'Coupon : ' => '', + 'days left' => '', + 'May be cumulative' => '', + 'Won\'t remove postage' => '', + 'Will be available on special offers' => '', + 'Application field' => '', + 'Do you really want to enable this element ?' => '', + 'Confirmation' => '', + 'Confirm' => '', + 'Create coupon' => '', + 'Create' => '', + 'Please save your Coupon in oder to affect it some conditions' => '', + 'Do you really want to delete this element ?' => '', + 'Thelia Product Templates' => '', + 'Thelia product templates' => '', + 'Add a new product template' => '', + 'Change this template' => '', + 'Change this product template' => '', + 'Delete this product template' => '', + 'No product template has been created yet. Click the + button to create one.' => '', + 'Template Name *' => '', + 'Template title' => '', + 'Enter here the template name in the default language (English)' => '', + 'Create a new product template' => '', + 'Create this product template' => '', + 'Delete template' => '', + 'Do you really want to delete this template ? It will be removed from all products.' => '', + 'Select an feature...' => '', + 'Select an feature and click (+) to add it to this template' => '', + 'Feature title' => '', + 'Delete this feature' => '', + 'This template contains no features' => '', + 'Remove feature' => '', + 'Do you really want to remove this feature from the template ?' => '', + 'Thelia Product Attributes' => '', + 'Thelia product attributes' => '', + 'Add a new product attribute' => '', + 'Change this attribute' => '', + 'Remove this attribute from all product templates' => '', + 'Add this attribute to all product templates' => '', + 'Change this product attribute' => '', + 'Delete this product attribute' => '', + 'No product attribute has been created yet. Click the + button to create one.' => '', + 'Title *' => '', + 'Attribute title' => '', + 'Enter here the attribute name in the default language (English)' => '', + 'Check this box if you want to add this attributes to all product templates' => '', + 'Create a new attribute' => '', + 'Create this attribute' => '', + 'Delete attribute' => '', + 'Do you really want to delete this attribute ? It will be removed from all product templates.' => '', + 'Add to all product templates' => '', + 'Do you really want to add this attribute to all product templates ?' => '', + 'Remove from all product templates' => '', + 'Do you really want to remove this attribute from all product templates ? You\'ll loose all product related data for this attribute.' => '', + 'Enter new attribute position' => '', + 'Edit an attribute' => '', + 'Attributes' => '', + 'Editing attribute "%name"' => '', + 'Edit attribute en_US : Officiis cumque.' => '', + 'Attribute information' => '', + 'Attribute values' => '', + 'Enter here all possible attribute values.' => '', + 'Delete this value' => '', + 'No value has been created yet. Click the + button to create one.' => '', + 'Sorry, attribute ID=1 was not found.' => '', + 'Enter here the value in the current edit language (English)' => '', + 'Create a new attribute value' => '', + 'Create this value' => '', + 'Delete attribute value' => '', + 'Do you really want to delete this attribute value ?' => '', + 'Enter new value position' => '', + 'Thelia Product Features' => '', + 'Thelia product features' => '', + 'Add a new product feature' => '', + 'Change this feature' => '', + 'Remove this feature from all product templates' => '', + 'Add this feature to all product templates' => '', + 'Change this product feature' => '', + 'Delete this product feature' => '', + 'No product feature has been created yet. Click the + button to create one.' => '', + 'Enter here the feature name in the default language (English)' => '', + 'Check this box if you want to add this features to all product templates' => '', + 'Create a new feature' => '', + 'Create this feature' => '', + 'Delete feature' => '', + 'Do you really want to delete this feature ? It will be removed from all product templates.' => '', + 'Do you really want to add this feature to all product templates ?' => '', + 'Do you really want to remove this feature from all product templates ? You\'ll loose all product related data for this feature.' => '', + 'Enter new feature position' => '', + 'Edit a feature' => '', + 'Features' => '', + 'Editing feature "%name"' => '', + 'Edit feature en_US : Consectetur omnis.' => '', + 'Feature information' => '', + 'Feature values' => '', + 'Enter here all possible feature values. To get a free text feature in product forms, don\'t add any value.' => '', + 'Sorry, feature ID=1 was not found.' => '', + 'Create a new feature value' => '', + 'Delete feature value' => '', + 'Do you really want to delete this feature value ?' => '', + 'Thelia Mailing Templates' => '', + 'Thelia mailing templates' => '', + 'Add a new mailing template' => '', + 'Change this mailing template' => '', + 'Delete this mailing template' => '', + 'No mailing template has been created yet. Click the + button to create one.' => '', + 'Mailing template name' => '', + 'Mailing template purpose' => '', + 'Enter here the mailing template purpose in the default language (English)' => '', + 'Create a new mailing template' => '', + 'Create this mailing template' => '', + 'Delete mailing template' => '', + 'Do you really want to delete this mailing template ?' => '', + 'Edit a mailing template' => '', + 'Editing mailing template "%name"' => '', + 'Edit mailing template order_confirmation' => '', + 'Prevent mailing template modification or deletion, except for super-admin' => '', + 'Message subject *' => '', + 'Subject' => '', + 'HTML Message' => '', + 'The mailing template in HTML format.' => '', + 'Text Message' => '', + 'The mailing template in text-only format.' => '', + 'Message created on %date_create. Last modification: %date_change' => '', + 'Sorry, message ID=1 was not found.' => '', + 'Update rates' => '', + 'Add a new currency' => '', + 'ISO 4217 Code' => '', + 'More information about ISO 4217' => '', + 'Symbol' => '', + 'Rate in €' => '', + 'Change this currency' => '', + 'Delete this currency' => '', + 'No currency has been created yet. Click the + button to create one.' => '', + 'Currency name' => '', + 'Enter here the currency name in the default language (English)' => '', + 'ISO 4217 code *' => '', + 'ISO 4217 code' => '', + 'Symbol *' => '', + 'Currency symbol' => '', + 'Rate from € *' => '', + 'Currency rate' => '', + 'Rate' => '', + 'The rate from Euro (Price in Euro * rate = Price in this currency)' => '', + 'Create a new currency' => '', + 'Create this currency' => '', + 'Delete currency' => '', + 'Do you really want to delete this currency ?' => '', + 'Enter new currency position' => '', + 'Edit a currency' => '', + 'Editing currency "%name"' => '', + 'Edit currency Euro' => '', + 'Currency ISO 4217 Code' => '', + 'The symbol, such as $, £, €...' => '', + 'Rate from Euro' => '', + 'Sorry, currency ID=1 was not found.' => '', + 'In order to manges your shop taxes you can manage' => '', + 'taxes' => '', + 'and' => '', + 'tax rules' => '', + 'Taxes define the amount of money which is add to a bought product.' => '', + 'Example :' => '', + 'French 19.6% VAT is a tax which add a 19.6% tax to the product price.' => '', + 'Ecotax is a tax wich add a defined amount (throug a product feature) to the product price.' => '', + 'Tax rules are combination of different taxes.' => '', + 'French 19.6% VAT with ecotax is the applicance of the ecotax (on the product price) then the applicance of the 19.6% tax (on the product price + the ecotax amount).' => '', + 'you can combine taxes in tax rules and chose if they are applied one after the other or at the same time : it allows to apply taxes on an already taxed price or not.' => '', + 'Taxes' => '', + 'Create a new tax' => '', + 'Change this tax' => '', + 'Delete this tax' => '', + 'Create a new tax rule' => '', + 'Change this tax rule' => '', + 'Set as default tax rule' => '', + 'Delete this tax rule' => '', + 'Type' => '', + 'amount' => '', + 'feature' => '', + 'percent' => '', + 'Delete tax' => '', + 'Do you really want to delete this tax ?' => '', + 'Delete tax rule' => '', + 'Do you really want to delete this tax rule ?' => '', + 'Edit a tax' => '', + 'Editing tax' => '', + 'Tax created on %date_create. Last modification: %date_change' => '', + 'Edit a tax rule' => '', + 'Editing tax rule' => '', + 'Tax rule created on %date_create. Last modification: %date_change' => '', + 'Manage taxes' => '', + 'Choose a country' => '', + 'Countries that have the same tax rule' => '', + 'NONE' => '', + 'Manage the tax rule taxes appliance order' => '', + 'Add tax to this group' => '', + 'Drop tax here to create a tax group' => '', + 'Drop tax here to delete from group' => '', + 'Tax rule taxes will be update for the following countries :' => '', + 'uncheck all' => '', + 'Update tax rule taxes' => '', + 'Edit tax rule taxes' => '', + 'Add a new country' => '', + 'Shop' => '', + 'N° ISO' => '', + 'ISO Code' => '', + 'Change this country' => '', + 'Delete this country' => '', + 'No country has been created yet. Click the + button to create one.' => '', + 'Country title *' => '', + 'Country title' => '', + 'Country area' => '', + 'ISO Code *' => '', + 'Alpha code 2 *' => '', + 'Alpha code 2' => '', + 'Alpha code 3 *' => '', + 'Alpha code 3' => '', + 'Create a new country' => '', + 'Create this country' => '', + 'Delete country' => '', + 'Do you really want to delete this country ?' => '', + 'Error' => '', + 'Impossible to change default country. Please contact your administrator or try later' => '', + 'Edit a country' => '', + 'Editing country "%name"' => '', + 'Edit country ' => '', + '' => '',//? + 'Country short description' => '', + 'Country description' => '', + 'Sorry, country ID=190 was not found.' => '', + 'Edit country Afghanistan' => '', + 'Sorry, country ID=1 was not found.' => '', + 'Thelia Shipping zones' => '', + 'Change this shipping zone' => '', + 'Edit a shipping zone' => '', + 'Editing shipping zone "%name"' => '', + 'Edit shipping zone %title' => '', + 'Add' => 'Ajouter', + 'Zones' => '', + 'Delete this zone' => '', + 'Remove zone' => '', + 'Do you really want to remove this zone ?' => '', + 'Thelia Shipping configuration' => '', + 'Add a new shipping configuration' => '', + 'Change this shipping configuration' => '', + 'Delete this shipping configuration' => '', + 'Shipping configuration name' => '', + 'Create a new shipping configuration' => '', + 'Create this shipping configuration' => '', + 'Delete shipping configuration' => '', + 'Do you really want to delete this shipping configuration ?' => '', + 'Edit a shipping configuration' => '', + 'Editing shipping configuration "%name"' => '', + 'Edit shipping configuration %title' => '', + 'Add this country' => '', + 'No area defined with this id' => '', + 'Remove country' => '', + 'Do you really want to remove this country ?' => '', + 'Classic modules' => '', + 'classic modules' => '', + 'Enable/Disable' => '', + 'Deactivate %title module' => '', + 'deactivation' => '', + 'Edit this module' => '', + 'Delete this module' => '', + 'Delivery modules' => '', + 'Payment modules' => '', + 'Delete a module' => '', + 'Do you really want to delete this module ?' => '', + 'Edit a system variable' => '', + 'Editing variable "%name"' => '', + 'Edit variable active-template' => '', + 'Prevent variable modification or deletion, except for super-admin' => '', + 'Variable created on %date_create. Last modification: %date_change' => '', + 'Sorry, variable ID=3 was not found.' => '', + 'Profiles' => '', + 'Create a new profile' => '', + 'Profile Code' => '', + 'Profile code' => '', + 'Postscriptum' => '', + 'Delete profile' => '', + 'Do you really want to delete this profile ?' => '', + 'You can\'t delete this profile' => '', + 'They are some administrator which are linked to this profile. Please edit/remove them before deleting this profile.' => '', + 'Create a new administrator' => '', + 'Login' => '', + 'FirstName' => 'Prénom', + 'LastName' => 'Nom', + 'Profile' => 'Profile', + 'Superadministrator' => '', + 'Change this administrator' => '', + 'Password' => '', + 'Password confirmation' => '', + 'Leave empty to keep current password' => '', + 'Update a new administrator' => '', + 'Delete administrator' => '', + 'Do you really want to delete this administrator ?' => '', + 'You can\'t delete this administrator' => '', + 'They are some administrator which are linked to this administrator. Please edit/remove them before deleting this administrator.' => '', + 'Thelia Languages' => '', + 'Languages' => '', + 'Languages management' => '', + 'Add a new language' => '', + 'Language name' => '', + 'ISO 639 Code' => '', + 'Locale' => '', + 'date form' => '', + 'time form' => '', + 'Change this language' => '', + 'Delete this language' => '', + 'Parameters' => '', + 'If a translation is missing or incomplete :' => '', + 'Using a domain or subdomain for each language' => '', + 'activate' => '', + 'Language title' => '', + 'language locale' => '', + 'en_US' => 'en_US', + 'date format' => '', + 'd-m-Y' => 'j-m-A', + 'time format' => '', + 'H:i:s' => '',//? + 'Create a new language' => '', + 'Create this language' => '', + 'Delete language' => '', + 'Do you really want to delete this language ?' => '', + 'Impossible to change default languages. Please contact your administrator or try later' => '', + 'Edit a language' => '', + 'Edit this language' => '', + 'deactivate' => 'désactiver', + 'Thelia Mailing System' => '', + 'Configuration mailing system' => '', + 'Enable remote SMTP use : ' => '', + 'Host :' => 'Host', + 'Host' => 'Host', + 'Port :' => 'Port', + 'Port' => 'Port', + 'Encryption :' => '', //? + 'Encryption' => '', + 'Username :' => 'Nom d\'utilisateur', + 'Username' => 'Nom d\'utilisateur', + 'Password :' => 'Mot de passe', + 'Auth Mode :' => '', + // 'Auth Mode' => 'Mode auteur', + // 'Timeout :' => 'Délai', +// 'Timeout' => 'Délai', + 'Source IP :' => 'IP source', + 'Source IP' => 'IP source', + 'Show logs' => 'Voir les loge', + 'Period' => 'Période', + 'From' => 'De', + 'To' => 'A', + 'Resources' => 'Ressources', + 'company' => 'entreprise', ) ; \ No newline at end of file diff --git a/templates/admin/default/translations.html b/templates/admin/default/translations.html index 946e68cdb..e973724fb 100644 --- a/templates/admin/default/translations.html +++ b/templates/admin/default/translations.html @@ -179,7 +179,7 @@
- +
diff --git a/templates/default/404.html b/templates/default/404.html index b4ee90792..f7b47381e 100644 --- a/templates/default/404.html +++ b/templates/default/404.html @@ -12,31 +12,11 @@ {block name="main-content"}
-
- -

+
+

404 {intl l="The page cannot be found"}

- - - - {ifloop rel="product_upsell"} - - {/ifloop} - -

+ + {/block} diff --git a/templates/default/I18n/en_US.php b/templates/default/I18n/en_US.php index b301bb505..19b58a6c4 100755 --- a/templates/default/I18n/en_US.php +++ b/templates/default/I18n/en_US.php @@ -28,12 +28,12 @@ return array ( 'Free shipping' => 'Free shipping', 'Orders over $50' => 'Orders over $50', 'Secure payment' => 'Secure payment', - 'Multi-payment plateform' => 'Multi-payment plateform', + 'Multi-payment platform' => 'Multi-payment platform', 'Need help ?' => 'Need help ?', 'Questions ? See or F.A.Q.' => 'Questions ? See or F.A.Q.', 'Latest articles' => 'Latest articles', 'No articles currently' => 'No articles currently', - 'Usefull links' => 'Usefull links', + 'Useful links' => 'Useful links', 'Login' => 'Login', 'Follow us' => 'Follow us', 'Newsletter' => 'Newsletter', @@ -113,11 +113,11 @@ return array ( 'Coupon code' => 'Coupon code', 'Ok' => 'Ok', 'Delivery address' => 'Delivery address', - 'Billing addres' => 'Billing addres', + 'Billing address' => 'Billing address', 'Change address' => 'Change address', 'Choose your payment method' => 'Choose your payment method', 'Secure Payment' => 'Secure Payment', - 'You chose to pay by' => 'You chose to pay by', + 'You choose to pay by' => 'You choose to pay by', 'Thank you for the trust you place in us.' => 'Thank you for the trust you place in us.', 'A summary of your order email has been sent to the following address' => 'A summary of your order email has been sent to the following address', 'Your order will be confirmed by us upon receipt of your payment.' => 'Your order will be confirmed by us upon receipt of your payment.', @@ -139,7 +139,7 @@ return array ( 'View order %ref as pdf document' => 'View order %ref as pdf document', 'Order details' => 'Order details', 'You don\'t have orders yet.' => 'You don\'t have orders yet.', - 'Update Profil' => 'Update Profil', + 'Update Profile' => 'Update Profile', 'Personal Informations' => 'Personal Informations', 'Select Title' => 'Select Title', 'Update' => 'Update', @@ -152,5 +152,59 @@ return array ( 'Select Country' => 'Select Country', 'Create' => 'Create', 'Related' => 'Related', +/* + 'The page cannot be found' => 'The page cannot be found', + 'What\'s your name?' => 'What\'s your name?', + 'So I can get back to you.' => 'So I can get back to you.', + 'The subject of your message.' => 'The subject of your message.', + 'And your message...' => 'And your message...', + 'This email already exists.' => 'This email already exists.', + 'Address label' => 'Address label', + 'Title' => 'Title', + 'First Name' => 'First Name', + 'Last Name' => 'Last Name', + 'Company Name' => 'Company Name', + 'Street Address' => 'Street Address', + 'Address Line 2' => 'Address Line 2', + 'Address Line 3' => 'Address Line 3', + 'City' => 'City', + 'Zip code' => 'Zip code', + 'Country' => 'Country', + 'Phone' => 'Phone', + 'Cellphone' => 'Cellphone', + 'Make this address as my primary address' => 'Make this address as my primary address', + 'Full Name' => 'Full Name', + 'Your Email Address' => 'Your Email Address', + 'Subject' => 'Subject', + 'Your Message' => 'Your Message', + 'Please enter your email address' => 'Please enter your email address', + 'No, I am a new customer.' => 'No, I am a new customer.', + 'Yes, I have a password :' => 'Yes, I have a password :', + 'Please enter your password' => 'Please enter your password', + 'This value should not be blank.' => 'This value should not be blank.', + 'A user already exists with this email address. Please login or if you\'ve forgotten your password, go to Reset Your Password.' => 'A user already exists with this email address. Please login or if you\'ve forgotten your password, go to Reset Your Password.', + 'This email does not exists' => 'This email does not exists', + 'Current Password' => 'Current Password', + 'New Password' => 'New Password', + 'Password confirmation' => 'Password confirmation', + 'Your current password does not match.' => 'Your current password does not match.', + 'Password confirmation is not the same as password field.' => 'Password confirmation is not the same as password field.', + 'I would like to receive the newsletter or the latest news.' => 'I would like to receive the newsletter or the latest news.', +*/ + 'Placeholder firstname' => 'John', + 'Placeholder lastname' => 'Doe', + 'Placeholder email' => 'johndoe@domain.com', + 'Placeholder phone' => '', + 'Placeholder cellphone' => '', + 'Placeholder company' => 'Google', + 'Placeholder address1' => '76 Ninth Avenue', + 'Placeholder address2' => '', + 'Placeholder city' => 'New York', + 'Placeholder zipcode' => 'NY 10011', + 'Placeholder address label' => 'Home, Work office, other', + 'Placeholder contact name' => 'What\'s your name?', + 'Placeholder contact email' => 'So I can get back to you.', + 'Placeholder contact subject' => 'The subject of your message.', + 'Placeholder contact message' => 'And your message...', ) ; \ No newline at end of file diff --git a/templates/default/I18n/es_ES.php b/templates/default/I18n/es_ES.php index cbf0e3a78..9e276a02b 100755 --- a/templates/default/I18n/es_ES.php +++ b/templates/default/I18n/es_ES.php @@ -28,12 +28,12 @@ return array ( 'Free shipping' => '', 'Orders over $50' => '', 'Secure payment' => '', - 'Multi-payment plateform' => '', + 'Multi-payment platform' => '', 'Need help ?' => '', 'Questions ? See or F.A.Q.' => '', 'Latest articles' => '', 'No articles currently' => '', - 'Usefull links' => '', + 'Useful links' => '', 'Login' => '', 'Follow us' => '', 'Newsletter' => '', @@ -113,11 +113,11 @@ return array ( 'Coupon code' => '', 'Ok' => '', 'Delivery address' => '', - 'Billing addres' => '', + 'Billing address' => '', 'Change address' => '', 'Choose your payment method' => '', 'Secure Payment' => '', - 'You chose to pay by' => '', + 'You choose to pay by' => '', 'Thank you for the trust you place in us.' => '', 'A summary of your order email has been sent to the following address' => '', 'Your order will be confirmed by us upon receipt of your payment.' => '', @@ -139,7 +139,7 @@ return array ( 'View order %ref as pdf document' => '', 'Order details' => '', 'You don\'t have orders yet.' => '', - 'Update Profil' => '', + 'Update Profile' => '', 'Personal Informations' => '', 'Select Title' => '', 'Update' => '', @@ -152,5 +152,59 @@ return array ( 'Select Country' => '', 'Create' => '', 'Related' => '', +/* + 'The page cannot be found' => '', + 'What\'s your name?' => '', + 'So I can get back to you.' => '', + 'The subject of your message.' => '', + 'And your message...' => '', + 'This email already exists.' => '', + 'Address label' => '', + 'Title' => '', + 'First Name' => '', + 'Last Name' => '', + 'Company Name' => '', + 'Street Address' => '', + 'Address Line 2' => '', + 'Address Line 3' => '', + 'City' => '', + 'Zip code' => '', + 'Country' => '', + 'Phone' => '', + 'Cellphone' => '', + 'Make this address as my primary address' => '', + 'Full Name' => '', + 'Your Email Address' => '', + 'Subject' => '', + 'Your Message' => '', + 'Please enter your email address' => '', + 'No, I am a new customer.' => '', + 'Yes, I have a password :' => '', + 'Please enter your password' => '', + 'This value should not be blank.' => '', + 'A user already exists with this email address. Please login or if you\'ve forgotten your password, go to Reset Your Password.' => '', + 'This email does not exists' => '', + 'Current Password' => '', + 'New Password' => '', + 'Password confirmation' => '', + 'Your current password does not match.' => '', + 'Password confirmation is not the same as password field.' => '', + 'I would like to receive the newsletter or the latest news.' => '', +*/ + 'Placeholder firstname' => '', + 'Placeholder lastname' => '', + 'Placeholder email' => '', + 'Placeholder phone' => '', + 'Placeholder cellphone' => '', + 'Placeholder company' => '', + 'Placeholder address1' => '', + 'Placeholder address2' => '', + 'Placeholder city' => '', + 'Placeholder zipcode' => '', + 'Placeholder address label' => '', + 'Placeholder contact name' => '', + 'Placeholder contact email' => '', + 'Placeholder contact subject' => '', + 'Placeholder contact message' => '', ) ; \ No newline at end of file diff --git a/templates/default/I18n/fr_FR.php b/templates/default/I18n/fr_FR.php index cbf0e3a78..a9f92fa95 100755 --- a/templates/default/I18n/fr_FR.php +++ b/templates/default/I18n/fr_FR.php @@ -1,156 +1,210 @@ '', - 'Thelia V2' => '', - 'Skip to content' => '', - 'Toggle navigation' => '', - 'Main Navigation' => '', - 'Register!' => '', - 'Log In!' => '', - 'Sign In' => '', - 'Register' => '', - 'Cart' => '', - 'View Cart' => '', - 'Checkout' => '', - 'You have no items in your shopping cart.' => '', - 'Home' => '', - 'Search a product' => '', - 'Search...' => '', - 'Minimum 2 characters.' => '', - 'Search' => '', - 'Language:' => '', - 'Currency:' => '', - 'Latest' => '', - 'Offers' => '', - 'Special Price:' => '', - 'Regular Price:' => '', - 'Free shipping' => '', - 'Orders over $50' => '', - 'Secure payment' => '', - 'Multi-payment plateform' => '', - 'Need help ?' => '', - 'Questions ? See or F.A.Q.' => '', - 'Latest articles' => '', - 'No articles currently' => '', - 'Usefull links' => '', - 'Login' => '', - 'Follow us' => '', - 'Newsletter' => '', - 'Sign up to receive our latest news.' => '', - 'Email address' => '', - 'Your email address' => '', - 'Subscribe' => '', - 'Contact Us' => '', - 'Copyright' => '', - 'You are here:' => '', - 'Show' => '', - 'per page' => '', - 'Sort By' => '', - 'Name ascending' => '', - 'Name descending' => '', - 'Price ascending' => '', - 'Price descending' => '', - 'View as' => '', - 'View product' => '', - 'Pagination' => '', - 'No products available in this category' => '', - 'Categories' => '', - 'Ref.' => '', - 'Availability' => '', - 'In stock' => '', - 'Out of stock' => '', - 'Add to cart' => '', - 'Description' => '', - 'Additional Info' => '', - 'View cart' => '', - 'Continue Shopping' => '', - 'Upsell Products' => '', - 'Your Cart' => '', - 'Billing and delivery' => '', - 'Check my order' => '', - 'Product Name' => '', - 'Name' => '', - 'Unit Price' => '', - 'Price' => '', - 'Quantity' => '', - 'Qty' => '', - 'Total' => '', - 'Tax Inclusive' => '', - 'TTC' => '', - 'Available' => '', - 'In Stock' => '', - 'No.' => '', - 'Remove' => '', - 'Proceed checkout' => '', - 'Warning' => '', - 'missing or invalid data' => '', - 'Do you have an account?' => '', - 'Forgot your Password?' => '', - 'Next' => '', - 'Log out!' => '', - 'My Account' => '', - 'Previous product' => '', - 'Next product' => '', - 'instead of' => '', - 'Add a new address' => '', - 'Choose your delivery address' => '', - 'Address %nb' => '', - 'Edit this address' => '', - 'Edit' => '', - 'Remove this address' => '', - 'Cancel' => '', - 'Choose your delivery method' => '', - 'Back' => '', - 'Next Step' => '', - 'Delete address' => '', - 'Do you really want to delete this address ?' => '', - 'No' => '', - 'Yes' => '', - 'Shipping Tax' => '', - 'You may have a coupon ?' => '', - 'Code :' => '', - 'Coupon code' => '', - 'Ok' => '', - 'Delivery address' => '', - 'Billing addres' => '', - 'Change address' => '', - 'Choose your payment method' => '', - 'Secure Payment' => '', - 'You chose to pay by' => '', - 'Thank you for the trust you place in us.' => '', - 'A summary of your order email has been sent to the following address' => '', - 'Your order will be confirmed by us upon receipt of your payment.' => '', - 'Order number' => '', - 'Date' => '', - 'Go home' => '', - 'Account' => '', - 'Personal Information' => '', - 'Change my account information' => '', - 'Change my password' => '', - 'My Address book' => '', - 'My Address Books' => '', - 'My Orders' => '', - 'List of orders' => '', - 'Order Number' => '', - 'Amount' => '', - 'Status' => '', - 'View' => '', - 'View order %ref as pdf document' => '', - 'Order details' => '', - 'You don\'t have orders yet.' => '', - 'Update Profil' => '', - 'Personal Informations' => '', - 'Select Title' => '', - 'Update' => '', - 'Change Password' => '', - 'Login Information' => '', - 'Create New Address' => '', - 'Address' => '', - 'Home address' => '', - 'Complementary address' => '', - 'Select Country' => '', - 'Create' => '', - 'Related' => '', + '+ View All' => '+ Voir tout', + 'Thelia V2' => 'Thelia v2', + 'Skip to content' => 'Aller au contenu', + 'Toggle navigation' => 'Navigation alternative', + 'Main Navigation' => 'Navigation principale', + 'Register!' => 'S\'inscrire !', + 'Log In!' => 'Se connecter', + 'Sign In' => 'S\'inscrire', + 'Register' => 'Se connecter', + 'Cart' => 'Panier', + 'View Cart' => 'Voir mon panier', + 'Checkout' => 'Payer', + 'You have no items in your shopping cart.' => 'Vous n\'avez pas de produit dans votre panier.', + 'Home' => 'Accueil', + 'Search a product' => 'Chercher un produit', + 'Search...' => 'Recherche…', + 'Minimum 2 characters.' => '2 caractères minimum.', + 'Search' => 'Recherche', + 'Language:' => 'Langue', + 'Currency:' => 'Monnaie', + 'Latest' => 'Nouveautés', + 'Offers' => 'Promotions', + 'Special Price:' => 'Prix en promotion :', + 'Regular Price:' => 'Prix :', + 'Free shipping' => 'Livraison gratuite', + 'Orders over $50' => 'Commandes supérieures à 50€',//ne devrait-on pas mettre une variable ici? + 'Secure payment' => 'Paiement sécurisé', + 'Multi-payment plateform' => 'Plateforme multipaiement',// bizarre ? + 'Need help ?' => 'Besoin d\'aide? ', + 'Questions ? See or F.A.Q.' => 'Des questions ? Voir la F.A.Q.', // bizarre le 'see or ' + 'Latest articles' => 'Nouveaux articles', + 'No articles currently' => 'Actuellement aucun article', + 'Useful links' => 'Liens utiles', + 'Login' => 'Connexion', + 'Follow us' => 'Suivez-nous', + 'Newsletter' => 'Newsletter', + 'Sign up to receive our latest news.' => 'Inscrivez-vous pour recevoir nos actualités.', + 'Email address' => 'Adresse e-mail', + 'Your email address' => 'Votre adresse e-mail', + 'Subscribe' => 'Inscription', + 'Contact Us' => 'Contactez-nous', + 'Copyright' => 'Copyright', + 'You are here:' => 'Vous êtes ici :', + 'Show' => 'Voir', + 'per page' => 'par page', + 'Sort By' => 'Trier par', + 'Name ascending' => 'Nom croissant', + 'Name descending' => 'Nom décroissant', + 'Price ascending' => 'Prix croissant', + 'Price descending' => 'Prix décroissant', + 'View as' => 'Voir en tant que ', + 'View product' => 'Voir le produit', + 'Pagination' => 'Pagination', + 'No products available in this category' => 'Aucun produit dans cette catégorie.', + 'Categories' => 'Catégories', + 'Ref.' => 'Ref.', + 'Availability' => 'Disponibilité', + 'In stock' => 'En stock', + 'Out of stock' => 'Indisponible', + 'Add to cart' => 'Ajouter au panier', + 'Description' => 'Description', + 'Additional Info' => 'Informations complémentaires', + 'View cart' => 'Voir mon panier', + 'Continue Shopping' => 'Continuer mes achats', + 'Upsell Products' => 'Nous vous proposons également', + 'Your Cart' => 'Votre panier', + 'Billing and delivery' => 'Facturation et livraison', + 'Check my order' => 'Vérifier ma commmande', + 'Product Name' => 'Nom du produit', + 'Name' => 'Nom', + 'Unit Price' => 'Prix unitaire', + 'Price' => 'Prix', + 'Quantity' => 'Quantité', + 'Qty' => 'Qté', + 'Total' => 'Total', + 'Tax Inclusive' => 'TVA incluse', + 'Available' => 'Disponible', + 'In Stock' => 'Disponible', + 'No.' => 'N°', + 'Remove' => 'Supprimer', + 'Proceed checkout' => 'Payer', + 'Warning' => 'Attention', + 'missing or invalid data' => 'Information éronnée ou incomplète', + 'Do you have an account?' => 'Avez-vous déjà un compte ?', + 'Forgot your Password?' => 'Mot de passé oublié ?', + 'Next' => 'Suivant', + 'Log out!' => 'Se déconnecter', + 'My Account' => 'Mon compte', + 'Previous product' => 'Produits précédents', + 'Next product' => 'Produits suivants', + 'instead of' => 'au lieu de', + 'Add a new address' => 'Ajouter une nouvelle adresse', + 'Choose your delivery address' => 'Choisissez une adresse de livraison', + 'Address %nb' => 'Adresse n°', + 'Edit this address' => 'Editer cette adresse', + 'Edit' => 'Editer', + 'Remove this address' => 'Supprimer cette adresse', + 'Cancel' => 'Annuler', + 'Choose your delivery method' => 'Choisissez votre moyen de livraison', + 'Back' => 'Retour', + 'Next Step' => 'Etape suivante', + 'Delete address' => 'Supprimer cette adresse', + 'Do you really want to delete this address ?' => 'Voulez-vous vraiment supprimer cette adresse ?', + 'No' => 'Non', + 'Yes' => 'Oui', + 'Shipping Tax' => 'Frais de livraison', + 'You may have a coupon ?' => 'Avez-vous un code promo ?', + 'Code :' => 'Code', + 'Coupon code' => 'Code promo', + 'Ok' => 'Ok', + 'Delivery address' => 'Adresse de livraison', + 'Billing address' => 'Adresse de facturation', + 'Change address' => 'Changer d\'adresse', + 'Choose your payment method' => 'Choisissez voter moyen de paiement', + 'Secure Payment' => 'Paiement sécurisé', + // Tous les éléments relatifs au message de confirmation de commande devraient être administrables non? + 'You choose to pay by' => 'Vous avez choisi de payer par', + 'Thank you for the trust you place in us.' => 'Merci pour voter confiance. ', + 'A summary of your order email has been sent to the following address' => 'Un récapitulatif de commande vows a été envoyé par e-mail à l\'adresse suivante : ', + 'Your order will be confirmed by us upon receipt of your payment.' => 'Votre commande sera confirmée à réception de votre pavement.', + 'Order number' => 'Commande numéro', + 'Date' => 'Date', + 'Go home' => 'Retour à l\'accueil', + 'Account' => 'Mon compte', + 'Personal Information' => 'Informations personnelles', + 'Change my account information' => 'Modifier mes informations personnelles', + 'Change my password' => 'Changer mon mot de passe', + 'My Address book' => 'Mon carnet d\'adresses', + 'My Address Books' => 'Mes carnets d\'adresses', + 'My Orders' => 'Mes commandes', + 'List of orders' => 'Liste de mes commandes', + 'Order Number' => 'Commande numéro', + 'Amount' => 'Montant', + 'Status' => 'Etat', + 'View' => 'Voir', + 'View order %ref as pdf document' => 'Ouvrir la commande %ref dans un pdf', + 'Order details' => 'Détail de commande', + 'You don\'t have orders yet.' => 'Vous n\'avez pas encore de commande.', + 'Update Profile' => 'Mettre à jour votre profil', + 'Personal Informations' => 'Informations personnelles', + 'Select Title' => 'Civilité', + 'Update' => 'Mettre à jour', + 'Change Password' => 'Modifier mon mot de passe', + 'Login Information' => 'Informations de connexion', + 'Create New Address' => 'Créer une nouvelle adresse', + 'Address' => 'Adresse', + 'Home address' => 'Résidence principal', + 'Complementary address' => 'Résidence secondaire', + 'Select Country' => 'Choisissez un pays', + 'Create' => 'Créer', + 'Related' => 'Liés', // voir le contexte pour l'accord + /* + 'The page cannot be found' => '', + 'What\'s your name?' => '', + 'So I can get back to you.' => '', + 'The subject of your message.' => '', + 'And your message...' => '', + 'This email already exists.' => '', + 'Address label' => '', + 'Title' => '', + 'First Name' => '', + 'Last Name' => '', + 'Company Name' => '', + 'Street Address' => '', + 'Address Line 2' => '', + 'Address Line 3' => '', + 'City' => '', + 'Zip code' => '', + 'Country' => '', + 'Phone' => '', + 'Cellphone' => '', + 'Make this address as my primary address' => '', + 'Full Name' => '', + 'Your Email Address' => '', + 'Subject' => '', + 'Your Message' => '', + 'Please enter your email address' => '', + 'No, I am a new customer.' => '', + 'Yes, I have a password :' => '', + 'Please enter your password' => '', + 'This value should not be blank.' => '', + 'A user already exists with this email address. Please login or if you\'ve forgotten your password, go to Reset Your Password.' => '', + 'This email does not exists' => '', + 'Current Password' => '', + 'New Password' => '', + 'Password confirmation' => '', + 'Your current password does not match.' => '', + 'Password confirmation is not the same as password field.' => '', + 'I would like to receive the newsletter or the latest news.' => '', + */ + 'Placeholder firstname' => 'Prénom', + 'Placeholder lastname' => 'Nom de famille', + 'Placeholder email' => 'Adresse e-mail', + 'Placeholder phone' => 'Téléphone', + 'Placeholder cellphone' => 'Portable', + 'Placeholder company' => 'Compagnie', + 'Placeholder address1' => 'Adresse', + 'Placeholder address2' => '', + 'Placeholder city' => 'Ville', + 'Placeholder zipcode' => 'Code postal', + 'Placeholder address label' => 'Maison, Domicile, Travail...', + 'Placeholder contact name' => 'Quel est votre nom ?', + 'Placeholder contact email' => 'Pour me permettre de vous contacter', + 'Placeholder contact subject' => 'Le sujet de votre message', + 'Placeholder contact message' => 'Votre commentaire', ) ; \ No newline at end of file diff --git a/templates/default/I18n/it_IT.php b/templates/default/I18n/it_IT.php index cbf0e3a78..9e276a02b 100755 --- a/templates/default/I18n/it_IT.php +++ b/templates/default/I18n/it_IT.php @@ -28,12 +28,12 @@ return array ( 'Free shipping' => '', 'Orders over $50' => '', 'Secure payment' => '', - 'Multi-payment plateform' => '', + 'Multi-payment platform' => '', 'Need help ?' => '', 'Questions ? See or F.A.Q.' => '', 'Latest articles' => '', 'No articles currently' => '', - 'Usefull links' => '', + 'Useful links' => '', 'Login' => '', 'Follow us' => '', 'Newsletter' => '', @@ -113,11 +113,11 @@ return array ( 'Coupon code' => '', 'Ok' => '', 'Delivery address' => '', - 'Billing addres' => '', + 'Billing address' => '', 'Change address' => '', 'Choose your payment method' => '', 'Secure Payment' => '', - 'You chose to pay by' => '', + 'You choose to pay by' => '', 'Thank you for the trust you place in us.' => '', 'A summary of your order email has been sent to the following address' => '', 'Your order will be confirmed by us upon receipt of your payment.' => '', @@ -139,7 +139,7 @@ return array ( 'View order %ref as pdf document' => '', 'Order details' => '', 'You don\'t have orders yet.' => '', - 'Update Profil' => '', + 'Update Profile' => '', 'Personal Informations' => '', 'Select Title' => '', 'Update' => '', @@ -152,5 +152,59 @@ return array ( 'Select Country' => '', 'Create' => '', 'Related' => '', +/* + 'The page cannot be found' => '', + 'What\'s your name?' => '', + 'So I can get back to you.' => '', + 'The subject of your message.' => '', + 'And your message...' => '', + 'This email already exists.' => '', + 'Address label' => '', + 'Title' => '', + 'First Name' => '', + 'Last Name' => '', + 'Company Name' => '', + 'Street Address' => '', + 'Address Line 2' => '', + 'Address Line 3' => '', + 'City' => '', + 'Zip code' => '', + 'Country' => '', + 'Phone' => '', + 'Cellphone' => '', + 'Make this address as my primary address' => '', + 'Full Name' => '', + 'Your Email Address' => '', + 'Subject' => '', + 'Your Message' => '', + 'Please enter your email address' => '', + 'No, I am a new customer.' => '', + 'Yes, I have a password :' => '', + 'Please enter your password' => '', + 'This value should not be blank.' => '', + 'A user already exists with this email address. Please login or if you\'ve forgotten your password, go to Reset Your Password.' => '', + 'This email does not exists' => '', + 'Current Password' => '', + 'New Password' => '', + 'Password confirmation' => '', + 'Your current password does not match.' => '', + 'Password confirmation is not the same as password field.' => '', + 'I would like to receive the newsletter or the latest news.' => '', +*/ + 'Placeholder firstname' => '', + 'Placeholder lastname' => '', + 'Placeholder email' => '', + 'Placeholder phone' => '', + 'Placeholder cellphone' => '', + 'Placeholder company' => '', + 'Placeholder address1' => '', + 'Placeholder address2' => '', + 'Placeholder city' => '', + 'Placeholder zipcode' => '', + 'Placeholder address label' => '', + 'Placeholder contact name' => '', + 'Placeholder contact email' => '', + 'Placeholder contact subject' => '', + 'Placeholder contact message' => '', ) ; \ No newline at end of file diff --git a/templates/default/account-password.html b/templates/default/account-password.html index 5b14ac1f6..1e67d4520 100644 --- a/templates/default/account-password.html +++ b/templates/default/account-password.html @@ -1,14 +1,18 @@ {extends file="layout.tpl"} +{* Security *} +{block name="no-return-functions" prepend} + {check_auth context="front" role="CUSTOMER" login_tpl="login"} +{/block} + {* Body Class *} {block name="body-class"}page-account-password{/block} {* Breadcrumb *} {block name='no-return-functions' append} - {$breadcrumbs = [['title' => {intl l="Account"}, 'url'=>{url path="/account"}]]} {$breadcrumbs = [ - ['title' => {intl l="Account"}, 'url'=>{url path="/account"}], - ['title' => {intl l="Change Password"}, 'url'=>{url path="/account/password"}] + ['title' => {intl l="Account"}, 'url'=>{url path="/account"}], + ['title' => {intl l="Change Password"}, 'url'=>{url path="/account/password"}] ]} {/block} @@ -37,12 +41,14 @@
{form_field form=$form field="password_old"} -
+
- - {if $error } - {$message} + + {if $error} + {$message} + {assign var="error_focus" value="true"} + {elseif !$value} {assign var="error_focus" value="true"} {/if}
@@ -50,25 +56,24 @@ {/form_field} {form_field form=$form field="password"} -
+
- + {if $error } - {$message} + {$message} {assign var="error_focus" value="true"} {/if}
{/form_field} {form_field form=$form field="password_confirm"} -
+
- + {if $error } - {$message} - {assign var="error_focus" value="true"} + {$message} {/if}
diff --git a/templates/default/account-update.html b/templates/default/account-update.html index 6fb50162e..d7b38e773 100644 --- a/templates/default/account-update.html +++ b/templates/default/account-update.html @@ -1,14 +1,18 @@ {extends file="layout.tpl"} +{* Security *} +{block name="no-return-functions" prepend} + {check_auth context="front" role="CUSTOMER" login_tpl="login"} +{/block} + {* Body Class *} {block name="body-class"}page-account-update{/block} {* Breadcrumb *} {block name='no-return-functions' append} - {$breadcrumbs = [['title' => {intl l="Account"}, 'url'=>{url path="/account"}]]} {$breadcrumbs = [ - ['title' => {intl l="Account"}, 'url'=>{url path="/account"}], - ['title' => {intl l="Update Profil"}, 'url'=>{url path="/account/update"}] + ['title' => {intl l="Account"}, 'url'=>{url path="/account"}], + ['title' => {intl l="Update Profile"}, 'url'=>{url path="/account/update"}] ]} {/block} @@ -17,10 +21,9 @@
-

{intl l="Update Profil"}

+

{intl l="Update Profile"}

- {form name="thelia.front.customer.profil.update"} - {assign var="isPost" value="{$smarty.post|count}"} + {form name="thelia.front.customer.profile.update"} {form_field form=$form field='success_url'} @@ -37,7 +40,7 @@
{form_field form=$form field="title"} -
+
- {if $error } - {$message} + {if $error} + {$message} {assign var="error_focus" value="true"} {elseif !$value} {assign var="error_focus" value="true"} - {elseif $isPost && $value != "" && !$error} - {/if}
{/form_field} {form_field form=$form field="firstname"} -
+
- + {if $error } - {$message} + {$message} {assign var="error_focus" value="true"} - {elseif $isPost && $value != "" && !$error} - {/if}
{/form_field} {form_field form=$form field="lastname"} -
+
- + {if $error } - {$message} + {$message} {assign var="error_focus" value="true"} - {elseif $isPost && $value != "" && !$error} - {/if}
{/form_field} {form_field form=$form field="email"} -
+
- + {if $error } - {$message} + {$message} {assign var="error_focus" value="true"} - {elseif $isPost && $value != "" && !$error} - {/if}
@@ -111,7 +106,7 @@ {$label} {if $error } - {$message} + {$message} {/if}
diff --git a/templates/default/account.html b/templates/default/account.html index 9e9c82369..863104615 100644 --- a/templates/default/account.html +++ b/templates/default/account.html @@ -1,5 +1,6 @@ {extends file="layout.tpl"} +{* Security *} {block name="no-return-functions" prepend} {check_auth context="front" role="CUSTOMER" login_tpl="login"} {/block} @@ -7,7 +8,7 @@ {* Breadcrumb *} {block name='no-return-functions' append} {$breadcrumbs = [ - ['title' => {intl l="Account"}, 'url'=>{url path="/account"}] + ['title' => {intl l="Account"}, 'url'=>{url path="/account"}] ]} {/block} @@ -32,7 +33,7 @@
{loop type="customer" name="customer.info"}
-

{loop type="title" name="customer.title.info" id=$TITLE}{$SHORT}{/loop} {$FIRSTNAME} {$LASTNAME}

+

{loop type="title" name="customer.title.info" id=$TITLE}{$SHORT}{/loop} {$FIRSTNAME|ucwords} {$LASTNAME|upper}

{loop type="address" name="address.default" default="true"}
  • @@ -49,12 +50,12 @@
  • - {if $CELLPHONE != ""} - {$CELLPHONE} - {/if} {if $PHONE != ""} {$PHONE} {/if} + {if $CELLPHONE != ""} + {$CELLPHONE} + {/if}
  • @@ -86,7 +87,7 @@
    • - {loop type="title" name="customer.title.info" id=$TITLE}{$SHORT}{/loop} {$FIRSTNAME} {$LASTNAME} + {loop type="title" name="customer.title.info" id=$TITLE}{$SHORT}{/loop} {$FIRSTNAME|ucwords} {$LASTNAME|upper} {if $COMPANY} {$COMPANY} {/if} @@ -118,7 +119,7 @@ diff --git a/templates/default/address-update.html b/templates/default/address-update.html index 710628015..8ab66107d 100644 --- a/templates/default/address-update.html +++ b/templates/default/address-update.html @@ -1,6 +1,7 @@ {extends file="layout.tpl"} -{block name="no-return-functions"} +{* Security *} +{block name="no-return-functions" prepend} {check_auth context="front" role="CUSTOMER" login_tpl="login"} {/block} @@ -11,7 +12,7 @@ {block name='no-return-functions' append} {$breadcrumbs = [ ['title' => {intl l="Account"}, 'url'=>{url path="/account"}], - ['title' => {intl l="Address Update"}, 'url'=>{url path="/address"}] + ['title' => {intl l="Address Update"}, 'url'=>{url path="/address/update/{$address_id}"}] ]} {/block} @@ -20,16 +21,16 @@
      -

      {intl l="Create New Address"}

      +

      {intl l="Address Update"}

      {form name="thelia.front.address.update"} - {loop name="customer.update" type="address" customer="current" id="{$address_id}"} + {loop name="customer.update" type="address" customer="current" id="{$address_id}"} {form_field form=$form field='success_url'} - {* the url the user is redirected to on login success *} + {/form_field} {form_field form=$form field='error_message'} - {* the url the user is redirected to on login success *} + {/form_field} {form_hidden_fields form=$form} {if $form_error}
      {$form_error_message}
      {/if} @@ -40,15 +41,16 @@
      {form_field form=$form field="label"} -
      - +
      +
      - + {if $error } - {$message} - {elseif $value != "" && !$error} - + {$message} + {assign var="error_focus" value="true"} + {elseif !$value} + {assign var="error_focus" value="true"} {/if}
      @@ -57,34 +59,32 @@ {form_field form=$form field="title"} {assign var="customer_title_id" value="{$value|default:$TITLE}"} -
      - +
      +
      - {loop type="title" name="title.list"} - + {/loop} {if $error } - {$message} - {elseif $value != "" && !$error} - + {$message} + {assign var="error_focus" value="true"} {/if}
      {/form_field} {form_field form=$form field="firstname"} -
      - +
      +
      - + {if $error } - {$message} - {elseif $value != "" && !$error} - + {$message} + {assign var="error_focus" value="true"} {/if}
      @@ -93,15 +93,14 @@ {form_field form=$form field="lastname"} -
      - +
      +
      - + {if $error } - {$message} - {elseif $value != "" && !$error} - + {$message} + {assign var="error_focus" value="true"} {/if}
      @@ -109,15 +108,14 @@ {/form_field} {form_field form=$form field="address1"} -
      - +
      +
      - + {if $error } - {$message} - {elseif $value != "" && !$error} - + {$message} + {assign var="error_focus" value="true"} {/if}
      @@ -125,15 +123,14 @@ {/form_field} {form_field form=$form field="address2"} -
      - +
      +
      - + {if $error } - {$message} - {elseif $value != "" && !$error} - + {$message} + {assign var="error_focus" value="true"} {/if}
      @@ -141,15 +138,14 @@ {/form_field} {form_field form=$form field="zipcode"} -
      - +
      +
      - + {if $error } - {$message} - {elseif $value != "" && !$error} - + {$message} + {assign var="error_focus" value="true"} {/if}
      @@ -157,15 +153,14 @@ {/form_field} {form_field form=$form field="city"} -
      - +
      +
      - + {if $error } - {$message} - {elseif $value != "" && !$error} - + {$message} + {assign var="error_focus" value="true"} {/if}
      @@ -173,35 +168,33 @@ {/form_field} {form_field form=$form field="country"} - {assign var="customer_country_id" value="{$value|default:$COUNTRY}"} -
      - + {assign var="customer_country_id" value="{$value|default:$COUNTRY}"} +
      +
      - {loop type="country" name="country.list"} - + {/loop} {if $error } - {$message} - {elseif $value != "" && !$error} - + {$message} + {assign var="error_focus" value="true"} {/if}
      {/form_field} {form_field form=$form field="phone"} -
      - +
      +
      - + {if $error } - {$message} - {elseif $value != "" && !$error} - + {$message} + {assign var="error_focus" value="true"} {/if}
      @@ -209,15 +202,14 @@ {/form_field} {form_field form=$form field="cellphone"} -
      - +
      +
      - + {if $error } - {$message} - {elseif $value != "" && !$error} - + {$message} + {assign var="error_focus" value="true"} {/if}
      @@ -227,21 +219,23 @@ {form_field form=$form field="is_default"} + {if not $DEFAULT}
      + {/if} {/form_field}
      - +
      diff --git a/templates/default/address.html b/templates/default/address.html index 376adafa2..fea5c5dd5 100644 --- a/templates/default/address.html +++ b/templates/default/address.html @@ -1,6 +1,7 @@ {extends file="layout.tpl"} -{block name="no-return-functions"} +{* Security *} +{block name="no-return-functions" prepend} {check_auth context="front" role="CUSTOMER" login_tpl="login"} {/block} @@ -11,7 +12,7 @@ {block name='no-return-functions' append} {$breadcrumbs = [ ['title' => {intl l="Account"}, 'url'=>{url path="/account"}], - ['title' => {intl l="Address"}, 'url'=>{url path="/address"}] + ['title' => {intl l="Add a New Address"}, 'url'=>{url path="/address/create"}] ]} {/block} @@ -24,11 +25,11 @@ {form name="thelia.front.address.create"} {form_field form=$form field='success_url'} - {* the url the user is redirected to on login success *} + {/form_field} {form_field form=$form field='error_message'} - {* the url the user is redirected to on login success *} + {/form_field} {form_hidden_fields form=$form} {if $form_error}
      {$form_error_message}
      {/if} @@ -39,15 +40,16 @@
      {form_field form=$form field="label"} -
      - +
      +
      - + {if $error } - {$message} - {elseif $value != "" && !$error} - + {$message} + {assign var="error_focus" value="true"} + {elseif !$value} + {assign var="error_focus" value="true"} {/if}
      @@ -55,34 +57,32 @@ {/form_field} {form_field form=$form field="title"} -
      - +
      +
      - {loop type="title" name="title.list"} {/loop} {if $error } - {$message} - {elseif $value != "" && !$error} - + {$message} + {assign var="error_focus" value="true"} {/if}
      {/form_field} {form_field form=$form field="firstname"} -
      - +
      +
      - + {if $error } - {$message} - {elseif $value != "" && !$error} - + {$message} + {assign var="error_focus" value="true"} {/if}
      @@ -91,15 +91,14 @@ {form_field form=$form field="lastname"} -
      - +
      +
      - + {if $error } - {$message} - {elseif $value != "" && !$error} - + {$message} + {assign var="error_focus" value="true"} {/if}
      @@ -107,15 +106,14 @@ {/form_field} {form_field form=$form field="address1"} -
      - +
      +
      - + {if $error } - {$message} - {elseif $value != "" && !$error} - + {$message} + {assign var="error_focus" value="true"} {/if}
      @@ -123,15 +121,14 @@ {/form_field} {form_field form=$form field="address2"} -
      - +
      +
      - + {if $error } - {$message} - {elseif $value != "" && !$error} - + {$message} + {assign var="error_focus" value="true"} {/if}
      @@ -139,15 +136,14 @@ {/form_field} {form_field form=$form field="zipcode"} -
      - +
      +
      - + {if $error } - {$message} - {elseif $value != "" && !$error} - + {$message} + {assign var="error_focus" value="true"} {/if}
      @@ -155,15 +151,14 @@ {/form_field} {form_field form=$form field="city"} -
      - +
      +
      - + {if $error } - {$message} - {elseif $value != "" && !$error} - + {$message} + {assign var="error_focus" value="true"} {/if}
      @@ -171,34 +166,32 @@ {/form_field} {form_field form=$form field="country"} -
      - +
      +
      - {loop type="country" name="country.list"} {/loop} {if $error } - {$message} - {elseif $value != "" && !$error} - + {$message} + {assign var="error_focus" value="true"} {/if}
      {/form_field} {form_field form=$form field="phone"} -
      - +
      +
      - + {if $error } - {$message} - {elseif $value != "" && !$error} - + {$message} + {assign var="error_focus" value="true"} {/if}
      @@ -206,15 +199,14 @@ {/form_field} {form_field form=$form field="cellphone"} -
      - +
      +
      - + {if $error } - {$message} - {elseif $value != "" && !$error} - + {$message} + {assign var="error_focus" value="true"} {/if}
      diff --git a/templates/default/assets/img/carousel/slider1.png b/templates/default/assets/img/carousel/slider1.png index 422b3ddc0..d2a1f3628 100644 Binary files a/templates/default/assets/img/carousel/slider1.png and b/templates/default/assets/img/carousel/slider1.png differ diff --git a/templates/default/assets/img/carousel/slider2.png b/templates/default/assets/img/carousel/slider2.png index 8eb4049b7..eab0f625c 100644 Binary files a/templates/default/assets/img/carousel/slider2.png and b/templates/default/assets/img/carousel/slider2.png differ diff --git a/templates/default/assets/img/carousel/slider3.png b/templates/default/assets/img/carousel/slider3.png index b3630ff60..2e91fd0f2 100644 Binary files a/templates/default/assets/img/carousel/slider3.png and b/templates/default/assets/img/carousel/slider3.png differ diff --git a/templates/default/assets/img/favicon.ico b/templates/default/assets/img/favicon.ico new file mode 100644 index 000000000..19f5af190 Binary files /dev/null and b/templates/default/assets/img/favicon.ico differ diff --git a/templates/default/assets/img/favicon.png b/templates/default/assets/img/favicon.png new file mode 100644 index 000000000..5669f3e76 Binary files /dev/null and b/templates/default/assets/img/favicon.png differ diff --git a/templates/default/assets/js/script.js b/templates/default/assets/js/script.js index dd55f4cbb..c6f695114 100644 --- a/templates/default/assets/js/script.js +++ b/templates/default/assets/js/script.js @@ -1,7 +1,20 @@ /* JQUERY PREVENT CONFLICT */ (function($) { - /* ------------------------------------------------------------------ +/* ------------------------------------------------------------------ + callback Function -------------------------------------------------- */ + var confirmCallback = { + 'address.delete': function($elm){ + $.post($elm.attr('href'), function(data){ + if(data.success) + $elm.closest('tr').remove(); + else + bootbox.alert(data.message); + }); + } + } + +/* ------------------------------------------------------------------ onLoad Function -------------------------------------------------- */ $(document).ready(function(){ @@ -48,20 +61,26 @@ }); // Confirm Dialog - $(document).on('click.confirm', '[data-toggle="confirm"]', function (e) { - var $this = $(this), - href = $this.attr('href'), - title = $this.attr('data-confirm-title') ? $this.attr('data-confirm-title') : 'Are you sure?'; + $(document).on('click.confirm', '[data-confirm]', function (e) { + var $this = $(this), + href = $this.attr('href'), + callback = $this.attr('data-confirm-callback'), + title = $this.attr('data-confirm') != '' ? $this.attr('data-confirm') : 'Are you sure?'; - bootbox.confirm(title, function(confirm) { + bootbox.confirm(title, function(confirm) { if(confirm){ - if(href){ - window.location.href = href; + //Check if callback and if it's a function + if (callback && $.isFunction(confirmCallback[callback])) { + confirmCallback[callback]($this); } else { - // If forms - var $form = $this.closest("form"); - if($form.size() > 0){ - $form.submit(); + if(href){ + window.location.href = href; + } else { + // If forms + var $form = $this.closest("form"); + if($form.size() > 0){ + $form.submit(); + } } } } @@ -195,7 +214,7 @@ }); // Apply validation - $('#form-contact, #form-register').validate({ + $('#form-contact, #form-register, #form-address').validate({ highlight: function(element) { $(element).closest('.form-group').addClass('has-error'); }, @@ -203,14 +222,14 @@ $(element).closest('.form-group').removeClass('has-error'); }, errorElement: 'span', - errorClass: 'help-block', + errorClass: 'help-block'/*, errorPlacement: function(error, element) { if(element.parent('.input-group').length || element.prop('type') === 'checkbox' || element.prop('type') === 'radio'){ error.prepend(' ').insertAfter(element.parent()); }else{ error.prepend(' ').insertAfter(element); } - } + }*/ }); diff --git a/templates/default/assets/less/thelia/account.less b/templates/default/assets/less/thelia/account.less index 40cf4da3c..ab72cae1c 100644 --- a/templates/default/assets/less/thelia/account.less +++ b/templates/default/assets/less/thelia/account.less @@ -2,7 +2,8 @@ .account-info { .list-info { address { margin-bottom: 0; } - + + .mobile, .tel, .email { display: block; diff --git a/templates/default/assets/less/thelia/checkout.less b/templates/default/assets/less/thelia/checkout.less index bcdee104f..8cd1b82ac 100644 --- a/templates/default/assets/less/thelia/checkout.less +++ b/templates/default/assets/less/thelia/checkout.less @@ -4,7 +4,7 @@ #delivery-address { .panel-heading { position: relative; - > .btn-add-address { position: absolute; top: 3px; right: 5px; margin:0; padding: 0; text-transform: none; } + > .btn-add-address { position: absolute; top: 7px; right: 10px; margin:0; padding: 0; text-transform: none; } } } diff --git a/templates/default/assets/less/thelia/global.less b/templates/default/assets/less/thelia/global.less index 378af265c..29c19c0c5 100755 --- a/templates/default/assets/less/thelia/global.less +++ b/templates/default/assets/less/thelia/global.less @@ -3,19 +3,6 @@ // Main Title .page-header { margin-top: 0; } -// 404 Page -.page_404{ - color: @brand-primary; - font-size: 9em; font-weight: bold; - text-align: center; - - span{ - color : #CCC; - display: block; - font-size: 15px; font-weight: normal; - } -} - // Collapse .no-js .collapse { display: block!important; } diff --git a/templates/default/assets/less/thelia/import.less b/templates/default/assets/less/thelia/import.less index b18246f32..594ee91b3 100755 --- a/templates/default/assets/less/thelia/import.less +++ b/templates/default/assets/less/thelia/import.less @@ -30,5 +30,5 @@ // Thelia : Pages @import "page-home.less"; +@import "page-error.less"; //@import "page-login.less"; -//@import "page-error.less"; \ No newline at end of file diff --git a/templates/default/assets/less/thelia/page-error.less b/templates/default/assets/less/thelia/page-error.less new file mode 100755 index 000000000..8f5f1df72 --- /dev/null +++ b/templates/default/assets/less/thelia/page-error.less @@ -0,0 +1,15 @@ +// 404 Page +.page-404 { + .main { padding: 10px 0 100px; } + #main-label { + color: @brand-primary; + font-size: 9em; font-weight: bold; + text-align: center; + + span{ + color : #CCC; + display: block; + font-size: 15px; font-weight: normal; + } + } +} diff --git a/templates/default/assets/themes/default/less/theme.less b/templates/default/assets/themes/default/less/theme.less index f07461c56..b9e6689ef 100755 --- a/templates/default/assets/themes/default/less/theme.less +++ b/templates/default/assets/themes/default/less/theme.less @@ -25,6 +25,13 @@ body { padding-top: 80px; } } } +.has-error .help-block { + &:before { + .icon(@remove); + margin-right: .3em; + } +} + label { font-weight: 600; } // Dropdowns @@ -1045,6 +1052,7 @@ td.product, .fn { font-size: 16px; font-weight: 600; } .list-info { + .mobile, .tel, .email { &:before { @@ -1054,7 +1062,8 @@ td.product, vertical-align: middle; } } - .tel:before { .icon(@mobile-phone); font-size: 30px; } + .mobile:before { .icon(@mobile-phone); font-size: 30px; } + .tel:before { .icon(@phone); font-size: 22px; } .email:before { .icon(@envelope); font-size: 18px; } } .group-btn { diff --git a/templates/default/cart.html b/templates/default/cart.html index 00689bd3e..73cd57ddc 100644 --- a/templates/default/cart.html +++ b/templates/default/cart.html @@ -18,12 +18,7 @@ {nocache} {ifloop rel="cartloop"} - + {include file="misc/checkout-progress.tpl" step="cart"} @@ -49,7 +44,7 @@ {intl l="Qty"} @@ -105,7 +100,7 @@
      - {for $will=1 to $STOCK} {/for} @@ -163,16 +158,4 @@ {/ifloop}
      -{/block} - -{block name="javascript-initialization"} - {/block} \ No newline at end of file diff --git a/templates/default/contact.html b/templates/default/contact.html index 2b0c7e7a9..66fc784f6 100644 --- a/templates/default/contact.html +++ b/templates/default/contact.html @@ -25,12 +25,12 @@
      {form_field form=$form field="name"} -
      +
      - + {if $error } - {$message} + {$message} {assign var="error_focus" value="true"} {elseif $value != "" && !$error} @@ -39,44 +39,38 @@
      {/form_field} {form_field form=$form field="email"} -
      +
      - + {if $error } - {$message} + {$message} {assign var="error_focus" value="true"} - {elseif $value != "" && !$error} - {/if}
      {/form_field}
      {form_field form=$form field="subject"} -
      +
      - + {if $error } - {$message} + {$message} {assign var="error_focus" value="true"} - {elseif $value != "" && !$error} - {/if}
      {/form_field} {form_field form=$form field="message"} -
      +
      - + {if $error } - {$message} + {$message} {assign var="error_focus" value="true"} - {elseif $value != "" && !$error} - {/if}
      diff --git a/templates/default/includes/mini-cart.html b/templates/default/includes/mini-cart.html index b91f73d83..2858d535b 100644 --- a/templates/default/includes/mini-cart.html +++ b/templates/default/includes/mini-cart.html @@ -21,13 +21,12 @@ {$TITLE} {/loop} {/ifloop} -
      - + {intl l="Total"}

      {$TITLE}

      - Remove + {intl l="Remove"}
      {if $IS_PROMO == 1} diff --git a/templates/default/layout.tpl b/templates/default/layout.tpl index 2c485b0a2..d89694ab5 100644 --- a/templates/default/layout.tpl +++ b/templates/default/layout.tpl @@ -48,6 +48,12 @@ GNU General Public License : http://www.gnu.org/licenses/ {block name="stylesheet"}{/block} + {* Favicon *} + {images file='assets/img/favicon.ico'}{/images} + {images file='assets/img/favicon.png'}{/images} + + + {* HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries *} {/form_field} {form_field form=$form field="firstname"} -
      +
      - + {if $error } - {$message} + {$message} {assign var="error_focus" value="true"} - {elseif $value != "" && !$error} - {/if}
      {/form_field} {form_field form=$form field="lastname"} -
      +
      - + {if $error } - {$message} + {$message} {assign var="error_focus" value="true"} - {elseif $value != "" && !$error} - {/if}
      {/form_field} {form_field form=$form field="email"} -
      +
      - + {if $error } - {$message} + {$message} {assign var="error_focus" value="true"} - {elseif $value != "" && !$error} - {/if}
      {/form_field} {form_field form=$form field="phone"} -
      +
      - + {if $error } - {$message} + {$message} {assign var="error_focus" value="true"} - {elseif $value != "" && !$error} - {/if}
      {/form_field} {form_field form=$form field="cellphone"} -
      +
      - + {if $error } - {$message} + {$message} {assign var="error_focus" value="true"} - {elseif $value != "" && !$error} - {/if}
      @@ -133,82 +121,72 @@
      {form_field form=$form field="company"} -
      +
      - + {if $error } - {$message} + {$message} {assign var="error_focus" value="true"} - {elseif $value != "" && !$error} - {/if}
      {/form_field} {form_field form=$form field="address1"} -
      +
      - + {if $error } - {$message} + {$message} {assign var="error_focus" value="true"} - {elseif $value != "" && !$error} - {/if}
      {/form_field} {form_field form=$form field="address2"} -
      +
      - + {if $error } - {$message} + {$message} {assign var="error_focus" value="true"} - {elseif $value != "" && !$error} - {/if}
      {/form_field} {form_field form=$form field="city"} -
      +
      - + {if $error } - {$message} + {$message} {assign var="error_focus" value="true"} - {elseif $value != "" && !$error} - {/if}
      {/form_field} {form_field form=$form field="zipcode"} -
      +
      - + {if $error } - {$message} + {$message} {assign var="error_focus" value="true"} - {elseif $value != "" && !$error} - {/if}
      {/form_field} {form_field form=$form field="country"} -
      +
      {if $error } - {$message} + {$message} {assign var="error_focus" value="true"} - {elseif $value != "" && !$error} - {/if}
      @@ -242,30 +218,26 @@
      {form_field form=$form field="password"} -
      +
      {if $error } - {$message} + {$message} {assign var="error_focus" value="true"} - {elseif $value != "" && !$error} - {/if}
      {/form_field} {form_field form=$form field="password_confirm"} -
      +
      {if $error } - {$message} + {$message} {assign var="error_focus" value="true"} - {elseif $value != "" && !$error} - {/if}
      @@ -281,7 +253,7 @@ I've read and agreed on Terms & Conditions. {if $error } - {$message} + {$message} {/if}