Alba-desarrollo
Threads by month
- ----- 2026 -----
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
August 2007
- 6 participants
- 168 discussions
SVN Alba r4923 - prosistem/alba/trunk/dist/symfony-1.0.5/lib/util
by commits@pressenter.com.ar 07 Aug '07
by commits@pressenter.com.ar 07 Aug '07
07 Aug '07
Author: josx
Date: 2007-08-06 21:41:01 -0300 (Mon, 06 Aug 2007)
New Revision: 4923
Modified:
prosistem/alba/trunk/dist/symfony-1.0.5/lib/util/sfFillInForm.class.php
Log:
Parche para solucionar bug #1176 de symfony. Lo incluyo ahora y luego cuando lo agreguen en versiones posteriores ya seguramente estara integrado
Modified: prosistem/alba/trunk/dist/symfony-1.0.5/lib/util/sfFillInForm.class.php
===================================================================
--- prosistem/alba/trunk/dist/symfony-1.0.5/lib/util/sfFillInForm.class.php 2007-08-06 22:36:59 UTC (rev 4922)
+++ prosistem/alba/trunk/dist/symfony-1.0.5/lib/util/sfFillInForm.class.php 2007-08-07 00:41:01 UTC (rev 4923)
@@ -116,10 +116,19 @@
{
// checkbox and radio
$element->removeAttribute('checked');
- if ($this->hasValue($values, $name) && ($this->getValue($values, $name) == $value || !$element->hasAttribute('value')))
+
+ if (is_array($this->getValue($values, $name)) && ($this->hasValue($values, $name) || !$element->hasAttribute('value')))
+ {
+ if (in_array($value, $this->getValue($values, $name)))
+ {
+ $element->setAttribute('checked', 'checked');
+ }
+ }
+ else if ($this->hasValue($values, $name) && ($this->getValue($values, $name) == $value || !$element->hasAttribute('value')))
{
$element->setAttribute('checked', 'checked');
}
+
}
else
{
1
0
SVN Alba r4922 - in prosistem/alba/trunk/alba/web: . instalar
by commits@pressenter.com.ar 06 Aug '07
by commits@pressenter.com.ar 06 Aug '07
06 Aug '07
Author: ftoledo
Date: 2007-08-06 19:36:59 -0300 (Mon, 06 Aug 2007)
New Revision: 4922
Added:
prosistem/alba/trunk/alba/web/instalar.old.php
prosistem/alba/trunk/alba/web/instalar/paso2.php
Modified:
prosistem/alba/trunk/alba/web/instalar/instalar.php
prosistem/alba/trunk/alba/web/instalar/paso1.php
Log:
pasos del instalador
Modified: prosistem/alba/trunk/alba/web/instalar/instalar.php
===================================================================
--- prosistem/alba/trunk/alba/web/instalar/instalar.php 2007-08-06 20:03:59 UTC (rev 4921)
+++ prosistem/alba/trunk/alba/web/instalar/instalar.php 2007-08-06 22:36:59 UTC (rev 4922)
@@ -32,14 +32,31 @@
define ('ALBA_INSTALLER',1);
-define ('IMG_OK','<img src="images/ok.png">');
-define ('IMG_ERROR' '<img src="images/error.png>');
+define ('IMG_OK','<img src="images/ok.png" title="Correcto" alt="Correcto">');
+define ('IMG_ERROR', '<img src="images/error.png" title="Incorrecto" alt="Incorrecto">');
-if (!isset($_SESSION['instalador']['paso']))
+if (!isset($_GET['paso']))
$paso = 1;
else
- $paso = $_SESSION['instalador']['paso'];
+ $paso = $_GET['paso'];
+
+$error_flag = false;
+$completo = false;
+
+
+function AlbaPath() {
+ return realpath(dirname(__FILE__) .DIRECTORY_SEPARATOR. ".." . DIRECTORY_SEPARATOR . ".." . DIRECTORY_SEPARATOR);
+}
+
+function DebugLog($str) {
+ $log = AlbaPath() . DIRECTORY_SEPARATOR . "log" . DIRECTORY_SEPARATOR . "install.log";
+ $fp = fopen($log,"a+");
+ if ($fp) {
+ fwrite($fp,date('d/m/Y H:i:s') . " $str\n");
+ fclose($fp);
+ }
+}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/2000/REC-xhtml1-200000126/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="es" lang="es">
@@ -54,25 +71,31 @@
<body>
<div id="cabeza">
<h1>Instalación de ALBA</h1>
- <p>Antes de continuar con la instalacion, es necesario comprobar los permisos
- de algunos directorios en particular:</p>
</div>
-
<div id="contenido">
<?php
switch ($paso) {
case 1:
- include ("instalar/paso1.php");
+ include ("paso1.php");
break;
case 2:
- include ("instalar/paso2.php");
+ include ("paso2.php");
break;
case 3:
- include ("instalar/paso3.php");
+ include ("paso3.php");
break;
}
?>
</div>
+ <br/>
+ <?php if (!$error_flag && !$completo): ?>
+ <div id="siguiente">
+ <form method="get" action="instalar.php">
+ <input type="hidden" name="paso" value="<?php echo $paso?>">
+ <input type="submit" name="btSiguiente" value="Siguiente">
+ </form>
+ </div>
+ <?php endif;?>
</body>
</html>
Modified: prosistem/alba/trunk/alba/web/instalar/paso1.php
===================================================================
--- prosistem/alba/trunk/alba/web/instalar/paso1.php 2007-08-06 20:03:59 UTC (rev 4921)
+++ prosistem/alba/trunk/alba/web/instalar/paso1.php 2007-08-06 22:36:59 UTC (rev 4922)
@@ -1,4 +1,4 @@
-<?php
+<?php
/**
* This file is part of Alba.
*
@@ -30,11 +30,6 @@
* @license GPL
*/
-function permisos($dir) {
- $octalPermiso = substr(sprintf('%o', @fileperms($dir)), -4);
- return ($octalPermiso == "0777" OR $octalPermiso == "1777");
-}
-
$dirs = array(
'config',
'cache',
@@ -44,9 +39,31 @@
'web' . DIRECTORY_SEPARATOR. 'uploads' .DIRECTORY_SEPARATOR. 'assets',
);
-?>
-<ul>
-<?php foeach($dirs as $dir):?>
- <li>Comprobando permisos en: <?php echo $dir?> <?php permiso($dir) : IMG_OK : IMG_ERROR </li>
+$alba_path = AlbaPath();
+?>
+<div id="detalle">
+<p>Antes de continuar con la instalación, es necesario comprobar los permisos
+de algunos directorios en particular.<br/>
+Por favor, corrija los mismos y vuelva a recargar ésta página hasta que todos
+esten correctos.
+</p>
+</div>
+
+<p>Directorio base: <?php echo $alba_path?></p>
+<table>
+<?php foreach($dirs as $dir):?>
+ <?php
+ if (!is_writable($alba_path .DIRECTORY_SEPARATOR . $dir))
+ $error_flag = true;
+ ?>
+ <tr>
+ <td>Comprobando permisos en: <?php echo $dir ?></td>
+ <td><?php echo is_writable($alba_path .DIRECTORY_SEPARATOR . $dir) ? IMG_OK : IMG_ERROR ." (Debe cambiar los permisos)" ?></td>
+ </tr>
<?php endforeach;?>
-</ul>
\ No newline at end of file
+</table>
+
+<?php
+// ir al siguiente paso
+ $paso = 2;
+?>
\ No newline at end of file
Added: prosistem/alba/trunk/alba/web/instalar/paso2.php
===================================================================
--- prosistem/alba/trunk/alba/web/instalar/paso2.php 2007-08-06 20:03:59 UTC (rev 4921)
+++ prosistem/alba/trunk/alba/web/instalar/paso2.php 2007-08-06 22:36:59 UTC (rev 4922)
@@ -0,0 +1,111 @@
+<?php
+/**
+ * This file is part of Alba.
+ *
+ * Alba is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * Alba is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Alba; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+
+/**
+ * instalador
+ *
+ * @package alba
+ * @author José Luis Di Biase <josx(a)interorganic.com.ar>
+ * @author Héctor Sanchez <hsanchez(a)pressenter.com.ar>
+ * @author Fernando Toledo <ftoledo(a)pressenter.com.ar>
+ * @version SVN: $Id: instalar.php 4883 2007-07-30 21:41:42Z ftoledo $
+ * @filesource
+ * @license GPL
+ */
+
+
+/* helpers para comprobaciones */
+function check_php() {
+ return version_compare(phpversion(),'5.0.0','>=');
+}
+function check_mysql() {
+ return extension_loaded('mysql');
+}
+function check_memorylimit() {
+ $limite = ini_get('memory_limit');
+ return ($limite >= 32);
+}
+function check_magicquotes() {
+ return !get_magic_quotes_gpc();
+}
+function check_gd() {
+ return extension_loaded('gd');
+}
+function check_apache2() {
+ $version = 0;
+ preg_match('!Apache/(.*) !U', apache_get_version(), $version);
+ return version_compare($version[1],'2.0.0','>=');
+
+}
+function check_rewrite() {
+ $modulos = apache_get_modules();
+ if(count($modulos)>0) {
+ $res = array_search('mod_rewrite', $modulos);
+ if($res === false) {
+ return false;
+ } else {
+ return true;
+ }
+ } else {
+ return false;
+ }
+}
+?>
+<div id="detalle">
+<p>Comprobación de las versiones de programas instalados:</p>
+</div>
+
+<table>
+ <tr>
+ <td>Version de PHP >= 5.0.0</td>
+ <td><?php echo check_php() ? IMG_OK : IMG_ERROR . " (Versión instalada " .phpversion(). ")"?></td>
+ </tr>
+ <tr>
+ <td>Límite de Memoria PHP (>=32Mb)</td>
+ <td><?php echo check_memorylimit() ? IMG_OK : IMG_ERROR ?></td>
+ </tr>
+ <tr>
+ <td>magic_quotes_gpc = Off</td>
+ <td><?php echo check_magicquotes() ? IMG_OK : IMG_ERROR ?></td>
+ </tr>
+ <tr>
+ <td>Módulo para Mysql</td>
+ <td><?php echo check_mysql() ? IMG_OK : IMG_ERROR ?></td>
+ </tr>
+ <tr>
+ <td>Módulo GD</td>
+ <td><?php echo check_gd() ? IMG_OK : IMG_ERROR ?></td>
+ </tr>
+ <tr>
+ <td colspan="2"> </td>
+ </tr>
+ <tr>
+ <td>Servidor web Apache 2</td>
+ <td><?php echo check_apache2() ? IMG_OK : IMG_ERROR ?></td>
+ </tr>
+ <tr>
+ <td>mod_rewrite</td>
+ <td><?php echo check_rewrite() ? IMG_OK : IMG_ERROR ?></td>
+ </tr>
+</table>
+<?php
+// ir al siguiente paso
+ $paso = 3;
+?>
\ No newline at end of file
Property changes on: prosistem/alba/trunk/alba/web/instalar/paso2.php
___________________________________________________________________
Name: svn:keywords
+ "Id Author URL Date Rev"
Added: prosistem/alba/trunk/alba/web/instalar.old.php
===================================================================
--- prosistem/alba/trunk/alba/web/instalar.old.php 2007-08-06 20:03:59 UTC (rev 4921)
+++ prosistem/alba/trunk/alba/web/instalar.old.php 2007-08-06 22:36:59 UTC (rev 4922)
@@ -0,0 +1,655 @@
+<?php
+/**
+ * This file is part of Alba.
+ *
+ * Alba is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * Alba is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Alba; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+
+/**
+ * instalador
+ *
+ * @package alba
+ * @author José Luis Di Biase <josx(a)interorganic.com.ar>
+ * @author Héctor Sanchez <hsanchez(a)pressenter.com.ar>
+ * @author Fernando Toledo <ftoledo(a)pressenter.com.ar>
+ * @version SVN: $Id: instalar.php 4883 2007-07-30 21:41:42Z ftoledo $
+ * @filesource
+ * @license GPL
+ */
+
+
+ define("OS_WINDOWS",((strtoupper(substr(PHP_OS,0,3))=='WIN'))?true:false);
+
+ define("APACHE_REQUIRED_VERSION","2.0.0");
+ define("PHP_REQUIRED_VERSION","5.0.0");
+ define("MEMORY_LIMIT_REQUIRED", "16");
+ define("MYSQL_REQUIRED_VERSION","4.1.0");
+
+ define("INSTALL_DIR", realpath(dirname(__FILE__) . DIRECTORY_SEPARATOR . ".." . DIRECTORY_SEPARATOR). DIRECTORY_SEPARATOR);
+ define("DEBUG_LOG",INSTALL_DIR."log".DIRECTORY_SEPARATOR."install.log");
+ define("ALBA_WEB",INSTALL_DIR."web" . DIRECTORY_SEPARATOR);
+ define("ALBA_CONFIG", INSTALL_DIR."config".DIRECTORY_SEPARATOR);
+
+ define("APACHE_CONFIG_DIST", ALBA_CONFIG."apache.conf.dist");
+ define("DATABASE_CONFIG_DIST", ALBA_CONFIG."databases.yml.dist");
+ define("PROPEL_CONFIG_DIST", ALBA_CONFIG."propel.ini.dist");
+ define("HTACCESS_DIST", ALBA_WEB.".htaccess.dist");
+
+ define("DATABASE_CONFIG", ALBA_CONFIG."databases.yml");
+ define("PROPEL_CONFIG", ALBA_CONFIG."propel.ini");
+ define("HTACCESS", ALBA_WEB.".htaccess");
+ define("SCHEMA", ALBA_CONFIG."schema.yml");
+
+
+ define("IMG_OK", "<img src='images/installer/save.png'>");
+ define("IMG_NOT_OK", "<img src='images/installer/delete.png'>");
+
+ define("SQL_CREATE_DB", INSTALL_DIR."data".DIRECTORY_SEPARATOR."sql".DIRECTORY_SEPARATOR."create-db.sql");
+ define("SQL_CREATE", INSTALL_DIR."data".DIRECTORY_SEPARATOR."sql".DIRECTORY_SEPARATOR."lib.model.schema.sql");
+ define("SQL_INSERT_INICIAL", INSTALL_DIR."data".DIRECTORY_SEPARATOR."sql".DIRECTORY_SEPARATOR."datos_desde_cero.sql");
+ define("SQL_INSERT_EJEMPLO", INSTALL_DIR."data".DIRECTORY_SEPARATOR."sql".DIRECTORY_SEPARATOR."datos_ejemplo.sql");
+
+ if(!file_exists(INSTALL_COMPLETE_FILE)) {
+
+ $fp = fopen(DEBUG_LOG, "at" );
+ fputs( $fp,date( "d/m/Y H:m:s")." ---- INICIO DE VERIFICACIONES ----\n\n" );
+
+ if(OS_WINDOWS) {
+ @unlink(ALBA_PATH.".htaccess");
+ @unlink(INSTALL_DIR."dist/.htaccess");
+ fputs( $fp,date( "d/m/Y H:m:s")." SO: Windows \n\n" );
+ }
+ else
+ fputs( $fp,date( "d/m/Y H:m:s")." SO: Linux \n\n" );
+
+ //muchas veces tarda demasiado por lo que es prudente ponerle un infinito tiempo de ejecucion
+ set_time_limit(0);
+
+
+
+
+ $f_phpversion = function_exists ("phpversion");
+ $f_apache_get_version = function_exists ("apache_get_version");
+ $f_get_magic_quotes_gpc = function_exists ("get_magic_quotes_gpc");
+ $f_mysql_module = function_exists ("mysql_connect");
+
+ $msg_phpversion = "";
+ $msg_apache_get_version = "";
+ $msg_mysql_module = "";
+ $msg_mod_rewrite = "";
+ $msg_get_magic_quotes_gpc = "";
+
+ $bool_mysql_module = false;
+ $bool_phpversion = false;
+ $bool_apache_get_version = false;
+ $bool_gd = estaExtensionPHP("gd");
+ $bool_mod_rewrite = false;
+ $bool_get_magic_quotes_gpc = false;
+
+ $memory_limit = ini_get('memory_limit');
+ if($memory_limit != '') {
+ $bool_memory_limit = compruebaMemoriaMaxima($memory_limit);
+ $bool_memory_no_chequeo = true;
+ } else {
+ $bool_memory_limit = true;
+ $memory_limit = "No se pudo conocer la cantidad de memoria disponible en su PHP.";
+ $bool_memory_no_chequeo = false;
+ }
+ fputs( $fp,date( "d/m/Y H:m:s")." memory_limit: $memory_limit\n\n" );
+
+ $bool_cache = tienePermisoEscritura(ALBA_PATH."cache");
+ $bool_log = tienePermisoEscritura(ALBA_PATH."log");
+ $bool_upload = tienePermisoEscritura(ALBA_WEB."uploads");
+ $bool_tmp = tienePermisoEscritura(ALBA_WEB."tmp");
+ $bool_config = tienePermisoEscritura(ALBA_PATH."config");
+
+ if($f_phpversion) {
+ $bool_phpversion = compruebaVersion(phpversion(),PHP_REQUIRED_VERSION);
+ $msg_phpversion = "Su versión de PHP es ".phpversion();
+ } else {
+ $msg_phpversion = "No se pudo verificar la versión de PHP";
+
+ }
+ fputs( $fp,date( "d/m/Y H:m:s")." phpversion: $msg_phpversion\n\n" );
+
+ if($f_apache_get_version) {
+ preg_match('!Apache/(.*) !U', apache_get_version(), $v);
+ $apache_installed_version = $v[1];
+ $bool_apache_get_version = compruebaVersion($apache_installed_version, APACHE_REQUIRED_VERSION);
+ $msg_apache_get_version = "Su versión de APACHE es ".$apache_installed_version;
+ $bool_mod_rewrite = estaExtensionApache("mod_rewrite");
+
+ if($bool_mod_rewrite) {
+ $msg_mod_rewrite = "";
+ } else {
+ $msg_mod_rewrite = "Por favor instale el mod_rewrite en el apache";
+ }
+
+ } else {
+ $msg_apache_get_version = "No se pudo verificar la versión de APACHE";
+ $msg_mod_rewrite = "( Al no poder verificar la versión de APACHE, tampoco pudo hacerlo para el mod_rewrite )";
+ }
+ fputs( $fp,date( "d/m/Y H:m:s")." apache_get_version: $msg_apache_get_version\n\n" );
+ fputs( $fp,date( "d/m/Y H:m:s")." mod_rewrite: $msg_mod_rewrite\n\n" );
+
+ if($f_mysql_module) {
+ $bool_mysql_module = true;
+ $msg_mysql_module = "Tiene instalado el modulo MYSQL en PHP";
+ } else
+ $msg_mysql_module = "No tiene instalado el modulo MYSQL en PHP";
+
+ fputs( $fp,date( "d/m/Y H:m:s")." mysql_module: $msg_mysql_module\n\n" );
+
+ if($f_get_magic_quotes_gpc) {
+ $bool_get_magic_quotes_gpc = get_magic_quotes_gpc();
+ if(!$bool_get_magic_quotes_gpc) {
+ $bool_get_magic_quotes_gpc = true;
+ $msg_get_magic_quotes_gpc = "";
+ } else {
+ $msg_get_magic_quotes_gpc = "Tiene que cambiar el valor de la variable magic_quotes_gpc de On a Off";
+ }
+ } else {
+ $msg_get_magic_quotes_gpc = " No se pudo verificar si usted tiene (magic_quotes_gpc = off) en el php.ini";
+ }
+ fputs( $fp,date( "d/m/Y H:m:s")." magic_quotes: $msg_get_magic_quotes_gpc\n\n" );
+
+ $hasErrors = false;
+ $aError = array();
+ $aDb = array( 'server' => '', 'user' => '', 'password' => '', 'name' => '', 'createdb' => '' ) ;
+
+ if(!file_exists(SQL_CREATE)) {
+ $hasErrors = true;
+ $aError['sql_files'] = 'El archivo para el SQL no puede abrirse';
+ fputs( $fp,date( "d/m/Y H:m:s")." SQL_CREATE: ".$aError['sql_files']."\n\n" );
+ }
+ else
+ fputs( $fp,date( "d/m/Y H:m:s")." SQL_CREATE: OK \n\n" );
+
+ if(!file_exists(SQL_INSERT_INICIAL)){
+ $hasErrors = true;
+ $aError['sql_files'] = 'El archivo para el SQL no puede abrirse';
+ fputs( $fp,date( "d/m/Y H:m:s")." SQL_INSERT_INICIAL: ".$aError['sql_files']."\n\n" );
+ }
+ else
+ fputs( $fp,date( "d/m/Y H:m:s")." SQL_INSERT_INICIAL: OK \n\n" );
+
+ if(!file_exists(SQL_INSERT_EJEMPLO)){
+ $hasErrors = true;
+ $aError['sql_files'] = 'El archivo para el SQL no puede abrirse';
+ fputs( $fp,date( "d/m/Y H:m:s")." SQL_INSERT_EJEMPLO: ".$aError['sql_files']."\n\n" );
+ }
+ else
+ fputs( $fp,date( "d/m/Y H:m:s")." SQL_INSERT_EJEMPLO: OK \n\n" );
+
+ fputs( $fp,date( "d/m/Y H:m:s")." ---- FIN DE VERIFICACIONES ----\n\n" );
+ fputs( $fp,date( "d/m/Y H:m:s")." ---- INICIO DB ----\n\n" );
+ if ($_SERVER['REQUEST_METHOD'] == "POST") {
+
+ if(!isset($_POST['db']['createdb']))
+ $_POST['db']['createdb'] = false;
+
+ $db_connection = @mysql_connect( $_POST['db']['server'], $_POST['db']['user'], $_POST['db']['password']);
+ if ($db_connection) {
+ $mysql_server_version = mysql_get_server_info();
+ fputs( $fp,date( "d/m/Y H:m:s")." mysql_server_version: ".$mysql_server_version ."\n\n" );
+ if(compruebaVersion($mysql_server_version, MYSQL_REQUIRED_VERSION)) {
+ if($_POST['db']['createdb']) {
+ fputs( $fp,date( "d/m/Y H:m:s")." -- Create DB --\n\n" );
+ if(!@mysql_query('CREATE DATABASE '.$_POST['db']['name'].' DEFAULT CHARACTER SET utf8 COLLATE utf8_bin')) {
+ $hasErrors = true;
+ $aError['newdb'] = 'No se pudo crear la base de datos ('.mysql_error().')';
+ fputs( $fp,date( "d/m/Y H:m:s")." newdb: ".$aError['newdb']."\n\n" );
+ $aDb = array( 'server' => $_POST['db']['server'] , 'user' => $_POST['db']['user'], 'password' => $_POST['db']['password'], 'name' => $_POST['db']['name'], 'createdb' => $_POST['db']['createdb']) ;
+ } else {
+ fputs( $fp,date( "d/m/Y H:m:s")." Se creo la base de datos OK--\n\n" );
+ if(doInstall($fp)) {
+ fputs( $fp,date( "d/m/Y H:m:s")." Fin doInstall (create_db): OK \n\n" );
+ fclose( $fp );
+ header("Location: ".REDIRECT_URL);
+ } else {
+ fputs( $fp,date( "d/m/Y H:m:s")." Fin doInstall (create_db): con Error \n\n" );
+ if (!@mysql_query('DROP DATABASE '.$_POST['db']['name'])){
+ $aError['insert_create'] = 'No se pudo eliminar la base de datos creada ('.mysql_error().')';
+ fputs( $fp,date( "d/m/Y H:m:s")." insert_create (create_db): ".$aError['insert_create']."\n\n" );
+ }
+ else {
+ $aError['insert_create'] = 'Se elimino la base de datos creada ('.mysql_error().')';
+ fputs( $fp,date( "d/m/Y H:m:s")." insert_create (create_db): ".$aError['insert_create']."\n\n" );
+ }
+ $hasErrors = true;
+ }
+ }
+ } else {
+ fputs( $fp,date( "d/m/Y H:m:s")." -- Select DB --\n\n" );
+ if(@mysql_select_db($_POST['db']['name'])) {
+ if(doInstall($fp)) {
+ fputs( $fp,date( "d/m/Y H:m:s")." Fin doInstall (select_db): OK \n\n" );
+ fclose( $fp );
+ header("Location: ".REDIRECT_URL);
+ } else {
+ $aError['insert_create'] = 'No se pudo agregar los datos a la base de datos existente ('.mysql_error().')';
+ fputs( $fp,date( "d/m/Y H:m:s")." insert_create (select_db): ".$aError['insert_create']."\n\n" );
+ $hasErrors = true;
+ }
+ } else {
+ $hasErrors = true;
+ $aError['currentdb'] = 'No se pudo usar la base de datos ('.mysql_error().')';
+ fputs( $fp,date( "d/m/Y H:m:s")." currentdb (select_db): ".$aError['currentdb']."\n\n" );
+ $aDb = array( 'server' => $_POST['db']['server'] , 'user' => $_POST['db']['user'], 'password' => $_POST['db']['password'], 'name' => $_POST['db']['name'], 'createdb' => $_POST['db']['createdb']) ;
+ }
+ }
+ } else {
+ $hasErrors = true;
+ $aError['mysql_version'] = 'Usted tiene una versión de MYSQL inferior a la'.MYSQL_REQUIRED_VERSION. '(Su versión actual es '.$mysql_server_version. ')';
+ fputs( $fp,date( "d/m/Y H:m:s")." mysql_server_version: ".$aError['mysql_version']."\n\n" );
+ $aDb = array( 'server' => $_POST['db']['server'] , 'user' => $_POST['db']['user'], 'password' => $_POST['db']['password'], 'name' => $_POST['db']['name'], 'createdb' => $_POST['db']['createdb'] );
+ }
+
+ mysql_close($db_connection);
+ } else {
+ $hasErrors = true;
+ $aError['connect'] = 'No pudo conectarse al Servidor de Base de datos ('.mysql_error().')';
+ fputs( $fp,date( "d/m/Y H:m:s")." connect: ".$aError['connect']."\n\n" );
+ $aDb = array( 'server' => $_POST['db']['server'] , 'user' => $_POST['db']['user'], 'password' => $_POST['db']['password'], 'name' => $_POST['db']['name'], 'createdb' => $_POST['db']['createdb'] );
+ }
+
+ }
+ fclose( $fp );
+?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/2000/REC-xhtml1-200000126/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <meta http-equiv="content-type" content="text/html; charset=utf-8" />
+ <meta name="title" content="Proyecto ALBA" />
+ <meta name="robots" content="index, follow" />
+ <meta name="description" content="Proyecto de Gestión Educativa ALBA" />
+ <meta name="keywords" content="alba, proyecto, software libre, educacion" />
+ <meta name="language" content="es" />
+ <title>Proyecto ALBA</title>
+ <link rel="stylesheet" type="text/css" href="installer/css/main.css"/>
+</head>
+
+<body>
+<div id ="sf_admin_container">
+<h2>Verificaciones necesarias para la instalación</h2>
+<br>
+<h2>Programas</h2>
+
+<table border="0" cellpadding="3" width="600" class="sf_admin_list">
+ <thead>
+ <tr>
+ <th id="sf_admin_list_th_verfica">Verificación</th>
+ <th id="sf_admin_list_th_resultado">Resultado</th>
+ </tr>
+ </thead>
+ <tr class="sf_admin_row_0" >
+ <td>Versión de PHP >= 5.0.0</td>
+ <td>
+ <?=($bool_phpversion)?IMG_OK:IMG_NOT_OK?>(<?=$msg_phpversion?>)
+ </td>
+ </tr>
+
+ <tr class="sf_admin_row_1" >
+ <td>¿ Esta instalado MYSQL en PHP ?</td>
+ <td>
+ <?=($bool_mysql_module)?IMG_OK:IMG_NOT_OK?>(<?=$msg_mysql_module?>)
+ </td>
+ </tr>
+
+
+ <tr class="sf_admin_row_0">
+ <td>¿ Esta Instalado GD en PHP ? (optativo) </td>
+ <td><?=($bool_gd)?IMG_OK:IMG_NOT_OK." (Si queres ver los gráficos de estadísticas necesitas instalar GD - http://www.php.net/manual/es/ref.image.php)";?></td>
+ </tr>
+
+ <tr class="sf_admin_row_1">
+ <td>En php.ini memory_limit >= 32</td>
+ <td><?=($bool_memory_limit AND $bool_memory_no_chequeo)?IMG_OK:IMG_NOT_OK;?>(<?=$memory_limit?>)</td>
+ </tr>
+
+ <tr class="sf_admin_row_1">
+ <td>En php.ini magic_quotes_gpc = off</td>
+ <td><?=($bool_get_magic_quotes_gpc)?IMG_OK:IMG_NOT_OK;?><?=$msg_get_magic_quotes_gpc?></td>
+ </tr>
+
+
+
+ <tr class="sf_admin_row_0">
+ <td>Versióon de APACHE >= 2.0</td>
+ <td><?=($bool_apache_get_version)?IMG_OK:IMG_NOT_OK?>(<?=$msg_apache_get_version?>)</td>
+ </tr>
+
+ <tr class="sf_admin_row_1">
+ <td>¿ Esta instalado MOD_REWRITE en APACHE ?</td>
+ <td><?=($bool_mod_rewrite)?IMG_OK:IMG_NOT_OK.$msg_mod_rewrite?></td>
+ </tr>
+
+</table>
+<br>
+<h2>Directorios con permisos para escritura:</h2>
+<table border="0" cellpadding="3" width="600" class="sf_admin_list">
+ <thead>
+ <tr>
+ <th id="sf_admin_list_th_dir">Directorios</th>
+ <th id="sf_admin_list_th_resultado">Resultados</th>
+ </tr>
+ </thead>
+ <tr class="sf_admin_row_0" >
+ <td>/cache</td>
+ <td><?=($bool_cache)?IMG_OK:IMG_NOT_OK." (chmod 777 ./alba/cache)";?></td>
+ </tr>
+ <tr class="sf_admin_row_1">
+ <td>/log</td>
+ <td><?=($bool_log)?IMG_OK:IMG_NOT_OK." (chmod 777 ./alba/logs)";?></td>
+ </tr>
+ <tr class="sf_admin_row_0">
+ <td>/uploads</td>
+ <td><?=($bool_upload)?IMG_OK:IMG_NOT_OK." (chmod 777 ./alba/web/uploads)";?></td>
+ </tr>
+ <tr class="sf_admin_row_1">
+ <td>/config</td>
+ <td><?=($bool_config)?IMG_OK:IMG_NOT_OK." (chmod 777 ./alba/config)";?></td>
+<?php // Aqui no deberiamos probar si tienen permisos los archivos databases.yml, propel.ini y web/.htaccess ?>
+ </tr>
+ <tr class="sf_admin_row_0">
+ <td>/tmp</td>
+ <td><?=($bool_tmp)?IMG_OK:IMG_NOT_OK." (chmod 777 ./alba/web/tmp)";?></td>
+ </tr>
+
+</table>
+
+<?php if($bool_config AND $bool_upload AND $bool_tmp 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 AND $bool_get_magic_quotes_gpc) { ?>
+
+<?php if($hasErrors) { ?>
+ <br><br>
+ <div class="form-errors">
+ <h2>Arreglar errores para continuar</h2>
+ <ul>
+ <?php foreach ($aError as $idx => $name) { ?>
+ <li><?php echo $name; ?></li>
+ <?php } ?>
+ </ul>
+ </div>
+<?php } ?>
+
+
+
+<br>
+<h2>Datos para la instalación</h2>
+<form action="<?=$_SERVER['PHP_SELF']?>" method="POST" >
+ <fieldset id="sf_fieldset_base_de_datos" class="">
+ <h2>Conección a la base de datos</h2>
+ <div class="form-row">
+ <label for="db_server" class="required">Servidor:</label><div class="content"><input type="text" name="db[server]" value="<?=$aDb['server']?>" size="64" /></div>
+ </div>
+ <div class="form-row">
+ <label for="db_user" class="required">Usuario:</label><div class="content"><input type="text" name="db[user]" value="<?=$aDb['user']?>" size="64" /></div>
+ </div>
+ <div class="form-row">
+ <label for="db_password" class="required">Contraseña:</label><div class="content"><input type="password" name="db[password]" value="<?=$aDb['password']?>" size="64" /></div>
+ </div>
+ <div class="form-row">
+ <label for="db_name" class="required">Nombre de base de datos:</label><div class="content"><input type="text" name="db[name]" value="<?=$aDb['name']?>" size="64" />
+ Crear Base de datos <input type="checkbox" name="db[createdb]" value="crear" <?=($aDb['createdb'])?'checked':''?>>
+ </div>
+
+ <div class="form-row">
+ <label for="db_name" class="required">¿Que datos quiere por defecto?:</label>
+ <div class="content">
+ Datos mínimos<input type="radio" name="db[datos]" value="minimos" checked >
+ Caso de Ejemplo<input type="radio" name="db[datos]" value="ejemplo">
+ </div>
+ </div>
+ </fieldset>
+
+ <ul class="sf_admin_actions">
+ <li><input type="submit" name="instalar" value="Instalar" class="sf_admin_action_instalar" /></li>
+ <li><input type="reset" name="borrar" value="Borrar" class="sf_admin_action_borrar" /></li>
+ </ul>
+</form>
+<? } else { ?>
+<br>
+<div align="center"><h2 style="color: #FF0000;">Para poder seguir con la instalción debe pasar completa la verificación.</h2></div>
+<? } ?>
+</div>
+</body>
+</html>
+
+
+<?
+// si existe el archivo de flag para la instacion
+} else { ?>
+<html>
+<body>
+Usted ya ha instalado el Proyetco ALBA. Si quiere volver a instalarlo debe borra el archivo alba/log/instalacion_completa.
+</body>
+</html>
+<? } ?>
+
+
+<?php
+
+/**
+* Funciones del instalador
+*/
+
+function compruebaVersion($instalada, $requireda) {
+ return (version_compare($instalada, $requireda, ">="));
+}
+
+
+function compruebaMemoriaMaxima($php_memory) {
+ $memory_limit = eregi_replace('[gmk]','',$php_memory);
+ return ($memory_limit >= MEMORY_LIMIT_REQUIRED);
+
+}
+
+function estaExtensionPHP($ext) {
+ $aExtension = get_loaded_extensions();
+ if(count($aExtension)>0) {
+ $res = array_search($ext, $aExtension);
+ if($res === false) {
+ return false;
+ } else {
+ return true;
+ }
+ } else {
+ return false;
+ }
+}
+
+
+function estaExtensionApache($ext) {
+ $aApacheModulos = apache_get_modules();
+ if(count($aApacheModulos)>0) {
+ $res = array_search($ext, $aApacheModulos);
+ if($res === false) {
+ return false;
+ } else {
+ return true;
+ }
+ } else {
+ return false;
+ }
+}
+
+
+function tienePermisoEscritura($dir) {
+ $octalPermiso = substr(sprintf('%o', @fileperms($dir)), -4);
+ return ($octalPermiso == "0777" OR $octalPermiso == "1777");
+}
+
+
+function reemplzarArchivo($archivo, $aReemplazo) {
+ $contenido = "";
+ if(file_exists($archivo)) {
+ $contenido = file_get_contents ($archivo);
+ foreach($aReemplazo as $indice => $reemplazo) {
+ $contenido = str_replace($indice, $reemplazo, $contenido);
+ }
+ }
+ return $contenido;
+}
+
+
+
+// ojo que esto no funciona para cualquier cosa si dentro de un string de un insert hay un dato con ;\n se separa por eso tambien
+function dump2Array($file) {
+ $aSql = array();
+ $res_sql = "";
+ if(file_exists($file)) {
+ $sql = file($file);
+ foreach($sql as $sql_line) {
+ $sql_line = trim($sql_line);
+ if (($sql_line != "") && (substr($sql_line, 0, 2) != "--") && (substr($sql_line, 0, 1) != "#") ) {
+ $res_sql .= $sql_line."\n";
+ }
+ }
+ $aSql= array_slice(explode(";\n", $res_sql),0,-1);
+ }
+ return $aSql;
+}
+
+function executeDump($file, $db,$fp) {
+ fputs( $fp,date( "d/m/Y H:m:s")." Entrando ExecuteDump: $file - $db \n\n" );
+ $aSql = dump2Array($file);
+ $error = false;
+ if(count($aSql) > 0 AND file_exists($file)) {
+ if(mysql_select_db($db)) {
+ fputs( $fp,date( "d/m/Y H:m:s")." ejecutando BEGIN \n\n" );
+ mysql_query("BEGIN");
+ foreach($aSql as $sql_line) {
+ $res = mysql_query(trim($sql_line));
+ if(!$res) {
+ fputs( $fp,date( "d/m/Y H:m:s")." Fallo SQL: $sql_line \n\n" );
+ fputs( $fp,date( "d/m/Y H:m:s")." error:". mysql_error()." \n\n" );
+ $error = true;
+ }
+ }
+ if($error == true) {
+ fputs( $fp,date( "d/m/Y H:m:s")." Se encontraron errores ejecutando ROLLBACK y saliendo \n\n" );
+ mysql_query("ROLLBACK");
+ return false;
+ } else {
+ fputs( $fp,date( "d/m/Y H:m:s")." Sin errores ejecutando COMMIT y saliendo \n\n" );
+ mysql_query("COMMIT");
+ return true;
+ }
+ }
+ else {
+ fputs( $fp,date( "d/m/Y H:m:s")." Error al seleccionar la base: $db \n\n" );
+ return false;
+ }
+ } else {
+ fputs( $fp,date( "d/m/Y H:m:s")." Devuele false no ejecuta nada : $db \n\n" );
+ return false;
+ }
+
+}
+
+function doInstall($fp) {
+ global $_POST;
+ fputs( $fp,date( "d/m/Y H:m:s")." Entrando doInstall() \n\n" );
+ //verifica que base de datos instalar si la del ejemplo o solamente la
+ //de los datos_desde_cero iniciales
+ switch($_POST['db']['datos']) {
+ case "ejemplo": $sql_insert = SQL_INSERT_INICIAL; break;
+ case "minimos": $sql_insert = SQL_INSERT_EJEMPLO; break;
+ default: $sql_insert = SQL_INSERT_EJEMPLO;
+ }
+ fputs( $fp,date( "d/m/Y H:m:s")." Utilizando SQL: $sql_insert \n\n" );
+ if(executeDump(SQL_CREATE, $_POST['db']['name'],$fp)) {
+ if(executeDump($sql_insert, $_POST['db']['name'],$fp)) {
+ $aReemplazo = array( 'USERDB' => $_POST['db']['user'], 'PASSDB' => $_POST['db']['password'], 'SERVER' => $_POST['db']['server'], 'DBNAME'=> $_POST['db']['name']);
+ $contenido_archivo = reemplzarArchivo(DATABASE_CONFIG_DIST,$aReemplazo);
+ file_put_contents(DATABASE_CONFIG, $contenido_archivo);
+
+ $aReemplazo = array( 'USERDB' => $_POST['db']['user'], 'PASSDB' => $_POST['db']['password'], 'SERVER' => $_POST['db']['server'], 'DBNAME'=> $_POST['db']['name']);
+ $contenido_archivo = reemplzarArchivo(PROPEL_CONFIG_DIST,$aReemplazo);
+ file_put_contents(PROPEL_CONFIG, $contenido_archivo);
+
+
+ _symlink(INSTALL_DIR."dist/".SYMFONY_DIR."/data/", ALBA_PATH."data/symfony");
+ _symlink(INSTALL_DIR."dist/pake/", ALBA_PATH."lib/pake");
+ _symlink(INSTALL_DIR."dist/phing.sandbox/", ALBA_PATH."lib/phing");
+ _symlink(INSTALL_DIR."dist/".SYMFONY_DIR."/lib/", ALBA_PATH."lib/symfony");
+ _symlink(INSTALL_DIR."alba/data/symfony/web/sf/", ALBA_WEB."sf");
+ fputs( $fp,date( "d/m/Y H:m:s")." Creando Links \n\n" );
+
+ $rewrite_path = (OS_WINDOWS)?CURRENT_WEB_DIR.SYMFONY_WINDOWS_WEB_DIR:CURRENT_WEB_DIR.SYMFONY_WEB_DIR;
+
+ if(!OS_WINDOWS)
+ _symlink(ALBA_WEB, INSTALL_DIR.SYMFONY_WEB_DIR); // crea nuevo link afuera de la estructura de alba
+
+ $aReemplazo = Array('REWRITE_PATH' => $rewrite_path);
+ $contenido_archivo = reemplzarArchivo(HTACCESS_DIST,$aReemplazo);
+ file_put_contents(HTACCESS, $contenido_archivo);
+ touch(INSTALL_COMPLETE_FILE);
+ fputs( $fp,date( "d/m/Y H:m:s")." Creando bandera INSTALL_COMPLETE_FILE \n\n" );
+ return true;
+ }
+ fputs( $fp,date( "d/m/Y H:m:s")." Fallo ejecutando: $sql_insert \n\n" );
+ return false;
+ } else {
+ fputs( $fp,date( "d/m/Y H:m:s")." Fallo ejecutando: SQL_CREATE \n\n" );
+ return false;
+ }
+
+}
+
+
+function doUninstall() {
+
+}
+
+function _symlink( $target, $link ) {
+ if (OS_WINDOWS) {
+ @dircopy($target, $link);
+ } else {
+ @symlink($target,$link);
+ }
+}
+
+
+function dircopy($srcdir, $dstdir, $verbose = false) {
+ $num = 0;
+ if(!is_dir($dstdir)) mkdir($dstdir);
+ if($curdir = opendir($srcdir)) {
+ while($file = readdir($curdir)) {
+ if($file != '.' && $file != '..') {
+ $srcfile = $srcdir . DIRECTORY_SEPARATOR . $file;
+ $dstfile = $dstdir . DIRECTORY_SEPARATOR . $file;
+ if(is_file($srcfile)) {
+ if(is_file($dstfile)) $ow = filemtime($srcfile) - filemtime($dstfile); else $ow = 1;
+ if($ow > 0) {
+ if($verbose) echo "Copying '$srcfile' to '$dstfile'...";
+ if(copy($srcfile, $dstfile)) {
+ touch($dstfile, filemtime($srcfile)); $num++;
+ if($verbose) echo "OK\n";
+ }
+ else echo "Error: File '$srcfile' could not be copied!\n";
+ }
+ }
+ else if(is_dir($srcfile)) {
+ $num += dircopy($srcfile, $dstfile, $verbose);
+ }
+ }
+ }
+ closedir($curdir);
+ }
+ return $num;
+}
+?>
\ No newline at end of file
Property changes on: prosistem/alba/trunk/alba/web/instalar.old.php
___________________________________________________________________
Name: svn:keywords
+ "Id Author URL Date Rev"
1
0
#239: Error 500 .-
----------------------+-----------------------------------------------------
Reporter: albertux | Owner: somebody
Type: defecto | Status: new
Priority: normal | Milestone:
Component: alba | Version:
Severity: normal | Keywords:
----------------------+-----------------------------------------------------
Error 500 en "Administración / General / Definir Organización" ... "Objeto
no Encontrado"
--
Ticket URL: <http://alba.pressenter.com.ar/cgi-bin/trac.cgi/ticket/239>
Pressenter - SVN Alba <http://wwww.proyectoalba.com.ar/>
Proyecto Alba - Sistema Informático Abierto de Gestión Unificada para Unidades Educacionales
1
2
#241: Error 500 .-
-----------------------+----------------------------------------------------
Reporter: albertux | Owner: ftoledo
Type: defecto | Status: new
Priority: normal | Milestone:
Component: alba-demo | Version: demo
Severity: normal | Keywords:
-----------------------+----------------------------------------------------
Error 500 encontrado en :
500 - Error Módulo no Encontrado
--
Ticket URL: <http://alba.pressenter.com.ar/cgi-bin/trac.cgi/ticket/241>
Pressenter - SVN Alba <http://wwww.proyectoalba.com.ar/>
Proyecto Alba - Sistema Informático Abierto de Gestión Unificada para Unidades Educacionales
1
3
06 Aug '07
Author: ftoledo
Date: 2007-08-06 17:03:59 -0300 (Mon, 06 Aug 2007)
New Revision: 4921
Added:
prosistem/alba/trunk/alba/web/instalar/images/
Removed:
prosistem/alba/trunk/alba/web/instalar/installer/
Log:
renombrando las imagenes dentro del directorio de instalacion
quedan adentro, de esta forma se puede eliminar el directorio
luego de la instalacion
Copied: prosistem/alba/trunk/alba/web/instalar/images (from rev 4920, prosistem/alba/trunk/alba/web/instalar/installer)
1
0
SVN Alba r4920 - in prosistem/alba/trunk/alba/web: . images instalar
by commits@pressenter.com.ar 06 Aug '07
by commits@pressenter.com.ar 06 Aug '07
06 Aug '07
Author: ftoledo
Date: 2007-08-06 17:02:30 -0300 (Mon, 06 Aug 2007)
New Revision: 4920
Added:
prosistem/alba/trunk/alba/web/instalar/
prosistem/alba/trunk/alba/web/instalar/instalar.php
prosistem/alba/trunk/alba/web/instalar/installer/
prosistem/alba/trunk/alba/web/instalar/paso1.php
Removed:
prosistem/alba/trunk/alba/web/images/installer/
Modified:
prosistem/alba/trunk/alba/web/instalar.php
Log:
ordenando el instalador
Added: prosistem/alba/trunk/alba/web/instalar/instalar.php
===================================================================
--- prosistem/alba/trunk/alba/web/instalar/instalar.php 2007-08-06 19:43:40 UTC (rev 4919)
+++ prosistem/alba/trunk/alba/web/instalar/instalar.php 2007-08-06 20:02:30 UTC (rev 4920)
@@ -0,0 +1,78 @@
+<?php
+/**
+ * This file is part of Alba.
+ *
+ * Alba is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * Alba is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Alba; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+/**
+ * instalador
+ *
+ * @package alba
+ * @author José Luis Di Biase <josx(a)interorganic.com.ar>
+ * @author Héctor Sanchez <hsanchez(a)pressenter.com.ar>
+ * @author Fernando Toledo <ftoledo(a)pressenter.com.ar>
+ * @version SVN: $Id: instalar.php 4883 2007-07-30 21:41:42Z ftoledo $
+ * @filesource
+ * @license GPL
+ */
+
+session_start();
+
+define ('ALBA_INSTALLER',1);
+
+define ('IMG_OK','<img src="images/ok.png">');
+define ('IMG_ERROR' '<img src="images/error.png>');
+
+
+if (!isset($_SESSION['instalador']['paso']))
+ $paso = 1;
+else
+ $paso = $_SESSION['instalador']['paso'];
+?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/2000/REC-xhtml1-200000126/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="es" lang="es">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <meta name="title" content="Proyecto ALBA" />
+ <meta name="robots" content="index, follow" />
+ <meta name="description" content="Proyecto de Gestión Educativa ALBA" />
+ <meta name="keywords" content="alba, proyecto, software libre, educacion" />
+ <meta name="language" content="es" />
+ </head>
+ <body>
+ <div id="cabeza">
+ <h1>Instalación de ALBA</h1>
+ <p>Antes de continuar con la instalacion, es necesario comprobar los permisos
+ de algunos directorios en particular:</p>
+ </div>
+
+ <div id="contenido">
+ <?php
+ switch ($paso) {
+ case 1:
+ include ("instalar/paso1.php");
+ break;
+ case 2:
+ include ("instalar/paso2.php");
+ break;
+ case 3:
+ include ("instalar/paso3.php");
+ break;
+ }
+ ?>
+ </div>
+ </body>
+</html>
+
Property changes on: prosistem/alba/trunk/alba/web/instalar/instalar.php
___________________________________________________________________
Name: svn:keywords
+ "Id Author URL Date Rev"
Copied: prosistem/alba/trunk/alba/web/instalar/installer (from rev 4912, prosistem/alba/trunk/alba/web/images/installer)
Added: prosistem/alba/trunk/alba/web/instalar/paso1.php
===================================================================
--- prosistem/alba/trunk/alba/web/instalar/paso1.php 2007-08-06 19:43:40 UTC (rev 4919)
+++ prosistem/alba/trunk/alba/web/instalar/paso1.php 2007-08-06 20:02:30 UTC (rev 4920)
@@ -0,0 +1,52 @@
+<?php
+/**
+ * This file is part of Alba.
+ *
+ * Alba is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * Alba is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Alba; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+
+/**
+ * instalador
+ *
+ * @package alba
+ * @author José Luis Di Biase <josx(a)interorganic.com.ar>
+ * @author Héctor Sanchez <hsanchez(a)pressenter.com.ar>
+ * @author Fernando Toledo <ftoledo(a)pressenter.com.ar>
+ * @version SVN: $Id: instalar.php 4883 2007-07-30 21:41:42Z ftoledo $
+ * @filesource
+ * @license GPL
+ */
+
+function permisos($dir) {
+ $octalPermiso = substr(sprintf('%o', @fileperms($dir)), -4);
+ return ($octalPermiso == "0777" OR $octalPermiso == "1777");
+}
+
+$dirs = array(
+ 'config',
+ 'cache',
+ 'log',
+ 'web' . DIRECTORY_SEPARATOR . 'tmp',
+ 'web' . DIRECTORY_SEPARATOR. 'uploads',
+ 'web' . DIRECTORY_SEPARATOR. 'uploads' .DIRECTORY_SEPARATOR. 'assets',
+);
+
+?>
+<ul>
+<?php foeach($dirs as $dir):?>
+ <li>Comprobando permisos en: <?php echo $dir?> <?php permiso($dir) : IMG_OK : IMG_ERROR </li>
+<?php endforeach;?>
+</ul>
\ No newline at end of file
Property changes on: prosistem/alba/trunk/alba/web/instalar/paso1.php
___________________________________________________________________
Name: svn:keywords
+ "Id Author URL Date Rev"
Modified: prosistem/alba/trunk/alba/web/instalar.php
===================================================================
--- prosistem/alba/trunk/alba/web/instalar.php 2007-08-06 19:43:40 UTC (rev 4919)
+++ prosistem/alba/trunk/alba/web/instalar.php 2007-08-06 20:02:30 UTC (rev 4920)
@@ -1,4 +1,4 @@
-<?php
+<?php
/**
* This file is part of Alba.
*
@@ -16,8 +16,6 @@
* along with Alba; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
/**
* instalador
*
@@ -29,627 +27,6 @@
* @filesource
* @license GPL
*/
-
- define("OS_WINDOWS",((strtoupper(substr(PHP_OS,0,3))=='WIN'))?true:false);
-
- define("APACHE_REQUIRED_VERSION","2.0.0");
- define("PHP_REQUIRED_VERSION","5.0.0");
- define("MEMORY_LIMIT_REQUIRED", "16");
- define("MYSQL_REQUIRED_VERSION","4.1.0");
-
- define("INSTALL_DIR", realpath(dirname(__FILE__) . DIRECTORY_SEPARATOR . ".." . DIRECTORY_SEPARATOR). DIRECTORY_SEPARATOR);
- define("DEBUG_LOG",INSTALL_DIR."log".DIRECTORY_SEPARATOR."install.log");
- define("ALBA_WEB",INSTALL_DIR."web" . DIRECTORY_SEPARATOR);
- define("ALBA_CONFIG", INSTALL_DIR."config".DIRECTORY_SEPARATOR);
-
- define("APACHE_CONFIG_DIST", ALBA_CONFIG."apache.conf.dist");
- define("DATABASE_CONFIG_DIST", ALBA_CONFIG."databases.yml.dist");
- define("PROPEL_CONFIG_DIST", ALBA_CONFIG."propel.ini.dist");
- define("HTACCESS_DIST", ALBA_WEB.".htaccess.dist");
-
- define("DATABASE_CONFIG", ALBA_CONFIG."databases.yml");
- define("PROPEL_CONFIG", ALBA_CONFIG."propel.ini");
- define("HTACCESS", ALBA_WEB.".htaccess");
- define("SCHEMA", ALBA_CONFIG."schema.yml");
-
-
- define("IMG_OK", "<img src='images/installer/save.png'>");
- define("IMG_NOT_OK", "<img src='images/installer/delete.png'>");
-
- define("SQL_CREATE_DB", INSTALL_DIR."data".DIRECTORY_SEPARATOR."sql".DIRECTORY_SEPARATOR."create-db.sql");
- define("SQL_CREATE", INSTALL_DIR."data".DIRECTORY_SEPARATOR."sql".DIRECTORY_SEPARATOR."lib.model.schema.sql");
- define("SQL_INSERT_INICIAL", INSTALL_DIR."data".DIRECTORY_SEPARATOR."sql".DIRECTORY_SEPARATOR."datos_desde_cero.sql");
- define("SQL_INSERT_EJEMPLO", INSTALL_DIR."data".DIRECTORY_SEPARATOR."sql".DIRECTORY_SEPARATOR."datos_ejemplo.sql");
-
- if(!file_exists(INSTALL_COMPLETE_FILE)) {
-
- $fp = fopen(DEBUG_LOG, "at" );
- fputs( $fp,date( "d/m/Y H:m:s")." ---- INICIO DE VERIFICACIONES ----\n\n" );
-
- if(OS_WINDOWS) {
- @unlink(ALBA_PATH.".htaccess");
- @unlink(INSTALL_DIR."dist/.htaccess");
- fputs( $fp,date( "d/m/Y H:m:s")." SO: Windows \n\n" );
- }
- else
- fputs( $fp,date( "d/m/Y H:m:s")." SO: Linux \n\n" );
-
- //muchas veces tarda demasiado por lo que es prudente ponerle un infinito tiempo de ejecucion
- set_time_limit(0);
-
-
-
-
- $f_phpversion = function_exists ("phpversion");
- $f_apache_get_version = function_exists ("apache_get_version");
- $f_get_magic_quotes_gpc = function_exists ("get_magic_quotes_gpc");
- $f_mysql_module = function_exists ("mysql_connect");
-
- $msg_phpversion = "";
- $msg_apache_get_version = "";
- $msg_mysql_module = "";
- $msg_mod_rewrite = "";
- $msg_get_magic_quotes_gpc = "";
-
- $bool_mysql_module = false;
- $bool_phpversion = false;
- $bool_apache_get_version = false;
- $bool_gd = estaExtensionPHP("gd");
- $bool_mod_rewrite = false;
- $bool_get_magic_quotes_gpc = false;
-
- $memory_limit = ini_get('memory_limit');
- if($memory_limit != '') {
- $bool_memory_limit = compruebaMemoriaMaxima($memory_limit);
- $bool_memory_no_chequeo = true;
- } else {
- $bool_memory_limit = true;
- $memory_limit = "No se pudo conocer la cantidad de memoria disponible en su PHP.";
- $bool_memory_no_chequeo = false;
- }
- fputs( $fp,date( "d/m/Y H:m:s")." memory_limit: $memory_limit\n\n" );
-
- $bool_cache = tienePermisoEscritura(ALBA_PATH."cache");
- $bool_log = tienePermisoEscritura(ALBA_PATH."log");
- $bool_upload = tienePermisoEscritura(ALBA_WEB."uploads");
- $bool_tmp = tienePermisoEscritura(ALBA_WEB."tmp");
- $bool_config = tienePermisoEscritura(ALBA_PATH."config");
-
- if($f_phpversion) {
- $bool_phpversion = compruebaVersion(phpversion(),PHP_REQUIRED_VERSION);
- $msg_phpversion = "Su versión de PHP es ".phpversion();
- } else {
- $msg_phpversion = "No se pudo verificar la versión de PHP";
-
- }
- fputs( $fp,date( "d/m/Y H:m:s")." phpversion: $msg_phpversion\n\n" );
-
- if($f_apache_get_version) {
- preg_match('!Apache/(.*) !U', apache_get_version(), $v);
- $apache_installed_version = $v[1];
- $bool_apache_get_version = compruebaVersion($apache_installed_version, APACHE_REQUIRED_VERSION);
- $msg_apache_get_version = "Su versión de APACHE es ".$apache_installed_version;
- $bool_mod_rewrite = estaExtensionApache("mod_rewrite");
-
- if($bool_mod_rewrite) {
- $msg_mod_rewrite = "";
- } else {
- $msg_mod_rewrite = "Por favor instale el mod_rewrite en el apache";
- }
-
- } else {
- $msg_apache_get_version = "No se pudo verificar la versión de APACHE";
- $msg_mod_rewrite = "( Al no poder verificar la versión de APACHE, tampoco pudo hacerlo para el mod_rewrite )";
- }
- fputs( $fp,date( "d/m/Y H:m:s")." apache_get_version: $msg_apache_get_version\n\n" );
- fputs( $fp,date( "d/m/Y H:m:s")." mod_rewrite: $msg_mod_rewrite\n\n" );
-
- if($f_mysql_module) {
- $bool_mysql_module = true;
- $msg_mysql_module = "Tiene instalado el modulo MYSQL en PHP";
- } else
- $msg_mysql_module = "No tiene instalado el modulo MYSQL en PHP";
-
- fputs( $fp,date( "d/m/Y H:m:s")." mysql_module: $msg_mysql_module\n\n" );
-
- if($f_get_magic_quotes_gpc) {
- $bool_get_magic_quotes_gpc = get_magic_quotes_gpc();
- if(!$bool_get_magic_quotes_gpc) {
- $bool_get_magic_quotes_gpc = true;
- $msg_get_magic_quotes_gpc = "";
- } else {
- $msg_get_magic_quotes_gpc = "Tiene que cambiar el valor de la variable magic_quotes_gpc de On a Off";
- }
- } else {
- $msg_get_magic_quotes_gpc = " No se pudo verificar si usted tiene (magic_quotes_gpc = off) en el php.ini";
- }
- fputs( $fp,date( "d/m/Y H:m:s")." magic_quotes: $msg_get_magic_quotes_gpc\n\n" );
-
- $hasErrors = false;
- $aError = array();
- $aDb = array( 'server' => '', 'user' => '', 'password' => '', 'name' => '', 'createdb' => '' ) ;
-
- if(!file_exists(SQL_CREATE)) {
- $hasErrors = true;
- $aError['sql_files'] = 'El archivo para el SQL no puede abrirse';
- fputs( $fp,date( "d/m/Y H:m:s")." SQL_CREATE: ".$aError['sql_files']."\n\n" );
- }
- else
- fputs( $fp,date( "d/m/Y H:m:s")." SQL_CREATE: OK \n\n" );
-
- if(!file_exists(SQL_INSERT_INICIAL)){
- $hasErrors = true;
- $aError['sql_files'] = 'El archivo para el SQL no puede abrirse';
- fputs( $fp,date( "d/m/Y H:m:s")." SQL_INSERT_INICIAL: ".$aError['sql_files']."\n\n" );
- }
- else
- fputs( $fp,date( "d/m/Y H:m:s")." SQL_INSERT_INICIAL: OK \n\n" );
-
- if(!file_exists(SQL_INSERT_EJEMPLO)){
- $hasErrors = true;
- $aError['sql_files'] = 'El archivo para el SQL no puede abrirse';
- fputs( $fp,date( "d/m/Y H:m:s")." SQL_INSERT_EJEMPLO: ".$aError['sql_files']."\n\n" );
- }
- else
- fputs( $fp,date( "d/m/Y H:m:s")." SQL_INSERT_EJEMPLO: OK \n\n" );
-
- fputs( $fp,date( "d/m/Y H:m:s")." ---- FIN DE VERIFICACIONES ----\n\n" );
- fputs( $fp,date( "d/m/Y H:m:s")." ---- INICIO DB ----\n\n" );
- if ($_SERVER['REQUEST_METHOD'] == "POST") {
-
- if(!isset($_POST['db']['createdb']))
- $_POST['db']['createdb'] = false;
-
- $db_connection = @mysql_connect( $_POST['db']['server'], $_POST['db']['user'], $_POST['db']['password']);
- if ($db_connection) {
- $mysql_server_version = mysql_get_server_info();
- fputs( $fp,date( "d/m/Y H:m:s")." mysql_server_version: ".$mysql_server_version ."\n\n" );
- if(compruebaVersion($mysql_server_version, MYSQL_REQUIRED_VERSION)) {
- if($_POST['db']['createdb']) {
- fputs( $fp,date( "d/m/Y H:m:s")." -- Create DB --\n\n" );
- if(!@mysql_query('CREATE DATABASE '.$_POST['db']['name'].' DEFAULT CHARACTER SET utf8 COLLATE utf8_bin')) {
- $hasErrors = true;
- $aError['newdb'] = 'No se pudo crear la base de datos ('.mysql_error().')';
- fputs( $fp,date( "d/m/Y H:m:s")." newdb: ".$aError['newdb']."\n\n" );
- $aDb = array( 'server' => $_POST['db']['server'] , 'user' => $_POST['db']['user'], 'password' => $_POST['db']['password'], 'name' => $_POST['db']['name'], 'createdb' => $_POST['db']['createdb']) ;
- } else {
- fputs( $fp,date( "d/m/Y H:m:s")." Se creo la base de datos OK--\n\n" );
- if(doInstall($fp)) {
- fputs( $fp,date( "d/m/Y H:m:s")." Fin doInstall (create_db): OK \n\n" );
- fclose( $fp );
- header("Location: ".REDIRECT_URL);
- } else {
- fputs( $fp,date( "d/m/Y H:m:s")." Fin doInstall (create_db): con Error \n\n" );
- if (!@mysql_query('DROP DATABASE '.$_POST['db']['name'])){
- $aError['insert_create'] = 'No se pudo eliminar la base de datos creada ('.mysql_error().')';
- fputs( $fp,date( "d/m/Y H:m:s")." insert_create (create_db): ".$aError['insert_create']."\n\n" );
- }
- else {
- $aError['insert_create'] = 'Se elimino la base de datos creada ('.mysql_error().')';
- fputs( $fp,date( "d/m/Y H:m:s")." insert_create (create_db): ".$aError['insert_create']."\n\n" );
- }
- $hasErrors = true;
- }
- }
- } else {
- fputs( $fp,date( "d/m/Y H:m:s")." -- Select DB --\n\n" );
- if(@mysql_select_db($_POST['db']['name'])) {
- if(doInstall($fp)) {
- fputs( $fp,date( "d/m/Y H:m:s")." Fin doInstall (select_db): OK \n\n" );
- fclose( $fp );
- header("Location: ".REDIRECT_URL);
- } else {
- $aError['insert_create'] = 'No se pudo agregar los datos a la base de datos existente ('.mysql_error().')';
- fputs( $fp,date( "d/m/Y H:m:s")." insert_create (select_db): ".$aError['insert_create']."\n\n" );
- $hasErrors = true;
- }
- } else {
- $hasErrors = true;
- $aError['currentdb'] = 'No se pudo usar la base de datos ('.mysql_error().')';
- fputs( $fp,date( "d/m/Y H:m:s")." currentdb (select_db): ".$aError['currentdb']."\n\n" );
- $aDb = array( 'server' => $_POST['db']['server'] , 'user' => $_POST['db']['user'], 'password' => $_POST['db']['password'], 'name' => $_POST['db']['name'], 'createdb' => $_POST['db']['createdb']) ;
- }
- }
- } else {
- $hasErrors = true;
- $aError['mysql_version'] = 'Usted tiene una versión de MYSQL inferior a la'.MYSQL_REQUIRED_VERSION. '(Su versión actual es '.$mysql_server_version. ')';
- fputs( $fp,date( "d/m/Y H:m:s")." mysql_server_version: ".$aError['mysql_version']."\n\n" );
- $aDb = array( 'server' => $_POST['db']['server'] , 'user' => $_POST['db']['user'], 'password' => $_POST['db']['password'], 'name' => $_POST['db']['name'], 'createdb' => $_POST['db']['createdb'] );
- }
-
- mysql_close($db_connection);
- } else {
- $hasErrors = true;
- $aError['connect'] = 'No pudo conectarse al Servidor de Base de datos ('.mysql_error().')';
- fputs( $fp,date( "d/m/Y H:m:s")." connect: ".$aError['connect']."\n\n" );
- $aDb = array( 'server' => $_POST['db']['server'] , 'user' => $_POST['db']['user'], 'password' => $_POST['db']['password'], 'name' => $_POST['db']['name'], 'createdb' => $_POST['db']['createdb'] );
- }
-
- }
- fclose( $fp );
-?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/2000/REC-xhtml1-200000126/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
- <meta http-equiv="content-type" content="text/html; charset=utf-8" />
- <meta name="title" content="Proyecto ALBA" />
- <meta name="robots" content="index, follow" />
- <meta name="description" content="Proyecto de Gestión Educativa ALBA" />
- <meta name="keywords" content="alba, proyecto, software libre, educacion" />
- <meta name="language" content="es" />
- <title>Proyecto ALBA</title>
- <link rel="stylesheet" type="text/css" href="installer/css/main.css"/>
-</head>
-
-<body>
-<div id ="sf_admin_container">
-<h2>Verificaciones necesarias para la instalación</h2>
-<br>
-<h2>Programas</h2>
-
-<table border="0" cellpadding="3" width="600" class="sf_admin_list">
- <thead>
- <tr>
- <th id="sf_admin_list_th_verfica">Verificación</th>
- <th id="sf_admin_list_th_resultado">Resultado</th>
- </tr>
- </thead>
- <tr class="sf_admin_row_0" >
- <td>Versión de PHP >= 5.0.0</td>
- <td>
- <?=($bool_phpversion)?IMG_OK:IMG_NOT_OK?>(<?=$msg_phpversion?>)
- </td>
- </tr>
-
- <tr class="sf_admin_row_1" >
- <td>¿ Esta instalado MYSQL en PHP ?</td>
- <td>
- <?=($bool_mysql_module)?IMG_OK:IMG_NOT_OK?>(<?=$msg_mysql_module?>)
- </td>
- </tr>
-
-
- <tr class="sf_admin_row_0">
- <td>¿ Esta Instalado GD en PHP ? (optativo) </td>
- <td><?=($bool_gd)?IMG_OK:IMG_NOT_OK." (Si queres ver los gráficos de estadísticas necesitas instalar GD - http://www.php.net/manual/es/ref.image.php)";?></td>
- </tr>
-
- <tr class="sf_admin_row_1">
- <td>En php.ini memory_limit >= 32</td>
- <td><?=($bool_memory_limit AND $bool_memory_no_chequeo)?IMG_OK:IMG_NOT_OK;?>(<?=$memory_limit?>)</td>
- </tr>
-
- <tr class="sf_admin_row_1">
- <td>En php.ini magic_quotes_gpc = off</td>
- <td><?=($bool_get_magic_quotes_gpc)?IMG_OK:IMG_NOT_OK;?><?=$msg_get_magic_quotes_gpc?></td>
- </tr>
-
-
-
- <tr class="sf_admin_row_0">
- <td>Versióon de APACHE >= 2.0</td>
- <td><?=($bool_apache_get_version)?IMG_OK:IMG_NOT_OK?>(<?=$msg_apache_get_version?>)</td>
- </tr>
-
- <tr class="sf_admin_row_1">
- <td>¿ Esta instalado MOD_REWRITE en APACHE ?</td>
- <td><?=($bool_mod_rewrite)?IMG_OK:IMG_NOT_OK.$msg_mod_rewrite?></td>
- </tr>
-
-</table>
-<br>
-<h2>Directorios con permisos para escritura:</h2>
-<table border="0" cellpadding="3" width="600" class="sf_admin_list">
- <thead>
- <tr>
- <th id="sf_admin_list_th_dir">Directorios</th>
- <th id="sf_admin_list_th_resultado">Resultados</th>
- </tr>
- </thead>
- <tr class="sf_admin_row_0" >
- <td>/cache</td>
- <td><?=($bool_cache)?IMG_OK:IMG_NOT_OK." (chmod 777 ./alba/cache)";?></td>
- </tr>
- <tr class="sf_admin_row_1">
- <td>/log</td>
- <td><?=($bool_log)?IMG_OK:IMG_NOT_OK." (chmod 777 ./alba/logs)";?></td>
- </tr>
- <tr class="sf_admin_row_0">
- <td>/uploads</td>
- <td><?=($bool_upload)?IMG_OK:IMG_NOT_OK." (chmod 777 ./alba/web/uploads)";?></td>
- </tr>
- <tr class="sf_admin_row_1">
- <td>/config</td>
- <td><?=($bool_config)?IMG_OK:IMG_NOT_OK." (chmod 777 ./alba/config)";?></td>
-<?php // Aqui no deberiamos probar si tienen permisos los archivos databases.yml, propel.ini y web/.htaccess ?>
- </tr>
- <tr class="sf_admin_row_0">
- <td>/tmp</td>
- <td><?=($bool_tmp)?IMG_OK:IMG_NOT_OK." (chmod 777 ./alba/web/tmp)";?></td>
- </tr>
-
-</table>
-
-<?php if($bool_config AND $bool_upload AND $bool_tmp 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 AND $bool_get_magic_quotes_gpc) { ?>
-
-<?php if($hasErrors) { ?>
- <br><br>
- <div class="form-errors">
- <h2>Arreglar errores para continuar</h2>
- <ul>
- <?php foreach ($aError as $idx => $name) { ?>
- <li><?php echo $name; ?></li>
- <?php } ?>
- </ul>
- </div>
-<?php } ?>
-
-
-
-<br>
-<h2>Datos para la instalación</h2>
-<form action="<?=$_SERVER['PHP_SELF']?>" method="POST" >
- <fieldset id="sf_fieldset_base_de_datos" class="">
- <h2>Conección a la base de datos</h2>
- <div class="form-row">
- <label for="db_server" class="required">Servidor:</label><div class="content"><input type="text" name="db[server]" value="<?=$aDb['server']?>" size="64" /></div>
- </div>
- <div class="form-row">
- <label for="db_user" class="required">Usuario:</label><div class="content"><input type="text" name="db[user]" value="<?=$aDb['user']?>" size="64" /></div>
- </div>
- <div class="form-row">
- <label for="db_password" class="required">Contraseña:</label><div class="content"><input type="password" name="db[password]" value="<?=$aDb['password']?>" size="64" /></div>
- </div>
- <div class="form-row">
- <label for="db_name" class="required">Nombre de base de datos:</label><div class="content"><input type="text" name="db[name]" value="<?=$aDb['name']?>" size="64" />
- Crear Base de datos <input type="checkbox" name="db[createdb]" value="crear" <?=($aDb['createdb'])?'checked':''?>>
- </div>
-
- <div class="form-row">
- <label for="db_name" class="required">¿Que datos quiere por defecto?:</label>
- <div class="content">
- Datos mínimos<input type="radio" name="db[datos]" value="minimos" checked >
- Caso de Ejemplo<input type="radio" name="db[datos]" value="ejemplo">
- </div>
- </div>
- </fieldset>
-
- <ul class="sf_admin_actions">
- <li><input type="submit" name="instalar" value="Instalar" class="sf_admin_action_instalar" /></li>
- <li><input type="reset" name="borrar" value="Borrar" class="sf_admin_action_borrar" /></li>
- </ul>
-</form>
-<? } else { ?>
-<br>
-<div align="center"><h2 style="color: #FF0000;">Para poder seguir con la instalción debe pasar completa la verificación.</h2></div>
-<? } ?>
-</div>
-</body>
-</html>
-
-
-<?
-// si existe el archivo de flag para la instacion
-} else { ?>
-<html>
-<body>
-Usted ya ha instalado el Proyetco ALBA. Si quiere volver a instalarlo debe borra el archivo alba/log/instalacion_completa.
-</body>
-</html>
-<? } ?>
-
-
-<?php
-
-/**
-* Funciones del instalador
-*/
-
-function compruebaVersion($instalada, $requireda) {
- return (version_compare($instalada, $requireda, ">="));
-}
-
-
-function compruebaMemoriaMaxima($php_memory) {
- $memory_limit = eregi_replace('[gmk]','',$php_memory);
- return ($memory_limit >= MEMORY_LIMIT_REQUIRED);
-
-}
-
-function estaExtensionPHP($ext) {
- $aExtension = get_loaded_extensions();
- if(count($aExtension)>0) {
- $res = array_search($ext, $aExtension);
- if($res === false) {
- return false;
- } else {
- return true;
- }
- } else {
- return false;
- }
-}
-
-
-function estaExtensionApache($ext) {
- $aApacheModulos = apache_get_modules();
- if(count($aApacheModulos)>0) {
- $res = array_search($ext, $aApacheModulos);
- if($res === false) {
- return false;
- } else {
- return true;
- }
- } else {
- return false;
- }
-}
-
-
-function tienePermisoEscritura($dir) {
- $octalPermiso = substr(sprintf('%o', @fileperms($dir)), -4);
- return ($octalPermiso == "0777" OR $octalPermiso == "1777");
-}
-
-
-function reemplzarArchivo($archivo, $aReemplazo) {
- $contenido = "";
- if(file_exists($archivo)) {
- $contenido = file_get_contents ($archivo);
- foreach($aReemplazo as $indice => $reemplazo) {
- $contenido = str_replace($indice, $reemplazo, $contenido);
- }
- }
- return $contenido;
-}
-
-
-
-// ojo que esto no funciona para cualquier cosa si dentro de un string de un insert hay un dato con ;\n se separa por eso tambien
-function dump2Array($file) {
- $aSql = array();
- $res_sql = "";
- if(file_exists($file)) {
- $sql = file($file);
- foreach($sql as $sql_line) {
- $sql_line = trim($sql_line);
- if (($sql_line != "") && (substr($sql_line, 0, 2) != "--") && (substr($sql_line, 0, 1) != "#") ) {
- $res_sql .= $sql_line."\n";
- }
- }
- $aSql= array_slice(explode(";\n", $res_sql),0,-1);
- }
- return $aSql;
-}
-
-function executeDump($file, $db,$fp) {
- fputs( $fp,date( "d/m/Y H:m:s")." Entrando ExecuteDump: $file - $db \n\n" );
- $aSql = dump2Array($file);
- $error = false;
- if(count($aSql) > 0 AND file_exists($file)) {
- if(mysql_select_db($db)) {
- fputs( $fp,date( "d/m/Y H:m:s")." ejecutando BEGIN \n\n" );
- mysql_query("BEGIN");
- foreach($aSql as $sql_line) {
- $res = mysql_query(trim($sql_line));
- if(!$res) {
- fputs( $fp,date( "d/m/Y H:m:s")." Fallo SQL: $sql_line \n\n" );
- fputs( $fp,date( "d/m/Y H:m:s")." error:". mysql_error()." \n\n" );
- $error = true;
- }
- }
- if($error == true) {
- fputs( $fp,date( "d/m/Y H:m:s")." Se encontraron errores ejecutando ROLLBACK y saliendo \n\n" );
- mysql_query("ROLLBACK");
- return false;
- } else {
- fputs( $fp,date( "d/m/Y H:m:s")." Sin errores ejecutando COMMIT y saliendo \n\n" );
- mysql_query("COMMIT");
- return true;
- }
- }
- else {
- fputs( $fp,date( "d/m/Y H:m:s")." Error al seleccionar la base: $db \n\n" );
- return false;
- }
- } else {
- fputs( $fp,date( "d/m/Y H:m:s")." Devuele false no ejecuta nada : $db \n\n" );
- return false;
- }
-
-}
-
-function doInstall($fp) {
- global $_POST;
- fputs( $fp,date( "d/m/Y H:m:s")." Entrando doInstall() \n\n" );
- //verifica que base de datos instalar si la del ejemplo o solamente la
- //de los datos_desde_cero iniciales
- switch($_POST['db']['datos']) {
- case "ejemplo": $sql_insert = SQL_INSERT_INICIAL; break;
- case "minimos": $sql_insert = SQL_INSERT_EJEMPLO; break;
- default: $sql_insert = SQL_INSERT_EJEMPLO;
- }
- fputs( $fp,date( "d/m/Y H:m:s")." Utilizando SQL: $sql_insert \n\n" );
- if(executeDump(SQL_CREATE, $_POST['db']['name'],$fp)) {
- if(executeDump($sql_insert, $_POST['db']['name'],$fp)) {
- $aReemplazo = array( 'USERDB' => $_POST['db']['user'], 'PASSDB' => $_POST['db']['password'], 'SERVER' => $_POST['db']['server'], 'DBNAME'=> $_POST['db']['name']);
- $contenido_archivo = reemplzarArchivo(DATABASE_CONFIG_DIST,$aReemplazo);
- file_put_contents(DATABASE_CONFIG, $contenido_archivo);
-
- $aReemplazo = array( 'USERDB' => $_POST['db']['user'], 'PASSDB' => $_POST['db']['password'], 'SERVER' => $_POST['db']['server'], 'DBNAME'=> $_POST['db']['name']);
- $contenido_archivo = reemplzarArchivo(PROPEL_CONFIG_DIST,$aReemplazo);
- file_put_contents(PROPEL_CONFIG, $contenido_archivo);
-
-
- _symlink(INSTALL_DIR."dist/".SYMFONY_DIR."/data/", ALBA_PATH."data/symfony");
- _symlink(INSTALL_DIR."dist/pake/", ALBA_PATH."lib/pake");
- _symlink(INSTALL_DIR."dist/phing.sandbox/", ALBA_PATH."lib/phing");
- _symlink(INSTALL_DIR."dist/".SYMFONY_DIR."/lib/", ALBA_PATH."lib/symfony");
- _symlink(INSTALL_DIR."alba/data/symfony/web/sf/", ALBA_WEB."sf");
- fputs( $fp,date( "d/m/Y H:m:s")." Creando Links \n\n" );
-
- $rewrite_path = (OS_WINDOWS)?CURRENT_WEB_DIR.SYMFONY_WINDOWS_WEB_DIR:CURRENT_WEB_DIR.SYMFONY_WEB_DIR;
-
- if(!OS_WINDOWS)
- _symlink(ALBA_WEB, INSTALL_DIR.SYMFONY_WEB_DIR); // crea nuevo link afuera de la estructura de alba
-
- $aReemplazo = Array('REWRITE_PATH' => $rewrite_path);
- $contenido_archivo = reemplzarArchivo(HTACCESS_DIST,$aReemplazo);
- file_put_contents(HTACCESS, $contenido_archivo);
- touch(INSTALL_COMPLETE_FILE);
- fputs( $fp,date( "d/m/Y H:m:s")." Creando bandera INSTALL_COMPLETE_FILE \n\n" );
- return true;
- }
- fputs( $fp,date( "d/m/Y H:m:s")." Fallo ejecutando: $sql_insert \n\n" );
- return false;
- } else {
- fputs( $fp,date( "d/m/Y H:m:s")." Fallo ejecutando: SQL_CREATE \n\n" );
- return false;
- }
-
-}
-
-
-function doUninstall() {
-
-}
-
-function _symlink( $target, $link ) {
- if (OS_WINDOWS) {
- @dircopy($target, $link);
- } else {
- @symlink($target,$link);
- }
-}
-
-
-function dircopy($srcdir, $dstdir, $verbose = false) {
- $num = 0;
- if(!is_dir($dstdir)) mkdir($dstdir);
- if($curdir = opendir($srcdir)) {
- while($file = readdir($curdir)) {
- if($file != '.' && $file != '..') {
- $srcfile = $srcdir . DIRECTORY_SEPARATOR . $file;
- $dstfile = $dstdir . DIRECTORY_SEPARATOR . $file;
- if(is_file($srcfile)) {
- if(is_file($dstfile)) $ow = filemtime($srcfile) - filemtime($dstfile); else $ow = 1;
- if($ow > 0) {
- if($verbose) echo "Copying '$srcfile' to '$dstfile'...";
- if(copy($srcfile, $dstfile)) {
- touch($dstfile, filemtime($srcfile)); $num++;
- if($verbose) echo "OK\n";
- }
- else echo "Error: File '$srcfile' could not be copied!\n";
- }
- }
- else if(is_dir($srcfile)) {
- $num += dircopy($srcfile, $dstfile, $verbose);
- }
- }
- }
- closedir($curdir);
- }
- return $num;
-}
+header("Location: instalar/instalar.php");
?>
\ No newline at end of file
1
0
SVN Alba r4919 - in prosistem/alba/trunk/alba/apps/principal/modules: evento/templates horarioescolar/actions horarioescolar/validate
by commits@pressenter.com.ar 06 Aug '07
by commits@pressenter.com.ar 06 Aug '07
06 Aug '07
Author: josx
Date: 2007-08-06 16:43:40 -0300 (Mon, 06 Aug 2007)
New Revision: 4919
Modified:
prosistem/alba/trunk/alba/apps/principal/modules/evento/templates/_carga_evento.php
prosistem/alba/trunk/alba/apps/principal/modules/horarioescolar/actions/actions.class.php
prosistem/alba/trunk/alba/apps/principal/modules/horarioescolar/validate/edit.yml
Log:
Validacion de horas en Horario escolar. Se incorporo la grafica necesaria en el componente de evento.
Modified: prosistem/alba/trunk/alba/apps/principal/modules/evento/templates/_carga_evento.php
===================================================================
--- prosistem/alba/trunk/alba/apps/principal/modules/evento/templates/_carga_evento.php 2007-08-06 18:33:21 UTC (rev 4918)
+++ prosistem/alba/trunk/alba/apps/principal/modules/evento/templates/_carga_evento.php 2007-08-06 19:43:40 UTC (rev 4919)
@@ -208,11 +208,17 @@
<div class="form-row">
<?php echo label_for('evento[fecha_inicio]', __('Inicio:'), 'class="required" ') ?>
- <div class="content<?php if ($sf_request->hasError('evento{fecha_inicio}')): ?> form-error<?php endif; ?>">
+ <div class="content<?php if ($sf_request->hasError('evento{fecha_inicio}') OR $sf_request->hasError('evento{hora_inicio}') ): ?> form-error<?php endif; ?>">
<?php if ($sf_request->hasError('evento{fecha_inicio}')): ?>
<?php echo form_error('evento{fecha_inicio}', array('class' => 'form-error-msg')) ?>
<?php endif; ?>
+
+ <?php if ($sf_request->hasError('evento{hora_inicio}')): ?>
+ <?php echo form_error('evento{hora_inicio}', array('class' => 'form-error-msg')) ?>
+ <?php endif; ?>
+
+
<?php echo object_input_date_tag($evento, 'getFechaInicio', array (
'rich' => true,
// 'withtime' => true,
@@ -227,11 +233,18 @@
<div class="form-row">
<?php echo label_for('evento[fecha_fin]', __('Fin:'), 'class="required" ') ?>
- <div class="content<?php if ($sf_request->hasError('evento{fecha_fin}')): ?> form-error<?php endif; ?>">
+
+ <div class="content<?php if ($sf_request->hasError('evento{fecha_fin}') OR $sf_request->hasError('evento{hora_fin}')): ?> form-error<?php endif; ?>">
+
<?php if ($sf_request->hasError('evento{fecha_fin}')): ?>
<?php echo form_error('evento{fecha_fin}', array('class' => 'form-error-msg')) ?>
<?php endif; ?>
+ <?php if ($sf_request->hasError('evento{hora_fin}')): ?>
+ <?php echo form_error('evento{hora_fin}', array('class' => 'form-error-msg')) ?>
+ <?php endif; ?>
+
+
<?php echo object_input_date_tag($evento, 'getFechaFin', array (
'rich' => true,
// 'withtime' => true,
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-08-06 18:33:21 UTC (rev 4918)
+++ prosistem/alba/trunk/alba/apps/principal/modules/horarioescolar/actions/actions.class.php 2007-08-06 19:43:40 UTC (rev 4919)
@@ -144,7 +144,9 @@
'horarioescolar{fk_evento_id}' => 'Evento:',
'evento{fecha_inicio}' => 'Fecha inicio:',
'evento{fecha_fin}' => 'Fecha fin:',
-
+
+ 'evento{hora_inicio}' => 'Hora inicio:',
+ 'evento{hora_fin}' => 'Hora fin:',
);
}
Modified: prosistem/alba/trunk/alba/apps/principal/modules/horarioescolar/validate/edit.yml
===================================================================
--- prosistem/alba/trunk/alba/apps/principal/modules/horarioescolar/validate/edit.yml 2007-08-06 18:33:21 UTC (rev 4918)
+++ prosistem/alba/trunk/alba/apps/principal/modules/horarioescolar/validate/edit.yml 2007-08-06 19:43:40 UTC (rev 4919)
@@ -6,7 +6,10 @@
- "horarioescolar{fk_horarioescolartipo_id}"
- "evento{fecha_inicio}"
- "evento{fecha_fin}"
+ - "evento{hora_inicio}"
+ - "evento{hora_fin}"
+
fillin:
enabled: on
@@ -29,15 +32,23 @@
required_msg: El campo tipo de horario escolar es obligatorio
evento{fecha_inicio}:
- required: no
+ required: No
validators: firstDay
evento{fecha_fin}:
- required: no
+ required: No
validators: lastDay
+ evento{hora_inicio}:
+ required: No
+ validators: horaInicio
+ evento{hora_fin}:
+ required: No
+ validators: horaFin
+
+
caracteresMaximos255:
class: sfStringValidator
1
0
SVN Alba r4918 - in prosistem/alba/trunk/alba/apps/principal/modules/horarioescolar: actions templates validate
by commits@pressenter.com.ar 06 Aug '07
by commits@pressenter.com.ar 06 Aug '07
06 Aug '07
Author: josx
Date: 2007-08-06 15:33:21 -0300 (Mon, 06 Aug 2007)
New Revision: 4918
Modified:
prosistem/alba/trunk/alba/apps/principal/modules/horarioescolar/actions/actions.class.php
prosistem/alba/trunk/alba/apps/principal/modules/horarioescolar/templates/_edit_form.php
prosistem/alba/trunk/alba/apps/principal/modules/horarioescolar/validate/edit.yml
Log:
Mejora en la validacion del evento en los horarios escolares, aun existe error por bug en symfony ( igual a #203 )
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-08-06 17:52:35 UTC (rev 4917)
+++ prosistem/alba/trunk/alba/apps/principal/modules/horarioescolar/actions/actions.class.php 2007-08-06 18:33:21 UTC (rev 4918)
@@ -142,7 +142,29 @@
'horarioescolar{fk_horarioescolartipo_id}' => 'Tipo Horario Escolar:',
'horarioescolar{fk_turno_id}' => 'Turno:',
'horarioescolar{fk_evento_id}' => 'Evento:',
+ 'evento{fecha_inicio}' => 'Fecha inicio:',
+ 'evento{fecha_fin}' => 'Fecha fin:',
+
+
);
}
+
+
+ public function handleErrorEdit() {
+ $this->preExecute();
+ $this->horarioescolar = $this->getHorarioescolarOrCreate();
+ $evento_generico = new miEvento();
+ $this->evento = $evento_generico->getEventoOrCreate($this->horarioescolar->getFkEventoId());
+ $this->evento = $evento_generico->updateEventoFromRequest($this->evento, $this->getRequestParameter('evento'), $this->getUser()->getCulture());
+ $this->updateHorarioescolarFromRequest($this->evento->getId());
+//print_R($this->evento);
+ $this->labels = $this->getLabels();
+ return sfView::SUCCESS;
+ }
+
+
+
+
+
}
?>
Modified: prosistem/alba/trunk/alba/apps/principal/modules/horarioescolar/templates/_edit_form.php
===================================================================
--- prosistem/alba/trunk/alba/apps/principal/modules/horarioescolar/templates/_edit_form.php 2007-08-06 17:52:35 UTC (rev 4917)
+++ prosistem/alba/trunk/alba/apps/principal/modules/horarioescolar/templates/_edit_form.php 2007-08-06 18:33:21 UTC (rev 4918)
@@ -2,7 +2,7 @@
// auto-generated by sfPropelAdmin
// date: 2007/07/18 17:55:34
?>
-<?php echo form_tag('horarioescolar/save', array(
+<?php echo form_tag('horarioescolar/edit', array(
'id' => 'sf_admin_edit_form',
'name' => 'sf_admin_edit_form',
'multipart' => true,
Modified: prosistem/alba/trunk/alba/apps/principal/modules/horarioescolar/validate/edit.yml
===================================================================
--- prosistem/alba/trunk/alba/apps/principal/modules/horarioescolar/validate/edit.yml 2007-08-06 17:52:35 UTC (rev 4917)
+++ prosistem/alba/trunk/alba/apps/principal/modules/horarioescolar/validate/edit.yml 2007-08-06 18:33:21 UTC (rev 4918)
@@ -4,7 +4,9 @@
- "horarioescolar{descripcion}"
- "horarioescolar{fk_turno_id}"
- "horarioescolar{fk_horarioescolartipo_id}"
-
+ - "evento{fecha_inicio}"
+ - "evento{fecha_fin}"
+
fillin:
enabled: on
@@ -26,6 +28,16 @@
required: Yes
required_msg: El campo tipo de horario escolar es obligatorio
+ evento{fecha_inicio}:
+ required: no
+ validators: firstDay
+
+ evento{fecha_fin}:
+ required: no
+ validators: lastDay
+
+
+
caracteresMaximos255:
class: sfStringValidator
@@ -51,7 +63,7 @@
class: albaHorasValidator
param:
hora_error: El campo debe ser una hora
- compare: horarioescolar[hora_fin]
+ compare: evento[hora_fin]
operator: <
compare_error: La hora de inicio debe ser anterior a la hora de fin
@@ -59,6 +71,23 @@
class: albaHorasValidator
param:
hora_error: EL campo debe ser una hora
- compare: horarioescolar[hora_inicio]
+ compare: evento[hora_inicio]
operator: >
compare_error: La hora de fin debe ser posterior a la hora de inicio
+
+firstDay:
+ class: albaDateValidator
+ param:
+ date_error: El campo debe ser una fecha
+ compare: evento[fecha_fin]
+ operator: <=
+ compare_error: La fecha inicio debe ser anterior a la fecha fin
+
+lastDay:
+ class: albaDateValidator
+ param:
+ date_error: EL campo debe ser una fecha
+ compare: evento[fecha_inicio]
+ operator: >=
+ compare_error: La fecha fin debe ser posterior a la fecha inicio
+
1
0
[Pressenter - SVN Alba] #143: la clase Turnos quedo mal nombrada , deberia ser Turno, en singular
by Pressenter - SVN Alba 06 Aug '07
by Pressenter - SVN Alba 06 Aug '07
06 Aug '07
#143: la clase Turnos quedo mal nombrada , deberia ser Turno, en singular
-------------------------+--------------------------------------------------
Reporter: ftoledo | Owner: somebody
Type: tarea | Status: new
Priority: baja | Milestone:
Component: alba-turnos | Version: desarollo
Severity: menor | Keywords:
-------------------------+--------------------------------------------------
El problema que ocurre es que los metodos del modelo quedan mal
ej:
$ciclolectivo->countTurnoss();
* renombrar la tabla de la base
* agregar al actualizar.sql
* verificar si va algo en datos_desde_cero.sql
* verificar datos de ejemplo .sql
* generar de nuevo el modelo
* renombrar el modulo
* en las acciones, el nombre de la clase
* en los templates, las variables referentes
* en el validate, nombre de los campos
* links que existas hacia ese modulo (ej. desde el menu)
modulos que manejan turnos:
* boletin
* calendario
* ciclolectivo
* division
* horarioescolar
* informes
* relAlumnoDivision
''pd: adjunto un grep donde aparece turnos''
--
Ticket URL: <http://alba.pressenter.com.ar/cgi-bin/trac.cgi/ticket/143>
Pressenter - SVN Alba <http://wwww.proyectoalba.com.ar/>
Proyecto Alba
1
4
SVN Alba r4917 - in prosistem/alba/trunk/alba/apps/principal/modules/relAnioActividad: actions config templates
by commits@pressenter.com.ar 06 Aug '07
by commits@pressenter.com.ar 06 Aug '07
06 Aug '07
Author: josx
Date: 2007-08-06 14:52:35 -0300 (Mon, 06 Aug 2007)
New Revision: 4917
Added:
prosistem/alba/trunk/alba/apps/principal/modules/relAnioActividad/templates/_edit_form.php
prosistem/alba/trunk/alba/apps/principal/modules/relAnioActividad/templates/_list_td_actions.php
prosistem/alba/trunk/alba/apps/principal/modules/relAnioActividad/templates/_list_td_tabular.php
Modified:
prosistem/alba/trunk/alba/apps/principal/modules/relAnioActividad/actions/actions.class.php
prosistem/alba/trunk/alba/apps/principal/modules/relAnioActividad/config/generator.yml
Log:
Arreglo de problema en edicion de a?\195?\177o y actividad (Problema del generator)
Modified: prosistem/alba/trunk/alba/apps/principal/modules/relAnioActividad/actions/actions.class.php
===================================================================
--- prosistem/alba/trunk/alba/apps/principal/modules/relAnioActividad/actions/actions.class.php 2007-08-06 16:02:44 UTC (rev 4916)
+++ prosistem/alba/trunk/alba/apps/principal/modules/relAnioActividad/actions/actions.class.php 2007-08-06 17:52:35 UTC (rev 4917)
@@ -23,8 +23,8 @@
* relAnioActividad Acciones
*
* @package alba
- * @author Jos� Luis Di Biase <josx(a)interorganic.com.ar>
- * @author H�ctor Sanchez <hsanchez(a)pressenter.com.ar>
+ * @author José Luis Di Biase <josx(a)interorganic.com.ar>
+ * @author Héctor Sanchez <hsanchez(a)pressenter.com.ar>
* @author Fernando Toledo <ftoledo(a)pressenter.com.ar>
* @version SVN: $Id$
* @filesource
@@ -33,6 +33,31 @@
class relAnioActividadActions extends autorelAnioActividadActions
{
+
+ protected function getRelAnioActividadOrCreate($id = 'id', $horas = '') {
+ if (!$this->getRequestParameter($id)) {
+ $rel_anio_actividad = new RelAnioActividad();
+ } else {
+ $rel_anio_actividad = RelAnioActividadPeer::retrieveByPk($this->getRequestParameter($id));
+ $this->forward404Unless($rel_anio_actividad);
+ }
+ return $rel_anio_actividad;
+ }
+
+ protected function updateRelAnioActividadFromRequest() {
+ $rel_anio_actividad = $this->getRequestParameter('rel_anio_actividad');
+ if (isset($rel_anio_actividad['fk_anio_id'])) {
+ $this->rel_anio_actividad->setFkAnioId($rel_anio_actividad['fk_anio_id'] ? $rel_anio_actividad['fk_anio_id'] : null);
+ }
+
+ if (isset($rel_anio_actividad['fk_actividad_id'])) {
+ $this->rel_anio_actividad->setFkActividadId($rel_anio_actividad['fk_actividad_id'] ? $rel_anio_actividad['fk_actividad_id'] : null);
+ }
+
+ if (isset($rel_anio_actividad['horas'])) {
+ $this->rel_anio_actividad->setHoras($rel_anio_actividad['horas']);
+ }
+
+ }
}
-
-?>
+?>
\ No newline at end of file
Modified: prosistem/alba/trunk/alba/apps/principal/modules/relAnioActividad/config/generator.yml
===================================================================
--- prosistem/alba/trunk/alba/apps/principal/modules/relAnioActividad/config/generator.yml 2007-08-06 16:02:44 UTC (rev 4916)
+++ prosistem/alba/trunk/alba/apps/principal/modules/relAnioActividad/config/generator.yml 2007-08-06 17:52:35 UTC (rev 4917)
@@ -11,8 +11,8 @@
edit:
title: Editar Actividades del Año
fields:
- fk_anio_id: { params: include_custom=--Seleccione un Añ--<}
- fk_actividad_id: { params: include_custom=>>Seleccione una Actividad<<}
+ fk_anio_id: { params: include_custom=>>Seleccione un Año<< }
+ fk_actividad_id: { params: include_custom=>>Seleccione una Actividad<< }
display: [ fk_anio_id, fk_actividad_id, horas ]
list:
title: Listado de Actividades por Año
@@ -20,4 +20,5 @@
object_actions:
_edit: -
_delete: -
- filters: [ fk_anio_id ]
+ filters: [ fk_anio_id ]
+
Added: prosistem/alba/trunk/alba/apps/principal/modules/relAnioActividad/templates/_edit_form.php
===================================================================
--- prosistem/alba/trunk/alba/apps/principal/modules/relAnioActividad/templates/_edit_form.php 2007-08-06 16:02:44 UTC (rev 4916)
+++ prosistem/alba/trunk/alba/apps/principal/modules/relAnioActividad/templates/_edit_form.php 2007-08-06 17:52:35 UTC (rev 4917)
@@ -0,0 +1,78 @@
+<?php
+// auto-generated by sfPropelAdmin
+// date: 2007/08/06 12:32:12
+?>
+<?php echo form_tag('relAnioActividad/save', array(
+ 'id' => 'sf_admin_edit_form',
+ 'name' => 'sf_admin_edit_form',
+ 'multipart' => true,
+)) ?>
+
+<?php echo object_input_hidden_tag($rel_anio_actividad, 'getId') ?>
+<?php echo object_input_hidden_tag($rel_anio_actividad, 'getHoras') ?>
+
+<fieldset id="sf_fieldset_none" class="">
+
+<div class="form-row">
+ <?php echo label_for('rel_anio_actividad[fk_anio_id]', __($labels['rel_anio_actividad{fk_anio_id}']), 'class="required" ') ?>
+ <div class="content<?php if ($sf_request->hasError('rel_anio_actividad{fk_anio_id}')): ?> form-error<?php endif; ?>">
+ <?php if ($sf_request->hasError('rel_anio_actividad{fk_anio_id}')): ?>
+ <?php echo form_error('rel_anio_actividad{fk_anio_id}', array('class' => 'form-error-msg')) ?>
+ <?php endif; ?>
+
+ <?php $value = object_select_tag($rel_anio_actividad, 'getFkAnioId', array (
+ 'related_class' => 'Anio',
+ 'control_name' => 'rel_anio_actividad[fk_anio_id]',
+ 'include_custom' => '>>Seleccione un Año<<',
+)); echo $value ? $value : ' ' ?>
+ </div>
+</div>
+
+<div class="form-row">
+ <?php echo label_for('rel_anio_actividad[fk_actividad_id]', __($labels['rel_anio_actividad{fk_actividad_id}']), 'class="required" ') ?>
+ <div class="content<?php if ($sf_request->hasError('rel_anio_actividad{fk_actividad_id}')): ?> form-error<?php endif; ?>">
+ <?php if ($sf_request->hasError('rel_anio_actividad{fk_actividad_id}')): ?>
+ <?php echo form_error('rel_anio_actividad{fk_actividad_id}', array('class' => 'form-error-msg')) ?>
+ <?php endif; ?>
+
+ <?php $value = object_select_tag($rel_anio_actividad, 'getFkActividadId', array (
+ 'related_class' => 'Actividad',
+ 'control_name' => 'rel_anio_actividad[fk_actividad_id]',
+ 'include_custom' => '>>Seleccione una Actividad<<',
+)); echo $value ? $value : ' ' ?>
+ </div>
+</div>
+
+
+<div class="form-row">
+ <?php echo label_for('rel_anio_actividad[horas]', __($labels['rel_anio_actividad{horas}']), 'class="required" ') ?>
+ <div class="content<?php if ($sf_request->hasError('rel_anio_actividad{horas}')): ?> form-error<?php endif; ?>">
+ <?php if ($sf_request->hasError('rel_anio_actividad{horas}')): ?>
+ <?php echo form_error('rel_anio_actividad{horas}', array('class' => 'form-error-msg')) ?>
+ <?php endif; ?>
+
+ <?php $value = object_input_tag($rel_anio_actividad, 'getHoras', array (
+ 'size' => 16,
+ 'control_name' => 'rel_anio_actividad[horas]',
+ )); echo $value ? $value : ' ' ?>
+
+ </div>
+</div>
+
+
+
+</fieldset>
+
+<?php include_partial('edit_actions', array('rel_anio_actividad' => $rel_anio_actividad)) ?>
+
+</form>
+
+<ul class="sf_admin_actions">
+ <li class="float-left"><?php if ($rel_anio_actividad->getId() && $rel_anio_actividad->getHoras()): ?>
+<?php echo button_to(__('delete'), 'relAnioActividad/delete?id='.$rel_anio_actividad->getId().'&horas='.$rel_anio_actividad->getHoras(), array (
+ 'post' => true,
+ 'confirm' => __('Are you sure?'),
+ 'class' => 'sf_admin_action_delete',
+)) ?><?php endif; ?>
+</li>
+ </ul>
Property changes on: prosistem/alba/trunk/alba/apps/principal/modules/relAnioActividad/templates/_edit_form.php
___________________________________________________________________
Name: svn:keywords
+ "Id Author URL Date Rev"
Added: prosistem/alba/trunk/alba/apps/principal/modules/relAnioActividad/templates/_list_td_actions.php
===================================================================
--- prosistem/alba/trunk/alba/apps/principal/modules/relAnioActividad/templates/_list_td_actions.php 2007-08-06 16:02:44 UTC (rev 4916)
+++ prosistem/alba/trunk/alba/apps/principal/modules/relAnioActividad/templates/_list_td_actions.php 2007-08-06 17:52:35 UTC (rev 4917)
@@ -0,0 +1,13 @@
+<?php
+// auto-generated by sfPropelAdmin
+// date: 2007/08/06 12:32:12
+?>
+<td>
+<ul class="sf_admin_td_actions">
+ <li><?php echo link_to(image_tag('/sf/sf_admin/images/edit_icon.png', array('alt' => __('edit'), 'title' => __('edit'))), 'relAnioActividad/edit?id='.$rel_anio_actividad->getId()) ?></li>
+ <li><?php echo link_to(image_tag('/sf/sf_admin/images/delete_icon.png', array('alt' => __('delete'), 'title' => __('delete'))), 'relAnioActividad/delete?id='.$rel_anio_actividad->getId(), array (
+ 'post' => true,
+ 'confirm' => __('Are you sure?'),
+)) ?></li>
+</ul>
+</td>
Property changes on: prosistem/alba/trunk/alba/apps/principal/modules/relAnioActividad/templates/_list_td_actions.php
___________________________________________________________________
Name: svn:keywords
+ "Id Author URL Date Rev"
Added: prosistem/alba/trunk/alba/apps/principal/modules/relAnioActividad/templates/_list_td_tabular.php
===================================================================
--- prosistem/alba/trunk/alba/apps/principal/modules/relAnioActividad/templates/_list_td_tabular.php 2007-08-06 16:02:44 UTC (rev 4916)
+++ prosistem/alba/trunk/alba/apps/principal/modules/relAnioActividad/templates/_list_td_tabular.php 2007-08-06 17:52:35 UTC (rev 4917)
@@ -0,0 +1,7 @@
+<?php
+// auto-generated by sfPropelAdmin
+// date: 2007/08/06 12:32:12
+?>
+ <td><?php echo $rel_anio_actividad->getAnio() ?></td>
+ <td><?php echo $rel_anio_actividad->getActividad() ?></td>
+ <td><?php echo $rel_anio_actividad->getHoras() ?></td>
Property changes on: prosistem/alba/trunk/alba/apps/principal/modules/relAnioActividad/templates/_list_td_tabular.php
___________________________________________________________________
Name: svn:keywords
+ "Id Author URL Date Rev"
1
0