From 834bee1cf2c5bd122b3e941c70b5c2f03ee80a27 Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Sun, 25 Jul 2004 02:16:48 +0000 Subject: [PATCH] Se cambiar MECON por MLIB. --- lib/MLIB/Agente.php | 215 ++++++++++++ lib/{MECON => MLIB}/Array/Pager.php | 0 lib/{MECON => MLIB}/DB/Pager.php | 0 lib/{MECON => MLIB}/DBO.php | 0 lib/{MECON => MLIB}/Date.php | 0 lib/MLIB/Dependencia.php | 252 ++++++++++++++ lib/{MECON => MLIB}/Feriado.php | 0 lib/{MECON => MLIB}/Graph.php | 0 .../Graph/external/jpgraph/QPL.txt | 0 .../Graph/external/jpgraph/README | 0 .../Graph/external/jpgraph/src/Changelog | 0 .../Graph/external/jpgraph/src/flags.dat | Bin .../jpgraph/src/flags_thumb100x100.dat | Bin .../external/jpgraph/src/flags_thumb35x35.dat | Bin .../external/jpgraph/src/flags_thumb60x60.dat | Bin .../external/jpgraph/src/imgdata_balls.inc | 0 .../external/jpgraph/src/imgdata_bevels.inc | 0 .../external/jpgraph/src/imgdata_diamonds.inc | 0 .../external/jpgraph/src/imgdata_pushpins.inc | 0 .../external/jpgraph/src/imgdata_squares.inc | 0 .../external/jpgraph/src/imgdata_stars.inc | 0 .../Graph/external/jpgraph/src/jpgraph.php | 0 .../external/jpgraph/src/jpgraph_bar.php | 0 .../external/jpgraph/src/jpgraph_canvas.php | 0 .../jpgraph/src/jpgraph_canvtools.php | 0 .../external/jpgraph/src/jpgraph_error.php | 0 .../external/jpgraph/src/jpgraph_flags.php | 0 .../external/jpgraph/src/jpgraph_gantt.php | 0 .../external/jpgraph/src/jpgraph_gb2312.php | 0 .../external/jpgraph/src/jpgraph_gradient.php | 0 .../external/jpgraph/src/jpgraph_line.php | 0 .../external/jpgraph/src/jpgraph_log.php | 0 .../external/jpgraph/src/jpgraph_pie.php | 0 .../external/jpgraph/src/jpgraph_pie3d.php | 0 .../external/jpgraph/src/jpgraph_plotmark.inc | 0 .../external/jpgraph/src/jpgraph_polar.php | 0 .../external/jpgraph/src/jpgraph_radar.php | 0 .../external/jpgraph/src/jpgraph_regstat.php | 0 .../external/jpgraph/src/jpgraph_scatter.php | 0 .../external/jpgraph/src/jpgraph_stock.php | 0 .../Graph/external/jpgraph/src/utils/Readme | 0 .../jpgraph/src/utils/jpdocgen/README | 0 .../src/utils/jpdocgen/dbschema_ddda.php | 0 .../jpgraph/src/utils/jpdocgen/ddda_chkdb.php | 0 .../jpgraph/src/utils/jpdocgen/de_normal.css | 0 .../jpgraph/src/utils/jpdocgen/de_utils.php | 0 .../jpgraph/src/utils/jpdocgen/jpclassref.php | 0 .../src/utils/jpdocgen/jpd_editclass.php | 0 .../src/utils/jpdocgen/jpd_editmethod.php | 0 .../src/utils/jpdocgen/jpd_editproject.php | 0 .../jpgraph/src/utils/jpdocgen/jpdb.php | 0 .../src/utils/jpdocgen/jpdbdelclass.php | 0 .../jpgraph/src/utils/jpdocgen/jpdocedit.php | 0 .../jpgraph/src/utils/jpdocgen/jpgendb.php | 0 .../src/utils/jpdocgen/jpgendbdriver.php | 0 .../jpgraph/src/utils/jpdocgen/jpgendoc.php | 0 .../src/utils/jpdocgen/jpgenhtmldoc.php | 0 .../src/utils/jpdocgen/jplintdriver.php | 0 .../jpgraph/src/utils/jpdocgen/jplintphp.php | 0 .../jpgraph/src/utils/misc/adjimg.php | 0 .../external/jpgraph/src/utils/misc/chkgd.php | 0 .../jpgraph/src/utils/misc/gencolorchart.php | 0 .../jpgraph/src/utils/misc/imgdbschema.inc | 0 .../jpgraph/src/utils/misc/mkgrad.php | 0 lib/{MECON => MLIB}/HTML/Arbol.php | 0 lib/{MECON => MLIB}/HTML/ArbolDB.php | 0 lib/{MECON => MLIB}/HTML/Error.php | 0 lib/{MECON => MLIB}/HTML/Icon.php | 0 lib/{MECON => MLIB}/HTML/Image.php | 0 lib/{MECON => MLIB}/HTML/Link.php | 0 lib/{MECON => MLIB}/HTML/Page.php | 0 lib/{MECON => MLIB}/HTML/QuickForm.php | 0 .../HTML/QuickForm/Renderer/Tabla.php | 0 .../QuickForm/Renderer/TablaHorizontal.php | 0 .../HTML/QuickForm/caritas.php | 0 lib/{MECON => MLIB}/HTML/QuickForm/mdate.php | 0 lib/{MECON => MLIB}/HTML/QuickFormSimple.php | 0 lib/{MECON => MLIB}/HTML/Tabla.php | 0 .../HTML/Tabla/estilo_claro.php | 0 .../HTML/Tabla/estilo_comun.php | 0 .../HTML/Tabla/estilo_impresion.php | 0 .../HTML/Tabla/estilo_llamativo.php | 0 .../HTML/Tabla/estilo_medio.php | 0 .../HTML/Tabla/estilo_oscuro.php | 0 lib/{MECON => MLIB}/HTML/TablaDB.php | 0 lib/MLIB/Legajos/Estudios.php | 93 +++++ lib/MLIB/Legajos/ExperienciaLaboral.php | 121 +++++++ lib/MLIB/Legajos/Familiares.php | 128 +++++++ lib/MLIB/Marco.php | 326 ++++++++++++++++++ lib/{MECON => MLIB}/Marco/Copete.php | 0 lib/{MECON => MLIB}/Marco/ImagenAnimada.php | 0 lib/{MECON => MLIB}/Marco/Marco.php | 0 lib/{MECON => MLIB}/Marco/Menu.php | 0 lib/{MECON => MLIB}/Marco/MenuHorizontal.php | 0 lib/{MECON => MLIB}/Marco/MenuOculto.php | 0 lib/{MECON => MLIB}/Marco/MenuPrincipal.php | 0 lib/{MECON => MLIB}/Marco/MenuVertical.php | 0 lib/{MECON => MLIB}/Marco/Seccion.php | 0 lib/MLIB/Novedad.php | 84 +++++ lib/MLIB/NovedadesDia.php | 186 ++++++++++ lib/{MECON => MLIB}/PDF.php | 0 lib/{MECON => MLIB}/PDF/Contenido.php | 0 lib/{MECON => MLIB}/PDF/Header.php | 0 lib/{MECON => MLIB}/PDF/HeaderDefecto.php | 0 .../PDF/HeaderDefecto/medidas.php | 0 lib/{MECON => MLIB}/PDF/Imagen.php | 0 lib/{MECON => MLIB}/PDF/Marco.php | 0 lib/{MECON => MLIB}/PDF/Marco/medidas.php | 0 lib/{MECON => MLIB}/PDF/SaltoPagina.php | 0 lib/{MECON => MLIB}/PDF/Separador.php | 0 lib/{MECON => MLIB}/PDF/Tabla.php | 0 lib/{MECON => MLIB}/PDF/Tabla/medidas.php | 0 lib/{MECON => MLIB}/PDF/Texto.php | 0 .../PDF/external/chart.class.php | 0 .../PDF/external/phppdflib.class.php | 0 .../PDF/external/strlen.inc.php | 0 .../PDF/external/template.class.php | 0 lib/{MECON => MLIB}/PDF/medidas.php | 0 lib/{MECON => MLIB}/Tiempo/Banda.php | 0 lib/{MECON => MLIB}/Tiempo/Hora.php | 0 lib/{MECON => MLIB}/Tiempo/Intervalo.php | 0 lib/MLIB/Usuario.php | 302 ++++++++++++++++ lib/{MECON => MLIB}/XLS.php | 0 lib/{MECON => MLIB}/defaults.php | 0 lib/{MECON => MLIB}/general.php | 0 lib/MLIB/includes/no_autorizado.html | 33 ++ 126 files changed, 1740 insertions(+) create mode 100644 lib/MLIB/Agente.php rename lib/{MECON => MLIB}/Array/Pager.php (100%) rename lib/{MECON => MLIB}/DB/Pager.php (100%) rename lib/{MECON => MLIB}/DBO.php (100%) rename lib/{MECON => MLIB}/Date.php (100%) create mode 100644 lib/MLIB/Dependencia.php rename lib/{MECON => MLIB}/Feriado.php (100%) rename lib/{MECON => MLIB}/Graph.php (100%) rename lib/{MECON => MLIB}/Graph/external/jpgraph/QPL.txt (100%) rename lib/{MECON => MLIB}/Graph/external/jpgraph/README (100%) rename lib/{MECON => MLIB}/Graph/external/jpgraph/src/Changelog (100%) rename lib/{MECON => MLIB}/Graph/external/jpgraph/src/flags.dat (100%) rename lib/{MECON => MLIB}/Graph/external/jpgraph/src/flags_thumb100x100.dat (100%) rename lib/{MECON => MLIB}/Graph/external/jpgraph/src/flags_thumb35x35.dat (100%) rename lib/{MECON => MLIB}/Graph/external/jpgraph/src/flags_thumb60x60.dat (100%) rename lib/{MECON => MLIB}/Graph/external/jpgraph/src/imgdata_balls.inc (100%) rename lib/{MECON => MLIB}/Graph/external/jpgraph/src/imgdata_bevels.inc (100%) rename lib/{MECON => MLIB}/Graph/external/jpgraph/src/imgdata_diamonds.inc (100%) rename lib/{MECON => MLIB}/Graph/external/jpgraph/src/imgdata_pushpins.inc (100%) rename lib/{MECON => MLIB}/Graph/external/jpgraph/src/imgdata_squares.inc (100%) rename lib/{MECON => MLIB}/Graph/external/jpgraph/src/imgdata_stars.inc (100%) rename lib/{MECON => MLIB}/Graph/external/jpgraph/src/jpgraph.php (100%) rename lib/{MECON => MLIB}/Graph/external/jpgraph/src/jpgraph_bar.php (100%) rename lib/{MECON => MLIB}/Graph/external/jpgraph/src/jpgraph_canvas.php (100%) rename lib/{MECON => MLIB}/Graph/external/jpgraph/src/jpgraph_canvtools.php (100%) rename lib/{MECON => MLIB}/Graph/external/jpgraph/src/jpgraph_error.php (100%) rename lib/{MECON => MLIB}/Graph/external/jpgraph/src/jpgraph_flags.php (100%) rename lib/{MECON => MLIB}/Graph/external/jpgraph/src/jpgraph_gantt.php (100%) rename lib/{MECON => MLIB}/Graph/external/jpgraph/src/jpgraph_gb2312.php (100%) rename lib/{MECON => MLIB}/Graph/external/jpgraph/src/jpgraph_gradient.php (100%) rename lib/{MECON => MLIB}/Graph/external/jpgraph/src/jpgraph_line.php (100%) rename lib/{MECON => MLIB}/Graph/external/jpgraph/src/jpgraph_log.php (100%) rename lib/{MECON => MLIB}/Graph/external/jpgraph/src/jpgraph_pie.php (100%) rename lib/{MECON => MLIB}/Graph/external/jpgraph/src/jpgraph_pie3d.php (100%) rename lib/{MECON => MLIB}/Graph/external/jpgraph/src/jpgraph_plotmark.inc (100%) rename lib/{MECON => MLIB}/Graph/external/jpgraph/src/jpgraph_polar.php (100%) rename lib/{MECON => MLIB}/Graph/external/jpgraph/src/jpgraph_radar.php (100%) rename lib/{MECON => MLIB}/Graph/external/jpgraph/src/jpgraph_regstat.php (100%) rename lib/{MECON => MLIB}/Graph/external/jpgraph/src/jpgraph_scatter.php (100%) rename lib/{MECON => MLIB}/Graph/external/jpgraph/src/jpgraph_stock.php (100%) rename lib/{MECON => MLIB}/Graph/external/jpgraph/src/utils/Readme (100%) rename lib/{MECON => MLIB}/Graph/external/jpgraph/src/utils/jpdocgen/README (100%) rename lib/{MECON => MLIB}/Graph/external/jpgraph/src/utils/jpdocgen/dbschema_ddda.php (100%) rename lib/{MECON => MLIB}/Graph/external/jpgraph/src/utils/jpdocgen/ddda_chkdb.php (100%) rename lib/{MECON => MLIB}/Graph/external/jpgraph/src/utils/jpdocgen/de_normal.css (100%) rename lib/{MECON => MLIB}/Graph/external/jpgraph/src/utils/jpdocgen/de_utils.php (100%) rename lib/{MECON => MLIB}/Graph/external/jpgraph/src/utils/jpdocgen/jpclassref.php (100%) rename lib/{MECON => MLIB}/Graph/external/jpgraph/src/utils/jpdocgen/jpd_editclass.php (100%) rename lib/{MECON => MLIB}/Graph/external/jpgraph/src/utils/jpdocgen/jpd_editmethod.php (100%) rename lib/{MECON => MLIB}/Graph/external/jpgraph/src/utils/jpdocgen/jpd_editproject.php (100%) rename lib/{MECON => MLIB}/Graph/external/jpgraph/src/utils/jpdocgen/jpdb.php (100%) rename lib/{MECON => MLIB}/Graph/external/jpgraph/src/utils/jpdocgen/jpdbdelclass.php (100%) rename lib/{MECON => MLIB}/Graph/external/jpgraph/src/utils/jpdocgen/jpdocedit.php (100%) rename lib/{MECON => MLIB}/Graph/external/jpgraph/src/utils/jpdocgen/jpgendb.php (100%) rename lib/{MECON => MLIB}/Graph/external/jpgraph/src/utils/jpdocgen/jpgendbdriver.php (100%) rename lib/{MECON => MLIB}/Graph/external/jpgraph/src/utils/jpdocgen/jpgendoc.php (100%) rename lib/{MECON => MLIB}/Graph/external/jpgraph/src/utils/jpdocgen/jpgenhtmldoc.php (100%) rename lib/{MECON => MLIB}/Graph/external/jpgraph/src/utils/jpdocgen/jplintdriver.php (100%) rename lib/{MECON => MLIB}/Graph/external/jpgraph/src/utils/jpdocgen/jplintphp.php (100%) rename lib/{MECON => MLIB}/Graph/external/jpgraph/src/utils/misc/adjimg.php (100%) rename lib/{MECON => MLIB}/Graph/external/jpgraph/src/utils/misc/chkgd.php (100%) rename lib/{MECON => MLIB}/Graph/external/jpgraph/src/utils/misc/gencolorchart.php (100%) rename lib/{MECON => MLIB}/Graph/external/jpgraph/src/utils/misc/imgdbschema.inc (100%) rename lib/{MECON => MLIB}/Graph/external/jpgraph/src/utils/misc/mkgrad.php (100%) rename lib/{MECON => MLIB}/HTML/Arbol.php (100%) rename lib/{MECON => MLIB}/HTML/ArbolDB.php (100%) rename lib/{MECON => MLIB}/HTML/Error.php (100%) rename lib/{MECON => MLIB}/HTML/Icon.php (100%) rename lib/{MECON => MLIB}/HTML/Image.php (100%) rename lib/{MECON => MLIB}/HTML/Link.php (100%) rename lib/{MECON => MLIB}/HTML/Page.php (100%) rename lib/{MECON => MLIB}/HTML/QuickForm.php (100%) rename lib/{MECON => MLIB}/HTML/QuickForm/Renderer/Tabla.php (100%) rename lib/{MECON => MLIB}/HTML/QuickForm/Renderer/TablaHorizontal.php (100%) rename lib/{MECON => MLIB}/HTML/QuickForm/caritas.php (100%) rename lib/{MECON => MLIB}/HTML/QuickForm/mdate.php (100%) rename lib/{MECON => MLIB}/HTML/QuickFormSimple.php (100%) rename lib/{MECON => MLIB}/HTML/Tabla.php (100%) rename lib/{MECON => MLIB}/HTML/Tabla/estilo_claro.php (100%) rename lib/{MECON => MLIB}/HTML/Tabla/estilo_comun.php (100%) rename lib/{MECON => MLIB}/HTML/Tabla/estilo_impresion.php (100%) rename lib/{MECON => MLIB}/HTML/Tabla/estilo_llamativo.php (100%) rename lib/{MECON => MLIB}/HTML/Tabla/estilo_medio.php (100%) rename lib/{MECON => MLIB}/HTML/Tabla/estilo_oscuro.php (100%) rename lib/{MECON => MLIB}/HTML/TablaDB.php (100%) create mode 100644 lib/MLIB/Legajos/Estudios.php create mode 100644 lib/MLIB/Legajos/ExperienciaLaboral.php create mode 100644 lib/MLIB/Legajos/Familiares.php create mode 100644 lib/MLIB/Marco.php rename lib/{MECON => MLIB}/Marco/Copete.php (100%) rename lib/{MECON => MLIB}/Marco/ImagenAnimada.php (100%) rename lib/{MECON => MLIB}/Marco/Marco.php (100%) rename lib/{MECON => MLIB}/Marco/Menu.php (100%) rename lib/{MECON => MLIB}/Marco/MenuHorizontal.php (100%) rename lib/{MECON => MLIB}/Marco/MenuOculto.php (100%) rename lib/{MECON => MLIB}/Marco/MenuPrincipal.php (100%) rename lib/{MECON => MLIB}/Marco/MenuVertical.php (100%) rename lib/{MECON => MLIB}/Marco/Seccion.php (100%) create mode 100644 lib/MLIB/Novedad.php create mode 100644 lib/MLIB/NovedadesDia.php rename lib/{MECON => MLIB}/PDF.php (100%) rename lib/{MECON => MLIB}/PDF/Contenido.php (100%) rename lib/{MECON => MLIB}/PDF/Header.php (100%) rename lib/{MECON => MLIB}/PDF/HeaderDefecto.php (100%) rename lib/{MECON => MLIB}/PDF/HeaderDefecto/medidas.php (100%) rename lib/{MECON => MLIB}/PDF/Imagen.php (100%) rename lib/{MECON => MLIB}/PDF/Marco.php (100%) rename lib/{MECON => MLIB}/PDF/Marco/medidas.php (100%) rename lib/{MECON => MLIB}/PDF/SaltoPagina.php (100%) rename lib/{MECON => MLIB}/PDF/Separador.php (100%) rename lib/{MECON => MLIB}/PDF/Tabla.php (100%) rename lib/{MECON => MLIB}/PDF/Tabla/medidas.php (100%) rename lib/{MECON => MLIB}/PDF/Texto.php (100%) rename lib/{MECON => MLIB}/PDF/external/chart.class.php (100%) rename lib/{MECON => MLIB}/PDF/external/phppdflib.class.php (100%) rename lib/{MECON => MLIB}/PDF/external/strlen.inc.php (100%) rename lib/{MECON => MLIB}/PDF/external/template.class.php (100%) rename lib/{MECON => MLIB}/PDF/medidas.php (100%) rename lib/{MECON => MLIB}/Tiempo/Banda.php (100%) rename lib/{MECON => MLIB}/Tiempo/Hora.php (100%) rename lib/{MECON => MLIB}/Tiempo/Intervalo.php (100%) create mode 100644 lib/MLIB/Usuario.php rename lib/{MECON => MLIB}/XLS.php (100%) rename lib/{MECON => MLIB}/defaults.php (100%) rename lib/{MECON => MLIB}/general.php (100%) create mode 100644 lib/MLIB/includes/no_autorizado.html diff --git a/lib/MLIB/Agente.php b/lib/MLIB/Agente.php new file mode 100644 index 0000000..38b6fd2 --- /dev/null +++ b/lib/MLIB/Agente.php @@ -0,0 +1,215 @@ + +------------------------------------------------------------------------------- +$Id$ +-----------------------------------------------------------------------------*/ + +require_once 'DB.php'; +require_once 'MECON/Tiempo/Hora.php'; + +/** + * @access public + */ +class MECON_Agente { + + /** + * Documento del agente. + */ + var $agente; + + /** + * Datos del agente + */ + var $datos=array(); + + /** + * @return string + */ + function getDependencia() + { + if(in_array('codep',array_keys($this->datos))) + return $this->datos['codep'];//TODO esta no es la columna correcta + else + return false; + } + + /** + * @return void + * @access public + */ + function getTipo() + { + if(in_array('marco_legal',array_keys($this->datos))) + return 'CON '.$this->datos['marco_legal']; + elseif(in_array('tipo_agente',array_keys($this->datos))) + return $this->datos['tipo_agente']; + else + return false; + } + + /** + * @param dbh $db + * @param int $agente + * + * @return void + * @access public + */ + function MECON_Agente(&$db,$agente=null) + { + $this->_db = $db; + //$this->_db = DB::connect('mysql://intranet:intranet@intranet-db.mecon.ar/novedades'); + if(! is_null($agente)) { + $this->buscarAgente($agente); + } + } + + /** + * @return void + * @access public + */ + function getNombre() + { + if(in_array('nombre',array_keys($this->datos))) + return $this->datos['nombre']; + else + return false; + } + + /** + * @return void + * @access public + */ + function getHoraDesde() + { + if(in_array('hora_desde',$this->datos)) + return new MECON_Tiempo_Hora($this->datos['hora_desde']); + elseif(in_array('hentra',$this->datos)) + return new MECON_Tiempo_Hora($this->datos['hentra']); + else + return false; + } + + /** + * @return void + * @access public + */ + function getHoraHasta() + { + if(in_array('hora_hasta',$this->datos)) + return new MECON_Tiempo_Hora($this->datos['hora_hasta']); + elseif(in_array('hsale',$this->datos)) + return new MECON_Tiempo_Hora($this->datos['hsale']); + else + return false; + } + + /** + * @return void + * @access public + */ + function getCuil() + { + if(in_array('cuil',$this->datos)) + { + $aux = $this->datos['cuil']; + $aux = preg_replace('/(\d{2})(\d*)(\d{1})/','$1-$2-$3',$aux); + return $aux; + }else + { + return false; + } + } + + /** + * @return void + * @access public + */ + function getOtrosDatos() + { + if(!is_null($this->datos['tipo_agente'])) { + $aux['tipo_doc'] = $this->datos['tipodoc']; + $aux['fecha_nac'] = $this->datos['fecha_nac']; + $aux['edad'] = $this->datos['edad']; + $aux['estado_civil'] = $this->datos['estado_civil']; + $aux['domicilio'] = $this->datos['domicilio']; + $aux['puerta'] = $this->datos['num_puerta']; + $aux['piso'] = $this->datos['piso']; + $aux['depto'] = $this->datos['depto']; + $aux['localidad'] = $this->datos['localidad']; + $aux['provincia'] = $this->datos['provincia']; + $aux['calle1'] = $this->datos['calle1']; + $aux['calle2'] = $this->datos['calle2']; + $aux['cp'] = $this->datos['cp']; + $aux['telefono'] = $this->datos['telefono']; + $aux['cargo'] = $this->datos['cargo']; + $aux['nivel'] = $this->datos['nivel']; + $aux['grado'] = $this->datos['grado']; + $aux['func_ejec'] = $this->datos['func_ejec']; + $aux['obra_social'] = $this->datos['obra_social']; + $aux['afiliado'] = $this->datos['afiliado']; + $aux['conyuge'] = $this->datos['conyuge']; + $aux['fecha_nac_conyuge'] = $this->datos['fecha_nac_cony']; + $aux['tipo_doc_conyuge'] = $this->datos['tipodoc_cony']; + $aux['nro_doc_cony'] = $this->datos['nrodoc_cony']; + return $aux; + } else { + return false; + } + } + + /** + * @param int $agente + * + * @return void + * @access public + */ + function buscarAgente($agente) + { + $this->agente = $agente; + $sql = "SELECT * + FROM novedades.web003 + WHERE nrodoc = ".$agente." AND tipo_agente <> 'AUT'"; + $result = $this->_db->query($sql); + if(DB::isError($result)) + trigger_error($result->getMessage("query mal hecho"), E_USER_ERROR); + if($result->numRows() > 0) { + $this->datos = $result->fetchRow(DB_FETCHMODE_ASSOC); + } else { + $sql = "SELECT * + FROM Contratados.Contratados + WHERE nrodoc = ".$agente; + $result = $this->_db->query($sql); + if(DB::isError($result)) { + trigger_error($result->getMessage("query mal hecho"), E_USER_ERROR); + } + if($result->numRows() > 0) { + $this->datos = $result->fetchRow(DB_FETCHMODE_ASSOC); + } else { + return false; + } + } + return true; + } + +} +?> \ No newline at end of file diff --git a/lib/MECON/Array/Pager.php b/lib/MLIB/Array/Pager.php similarity index 100% rename from lib/MECON/Array/Pager.php rename to lib/MLIB/Array/Pager.php diff --git a/lib/MECON/DB/Pager.php b/lib/MLIB/DB/Pager.php similarity index 100% rename from lib/MECON/DB/Pager.php rename to lib/MLIB/DB/Pager.php diff --git a/lib/MECON/DBO.php b/lib/MLIB/DBO.php similarity index 100% rename from lib/MECON/DBO.php rename to lib/MLIB/DBO.php diff --git a/lib/MECON/Date.php b/lib/MLIB/Date.php similarity index 100% rename from lib/MECON/Date.php rename to lib/MLIB/Date.php diff --git a/lib/MLIB/Dependencia.php b/lib/MLIB/Dependencia.php new file mode 100644 index 0000000..6b01f1f --- /dev/null +++ b/lib/MLIB/Dependencia.php @@ -0,0 +1,252 @@ + +------------------------------------------------------------------------------- +$Id$ +-----------------------------------------------------------------------------*/ + +#require_once 'PEAR.php'; +require_once 'MECON/Agente.php'; +require_once 'DB.php'; + +/** + * @access protected + */ +class MECON_Dependencia { + + /** + * @protected + */ + var $_dbh; + + /** + * @protected + */ + var $_database; + + /** + * @var int $codep + * @access public + */ + var $codep; + + /** + * @var int $nombre + * @access public + */ + var $nombre; + + /** + * @var int $nombre_breve + * @access public + */ + var $nombre_breve; + + /** + * Id de la dependencia en la base. + * + * @var int $dependencia_id + * @access public + */ + var $dependencia_id = null; + + /** + * @param string $codep + * @param int $id + * + * @return void + * @access public + */ + function MECON_Dependencia(&$db, $codep, $id = null, $database = 'CODEP') + { + $this->_db = $db; + $this->_database = $database; + + if(!is_null($codep)) { + $this->codep = $codep; + + $sql = "SELECT nombre, nombre_breve, dependencia_id, codigo_actual + FROM ".$database.".Dependencias + WHERE codigo_actual = '".$this->codep."' AND + dependencia_esta_activa = 1"; + + $result = $this->_db->query($sql); + } + else { + $this->dependencia_id = $id; + + $sql = "SELECT nombre, nombre_breve, dependencia_id, codigo_actual + FROM ".$database.".Dependencias + WHERE dependencia_id = ".$this->dependencia_id." AND + dependencia_esta_activa = 1"; + $result = $this->_db->query($sql); + } + + if(DB::isError($result)) + trigger_error($result->getMessage("query mal hecho"), E_USER_ERROR); + + if($result->numRows() > 0) { + $row = $result->fetchRow(DB_FETCHMODE_ASSOC); + $this->codep = $row['codigo_actual']; + $this->nombre = $row['nombre']; + $this->nombre_breve = $row['nombre_breve']; + $this->dependencia_id = $row['dependencia_id']; + } + } + + + /** + * @return void + * @access public + */ + function getAgentes() + { + //Planta y becarios + $agentes = array(); + $sql = "SELECT nrodoc + FROM novedades.web003 + WHERE codep = '".$this->codep."'"; + $result = $this->_db->query($sql); + if(DB::isError($result)) + trigger_error($result->getMessage("query mal hecho"), E_USER_ERROR); + while($row = $result->fetchRow()) + $agentes[$row[0]] = new MECON_Agente($this->_db, $row[0]); + //Contratados + $sql = "SELECT nrodoc + FROM Contratados.Contratados + WHERE codep = '".$this->codep."'"; + $result = $this->_db->query($sql); + if(DB::isError($result)) + trigger_error($result->getMessage("query mal hecho"), E_USER_ERROR); + while($row = $result->fetchRow()) + $agentes[$row[0]] = new MECON_Agente($this->_db, $row[0]); + return $agentes; + } + + + /** + * @return dependencia + * @access public + * @static + */ + function getDependencias() + { + $base = (isset($this->_database))? $this->_database : "CODEP"; + $sql = "SELECT codigo_actual + FROM ".$base.".Dependencias + WHERE dependencia_esta_activa = 1"; + $result = $this->_db->query($sql); + if(DB::isError($result)) + trigger_error($result->getMessage("query mal hecho"), E_USER_ERROR); + $dependencias = array(); + while($row = $result->fetchRow()) + $dependencias[] = $row[0]; + return $dependencias; + } + + + /** + * @return void + * @access public + */ + function getNombre() + { + return $this->nombre; + } + + + /** + * @return void + * @access public + */ + function getNombreBreve() + { + return $this->nombre_breve; + } + + + + /** + * Buscar dependencias por el codep. + * + * @param db &$dbh Base de Datos + * @param string $codep COdigo de dependencia, o parte del mismo seguido del comodIn (*) + * + * @return array + * @access public + * @static + */ + function buscarPorCodigo(&$dbh, $codep, $database = 'CODEP') + { + //Reemplazar el comodín + $codep = preg_replace ('/\*/', '%', $codep); + + $sql = " SELECT codigo_actual, codigo_comdoc, nombre, + dependencia_id, nombre_breve + FROM ".$database.".Dependencias + WHERE dependencia_esta_activa = 1 + AND codigo_actual LIKE '".$codep."' + ORDER BY codigo_actual "; + + $dbh->setFetchMode(DB_FETCHMODE_ASSOC); + $result = $dbh->query($sql); + + return $result; + } + + + + /** + * @param db &$dbh Base de Datos + * @param string $clave Cadena de palabras clave del nombre de la dependencia. + * + * @return array + * @access public + * @static + */ + function buscarPorNombre(&$dbh, $clave, $database = 'CODEP') + { + //ReducciOn de espacios en blanco + $clave = preg_replace ('/\s+/', ' ', $clave); + + $sql = " SELECT codigo_actual, codigo_comdoc, nombre, dependencia_id, + nombre_breve + FROM ".$database.".Dependencias + WHERE dependencia_esta_activa = 1 "; + + //Separar la cadena de palabras clave + $items = split(' ', $clave); + foreach ($items as $i){ + $sql.= " AND nombre like '%".$i."%' "; + } + + $sql.= " ORDER BY codigo_actual"; + + $dbh->setFetchMode(DB_FETCHMODE_ASSOC); + $result = $dbh->query($sql); + + return $result; + } + + +} +?> \ No newline at end of file diff --git a/lib/MECON/Feriado.php b/lib/MLIB/Feriado.php similarity index 100% rename from lib/MECON/Feriado.php rename to lib/MLIB/Feriado.php diff --git a/lib/MECON/Graph.php b/lib/MLIB/Graph.php similarity index 100% rename from lib/MECON/Graph.php rename to lib/MLIB/Graph.php diff --git a/lib/MECON/Graph/external/jpgraph/QPL.txt b/lib/MLIB/Graph/external/jpgraph/QPL.txt similarity index 100% rename from lib/MECON/Graph/external/jpgraph/QPL.txt rename to lib/MLIB/Graph/external/jpgraph/QPL.txt diff --git a/lib/MECON/Graph/external/jpgraph/README b/lib/MLIB/Graph/external/jpgraph/README similarity index 100% rename from lib/MECON/Graph/external/jpgraph/README rename to lib/MLIB/Graph/external/jpgraph/README diff --git a/lib/MECON/Graph/external/jpgraph/src/Changelog b/lib/MLIB/Graph/external/jpgraph/src/Changelog similarity index 100% rename from lib/MECON/Graph/external/jpgraph/src/Changelog rename to lib/MLIB/Graph/external/jpgraph/src/Changelog diff --git a/lib/MECON/Graph/external/jpgraph/src/flags.dat b/lib/MLIB/Graph/external/jpgraph/src/flags.dat similarity index 100% rename from lib/MECON/Graph/external/jpgraph/src/flags.dat rename to lib/MLIB/Graph/external/jpgraph/src/flags.dat diff --git a/lib/MECON/Graph/external/jpgraph/src/flags_thumb100x100.dat b/lib/MLIB/Graph/external/jpgraph/src/flags_thumb100x100.dat similarity index 100% rename from lib/MECON/Graph/external/jpgraph/src/flags_thumb100x100.dat rename to lib/MLIB/Graph/external/jpgraph/src/flags_thumb100x100.dat diff --git a/lib/MECON/Graph/external/jpgraph/src/flags_thumb35x35.dat b/lib/MLIB/Graph/external/jpgraph/src/flags_thumb35x35.dat similarity index 100% rename from lib/MECON/Graph/external/jpgraph/src/flags_thumb35x35.dat rename to lib/MLIB/Graph/external/jpgraph/src/flags_thumb35x35.dat diff --git a/lib/MECON/Graph/external/jpgraph/src/flags_thumb60x60.dat b/lib/MLIB/Graph/external/jpgraph/src/flags_thumb60x60.dat similarity index 100% rename from lib/MECON/Graph/external/jpgraph/src/flags_thumb60x60.dat rename to lib/MLIB/Graph/external/jpgraph/src/flags_thumb60x60.dat diff --git a/lib/MECON/Graph/external/jpgraph/src/imgdata_balls.inc b/lib/MLIB/Graph/external/jpgraph/src/imgdata_balls.inc similarity index 100% rename from lib/MECON/Graph/external/jpgraph/src/imgdata_balls.inc rename to lib/MLIB/Graph/external/jpgraph/src/imgdata_balls.inc diff --git a/lib/MECON/Graph/external/jpgraph/src/imgdata_bevels.inc b/lib/MLIB/Graph/external/jpgraph/src/imgdata_bevels.inc similarity index 100% rename from lib/MECON/Graph/external/jpgraph/src/imgdata_bevels.inc rename to lib/MLIB/Graph/external/jpgraph/src/imgdata_bevels.inc diff --git a/lib/MECON/Graph/external/jpgraph/src/imgdata_diamonds.inc b/lib/MLIB/Graph/external/jpgraph/src/imgdata_diamonds.inc similarity index 100% rename from lib/MECON/Graph/external/jpgraph/src/imgdata_diamonds.inc rename to lib/MLIB/Graph/external/jpgraph/src/imgdata_diamonds.inc diff --git a/lib/MECON/Graph/external/jpgraph/src/imgdata_pushpins.inc b/lib/MLIB/Graph/external/jpgraph/src/imgdata_pushpins.inc similarity index 100% rename from lib/MECON/Graph/external/jpgraph/src/imgdata_pushpins.inc rename to lib/MLIB/Graph/external/jpgraph/src/imgdata_pushpins.inc diff --git a/lib/MECON/Graph/external/jpgraph/src/imgdata_squares.inc b/lib/MLIB/Graph/external/jpgraph/src/imgdata_squares.inc similarity index 100% rename from lib/MECON/Graph/external/jpgraph/src/imgdata_squares.inc rename to lib/MLIB/Graph/external/jpgraph/src/imgdata_squares.inc diff --git a/lib/MECON/Graph/external/jpgraph/src/imgdata_stars.inc b/lib/MLIB/Graph/external/jpgraph/src/imgdata_stars.inc similarity index 100% rename from lib/MECON/Graph/external/jpgraph/src/imgdata_stars.inc rename to lib/MLIB/Graph/external/jpgraph/src/imgdata_stars.inc diff --git a/lib/MECON/Graph/external/jpgraph/src/jpgraph.php b/lib/MLIB/Graph/external/jpgraph/src/jpgraph.php similarity index 100% rename from lib/MECON/Graph/external/jpgraph/src/jpgraph.php rename to lib/MLIB/Graph/external/jpgraph/src/jpgraph.php diff --git a/lib/MECON/Graph/external/jpgraph/src/jpgraph_bar.php b/lib/MLIB/Graph/external/jpgraph/src/jpgraph_bar.php similarity index 100% rename from lib/MECON/Graph/external/jpgraph/src/jpgraph_bar.php rename to lib/MLIB/Graph/external/jpgraph/src/jpgraph_bar.php diff --git a/lib/MECON/Graph/external/jpgraph/src/jpgraph_canvas.php b/lib/MLIB/Graph/external/jpgraph/src/jpgraph_canvas.php similarity index 100% rename from lib/MECON/Graph/external/jpgraph/src/jpgraph_canvas.php rename to lib/MLIB/Graph/external/jpgraph/src/jpgraph_canvas.php diff --git a/lib/MECON/Graph/external/jpgraph/src/jpgraph_canvtools.php b/lib/MLIB/Graph/external/jpgraph/src/jpgraph_canvtools.php similarity index 100% rename from lib/MECON/Graph/external/jpgraph/src/jpgraph_canvtools.php rename to lib/MLIB/Graph/external/jpgraph/src/jpgraph_canvtools.php diff --git a/lib/MECON/Graph/external/jpgraph/src/jpgraph_error.php b/lib/MLIB/Graph/external/jpgraph/src/jpgraph_error.php similarity index 100% rename from lib/MECON/Graph/external/jpgraph/src/jpgraph_error.php rename to lib/MLIB/Graph/external/jpgraph/src/jpgraph_error.php diff --git a/lib/MECON/Graph/external/jpgraph/src/jpgraph_flags.php b/lib/MLIB/Graph/external/jpgraph/src/jpgraph_flags.php similarity index 100% rename from lib/MECON/Graph/external/jpgraph/src/jpgraph_flags.php rename to lib/MLIB/Graph/external/jpgraph/src/jpgraph_flags.php diff --git a/lib/MECON/Graph/external/jpgraph/src/jpgraph_gantt.php b/lib/MLIB/Graph/external/jpgraph/src/jpgraph_gantt.php similarity index 100% rename from lib/MECON/Graph/external/jpgraph/src/jpgraph_gantt.php rename to lib/MLIB/Graph/external/jpgraph/src/jpgraph_gantt.php diff --git a/lib/MECON/Graph/external/jpgraph/src/jpgraph_gb2312.php b/lib/MLIB/Graph/external/jpgraph/src/jpgraph_gb2312.php similarity index 100% rename from lib/MECON/Graph/external/jpgraph/src/jpgraph_gb2312.php rename to lib/MLIB/Graph/external/jpgraph/src/jpgraph_gb2312.php diff --git a/lib/MECON/Graph/external/jpgraph/src/jpgraph_gradient.php b/lib/MLIB/Graph/external/jpgraph/src/jpgraph_gradient.php similarity index 100% rename from lib/MECON/Graph/external/jpgraph/src/jpgraph_gradient.php rename to lib/MLIB/Graph/external/jpgraph/src/jpgraph_gradient.php diff --git a/lib/MECON/Graph/external/jpgraph/src/jpgraph_line.php b/lib/MLIB/Graph/external/jpgraph/src/jpgraph_line.php similarity index 100% rename from lib/MECON/Graph/external/jpgraph/src/jpgraph_line.php rename to lib/MLIB/Graph/external/jpgraph/src/jpgraph_line.php diff --git a/lib/MECON/Graph/external/jpgraph/src/jpgraph_log.php b/lib/MLIB/Graph/external/jpgraph/src/jpgraph_log.php similarity index 100% rename from lib/MECON/Graph/external/jpgraph/src/jpgraph_log.php rename to lib/MLIB/Graph/external/jpgraph/src/jpgraph_log.php diff --git a/lib/MECON/Graph/external/jpgraph/src/jpgraph_pie.php b/lib/MLIB/Graph/external/jpgraph/src/jpgraph_pie.php similarity index 100% rename from lib/MECON/Graph/external/jpgraph/src/jpgraph_pie.php rename to lib/MLIB/Graph/external/jpgraph/src/jpgraph_pie.php diff --git a/lib/MECON/Graph/external/jpgraph/src/jpgraph_pie3d.php b/lib/MLIB/Graph/external/jpgraph/src/jpgraph_pie3d.php similarity index 100% rename from lib/MECON/Graph/external/jpgraph/src/jpgraph_pie3d.php rename to lib/MLIB/Graph/external/jpgraph/src/jpgraph_pie3d.php diff --git a/lib/MECON/Graph/external/jpgraph/src/jpgraph_plotmark.inc b/lib/MLIB/Graph/external/jpgraph/src/jpgraph_plotmark.inc similarity index 100% rename from lib/MECON/Graph/external/jpgraph/src/jpgraph_plotmark.inc rename to lib/MLIB/Graph/external/jpgraph/src/jpgraph_plotmark.inc diff --git a/lib/MECON/Graph/external/jpgraph/src/jpgraph_polar.php b/lib/MLIB/Graph/external/jpgraph/src/jpgraph_polar.php similarity index 100% rename from lib/MECON/Graph/external/jpgraph/src/jpgraph_polar.php rename to lib/MLIB/Graph/external/jpgraph/src/jpgraph_polar.php diff --git a/lib/MECON/Graph/external/jpgraph/src/jpgraph_radar.php b/lib/MLIB/Graph/external/jpgraph/src/jpgraph_radar.php similarity index 100% rename from lib/MECON/Graph/external/jpgraph/src/jpgraph_radar.php rename to lib/MLIB/Graph/external/jpgraph/src/jpgraph_radar.php diff --git a/lib/MECON/Graph/external/jpgraph/src/jpgraph_regstat.php b/lib/MLIB/Graph/external/jpgraph/src/jpgraph_regstat.php similarity index 100% rename from lib/MECON/Graph/external/jpgraph/src/jpgraph_regstat.php rename to lib/MLIB/Graph/external/jpgraph/src/jpgraph_regstat.php diff --git a/lib/MECON/Graph/external/jpgraph/src/jpgraph_scatter.php b/lib/MLIB/Graph/external/jpgraph/src/jpgraph_scatter.php similarity index 100% rename from lib/MECON/Graph/external/jpgraph/src/jpgraph_scatter.php rename to lib/MLIB/Graph/external/jpgraph/src/jpgraph_scatter.php diff --git a/lib/MECON/Graph/external/jpgraph/src/jpgraph_stock.php b/lib/MLIB/Graph/external/jpgraph/src/jpgraph_stock.php similarity index 100% rename from lib/MECON/Graph/external/jpgraph/src/jpgraph_stock.php rename to lib/MLIB/Graph/external/jpgraph/src/jpgraph_stock.php diff --git a/lib/MECON/Graph/external/jpgraph/src/utils/Readme b/lib/MLIB/Graph/external/jpgraph/src/utils/Readme similarity index 100% rename from lib/MECON/Graph/external/jpgraph/src/utils/Readme rename to lib/MLIB/Graph/external/jpgraph/src/utils/Readme diff --git a/lib/MECON/Graph/external/jpgraph/src/utils/jpdocgen/README b/lib/MLIB/Graph/external/jpgraph/src/utils/jpdocgen/README similarity index 100% rename from lib/MECON/Graph/external/jpgraph/src/utils/jpdocgen/README rename to lib/MLIB/Graph/external/jpgraph/src/utils/jpdocgen/README diff --git a/lib/MECON/Graph/external/jpgraph/src/utils/jpdocgen/dbschema_ddda.php b/lib/MLIB/Graph/external/jpgraph/src/utils/jpdocgen/dbschema_ddda.php similarity index 100% rename from lib/MECON/Graph/external/jpgraph/src/utils/jpdocgen/dbschema_ddda.php rename to lib/MLIB/Graph/external/jpgraph/src/utils/jpdocgen/dbschema_ddda.php diff --git a/lib/MECON/Graph/external/jpgraph/src/utils/jpdocgen/ddda_chkdb.php b/lib/MLIB/Graph/external/jpgraph/src/utils/jpdocgen/ddda_chkdb.php similarity index 100% rename from lib/MECON/Graph/external/jpgraph/src/utils/jpdocgen/ddda_chkdb.php rename to lib/MLIB/Graph/external/jpgraph/src/utils/jpdocgen/ddda_chkdb.php diff --git a/lib/MECON/Graph/external/jpgraph/src/utils/jpdocgen/de_normal.css b/lib/MLIB/Graph/external/jpgraph/src/utils/jpdocgen/de_normal.css similarity index 100% rename from lib/MECON/Graph/external/jpgraph/src/utils/jpdocgen/de_normal.css rename to lib/MLIB/Graph/external/jpgraph/src/utils/jpdocgen/de_normal.css diff --git a/lib/MECON/Graph/external/jpgraph/src/utils/jpdocgen/de_utils.php b/lib/MLIB/Graph/external/jpgraph/src/utils/jpdocgen/de_utils.php similarity index 100% rename from lib/MECON/Graph/external/jpgraph/src/utils/jpdocgen/de_utils.php rename to lib/MLIB/Graph/external/jpgraph/src/utils/jpdocgen/de_utils.php diff --git a/lib/MECON/Graph/external/jpgraph/src/utils/jpdocgen/jpclassref.php b/lib/MLIB/Graph/external/jpgraph/src/utils/jpdocgen/jpclassref.php similarity index 100% rename from lib/MECON/Graph/external/jpgraph/src/utils/jpdocgen/jpclassref.php rename to lib/MLIB/Graph/external/jpgraph/src/utils/jpdocgen/jpclassref.php diff --git a/lib/MECON/Graph/external/jpgraph/src/utils/jpdocgen/jpd_editclass.php b/lib/MLIB/Graph/external/jpgraph/src/utils/jpdocgen/jpd_editclass.php similarity index 100% rename from lib/MECON/Graph/external/jpgraph/src/utils/jpdocgen/jpd_editclass.php rename to lib/MLIB/Graph/external/jpgraph/src/utils/jpdocgen/jpd_editclass.php diff --git a/lib/MECON/Graph/external/jpgraph/src/utils/jpdocgen/jpd_editmethod.php b/lib/MLIB/Graph/external/jpgraph/src/utils/jpdocgen/jpd_editmethod.php similarity index 100% rename from lib/MECON/Graph/external/jpgraph/src/utils/jpdocgen/jpd_editmethod.php rename to lib/MLIB/Graph/external/jpgraph/src/utils/jpdocgen/jpd_editmethod.php diff --git a/lib/MECON/Graph/external/jpgraph/src/utils/jpdocgen/jpd_editproject.php b/lib/MLIB/Graph/external/jpgraph/src/utils/jpdocgen/jpd_editproject.php similarity index 100% rename from lib/MECON/Graph/external/jpgraph/src/utils/jpdocgen/jpd_editproject.php rename to lib/MLIB/Graph/external/jpgraph/src/utils/jpdocgen/jpd_editproject.php diff --git a/lib/MECON/Graph/external/jpgraph/src/utils/jpdocgen/jpdb.php b/lib/MLIB/Graph/external/jpgraph/src/utils/jpdocgen/jpdb.php similarity index 100% rename from lib/MECON/Graph/external/jpgraph/src/utils/jpdocgen/jpdb.php rename to lib/MLIB/Graph/external/jpgraph/src/utils/jpdocgen/jpdb.php diff --git a/lib/MECON/Graph/external/jpgraph/src/utils/jpdocgen/jpdbdelclass.php b/lib/MLIB/Graph/external/jpgraph/src/utils/jpdocgen/jpdbdelclass.php similarity index 100% rename from lib/MECON/Graph/external/jpgraph/src/utils/jpdocgen/jpdbdelclass.php rename to lib/MLIB/Graph/external/jpgraph/src/utils/jpdocgen/jpdbdelclass.php diff --git a/lib/MECON/Graph/external/jpgraph/src/utils/jpdocgen/jpdocedit.php b/lib/MLIB/Graph/external/jpgraph/src/utils/jpdocgen/jpdocedit.php similarity index 100% rename from lib/MECON/Graph/external/jpgraph/src/utils/jpdocgen/jpdocedit.php rename to lib/MLIB/Graph/external/jpgraph/src/utils/jpdocgen/jpdocedit.php diff --git a/lib/MECON/Graph/external/jpgraph/src/utils/jpdocgen/jpgendb.php b/lib/MLIB/Graph/external/jpgraph/src/utils/jpdocgen/jpgendb.php similarity index 100% rename from lib/MECON/Graph/external/jpgraph/src/utils/jpdocgen/jpgendb.php rename to lib/MLIB/Graph/external/jpgraph/src/utils/jpdocgen/jpgendb.php diff --git a/lib/MECON/Graph/external/jpgraph/src/utils/jpdocgen/jpgendbdriver.php b/lib/MLIB/Graph/external/jpgraph/src/utils/jpdocgen/jpgendbdriver.php similarity index 100% rename from lib/MECON/Graph/external/jpgraph/src/utils/jpdocgen/jpgendbdriver.php rename to lib/MLIB/Graph/external/jpgraph/src/utils/jpdocgen/jpgendbdriver.php diff --git a/lib/MECON/Graph/external/jpgraph/src/utils/jpdocgen/jpgendoc.php b/lib/MLIB/Graph/external/jpgraph/src/utils/jpdocgen/jpgendoc.php similarity index 100% rename from lib/MECON/Graph/external/jpgraph/src/utils/jpdocgen/jpgendoc.php rename to lib/MLIB/Graph/external/jpgraph/src/utils/jpdocgen/jpgendoc.php diff --git a/lib/MECON/Graph/external/jpgraph/src/utils/jpdocgen/jpgenhtmldoc.php b/lib/MLIB/Graph/external/jpgraph/src/utils/jpdocgen/jpgenhtmldoc.php similarity index 100% rename from lib/MECON/Graph/external/jpgraph/src/utils/jpdocgen/jpgenhtmldoc.php rename to lib/MLIB/Graph/external/jpgraph/src/utils/jpdocgen/jpgenhtmldoc.php diff --git a/lib/MECON/Graph/external/jpgraph/src/utils/jpdocgen/jplintdriver.php b/lib/MLIB/Graph/external/jpgraph/src/utils/jpdocgen/jplintdriver.php similarity index 100% rename from lib/MECON/Graph/external/jpgraph/src/utils/jpdocgen/jplintdriver.php rename to lib/MLIB/Graph/external/jpgraph/src/utils/jpdocgen/jplintdriver.php diff --git a/lib/MECON/Graph/external/jpgraph/src/utils/jpdocgen/jplintphp.php b/lib/MLIB/Graph/external/jpgraph/src/utils/jpdocgen/jplintphp.php similarity index 100% rename from lib/MECON/Graph/external/jpgraph/src/utils/jpdocgen/jplintphp.php rename to lib/MLIB/Graph/external/jpgraph/src/utils/jpdocgen/jplintphp.php diff --git a/lib/MECON/Graph/external/jpgraph/src/utils/misc/adjimg.php b/lib/MLIB/Graph/external/jpgraph/src/utils/misc/adjimg.php similarity index 100% rename from lib/MECON/Graph/external/jpgraph/src/utils/misc/adjimg.php rename to lib/MLIB/Graph/external/jpgraph/src/utils/misc/adjimg.php diff --git a/lib/MECON/Graph/external/jpgraph/src/utils/misc/chkgd.php b/lib/MLIB/Graph/external/jpgraph/src/utils/misc/chkgd.php similarity index 100% rename from lib/MECON/Graph/external/jpgraph/src/utils/misc/chkgd.php rename to lib/MLIB/Graph/external/jpgraph/src/utils/misc/chkgd.php diff --git a/lib/MECON/Graph/external/jpgraph/src/utils/misc/gencolorchart.php b/lib/MLIB/Graph/external/jpgraph/src/utils/misc/gencolorchart.php similarity index 100% rename from lib/MECON/Graph/external/jpgraph/src/utils/misc/gencolorchart.php rename to lib/MLIB/Graph/external/jpgraph/src/utils/misc/gencolorchart.php diff --git a/lib/MECON/Graph/external/jpgraph/src/utils/misc/imgdbschema.inc b/lib/MLIB/Graph/external/jpgraph/src/utils/misc/imgdbschema.inc similarity index 100% rename from lib/MECON/Graph/external/jpgraph/src/utils/misc/imgdbschema.inc rename to lib/MLIB/Graph/external/jpgraph/src/utils/misc/imgdbschema.inc diff --git a/lib/MECON/Graph/external/jpgraph/src/utils/misc/mkgrad.php b/lib/MLIB/Graph/external/jpgraph/src/utils/misc/mkgrad.php similarity index 100% rename from lib/MECON/Graph/external/jpgraph/src/utils/misc/mkgrad.php rename to lib/MLIB/Graph/external/jpgraph/src/utils/misc/mkgrad.php diff --git a/lib/MECON/HTML/Arbol.php b/lib/MLIB/HTML/Arbol.php similarity index 100% rename from lib/MECON/HTML/Arbol.php rename to lib/MLIB/HTML/Arbol.php diff --git a/lib/MECON/HTML/ArbolDB.php b/lib/MLIB/HTML/ArbolDB.php similarity index 100% rename from lib/MECON/HTML/ArbolDB.php rename to lib/MLIB/HTML/ArbolDB.php diff --git a/lib/MECON/HTML/Error.php b/lib/MLIB/HTML/Error.php similarity index 100% rename from lib/MECON/HTML/Error.php rename to lib/MLIB/HTML/Error.php diff --git a/lib/MECON/HTML/Icon.php b/lib/MLIB/HTML/Icon.php similarity index 100% rename from lib/MECON/HTML/Icon.php rename to lib/MLIB/HTML/Icon.php diff --git a/lib/MECON/HTML/Image.php b/lib/MLIB/HTML/Image.php similarity index 100% rename from lib/MECON/HTML/Image.php rename to lib/MLIB/HTML/Image.php diff --git a/lib/MECON/HTML/Link.php b/lib/MLIB/HTML/Link.php similarity index 100% rename from lib/MECON/HTML/Link.php rename to lib/MLIB/HTML/Link.php diff --git a/lib/MECON/HTML/Page.php b/lib/MLIB/HTML/Page.php similarity index 100% rename from lib/MECON/HTML/Page.php rename to lib/MLIB/HTML/Page.php diff --git a/lib/MECON/HTML/QuickForm.php b/lib/MLIB/HTML/QuickForm.php similarity index 100% rename from lib/MECON/HTML/QuickForm.php rename to lib/MLIB/HTML/QuickForm.php diff --git a/lib/MECON/HTML/QuickForm/Renderer/Tabla.php b/lib/MLIB/HTML/QuickForm/Renderer/Tabla.php similarity index 100% rename from lib/MECON/HTML/QuickForm/Renderer/Tabla.php rename to lib/MLIB/HTML/QuickForm/Renderer/Tabla.php diff --git a/lib/MECON/HTML/QuickForm/Renderer/TablaHorizontal.php b/lib/MLIB/HTML/QuickForm/Renderer/TablaHorizontal.php similarity index 100% rename from lib/MECON/HTML/QuickForm/Renderer/TablaHorizontal.php rename to lib/MLIB/HTML/QuickForm/Renderer/TablaHorizontal.php diff --git a/lib/MECON/HTML/QuickForm/caritas.php b/lib/MLIB/HTML/QuickForm/caritas.php similarity index 100% rename from lib/MECON/HTML/QuickForm/caritas.php rename to lib/MLIB/HTML/QuickForm/caritas.php diff --git a/lib/MECON/HTML/QuickForm/mdate.php b/lib/MLIB/HTML/QuickForm/mdate.php similarity index 100% rename from lib/MECON/HTML/QuickForm/mdate.php rename to lib/MLIB/HTML/QuickForm/mdate.php diff --git a/lib/MECON/HTML/QuickFormSimple.php b/lib/MLIB/HTML/QuickFormSimple.php similarity index 100% rename from lib/MECON/HTML/QuickFormSimple.php rename to lib/MLIB/HTML/QuickFormSimple.php diff --git a/lib/MECON/HTML/Tabla.php b/lib/MLIB/HTML/Tabla.php similarity index 100% rename from lib/MECON/HTML/Tabla.php rename to lib/MLIB/HTML/Tabla.php diff --git a/lib/MECON/HTML/Tabla/estilo_claro.php b/lib/MLIB/HTML/Tabla/estilo_claro.php similarity index 100% rename from lib/MECON/HTML/Tabla/estilo_claro.php rename to lib/MLIB/HTML/Tabla/estilo_claro.php diff --git a/lib/MECON/HTML/Tabla/estilo_comun.php b/lib/MLIB/HTML/Tabla/estilo_comun.php similarity index 100% rename from lib/MECON/HTML/Tabla/estilo_comun.php rename to lib/MLIB/HTML/Tabla/estilo_comun.php diff --git a/lib/MECON/HTML/Tabla/estilo_impresion.php b/lib/MLIB/HTML/Tabla/estilo_impresion.php similarity index 100% rename from lib/MECON/HTML/Tabla/estilo_impresion.php rename to lib/MLIB/HTML/Tabla/estilo_impresion.php diff --git a/lib/MECON/HTML/Tabla/estilo_llamativo.php b/lib/MLIB/HTML/Tabla/estilo_llamativo.php similarity index 100% rename from lib/MECON/HTML/Tabla/estilo_llamativo.php rename to lib/MLIB/HTML/Tabla/estilo_llamativo.php diff --git a/lib/MECON/HTML/Tabla/estilo_medio.php b/lib/MLIB/HTML/Tabla/estilo_medio.php similarity index 100% rename from lib/MECON/HTML/Tabla/estilo_medio.php rename to lib/MLIB/HTML/Tabla/estilo_medio.php diff --git a/lib/MECON/HTML/Tabla/estilo_oscuro.php b/lib/MLIB/HTML/Tabla/estilo_oscuro.php similarity index 100% rename from lib/MECON/HTML/Tabla/estilo_oscuro.php rename to lib/MLIB/HTML/Tabla/estilo_oscuro.php diff --git a/lib/MECON/HTML/TablaDB.php b/lib/MLIB/HTML/TablaDB.php similarity index 100% rename from lib/MECON/HTML/TablaDB.php rename to lib/MLIB/HTML/TablaDB.php diff --git a/lib/MLIB/Legajos/Estudios.php b/lib/MLIB/Legajos/Estudios.php new file mode 100644 index 0000000..60a1060 --- /dev/null +++ b/lib/MLIB/Legajos/Estudios.php @@ -0,0 +1,93 @@ + | +// +--------------------------------------------------------------------+ +// +// $Id: Intranet_Legajos_Estudios.php 23 2003-07-15 18:56:42Z msklar $ +// + + + +// +X2C includes +require_once 'DB.php'; +// ~X2C + +// +X2C Class 163 :Servicios_Legajos_Estudios +/** + * Estudios del agente + * + * @access public + */ +// XXX - Pregunta llucar: POR QUE CATSO HEREDA DE DB??? +class MECON_Legajos_Estudios extends DB { + /** + * @var int $agente + * @access public + */ + var $agente; + + /** + * @var int $datos + * @access public + */ + var $datos; + + // ~X2C + + // +X2C Operation 166 + /** + * @param int $agente + * + * @return void + * @access public + */ + function MECON_Legajos_Estudios($db,$agente) // ~X2C + { + $this->agente = $agente; + $sql = "SELECT * + FROM novedades.web005 + WHERE documento = $agente"; + $result = $db->query($sql); + if (DB::isError($result)) + trigger_error($result->getMessage('Query mal hecho'), E_USER_ERROR); + + for ($fila = 0; $fila < $result->numRows(); $fila++) { + $this->datos[$fila] = $result->fetchRow(DB_FETCHMODE_ASSOC); + } + } + // -X2C + + // +X2C Operation 172 + /** + * @return void + * @access public + */ + function getEstudios() // ~X2C + { + return $this->datos; + } + // -X2C + +} // -X2C Class :Servicios_Legajos_Estudios +?> diff --git a/lib/MLIB/Legajos/ExperienciaLaboral.php b/lib/MLIB/Legajos/ExperienciaLaboral.php new file mode 100644 index 0000000..27d8f89 --- /dev/null +++ b/lib/MLIB/Legajos/ExperienciaLaboral.php @@ -0,0 +1,121 @@ + | +// +--------------------------------------------------------------------+ +// +// $Id: Intranet_Legajos_ExperienciaLaboral.php 23 2003-07-15 18:56:42Z msklar $ +// + +// +X2C includes +require_once 'DB.php'; +// ~X2C + +// +X2C Class 155 :Servicios_Legajos_ExperienciaLaboral +/** + * Antigüedad laboral del agente + * + * @access public + */ +// XXX - Pregunta llucar: POR QUE CATSO HEREDA DE DB??? +class MECON_Legajos_ExperienciaLaboral extends DB { + /** + * @var int $agente + * @access public + */ + var $agente; + + /** + * @var int $antiguedad + * @access public + */ + var $antiguedad; + + /** + * @var int $experiencia + * @access public + */ + var $experiencia; + + // ~X2C + + // +X2C Operation 159 + /** + * @param int $agente + * + * @return void + * @access public + */ + function MECON_Legajos_ExperienciaLaboral($db,$agente) // ~X2C + { + $this->agente = $agente; + $sql = "SELECT * + FROM novedades.web032 + WHERE nrodoc = $agente + ORDER BY desde"; + $result_exp = $db->query($sql); + if (DB::isError($result_exp)) + trigger_error($result_exp->getMessage('Query mal hecho'), E_USER_ERROR); + + for ($fila = 0; $fila < $result_exp->numRows(); $fila++) { + $this->experiencia[$fila] = $result_exp->fetchRow(DB_FETCHMODE_ASSOC); + } + + $sql = "SELECT * + FROM novedades.web031 + WHERE nrodoc = $agente"; + $result_ant = $db->query($sql); + if (DB::isError($result_ant)) + trigger_error($result_ant->getMessage('Query mal hecho'), E_USER_ERROR); + + if ($result_ant->numRows() > 0) { + $this->antiguedad = $result_ant->fetchRow(DB_FETCHMODE_ASSOC); + } + + } + // -X2C + + // +X2C Operation 160 + /** + * @return void + * @access public + */ + function getAntiguedad() // ~X2C + { + return $this->antiguedad; + } + // -X2C + + // +X2C Operation 161 + /** + * @return void + * @access public + */ + function getExperiencia() // ~X2C + { + return $this->experiencia; + } + // -X2C + +} // -X2C Class :Servicios_Legajos_ExperienciaLaboral +?> diff --git a/lib/MLIB/Legajos/Familiares.php b/lib/MLIB/Legajos/Familiares.php new file mode 100644 index 0000000..195480d --- /dev/null +++ b/lib/MLIB/Legajos/Familiares.php @@ -0,0 +1,128 @@ + | +// +--------------------------------------------------------------------+ +// +// $Id: Intranet_Legajos_Familiares.php 23 2003-07-15 18:56:42Z msklar $ +// + +// +X2C includes +require_once 'DB.php'; +// ~X2C + +// +X2C Class 154 :Servicios_Legajos_Familiares +/** + * @access public + */ +// XXX - Pregunta llucar: POR QUE CATSO HEREDA DE DB??? +class MECON_Legajos_Familiares extends DB { + /** + * @var int $agente + * @access public + */ + var $agente; + + /** + * @var int $datos + * @access public + */ + var $datos; + + // ~X2C + + // +X2C Operation 169 + /** + * @param int $agente + * + * @return void + * @access public + */ + function MECON_Legajos_Familiares($db,$agente) // ~X2C + { + $this->agente = $agente; + $sql = "SELECT * + FROM novedades.web004 + WHERE documento = $agente"; + $result = $db->query($sql); + if (DB::isError($result)) + trigger_error($result->getMessage('Query mal hecho'), E_USER_ERROR); + + for ($fila = 0; $fila < $result->numRows(); $fila++) { + $this->datos[$fila] = $result->fetchRow(DB_FETCHMODE_ASSOC); + } + } + // -X2C + + // +X2C Operation 170 + /** + * @return void + * @access public + */ + function getHijos() // ~X2C + { + $aux = array(); + $fila = 0; + if(is_array($this->datos)) { + foreach (array_keys($this->datos) as $key) { + if($this->datos[$key]['parentesco']=='H') { + $aux[$fila]['nombre'] = $this->datos[$key]['nombre']; + $aux[$fila]['tipo_doc'] = $this->datos[$key]['tipodoc']; + $aux[$fila]['nro_doc'] = $this->datos[$key]['nrodoc']; + $aux[$fila]['fecha_nac'] = $this->datos[$key]['fecha_nac']; + $aux[$fila]['parentesco'] = $this->datos[$key]['parentesco']; + $fila++; + } + } + } + return $aux; + } + // -X2C + + // +X2C Operation 171 + /** + * @return void + * @access public + */ + function getFamiliares() // ~X2C + { + $aux = array(); + $fila = 0; + if(is_array($this->datos)) { + foreach (array_keys($this->datos) as $key) { + if($this->datos[$key]['parentesco']!="H") { + $aux[$fila]['nombre'] = $this->datos[$key]['nombre']; + $aux[$fila]['tipo_doc'] = $this->datos[$key]['tipodoc']; + $aux[$fila]['nro_doc'] = $this->datos[$key]['nrodoc']; + $aux[$fila]['fecha_nac'] = $this->datos[$key]['fecha_nac']; + $aux[$fila]['parentesco'] = $this->datos[$key]['parentesco']; + $fila++; + } + } + } + return $aux; + } + // -X2C + +} // -X2C Class :Servicios_Legajos_Familiares +?> diff --git a/lib/MLIB/Marco.php b/lib/MLIB/Marco.php new file mode 100644 index 0000000..6adc181 --- /dev/null +++ b/lib/MLIB/Marco.php @@ -0,0 +1,326 @@ + +------------------------------------------------------------------------------- +$Id$ +-----------------------------------------------------------------------------*/ + +require_once 'PEAR.php'; +require_once 'MECON/Marco/Copete.php'; +require_once 'MECON/Marco/Menu.php'; +require_once 'MECON/Marco/MenuPrincipal.php'; + +//Agregado para el uso de HTML_Page (Uso la version Original de Pear) +require_once 'MECON/HTML/Page.php'; +require_once 'HTML/Table.php'; + +//Defino los directorios por default +define ('DIR_IMAGENES', 'images'); +define ('DIR_ESTILOS' , 'css' ); +define ('DIR_JS' , 'js' ); +define ('DIR_WWW' , 'www' ); +define ('DIR_CACHE' , '/tmp' ); + +//Defino las constantes +define ('SCRIPT_DIR_BASE', '/MECON/js/' ); +define ('ESTILO_DIR_BASE', '/MECON/css/'); +define ('SCRIPT_GENERICO', 'marco.js' ); +define ('ESTILO_GENERICO', 'marco.css' ); + +/** + * Clase encargada del manejo del Marco de los sistemas. + * + * @access public + */ +class MECON_Marco extends MECON_HTML_Page { + /** + * Array con los datos de configuracion del sistema. + * + * @var array $configuracion + * @access private + */ + var $_configuracion; + + /** + * Mantiene el estado de los espacios + * + * @var bool $espacios + * @access private + */ + var $_espacios = true; + + /** + * Menu vertical para agregar en la pantalla. + * + * @var mixed $menuVertical + * @access private + */ + var $_menuVertical = null; + + /** + * Mantiene el estado de los links en la pagina. (True habilitados, False no) + * + * @var bool $links + * @access private + */ + var $_links = true; + + /** + * Constructor. Recibe como parametro el path del archivo de configuracion + * + * @param string $arch_configuracion indicacion de la ubicacion y nombre del archivo de configuracion + * @param MECON_Perm $obj_permiso Objeto Permisos + * + * @return void + * @access public + */ + function MECON_Marco($arch_configuracion, $obj_permiso = null) + { + //Creo el objeto pagina + parent::MECON_HTML_Page(); + //Obtengo y arreglo la configuracion + $this->_obtenerConfiguracion($arch_configuracion); + //Agrego el objeto permiso a la configuracion + if (@$obj_permiso) { + $this->_configuracion['obj_permiso'] = $obj_permiso; + } + //Agrego el estilo y el script genericos + $this->addScript(SCRIPT_DIR_BASE.SCRIPT_GENERICO); + $this->addStyleSheet(ESTILO_DIR_BASE.ESTILO_GENERICO); + //Seteo el titulo + $this->setTitle($this->_configuracion['titulo_sistema']); + $this->_configuracion['subtitulo'] = ''; + $this->_configuracion['titulo_sistema2'] = ''; + } + + /** + * Funcion que se encarga de la obtencion y generacion del array de configuracion. Recibe como parametro el path del archivo de configuracion + * + * @param string $archivo Archivo de configuracion del sistema + * + * @return array + * @access private + */ + function _obtenerConfiguracion($archivo) + { + $this->_configuracion = include $archivo; + //Verifico que existan los directorios, si no es asi los reemplazo por los defaults + if (!@$this->_configuracion['directorios']['root']) { + trigger_error('Es obligatorio ingresar el directorio root!', E_USER_ERROR); + } + if (!@$this->_configuracion['directorios']['imagenes']){ + $this->_configuracion['directorios']['imagenes'] = $this->_configuracion['directorios']['root'].'/'.DIR_IMAGENES; + } + if (!@$this->_configuracion['directorios']['estilos']){ + $this->_configuracion['directorios']['estilos'] = $this->_configuracion['directorios']['root'].'/'.DIR_ESTILOS; + } + if (!@$this->_configuracion['directorios']['js']){ + $this->_configuracion['directorios']['js'] = $this->_configuracion['directorios']['root'].'/'.DIR_JS; + } + if (!@$this->_configuracion['directorios']['www']){ + $this->_configuracion['directorios']['www'] = $this->_configuracion['directorios']['root'].'/'.DIR_WWW; + } + if (!@$this->_configuracion['directorios_fs']['cache']){ + $this->_configuracion['directorios_fs']['cache'] = DIR_CACHE; + } + } + + /** + * Redefinicion de la funcion que permite agregar objetos o html al body de la pagina +Si es un objeto debe tener un metodo toHtml y opcionalmente puede tener un getCSS. +@deprecated + * + * @param Mixed $body Mixed. Recibe el contenido a agregar como body de la pagina + * + * @return void + * @access public + */ + function addBody($body) + { + $this->addBodyContent($body); + } + + /** + * Funcion que permite concatenar lo pasado como parametro al titulo del sistema + * + * @param string $titulo String que se quiere agregar al titulo del sistema + * + * @return void + * @access public + */ + function addTitle($titulo) + { + $this->_configuracion['titulo_sistema2'].= ' - '.$titulo; + } + + /** + * Setea la variable que define si hay que separar el body del menu + * + * @param bool $espacios Si es verdadero agrega los espacios, sino los elimina + * + * @return void + * @access public + */ + function setEspacios($espacios = true) + { + $this->_espacios = $espacios; + } + + /** + * Agrega un menu vertical a la izquierda en la pantalla. + * + * @param mixed $menuVertical Objeto u Html que representa el menu a mostrar. + * + * @return void + * @access public + */ + function addMenuVertical($menuVertical) + { + if ((is_object($menuVertical)) && (method_exists($menuVertical, 'getcss'))) { + $this->addStyleSheet($menuVertical->getCSS()); + } + $this->_menuVertical = $menuVertical; + } + + /** + * Permite habilitar o deshabilitar los links de una pagina (todos) + * + * @param bool $param True habilita los links, False no. + * + * @return void + * @access public + */ + function habilitarLinks($param = true) + { + $this->_links = $param; + } + + /** + * Devuelve el html de la pagina + * + * @return string + * @access public + */ + function toHTML() + { + //Seteo el titulo de la pagina + parent::setTitle($this->_configuracion['titulo_sistema'].$this->_configuracion['titulo_sistema2']); + //Agrego la opcion seleccionada de links a la configuracion + $this->_configuracion['links'] = $this->_links; + //Agrego la opcion seleccionada de espacios a la configuracion + $this->_configuracion['espacios'] = $this->_espacios; + //Creo el menu principal + $menu = new MECON_Marco_MenuPrincipal ($this->_configuracion); + //Agrego el contenido de la pagina + $body = array ( 'body' => $this->_body, 'menuVertical' => $this->_menuVertical); + //Page + //Agrego el contenido al menu + $menu->addBody($body); + //Agrego el Marco completo a Page + $this->setBody('
'); + foreach ($menu->resultado AS $res) { + $this->addBodyContent($res); + } + $this->addBodyContent('
'); + return parent::toHTML(); + } + + /** + * Funcion que permite concatenar lo pasado como parametro al titulo del sistema + * + * @param string $subtitulo Subtitulo a agregar + * + * @return void + * @access public + */ + function addSubTitle($subtitulo) + { + if (is_a($subtitulo, 'mecon_html_link')) { + $subtitulo->updateAttributes( + array('class' => 'mecon_marco_subtitle')); + } + if (method_exists($subtitulo, 'tohtml')) { + $subtitulo = $subtitulo->toHtml(); + } + $this->_configuracion['subtitulo'] .= ' - ' . $subtitulo; + } + + /** + * Concatena lo pasado por parametro al titulo del sistema + * + * @param string $titulo Titulo a agregar. Si se pasa vacio se borra lo que pudiera estar + * + * @return void + * @access public + */ + function setTitle($titulo = '') + { + $this->_configuracion['titulo_sistema2'] = ($titulo) ? ' - '.$titulo : + ''; + } + + /** + * Concatena lo pasado por parametro al titulo de seccion + * + * @param string $subtitulo Setea el subtitulo. Si se pasa vacio borra lo que pudiera estar. + * + * @return void + * @access public + */ + function setSubtitle($subtitulo = '') + { + $this->_configuracion['subtitulo'] = ($subtitulo) ? ' - '.$subtitulo : + ''; + } + + /** + * Permite hacer que en el copete aparezca un icono de ayuda, en un lugar predefinido. Sobreescribe lo seteado anteriormente por cualquier metodo. + * + * @param mixed $ayuda Objeto MECON_HTML_Link o string para utilizar en el map. + * + * @return void + * @access public + */ + function setAyuda($ayuda) + { + $this->_configuracion['ayuda'] = $ayuda; + } + + /** + * Permite obtener el array de configuracion completo. En caso de recibir una clave como parametro devuelve su valor. Solo se tienen en cuenta las claves del primer nivel. + * + * @param string $clave Clave del array de configuracion a obtener. + * + * @return mixed + * @access public + */ + function getConf($clave = null) + { + if ($clave) { + return @$this->_configuracion[$clave]; + } + else { + return $this->_configuracion; + } + } +} +?> \ No newline at end of file diff --git a/lib/MECON/Marco/Copete.php b/lib/MLIB/Marco/Copete.php similarity index 100% rename from lib/MECON/Marco/Copete.php rename to lib/MLIB/Marco/Copete.php diff --git a/lib/MECON/Marco/ImagenAnimada.php b/lib/MLIB/Marco/ImagenAnimada.php similarity index 100% rename from lib/MECON/Marco/ImagenAnimada.php rename to lib/MLIB/Marco/ImagenAnimada.php diff --git a/lib/MECON/Marco/Marco.php b/lib/MLIB/Marco/Marco.php similarity index 100% rename from lib/MECON/Marco/Marco.php rename to lib/MLIB/Marco/Marco.php diff --git a/lib/MECON/Marco/Menu.php b/lib/MLIB/Marco/Menu.php similarity index 100% rename from lib/MECON/Marco/Menu.php rename to lib/MLIB/Marco/Menu.php diff --git a/lib/MECON/Marco/MenuHorizontal.php b/lib/MLIB/Marco/MenuHorizontal.php similarity index 100% rename from lib/MECON/Marco/MenuHorizontal.php rename to lib/MLIB/Marco/MenuHorizontal.php diff --git a/lib/MECON/Marco/MenuOculto.php b/lib/MLIB/Marco/MenuOculto.php similarity index 100% rename from lib/MECON/Marco/MenuOculto.php rename to lib/MLIB/Marco/MenuOculto.php diff --git a/lib/MECON/Marco/MenuPrincipal.php b/lib/MLIB/Marco/MenuPrincipal.php similarity index 100% rename from lib/MECON/Marco/MenuPrincipal.php rename to lib/MLIB/Marco/MenuPrincipal.php diff --git a/lib/MECON/Marco/MenuVertical.php b/lib/MLIB/Marco/MenuVertical.php similarity index 100% rename from lib/MECON/Marco/MenuVertical.php rename to lib/MLIB/Marco/MenuVertical.php diff --git a/lib/MECON/Marco/Seccion.php b/lib/MLIB/Marco/Seccion.php similarity index 100% rename from lib/MECON/Marco/Seccion.php rename to lib/MLIB/Marco/Seccion.php diff --git a/lib/MLIB/Novedad.php b/lib/MLIB/Novedad.php new file mode 100644 index 0000000..34b34a0 --- /dev/null +++ b/lib/MLIB/Novedad.php @@ -0,0 +1,84 @@ +_db = $db; + + if(!is_null($codigo)) + { + + $this->codigo = $codigo; + $sql = "SELECT descripcion FROM novedades.webnov WHERE codigo='".$this->codigo."'"; + $result = $this->_db->getOne($sql); + $this->descripcion = $result; + } + } + } + + /** + * Devuelve el código de la novedad + * + * @return string codigo + * @access public + * + */ + function getCodigo() { + return $this->codigo; + } + + /** + * Devuelve la descripción de la novedad + * + * @return string descripcion + * @access public + * + */ + function getDescripcion() { + return $this->descripcion; + } +} + +?> diff --git a/lib/MLIB/NovedadesDia.php b/lib/MLIB/NovedadesDia.php new file mode 100644 index 0000000..e652584 --- /dev/null +++ b/lib/MLIB/NovedadesDia.php @@ -0,0 +1,186 @@ + | +// +--------------------------------------------------------------------+ +// +// $URL: http://portal.mecon.ar/svn/he/tronco/src/lib/he/HE/NovedadesDia.php $ +// $Rev: 380 $ +// $Date: 2003-05-08 18:40:47 -0300 (Thu, 08 May 2003) $ +// $Author: gmeray $ +// + +require_once 'DB.php'; +require_once 'Date.php'; +require_once 'MECON/Novedad.php'; +require_once 'MECON/Tiempo/Hora.php'; + +/** + * Representa un Intervalo entre 2 horas del mismo dia + * + * @package HE + * @abstract + * @version $Rev: 380 $ + * @author Gonzalo Merayo + */ +class MECON_NovedadesDia { + + var $novedades = array(); + + var $agente = null; + + var $fecha = null; + + var $_db = null; + + + function MECON_NovedadesDia(&$db, $agente, $fecha) { +#validar el tipo de $fecha + $this->agente = $agente; + $this->fecha = $fecha; + +#Ver de donde sacar esto bonito... + + $this->_db = $db; + if(DB::isError($this->_db)) + trigger_error($this->_db->getMessage(), E_USER_ERROR); +#Carga las novedades del agente/fecha en la lista de novedades + + $this->BuscarLicencia(); + $this->BuscarNovedadesTemporales(); + $this->BuscarNovedadDiaria(); + } + + function deLicencia() { + $licencias = array('Adp','Asa','Fal','Fran','FES/REL','Grem','Interrup','Sus','10a','10a/d','10c','10d','10g','10h','10i','10j','10j/c','13Ia','13Ia/s','13Ia/u','13Ib','13Ic','13Id','13Id/a','13Id/h','13Ie','13Ig','13IIa','13IIb','13IIc','13IId', '13IIe','1363/97-2','14a','14b','14b1','14b2','14c','14d','14f','14g','14h','15a', '15b','15c','9'); + $anti_licencias = array('Interr/13a','Interr/9'); + foreach($this->novedades as $nov) { + if(in_array($nov->codigo, $anti_licencias)) + return false; + if(in_array($nov->codigo, $licencias)) + return true; + } + return false; + } + + function enComicion() { + foreach($this->novedades as $nov) + if($nov->codigo == 'com') + return true; + return false; + } + + function esFranco() { + foreach($this->novedades as $nov) + if($nov->codigo == 'Fran') + return true; + return false; + } + + function debioVenir() { + $ret = true; + foreach($this->novedades as $novedad) { + if(!($novedad->codigo == 'adde' + or $novedad->codigo == 'aden' + or $novedad->codigo == 'adden' + or $novedad->codigo == 'ahp' + or $novedad->codigo == 'anul' + or $novedad->codigo == 'ato' + or $novedad->codigo == 'atp' + or $novedad->codigo == 'interr/13a' + or $novedad->codigo == 'interr/9' + or $novedad->codigo == 'interrup' + or $novedad->codigo == 'lta' + or $novedad->codigo == 'sinnov' + or $novedad->codigo == 'tsj' + or $novedad->codigo == '10a/c' + or $novedad->codigo == '10b' + or $novedad->codigo == '10e' + or $novedad->codigo == '15a' + or $novedad->codigo == '15b' + )) + $ret = false; + } + return $ret; + } + + function getAtos() { + $atos = array(); + foreach($this->novedades as $nov) + if($nov->codigo == 'ato') + array_push($atos, $nov); + return $atos; + } + + function BuscarLicencia() { + $fecha = $this->fecha->format("%Y%m%d"); + $query = "SELECT codnov,descripcion + FROM novedades.web018,novedades.webnov + WHERE docagente = $this->agente + AND diadesde <= $fecha + AND diahasta >= $fecha + AND codnov = codigo"; + $result = $this->_db->query($query); + if(DB::isError($result)) + trigger_error($result->getMessage(), E_USER_ERROR); + while($r = $result->fetchRow()) { + $novedad = new MECON_Novedad(); + $novedad->codigo = $r[0]; + $novedad->descripcion = $r[1]; + array_push($this->novedades, $novedad); + } + } + + function BuscarNovedadesTemporales() { + $fecha = $this->fecha->getYear()."-". + $this->fecha->getMonth()."-". + $this->fecha->getDay(); + $query = "SELECT novedad, desde, hasta, descripcion + FROM novedades.parciales,novedades.webnov + WHERE fecha = '$fecha' + AND nrodoc = $this->agente + AND novedad = codigo"; + $result = $this->_db->query($query); + if(DB::isError($result)) + trigger_error($result->getMessage(), E_USER_ERROR); + while($r = $result->fetchRow()) { + $novedad = new MECON_Novedad(); + $novedad->codigo = $r[0]; + $novedad->descripcion = $r[3]; + $novedad->intervalo = new MECON_Tiempo_Intervalo(new MECON_Tiempo_Hora($r[1]), new MECON_Tiempo_Hora($r[2])); + array_push($this->novedades, $novedad); + } + + } + + function BuscarNovedadDiaria() { + $mes = $this->fecha->getMonth(); + $dia = $this->fecha->getDay() + 0; //el +0 hace que tome al dia como numero + //y no le agregue un 0 si es < que 10 + $ano = $this->fecha->getYear(); + $query = "SELECT novedad,descripcion + FROM novedades.web020,novedades.webnov + WHERE anio = $ano + AND mes = $mes + AND nrodoc = $this->agente + AND dia$dia = 1 + AND novedad = codigo"; + $result = $this->_db->query($query); + if(DB::isError($result)) + trigger_error($result->getMessage(), E_USER_ERROR); + if($c = $result->fetchRow()) { + $codigo = $c[0]; + $descripcion = $c[1]; + $novedad = new MECON_Novedad(); + $novedad->codigo = $codigo; + $novedad->descripcion = $descripcion; + array_push($this->novedades, $novedad); + } + } + +} diff --git a/lib/MECON/PDF.php b/lib/MLIB/PDF.php similarity index 100% rename from lib/MECON/PDF.php rename to lib/MLIB/PDF.php diff --git a/lib/MECON/PDF/Contenido.php b/lib/MLIB/PDF/Contenido.php similarity index 100% rename from lib/MECON/PDF/Contenido.php rename to lib/MLIB/PDF/Contenido.php diff --git a/lib/MECON/PDF/Header.php b/lib/MLIB/PDF/Header.php similarity index 100% rename from lib/MECON/PDF/Header.php rename to lib/MLIB/PDF/Header.php diff --git a/lib/MECON/PDF/HeaderDefecto.php b/lib/MLIB/PDF/HeaderDefecto.php similarity index 100% rename from lib/MECON/PDF/HeaderDefecto.php rename to lib/MLIB/PDF/HeaderDefecto.php diff --git a/lib/MECON/PDF/HeaderDefecto/medidas.php b/lib/MLIB/PDF/HeaderDefecto/medidas.php similarity index 100% rename from lib/MECON/PDF/HeaderDefecto/medidas.php rename to lib/MLIB/PDF/HeaderDefecto/medidas.php diff --git a/lib/MECON/PDF/Imagen.php b/lib/MLIB/PDF/Imagen.php similarity index 100% rename from lib/MECON/PDF/Imagen.php rename to lib/MLIB/PDF/Imagen.php diff --git a/lib/MECON/PDF/Marco.php b/lib/MLIB/PDF/Marco.php similarity index 100% rename from lib/MECON/PDF/Marco.php rename to lib/MLIB/PDF/Marco.php diff --git a/lib/MECON/PDF/Marco/medidas.php b/lib/MLIB/PDF/Marco/medidas.php similarity index 100% rename from lib/MECON/PDF/Marco/medidas.php rename to lib/MLIB/PDF/Marco/medidas.php diff --git a/lib/MECON/PDF/SaltoPagina.php b/lib/MLIB/PDF/SaltoPagina.php similarity index 100% rename from lib/MECON/PDF/SaltoPagina.php rename to lib/MLIB/PDF/SaltoPagina.php diff --git a/lib/MECON/PDF/Separador.php b/lib/MLIB/PDF/Separador.php similarity index 100% rename from lib/MECON/PDF/Separador.php rename to lib/MLIB/PDF/Separador.php diff --git a/lib/MECON/PDF/Tabla.php b/lib/MLIB/PDF/Tabla.php similarity index 100% rename from lib/MECON/PDF/Tabla.php rename to lib/MLIB/PDF/Tabla.php diff --git a/lib/MECON/PDF/Tabla/medidas.php b/lib/MLIB/PDF/Tabla/medidas.php similarity index 100% rename from lib/MECON/PDF/Tabla/medidas.php rename to lib/MLIB/PDF/Tabla/medidas.php diff --git a/lib/MECON/PDF/Texto.php b/lib/MLIB/PDF/Texto.php similarity index 100% rename from lib/MECON/PDF/Texto.php rename to lib/MLIB/PDF/Texto.php diff --git a/lib/MECON/PDF/external/chart.class.php b/lib/MLIB/PDF/external/chart.class.php similarity index 100% rename from lib/MECON/PDF/external/chart.class.php rename to lib/MLIB/PDF/external/chart.class.php diff --git a/lib/MECON/PDF/external/phppdflib.class.php b/lib/MLIB/PDF/external/phppdflib.class.php similarity index 100% rename from lib/MECON/PDF/external/phppdflib.class.php rename to lib/MLIB/PDF/external/phppdflib.class.php diff --git a/lib/MECON/PDF/external/strlen.inc.php b/lib/MLIB/PDF/external/strlen.inc.php similarity index 100% rename from lib/MECON/PDF/external/strlen.inc.php rename to lib/MLIB/PDF/external/strlen.inc.php diff --git a/lib/MECON/PDF/external/template.class.php b/lib/MLIB/PDF/external/template.class.php similarity index 100% rename from lib/MECON/PDF/external/template.class.php rename to lib/MLIB/PDF/external/template.class.php diff --git a/lib/MECON/PDF/medidas.php b/lib/MLIB/PDF/medidas.php similarity index 100% rename from lib/MECON/PDF/medidas.php rename to lib/MLIB/PDF/medidas.php diff --git a/lib/MECON/Tiempo/Banda.php b/lib/MLIB/Tiempo/Banda.php similarity index 100% rename from lib/MECON/Tiempo/Banda.php rename to lib/MLIB/Tiempo/Banda.php diff --git a/lib/MECON/Tiempo/Hora.php b/lib/MLIB/Tiempo/Hora.php similarity index 100% rename from lib/MECON/Tiempo/Hora.php rename to lib/MLIB/Tiempo/Hora.php diff --git a/lib/MECON/Tiempo/Intervalo.php b/lib/MLIB/Tiempo/Intervalo.php similarity index 100% rename from lib/MECON/Tiempo/Intervalo.php rename to lib/MLIB/Tiempo/Intervalo.php diff --git a/lib/MLIB/Usuario.php b/lib/MLIB/Usuario.php new file mode 100644 index 0000000..8d4b9a2 --- /dev/null +++ b/lib/MLIB/Usuario.php @@ -0,0 +1,302 @@ + +------------------------------------------------------------------------------- +$Id: Usuario.php 242 2003-08-11 18:02:16Z manazar $ +-----------------------------------------------------------------------------*/ +require_once 'MECON/Agente.php'; + +require_once 'DB.php'; +require_once 'PEAR.php'; + +/** + * @access public + */ +class MECON_Usuario { + /** + * @var int $dni + * @access public + */ + var $dni; + + /** + * @var string $login + * @access public + */ + var $login; + + /** + * @var string $nivelygrado + * @access public + */ + var $nivelygrado; + + + /** + * @var string $codep + * @access public + */ + var $codep; + + + /** + * @var string $nombre + * @access public + */ + var $nombre; + + /** + * @var string $tipo + * @access public + */ + var $tipo; + + /** + * @protected + */ + var $_db; + + /** + * @param string $dni + * + * @return void + * @access public + */ + function ArmarconDNI($dni) + { + $sql = "SELECT login,nombre + from usuario.Usuario + where dni = $dni"; + $result = $this->_db->query($sql); + if (DB::isError($result)) { + return $result; + } elseif ($result->NumRows()>0) { + $row = $result->fetchRow(DB_FETCHMODE_ORDERED); + $login = $row[0]; + $nombre = $row[1]; + $this->login=$login; + $this->nombre=$nombre; + $this->dni=$dni; + } else { + return new PEAR_Error ('El dni '.$dni.' no existe, debe loguearse al + menos una vez a la intranet.'); + } + } + + /** + * @param string $login + * + * @return void + * @access public + */ + function ArmarconLOGIN($login) + { + //$login = ereg_replace ("@", "\\\@", $login); + $sql = "SELECT dni,nombre + from usuario.Usuario + where login = '$login'"; + + $result = $this->_db->query($sql); + + if (DB::isError($result)) { + return $result; + } elseif ($result->NumRows()>0) { + $row = $result->fetchRow(DB_FETCHMODE_ORDERED); + $this->dni = $row[0]; + $this->nombre = $row[1]; + $this->login = $login; + } else { + return new PEAR_Error ('El usuario '.$login.' no existe, debe loguearse al + menos una vez a la intranet.'); + } + } + + /** + * @param int $dni + * + * @return void + * @access public + */ + function MECON_Usuario($db, $dni = null, $login = null) + { + $this->_db = $db; + if(! is_null($dni)) { + $this->ArmarconDNI($dni); + $this->buscarUsuarioDNI($dni); + } + if(! is_null($login)) { + $this->ArmarconLOGIN($login); + $this->buscarUsuarioDNI($this->getDni()); + } + + } + + /** + * @param int $uario + * + * @return lo que devuelve el query (DB_Result o DB_Error). + * @access public + */ + function Insertar_Usuario($dni, $login, $nombre) + { + $sql = "REPLACE INTO usuario.Usuario (login,dni,nombre) + values ('$login',$dni,'$nombre')"; + return $this->_db->query($sql); + } + + /** + * @return int + * @access public + */ + function getDni() + { + return $this->dni; + } + + /** + * @return string + * @access public + */ + function getLogin() + { + return $this->login; + } + + /** + * @return string + * @access public + */ + function getCodep() + { + return $this->codep; + } + + + /** + * @return string + * @access public + */ + function getNombre() + { + return $this->nombre; + } + + /** + * @return string + * @access public + */ + function getNivelygrado() + { + return $this->nivelygrado; + } + + + /** + * @return string + * @access public + */ + function getTipo() + { + return $this->tipo; + } + + + /** + * @param int $dni + * + * @return void + * @access public + */ + function buscarUsuarioDNI($dni) + { + $MECON_Agente= & new MECON_Agente($this->_db, $dni); + $this->dni = $dni; + $nombre = $MECON_Agente->getNombre(); + $this->nombre = $nombre; + $codep= $MECON_Agente->getDependencia(); + $this->codep = $codep; + $tipo= $MECON_Agente->getTipo(); + $this->tipo = $tipo; + $this->nivelygrado=""; + if (isset($MECON_Agente->datos['nivel'])) + { + $this->nivelygrado= $MECON_Agente->datos['nivel'].$MECON_Agente->datos['grado']; + } + + } + + /** + * Verifica si el login pasado por parametro es valido + * + * @param string $login Login a verificar + * + * @return mixed + * @access public + */ + function verificarLogin($login) { + $sql = "SELECT count(*) as cuenta FROM usuario.Usuario WHERE login = " + . $this->_db->quote($login) ; + $result = $this->_db->query($sql); + if (PEAR::isError($result)) { + return $result; + } + $row = $result->fetchRow(DB_FETCHMODE_ASSOC); + if ($row['cuenta'] != 0) { + return true; + } + return false; + } + + /** + * Devuelve un array de logins con aquellos que cumplan con algun requisito + * del filtro. + * + * @param DB &$db Base de Datos + * @param string $login Login a filtrar. (Puede ser completo o una parte de el) + * @param string $nombre Nombre a filtrar. + * + * @return mixed + * @access public + * @static + */ + function filtrarUsuarios(&$db, $login, $nombre) { + if ($login && $nombre) { + return new PEAR_Error('Solo debe ingresarse una opcion de filtro, + login o nombre, a la vez.'); + } + $sql = "SELECT u.login as login, u.nombre as nombre FROM usuario.Usuario as u + WHERE "; + + if ($login) { + $sql.= ' u.login LIKE \'%'.$login.'%\''; + } + else { + $sql.= ' u.nombre LIKE \'%'.$nombre.'%\''; + } + $sql.= 'ORDER BY u.login'; + + $db->setFetchMode(DB_FETCHMODE_ASSOC); + $result = $db->query($sql); + return $result; + } +} +?> diff --git a/lib/MECON/XLS.php b/lib/MLIB/XLS.php similarity index 100% rename from lib/MECON/XLS.php rename to lib/MLIB/XLS.php diff --git a/lib/MECON/defaults.php b/lib/MLIB/defaults.php similarity index 100% rename from lib/MECON/defaults.php rename to lib/MLIB/defaults.php diff --git a/lib/MECON/general.php b/lib/MLIB/general.php similarity index 100% rename from lib/MECON/general.php rename to lib/MLIB/general.php diff --git a/lib/MLIB/includes/no_autorizado.html b/lib/MLIB/includes/no_autorizado.html new file mode 100644 index 0000000..0264ea3 --- /dev/null +++ b/lib/MLIB/includes/no_autorizado.html @@ -0,0 +1,33 @@ + + +ERROR + + + + + + + + + + + + + + + + + + + +
+
+
+
ACCESO + NO AUTORIZADO
+
+ -- 2.43.0