Commits

rne...@debserverp4.com.ar  committed 3f7e1c5

add message to prospect page if no unit models

  • Participants
  • Parent commits 56b383b

Comments (0)

Files changed (2)

File application/modules/prospects/controllers/AddController.php

 		$service->setDao($dao);
 		$daoForm = new Unit_Library_Impl_Dao();
 		$daoForm->setTemplate(new Unit_Model_DbTable_UnitModel());
-		$form = $service->getForm(array('name'=>'Prospects_Form_Add','set'=>true,'dao'=>$daoForm));
-		$this->view->form = $form;
-		if( $this->getRequest()->isPost() and $form->isValid($this->getRequest()->getParams() ) )
-		{
+		try{
+		    $form = $service->getForm(array('name'=>'Prospects_Form_Add','set'=>true,'dao'=>$daoForm));
+		    $this->view->form = $form;
+		    if( $this->getRequest()->isPost() and $form->isValid($this->getRequest()->getParams() ) )
+		    {
 			try {
 				if( $service->saveTransaction($this->getRequest()->getParams())==true )
 				{
 			} catch (Exception $e) {
 				$this->assignMessage($service->getMessageState());
 			}
+		    }
+		    $this->assignMessage($service->getMessageState());
 		}
-		$this->assignMessage($service->getMessageState());
+		catch (Exception $e) {				
+				$this->assignMessage(array('msg'=>'noUnitModels','type'=>'error'));
+		}
 	}
 }

File application/modules/prospects/forms/Add.php

 		if(count($list)==0)
 		{
 			throw new Exception('The system is not properly set up');
+			
 		}
 		else
 		{