diff --git a/src/API/Common/Stampa.php b/src/API/Common/Stampa.php new file mode 100644 index 000000000..ad260ca5f --- /dev/null +++ b/src/API/Common/Stampa.php @@ -0,0 +1,30 @@ +first(); + if (!empty($print)) { + $directory = DOCROOT.'/files/api'; + $data = Prints::render($print->id, $request['id_record'], $directory); + + download($data['path']); + delete($data['path']); + } + + return [ + 'custom' => '', + ]; + } +} diff --git a/update/2_4_11.sql b/update/2_4_11.sql index e6bee20cf..11fc70f04 100644 --- a/update/2_4_11.sql +++ b/update/2_4_11.sql @@ -148,7 +148,8 @@ INSERT INTO `zz_api_resources` (`id`, `version`, `type`, `resource`, `class`, `e (NULL, 'v1', 'create', 'sessione', 'Modules\\Interventi\\API\\v1\\Sessioni', '1'), (NULL, 'v1', 'delete', 'sessioni_intervento', 'Modules\\Interventi\\API\\v1\\Sessioni', '1'), (NULL, 'v1', 'retrieve', 'articoli_intervento', 'Modules\\Interventi\\API\\v1\\Articoli', '1'), -(NULL, 'v1', 'create', 'articolo_intervento', 'Modules\\Interventi\\API\\v1\\Articoli', '1'); +(NULL, 'v1', 'create', 'articolo_intervento', 'Modules\\Interventi\\API\\v1\\Articoli', '1'), +(NULL, 'v1', 'retrieve', 'stampa', 'Api\\Common\\Stampa', '1'); -- Supporto alla personalizzazione dell'API remota OSMCloud INSERT INTO `zz_settings` (`id`, `nome`, `valore`, `tipo`, `editable`, `sezione`, `order`) VALUES