public function setup()
 {
     $SN = array(true => 'Sí', false => 'No');
     $this->setWidgets(array('tractada' => new sfWidgetFormChoice(array('choices' => $SN)), 'Codi' => new sfWidgetFormInputText(array(), array()), 'Estat' => new sfWidgetFormChoice(array('choices' => ReservaespaisPeer::selectEstat())), 'CondicionsCCG' => new sfWidgetFormTextareaTinyMCE(), 'ReservaEspaiID' => new sfWidgetFormInputHidden(), 'Nom' => new sfWidgetFormInputText(array(), array('style' => 'width:400px')), 'DataActivitat' => new sfWidgetFormInputText(array(), array('style' => 'width:400px')), 'HorariActivitat' => new sfWidgetFormInputText(array(), array('style' => 'width:400px')), 'EspaisSolicitats' => new sfWidgetFormChoice(array('renderer_class' => 'sfWidgetFormSelectManyMy', 'choices' => EspaisPeer::selectFormReserva($this->getOption('IDS')), 'multiple' => true, 'expanded' => true), array('class' => 'ul_espais')), 'MaterialSolicitat' => new sfWidgetFormChoice(array('renderer_class' => 'sfWidgetFormSelectManyMy', 'choices' => MaterialgenericPeer::selectFormulariUsuaris(), 'multiple' => true, 'expanded' => true), array('class' => 'ul_material')), 'TipusActe' => new sfWidgetFormInputText(array(), array('style' => 'width:400px')), 'Representacio' => new sfWidgetFormInputText(array(), array('style' => 'width:400px')), 'Responsable' => new sfWidgetFormInputText(array(), array('style' => 'width:400px')), 'TelefonResponsable' => new sfWidgetFormInputText(array(), array('style' => 'width:400px')), 'Organitzadors' => new sfWidgetFormInputText(array(), array('style' => 'width:400px')), 'PersonalAutoritzat' => new sfWidgetFormInputText(array(), array('style' => 'width:400px')), 'PrevisioAssistents' => new sfWidgetFormInputText(array(), array('style' => 'width:400px')), 'isEnregistrable' => new sfWidgetFormChoice(array('choices' => $SN), array()), 'EsCicle' => new sfWidgetFormChoice(array('choices' => $SN), array()), 'Comentaris' => new sfWidgetFormTextarea(array(), array('rows' => '10', 'cols' => '50')), 'Usuaris_usuariID' => new sfWidgetFormInputHidden(), 'DataAlta' => new sfWidgetFormInputHidden(), 'DataAcceptacioCondicions' => new sfWidgetFormInputHidden(), 'ObservacionsCondicions' => new sfWidgetFormTextarea(array(), array('rows' => '10', 'cols' => '50'))));
     $this->setValidators(array('tractada' => new sfValidatorPass(array('required' => false), array()), 'Codi' => new sfValidatorPass(array('required' => false), array()), 'ReservaEspaiID' => new sfValidatorPropelChoice(array('model' => 'Reservaespais', 'column' => 'ReservaEspaiID', 'required' => false)), 'Representacio' => new sfValidatorString(array('required' => true)), 'Responsable' => new sfValidatorString(array('required' => true)), 'TelefonResponsable' => new sfValidatorString(array('required' => true)), 'PersonalAutoritzat' => new sfValidatorString(array('required' => true)), 'PrevisioAssistents' => new sfValidatorInteger(array('required' => true)), 'EsCicle' => new sfValidatorBoolean(array('required' => true)), 'Comentaris' => new sfValidatorString(array('required' => false)), 'Estat' => new sfValidatorString(array('max_length' => 1, 'required' => true)), 'Usuaris_usuariID' => new sfValidatorPropelChoice(array('model' => 'Usuaris', 'column' => 'UsuariID', 'required' => true)), 'Organitzadors' => new sfValidatorString(array('required' => true)), 'DataActivitat' => new sfValidatorString(array('required' => true)), 'HorariActivitat' => new sfValidatorString(array('required' => true)), 'TipusActe' => new sfValidatorString(array('required' => true)), 'Nom' => new sfValidatorString(array('required' => true)), 'isEnregistrable' => new sfValidatorBoolean(array('required' => true)), 'DataAlta' => new sfValidatorDateTime(array('required' => false)), 'EspaisSolicitats' => new sfValidatorString(array('required' => false)), 'MaterialSolicitat' => new sfValidatorString(array('required' => false)), 'CondicionsCCG' => new sfValidatorPass(), 'DataAcceptacioCondicions' => new sfValidatorPass(), 'ObservacionsCondicions' => new sfValidatorString(array('required' => false))));
     $this->widgetSchema->setLabels(array('tractada' => 'Tractada?', 'Codi' => "Codi: ", 'Estat' => "Estat actual: ", 'Nom' => "Nom de l'activitat: ", 'DataActivitat' => "Proposta de data: ", 'HorariActivitat' => "Horari de l'activitat: ", 'Espais' => 'Espais: (<a class="blue" href="' . sfConfig::get('sf_webroot') . 'intranet_dev.php/web/espais" target="_NEW">veure\'ls</a>)', 'Material' => "Material: ", 'TipusActe' => "Tipus d'acte: ", 'isEnregistrable' => "És enregistrable?", 'Representacio' => "En representació de: ", 'Responsable' => "Responsable: ", 'TelefonResponsable' => "Telèfon del responsable: ", 'Organitzadors' => "Organitzadors: ", 'PersonalAutoritzat' => "Personal autoritzat: ", 'PrevisioAssistents' => "Previsió d'assistents: ", 'EsCicle' => "És un cicle? ", 'Comentaris' => "Comentaris: ", 'EspaisSolicitats' => 'Espais: ', 'MaterialSolicitat' => 'Material: ', 'ObservacionsCondicions' => 'Observacions ', 'CondicionsCCG' => 'Condicions '));
     $this->widgetSchema->setNameFormat('reservaespais[%s]');
     $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
     $this->widgetSchema->setFormFormatterName('Span');
 }
