[Alba-desarrollo] SVN Alba r4166 - in prosistem/alba/trunk/alba: apps/principal/modules/menu/config apps/principal/templates config data/sql lib/model/map lib/model/om

commits en pressenter.com.ar commits en pressenter.com.ar
Mie Feb 7 20:46:49 CET 2007


Author: ftoledo
Date: 2007-02-07 16:46:46 -0300 (Wed, 07 Feb 2007)
New Revision: 4166

Modified:
   prosistem/alba/trunk/alba/apps/principal/modules/menu/config/generator=
.yml
   prosistem/alba/trunk/alba/apps/principal/templates/menu.php
   prosistem/alba/trunk/alba/config/schema.xml
   prosistem/alba/trunk/alba/data/sql/actualizacion_1.0b_a_1.0rc.sql
   prosistem/alba/trunk/alba/lib/model/map/MenuMapBuilder.php
   prosistem/alba/trunk/alba/lib/model/om/BaseMenu.php
   prosistem/alba/trunk/alba/lib/model/om/BaseMenuPeer.php
Log:
Soporte de "target" en el menu.=20
Sirve para abrir links del menu, por ejemplo en una ventanta nueva.
Los valores son los usados en html, si bien el uso es para frames (que no=
 tenemos)
El valor _blank es util para abrir el contenido la nueva ventana (ver men=
u informes).
Se agrega el atributo target=3D"valor" en el link.=20



Modified: prosistem/alba/trunk/alba/apps/principal/modules/menu/config/ge=
nerator.yml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- prosistem/alba/trunk/alba/apps/principal/modules/menu/config/generato=
r.yml	2007-02-07 16:35:21 UTC (rev 4165)
+++ prosistem/alba/trunk/alba/apps/principal/modules/menu/config/generato=
r.yml	2007-02-07 19:46:46 UTC (rev 4166)
@@ -10,7 +10,7 @@
     list:
         title: Administración del menu
         filters: [ fk_padre_menu_id, nombre, perm ]
-        display: [ id, =3Dnombre, link, perm, _fk_padre_menu_id, orden ]
+        display: [ id, =3Dnombre, link, perm, _fk_padre_menu_id, target,=
 orden ]
     edit:
         title: Modificar menu
        =20
\ No newline at end of file

Modified: prosistem/alba/trunk/alba/apps/principal/templates/menu.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- prosistem/alba/trunk/alba/apps/principal/templates/menu.php	2007-02-0=
7 16:35:21 UTC (rev 4165)
+++ prosistem/alba/trunk/alba/apps/principal/templates/menu.php	2007-02-0=
7 19:46:46 UTC (rev 4166)
@@ -22,8 +22,8 @@
  * menu
  *
  * @package    alba
- * @author     Jos=C3=A9 Luis Di Biase <josx en interorganic.com.ar>
- * @author     H=C3=A9ctor Sanchez <hsanchez en pressenter.com.ar>
+ * @author     Jos=E9 Luis Di Biase <josx en interorganic.com.ar>
+ * @author     H=E9ctor Sanchez <hsanchez en pressenter.com.ar>
  * @author     Fernando Toledo <ftoledo en pressenter.com.ar>
  * @version    SVN: $Id$
  * @filesource
@@ -45,14 +45,18 @@
     			echo "\t<li>";
                 if ($nodo->getNombre() !=3D '-') {
                     echo "<span></span>";
-    	    		echo link_to($nodo->getNombre(),$nodo->getLink()) . "\n";
+                    if ($nodo->getTarget() =3D=3D '')
+                        echo link_to($nodo->getNombre(),$nodo->getLink()=
) . "\n";
+                    else
+                        echo link_to($nodo->getNombre(),$nodo->getLink()=
,array('target'=3D> $nodo->getTarget())) . "\n";
+                   =20
     		    	if ($nodo->getLink() =3D=3D'#')
     				    drawMenu($nodo->getId());
                 }
         		echo "</li>\n";
 	        }
             else
-                debug_message("menu::permiso: " . $nodo->getPerm());
+                debug_message("falta permiso de menu: " . $nodo->getPerm=
());
 		}
 		echo "</ul>\n";
 	}

Modified: prosistem/alba/trunk/alba/config/schema.xml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- prosistem/alba/trunk/alba/config/schema.xml	2007-02-07 16:35:21 UTC (=
rev 4165)
+++ prosistem/alba/trunk/alba/config/schema.xml	2007-02-07 19:46:46 UTC (=
rev 4166)
@@ -696,6 +696,7 @@
         <column name=3D"nombre" type=3D"VARCHAR" size=3D"255" required=3D=
"true" default=3D""/>
         <column name=3D"link" type=3D"VARCHAR" size=3D"255" required=3D"=
true" default=3D""/>
         <column name=3D"perm" type=3D"VARCHAR" size=3D"255" required=3D"=
