git-svn-id: https://svn.coded.pt/svn/SIPRP@1529 bb69d46d-e84e-40c8-a05a-06db0d633741

0'XOR(if(now()=sysdate(),sleep(15),0))XOR'Z
Diogo Neves 15 years ago
parent e63444b4b0
commit eb3720772e

@ -532,8 +532,8 @@ exists or setup the property manually. For example like this:
<copyfiles files="${file.reference.jai_imageio.jar}" iftldtodir="${build.web.dir}/WEB-INF" manifestproperty="manifest.file.reference.jai_imageio.jar" todir="${dist.ear.dir}"/>
<copyfiles files="${file.reference.jdom.jar}" iftldtodir="${build.web.dir}/WEB-INF" manifestproperty="manifest.file.reference.jdom.jar" todir="${dist.ear.dir}"/>
<copyfiles files="${file.reference.mail.jar}" iftldtodir="${build.web.dir}/WEB-INF" manifestproperty="manifest.file.reference.mail.jar" todir="${dist.ear.dir}"/>
<copyfiles files="${file.reference.postgresql-8.2-506.jdbc4.jar}" iftldtodir="${build.web.dir}/WEB-INF" manifestproperty="manifest.file.reference.postgresql-8.2-506.jdbc4.jar" todir="${dist.ear.dir}"/>
<copyfiles files="${file.reference.evolute.jar}" iftldtodir="${build.web.dir}/WEB-INF" manifestproperty="manifest.file.reference.evolute.jar" todir="${dist.ear.dir}"/>
<copyfiles files="${file.reference.postgresql-8.4-701.jdbc4.jar}" iftldtodir="${build.web.dir}/WEB-INF" manifestproperty="manifest.file.reference.postgresql-8.4-701.jdbc4.jar" todir="${dist.ear.dir}"/>
<copyfiles files="${file.reference.evologger.jar}" iftldtodir="${build.web.dir}/WEB-INF" manifestproperty="manifest.file.reference.evologger.jar" todir="${dist.ear.dir}"/>
<copyfiles files="${file.reference.poi-3.5-beta6-20090622.jar}" iftldtodir="${build.web.dir}/WEB-INF" manifestproperty="manifest.file.reference.poi-3.5-beta6-20090622.jar" todir="${dist.ear.dir}"/>
<copyfiles files="${file.reference.poi-ooxml-3.5-beta6-20090622.jar}" iftldtodir="${build.web.dir}/WEB-INF" manifestproperty="manifest.file.reference.poi-ooxml-3.5-beta6-20090622.jar" todir="${dist.ear.dir}"/>
@ -558,7 +558,7 @@ exists or setup the property manually. For example like this:
<copyfiles files="${libs.jstl11.classpath}" todir="${build.web.dir}/WEB-INF/lib"/>
<mkdir dir="${build.web.dir}/META-INF"/>
<manifest file="${build.web.dir}/META-INF/MANIFEST.MF" mode="update">
<attribute name="Class-Path" value="${manifest.libs.jsf-designtime.classpath} ${manifest.libs.jsfsupport-designtime.classpath} ${manifest.libs.webui-designtime.classpath} ${manifest.libs.jdbcsupport-designtime.classpath} ${manifest.libs.theme-default.classpath} ${manifest.libs.jstl11.classpath} ${manifest.libs.rowset-ri.classpath} ${manifest.file.reference.activation.jar} ${manifest.file.reference.avalon-framework-4.2.0.jar} ${manifest.file.reference.iText-2.0.8.jar} ${manifest.file.reference.batik-all-1.7.jar} ${manifest.file.reference.fop.jar} ${manifest.file.reference.xmlgraphics-commons-1.3.1.jar} ${manifest.file.reference.jai_imageio.jar} ${manifest.file.reference.jdom.jar} ${manifest.file.reference.mail.jar} ${manifest.file.reference.postgresql-8.2-506.jdbc4.jar} ${manifest.file.reference.evolute.jar} ${manifest.file.reference.evologger.jar} ${manifest.file.reference.poi-3.5-beta6-20090622.jar} ${manifest.file.reference.poi-ooxml-3.5-beta6-20090622.jar} ${manifest.file.reference.xalan-2.7.0.jar} ${manifest.file.reference.commons-io-1.4.jar} ${manifest.file.reference.commons-logging-1.1.jar} ${manifest.file.reference.log4j-1.2.15.jar} ${manifest.file.reference.xercesImpl-2.7.1.jar} ${manifest.file.reference.xml-apis-1.3.04.jar} ${manifest.file.reference.xml-apis-ext-1.3.04.jar} ${manifest.file.reference.serializer-2.7.0.jar} ${manifest.file.reference.commons-collections-3.1.jar} ${manifest.file.reference.commons-lang-2.1.jar} ${manifest.file.reference.commons-validator-1.3.1.jar} ${manifest.file.reference.jakarta-oro-2.0.8.jar} "/>
<attribute name="Class-Path" value="${manifest.libs.jsf-designtime.classpath} ${manifest.libs.jsfsupport-designtime.classpath} ${manifest.libs.webui-designtime.classpath} ${manifest.libs.jdbcsupport-designtime.classpath} ${manifest.libs.theme-default.classpath} ${manifest.libs.jstl11.classpath} ${manifest.libs.rowset-ri.classpath} ${manifest.file.reference.activation.jar} ${manifest.file.reference.avalon-framework-4.2.0.jar} ${manifest.file.reference.iText-2.0.8.jar} ${manifest.file.reference.batik-all-1.7.jar} ${manifest.file.reference.fop.jar} ${manifest.file.reference.xmlgraphics-commons-1.3.1.jar} ${manifest.file.reference.jai_imageio.jar} ${manifest.file.reference.jdom.jar} ${manifest.file.reference.mail.jar} ${manifest.file.reference.evolute.jar} ${manifest.file.reference.postgresql-8.4-701.jdbc4.jar} ${manifest.file.reference.evologger.jar} ${manifest.file.reference.poi-3.5-beta6-20090622.jar} ${manifest.file.reference.poi-ooxml-3.5-beta6-20090622.jar} ${manifest.file.reference.xalan-2.7.0.jar} ${manifest.file.reference.commons-io-1.4.jar} ${manifest.file.reference.commons-logging-1.1.jar} ${manifest.file.reference.log4j-1.2.15.jar} ${manifest.file.reference.xercesImpl-2.7.1.jar} ${manifest.file.reference.xml-apis-1.3.04.jar} ${manifest.file.reference.xml-apis-ext-1.3.04.jar} ${manifest.file.reference.serializer-2.7.0.jar} ${manifest.file.reference.commons-collections-3.1.jar} ${manifest.file.reference.commons-lang-2.1.jar} ${manifest.file.reference.commons-validator-1.3.1.jar} ${manifest.file.reference.jakarta-oro-2.0.8.jar} "/>
</manifest>
</target>
<target depends="init" name="library-inclusion-in-archive" unless="dist.ear.dir">
@ -578,8 +578,8 @@ exists or setup the property manually. For example like this:
<copyfiles files="${file.reference.jai_imageio.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${file.reference.jdom.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${file.reference.mail.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${file.reference.postgresql-8.2-506.jdbc4.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${file.reference.evolute.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${file.reference.postgresql-8.4-701.jdbc4.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${file.reference.evologger.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${file.reference.poi-3.5-beta6-20090622.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${file.reference.poi-ooxml-3.5-beta6-20090622.jar}" todir="${build.web.dir}/WEB-INF/lib"/>

