Пример #1
0
 public function selectaccountAction()
 {
     if ($this->getUserFunctions()->isUserLogued()) {
         if ($this->userCanHandleAccounts()) {
             $form = new SelectAccountForm();
             $form->get('TIPO')->setValueOptions($this->getSelectOptions());
         } else {
             return $this->redirect()->toRoute('user', array('action' => 'add'));
         }
     } else {
         // no hay usuario logueado. Mostrar seleccion de cuenta (CLIENTE o DUENO)
         $form = new SelectAccountForm();
         $form->get('TIPO')->setValueOptions($this->getSelectOptions(true));
     }
     $form->get('submit')->setValue('Siguiente');
     return array('form' => $form);
     //        if ($this->getUserFunctions()->isUserLogued() && $this->userCanHandleAccounts()){
     //            $form = new SelectAccountForm();
     //            $form->get('TIPO')->setValueOptions($this->getSelectOptions());
     //            $form->get('submit')->setValue('Siguiente');
     //            return array('form' => $form);
     //        } else {
     //             return $this->redirect()->toRoute('user', array('action' => 'add'));
     //        }
 }
Пример #2
0
 public function selectaccountAction()
 {
     if (!$this->userCanHandleAccounts()) {
         // El usuario no puede elegir entre dar de alta a distintos tipos de usuario
         return $this->redirect()->toRoute('user', array('action' => 'add'));
     } else {
         $form = new SelectAccountForm();
         $form->get('TIPO')->setValueOptions($this->getSelectOptions());
         $form->get('submit')->setValue('Siguiente');
         return array('form' => $form);
     }
 }