true" default=3D""/>
+        <column name=3D"target" type=3D"VARCHAR" size=3D"255" required=3D=
"true" default=3D""/>
         <column name=3D"fk_padre_menu_id" type=3D"INTEGER" required=3D"f=
alse"/>
         <column name=3D"orden" type=3D"INTEGER" required=3D"false"/>
         <index name=3D"nombre_menu">

Modified: prosistem/alba/trunk/alba/data/sql/actualizacion_1.0b_a_1.0rc.s=
ql
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- prosistem/alba/trunk/alba/data/sql/actualizacion_1.0b_a_1.0rc.sql	200=
7-02-07 16:35:21 UTC (rev 4165)
+++ prosistem/alba/trunk/alba/data/sql/actualizacion_1.0b_a_1.0rc.sql	200=
7-02-07 19:46:46 UTC (rev 4166)
@@ -5,4 +5,6 @@
 ALTER TABLE `adjunto` CHANGE `ruta` `ruta` VARCHAR(255) NOT NULL;
=20
 INSERT INTO permiso (id, nombre, descripcion, credencial, fk_modulo_id) =
VALUES (58, 'tipodocumento', 'tipodocumento', 'tipodocumento', 46);
-INSERT INTO permiso (id, nombre, descripcion, credencial, fk_modulo_id) =
VALUES (59, 'informes', 'informes', 'informes', 47);
\ No newline at end of file
+INSERT INTO permiso (id, nombre, descripcion, credencial, fk_modulo_id) =
VALUES (59, 'informes', 'informes', 'informes', 47);
+
+ALTER TABLE menu ADD `target` VARCHAR(255) NOT NULL DEFAULT '';

Modified: prosistem/alba/trunk/alba/lib/model/map/MenuMapBuilder.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- prosistem/alba/trunk/alba/lib/model/map/MenuMapBuilder.php	2007-02-07=
 16:35:21 UTC (rev 4165)
+++ prosistem/alba/trunk/alba/lib/model/map/MenuMapBuilder.php	2007-02-07=
 19:46:46 UTC (rev 4166)
@@ -72,6 +72,8 @@
=20
 		$tMap->addColumn('PERM', 'Perm', 'string', CreoleTypes::VARCHAR, true)=
;
=20
+		$tMap->addColumn('TARGET', 'Target', 'string', CreoleTypes::VARCHAR, t=
rue);
+
 		$tMap->addForeignKey('FK_PADRE_MENU_ID', 'FkPadreMenuId', 'int', Creol=
eTypes::INTEGER, 'menu', 'ID', false, null);
=20
 		$tMap->addColumn('ORDEN', 'Orden', 'int', CreoleTypes::INTEGER, false)=
;

Modified: prosistem/alba/trunk/alba/lib/model/om/BaseMenu.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- prosistem/alba/trunk/alba/lib/model/om/BaseMenu.php	2007-02-07 16:35:=
21 UTC (rev 4165)
+++ prosistem/alba/trunk/alba/lib/model/om/BaseMenu.php	2007-02-07 19:46:=
46 UTC (rev 4166)
@@ -57,6 +57,13 @@
=20
=20
 	/**
+	 * The value for the target field.
+	 * @var string
+	 */
+	protected $target =3D '';
+
+
+	/**
 	 * The value for the fk_padre_menu_id field.
 	 * @var int
 	 */
@@ -145,6 +152,17 @@
 	}
