示例#1
0
 /**
  * @access 	public
  * @return 	void
  */
 public function finishBusinessPlanAction()
 {
     $form = new External_Form_FinishPlan();
     if ($this->getRequest()->isPost()) {
         if ($form->isValid($this->getRequest()->getPost())) {
             $this->_mapper->setData($form->getValues());
             $return = $this->_mapper->saveFinishPlan();
             $message = $this->_mapper->getMessage()->toArray();
             $result = array('status' => (bool) $return, 'id' => $return, 'description' => $message, 'data' => $form->getValues(), 'fields' => $this->_mapper->getFieldsError());
             $this->_helper->json($result);
         } else {
             $message = new App_Message();
             $message->addMessage($this->_config->messages->warning, App_Message::WARNING);
             $result = array('status' => false, 'description' => $message->toArray(), 'errors' => $form->getMessages());
             $this->_helper->json($result);
         }
     }
 }
 /**
  * @access 	public
  * @return 	void
  */
 public function saveCouncilDecisionAction()
 {
     $this->_helper->viewRenderer->setRender('form');
     $form = new Fefop_Form_CouncilDecision();
     if ($this->getRequest()->isPost()) {
         if ($form->isValid($this->getRequest()->getPost())) {
             $this->_mapper->setData($form->getValues());
             $return = $this->_mapper->saveCouncilDecision();
             $message = $this->_mapper->getMessage()->toArray();
             $result = array('status' => (bool) $return, 'id' => $return, 'description' => $message, 'data' => $form->getValues(), 'fields' => $this->_mapper->getFieldsError());
             $this->_helper->json($result);
         } else {
             $message = new App_Message();
             $message->addMessage($this->_config->messages->warning, App_Message::WARNING);
             $result = array('status' => false, 'description' => $message->toArray(), 'errors' => $form->getMessages());
             $this->_helper->json($result);
         }
     }
 }