añado jsp
This commit is contained in:
@@ -0,0 +1,442 @@
|
||||
<%@ 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="com.tarisan.persistencia.PersistenciaParametros" %>
|
||||
<%@ page import="java.sql.*" %>
|
||||
<%@ page import="java.util.Vector" %>
|
||||
<%@ page import="java.io.*" %>
|
||||
|
||||
<%
|
||||
// LogTarisan.logger.log(NivelLog.INFO, ((Usuario)sesion.getAttribute("USUARIO")).getMedico() + "Inicio p墔ina de determinaciones anal癃icas (med/determinaciones.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鏮 invalidada");
|
||||
response.sendRedirect("../../html/login.html");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
LogTarisan.logger.log(NivelLog.INFO, ((Usuario)sesion.getAttribute("USUARIO")).getMedico() + "Inicio p墔ina de incicdencias (med/incidencia.jsp)");
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
// Definicion de variables
|
||||
String strParametroMenu="";
|
||||
String strMensaje="";
|
||||
String strCorreo = "";
|
||||
String mensajeError= "";
|
||||
String strAdjunto = "";
|
||||
String strAdjuntos = "";
|
||||
String strAsuntoCorreo = "";
|
||||
String strMensajeCorreo = "";
|
||||
String strTarjetaCorreo = "";
|
||||
String strError = "";
|
||||
Integer intLimpiarAdjuntos = 0;
|
||||
|
||||
//Obtenci鏮 del perfil del usuario conectado
|
||||
StringBuffer perfil = new StringBuffer();
|
||||
perfil.append("|");
|
||||
perfil.append(sesion.getAttribute("PERFIL"));
|
||||
perfil.append("|");
|
||||
|
||||
//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 descripcion para las busquedas
|
||||
if (request.getParameter("msg")!=null)
|
||||
strMensaje = (String)request.getParameter("msg");
|
||||
|
||||
//parametro adjunto con el nombre del archivo adjuntado
|
||||
if (request.getParameter("adjunto")!=null)
|
||||
strAdjunto = (String)request.getParameter("adjunto");
|
||||
|
||||
//parametro asunto del correo a enviar
|
||||
if (request.getParameter("asunto")!=null)
|
||||
strAsuntoCorreo = (String)request.getParameter("asunto");
|
||||
|
||||
//parametro mensaje del correo a enviar
|
||||
if (request.getParameter("mensaje")!=null)
|
||||
strMensajeCorreo = (String)request.getParameter("mensaje");
|
||||
|
||||
//parametro tarjeta del correo a enviar
|
||||
if (request.getParameter("tarjeta")!=null)
|
||||
strTarjetaCorreo = (String)request.getParameter("tarjeta");
|
||||
|
||||
//parametro limpiar adjuntos que se hace la primera vez que se entra
|
||||
if (request.getParameter("limpiarAdjuntos")!=null)
|
||||
intLimpiarAdjuntos = Integer.parseInt(request.getParameter("limpiarAdjuntos"));
|
||||
|
||||
//parametro error de la subida del adjunto
|
||||
if (request.getParameter("err")!=null)
|
||||
strError = (String)request.getParameter("err");
|
||||
|
||||
//Si el m嶮ico no tiene el correo guardado en la cabecera, redirijimos a cabecera.jsp para que lo meta
|
||||
Integer noTieneEmail = 0;
|
||||
Tamedico tamedico = new Tamedico();
|
||||
PersistenciaTamedico pertamedico = new PersistenciaTamedico();
|
||||
int intMedico=((Usuario)sesion.getAttribute("USUARIO")).getMedico();
|
||||
tamedico = pertamedico.seleccionar(intMedico);
|
||||
if (tamedico.getEmailCab()==null){
|
||||
noTieneEmail = 1;
|
||||
mensajeError = "Para crear una incidencia debe tener registrado su correo electr鏮ico:";
|
||||
}else{
|
||||
strCorreo = tamedico.getEmailCab();
|
||||
if (!Utilidades.validarEmail(strCorreo)){
|
||||
noTieneEmail = 1;
|
||||
mensajeError = "Debe utilizar una direcci鏮 de correo v嫮ida.";
|
||||
}
|
||||
}
|
||||
|
||||
File dir = new File(ParametrosConfiguracion.ruta_adjuntos+"/");
|
||||
Vector<String> archivos = Utilidades.buscar_ficheros_recursivo(dir);
|
||||
|
||||
if (intLimpiarAdjuntos==1){
|
||||
if (archivos != null) {
|
||||
for (int f=0; f < archivos.size() ; f++) {
|
||||
String path = archivos.elementAt(f);
|
||||
LogTarisan.logger.log(NivelLog.DEBUG, "Eliminamos todos los adjuntos. Ruta de adjunto "+f+": " + path);
|
||||
File adjunto = new File(path);
|
||||
if(adjunto.exists())
|
||||
{
|
||||
adjunto.delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if (archivos != null) {
|
||||
for (int f=0; f < archivos.size() ; f++) {
|
||||
String path = archivos.elementAt(f);
|
||||
String[] partes = path.split("/");
|
||||
String filename = partes[6];
|
||||
strAdjuntos += partes[6] + "--";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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/>", " ");
|
||||
}
|
||||
}
|
||||
%>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>Incidencias</title>
|
||||
<link rel="shortcut icon" href="../../img/logo.ico" />
|
||||
<link rel="STYLESHEET" type="text/css" href="../../css/estilos.css">
|
||||
<link rel="STYLESHEET" type="text/css" href="../../css/jquery.modal.css">
|
||||
|
||||
<script language="JavaScript" src="../../js/funciones.js"></script>
|
||||
<script language="JavaScript" src="../../js/jquery-1.11.3.js"></script>
|
||||
<script language="JavaScript" src="../../js/inicio_tarisan.js"></script>
|
||||
<script language="JavaScript" src="../../js/menu_med.js"></script>
|
||||
<script language="JavaScript" src="../../js/bloques_tarisan.js"></script>
|
||||
<script language="JavaScript" src="../../js/jquery.modal.min.js"></script>
|
||||
<script language="JavaScript">pNG="<%= perfil.toString() %>"</script>
|
||||
<script language="JavaScript" type="text/javascript">
|
||||
<!--
|
||||
function enviar_incidencia()
|
||||
{
|
||||
if (frmIncidencia.ASUNTO.value == ""){
|
||||
modal({type:'error',title:',tenci鏮!',text:'Debe introducir la descripci鏮 de la incidencia',callback: function(result){frmIncidencia.ASUNTO.focus();}});
|
||||
}else if (frmIncidencia.MENSAJE.value == ""){
|
||||
modal({type:'error',title:',tenci鏮!',text:'Debe introducir el detalle de la incidencia',callback: function(result){frmIncidencia.MENSAJE.focus();}});
|
||||
}else{
|
||||
frmIncidencia.submit();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function introducir_email()
|
||||
{
|
||||
frmIntroducirEmail.submit();
|
||||
}
|
||||
|
||||
function pasarAMayusculas(campo)
|
||||
{
|
||||
campo.value=campo.value.toUpperCase();
|
||||
}
|
||||
|
||||
function eliminarAdjunto(adjunto)
|
||||
{
|
||||
document.frmAdjunto.eliminar.value = 1;
|
||||
document.frmAdjunto.adj.value = adjunto;
|
||||
document.frmAdjunto.ASUNTO.value = frmIncidencia.ASUNTO.value;
|
||||
document.frmAdjunto.MENSAJE.value = frmIncidencia.MENSAJE.value;
|
||||
document.frmAdjunto.TARJETA.value = (frmIncidencia.TARJETA.value).replace(/%/g, "()").trim();
|
||||
document.frmAdjunto.submit();
|
||||
}
|
||||
|
||||
function adjuntar()
|
||||
{
|
||||
document.frmAdjunto.ASUNTO.value = frmIncidencia.ASUNTO.value;
|
||||
document.frmAdjunto.MENSAJE.value = frmIncidencia.MENSAJE.value;
|
||||
document.frmAdjunto.TARJETA.value = (frmIncidencia.TARJETA.value).replace(/%/g, "()").trim();
|
||||
/*document.frmAdjunto.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鏮 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墔ina //-->
|
||||
<table cellpadding="0" cellspacing="0" border="0" align="center" style="width:95%">
|
||||
<tr valign="top">
|
||||
<!--<td width="180">//-->
|
||||
<td width="5%">
|
||||
<!-- Men� de navegaci鏮 del m鏚ulo (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>//-->
|
||||
<td width="565">
|
||||
<!-- Tabla con el contenido de la p墔ina (zona central-derecha) //-->
|
||||
<table cellpadding="0" cellspacing="0" border="0" width="100%">
|
||||
<tr>
|
||||
<!--<td><img src="../../img/sp.gif" width="4" height="261" border="0"></td>//-->
|
||||
<td width="1px" bgcolor="#CCCCCC" height="330px"></td>
|
||||
<td class="txt" valign="top">
|
||||
<img src="../../img/sp.gif" width="1" height="11" border="0"><br>
|
||||
<div class="cajaCentral">
|
||||
<div class="tituloCajaCentral">
|
||||
<span>SISTEMA DE INCIDENCIAS DE TARISAN</span>
|
||||
</div>
|
||||
<br>
|
||||
<form name="frmIncidencia" action="../../servlet/GestorMedicos" method="post" autocomplete="off">
|
||||
<input type="hidden" name="OPCION" value="<%=Constantes.OPC_MED_ENVIAR_EMAIL%>">
|
||||
<input type="hidden" name="correo" value="<%=strCorreo%>">
|
||||
<input type="hidden" name="nombreAdjuntos" value="<%=strAdjuntos%>">
|
||||
<table border="0" align="center" width="100%">
|
||||
<!-- <tr>
|
||||
<td> </td>
|
||||
<td align="left"><h5>SISTEMA DE INCIDENCIAS DE TARISAN</h5></td>
|
||||
</tr> -->
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td align="left"><p class="txt">*Para el correcto funcionamiento del sistema de incidencias debe comprobar en la secci鏮 "CABECERA" que tiene una cuenta de correo v嫮ida.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td align="left" class="txtnegrita">Descripci鏮 breve:</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td align="left"><input type="text" size="40" name="ASUNTO" id="asun" class="txt" value="<%=strAsuntoCorreo %>" style="width:40%"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td align="left" class="txtnegrita"><span>Detalle de la Incidencia:</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td align="left">
|
||||
<textarea name="MENSAJE" rows="4" cols="70%" class="txt" style="width:70%"><%=strMensajeCorreo %></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td align="left" class="txtnegrita">Pase la tarjeta para registrarla:</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td align="left"><input type="password" size="40" name="TARJETA" id="tar" class="txt" value="<%=strTarjetaCorreo %>" style="width:70%"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<table border="0" align="center" width="100%">
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td align="left" class="txtnegrita">Adjuntar archivos:</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td>
|
||||
<form name="frmAdjunto" enctype="multipart/form-data" action="../../../JavaBridgeTemplate621/adjuntar.php" method="POST">
|
||||
<input name="uploadedfile" type="file" />
|
||||
<input type="submit" value="Adjuntar" onclick="adjuntar()"/>
|
||||
<input type="hidden" name="medico" value="<%=intMedico %>" />
|
||||
<input type="hidden" name="eliminar" value="" />
|
||||
<input type="hidden" name="adj" value="" />
|
||||
<input type="hidden" name="ASUNTO" value="" />
|
||||
<input type="hidden" name="MENSAJE" value="" />
|
||||
<input type="hidden" name="TARJETA" value="" />
|
||||
<%
|
||||
if (intLimpiarAdjuntos!=1){
|
||||
if (archivos != null) {
|
||||
for (int f=0; f < archivos.size() ; f++) {
|
||||
String path = archivos.elementAt(f);
|
||||
String[] partes = path.split("/");
|
||||
String filename = partes[6];
|
||||
%>
|
||||
<span type="text" name="txtAdjunto" class="txtnegrita" style="color: rgb(69, 69, 255);margin-left: 50px;"><%= filename%></span>
|
||||
<a href="javascript:eliminarAdjunto('<%= filename%>')" class="enlace" title="Eliminar" style="color:rgb(219, 67, 67);font-size: medium;">X</a>
|
||||
<%
|
||||
}
|
||||
}
|
||||
}
|
||||
%>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td colspan="2" align="left"><a href="javascript:enviar_incidencia()" class="enlace">Enviar</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
</tr>
|
||||
<%
|
||||
if (strMensaje.compareTo("")!=0){
|
||||
%>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td align="center"><p class="txtNegrita" style="color:blue"><%= strMensaje %></p></td>
|
||||
</tr>
|
||||
<%
|
||||
}
|
||||
|
||||
if (strError.compareTo("")!=0){
|
||||
%>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td align="center"><p class="txtNegrita" style="color:red"><%= strError %></p></td>
|
||||
</tr>
|
||||
<%
|
||||
}
|
||||
%>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<form name="frmIntroducirEmail" action="../../servlet/GestorMedicos" method="post" autocomplete="off">
|
||||
<input type="hidden" name="OPCION" value="<%=Constantes.OPC_MED_ENVIAR_EMAIL%>">
|
||||
<input type="hidden" name="introducir_email" value="1" />
|
||||
</form>
|
||||
</td>
|
||||
</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);
|
||||
}
|
||||
|
||||
var jsNoTieneEmail = <%=noTieneEmail %>;
|
||||
if (jsNoTieneEmail==1){
|
||||
//prompt("Para crear una incidencia debe tener registrado su correo electr鏮ico:");
|
||||
modal({type:'error',title:',tenci鏮!',text:'<%= mensajeError%>',callback: function(result){introducir_email();}});
|
||||
}
|
||||
</script>
|
||||
<%
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
LogTarisan.logger.log(NivelLog.ERROR, ((Usuario)sesion.getAttribute("USUARIO")).getMedico() + " - Exception: " + ex);
|
||||
sesion.setAttribute("ERROR", "Error en la presentaci鏮 de la p墔ina al usuario.");
|
||||
response.sendRedirect("../error.jsp");
|
||||
}
|
||||
LogTarisan.logger.log(NivelLog.INFO, ((Usuario)sesion.getAttribute("USUARIO")).getMedico() + "Final p墔ina de determinaciones anal癃icas (med/incidencia.jsp)");
|
||||
}
|
||||
%>
|
||||
Reference in New Issue
Block a user