diff --git a/core/lib/Thelia/Action/Currency.php b/core/lib/Thelia/Action/Currency.php index 4e3bb45d4..5ed2fb875 100644 --- a/core/lib/Thelia/Action/Currency.php +++ b/core/lib/Thelia/Action/Currency.php @@ -34,6 +34,8 @@ use Thelia\Core\Event\TheliaEvents; use Thelia\Core\Event\CurrencyChangeEvent; use Thelia\Core\Event\CurrencyCreateEvent; use Thelia\Core\Event\CurrencyDeleteEvent; +use Thelia\Model\Map\CurrencyTableMap; +use Thelia\Model\ConfigQuery; class Currency extends BaseAction implements EventSubscriberInterface { @@ -53,11 +55,12 @@ class Currency extends BaseAction implements EventSubscriberInterface ->setName($event->getCurrencyName()) ->setSymbol($event->getSymbol()) ->setRate($event->getRate()) - ->setCode($event->getCode()) + ->setCode(strtoupper($event->getCode())) ->save() ; + $event->setCurrency($currency); } @@ -79,7 +82,7 @@ class Currency extends BaseAction implements EventSubscriberInterface ->setName($event->getCurrencyName()) ->setSymbol($event->getSymbol()) ->setRate($event->getRate()) - ->setCode($event->getCode()) + ->setCode(strtoupper($event->getCode())) ->save(); @@ -87,6 +90,32 @@ class Currency extends BaseAction implements EventSubscriberInterface } } + /** + * Set the default currency + * + * @param CurrencyChangeEvent $event + */ + public function setDefault(CurrencyChangeEvent $event) + { + $search = CurrencyQuery::create(); + + if (null !== $currency = CurrencyQuery::create()->findOneById($event->getCurrencyId())) { + + if ($currency->getByDefault() != $event->getIsDefault()) { + + // Reset default status + CurrencyQuery::create()->filterByByDefault(true)->update(array('ByDefault' => false)); + + $currency + ->setByDefault($event->getIsDefault()) + ->save() + ; + } + + $event->setCurrency($currency); + } + } + /** * Delete a currencyuration entry * @@ -106,15 +135,41 @@ class Currency extends BaseAction implements EventSubscriberInterface } } + public function updateRates() { + + $rates_url = ConfigQuery::read('currency_rate_update_url', 'http://www.ecb.int/stats/eurofxref/eurofxref-daily.xml'); + + $rate_data = file_get_contents($rates_url); + + if ($rate_data && $sxe = new \SimpleXMLElement($rate_data)) { + + foreach ($sxe->Cube[0]->Cube[0]->Cube as $last) + { + $code = strtoupper($last["currency"]); + $rate = floatval($last['rate']); + + if (null !== $currency = CurrencyQuery::create()->findOneByCode($code)) { + $currency->setRate($rate)->save(); + } + } + } + else { + throw new \RuntimeException(sprintf("Failed to get currency rates data from URL %s", $url)); + } + } + /** * {@inheritDoc} */ public static function getSubscribedEvents() { return array( - TheliaEvents::CURRENCY_CREATE => array("create", 128), - TheliaEvents::CURRENCY_MODIFY => array("modify", 128), - TheliaEvents::CURRENCY_DELETE => array("delete", 128), + TheliaEvents::CURRENCY_CREATE => array("create", 128), + TheliaEvents::CURRENCY_MODIFY => array("modify", 128), + TheliaEvents::CURRENCY_DELETE => array("delete", 128), + TheliaEvents::CURRENCY_SET_DEFAULT => array("setDefault", 128), + TheliaEvents::CURRENCY_UPDATE_RATES => array("updateRates", 128), + ); } } diff --git a/core/lib/Thelia/Action/PageNotFound.php b/core/lib/Thelia/Action/PageNotFound.php new file mode 100755 index 000000000..c6f547fc4 --- /dev/null +++ b/core/lib/Thelia/Action/PageNotFound.php @@ -0,0 +1,84 @@ +. */ +/* */ +/*************************************************************************************/ + +namespace Thelia\Action; + +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\EventDispatcher\EventSubscriberInterface; +use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent; +use Symfony\Component\HttpKernel\KernelEvents; +use Thelia\Model\ConfigQuery; + +/** + * + * Class PageNotFound + * @package Thelia\Action + * @author Etienne Roudeix + */ +class PageNotFound extends BaseAction implements EventSubscriberInterface +{ + public function display404(GetResponseForExceptionEvent $event) + { + if(is_a($event->getException(), 'Symfony\Component\HttpKernel\Exception\NotFoundHttpException')) { + + $parser = $this->container->get("thelia.parser"); + + // Define the template thant shoud be used + $parser->setTemplate(ConfigQuery::getActiveTemplate()); + + //$event->getRequest()->attributes->set('_view', ConfigQuery::getPageNotFoundView()); + + $response = new Response($parser->render(ConfigQuery::getPageNotFoundView()), 404); + + $event->setResponse($response); + } + } + + /** + * Returns an array of event names this subscriber wants to listen to. + * + * The array keys are event names and the value can be: + * + * * The method name to call (priority defaults to 0) + * * An array composed of the method name to call and the priority + * * An array of arrays composed of the method names to call and respective + * priorities, or 0 if unset + * + * For instance: + * + * * array('eventName' => 'methodName') + * * array('eventName' => array('methodName', $priority)) + * * array('eventName' => array(array('methodName1', $priority), array('methodName2')) + * + * @return array The event names to listen to + * + * @api + */ + public static function getSubscribedEvents() + { + return array( + KernelEvents::EXCEPTION => array("display404", 128), + ); + } +} diff --git a/core/lib/Thelia/Config/Resources/action.xml b/core/lib/Thelia/Config/Resources/action.xml index bcc162e24..7eea2e005 100755 --- a/core/lib/Thelia/Config/Resources/action.xml +++ b/core/lib/Thelia/Config/Resources/action.xml @@ -47,6 +47,11 @@ + + + + + diff --git a/core/lib/Thelia/Config/Resources/config.xml b/core/lib/Thelia/Config/Resources/config.xml index 17aa2d441..eda938f2b 100755 --- a/core/lib/Thelia/Config/Resources/config.xml +++ b/core/lib/Thelia/Config/Resources/config.xml @@ -167,17 +167,23 @@ - + - + + + + + + + diff --git a/core/lib/Thelia/Config/Resources/routing/admin.xml b/core/lib/Thelia/Config/Resources/routing/admin.xml index 627fa9bf3..58645d531 100755 --- a/core/lib/Thelia/Config/Resources/routing/admin.xml +++ b/core/lib/Thelia/Config/Resources/routing/admin.xml @@ -101,6 +101,14 @@ Thelia\Controller\Admin\CurrencyController::saveChangeAction + + Thelia\Controller\Admin\CurrencyController::setDefaultAction + + + + Thelia\Controller\Admin\CurrencyController::updateRatesAction + + Thelia\Controller\Admin\CurrencyController::deleteAction diff --git a/core/lib/Thelia/Config/Resources/routing/front.xml b/core/lib/Thelia/Config/Resources/routing/front.xml index ec2e80db8..500fe7427 100755 --- a/core/lib/Thelia/Config/Resources/routing/front.xml +++ b/core/lib/Thelia/Config/Resources/routing/front.xml @@ -49,5 +49,8 @@ Thelia\Controller\Front\CartController::changeItem cart - + + + Thelia\Controller\Front\UrlRewritingController::check + diff --git a/core/lib/Thelia/Controller/Admin/BaseAdminController.php b/core/lib/Thelia/Controller/Admin/BaseAdminController.php index 8160033fe..949344685 100755 --- a/core/lib/Thelia/Controller/Admin/BaseAdminController.php +++ b/core/lib/Thelia/Controller/Admin/BaseAdminController.php @@ -150,12 +150,33 @@ class BaseAdminController extends BaseController return $this->container->get('http_kernel')->handle($subRequest, HttpKernelInterface::SUB_REQUEST); } + /** + * Return the route path defined for the givent route ID + * + * @param string $routeId a route ID, as defines in Config/Resources/routing/admin.xml + * + * @see \Thelia\Controller\BaseController::getRouteFromRouter() + */ + protected function getRoute($routeId) { + return $this->getRouteFromRouter('router.admin', $routeId); + } + + /** + * Redirect to à route ID related URL + * + * @param unknown $routeId the route ID, as found in Config/Resources/routing/admin.xml + * @param unknown $urlParameters the URL parametrs, as a var/value pair array + */ + public function redirectToRoute($routeId, $urlParameters = array()) { + $this->redirect(URL::absoluteUrl($this->getRoute($routeId), $urlParameters)); + } + /** * Get the current edition lang ID, checking if a change was requested in the current request */ protected function getCurrentEditionLangId() { return $this->getRequest()->get( - 'edition_language', + 'edit_language_id', $this->getSession()->getAdminEditionLangId() ); } @@ -196,29 +217,32 @@ class BaseAdminController extends BaseController $session = $this->getSession(); - // Find the current edit language ID $edition_language = $this->getCurrentEditionLangId(); // Current back-office (not edition) language - $current_lang = LangQuery::create()->findOneById($session->getLangId()); + $current_lang = LangQuery::create()->findOneById($session->getLangId()); + + // Find the current edit language ID + $edition_language = LangQuery::create()->findOneById($this->getCurrentEditionLangId()); // Prepare common template variables $args = array_merge($args, array( - 'locale' => $session->getLocale(), - 'lang_code' => $session->getLang(), - 'lang_id' => $session->getLangId(), + 'locale' => $session->getLocale(), + 'lang_code' => $session->getLang(), + 'lang_id' => $session->getLangId(), - 'datetime_format' => $current_lang->getDateTimeFormat(), - 'date_format' => $current_lang->getDateFormat(), - 'time_format' => $current_lang->getTimeFormat(), + 'datetime_format' => $current_lang->getDateTimeFormat(), + 'date_format' => $current_lang->getDateFormat(), + 'time_format' => $current_lang->getTimeFormat(), - 'edition_language' => $edition_language, + 'edit_language_id' => $edition_language->getId(), + 'edit_language_locale' => $edition_language->getLocale(), - 'current_url' => htmlspecialchars($this->getRequest()->getUri()) + 'current_url' => htmlspecialchars($this->getRequest()->getUri()) )); // Update the current edition language in session - $this->getSession()->setAdminEditionLangId($edition_language); + $this->getSession()->setAdminEditionLangId($edition_language->getId()); // Render the template. try { diff --git a/core/lib/Thelia/Controller/Admin/CategoryController.php b/core/lib/Thelia/Controller/Admin/CategoryController.php index 9966034f8..6cba34e39 100755 --- a/core/lib/Thelia/Controller/Admin/CategoryController.php +++ b/core/lib/Thelia/Controller/Admin/CategoryController.php @@ -188,7 +188,7 @@ class CategoryController extends BaseAdminController // Find the current order $category_order = $this->getRequest()->get( - 'category_order', + 'order', $this->getSession()->get('admin.category_order', 'manual') ); diff --git a/core/lib/Thelia/Controller/Admin/ConfigController.php b/core/lib/Thelia/Controller/Admin/ConfigController.php index 8f761ed7e..f7e62ff19 100644 --- a/core/lib/Thelia/Controller/Admin/ConfigController.php +++ b/core/lib/Thelia/Controller/Admin/ConfigController.php @@ -42,6 +42,25 @@ use Thelia\Form\ConfigCreationForm; */ class ConfigController extends BaseAdminController { + /** + * Render the currencies list, ensuring the sort order is set. + * + * @return Symfony\Component\HttpFoundation\Response the response + */ + protected function renderList() { + + // Find the current order + $order = $this->getRequest()->get( + 'order', + $this->getSession()->get('admin.variables_order', 'name') + ); + + // Store the current sort order in session + $this->getSession()->set('admin.variables_order', $order); + + return $this->render('variables', array('order' => $order)); + } + /** * The default action is displaying the variables list. * @@ -51,7 +70,7 @@ class ConfigController extends BaseAdminController if (null !== $response = $this->checkAuth("admin.configuration.variables.view")) return $response; - return $this->render('variables'); + return $this->renderList(); } /** @@ -124,7 +143,7 @@ class ConfigController extends BaseAdminController } // At this point, the form has error, and should be redisplayed. - return $this->render('variables'); + return $this->renderList(); } /** @@ -220,10 +239,11 @@ class ConfigController extends BaseAdminController // If we have to stay on the same page, do not redirect to the succesUrl, // just redirect to the edit page again. if ($this->getRequest()->get('save_mode') == 'stay') { - $this->redirect(URL::absoluteUrl( - "admin/configuration/variables/change", + + $this->redirectToRoute( + "admin.configuration.variables.change", array('variable_id' => $variable_id) - )); + ); } // Redirect to the success URL @@ -276,7 +296,7 @@ class ConfigController extends BaseAdminController $this->dispatch(TheliaEvents::CONFIG_SETVALUE, $event); } - $this->redirect(URL::adminViewUrl('variables')); + $this->redirectToRoute('admin.configuration.variables.default'); } /** @@ -294,6 +314,6 @@ class ConfigController extends BaseAdminController $this->dispatch(TheliaEvents::CONFIG_DELETE, $event); - $this->redirect(URL::adminViewUrl('variables')); + $this->redirectToRoute('admin.configuration.variables.default'); } } \ No newline at end of file diff --git a/core/lib/Thelia/Controller/Admin/CurrencyController.php b/core/lib/Thelia/Controller/Admin/CurrencyController.php index 69cc60117..2fae3315b 100644 --- a/core/lib/Thelia/Controller/Admin/CurrencyController.php +++ b/core/lib/Thelia/Controller/Admin/CurrencyController.php @@ -83,7 +83,7 @@ class CurrencyController extends BaseAdminController // Check current user authorization if (null !== $response = $this->checkAuth("admin.configuration.currencies.create")) return $response; - $currency = false; + $error_msg = false; // Create the Creation Form $creationForm = new CurrencyCreationForm($this->getRequest()); @@ -101,7 +101,9 @@ class CurrencyController extends BaseAdminController ->setCurrencyName($data['name']) ->setLocale($data["locale"]) ->setSymbol($data['symbol']) - ; + ->setCode($data['code']) + ->setRate($data['rate']) + ; $this->dispatch(TheliaEvents::CURRENCY_CREATE, $createEvent); @@ -118,24 +120,24 @@ class CurrencyController extends BaseAdminController } catch (FormValidationException $ex) { // Form cannot be validated - $currency = sprintf("Please check your input: %s", $ex->getCurrency()); + $error_msg = sprintf("Please check your input: %s", $ex->getMessage()); } catch (\Exception $ex) { // Any other error - $currency = sprintf("Sorry, an error occured: %s", $ex->getCurrency()); + $error_msg = sprintf("Sorry, an error occured: %s", $ex->getMessage()); } - if ($currency !== false) { + if ($error_msg !== false) { // An error has been detected: log it - Tlog::getInstance()->error(sprintf("Error during currency creation process : %s. Exception was %s", $currency, $ex->getCurrency())); + Tlog::getInstance()->error(sprintf("Error during currency creation process : %s. Exception was %s", $error_msg, $ex->getMessage())); // Mark the form as errored - $creationForm->setErrorCurrency($currency); + $creationForm->setErrorMessage($error_msg); // Pass it to the parser, along with the error currency $this->getParserContext() ->addForm($creationForm) - ->setGeneralError($currency) + ->setGeneralError($error_msg) ; } @@ -167,7 +169,7 @@ class CurrencyController extends BaseAdminController 'locale' => $currency->getLocale(), 'code' => $currency->getCode(), 'symbol' => $currency->getSymbol(), - 'rate' => $currency->getSubject() + 'rate' => $currency->getRate() ); // Setup the object form @@ -191,7 +193,7 @@ class CurrencyController extends BaseAdminController // Check current user authorization if (null !== $response = $this->checkAuth("admin.configuration.currencies.change")) return $response; - $currency = false; + $error_msg = false; // Create the form from the request $changeForm = new CurrencyModificationForm($this->getRequest()); @@ -228,10 +230,10 @@ class CurrencyController extends BaseAdminController // If we have to stay on the same page, do not redirect to the succesUrl, // just redirect to the edit page again. if ($this->getRequest()->get('save_mode') == 'stay') { - $this->redirect(URL::absoluteUrl( - "admin/configuration/currencies/change", + $this->redirectToRoute( + "admin.configuration.currencies.change", array('currency_id' => $currency_id) - )); + ); } // Redirect to the success URL @@ -239,24 +241,24 @@ class CurrencyController extends BaseAdminController } catch (FormValidationException $ex) { // Invalid data entered - $currency = sprintf("Please check your input: %s", $ex->getCurrency()); + $error_msg = sprintf("Please check your input: %s", $ex->getMessage()); } catch (\Exception $ex) { // Any other error - $currency = sprintf("Sorry, an error occured: %s", $ex->getCurrency()); + $error_msg = sprintf("Sorry, an error occured: %s", $ex->getMessage()); } - if ($currency !== false) { + if ($error_msg !== false) { // Log error currency - Tlog::getInstance()->error(sprintf("Error during currency modification process : %s. Exception was %s", $currency, $ex->getCurrency())); + Tlog::getInstance()->error(sprintf("Error during currency modification process : %s. Exception was %s", $error_msg, $ex->getMessage())); // Mark the form as errored - $changeForm->setErrorCurrency($currency); + $changeForm->setErrorMessage($error_msg); // Pas the form and the error to the parser $this->getParserContext() ->addForm($changeForm) - ->setGeneralError($currency) + ->setGeneralError($error_msg) ; } @@ -264,6 +266,47 @@ class CurrencyController extends BaseAdminController return $this->render('currency-edit', array('currency_id' => $currency_id)); } + /** + * Sets the default currency + */ + public function setDefaultAction() { + // Check current user authorization + if (null !== $response = $this->checkAuth("admin.configuration.currencies.change")) return $response; + + $changeEvent = new CurrencyChangeEvent($this->getRequest()->get('currency_id', 0)); + + // Create and dispatch the change event + $changeEvent->setIsDefault(true); + + try { + $this->dispatch(TheliaEvents::CURRENCY_SET_DEFAULT, $changeEvent); + } + catch (\Exception $ex) { + // Any error + return $this->errorPage(sprintf("Sorry, an error occured: %s", $ex->getMessage())); + } + + $this->redirectToRoute('admin.configuration.currencies.default'); + } + + /** + * Update currencies rates + */ + public function updateRatesAction() { + // Check current user authorization + if (null !== $response = $this->checkAuth("admin.configuration.currencies.change")) return $response; + + try { + $this->dispatch(TheliaEvents::CURRENCY_UPDATE_RATES); + } + catch (\Exception $ex) { + // Any error + return $this->errorPage(sprintf("Sorry, an error occured: %s", $ex->getMessage())); + } + + $this->redirectToRoute('admin.configuration.currencies.default'); + } + /** * Delete a currency object * @@ -279,6 +322,6 @@ class CurrencyController extends BaseAdminController $this->dispatch(TheliaEvents::CURRENCY_DELETE, $event); - $this->redirect(URL::adminViewUrl('currencies')); + $this->redirectToRoute('admin.configuration.currencies.default'); } } \ No newline at end of file diff --git a/core/lib/Thelia/Controller/Admin/MessageController.php b/core/lib/Thelia/Controller/Admin/MessageController.php index 5a53fd28a..29ee83df4 100644 --- a/core/lib/Thelia/Controller/Admin/MessageController.php +++ b/core/lib/Thelia/Controller/Admin/MessageController.php @@ -214,10 +214,10 @@ class MessageController extends BaseAdminController // If we have to stay on the same page, do not redirect to the succesUrl, // just redirect to the edit page again. if ($this->getRequest()->get('save_mode') == 'stay') { - $this->redirect(URL::absoluteUrl( - "admin/configuration/messages/change", + $this->redirectToRoute( + "admin.configuration.messages.change", array('message_id' => $message_id) - )); + ); } // Redirect to the success URL diff --git a/core/lib/Thelia/Controller/Admin/SessionController.php b/core/lib/Thelia/Controller/Admin/SessionController.php index 552fea8eb..a377df208 100755 --- a/core/lib/Thelia/Controller/Admin/SessionController.php +++ b/core/lib/Thelia/Controller/Admin/SessionController.php @@ -46,7 +46,7 @@ class SessionController extends BaseAdminController $this->getSecurityContext()->clearAdminUser(); // Go back to login page. - return Redirect::exec(URL::absoluteUrl('/admin/login')); // FIXME - should be a parameter + $this->redirectToRoute('admin.login'); } public function checkLoginAction() diff --git a/core/lib/Thelia/Controller/BaseController.php b/core/lib/Thelia/Controller/BaseController.php index c7c9f6f14..853776214 100755 --- a/core/lib/Thelia/Controller/BaseController.php +++ b/core/lib/Thelia/Controller/BaseController.php @@ -31,11 +31,12 @@ use Thelia\Tools\Redirect; use Thelia\Core\Template\ParserContext; use Thelia\Core\Event\ActionEvent; use Symfony\Component\EventDispatcher\EventDispatcher; -use Thelia\Core\Factory\ActionEventFactory; use Thelia\Form\BaseForm; use Thelia\Form\Exception\FormValidationException; use Symfony\Component\EventDispatcher\Event; use Thelia\Core\Event\DefaultActionEvent; +use Symfony\Component\Routing\Generator\UrlGeneratorInterface; +use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; /** * @@ -177,9 +178,9 @@ class BaseController extends ContainerAware * * @param string $url */ - public function redirect($url) + public function redirect($url, $status = 302) { - Redirect::exec($url); + Redirect::exec($url, $status); } /** @@ -200,4 +201,32 @@ class BaseController extends ContainerAware if (null !== $url) $this->redirect($url); } -} + + /** + * Get a route path from the route id. + * + * @param $routerName + * @param $routeId + * + * @return mixed + * @throws InvalidArgumentException + */ + protected function getRouteFromRouter($routerName, $routeId) { + $route = $this->container->get($routerName)->getRouteCollection()->get($routeId); + + if ($route == null) { + throw new InvalidArgumentException(sprintf("Route ID '%s' does not exists.", $routeId)); + } + + return $route->getPath(); + } + + /** + * Return a 404 error + * @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException + */ + protected function pageNotFound() + { + throw new NotFoundHttpException(); + } +} \ No newline at end of file diff --git a/core/lib/Thelia/Controller/Front/BaseFrontController.php b/core/lib/Thelia/Controller/Front/BaseFrontController.php index c466ab0c6..b6d4a6f93 100755 --- a/core/lib/Thelia/Controller/Front/BaseFrontController.php +++ b/core/lib/Thelia/Controller/Front/BaseFrontController.php @@ -26,4 +26,24 @@ use Thelia\Controller\BaseController; class BaseFrontController extends BaseController { + /** + * Return the route path defined for the givent route ID + * + * @param string $routeId a route ID, as defines in Config/Resources/routing/front.xml + * + * @see \Thelia\Controller\BaseController::getRouteFromRouter() + */ + protected function getRoute($routeId) { + return $this->getRouteFromRouter('router.front', $routeId); + } + + /** + * Redirect to à route ID related URL + * + * @param unknown $routeId the route ID, as found in Config/Resources/routing/admin.xml + * @param unknown $urlParameters the URL parametrs, as a var/value pair array + */ + public function redirectToRoute($routeId, $urlParameters = array()) { + $this->redirect(URL::absoluteUrl($this->getRoute($routeId), $urlParameters)); + } } diff --git a/core/lib/Thelia/Controller/Front/DefaultController.php b/core/lib/Thelia/Controller/Front/DefaultController.php index 235e1bb64..d9c5a681a 100755 --- a/core/lib/Thelia/Controller/Front/DefaultController.php +++ b/core/lib/Thelia/Controller/Front/DefaultController.php @@ -23,6 +23,9 @@ namespace Thelia\Controller\Front; use Symfony\Component\HttpFoundation\Request; +use Thelia\Model\ConfigQuery; +use Thelia\Tools\Redirect; +use Thelia\Tools\URL; /** * @@ -43,6 +46,16 @@ class DefaultController extends BaseFrontController */ public function noAction(Request $request) { + if(ConfigQuery::isRewritingEnable()) { + + /* Does the query GET parameters match a rewritten URL ? */ + $rewrittenUrl = URL::init()->retrieveCurrent($request); + if($rewrittenUrl->rewrittenUrl !== null) { + /* 301 redirection to rewritten URL */ + $this->redirect($rewrittenUrl->rewrittenUrl, 301); + } + } + if (! $view = $request->query->get('view')) { $view = "index"; if ($request->request->has('view')) { diff --git a/core/lib/Thelia/Controller/Front/UrlRewritingController.php b/core/lib/Thelia/Controller/Front/UrlRewritingController.php new file mode 100755 index 000000000..df2479969 --- /dev/null +++ b/core/lib/Thelia/Controller/Front/UrlRewritingController.php @@ -0,0 +1,81 @@ +. */ +/* */ +/*************************************************************************************/ +namespace Thelia\Controller\Front; + +use Thelia\Core\HttpFoundation\Request; +use Thelia\Exception\UrlRewritingException; +use Thelia\Model\ConfigQuery; +use Thelia\Tools\URL; + +class UrlRewritingController extends BaseFrontController +{ + public function check(Request $request, $rewritten_url) + { + if(ConfigQuery::isRewritingEnable()) { + try { + $rewrittenUrlData = URL::init()->resolve($rewritten_url); + } catch(UrlRewritingException $e) { + switch($e->getCode()) { + case UrlRewritingException::URL_NOT_FOUND : + return $this->pageNotFound(); + break; + default: + throw $e; + } + } + + /* is the URL redirected ? */ + + if(null !== $rewrittenUrlData->redirectedToUrl) { + $this->redirect($rewrittenUrlData->redirectedToUrl, 301); + } + + /* define GET arguments in request */ + + if(null !== $rewrittenUrlData->view) { + $request->query->set('view', $rewrittenUrlData->view); + if(null !== $rewrittenUrlData->viewId) { + $request->query->set($rewrittenUrlData->view . '_id', $rewrittenUrlData->viewId); + } + } + if(null !== $rewrittenUrlData->locale) { + $request->query->set('locale', $rewrittenUrlData->locale); + } + + foreach($rewrittenUrlData->otherParameters as $parameter => $value) { + $request->query->set($parameter, $value); + } + } + + if (! $view = $request->query->get('view')) { + $view = "index"; + if ($request->request->has('view')) { + $view = $request->request->get('view'); + } + } + + $request->attributes->set('_view', $view); + + } + +} diff --git a/core/lib/Thelia/Core/Event/CurrencyChangeEvent.php b/core/lib/Thelia/Core/Event/CurrencyChangeEvent.php index f94d71b88..1e7677fee 100644 --- a/core/lib/Thelia/Core/Event/CurrencyChangeEvent.php +++ b/core/lib/Thelia/Core/Event/CurrencyChangeEvent.php @@ -27,6 +27,7 @@ use Thelia\Model\Currency; class CurrencyChangeEvent extends CurrencyCreateEvent { protected $currency_id; + protected $is_default; public function __construct($currency_id) { @@ -44,4 +45,16 @@ class CurrencyChangeEvent extends CurrencyCreateEvent return $this; } -} \ No newline at end of file + + public function getIsDefault() + { + return $this->is_default; + } + + public function setIsDefault($is_default) + { + $this->is_default = $is_default; + + return $this; + } +} diff --git a/core/lib/Thelia/Core/Event/CurrencyCreateEvent.php b/core/lib/Thelia/Core/Event/CurrencyCreateEvent.php index fba23a09b..d9d345ddd 100644 --- a/core/lib/Thelia/Core/Event/CurrencyCreateEvent.php +++ b/core/lib/Thelia/Core/Event/CurrencyCreateEvent.php @@ -65,6 +65,8 @@ class CurrencyCreateEvent extends CurrencyEvent public function setSymbol($symbol) { $this->symbol = $symbol; + + return $this; } public function getCode() diff --git a/core/lib/Thelia/Core/Event/TheliaEvents.php b/core/lib/Thelia/Core/Event/TheliaEvents.php index e32be723f..e11ce4d9b 100755 --- a/core/lib/Thelia/Core/Event/TheliaEvents.php +++ b/core/lib/Thelia/Core/Event/TheliaEvents.php @@ -215,9 +215,11 @@ final class TheliaEvents // -- Currencies management --------------------------------------------- - const CURRENCY_CREATE = "action.createCurrency"; - const CURRENCY_MODIFY = "action.changeCurrency"; - const CURRENCY_DELETE = "action.deleteCurrency"; + const CURRENCY_CREATE = "action.createCurrency"; + const CURRENCY_MODIFY = "action.changeCurrency"; + const CURRENCY_DELETE = "action.deleteCurrency"; + const CURRENCY_SET_DEFAULT = "action.setDefaultCurrency"; + const CURRENCY_UPDATE_RATES = "action.updateCurrencyRates"; const BEFORE_CREATECURRENCY = "action.before_createCurrency"; const AFTER_CREATECURRENCY = "action.after_createCurrency"; diff --git a/core/lib/Thelia/Core/Template/Loop/Address.php b/core/lib/Thelia/Core/Template/Loop/Address.php index eb837eb4b..43bbbaefb 100755 --- a/core/lib/Thelia/Core/Template/Loop/Address.php +++ b/core/lib/Thelia/Core/Template/Loop/Address.php @@ -114,22 +114,24 @@ class Address extends BaseLoop foreach ($addresses as $address) { $loopResultRow = new LoopResultRow(); - $loopResultRow->set("ID", $address->getId()); - $loopResultRow->set("NAME", $address->getName()); - $loopResultRow->set("CUSTOMER", $address->getCustomerId()); - $loopResultRow->set("TITLE", $address->getTitleId()); - $loopResultRow->set("COMPANY", $address->getCompany()); - $loopResultRow->set("FIRSTNAME", $address->getFirstname()); - $loopResultRow->set("LASTNAME", $address->getLastname()); - $loopResultRow->set("ADDRESS1", $address->getAddress1()); - $loopResultRow->set("ADDRESS2", $address->getAddress2()); - $loopResultRow->set("ADDRESS3", $address->getAddress3()); - $loopResultRow->set("ZIPCODE", $address->getZipcode()); - $loopResultRow->set("CITY", $address->getCity()); - $loopResultRow->set("COUNTRY", $address->getCountryId()); - $loopResultRow->set("PHONE", $address->getPhone()); - $loopResultRow->set("CELLPHONE", $address->getCellphone()); - $loopResultRow->set("DEFAULT", $address->getIsDefault()); + $loopResultRow + ->set("ID", $address->getId()) + ->set("NAME", $address->getName()) + ->set("CUSTOMER", $address->getCustomerId()) + ->set("TITLE", $address->getTitleId()) + ->set("COMPANY", $address->getCompany()) + ->set("FIRSTNAME", $address->getFirstname()) + ->set("LASTNAME", $address->getLastname()) + ->set("ADDRESS1", $address->getAddress1()) + ->set("ADDRESS2", $address->getAddress2()) + ->set("ADDRESS3", $address->getAddress3()) + ->set("ZIPCODE", $address->getZipcode()) + ->set("CITY", $address->getCity()) + ->set("COUNTRY", $address->getCountryId()) + ->set("PHONE", $address->getPhone()) + ->set("CELLPHONE", $address->getCellphone()) + ->set("DEFAULT", $address->getIsDefault()) + ; $loopResult->addRow($loopResultRow); } diff --git a/core/lib/Thelia/Core/Template/Loop/CategoryTree.php b/core/lib/Thelia/Core/Template/Loop/CategoryTree.php index 63f1e9cfb..afcd0410e 100755 --- a/core/lib/Thelia/Core/Template/Loop/CategoryTree.php +++ b/core/lib/Thelia/Core/Template/Loop/CategoryTree.php @@ -107,8 +107,6 @@ class CategoryTree extends BaseI18nLoop $visible = $this->getVisible(); $exclude = $this->getExclude(); - //echo "exclude=".print_r($exclude); - $loopResult = new LoopResult(); $this->buildCategoryTree($id, $visible, 0, $depth, $exclude, $loopResult); diff --git a/core/lib/Thelia/Core/Template/Loop/Config.php b/core/lib/Thelia/Core/Template/Loop/Config.php index 5cc1b2b44..f8819afef 100644 --- a/core/lib/Thelia/Core/Template/Loop/Config.php +++ b/core/lib/Thelia/Core/Template/Loop/Config.php @@ -34,6 +34,8 @@ use Thelia\Model\LangQuery; use Thelia\Core\Template\Loop\Argument\ArgumentCollection; use Thelia\Model\ConfigQuery; use Thelia\Type\BooleanOrBothType; +use Thelia\Type\TypeCollection; +use Thelia\Type\EnumListType; /** * Config loop, to access configuration variables @@ -59,7 +61,21 @@ class Config extends BaseI18nLoop Argument::createIntListTypeArgument('exclude'), Argument::createAnyTypeArgument('variable'), Argument::createBooleanOrBothTypeArgument('hidden'), - Argument::createBooleanOrBothTypeArgument('secured') + Argument::createBooleanOrBothTypeArgument('secured'), + new Argument( + 'order', + new TypeCollection( + new EnumListType( + array( + 'id', 'id_reverse', + 'name', 'name_reverse', + 'title', 'title_reverse', + 'value', 'value_reverse', + ) + ) + ), + 'name' + ) ); } @@ -94,7 +110,39 @@ class Config extends BaseI18nLoop if (! is_null($secured) && $secured != BooleanOrBothType::ANY) $search->filterBySecured($secured ? 1 : 0); - $search->orderByName(Criteria::ASC); + $orders = $this->getOrder(); + + foreach($orders as $order) { + switch ($order) { + case 'id': + $search->orderById(Criteria::ASC); + break; + case 'id_reverse': + $search->orderById(Criteria::DESC); + break; + + case 'name': + $search->orderByName(Criteria::ASC); + break; + case 'name_reverse': + $search->orderByName(Criteria::DESC); + break; + + case 'title': + $search->addAscendingOrderByColumn('i18n_TITLE'); + break; + case 'title_reverse': + $search->addDescendingOrderByColumn('i18n_TITLE'); + break; + + case 'value': + $search->orderByValue(Criteria::ASC); + break; + case 'value_reverse': + $search->orderByValue(Criteria::DESC); + break; + } + } $results = $this->search($search, $pagination); @@ -116,9 +164,13 @@ class Config extends BaseI18nLoop ->set("POSTSCRIPTUM" , $result->getVirtualColumn('i18n_POSTSCRIPTUM')) ->set("HIDDEN" , $result->getHidden()) ->set("SECURED" , $result->getSecured()) - ->set("CREATE_DATE" , $result->getCreatedAt()) - ->set("UPDATE_DATE" , $result->getUpdatedAt()) - ; + + ->set("CREATE_DATE" , $result->getCreatedAt()) + ->set("UPDATE_DATE" , $result->getUpdatedAt()) + ->set("VERSION" , $result->getVersion()) + ->set("VERSION_DATE" , $result->getVersionCreatedAt()) + ->set("VERSION_AUTHOR" , $result->getVersionCreatedBy()) + ; $loopResult->addRow($loopResultRow); } diff --git a/core/lib/Thelia/Core/Template/Loop/Currency.php b/core/lib/Thelia/Core/Template/Loop/Currency.php index 2fb296070..6db6c6223 100755 --- a/core/lib/Thelia/Core/Template/Loop/Currency.php +++ b/core/lib/Thelia/Core/Template/Loop/Currency.php @@ -66,8 +66,9 @@ class Currency extends BaseI18nLoop 'code', 'code_reverse', 'symbol', 'symbol_reverse', 'rate', 'rate_reverse', + 'is_default', 'is_default_reverse', 'manual', 'manual_reverse') - ) + ) ), 'manual' ) @@ -143,6 +144,13 @@ class Currency extends BaseI18nLoop $search->orderByRate(Criteria::DESC); break; + case 'is_default': + $search->orderByByDefault(Criteria::ASC); + break; + case 'is_default_reverse': + $search->orderByByDefault(Criteria::DESC); + break; + case 'manual': $search->orderByPosition(Criteria::ASC); break; @@ -169,7 +177,11 @@ class Currency extends BaseI18nLoop ->set("SYMBOL" , $currency->getSymbol()) ->set("RATE" , $currency->getRate()) ->set("POSITION" , $currency->getPosition()) - ->set("IS_DEFAULT" , $currency->getByDefault()); + ->set("IS_DEFAULT" , $currency->getByDefault()) + + ->set("CREATE_DATE" , $currency->getCreatedAt()) + ->set("UPDATE_DATE" , $currency->getUpdatedAt()) + ; $loopResult->addRow($loopResultRow); } diff --git a/core/lib/Thelia/Core/Template/Loop/Product.php b/core/lib/Thelia/Core/Template/Loop/Product.php index a35ff90b3..17ecd3212 100755 --- a/core/lib/Thelia/Core/Template/Loop/Product.php +++ b/core/lib/Thelia/Core/Template/Loop/Product.php @@ -519,6 +519,12 @@ class Product extends BaseI18nLoop ->set("IS_PROMO", $product->getVirtualColumn('main_product_is_promo')) ->set("IS_NEW", $product->getVirtualColumn('main_product_is_new')) ->set("POSITION", $product->getPosition()) + + ->set("CREATE_DATE", $category->getCreatedAt()) + ->set("UPDATE_DATE", $category->getUpdatedAt()) + ->set("VERSION", $category->getVersion()) + ->set("VERSION_DATE", $category->getVersionCreatedAt()) + ->set("VERSION_AUTHOR", $category->getVersionCreatedBy()) ; $loopResult->addRow($loopResultRow); diff --git a/core/lib/Thelia/Core/Template/Smarty/Plugins/AdminUtilities.php b/core/lib/Thelia/Core/Template/Smarty/Plugins/AdminUtilities.php new file mode 100644 index 000000000..aab63177a --- /dev/null +++ b/core/lib/Thelia/Core/Template/Smarty/Plugins/AdminUtilities.php @@ -0,0 +1,144 @@ +. */ +/* */ +/*************************************************************************************/ + +namespace Thelia\Core\Template\Smarty\Plugins; + +use Thelia\Core\Template\Smarty\SmartyPluginDescriptor; +use Thelia\Core\Template\Smarty\AbstractSmartyPlugin; +use Thelia\Tools\URL; +use Thelia\Core\HttpFoundation\Request; +use Thelia\Core\Security\SecurityContext; + +/** + * This class implements variour admin template utilities + * + * @author Franck Allimant + */ +class AdminUtilities extends AbstractSmartyPlugin +{ + private $securityContext; + + public function __construct(SecurityContext $securityContext) + { + $this->securityContext = $securityContext; + } + + public function generatePositionChangeBlock($params, &$smarty) { + // The required permissions + $permission = $this->getParam($params, 'permission'); + + // The base position change path + $path = $this->getParam($params, 'path'); + + // The URL parameter the object ID is assigned + $url_parameter = $this->getParam($params, 'url_parameter'); + + // The current object position + $position = $this->getParam($params, 'position'); + + // The object ID + $id = $this->getParam($params, 'id'); + + // The in place dition class + $in_place_edit_class = $this->getParam($params, 'in_place_edit_class'); + + /* + + {$POSITION} + + */ + + if ($permissions == null || $this->securityContext->isGranted("ADMIN", array($permission))) { + return sprintf( + '%s', + URL::absoluteUrl("$path/positionUp", array($url_parameter => $id)), + $in_place_edit_class, + $id, + $position, + URL::absoluteUrl("$path/positionDown", array($url_parameter => $id)) + ); + } + else { + return $position; + } + } + + + /** + * Generates the link of a sortable column header + * + * @param array $params + * @param unknown $smarty + * @return string no text is returned. + */ + public function generateSortableColumnHeader($params, &$smarty) + { + // The current order of the table + $current_order = $this->getParam($params, 'current_order'); + + // The column ascending order + $order = $this->getParam($params, 'order'); + + // The column descending order label + $reverse_order = $this->getParam($params, 'reverse_order'); + + // The order change path + $path = $this->getParam($params, 'path'); + + // The column label + $label = $this->getParam($params, 'label'); + + if ($current_order == $order) { + $icon = 'up'; + $order_change = $reverse_order; + } + else if ($current_order == $reverse_order) { + $icon = 'down'; + $order_change = $order; + } + else { + $order_change = $order; + } + + if (! empty($icon)) + $output = sprintf(' ', $icon); + else + $output = ''; + + return sprintf('%s%s', $output, URL::absoluteUrl($path, array('order' => $order_change)), $label); + } + + + /** + * Define the various smarty plugins handled by this class + * + * @return an array of smarty plugin descriptors + */ + public function getPluginDescriptors() + { + return array( + new SmartyPluginDescriptor('function', 'admin_sortable_header', $this, 'generateSortableColumnHeader'), + new SmartyPluginDescriptor('function', 'admin_position_block' , $this, 'generatePositionChangeBlock'), + ); + } +} \ No newline at end of file diff --git a/core/lib/Thelia/Core/Template/Smarty/Plugins/UrlGenerator.php b/core/lib/Thelia/Core/Template/Smarty/Plugins/UrlGenerator.php index 33e699c43..635c03b8c 100755 --- a/core/lib/Thelia/Core/Template/Smarty/Plugins/UrlGenerator.php +++ b/core/lib/Thelia/Core/Template/Smarty/Plugins/UrlGenerator.php @@ -147,7 +147,7 @@ class UrlGenerator extends AbstractSmartyPlugin { return array( "current" => "getCurrentUrl", - "return_to" => "getReturnToUrl", + "return_to" => "getReturnToUrl", "index" => "getIndexUrl", ); } @@ -169,7 +169,9 @@ class UrlGenerator extends AbstractSmartyPlugin protected function getCurrentUrl() { - return URL::retrieveCurrent($this->request); + $retriever = URL::init()->retrieveCurrent($this->request); + + return $retriever->rewrittenUrl === null ? $retriever->url : $retriever->rewrittenUrl ; } protected function getReturnToUrl() diff --git a/core/lib/Thelia/Core/Template/Smarty/SmartyParser.php b/core/lib/Thelia/Core/Template/Smarty/SmartyParser.php index 12014e817..89c7eb457 100755 --- a/core/lib/Thelia/Core/Template/Smarty/SmartyParser.php +++ b/core/lib/Thelia/Core/Template/Smarty/SmartyParser.php @@ -36,6 +36,7 @@ class SmartyParser extends Smarty implements ParserInterface /** * @param Request $request * @param EventDispatcherInterface $dispatcher + * @param ParserContext $parserContext * @param bool $template * @param string $env * @param bool $debug diff --git a/core/lib/Thelia/Exception/UrlRewritingException.php b/core/lib/Thelia/Exception/UrlRewritingException.php new file mode 100755 index 000000000..0df566a6b --- /dev/null +++ b/core/lib/Thelia/Exception/UrlRewritingException.php @@ -0,0 +1,42 @@ +. */ +/* */ +/*************************************************************************************/ + +namespace Thelia\Exception; + +use Thelia\Log\Tlog; + +class UrlRewritingException extends \Exception +{ + const UNKNOWN_EXCEPTION = 0; + + const URL_NOT_FOUND = 404; + + const RESOLVER_NULL_SEARCH = 800; + + public function __construct($message, $code = null, $previous = null) { + if($code === null) { + $code = self::UNKNOWN_EXCEPTION; + } + parent::__construct($message, $code, $previous); + } +} diff --git a/core/lib/Thelia/Form/CurrencyCreationForm.php b/core/lib/Thelia/Form/CurrencyCreationForm.php index 11a496582..a4d858ed6 100644 --- a/core/lib/Thelia/Form/CurrencyCreationForm.php +++ b/core/lib/Thelia/Form/CurrencyCreationForm.php @@ -31,20 +31,20 @@ class CurrencyCreationForm extends BaseForm { protected function buildForm($change_mode = false) { - $name_constraints = array(new Constraints\NotBlank()); + $code_constraints = array(new Constraints\NotBlank()); if (!$change_mode) { - $name_constraints[] = new Constraints\Callback(array( - "methods" => array(array($this, "checkDuplicateName")) + $code_constraints[] = new Constraints\Callback(array( + "methods" => array(array($this, "checkDuplicateCode")) )); } $this->formBuilder - ->add("name" , "text" , array("constraints" => array($name_constraints))) - ->add("locale" , "text" , array()) + ->add("name" , "text" , array("constraints" => array(new NotBlank()))) + ->add("locale" , "text" , array("constraints" => array(new NotBlank()))) ->add("symbol" , "text" , array("constraints" => array(new NotBlank()))) ->add("rate" , "text" , array("constraints" => array(new NotBlank()))) - ->add("code" , "text" , array("constraints" => array(new NotBlank()))) + ->add("code" , "text" , array("constraints" => $code_constraints)) ; } @@ -53,12 +53,12 @@ class CurrencyCreationForm extends BaseForm return "thelia_currency_creation"; } - public function checkDuplicateName($value, ExecutionContextInterface $context) + public function checkDuplicateCode($value, ExecutionContextInterface $context) { - $currency = CurrencyQuery::create()->findOneByName($value); + $currency = CurrencyQuery::create()->findOneByCode($value); if ($currency) { - $context->addViolation(sprintf("A currency with name \"%s\" already exists.", $value)); + $context->addViolation(sprintf("A currency with code \"%s\" already exists.", $value)); } } diff --git a/core/lib/Thelia/Form/CurrencyModificationForm.php b/core/lib/Thelia/Form/CurrencyModificationForm.php index 6a4279d1b..3f0b1f152 100644 --- a/core/lib/Thelia/Form/CurrencyModificationForm.php +++ b/core/lib/Thelia/Form/CurrencyModificationForm.php @@ -34,8 +34,8 @@ class CurrencyModificationForm extends CurrencyCreationForm parent::buildForm(true); $this->formBuilder - ->add("id" , "hidden", array("constraints" => array(new GreaterThan(array('value' => 0))))) - ; + ->add("id", "hidden", array("constraints" => array(new GreaterThan(array('value' => 0))))) + ; } public function getName() diff --git a/core/lib/Thelia/Model/Category.php b/core/lib/Thelia/Model/Category.php index ae999ccc8..a3ad2ce77 100755 --- a/core/lib/Thelia/Model/Category.php +++ b/core/lib/Thelia/Model/Category.php @@ -23,7 +23,7 @@ class Category extends BaseCategory public function getUrl($locale) { - return URL::retrieve('category', $this->getId(), $locale); + return URL::init()->retrieve('category', $this->getId(), $locale); } /** diff --git a/core/lib/Thelia/Model/ConfigQuery.php b/core/lib/Thelia/Model/ConfigQuery.php index 4165f4f7c..87b506e93 100755 --- a/core/lib/Thelia/Model/ConfigQuery.php +++ b/core/lib/Thelia/Model/ConfigQuery.php @@ -32,4 +32,14 @@ class ConfigQuery extends BaseConfigQuery { { return self::read("rewriting_enable") == 1; } + + public static function getPageNotFoundView() + { + return self::read("page_not_found_view", '404.html'); + } + + public static function getActiveTemplate() + { + return self::read('active-template', 'default'); + } } // ConfigQuery diff --git a/core/lib/Thelia/Model/Content.php b/core/lib/Thelia/Model/Content.php index 1a797be89..f51915776 100755 --- a/core/lib/Thelia/Model/Content.php +++ b/core/lib/Thelia/Model/Content.php @@ -9,6 +9,6 @@ class Content extends BaseContent { public function getUrl($locale) { - return URL::retrieve('content', $this->getId(), $locale); + return URL::init()->retrieve('content', $this->getId(), $locale); } } diff --git a/core/lib/Thelia/Model/Folder.php b/core/lib/Thelia/Model/Folder.php index 05838e939..2672c17de 100755 --- a/core/lib/Thelia/Model/Folder.php +++ b/core/lib/Thelia/Model/Folder.php @@ -17,7 +17,7 @@ class Folder extends BaseFolder public function getUrl($locale) { - return URL::retrieve('folder', $this->getId(), $locale); + return URL::init()->retrieve('folder', $this->getId(), $locale); } /** diff --git a/core/lib/Thelia/Model/Product.php b/core/lib/Thelia/Model/Product.php index e7d0586cc..b4b036896 100755 --- a/core/lib/Thelia/Model/Product.php +++ b/core/lib/Thelia/Model/Product.php @@ -9,6 +9,6 @@ class Product extends BaseProduct { public function getUrl($locale) { - return URL::retrieve('product', $this->getId(), $locale); + return URL::init()->retrieve('product', $this->getId(), $locale); } } diff --git a/core/lib/Thelia/Model/RewritingUrlQuery.php b/core/lib/Thelia/Model/RewritingUrlQuery.php index c5b73c1e5..d1ab8fcdf 100644 --- a/core/lib/Thelia/Model/RewritingUrlQuery.php +++ b/core/lib/Thelia/Model/RewritingUrlQuery.php @@ -2,8 +2,10 @@ namespace Thelia\Model; +use Propel\Runtime\ActiveQuery\Criteria; +use Propel\Runtime\ActiveQuery\Join; use Thelia\Model\Base\RewritingUrlQuery as BaseRewritingUrlQuery; - +use Thelia\Model\Map\RewritingUrlTableMap; /** * Skeleton subclass for performing query and update operations on the 'rewriting_url' table. @@ -15,6 +17,96 @@ use Thelia\Model\Base\RewritingUrlQuery as BaseRewritingUrlQuery; * long as it does not already exist in the output directory. * */ -class RewritingUrlQuery extends BaseRewritingUrlQuery { +class RewritingUrlQuery extends BaseRewritingUrlQuery +{ + /** + * @param $rewrittenUrl + * + * @return array|mixed|\Propel\Runtime\Collection\ObjectCollection + */ + public function getResolverSearch($rewrittenUrl) + { + $redirectedJoin = new Join(); + $redirectedJoin->addExplicitCondition(RewritingUrlTableMap::TABLE_NAME, 'REDIRECTED', 'ru', RewritingUrlTableMap::TABLE_NAME, 'ID', 'is_redirected'); + $redirectedJoin->setJoinType(Criteria::LEFT_JOIN); + $search = RewritingArgumentQuery::create() + ->joinRewritingUrl('ru', Criteria::RIGHT_JOIN) + ->addJoinObject($redirectedJoin) + ->where('`ru`.URL = ?', $rewrittenUrl, \PDO::PARAM_STR) + ->withColumn('`ru`.URL', 'ru_url') + ->withColumn('`ru`.VIEW', 'ru_view') + ->withColumn('`ru`.VIEW_LOCALE', 'ru_locale') + ->withColumn('`ru`.VIEW_ID', 'ru_viewId') + ->withColumn('`is_redirected`.URL', 'ru_redirected_to_url') + ->find(); + + return $search; + } + + /** + * @param $view + * @param $viewId + * @param $viewLocale + * + * @return null|RewritingUrl + */ + public function getViewUrlQuery($view, $viewLocale, $viewId) + { + return RewritingUrlQuery::create() + ->joinRewritingArgument('ra', Criteria::LEFT_JOIN) + ->where('ISNULL(`ra`.REWRITING_URL_ID)') + ->filterByView($view) + ->filterByViewLocale($viewLocale) + ->filterByViewId($viewId) + ->filterByRedirected(null) + ->orderByUpdatedAt(Criteria::DESC) + ->findOne(); + } + + /** + * @param $view + * @param $viewLocale + * @param $viewId + * @param $viewOtherParameters + * + * @return null|RewritingUrl + */ + public function getSpecificUrlQuery($view, $viewLocale, $viewId, $viewOtherParameters) + { + $urlQuery = RewritingUrlQuery::create() + ->joinRewritingArgument('ra', Criteria::LEFT_JOIN) + ->withColumn('`ra`.REWRITING_URL_ID', 'ra_REWRITING_URL_ID') + ->filterByView($view) + ->filterByViewLocale($viewLocale) + ->filterByViewId($viewId) + ->filterByRedirected(null) + ->orderByUpdatedAt(Criteria::DESC); + + $otherParametersCount = count($viewOtherParameters); + if($otherParametersCount > 0) { + $parameterConditions = array(); + + foreach($viewOtherParameters as $parameter => $value) { + $conditionName = 'other_parameter_condition_' . count($parameterConditions); + $urlQuery->condition('parameter_condition', '`ra`.PARAMETER= ?', $parameter, \PDO::PARAM_STR) + ->condition('value_condition', '`ra`.VALUE = ?', $value, \PDO::PARAM_STR) + ->combine(array('parameter_condition', 'value_condition'), Criteria::LOGICAL_AND, $conditionName); + $parameterConditions[] = $conditionName; + } + + $urlQuery->where($parameterConditions, Criteria::LOGICAL_OR); + + $urlQuery->groupBy(RewritingUrlTableMap::ID); + + $urlQuery->condition('count_condition_1', 'COUNT(' . RewritingUrlTableMap::ID . ') = ?', $otherParametersCount, \PDO::PARAM_INT) // ensure we got all the asked parameters (provided by the query) + ->condition('count_condition_2', 'COUNT(' . RewritingUrlTableMap::ID . ') = (SELECT COUNT(*) FROM rewriting_argument WHERE rewriting_argument.REWRITING_URL_ID = ra_REWRITING_URL_ID)'); // ensure we don't miss any parameters (needed to match the rewritten url) + + $urlQuery->having(array('count_condition_1', 'count_condition_2'), Criteria::LOGICAL_AND); + } else { + $urlQuery->where('ISNULL(`ra`.REWRITING_URL_ID)'); + } + + return $urlQuery->findOne(); + } } // RewritingUrlQuery diff --git a/core/lib/Thelia/Rewriting/RewritingResolver.php b/core/lib/Thelia/Rewriting/RewritingResolver.php index 818dbec32..900442db9 100755 --- a/core/lib/Thelia/Rewriting/RewritingResolver.php +++ b/core/lib/Thelia/Rewriting/RewritingResolver.php @@ -22,6 +22,13 @@ /*************************************************************************************/ namespace Thelia\Rewriting; +use Propel\Runtime\ActiveQuery\Criteria; +use Propel\Runtime\ActiveQuery\Join; +use Thelia\Exception\RewritingUrlException; +use Thelia\Exception\UrlRewritingException; +use Thelia\Model\RewritingUrlQuery; +use Thelia\Model\Map\RewritingUrlTableMap; + /** * Class RewritingResolver * @package Thelia\Rewriting @@ -31,5 +38,58 @@ namespace Thelia\Rewriting; */ class RewritingResolver { + protected $search = null; + protected $rewritingUrlQuery = null; + + public $view; + public $viewId; + public $locale; + public $otherParameters; + public $redirectedToUrl; + + public function __construct($url = null) + { + $this->rewritingUrlQuery = new RewritingUrlQuery(); + + if($url !== null) { + $this->load($url); + } + } + + public function load($rewrittenUrl) + { + $this->search = $this->rewritingUrlQuery->getResolverSearch($rewrittenUrl); + + if($this->search->count() == 0) { + throw new UrlRewritingException('URL NOT FOUND', UrlRewritingException::URL_NOT_FOUND); + } + + $this->view = $this->search->getFirst()->getVirtualColumn('ru_view'); + $this->viewId = $this->search->getFirst()->getVirtualColumn('ru_viewId'); + $this->locale = $this->search->getFirst()->getVirtualColumn('ru_locale'); + $this->redirectedToUrl = $this->search->getFirst()->getVirtualColumn('ru_redirected_to_url'); + + $this->otherParameters = $this->getOtherParameters(); + } + + protected function getOtherParameters() + { + if($this->search === null) { + throw new UrlRewritingException('RESOLVER NULL SEARCH', UrlRewritingException::RESOLVER_NULL_SEARCH); + } + + $otherParameters = array(); + foreach($this->search as $result) { + $parameter = $result->getParameter(); + $value = $result->getValue(); + + if(null !== $parameter) { + $otherParameters[$parameter] = $value; + } + } + + return $otherParameters; + } + } diff --git a/core/lib/Thelia/Rewriting/RewritingRetriever.php b/core/lib/Thelia/Rewriting/RewritingRetriever.php index 0deb7de45..7958af012 100755 --- a/core/lib/Thelia/Rewriting/RewritingRetriever.php +++ b/core/lib/Thelia/Rewriting/RewritingRetriever.php @@ -23,8 +23,9 @@ namespace Thelia\Rewriting; use Propel\Runtime\ActiveQuery\Criteria; -use Thelia\Model\Base\RewritingUrlQuery; +use Thelia\Model\RewritingUrlQuery; use Thelia\Model\Map\RewritingUrlTableMap; +use Thelia\Tools\URL; /** * Class RewritingRetriever @@ -35,38 +36,40 @@ use Thelia\Model\Map\RewritingUrlTableMap; */ class RewritingRetriever { - /** - * @param $view - * @param $viewLocale - * @param $viewId - * - * @return null|$url - */ - public function getViewUrl($view, $viewLocale, $viewId) - { - $url = $this->getViewUrlQuery($view, $viewId, $viewLocale); + protected $search = null; + protected $rewritingUrlQuery = null; - return $url === null ? null : $url->getUrl(); + public $url; + public $rewrittenUrl; + + public function __construct($view = null, $viewLocale = null, $viewId = null) + { + $this->rewritingUrlQuery = new RewritingUrlQuery(); + + if($view !== null && $viewLocale !== null) { + $this->load($view, $viewLocale, $viewId); + } } /** - * @param $view - * @param $viewId - * @param $viewLocale - * - * @return null|RewritingUrl + * @param $view + * @param $viewLocale + * @param null $viewId */ - protected function getViewUrlQuery($view, $viewId, $viewLocale) + public function loadViewUrl($view, $viewLocale, $viewId = null) { - return RewritingUrlQuery::create() - ->joinRewritingArgument('ra', Criteria::LEFT_JOIN) - ->where('ISNULL(`ra`.REWRITING_URL_ID)') - ->filterByView($view) - ->filterByViewLocale($viewLocale) - ->filterByViewId($viewId) - ->filterByRedirected(null) - ->orderByUpdatedAt(Criteria::DESC) - ->findOne(); + $this->search = $this->rewritingUrlQuery->getViewUrlQuery($view, $viewLocale, $viewId); + + $allParametersWithoutView = array(); + $allParametersWithoutView['locale'] = $viewLocale; + if(null !== $viewId) { + $allParametersWithoutView[$view . '_id'] = $viewId; + } + + $this->url = URL::viewUrl($view, $allParametersWithoutView); + if($this->search !== null) { + $this->rewrittenUrl = $this->search->getUrl(); + } } /** @@ -74,46 +77,25 @@ class RewritingRetriever * @param $viewLocale * @param null $viewId * @param array $viewOtherParameters - * - * @return null|$url */ - public function getSpecificUrl($view, $viewLocale, $viewId = null, $viewOtherParameters = array()) + public function loadSpecificUrl($view, $viewLocale, $viewId = null, $viewOtherParameters = array()) { - $urlQuery = RewritingUrlQuery::create() - ->joinRewritingArgument('ra', Criteria::LEFT_JOIN) - ->withColumn('`ra`.REWRITING_URL_ID', 'ra_REWRITING_URL_ID') - ->filterByView($view) - ->filterByViewLocale($viewLocale) - ->filterByViewId($viewId) - ->filterByRedirected(null) - ->orderByUpdatedAt(Criteria::DESC); - - $otherParametersCount = count($viewOtherParameters); - if($otherParametersCount > 0) { - $parameterConditions = array(); - - foreach($viewOtherParameters as $parameter => $value) { - $conditionName = 'other_parameter_condition_' . count($parameterConditions); - $urlQuery->condition('parameter_condition', '`ra`.PARAMETER= ?', $parameter, \PDO::PARAM_STR) - ->condition('value_condition', '`ra`.VALUE = ?', $value, \PDO::PARAM_STR) - ->combine(array('parameter_condition', 'value_condition'), Criteria::LOGICAL_AND, $conditionName); - $parameterConditions[] = $conditionName; - } - - $urlQuery->where($parameterConditions, Criteria::LOGICAL_OR); - - $urlQuery->groupBy(RewritingUrlTableMap::ID); - - $urlQuery->condition('count_condition_1', 'COUNT(' . RewritingUrlTableMap::ID . ') = ?', $otherParametersCount, \PDO::PARAM_INT) // ensure we got all the asked parameters (provided by the query) - ->condition('count_condition_2', 'COUNT(' . RewritingUrlTableMap::ID . ') = (SELECT COUNT(*) FROM rewriting_argument WHERE rewriting_argument.REWRITING_URL_ID = ra_REWRITING_URL_ID)'); // ensure we don't miss any parameters (needed to match the rewritten url) - - $urlQuery->having(array('count_condition_1', 'count_condition_2'), Criteria::LOGICAL_AND); - } else { - $urlQuery->where('ISNULL(`ra`.REWRITING_URL_ID)'); + if(empty($viewOtherParameters)) { + $this->loadViewUrl($view, $viewLocale, $viewId); + return; } - $url = $urlQuery->findOne(); + $this->search = $this->rewritingUrlQuery->getSpecificUrlQuery($view, $viewLocale, $viewId, $viewOtherParameters); - return $url === null ? null : $url->getUrl(); + $allParametersWithoutView = $viewOtherParameters; + $allParametersWithoutView['locale'] = $viewLocale; + if(null !== $viewId) { + $allParametersWithoutView[$view . '_id'] = $viewId; + } + + $this->url = URL::viewUrl($view, $allParametersWithoutView); + if($this->search !== null) { + $this->rewrittenUrl = $this->search->getUrl(); + } } } diff --git a/core/lib/Thelia/Tests/Rewriting/RewritingResolverTest.php b/core/lib/Thelia/Tests/Rewriting/RewritingResolverTest.php new file mode 100755 index 000000000..a3ec561d2 --- /dev/null +++ b/core/lib/Thelia/Tests/Rewriting/RewritingResolverTest.php @@ -0,0 +1,154 @@ +. */ +/* */ +/*************************************************************************************/ + +namespace Thelia\Tests\Rewriting; + +use Thelia\Model\RewritingArgument; +use Thelia\Rewriting\RewritingResolver; +use Propel\Runtime\Collection\ObjectCollection; + +/** + * + * @author Etienne Roudeix + * + */ +class RewritingResolverTest extends \PHPUnit_Framework_TestCase +{ + protected function getMethod($name) + { + $class = new \ReflectionClass('\Thelia\Rewriting\RewritingResolver'); + $method = $class->getMethod($name); + $method->setAccessible(true); + + return $method; + } + + protected function getProperty($name) + { + $class = new \ReflectionClass('\Thelia\Rewriting\RewritingResolver'); + $property = $class->getProperty($name); + $property->setAccessible(true); + + return $property; + } + + /** + * @expectedException \Thelia\Exception\UrlRewritingException + * @expectedExceptionCode 800 + */ + public function testGetOtherParametersException() + { + $resolver = new RewritingResolver(); + + $method = $this->getMethod('getOtherParameters'); + $actual = $method->invoke($resolver); + } + + public function testGetOtherParameters() + { + $rewritingArguments = array( + array('Parameter' => 'foo0', 'Value' => 'bar0'), + array('Parameter' => 'foo1', 'Value' => 'bar1'), + array('Parameter' => 'foo2', 'Value' => 'bar2'), + ); + $searchResult = new ObjectCollection(); + $searchResult->setModel('\Thelia\Model\RewritingArgument'); + $searchResult->fromArray($rewritingArguments); + + $resolver = new RewritingResolver(); + + $search = $this->getProperty('search'); + $search->setValue($resolver, $searchResult); + + $method = $this->getMethod('getOtherParameters'); + $actual = $method->invoke($resolver); + + $expected = array( + 'foo0' => 'bar0', + 'foo1' => 'bar1', + 'foo2' => 'bar2', + ); + + $this->assertEquals($expected, $actual); + } + + /** + * @expectedException \Thelia\Exception\UrlRewritingException + * @expectedExceptionCode 404 + */ + public function testLoadException() + { + $collection = new ObjectCollection(); + $collection->setModel('\Thelia\Model\RewritingArgument'); + + $resolverQuery = $this->getMock('\Thelia\Model\RewritingUrlQuery', array('getResolverSearch')); + $resolverQuery->expects($this->any()) + ->method('getResolverSearch') + ->with('foo.html') + ->will($this->returnValue($collection)); + + $resolver = new RewritingResolver(); + + $rewritingUrlQuery = $this->getProperty('rewritingUrlQuery'); + $rewritingUrlQuery->setValue($resolver, $resolverQuery); + + $resolver->load('foo.html'); + } + + public function testLoad() + { + $collection = new ObjectCollection(); + $collection->setModel('\Thelia\Model\RewritingArgument'); + + for($i=0; $i<3; $i++) { + $ra = new RewritingArgument(); + $ra->setParameter('foo' . $i); + $ra->setValue('bar' . $i); + $ra->setVirtualColumn('ru_view', 'view'); + $ra->setVirtualColumn('ru_viewId', 'viewId'); + $ra->setVirtualColumn('ru_locale', 'locale'); + $ra->setVirtualColumn('ru_redirected_to_url', null); + + $collection->append($ra); + } + + + $resolverQuery = $this->getMock('\Thelia\Model\RewritingUrlQuery', array('getResolverSearch')); + $resolverQuery->expects($this->any()) + ->method('getResolverSearch') + ->with('foo.html') + ->will($this->returnValue($collection)); + + $resolver = new RewritingResolver(); + + $rewritingUrlQuery = $this->getProperty('rewritingUrlQuery'); + $rewritingUrlQuery->setValue($resolver, $resolverQuery); + + $resolver->load('foo.html'); + + $this->assertEquals('view', $resolver->view); + $this->assertEquals('viewId', $resolver->viewId); + $this->assertEquals('locale', $resolver->locale); + $this->assertEquals(array('foo0' => 'bar0', 'foo1' => 'bar1', 'foo2' => 'bar2'), $resolver->otherParameters); + } +} diff --git a/core/lib/Thelia/Tests/Rewriting/RewritingRetrieverTest.php b/core/lib/Thelia/Tests/Rewriting/RewritingRetrieverTest.php index 741c22b4e..9a5036adc 100755 --- a/core/lib/Thelia/Tests/Rewriting/RewritingRetrieverTest.php +++ b/core/lib/Thelia/Tests/Rewriting/RewritingRetrieverTest.php @@ -23,7 +23,9 @@ namespace Thelia\Tests\Rewriting; +use Thelia\Model\RewritingUrl; use Thelia\Rewriting\RewritingRetriever; +use Thelia\Tools\URL; /** * @@ -32,13 +34,65 @@ use Thelia\Rewriting\RewritingRetriever; */ class RewritingRetrieverTest extends \PHPUnit_Framework_TestCase { - public function testGetViewUrl() + protected function getMethod($name) { + $class = new \ReflectionClass('\Thelia\Rewriting\RewritingRetriever'); + $method = $class->getMethod($name); + $method->setAccessible(true); + return $method; } - public function testGetSpecificUrl() + protected function getProperty($name) { + $class = new \ReflectionClass('\Thelia\Rewriting\RewritingRetriever'); + $property = $class->getProperty($name); + $property->setAccessible(true); + return $property; + } + + public function testLoadViewUrl() + { + $searchResult = new RewritingUrl(); + $searchResult->setUrl('foo.html'); + + $retrieverQuery = $this->getMock('\Thelia\Model\RewritingUrlQuery', array('getViewUrlQuery')); + $retrieverQuery->expects($this->any()) + ->method('getViewUrlQuery') + ->with('view', 'fr_FR', 1) + ->will($this->returnValue($searchResult)); + + $retriever = new RewritingRetriever(); + + $rewritingUrlQuery = $this->getProperty('rewritingUrlQuery'); + $rewritingUrlQuery->setValue($retriever, $retrieverQuery); + + $retriever->loadViewUrl('view', 'fr_FR', 1); + + $this->assertEquals('foo.html', $retriever->rewrittenUrl); + $this->assertEquals(URL::viewUrl('view', array('locale' => 'fr_FR', 'view_id' => 1)), $retriever->url); + } + + public function testLoadSpecificUrl() + { + $searchResult = new RewritingUrl(); + $searchResult->setUrl('foo.html'); + + $retrieverQuery = $this->getMock('\Thelia\Model\RewritingUrlQuery', array('getSpecificUrlQuery')); + $retrieverQuery->expects($this->any()) + ->method('getSpecificUrlQuery') + ->with('view', 'fr_FR', 1, array('foo0' => 'bar0', 'foo1' => 'bar1')) + ->will($this->returnValue($searchResult)); + + $retriever = new RewritingRetriever(); + + $rewritingUrlQuery = $this->getProperty('rewritingUrlQuery'); + $rewritingUrlQuery->setValue($retriever, $retrieverQuery); + + $retriever->loadSpecificUrl('view', 'fr_FR', 1, array('foo0' => 'bar0', 'foo1' => 'bar1')); + + $this->assertEquals('foo.html', $retriever->rewrittenUrl); + $this->assertEquals(URL::viewUrl('view', array('foo0' => 'bar0', 'foo1' => 'bar1', 'locale' => 'fr_FR', 'view_id' => 1)), $retriever->url); } } diff --git a/core/lib/Thelia/Tools/URL.php b/core/lib/Thelia/Tools/URL.php index b84fdca73..a527746ce 100755 --- a/core/lib/Thelia/Tools/URL.php +++ b/core/lib/Thelia/Tools/URL.php @@ -25,18 +25,33 @@ namespace Thelia\Tools; use Symfony\Component\HttpFoundation\Request; use Thelia\Model\ConfigQuery; +use Thelia\Rewriting\RewritingResolver; use Thelia\Rewriting\RewritingRetriever; class URL { + protected $resolver = null; + protected $retriever = null; + const PATH_TO_FILE = true; const WITH_INDEX_PAGE = false; + public function __construct() + { + $this->retriever = new RewritingRetriever(); + $this->resolver = new RewritingResolver(); + } + public static function getIndexPage() { return ConfigQuery::read('base_url', '/') . "index_dev.php"; // FIXME ! } + public static function init() + { + return new URL(); + } + /** * Returns the Absolute URL for a given path relative to web root. By default, * the index.php (or index_dev.php) script name is added to the URL, use @@ -103,7 +118,7 @@ class URL */ public static function viewUrl($viewName, array $parameters = array()) { - $path = sprintf("%s?view=%s", self::getIndexPage(), $viewName); + $path = sprintf("?view=%s", $viewName); return self::absoluteUrl($path, $parameters); } @@ -115,18 +130,17 @@ class URL * * @return null|string */ - public static function retrieve($view, $viewId, $viewLocale) + public function retrieve($view, $viewId, $viewLocale) { $rewrittenUrl = null; if(ConfigQuery::isRewritingEnable()) { - $retriever = new RewritingRetriever(); - $rewrittenUrl = $retriever->getViewUrl($view, $viewLocale, $viewId); + $rewrittenUrl = $this->retriever->loadViewUrl($view, $viewLocale, $viewId); } return $rewrittenUrl === null ? self::viewUrl($view, array($view . '_id' => $viewId, 'locale' => $viewLocale)) : $rewrittenUrl; } - public static function retrieveCurrent(Request $request) + public function retrieveCurrent(Request $request) { $rewrittenUrl = null; if(ConfigQuery::isRewritingEnable()) { @@ -134,12 +148,10 @@ class URL $viewLocale = $request->query->get('locale', null); $viewId = $view === null ? null : $request->query->get($view . '_id', null); - $allParameters = $request->query->all(); - $allParametersWithoutView = $allParameters; + $allOtherParameters = $request->query->all(); if($view !== null) { - unset($allParametersWithoutView['view']); + unset($allOtherParameters['view']); } - $allOtherParameters = $allParametersWithoutView; if($viewLocale !== null) { unset($allOtherParameters['locale']); } @@ -147,10 +159,15 @@ class URL unset($allOtherParameters[$view . '_id']); } - $retriever = new RewritingRetriever(); - $rewrittenUrl = $retriever->getSpecificUrl($view, $viewLocale, $viewId, $allOtherParameters); + $this->retriever->loadSpecificUrl($view, $viewLocale, $viewId, $allOtherParameters); } - return $rewrittenUrl === null ? self::viewUrl($view, $allParametersWithoutView) : $rewrittenUrl; + return $this->retriever; + } + + public function resolve($url) + { + $this->resolver->load($url); + return $this->resolver; } } diff --git a/install/insert.sql b/install/insert.sql index 4336eaa0c..a4b7d3c1b 100755 --- a/install/insert.sql +++ b/install/insert.sql @@ -6,14 +6,16 @@ INSERT INTO `lang`(`id`,`title`,`code`,`locale`,`url`,`by_default`,`created_at`, INSERT INTO `config` (`name`, `value`, `secured`, `hidden`, `created_at`, `updated_at`) VALUES ('session_config.default', '1', 1, 1, NOW(), NOW()), -('verifyStock', '1', 1, 0, NOW(), NOW()), -('default_lang_without_translation', '1', 1, 0, NOW(), NOW()), -('rewriting_enable', '0', 1, 0, NOW(), NOW()), -('imagine_graphic_driver', 'gd', 1, 0, NOW(), NOW()), -('default_images_quality_percent', '75', 1, 0, NOW(), NOW()), -('original_image_delivery_mode', 'symlink', 1, 0, NOW(), NOW()), -('images_library_path', 'local/media/images', 1, 0, NOW(), NOW()), -('image_cache_dir_from_web_root', 'cache/images', 1, 0, NOW(), NOW()); +('verifyStock', '1', 0, 0, NOW(), NOW()), +('default_lang_without_translation', '1', 0, 0, NOW(), NOW()), +('rewriting_enable', '0', 0, 0, NOW(), NOW()), +('imagine_graphic_driver', 'gd', 0, 0, NOW(), NOW()), +('default_images_quality_percent', '75', 0, 0, NOW(), NOW()), +('original_image_delivery_mode', 'symlink', 0, 0, NOW(), NOW()), +('images_library_path', 'local/media/images', 0, 0, NOW(), NOW()), +('image_cache_dir_from_web_root', 'cache/images', 0, 0, NOW(), NOW()), +('currency_rate_update_url', 'http://www.ecb.int/stats/eurofxref/eurofxref-daily.xml', 0, 0, NOW(), NOW()), +('page_not_found_view', '404.html', 0, 0, NOW(), NOW()); INSERT INTO `module` (`code`, `type`, `activate`, `position`, `created_at`, `updated_at`) VALUES ('test', '1', '1', '1', NOW(), NOW()); @@ -24,11 +26,11 @@ INSERT INTO `customer_title`(`id`, `by_default`, `position`, `created_at`, `upda INSERT INTO `customer_title_i18n` (`id`, `locale`, `short`, `long`) VALUES (1, 'fr_FR', 'Mr', 'Monsieur'), -(1, 'en_EN', 'M', 'Mister'), +(1, 'en_UK', 'M', 'Mister'), (2, 'fr_FR', 'Mrs', 'Madame'), -(2, 'en_EN', 'Mme', 'Misses'), +(2, 'en_UK', 'Mme', 'Misses'), (3, 'fr_FR', 'Miss', 'Madamemoiselle'), -(3, 'en_EN', 'Mlle', 'Miss'); +(3, 'en_UK', 'Mlle', 'Miss'); INSERT INTO `currency` (`id` ,`code` ,`symbol` ,`rate`, `position` ,`by_default` ,`created_at` ,`updated_at`) VALUES @@ -38,12 +40,12 @@ VALUES INSERT INTO `currency_i18n` (`id` ,`locale` ,`name`) VALUES -(1, 'fr_FR', 'euro'), -(1, 'en_EN', 'euro'), -(2, 'fr_FR', 'dollar'), -(2, 'en_EN', 'dollar'), -(3, 'fr_FR', 'livre'), -(3, 'en_EN', 'pound'); +(1, 'fr_FR', 'Euro'), +(1, 'en_UK', 'Euro'), +(2, 'fr_FR', 'Dollar Américain'), +(2, 'en_UK', 'United States Dollar'), +(3, 'fr_FR', 'Livre anglaise'), +(3, 'en_UK', 'UK Pound'); INSERT INTO `country` (`id`, `area_id`, `isocode`, `isoalpha2`, `isoalpha3`, `created_at`, `updated_at`) VALUES @@ -313,795 +315,795 @@ INSERT INTO `country` (`id`, `area_id`, `isocode`, `isoalpha2`, `isoalpha3`, `cr (268, NULL, '840', 'US', 'USA', NOW(), NOW()); INSERT INTO `country_i18n` (`id`, `locale`, `title`, `description`, `chapo`, `postscriptum`) VALUES -(1, 'en_EN', 'Afghanistan', '', '', ''), +(1, 'en_UK', 'Afghanistan', '', '', ''), (1, 'es_ES', 'Afganistán', '', '', ''), (1, 'fr_FR', 'Afghanistan', '', '', ''), -(2, 'en_EN', 'South Africa', '', '', ''), +(2, 'en_UK', 'South Africa', '', '', ''), (2, 'es_ES', 'Sudáfrica', '', '', ''), (2, 'fr_FR', 'Afrique du Sud', '', '', ''), -(3, 'en_EN', 'Albania', '', '', ''), +(3, 'en_UK', 'Albania', '', '', ''), (3, 'es_ES', 'Albania', '', '', ''), (3, 'fr_FR', 'Albanie', '', '', ''), -(4, 'en_EN', 'Algeria', '', '', ''), +(4, 'en_UK', 'Algeria', '', '', ''), (4, 'es_ES', 'Argelia', '', '', ''), (4, 'fr_FR', 'Algérie', '', '', ''), -(5, 'en_EN', 'Germany', '', '', ''), +(5, 'en_UK', 'Germany', '', '', ''), (5, 'es_ES', 'Alemania', '', '', ''), (5, 'fr_FR', 'Allemagne', '', '', ''), -(6, 'en_EN', 'Andorra', '', '', ''), +(6, 'en_UK', 'Andorra', '', '', ''), (6, 'es_ES', 'Andorra', '', '', ''), (6, 'fr_FR', 'Andorre', '', '', ''), -(7, 'en_EN', 'Angola', '', '', ''), +(7, 'en_UK', 'Angola', '', '', ''), (7, 'es_ES', 'Angola', '', '', ''), (7, 'fr_FR', 'Angola', '', '', ''), -(8, 'en_EN', 'Antigua and Barbuda', '', '', ''), +(8, 'en_UK', 'Antigua and Barbuda', '', '', ''), (8, 'es_ES', 'Antigua y Barbuda', '', '', ''), (8, 'fr_FR', 'Antigua-et-Barbuda', '', '', ''), -(9, 'en_EN', 'Saudi Arabia', '', '', ''), +(9, 'en_UK', 'Saudi Arabia', '', '', ''), (9, 'es_ES', 'Arabia Saudita', '', '', ''), (9, 'fr_FR', 'Arabie saoudite', '', '', ''), -(10, 'en_EN', 'Argentina', '', '', ''), +(10, 'en_UK', 'Argentina', '', '', ''), (10, 'es_ES', 'Argentina', '', '', ''), (10, 'fr_FR', 'Argentine', '', '', ''), -(11, 'en_EN', 'Armenia', '', '', ''), +(11, 'en_UK', 'Armenia', '', '', ''), (11, 'es_ES', 'Armenia', '', '', ''), (11, 'fr_FR', 'Arménie', '', '', ''), -(12, 'en_EN', 'Australia', '', '', ''), +(12, 'en_UK', 'Australia', '', '', ''), (12, 'es_ES', 'Australia', '', '', ''), (12, 'fr_FR', 'Australie', '', '', ''), -(13, 'en_EN', 'Austria', '', '', ''), +(13, 'en_UK', 'Austria', '', '', ''), (13, 'es_ES', 'Austria', '', '', ''), (13, 'fr_FR', 'Autriche', '', '', ''), -(14, 'en_EN', 'Azerbaijan', '', '', ''), +(14, 'en_UK', 'Azerbaijan', '', '', ''), (14, 'es_ES', 'Azerbaiyán', '', '', ''), (14, 'fr_FR', 'Azerbaïdjan', '', '', ''), -(15, 'en_EN', 'Bahamas', '', '', ''), +(15, 'en_UK', 'Bahamas', '', '', ''), (15, 'es_ES', 'Bahamas', '', '', ''), (15, 'fr_FR', 'Bahamas', '', '', ''), -(16, 'en_EN', 'Bahrain', '', '', ''), +(16, 'en_UK', 'Bahrain', '', '', ''), (16, 'es_ES', 'Bahrein', '', '', ''), (16, 'fr_FR', 'Bahreïn', '', '', ''), -(17, 'en_EN', 'Bangladesh', '', '', ''), +(17, 'en_UK', 'Bangladesh', '', '', ''), (17, 'es_ES', 'Bangladesh', '', '', ''), (17, 'fr_FR', 'Bangladesh', '', '', ''), -(18, 'en_EN', 'Barbados', '', '', ''), +(18, 'en_UK', 'Barbados', '', '', ''), (18, 'es_ES', 'Barbados', '', '', ''), (18, 'fr_FR', 'Barbade', '', '', ''), -(19, 'en_EN', 'Belarus', '', '', ''), +(19, 'en_UK', 'Belarus', '', '', ''), (19, 'es_ES', 'Belarús', '', '', ''), (19, 'fr_FR', 'Belau', '', '', ''), -(20, 'en_EN', 'Belgium', '', '', ''), +(20, 'en_UK', 'Belgium', '', '', ''), (20, 'es_ES', 'Bélgica', '', '', ''), (20, 'fr_FR', 'Belgique', '', '', ''), -(21, 'en_EN', 'Belize', '', '', ''), +(21, 'en_UK', 'Belize', '', '', ''), (21, 'es_ES', 'Belice', '', '', ''), (21, 'fr_FR', 'Belize', '', '', ''), -(22, 'en_EN', 'Benin', '', '', ''), +(22, 'en_UK', 'Benin', '', '', ''), (22, 'es_ES', 'Benin', '', '', ''), (22, 'fr_FR', 'Bénin', '', '', ''), -(23, 'en_EN', 'Bhutan', '', '', ''), +(23, 'en_UK', 'Bhutan', '', '', ''), (23, 'es_ES', 'Bhután', '', '', ''), (23, 'fr_FR', 'Bhoutan', '', '', ''), -(24, 'en_EN', 'Bielorussia', '', '', ''), +(24, 'en_UK', 'Bielorussia', '', '', ''), (24, 'es_ES', 'Bielorusia', '', '', ''), (24, 'fr_FR', 'Biélorussie', '', '', ''), -(25, 'en_EN', 'Burma', '', '', ''), +(25, 'en_UK', 'Burma', '', '', ''), (25, 'es_ES', 'Birmania', '', '', ''), (25, 'fr_FR', 'Birmanie', '', '', ''), -(26, 'en_EN', 'Bolivia', '', '', ''), +(26, 'en_UK', 'Bolivia', '', '', ''), (26, 'es_ES', 'Bolivia', '', '', ''), (26, 'fr_FR', 'Bolivie', '', '', ''), -(27, 'en_EN', 'Bosnia and Herzegovina', '', '', ''), +(27, 'en_UK', 'Bosnia and Herzegovina', '', '', ''), (27, 'es_ES', 'Bosnia y Herzegovina', '', '', ''), (27, 'fr_FR', 'Bosnie-Herzégovine', '', '', ''), -(28, 'en_EN', 'Botswana', '', '', ''), +(28, 'en_UK', 'Botswana', '', '', ''), (28, 'es_ES', 'Botswana', '', '', ''), (28, 'fr_FR', 'Botswana', '', '', ''), -(29, 'en_EN', 'Brazil', '', '', ''), +(29, 'en_UK', 'Brazil', '', '', ''), (29, 'es_ES', 'Brasil', '', '', ''), (29, 'fr_FR', 'Brésil', '', '', ''), -(30, 'en_EN', 'Brunei', '', '', ''), +(30, 'en_UK', 'Brunei', '', '', ''), (30, 'es_ES', 'Brunei', '', '', ''), (30, 'fr_FR', 'Brunei', '', '', ''), -(31, 'en_EN', 'Bulgaria', '', '', ''), +(31, 'en_UK', 'Bulgaria', '', '', ''), (31, 'es_ES', 'Bulgaria', '', '', ''), (31, 'fr_FR', 'Bulgarie', '', '', ''), -(32, 'en_EN', 'Burkina', '', '', ''), +(32, 'en_UK', 'Burkina', '', '', ''), (32, 'es_ES', 'Burkina', '', '', ''), (32, 'fr_FR', 'Burkina', '', '', ''), -(33, 'en_EN', 'Burundi', '', '', ''), +(33, 'en_UK', 'Burundi', '', '', ''), (33, 'es_ES', 'Burundi', '', '', ''), (33, 'fr_FR', 'Burundi', '', '', ''), -(34, 'en_EN', 'Cambodia', '', '', ''), +(34, 'en_UK', 'Cambodia', '', '', ''), (34, 'es_ES', 'Camboya', '', '', ''), (34, 'fr_FR', 'Cambodge', '', '', ''), -(35, 'en_EN', 'Cameroon', '', '', ''), +(35, 'en_UK', 'Cameroon', '', '', ''), (35, 'es_ES', 'Camerún', '', '', ''), (35, 'fr_FR', 'Cameroun', '', '', ''), -(37, 'en_EN', 'Cape Verde', '', '', ''), +(37, 'en_UK', 'Cape Verde', '', '', ''), (37, 'es_ES', 'Cabo Verde', '', '', ''), (37, 'fr_FR', 'Cap-Vert', '', '', ''), -(38, 'en_EN', 'Chile', '', '', ''), +(38, 'en_UK', 'Chile', '', '', ''), (38, 'es_ES', 'Chile', '', '', ''), (38, 'fr_FR', 'Chili', '', '', ''), -(39, 'en_EN', 'China', '', '', ''), +(39, 'en_UK', 'China', '', '', ''), (39, 'es_ES', 'China', '', '', ''), (39, 'fr_FR', 'Chine', '', '', ''), -(40, 'en_EN', 'Cyprus', '', '', ''), +(40, 'en_UK', 'Cyprus', '', '', ''), (40, 'es_ES', 'Chipre', '', '', ''), (40, 'fr_FR', 'Chypre', '', '', ''), -(41, 'en_EN', 'Colombia', '', '', ''), +(41, 'en_UK', 'Colombia', '', '', ''), (41, 'es_ES', 'Colombia', '', '', ''), (41, 'fr_FR', 'Colombie', '', '', ''), -(42, 'en_EN', 'Comoros', '', '', ''), +(42, 'en_UK', 'Comoros', '', '', ''), (42, 'es_ES', 'Comoras', '', '', ''), (42, 'fr_FR', 'Comores', '', '', ''), -(43, 'en_EN', 'Congo', '', '', ''), +(43, 'en_UK', 'Congo', '', '', ''), (43, 'es_ES', 'Congo', '', '', ''), (43, 'fr_FR', 'Congo', '', '', ''), -(44, 'en_EN', 'Cook Islands', '', '', ''), +(44, 'en_UK', 'Cook Islands', '', '', ''), (44, 'es_ES', 'Cook', '', '', ''), (44, 'fr_FR', 'Cook', '', '', ''), -(45, 'en_EN', 'North Korea', '', '', ''), +(45, 'en_UK', 'North Korea', '', '', ''), (45, 'es_ES', 'Corea del Norte', '', '', ''), (45, 'fr_FR', 'Corée du Nord', '', '', ''), -(46, 'en_EN', 'South Korea', '', '', ''), +(46, 'en_UK', 'South Korea', '', '', ''), (46, 'es_ES', 'Corea del Sur', '', '', ''), (46, 'fr_FR', 'Corée du Sud', '', '', ''), -(47, 'en_EN', 'Costa Rica', '', '', ''), +(47, 'en_UK', 'Costa Rica', '', '', ''), (47, 'es_ES', 'Costa Rica', '', '', ''), (47, 'fr_FR', 'Costa Rica', '', '', ''), -(48, 'en_EN', 'Ivory Coast', '', '', ''), +(48, 'en_UK', 'Ivory Coast', '', '', ''), (48, 'es_ES', 'Costa de Marfil', '', '', ''), (48, 'fr_FR', 'Côte dIvoire', '', '', ''), -(49, 'en_EN', 'Croatia', '', '', ''), +(49, 'en_UK', 'Croatia', '', '', ''), (49, 'es_ES', 'Croacia', '', '', ''), (49, 'fr_FR', 'Croatie', '', '', ''), -(50, 'en_EN', 'Cuba', '', '', ''), +(50, 'en_UK', 'Cuba', '', '', ''), (50, 'es_ES', 'Cuba', '', '', ''), (50, 'fr_FR', 'Cuba', '', '', ''), -(51, 'en_EN', 'Denmark', '', '', ''), +(51, 'en_UK', 'Denmark', '', '', ''), (51, 'es_ES', 'Dinamarca', '', '', ''), (51, 'fr_FR', 'Danemark', '', '', ''), -(52, 'en_EN', 'Djibouti', '', '', ''), +(52, 'en_UK', 'Djibouti', '', '', ''), (52, 'es_ES', 'Djibouti', '', '', ''), (52, 'fr_FR', 'Djibouti', '', '', ''), -(53, 'en_EN', 'Dominica', '', '', ''), +(53, 'en_UK', 'Dominica', '', '', ''), (53, 'es_ES', 'Dominica', '', '', ''), (53, 'fr_FR', 'Dominique', '', '', ''), -(54, 'en_EN', 'Egypt', '', '', ''), +(54, 'en_UK', 'Egypt', '', '', ''), (54, 'es_ES', 'Egipto', '', '', ''), (54, 'fr_FR', 'Égypte', '', '', ''), -(55, 'en_EN', 'United Arab Emirates', '', '', ''), +(55, 'en_UK', 'United Arab Emirates', '', '', ''), (55, 'es_ES', 'Emiratos Árabes Unidos', '', '', ''), (55, 'fr_FR', 'Émirats arabes unis', '', '', ''), -(56, 'en_EN', 'Ecuador', '', '', ''), +(56, 'en_UK', 'Ecuador', '', '', ''), (56, 'es_ES', 'Ecuador', '', '', ''), (56, 'fr_FR', 'Équateur', '', '', ''), -(57, 'en_EN', 'Eritrea', '', '', ''), +(57, 'en_UK', 'Eritrea', '', '', ''), (57, 'es_ES', 'Eritrea', '', '', ''), (57, 'fr_FR', 'Érythrée', '', '', ''), -(58, 'en_EN', 'Spain', '', '', ''), +(58, 'en_UK', 'Spain', '', '', ''), (58, 'es_ES', 'España', '', '', ''), (58, 'fr_FR', 'Espagne', '', '', ''), -(59, 'en_EN', 'Estonia', '', '', ''), +(59, 'en_UK', 'Estonia', '', '', ''), (59, 'es_ES', 'Estonia', '', '', ''), (59, 'fr_FR', 'Estonie', '', '', ''), -(61, 'en_EN', 'Ethiopia', '', '', ''), +(61, 'en_UK', 'Ethiopia', '', '', ''), (61, 'es_ES', 'Etiopía', '', '', ''), (61, 'fr_FR', 'Éthiopie', '', '', ''), -(62, 'en_EN', 'Fiji', '', '', ''), +(62, 'en_UK', 'Fiji', '', '', ''), (62, 'es_ES', 'Fiji', '', '', ''), (62, 'fr_FR', 'Fidji', '', '', ''), -(63, 'en_EN', 'Finland', '', '', ''), +(63, 'en_UK', 'Finland', '', '', ''), (63, 'es_ES', 'Finlandia', '', '', ''), (63, 'fr_FR', 'Finlande', '', '', ''), -(64, 'en_EN', 'France metropolitan', '', '', ''), +(64, 'en_UK', 'France metropolitan', '', '', ''), (64, 'es_ES', 'Francia', '', '', ''), (64, 'fr_FR', 'France métropolitaine', '', '', ''), -(65, 'en_EN', 'Gabon', '', '', ''), +(65, 'en_UK', 'Gabon', '', '', ''), (65, 'es_ES', 'Gabón', '', '', ''), (65, 'fr_FR', 'Gabon', '', '', ''), -(66, 'en_EN', 'Gambia', '', '', ''), +(66, 'en_UK', 'Gambia', '', '', ''), (66, 'es_ES', 'Gambia', '', '', ''), (66, 'fr_FR', 'Gambie', '', '', ''), -(67, 'en_EN', 'Georgia', '', '', ''), +(67, 'en_UK', 'Georgia', '', '', ''), (67, 'es_ES', 'Georgia', '', '', ''), (67, 'fr_FR', 'Géorgie', '', '', ''), -(68, 'en_EN', 'Ghana', '', '', ''), +(68, 'en_UK', 'Ghana', '', '', ''), (68, 'es_ES', 'Ghana', '', '', ''), (68, 'fr_FR', 'Ghana', '', '', ''), -(69, 'en_EN', 'Greece', '', '', ''), +(69, 'en_UK', 'Greece', '', '', ''), (69, 'es_ES', 'Grecia', '', '', ''), (69, 'fr_FR', 'Grèce', '', '', ''), -(70, 'en_EN', 'Grenada', '', '', ''), +(70, 'en_UK', 'Grenada', '', '', ''), (70, 'es_ES', 'Granada', '', '', ''), (70, 'fr_FR', 'Grenade', '', '', ''), -(71, 'en_EN', 'Guatemala', '', '', ''), +(71, 'en_UK', 'Guatemala', '', '', ''), (71, 'es_ES', 'Guatemala', '', '', ''), (71, 'fr_FR', 'Guatemala', '', '', ''), -(72, 'en_EN', 'Guinea', '', '', ''), +(72, 'en_UK', 'Guinea', '', '', ''), (72, 'es_ES', 'Guinea', '', '', ''), (72, 'fr_FR', 'Guinée', '', '', ''), -(73, 'en_EN', 'Guinea-Bissau', '', '', ''), +(73, 'en_UK', 'Guinea-Bissau', '', '', ''), (73, 'es_ES', 'Guinea-Bissau', '', '', ''), (73, 'fr_FR', 'Guinée-Bissao', '', '', ''), -(74, 'en_EN', 'Equatorial Guinea', '', '', ''), +(74, 'en_UK', 'Equatorial Guinea', '', '', ''), (74, 'es_ES', 'Guinea Ecuatorial', '', '', ''), (74, 'fr_FR', 'Guinée équatoriale', '', '', ''), -(75, 'en_EN', 'Guyana', '', '', ''), +(75, 'en_UK', 'Guyana', '', '', ''), (75, 'es_ES', 'Guyana', '', '', ''), (75, 'fr_FR', 'Guyana', '', '', ''), -(76, 'en_EN', 'Haiti', '', '', ''), +(76, 'en_UK', 'Haiti', '', '', ''), (76, 'es_ES', 'Haití', '', '', ''), (76, 'fr_FR', 'Haïti', '', '', ''), -(77, 'en_EN', 'Honduras', '', '', ''), +(77, 'en_UK', 'Honduras', '', '', ''), (77, 'es_ES', 'Honduras', '', '', ''), (77, 'fr_FR', 'Honduras', '', '', ''), -(78, 'en_EN', 'Hungary', '', '', ''), +(78, 'en_UK', 'Hungary', '', '', ''), (78, 'es_ES', 'Hungría', '', '', ''), (78, 'fr_FR', 'Hongrie', '', '', ''), -(79, 'en_EN', 'India', '', '', ''), +(79, 'en_UK', 'India', '', '', ''), (79, 'es_ES', 'India', '', '', ''), (79, 'fr_FR', 'Inde', '', '', ''), -(80, 'en_EN', 'Indonesia', '', '', ''), +(80, 'en_UK', 'Indonesia', '', '', ''), (80, 'es_ES', 'Indonesia', '', '', ''), (80, 'fr_FR', 'Indonésie', '', '', ''), -(81, 'en_EN', 'Iran', '', '', ''), +(81, 'en_UK', 'Iran', '', '', ''), (81, 'es_ES', 'Irán', '', '', ''), (81, 'fr_FR', 'Iran', '', '', ''), -(82, 'en_EN', 'Iraq', '', '', ''), +(82, 'en_UK', 'Iraq', '', '', ''), (82, 'es_ES', 'Iraq', '', '', ''), (82, 'fr_FR', 'Iraq', '', '', ''), -(83, 'en_EN', 'Ireland', '', '', ''), +(83, 'en_UK', 'Ireland', '', '', ''), (83, 'es_ES', 'Irlanda', '', '', ''), (83, 'fr_FR', 'Irlande', '', '', ''), -(84, 'en_EN', 'Iceland', '', '', ''), +(84, 'en_UK', 'Iceland', '', '', ''), (84, 'es_ES', 'Islandia', '', '', ''), (84, 'fr_FR', 'Islande', '', '', ''), -(85, 'en_EN', 'Israel', '', '', ''), +(85, 'en_UK', 'Israel', '', '', ''), (85, 'es_ES', 'Israel', '', '', ''), (85, 'fr_FR', 'Israël', '', '', ''), -(86, 'en_EN', 'Italy', '', '', ''), +(86, 'en_UK', 'Italy', '', '', ''), (86, 'es_ES', 'Italia', '', '', ''), (86, 'fr_FR', 'Italie', '', '', ''), -(87, 'en_EN', 'Jamaica', '', '', ''), +(87, 'en_UK', 'Jamaica', '', '', ''), (87, 'es_ES', 'Jamaica', '', '', ''), (87, 'fr_FR', 'Jamaïque', '', '', ''), -(88, 'en_EN', 'Japan', '', '', ''), +(88, 'en_UK', 'Japan', '', '', ''), (88, 'es_ES', 'Japón', '', '', ''), (88, 'fr_FR', 'Japon', '', '', ''), -(89, 'en_EN', 'Jordan', '', '', ''), +(89, 'en_UK', 'Jordan', '', '', ''), (89, 'es_ES', 'Jordania', '', '', ''), (89, 'fr_FR', 'Jordanie', '', '', ''), -(90, 'en_EN', 'Kazakhstan', '', '', ''), +(90, 'en_UK', 'Kazakhstan', '', '', ''), (90, 'es_ES', 'Kazajstán', '', '', ''), (90, 'fr_FR', 'Kazakhstan', '', '', ''), -(91, 'en_EN', 'Kenya', '', '', ''), +(91, 'en_UK', 'Kenya', '', '', ''), (91, 'es_ES', 'Kenia', '', '', ''), (91, 'fr_FR', 'Kenya', '', '', ''), -(92, 'en_EN', 'Kyrgyzstan', '', '', ''), +(92, 'en_UK', 'Kyrgyzstan', '', '', ''), (92, 'es_ES', 'Kirguistán', '', '', ''), (92, 'fr_FR', 'Kirghizistan', '', '', ''), -(93, 'en_EN', 'Kiribati', '', '', ''), +(93, 'en_UK', 'Kiribati', '', '', ''), (93, 'es_ES', 'Kiribati', '', '', ''), (93, 'fr_FR', 'Kiribati', '', '', ''), -(94, 'en_EN', 'Kuwait', '', '', ''), +(94, 'en_UK', 'Kuwait', '', '', ''), (94, 'es_ES', 'Kuwait', '', '', ''), (94, 'fr_FR', 'Koweït', '', '', ''), -(95, 'en_EN', 'Laos', '', '', ''), +(95, 'en_UK', 'Laos', '', '', ''), (95, 'es_ES', 'Laos', '', '', ''), (95, 'fr_FR', 'Laos', '', '', ''), -(96, 'en_EN', 'Lesotho', '', '', ''), +(96, 'en_UK', 'Lesotho', '', '', ''), (96, 'es_ES', 'Lesotho', '', '', ''), (96, 'fr_FR', 'Lesotho', '', '', ''), -(97, 'en_EN', 'Latvia', '', '', ''), +(97, 'en_UK', 'Latvia', '', '', ''), (97, 'es_ES', 'Letonia', '', '', ''), (97, 'fr_FR', 'Lettonie', '', '', ''), -(98, 'en_EN', 'Lebanon', '', '', ''), +(98, 'en_UK', 'Lebanon', '', '', ''), (98, 'es_ES', 'Líbano', '', '', ''), (98, 'fr_FR', 'Liban', '', '', ''), -(99, 'en_EN', 'Liberia', '', '', ''), +(99, 'en_UK', 'Liberia', '', '', ''), (99, 'es_ES', 'Liberia', '', '', ''), (99, 'fr_FR', 'Liberia', '', '', ''), -(100, 'en_EN', 'Libya', '', '', ''), +(100, 'en_UK', 'Libya', '', '', ''), (100, 'es_ES', 'Libia', '', '', ''), (100, 'fr_FR', 'Libye', '', '', ''), -(101, 'en_EN', 'Liechtenstein', '', '', ''), +(101, 'en_UK', 'Liechtenstein', '', '', ''), (101, 'es_ES', 'Liechtenstein', '', '', ''), (101, 'fr_FR', 'Liechtenstein', '', '', ''), -(102, 'en_EN', 'Lithuania', '', '', ''), +(102, 'en_UK', 'Lithuania', '', '', ''), (102, 'es_ES', 'Lituania', '', '', ''), (102, 'fr_FR', 'Lituanie', '', '', ''), -(103, 'en_EN', 'Luxembourg', '', '', ''), +(103, 'en_UK', 'Luxembourg', '', '', ''), (103, 'es_ES', 'Luxemburgo', '', '', ''), (103, 'fr_FR', 'Luxembourg', '', '', ''), -(104, 'en_EN', 'Macedonia', '', '', ''), +(104, 'en_UK', 'Macedonia', '', '', ''), (104, 'es_ES', 'Macedonia', '', '', ''), (104, 'fr_FR', 'Macédoine', '', '', ''), -(105, 'en_EN', 'Madagascar', '', '', ''), +(105, 'en_UK', 'Madagascar', '', '', ''), (105, 'es_ES', 'Madagascar', '', '', ''), (105, 'fr_FR', 'Madagascar', '', '', ''), -(106, 'en_EN', 'Malaysia', '', '', ''), +(106, 'en_UK', 'Malaysia', '', '', ''), (106, 'es_ES', 'Malasia', '', '', ''), (106, 'fr_FR', 'Malaisie', '', '', ''), -(107, 'en_EN', 'Malawi', '', '', ''), +(107, 'en_UK', 'Malawi', '', '', ''), (107, 'es_ES', 'Malawi', '', '', ''), (107, 'fr_FR', 'Malawi', '', '', ''), -(108, 'en_EN', 'Maldives', '', '', ''), +(108, 'en_UK', 'Maldives', '', '', ''), (108, 'es_ES', 'Maldivas', '', '', ''), (108, 'fr_FR', 'Maldives', '', '', ''), -(109, 'en_EN', 'Mali', '', '', ''), +(109, 'en_UK', 'Mali', '', '', ''), (109, 'es_ES', 'Malí', '', '', ''), (109, 'fr_FR', 'Mali', '', '', ''), -(110, 'en_EN', 'Malta', '', '', ''), +(110, 'en_UK', 'Malta', '', '', ''), (110, 'es_ES', 'Malta', '', '', ''), (110, 'fr_FR', 'Malte', '', '', ''), -(111, 'en_EN', 'Morocco', '', '', ''), +(111, 'en_UK', 'Morocco', '', '', ''), (111, 'es_ES', 'Marruecos', '', '', ''), (111, 'fr_FR', 'Maroc', '', '', ''), -(112, 'en_EN', 'Marshall Islands', '', '', ''), +(112, 'en_UK', 'Marshall Islands', '', '', ''), (112, 'es_ES', 'Marshall', '', '', ''), (112, 'fr_FR', 'Marshall', '', '', ''), -(113, 'en_EN', 'Mauritius', '', '', ''), +(113, 'en_UK', 'Mauritius', '', '', ''), (113, 'es_ES', 'Mauricio', '', '', ''), (113, 'fr_FR', 'Maurice', '', '', ''), -(114, 'en_EN', 'Mauritania', '', '', ''), +(114, 'en_UK', 'Mauritania', '', '', ''), (114, 'es_ES', 'Mauritania', '', '', ''), (114, 'fr_FR', 'Mauritanie', '', '', ''), -(115, 'en_EN', 'Mexico', '', '', ''), +(115, 'en_UK', 'Mexico', '', '', ''), (115, 'es_ES', 'Méjico', '', '', ''), (115, 'fr_FR', 'Mexique', '', '', ''), -(116, 'en_EN', 'Micronesia', '', '', ''), +(116, 'en_UK', 'Micronesia', '', '', ''), (116, 'es_ES', 'Micronesia', '', '', ''), (116, 'fr_FR', 'Micronésie', '', '', ''), -(117, 'en_EN', 'Moldova', '', '', ''), +(117, 'en_UK', 'Moldova', '', '', ''), (117, 'es_ES', 'Moldova', '', '', ''), (117, 'fr_FR', 'Moldavie', '', '', ''), -(118, 'en_EN', 'Monaco', '', '', ''), +(118, 'en_UK', 'Monaco', '', '', ''), (118, 'es_ES', 'Mónaco', '', '', ''), (118, 'fr_FR', 'Monaco', '', '', ''), -(119, 'en_EN', 'Mongolia', '', '', ''), +(119, 'en_UK', 'Mongolia', '', '', ''), (119, 'es_ES', 'Mongolia', '', '', ''), (119, 'fr_FR', 'Mongolie', '', '', ''), -(120, 'en_EN', 'Mozambique', '', '', ''), +(120, 'en_UK', 'Mozambique', '', '', ''), (120, 'es_ES', 'Mozambique', '', '', ''), (120, 'fr_FR', 'Mozambique', '', '', ''), -(121, 'en_EN', 'Namibia', '', '', ''), +(121, 'en_UK', 'Namibia', '', '', ''), (121, 'es_ES', 'Namibia', '', '', ''), (121, 'fr_FR', 'Namibie', '', '', ''), -(122, 'en_EN', 'Nauru', '', '', ''), +(122, 'en_UK', 'Nauru', '', '', ''), (122, 'es_ES', 'Nauru', '', '', ''), (122, 'fr_FR', 'Nauru', '', '', ''), -(123, 'en_EN', 'Nepal', '', '', ''), +(123, 'en_UK', 'Nepal', '', '', ''), (123, 'es_ES', 'Nepal', '', '', ''), (123, 'fr_FR', 'Népal', '', '', ''), -(124, 'en_EN', 'Nicaragua', '', '', ''), +(124, 'en_UK', 'Nicaragua', '', '', ''), (124, 'es_ES', 'Nicaragua', '', '', ''), (124, 'fr_FR', 'Nicaragua', '', '', ''), -(125, 'en_EN', 'Niger', '', '', ''), +(125, 'en_UK', 'Niger', '', '', ''), (125, 'es_ES', 'Níger', '', '', ''), (125, 'fr_FR', 'Niger', '', '', ''), -(126, 'en_EN', 'Nigeria', '', '', ''), +(126, 'en_UK', 'Nigeria', '', '', ''), (126, 'es_ES', 'Nigeria', '', '', ''), (126, 'fr_FR', 'Nigeria', '', '', ''), -(127, 'en_EN', 'Niue', '', '', ''), +(127, 'en_UK', 'Niue', '', '', ''), (127, 'es_ES', 'Niue', '', '', ''), (127, 'fr_FR', 'Niue', '', '', ''), -(128, 'en_EN', 'Norway', '', '', ''), +(128, 'en_UK', 'Norway', '', '', ''), (128, 'es_ES', 'Noruega', '', '', ''), (128, 'fr_FR', 'Norvège', '', '', ''), -(129, 'en_EN', 'New Zealand', '', '', ''), +(129, 'en_UK', 'New Zealand', '', '', ''), (129, 'es_ES', 'Nueva Zelandia', '', '', ''), (129, 'fr_FR', 'Nouvelle-Zélande', '', '', ''), -(130, 'en_EN', 'Oman', '', '', ''), +(130, 'en_UK', 'Oman', '', '', ''), (130, 'es_ES', 'Omán', '', '', ''), (130, 'fr_FR', 'Oman', '', '', ''), -(131, 'en_EN', 'Uganda', '', '', ''), +(131, 'en_UK', 'Uganda', '', '', ''), (131, 'es_ES', 'Uganda', '', '', ''), (131, 'fr_FR', 'Ouganda', '', '', ''), -(132, 'en_EN', 'Uzbekistan', '', '', ''), +(132, 'en_UK', 'Uzbekistan', '', '', ''), (132, 'es_ES', 'Uzbekistán', '', '', ''), (132, 'fr_FR', 'Ouzbékistan', '', '', ''), -(133, 'en_EN', 'Pakistan', '', '', ''), +(133, 'en_UK', 'Pakistan', '', '', ''), (133, 'es_ES', 'Pakistán', '', '', ''), (133, 'fr_FR', 'Pakistan', '', '', ''), -(134, 'en_EN', 'Panama', '', '', ''), +(134, 'en_UK', 'Panama', '', '', ''), (134, 'es_ES', 'Panamá', '', '', ''), (134, 'fr_FR', 'Panama', '', '', ''), -(135, 'en_EN', 'Papua Nueva Guinea', '', '', ''), +(135, 'en_UK', 'Papua Nueva Guinea', '', '', ''), (135, 'es_ES', 'Papua Nueva Guinea', '', '', ''), (135, 'fr_FR', 'Papouasie', '', '', ''), -(136, 'en_EN', 'Paraguay', '', '', ''), +(136, 'en_UK', 'Paraguay', '', '', ''), (136, 'es_ES', 'Paraguay', '', '', ''), (136, 'fr_FR', 'Paraguay', '', '', ''), -(137, 'en_EN', 'Netherlands', '', '', ''), +(137, 'en_UK', 'Netherlands', '', '', ''), (137, 'es_ES', 'Países Bajos', '', '', ''), (137, 'fr_FR', 'Pays-Bas', '', '', ''), -(138, 'en_EN', 'Peru', '', '', ''), +(138, 'en_UK', 'Peru', '', '', ''), (138, 'es_ES', 'Perú', '', '', ''), (138, 'fr_FR', 'Pérou', '', '', ''), -(139, 'en_EN', 'Philippines', '', '', ''), +(139, 'en_UK', 'Philippines', '', '', ''), (139, 'es_ES', 'Filipinas', '', '', ''), (139, 'fr_FR', 'Philippines', '', '', ''), -(140, 'en_EN', 'Poland', '', '', ''), +(140, 'en_UK', 'Poland', '', '', ''), (140, 'es_ES', 'Polonia', '', '', ''), (140, 'fr_FR', 'Pologne', '', '', ''), -(141, 'en_EN', 'Portugal', '', '', ''), +(141, 'en_UK', 'Portugal', '', '', ''), (141, 'es_ES', 'Portugal', '', '', ''), (141, 'fr_FR', 'Portugal', '', '', ''), -(142, 'en_EN', 'Qatar', '', '', ''), +(142, 'en_UK', 'Qatar', '', '', ''), (142, 'es_ES', 'Qatar', '', '', ''), (142, 'fr_FR', 'Qatar', '', '', ''), -(143, 'en_EN', 'Central African Republic', '', '', ''), +(143, 'en_UK', 'Central African Republic', '', '', ''), (143, 'es_ES', 'República Centroafricana', '', '', ''), (143, 'fr_FR', 'République centrafricaine', '', '', ''), -(144, 'en_EN', 'Dominican Republic', '', '', ''), +(144, 'en_UK', 'Dominican Republic', '', '', ''), (144, 'es_ES', 'República Dominicana', '', '', ''), (144, 'fr_FR', 'République dominicaine', '', '', ''), -(145, 'en_EN', 'Czech Republic', '', '', ''), +(145, 'en_UK', 'Czech Republic', '', '', ''), (145, 'es_ES', 'República Checa', '', '', ''), (145, 'fr_FR', 'République tchèque', '', '', ''), -(146, 'en_EN', 'Romania', '', '', ''), +(146, 'en_UK', 'Romania', '', '', ''), (146, 'es_ES', 'Rumania', '', '', ''), (146, 'fr_FR', 'Roumanie', '', '', ''), -(147, 'en_EN', 'United Kingdom', '', '', ''), +(147, 'en_UK', 'United Kingdom', '', '', ''), (147, 'es_ES', 'Reino Unido', '', '', ''), (147, 'fr_FR', 'Royaume-Uni', '', '', ''), -(148, 'en_EN', 'Russia', '', '', ''), +(148, 'en_UK', 'Russia', '', '', ''), (148, 'es_ES', 'Rusia', '', '', ''), (148, 'fr_FR', 'Russie', '', '', ''), -(149, 'en_EN', 'Rwanda', '', '', ''), +(149, 'en_UK', 'Rwanda', '', '', ''), (149, 'es_ES', 'Ruanda', '', '', ''), (149, 'fr_FR', 'Rwanda', '', '', ''), -(150, 'en_EN', 'Saint Kitts and Nevis', '', '', ''), +(150, 'en_UK', 'Saint Kitts and Nevis', '', '', ''), (150, 'es_ES', 'San Cristóbal', '', '', ''), (150, 'fr_FR', 'Saint-Christophe-et-Niévès', '', '', ''), -(151, 'en_EN', 'Saint Lucia', '', '', ''), +(151, 'en_UK', 'Saint Lucia', '', '', ''), (151, 'es_ES', 'Santa Lucía', '', '', ''), (151, 'fr_FR', 'Sainte-Lucie', '', '', ''), -(152, 'en_EN', 'San Marino', '', '', ''), +(152, 'en_UK', 'San Marino', '', '', ''), (152, 'es_ES', 'San Marino', '', '', ''), (152, 'fr_FR', 'Saint-Marin', '', '', ''), -(153, 'en_EN', 'Saint Vincent and the Grenadines', '', '', ''), +(153, 'en_UK', 'Saint Vincent and the Grenadines', '', '', ''), (153, 'es_ES', 'San Vicente y las Granadinas', '', '', ''), (153, 'fr_FR', 'Saint-Vincent-et-les Grenadines', '', '', ''), -(154, 'en_EN', 'Solomon Islands', '', '', ''), +(154, 'en_UK', 'Solomon Islands', '', '', ''), (154, 'es_ES', 'Salomón', '', '', ''), (154, 'fr_FR', 'Salomon', '', '', ''), -(155, 'en_EN', 'El Salvador', '', '', ''), +(155, 'en_UK', 'El Salvador', '', '', ''), (155, 'es_ES', 'El Salvador', '', '', ''), (155, 'fr_FR', 'Salvador', '', '', ''), -(156, 'en_EN', 'Western Samoa', '', '', ''), +(156, 'en_UK', 'Western Samoa', '', '', ''), (156, 'es_ES', 'Samoa', '', '', ''), (156, 'fr_FR', 'Samoa occidentales', '', '', ''), -(157, 'en_EN', 'Sao Tome and Principe', '', '', ''), +(157, 'en_UK', 'Sao Tome and Principe', '', '', ''), (157, 'es_ES', 'Santo Tomé y Príncipe', '', '', ''), (157, 'fr_FR', 'Sao Tomé-et-Principe', '', '', ''), -(158, 'en_EN', 'Senegal', '', '', ''), +(158, 'en_UK', 'Senegal', '', '', ''), (158, 'es_ES', 'Senegal', '', '', ''), (158, 'fr_FR', 'Sénégal', '', '', ''), -(159, 'en_EN', 'Seychelles', '', '', ''), +(159, 'en_UK', 'Seychelles', '', '', ''), (159, 'es_ES', 'Seychelles', '', '', ''), (159, 'fr_FR', 'Seychelles', '', '', ''), -(160, 'en_EN', 'Sierra Leone', '', '', ''), +(160, 'en_UK', 'Sierra Leone', '', '', ''), (160, 'es_ES', 'Sierra Leona', '', '', ''), (160, 'fr_FR', 'Sierra Leone', '', '', ''), -(161, 'en_EN', 'Singapore', '', '', ''), +(161, 'en_UK', 'Singapore', '', '', ''), (161, 'es_ES', 'Singapur', '', '', ''), (161, 'fr_FR', 'Singapour', '', '', ''), -(162, 'en_EN', 'Slovakia', '', '', ''), +(162, 'en_UK', 'Slovakia', '', '', ''), (162, 'es_ES', 'Eslovaquia', '', '', ''), (162, 'fr_FR', 'Slovaquie', '', '', ''), -(163, 'en_EN', 'Slovenia', '', '', ''), +(163, 'en_UK', 'Slovenia', '', '', ''), (163, 'es_ES', 'Eslovenia', '', '', ''), (163, 'fr_FR', 'Slovénie', '', '', ''), -(164, 'en_EN', 'Somalia', '', '', ''), +(164, 'en_UK', 'Somalia', '', '', ''), (164, 'es_ES', 'Somalia', '', '', ''), (164, 'fr_FR', 'Somalie', '', '', ''), -(165, 'en_EN', 'Sudan', '', '', ''), +(165, 'en_UK', 'Sudan', '', '', ''), (165, 'es_ES', 'Sudán', '', '', ''), (165, 'fr_FR', 'Soudan', '', '', ''), -(166, 'en_EN', 'Sri Lanka', '', '', ''), +(166, 'en_UK', 'Sri Lanka', '', '', ''), (166, 'es_ES', 'Sri Lanka', '', '', ''), (166, 'fr_FR', 'Sri Lanka', '', '', ''), -(167, 'en_EN', 'Sweden', '', '', ''), +(167, 'en_UK', 'Sweden', '', '', ''), (167, 'es_ES', 'Suecia', '', '', ''), (167, 'fr_FR', 'Suède', '', '', ''), -(168, 'en_EN', 'Switzerland', '', '', ''), +(168, 'en_UK', 'Switzerland', '', '', ''), (168, 'es_ES', 'Suiza', '', '', ''), (168, 'fr_FR', 'Suisse', '', '', ''), -(169, 'en_EN', 'Suriname', '', '', ''), +(169, 'en_UK', 'Suriname', '', '', ''), (169, 'es_ES', 'Suriname', '', '', ''), (169, 'fr_FR', 'Suriname', '', '', ''), -(170, 'en_EN', 'Swaziland', '', '', ''), +(170, 'en_UK', 'Swaziland', '', '', ''), (170, 'es_ES', 'Swazilandia', '', '', ''), (170, 'fr_FR', 'Swaziland', '', '', ''), -(171, 'en_EN', 'Syria', '', '', ''), +(171, 'en_UK', 'Syria', '', '', ''), (171, 'es_ES', 'Siria', '', '', ''), (171, 'fr_FR', 'Syrie', '', '', ''), -(172, 'en_EN', 'Tajikistan', '', '', ''), +(172, 'en_UK', 'Tajikistan', '', '', ''), (172, 'es_ES', 'Tayikistán', '', '', ''), (172, 'fr_FR', 'Tadjikistan', '', '', ''), -(173, 'en_EN', 'Tanzania', '', '', ''), +(173, 'en_UK', 'Tanzania', '', '', ''), (173, 'es_ES', 'Tanzanía', '', '', ''), (173, 'fr_FR', 'Tanzanie', '', '', ''), -(174, 'en_EN', 'Chad', '', '', ''), +(174, 'en_UK', 'Chad', '', '', ''), (174, 'es_ES', 'Chad', '', '', ''), (174, 'fr_FR', 'Tchad', '', '', ''), -(175, 'en_EN', 'Thailand', '', '', ''), +(175, 'en_UK', 'Thailand', '', '', ''), (175, 'es_ES', 'Tailandia', '', '', ''), (175, 'fr_FR', 'Thaïlande', '', '', ''), -(176, 'en_EN', 'Togo', '', '', ''), +(176, 'en_UK', 'Togo', '', '', ''), (176, 'es_ES', 'Togo', '', '', ''), (176, 'fr_FR', 'Togo', '', '', ''), -(177, 'en_EN', 'Tonga', '', '', ''), +(177, 'en_UK', 'Tonga', '', '', ''), (177, 'es_ES', 'Tonga', '', '', ''), (177, 'fr_FR', 'Tonga', '', '', ''), -(178, 'en_EN', 'Trinidad and Tobago', '', '', ''), +(178, 'en_UK', 'Trinidad and Tobago', '', '', ''), (178, 'es_ES', 'Trinidad y Tabago', '', '', ''), (178, 'fr_FR', 'Trinité-et-Tobago', '', '', ''), -(179, 'en_EN', 'Tunisia', '', '', ''), +(179, 'en_UK', 'Tunisia', '', '', ''), (179, 'es_ES', 'Túnez', '', '', ''), (179, 'fr_FR', 'Tunisie', '', '', ''), -(180, 'en_EN', 'Turkmenistan', '', '', ''), +(180, 'en_UK', 'Turkmenistan', '', '', ''), (180, 'es_ES', 'Turkmenistán', '', '', ''), (180, 'fr_FR', 'Turkménistan', '', '', ''), -(181, 'en_EN', 'Turkey', '', '', ''), +(181, 'en_UK', 'Turkey', '', '', ''), (181, 'es_ES', 'Turquía', '', '', ''), (181, 'fr_FR', 'Turquie', '', '', ''), -(182, 'en_EN', 'Tuvalu', '', '', ''), +(182, 'en_UK', 'Tuvalu', '', '', ''), (182, 'es_ES', 'Tuvalu', '', '', ''), (182, 'fr_FR', 'Tuvalu', '', '', ''), -(183, 'en_EN', 'Ukraine', '', '', ''), +(183, 'en_UK', 'Ukraine', '', '', ''), (183, 'es_ES', 'Ucrania', '', '', ''), (183, 'fr_FR', 'Ukraine', '', '', ''), -(184, 'en_EN', 'Uruguay', '', '', ''), +(184, 'en_UK', 'Uruguay', '', '', ''), (184, 'es_ES', 'Uruguay', '', '', ''), (184, 'fr_FR', 'Uruguay', '', '', ''), -(185, 'en_EN', 'The Vatican', '', '', ''), +(185, 'en_UK', 'The Vatican', '', '', ''), (185, 'es_ES', 'El Vatican', '', '', ''), (185, 'fr_FR', 'Vatican', '', '', ''), -(186, 'en_EN', 'Vanuatu', '', '', ''), +(186, 'en_UK', 'Vanuatu', '', '', ''), (186, 'es_ES', 'Vanuatu', '', '', ''), (186, 'fr_FR', 'Vanuatu', '', '', ''), -(187, 'en_EN', 'Venezuela', '', '', ''), +(187, 'en_UK', 'Venezuela', '', '', ''), (187, 'es_ES', 'Venezuela', '', '', ''), (187, 'fr_FR', 'Venezuela', '', '', ''), -(188, 'en_EN', 'Vietnam', '', '', ''), +(188, 'en_UK', 'Vietnam', '', '', ''), (188, 'es_ES', 'Viet Nam', '', '', ''), (188, 'fr_FR', 'Viêt Nam', '', '', ''), -(189, 'en_EN', 'Yemen', '', '', ''), +(189, 'en_UK', 'Yemen', '', '', ''), (189, 'es_ES', 'Yemen', '', '', ''), (189, 'fr_FR', 'Yémen', '', '', ''), -(190, 'en_EN', 'Yougoslavia', '', '', ''), +(190, 'en_UK', 'Yougoslavia', '', '', ''), (190, 'es_ES', 'Yugoslavia', '', '', ''), (190, 'fr_FR', 'Yougoslavie', '', '', ''), -(191, 'en_EN', 'Zaire', '', '', ''), +(191, 'en_UK', 'Zaire', '', '', ''), (191, 'es_ES', 'Zaire', '', '', ''), (191, 'fr_FR', 'Zaïre', '', '', ''), -(192, 'en_EN', 'Zambia', '', '', ''), +(192, 'en_UK', 'Zambia', '', '', ''), (192, 'es_ES', 'Zambia', '', '', ''), (192, 'fr_FR', 'Zambie', '', '', ''), -(193, 'en_EN', 'Zimbabwe', '', '', ''), +(193, 'en_UK', 'Zimbabwe', '', '', ''), (193, 'es_ES', 'Zimbabwe', '', '', ''), (193, 'fr_FR', 'Zimbabwe', '', '', ''), -(196, 'en_EN', 'USA - Alaska', '', '', ''), +(196, 'en_UK', 'USA - Alaska', '', '', ''), (196, 'es_ES', 'USA - Alaska', '', '', ''), (196, 'fr_FR', 'USA - Alaska', '', '', ''), -(197, 'en_EN', 'USA - Arizona', '', '', ''), +(197, 'en_UK', 'USA - Arizona', '', '', ''), (197, 'es_ES', 'USA - Arizona', '', '', ''), (197, 'fr_FR', 'USA - Arizona', '', '', ''), -(198, 'en_EN', 'USA - Arkansas', '', '', ''), +(198, 'en_UK', 'USA - Arkansas', '', '', ''), (198, 'es_ES', 'USA - Arkansas', '', '', ''), (198, 'fr_FR', 'USA - Arkansas', '', '', ''), -(199, 'en_EN', 'USA - California', '', '', ''), +(199, 'en_UK', 'USA - California', '', '', ''), (199, 'es_ES', 'USA - California', '', '', ''), (199, 'fr_FR', 'USA - California', '', '', ''), -(200, 'en_EN', 'USA - Colorado', '', '', ''), +(200, 'en_UK', 'USA - Colorado', '', '', ''), (200, 'es_ES', 'USA - Colorado', '', '', ''), (200, 'fr_FR', 'USA - Colorado', '', '', ''), -(201, 'en_EN', 'USA - Connecticut', '', '', ''), +(201, 'en_UK', 'USA - Connecticut', '', '', ''), (201, 'es_ES', 'USA - Connecticut', '', '', ''), (201, 'fr_FR', 'USA - Connecticut', '', '', ''), -(202, 'en_EN', 'USA - Delaware', '', '', ''), +(202, 'en_UK', 'USA - Delaware', '', '', ''), (202, 'es_ES', 'USA - Delaware', '', '', ''), (202, 'fr_FR', 'USA - Delaware', '', '', ''), -(203, 'en_EN', 'USA - District Of Columbia', '', '', ''), +(203, 'en_UK', 'USA - District Of Columbia', '', '', ''), (203, 'es_ES', 'USA - District Of Columbia', '', '', ''), (203, 'fr_FR', 'USA - District Of Columbia', '', '', ''), -(204, 'en_EN', 'USA - Florida', '', '', ''), +(204, 'en_UK', 'USA - Florida', '', '', ''), (204, 'es_ES', 'USA - Florida', '', '', ''), (204, 'fr_FR', 'USA - Florida', '', '', ''), -(205, 'en_EN', 'USA - Georgia', '', '', ''), +(205, 'en_UK', 'USA - Georgia', '', '', ''), (205, 'es_ES', 'USA - Georgia', '', '', ''), (205, 'fr_FR', 'USA - Georgia', '', '', ''), -(206, 'en_EN', 'USA - Hawaii', '', '', ''), +(206, 'en_UK', 'USA - Hawaii', '', '', ''), (206, 'es_ES', 'USA - Hawaii', '', '', ''), (206, 'fr_FR', 'USA - Hawaii', '', '', ''), -(207, 'en_EN', 'USA - Idaho', '', '', ''), +(207, 'en_UK', 'USA - Idaho', '', '', ''), (207, 'es_ES', 'USA - Idaho', '', '', ''), (207, 'fr_FR', 'USA - Idaho', '', '', ''), -(208, 'en_EN', 'USA - Illinois', '', '', ''), +(208, 'en_UK', 'USA - Illinois', '', '', ''), (208, 'es_ES', 'USA - Illinois', '', '', ''), (208, 'fr_FR', 'USA - Illinois', '', '', ''), -(209, 'en_EN', 'USA - Indiana', '', '', ''), +(209, 'en_UK', 'USA - Indiana', '', '', ''), (209, 'es_ES', 'USA - Indiana', '', '', ''), (209, 'fr_FR', 'USA - Indiana', '', '', ''), -(210, 'en_EN', 'USA - Iowa', '', '', ''), +(210, 'en_UK', 'USA - Iowa', '', '', ''), (210, 'es_ES', 'USA - Iowa', '', '', ''), (210, 'fr_FR', 'USA - Iowa', '', '', ''), -(211, 'en_EN', 'USA - Kansas', '', '', ''), +(211, 'en_UK', 'USA - Kansas', '', '', ''), (211, 'es_ES', 'USA - Kansas', '', '', ''), (211, 'fr_FR', 'USA - Kansas', '', '', ''), -(212, 'en_EN', 'USA - Kentucky', '', '', ''), +(212, 'en_UK', 'USA - Kentucky', '', '', ''), (212, 'es_ES', 'USA - Kentucky', '', '', ''), (212, 'fr_FR', 'USA - Kentucky', '', '', ''), -(213, 'en_EN', 'USA - Louisiana', '', '', ''), +(213, 'en_UK', 'USA - Louisiana', '', '', ''), (213, 'es_ES', 'USA - Louisiana', '', '', ''), (213, 'fr_FR', 'USA - Louisiana', '', '', ''), -(214, 'en_EN', 'USA - Maine', '', '', ''), +(214, 'en_UK', 'USA - Maine', '', '', ''), (214, 'es_ES', 'USA - Maine', '', '', ''), (214, 'fr_FR', 'USA - Maine', '', '', ''), -(215, 'en_EN', 'USA - Maryland', '', '', ''), +(215, 'en_UK', 'USA - Maryland', '', '', ''), (215, 'es_ES', 'USA - Maryland', '', '', ''), (215, 'fr_FR', 'USA - Maryland', '', '', ''), -(216, 'en_EN', 'USA - Massachusetts', '', '', ''), +(216, 'en_UK', 'USA - Massachusetts', '', '', ''), (216, 'es_ES', 'USA - Massachusetts', '', '', ''), (216, 'fr_FR', 'USA - Massachusetts', '', '', ''), -(217, 'en_EN', 'USA - Michigan', '', '', ''), +(217, 'en_UK', 'USA - Michigan', '', '', ''), (217, 'es_ES', 'USA - Michigan', '', '', ''), (217, 'fr_FR', 'USA - Michigan', '', '', ''), -(218, 'en_EN', 'USA - Minnesota', '', '', ''), +(218, 'en_UK', 'USA - Minnesota', '', '', ''), (218, 'es_ES', 'USA - Minnesota', '', '', ''), (218, 'fr_FR', 'USA - Minnesota', '', '', ''), -(219, 'en_EN', 'USA - Mississippi', '', '', ''), +(219, 'en_UK', 'USA - Mississippi', '', '', ''), (219, 'es_ES', 'USA - Mississippi', '', '', ''), (219, 'fr_FR', 'USA - Mississippi', '', '', ''), -(220, 'en_EN', 'USA - Missouri', '', '', ''), +(220, 'en_UK', 'USA - Missouri', '', '', ''), (220, 'es_ES', 'USA - Missouri', '', '', ''), (220, 'fr_FR', 'USA - Missouri', '', '', ''), -(221, 'en_EN', 'USA - Montana', '', '', ''), +(221, 'en_UK', 'USA - Montana', '', '', ''), (221, 'es_ES', 'USA - Montana', '', '', ''), (221, 'fr_FR', 'USA - Montana', '', '', ''), -(222, 'en_EN', 'USA - Nebraska', '', '', ''), +(222, 'en_UK', 'USA - Nebraska', '', '', ''), (222, 'es_ES', 'USA - Nebraska', '', '', ''), (222, 'fr_FR', 'USA - Nebraska', '', '', ''), -(223, 'en_EN', 'USA - Nevada', '', '', ''), +(223, 'en_UK', 'USA - Nevada', '', '', ''), (223, 'es_ES', 'USA - Nevada', '', '', ''), (223, 'fr_FR', 'USA - Nevada', '', '', ''), -(224, 'en_EN', 'USA - New Hampshire', '', '', ''), +(224, 'en_UK', 'USA - New Hampshire', '', '', ''), (224, 'es_ES', 'USA - New Hampshire', '', '', ''), (224, 'fr_FR', 'USA - New Hampshire', '', '', ''), -(225, 'en_EN', 'USA - New Jersey', '', '', ''), +(225, 'en_UK', 'USA - New Jersey', '', '', ''), (225, 'es_ES', 'USA - New Jersey', '', '', ''), (225, 'fr_FR', 'USA - New Jersey', '', '', ''), -(226, 'en_EN', 'USA - New Mexico', '', '', ''), +(226, 'en_UK', 'USA - New Mexico', '', '', ''), (226, 'es_ES', 'USA - New Mexico', '', '', ''), (226, 'fr_FR', 'USA - New Mexico', '', '', ''), -(227, 'en_EN', 'USA - New York', '', '', ''), +(227, 'en_UK', 'USA - New York', '', '', ''), (227, 'es_ES', 'USA - New York', '', '', ''), (227, 'fr_FR', 'USA - New York', '', '', ''), -(228, 'en_EN', 'USA - North Carolina', '', '', ''), +(228, 'en_UK', 'USA - North Carolina', '', '', ''), (228, 'es_ES', 'USA - North Carolina', '', '', ''), (228, 'fr_FR', 'USA - North Carolina', '', '', ''), -(229, 'en_EN', 'USA - North Dakota', '', '', ''), +(229, 'en_UK', 'USA - North Dakota', '', '', ''), (229, 'es_ES', 'USA - North Dakota', '', '', ''), (229, 'fr_FR', 'USA - North Dakota', '', '', ''), -(230, 'en_EN', 'USA - Ohio', '', '', ''), +(230, 'en_UK', 'USA - Ohio', '', '', ''), (230, 'es_ES', 'USA - Ohio', '', '', ''), (230, 'fr_FR', 'USA - Ohio', '', '', ''), -(231, 'en_EN', 'USA - Oklahoma', '', '', ''), +(231, 'en_UK', 'USA - Oklahoma', '', '', ''), (231, 'es_ES', 'USA - Oklahoma', '', '', ''), (231, 'fr_FR', 'USA - Oklahoma', '', '', ''), -(232, 'en_EN', 'USA - Oregon', '', '', ''), +(232, 'en_UK', 'USA - Oregon', '', '', ''), (232, 'es_ES', 'USA - Oregon', '', '', ''), (232, 'fr_FR', 'USA - Oregon', '', '', ''), -(233, 'en_EN', 'USA - Pennsylvania', '', '', ''), +(233, 'en_UK', 'USA - Pennsylvania', '', '', ''), (233, 'es_ES', 'USA - Pennsylvania', '', '', ''), (233, 'fr_FR', 'USA - Pennsylvania', '', '', ''), -(234, 'en_EN', 'USA - Rhode Island', '', '', ''), +(234, 'en_UK', 'USA - Rhode Island', '', '', ''), (234, 'es_ES', 'USA - Rhode Island', '', '', ''), (234, 'fr_FR', 'USA - Rhode Island', '', '', ''), -(235, 'en_EN', 'USA - South Carolina', '', '', ''), +(235, 'en_UK', 'USA - South Carolina', '', '', ''), (235, 'es_ES', 'USA - South Carolina', '', '', ''), (235, 'fr_FR', 'USA - South Carolina', '', '', ''), -(236, 'en_EN', 'USA - South Dakota', '', '', ''), +(236, 'en_UK', 'USA - South Dakota', '', '', ''), (236, 'es_ES', 'USA - South Dakota', '', '', ''), (236, 'fr_FR', 'USA - South Dakota', '', '', ''), -(237, 'en_EN', 'USA - Tennessee', '', '', ''), +(237, 'en_UK', 'USA - Tennessee', '', '', ''), (237, 'es_ES', 'USA - Tennessee', '', '', ''), (237, 'fr_FR', 'USA - Tennessee', '', '', ''), -(238, 'en_EN', 'USA - Texas', '', '', ''), +(238, 'en_UK', 'USA - Texas', '', '', ''), (238, 'es_ES', 'USA - Texas', '', '', ''), (238, 'fr_FR', 'USA - Texas', '', '', ''), -(239, 'en_EN', 'USA - Utah', '', '', ''), +(239, 'en_UK', 'USA - Utah', '', '', ''), (239, 'es_ES', 'USA - Utah', '', '', ''), (239, 'fr_FR', 'USA - Utah', '', '', ''), -(240, 'en_EN', 'USA - Vermont', '', '', ''), +(240, 'en_UK', 'USA - Vermont', '', '', ''), (240, 'es_ES', 'USA - Vermont', '', '', ''), (240, 'fr_FR', 'USA - Vermont', '', '', ''), -(241, 'en_EN', 'USA - Virginia', '', '', ''), +(241, 'en_UK', 'USA - Virginia', '', '', ''), (241, 'es_ES', 'USA - Virginia', '', '', ''), (241, 'fr_FR', 'USA - Virginia', '', '', ''), -(242, 'en_EN', 'USA - Washington', '', '', ''), +(242, 'en_UK', 'USA - Washington', '', '', ''), (242, 'es_ES', 'USA - Washington', '', '', ''), (242, 'fr_FR', 'USA - Washington', '', '', ''), -(243, 'en_EN', 'USA - West Virginia', '', '', ''), +(243, 'en_UK', 'USA - West Virginia', '', '', ''), (243, 'es_ES', 'USA - West Virginia', '', '', ''), (243, 'fr_FR', 'USA - West Virginia', '', '', ''), -(244, 'en_EN', 'USA - Wisconsin', '', '', ''), +(244, 'en_UK', 'USA - Wisconsin', '', '', ''), (244, 'es_ES', 'USA - Wisconsin', '', '', ''), (244, 'fr_FR', 'USA - Wisconsin', '', '', ''), -(245, 'en_EN', 'USA - Wyoming', '', '', ''), +(245, 'en_UK', 'USA - Wyoming', '', '', ''), (245, 'es_ES', 'USA - Wyoming', '', '', ''), (245, 'fr_FR', 'USA - Wyoming', '', '', ''), -(246, 'en_EN', 'Canada - Colombie-Britannique', '', '', ''), +(246, 'en_UK', 'Canada - Colombie-Britannique', '', '', ''), (246, 'es_ES', 'Canada - Colombie-Britannique', '', '', ''), (246, 'fr_FR', 'Canada - Colombie-Britannique', '', '', ''), -(247, 'en_EN', 'Canada - Alberta', '', '', ''), +(247, 'en_UK', 'Canada - Alberta', '', '', ''), (247, 'es_ES', 'Canada - Alberta', '', '', ''), (247, 'fr_FR', 'Canada - Alberta', '', '', ''), -(248, 'en_EN', 'Canada - Saskatchewan', '', '', ''), +(248, 'en_UK', 'Canada - Saskatchewan', '', '', ''), (248, 'es_ES', 'Canada - Saskatchewan', '', '', ''), (248, 'fr_FR', 'Canada - Saskatchewan', '', '', ''), -(249, 'en_EN', 'Canada - Manitoba', '', '', ''), +(249, 'en_UK', 'Canada - Manitoba', '', '', ''), (249, 'es_ES', 'Canada - Manitoba', '', '', ''), (249, 'fr_FR', 'Canada - Manitoba', '', '', ''), -(250, 'en_EN', 'Canada - Ontario', '', '', ''), +(250, 'en_UK', 'Canada - Ontario', '', '', ''), (250, 'es_ES', 'Canada - Ontario', '', '', ''), (250, 'fr_FR', 'Canada - Ontario', '', '', ''), -(251, 'en_EN', 'Canada - Québec', '', '', ''), +(251, 'en_UK', 'Canada - Québec', '', '', ''), (251, 'es_ES', 'Canada - Québec', '', '', ''), (251, 'fr_FR', 'Canada - Québec', '', '', ''), -(252, 'en_EN', 'Canada - Nouveau-Brunswick', '', '', ''), +(252, 'en_UK', 'Canada - Nouveau-Brunswick', '', '', ''), (252, 'es_ES', 'Canada - Nouveau-Brunswick', '', '', ''), (252, 'fr_FR', 'Canada - Nouveau-Brunswick', '', '', ''), -(253, 'en_EN', 'Canada - Nouvelle-Écosse', '', '', ''), +(253, 'en_UK', 'Canada - Nouvelle-Écosse', '', '', ''), (253, 'es_ES', 'Canada - Nouvelle-Écosse', '', '', ''), (253, 'fr_FR', 'Canada - Nouvelle-Écosse', '', '', ''), -(254, 'en_EN', 'Canada - Île-du-Prince-Édouard ', '', '', ''), +(254, 'en_UK', 'Canada - Île-du-Prince-Édouard ', '', '', ''), (254, 'es_ES', 'Canada - Île-du-Prince-Édouard ', '', '', ''), (254, 'fr_FR', 'Canada - Île-du-Prince-Édouard ', '', '', ''), -(255, 'en_EN', 'Canada - Terre-Neuve-et-Labrador ', '', '', ''), +(255, 'en_UK', 'Canada - Terre-Neuve-et-Labrador ', '', '', ''), (255, 'es_ES', 'Canada - Terre-Neuve-et-Labrador ', '', '', ''), (255, 'fr_FR', 'Canada - Terre-Neuve-et-Labrador ', '', '', ''), -(256, 'en_EN', 'Canada - Yukon', '', '', ''), +(256, 'en_UK', 'Canada - Yukon', '', '', ''), (256, 'es_ES', 'Canada - Yukon', '', '', ''), (256, 'fr_FR', 'Canada - Yukon', '', '', ''), -(257, 'en_EN', 'Canada - Territoires-du-Nord-Ouest', '', '', ''), +(257, 'en_UK', 'Canada - Territoires-du-Nord-Ouest', '', '', ''), (257, 'es_ES', 'Canada - Territoires-du-Nord-Ouest', '', '', ''), (257, 'fr_FR', 'Canada - Territoires-du-Nord-Ouest', '', '', ''), -(258, 'en_EN', 'Canada - Nunavut', '', '', ''), +(258, 'en_UK', 'Canada - Nunavut', '', '', ''), (258, 'es_ES', 'Canada - Nunavut', '', '', ''), (258, 'fr_FR', 'Canada - Nunavut', '', '', ''), -(259, 'en_EN', 'Guadeloupe', '', '', ''), +(259, 'en_UK', 'Guadeloupe', '', '', ''), (259, 'es_ES', 'Guadeloupe', '', '', ''), (259, 'fr_FR', 'Guadeloupe', '', '', ''), -(260, 'en_EN', 'Guyane Française', '', '', ''), +(260, 'en_UK', 'Guyane Française', '', '', ''), (260, 'es_ES', 'Guyane Française', '', '', ''), (260, 'fr_FR', 'Guyane Française', '', '', ''), -(261, 'en_EN', 'Martinique', '', '', ''), +(261, 'en_UK', 'Martinique', '', '', ''), (261, 'es_ES', 'Martinique', '', '', ''), (261, 'fr_FR', 'Martinique', '', '', ''), -(262, 'en_EN', 'Mayotte', '', '', ''), +(262, 'en_UK', 'Mayotte', '', '', ''), (262, 'es_ES', 'Mayotte', '', '', ''), (262, 'fr_FR', 'Mayotte', '', '', ''), -(263, 'en_EN', 'Réunion(La)', '', '', ''), +(263, 'en_UK', 'Réunion(La)', '', '', ''), (263, 'es_ES', 'Réunion(La)', '', '', ''), (263, 'fr_FR', 'Réunion(La)', '', '', ''), -(264, 'en_EN', 'St Pierre et Miquelon', '', '', ''), +(264, 'en_UK', 'St Pierre et Miquelon', '', '', ''), (264, 'es_ES', 'St Pierre et Miquelon', '', '', ''), (264, 'fr_FR', 'St Pierre et Miquelon', '', '', ''), -(265, 'en_EN', 'Nouvelle-Calédonie', '', '', ''), +(265, 'en_UK', 'Nouvelle-Calédonie', '', '', ''), (265, 'es_ES', 'Nouvelle-Calédonie', '', '', ''), (265, 'fr_FR', 'Nouvelle-Calédonie', '', '', ''), -(266, 'en_EN', 'Polynésie française', '', '', ''), +(266, 'en_UK', 'Polynésie française', '', '', ''), (266, 'es_ES', 'Polynésie française', '', '', ''), (266, 'fr_FR', 'Polynésie française', '', '', ''), -(267, 'en_EN', 'Wallis-et-Futuna', '', '', ''), +(267, 'en_UK', 'Wallis-et-Futuna', '', '', ''), (267, 'es_ES', 'Wallis-et-Futuna', '', '', ''), (267, 'fr_FR', 'Wallis-et-Futuna', '', '', ''), -(268, 'en_EN', 'USA - Alabama', '', '', ''), +(268, 'en_UK', 'USA - Alabama', '', '', ''), (268, 'es_ES', 'USA - Alabama', '', '', ''), (268, 'fr_FR', 'USA - Alabama', '', '', ''); diff --git a/templates/admin/default/assets/css/admin.less b/templates/admin/default/assets/css/admin.less index 85cef27da..0bc9fc274 100755 --- a/templates/admin/default/assets/css/admin.less +++ b/templates/admin/default/assets/css/admin.less @@ -621,6 +621,7 @@ form .info .input-append .add-on { li.active a { opacity: 1; background-color: #E7E7E7; + border: 1px solid #E9720F; } } } @@ -657,6 +658,7 @@ label { font-weight: normal; } + .form-horizontal input + .help-block, .form-horizontal select + .help-block, .form-horizontal textarea + .help-block, @@ -664,9 +666,10 @@ label { .form-horizontal .input-prepend + .help-block, .form-horizontal .input-append + .help-block .help-block, .form-horizontal .help-block { - margin-top: 0px; + margin-top: 5px; } + // Fix for append-fields shorter than others // see http://stackoverflow.com/questions/13306670/bootstrap-prepended-and-appended-input-how-to-max-input-field-width .input-append.input-block-level, @@ -725,6 +728,17 @@ label { td, th { text-align: center; + + &.text-center { + text-align: center; + } + &.text-left { + text-align: left; + } + &.text-right { + text-align: right; + } + } td.object-title, th.object-title { diff --git a/templates/admin/default/categories.html b/templates/admin/default/categories.html index 1548140bf..65902e5d7 100755 --- a/templates/admin/default/categories.html +++ b/templates/admin/default/categories.html @@ -47,54 +47,40 @@   + - {if $category_order == 'alpha'} - - {$order_change = 'alpha_reverse'} - {elseif $category_order == 'alpha_reverse'} - - {$order_change = 'alpha'} - {else} - {$order_change = 'alpha'} - {/if} - - {intl l="Category title"} - - + {admin_sortable_header + current_order=$category_order + order='alpha' + reverse_order='alpha_reverse' + path={url path='/admin/catalog/category' id="{$current_category_id}"} + label={intl l='Category title'} + } + {module_include location='category_list_header'} - {if $category_order == 'visible'} - - {$order_change = 'visible_reverse'} - {elseif $category_order == 'visible_reverse'} - - {$order_change = 'visible'} - {else} - {$order_change = 'visible'} - {/if} - - - {intl l="Online"} - + {admin_sortable_header + current_order=$category_order + order='visible' + reverse_order='visible_reverse' + path={url path='/admin/catalog/category' id="{$current_category_id}"} + label={intl l='Online'} + } - {if $category_order == 'manual'} - - {$order_change = 'manual_reverse'} - {elseif $category_order == 'manual_reverse'} - - {$order_change = 'manual'} - {else} - {$order_change = 'manual'} - {/if} - - {intl l="Position"} + {admin_sortable_header + current_order=$category_order + order='manual' + reverse_order='manual_reverse' + path={url path='/admin/catalog/category' id="{$current_category_id}"} + label={intl l='Position'} + } - {intl l="Actions"} +   @@ -126,15 +112,14 @@ - {loop type="auth" name="can_change" roles="ADMIN" permissions="admin.category.edit"} - - {$POSITION} - - {/loop} - - {elseloop rel="can_change"} - {$POSITION} - {/elseloop} + {admin_position_block + permission="admin.category.edit" + path={url path='admin/catalog/category' category_id="{$ID}"} + url_parameter="category_id" + in_place_edit_class="categoryPositionChange" + position="$POSITION" + id="$ID" + } @@ -200,13 +185,38 @@   - {intl l="Product title"} + + {admin_sortable_header + current_order=$product_order + order='alpha' + reverse_order='alpha_reverse' + path={url path='/admin/catalog/product' id="{$current_category_id}"} + label={intl l='Product title'} + } {module_include location='product_list_header'} - {intl l="Online"} - {intl l="Position"} - {intl l="Actions"} + + {admin_sortable_header + current_order=$product_order + order='visible' + reverse_order='visible_reverse' + path={url path='/admin/catalog/product' id="{$current_category_id}"} + label={intl l='Online'} + } + + + + {admin_sortable_header + current_order=$product_order + order='manual' + reverse_order='manual_reverse' + path={url path='/admin/catalog/product' id="{$current_category_id}"} + label={intl l='Position'} + } + + +   @@ -229,13 +239,18 @@ - - {$POSITION} - + {admin_position_block + permission="admin.product.edit" + path={url path='admin/catalog/product' category_id="{$ID}"} + url_parameter="product_id" + in_place_edit_class="productPositionChange" + position="$POSITION" + id="$ID" + } - + diff --git a/templates/admin/default/currencies.html b/templates/admin/default/currencies.html index 762bb47ee..a693214d7 100644 --- a/templates/admin/default/currencies.html +++ b/templates/admin/default/currencies.html @@ -26,7 +26,7 @@
-
+
- - - - - + {module_include location='currencies_table_header'} @@ -136,37 +118,37 @@ {loop name="currencies" type="currency" backend_context="1" lang=$lang_id order=$order} + - + - + - + - + - + - - - + {module_include location='currencies_table_row'} @@ -228,7 +210,7 @@ - - - + + + + + {module_include location='variables_table_header'} - {loop name="config" type="config" hidden="0" secured="*" backend_context="1" lang="$lang_id"} + {loop name="config" type="config" hidden="0" secured="*" backend_context="1" lang="$lang_id" order="$order"} @@ -172,6 +198,10 @@
{loop type="lang" name="default-lang" default_only="1"} + + {* Switch edition to the current locale *} + + {form_field form=$form field='locale'} {/form_field} diff --git a/templates/default/404.html b/templates/default/404.html new file mode 100644 index 000000000..7e2e925b4 --- /dev/null +++ b/templates/default/404.html @@ -0,0 +1,3 @@ +

PAGE NOT FOUND

+ +Back Home \ No newline at end of file
@@ -35,99 +35,81 @@ + {/loop}
- {if $order == 'id'} - - {$order_change = 'id_reverse'} - {elseif $order == 'id_reverse'} - - {$order_change = 'id'} - {else} - {$order_change = 'id'} - {/if} - - {intl l="ID"} - + {admin_sortable_header + current_order=$order + order='id' + reverse_order='id_reverse' + path='/admin/configuration/currencies' + label="{intl l='ID'}" + } - {if $order == 'alpha'} - - {$order_change = 'alpha_reverse'} - {elseif $order == 'alpha_reverse'} - - {$order_change = 'alpha'} - {else} - {$order_change = 'alpha'} - {/if} - - {intl l="Name"} - + {admin_sortable_header + current_order=$order + order='alpha' + reverse_order='alpha_reverse' + path='/admin/configuration/currencies' + label="{intl l='Name'}" + } - {if $order == 'code'} - - {$order_change = 'code_reverse'} - {elseif $order == 'code_reverse'} - - {$order_change = 'code'} - {else} - {$order_change = 'code'} - {/if} - {intl l="ISO 4217 Code"} + + {admin_sortable_header + current_order=$order + order='code' + reverse_order='code_reverse' + path='/admin/configuration/currencies' + label="{intl l="ISO 4217 Code"}" + } - {if $order == 'symbol'} - - {$order_change = 'symbol_reverse'} - {elseif $order == 'symbol_reverse'} - - {$order_change = 'symbol'} - {else} - {$order_change = 'symbol'} - {/if} - - {intl l="Symbol"} - + + {admin_sortable_header + current_order=$order + order='symbol' + reverse_order='symbol_reverse' + path='/admin/configuration/currencies' + label="{intl l="Symbol"}" + } - {if $order == 'rate'} - - {$order_change = 'rate_reverse'} - {elseif $order == 'rate_reverse'} - - {$order_change = 'rate'} - {else} - {$order_change = 'rate'} - {/if} - - {intl l="Rate in €"} - + + {admin_sortable_header + current_order=$order + order='rate' + reverse_order='rate_reverse' + path='/admin/configuration/currencies' + label="{intl l="Rate in €"}" + } - {if $order == 'manual'} - - {$order_change = 'manual_reverse'} - {elseif $order == 'manual_reverse'} - - {$order_change = 'manual'} - {else} - {$order_change = 'manual'} - {/if} - - {intl l="Position"} + + {admin_sortable_header + current_order=$order + order='manual' + reverse_order='manual_reverse' + path='/admin/configuration/currencies' + label="{intl l="Position"}" + } {intl l="Default"} + {admin_sortable_header + current_order=$order + order='is_default' + reverse_order='is_default_reverse' + path='/admin/configuration/currencies' + label="{intl l="Default"}" + } +
{$ID}{$ID} + {loop type="auth" name="can_change" roles="ADMIN" permissions="admin.configuration.currencies.change"} + {$NAME} + {/loop} + {elseloop rel="can_change"} + {$NAME} + {/elseloop} + - {loop type="auth" name="can_change" roles="ADMIN" permissions="admin.configuration.currencies.change"} - {$NAME} - {/loop} - {elseloop rel="can_change"} - {$NAME} - {/elseloop} - {$ISOCODE}{$ISOCODE}{$SYMBOL}{$SYMBOL}{format_number number="$RATE" decimals="4"}{$RATE|string_format:"%.4f"} + {admin_position_block + permission="admin.currencies.edit" + path="/admin/configuration/currencies" + url_parameter="currency_id" + in_place_edit_class="currencyPositionChange" + position="$POSITION" + id="$ID" + } + - {loop type="auth" name="can_change" roles="ADMIN" permissions="admin.category.edit"} - - {$POSITION} - - {/loop} - - {elseloop rel="can_change"} - {$POSITION} - {/elseloop} - + +
{intl l="Purpose"}{intl l="Name"}{intl l="Value"} + {admin_sortable_header + current_order=$order + order='title' + reverse_order='title_reverse' + path={url path='/admin/configuration/variables'} + label={intl l='Purpose'} + } + + {admin_sortable_header + current_order=$order + order='name' + reverse_order='name_reverse' + path={url path='/admin/configuration/variables'} + label={intl l='Name'} + } + + {admin_sortable_header + current_order=$order + order='value' + reverse_order='value_reverse' + path={url path='/admin/configuration/variables'} + label={intl l='Value'} + } +  
{$TITLE}