var arrVisores= [ ['pdf','pdf_viewer.php'], ['doc','pdf_viewer.php'], ['docx','pdf_viewer.php'], ['png','images_viewer.php'], ['gif','images_viewer.php'], ['jpg','images_viewer.php'], ['jpeg','images_viewer.php'] ]; var msgEspereAux=null; var limpiarValorControl=true; var lblAplicacion='MAJO'; var arrDias=new Array(); arrDias[0]='Domingo'; arrDias[1]='Lunes'; arrDias[2]='Martes'; arrDias[3]='Mi\xE9rcoles'; arrDias[4]='Jueves'; arrDias[5]='Viernes'; arrDias[6]='Sábado'; var matrizDias=new Array(); matrizDias[0]=['0','Domingo']; matrizDias[1]=['1','Lunes']; matrizDias[2]=['2','Martes']; matrizDias[3]=['3','Mi\xE9rcoles']; matrizDias[4]=['4','Jueves']; matrizDias[5]=['5','Viernes']; matrizDias[6]=['6','Sábado']; var arrMeses=[['1','Enero'],['2','Febrero'],['3','Marzo'],['4','Abril'],['5','Mayo'],['6','Junio'],['7','Julio'],['8','Agosto'],['9','Septiembre'],['10','Octubre'],['11','Noviembre'],['12','Diciembre']]; Ext.override(Ext.grid.GroupingView, { doRender : function(cs, rs, ds, startRow, colCount, stripe) { if(rs.length < 1) { return ''; } if(!this.canGroup() || this.isUpdating) { return Ext.grid.GroupingView.superclass.doRender.apply(this, arguments); } var groupField = this.getGroupField(), colIndex = this.cm.findColumnIndex(groupField), g, gstyle = 'width:' + this.getTotalWidth() + ';', cfg = this.cm.config[colIndex], groupRenderer = cfg.groupRenderer || cfg.renderer, prefix = this.showGroupName ? (cfg.groupName || cfg.header)+': ' : '', groups = [], curGroup, i, len, gid; for(i = 0, len = rs.length; i < len; i++){ var rowIndex = startRow + i, r = rs[i], gvalue = r.data[groupField]; g = this.getGroup(gvalue, r, groupRenderer, rowIndex, colIndex, ds); if(!curGroup || curGroup.group != g) { var pos=-1; var x; for(x=0;x'); valor=arrDatos[1]; arrDatos=valor.split('= 48 && key <= 57)); } // function msgBox(mensaje,fun,icono) { if(typeof(msgPersonalizado)!='undefined') { msgPersonalizado(mensaje,fun); return; } funcion =fun; if(fun==undefined) funcion=null var ICONO=Ext.MessageBox.WARNING; if(icono) ICONO=icono; Ext.MessageBox.show( { title: lblAplicacion, msg: mensaje, buttons: Ext.MessageBox.OK, icon: ICONO, fn:funcion } ); } function msgBoxWin(mensaje,resp,ancho,alto) { var alt=140; if(alto!=undefined) alt=alto; var anch=420; if(ancho!=undefined) anch=ancho; var ventanaAM = new Ext.Window( { title: lblAplicacion, width: anch, height:alt, layout: 'absolute', plain:true, modal:true, border:false, bodyStyle:'padding:3px;color:blue', buttonAlign:'center', items: { xtype:'label', html:'
'+mensaje+'
', x:10, y:20 }, listeners : { show : { buffer : 10, fn : function() { } } }, buttons: [ { text: 'OK', handler: function() { resp(); ventanaAM.close(); } } ] } ); ventanaAM.show(); } function msgConfirm(mensaje,resp) { Ext.MessageBox.show( { title: lblAplicacion, msg: mensaje, buttons: Ext.MessageBox.YESNO, icon: Ext.MessageBox.QUESTION, fn:resp } ); } function msgConfirmWin(mensaje,resp,ancho,alto) { var alt=140; if(alto!=undefined) alt=alto; var anch=420; if(ancho!=undefined) anch=ancho; var ventanaAM = new Ext.Window( { title: lblAplicacion, width: anch, height:alt, layout: 'absolute', plain:true, modal:true, border:false, bodyStyle:'padding:3px;color:blue', buttonAlign:'center', items: { xtype:'label', html:'
'+mensaje+'
', x:10, y:20 }, listeners : { show : { buffer : 10, fn : function() { } } }, buttons: [ { text: 'Yes', handler: function() { resp('yes'); ventanaAM.close(); } }, { text: 'No', handler:function() { resp('no'); ventanaAM.close(); } } ] } ); ventanaAM.show(); } //formato a controles function marcarCampo(obj)//fondo de un color { obj.style.background='#FFd2dC'; obj.style.backgroundColor='#FFd2dC'; } function desmarcarCampo(obj)//quitarle el color { obj.style.background='#FFFFFF'; obj.style.backgroundColor='#FFFFFF'; } //funciones de arbol function limpiarNodo(nodo) { while(nodo.hasChildNodes()) { nodo.removeChild(nodo.item(0)); } } function obtenerNodoSel(raiz) { var z=0; var enc=false; var nodoSel=null; while((z 0) combo.remove(0); } function crearRichText(idCtrl,divDestino,ancho,alto,conf,valor) { var div = document.getElementById(divDestino); var vTexto=''; if (valor!=undefined) vTexto=valor; var configuracion="../fckconfig.js"; if((conf!='')&&(conf!=undefined)) configuracion=conf; var conf= { Name:idCtrl, Width:ancho, Height:alto, Value:vTexto, config:configuracion } var richText=new Ext.ux.FCKeditor(conf); var Panel=new Ext.Panel ( { id:'panel_'+idCtrl, renderTo:divDestino, items:[richText] } ) return richText; } function crearCampoHora(idControlDestino,hiddenValor,horaMinima,horaMaxima,interval) { hMinima='00:00'; hMaxima='23:59'; if(horaMaxima!=undefined) hMaxima=horaMaxima; if(horaMinima!=undefined) hMinima=horaMinima; intervalo=15; if(interval!=undefined) intervalo=interval; var arrHInicial=hMinima.split(':'); var arrHFinal=hMaxima.split(':'); var horaInicial=new Date(2010,5,10,parseInt(arrHInicial[0]),parseInt(arrHInicial[1])); var horaFinal=new Date(2010,5,10,parseInt(arrHFinal[0]),parseInt(arrHFinal[1])); if(horaInicial>horaFinal) { var temp=horaInicial; horaInicial=horaFinal; horaFinal=temp; } var arrHoras=generarIntervaloHoras(horaInicial,horaFinal,intervalo); function funcHoraCamb(campo,nuevoV,viejoV) { gE(hiddenValor).value=nuevoV; } /*var hora=new Ext.form.TimeField ( { id:'f_'+idControlDestino, width:100, renderTo:idControlDestino, readOnly:true, minValue:hMinima, maxValue:hMaxima, height:150, format:'H:i', increment:intervalo } )*/ var hora=crearComboExtFormulario(idControlDestino,hiddenValor,arrHoras); hora.setWidth(110); var hHora=gE(hiddenValor); hora.setValue(hHora.value); hora.on('change',funcHoraCamb); return hora; } function crearCampoHoraExt(idControl,horaMinima,horaMaxima,interval,esGrid) { hMinima='00:00'; hMaxima='23:59'; if(horaMaxima!=undefined) hMaxima=horaMaxima; if(horaMinima!=undefined) hMinima=horaMinima; intervalo=15; if(interval!=undefined) intervalo=interval; var arrHInicial=hMinima.split(':'); var arrHFinal=hMaxima.split(':'); var horaInicial=new Date(2010,5,10,parseInt(arrHInicial[0]),parseInt(arrHInicial[1])); var horaFinal=new Date(2010,5,10,parseInt(arrHFinal[0]),parseInt(arrHFinal[1])); var arrHoras=generarIntervaloHoras(horaInicial,horaFinal,intervalo); var hora; if(!esGrid) hora=crearComboExt(idControl,arrHoras); else hora=crearComboExt(idControl,arrHoras,0,0,null,{transform:false}); return hora; } function crearCampoFecha(idControlDestino,hiddenValor,minimaFecha,maximaFecha,funcChange) { minFecha=null; maxFecha=null; if(maximaFecha!=undefined) maxFecha=maximaFecha; if(minimaFecha!=undefined) minFecha=minimaFecha; function funcFechaCamb(campo,nuevoV,viejoV) { var f=new Date(nuevoV); gE(hiddenValor).value=f.format('d/m/Y'); } var FNac=new Ext.form.DateField ( { id:'f_'+idControlDestino, width:100, format:'d/m/Y', renderTo:idControlDestino, readOnly:true, minValue:minFecha, maxValue:maxFecha, height:150 } ) var FNacimiento=gE(hiddenValor); FNac.setValue(FNacimiento.value); if(funcChange==undefined) FNac.on('change',funcFechaCamb); else FNac.on('select',funcChange); var contenedor=FNac.getEl(); var idImg=contenedor.next().id; var img=gE(idImg); if(Ext.isIE) img.removeAttribute('style'); else img.setAttribute('style',''); return FNac; } function crearComboExtFormulario(idControlDestino,hiddenValor,arregloValores) { var almacen=new Ext.data.SimpleStore ( { fields: [ {name:'id'}, {name:'texto'} ] } ) var comboTmp=document.createElement('select'); var combo =new Ext.form.ComboBox ( { id:'f_'+idControlDestino, mode:'local', name:idControlDestino, emptyText:'Elija una opci\u00f3n', store:almacen, displayField:'texto', valueField:'id', transform:comboTmp, editable:false, typeAhead: true, triggerAction: 'all', lazyRender:true, renderTo:idControlDestino } ) almacen.loadData(arregloValores); function funcValorCambiado(campo,nuevoV,viejoV) { gE(hiddenValor).value=nuevoV; } var hCombo=gE(hiddenValor); combo.setValue(hCombo.value); combo.on('change',funcValorCambiado); return combo; } Ext.form.TriggerField.override({ afterRender: function() { Ext.form.TriggerField.superclass.afterRender.call(this); } }); function cerrarSesion(noRedireccion) { function procResp() { if(noRedireccion==undefined) { document.location.href="../principal/indexLatis.php"; } } obtenerDatosWeb('../paginasFunciones/funciones.php',procResp,'POST','funcion=2',true); } function hK() { if(typeof keyMap!='undefined') keyMap.enable(); } function dK() { if(typeof keyMap!='undefined') keyMap.disable(); } function cv(valor,ignorarRetorno,evitaCodificarURI) { valor=valor+''; valor=valor.replace(/"/gi,'\\"'); if((ignorarRetorno==undefined)||(ignorarRetorno==false)) valor=valor.replace(/\n/gi, '
'); else valor=valor.replace(/\n/gi, ''); valor=valor.replace(/\r/gi, ''); valor=valor.replace(/\t/gi, ' '); if(!evitaCodificarURI) return encodeURIComponent(valor); return (valor); } function dv(valor,urlEncode) { var cadena=valor; if((urlEncode==undefined)||(urlEncode)) cadena=decodeURIComponent(valor); cadena=cadena.replace(/#R
/gi,'\n\r'); return cadena; } function selElemCombo(combo,valor) { var x; var valorAux=valor+''; var valRef; for(x=0;x'+arrResp[0]); } } obtenerDatosWeb('../paginasFunciones/funcionesFormulario.php',funcResp, 'POST','funcion=16&condComp='+condComp+'&valDep='+cadObj+'&idReferencia='+gE('idReferencia').value+'&vCondicion='+valorCondicion+'&condicion='+condicion+'&cDestino='+cDestino+'&idFormulario='+idFormulario,true); } function actualizarListado(combo,cFiltro,condicion,cDestino,tControl) { var tipoControl=tControl; var valorCondicion; if(typeof(combo)!='string') valorCondicion=combo.options[combo.selectedIndex].value; else valorCondicion=combo; var idFormulario=gE('idFormulario').value; var nomNCol; var nColumnas; var anchoCol; var tblDestino; var nomDestino; if((tipoControl>=14)&&(tipoControl<=16)) { nomDestino='_'+cDestino+'vch'; nomNCol='nColumnas_'+cDestino+'vch'; nColumnas=gE(nomNCol).value; anchoCol=gE('ancho_'+cDestino+'vch').value; tblDestino=gE('tbl_'+cDestino+'vch'); gE(nomDestino).value='-1'; } else { if((tipoControl>=17)&&(tipoControl<=19)) { nomDestino='_'+cDestino+'arr'; nomNCol='nColumnas_'+cDestino+'arr'; nColumnas=gE(nomNCol).value; anchoCol=gE('ancho_'+cDestino+'arr').value; tblDestino=gE('tbl_'+cDestino+'arr'); } } function funcResp() { arrResp=peticion_http.responseText.split('|'); if(arrResp[0]=='1') { var arrOpciones=eval(arrResp[1]); var numOpt=arrOpciones.length; var x; var opt; var ct=0; var padre=tblDestino.parentNode; padre.removeChild(tblDestino); var tablaCtrl=crearTabla(nColumnas,arrOpciones,tipoControl,nomDestino,anchoCol); padre.appendChild(tablaCtrl); } else { msgBox('No se ha podido llevar cabo la operación debido al siguiente error:
'+arrResp[0]); } } obtenerDatosWeb('../paginasFunciones/funcionesFormulario.php',funcResp, 'POST','funcion=16&vCondicion='+valorCondicion+'&condicion='+condicion+'&cDestino='+cDestino+'&idFormulario='+idFormulario,true); } function crearComboGeneral(id,arrData,msgInicial) { var arrDatos=[]; if((arrData !=undefined)&&(arrData!=null)) arrDatos=arrData; var idCombo='idComboGral'; if(id!=undefined) idCombo=id; var dsDatos= new Ext.data.SimpleStore ( { fields: [ {name:'id'}, {name:'tipo'}, {name:'comp1'}, {name:'comp2'}, {name:'comp3'} ] } ); dsDatos.loadData(arrDatos); var comboEtapas=document.createElement('select'); var cmbGeneral=new Ext.form.ComboBox ( { id:idCombo, mode:'local', emptyText:msgInicial, store:dsDatos, displayField:'tipo', valueField:'id', transform:comboEtapas, editable:false, typeAhead: true, triggerAction: 'all', lazyRender:true, width:120, listWidth:270 } ) return cmbGeneral; } function llenarCombo(combo,arrValores,seleccione) { var x; var opcion; limpiarCombo(combo); if((seleccione!=undefined)&&(combo.getAttribute('multiple')==null)) { option=document.createElement('option'); combo.options[0]=option; option.text="Seleccione"; option.value="-1"; } for(x=0;x='0')&&(valor.substr(x,1)<='9'))||(valor.substr(x,1)=='.')||(valor.substr(x,1)=='-')) cadAux+=valor.substr(x,1); } return cadAux; } function cambiaraFormatoMysqlToEstandar(fecha) { if(typeof(fecha)=='string') { var arrFecha=fecha.split('-'); return arrFecha[2]+'/'+arrFecha[1]+"/"+arrFecha[0]; } else return fecha.format('d/m/Y'); } function bE(valor) { return Base64.encode(valor) } function bD(valor) { return Base64.decode(valor) } function crearRegistro(campos) { return Ext.data.Record.create ( campos); } function obtenerValorSelect(combo) { var cmb; if(typeof(combo)=='object') cmb=combo; else cmb=gE(combo); return cmb.options[cmb.selectedIndex].value; } function obtenerListadoArregloFilas(arrFilas,columna,separador) { var x; var listado=''; var sep=''; if(separador!=undefined) sep=separador; for(x=0;x0)) return nodo.childNodes; if((typeof(nodo.children)!='undefined')&&(nodo.children.length>0)) return nodo.children; if(nodo.attributes!=undefined) { if((typeof(nodo.attributes.children)!='undefined')&&(nodo.attributes.children.length>0)) return nodo.attributes.children; } return []; } function ucWords(string) { var arrayWords; var returnString = ""; var len; arrayWords = string.split(" "); len = arrayWords.length; for(i=0;i < len ;i++) { if(i != (len-1)) { returnString = returnString+ucFirst(arrayWords[i])+" "; } else { returnString = returnString+ucFirst(arrayWords[i]); } } return returnString; } function ucFirst(string) { return string.substr(0,1).toUpperCase()+string.substr(1,string.length); } function abrirVentanaPOST(URL,arrDatos,nVentana) { var nombreVentana='vAuxiliar'; if(nVentana) nombreVentana=nVentana; window.open('',nombreVentana, "toolbar=no,directories=no,menubar=no,status=no,scrollbars=yes,fullscreen=yes"); enviarFormularioDatos(URL,arrDatos,'POST',nombreVentana); } function ordenarCombo(cmb,orden) //1= por valor asc,-1 por valor desc;2 por titulo asc;-2 por titulo desc { if(typeof(cmb)=='object') cmbDestino=cmb; else cmbDestino=gE(cmb); var x; var arrDestino=new Array(); var objArray; for(x=0;x0) { arrBotones.push('-'); } arrBotones.push( { id:'btnDel_'+idCampoGrid, text:objConf.etRemover, icon:'../images/delete.png', cls:'x-btn-text-icon', hidden:eOculto, handler:function() {} } ); var dsDatos=[]; var alDatos= new Ext.data.SimpleStore ( { fields: arrCampos } ); alDatos.loadData(dsDatos); var chkRow=new Ext.grid.CheckboxSelectionModel(); var arrColumnasCompleto=new Array(); arrColumnasCompleto.push(new Ext.grid.RowNumberer()); arrColumnasCompleto.push(chkRow); var x; for(x=0;x0) { arrBotones.push('-'); } arrBotones.push( { id:'btnDel_'+idCampoGrid, text:objConf.etRemover, icon:'../images/delete.png', cls:'x-btn-text-icon', hidden:eOculto, handler:function() { var datosGrid=idCampoGrid.split('_'); var tblGrid=gEx(idCampoGrid); var fila=tblGrid.getSelectionModel().getSelected(); if(fila==null) { msgBox('Primero debe seleccionar el elemento a eliminar'); return; } function resp(btn) { if(btn=='yes') { tblGrid.getStore().remove(fila); } } msgConfirm('Está seguro de querer eliminar el elemento seleccionado?',resp); } } ); var alDatos; if((objConf.agrupado)&&(objConf.agrupado=='1')) { var lector= new Ext.data.ArrayReader({ fields: [ {name:'idPedido'}, {name: 'txtRazonSocial2'}, {name:'folioPedido'}, {name:'fechaRecepcion', type:'date'}, {name: 'diferencia', type:'int'}, {name: 'num_Factura'}, {name: 'fecha_entrada',type:'date'}, {name: 'Nombre'}, {name: 'observaciones'}, {name:'num_entrega'}, {name:'cond_pago'}, {name: 'txtRFC'} ] } ); alDatos= new Ext.data.GroupingStore({ reader: lector, sortInfo: {field: objConf.campoAgrupacion, direction: 'ASC'}, groupField: objConf.campoAgrupacion, remoteGroup:false, remoteSort: false, autoLoad:false }) } else { alDatos= new Ext.data.SimpleStore ( { fields: arrCampos } ); } alDatos.loadData(arrDatosGrid); var chkRow=new Ext.grid.CheckboxSelectionModel(); var arrColumnasCompleto=new Array(); arrColumnasCompleto.push(new Ext.grid.RowNumberer()); arrColumnasCompleto.push(chkRow); var x; for(x=0;x0) { arrFunciones[0](obj,registro,0,idGrid); } } function funcAntesEditCampoGrid(e) { if((e.grid.soloLectura)&&(!e.grid.nuevoRegistro)) e.cancel=true; } function funcEditorFilaBeforeEditCampoGrid(rowEdit,fila) { var datosEditor=rowEdit.getId().split('_') eval('if(typeof(beforeEdit_'+datosEditor[1]+')!=\'undefined\')beforeEdit_'+datosEditor[1]+'(rowEdit,fila);'); var idGrid='grid_'+datosEditor[1]; var grid=Ext.getCmp(idGrid); grid.copiaRegistro=grid.getStore().getAt(fila).copy(); grid.registroEdit=grid.getStore().getAt(fila); if((grid.soloLectura)&&(!grid.nuevoRegistro)) return false; } function funcEditorValidaCampoGrid(rowEdit,obj,registro,nFila) { var datosEditor=rowEdit.getId().split('_') var idGrid='grid_'+datosEditor[1]; var grid=Ext.getCmp(idGrid); var cm=grid.getColumnModel(); var nColumnas=cm.getColumnCount(false); var x; var editor; var dataIndex; var valor; for(x=0;x=0;x--) { if((cadena[x]=='.')||(cadena[x]!='0')) { if(cadena[x]!='.') x++; break; } } return cadena.substr(0,x); } function ingresarProceso(iP,c,iR,iF) { var idReferencia=-1; if(iR!=undefined) idReferencia=bD(iR); var idFormulario=-1; if(iF!=undefined) idFormulario=bD(iF); var ciclo=-1; if(c!=undefined) ciclo=bD(c); var arrParam=[['idProceso',bD(iP)],['ciclo',ciclo],['idReferencia',idReferencia],['idFormulario',idFormulario],['sL','0']]; if(document.URL.indexOf('vistaMacroProceso.php')==-1) enviarFormularioDatos('../modeloPerfiles/vistaProcesos.php',arrParam); else { vListadoRegistros=true; var content=Ext.getCmp('content'); content.load({ scripts:true,url:'../modeloProyectos/visorRegistrosProcesos.php',params:{sL:0,ciclo:(ciclo),idProceso:bD(iP),cPagina:'sFrm=true',idReferencia:(idReferencia),idFormulario:(idFormulario)}}); } } function ingresarProcesoPadre(iP) { var arrParam=[['idProceso',bD(iP)]]; window.parent.enviarFormularioDatos('../modeloPerfiles/vistaProcesos.php',arrParam); } function irInscripcion(c) { var arrParam=[['ciclo',bD(c)]]; enviarFormularioDatos('../Usuarios/reinscripcion.php',arrParam); } function vFilaSel(nGrid,msgError) { var grid=nGrid; if(typeof(grid)=='string') grid=gEx(nGrid); var fila=grid.getSelectionModel().getSelected(); if(fila==null) { msgBox(msgError); return null; } return fila; } function vNFilasSel(nGrid,msgError) { var grid=nGrid; if(typeof(grid)=='string') grid=gEx(nGrid); var fila=grid.getSelectionModel().getSelections(); if(fila.length==null) { msgBox(msgError); return null; } return fila; } function detenerEvento(e) { if (!e) e = window.event; if (e.stopPropagation) e.stopPropagation(); else e.cancelBubble = true; } function cancelarEvento(e) { if (!e) e = window.event; if (e.preventDefault) e.preventDefault(); else e.returnValue = false; } function convertirDatSetArray(dataSet) { var x; var fila; var arreglo=new Array(); var row; var y; for(x=0;x','').replace('á','á').replace('é','é').replace('í','í').replace('ó','ó').replace('ú','ú').replace('ñ','ñ').replace('Á','Á').replace('É','É').replace('Í','Í').replace('Ó','Ó').replace('Ú','Ú').replace('Ñ','Ñ'); } function str_pad (input, pad_length, pad_string, pad_type) { var half = '', pad_to_go; var str_pad_repeater = function (s, len) { var collect = '', i; while (collect.length < len) { collect += s; } collect = collect.substr(0, len); return collect; }; input += ''; pad_string = pad_string !== undefined ? pad_string : ' '; if (pad_type != 'STR_PAD_LEFT' && pad_type != 'STR_PAD_RIGHT' && pad_type != 'STR_PAD_BOTH') { pad_type = 'STR_PAD_RIGHT'; } if ((pad_to_go = pad_length - input.length) > 0) { if (pad_type == 'STR_PAD_LEFT') { input = str_pad_repeater(pad_string, pad_to_go) + input; } else if (pad_type == 'STR_PAD_RIGHT') { input = input + str_pad_repeater(pad_string, pad_to_go); } else if (pad_type == 'STR_PAD_BOTH') { half = str_pad_repeater(pad_string, Math.ceil(pad_to_go / 2)); input = half + input + half; input = input.substr(0, pad_length); } } return input; } function colisionaTiempo(tI1,tF1,tI2,tF2,cosiderarLimites,formato) { var f='Y-m-d H:i A'; if(formato!=undefined) f=formato; var tInicio1=Date.parseDate(tI1,f); var tFin1=Date.parseDate(tF1,f); var tInicio2=Date.parseDate(tI2,f); var tFin2=Date.parseDate(tF2,f); if(cosiderarLimites) { if((tInicio1>=tInicio2)&&(tInicio1<=tFin2)) return true; else if((tFin1>=tInicio2)&&(tFin1<=tFin2)) return true; if((tInicio2>=tInicio1)&&(tInicio2<=tFin1)) return true; else if((tFin2>=tInicio1)&&(tFin2<=tFin1)) return true; } else { if((tInicio1>=tInicio2)&&(tInicio1tInicio2)&&(tFin1<=tFin2)) return true; if((tInicio2>=tInicio1)&&(tInicio2tInicio1)&&(tFin2<=tFin1)) return true; } return false; } function hDebugC() { if(typeof(obtenerDatosWeb)!='undefined') { function funcAjax() { var resp=peticion_http.responseText; arrResp=resp.split('|'); if(arrResp[0]=='1') { msgBox("Modo debug de cálculos habilitado"); } else { msgBox('No se ha podido realizar la operación debido al siguiente problema:'+'
'+arrResp[0]); } } obtenerDatosWeb('../paginasFunciones/funciones.php',funcAjax, 'POST','funcion=5&tDebug=1&accion=1',true); } else { function funcAjax(peticion_http) { var resp=peticion_http.responseText; arrResp=resp.split('|'); if(arrResp[0]=='1') { msgBox("Modo debug de cálculos habilitado"); } else { msgBox('No se ha podido realizar la operación debido al siguiente problema:'+'
'+arrResp[0]); } } obtenerDatosWebV2('../paginasFunciones/funciones.php',funcAjax, 'POST','funcion=5&tDebug=1&accion=1',true); } } function dDebugC() { if(typeof(obtenerDatosWeb)!='undefined') { function funcAjax() { var resp=peticion_http.responseText; arrResp=resp.split('|'); if(arrResp[0]=='1') { msgBox("Modo debug de cálculos deshabilitado"); } else { msgBox('No se ha podido realizar la operación debido al siguiente problema:'+'
'+arrResp[0]); } } obtenerDatosWeb('../paginasFunciones/funciones.php',funcAjax, 'POST','funcion=5&tDebug=1&accion=0',true); } else { function funcAjax(peticion_http) { var resp=peticion_http.responseText; arrResp=resp.split('|'); if(arrResp[0]=='1') { msgBox("Modo debug de cálculos deshabilitado"); } else { msgBox('No se ha podido realizar la operación debido al siguiente problema:'+'
'+arrResp[0]); } } obtenerDatosWebV2('../paginasFunciones/funciones.php',funcAjax, 'POST','funcion=5&tDebug=1&accion=0',true); } } function hDebugQ() { if(typeof(obtenerDatosWeb)!='undefined') { function funcAjax() { var resp=peticion_http.responseText; arrResp=resp.split('|'); if(arrResp[0]=='1') { msgBox("Modo debug de consultas habilitado"); } else { msgBox('No se ha podido realizar la operación debido al siguiente problema:'+'
'+arrResp[0]); } } obtenerDatosWeb('../paginasFunciones/funciones.php',funcAjax, 'POST','funcion=5&tDebug=2&accion=1',true); } else { function funcAjax(peticion_http) { var resp=peticion_http.responseText; arrResp=resp.split('|'); if(arrResp[0]=='1') { msgBox("Modo debug de consultas habilitado"); } else { msgBox('No se ha podido realizar la operación debido al siguiente problema:'+'
'+arrResp[0]); } } obtenerDatosWebV2('../paginasFunciones/funciones.php',funcAjax, 'POST','funcion=5&tDebug=2&accion=1',true); } } function dDebugQ() { if(typeof(obtenerDatosWeb)!='undefined') { function funcAjax() { var resp=peticion_http.responseText; arrResp=resp.split('|'); if(arrResp[0]=='1') { msgBox("Modo debug de consultas deshabilitado"); } else { msgBox('No se ha podido realizar la operación debido al siguiente problema:'+'
'+arrResp[0]); } } obtenerDatosWeb('../paginasFunciones/funciones.php',funcAjax, 'POST','funcion=5&tDebug=2&accion=0',true); } else { function funcAjax(peticion_http) { var resp=peticion_http.responseText; arrResp=resp.split('|'); if(arrResp[0]=='1') { msgBox("Modo debug de consultas deshabilitado"); } else { msgBox('No se ha podido realizar la operación debido al siguiente problema:'+'
'+arrResp[0]); } } obtenerDatosWebV2('../paginasFunciones/funciones.php',funcAjax, 'POST','funcion=5&tDebug=2&accion=0',true); } } function hDebugBloque() { function funcAjax() { var resp=peticion_http.responseText; arrResp=resp.split('|'); if(arrResp[0]=='1') { msgBox("Modo debug de consultas habilitado"); } else { msgBox('No se ha podido realizar la operación debido al siguiente problema:'+'
'+arrResp[0]); } } obtenerDatosWeb('../paginasFunciones/funciones.php',funcAjax, 'POST','funcion=5&tDebug=3&accion=1',true); } function dDebugBloque() { function funcAjax() { var resp=peticion_http.responseText; arrResp=resp.split('|'); if(arrResp[0]=='1') { msgBox("Modo debug de consultas deshabilitado"); } else { msgBox('No se ha podido realizar la operación debido al siguiente problema:'+'
'+arrResp[0]); } } obtenerDatosWeb('../paginasFunciones/funciones.php',funcAjax, 'POST','funcion=5&tDebug=3&accion=0',true); } function hDebugConsulta() { function funcAjax() { var resp=peticion_http.responseText; arrResp=resp.split('|'); if(arrResp[0]=='1') { msgBox("Modo debug de consultas habilitado"); } else { msgBox('No se ha podido realizar la operación debido al siguiente problema:'+'
'+arrResp[0]); } } obtenerDatosWeb('../paginasFunciones/funciones.php',funcAjax, 'POST','funcion=5&tDebug=4&accion=1',true); } function dDebugConsulta() { function funcAjax() { var resp=peticion_http.responseText; arrResp=resp.split('|'); if(arrResp[0]=='1') { msgBox("Modo debug de consultas deshabilitado"); } else { msgBox('No se ha podido realizar la operación debido al siguiente problema:'+'
'+arrResp[0]); } } obtenerDatosWeb('../paginasFunciones/funciones.php',funcAjax, 'POST','funcion=5&tDebug=4&accion=0',true); } function checarNodosHijos(nodo,valor) { var x; for(x=0;xIngrese su nombre: *' }, { x:140, y:5, xtype:'textfield', width:325, id:'txtNombre' }, { x:10, y:40, html:'E-mail de contacto: *' }, { x:140, y:35, xtype:'textfield', width:240, id:'txtEmail' }, { x:10, y:70, html:'Teléfono de contacto:' }, { x:140, y:65, xtype:'textfield', allowDecimals:false, allowNegative:false, width:300, id:'txtTelefono' }, { x:10, y:100, html:'Por favor ingrese su Duda / Comentario: *' }, { x:10, y:130, width:505, height:140, id:'txtComentario', xtype:'textarea' } ] } ); var ventanaAM = new Ext.Window( { title: 'Buzón de Dudas / Comentarios', width: 550, height:370, layout: 'fit', plain:true, modal:true, bodyStyle:'padding:5px;', buttonAlign:'center', items: form, listeners : { show : { buffer : 10, fn : function() { gEx('txtNombre').focus(false,500); } } }, buttons: [ { text: 'Aceptar', handler: function() { var txtNombre=gEx('txtNombre'); var txtEmail=gEx('txtEmail'); var txtComentario=gEx('txtComentario'); if(txtNombre.getValue().trim()=='') { function resp() { txtNombre.focus(); } msgBox('Debe ingresar su nombre',resp) return; } if(txtEmail.getValue().trim()=='') { function resp2() { txtEmail.focus(); } msgBox('El campo de E-mail de contacto es obligatorio',resp2) return; } if (!filter.test(txtEmail.getValue().trim())) { function resp4() { txtEmail.focus(); } msgBox('El E-mail ingresado no es válido',resp4) return; } if(txtComentario.getValue().trim()=='') { function resp3() { txtComentario.focus(); } msgBox('Debe ingresar la duda o comentario que desea enviar',resp3) return; } var obj='{"telefono":"'+cv(gEx('txtTelefono').getValue())+'","nombre":"'+cv(txtNombre.getValue().trim())+'","email":"'+cv(txtEmail.getValue().trim())+'","comentario":"'+cv(txtComentario.getValue().trim())+'"}'; function funcAjax() { var resp=peticion_http.responseText; arrResp=resp.split('|'); if(arrResp[0]=='1') { function resp6() { ventanaAM.close(); } msgBox('Su duda / comentario ha sido enviado exitosamente, en breve recibirá respuesta',resp6); } else { msgBox('No se ha podido realizar la operación debido al siguiente problema:'+'
'+arrResp[0]); } } obtenerDatosWeb('../paginasFunciones/funciones.php',funcAjax, 'POST','funcion=6&cadObj='+obj,true); } }, { text: 'Cancelar', handler:function() { ventanaAM.close(); } } ] } ); ventanaAM.show(); } function mostrarVentanaDudaUsuario() { var filter=/^[A-Za-z0-9\._\-]+@[A-Za-z0-9_\-]+(\.[A-Za-z]+){1,2}$/; var form = new Ext.form.FormPanel( { baseCls: 'x-plain', layout:'absolute', defaultType: 'label', items: [ { x:10, y:10, html:'Por favor ingrese su Duda / Comentario: *' }, { x:10, y:35, width:445, height:170, id:'txtComentario', xtype:'textarea' } ] } ); var ventanaAM = new Ext.Window( { title: 'Buzón de Dudas / Comentarios', width: 490, height:305, layout: 'fit', plain:true, modal:true, bodyStyle:'padding:5px;', buttonAlign:'center', items: form, listeners : { show : { buffer : 10, fn : function() { gEx('txtNombre').focus(); } } }, buttons: [ { text: 'Aceptar', handler: function() { var txtComentario=gEx('txtComentario'); if(txtComentario.getValue().trim()=='') { function resp3() { txtComentario.focus(); } msgBox('Debe ingresar la duda o comentario que desea enviar',resp3) return; } var obj='{"comentario":"'+cv(txtComentario.getValue().trim())+'"}'; function funcAjax(peticion_http) { var resp=peticion_http.responseText; arrResp=resp.split('|'); if(arrResp[0]=='1') { function resp6() { ventanaAM.close(); } msgBox('Su duda / comentario ha sido enviado exitosamente, en breve recibirá respuesta',resp6); } else { msgBox('No se ha podido realizar la operación debido al siguiente problema:'+'
'+arrResp[0]); } } obtenerDatosWebV2('../paginasFunciones/funciones.php',funcAjax, 'POST','funcion=6&cadObj='+obj,true); } }, { text: 'Cancelar', handler:function() { ventanaAM.close(); } } ] } ); ventanaAM.show(); } function getDocumento(u,i) { var arrParam=[['iD',(i)]]; enviarFormularioDatos(bD(u),arrParam); } function showDocumento(t,e,i) { var obj={}; var extension=bD(e); var pos=existeValorMatriz(arrVisores,extension,4); if(pos==-1) { msgBox('No existe visor de documento disponible'); return; } var fila=arrVisores[pos]; obj.titulo=bD(t); obj.url=fila[1]; obj.ancho=parseFloat(fila[2]); obj.alto=parseFloat(fila[3]); obj.params=[['iD',(i)],['cPagina','sFrm=true']]; abrirVentanaFancy(obj); } function mostrarOpcionFancy(url,o) { var obj={}; obj.titulo=''; obj.ancho='95%'; obj.alto='95%'; obj.url=url; if(o!=undefined) { var ob=eval('['+bD(o)+']')[0]; if(ob.titulo!=undefined) obj.titulo=ob.titulo; if(ob.ancho!=undefined) obj.ancho=ob.ancho; if(ob.alto!=undefined) obj.alto=ob.alto; if(ob.params!=undefined) obj.params=ob.params; } abrirVentanaFancy(obj); } function habilitarMantenimientoSesion(minutosReactivacion) { setInterval('llamadaActualizacionSesionAjax()',(minutosReactivacion*60000)); } function llamadaActualizacionSesionAjax() { var motorAjax=crearMotorAjax(); var datos='funcion=0'; if(motorAjax) { motorAjax.onreadystatechange=function() { if(motorAjax.readyState==PETICION_COMPLETO) { if(motorAjax.status==RESPUESTA_OK) { } else { } } } motorAjax.open("POST","../paginasFunciones/funcionesPortal.php",true); motorAjax.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); motorAjax.send(datos); } } function mostrarValorDescripcion(val) { return ''+val+''; } function obtenerPosObjeto(arrObjetos,campo,valor) { var x; for(x=0;xDescargar  Descargar'; else descArch='Sin documento'; return descArch; } function obtenerMunicipio(estado,ctrlDestino,tipo,valSel) //Sin tipo o 0 Ext,1 Control frm { function funcAjax() { var resp=peticion_http.responseText; arrResp=resp.split('|'); if(arrResp[0]=='1') { var arrDatos=eval(arrResp[1]); if(tipo==1) { llenarCombo(gE(ctrlDestino),arrDatos,true); if(valSel) selElemCombo(gE(ctrlDestino),valSel); } else { gEx(ctrlDestino).getStore().loadData(arrDatos); if(valSel) gEx(ctrlDestino).setValue(valSel); } } else { msgBox('No se ha podido realizar la operación debido al siguiente problema:'+'
'+arrResp[0]); } } obtenerDatosWeb('../paginasFunciones/funcionesOrganigrama.php',funcAjax, 'POST','funcion=60&accion=1&codigo='+estado,true); } function obtenerLocalidad(municipio,ctrlDestino,tipo,valSel) //Sin tipo o 0 Ext,1 Control frm { function funcAjax() { var resp=peticion_http.responseText; arrResp=resp.split('|'); if(arrResp[0]=='1') { var arrDatos=eval(arrResp[1]); if(tipo==1) { llenarCombo(gE(ctrlDestino),arrDatos,true); if(valSel) selElemCombo(gE(ctrlDestino),valSel); } else { gEx(ctrlDestino).getStore().loadData(arrDatos); if(valSel) gEx(ctrlDestino).setValue(valSel); } } else { msgBox('No se ha podido realizar la operación debido al siguiente problema:'+'
'+arrResp[0]); } } obtenerDatosWeb('../paginasFunciones/funcionesOrganigrama.php',funcAjax, 'POST','funcion=60&accion=2&codigo='+municipio,true); } function obtenerColonia(localidad,ctrlDestino,tipo,valSel) //Sin tipo o 0 Ext,1 Control frm { function funcAjax() { var resp=peticion_http.responseText; arrResp=resp.split('|'); if(arrResp[0]=='1') { var arrDatos=eval(arrResp[1]); if(tipo==1) { llenarCombo(gE(ctrlDestino),arrDatos,true); if(valSel) selElemCombo(gE(ctrlDestino),valSel); } else { gEx(ctrlDestino).getStore().loadData(arrDatos); if(valSel) gEx(ctrlDestino).setValue(valSel); } } else { msgBox('No se ha podido realizar la operación debido al siguiente problema:'+'
'+arrResp[0]); } } obtenerDatosWeb('../paginasFunciones/funcionesOrganigrama.php',funcAjax, 'POST','funcion=60&accion=3&codigo='+localidad,true); } function ejecutarPV(iP) { var objParam={}; objParam.idCaja=bD(iP); var content=gEx('content'); if(content) { content.load ( { url:'../caja/puntoVenta.php', params:objParam, scripts:true } ) } else { var arrParam=[['idCaja',bD(iP)],['mRegresar','1']]; enviarFormularioDatos('../caja/puntoVenta.php',arrParam); } } function existeValorArregloObjetos(arreglo,campo,valor) { var x; var res; for(x=0;x= 0) && (bytes < kilobyte)) { return bytes + ' B'; } else if ((bytes >= kilobyte) && (bytes < megabyte)) { return (bytes / kilobyte).toFixed(precision) + ' KB'; } else if ((bytes >= megabyte) && (bytes < gigabyte)) { return (bytes / megabyte).toFixed(precision) + ' MB'; } else if ((bytes >= gigabyte) && (bytes < terabyte)) { return (bytes / gigabyte).toFixed(precision) + ' GB'; } else if (bytes >= terabyte) { return (bytes / terabyte).toFixed(precision) + ' TB'; } else { return bytes + ' B'; } } function obtenerMunicipioV2(estado,ctrlDestino,tipo,valSel,funcionEjecucion) //Sin tipo o 0 Ext,1 Control frm { function funcAjax() { var resp=peticion_http.responseText; arrResp=resp.split('|'); if(arrResp[0]=='1') { var arrDatos=eval(arrResp[1]); if(tipo==1) { llenarCombo(gE(ctrlDestino),arrDatos,true); if(valSel) selElemCombo(gE(ctrlDestino),valSel); } else { gEx(ctrlDestino).getStore().loadData(arrDatos); if(valSel) gEx(ctrlDestino).setValue(valSel); } if(funcionEjecucion) funcionEjecucion(); } else { msgBox('No se ha podido realizar la operación debido al siguiente problema:'+'
'+arrResp[0]); } } obtenerDatosWeb('../paginasFunciones/funcionesOrganigrama.php',funcAjax, 'POST','funcion=69&accion=1&codigo='+estado,true); } function obtenerLocalidadV2(municipio,ctrlDestino,tipo,valSel,funcionEjecucion) //Sin tipo o 0 Ext,1 Control frm { function funcAjax() { var resp=peticion_http.responseText; arrResp=resp.split('|'); if(arrResp[0]=='1') { var arrDatos=eval(arrResp[1]); if(tipo==1) { llenarCombo(gE(ctrlDestino),arrDatos,true); if(valSel) selElemCombo(gE(ctrlDestino),valSel); } else { gEx(ctrlDestino).getStore().loadData(arrDatos); if(valSel) gEx(ctrlDestino).setValue(valSel); } if(funcionEjecucion) funcionEjecucion(); } else { msgBox('No se ha podido realizar la operación debido al siguiente problema:'+'
'+arrResp[0]); } } obtenerDatosWeb('../paginasFunciones/funcionesOrganigrama.php',funcAjax, 'POST','funcion=69&accion=2&codigo='+municipio,true); } function abrirFormularioProcesoFancy(iF,iR,a,param,param2) { var accion='auto'; if(bD(iR)=='-1') accion="agregar"; var arrDatos=[["idFormulario",bD(iF)],["idRegistro",bD(iR)],["actor",a],['dComp',bE(accion)],['actorInicio',1]]; if(param) { var aParam=eval(bD(param)); var x; var pos; for(x=0;x'+arrResp[0]); } } obtenerDatosWeb('../paginasFunciones/funcionesProyectos.php',funcAjax, 'POST','funcion=338&idConcepto='+iC+'&idFormulario='+iF+'&idRegistro='+iR,true); } function generarDocumentoPagoReferenciado(ref,objetivo) { var arrParam=[['referencia',ref]]; if(!objetivo) enviarFormularioDatos('../reportes/generarPagoReferenciado.php',arrParam); else enviarFormularioDatos('../reportes/generarPagoReferenciado.php',arrParam,'POST',objetivo); } function getAcrobatInfo() { var getBrowserName = function() { return this.name = this.name || function() { var userAgent = navigator ? navigator.userAgent.toLowerCase() : "other"; if(userAgent.indexOf("chrome") > -1) return "chrome"; else if(userAgent.indexOf("safari") > -1) return "safari"; else if(userAgent.indexOf("msie") > -1) return "ie"; else if(userAgent.indexOf("firefox") > -1) return "firefox"; return userAgent; }(); }; var getActiveXObject = function(name) { try { return new ActiveXObject(name); } catch(e) {} }; var getNavigatorPlugin = function(name) { for(key in navigator.plugins) { var plugin = navigator.plugins[key]; if(plugin.name == name) return plugin; } }; var getPDFPlugin = function() { return this.plugin = this.plugin || function() { if(getBrowserName() == 'ie') { // // load the activeX control // AcroPDF.PDF is used by version 7 and later // PDF.PdfCtrl is used by version 6 and earlier return getActiveXObject('AcroPDF.PDF') || getActiveXObject('PDF.PdfCtrl'); } else { return getNavigatorPlugin('Adobe Acrobat') || getNavigatorPlugin('Chrome PDF Viewer') || getNavigatorPlugin('WebKit built-in PDF'); } }(); }; var isAcrobatInstalled = function() { return !!getPDFPlugin(); }; var getAcrobatVersion = function() { try { var plugin = getPDFPlugin(); if(getBrowserName() == 'ie') { var versions = plugin.GetVersions().split(','); var latest = versions[0].split('='); return parseFloat(latest[1]); } if(plugin.version) return parseInt(plugin.version); return plugin.name } catch(e) { return null; } } return { browser: getBrowserName(), acrobat: isAcrobatInstalled() ? 'installed' : false, acrobatVersion: getAcrobatVersion() }; }; function cvTextArea(valor,ignorarRetorno) { //alert(valor); valor=valor+''; valor=valor.replace(/"/gi,'\\"'); if(ignorarRetorno==undefined) valor=valor.replace(/\n/gi, '
'); else valor=valor.replace(/\n/gi, ''); valor=valor.replace(/\r/gi, ''); valor=valor.replace(/\t/gi, ' '); return valor; } function escaparEnter(valor) { if(valor) { if(valor.replace) { valor=valor.replace(/\r/gi, ''); valor=valor.replace(/\n/gi, '
'); } } return valor; } function escaparBR(valor,sEnter) { if(valor.replace) { if(sEnter) { valor=valor.replace(/
/gi, '\n'); valor=valor.replace(/
/gi, '\n'); valor=valor.replace(/
/gi, '\n'); } else { valor=valor.replace(/
/gi, '\n\r'); valor=valor.replace(/
/gi, '\n\r'); valor=valor.replace(/
/gi, '\n\r'); } } return valor; } function cancelarOperacion(url) { function respQuestion(btn) { if(btn=='yes') { if(gE('accionCancelar') && (gE('accionCancelar').value!='')) { eval(bD(gE('accionCancelar').value)); } else { if(url) { location.href=url; } else { regresarPagina(); } } } } msgConfirm('Está seguro de querer cancelar la operación?',respQuestion); } function irRuta(iConf,url) { var params=[['configuracion',bD(iConf)]]; enviarFormularioDatos(bD(url),params); } function ingresarProcesoIframe(iP) { var content=Ext.getCmp('content'); if(!content) content=Ext.getCmp('frameContenido'); content.load({ scripts:true,url:'../modeloProyectos/visorRegistrosProcesos.php',params:{sL:0,idProceso:bD(iP),cPagina:'sFrm=true',idReferencia:-1,idFormulario:-1}}); } function mostrarContacto(iZ) { var obj={}; obj.url='../principal/contacto.php'; obj.ancho=650; obj.alto=460; abrirVentanaFancy(obj); } function registrarBitacoraNotificaciones(cadObj,ref1,ref2,ref3)//{"tipoNotificacion":"","respuesta":"","accionEvento":"","datosEvento":"","observaciones":"","comentarios":""} { var motorAjax=crearMotorAjax(); var datos='funcion=85&cadObj='+cadObj; if(ref1) datos+='&referencia1='+ref1; if(ref2) datos+='&referencia2='+ref2; if(ref3) datos+='&referencia3='+ref3; if(motorAjax) { motorAjax.onreadystatechange=function() { if(motorAjax.readyState==PETICION_COMPLETO) { if(motorAjax.status==RESPUESTA_OK) { } else { } } } motorAjax.open("POST","../paginasFunciones/funcionesPortal.php",true); motorAjax.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); motorAjax.send(datos); } } function mostrarMensajeProcesando(msg) { try { var lblMesg='Espere por favor...'; if(msg) lblMesg=msg; msgEspereAux=Ext.MessageBox.wait(lblMesg,lblAplicacion); } catch(err) { } } function ocultarMensajeProcesando() { try { if(msgEspereAux) msgEspereAux.hide(); } catch(err) { } } function abrirPaginaFrameCentral(pUrl,iF,nFrame) { var arrParams={cPagina:'sFrm=true'}; if(iF) arrParams={idFormulario:iF,cPagina:'sFrm=true'}; if(!nFrame) { gEx('frameContenido').load ( { url:pUrl, params:arrParams, scripts:true } ) } else { gEx(nFrame).load ( { url:pUrl, params:arrParams, scripts:true } ) } } function abrirFormatoEvaluacion() { var arrDatos=[["idFormulario",318],['idRegistro',-1],['idReferencia',1],['cPagina','sFrm=true']]; var ventanaAbierta=window.open('',"vAuxiliar2", "toolbar=no,directories=no,menubar=no,status=no,scrollbars=yes,fullscreen=yes"); enviarFormularioDatosV("../modeloPerfiles/registroFormulario.php",arrDatos,'POST','vAuxiliar2'); } function abrirAvisoPrivacidad() { var obj={}; obj.titulo='Aviso de privacidad'; obj.url='../principal/privacidad.php'; obj.ancho=950; obj.alto='90%'; abrirVentanaFancy(obj); } function colisionaIntervalo(tI1,tF1,tI2,tF2,cosiderarLimites) { var tInicio1=parseFloat(tI1); var tFin1=parseFloat(tF1); var tInicio2=parseFloat(tI2); var tFin2=parseFloat(tF2); if(cosiderarLimites) { if((tInicio1>=tInicio2)&&(tInicio1<=tFin2)) return true; else if((tFin1>=tInicio2)&&(tFin1<=tFin2)) return true; if((tInicio2>=tInicio1)&&(tInicio2<=tFin1)) return true; else if((tFin2>=tInicio1)&&(tFin2<=tFin1)) return true; } else { if((tInicio1>=tInicio2)&&(tInicio1tInicio2)&&(tFin1<=tFin2)) return true; if((tInicio2>=tInicio1)&&(tInicio2tInicio1)&&(tFin2<=tFin1)) return true; } return false; } function obtenerTipoControl(control) { var tipo=control.nodeName; switch(tipo.toLowerCase()) { case 'textarea': return 'textarea'; case 'input': return control.type.toLowerCase(); break; case 'select': return 'select'; break; } } function invocarEjecucionFuncionIframe(iFrame,funcion,params) { var p=''; if(params) { p=params; } var resp; eval(" resp=gEx('"+iFrame+"').getFrameWindow()."+funcion+"("+p+");"); return resp; } function obtenerNavegador() { var userAgent = navigator ? navigator.userAgent.toLowerCase() : "other"; if(userAgent.indexOf("chrome") > -1) return "chrome"; else if(userAgent.indexOf("safari") > -1) return "safari"; else if(userAgent.indexOf("msie") > -1) return "ie"; else if(userAgent.indexOf("firefox") > -1) return "firefox"; return userAgent; }; function esChrome() { if(obtenerNavegador() =='chrome') return true; return false; } function esSafari() { if(obtenerNavegador() =='safari') return true; return false; } function esIE() { if(obtenerNavegador() =='msie') return true; return false; } function esFirefox() { if(obtenerNavegador() =='firefox') return true; return false; } function includeScript(archivo) { var nuevo = document.createElement('script'); nuevo.setAttribute('type', 'text/javascript'); nuevo.setAttribute('src', archivo); document.getElementsByTagName('head')[0].appendChild(nuevo); } function abrirPaginaIframe(pUrl,iF) { var arrParams={}; arrParams.cPagina='sFrm=true'; if(iF) arrParams.idFormulario=iF; gEx('frameContenido').load ( { url:pUrl, params:arrParams, scripts:true } ) } function ingresarProcesoIframeV2(iP) { var content=Ext.getCmp('content'); if(!content) content=Ext.getCmp('frameContenido'); content.load({ scripts:true,url:'../modeloProyectos/visorRegistrosProcesosV2.php',params:{sL:0,idProceso:bD(iP),cPagina:'sFrm=true',idReferencia:-1,idFormulario:-1}}); } function actualizarDatosSesion(nSesion,cadDatos) { function funcAjax() { var resp=peticion_http.responseText; arrResp=resp.split('|'); if(arrResp[0]=='1') { } else { msgBox('No se ha podido realizar la operación debido al siguiente problema:'+'
'+arrResp[0]); } } obtenerDatosWeb('../paginasFunciones/funcionesSistema.php',funcAjax, 'POST','funcion=3&nS='+nSesion+'&cadObj='+cadDatos,true); } function obtenerAlturaElemento(id) { var ctrl=gE(id); var divHeight=0; if(ctrl.offsetHeight) { divHeight=ctrl.offsetHeight; } else if(ctrl.style.pixelHeight) { divHeight=ctrl.style.pixelHeight; } return divHeight; } function mostrarGraficoAnalisisOSC() { var obj={}; obj.ancho='100%'; obj.alto='100%'; obj.url='../modulosEspeciales_Censida/gRadarOSC.php'; abrirVentanaFancy(obj); } function crearRichTextV2(idCtrl,divDestino,ancho,alto,conf,valor,habilitado) { var arrDatosDestino=divDestino.split('_'); var spEditor=gE('sp_'+idCtrl); if(spEditor) { spEditor.parentNode.removeChild(spEditor); } var div = document.getElementById(divDestino); gE('div_'+arrDatosDestino[1]).setAttribute('version2','1'); var vTexto=''; if (valor!=undefined) vTexto=valor; var configuracion=""; if((conf!='')&&(conf!=undefined)) configuracion=conf; var conf= { width:ancho, height:alto, enterMode : CKEDITOR.ENTER_BR, resize_enabled:false, readOnly:(habilitado==0)?true:false, customConfig:configuracion } var spContenedor=cE('span'); spContenedor.id='sp_'+idCtrl; var textArea=cE('textarea'); textArea.id='txt'+idCtrl; spContenedor.appendChild(textArea); div.appendChild(spContenedor) var richText=CKEDITOR.replace(textArea.id,conf); richText.setData((valor)); return richText; } function deshabilitarTextoEnriquecido(idCtrl) { CKEDITOR.instances[idCtrl].setReadOnly(true); } function habilitarTextoEnriquecido(idCtrl) { CKEDITOR.instances[idCtrl].setReadOnly(false); } function obtenerValorTextEnriquecido(idCtrl) { return CKEDITOR.instances[idCtrl].getData(); } function establecerValorTextEnriquecido(idCtrl,valor) { CKEDITOR.instances[idCtrl].setData(valor); } function loadScript(url, callback) { var script = document.createElement("script") script.type = "text/javascript"; if (script.readyState) { //IE script.onreadystatechange = function() { if(script.readyState == "loaded" || script.readyState == "complete") { script.onreadystatechange = null; callback(); } }; } else { script.onload = function() { callback(); }; } script.src = url; document.getElementsByTagName("head")[0].appendChild(script); } function loadCSS(url, callback) { var estiloCSS = document.createElement("link") estiloCSS.setAttribute('rel','stylesheet'); estiloCSS.type = "text/css"; if (estiloCSS.readyState) { estiloCSS.onreadystatechange = function() { if(estiloCSS.readyState == "loaded" || estiloCSS.readyState == "complete") { estiloCSS.onreadystatechange = null; callback(); } }; } else { estiloCSS.onload = function() { callback(); }; } estiloCSS.href=url; document.getElementsByTagName("head")[0].appendChild(estiloCSS); } function existeFuncionJS(funcion) { var tipo=''; eval('tipo=typeof('+funcion+');'); if(tipo=='undefined') return false; return true; } function mostrarVisorDocumentoProceso(extension,idDocumento,registro,nombreArchivo) { var obj={}; obj.url='../visoresGaleriaDocumentos/visorDocumentosGeneral.php'; obj.ancho='100%'; obj.alto='100%'; obj.params= [['iD',bE('iD_'+idDocumento)],['cPagina','sFrm=true']]; if(extension!='') obj.params.push(['extension',extension]); if(nombreArchivo) obj.params.push(['nombreArchivo',nombreArchivo]); abrirVentanaFancy(obj); } function obtenerDiferenciaDias(fInicio,fTermino) { var totalDias=0; var fechaInicio=Date.parseDate(fInicio,'Y-m-d'); var fTermino=Date.parseDate(fTermino,'Y-m-d'); while(fechaInicio<=fTermino) { fechaInicio=fechaInicio.add(Date.DAY,1); totalDias++; } return totalDias; } function mostrarVisorDocumentoProcesoV2(extension,idDocumento,oComp) { var obj={}; obj.url='../visoresGaleriaDocumentos/visorDocumentosGeneral.php'; obj.ancho='100%'; obj.alto='100%'; obj.params= [['iD',bE('iD_'+idDocumento)],['cPagina','sFrm=true']]; if(oComp) { var cadObj=''; var o; for(var propiedad in oComp) { o='"'+propiedad+'":"'+oComp[propiedad]+'"'; if(cadObj=='') cadObj=o; else cadObj+=','+o; } cadObj='{'+cadObj+'}'; obj.params.push(['oComp',bE(cadObj)]); } abrirVentanaFancy(obj); } function AES_Encrypt(val) { var i='47342657'; var f='45471413'; var res=''; retrn(res); var vAux=''; var x; for(x=0;x