示例#2
0
 /**
  * This is a method for emulating ON DELETE CASCADE for DBs that don't support this
  * feature (like MySQL or SQLite).
  *
  * This method is not very speedy because it must perform a query first to get
  * the implicated records and then perform the deletes by calling those Peer classes.
  *
  * This method should be used within a transaction if possible.
  *
  * @param      Criteria $criteria
  * @param      PropelPDO $con
  * @return     int The number of affected rows (if supported by underlying database driver).
  */
 protected static function doOnDeleteCascade(Criteria $criteria, PropelPDO $con)
 {
     // initialize var to track total num of affected rows
     $affectedRows = 0;
     // first find the objects that are implicated by the $criteria
     $objects = UsuarisPeer::doSelect($criteria, $con);
     foreach ($objects as $obj) {
         // delete related AppDocumentsPermisos objects
         $criteria = new Criteria(AppDocumentsPermisosPeer::DATABASE_NAME);
         $criteria->add(AppDocumentsPermisosPeer::IDUSUARI, $obj->getUsuariid());
         $affectedRows += AppDocumentsPermisosPeer::doDelete($criteria, $con);
         // delete related AppDocumentsPermisosDir objects
         $criteria = new Criteria(AppDocumentsPermisosDirPeer::DATABASE_NAME);
         $criteria->add(AppDocumentsPermisosDirPeer::IDUSUARI, $obj->getUsuariid());
         $affectedRows += AppDocumentsPermisosDirPeer::doDelete($criteria, $con);
         // delete related Cessio objects
         $criteria = new Criteria(CessioPeer::DATABASE_NAME);
         $criteria->add(CessioPeer::USUARI_ID, $obj->getUsuariid());
         $affectedRows += CessioPeer::doDelete($criteria, $con);
         // delete related Factures objects
         $criteria = new Criteria(FacturesPeer::DATABASE_NAME);
         $criteria->add(FacturesPeer::VALIDAUSUARI, $obj->getUsuariid());
         $affectedRows += FacturesPeer::doDelete($criteria, $con);
         // delete related Matricules objects
         $criteria = new Criteria(MatriculesPeer::DATABASE_NAME);
         $criteria->add(MatriculesPeer::USUARIS_USUARIID, $obj->getUsuariid());
         $affectedRows += MatriculesPeer::doDelete($criteria, $con);
         // delete related Missatges objects
         $criteria = new Criteria(MissatgesPeer::DATABASE_NAME);
         $criteria->add(MissatgesPeer::USUARIS_USUARIID, $obj->getUsuariid());
         $affectedRows += MissatgesPeer::doDelete($criteria, $con);
         // delete related Personal objects
         $criteria = new Criteria(PersonalPeer::DATABASE_NAME);
         $criteria->add(PersonalPeer::IDUSUARI, $obj->getUsuariid());
         $affectedRows += PersonalPeer::doDelete($criteria, $con);
         // delete related Reservaespais objects
         $criteria = new Criteria(ReservaespaisPeer::DATABASE_NAME);
         $criteria->add(ReservaespaisPeer::USUARIS_USUARIID, $obj->getUsuariid());
         $affectedRows += ReservaespaisPeer::doDelete($criteria, $con);
         // delete related UsuarisApps objects
         $criteria = new Criteria(UsuarisAppsPeer::DATABASE_NAME);
         $criteria->add(UsuarisAppsPeer::USUARI_ID, $obj->getUsuariid());
         $affectedRows += UsuarisAppsPeer::doDelete($criteria, $con);
         // delete related UsuarisMenus objects
         $criteria = new Criteria(UsuarisMenusPeer::DATABASE_NAME);
         $criteria->add(UsuarisMenusPeer::USUARI_ID, $obj->getUsuariid());
         $affectedRows += UsuarisMenusPeer::doDelete($criteria, $con);
         // delete related UsuarisSites objects
         $criteria = new Criteria(UsuarisSitesPeer::DATABASE_NAME);
         $criteria->add(UsuarisSitesPeer::USUARI_ID, $obj->getUsuariid());
         $affectedRows += UsuarisSitesPeer::doDelete($criteria, $con);
         // delete related Usuarisllistes objects
         $criteria = new Criteria(UsuarisllistesPeer::DATABASE_NAME);
         $criteria->add(UsuarisllistesPeer::USUARIS_USUARISID, $obj->getUsuariid());
         $affectedRows += UsuarisllistesPeer::doDelete($criteria, $con);
     }
     return $affectedRows;
 }
