From 9056c725c7e8a410204ab48165eb1b288e91c430 Mon Sep 17 00:00:00 2001 From: Nicolas Villa Date: Mon, 20 Jan 2014 07:55:24 +0100 Subject: [PATCH 1/9] Implementation of the translation system for installation process --- web/install/I18n/en_US.php | 34 ++++++++++++++++++++++++++++++++++ web/install/I18n/fr_FR.php | 34 ++++++++++++++++++++++++++++++++++ web/install/bdd.php | 12 ++++++------ web/install/config.php | 14 +++++++------- web/install/connection.php | 12 ++++++------ web/install/end.php | 6 +++--- web/install/header.php | 35 ++++++++++++++++++++++++++--------- web/install/index.php | 11 ++++++++--- web/install/permission.php | 4 ++-- 9 files changed, 126 insertions(+), 36 deletions(-) create mode 100644 web/install/I18n/en_US.php create mode 100755 web/install/I18n/fr_FR.php diff --git a/web/install/I18n/en_US.php b/web/install/I18n/en_US.php new file mode 100644 index 000000000..d775686a7 --- /dev/null +++ b/web/install/I18n/en_US.php @@ -0,0 +1,34 @@ + 'Administrator login :', +'Administrator password :' => 'Administrator password :', +'Administrator password verification :' => 'Administrator password verification :', +'Checking permissions' => 'Checking permissions', +'Choose your database' => 'Choose your database', +'Company name :' => 'Company name :', +'Contact email :' => 'Contact email :', +'Continue' => 'Continue', +'Create an other database' => 'Create an other database', +'Database connection' => 'Database connection', +'Database selection' => 'Database selection', +'Don\'t forget to delete the web/install directory.' => 'Don\'t forget to delete the web/install directory.', +'General information' => 'General information', +'Go to back office' => 'Go to back office', +'Host :' => 'Host :', +'or' => 'or', +'Password :' => 'Password :', +'Port :' => 'Port :', +'Select below the one you want to use.' => 'Select below the one you want to use.', +'Thanks' => 'Thanks', +'Thanks, you have installed Thelia' => 'Thanks, you have installed Thelia', +'Thelia installation wizard' => 'Thelia installation wizard', +'The SQL server contains multiple databases.' => 'The SQL server contains multiple databases.', +'Username :' => 'Username :', +'Version undefined' => 'Version undefined', +'website url :' => 'website url :', +'Welcome' => 'Welcome', +'Welcome in the Thelia installation wizard.' => 'Welcome in the Thelia installation wizard.', +'We will guide you throughout this process to install any application on your system.' => 'We will guide you throughout this process to install any application on your system.', +'Wrong connection information' => 'Wrong connection information' +); diff --git a/web/install/I18n/fr_FR.php b/web/install/I18n/fr_FR.php new file mode 100755 index 000000000..d9aee3ceb --- /dev/null +++ b/web/install/I18n/fr_FR.php @@ -0,0 +1,34 @@ + 'Identifiant administrateur :', +'Administrator password :' => 'Mot de passe administrateur :', +'Administrator password verification :' => 'Vérification mot de passe administrateur :', +'Checking permissions' => 'Permissions', +'Choose your database' => 'Choissisez la base de donnée', +'Company name :' => 'Nom de la société :', +'Contact email :' => 'Email de contact :', +'Continue' => 'Continuez', +'Create an other database' => 'Créez une nouvelle base de donnée', +'Database connection' => 'Base de donnée', +'Database selection' => 'Sélectionnez la base de donnée', +'Don\'t forget to delete the web/install directory.' => 'N\'oubliez d\'enlever le répertoire web/install.', +'General information' => 'Information générale', +'Go to back office' => 'Allez dans l\'interface d\'administration', +'Host :' => 'Hôte :', +'or' => 'ou', +'Password :' => 'Mot de passe :', +'Port :' => 'Port :', +'Select below the one you want to use.' => 'Sélectionnez ci-dessous celle que vous souhaitez utiliser.', +'Thanks' => 'Merci', +'Thanks, you have installed Thelia' => 'Merci, d\'avoir installé Thélia', +'Thelia installation wizard' => 'Gestionnaire d\'installation de Thélia', +'The SQL server contains multiple databases.' => 'Le serveur SQL contient plusieurs databases.', +'Username :' => 'Utilisateur :', +'Version undefined' => 'Version non définie', +'website url :' => 'Url du site :', +'Welcome' => 'Bienvenue', +'Welcome in the Thelia installation wizard.' => 'Bienvenue dans le gestionnaire d\'installation de Thélia.', +'We will guide you throughout this process to install any application on your system.' => 'Nous allons vous guidez pour installer Thélia sur votre système.', +'Wrong connection information' => 'Mauvaise information de connexion' +); diff --git a/web/install/bdd.php b/web/install/bdd.php index 05fcfe762..5e46fe440 100755 --- a/web/install/bdd.php +++ b/web/install/bdd.php @@ -53,10 +53,10 @@ $databases = $connection->query('show databases');
- Choose your database + trans('Choose your database'); ?>

