SVN Alba r4856 - prosistem/alba/trunk/alba/apps/principal/modules/horarioescolar/actions
Author: josx Date: 2007-07-20 16:46:07 -0300 (Fri, 20 Jul 2007) New Revision: 4856 Modified: prosistem/alba/trunk/alba/apps/principal/modules/horarioescolar/actions/actions.class.php Log: Sacando codigo que ya no se usa Modified: prosistem/alba/trunk/alba/apps/principal/modules/horarioescolar/actions/actions.class.php =================================================================== --- prosistem/alba/trunk/alba/apps/principal/modules/horarioescolar/actions/actions.class.php 2007-07-20 19:32:16 UTC (rev 4855) +++ prosistem/alba/trunk/alba/apps/principal/modules/horarioescolar/actions/actions.class.php 2007-07-20 19:46:07 UTC (rev 4856) @@ -131,163 +131,7 @@ } - - - - function _add_zeros($string, $strlen) { - if ($strlen > strlen($string)) { - for ($x = strlen($string); $x < $strlen; $x++) { - $string = '0' . $string; - } - } - return $string; - } - - function executeMostrar() { - - - $criteria = new Criteria(); - //$criteria->add(EstablecimientoPeer::IS_LIVE, 1); - $establecimientos = EstablecimientoPeer::doSelect($criteria); - $optionsEstablecimiento = array(); - foreach ($establecimientos as $establecimiento) { - $optionsEstablecimiento[$establecimiento->getId()] = $establecimiento->getNombre(); - } - asort($optionsEstablecimiento); - $this->optionsEstablecimiento = $optionsEstablecimiento; - -// $establecimiento_id = $this->getRequestParameter('establecimiento_id'); -// if(!$establecimiento_id) { -// if(count($optionsEstablecimiento) > 0) { -// $establecimiento_id = key($optionsEstablecimiento); -// } -// } -// - $establecimiento_id = $this->getUser()->getAttribute('fk_establecimiento_id'); - $this->establecimiento_id = $establecimiento_id; - - - - $criteria = new Criteria(); - $criteria->add(CiclolectivoPeer::FK_ESTABLECIMIENTO_ID, $establecimiento_id); - $ciclolectivos = CiclolectivoPeer::doSelect($criteria); - $optionsCiclolectivo = array(); - foreach ($ciclolectivos as $ciclolectivo) { - $optionsCiclolectivo[$ciclolectivo->getId()] = $ciclolectivo->getDescripcion(); - } - asort($optionsCiclolectivo); - - $this->optionsCiclolectivo = $optionsCiclolectivo; - -/* - $ciclolectivo_id = $this->getRequestParameter('ciclolectivo_id'); - if(!$ciclolectivo_id) { - if(count($optionsCiclolectivo) > 0) { - $ciclolectivo_id = key($optionsCiclolectivo); - } - }*/ - - $ciclolectivo_id = $this->getUser()->getAttribute('fk_ciclolectivo_id'); - $this->ciclolectivo_id = $ciclolectivo_id; - - $criteriaT = new Criteria(); - $criteriaT->add(TurnosPeer::FK_CICLOLECTIVO_ID, $ciclolectivo_id); - $turnos = TurnosPeer::doSelect($criteriaT); - $optionsTurnos = array(); - $optionsTurnos[] = "--Seleccione--"; - foreach ($turnos as $turno) { - $optionsTurnos[$turno->getId()] = $turno->getDescripcion(); - } - asort($optionsTurnos); - $this->optionsTurnos = $optionsTurnos; - - - - $this->aHour = array(); - $horarioescolares = array(); - - Misc::use_helper('Misc'); - $aSemana = diasDeLaSemana(1); - - $this->aDayNames = array('Lunes','Martes','Miercoles','Jueves','Viernes'); - $this->aDay = array(strtotime("2006-09-11"), strtotime("2006-09-12"), strtotime("2006-09-13"), strtotime("2006-09-14"), strtotime("2006-09-15")); - - - $turnos_id = $this->getRequestParameter('turnos_id'); - - if ($this->getRequest()->getMethod() == sfRequest::POST AND $turnos_id) { -// $ciclolectivo_id = $this->getRequestParameter('ciclolectivo_id'); -// $establecimiento_id = $this->getRequestParameter('establecimiento_id'); - - - - $turno = TurnosPeer::retrieveByPK($turnos_id); - - if($this->getRequestParameter('time_interval')) { - $this->time_interval = $this->getRequestParameter('time_interval'); - } else { - $this->time_interval = 30; - } - - $this->aHour = array(strtotime($turno->getHoraInicio()), strtotime($turno->getHoraFin())); - - $criteria = new Criteria(); - $criteria->add(HorarioescolarPeer::FK_ESTABLECIMIENTO_ID, $establecimiento_id); - $criteria->add(HorarioescolarPeer::FK_TURNOS_ID, $turnos_id); - $horarioescolares = HorarioescolarPeer::doSelect($criteria); - - - } else { - $this->aHour = array(strtotime("8:00"), strtotime("17:00")); - $this->time_interval = 30; - } - - - $this->turnos_id = $turnos_id; - //Eventos - $this->aEvent = array(); - - if(count($horarioescolares) > 0) { - - $aColor = array ("silver", "gray"); - $aColorSet = array(); - $optionsHorarioescolar = array(); - $i=1; - foreach ($horarioescolares as $horarioescolar) { - - if(!array_key_exists($horarioescolar->getFkHorarioescolartipoId(),$aColorSet)) { - $aColorSet[$horarioescolar->getFkHorarioescolartipoId()] = $aColor[($i%2)]; - } - - $optionsHorarioescolar[$horarioescolar->getId()] = $horarioescolar->getDescripcion(); - $nombre = $horarioescolar->getNombre(); - $hora_inicio = $horarioescolar->getHoraInicio(); - $hora_fin = $horarioescolar->getHoraFin(); - $descripcion = $horarioescolar->getDescripcion(); - $dia_semana = $horarioescolar->getDia(); - $aDia = array(); - switch($dia_semana) { - case 8: - $aDia[] = date("Y-m-d", $this->aDay[0]); - $aDia[] = date("Y-m-d", $this->aDay[1]); - $aDia[] = date("Y-m-d", $this->aDay[2]); - $aDia[] = date("Y-m-d", $this->aDay[3]); - $aDia[] = date("Y-m-d", $this->aDay[4]); - - break; - default: $aDia[] = date("Y-m-d", $this->aDay[($dia_semana-1)]); - } - $tmpEvent= array(); - for($j=0;$j<count($aDia);$j++) { - array_push($tmpEvent,(object) array ( 'id'=> $i ,'name' => $nombre ,'date' => $aDia[$j],'start_time' => $hora_inicio, 'end_time' => $hora_fin, 'desc' => $descripcion, 'color' => $aColorSet[$horarioescolar->getFkHorarioescolartipoId()])); - $i++; - } - $this->aEvent = $tmpEvent; - } - } - - } - + protected function getLabels() { return array(
participants (1)
-
commits@pressenter.com.ar