throw new MethodNotAllowedException();
}
*/
+ if (!$id) {
+ throw new NotFoundException(__('Historique introuvable'));
+ }
+
+ // GETTING THE CHANGELOG OF THE APPLIANCE
+ $this->Changelog->id = $id;
+ $changelog = $this->Changelog->findById($id);
+ if (!$changelog) {
+ throw new NotFoundException(__('Historique introuvable'));
+ }
+
+ // GETTING ALL WARNINGS FROM THE CHANGELOG
+ if($this->Changelog->value('warnings')) {
+ $warnings_id = explode('|', $this->Changelog->value('warnings'));
+ App::import('Controller', 'Warnings');
+ $warningsController = new WarningsController;
+
+ // DELETING ALL WARNING FROM THIS CHANGELOG
+ foreach ($warnings_id as $warning_id) {
+ $warningsController->Warning->delete($warning_id);
+ }
+ }
+
+ // DELETING CHANGELOG
if ($this->Changelog->delete($id)) {
/*$this->Session->setFlash(
__("L'historique d'id: %s a été supprimé.", h($id))