示例#3
0
 /**
  * Funció que retorna les reserves que ha fet un usuari a un SITE determinat. 
  *
  * @param int $idU
  * @return Reservaespais
  */
 static function getReservesUsuaris($idU, $idS)
 {
     $C = new Criteria();
     $C = self::getCriteriaActiu($C, $idS);
     $C->add(ReservaespaisPeer::USUARIS_USUARIID, $idU);
     return ReservaespaisPeer::doSelect($C);
 }
 /**
  * Retrieve multiple objects by pkey.
  *
  * @param      array $pks List of primary keys
  * @param      PropelPDO $con the connection to use
  * @throws     PropelException Any exceptions caught during processing will be
  *		 rethrown wrapped into a PropelException.
  */
 public static function retrieveByPKs($pks, PropelPDO $con = null)
 {
     if ($con === null) {
         $con = Propel::getConnection(ReservaespaisPeer::DATABASE_NAME, Propel::CONNECTION_READ);
     }
     $objs = null;
     if (empty($pks)) {
         $objs = array();
     } else {
         $criteria = new Criteria(ReservaespaisPeer::DATABASE_NAME);
         $criteria->add(ReservaespaisPeer::RESERVAESPAIID, $pks, Criteria::IN);
         $objs = ReservaespaisPeer::doSelect($criteria, $con);
     }
     return $objs;
 }
示例#5
0
 /**
  * Executa processos en background... que llança el sistema
  * */
 public function executeSBackground(sfWebRequest $request)
 {
     $accio = $request->getParameter('accio', '');
     switch ($accio) {
         case 'RECORDATORI_RESERVA_ESPAIS':
             $LOR = ReservaespaisPeer::getReservesRecordatoriNoResposta();
             foreach ($LOR as $OR) {
                 $idS = $OR->getSiteId();
                 $this->SendMailReservaEspais($OR, $idS, true);
             }
             $this->sendMail('*****@*****.**', '*****@*****.**', 'Hospici :: Remember condicions', var_dump($LOR));
             break;
     }
     return sfView::NONE;
 }
