diff --git a/VERSIONS_WIP/80976 b/VERSIONS_WIP/80976 index 68fa36c80c5586b1555e059ebe9968dd94ac7350..7e4f5109fd342d73d847ab8e60fe00bd99ec350f 100644 --- a/VERSIONS_WIP/80976 +++ b/VERSIONS_WIP/80976 @@ -1 +1 @@ - - ticket #80976 : gestion des integrations hotline niveau 1 \ No newline at end of file + - ticket #80976 : page notice : lorque connecté en tant qu'administrateur, l'outil "Inspector Gadget" permet de supprimer un exemplaire \ No newline at end of file diff --git a/application/modules/admin/controllers/RecordsController.php b/application/modules/admin/controllers/RecordsController.php index 7a9c35bb837f6869faf6ecac0f224c65f96a0464..5d88e62b5617854dbae2835ec458aaef1b36e5c6 100644 --- a/application/modules/admin/controllers/RecordsController.php +++ b/application/modules/admin/controllers/RecordsController.php @@ -110,14 +110,13 @@ class Admin_RecordsController extends ZendAfi_Controller_Action { public function deleteItemAction() { - if (!$item = Class_Exemplaire::find($this->_getParam('id'))) - $this->_helper->notify($this->_('Exemplaire non trouvé')); - - if ($item) { + if ($item = Class_Exemplaire::find($this->_getParam('id'))) $item->delete(); - $this->_helper->notify($this->_('Exemplaire "%s" supprimé', - $item->getCodeBarres())); - } + + $this->_helper->notify($item + ? $this->_('Exemplaire "%s" supprimé', + $item->getCodeBarres()) + : $this->_('Exemplaire non trouvé')); $this->_redirectToReferer(); }