Example #1
0
 public function executeCreate(sfWebRequest $request)
 {
     if ($this->getRequest()->hasParameter('compra[is4]') and $this->getRequest()->getParameter('compra[is4]') == 'producto') {
         $this->form = $this->configuration->get4ProductoForm();
     } else {
         if ($this->getRequest()->getParameter('compra[is4]') == 'nota_pedido') {
             $compra = new Compra();
             $nota_de_pedido = NotaPedidoPeer::retrieveByPK($this->getRequest()->getParameter('compra[nota_pedido_id]'));
             $compra->setProveedorId($nota_de_pedido->getProveedorId());
             $compra->setFecha($nota_de_pedido->getFecha());
             $compra->setFechaEntrega($nota_de_pedido->getFechaPlazoEntrega());
             $this->form = new Compra4NotaPedidoForm($compra);
         } else {
             $this->form = $this->configuration->getForm();
         }
     }
     $this->compra = $this->form->getObject();
     $this->processForm($request, $this->form);
     if ($this->getRequest()->isXmlHttpRequest()) {
         $this->setTemplate('newWinContent');
     }
 }