Rimozione id_module da zz_imports

This commit is contained in:
MatteoPistorello 2023-05-30 16:48:38 +02:00
parent 9173fc0d2c
commit b9390fed09
2 changed files with 9 additions and 4 deletions

View File

@ -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

View File

@ -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');
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`;