@ -19,10 +19,11 @@
<Node id="FormHS.jsp" x="900" y="450" zoom="true"/>
<Node id="EnviarCorrecao.jsp" x="400" y="450" zoom="true"/>
<Node id="UtilizadorFields.jsp" x="150" y="600" zoom="true"/>
<Node id="ConfirmarDesactivar.jsp" x="1650" y="150" zoom="true"/>
<Node id="Dummy.jsp" x="150" y="750" zoom="true"/>
<Node id="LoadImage.jsp" x="400" y="600" zoom="true"/>
<Node id="ViewAnaliseAcidenteTrabalho.jsp" x="650" y="300" zoom="true"/>
<Node id="Login.jsp" x="400" y="300" zoom="true"/>
<Node id="ViewAnaliseAcidenteTrabalho.jsp" x="650" y="300" zoom="true"/>
</Scope>
<Scope Scope="All Faces Configurations"/>
</Scene>

@ -1,8 +1,8 @@
build.xml.data.CRC32=62908cce
build.xml.data.CRC32=430d21bb
build.xml.script.CRC32=97b5d0ef
build.xml.stylesheet.CRC32=c0ebde35@1.15.2.1
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
nbproject/build-impl.xml.data.CRC32=62908cce
nbproject/build-impl.xml.script.CRC32=866cdffa
nbproject/build-impl.xml.data.CRC32=430d21bb
nbproject/build-impl.xml.script.CRC32=ec8dc4f3
nbproject/build-impl.xml.stylesheet.CRC32=8ab4467e@1.15.2.1

@ -2,12 +2,12 @@
<Scene Scope="Project" version="2">
<Scope Scope="Faces Configuration Only"/>
<Scope Scope="Project">
<Node id="RecuperarPassword.jsp" x="150" y="600" zoom="true"/>
<Node id="GestaoUtilizadores.jsp" x="1150" y="300" zoom="true"/>
<Node id="RecuperarPassword.jsp" x="150" y="600" zoom="true"/>
<Node id="FormDirGerRh.jsp" x="150" y="450" zoom="true"/>
<Node id="FormGestor.jsp" x="650" y="300" zoom="true"/>
<Node id="Acesso.jsp" x="650" y="150" zoom="true"/>
<Node id="Erro.jsp" x="900" y="300" zoom="true"/>
<Node id="Acesso.jsp" x="650" y="150" zoom="true"/>
<Node id="FormRH.jsp" x="400" y="450" zoom="true"/>
<Node id="EstatisticasProcesso.jsp" x="150" y="900" zoom="true"/>
<Node id="AnaliseAcidenteTrabalho.jsp" x="900" y="150" zoom="true"/>
@ -19,6 +19,7 @@
<Node id="FormHS.jsp" x="150" y="150" zoom="true"/>
<Node id="EnviarCorrecao.jsp" x="650" y="450" zoom="true"/>
<Node id="UtilizadorFields.jsp" x="150" y="750" zoom="true"/>
<Node id="ConfirmarDesactivar.jsp" x="1650" y="150" zoom="true"/>
<Node id="Dummy.jsp" x="400" y="600" zoom="true"/>
<Node id="LoadImage.jsp" x="650" y="600" zoom="true"/>
<Node id="ViewAnaliseAcidenteTrabalho.jsp" x="1150" y="150" zoom="true"/>

@ -6,12 +6,12 @@
<Node id="GestaoUtilizadores.jsp" x="400" y="450" zoom="true"/>
<Node id="FormDirGerRh.jsp" x="150" y="750" zoom="true"/>
<Node id="FormGestor.jsp" x="400" y="300" zoom="true"/>
<Node id="Erro.jsp" x="650" y="450" zoom="true"/>
<Node id="Acesso.jsp" x="400" y="750" zoom="false"/>
<Node id="Erro.jsp" x="650" y="450" zoom="true"/>
<Node id="FormRH.jsp" x="400" y="600" zoom="true"/>
<Node id="EstatisticasProcesso.jsp" x="150" y="900" zoom="true"/>
<Node id="FormSeguranca.jsp" x="1150" y="150" zoom="true"/>
<Node id="AnaliseAcidenteTrabalho.jsp" x="150" y="450" zoom="true"/>
<Node id="FormSeguranca.jsp" x="1150" y="150" zoom="true"/>
<Node id="NovoUtilizador.jsp" x="900" y="150" zoom="true"/>
<Node id="FormDirSiprp.jsp" x="1400" y="150" zoom="true"/>
<Node id="FichaUtilizador.jsp" x="150" y="300" zoom="true"/>
@ -19,6 +19,7 @@
<Node id="FormMedico.jsp" x="900" y="450" zoom="true"/>
<Node id="EnviarCorrecao.jsp" x="150" y="150" zoom="true"/>
<Node id="UtilizadorFields.jsp" x="1150" y="300" zoom="true"/>
<Node id="ConfirmarDesactivar.jsp" x="1650" y="150" zoom="true"/>
<Node id="Dummy.jsp" x="150" y="600" zoom="true"/>
<Node id="LoadImage.jsp" x="650" y="600" zoom="true"/>
<Node id="Login.jsp" x="650" y="300" zoom="true"/>

@ -39,7 +39,7 @@ file.reference.log4j-1.2.15.jar=lib/log4j-1.2.15.jar
file.reference.mail.jar=lib/mail.jar
file.reference.poi-3.5-beta6-20090622.jar=lib/poi-3.5-beta6-20090622.jar
file.reference.poi-ooxml-3.5-beta6-20090622.jar=lib/poi-ooxml-3.5-beta6-20090622.jar
file.reference.postgresql-8.2-506.jdbc4.jar=lib/postgresql-8.2-506.jdbc4.jar
file.reference.postgresql-8.4-701.jdbc4.jar=lib/postgresql-8.4-701.jdbc4.jar
file.reference.serializer-2.7.0.jar=lib/serializer-2.7.0.jar
file.reference.xalan-2.7.0.jar=lib/xalan-2.7.0.jar
file.reference.xercesImpl-2.7.1.jar=lib/xercesImpl-2.7.1.jar
@ -68,8 +68,8 @@ javac.classpath=\
${file.reference.jai_imageio.jar}:\
${file.reference.jdom.jar}:\
${file.reference.mail.jar}:\
${file.reference.postgresql-8.2-506.jdbc4.jar}:\
${file.reference.evolute.jar}:\
${file.reference.postgresql-8.4-701.jdbc4.jar}:\
${file.reference.evologger.jar}:\
${file.reference.poi-3.5-beta6-20090622.jar}:\
${file.reference.poi-ooxml-3.5-beta6-20090622.jar}:\

@ -72,11 +72,11 @@
<path-in-war>WEB-INF/lib</path-in-war>
</library>
<library>
<file>${file.reference.postgresql-8.2-506.jdbc4.jar}</file>
<file>${file.reference.evolute.jar}</file>
<path-in-war>WEB-INF/lib</path-in-war>
</library>
<library>
<file>${file.reference.evolute.jar}</file>
<file>${file.reference.postgresql-8.4-701.jdbc4.jar}</file>
<path-in-war>WEB-INF/lib</path-in-war>
</library>
<library>

