añado js
This commit is contained in:
+297
@@ -0,0 +1,297 @@
|
||||
|
||||
// ******************************************
|
||||
// Cargamos las opciones del menu en un ARRAY
|
||||
// ******************************************
|
||||
|
||||
// Inicializar las variables para la función generaPath
|
||||
|
||||
|
||||
var ADMINISTRADOR = "00";
|
||||
var CABECERA = "01";
|
||||
var ANALISTA = "02";
|
||||
var ESPECIALISTA = "03";
|
||||
var REHABPOD = "04";
|
||||
var ATS = "05";
|
||||
var ESTOMA = "06";
|
||||
var ODON = "07";
|
||||
var RADIOLOGO = "08";
|
||||
setCookie("SECCION", SECCION_MEDICOS);
|
||||
|
||||
|
||||
// el 1er parametro es el texto que se muestra
|
||||
// el 2o parametro es la URL a la que va el link
|
||||
// el 3er parametro son los perfiles que admite esa opcion
|
||||
|
||||
// escribimos el 1er nivel de navegacion
|
||||
var menu = new Array();
|
||||
// Gestion medicos
|
||||
menu[0] = ["Cabecera", pathLOCAL + "jsp/med/cabecera.jsp?x=0", "01|02|03|04|05|06|07|08"];
|
||||
menu[1] = ["Password", pathLOCAL + "jsp/med/password.jsp?x=1", "00|01|02|03|04|05|06|07|08"];
|
||||
menu[2] = ["Actos M\u00E9dicos", pathLOCAL + "jsp/med/actos.jsp?x=2&pagina=1", "01|02|03|04|05|06|08"];
|
||||
menu[3] = ["Liquidaci\u00F3n Actos Tarisan", pathLOCAL + "jsp/med/liquidacion.jsp?x=3", "01|03|04|05|06|07"];
|
||||
menu[4] = ["Liquidaci\u00F3n Actos Tarisan", pathLOCAL + "jsp/med/liquidacion_analista.jsp?x=4&pagina=1", "02"];
|
||||
menu[5] = ["Liquidaci\u00F3n Actos Tarisan", pathLOCAL + "jsp/med/liquidacion_radiologo.jsp?x=5&pagina=1", "08"];
|
||||
menu[6] = ["Detalle Pacientes", pathLOCAL + "jsp/med/detallePacientes.jsp?x=6&pagina=1", "01|02|03|04|05|06|07|08"];
|
||||
menu[7] = ["I.R.P.F.", pathLOCAL + "jsp/med/detalleIRPF.jsp?x=7&pagina=1", "01|02|03|04|05|06|08"];
|
||||
menu[8] = ["Medicamentos", pathLOCAL + "jsp/med/medicamentos.jsp?x=8&pagina=1", "01|03"];
|
||||
menu[9] = ["Prescripciones", pathLOCAL + "jsp/med/prescripciones.jsp?x=9&pagina=1", "01|03"];
|
||||
menu[10] = ["An\u00E1lisis", pathLOCAL + "jsp/med/analisis.jsp?x=10&pagina=1", "01|03"];
|
||||
menu[11] = ["Anatomia patol\u00F3gica", pathLOCAL + "jsp/med/ap.jsp?x=11&pagina=1", "01|03"];
|
||||
menu[12] = ["Igualados", pathLOCAL + "jsp/med/igualados.jsp?x=12&pagina=1", "01"];
|
||||
menu[13] = ["Gesti\u00F3n Perfiles", pathLOCAL + "jsp/med/gestor_perfiles.jsp?x=13&pagina=1", "01|03"];
|
||||
menu[14] = ["Hist\u00F3rico liquidaciones", pathLOCAL + "jsp/med/historico_liquidacion.jsp?x=14", "01|02|03|04|05|06|07|08"];
|
||||
menu[15] = ["Volantes Ingreso o CMA", pathLOCAL + "jsp/med/historico_volantes.jsp?x=15", "00"];
|
||||
menu[16] = ["Prescripciones ATS", pathLOCAL + "jsp/med/historico_ats.jsp?x=16", "01|03|06"];
|
||||
//menu[15] = ["Detalle An\u00E1lisis Capturados", pathLOCAL + "jsp/med/detalle_analista.jsp?x=15", "02"];
|
||||
menu[17] = ["Imprimir An\u00E1lisis Capturados", pathLOCAL + "jsp/med/peticiones_capturadas.jsp?x=17&pagina=1", "02|08"];
|
||||
menu[18] = ["Determinaciones Anal\u00edticas", pathLOCAL + "jsp/med/determinaciones.jsp?x=18&pagina=1", "01|02|03|04|05|06|07"];
|
||||
menu[19] = ["Noticias", pathLOCAL + "jsp/med/noticias.jsp?x=19&pagina=1", "01|02|03|04|05|06|07|08"];
|
||||
menu[20] = ["Incidencia", pathLOCAL + "jsp/med/incidencia.jsp?x=20&limpiarAdjuntos=1", "01|02|03|04|05|06|07|08"];
|
||||
|
||||
|
||||
|
||||
//precargamos las imagenes
|
||||
//if (document.images) {
|
||||
//bullets del menu de la izq
|
||||
var bulletAbierto = new Image(); bulletAbierto.src = pathLOCAL+"img/gen_bullet_abierto.gif";
|
||||
var bulletActivo = new Image(); bulletActivo.src = pathLOCAL+"img/gen_bullet_activo.gif";
|
||||
var bulletCerrado = new Image(); bulletCerrado.src = pathLOCAL+"img/gen_bullet_cerrado.gif";
|
||||
var bulletSelect = new Image(); bulletSelect.src = pathLOCAL+"img/gen_bullet_select.gif";
|
||||
var pbullet = new Image(); pbullet.src = pathLOCAL+"img/gen_bullet_cerrado.gif";
|
||||
//}
|
||||
|
||||
var stContenedor = (document.layers)?"contenedorMenu.document.":"";
|
||||
var esCargado = false;
|
||||
var ponImgs = false;
|
||||
var iContador = 0;
|
||||
|
||||
window.onload = Cargado;
|
||||
|
||||
function Cargado(){
|
||||
esCargado = true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// pNG --> perfilNavegacionGestion puede ser | 01 | 02 | 03 |
|
||||
|
||||
|
||||
//Función que determina si se escribe una opción de menú
|
||||
//strAcceso debe contener las opciones de acceso de la opción
|
||||
//a escribir (el tercer parámetro cuando se declaran las opciones).
|
||||
//**** IR CONSTRUYENDO EL IF PARA LUEGO HACER UN EVAL ****
|
||||
//EJ: Si strAcceso fuese |05|01&T2|
|
||||
//El resultado seráa un eval de la cadena:
|
||||
//((pNG.indexOf("05")) || ((pNG.indexOf("01")) && (pNG.indexOf("T2")))
|
||||
|
||||
function tiene(churroOpciones,condicion){
|
||||
if (churroOpciones.indexOf("|"+condicion+"|")>=0)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
function notiene(churroOpciones,condicion){
|
||||
condicion=condicion.substring(1, condicion.length);
|
||||
if (churroOpciones.indexOf("|"+condicion+"|")<0)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
function escribirOpcionMenu(strAcceso){
|
||||
var resultado = true;
|
||||
var strCadenaBooleana = "";
|
||||
//Troceamos el churro de accesos
|
||||
var strVectorAcceso = strAcceso.split("|");
|
||||
|
||||
for (var i=0; i<strVectorAcceso.length; i++)
|
||||
{
|
||||
var strOpcion = strVectorAcceso[i];
|
||||
|
||||
if (i!=0)
|
||||
strCadenaBooleana = strCadenaBooleana + " || ";
|
||||
|
||||
if (strOpcion.indexOf("&") > -1)
|
||||
{
|
||||
var strSubVectorAcceso2 = strOpcion.split("&");
|
||||
var booPrimeraEntradaY = true;
|
||||
|
||||
strCadenaBooleana = strCadenaBooleana + " (";
|
||||
for (var j=0;j<strSubVectorAcceso2.length;j++)
|
||||
{
|
||||
strOpcion = strSubVectorAcceso2[j];
|
||||
if (j!=0)
|
||||
strCadenaBooleana = strCadenaBooleana + " && ";
|
||||
|
||||
if (strOpcion.substring(0, 1) == "!")
|
||||
strCadenaBooleana = strCadenaBooleana + "no";
|
||||
|
||||
strCadenaBooleana = strCadenaBooleana + "tiene(pNG,'"+ strOpcion + "')";
|
||||
}
|
||||
strCadenaBooleana = strCadenaBooleana + ") ";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (strOpcion.substring(0, 1) == "!")
|
||||
strCadenaBooleana = strCadenaBooleana + "no";
|
||||
|
||||
strCadenaBooleana = strCadenaBooleana + "tiene(pNG,'"+ strOpcion + "')";
|
||||
}
|
||||
}
|
||||
|
||||
if (strCadenaBooleana.length > 0)
|
||||
resultado = eval(strCadenaBooleana);
|
||||
else
|
||||
resultado = false;
|
||||
|
||||
return resultado;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function construirMenuGst(){
|
||||
var separador = '<tr valign="top"><td colspan="2"><img src="' + './img/sp.gif" width="1" height="8" border="0"></td></tr>';
|
||||
var stOpcion = '<table cellpadding="0" cellspacing="0" border="0" width="165">\n';
|
||||
for (i=0 ; i<menu.length; i++){
|
||||
if ( escribirOpcionMenu(menu[i][2]) ){
|
||||
if (i==x){
|
||||
if (menu[i][1].indexOf("x=")>-1)
|
||||
parametros = "";
|
||||
else
|
||||
parametros = "?x="+i;
|
||||
|
||||
stOpcion += '<tr valign="top">';
|
||||
stOpcion += ' <td width="16" class="menuOnSelect"><img src="' + './img/sp.gif" name="bullet' + i + '" width="16" height="12" border="0"></td>\n';
|
||||
|
||||
if(menu[i][1]==location.pathname){
|
||||
|
||||
stOpcion += ' <td width="150" class="menuOnSelect"><a href="javascript:reescribirMenuGst('+i+');" class="menuOnSelect" onMouseOver="self.status=\''+ menu[i][0].toUpperCase() +'\';return true;" onMouseOut="self.status=\'\';return true;"><b>' + menu[i][0].toUpperCase() + '</b></a><br>\n';
|
||||
}else
|
||||
stOpcion += ' <td width="150" class="menuOnSelect"><a href=' + menu[i][1] +' class="menuOnSelect" onMouseOver="self.status=\''+ menu[i][0].toUpperCase() +'\';return true;" onMouseOut="self.status=\'\';return true;"><b>' + menu[i][0].toUpperCase() + '</b></a><br>\n';
|
||||
|
||||
|
||||
|
||||
stOpcion += "</td></tr>" + separador;
|
||||
|
||||
}
|
||||
else {
|
||||
if (menu[i][1].indexOf("x=")>-1)
|
||||
parametros = "";
|
||||
else
|
||||
parametros = "?x="+i;
|
||||
|
||||
stOpcion += '<tr valign="top">';
|
||||
stOpcion += ' <td width="16" class="menuBack"><img src="' + './img/sp.gif" name="bullet' + i +'" width="16" height="12" border="0"></td>\n';
|
||||
|
||||
if(menu[i][1]==location.pathname)
|
||||
stOpcion += " <td width='150' class='menuBack'><a href=\"javascript:reescribirMenuGst("+i+");\" onMouseOver=\"cambiar('bullet" + i +"','bulletActivo');self.status='"+menu[i][0].toUpperCase()+"'; return true;\" onMouseOut=\"cambiar('bullet" + i +"','bulletCerrado');self.status=''; return true;\" class=\"menuOff\"><b>" + menu[i][0].toUpperCase() + "</b></a>";
|
||||
else
|
||||
stOpcion += " <td width='150' class='menuBack'><a href=" + menu[i][1] +" onMouseOver=\"cambiar('bullet" + i +"','bulletActivo');self.status='"+menu[i][0].toUpperCase()+"'; return true;\" onMouseOut=\"cambiar('bullet" + i +"','bulletCerrado');self.status=''; return true;\" class=\"menuOff\"><b>" + menu[i][0].toUpperCase() + "</b></a>";
|
||||
|
||||
stOpcion += "</td></tr>" + separador;
|
||||
}
|
||||
}
|
||||
}
|
||||
stOpcion += "</table>";
|
||||
return stOpcion;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function escribirMenuGst(){
|
||||
var stCapaMenu = (document.layers)?'<div id="contenedorMenu" style="position:relative;top:0px;left:0px;">\n\n':'<div id="contenedorMenu">\n\n';
|
||||
stCapaMenu += (document.layers)?'<img src="/img/gen_bullet_cerrado.gif" width="165" height="1">':construirMenuGst();
|
||||
stCapaMenu += '</div>';
|
||||
document.write(stCapaMenu);
|
||||
//hacemos un retardo si navega con un ie 4.x
|
||||
if (document.all && navigator.appVersion.indexOf("MSIE 4.")>=0 )
|
||||
setTimeout('reescribirMenuGst(x,y)',5800);
|
||||
else
|
||||
reescribirMenuGst(x,y);
|
||||
|
||||
}
|
||||
|
||||
|
||||
function reescribirMenuGst(k,j){
|
||||
x = k;
|
||||
if((j<0) ||(j==null))
|
||||
y = null;
|
||||
else
|
||||
y = j;
|
||||
var stMenuDesplegado = "";
|
||||
if (document.layers) {
|
||||
if(document.contenedorMenu){
|
||||
stMenuDesplegado = construirMenuGst();
|
||||
document.layers["contenedorMenu"].document.open();
|
||||
stHTML = '<layer top="0" left="0">'+stMenuDesplegado+'</layer>';
|
||||
if(esCargado){
|
||||
document.layers["contenedorMenu"].document.write(stHTML);
|
||||
ponImgs = true;
|
||||
}
|
||||
document.layers["contenedorMenu"].document.close();
|
||||
|
||||
if(!esCargado){
|
||||
iContador +=1;
|
||||
if(iContador > 10)
|
||||
esCargado = true;
|
||||
setTimeout('reescribirMenuGst(x,y)',800);
|
||||
}
|
||||
}
|
||||
else
|
||||
setTimeout('reescribirMenuGst(x,y)',800);
|
||||
}
|
||||
else if (document.all) {
|
||||
stMenuDesplegado = construirMenuGst();
|
||||
document.all["contenedorMenu"].innerHTML = stMenuDesplegado;
|
||||
ponImgs = true;
|
||||
}
|
||||
else if (document.getElementById) {
|
||||
stMenuDesplegado = construirMenuGst();
|
||||
document.getElementById("contenedorMenu").innerHTML = stMenuDesplegado;
|
||||
ponImgs = true;
|
||||
}
|
||||
if(ponImgs){
|
||||
|
||||
|
||||
for (i=0 ; i<menu.length; i++){
|
||||
if ( escribirOpcionMenu(menu[i][2]) ){
|
||||
if(i==x){
|
||||
if (y<0 || y==null)
|
||||
cambiar("bullet" + i,"bulletSelect");
|
||||
else
|
||||
cambiar("bullet" + i,"bulletAbierto");
|
||||
|
||||
/*if (!(subMenu[x]==null))
|
||||
{
|
||||
for (j=0 ; j<subMenu[x].length; j++)
|
||||
{
|
||||
if (escribirOpcionMenu(subMenu[x][j][2]))
|
||||
{
|
||||
if (j==y)
|
||||
{
|
||||
cambiar("pbullet" + i +j,"pbullet");
|
||||
cambiar("sbullet" + i +j,"bulletSelect");
|
||||
}
|
||||
else{
|
||||
cambiar("pbullet" + i +j,"pbullet");
|
||||
cambiar("sbullet" + i +j,"bulletCerrado");
|
||||
}
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
else
|
||||
cambiar("bullet" + i,"bulletCerrado");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user