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
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. 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 menu informes). Se agrega el atributo target="valor" en el link. Modified: prosistem/alba/trunk/alba/apps/principal/modules/menu/config/generator.yml =================================================================== --- prosistem/alba/trunk/alba/apps/principal/modules/menu/config/generator.yml 2007-02-07 16:35:21 UTC (rev 4165) +++ prosistem/alba/trunk/alba/apps/principal/modules/menu/config/generator.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, =nombre, link, perm, _fk_padre_menu_id, orden ] + display: [ id, =nombre, link, perm, _fk_padre_menu_id, target, orden ] edit: title: Modificar menu \ No newline at end of file Modified: prosistem/alba/trunk/alba/apps/principal/templates/menu.php =================================================================== --- prosistem/alba/trunk/alba/apps/principal/templates/menu.php 2007-02-07 16:35:21 UTC (rev 4165) +++ prosistem/alba/trunk/alba/apps/principal/templates/menu.php 2007-02-07 19:46:46 UTC (rev 4166) @@ -22,8 +22,8 @@ * menu * * @package alba - * @author José Luis Di Biase <[email protected]> - * @author Héctor Sanchez <[email protected]> + * @author Jos� Luis Di Biase <[email protected]> + * @author H�ctor Sanchez <[email protected]> * @author Fernando Toledo <[email protected]> * @version SVN: $Id$ * @filesource @@ -45,14 +45,18 @@ echo "\t<li>"; if ($nodo->getNombre() != '-') { echo "<span></span>"; - echo link_to($nodo->getNombre(),$nodo->getLink()) . "\n"; + if ($nodo->getTarget() == '') + echo link_to($nodo->getNombre(),$nodo->getLink()) . "\n"; + else + echo link_to($nodo->getNombre(),$nodo->getLink(),array('target'=> $nodo->getTarget())) . "\n"; + if ($nodo->getLink() =='#') 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 =================================================================== --- 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="nombre" type="VARCHAR" size="255" required="true" default=""/> <column name="link" type="VARCHAR" size="255" required="true" default=""/> <column name="perm" type="VARCHAR" size="255" required="true" default=""/> + <column name="target" type="VARCHAR" size="255" required="true" default=""/> <column name="fk_padre_menu_id" type="INTEGER" required="false"/> <column name="orden" type="INTEGER" required="false"/> <index name="nombre_menu"> Modified: prosistem/alba/trunk/alba/data/sql/actualizacion_1.0b_a_1.0rc.sql =================================================================== --- prosistem/alba/trunk/alba/data/sql/actualizacion_1.0b_a_1.0rc.sql 2007-02-07 16:35:21 UTC (rev 4165) +++ prosistem/alba/trunk/alba/data/sql/actualizacion_1.0b_a_1.0rc.sql 2007-02-07 19:46:46 UTC (rev 4166) @@ -5,4 +5,6 @@ ALTER TABLE `adjunto` CHANGE `ruta` `ruta` VARCHAR(255) NOT NULL; 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 =================================================================== --- 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 @@ $tMap->addColumn('PERM', 'Perm', 'string', CreoleTypes::VARCHAR, true); + $tMap->addColumn('TARGET', 'Target', 'string', CreoleTypes::VARCHAR, true); + $tMap->addForeignKey('FK_PADRE_MENU_ID', 'FkPadreMenuId', 'int', CreoleTypes::INTEGER, 'menu', 'ID', false, null); $tMap->addColumn('ORDEN', 'Orden', 'int', CreoleTypes::INTEGER, false); Modified: prosistem/alba/trunk/alba/lib/model/om/BaseMenu.php =================================================================== --- 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 @@ /** + * The value for the target field. + * @var string + */ + protected $target = ''; + + + /** * The value for the fk_padre_menu_id field. * @var int */ @@ -145,6 +152,17 @@ } /** + * Get the [target] column value. + * + * @return string + */ + public function getTarget() + { + + return $this->target; + } + + /** * Get the [fk_padre_menu_id] column value. * * @return int @@ -231,6 +249,22 @@ } // setPerm() /** + * Set the value of [target] column. + * + * @param string $v new value + * @return void + */ + public function setTarget($v) + { + + if ($this->target !== $v || $v === '') { + $this->target = $v; + $this->modifiedColumns[] = MenuPeer::TARGET; + } + + } // setTarget() + + /** * Set the value of [fk_padre_menu_id] column. * * @param int $v new value @@ -291,16 +325,18 @@ $this->perm = $rs->getString($startcol + 3); - $this->fk_padre_menu_id = $rs->getInt($startcol + 4); + $this->target = $rs->getString($startcol + 4); - $this->orden = $rs->getInt($startcol + 5); + $this->fk_padre_menu_id = $rs->getInt($startcol + 5); + $this->orden = $rs->getInt($startcol + 6); + $this->resetModified(); $this->setNew(false); // FIXME - using NUM_COLUMNS may be clearer. - return $startcol + 6; // 6 = MenuPeer::NUM_COLUMNS - MenuPeer::NUM_LAZY_LOAD_COLUMNS). + return $startcol + 7; // 7 = MenuPeer::NUM_COLUMNS - MenuPeer::NUM_LAZY_LOAD_COLUMNS). } 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] => $this->getNombre(), $keys[2] => $this->getLink(), $keys[3] => $this->getPerm(), - $keys[4] => $this->getFkPadreMenuId(), - $keys[5] => $this->getOrden(), + $keys[4] => $this->getTarget(), + $keys[5] => $this->getFkPadreMenuId(), + $keys[6] => $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[$keys[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[$keys[5]]); + if (array_key_exists($keys[6], $arr)) $this->setOrden($arr[$keys[6]]); } /** @@ -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->add(MenuPeer::FK_PADRE_MENU_ID, $this->fk_padre_menu_id); if ($this->isColumnModified(MenuPeer::ORDEN)) $criteria->add(MenuPeer::ORDEN, $this->orden); @@ -737,6 +782,8 @@ $copyObj->setPerm($this->perm); + $copyObj->setTarget($this->target); + $copyObj->setFkPadreMenuId($this->fk_padre_menu_id); $copyObj->setOrden($this->orden); Modified: prosistem/alba/trunk/alba/lib/model/om/BaseMenuPeer.php =================================================================== --- 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 = 'model.Menu'; /** The total number of columns. */ - const NUM_COLUMNS = 6; + const NUM_COLUMNS = 7; /** The number of lazy-loaded columns. */ const NUM_LAZY_LOAD_COLUMNS = 0; @@ -42,6 +42,9 @@ /** the column name for the PERM field */ const PERM = 'menu.PERM'; + /** the column name for the TARGET field */ + const TARGET = 'menu.TARGET'; + /** the column name for the FK_PADRE_MENU_ID field */ const FK_PADRE_MENU_ID = 'menu.FK_PADRE_MENU_ID'; @@ -59,10 +62,10 @@ * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id' */ private static $fieldNames = array ( - BasePeer::TYPE_PHPNAME => array ('Id', 'Nombre', 'Link', 'Perm', 'FkPadreMenuId', 'Orden', ), - BasePeer::TYPE_COLNAME => array (MenuPeer::ID, MenuPeer::NOMBRE, MenuPeer::LINK, MenuPeer::PERM, MenuPeer::FK_PADRE_MENU_ID, MenuPeer::ORDEN, ), - BasePeer::TYPE_FIELDNAME => array ('id', 'nombre', 'link', 'perm', 'fk_padre_menu_id', 'orden', ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, ) + BasePeer::TYPE_PHPNAME => array ('Id', 'Nombre', 'Link', 'Perm', 'Target', 'FkPadreMenuId', 'Orden', ), + BasePeer::TYPE_COLNAME => array (MenuPeer::ID, MenuPeer::NOMBRE, MenuPeer::LINK, MenuPeer::PERM, MenuPeer::TARGET, MenuPeer::FK_PADRE_MENU_ID, MenuPeer::ORDEN, ), + BasePeer::TYPE_FIELDNAME => array ('id', 'nombre', 'link', 'perm', 'target', 'fk_padre_menu_id', 'orden', ), + BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, ) ); /** @@ -72,10 +75,10 @@ * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0 */ private static $fieldKeys = array ( - BasePeer::TYPE_PHPNAME => array ('Id' => 0, 'Nombre' => 1, 'Link' => 2, 'Perm' => 3, 'FkPadreMenuId' => 4, 'Orden' => 5, ), - BasePeer::TYPE_COLNAME => array (MenuPeer::ID => 0, MenuPeer::NOMBRE => 1, MenuPeer::LINK => 2, MenuPeer::PERM => 3, MenuPeer::FK_PADRE_MENU_ID => 4, MenuPeer::ORDEN => 5, ), - BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'nombre' => 1, 'link' => 2, 'perm' => 3, 'fk_padre_menu_id' => 4, 'orden' => 5, ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, ) + BasePeer::TYPE_PHPNAME => array ('Id' => 0, 'Nombre' => 1, 'Link' => 2, 'Perm' => 3, 'Target' => 4, 'FkPadreMenuId' => 5, 'Orden' => 6, ), + BasePeer::TYPE_COLNAME => array (MenuPeer::ID => 0, MenuPeer::NOMBRE => 1, MenuPeer::LINK => 2, MenuPeer::PERM => 3, MenuPeer::TARGET => 4, MenuPeer::FK_PADRE_MENU_ID => 5, MenuPeer::ORDEN => 6, ), + BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'nombre' => 1, 'link' => 2, 'perm' => 3, 'target' => 4, 'fk_padre_menu_id' => 5, 'orden' => 6, ), + BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, ) ); /** @@ -184,6 +187,8 @@ $criteria->addSelectColumn(MenuPeer::PERM); + $criteria->addSelectColumn(MenuPeer::TARGET); + $criteria->addSelectColumn(MenuPeer::FK_PADRE_MENU_ID); $criteria->addSelectColumn(MenuPeer::ORDEN);
participants (1)
-
commits@pressenter.com.ar