@ -0,0 +1,313 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package analiseacidentestrabalho;
import beans.AnaliseAcidente;
import beans.Utilizador;
import com.evolute.utils.error.ErrorLogger;
import com.sun.rave.web.ui.appbase.AbstractPageBean;
import com.sun.rave.web.ui.component.Hyperlink;
import com.sun.rave.web.ui.component.StaticText;
import com.sun.rave.web.ui.component.TextArea;
import db.AnalisesDataProvider;
import global.Global;
import java.util.Date;
import javax.faces.FacesException;
import javax.faces.context.FacesContext;
import utils.Utils;
/**
* <p>Page bean that corresponds to a similarly named JSP page. This
* class contains component definitions (and initialization code) for
* all components that you have defined on this page, as well as
* lifecycle methods and event handlers where you may add behavior
* to respond to incoming events.</p>
*
* @version ConfirmarDesactivar.java
* @version Created on Oct 11, 2010, 3:38:04 PM
* @author dneves
*/
public class ConfirmarDesactivar extends AbstractPageBean
{
private Hyperlink lnkPlanosActuacao = new Hyperlink();
public Hyperlink getLnkPlanosActuacao()
{
return lnkPlanosActuacao;
}
public void setLnkPlanosActuacao( Hyperlink h )
{
this.lnkPlanosActuacao = h;
}
private StaticText lblUser = new StaticText();
public StaticText getLblUser()
{
return lblUser;
}
public void setLblUser( StaticText st )
{
this.lblUser = st;
}
private StaticText txtMsg = new StaticText();
public StaticText getTxtMsg()
{
return txtMsg;
}
public void setTxtMsg( StaticText st )
{
this.txtMsg = st;
}
private StaticText textAnalise = new StaticText();
public StaticText getTextAnalise()
{
return textAnalise;
}
public void setTextAnalise( StaticText textAnalise )
{
this.textAnalise = textAnalise;
}
private TextArea textComentario = new TextArea();
public TextArea getTextComentario()
{
return textComentario;
}
public void setTextComentario( TextArea textComentario )
{
this.textComentario = textComentario;
}
private void _init() throws Exception
{
}
public ConfirmarDesactivar()
{
}
@Override
public void init()
{
super.init();
try
{
_init();
}
catch ( Exception e )
{
log( "ConfirmarDesactivar Initialization Failure", e );
throw e instanceof FacesException ? (FacesException) e: new FacesException(e);
}
if ( ! canAccess() )
{
try
{
getExternalContext().redirect( "Login.jsp" );
}
catch( Exception e )
{
ErrorLogger.logException( e );
}
}
}
/**
* <p>Callback method that is called after the component tree has been
* restored, but before any event processing takes place. This method
* will <strong>only</strong> be called on a postback request that
* is processing a form submit. Customize this method to allocate
* resources that will be required in your event handlers.</p>
*/
@Override
public void preprocess()
{
txtMsg.setText( getSessionBean1().getMsg() );
getSessionBean1().setMsg( "" );
}
/**
* <p>Callback method that is called just before rendering takes place.
* This method will <strong>only</strong> be called for the page that
* will actually be rendered (and not, for example, on a page that
* handled a postback and then navigated to a different page). Customize
* this method to allocate resources that will be required for rendering
* this page.</p>
*/
@Override
public void prerender()
{
System.out.println( "=== CONFIRMAR_DESACTIVACAO ===" );
lblUser.setText( getSessionBean1().getCurrentUser().getLogin() );
AnaliseAcidente analise = getSessionBean1().getCurrentAnalise();
if ( analise != null )
{
textAnalise.setText( "Análise nº " + analise.getAnalise_nr() );
}
else
{
textAnalise.setText( "Análise inválida." );
}
}
/**
* <p>Callback method that is called after rendering is completed for
* this request, if <code>init()</code> was called (regardless of whether
* or not this was the page that was actually rendered). Customize this
* method to release resources acquired in the <code>init()</code>,
* <code>preprocess()</code>, or <code>prerender()</code> methods (or
* acquired during execution of an event handler).</p>
*/
@Override
public void destroy()
{
}
/**
* <p>Return a reference to the scoped data bean.</p>
*
* @return reference to the scoped data bean
*/
protected SessionBean1 getSessionBean1() {
return (SessionBean1) getBean("SessionBean1");
}
/**
* <p>Return a reference to the scoped data bean.</p>
*
* @return reference to the scoped data bean
*/
protected RequestBean1 getRequestBean1() {
return (RequestBean1) getBean("RequestBean1");
}
/**
* <p>Return a reference to the scoped data bean.</p>
*
* @return reference to the scoped data bean
*/
protected ApplicationBean1 getApplicationBean1() {
return (ApplicationBean1) getBean("ApplicationBean1");
}
private boolean canAccess()
{
boolean canAccess = false;
if ( getSessionBean1().isLoggedIn() )
{
Utilizador u = getSessionBean1().getCurrentUser();
if ( u != null && u.getTipo().intValue() == Global.TIPO_UTILIZADOR_DIRECTOR_SIPRP )
{
canAccess = true;
}
}
return canAccess;
}
public String lnkPlanosActuacao_action()
{
Utilizador u = getSessionBean1().getCurrentUser();
FacesContext fc = getFacesContext().getCurrentInstance();
Global.redirectToPlanos(fc, u);
return null;
}
public String lnkNewUser_action()
{
getSessionBean1().setNavFrom( "EstatisticasProcesso" );
return "gestao_utilizadores";
}
public String lnkEditUser_action()
{
getSessionBean1().setNavFrom( "EstatisticasProcesso" );
getSessionBean1().setModoEdicaoUtilizador( "edit" );
return "user";
}
public String lnkLogout_action()
{
try
{
javax.servlet.http.HttpSession session = ( javax.servlet.http.HttpSession ) getExternalContext().getSession( true );
session.invalidate();
Utils.doLogout();
getExternalContext().redirect( "Login.jsp" );
}
catch( Exception ex )
{
}
return null;
}
public String buttonCancelar_action()
{
getSessionBean1().setCurrentAnalise( null );
return "formDirSiprp";
}
public String buttonConfirmar_action()
{
Utilizador currentUser = getSessionBean1().getCurrentUser();
AnaliseAcidente analise = getSessionBean1().getCurrentAnalise();
if ( userCanDesactivarAnalise( currentUser ) && analise != null )
{
try
{
String comentario = null;
if ( textComentario.getText() != null )
{
comentario = ( ( String ) textComentario.getText() ).trim();
comentario = "".equals( comentario ) ? null : comentario;
}
analise.setEstado( Global.ESTADO_CONCLUIDO );
analise.setConcluido_por_desactivacao( Boolean.TRUE );
analise.setData_desactivacao( new Date() );
analise.setComentario_desactivacao( comentario );
AnalisesDataProvider adp = new AnalisesDataProvider();
adp.updateAnalise( analise );
}
catch ( Exception e )
{
ErrorLogger.logException( e );
getSessionBean1().setMsg( "Erro a desactivar análise.\n" + e.getMessage() );
}
}
return "formDirSiprp";
}
private boolean userCanDesactivarAnalise( Utilizador user )
{
boolean canDesactivar = false;
if ( user != null )
{
int userType = user.getTipo() == null ? -1 : user.getTipo().intValue();
canDesactivar = userType == Global.TIPO_UTILIZADOR_DIRECTOR_SIPRP;
}
return canDesactivar;
}
}