- The SQL server contains multiple databases.
- Select below the one you want to use. + trans('The SQL server contains multiple databases.'); ?>
+ trans('Select below the one you want to use.'); ?>

@@ -93,12 +93,12 @@ $databases = $connection->query('show databases'); if($permissions->fetchColumn(0) > 0) { ?>

- or + trans('or'); ?>

@@ -109,7 +109,7 @@ $databases = $connection->query('show databases');
- +
diff --git a/web/install/config.php b/web/install/config.php index b904a7900..938befb9d 100755 --- a/web/install/config.php +++ b/web/install/config.php @@ -81,32 +81,32 @@ $website_url = preg_replace("#/install/[a-z](.*)#" ,'', $url);
- +
- +
- +
- +
- +
- +
- +
diff --git a/web/install/connection.php b/web/install/connection.php index fdbddfafd..3d017884e 100755 --- a/web/install/connection.php +++ b/web/install/connection.php @@ -32,25 +32,25 @@ $_SESSION['install']['step'] = 3; -
Wrong connection information
+
trans('Wrong connection information'); ?>
- +
- +
- +
- +
@@ -58,7 +58,7 @@ $_SESSION['install']['step'] = 3;
- +
diff --git a/web/install/end.php b/web/install/end.php index 8c1d1d55c..d3eee16f4 100755 --- a/web/install/end.php +++ b/web/install/end.php @@ -67,14 +67,14 @@ $website_url = preg_replace("#/install/[a-z](.*)#" ,'', $url);

- Thanks, you have installed Thelia + trans('Thanks, you have installed Thelia'); ?>

- Don't forget to delete the web/install directory. + trans('Don\'t forget to delete the web/install directory.'); ?>

- Go to back office + trans('Go to back office'); ?>

diff --git a/web/install/header.php b/web/install/header.php index 983fa51ce..36aa4a28d 100755 --- a/web/install/header.php +++ b/web/install/header.php @@ -22,6 +22,21 @@ /*************************************************************************************/ session_start(); include 'bootstrap.php'; + +use Symfony\Component\Translation\Translator; + +$_SESSION['install']['lang'] = "en_US"; + +if($_REQUEST['lang']){ + $_SESSION['install']['lang'] = $_REQUEST['lang']; +} + +$trans = new Translator(); +$trans->setLocale($_SESSION['install']['lang']); +$trans->addLoader("php", new Symfony\Component\Translation\Loader\PhpFileLoader()); +$trans->addResource('php', __DIR__.'/I18n/'.$_SESSION['install']['lang'].'.php', $_SESSION['install']['lang']); + + ?> @@ -29,14 +44,16 @@ include 'bootstrap.php'; Installation + +
-
Version undefined
+
trans('Version undefined'); ?>
@@ -46,14 +63,14 @@ include 'bootstrap.php';
-

Thelia installation wizard

+

trans('Thelia installation wizard'); ?>

    -
  • 1Welcome
  • -
  • 2Checking permissions
  • -
  • 3Database connection
  • -
  • 4Database selection
  • -
  • 5General information
  • -
  • 6Thanks
  • +
  • 1trans('Welcome'); ?>
  • +
  • 2trans('Checking permissions'); ?>
  • +
  • 3trans('Database connection'); ?>
  • +
  • 4trans('Database selection'); ?>
  • +
  • 5trans('General information'); ?>
  • +
  • 6trans('Thanks'); ?>
-
\ No newline at end of file +
diff --git a/web/install/index.php b/web/install/index.php index 884ca11b7..05d916e3c 100755 --- a/web/install/index.php +++ b/web/install/index.php @@ -26,14 +26,19 @@ include("header.php"); ?>
+ +

-Welcome in the Thelia installation wizard. +trans('Welcome in the Thelia installation wizard.'); ?>