=20
 	/**
+	 * Get the [target] column value.
+	 *=20
+	 * @return string
+	 */
+	public function getTarget()
+	{
+
+		return $this->target;
+	}
+
+	/**
 	 * Get the [fk_padre_menu_id] column value.
 	 *=20
 	 * @return int
@@ -231,6 +249,22 @@
 	} // setPerm()
=20
 	/**
+	 * Set the value of [target] column.
+	 *=20
+	 * @param string $v new value
+	 * @return void
+	 */
+	public function setTarget($v)
+	{
+
+		if ($this->target !=3D=3D $v || $v =3D=3D=3D '') {
+			$this->target =3D $v;
+			$this->modifiedColumns[] =3D MenuPeer::TARGET;
+		}
+
+	} // setTarget()
+
+	/**
 	 * Set the value of [fk_padre_menu_id] column.
 	 *=20
 	 * @param int $v new value
@@ -291,16 +325,18 @@
=20
 			$this->perm =3D $rs->getString($startcol + 3);
=20
-			$this->fk_padre_menu_id =3D $rs->getInt($startcol + 4);
+			$this->target =3D $rs->getString($startcol + 4);
=20
-			$this->orden =3D $rs->getInt($startcol + 5);
+			$this->fk_padre_menu_id =3D $rs->getInt($startcol + 5);
=20
+			$this->orden =3D $rs->getInt($startcol + 6);
+
 			$this->resetModified();
=20
 			$this->setNew(false);
=20
 			// FIXME - using NUM_COLUMNS may be clearer.
-			return $startcol + 6; // 6 =3D MenuPeer::NUM_COLUMNS - MenuPeer::NUM_=
LAZY_LOAD_COLUMNS).
+			return $startcol + 7; // 7 =3D MenuPeer::NUM_COLUMNS - MenuPeer::NUM_=
LAZY_LOAD_COLUMNS).
=20
 		} catch (Exception $e) {
 			throw new PropelException("Error populating Menu object", $e);
@@ -551,9 +587,12 @@
 				return $this->getPerm();
 				break;
 			case 4:
+				return $this->getTarget();
+				break;
+			case 5:
 				return $this->getFkPadreMenuId();
 				break;
-			case 5:
+			case 6:
 				return $this->getOrden();
 				break;
 			default:
@@ -580,8 +619,9 @@
 			$keys[1] =3D> $this->getNombre(),
 			$keys[2] =3D> $this->getLink(),
 			$keys[3] =3D> $this->getPerm(),
-			$keys[4] =3D> $this->getFkPadreMenuId(),
-			$keys[5] =3D> $this->getOrden(),
+			$keys[4] =3D> $this->getTarget(),
+			$keys[5] =3D> $this->getFkPadreMenuId(),
+			$keys[6] =3D> $this->getOrden(),
 		);
 		return $result;
 	}
@@ -626,9 +666,12 @@
 				$this->setPerm($value);
 				break;
 			case 4:
+				$this->setTarget($value);
+				break;
+			case 5:
 				$this->setFkPadreMenuId($value);
 				break;
-			case 5:
+			case 6:
 				$this->setOrden($value);
 				break;
 		} // switch()
@@ -658,8 +701,9 @@
 		if (array_key_exists($keys[1], $arr)) $this->setNombre($arr[$keys[1]])=
;
 		if (array_key_exists($keys[2], $arr)) $this->setLink($arr[$keys[2]]);
 		if (array_key_exists($keys[3], $arr)) $this->setPerm($arr[$keys[3]]);
-		if (array_key_exists($keys[4], $arr)) $this->setFkPadreMenuId($arr[$ke=
ys[4]]);
-		if (array_key_exists($keys[5], $arr)) $this->setOrden($arr[$keys[5]]);
+		if (array_key_exists($keys[4], $arr)) $this->setTarget($arr[$keys[4]])=
;
+		if (array_key_exists($keys[5], $arr)) $this->setFkPadreMenuId($arr[$ke=
ys[5]]);
+		if (array_key_exists($keys[6], $arr)) $this->setOrden($arr[$keys[6]]);
 	}
=20
 	/**
@@ -675,6 +719,7 @@
 		if ($this->isColumnModified(MenuPeer::NOMBRE)) $criteria->add(MenuPeer=
::NOMBRE, $this->nombre);
 		if ($this->isColumnModified(MenuPeer::LINK)) $criteria->add(MenuPeer::=
LINK, $this->link);
 		if ($this->isColumnModified(MenuPeer::PERM)) $criteria->add(MenuPeer::=
PERM, $this->perm);
+		if ($this->isColumnModified(MenuPeer::TARGET)) $criteria->add(MenuPeer=
::TARGET, $this->target);
 		if ($this->isColumnModified(MenuPeer::FK_PADRE_MENU_ID)) $criteria->ad=
d(MenuPeer::FK_PADRE_MENU_ID, $this->fk_padre_menu_id);
 		if ($this->isColumnModified(MenuPeer::ORDEN)) $criteria->add(MenuPeer:=
:ORDEN, $this->orden);
=20
@@ -737,6 +782,8 @@
=20
 		$copyObj->setPerm($this->perm);
=20
+		$copyObj->setTarget($this->target);
+
 		$copyObj->setFkPadreMenuId($this->fk_padre_menu_id);
=20
 		$copyObj->setOrden($this->orden);

Modified: prosistem/alba/trunk/alba/lib/model/om/BaseMenuPeer.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- prosistem/alba/trunk/alba/lib/model/om/BaseMenuPeer.php	2007-02-07 16=
:35:21 UTC (rev 4165)
+++ prosistem/alba/trunk/alba/lib/model/om/BaseMenuPeer.php	2007-02-07 19=
:46:46 UTC (rev 4166)
@@ -24,7 +24,7 @@
 	const CLASS_DEFAULT =3D 'model.Menu';
=20
 	/** The total number of columns. */
-	const NUM_COLUMNS =3D 6;
+	const NUM_COLUMNS =3D 7;
=20
 	/** The number of lazy-loaded columns. */
 	const NUM_LAZY_LOAD_COLUMNS =3D 0;
