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 diff --git a/Readme.md b/Readme.md index abb8ccd30..07a36f389 100755 --- a/Readme.md +++ b/Readme.md @@ -3,7 +3,7 @@ Readme Thelia ------ -[](https://travis-ci.org/thelia/thelia) +[](https://travis-ci.org/thelia/thelia) [](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. 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", 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')); } 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/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/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/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( 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 @@