-We will guide you throughout this process to install any application on your system. +trans('We will guide you throughout this process to install any application on your system.'); ?>

\ No newline at end of file diff --git a/web/install/permission.php b/web/install/permission.php index fca995457..fda432d4f 100755 --- a/web/install/permission.php +++ b/web/install/permission.php @@ -35,7 +35,7 @@ $_SESSION['install']['current_step'] = 'permission.php'; $_SESSION['install']['step'] = 2; ?>
-

Checking permissions

+

trans('Checking permissions'); ?>

    $data): ?>
  • @@ -48,7 +48,7 @@ $_SESSION['install']['step'] = 2;
- Continue + trans('Continue'); ?> refresh From e68769efa66a24e65601dda3080d97becd043188 Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Mon, 20 Jan 2014 09:41:09 +0100 Subject: [PATCH 2/9] add alias branch in composer.json file --- composer.json | 5 +++++ composer.lock | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index ad71d52e6..d609eedc6 100755 --- a/composer.json +++ b/composer.json @@ -57,5 +57,10 @@ "": "local/modules/", "Thelia" : "core/lib/" } + }, + "extra": { + "branch-alias": { + "dev-master": "2.0.0-dev" + } } } diff --git a/composer.lock b/composer.lock index 6da4aed80..7dcf78eb5 100755 --- a/composer.lock +++ b/composer.lock @@ -3,7 +3,7 @@ "This file locks the dependencies of your project to a known state", "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file" ], - "hash": "6dee359d61c06345d0e4cc045b19dc4e", + "hash": "f779af80bcfc2ed1deefba9350bdcf66", "packages": [ { "name": "ensepar/html2pdf", From a176711d5c853d6caa7da8b36eaa98c02e8b75d6 Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Mon, 20 Jan 2014 09:44:09 +0100 Subject: [PATCH 3/9] add license badge in readme file --- Readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Readme.md b/Readme.md index abb8ccd30..07a36f389 100755 --- a/Readme.md +++ b/Readme.md @@ -3,7 +3,7 @@ Readme Thelia ------ -[![Build Status](https://travis-ci.org/thelia/thelia.png?branch=master)](https://travis-ci.org/thelia/thelia) +[![Build Status](https://travis-ci.org/thelia/thelia.png?branch=master)](https://travis-ci.org/thelia/thelia) [![License](https://poser.pugx.org/thelia/thelia/license.png)](https://packagist.org/packages/thelia/thelia) [Thelia](http://thelia.net/v2) is an open source tool for creating e-business websites and managing online content. This software is published under GPL. From 809d2631c0a09f14211312b81c6fb66c672a7b77 Mon Sep 17 00:00:00 2001 From: Etienne Roudeix Date: Mon, 20 Jan 2014 11:11:44 +0100 Subject: [PATCH 4/9] remove old functions --- .../Admin/AdministratorController.php | 21 ------------------- 1 file changed, 21 deletions(-) diff --git a/core/lib/Thelia/Controller/Admin/AdministratorController.php b/core/lib/Thelia/Controller/Admin/AdministratorController.php index 214d4cd7a..273728206 100644 --- a/core/lib/Thelia/Controller/Admin/AdministratorController.php +++ b/core/lib/Thelia/Controller/Admin/AdministratorController.php @@ -114,26 +114,6 @@ class AdministratorController extends AbstractCrudController return new AdministratorModificationForm($this->getRequest(), "form", $data); } - protected function hydrateResourceUpdateForm($object) - { - $data = array( - 'id' => $object->getId(), - ); - - // Setup the object form - return new AdministratorUpdateResourceAccessForm($this->getRequest(), "form", $data); - } - - protected function hydrateModuleUpdateForm($object) - { - $data = array( - 'id' => $object->getId(), - ); - - // Setup the object form - return new AdministratorUpdateModuleAccessForm($this->getRequest(), "form", $data); - } - protected function getObjectFromEvent($event) { return $event->hasAdministrator() ? $event->getAdministrator() : null; @@ -142,7 +122,6 @@ class AdministratorController extends AbstractCrudController protected function getExistingObject() { return AdminQuery::create() - ->joinWithI18n($this->getCurrentEditionLocale()) ->findOneById($this->getRequest()->get('administrator_id')); } From 3e4eff172f4a4272d68721c68cbe3cc194c296bc Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Mon, 20 Jan 2014 12:01:25 +0100 Subject: [PATCH 5/9] fix getExistingObject method for several controller. --- .../Thelia/Controller/Admin/AttributeAvController.php | 11 ++++++++--- .../Thelia/Controller/Admin/AttributeController.php | 11 ++++++++--- core/lib/Thelia/Controller/Admin/ConfigController.php | 9 +++++++-- .../lib/Thelia/Controller/Admin/CountryController.php | 11 +++++++---- .../Thelia/Controller/Admin/CurrencyController.php | 9 +++++++-- .../Thelia/Controller/Admin/FeatureAvController.php | 11 ++++++++--- .../lib/Thelia/Controller/Admin/FeatureController.php | 11 ++++++++--- .../lib/Thelia/Controller/Admin/MessageController.php | 11 ++++++++--- core/lib/Thelia/Controller/Admin/ModuleController.php | 11 ++++++++--- .../lib/Thelia/Controller/Admin/ProfileController.php | 11 ++++++++--- core/lib/Thelia/Controller/Admin/TaxController.php | 11 ++++++++--- .../lib/Thelia/Controller/Admin/TaxRuleController.php | 9 +++++++-- .../Thelia/Controller/Admin/TemplateController.php | 11 ++++++++--- templates/backOffice/default/configuration.html | 8 -------- 14 files changed, 100 insertions(+), 45 deletions(-) diff --git a/core/lib/Thelia/Controller/Admin/AttributeAvController.php b/core/lib/Thelia/Controller/Admin/AttributeAvController.php index 97b4cd5e6..4ddf439a2 100644 --- a/core/lib/Thelia/Controller/Admin/AttributeAvController.php +++ b/core/lib/Thelia/Controller/Admin/AttributeAvController.php @@ -137,9 +137,14 @@ class AttributeAvController extends AbstractCrudController protected function getExistingObject() { - return AttributeAvQuery::create() - ->joinWithI18n($this->getCurrentEditionLocale()) - ->findOneById($this->getRequest()->get('attributeav_id')); + $attributeAv = AttributeAvQuery::create() + ->findOneById($this->getRequest()->get('attributeav_id', 0)); + + if (null !== $attributeAv) { + $attribute->setLocale($this->getCurrentEditionLocale()); + } + + return $attributeAv; } protected function getObjectLabel($object) diff --git a/core/lib/Thelia/Controller/Admin/AttributeController.php b/core/lib/Thelia/Controller/Admin/AttributeController.php index b058f060d..52b70f0a2 100644 --- a/core/lib/Thelia/Controller/Admin/AttributeController.php +++ b/core/lib/Thelia/Controller/Admin/AttributeController.php @@ -167,9 +167,14 @@ class AttributeController extends AbstractCrudController protected function getExistingObject() { - return AttributeQuery::create() - ->joinWithI18n($this->getCurrentEditionLocale()) - ->findOneById($this->getRequest()->get('attribute_id')); + $attribute = AttributeQuery::create() + ->findOneById($this->getRequest()->get('attribute_id', 0)); + + if (null !== $attribute) { + $attribute->setLocale($this->getCurrentEditionLocale()); + } + + return $attribute; } protected function getObjectLabel($object) diff --git a/core/lib/Thelia/Controller/Admin/ConfigController.php b/core/lib/Thelia/Controller/Admin/ConfigController.php index fe18720b6..8e4e0d43c 100644 --- a/core/lib/Thelia/Controller/Admin/ConfigController.php +++ b/core/lib/Thelia/Controller/Admin/ConfigController.php @@ -140,9 +140,14 @@ class ConfigController extends AbstractCrudController protected function getExistingObject() { - return ConfigQuery::create() - ->joinWithI18n($this->getCurrentEditionLocale()) + $config = ConfigQuery::create() ->findOneById($this->getRequest()->get('variable_id')); + + if (null !== $config) { + $config->setLocale($this->getCurrentEditionLocale()); + } + + return $config; } protected function getObjectLabel($object) diff --git a/core/lib/Thelia/Controller/Admin/CountryController.php b/core/lib/Thelia/Controller/Admin/CountryController.php index d950cc487..43959b909 100644 --- a/core/lib/Thelia/Controller/Admin/CountryController.php +++ b/core/lib/Thelia/Controller/Admin/CountryController.php @@ -120,8 +120,6 @@ class CountryController extends AbstractCrudController $event ->setLocale($formData['locale']) ->setTitle($formData['title']) - ->setChapo($formData['chapo']) - ->setDescription($formData['description']) ->setIsocode($formData['isocode']) ->setIsoAlpha2($formData['isoalpha2']) ->setIsoAlpha3($formData['isoalpha3']) @@ -164,9 +162,14 @@ class CountryController extends AbstractCrudController */ protected function getExistingObject() { - return CountryQuery::create() - ->joinWithI18n($this->getCurrentEditionLocale()) + $country = CountryQuery::create() ->findPk($this->getRequest()->get('country_id', 0)); + + if (null !== $country) { + $country->setLocale($this->getCurrentEditionLocale()); + } + + return $country; } /** diff --git a/core/lib/Thelia/Controller/Admin/CurrencyController.php b/core/lib/Thelia/Controller/Admin/CurrencyController.php index be780a13b..a9212c0d4 100644 --- a/core/lib/Thelia/Controller/Admin/CurrencyController.php +++ b/core/lib/Thelia/Controller/Admin/CurrencyController.php @@ -141,9 +141,14 @@ class CurrencyController extends AbstractCrudController protected function getExistingObject() { - return CurrencyQuery::create() - ->joinWithI18n($this->getCurrentEditionLocale()) + $currency = CurrencyQuery::create() ->findOneById($this->getRequest()->get('currency_id')); + + if (null !== $currency) { + $currency->setLocale($this->getCurrentEditionLocale()); + } + + return $currency; } protected function getObjectLabel($object) diff --git a/core/lib/Thelia/Controller/Admin/FeatureAvController.php b/core/lib/Thelia/Controller/Admin/FeatureAvController.php index f1ac84f7b..9eea87b32 100644 --- a/core/lib/Thelia/Controller/Admin/FeatureAvController.php +++ b/core/lib/Thelia/Controller/Admin/FeatureAvController.php @@ -137,9 +137,14 @@ class FeatureAvController extends AbstractCrudController protected function getExistingObject() { - return FeatureAvQuery::create() - ->joinWithI18n($this->getCurrentEditionLocale()) - ->findOneById($this->getRequest()->get('featureav_id')); + $featureAv = FeatureAvQuery::create() + ->findOneById($this->getRequest()->get('featureav_id', 0)); + + if (null !== $featureAv) { + $featureAv->setLocale($this->getCurrentEditionLocale()); + } + + return $featureAv; } protected function getObjectLabel($object) diff --git a/core/lib/Thelia/Controller/Admin/FeatureController.php b/core/lib/Thelia/Controller/Admin/FeatureController.php index 5ae0aae7d..4cbbd8527 100644 --- a/core/lib/Thelia/Controller/Admin/FeatureController.php +++ b/core/lib/Thelia/Controller/Admin/FeatureController.php @@ -167,9 +167,14 @@ class FeatureController extends AbstractCrudController protected function getExistingObject() { - return FeatureQuery::create() - ->joinWithI18n($this->getCurrentEditionLocale()) - ->findOneById($this->getRequest()->get('feature_id')); + $feature = FeatureQuery::create() + ->findOneById($this->getRequest()->get('feature_id', 0)); + + if (null !== $feature) { + $feature->setLocale($this->getCurrentEditionLocale()); + } + + return $feature; } protected function getObjectLabel($object) diff --git a/core/lib/Thelia/Controller/Admin/MessageController.php b/core/lib/Thelia/Controller/Admin/MessageController.php index aebf29d04..e6b50c96d 100644 --- a/core/lib/Thelia/Controller/Admin/MessageController.php +++ b/core/lib/Thelia/Controller/Admin/MessageController.php @@ -143,9 +143,14 @@ class MessageController extends AbstractCrudController protected function getExistingObject() { - return MessageQuery::create() - ->joinWithI18n($this->getCurrentEditionLocale()) - ->findOneById($this->getRequest()->get('message_id')); + $message = MessageQuery::create() + ->findOneById($this->getRequest()->get('message_id', 0)); + + if (null !== $message) { + $message->setLocale($this->getCurrentEditionLocale()); + } + + return $message; } protected function getObjectLabel($object) diff --git a/core/lib/Thelia/Controller/Admin/ModuleController.php b/core/lib/Thelia/Controller/Admin/ModuleController.php index 4c7b6dbb2..e86014809 100644 --- a/core/lib/Thelia/Controller/Admin/ModuleController.php +++ b/core/lib/Thelia/Controller/Admin/ModuleController.php @@ -144,9 +144,14 @@ class ModuleController extends AbstractCrudController protected function getExistingObject() { - return ModuleQuery::create() - ->joinWithI18n($this->getCurrentEditionLocale()) - ->findOneById($this->getRequest()->get('module_id')); + $module = ModuleQuery::create() + ->findOneById($this->getRequest()->get('module_id', 0)); + + if (null !== $module) { + $module->setLocale($this->getCurrentEditionLocale()); + } + + return $module; } protected function getObjectLabel($object) diff --git a/core/lib/Thelia/Controller/Admin/ProfileController.php b/core/lib/Thelia/Controller/Admin/ProfileController.php index 9b83c30b7..22794789f 100644 --- a/core/lib/Thelia/Controller/Admin/ProfileController.php +++ b/core/lib/Thelia/Controller/Admin/ProfileController.php @@ -145,9 +145,14 @@ class ProfileController extends AbstractCrudController protected function getExistingObject() { - return ProfileQuery::create() - ->joinWithI18n($this->getCurrentEditionLocale()) - ->findOneById($this->getRequest()->get('profile_id')); + $profile = ProfileQuery::create() + ->findOneById($this->getRequest()->get('profile_id', 0)); + + if (null !== $profile) { + $profile->setLocale($this->getCurrentEditionLocale()); + } + + return $profile; } protected function getObjectLabel($object) diff --git a/core/lib/Thelia/Controller/Admin/TaxController.php b/core/lib/Thelia/Controller/Admin/TaxController.php index 96b6a4d5b..f5c20a1bd 100644 --- a/core/lib/Thelia/Controller/Admin/TaxController.php +++ b/core/lib/Thelia/Controller/Admin/TaxController.php @@ -121,9 +121,14 @@ class TaxController extends AbstractCrudController protected function getExistingObject() { - return TaxQuery::create() - ->joinWithI18n($this->getCurrentEditionLocale()) - ->findOneById($this->getRequest()->get('tax_id')); + $tax = TaxQuery::create() + ->findOneById($this->getRequest()->get('tax_id', 0)); + + if (null !== $tax) { + $tax->setLocale($this->getCurrentEditionLocale()); + } + + return $tax; } protected function getObjectLabel($object) diff --git a/core/lib/Thelia/Controller/Admin/TaxRuleController.php b/core/lib/Thelia/Controller/Admin/TaxRuleController.php index b85123505..0f64c3ccb 100644 --- a/core/lib/Thelia/Controller/Admin/TaxRuleController.php +++ b/core/lib/Thelia/Controller/Admin/TaxRuleController.php @@ -140,9 +140,14 @@ class TaxRuleController extends AbstractCrudController protected function getExistingObject() { - return TaxRuleQuery::create() - ->joinWithI18n($this->getCurrentEditionLocale()) + $taxRule = TaxRuleQuery::create() ->findOneById($this->getRequest()->get('tax_rule_id')); + + if (null !== $taxRule) { + $taxRule->setLocale($this->getCurrentEditionLocale()); + } + + return $taxRule; } protected function getObjectLabel($object) diff --git a/core/lib/Thelia/Controller/Admin/TemplateController.php b/core/lib/Thelia/Controller/Admin/TemplateController.php index 5e551679d..bd2d9bf9c 100644 --- a/core/lib/Thelia/Controller/Admin/TemplateController.php +++ b/core/lib/Thelia/Controller/Admin/TemplateController.php @@ -129,9 +129,14 @@ class TemplateController extends AbstractCrudController protected function getExistingObject() { - return TemplateQuery::create() - ->joinWithI18n($this->getCurrentEditionLocale()) - ->findOneById($this->getRequest()->get('template_id')); + $template = TemplateQuery::create() + ->findOneById($this->getRequest()->get('template_id', 0)); + + if (null !== $template) { + $template->setLocale($this->getCurrentEditionLocale()); + } + + return $template; } protected function getObjectLabel($object) diff --git a/templates/backOffice/default/configuration.html b/templates/backOffice/default/configuration.html index 12ee85cda..1560cd332 100755 --- a/templates/backOffice/default/configuration.html +++ b/templates/backOffice/default/configuration.html @@ -178,14 +178,6 @@ {/loop} - - {loop type="auth" name="pcc9" role="ADMIN" resource="admin.configuration.update" access="VIEW"} - - {intl l='Update your Thelia'} - - - {/loop} - {module_include location='system_configuration_bottom'}
From 83dd51411447265268e190915c75c6e5082b62a3 Mon Sep 17 00:00:00 2001 From: Emmanuel Nurit Date: Mon, 20 Jan 2014 12:07:58 +0100 Subject: [PATCH 6/9] [front office] default template unescape tile --- templates/frontOffice/default/layout.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/frontOffice/default/layout.tpl b/templates/frontOffice/default/layout.tpl index 6ea39f9cd..5aa76525c 100755 --- a/templates/frontOffice/default/layout.tpl +++ b/templates/frontOffice/default/layout.tpl @@ -36,7 +36,7 @@ GNU General Public License : http://www.gnu.org/licenses/ {* Page Title *} - {block name="page-title"}{strip}{if $page_title}{$page_title}{elseif $breadcrumbs}{foreach from=$breadcrumbs|array_reverse item=breadcrumb}{$breadcrumb.title} - {/foreach}{$store_name}{/if}{/strip}{/block} + {block name="page-title"}{strip}{if $page_title}{$page_title}{elseif $breadcrumbs}{foreach from=$breadcrumbs|array_reverse item=breadcrumb}{$breadcrumb.title|unescape} - {/foreach}{$store_name}{/if}{/strip}{/block} {* Meta Tags *} From 93e5c42b53a2b4cec39ea6737a3996efb4606d32 Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Mon, 20 Jan 2014 12:17:55 +0100 Subject: [PATCH 7/9] complete changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cf3a4d8ba..9d5355019 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ #2.0.0-beta4 - Tinymce is now a dedicated module. You need to activate it. - Fix PDF creation. Bug #180 +- Fix many translation issues. #2.0.0-beta3 - Coupon effect inputs are now more customisable (input text, select, ajax, etc.. are usable) and unlimited amount of input for coupon effect are now possible too From 2218b79e8d7e8e8b839fff29988fcc5b99d265ac Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Mon, 20 Jan 2014 14:04:52 +0100 Subject: [PATCH 8/9] company field is not required --- core/lib/Thelia/Form/CustomerUpdateForm.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/lib/Thelia/Form/CustomerUpdateForm.php b/core/lib/Thelia/Form/CustomerUpdateForm.php index 7442309be..9c83fc354 100755 --- a/core/lib/Thelia/Form/CustomerUpdateForm.php +++ b/core/lib/Thelia/Form/CustomerUpdateForm.php @@ -62,7 +62,8 @@ class CustomerUpdateForm extends BaseForm "label" => Translator::getInstance()->trans("Company"), "label_attr" => array( "for" => "company" - ) + ), + "required" => false )) ->add("firstname", "text", array( "constraints" => array( From 2bd23777caee70f5b288e91308e4fcfc0a00cb62 Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Mon, 20 Jan 2014 14:52:44 +0100 Subject: [PATCH 9/9] "save and close" button had now effect. Fix #185 --- core/lib/Thelia/Controller/Admin/ConfigStoreController.php | 7 ++++++- templates/backOffice/default/config-store.html | 3 +++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/core/lib/Thelia/Controller/Admin/ConfigStoreController.php b/core/lib/Thelia/Controller/Admin/ConfigStoreController.php index 95d425edb..ff339ded9 100644 --- a/core/lib/Thelia/Controller/Admin/ConfigStoreController.php +++ b/core/lib/Thelia/Controller/Admin/ConfigStoreController.php @@ -85,7 +85,12 @@ class ConfigStoreController extends BaseAdminController $this->adminLogAppend(AdminResources::STORE, AccessManager::UPDATE, "Store configuration changed"); - $this->redirectToRoute('admin.configuration.store.default'); + if ($this->getRequest()->get('save_mode') == 'stay') { + $this->redirectToRoute('admin.configuration.store.default'); + } + + // Redirect to the success URL + $this->redirect($configStoreForm->getSuccessUrl()); } catch (\Exception $ex) { $error_msg = $ex->getMessage(); diff --git a/templates/backOffice/default/config-store.html b/templates/backOffice/default/config-store.html index c9522a562..f6f300ddb 100755 --- a/templates/backOffice/default/config-store.html +++ b/templates/backOffice/default/config-store.html @@ -32,6 +32,9 @@ {form_hidden_fields form=$form} + {form_field form=$form field='success_url'} + + {/form_field} {include file = "includes/inner-form-toolbar.html" hide_flags = true