[Alba-desarrollo] SVN Alba r4163 - in prosistem/alba/trunk/alba/apps/principal/modules: asistencia/actions asistencia/templates boletin/actions calendario/actions

commits en pressenter.com.ar commits en pressenter.com.ar
Lun Feb 5 21:14:07 CET 2007


Author: josx
Date: 2007-02-05 17:14:01 -0300 (Mon, 05 Feb 2007)
New Revision: 4163

Modified:
   prosistem/alba/trunk/alba/apps/principal/modules/asistencia/actions/ac=
tions.class.php
   prosistem/alba/trunk/alba/apps/principal/modules/asistencia/templates/=
indexSuccess.php
   prosistem/alba/trunk/alba/apps/principal/modules/boletin/actions/actio=
ns.class.php
   prosistem/alba/trunk/alba/apps/principal/modules/calendario/actions/ac=
tions.class.php
Log:
Modulo asistencias: error si fecha es erronea o no hay divisiones. Solo m=
uestra fechas para cargar si estas en el ciclo lectivo.=20

Modified: prosistem/alba/trunk/alba/apps/principal/modules/asistencia/act=
ions/actions.class.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- prosistem/alba/trunk/alba/apps/principal/modules/asistencia/actions/a=
ctions.class.php	2007-02-05 16:02:34 UTC (rev 4162)
+++ prosistem/alba/trunk/alba/apps/principal/modules/asistencia/actions/a=
ctions.class.php	2007-02-05 20:14:01 UTC (rev 4163)
@@ -43,147 +43,233 @@
     *
     */
     public function executeIndex() {
+       =20
+
         Misc::use_helper('Misc');
        =20
-        //Datos por default=20
+        //Iniciando Variables
         $alumno_id =3D -1;
         $cuenta_id =3D -1;
-        list($d, $m, $y) =3D split("[/. -]",date("d/m/Y"));
+        $vista_id =3D 1;         // default para vista DIARIO
+        $division_id =3D0;
         $datos =3D array();
         $idxAlumno=3D array();=20
-        $this->vista_id =3D 1;        =20
-        $this->division_id =3D0;
         $aFeriado =3D array();
-        //Asignacion por parametro   =20
+        $aIntervalo =3D array();              =20
+        $optionsDivision =3D array();
+        $aTemp =3D array();
+        $aFechaTemp =3D array();
+        $aTipoasistencias =3D array();
+        $aPorcentajeAsistencia =3D array();
+        $flag_error =3D 0;
+
+
+        // tomando los datos del formulario y completando variable
+
+        $ciclolectivo_id =3D $this->getUser()->getAttribute('fk_ciclolec=
tivo_id');      =20
+        $ciclolectivo =3D CiclolectivoPeer::retrieveByPK($ciclolectivo_i=
d);
+
+        $ciclolectivo_fecha_inicio =3D strtotime($ciclolectivo->getFecha=
Inicio());
+        $ciclolectivo_fecha_fin =3D strtotime($ciclolectivo->getFechaFin=
());
+
+        // asigno la fecha de inicio del ciclo lectivo por defecto
+        $aFechaActual =3D getdate($ciclolectivo_fecha_inicio);
+        $d =3D $aFechaActual['mday'];
+        $m =3D $aFechaActual['mon'];
+        $y =3D $aFechaActual['year'];
+
+       =20
+        // tomo el a=C3=B1o de la fecha de inicio y de fin del ciclo lec=
tivo
+        $anio_desde =3D date("Y",$ciclolectivo_fecha_inicio);
+        $anio_hasta =3D date("Y",$ciclolectivo_fecha_fin);
+       =20
+
         if ($this->getRequestParameter('alumno_id')) {
             $alumno_id =3D $this->getRequestParameter('alumno_id');  =20
             $a =3D AlumnoPeer::retrieveByPK($alumno_id);
             $cuenta_id =3D $a->getFkCuentaId();
         }
=20
-        if ($this->getRequestParameter('vistas'))
-            $this->vista_id  =3D $this->getRequestParameter('vistas');  =
           =20
=20
-        if ($this->getRequestParameter('dia'))
+        if ($this->getRequestParameter('vistas')) {
+            $vista_id  =3D $this->getRequestParameter('vistas');        =
     =20
+        }
+
+        if ($this->getRequestParameter('dia')) {
             $d =3D $this->getRequestParameter('dia');
-        if ($this->getRequestParameter('mes'))
+        }
+
+        if ($this->getRequestParameter('mes')) {
             $m =3D $this->getRequestParameter('mes');
-        if ($this->getRequestParameter('ano'))
+        }
+
+        if ($this->getRequestParameter('ano')) {
             $y =3D $this->getRequestParameter('ano');
-       =20
-        $aIntervalo =3D array();              =20
-        $aIntervalo =3D diasxintervalo($d,$m,$y,$this->vista_id);     =20
+        }
+
+
         $establecimiento_id =3D $this->getUser()->getAttribute('fk_estab=
lecimiento_id');
+
         $criteria =3D new Criteria();
         $criteria->add(AnioPeer::FK_ESTABLECIMIENTO_ID, $establecimiento=
_id);
-        $divisiones =3D DivisionPeer::doSelectJoinAnio($criteria);      =
 =20
-       =20
-        $optionsDivision =3D array();
-        foreach ($divisiones as $division)
+        $divisiones =3D DivisionPeer::doSelectJoinAnio($criteria);      =
  // divisiones a mostrar
+
+        foreach ($divisiones as $division) {
              $optionsDivision[$division->getId()] =3D $division->getAnio=
()->getDescripcion()." ".$division->getDescripcion();       =20
+        }
         asort($optionsDivision);
=20
+
+
         if ($this->getRequestParameter('division_id')) {
-            $this->division_id =3D $this->getRequestParameter('division_=
id');   =20
+            $division_id =3D $this->getRequestParameter('division_id'); =
  =20
         } else {
-            if ($this->getRequestParameter('alumno_id'))=20
-                $this->division_id =3D 1;
-            else{
-                //comprobar que que el array , sino le asigno
-                if (count($optionsDivision)>0){
-                    $d =3D array_keys($optionsDivision);       =20
-                    $this->division_id =3D $d[0];
-                }   =20
+            if ($this->getRequestParameter('alumno_id')) {
+                $division_id =3D 1;
+            } else {
+                if (count($optionsDivision) > 0){
+                    $aTemp =3D array_keys($optionsDivision);       =20
+                    $division_id =3D $aTemp[0];
+                } else {
+                    // Ver si se puede hacer desde el validate
+                    $this->getRequest()->setError('Division', 'No hay Ni=
nguna Divisi=C3=B3n cargada');
+                    $flag_error =3D 1;
+                }
             }    =20
         }
=20
+
+        if(!checkdate($m,$d,$y)) {
+            // Ver si se puede hacer desde el validate
+            $this->getRequest()->setError('Fecha', 'La fecha ingresada e=
s erronea');
+            $flag_error =3D 1;
+        }=20
+
+
+
+        if($flag_error =3D=3D 0) {
+            // devuelve un intervalo de dias seg=C3=BAn vista y fecha se=
leccionada
+            $aIntervalo =3D diasxintervalo($d, $m, $y, $vista_id); =20
+
+            // chequeo si el intervalo de fechas generados esta o no den=
tro de las fechas validas del ciclo lectivo
+            foreach($aIntervalo as $fecha) {
+                $fecha_intervalo =3D strtotime($fecha);
+                if($fecha_intervalo >=3D $ciclolectivo_fecha_inicio AND =
$fecha_intervalo <=3D $ciclolectivo_fecha_fin) {
+                    $aFechaTemp[] =3D $fecha;
+                }
+            }
+            $aIntervalo =3D $aFechaTemp;
+        }
+
+
+        // obteniendo los feriados actuales
         $criteria =3D new Criteria();
         $feriados =3D FeriadoPeer::doSelect($criteria);       =20
         foreach($feriados as $feriado) {
             $aFeriado[$feriado->getFecha()] =3D $feriado->getNombre();=20
         }
=20
-        //Obtener los alumnos de la division y asistencias en el rango d=
e fecha
-        $con =3D sfContext::getInstance()->getDatabaseConnection($connec=
tion=3D'propel');=20
-        $s =3D "SELECT alumno.id, alumno.nombre, alumno.apellido,";
-        $s .=3D "tipoasistencia.descripcion, tipoasistencia.nombre asist=
encia, asistencia.fecha,";
-        $s .=3D "fk_tipoasistencia_id ";
-        $s .=3D "FROM (alumno, rel_alumno_division) ";
-        $s .=3D "LEFT JOIN asistencia ON ( rel_alumno_division.FK_ALUMNO=
_ID =3D asistencia.FK_ALUMNO_ID ";
-        $s .=3D "AND asistencia.FECHA ";
-        $s .=3D "IN (";
-        for($i=3D0, $max =3D count($aIntervalo); $i < $max ;$i++) {=20
-             $s .=3D "'".$aIntervalo[$i]." 00:00:00'";
-             if  ($i < count($aIntervalo)-1 )
-                $s .=3D ",";
-        }
-        $s .=3D ") ) ";
-        $s .=3D "LEFT JOIN tipoasistencia ON ( asistencia.FK_TIPOASISTEN=
CIA_ID =3D tipoasistencia.ID ) ";
-        $s .=3D "WHERE ";
-        if ($alumno_id >=3D 0)
-            $s .=3D "alumno.ID =3D".$alumno_id;
-        else
-            $s .=3D "rel_alumno_division.FK_DIVISION_ID =3D". $this->div=
ision_id;
-        $s .=3D " AND rel_alumno_division.FK_ALUMNO_ID =3D alumno.ID";  =
 =20
-        $s .=3D " ORDER BY alumno.nombre,asistencia.FECHA";
+
+        // esto deberia estar hecho muy diferente guardar en un /tmp con=
 archivo aleatorio
+        if(file_exists(sfConfig::get('sf_upload_dir_name').'/grafico_asi=
stencias.png'))
+            unlink(sfConfig::get('sf_upload_dir_name').'/grafico_asisten=
cias.png');
+
+        if(count($aIntervalo) > 0 ) {
+            //Obtener los alumnos de la division y asistencias en el ran=
go de fecha
+            $con =3D sfContext::getInstance()->getDatabaseConnection($co=
nnection=3D'propel');=20
+            $s =3D "SELECT alumno.id, alumno.nombre, alumno.apellido,";
+            $s .=3D "tipoasistencia.descripcion, tipoasistencia.nombre a=
sistencia, asistencia.fecha,";
+            $s .=3D "fk_tipoasistencia_id ";
+            $s .=3D "FROM (alumno, rel_alumno_division) ";
+            $s .=3D "LEFT JOIN asistencia ON ( rel_alumno_division.FK_AL=
UMNO_ID =3D asistencia.FK_ALUMNO_ID ";
+            $s .=3D "AND asistencia.FECHA ";
+            $s .=3D "IN (";
+
+            for($i=3D0, $max =3D count($aIntervalo); $i < $max ;$i++) {=20
+                $s .=3D "'".$aIntervalo[$i]." 00:00:00'";
+                if  ($i < count($aIntervalo)-1 ) {
+                    $s .=3D ",";
+                }
+            }
+
+            $s .=3D ") ) ";
+            $s .=3D "LEFT JOIN tipoasistencia ON ( asistencia.FK_TIPOASI=
STENCIA_ID =3D tipoasistencia.ID ) ";
+            $s .=3D "WHERE ";
+
+            if ($alumno_id >=3D 0) {
+                $s .=3D "alumno.ID =3D".$alumno_id;
+            } else {
+                $s .=3D "rel_alumno_division.FK_DIVISION_ID =3D". $divis=
ion_id;
+            }
+
+            $s .=3D " AND rel_alumno_division.FK_ALUMNO_ID =3D alumno.ID=
";   =20
+            $s .=3D " ORDER BY alumno.nombre,asistencia.FECHA";
        =20
-        $stmt =3D $con->createStatement();
-        $alumnos =3D $stmt->executeQuery($s, ResultSet::FETCHMODE_ASSOC)=
;
+            $stmt =3D $con->createStatement();
+            $alumnos =3D $stmt->executeQuery($s, ResultSet::FETCHMODE_AS=
SOC);
                =20
-        $totales =3D array(); =20
-        $tot =3D 0;
-        foreach ($alumnos as $alumno){
-            $idxAlumno[$alumno['id']] =3D $alumno['apellido']." ". $alum=
no['nombre'];
-            if  ($alumno['fecha']) {
-                $datos[$alumno['id']][$alumno['fecha']] =3D $alumno['asi=
stencia'];
-                @$totales[$alumno['asistencia']]++;
+            $totales =3D array(); =20
+            $tot =3D 0;
+            foreach ($alumnos as $alumno){
+                $idxAlumno[$alumno['id']] =3D $alumno['apellido']." ". $=
alumno['nombre'];
+                if  ($alumno['fecha']) {=20
+                    $datos[$alumno['id']][$alumno['fecha']] =3D $alumno[=
'asistencia'];
+                    @$totales[$alumno['asistencia']]++;
+                }
             }
-        }
=20
-        $aTipoasistencias =3D $this->getTiposasistencias();
-        $aPorcentajeAsistencia =3D array();
-        $flag =3D 0;
-        $tot =3D 0;
+            $aTipoasistencias =3D $this->getTiposasistencias();
+            $aPorcentajeAsistencia =3D array();
+            $flag =3D 0;
+            $tot =3D 0;
=20
-        $dias =3D count($aIntervalo)*count($idxAlumno);
-        foreach($aTipoasistencias as $idx =3D> $Tipoasistencia) {
-            $aPorcentajeAsistencia[$idx]=3Disset($totales[$idx])?$totale=
s[$idx]:0;
-            @$tot +=3D $totales[$idx];
-            if($aPorcentajeAsistencia[$idx] !=3D 0) $flag =3D 1;
-        }
-       =20
-        if(file_exists(sfConfig::get('sf_upload_dir_name').'/grafico_asi=
stencias.png'))
-            unlink(sfConfig::get('sf_upload_dir_name').'/grafico_asisten=
cias.png');
=20
-        if($flag =3D=3D 1) {
+            // cantidad de fechas sin fines de semana
+            $cantFechas =3D 0;
+            foreach($aIntervalo as $fecha) {
+                if( !(date("w",strtotime($fecha)) =3D=3D 6) AND !(date("=
w",strtotime($fecha)) =3D=3D 0) ) {
+                    $cantFechas++;
+                }
+            }
=20
-            $aTitulo =3D array_keys($aTipoasistencias);
-            $aTitulo[] =3D "No Cargado";
+            $dias =3D $cantFechas*count($idxAlumno);
+            foreach($aTipoasistencias as $idx =3D> $Tipoasistencia) {
+                $aPorcentajeAsistencia[$idx] =3D isset($totales[$idx])?$=
totales[$idx]:0;
+                @$tot +=3D $totales[$idx];
+                if($aPorcentajeAsistencia[$idx] !=3D 0) $flag =3D 1;
+            }
=20
-            if(array_search("gd", get_loaded_extensions())) { // Si no t=
iene cargado la GD no muestra el grafico
+            if($flag =3D=3D 1) {
=20
-                include "graph.php";
-                putenv('GDFONTPATH=3D' . realpath(sfConfig::get('sf_lib_=
dir')."/font/"));
-                $graph =3D new graph();
-                $graph->setProp("font","FreeSerifBold.ttf");
-                $graph->setProp("keyfont","FreeSerifBold.ttf");
-                $graph->setProp("showkey",true);
-                $graph->setProp("type","pie");
-                $graph->setProp("showgrid",false);
-                $graph->setProp("key", $aTitulo);
-                $graph->setProp("keywidspc",-50);
-                $graph->setProp("keyinfo",2);
-                foreach($aPorcentajeAsistencia as $porcentaje)  {
-                    $graph->addPoint($porcentaje);
+                $aTitulo =3D array_keys($aTipoasistencias);
+                $aTitulo[] =3D "No Cargado";
+
+                if(array_search("gd", get_loaded_extensions())) { // Si =
no tiene cargado la GD no muestra el grafico
+
+                    include "graph.php";
+                    putenv('GDFONTPATH=3D' . realpath(sfConfig::get('sf_=
lib_dir')."/font/"));
+                    $graph =3D new graph();
+                    $graph->setProp("font","FreeSerifBold.ttf");
+                    $graph->setProp("keyfont","FreeSerifBold.ttf");
+                    $graph->setProp("showkey",true);
+                    $graph->setProp("type","pie");
+                    $graph->setProp("showgrid",false);
+                    $graph->setProp("key", $aTitulo);
+                    $graph->setProp("keywidspc",-50);
+                    $graph->setProp("keyinfo",2);
+                    foreach($aPorcentajeAsistencia as $porcentaje)  {
+                        $graph->addPoint($porcentaje);
+                    }
+                    $graph->addPoint($dias-$tot);
+   =20
+                    $graph->graphX();
+                    $graph->showGraph(sfConfig::get('sf_upload_dir_name'=
).'/grafico_asistencias.png');
                 }
-                $graph->addPoint($dias-$tot);
-   =20
-                $graph->graphX();
-                $graph->showGraph(sfConfig::get('sf_upload_dir_name').'/=
grafico_asistencias.png');
             }
+        } else {
+            // si pasa por aqui es que no hay fechas creadas en el inter=
valo
+        }
=20
-
-        }
         //Asignacion de variables para el template
         $this->d =3D $d;
         $this->m =3D $m;
@@ -199,33 +285,39 @@
         $this->aFeriado =3D $aFeriado;
         $this->alumno_id =3D $alumno_id;
         $this->cuenta_id =3D $cuenta_id;
-        //Verifico si muestro versi=EF=BF=BD para imprimir  =20
-        if ($this->getRequestParameter('vista'))
+        $this->vista_id =3D $vista_id;
+        $this->division_id =3D $division_id;
+        $this->anio_desde =3D $anio_desde;
+        $this->anio_hasta =3D $anio_hasta;
+
+        //Verifico si muestro versi=C3=B3n para imprimir  =20
+        if ($this->getRequestParameter('vista')) {
             $this->vista =3D $this->getRequestParameter('vista');
-        else
+        } else {
             $this->vista =3D "";
+        }
   }
  =20
   /**
   * Accion para mostrar los datos cambiados en el form
   */
-  public function executeMostrar() {
-    $vista_id  =3D $this->getRequestParameter('vistas');
-    $vista  =3D $this->getRequestParameter('vista');
-    $d =3D $this->getRequestParameter('dia');
-    $m =3D $this->getRequestParameter('mes');
-    $y =3D $this->getRequestParameter('ano');
-    return $this->forward('asistencia','index',"vista_id=3D$vista_id&dia=
=3D$d&mes=3D$m&ano=3D$y");  =20
-  }
+    function executeMostrar() {
+        $vista_id  =3D $this->getRequestParameter('vistas');
+        $vista  =3D $this->getRequestParameter('vista');
+        $d =3D $this->getRequestParameter('dia');
+        $m =3D $this->getRequestParameter('mes');
+        $y =3D $this->getRequestParameter('ano');
+        return $this->forward('asistencia','index',"vista_id=3D$vista_id=
&dia=3D$d&mes=3D$m&ano=3D$y");  =20
+    }
  =20
-  public function handleErrorMostrar(){
-    $this->forward('asistencia', 'index');
-  } =20
+    public function handleErrorMostrar(){
+        $this->forward('asistencia', 'index');
+    } =20
  =20
   /**
   * Graba las asistencias
   */
-  public function executeGrabar() {
+    public function executeGrabar() {
=20
         // inicializando variables
         $aDatosTipoasistencia =3D array();
@@ -247,6 +339,7 @@
         if($cantAsistencia > 0) {
             // tomo los tipos de asistencias
             $aDatosTablaTipoAsistencias =3D $this->getTiposasistencias()=
;
+
             //grabo al disco
             $con =3D Propel::getConnection();
             try {
@@ -255,8 +348,6 @@
=20
                 foreach($aAsistencia as $alumno_id =3D> $aPeriodo ) {
                     foreach($aPeriodo as $fecha =3D> $Tipoasistencia) {
-                        $fecha =3D str_replace("'","",$fecha);
-                        $alumno_id =3D str_replace("'","",$alumno_id);
                         $cton1 =3D $criteria->getNewCriterion(Asistencia=
Peer::FK_ALUMNO_ID, $alumno_id);
                         $cton2 =3D $criteria->getNewCriterion(Asistencia=
Peer::FECHA, $fecha);
                         $cton1->addAnd($cton2);
@@ -264,15 +355,13 @@
                     }
                 }
                 AsistenciaPeer::doDelete($criteria);
-                   =20
+
                 foreach($aAsistencia as $alumno_id =3D> $aPeriodo ) {
                     foreach($aPeriodo as $fecha =3D> $Tipoasistencia) {
                         //die($TipoAsistencia);
                         $Asistencia =3D new Asistencia();
                         if(array_key_exists($Tipoasistencia, $aDatosTabl=
aTipoAsistencias)){
-                            $alumno_id =3D str_replace("'","",$alumno_id=
);
                             $Asistencia->setFkAlumnoId($alumno_id);
-                            $fecha =3D str_replace("'","",$fecha);
                             list($y, $m, $d) =3D split("[/. -]",$fecha);=
       =20
                             $fecha =3D "$y-$m-$d";
                             $Asistencia->setFecha($fecha);
@@ -288,7 +377,6 @@
                  throw $e;
             }
         }
-           =20
         return $this->redirect($destino);   =20
     }
        =20

Modified: prosistem/alba/trunk/alba/apps/principal/modules/asistencia/tem=
plates/indexSuccess.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- prosistem/alba/trunk/alba/apps/principal/modules/asistencia/templates=
/indexSuccess.php	2007-02-05 16:02:34 UTC (rev 4162)
+++ prosistem/alba/trunk/alba/apps/principal/modules/asistencia/templates=
/indexSuccess.php	2007-02-05 20:14:01 UTC (rev 4163)
@@ -22,8 +22,8 @@
 *  asistencias template.
 *
 * @package    alba
-* @author     Jos=E9 Luis Di Biase <josx en interorganic.com.ar>
-* @author     H=E9tor Sanchez <hsanchez en pressenter.com.ar>
+* @author     Jos=C3=A9 Luis Di Biase <josx en interorganic.com.ar>
+* @author     H=C3=A9ctor Sanchez <hsanchez en pressenter.com.ar>
 * @author     Fernando Toledo <ftoledo en pressenter.com.ar>
 * @version    SVN: $Id$
 * @filesource
@@ -31,6 +31,7 @@
 */
 ?>                  =20
 <h1>Asistencias</h1>
+   =20
     <?php if ($sf_request->hasErrors()): ?>
       <div class=3D"form-errors">
       <h2><?php echo __('There are some errors that prevent the form to =
validate') ?></h2>
@@ -41,35 +42,42 @@
        </ul>
       </div>
     <?php endif ?>
+
     <?php echo form_tag('asistencia/mostrar', 'id=3Dsf_admin_edit_form n=
ame=3Dsf_admin_edit_form multipart=3Dtrue') ?>
     <fieldset id=3D"sf_fieldset_none" class=3D"">
     <div class=3D"form-row">
         <table cellspacing=3D"1">
             <tr>
+
                 <td>
                     <?php echo label_for('division_id', __('Divisi&oacut=
e;n:'), 'class=3D"required" '); ?>
                 </td>
                 <td>
                     <?php echo select_tag('division_id', options_for_sel=
ect($optionsDivision, $division_id)); ?>
                 </td>
-                <td>
+
+
+                <td style=3D'padding-left:50px'>
                     <?php echo label_for('fecha', __('Fecha Inicio:'), '=
class=3D"required" '); ?>      =20
                 </td>
                 <td>
                     <?php //----- Nuevo -----//
-                          //@TODO Obtener el a=F1o de inicio y de fin de=
l cliclo lectivo=20
-                          echo select_day_tag('dia', $d, 'include_custom=
=3DElija un dia') ?>
+                          //@TODO Obtener el a=C3=B1o de inicio y de fin=
 del cliclo lectivo=20
+                          echo select_day_tag('dia', $d, 'include_custom=
=3DElija un d&iacute;a') ?>
                     <?php echo select_month_tag('mes', $m, 'include_cust=
om=3DElija un mes use_short_month=3Dtrue') ?>
-                    <?php echo select_year_tag('ano', $y, 'include_custo=
m=3DElija un a&ntilde;o year_end=3D2007 year_start=3D2007') ?>
+                    <?php echo select_year_tag('ano', $y, 'include_custo=
m=3DElija un a&ntilde;o year_end=3D'.$anio_hasta.' year_start=3D'.$anio_d=
esde) ?>
                 </td>
-                <td>
-                    <?php echo label_for('vista', __('Vista:'), 'class=3D=
"required" '); ?>
+
+                <td style=3D'padding-left:50px'>
+                    <?php echo label_for('vista', __('Vista:'), 'class=3D=
"required"'); ?>
                 </td>
                 <td> =20
-                    <?php echo select_tag('vistas', options_for_select($=
aVistas,$vista_id)); ?>
+                    <?php echo select_tag('vistas', options_for_select($=
aVistas, $vista_id)); ?>
                 </td>
+
             </tr>
         <table>     =20
+
         <ul class=3D"sf_admin_actions">
             <li>
             <?php echo submit_tag(__('Mostrar'), array ('name' =3D> 'Mos=
trar','class' =3D> 'sf_admin_action_save')) ?>
@@ -81,6 +89,11 @@
             <?php echo input_hidden_tag('alumno_id', $alumno_id) ?>
         <? }?>   =20
      </form>
+
+
+<br>
+<br>
+
 <?php echo form_tag('asistencia/grabar', 'id=3Dsf_admin_edit_form name=3D=
sf_admin_edit_form multipart=3Dtrue');
       echo input_hidden_tag('division_id', $division_id);=20
       echo input_hidden_tag('dia', $d);=20
@@ -92,6 +105,7 @@
 ?>
     <h1>Mes: <?php echo  $aMeses[$m]; ?> </h1>
     <fieldset id=3D"sf_fieldset_none" class=3D"">
+
 <?php if( count($aAlumnos)>0) {?>
     <table  cellspacing=3D"1" class=3D"sf_admin_list">    =20
     <thead>
@@ -99,12 +113,15 @@
         <th id=3D"sf_admin_list_th_alumno"> Alumnos / D&iacute;as </th>
         <?php
             for($i=3D0, $max =3D count($aIntervalo); $i < $max ;$i++) { =
?>
-                <th id=3D"sf_admin_list_th_sf_actions"><?php echo date("=
d",strtotime($aIntervalo[$i]))?></th>
+                <th id=3D"sf_admin_list_th_sf_actions" <?=3D(date("w",st=
rtotime($aIntervalo[$i])) =3D=3D 6 || date("w",strtotime($aIntervalo[$i])=
) =3D=3D 0)?"style=3D'color:#FF0000'":""?> ><?php echo date("d",strtotime=
($aIntervalo[$i]))?></th>
             <?}?>
-            <?php foreach ($aTipoasistencias as $idx =3D> $Tipoasistenci=
a){ ?>
+=20
+                <th id=3D"sf_admin_list_th_sf_actions">&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</th>
+
+           <?php foreach ($aTipoasistencias as $idx =3D> $Tipoasistencia=
){ ?>
                 <th id=3D"sf_admin_list_th_sf_actions"><?php echo $idx ?=
></th>
             <?}?>
-     </tr>
+      </tr>
      </thead>
      <tbody>
      <?php =20
@@ -123,25 +140,27 @@
                 <?php=20
                     $fecha =3D date("Y-m-d 00:00:00",strtotime($aInterva=
lo[$i]));
                     if ( array_key_exists($fecha, $aFeriado) )  {
-                        echo input_tag("asistencia['$idx']['$fecha']", "=
", array('size' =3D> '2', 'maxlength' =3D> '2', 'disabled' =3D> true ));
+                        echo input_tag("asistencia[$idx][$fecha]", "", a=
rray('size' =3D> '2', 'maxlength' =3D> '2', 'disabled' =3D> true ));
                         $aFeriadoEfectivo[$fecha] =3D $aFeriado[$fecha];
                     }   =20
-                    elseif (date("w",strtotime($aIntervalo[$i])) =3D=3D =
6 || date("w",strtotime($aIntervalo[$i])) =3D=3D 0){
-                         echo input_tag("asistencia['$idx']['$fecha']", =
"", array('size' =3D> "2", 'maxlength' =3D> "2",'disabled' =3D> true )); =
  =20
-                        =20
+                    elseif (date("w",strtotime($aIntervalo[$i])) =3D=3D =
6 || date("w",strtotime($aIntervalo[$i])) =3D=3D 0) { //  No lo muestra s=
i es s=C3=A1
+                         echo input_tag("asistencia[$idx][$fecha]", "", =
array('size' =3D> "2", 'maxlength' =3D> "2",'disabled' =3D> true ));   =20
                     } else {
-                        if ( array_key_exists($idx, $aDatos) AND array_k=
ey_exists($fecha, $aDatos[$idx])){
+                        if ( array_key_exists($idx, $aDatos) AND array_k=
ey_exists($fecha, $aDatos[$idx])) {
                             $sizeAsis =3D count($aDatos[$idx][$fecha]);
-                            echo input_tag("asistencia['$idx']['$fecha']=
", $aDatos["$idx"]["$fecha"], array('size' =3D> $sizeAsis, 'maxlength' =3D=
> $sizeAsis));
+                            echo input_tag("asistencia[$idx][$fecha]", $=
aDatos["$idx"]["$fecha"], array('size' =3D> $sizeAsis, 'maxlength' =3D> $=
sizeAsis));
                             @$totales[$aDatos["$idx"]["$fecha"]]++;
                             @$totalesAlumnos[$aDatos["$idx"]["$fecha"]]+=
+;
                          } else {
-                            echo input_tag("asistencia['$idx']['$fecha']=
", "", array('size' =3D> "2", 'maxlength' =3D> "2"));   =20
+                            echo input_tag("asistencia[$idx][$fecha]", "=
", array('size' =3D> "2", 'maxlength' =3D> "2"));   =20
                          }
                      }
                  ?>
                  </td>
-            <?php }
+
+            <?php } ?>
+<td></td>
+<?
                foreach ($aTipoasistencias as $idx =3D> $Tipoasistencia){=
  ?>
                   <td><?php echo isset($totalesAlumnos[$idx])?$totalesAl=
umnos[$idx]:0; ?></td>
                <?php }?>
@@ -149,6 +168,8 @@
      <?php  } ?>
      </tbody>
     </table>
+
+
      <?php if ( count($aAlumnos) >0 ) {?>     =20
       <div class=3D"form-row">
         <ul class=3D"sf_admin_actions"><li>  =20
@@ -157,13 +178,9 @@
         <?php=20
             echo form_tag('asistencia/mostrar', 'id=3Dsf_admin_edit_form=
 name=3Dsf_admin_edit_form multipart=3Dtrue');
             echo input_hidden_tag('division_id', $division_id);=20
-            //list($y, $m, $d) =3D split("[/. -]",$fechainicio);
-            //echo input_hidden_tag('fechainicio', "$d/$m/$y");=20
-            //Fecha inicio.
             echo input_hidden_tag('dia', "$d");=20
             echo input_hidden_tag('mes', "$m");=20
             echo input_hidden_tag('ano', "$y");=20
-           =20
             echo input_hidden_tag('vistas', $vista_id);
             echo input_hidden_tag('vista', "noMuestraMenu");=20
             if($alumno_id >=3D 0)
@@ -174,6 +191,7 @@
         </li></ul>
      </div>
     <?php }?>=20
+
         <table cellspacing=3D"1">
             <tr>
     <?php foreach ($aTipoasistencias as $idx =3D> $Tipoasistencia){
@@ -184,26 +202,36 @@
           }
     ?>
             </tr>
-<?php
+
+
+<?php // Comienza Feriados
     if(count($aFeriadoEfectivo)>0) {
 ?>
     </table>
-        <br>Feriado<br>
+        <br>Feriados en Intervalo<br>
+
     <table cellspacing=3D"1">
         <tr>
-<?php   //print_r($aFeriadoEfectivo);
+<?php
         foreach($aFeriadoEfectivo as $fecha =3D> $nombre) {
             $fecha =3D date("d-m-Y",strtotime($fecha));
-            echo "<td style=3D'padding-left:20px'><b>$nombre</b>  - $fec=
ha</td>";
+            echo "<td style=3D'padding-left:20px'><b>$nombre</b>:  $fech=
a</td>";
         }
-    }
+    }=20
+    // Finaliza Feriados
 ?>
         </tr>
+
 <? } else { ?>
 <h2>NO HAY ALUMNOS</h2>
 <? } ?>
+
+
+
+
         </table>
     </div>
+
       <div class=3D"float-right">
           <ul class=3D"sf_admin_actions">
             <li><input style=3D"background: #ffc url(small/alumnos.png) =
no-repeat 3px 2px" value=3D"Listado Alumnos" type=3D"button" onclick=3D"d=
ocument.location.href=3D'<?=3DsfContext::getInstance()->getRequest()->get=
RelativeUrlRoot()?>/alumno/list';" /></li>
@@ -213,6 +241,8 @@
         </ul>
       </div>
     </fieldset>
+
+
  =20
 <div align=3D"center">
 <img src=3D"<?=3DsfContext::getInstance()->getRequest()->getRelativeUrlR=
oot()."/".sfConfig::get('sf_upload_dir_name').'/grafico_asistencias.png'?=
>"> =20

Modified: prosistem/alba/trunk/alba/apps/principal/modules/boletin/action=
s/actions.class.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- prosistem/alba/trunk/alba/apps/principal/modules/boletin/actions/acti=
ons.class.php	2007-02-05 16:02:34 UTC (rev 4162)
+++ prosistem/alba/trunk/alba/apps/principal/modules/boletin/actions/acti=
ons.class.php	2007-02-05 20:14:01 UTC (rev 4163)
@@ -415,10 +415,10 @@
                     $aAsistencia[$periodo->getId()] =3D $this->getAsiste=
nciaTotal($alumno_id, $periodo->getFechaInicio(), $periodo->getFechaFin()=
);
                 }      =20
             } else {
-                $this->setFlash('notice','Error el alumno no esta en nin=
gun divisi=C3=B3n');
+                $this->setFlash('notice','Error: el alumno no esta en ni=
nguna divisi=C3=B3n');
             }
         } else {
-            $this->setFlash('notice','Error no envio el alumno');
+            $this->setFlash('notice','Error: no envio el alumno');
         }
=20
=20

Modified: prosistem/alba/trunk/alba/apps/principal/modules/calendario/act=
ions/actions.class.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- prosistem/alba/trunk/alba/apps/principal/modules/calendario/actions/a=
ctions.class.php	2007-02-05 16:02:34 UTC (rev 4162)
+++ prosistem/alba/trunk/alba/apps/principal/modules/calendario/actions/a=
ctions.class.php	2007-02-05 20:14:01 UTC (rev 4163)
@@ -22,8 +22,8 @@
  * calendario actions
  *
  * @package    alba
- * @author     Jos=E9 Luis Di Biase <josx en interorganic.com.ar>
- * @author     H=E9ctor Sanchez <hsanchez en pressenter.com.ar>
+ * @author     Jos=C3=A9 Luis Di Biase <josx en interorganic.com.ar>
+ * @author     H=C3=A9ctor Sanchez <hsanchez en pressenter.com.ar>
  * @author     Fernando Toledo <ftoledo en pressenter.com.ar>
  * @version    SVN: $Id$
  * @filesource
@@ -188,10 +188,9 @@
         $establecimiento_id =3D $this->getUser()->getAttribute('fk_estab=
lecimiento_id');
         $this->establecimiento_id =3D $establecimiento_id;
        =20
-           =20
+          =20
=20
-
-/*        $criteria =3D new Criteria();
+/*      $criteria =3D new Criteria();
         $criteria->add(CiclolectivoPeer::FK_ESTABLECIMIENTO_ID, $estable=
cimiento_id);
         $ciclolectivos =3D CiclolectivoPeer::doSelect($criteria);
         $optionsCiclolectivo =3D array();




Más información sobre la lista de distribución Alba-desarrollo