public function getNumActivitats() { $C = new Criteria(); $C = CiclesPeer::getCriteriaActiu($C, $this->getSiteId()); $C = ActivitatsPeer::getCriteriaActiu($C, $this->getSiteId()); $C = HorarisPeer::getCriteriaActiu($C, $this->getSiteId()); $C->addJoin(CiclesPeer::CICLEID, ActivitatsPeer::CICLES_CICLEID); $C->addJoin(ActivitatsPeer::ACTIVITATID, HorarisPeer::ACTIVITATS_ACTIVITATID); $C->add(CiclesPeer::CICLEID, $this->getCicleid()); $C->addAscendingOrderByColumn(HorarisPeer::DIA); $C->addGroupByColumn(ActivitatsPeer::ACTIVITATID); return HorarisPeer::doCount($C); }
/** * Use: [ executeGCicles ] * Return: Pager * Parameters: PAGE(Page), $CERCA(Search), $IDS (IdSite) * */ public static function getList($PAGE = 1, $CERCA = "", $idS, $pager = true, $ordre_data = false) { if ($ordre_data) { $C = new Criteria(); $C = CiclesPeer::getCriteriaActiu($C, $idS); $C = ActivitatsPeer::getCriteriaActiu($C, $idS); $C = HorarisPeer::getCriteriaActiu($C, $idS); $C->addJoin(CiclesPeer::CICLEID, ActivitatsPeer::CICLES_CICLEID); $C->addJoin(ActivitatsPeer::ACTIVITATID, HorarisPeer::ACTIVITATS_ACTIVITATID); $C->addAscendingOrderByColumn(HorarisPeer::DIA); $C->add(CiclesPeer::EXTINGIT, false); $C->addGroupByColumn(CiclesPeer::CICLEID); return CiclesPeer::doSelect($C); } else { $C = new Criteria(); $C = self::getCriteriaActiu($C, $idS); if (!empty($CERCA)) { $C->add(self::NOM, '%' . $CERCA['text'] . '%', CRITERIA::LIKE); } if ($CERCA['select'] == 1) { $C->add(self::EXTINGIT, false); } else { $C->add(self::EXTINGIT, true); } $C->addAscendingOrderByColumn(self::NOM); if ($pager) { $pager = new sfPropelPager('Cicles', 100); $pager->setCriteria($C); $pager->setPage($PAGE); $pager->init(); return $pager; } else { return self::doSelect($C); } } }
/** * ActivitatsPeer::getLlistatWord() * * Fa el select per a un formulari de llistat d'activitats i posterior impressió de word * * @param mixed $IAF * @param mixed $IDS * @return */ public static function getLlistatWord(InformeActivitatsForm $IAF, $IDS) { $C = new Criteria(); $C = ActivitatsPeer::getCriteriaActiu($C, $IDS); $C = HorarisPeer::getCriteriaActiu($C, $IDS); $C->addJoin(ActivitatsPeer::ACTIVITATID, HorarisPeer::ACTIVITATS_ACTIVITATID); if ($IAF->getValue('idCicle') > 0) { $C->add(ActivitatsPeer::CICLES_CICLEID, $IAF->getValue('idCicle')); } $C1 = $C->getNewCriterion(HorarisPeer::DIA, $IAF->getValue('DataInici'), CRITERIA::GREATER_EQUAL); $C2 = $C->getNewCriterion(HorarisPeer::DIA, $IAF->getValue('DataFi'), CRITERIA::LESS_EQUAL); if (!is_null($IAF->getValue('DataInici'))) { $C->addAnd($C1); } if (!is_null($IAF->getValue('DataFi'))) { $C->addAnd($C2); } $C->add(ActivitatsPeer::TMIG, "", CRITERIA::NOT_EQUAL); $C->addAscendingOrderByColumn(HorarisPeer::DIA); $C->addGroupByColumn(ActivitatsPeer::ACTIVITATID); return ActivitatsPeer::doSelect($C); }
public function getActivitatss() { $C = new Criteria(); $C = ActivitatsPeer::getCriteriaActiu($C, $this->getSiteId()); $C = HorarisPeer::getCriteriaActiu($C, $this->getSiteId()); $C->add(HorarisPeer::HORARISID, $this->getHorarisid()); $C->addJoin(HorarisPeer::ACTIVITATS_ACTIVITATID, ActivitatsPeer::ACTIVITATID); $C->addGroupByColumn(ActivitatsPeer::ACTIVITATID); return ActivitatsPeer::doSelectOne($C); }
public function getHorarisActius($idS) { $C = new Criteria(); $C = HorarisPeer::getCriteriaActiu($C, $idS); $C->addAscendingOrderByColumn(HorarisPeer::DIA); return $this->getHorariss($C); }
private static function criteriaOcupatEspais($datai, $dataf, $hi, $hf, $idS, $idG = null, $idH = null, $idC = null) { //Mirem les activitats que usen material aquests dies. $C = new Criteria(); $C = self::getCriteriaActiu($C, $idS); $C = HorarisPeer::getCriteriaActiu($C, $idS); $C = HorarisespaisPeer::getCriteriaActiu($C, $idS); $C->addJoin(HorarisPeer::HORARISID, HorarisespaisPeer::HORARIS_HORARISID); $C->addJoin(HorarisespaisPeer::MATERIAL_IDMATERIAL, MaterialPeer::IDMATERIAL); if (!is_null($idG)) { $C->add(MaterialPeer::MATERIALGENERIC_IDMATERIALGENERIC, $idG); } if (!is_null($idH)) { $C->add(HorarisPeer::HORARISID, $idH, Criteria::NOT_EQUAL); } $C1 = self::getCriteriaSolapament($C, $datai, $dataf, HorarisPeer::DIA, HorarisPeer::DIA); $C2 = self::getCriteriaSolapament($C, $hi, $hf, HorarisPeer::HORAPRE, HorarisPeer::HORAPOST); $C1->addAnd($C2); $C->addAnd($C1); return $C; }
/** * Function que retorna els dies del mes que hi ha activitat. Només s'usa a la home page * @param unknown $mes * @param unknown $any */ public static function getDiesAmbActivitat($mes, $any, $idS) { $C = new Criteria(); $C = HorarisPeer::getCriteriaActiu($C, $idS); $C = self::getCriteriaActiu($C, $idS); $C1 = $C->getNewCriterion(HorarisPeer::DIA, $any . '-' . $mes . '-1', CRITERIA::GREATER_EQUAL); $C2 = $C->getNewCriterion(HorarisPeer::DIA, $any . '-' . $mes . '-31', CRITERIA::LESS_EQUAL); $C1->addAnd($C2); $C->add($C1); $C->add(ActivitatsPeer::PUBLICAWEB, true); $C->addJoin(self::ACTIVITATID, HorarisPeer::ACTIVITATS_ACTIVITATID); $C->addGroupByColumn(HorarisPeer::DIA); $dies = array(); foreach (HorarisPeer::doSelect($C) as $OH) { $dies[$OH->getDia('d')] = intval($OH->getDia('d')); } $ret = array(); foreach ($dies as $D) { $ret[] = $D; } rsort($ret); return $ret; }