Ejemplo n.º 1
0
 /** Delete a reference
  * @access public
  * @return void
  */
 public function deleteAction()
 {
     if ($this->getParam('id', false)) {
         if ($this->_request->isPost()) {
             $id = (int) $this->_request->getPost('id');
             $findID = (int) $this->_request->getPost('findID');
             $this->setController($this->_request->getPost('controller'));
             $this->setRedirect($this->getController());
             $del = $this->_request->getPost('del');
             if ($del == 'Yes' && $id > 0) {
                 $where = array();
                 $where[] = $this->_bibliography->getAdapter()->quoteInto('id = ?', $id);
                 $this->_bibliography->delete($where);
                 $this->getFlash()->addMessage('Reference deleted!');
                 $this->redirect($this->getRedirect() . 'record/id/' . $findID);
             }
         } else {
             $id = (int) $this->getParam('id');
             if ($id > 0) {
                 $this->view->id = $id;
                 $this->view->bib = $this->_bibliography->fetchFindBook($id, $this->getController());
             }
         }
     } else {
         throw new Pas_Exception_Param($this->_missingParameter, 500);
     }
 }
Ejemplo n.º 2
0
 /** Delete a reference
  */
 public function deleteAction()
 {
     if ($this->_getParam('id', false)) {
         if ($this->_request->isPost()) {
             $id = (int) $this->_request->getPost('id');
             $findID = (int) $this->_request->getPost('findID');
             $del = $this->_request->getPost('del');
             if ($del == 'Yes' && $id > 0) {
                 $bibs = new Bibliography();
                 $where = array();
                 $where = $bibs->getAdapter()->quoteInto('id = ?', $id);
                 $bibs->delete($where);
                 $this->_flashMessenger->addMessage('Reference deleted!');
                 $this->_redirect(self::REDIRECT . $findID);
             }
         } else {
             $id = (int) $this->_getParam('id');
             if ($id > 0) {
                 $this->view->id = $id;
                 $bibs = new Bibliography();
                 $this->view->bib = $bibs->fetchFindBook($id);
             }
         }
     } else {
         throw new Pas_Exception_Param($this->_missingParameter);
     }
 }