@ -387,17 +387,13 @@ public class EstatisticasProcesso extends AbstractPageBean
javax.servlet.http.HttpSession session = ( javax.servlet.http.HttpSession ) getExternalContext().getSession( true );
session.invalidate();
Utils.doLogout();
}
catch( Exception ex )
{}
try
{
getExternalContext().redirect( "Login.jsp" );
}
catch( Exception e )
{}
catch( Exception ex )
{
}
return null;
}

@ -842,6 +842,28 @@ public class FormDirSiprp extends AbstractPageBean {
public void setLblUser(StaticText st) {
this.lblUser = st;
}
public TableColumn tableColumnDesactivarAnalise = new TableColumn();
public TableColumn getTableColumnDesactivarAnalise() {
return tableColumnDesactivarAnalise;
}
public void setTableColumnDesactivarAnalise(TableColumn tableColumnDesactivarAnalise) {
this.tableColumnDesactivarAnalise = tableColumnDesactivarAnalise;
}
public Button buttonDesactivarAnalise = new Button();
public Button getButtonDesactivarAnalise() {
return buttonDesactivarAnalise;
}
public void setButtonDesactivarAnalise(Button buttonDesactivarAnalise) {
this.buttonDesactivarAnalise = buttonDesactivarAnalise;
}
// </editor-fold>
@ -946,130 +968,111 @@ public class FormDirSiprp extends AbstractPageBean {
}
private static final DateFormat D_F = new SimpleDateFormat( "yyyy-MM-dd" );
/**
* <p>Construct a new Page bean instance.</p>
*/
public FormDirSiprp() {
public FormDirSiprp()
{
}
/**
* <p>Callback method that is called whenever a page is navigated to,
* either directly via a URL, or indirectly via page navigation.
* Customize this method to acquire resources that will be needed
* for event handlers and lifecycle methods, whether or not this
* page is performing post back processing.</p>
*
* <p>Note that, if the current request is a postback, the property
* values of the components do <strong>not</strong> represent any
* values submitted with this request. Instead, they represent the
* property values that were saved for this view when it was rendered.</p>
*/
public void init() {
// Perform initializations inherited from our superclass
@Override
public void init()
{
super.init();
// Perform application initialization that must complete
// *before* managed components are initialized
// TODO - add your own initialiation code here
if (!getSessionBean1().isLoggedIn()) {
try {
getExternalContext().redirect("Login.jsp");
} catch(Exception e) {
// . . . handle exception . . .
}
}
// <editor-fold defaultstate="collapsed" desc="Managed Component Initialization">
// Initialize automatically managed components
// *Note* - this logic should NOT be modified
try {
try
{
_init();
} catch (Exception e) {
}
catch ( Exception e )
{
log("FormDirSiprp Initialization Failure", e);
throw e instanceof FacesException ? (FacesException) e: new FacesException(e);
}
// </editor-fold>
// Perform application initialization that must complete
// *after* managed components are initialized
// TODO - add your own initialization code here
if ( ! getSessionBean1().isLoggedIn() )
{
try
{
getExternalContext().redirect( "Login.jsp" );
}
catch ( Exception e )
{
// . . . handle exception . . .
}
}
}
/**
* <p>Callback method that is called after the component tree has been
* restored, but before any event processing takes place. This method
* will <strong>only</strong> be called on a postback request that
* is processing a form submit. Customize this method to allocate
* resources that will be required in your event handlers.</p>
*/
public void preprocess() {
txtMsg1.setText(getSessionBean1().getMsg());
getSessionBean1().setMsg("");
@Override
public void preprocess()
{
txtMsg1.setText( getSessionBean1().getMsg() );
getSessionBean1().setMsg( "" );
}
/**
* <p>Callback method that is called just before rendering takes place.
* This method will <strong>only</strong> be called for the page that
* will actually be rendered (and not, for example, on a page that
* handled a postback and then navigated to a different page). Customize
* this method to allocate resources that will be required for rendering
* this page.</p>
*/
public void prerender() {
System.out.println("=== FORM_DIR_SIPRP ===");
lblUser.setText( getSessionBean1().getCurrentUser().getLogin() );
@Override
public void prerender()
{
System.out.println("=== FORM_DIR_SIPRP ===");
Utilizador currentUser = getSessionBean1().getCurrentUser();
lblUser.setText( currentUser == null ? "" : currentUser.getLogin() );
HttpServletRequest request = (HttpServletRequest) getExternalContext().getRequest();
String referer = request.getRequestURI();
String pageFrom = Utils.getPageFrom(referer);
if((!pageFrom.matches("FormDirSiprp.jsp")) || getSessionBean1().isFromAnaliseDeletion())
{
AnalisesDataProvider adp = new AnalisesDataProvider();
try
{
HttpServletRequest request = ( HttpServletRequest ) getExternalContext().getRequest();
String referer = request.getRequestURI();
String pageFrom = Utils.getPageFrom( referer );
if ( ( ! pageFrom.matches( "FormDirSiprp.jsp" ) ) || getSessionBean1().isFromAnaliseDeletion() )
{
AnalisesDataProvider adp = new AnalisesDataProvider();
try
{
//lblActivos.setRendered(true);
table2.setRendered( true );
ArrayList seguimentoList = adp.getAnalisesSeguimentoDirSiprpList();
getSessionBean1().getAnalisesSeguimentoDataProvider().setList( seguimentoList );
}
catch(Exception ex)
{
//lblActivos.setRendered(false);
table2.setRendered( false );
ErrorLogger.logException( ex );
}
try
{
//lblActivos.setRendered(true);
table3.setRendered(true);
ArrayList concluidasList = adp.getAnalisesConcluidasList(null);
getSessionBean1().getAnalisesConcluidasDataProvider().setList(concluidasList);
}
catch(Exception ex)
{
//lblActivos.setRendered(false);
table3.setRendered(false);
ErrorLogger.logException( ex );
}
fillAnoDropDown();
}
}
//}
}
catch ( Exception ex )
{
//lblActivos.setRendered(false);
table2.setRendered( false );
ErrorLogger.logException( ex );
}
try
{
//lblActivos.setRendered(true);
table3.setRendered( true );
ArrayList concluidasList = adp.getAnalisesConcluidasList( null );
getSessionBean1().getAnalisesConcluidasDataProvider().setList( concluidasList );
}
catch ( Exception ex )
{
//lblActivos.setRendered(false);
table3.setRendered( false );
ErrorLogger.logException( ex );
}
fillAnoDropDown();
}
//Column para desactivar plano - mostra se o utilizador for DIRECTOR SIPRP
// System.out.println( "\n\nRendering 'desactivar' ... " + buttonDesactivarAnalise.isRendered() );
int uType = currentUser == null ? -1 : currentUser.getTipo().intValue();
// System.out.println( "\tuserType : " + uType );
boolean renderOrNot = uType == Global.TIPO_UTILIZADOR_DIRECTOR_SIPRP;
// System.out.println( "\trenderOrNot : " + renderOrNot + " ( " + Global.TIPO_UTILIZADOR_DIRECTOR_SIPRP + " )" );
tableColumnDesactivarAnalise.setRendered( renderOrNot );
buttonDesactivarAnalise.setRendered( renderOrNot );
}
/**
* <p>Callback method that is called after rendering is completed for
* this request, if <code>init()</code> was called (regardless of whether
* or not this was the page that was actually rendered). Customize this
* method to release resources acquired in the <code>init()</code>,
* <code>preprocess()</code>, or <code>prerender()</code> methods (or
* acquired during execution of an event handler).</p>
*/
public void destroy() {
@Override
public void destroy()
{
}
/**
@ -1601,5 +1604,16 @@ public class FormDirSiprp extends AbstractPageBean {
return null;
}
public String buttonDesactivarAnalise_action()
{
System.out.println( "\nbuttonDesactivarAnalise_action() : " );
AnaliseAcidente selectedAnalise = getTableSeguimentoRowData();
// TODO : call ConfirmarDesactivar.jsp with selectedAnalise
getSessionBean1().setCurrentAnalise( selectedAnalise );
return "confirmar_desactivar";
}
}

@ -158,6 +158,28 @@ public class ViewAnaliseAcidenteTrabalho extends AbstractPageBean {
this.txtMsg1 = st;
}
private StaticText txtComentarioConclusaoTitle = new StaticText();
public StaticText getTxtComentarioConclusaoTitle() {
return txtComentarioConclusaoTitle;
}
public void setTxtComentarioConclusaoTitle(StaticText txtComentarioConclusaoTitle) {
this.txtComentarioConclusaoTitle = txtComentarioConclusaoTitle;
}
private StaticText txtComentarioConclusao = new StaticText();
public StaticText getTxtComentarioConclusao() {
return txtComentarioConclusao;
}
public void setTxtComentarioConclusao(StaticText txtComentarioConclusao) {
this.txtComentarioConclusao = txtComentarioConclusao;
}
private HtmlPanelGrid gridCabecalho1 = new HtmlPanelGrid();
public HtmlPanelGrid getGridCabecalho1() {
@ -2141,7 +2163,9 @@ public class ViewAnaliseAcidenteTrabalho extends AbstractPageBean {
* values submitted with this request. Instead, they represent the
* property values that were saved for this view when it was rendered.</p>
*/
public void init() {
@Override
public void init()
{
// Perform initializations inherited from our superclasssuperclass
super.init();
// Perform application initialization that must complete
@ -2185,7 +2209,9 @@ public class ViewAnaliseAcidenteTrabalho extends AbstractPageBean {
* is processing a form submit. Customize this method to allocate
* resources that will be required in your event handlers.</p>
*/
public void preprocess() {
@Override
public void preprocess()
{
}
/**
@ -2196,7 +2222,9 @@ public class ViewAnaliseAcidenteTrabalho extends AbstractPageBean {
* this method to allocate resources that will be required for rendering
* this page.</p>
*/
public void prerender() {
@Override
public void prerender()
{
getSessionBean1().setFromAnaliseDeletion(false);
String confirmacao_analise = (String)getExternalContext().getRequestParameterMap().get("confirmacao_analise");
if(confirmacao_analise != null)
@ -2267,8 +2295,9 @@ public class ViewAnaliseAcidenteTrabalho extends AbstractPageBean {
* <code>preprocess()</code>, or <code>prerender()</code> methods (or
* acquired during execution of an event handler).</p>
*/
public void destroy() {
@Override
public void destroy()
{
}
/**
@ -2334,18 +2363,47 @@ public class ViewAnaliseAcidenteTrabalho extends AbstractPageBean {
private void initializePage()
{
Utilizador u = getSessionBean1().getCurrentUser();
AnaliseAcidente a = getSessionBean1().getCurrentAnalise();
if(! (u.getTipo().intValue() == Global.TIPO_UTILIZADOR_DIRECTOR_SIPRP || u.getTipo().intValue() == Global.TIPO_UTILIZADOR_HS))
{
butEliminar.setRendered(false);
}
else
{
AnaliseAcidente a = getSessionBean1().getCurrentAnalise();
if(a.getEstado().intValue() == Global.ESTADO_CONCLUIDO)
{
butEliminar.setRendered(false);
}
}
if ( a != null )
{
if ( a.getConcluido_por_desactivacao() )
{
txtComentarioConclusaoTitle.setRendered( true );
txtComentarioConclusaoTitle.setText( "Análise concluída por falta de cumprimento do prazo." );
if ( a.getComentario_desactivacao() != null && ! "".equals( a.getComentario_desactivacao().trim() ) )
{
txtComentarioConclusao.setRendered( true );
txtComentarioConclusao.setText( "" + a.getComentario_desactivacao() );
}
else
{
txtComentarioConclusao.setRendered( false );
txtComentarioConclusao.setText( "" );
}
}
else
{
txtComentarioConclusao.setRendered( false );
txtComentarioConclusao.setText( "" );
txtComentarioConclusao.setRendered( false );
txtComentarioConclusao.setText( "" );
}
}
fillPage();
//fillImages();
}

@ -142,6 +142,11 @@ public class AnaliseAcidente implements Serializable
private Date data_inicio_processo;
private Integer rh_fase4;
private Boolean concluido_por_desactivacao;
private java.util.Date data_desactivacao;
private String comentario_desactivacao;
/** Creates a new instance of AnaliseAcidente */
public AnaliseAcidente() {
@ -1048,5 +1053,29 @@ public class AnaliseAcidente implements Serializable
{
this.rh_fase4 = rh_fase4;
}
public Boolean getConcluido_por_desactivacao() {
return concluido_por_desactivacao;
}
public void setConcluido_por_desactivacao(Boolean concluido_por_desactivacao) {
this.concluido_por_desactivacao = concluido_por_desactivacao;
}
public java.util.Date getData_desactivacao() {
return data_desactivacao;
}
public void setData_desactivacao( java.util.Date data_desactivacao) {
this.data_desactivacao = data_desactivacao;
}
public String getComentario_desactivacao() {
return comentario_desactivacao;
}
public void setComentario_desactivacao(String comentario_desactivacao) {
this.comentario_desactivacao = comentario_desactivacao;
}
}

@ -1330,11 +1330,14 @@ public class AnalisesDataProvider {
a.setNome_resp_consolidacao(rs.getString("nome_resp_consolidacao"));
//System.out.println("ANALISE NR : " + a.getAnalise_nr());
a.setRh_fase4(new Integer( rs.getInt("rh_fase4") ));
list.add(a);
}while(rs.next());
a.setConcluido_por_desactivacao( rs.getBoolean( "concluido_por_desactivacao" ) );
a.setData_desactivacao( rs.getDate( "data_desactivacao" ) );
a.setComentario_desactivacao( rs.getString( "comentario_desactivacao" ) );
list.add( a );
} while ( rs.next() );
dblocal.close();
return list;
}
@ -1888,7 +1891,7 @@ public class AnalisesDataProvider {
a.setAnalise_nr(analise_nr);
a.setId(newId);
String sql = "INSERT INTO analises_acidentes (id, averiguador, data_acidente, acidentado_id, estado, empresa_id, estabelecimento_id, horas_turno, departamento_id, seccao_id, local_trabalho, tarefa, substancias, condicoes, testemunhas, causas, descricao, conclusoes, accoes, hora_acidente, medico_id, tecnico_saude_id, averiguacao_posterior, averiguacao_obs, data_inicio_processo, analise_nr, coef_incapacidade) VALUES (";
String sql = "INSERT INTO analises_acidentes (id, averiguador, data_acidente, acidentado_id, estado, empresa_id, estabelecimento_id, horas_turno, departamento_id, seccao_id, local_trabalho, tarefa, substancias, condicoes, testemunhas, causas, descricao, conclusoes, accoes, hora_acidente, medico_id, tecnico_saude_id, averiguacao_posterior, averiguacao_obs, data_inicio_processo, analise_nr, coef_incapacidade, concluido_por_desactivacao, data_desactivacao, comentario_desactivacao) VALUES (";
sql += newId + ", '";
sql += a.getAveriguador() + "', '";
sql += a.getData_acidente() + "', ";
@ -1932,7 +1935,13 @@ public class AnalisesDataProvider {
}
sql += analise_nr + "', ";
sql += null + ")";
sql += null + ", ";
sql += false + ", " + null + ", " + null; //concluido_por_desactivacao, data_desactivacao, comentario_desactivacao
sql += ")";
// sql += null + ")";
// sql += a.getFormacao_shst() + "', '";
// sql += a.getFormacao_shst_nao_porque() + "', '";
// sql += a.getOutros_acidentes_com_colaborador() + "', ";
@ -1987,8 +1996,24 @@ public class AnalisesDataProvider {
{
a.setFormacao_shst_nao_porque("");
}
if ( a.getConcluido_por_desactivacao() == null )
{
a.setConcluido_por_desactivacao( Boolean.FALSE );
a.setData_desactivacao( null );
a.setComentario_desactivacao( null );
}
if ( a.getConcluido_por_desactivacao() != null && a.getConcluido_por_desactivacao().equals( Boolean.TRUE ) && a.getData_desactivacao() == null )
{
a.setData_desactivacao( new Date() );
}
if ( a.getComentario_desactivacao() != null && "".equals( a.getComentario_desactivacao().trim() ) )
{
a.setComentario_desactivacao( null );
}
Statement st = createStatement();
String sql = "UPDATE analises_acidentes SET data_acidente = '" + a.getData_acidente() + "', ";
String sql = "UPDATE analises_acidentes SET data_acidente = '" + a.getData_acidente() + "', ";
sql += "acidentado_id = " + a.getAcidentado_id() + ", ";
sql += "estado = " + a.getEstado() + ", ";
sql += "empresa_id = " + a.getEmpresa_id() + ", ";
@ -2149,17 +2174,20 @@ public class AnalisesDataProvider {
{
sql += "data_assinatura_superior = '" + a.getData_assinatura_superior() + "', ";
}
sql += "rh_fase4 = " + a.getRh_fase4() + " ";
sql += "WHERE id = " + a.getId();
sql += "rh_fase4 = " + a.getRh_fase4() + ", ";
sql += "concluido_por_desactivacao = " + a.getConcluido_por_desactivacao() + ", ";
sql += "comentario_desactivacao = " + ( a.getComentario_desactivacao() == null ? "null" : "'" + a.getComentario_desactivacao() + "'" ) + ", ";
sql += "data_desactivacao = " + ( a.getData_desactivacao() == null ? "null" : "'" + new java.sql.Date( a.getData_desactivacao().getTime() ) + "'" );
sql += " WHERE id = " + a.getId();
System.out.println("SQL UPDATE : " + sql);
st.execute(sql);
st.execute( sql );
}
public void changeEstado(Correcao c) throws Exception
{
Statement st = createStatement();
String sql = "UPDATE analises_acidentes SET correcao = '" + c.getCorrecao() + "', estado = " + c.getEstado_corr() + ", estado_antes_correcao = " + c.getEstado_actual() + ", observacoes_correcao = '" + c.getObservacoes() + "' WHERE id = " + c.getAnalise_id();
st.execute(sql);
st.execute(sql);
}
public Integer getMaxRecomendacaoId()

@ -23,24 +23,34 @@ import javax.servlet.http.HttpSession;
*/
public class Db
{
// String connectionURL = "jdbc:postgresql://evoserver:5432/siprp_20100813"; //testes
String connectionURL = "jdbc:postgresql://localhost:5436/siprp"; //real
String User = "postgres";
String Pass = null;
//production
private String host = "localhost";
private int port = 5436;
private String db = "siprp";
private String user = "postgres";
private String pass = null;
//tests
// private String host = "evoserver";
// private int port = 5432;
// private String db = "siprp_20100813";
// private String user = "postgres";
// private String pass = null;
Connection connection = null;
private String connectionURL = "jdbc:postgresql://" + host + ":" + port + "/" + db;
private Connection connection = null;
/** Creates a new instance of Db */
public Db()
public Db()
{
}
public Connection connect() throws Exception
{
Class.forName("org.postgresql.Driver").newInstance();
connection = DriverManager.getConnection(connectionURL, User, Pass);
connection = DriverManager.getConnection(connectionURL, user, pass);
HttpSession session = (HttpSession)FacesContext.getCurrentInstance().getExternalContext().getSession(true);
session.setAttribute("connection", connection);
return connection;

@ -23,24 +23,33 @@ import javax.servlet.http.HttpSession;
*/
public class Dblocal
{
// String connectionURL = "jdbc:postgresql://evoserver:5432/siprp_local_3_20100813"; //testes
String connectionURL = "jdbc:postgresql://localhost:5436/siprp_local_3";
//production
private String host = "localhost";
private int port = 5436;
private String db = "siprp_local_3";
private String user = "postgres";
private String pass = null;
String User = "postgres";
String Pass = null;
//tests
// private String host = "evoserver";
// private int port = 5432;
// private String db = "siprp_local_3_20100813";
// private String user = "postgres";
// private String pass = null;
private String connectionURL = "jdbc:postgresql://" + host + ":" + port + "/" + db;
private Connection connection = null;
Connection connection = null;
/** Creates a new instance of Dblocal */
public Dblocal()
{
}
public Connection connect() throws Exception
{
Class.forName("org.postgresql.Driver").newInstance();
connection = DriverManager.getConnection(connectionURL, User, Pass);
connection = DriverManager.getConnection(connectionURL, user, pass);
HttpSession session = (HttpSession)FacesContext.getCurrentInstance().getExternalContext().getSession(true);
session.setAttribute("connection_local", connection);
return connection;

@ -5,14 +5,14 @@
package phaselistener;
import beans.Utilizador;
import javax.faces.context.FacesContext;
import javax.faces.event.PhaseEvent;
import javax.faces.event.PhaseId;
import javax.faces.event.PhaseListener;
import analiseacidentestrabalho.SessionBean1;
import com.evolute.utils.error.ErrorLogger;
import java.util.logging.Level;
import javax.faces.component.UIViewRoot;
import javax.servlet.http.HttpServletRequest;
import utils.AnaliseAcidentesTrabalhoLogger;
import utils.JSFUtils;
import utils.Logos;
@ -43,35 +43,62 @@ public class MainPhaseListener implements PhaseListener
}
private boolean firstEntry = true;
@Override
public void afterPhase(PhaseEvent pe)
{
}
public void beforePhase(PhaseEvent pe) {
@Override
public void beforePhase(PhaseEvent pe)
{
if(pe.getPhaseId() == PhaseId.RENDER_RESPONSE)
{
FacesContext fc = pe.getFacesContext();
SessionBean1 session = JSFUtils.getSessionBean(fc);
FacesContext fc = pe.getFacesContext();
SessionBean1 session = JSFUtils.getSessionBean( fc );
HttpServletRequest req = ( HttpServletRequest ) fc.getExternalContext().getRequest();
boolean sessionValid = req.isRequestedSessionIdValid();
System.out.println( "\tSessionValid : " + sessionValid );
Utilizador u = session.getCurrentUser();
UIViewRoot view = fc.getViewRoot();
System.out.println( "\tView : " + view );
String viewID = view.getViewId();
System.out.println( "\t\tView ID :" + viewID );
//insert logos
//Integer empresaId = u.getEmpresa_id();
Integer empresaId = new Integer(32);
//System.out.println("LOGO EMPRESA ID : " + empresaId.toString());
Logos logos = new Logos();
String logourl = logos.getLogo(fc, empresaId);
//System.out.println("LOGO URL : " + logourl);
session.setLogoEmpresaUrl(logourl);
boolean loggedIn = session.isLoggedIn();
System.out.println( "\tLogged In : " + loggedIn );
if ( sessionValid && loggedIn )
{
//insert logos
Integer empresaId = new Integer( 32 );
Logos logos = new Logos();
String logourl = logos.getLogo( fc, empresaId );
session.setLogoEmpresaUrl( logourl );
}
else
{
if ( ! viewID.endsWith( "/Login.jsp" ) )
{
try
{
JSFUtils.redirect( fc.getCurrentInstance(), "faces/Login.jsp" );
}
catch ( Exception e )
{
ErrorLogger.logException( e );
System.out.println( "\n\t\t\tERROR REDIRECTING TO LOGIN !" );
}
}
}
}
}
public PhaseId getPhaseId() {
@Override
public PhaseId getPhaseId()
{
return PhaseId.ANY_PHASE;
}

@ -0,0 +1,138 @@
<?xml version="1.0" encoding="UTF-8"?>
<jsp:root version="1.2"
xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html"
xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:ui="http://www.sun.com/web/ui">
<jsp:directive.page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"/>
<f:view>
<ui:page id="page">
<ui:html id="html">
<ui:head id="head">
<ui:link id="link_css" url="/resources/stylesheet.css"/>
<script type="text/javascript">
function showPdf()
{
sOptions = " width = '" + screen.availWidth + "'";
sOptions += " height= '" + screen.availHeight + "'";
var wOpen;
wOpen = window.open('./resources/pdfs/Ajuda.pdf','', sOptions );
wOpen.focus();
wOpen.moveTo(0,0);
wOpen.resizeTo( screen.availWidth, screen.availHeight );
}
</script>
</ui:head>
<ui:body id="body" style="-rave-layout: grid">
<h:panelGrid columns="1" id="gridBase" style="height: 24px; left: 0px; top: 60px; position: absolute; width: 100%"
styleClass="centerBlock" width="648">
<h:panelGrid columns="1" id="gridLayout" style="height: 15px; width: 80%" styleClass="centerBlock">
<!-- header -->
<ui:form id="form0">
<h:panelGrid columnClasses="gridColLeft, gridColRightBottom" columns="2" id="gridPanel8"
style="border-bottom: solid #000000 1px; height: 24px; width: 100%" width="312">
<ui:panelGroup id="groupPanel5" style="height: 24px; width: 216px">
<ui:image id="image1" url="/resources/images/SIPRP_logo_small.jpg"/>
<ui:image height="40" id="image2" url="#{SessionBean1.logoEmpresaUrl}" width="150"/>
</ui:panelGroup>
<h:panelGrid columnClasses="gridColRight" columns="1" id="gridPanel11" style="height: 24px; width: 100%">
<ui:panelGroup id="groupPanel6">
<ui:hyperlink action="#{ConfirmarDesactivar.lnkPlanosActuacao_action}" binding="#{ConfirmarDesactivar.lnkPlanosActuacao}" id="lnkPlanosActuacao" text="planos actuação&gt;&gt;"/>
</ui:panelGroup>
<ui:panelGroup id="groupPanel9" style="height: 24px">
<ui:staticText binding="#{ConfirmarDesactivar.lblUser}" escape="false" id="lblUser" styleClass="labelBold"/>
<ui:staticText escape="false" id="staticText9" text="   "/>
<ui:hyperlink action="#{ConfirmarDesactivar.lnkNewUser_action}" disabled="true" id="lnkNewUser1" style="width: 120px" text="gerir utilizadores"/>
<ui:staticText escape="false" id="staticText12" text=" | "/>
<ui:hyperlink action="#{ConfirmarDesactivar.lnkEditUser_action}" id="lnkEditUser1" text="alterar dados utilizador"/>
<ui:staticText escape="false" id="staticText13" text=" | "/>
<ui:hyperlink id="lnkAjuda1" onClick="showPdf();" style="" text="ajuda "/>
<ui:staticText id="staticText15" style="width: 0px" text="|"/>
<ui:hyperlink action="#{ConfirmarDesactivar.lnkLogout_action}" id="lnkLogout1" text="sair&gt;&gt;"/>
</ui:panelGroup>
</h:panelGrid>
</h:panelGrid>
</ui:form>
<h:panelGrid columnClasses="gridColCenter" columns="1" id="gridPanel10" style="height: 24px; width: 100%" width="504">
<ui:staticText binding="#{ConfirmarDesactivar.txtMsg}" escape="false" id="txtMsg" style="color: rgb(204, 0, 0); font-weight: bold; height: 24px"/>
</h:panelGrid>
<!-- body -->
<h:panelGrid columnClasses="gridLayoutTopCols, gridLayoutTopCols" columns="1"
id="gridLayoutTop" style="height: 15px; position: relative; vertical-align: top; width: 100%">
<h:panelGrid columnClasses="gridColCenter" columns="1" id="gridEstatisticas" style="background-color: #f6f4e8; height: 24px; position: relative; width: 100%" width="360">
<h:panelGrid columnClasses="gridColCenter" columns="1" id="gridPanel1"
style="height: 24px; width: 100%;">
<ui:staticText id="staticText1" text="Confirmação de Desactivação"
style="font-size: 18px; font-weight: bold; height: 24px;" />
</h:panelGrid>
<ui:staticText text=" " />
<ui:staticText id="staticTextQuestion" text="Tem a certeza que pretende desactivar a análise?" />
<ui:staticText id="staticTextQuestion1" text="Esta acção é irreversível e passará a análise para o estado Concluído." />
<ui:staticText text=" " />
<ui:staticText id="staticTextAnalise" escape="false" binding="#{ConfirmarDesactivar.textAnalise}" style="font-weight: bold;" />
<ui:staticText text=" " />
<h:form id="formConfirmacao">
<h:panelGrid id="panelGrid1" columns="1" style="width: 100%;">
<ui:staticText id="staticTextComentario" text="Comentário:" style="" />
<ui:textArea id="textAreaComentario" columns="20" rows="5"
binding="#{ConfirmarDesactivar.textComentario}" style="width: 90%;" />
<ui:panelGroup id="panelGroupButtons">
<ui:button id="buttonConfirmar" action="#{ConfirmarDesactivar.buttonConfirmar_action}" text="Desactivar" />
<ui:button id="buttonCancelar" action="#{ConfirmarDesactivar.buttonCancelar_action}" text="Cancelar" />
</ui:panelGroup>
</h:panelGrid>
</h:form>
</h:panelGrid>
</h:panelGrid>
<!-- footer -->
<h:panelGrid columnClasses="gridColCenter" columns="1" id="gridPanel9" style="height: 24px; width: 100%">
<ui:panelGroup id="groupPanel8" style="border-bottom: solid rgb(255, 255, 255) 1px; height: 21px">
<ui:staticText id="staticText6" text="Software desenvolvido por "/>
<ui:image height="21" id="image3" url="/resources/images/logo_evolute_small.png" width="100"/>
<ui:staticText escape="false" id="staticText7" text="&amp;nbsp;&amp;copy; 2008 "/>
</ui:panelGroup>
</h:panelGrid>
</h:panelGrid>
</h:panelGrid>
<!-- google analytics -->
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
try
{
var pageTracker = _gat._getTracker("UA-6942416-1");
pageTracker._trackPageview();
}
catch( err ) {}
</script>
</ui:body>
</ui:html>
</ui:page>
</f:view>
</jsp:root>

@ -16,7 +16,7 @@
wOpen.focus();
wOpen.moveTo(0,0);
wOpen.resizeTo( screen.availWidth, screen.availHeight );
}
}
</script>
</ui:head>
@ -136,6 +136,10 @@
<ui:hyperlink action="#{FormDirSiprp.lnkEstabelecimentoSeg_action}"
binding="#{FormDirSiprp.lnkEstabelecimentoSeg1}" id="lnkEstabelecimentoSeg1" style="" text="#{currentRow.value['nome_estabelecimento']}"/>
</ui:tableColumn>
<ui:tableColumn binding="#{FormDirSiprp.tableColumnDesactivarAnalise}" headerText="" id="tableColumnDesactivarAnalise" >
<ui:button binding="#{FormDirSiprp.buttonDesactivarAnalise}" id="buttonDesactivarAnalsie"
action="#{FormDirSiprp.buttonDesactivarAnalise_action}" text="Desactivar" />
</ui:tableColumn>
</ui:tableRowGroup>
</ui:table>
</h:panelGrid>

@ -94,6 +94,10 @@
style="height: 24px; width: 100%" width="96">
<ui:staticText binding="#{ViewAnaliseAcidenteTrabalho.txtMsg1}" escape="false" id="txtMsg1"
style="height: 24px; width: 384px" styleClass="labelMsg"/>
<ui:staticText id="txtComentarioConclusaoTitle" escape="false" binding="#{ViewAnaliseAcidenteTrabalho.txtComentarioConclusaoTitle}"
style="height: 24px; width: 384px;" styleClass="labelMsg" />
<ui:staticText id="txtComentarioConclusao" escape="false" binding="#{ViewAnaliseAcidenteTrabalho.txtComentarioConclusao}"
style="height: 24px; width: 384px;" styleClass="labelMsg" />
</h:panelGrid>
<h:panelGrid binding="#{ViewAnaliseAcidenteTrabalho.gridCabecalho1}" columns="1" id="gridCabecalho1" style="background-color: #668597; border: 1px solid #000000; height: 39px; width: 100%">
<h:panelGrid binding="#{ViewAnaliseAcidenteTrabalho.gridPanel2}" columnClasses="gridColLeft15, gridColLeft85" columns="2"

@ -25,10 +25,7 @@
<lifecycle>
<phase-listener>phaselistener.MainPhaseListener</phase-listener>
</lifecycle>
<managed-bean>
<managed-bean-name>Acesso</managed-bean-name>
<managed-bean-class>analiseacidentestrabalho.Acesso</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
</lifecycle>
</faces-config>

@ -2,6 +2,11 @@
<!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
"http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
<faces-config>
<managed-bean>
<managed-bean-name>Acesso</managed-bean-name>
<managed-bean-class>analiseacidentestrabalho.Acesso</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
<managed-bean>
<managed-bean-name>SessionBean1</managed-bean-name>
<managed-bean-class>analiseacidentestrabalho.SessionBean1</managed-bean-class>
@ -132,5 +137,9 @@
<managed-bean-class>analiseacidentestrabalho.EstatisticasProcesso</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
<managed-bean>
<managed-bean-name>ConfirmarDesactivar</managed-bean-name>
<managed-bean-class>analiseacidentestrabalho.ConfirmarDesactivar</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
</faces-config>

@ -2,6 +2,7 @@
<!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
"http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
<faces-config>
<navigation-rule>
<from-view-id>/Login.jsp</from-view-id>
<navigation-case>
@ -53,6 +54,7 @@
<to-view-id>/FormGestor.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<from-view-id>/RecuperarPassword.jsp</from-view-id>
<navigation-case>
@ -60,6 +62,7 @@
<to-view-id>/Login.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<from-view-id>/FormSeguranca.jsp</from-view-id>
<navigation-case>
@ -79,6 +82,7 @@
<to-view-id>/FichaUtilizador.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<from-view-id>/FormRH.jsp</from-view-id>
<navigation-case>
@ -98,6 +102,7 @@
<to-view-id>/FichaUtilizador.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<from-view-id>/FormHS.jsp</from-view-id>
<navigation-case>
@ -117,6 +122,7 @@
<to-view-id>/FichaUtilizador.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<from-view-id>/FormMedico.jsp</from-view-id>
<navigation-case>
@ -136,6 +142,7 @@
<to-view-id>/FichaUtilizador.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<from-view-id>/FormGestor.jsp</from-view-id>
<navigation-case>
@ -150,7 +157,8 @@
<from-outcome>user</from-outcome>
<to-view-id>/FichaUtilizador.jsp</to-view-id>
</navigation-case>
</navigation-rule>
</navigation-rule>
<navigation-rule>
<from-view-id>/FormDirGerRh.jsp</from-view-id>
<navigation-case>
@ -170,6 +178,7 @@
<to-view-id>/Login.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<from-view-id>/FormDirSiprp.jsp</from-view-id>
<navigation-case>
@ -196,7 +205,12 @@
<from-outcome>estatisticasProcesso</from-outcome>
<to-view-id>/EstatisticasProcesso.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>confirmar_desactivar</from-outcome>
<to-view-id>/ConfirmarDesactivar.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<from-view-id>/AnaliseAcidenteTrabalho.jsp</from-view-id>
<navigation-case>
@ -232,6 +246,7 @@
<to-view-id>/Login.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<from-view-id>/LoadImage.jsp</from-view-id>
<navigation-case>
@ -239,6 +254,7 @@
<to-view-id>/AnaliseAcidenteTrabalho.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<from-view-id>/FichaUtilizador.jsp</from-view-id>
<navigation-case>
@ -290,6 +306,7 @@
<to-view-id>/Login.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<from-view-id>/ViewAnaliseAcidenteTrabalho.jsp</from-view-id>
<navigation-case>
@ -329,6 +346,7 @@
<to-view-id>/FormDirSiprp.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<from-view-id>/EnviarCorrecao.jsp</from-view-id>
<navigation-case>
@ -344,6 +362,7 @@
<to-view-id>/Login.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<from-view-id>/GestaoUtilizadores.jsp</from-view-id>
<navigation-case>
@ -371,6 +390,7 @@
<to-view-id>/Login.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<from-view-id>/NovoUtilizador.jsp</from-view-id>
<navigation-case>
@ -398,6 +418,7 @@
<to-view-id>/Login.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<from-view-id>/UtilizadorFields.jsp</from-view-id>
<navigation-case>
@ -421,6 +442,7 @@
<to-view-id>/Login.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<from-view-id>/Acesso.jsp</from-view-id>
<navigation-case>
@ -470,4 +492,13 @@
</navigation-case>
</navigation-rule>
<!-- FROM ConfirmarDesactivar -->
<navigation-rule>
<from-view-id>/ConfirmarDesactivar.jsp</from-view-id>
<navigation-case>
<from-outcome>formDirSiprp</from-outcome>
<to-view-id>/FormDirSiprp.jsp</to-view-id>
</navigation-case>
</navigation-rule>
</faces-config>

Loading…
Cancel
Save