示例#6
0
 /**
  * Returns the number of related Reservaespais objects.
  *
  * @param      Criteria $criteria
  * @param      boolean $distinct
  * @param      PropelPDO $con
  * @return     int Count of related Reservaespais objects.
  * @throws     PropelException
  */
 public function countReservaespaiss(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
 {
     if ($criteria === null) {
         $criteria = new Criteria(UsuarisPeer::DATABASE_NAME);
     } else {
         $criteria = clone $criteria;
     }
     if ($distinct) {
         $criteria->setDistinct();
     }
     $count = null;
     if ($this->collReservaespaiss === null) {
         if ($this->isNew()) {
             $count = 0;
         } else {
             $criteria->add(ReservaespaisPeer::USUARIS_USUARIID, $this->usuariid);
             $count = ReservaespaisPeer::doCount($criteria, false, $con);
         }
     } else {
         // criteria has no effect for a new object
         if (!$this->isNew()) {
             // the following code is to determine if a new query is
             // called for.  If the criteria is the same as the last
             // one, just return count of the collection.
             $criteria->add(ReservaespaisPeer::USUARIS_USUARIID, $this->usuariid);
             if (!isset($this->lastReservaespaisCriteria) || !$this->lastReservaespaisCriteria->equals($criteria)) {
                 $count = ReservaespaisPeer::doCount($criteria, false, $con);
             } else {
                 $count = count($this->collReservaespaiss);
             }
         } else {
             $count = count($this->collReservaespaiss);
         }
     }
     return $count;
 }
示例#7
0
 /**
  * Gestió de formularis a través de mail     
  * */
 public function executeFormularis(sfWebRequest $request)
 {
     $this->setLayout('gestio');
     $this->DEFAULT = false;
     $this->IDU = $this->getUser()->getSessionPar('idU');
     $this->IDS = $this->getUser()->getSessionPar('idS');
     //Entren crides i es mostra una reposta en web si ha anat bé o no.
     $PARAMETRES = Encript::Desencripta($request->getParameter('PAR'));
     $PAR = unserialize($PARAMETRES);
     switch ($PAR['formulari']) {
         //Paràmetres [id = IDReservaEspais]
         //Només es podrà si l'estat actual és ESPERA_ACCEPTACIÓ_CONDICIONS
         case 'Reserva_Espais_Mail_Accepta_Condicions':
             $OR = ReservaespaisPeer::retrieveByPK($PAR['id']);
             //Fem un login i després acceptem les condicions
             $OU = UsuarisPeer::retrieveByPK($OR->getUsuarisUsuariid());
             $this->makeLogin($OU->getDNI(), $OU->getPasswd());
             if ($OR instanceof Reservaespais && $OR->setAcceptada()) {
                 $this->redirect('@hospici_llista_reserves?estat=RESERVA_ACCEPTADA');
             } else {
                 $this->redirect('@hospici_llista_reserves?estat=ERROR_TECNIC');
             }
             UsuarisPeer::addSite($OR->getUsuarisUsuariid(), $OR->getSiteid());
             break;
             //Des del mail la persona no accepta i rebutja les condicions.
         //Des del mail la persona no accepta i rebutja les condicions.
         case 'Reserva_Espais_Mail_Rebutja_Condicions':
             $OR = ReservaespaisPeer::retrieveByPK($PAR['id']);
             //Fem un login i després acceptem les condicions
             $OU = UsuarisPeer::retrieveByPK($OR->getUsuarisUsuariid());
             $this->makeLogin($OU->getDNI(), $OU->getPasswd());
             if ($OR instanceof Reservaespais && $OR->setRebutjada()) {
                 $this->redirect('@hospici_llista_reserves?estat=RESERVA_ANULADA');
             } else {
                 $this->redirect('@hospici_llista_reserves?estat=ERROR_TECNIC');
             }
             UsuarisPeer::addSite($OR->getUsuarisUsuariid(), $OR->getSiteid());
             break;
         default:
             break;
     }
 }
 /**
  * Populates the object using an array.
  *
  * This is particularly useful when populating an object from one of the
  * request arrays (e.g. $_POST).  This method goes through the column
  * names, checking to see whether a matching key exists in populated
  * array. If so the setByName() method is called for that column.
  *
  * You can specify the key type of the array by additionally passing one
  * of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME,
  * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM.
  * The default key type is the column's phpname (e.g. 'AuthorId')
  *
  * @param      array  $arr     An array to populate the object from.
  * @param      string $keyType The type of keys the array uses.
  * @return     void
  */
 public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
 {
     $keys = ReservaespaisPeer::getFieldNames($keyType);
     if (array_key_exists($keys[0], $arr)) {
         $this->setReservaespaiid($arr[$keys[0]]);
     }
     if (array_key_exists($keys[1], $arr)) {
         $this->setRepresentacio($arr[$keys[1]]);
     }
     if (array_key_exists($keys[2], $arr)) {
         $this->setResponsable($arr[$keys[2]]);
     }
     if (array_key_exists($keys[3], $arr)) {
         $this->setTelefonresponsable($arr[$keys[3]]);
     }
     if (array_key_exists($keys[4], $arr)) {
         $this->setPersonalautoritzat($arr[$keys[4]]);
     }
     if (array_key_exists($keys[5], $arr)) {
         $this->setPrevisioassistents($arr[$keys[5]]);
     }
     if (array_key_exists($keys[6], $arr)) {
         $this->setEscicle($arr[$keys[6]]);
     }
     if (array_key_exists($keys[7], $arr)) {
         $this->setComentaris($arr[$keys[7]]);
     }
     if (array_key_exists($keys[8], $arr)) {
         $this->setEstat($arr[$keys[8]]);
     }
     if (array_key_exists($keys[9], $arr)) {
         $this->setUsuarisUsuariid($arr[$keys[9]]);
     }
     if (array_key_exists($keys[10], $arr)) {
         $this->setOrganitzadors($arr[$keys[10]]);
     }
     if (array_key_exists($keys[11], $arr)) {
         $this->setDataactivitat($arr[$keys[11]]);
     }
     if (array_key_exists($keys[12], $arr)) {
         $this->setHorariactivitat($arr[$keys[12]]);
     }
     if (array_key_exists($keys[13], $arr)) {
         $this->setTipusacte($arr[$keys[13]]);
     }
     if (array_key_exists($keys[14], $arr)) {
         $this->setNom($arr[$keys[14]]);
     }
     if (array_key_exists($keys[15], $arr)) {
         $this->setIsenregistrable($arr[$keys[15]]);
     }
     if (array_key_exists($keys[16], $arr)) {
         $this->setEspaissolicitats($arr[$keys[16]]);
     }
     if (array_key_exists($keys[17], $arr)) {
         $this->setMaterialsolicitat($arr[$keys[17]]);
     }
     if (array_key_exists($keys[18], $arr)) {
         $this->setDataalta($arr[$keys[18]]);
     }
     if (array_key_exists($keys[19], $arr)) {
         $this->setCompromis($arr[$keys[19]]);
     }
     if (array_key_exists($keys[20], $arr)) {
         $this->setCodi($arr[$keys[20]]);
     }
     if (array_key_exists($keys[21], $arr)) {
         $this->setCondicionsccg($arr[$keys[21]]);
     }
     if (array_key_exists($keys[22], $arr)) {
         $this->setDataacceptaciocondicions($arr[$keys[22]]);
     }
     if (array_key_exists($keys[23], $arr)) {
         $this->setObservacionscondicions($arr[$keys[23]]);
     }
     if (array_key_exists($keys[24], $arr)) {
         $this->setHasdifusio($arr[$keys[24]]);
     }
     if (array_key_exists($keys[25], $arr)) {
         $this->setWebdescripcio($arr[$keys[25]]);
     }
     if (array_key_exists($keys[26], $arr)) {
         $this->setSiteId($arr[$keys[26]]);
     }
     if (array_key_exists($keys[27], $arr)) {
         $this->setActiu($arr[$keys[27]]);
     }
     if (array_key_exists($keys[28], $arr)) {
         $this->setTractada($arr[$keys[28]]);
     }
 }
示例#9
0
 public function executeUsuaris(sfWebRequest $request)
 {
     $accio = $request->getParameter('accio', 'inici');
     $this->IDU = $this->getUser()->getSessionPar('idU');
     $this->IDS = SitesPeer::HOSPICI_ID;
     $this->SECCIO = "";
     switch ($accio) {
         case 'inici':
             $this->SECCIO = 'INICI';
             break;
             //Modificació de les dades de l'usuari.
         //Modificació de les dades de l'usuari.
         case 'update':
             $RS = $request->getParameter('usuaris');
             if ($RS['UsuariID'] == $this->IDU) {
                 $FU = UsuarisPeer::initialize($this->IDU, $this->IDS, false, true);
                 $FU->bind($RS);
                 if ($FU->isValid()) {
                     $FU->save();
                     $this->MISSATGE = "OK";
                 }
             }
         case 'compra_entrada':
             //Des de l'Hospici només es pot reservar una entrada. Més endavant s'haurà d'abonar l'import.
             $RS = $request->getParameter('entrades');
             $OER = EntradesReservaPeer::initialize()->getObject();
             //Si no existeix una compra per aquest usuari, la fem, altrament, no fem res.
             if (!EntradesReservaPeer::ExisteixenEntradesComprades($this->IDU, $RS['idH'])) {
                 $OER->setUsuariid($this->IDU);
                 $OER->setHorarisid($RS['idH']);
                 $OER->setQuantes($RS['num']);
                 $OER->setData(date('Y-m-d H:i', time()));
                 $OER->setEstat(0);
                 $OER->setActiu(true);
                 $OER->save();
             }
             $this->SECCIO = 'COMPRA_ENTRADA';
             break;
         case 'anula_entrada':
             $RS = $request->getParameter('idER');
             $OER = EntradesReservaPeer::retrieveByPK($RS);
             $idu = $OER->getUsuariid();
             $act = $OER->getActiu();
             if ($idu == $this->IDU && $act) {
                 $OER->setEstat(EntradesReservaPeer::ANULADA);
                 $OER->save();
             }
             $this->SECCIO = 'COMPRA_ENTRADA';
             break;
     }
     $this->setLayout('hospici');
     //Si ja hi hem fet operacions... carreguem l'actual, sinó en fem un de nou.
     if (isset($FU) && $FU instanceof UsuarisForm) {
         $this->FUsuari = $FU;
     } else {
         $this->FUsuari = UsuarisPeer::initialize($this->IDU, $this->IDS, false, true);
     }
     $this->LMatricules = MatriculesPeer::h_getMatriculesUsuari($this->IDU);
     $this->LReserves = ReservaespaisPeer::h_getReservesUsuaris($this->IDU, $this->IDS);
     $this->LEntrades = EntradesReservaPeer::getEntradesUsuari($this->IDU);
     // $this->LMissatges = MissatgesPeer::getMissatgesUsuari();
 }
示例#10
0
 public function getReserves($idS = 0)
 {
     $C = new Criteria();
     $C = UsuarisPeer::getCriteriaActiu($C, $idS);
     $C = ReservaespaisPeer::getCriteriaActiu($C, $idS);
     $C->addJoin(UsuarisPeer::USUARIID, ReservaespaisPeer::USUARIS_USUARIID);
     $C->add(UsuarisPeer::USUARIID, $this->getUsuariid());
     $C->addDescendingOrderByColumn(ReservaespaisPeer::DATAALTA);
     return ReservaespaisPeer::doSelect($C);
 }
示例#11
0
 /**
  * Gestió de formularis a través de mail     
  * */
 public function executeFormularis(sfWebRequest $request)
 {
     $this->setLayout('gestio');
     $this->DEFAULT = false;
     $this->IDU = $this->getUser()->getSessionPar('idU');
     $this->IDS = $this->getUser()->getSessionPar('idS');
     //Entren crides i es mostra una reposta en web si ha anat bé o no.
     $PARAMETRES = Encript::Desencripta($request->getParameter('PAR'));
     $PAR = unserialize($PARAMETRES);
     switch ($PAR['formulari']) {
         //Paràmetres [id = IDReservaEspais]
         //Només es podrà si l'estat actual és ESPERA_ACCEPTACIÓ_CONDICIONS
         case 'Reserva_Espais_Mail_Accepta_Condicions':
             $OR = ReservaespaisPeer::retrieveByPK($PAR['id']);
             //Fem un login i després acceptem les condicions
             $OU = UsuarisPeer::retrieveByPK($OR->getUsuarisUsuariid());
             $this->makeLogin($OU->getDNI(), $OU->getPasswd());
             if ($OR instanceof Reservaespais) {
                 if ($OR->setAcceptada()) {
                     myUser::addLogTimeline('acceptada', 'Reserva (Hospici)', $this->IDU, $OR->getSiteId(), $OR->getReservaespaiid());
                     //Enviem un mail a secretaria informant de l'acceptació de les condicions
                     $this->sendMail(OptionsPeer::getString('MAIL_FROM', $OR->getSiteid()), OptionsPeer::getString('MAIL_SECRETARIA', $OR->getSiteid()), "RESERVA " . $OR->getCodi() . " ACCEPTADA", "Les condicions per a la reserva amb codi " . $OR->getCodi() . " organitzada per " . $OR->getOrganitzadors() . " han estat <b>ACCEPTADES</b>. <br /> Per poder accedir-hi podeu clicar el següent <a href=\"http://www.casadecultura.cat/gestio/gReserves/accio/E/IDR/" . $OR->getReservaespaiid() . "\">enllaç</a> havent entrat prèviament a la intranet.");
                     $this->redirect('@hospici_llista_reserves?estat=RESERVA_ACCEPTADA');
                 } else {
                     $this->redirect('@hospici_llista_reserves?estat=ERROR_JA_CONTESTAT');
                 }
             } else {
                 $this->redirect('@hospici_llista_reserves?estat=ERROR_TECNIC');
             }
             UsuarisPeer::addSite($OR->getUsuarisUsuariid(), $OR->getSiteid());
             break;
             //Des del mail la persona no accepta i rebutja les condicions.
         //Des del mail la persona no accepta i rebutja les condicions.
         case 'Reserva_Espais_Mail_Rebutja_Condicions':
             $OR = ReservaespaisPeer::retrieveByPK($PAR['id']);
             //Fem un login i després acceptem les condicions
             $OU = UsuarisPeer::retrieveByPK($OR->getUsuarisUsuariid());
             $this->makeLogin($OU->getDNI(), $OU->getPasswd());
             if ($OR instanceof Reservaespais) {
                 if ($OR->setRebutjada()) {
                     myUser::addLogTimeline('no_acceptada', 'Reserva (Hospici)', $this->IDU, $OR->getSiteId(), $OR->getReservaespaiid());
                     //Enviem un mail a secretaria informant del rebuig de les condicions
                     $this->sendMail(OptionsPeer::getString('MAIL_FROM', $OR->getSiteid()), OptionsPeer::getString('MAIL_SECRETARIA', $OR->getSiteid()), "RESERVA " . $OR->getCodi() . " REBUTJADA", "Les condicions per a la reserva amb codi " . $OR->getCodi() . " organitzada per " . $OR->getOrganitzadors() . " han estat <b>REBUTJADES</b>. <br /> Per poder accedir-hi podeu clicar el següent <a href=\"http://www.casadecultura.cat/gestio/gReserves/accio/E/IDR/" . $OR->getReservaespaiid() . "\">enllaç</a> havent entrat prèviament a la intranet.");
                     $this->redirect('@hospici_llista_reserves?estat=RESERVA_ANULADA');
                 } else {
                     $this->redirect('@hospici_llista_reserves?estat=ERROR_JA_CONTESTAT');
                 }
             } else {
                 $this->redirect('@hospici_llista_reserves?estat=ERROR_TECNIC');
             }
             UsuarisPeer::addSite($OR->getUsuarisUsuariid(), $OR->getSiteid());
             break;
         default:
             break;
     }
 }