Viewing file: ci_comentarios.php (3.6 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
class ci_comentarios extends tdfonline_ci
{
protected $s__datos_filtro;
protected $s__datos;
//-----------------------------------------------------------------------------------
//---- Filtro -----------------------------------------------------------------------
//-----------------------------------------------------------------------------------
function conf__filtro(toba_ei_formulario $filtro)
{
if (isset($this->s__datos_filtro)) {
$filtro->set_datos($this->s__datos_filtro);
}
}
function evt__filtro__filtrar($datos)
{
$this->s__datos_filtro = $datos;
}
function evt__filtro__cancelar()
{
unset($this->s__datos_filtro);
}
//-----------------------------------------------------------------------------------
//---- cuadro -----------------------------------------------------------------------
//-----------------------------------------------------------------------------------
function conf__cuadro(tdfonline_ei_cuadro $cuadro)
{
if (isset($this->s__datos_filtro)) {
$this->s__datos = $this->dep('datos')->tabla('comentario')->get_listado($this->s__datos_filtro);
} else {
$this->s__datos = $this->dep('datos')->tabla('comentario')->get_listado();
}
$cuadro->set_datos($this->s__datos);
}
function evt__cuadro__aprobar($datos)
{
$this->dep('datos')->tabla('comentario')->set_estado($datos['id_comentario'],1); //aprobar
$this->resetear();
}
function evt__cuadro__rechazar($datos)
{
$this->dep('datos')->tabla('comentario')->set_estado($datos['id_comentario'],2); //rechazar
$this->resetear();
}
function evt__cuadro__cancelar($datos)
{
$this->dep('datos')->tabla('comentario')->set_estado($datos['id_comentario'],3); //cancelar
$this->resetear();
}
function conf_evt__cuadro__aprobar($evento, $fila)
{
switch($this->s__datos[$fila]['estado']){
//case 0: //Pendiente
// $evento->anular();
// break;
case 1: //Aprobado
$evento->anular();
break;
//case 2: //Rechazado
// $evento->anular();
// break;
//case 3: //Cancelado
// $evento->anular();
// break;
}
}
function conf_evt__cuadro__rechazar($evento, $fila)
{
switch($this->s__datos[$fila]['estado']){
//case 0: //Pendiente
// $evento->anular();
// break;
//case 1: //Aprobado
// $evento->anular();
// break;
case 2: //Rechazado
$evento->anular();
break;
//case 3: //Cancelado
// $evento->anular();
}
}
function conf_evt__cuadro__cancelar($evento, $fila)
{
switch($this->s__datos[$fila]['estado']){
//case 0: //Pendiente
// $evento->anular();
// break;
//case 1: //Aprobado
// $evento->anular();
// break;
//case 2: //Rechazado
// $evento->anular();
// break;
case 3: //Cancelado
$evento->anular();
}
}
//-----------------------------------------------------------------------------------
//---- Eventos ----------------------------------------------------------------------
//-----------------------------------------------------------------------------------
function evt__agregar()
{
$this->set_pantalla('pant_edicion');
}
//-----------------------------------------------------------------------------------
//---- Funcioanes -------------------------------------------------------------------
//-----------------------------------------------------------------------------------
function resetear()
{
$this->dep('datos')->resetear();
$this->set_pantalla('pant_inicial');
}
}
?>
|