- <?php
- /**
- * perfil actions.
- *
- * @package Proyecto
- * @subpackage perfil
- * @author Your name here
- * @version SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
- */
- class perfilActions extends sfActions
- {
- /**
- * Executes index action
- *
- * @param sfRequest $request A request object
- */
- public function executePrincipal(sfWebRequest $request)
- {
- $this->id=$this->getUser()->getAttribute('id');
- $this->nombre=$this->getUser()->getAttribute('nombre');
- $this->apellido=$this->getUser()->getAttribute('apellido');
- $q=Doctrine_Core::getTable('Curriculum')
- ->createQuery('c')
- ->where('c.pasante_id = ?', $this->id);
- $curriculum = $q->execute();
- if (count($curriculum)>0){
- $this->curriculum=true;
- }else{
- $this->curriculum=false;
- }
- }
- public function executeBuscarempresa(sfWebRequest $request)
- {
- $this->id=$this->getUser()->getAttribute('id');
- $this->autenticado=$this->getUser()->isAuthenticated();
- $this->nombre=$this->getUser()->getAttribute('nombre');
- $this->apellido=$this->getUser()->getAttribute('apellido');
- $q=Doctrine_Core::getTable('Curriculum')
- ->createQuery('c')
- ->where('c.pasante_id = ?', $this->id);
- $curriculum = $q->execute();
- if (count($curriculum)>0){
- $this->curriculum=true;
- }else{
- $this->curriculum=false;
- }
- $this->form = new BuscarEmpresaForm();
- }
- public function executeCreate(sfWebRequest $request)
- {
- $this->autenticado=$this->getUser()->isAuthenticated();
- $this->forward404Unless($request->isMethod(sfRequest::POST));
- $this->form = new PasanteForm();
- $this->processForm($request, $this->form);
- $this->setTemplate('new');
- }
- protected function processForm(sfWebRequest $request, sfForm $form)
- {
- $form->bind($request->getParameter($form->getName()), $request->getFiles($form->getName()));
- if ($form->isValid()){
- $this->redirect('perfil/Principal');
- }
- }
- }