Exemplo n.º 1
0
 public function deletedenomrulerAction()
 {
     $denoms = new DenomRulers();
     $where = $denoms->getAdapter()->quoteInto('id = ?', (int) $this->_getParam('id'));
     $denoms->delete($where);
 }
 /** Link a ruler to a denomination
  * @access public
  * @return void
  *
  */
 public function rulertodenominationAction()
 {
     $form = new AddDenomToRulerForm();
     $rulerid = $this->getParam('rulerid');
     $period = $this->getParam('period');
     $denoms = new Denominations();
     $denomsList = $denoms->getDenomsAdd($period);
     $form->ruler_id->setValue($rulerid);
     $form->period_id->setValue($period);
     $form->denomination_id->addMultiOptions($denomsList);
     $this->view->form = $form;
     if ($this->_request->isPost()) {
         if ($form->isValid($this->_request->getPost())) {
             $denoms = new DenomRulers();
             $denoms->add($form->getValues());
             $this->getFlash()->addMessage('A new denomination has been added.');
             if ($period == 21) {
                 $this->redirect($this->redirectUrl . 'romanruler/id/' . $rulerid);
             } else {
                 $this->redirect($this->redirectUrl . 'medruler/id/' . $rulerid);
             }
         } else {
             $this->getFlash()->addMessage($this->_formErrors);
             $form->populate($this->_request->getPost());
         }
     }
 }