Finish export forms
modifié: core/lib/Thelia/Config/Resources/config.xml modifié: core/lib/Thelia/Config/Resources/form.xml modifié: core/lib/Thelia/Controller/Admin/ExportController.php modifié: core/lib/Thelia/Controller/Admin/ImportExportController.php modifié: core/lib/Thelia/Core/Template/Loop/Formatter.php modifié: core/lib/Thelia/Core/Template/Loop/ImportExportType.php modifié: core/lib/Thelia/Form/ExportForm.php modifié: core/lib/Thelia/ImportExport/Both/NewsletterImportExport.php modifié: core/lib/Thelia/ImportExport/Export/MailingExport.php renommé: core/lib/Thelia/ImportExport/ExportHandlerInterface.php -> core/lib/Thelia/ImportExport/ExportHandler.php modifié: core/lib/Thelia/Model/Export.php modifié: core/lib/Thelia/Model/Import.php nouveau fichier: core/lib/Thelia/Tests/ImportExport/Export/MailingExportTest.php nouveau fichier: templates/backOffice/default/ajax/export-modal.html modifié: templates/backOffice/default/export-page.html modifié: templates/backOffice/default/export.html
This commit is contained in:
@@ -108,11 +108,11 @@ class ExportController extends BaseAdminController
|
||||
protected function setOrders($category = null, $export = null)
|
||||
{
|
||||
if ($category === null) {
|
||||
$category = $this->getRequest()->query->get("category_order");
|
||||
$category = $this->getRequest()->query->get("category_order", "manual");
|
||||
}
|
||||
|
||||
if ($export === null) {
|
||||
$export = $this->getRequest()->query->get("export_order");
|
||||
$export = $this->getRequest()->query->get("export_order", "manual");
|
||||
}
|
||||
|
||||
$this->getParserContext()
|
||||
|
||||
@@ -11,7 +11,9 @@
|
||||
/*************************************************************************************/
|
||||
|
||||
namespace Thelia\Controller\Admin;
|
||||
use Thelia\Core\HttpFoundation\Response;
|
||||
use Thelia\Core\Template\Element\LoopResult;
|
||||
use Thelia\Core\Template\Loop\Export as ExportLoop;
|
||||
use Thelia\Core\Template\Loop\Import as ImportLoop;
|
||||
use Thelia\Model\ExportQuery;
|
||||
|
||||
/**
|
||||
@@ -37,7 +39,37 @@ class ImportExportController extends BaseAdminController
|
||||
return $this->render("404");
|
||||
}
|
||||
|
||||
return $this->render("import-page");
|
||||
/**
|
||||
* Use the loop to inject the same vars in Smarty
|
||||
*/
|
||||
$loop = new ImportLoop($this->container);
|
||||
|
||||
$loop->initializeArgs([
|
||||
"export" => $export->getId()
|
||||
]);
|
||||
|
||||
$query = $loop->buildModelCriteria();
|
||||
$result= $query->find();
|
||||
|
||||
$results = $loop->parseResults(
|
||||
new LoopResult($result)
|
||||
);
|
||||
|
||||
$parserContext = $this->getParserContext();
|
||||
|
||||
/** @var \Thelia\Core\Template\Element\LoopResultRow $row */
|
||||
foreach ($results as $row) {
|
||||
foreach ($row->getVarVal() as $name=>$value) {
|
||||
$parserContext->set($name, $value);
|
||||
}
|
||||
}
|
||||
|
||||
/** Then render the form */
|
||||
if ($this->getRequest()->isXmlHttpRequest()) {
|
||||
return $this->render("ajax/import-modal");
|
||||
} else {
|
||||
return $this->render("import-page");
|
||||
}
|
||||
}
|
||||
|
||||
public function exportView($id)
|
||||
@@ -46,12 +78,37 @@ class ImportExportController extends BaseAdminController
|
||||
return $this->render("404");
|
||||
}
|
||||
|
||||
$this->getParserContext()
|
||||
->set("ID", $export->getId())
|
||||
->set("TITLE", $export->getTitle())
|
||||
;
|
||||
/**
|
||||
* Use the loop to inject the same vars in Smarty
|
||||
*/
|
||||
$loop = new ExportLoop($this->container);
|
||||
|
||||
return $this->render("export-page");
|
||||
$loop->initializeArgs([
|
||||
"export" => $export->getId()
|
||||
]);
|
||||
|
||||
$query = $loop->buildModelCriteria();
|
||||
$result= $query->find();
|
||||
|
||||
$results = $loop->parseResults(
|
||||
new LoopResult($result)
|
||||
);
|
||||
|
||||
$parserContext = $this->getParserContext();
|
||||
|
||||
/** @var \Thelia\Core\Template\Element\LoopResultRow $row */
|
||||
foreach ($results as $row) {
|
||||
foreach ($row->getVarVal() as $name=>$value) {
|
||||
$parserContext->set($name, $value);
|
||||
}
|
||||
}
|
||||
|
||||
/** Then render the form */
|
||||
if ($this->getRequest()->isXmlHttpRequest()) {
|
||||
return $this->render("ajax/export-modal");
|
||||
} else {
|
||||
return $this->render("export-page");
|
||||
}
|
||||
}
|
||||
|
||||
protected function getExport($id)
|
||||
|
||||
Reference in New Issue
Block a user