[Alba-desarrollo] SVN Alba r4006 - in prosistem/alba/trunk: . alba/apps/principal/modules/asistencia/actions alba/apps/principal/modules/asistencia/templates

commits en pressenter.com.ar commits en pressenter.com.ar
Vie Ene 12 15:18:26 CET 2007


Author: josx
Date: 2007-01-12 11:18:25 -0300 (Fri, 12 Jan 2007)
New Revision: 4006

Modified:
   prosistem/alba/trunk/alba/apps/principal/modules/asistencia/actions/actions.class.php
   prosistem/alba/trunk/alba/apps/principal/modules/asistencia/templates/indexSuccess.php
   prosistem/alba/trunk/index.php
Log:
GD no es mas obligatorio en la instalacion y ademas si no la tiene no muestra el grafico. (ticket #97) 

Modified: prosistem/alba/trunk/alba/apps/principal/modules/asistencia/actions/actions.class.php
===================================================================
--- prosistem/alba/trunk/alba/apps/principal/modules/asistencia/actions/actions.class.php	2007-01-12 13:54:04 UTC (rev 4005)
+++ prosistem/alba/trunk/alba/apps/principal/modules/asistencia/actions/actions.class.php	2007-01-12 14:18:25 UTC (rev 4006)
@@ -154,27 +154,32 @@
 
         if($flag == 1) {
 
-        $aTitulo = array_keys($aTipoasistencias);
-        $aTitulo[] = "No Cargado";
+            $aTitulo = array_keys($aTipoasistencias);
+            $aTitulo[] = "No Cargado";
 
-        include "graph.php";
-        putenv('GDFONTPATH=' . realpath(sfConfig::get('sf_lib_dir')."/font/"));
-        $graph = 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);
+            if(array_search("gd", get_loaded_extensions())) { // Si no tiene cargado la GD no muestra el grafico
 
-        $graph->graphX();
-        $graph->showGraph(sfConfig::get('sf_upload_dir_name').'/grafico_asistencias.png');
+                include "graph.php";
+                putenv('GDFONTPATH=' . realpath(sfConfig::get('sf_lib_dir')."/font/"));
+                $graph = 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);
+    
+                $graph->graphX();
+                $graph->showGraph(sfConfig::get('sf_upload_dir_name').'/grafico_asistencias.png');
+            }
+
+
         }
         //print_r($optionsDivision);
         //Asignacion de variables para el template

Modified: prosistem/alba/trunk/alba/apps/principal/modules/asistencia/templates/indexSuccess.php
===================================================================
--- prosistem/alba/trunk/alba/apps/principal/modules/asistencia/templates/indexSuccess.php	2007-01-12 13:54:04 UTC (rev 4005)
+++ prosistem/alba/trunk/alba/apps/principal/modules/asistencia/templates/indexSuccess.php	2007-01-12 14:18:25 UTC (rev 4006)
@@ -99,7 +99,7 @@
                             $sizeAsis = count($aDatos[$idx][$fecha]);
                             echo input_tag("asistencia['$idx']['$fecha']", $aDatos["$idx"]["$fecha"], array('size' => $sizeAsis, 'maxlength' => $sizeAsis));
                             @$totales[$aDatos["$idx"]["$fecha"]]++;
-                            $totalesAlumnos[$aDatos["$idx"]["$fecha"]]++;
+                            @$totalesAlumnos[$aDatos["$idx"]["$fecha"]]++;
                          } else {
                             echo input_tag("asistencia['$idx']['$fecha']", "", array('size' => "2", 'maxlength' => "2"));    
                          }

Modified: prosistem/alba/trunk/index.php
===================================================================
--- prosistem/alba/trunk/index.php	2007-01-12 13:54:04 UTC (rev 4005)
+++ prosistem/alba/trunk/index.php	2007-01-12 14:18:25 UTC (rev 4006)
@@ -134,15 +134,7 @@
         $msg_mysql_module = "No tiene instalado el modulo MYSQL en PHP";
     }
 
-   
 
-// .htacces en el dir web 
-
-// sacar acceso a todos los dirs menos al web
-
-// chequear del apache si corre con AllowOverride All
-
-
     $hasErrors = false;
     $aError = array();
     $aDb = array( 'server' => '', 'user' => '', 'password' => '', 'name' => '', 'createdb' => '' ) ;
@@ -247,8 +239,8 @@
         
 
     <tr class="sf_admin_row_0">
-        <td>&#191; Esta Instalado GD en PHP ?</td>
-        <td><?=($bool_gd)?IMG_OK:IMG_NOT_OK." (Necesitas instalar GD  - http://www.php.net/manual/es/ref.image.php)";?></td>
+        <td>&#191; Esta Instalado GD en PHP ? (optativo) </td>
+        <td><?=($bool_gd)?IMG_OK:IMG_NOT_OK." (Si queres ver los gr&aacute;ficos de estad&iacute;sticas necesitas instalar GD  - http://www.php.net/manual/es/ref.image.php)";?></td>
     </tr>
 
     <tr class="sf_admin_row_1">
@@ -295,7 +287,7 @@
     </tr>
 </table>
 
-<? if($bool_config AND $bool_upload AND $bool_log AND $bool_cache AND $bool_memory_limit AND $bool_apache_get_version AND $bool_phpversion AND $bool_gd AND $bool_mysql_module AND $bool_mod_rewrite) { ?>
+<? if($bool_config AND $bool_upload AND $bool_log AND $bool_cache AND $bool_memory_limit AND $bool_apache_get_version AND $bool_phpversion AND $bool_mysql_module AND $bool_mod_rewrite) { ?>
 
 <?php if($hasErrors) { ?>
     <br><br>




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