Fix bugs and add Product prices export

modifié:         core/lib/Thelia/Config/Resources/export.xml
	modifié:         core/lib/Thelia/Controller/Admin/ImportController.php
	modifié:         core/lib/Thelia/Core/DependencyInjection/Loader/XmlFileLoader.php
	modifié:         core/lib/Thelia/Core/DependencyInjection/Loader/schema/dic/config/thelia-1.0.xsd
	nouveau fichier: core/lib/Thelia/ImportExport/Export/Type/ProductPricesExport.php
	modifié:         core/lib/Thelia/Tests/Controller/ImportControllerTest.php
This commit is contained in:
Benjamin Perche
2014-07-21 14:43:51 +02:00
parent 5e00367757
commit 0e3ae84cb8
6 changed files with 126 additions and 44 deletions

View File

@@ -365,12 +365,7 @@ class XmlFileLoader extends FileLoader
if (!class_exists($class)) {
throw new \ErrorException(
Translator::getInstance()->trans(
"The class \"%class\" doesn't exist",
[
"%class" => $class
]
)
"The class \"$class\" doesn't exist"
);
}
@@ -378,13 +373,7 @@ class XmlFileLoader extends FileLoader
if (!$classInstance instanceof ExportHandler) {
throw new \ErrorException(
Translator::getInstance()->trans(
"The class \"%class\" must extend %baseClass",
[
"%class" => $class,
"%baseClass" => "Thelia\\ImportExport\\Export\\ExportHandler",
]
)
"The class \"$class\" must extend Thelia\\ImportExport\\Export\\ExportHandler"
);
}
@@ -392,12 +381,7 @@ class XmlFileLoader extends FileLoader
if (null === $category) {
throw new \ErrorException(
Translator::getInstance()->trans(
"The export category \"%category\" doesn't exist",
[
"%category" => $categoryRef
]
)
"The export category \"$categoryRef\" doesn't exist"
);
}
@@ -518,12 +502,7 @@ class XmlFileLoader extends FileLoader
if (!class_exists($class)) {
throw new \ErrorException(
Translator::getInstance()->trans(
"The class \"%class\" doesn't exist",
[
"%class" => $class
]
)
"The class \"$class\" doesn't exist"
);
}
@@ -531,13 +510,7 @@ class XmlFileLoader extends FileLoader
if (!$classInstance instanceof ImportHandler) {
throw new \ErrorException(
Translator::getInstance()->trans(
"The class \"%class\" must extend %baseClass",
[
"%class" => $class,
"%baseClass" => "Thelia\\ImportImport\\ImportHandler",
]
)
"The class \"$class\" must extend Thelia\\ImportImport\\ImportHandler"
);
}
@@ -545,12 +518,7 @@ class XmlFileLoader extends FileLoader
if (null === $category) {
throw new \ErrorException(
Translator::getInstance()->trans(
"The import category \"%category\" doesn't exist",
[
"%category" => $categoryRef
]
)
"The import category \"$categoryRef\" doesn't exist"
);
}

View File

@@ -227,7 +227,7 @@
<xsd:element name="title" type="export_category_title" />
</xsd:choice>
<xsd:attribute name="id" type="xsd:string" />
<xsd:attribute name="id" use="required" type="xsd:string" />
</xsd:complexType>
<xsd:complexType name="export_category_title">
@@ -274,7 +274,7 @@
<xsd:element name="title" type="import_category_title" />
</xsd:choice>
<xsd:attribute name="id" type="xsd:string" />
<xsd:attribute name="id" use="required" type="xsd:string" />
</xsd:complexType>
<xsd:complexType name="import_category_title">