public function executeIndex(sfWebRequest $request) { $this->user_procedures = Doctrine::getTable('UserProcedure')->findBy('procedure_id', $request->getParameter('procedure_id')); $this->procedure = Doctrine::getTable('Procedure')->find(array($request->getParameter('procedure_id'))); $obj = new UserProcedure(); $obj->setProcedureId($request->getParameter('procedure_id')); $this->form = new UserProcedureForm($obj); }
public function executeIndex(sfWebRequest $request) { // sorting if ($request->getParameter('sort') && $this->isValidSortColumn($request->getParameter('sort'))) { $this->setSort(array($request->getParameter('sort'), $request->getParameter('sort_type'))); } // pager if ($request->getParameter('page')) { $this->setPage($request->getParameter('page')); } $this->pager = $this->getPager(); $this->sort = $this->getSort(); $this->user_procedures = Doctrine::getTable('UserProcedure')->findBy('procedure_id', $request->getParameter('procedure_id')); $this->procedure = Doctrine::getTable('Procedure')->find(array($request->getParameter('procedure_id'))); $obj = new UserProcedure(); $obj->setProcedureId($request->getParameter('procedure_id')); $this->form = new UserProcedureForm($obj); }
public function save(Doctrine_Connection $conn = null) { $is_new = $this->isNew(); $procedure = parent::Save($conn); if ($is_new) { /* $dc=DatoCatastralPeer::retrieveByPK($this->getDatoCatastralId()); $numero=$dc->getNumero().'-'.$dc->getCircunscripcion().'-'.$dc->getSeccion().'-'.$this->getId(); $this->setNumero($numero); $this->save(); */ // singleton $singleton = sfContext::getInstance(); $revision = new Revision(); $revision->setNumber(0); $revision->setProcedureId($this->get('id')); $revision->setRevisionStateId(1); // <- Estado inicial. $revision->setBlock(true); // <- Bloqueamos la revision. $revision->setCreatorId($singleton->getUser()->getGuardUser()->getId()); $revision->save(); // Agregamos registro usuario_tramite $usuarioTramite = new UserProcedure(); $usuarioTramite->setUserId($singleton->getUser()->getGuardUser()->getId()); $usuarioTramite->setProcedureId($this->get('id')); $usuarioTramite->save(); } else { /* //guarda el numero de tramite en funcion del dato catastral $dc=DatoCatastralPeer::retrieveByPK($this->getDatoCatastralId()); $numero=$dc->getNumero().'-'.$dc->getCircunscripcion().'-'.$dc->getSeccion().'-'.$this->getId(); $this->setNumero($numero); //$this->save(); return parent::save($con); */ } }