From 86eb77de30873141ff2466dcf9498405ce30e26a Mon Sep 17 00:00:00 2001 From: sviluppo-giacomo Date: Wed, 30 Apr 2025 08:47:17 +0200 Subject: [PATCH] Add delete action and enhance logging in LicenzeController Introduced a new deleteAction method in LicenzeController to handle deletion functionality. Updated the logging mechanism in inserimentoRecordDiLog to capture additional details, enhancing the audit trail for licensing changes. Removed the deprecated afterDeleteElement method. --- .../v1/controllers/LicenzeController.php | 24 +++++++++---------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/application/modules/v1/controllers/LicenzeController.php b/application/modules/v1/controllers/LicenzeController.php index ea89e49..edd58fc 100644 --- a/application/modules/v1/controllers/LicenzeController.php +++ b/application/modules/v1/controllers/LicenzeController.php @@ -9,6 +9,11 @@ class V1_LicenzeController extends App_Controller_Rest_Controller parent::init(); } + public function deleteAction() + { + $this->disableCallAction(); + } + //----------------------------------------------- public function switchMethodFunction($method) @@ -33,21 +38,14 @@ class V1_LicenzeController extends App_Controller_Rest_Controller return $data; } - public function afterDeleteElement($id): void - { - $record = $this->_genericModel->getRecordById($this->_resourceName, $id); - $this->inserimentoRecordDiLog($record, 'Eliminazione'); - } - private function inserimentoRecordDiLog($data, $op) { - /*$this->_genericModel->insert('LogLicenze', [ - 'Operazione' => $op, - 'Data' => date('Y-m-d H:i:s'), - 'Utente' => $this->_authInfo->getIdentity(), - 'Descrizione' => '', - 'IdElemento' => '' - ]);*/ + $this->_genericModel->insert('LogLicenze', [ + 'Descrizione' => $op, + 'IdentificativoPC' => $data['IdentificativoPC'], + 'PartitaIva' => $data['PartitaIva'], + 'CodiceFiscale' => $data['CodiceFiscale'] + ]); } }//END CLASS