Files
tarisan_gitea/jsp/adm/mto_actos.jsp
T
2025-06-09 13:55:08 +02:00

412 lines
14 KiB
Plaintext

<%@ page import="com.tarisan.control.*" %>
<%@ page import="com.tarisan.data.*" %>
<%@ page import="com.tarisan.excepcion.*" %>
<%@ page import="com.tarisan.log.*" %>
<%@ page import="com.tarisan.util.Utilidades" %>
<%@ page import="java.sql.*" %>
<%@ page import="java.util.Vector" %>
<%
LogTarisan.logger.log(NivelLog.INFO, "Inicio página de mantenimiento de niveles analíticos (adm/mto_actos.jsp)");
response.setHeader("Expires", "0");
response.setHeader("Pragma", "no-cache");
response.setHeader("Cache-Control", "no-cache");
HttpSession sesion = request.getSession(true);
if(sesion.isNew() || (sesion.getAttribute("USUARIO") == null))
{
LogTarisan.logger.log(NivelLog.INFO, "Sesión invalidada");
response.sendRedirect("../../html/login.html");
}
else
{
try
{
//Obtención del perfil del usuario conectado
StringBuffer perfil = new StringBuffer();
perfil.append("|");
perfil.append(sesion.getAttribute("PERFIL"));
perfil.append("|");
// Definicion de variables
String strParametroMenu = "";
String strParametroEspe = "0";
String strDescripcionActo = "";
int intPagina = 0;
//Obtenemos los valores de los parametros que se pasan a la pagina
//En caso de que no se le pasen parametros, quedaram inicializados
//a sus valores por defecto
//parametro x para marcar la opcion del menu en la que se encuentra el usuario
if (request.getParameter("x")!=null)
strParametroMenu=(String)request.getParameter("x");
//Parametro especialidad para saber si el combo tiene seleccionada una especialidad y mostrar los actos de cada especialidad o no
if (request.getParameter("especialidad")!=null)
strParametroEspe=(String)request.getParameter("especialidad");
//parametro pagina para realizar la paginacion
if (request.getParameter("pagina")!=null)
intPagina=Integer.parseInt(request.getParameter("pagina"));
//parametro acto para las busquedas
if (request.getParameter("hiddenActo")!=null)
strDescripcionActo = (String)request.getParameter("hiddenActo");
Tamensaje tamensaje = new Tamensaje();
PersistenciaTamensaje pertamensaje = new PersistenciaTamensaje();
boolean mostrarNoticia = true;
PersistenciaTanoticias perTaNo = new PersistenciaTanoticias();
Vector vSeleccionNot = perTaNo.obtener_noticias_cabecera();
Vector vNoticias = new Vector();
String strNoticia = "";
String noticias ="";
String separador = " ---//--- ";
if(vSeleccionNot.size()==0){
mostrarNoticia = false;
}else{
mostrarNoticia = true;
Tanoticias tanoticia = null;
for(int i = 0; i < vSeleccionNot.size(); i++)
{
tanoticia = (Tanoticias)vSeleccionNot.elementAt(i);
if (i!=0){
strNoticia = strNoticia + separador + tanoticia.getNoticia();
}else{
strNoticia = tanoticia.getNoticia();
}
strNoticia = strNoticia.replaceAll("<br/>", " ");
}
}
//Lo pongo a false para que no salga la noticia
mostrarNoticia = false;
%>
<html>
<head>
<title>Mantenimiento Actos</title>
<link rel="STYLESHEET" type="text/css" href="../../css/estilos.css">
<script language="JavaScript" src="../../js/inicio_tarisan.js"></script>
<script language="JavaScript" src="../../js/menu_adm.js"></script>
<script language="JavaScript" src="../../js/bloques_tarisan.js"></script>
<script language="JavaScript" src="../../js/funciones.js"></script>
<script language="JavaScript" src="../../js/jquery-1.11.3.js"></script>
<script language="JavaScript">pNG="<%= perfil.toString() %>";</script>
<script language="JavaScript" type="text/javascript">
<!--
var modificado = 0;
function pasarAMayusculas(campo)
{
campo.value = campo.value.toUpperCase();
}
function MostrarActos(especialidad){
if (document.getElementById("mto_esp").value != 0){
document.getElementById("hiddenEspecialidad").value = document.getElementById("mto_esp").value;
document.getElementById("hiddenActo").value = "";
document.frmActos.submit();
}
}
function enviar(){
if (modificado == 1){
for (i=0;i<document.getElementById("nElementos").value;i++){
document.getElementById("hiddenNivel"+(i+1)).value = document.getElementById("mto_nivel"+(i+1)).value;
}
document.frmActosNiveles.submit();
alert("Nivel modificado");
} else{
alert("No has modificado ningun valor");
}
}
function paginacion(pagina){
document.getElementById("pagina").value = pagina;
document.getElementById("hiddenEspecialidad").value = document.getElementById("mto_esp").value;
document.frmActos.submit();
}
function buscar()
{
document.getElementById("pagina").value = 1;
pasarAMayusculas(document.getElementById("acto"));
document.getElementById("hiddenActo").value = document.getElementById("acto").value;
document.frmActos.submit();
}
-->
</script>
</head>
<body marginwidth="0" marginheight="0" leftmargin="0" topmargin="0" alink="#43881A" bgcolor="#FFFFFF">
<div class="marco">
<table cellpadding="0" cellspacing="0" border="0" align="center" style="width:95%">
<tr>
<td class="tdLogoCabecera"><img src="<%=request.getContextPath()%>/img/logo.png" class="logoCabecera"></td>
<td>
<table width="100%">
<tr><td class="tituloTablaMedico" align="center"><%= sesion.getAttribute("USUARIO") %></td></tr>
<tr>
<td>
<div id="contenedorNoticia">
<br>
<div class="tituloNoticia">
<p class="marquee"><%=strNoticia %></p>
</div>
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
<!-- Cabecera de Navegación superior //-->
<table cellpadding="0" cellspacing="0" border="0" align="center" style="width:95%">
<tr>
<td><script language="JavaScript">bloques();</script></td>
</tr>
</table>
<br>
<!-- Cuerpo de la página //-->
<table cellpadding="0" cellspacing="0" border="0" align="center" style="width:95%">
<tr valign="top">
<!--<td width="180">//-->
<td width="5%">
<!-- Menú de navegación del módulo de navegación (zona izquierda) //-->
<table cellpadding="0" cellspacing="0" border="0">
<tr valign="top">
<td colspan="2"><img src="../../img/sp.gif" width="180" height="12" border="0"></td>
</tr>
<tr valign="top">
<td><script language="JavaScript">escribirMenuGst();</script></td>
</tr>
</table>
</td>
<!--<td bgcolor="#CCCCCC"><img src="../../img/sp.gif" width="1" height="12" border="0"></td>//-->
<!-- Zona central //-->
<td width="565">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td width="1px" bgcolor="#CCCCCC" height="190px"></td>
<td>
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td colspan="3">
<table border="0" align="center">
<tr>
<td align="right"><span class="txtnegrita">Especialidad: </span></td>
<% PersistenciaTanivelEspecialidadTanivelActo per = new PersistenciaTanivelEspecialidadTanivelActo();
Vector vSeleccion = per.obtenerEspecialidades();
if (vSeleccion.size() == 0) //No se han encontrado datos
{
%>
<!-- No hay registros -->
<tr>
<td colspan="3">&nbsp;</td>
</tr>
<tr>
<td colspan="3" align="center"><span class="txt"><% tamensaje = pertamensaje.obtenerMensaje(10); %><%=tamensaje.getMensaje() %></span></td>
</tr>
<!-- No hay registros -->
<%
}else{
%>
<td><select id="mto_esp" name="especialidades" onchange="MostrarActos()">
<option value=0>-- Seleccionar --</option>
<%
TanivelEspecialidad TanivEsp = null;
for(int i = 0; i < vSeleccion.size(); i++)
{
TanivEsp = (TanivelEspecialidad)vSeleccion.elementAt(i);
String descripcion = "";
descripcion = per.ObtenerDescripcion(TanivEsp.getEspecialidad());
%>
<option value="<%=TanivEsp.getEspecialidad()%>" <%=(strParametroEspe.compareTo(String.valueOf(TanivEsp.getEspecialidad()))==0)?"selected=selected":"" %>><%=descripcion %></option>
<%
}
%>
</select></td>
<% }
%>
</tr>
</table>
</td>
</tr>
<tr><td colspan="3">&nbsp;</td></tr>
<tr>
<% if (Integer.parseInt(strParametroEspe)!=0){
Vector vTanivAct = new Vector();
vTanivAct = per.ObtenerActos(Integer.parseInt(strParametroEspe),intPagina,strDescripcionActo);
if (vTanivAct.size() == 0) //No se han encontrado datos
{
%>
<!-- No hay registros -->
<table>
<tr>
<td colspan="3">&nbsp;</td>
</tr>
<tr>
<td colspan="3" align="center"><span class="txt"><% tamensaje = pertamensaje.obtenerMensaje(10); %><%=tamensaje.getMensaje() %></span></td>
</tr>
</table>
<!-- No hay registros -->
<%
}else{
if (intPagina != 0){ //se tiene en cuenta la paginacion
%>
<!-- Hay registros -->
<tr>
<td colspan="3">
<table border="0" align="center">
<tr>
<td><span class="txtnegrita">Descripcion Acto: </span></td>
<td><input type="text" size="50" name="acto" id="acto" class="txt" value="<%=strDescripcionActo%>"></td>
<td>&nbsp;</td>
<td><a href="javascript:buscar()" class="enlace"><%=pertamensaje.obtenerMensaje(24).getMensaje() %></a></td>
</tr>
</table>
</td>
</tr>
<table cellpadding="0" border="0" width="90%" align="center">
<tr>
<td colspan="3" align="right"><span class="txt">Página <%=per.getPaginacion().getNumeroPagina()%> de <%=per.getPaginacion().getNumeroPaginasTotales()%></span></td>
</tr>
<%
}
%>
<tr><form name="frmActosNiveles" action="../../servlet/GestorAdministracion" method="post">
<td class="cabeceraTabla" align="center" bgcolor="#FFAAAA">Codigo</td>
<td class="cabeceraTabla" align="center" bgcolor="#FFAAAA">Acto</td>
<td class="cabeceraTabla" align="center" bgcolor="#FFAAAA">Nivel</td>
</tr>
<%
TanivelActo TanivAct = null;
String estilo = "";
for(int i = 0; i < vTanivAct.size(); i++){
TanivAct = (TanivelActo)vTanivAct.elementAt(i);
String descripcionActo = "";
descripcionActo = per.ObtenerDescripcionActo(TanivAct.getActo(),Integer.parseInt(strParametroEspe));
if (i % 2 == 0)
{
estilo = "filaA";
}
else
{
estilo = "filaB";
}
%>
<tr>
<td class="<%=estilo%>" align="center"><span class="txtnegrita"><%=TanivAct.getActo()%> </span></td>
<td class="<%=estilo%>" align="center"><span class="txtnegrita"><%=descripcionActo%> </span></td>
<td class="<%=estilo%>" align="center"><select id="mto_nivel<%=(i+1) %>" name="mto_visibilidad" onchange="modificado=1">
<option value=1 <%=(1==TanivAct.getNivel())?"selected=selected":"" %>>1</option>
<option value=2 <%=(2==TanivAct.getNivel())?"selected=selected":"" %>>2</option>
<option value=3 <%=(3==TanivAct.getNivel())?"selected=selected":"" %>>3</option>
</td>
<td><input type="hidden" name="hiddenActo<%=(i+1) %>" id="hiddenActo<%=(i+1) %>" value="<%=TanivAct.getActo()%>"></td>
<td><input type="hidden" name="hiddenNivel<%=(i+1)%>" id="hiddenNivel<%=(i+1)%>" value=""></td>
<td><input type="hidden" name="nElementos" id="nElementos" value="<%=vTanivAct.size()%>"></td>
</tr>
<%
}
if (intPagina!=0){ //se tiene en cuenta la paginacion %>
<tr><td colspan="3"></td></tr>
<tr>
<td colspan="3">
<table border="0" align="center">
<tr>
<%if (per.getPaginacion().esPrimeraPagina()){%>
<td width="70" align="right"><span class="pagDesactivo">primero</span></td>
<td></td>
<td width="70" align="left"><span class="pagDesactivo">anterior</span></td>
<%}else{%>
<td width="70" align="right"><a href="javascript:paginacion(1)" class="enlace">primero</a></td>
<td></td>
<td width="70" align="left"><a href="javascript:paginacion(<%=per.getPaginacion().getNumeroPagina() - 1%>)" class="enlace">anterior</a></td>
<%}%>
<%if (per.getPaginacion().esUltimaPagina()){%>
<td width="70" align="right"><span class="pagDesactivo">siguiente</span></td>
<td></td>
<td width="70" align="left"><span class="pagDesactivo">último</span></td>
<%}else{%>
<td width="70" align="right"><a href="javascript:paginacion(<%=per.getPaginacion().getNumeroPagina() + 1%>)" class="enlace">siguiente</a></td>
<td></td>
<td width="70" align="left"><a href="javascript:paginacion(<%=per.getPaginacion().getNumeroPaginasTotales()%>)" class="enlace">último</a></td>
<%}%>
</tr>
</table>
</td>
</tr>
<%
} //fin if(pagina!=0)
%>
<input type="hidden" name="hiddenEspe" value="<%=strParametroEspe%>">
<tr>
<td><input type="hidden" name="OPCION" value="<%=Constantes.OPC_ADM_GES_ACT_NIVEL_ACTO%>"></td>
<td colspan="2" align="right"><a href="javascript:enviar()" class="enlace">Aceptar</a></td>
</tr>
</form>
</td>
</tr>
</table>
<%
}
}
%>
<form name="frmActos" action="../../servlet/GestorAdministracion" method="post">
<input type="hidden" name="pagina" id="pagina" value="1">
<input type="hidden" id="hiddenEspecialidad" name="hiddenEspecialidad" value="<%=Integer.parseInt(strParametroEspe)%>">
<input type="hidden" id="hiddenActo" name="hiddenActo" value="<%=strDescripcionActo%>">
<input type="hidden" name="OPCION" value="<%=Constantes.OPC_ADM_GES_NIVELES_ACT%>">
</form>
</table>
</tr>
</table>
</td>
</tr>
</table>
</div>
</body>
</html>
<script>
var jsMostrarNoticia = <%=mostrarNoticia %>;
if (!jsMostrarNoticia){
document.getElementById('contenedorNoticia').style.display="none";
}else{
<% strNoticia = strNoticia.replaceAll("\"", "'"); %>
var not = "<%=strNoticia %>";
tamanioNoticia(not);
marquee($('.tituloNoticia'), $('.marquee'),not);
}
</script>
<%
}
catch(Exception ex)
{
LogTarisan.logger.log(NivelLog.ERROR, "Exception: " + ex);
sesion.setAttribute("ERROR", "Error en la presentación de la página al usuario.");
response.sendRedirect("../error.jsp");
}
}
LogTarisan.logger.log(NivelLog.INFO, "Final página de mantenimiento de niveles analíticos (adm/mto_actos.jsp)");
%>