示例#1
0
 public function executeEdit($request)
 {
     $evento_generico = new miEvento(new sfEventDispatcher());
     $this->rel_division_actividad_docente = $this->getRelDivisionActividadDocenteOrCreate();
     $this->evento = $evento_generico->getEventoOrCreate($this->rel_division_actividad_docente->getFkEventoId());
     if ($this->getRequest()->getMethod() == sfRequest::POST) {
         $e = $this->getRequestParameter('evento');
         $r = $this->getRequestParameter('rel_division_actividad_docente');
         $division = DivisionPeer::retrieveByPk($r["fk_division_id"]);
         $actividad = ActividadPeer::retrieveByPk($r["fk_actividad_id"]);
         $docente = DocentePeer::retrieveByPk($r["fk_docente_id"]);
         $e['titulo'] = $division . " - " . $actividad->getNombre();
         $this->evento = $evento_generico->updateEventoFromRequest($this->evento, $e, $this->getUser()->getCulture());
         $this->evento->save();
         $this->forward404Unless($this->evento);
         $this->updateRelDivisionActividadDocenteFromRequest($this->evento->getId());
         $this->saveRelDivisionActividadDocente($this->rel_division_actividad_docente);
         $this->getUser()->setFlash('notice', 'Your modifications have been saved');
         if ($this->getRequestParameter('save_and_add')) {
             return $this->redirect('relDivisionActividadDocente/create');
         } else {
             if ($this->getRequestParameter('save_and_list')) {
                 return $this->redirect('relDivisionActividadDocente/list');
             } else {
                 return $this->redirect('relDivisionActividadDocente/edit?id=' . $this->rel_division_actividad_docente->getId());
             }
         }
     } else {
         $this->labels = $this->getLabels();
     }
 }
示例#2
0
 public function handleErrorEdit()
 {
     $this->preExecute();
     $this->docenteHorario = $this->getDocenteHorarioOrCreate();
     $this->docente = DocentePeer::retrieveByPk($this->getRequestParameter('docente_horario[fk_docente_id]'));
     $evento_generico = new miEvento(new sfEventDispatcher());
     $this->evento = $evento_generico->getEventoOrCreate($this->docenteHorario->getFkEventoId());
     $this->evento = $evento_generico->updateEventoFromRequest($this->evento, $this->getRequestParameter('evento'), $this->getUser()->getCulture());
     $this->updateDocenteHorarioFromRequest($this->evento->getId());
     $this->labels = $this->getLabels();
     return sfView::SUCCESS;
 }
示例#3
0
 public function handleErrorEdit()
 {
     $this->preExecute();
     $this->horarioescolar = $this->getHorarioescolarOrCreate();
     $evento_generico = new miEvento();
     $this->evento = $evento_generico->getEventoOrCreate($this->horarioescolar->getFkEventoId());
     $this->evento = $evento_generico->updateEventoFromRequest($this->evento, $this->getRequestParameter('evento'), $this->getUser()->getCulture());
     $this->updateHorarioescolarFromRequest($this->evento->getId());
     //print_R($this->evento);
     $this->labels = $this->getLabels();
     return sfView::SUCCESS;
 }