setClaseActual("IgepPeticiones"); //La select que mostramos $this->str_select = 'SELECT id as "id", tptc_peticiones.estado as "estado", desc_estado as "desc_estado", fcmn_fechas(fpeticion,\'FECHAHORA\') as "fpeticion", fcmn_fechas(fsolucion,\'FECHA\') as "fsolucion", problema as "problema", solucion as "solucion" FROM tptc_peticiones, tptc_estado_peticiones'; //WHERE $str_where = "aplicacion = '".$g_aplicacion."' "; $str_where .= "AND tptc_peticiones.estado = tptc_estado_peticiones.estado "; $str_where .= "AND usuario = '".strtoupper(ComunSession::dameUsuario())."' "; $this->str_where = $str_where; //El orden de presentación de los datos $this->str_orderBy = "2,1 desc"; //Añadimos los Matching - Correspondecias campoTPL <-> campoBD (casan con el filtro) $this->addMatching("id","id","tptc_peticiones"); $this->addMatching("estado","estado","tptc_peticiones"); $this->addMatching("fpeticion","fpeticion","tptc_peticiones"); $this->addMatching("fsolucion","fsolucion","tptc_peticiones"); $this->addMatching("problema","problema","tptc_peticiones"); $this->addMatching("solucion","solucion","tptc_peticiones"); // Añadimos la clase del detalle y el campo que relaciona los dos paneles (clase,camposPadre, camposHijo) $this->addHijo("IgepPeticionesD",array( "id"),array( "id")); // Lista con datos obtenidos de una consulta $listaEstado = new IgepLista("estado","PETICIONES"); $listaEstado->addOpcion('','Todas'); $listaEstado->setSeleccionado(''); $this->addLista($listaEstado); }//Fin de Constructor //Añadimos a la Busqueda parámetros especiales function preBuscar(&$objDatos){ $str_where = ''; //Comprobamos el intervalo de fechas $fechaIni = $objDatos->getCampo('fechaIni'); $fechaFin = $objDatos->getCampo('fechaFin'); //Número de Factura if (!empty($fechaIni) && !empty($fechaFin)){ $where .= "(fpeticion >= '".$fechaIni."' AND fpeticion <= '".$fechaFin."')"; } if (!empty($fechaIni) && empty($fechaFin)){ $where .= "(fpeticion >= '".$fechaIni."')"; } if (empty($fechaIni) && !empty($fechaFin)){ $where .= "(fpeticion <= '".$fechaFin."')"; } $this->setParametrosBusqueda($where); return 0; } }//Fin de IgepPeticiones ?>