Ejemplo n.º 1
0
 /**
  * deleteAction
  * Delete a record previously selected by the customer
  * @return unknown_type
  */
 public function deleteAction()
 {
     $id = $this->getRequest()->getParam('id');
     $controller = Zend_Controller_Front::getInstance()->getRequest()->getControllerName();
     $template = EmailsTemplates::find($id, null, false);
     if (is_object($template)) {
         if (isset($template->code) && !empty($template->code)) {
             $this->_helper->redirector('list', $controller, 'admin', array('mex' => $this->translator->translate('You cannot delete system templates'), 'status' => 'danger'));
             die;
         }
         $template->delete();
     }
     $this->_helper->redirector('list', $controller, 'admin', array('mex' => $this->translator->translate('Template deleted successfully'), 'status' => 'success'));
 }