-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Juan Bordón
committed
May 12, 2005
1 parent
c1b3c4b
commit 76625e6
Showing
8 changed files
with
322 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
<? | ||
require_once("nucleo/browser/clases/objeto_ci_me_tab.php"); | ||
|
||
class ci_abm_dbt extends objeto_ci_me_tab | ||
{ | ||
protected $clave; | ||
protected $selecciones; | ||
private $db_tablas; | ||
|
||
function __construct($id) | ||
{ | ||
parent::__construct($id); | ||
include_once( $this->info["parametro_a"]); | ||
$clase = $this->info['parametro_b']; | ||
$this->db_tablas = new $clase($this->info['fuente']); | ||
} | ||
|
||
function destruir() | ||
{ | ||
ei_arbol($this->get_estado_sesion(),"ESTADO Interno"); | ||
//ei_arbol($this->db_tablas->info()); | ||
parent::destruir(); | ||
} | ||
|
||
function mantener_estado_sesion() | ||
{ | ||
$estado = parent::mantener_estado_sesion(); | ||
$estado[] = "clave"; | ||
$estado[] = "selecciones"; | ||
return $estado; | ||
} | ||
|
||
//------------------------------------------------------------------------ | ||
//-- traduzco los EVENTOS al DB_TABLAS | ||
//------------------------------------------------------------------------ | ||
|
||
public function registrar_evento($id, $evento, $parametros=null) | ||
//Se disparan eventos dentro del nivel actual | ||
{ | ||
$e = explode("_",$id); | ||
$tipo_ei = $e[0]; | ||
$elemento = $e[1]; | ||
if($tipo_ei == "c"){ //-- Cuadro | ||
//Los cuadros solo seleccionan | ||
$this->selecciones[$elemento] = $parametros; | ||
}elseif($tipo == "f"){ //-- Formulario | ||
//Obtengo el elemento manejado | ||
//Obtengo la cantidad de registro que maneja db_registros | ||
$cr = $this->db_tablas->obtener_cardinalidad(); | ||
if($cr == 1){ | ||
//El elemento maneja un registro | ||
ei_arbol($parametros, $id . " - " .$evento); | ||
}else{ | ||
//El elemento maneja mas de un registro | ||
ei_arbol($parametros, $id . " - " .$evento); | ||
} | ||
} | ||
} | ||
|
||
function proveer_datos_dependencias($dependencia) | ||
{ | ||
echo "CONTENIDO DE : $dependencia"; | ||
} | ||
|
||
//------------------------------------------------------------------------ | ||
//-- Eventos del ABM | ||
//------------------------------------------------------------------------ | ||
|
||
function cargar($clave) | ||
{ | ||
$this->clave = $clave; | ||
$this->db_tablas->cargar($clave); | ||
} | ||
|
||
function eliminar() | ||
{ | ||
// Eliminar el DBTABLA | ||
} | ||
//------------------------------------------------------------------------ | ||
} | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
<? | ||
require_once("nucleo/browser/clases/objeto_ci_me.php"); | ||
|
||
class ci_abm_nav extends objeto_ci_me | ||
{ | ||
protected $filtro; | ||
protected $seleccion; | ||
protected $nueva_entidad=false; | ||
|
||
function __construct($id) | ||
{ | ||
parent::__construct($id); | ||
} | ||
|
||
function mantener_estado_sesion() | ||
{ | ||
$estado = parent::mantener_estado_sesion(); | ||
$estado[] = "filtro"; | ||
$estado[] = "seleccion"; | ||
$estado[] = "nueva_entidad"; | ||
return $estado; | ||
} | ||
|
||
function evt__limpieza_memoria() | ||
{ | ||
parent::evt__limpieza_memoria(array("filtro")); | ||
} | ||
|
||
//-------------------------------------------------------------- | ||
// Construccion de la INTERFACE | ||
//-------------------------------------------------------------- | ||
|
||
function get_etapa_actual() | ||
//Sobreescribir la navegacion entre etapas | ||
{ | ||
return ( isset($this->seleccion) || ( isset($this->nueva_entidad) && $this->nueva_entidad) ) ? 2 : 1; | ||
} | ||
|
||
function get_lista_eventos() | ||
//Generacion de la lista de botones | ||
{ | ||
$evento = array(); | ||
if( $this->get_etapa_actual() === 1 ){ | ||
//Seleeccion de la entidad | ||
$evento['agregar']['etiqueta'] = "&Agregar"; | ||
$evento['agregar']['estilo']="abm-input"; | ||
$evento['agregar']['tip']="Agregar un nuevo registro"; | ||
}else{ | ||
//Edicion de la entidad | ||
$evento['cancelar']['etiqueta'] = "&Cancelar"; | ||
$evento['cancelar']['estilo']="abm-input"; | ||
//$evento['cancelar']['confirmacion'] = "¿Desea descartar los cambios?"; | ||
$evento['cancelar']['tip']="Descarta los cambios realizados"; | ||
$evento['guardar']['etiqueta'] = "&Guardar"; | ||
$evento['guardar']['estilo']="abm-input"; | ||
$evento['guardar']['tip']="Guardar cambios"; | ||
$evento['eliminar']['etiqueta'] = "&Eliminar"; | ||
$evento['eliminar']['confirmacion'] = "¿Desea eliminar los datos?"; | ||
$evento['eliminar']['estilo']="abm-input-eliminar"; | ||
$evento['eliminar']['tip']="Eliminar los datos"; | ||
} | ||
return $evento; | ||
} | ||
|
||
function evt__pre_cargar_datos_dependencias() | ||
{ | ||
if( ($this->get_etapa_actual() === 2) && (isset($this->seleccion)) ){ | ||
$this->dependencias["entidad"]->cargar($this->seleccion); | ||
} | ||
} | ||
|
||
//-------------------------------------------------------------- | ||
// EVENTOS Dependencias | ||
//-------------------------------------------------------------- | ||
|
||
function evt__filtro__filtrar($datos) | ||
{ | ||
//if( array_no_nulo($datos) ){ | ||
$this->filtro = $datos; | ||
//} | ||
} | ||
|
||
function evt__filtro__limpiar($datos) | ||
{ | ||
unset( $this->filtro ); | ||
} | ||
|
||
function evt__filtro__carga() | ||
{ | ||
if(isset($this->filtro)){ | ||
return $this->filtro; | ||
} | ||
} | ||
|
||
function evt__cuadro__seleccion($registro) | ||
{ | ||
$this->seleccion = $registro; | ||
|
||
} | ||
|
||
function evt__cuadro__carga() | ||
{ | ||
include_once("p_nucleo/anexas/dao_anx.php"); | ||
return dao_anx::get_personas(); | ||
} | ||
|
||
//-------------------------------------------------------------- | ||
|
||
function evt__agregar() | ||
{ | ||
$this->nueva_entidad = true; | ||
} | ||
|
||
function evt__entrada__2() | ||
{ | ||
} | ||
|
||
function evt__cancelar() | ||
{ | ||
$this->disparar_limpieza_memoria(); | ||
} | ||
|
||
function evt__guardar() | ||
{ | ||
|
||
} | ||
|
||
function evt__eliminar() | ||
{ | ||
|
||
} | ||
//-------------------------------------------------------------- | ||
|
||
} | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.