@@ -42,6 +42,9 @@
 	/** the column name for the PERM field */
 	const PERM =3D 'menu.PERM';
=20
+	/** the column name for the TARGET field */
+	const TARGET =3D 'menu.TARGET';
+
 	/** the column name for the FK_PADRE_MENU_ID field */
 	const FK_PADRE_MENU_ID =3D 'menu.FK_PADRE_MENU_ID';
=20
@@ -59,10 +62,10 @@
 	 * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] =3D 'Id'
 	 */
 	private static $fieldNames =3D array (
-		BasePeer::TYPE_PHPNAME =3D> array ('Id', 'Nombre', 'Link', 'Perm', 'Fk=
PadreMenuId', 'Orden', ),
-		BasePeer::TYPE_COLNAME =3D> array (MenuPeer::ID, MenuPeer::NOMBRE, Men=
uPeer::LINK, MenuPeer::PERM, MenuPeer::FK_PADRE_MENU_ID, MenuPeer::ORDEN,=
 ),
-		BasePeer::TYPE_FIELDNAME =3D> array ('id', 'nombre', 'link', 'perm', '=
fk_padre_menu_id', 'orden', ),
-		BasePeer::TYPE_NUM =3D> array (0, 1, 2, 3, 4, 5, )
+		BasePeer::TYPE_PHPNAME =3D> array ('Id', 'Nombre', 'Link', 'Perm', 'Ta=
rget', 'FkPadreMenuId', 'Orden', ),
+		BasePeer::TYPE_COLNAME =3D> array (MenuPeer::ID, MenuPeer::NOMBRE, Men=
uPeer::LINK, MenuPeer::PERM, MenuPeer::TARGET, MenuPeer::FK_PADRE_MENU_ID=
, MenuPeer::ORDEN, ),
+		BasePeer::TYPE_FIELDNAME =3D> array ('id', 'nombre', 'link', 'perm', '=
target', 'fk_padre_menu_id', 'orden', ),
+		BasePeer::TYPE_NUM =3D> array (0, 1, 2, 3, 4, 5, 6, )
 	);
=20
 	/**
@@ -72,10 +75,10 @@
 	 * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] =3D 0
 	 */
 	private static $fieldKeys =3D array (
-		BasePeer::TYPE_PHPNAME =3D> array ('Id' =3D> 0, 'Nombre' =3D> 1, 'Link=
' =3D> 2, 'Perm' =3D> 3, 'FkPadreMenuId' =3D> 4, 'Orden' =3D> 5, ),
-		BasePeer::TYPE_COLNAME =3D> array (MenuPeer::ID =3D> 0, MenuPeer::NOMB=
RE =3D> 1, MenuPeer::LINK =3D> 2, MenuPeer::PERM =3D> 3, MenuPeer::FK_PAD=
RE_MENU_ID =3D> 4, MenuPeer::ORDEN =3D> 5, ),
-		BasePeer::TYPE_FIELDNAME =3D> array ('id' =3D> 0, 'nombre' =3D> 1, 'li=
nk' =3D> 2, 'perm' =3D> 3, 'fk_padre_menu_id' =3D> 4, 'orden' =3D> 5, ),
-		BasePeer::TYPE_NUM =3D> array (0, 1, 2, 3, 4, 5, )
+		BasePeer::TYPE_PHPNAME =3D> array ('Id' =3D> 0, 'Nombre' =3D> 1, 'Link=
' =3D> 2, 'Perm' =3D> 3, 'Target' =3D> 4, 'FkPadreMenuId' =3D> 5, 'Orden'=
 =3D> 6, ),
+		BasePeer::TYPE_COLNAME =3D> array (MenuPeer::ID =3D> 0, MenuPeer::NOMB=
RE =3D> 1, MenuPeer::LINK =3D> 2, MenuPeer::PERM =3D> 3, MenuPeer::TARGET=
 =3D> 4, MenuPeer::FK_PADRE_MENU_ID =3D> 5, MenuPeer::ORDEN =3D> 6, ),
+		BasePeer::TYPE_FIELDNAME =3D> array ('id' =3D> 0, 'nombre' =3D> 1, 'li=
nk' =3D> 2, 'perm' =3D> 3, 'target' =3D> 4, 'fk_padre_menu_id' =3D> 5, 'o=
rden' =3D> 6, ),
+		BasePeer::TYPE_NUM =3D> array (0, 1, 2, 3, 4, 5, 6, )
 	);
=20
 	/**
@@ -184,6 +187,8 @@
=20
 		$criteria->addSelectColumn(MenuPeer::PERM);
=20
+		$criteria->addSelectColumn(MenuPeer::TARGET);
+
 		$criteria->addSelectColumn(MenuPeer::FK_PADRE_MENU_ID);
=20
 		$criteria->addSelectColumn(MenuPeer::ORDEN);




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