Rimozione id_module da zz_imports
This commit is contained in:
parent
9173fc0d2c
commit
b9390fed09
|
@ -21,6 +21,8 @@ use Modules\Importazione\Import;
|
||||||
|
|
||||||
include_once __DIR__.'/../../core.php';
|
include_once __DIR__.'/../../core.php';
|
||||||
|
|
||||||
|
$modulo_import = Modules::get($id_module);
|
||||||
|
|
||||||
switch (filter('op')) {
|
switch (filter('op')) {
|
||||||
case 'add':
|
case 'add':
|
||||||
$id_import = filter('id_import');
|
$id_import = filter('id_import');
|
||||||
|
@ -29,7 +31,7 @@ switch (filter('op')) {
|
||||||
$id_record = $import->id;
|
$id_record = $import->id;
|
||||||
|
|
||||||
Uploads::upload($_FILES['file'], [
|
Uploads::upload($_FILES['file'], [
|
||||||
'id_module' => $import->getModule()->id,
|
'id_module' => $id_module,
|
||||||
'id_record' => $id_record,
|
'id_record' => $id_record,
|
||||||
]);
|
]);
|
||||||
break;
|
break;
|
||||||
|
@ -40,10 +42,9 @@ switch (filter('op')) {
|
||||||
$import = Import::find($id_import);
|
$import = Import::find($id_import);
|
||||||
$import_manager = $import->class;
|
$import_manager = $import->class;
|
||||||
|
|
||||||
$modulo_collegato = $import->moduloCollegato;
|
|
||||||
if (!empty($import_manager)) {
|
if (!empty($import_manager)) {
|
||||||
// Generazione percorso
|
// 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;
|
$filepath = base_dir().'/'.$file;
|
||||||
|
|
||||||
// Generazione del file
|
// Generazione del file
|
||||||
|
|
|
@ -56,3 +56,7 @@ INSERT INTO `zz_api_resources` (`id`, `version`, `type`, `resource`, `class`, `e
|
||||||
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', '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', '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`;
|
Loading…
Reference in New Issue