diff --git a/install-new/dev/index.php b/install-new/dev/index.php index 625959498..830a2bc3e 100644 --- a/install-new/dev/index.php +++ b/install-new/dev/index.php @@ -29,21 +29,21 @@ class SynchronizeController extends InstallControllerHttp $this->loader->setLanguages($languages); if (Tools::getValue('submit')) - $this->synchronizeDatabase(); + $this->generateSchemas(); + else if (Tools::getValue('synchronize')) + $this->synchronizeEntities(); if ($this->type == 'demo') $this->loader->setFixturesPath(); + else + $this->loader->setDefaultPath(); $this->displayTemplate('index'); } - public function synchronizeDatabase() + public function generateSchemas() { if ($this->type == 'demo') - { - $this->loader->setDefaultPath(); - $this->loader->generateAllEntityFiles(); $this->loader->setFixturesPath(); - } $tables = isset($_POST['tables']) ? (array)$_POST['tables'] : array(); $columns = isset($_POST['columns']) ? (array)$_POST['columns'] : array(); @@ -52,6 +52,7 @@ class SynchronizeController extends InstallControllerHttp $primaries = isset($_POST['primary']) ? (array)$_POST['primary'] : array(); $classes = isset($_POST['class']) ? (array)$_POST['class'] : array(); $sqls = isset($_POST['sql']) ? (array)$_POST['sql'] : array(); + $orders = isset($_POST['order']) ? (array)$_POST['order'] : array(); $images = isset($_POST['image']) ? (array)$_POST['image'] : array(); $entities = array(); @@ -70,6 +71,9 @@ class SynchronizeController extends InstallControllerHttp if (isset($sqls[$table]) && $sqls[$table]) $config['sql'] = $sqls[$table]; + if (isset($orders[$table]) && $orders[$table]) + $config['ordersql'] = $orders[$table]; + if (isset($images[$table]) && $images[$table]) $config['image'] = $images[$table]; @@ -89,16 +93,30 @@ class SynchronizeController extends InstallControllerHttp 'fields' => $fields, ); } - $this->loader->generateEntityFiles($entities); - if ($this->type != 'demo') + foreach ($entities as $entity => $info) + $this->loader->generateEntitySchema($entity, $info['fields'], $info['config']); + + $this->errors = $this->loader->getErrors(); + } + + public function synchronizeEntities() + { + $entities = Tools::getValue('entities'); + if (isset($entities['common'])) + { + $this->loader->setDefaultPath(); + $this->loader->generateEntityFiles($entities['common']); + } + + if (isset($entities['fixture'])) { $this->loader->setFixturesPath(); - $this->loader->generateAllEntityFiles(); - $this->loader->setDefaultPath(); + $this->loader->generateEntityFiles($entities['fixture']); } $this->errors = $this->loader->getErrors(); + $this->loader->setDefaultPath(); } } diff --git a/install-new/dev/index.phtml b/install-new/dev/index.phtml index 82285bf3a..2f025d3be 100644 --- a/install-new/dev/index.phtml +++ b/install-new/dev/index.phtml @@ -1,6 +1,6 @@ - The Synchronizator + Outil de synchronisation de l'installeur @@ -8,33 +8,63 @@ @@ -46,72 +76,162 @@ -