diff --git a/modules/import/actions.php b/modules/import/actions.php index 3735895c6..0eb6cfc9e 100755 --- a/modules/import/actions.php +++ b/modules/import/actions.php @@ -21,6 +21,8 @@ use Modules\Importazione\Import; include_once __DIR__.'/../../core.php'; +$modulo_import = Modules::get($id_module); + switch (filter('op')) { case 'add': $id_import = filter('id_import'); @@ -29,7 +31,7 @@ switch (filter('op')) { $id_record = $import->id; Uploads::upload($_FILES['file'], [ - 'id_module' => $import->getModule()->id, + 'id_module' => $id_module, 'id_record' => $id_record, ]); break; @@ -40,10 +42,9 @@ switch (filter('op')) { $import = Import::find($id_import); $import_manager = $import->class; - $modulo_collegato = $import->moduloCollegato; if (!empty($import_manager)) { // Generazione percorso - $file = $modulo_collegato->upload_directory.'/example-'.strtolower($modulo_collegato->title).'.csv'; + $file = $modulo_import->upload_directory.'/example-'.strtolower($import->name).'.csv'; $filepath = base_dir().'/'.$file; // Generazione del file diff --git a/update/2_4_46.sql b/update/2_4_46.sql index d7071190e..50669a31a 100644 --- a/update/2_4_46.sql +++ b/update/2_4_46.sql @@ -55,4 +55,8 @@ INSERT INTO `zz_prints` (`id`, `id_module`, `is_record`, `name`, `title`, `filen INSERT INTO `zz_api_resources` (`id`, `version`, `type`, `resource`, `class`, `enabled`) VALUES (NULL, 'app-v1', 'retrieve', 'checklist', 'API\\App\\v1\\Checklists', '1'); INSERT INTO `zz_api_resources` (`id`, `version`, `type`, `resource`, `class`, `enabled`) VALUES (NULL, 'app-v1', 'retrieve', 'checklists', 'API\\App\\v1\\Checklists', '1'); INSERT INTO `zz_api_resources` (`id`, `version`, `type`, `resource`, `class`, `enabled`) VALUES (NULL, 'app-v1', 'update', 'checklist', 'API\\App\\v1\\Checklists', '1'); -INSERT INTO `zz_api_resources` (`id`, `version`, `type`, `resource`, `class`, `enabled`) VALUES (NULL, 'app-v1', 'retrieve', 'checklists-cleanup', 'API\\App\\v1\\Checklists', '1'); \ No newline at end of file +INSERT INTO `zz_api_resources` (`id`, `version`, `type`, `resource`, `class`, `enabled`) VALUES (NULL, 'app-v1', 'retrieve', 'checklists-cleanup', 'API\\App\\v1\\Checklists', '1'); + +-- Rimozione id_module in zz_imports +ALTER TABLE `zz_imports` DROP FOREIGN KEY `zz_imports_ibfk_1`; +ALTER TABLE `zz_imports` DROP `id_module`; \ No newline at end of file