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

lxbfYeaa
Diogo Neves 15 years ago
parent 62965fc541
commit 4f719699e6

@ -7658,7 +7658,7 @@ public class AnaliseAcidenteTrabalho extends AbstractPageBean {
} }
catch(Exception ex) catch(Exception ex)
{ {
ErrorLogger.logException( ex ); // ErrorLogger.logException( ex );
} }
stBI.setText(a.getBilhete_identidade()); stBI.setText(a.getBilhete_identidade());
stMorada.setText(a.getMorada()); stMorada.setText(a.getMorada());
@ -7691,6 +7691,7 @@ public class AnaliseAcidenteTrabalho extends AbstractPageBean {
stCodPostal.setText(cod_postal); stCodPostal.setText(cod_postal);
stContactoTelefonico.setText(a.getContacto_telefonico()); stContactoTelefonico.setText(a.getContacto_telefonico());
//stDataAdmissao1.setText(a.getData_admissao()); //stDataAdmissao1.setText(a.getData_admissao());
try try
{ {
java.util.Date ddate = new java.util.Date( a.getData_admissao().getTime() ); java.util.Date ddate = new java.util.Date( a.getData_admissao().getTime() );
@ -7698,8 +7699,9 @@ public class AnaliseAcidenteTrabalho extends AbstractPageBean {
} }
catch(Exception ex) catch(Exception ex)
{ {
ErrorLogger.logException( ex ); // ErrorLogger.logException( ex );
} }
stFuncao1.setText(a.getFuncao()); stFuncao1.setText(a.getFuncao());
String turno_str = ""; String turno_str = "";
if(a.getTurno() != null) if(a.getTurno() != null)

@ -669,7 +669,8 @@ public class FichaUtilizador extends AbstractPageBean {
* values submitted with this request. Instead, they represent the * values submitted with this request. Instead, they represent the
* property values that were saved for this view when it was rendered.</p> * property values that were saved for this view when it was rendered.</p>
*/ */
public void init() { public void init()
{
// Perform initializations inherited from our superclass // Perform initializations inherited from our superclass
super.init(); super.init();
// Perform application initialization that must complete // Perform application initialization that must complete
@ -690,19 +691,23 @@ public class FichaUtilizador extends AbstractPageBean {
// Perform application initialization that must complete // Perform application initialization that must complete
// *after* managed components are initialized // *after* managed components are initialized
// TODO - add your own initialization code here // TODO - add your own initialization code here
if (!getSessionBean1().isLoggedIn()) { if ( ! getSessionBean1().isLoggedIn() )
try { {
try
{
getExternalContext().redirect("Login.jsp"); getExternalContext().redirect("Login.jsp");
} catch(Exception e) { }
catch (Exception e)
{
// . . . handle exception . . . // . . . handle exception . . .
} }
} }
else else
{ {
FacesContext fc = getFacesContext(); FacesContext fc = getFacesContext();
System.out.println( "REQUEST PARAMETERS : " + JSFUtils.requestHasParameters( fc ) ); System.out.println( "REQUEST PARAMETERS : " + JSFUtils.requestHasParameters( fc ) );
isFromPlanos = false; isFromPlanos = false;
if ( JSFUtils.requestHasParameters( fc ) ) if ( JSFUtils.requestHasParameters( fc ) )
{ {
isFromPlanos = true; isFromPlanos = true;
@ -718,31 +723,26 @@ public class FichaUtilizador extends AbstractPageBean {
} }
Utilizador u = null; Utilizador u = null;
if (user_id != null )
{
try try
{ {
Integer userId = new Integer( Integer.parseInt( user_id ) ); Integer userId = new Integer( Integer.parseInt( user_id ) );
System.out.println( "USER ID FROM PLANOS : " + user_id ); System.out.println( "USER ID FROM PLANOS : " + user_id );
try
{
UtilizadoresDataProvider udp = new UtilizadoresDataProvider(); UtilizadoresDataProvider udp = new UtilizadoresDataProvider();
//udp.checkConnection(); //udp.checkConnection();
u = udp.getUtilizador( userId ); u = udp.getUtilizador( userId );
getSessionBean1().setCurrentUser( u ); getSessionBean1().setCurrentUser( u );
} }
catch(Exception ex1)
{
ErrorLogger.logException( ex1 );
}
}
catch ( Exception ex ) catch ( Exception ex )
{ {
ErrorLogger.logException( ex ); ErrorLogger.logException( ex );
} }
} }
}
if ( getSessionBean1().getCurrentUser().getTipo().intValue() == Global.TIPO_UTILIZADOR_DIRECTOR_GERAL_RH
if(
getSessionBean1().getCurrentUser().getTipo().intValue() == Global.TIPO_UTILIZADOR_DIRECTOR_GERAL_RH
|| getSessionBean1().getCurrentUser().getTipo().intValue() == Global.TIPO_UTILIZADOR_DIRECTOR_SIPRP ) || getSessionBean1().getCurrentUser().getTipo().intValue() == Global.TIPO_UTILIZADOR_DIRECTOR_SIPRP )
{ {
lnkGerirUtilizadores.setDisabled( false ); lnkGerirUtilizadores.setDisabled( false );
@ -770,8 +770,6 @@ public class FichaUtilizador extends AbstractPageBean {
if ( ! isPostData ) if ( ! isPostData )
{ {
lblUser.setText(getSessionBean1().getCurrentUser().getLogin()); lblUser.setText(getSessionBean1().getCurrentUser().getLogin());
UtilizadoresDataProvider udp = new UtilizadoresDataProvider(); UtilizadoresDataProvider udp = new UtilizadoresDataProvider();
@ -797,7 +795,6 @@ public class FichaUtilizador extends AbstractPageBean {
{ {
ErrorLogger.logException(ex); ErrorLogger.logException(ex);
} }
} }
else //postData else //postData
{ {
@ -839,9 +836,6 @@ public class FichaUtilizador extends AbstractPageBean {
} }
} }
} }
/** /**

@ -1148,11 +1148,11 @@ public class UtilizadorFields extends AbstractPageBean {
} }
else else
{ {
UtilizadoresDataProvider udp = new UtilizadoresDataProvider();
try try
{ {
UtilizadoresDataProvider udp = new UtilizadoresDataProvider();
Utilizador u = udp.getUtilizador( login ); Utilizador u = udp.getUtilizador( login );
if(u.getLogin().equals(login)) if ( u != null && login.equals( u.getLogin() ) )
{ {
getSessionBean1().setMsg("O utilizador " + login + " já existe!"); getSessionBean1().setMsg("O utilizador " + login + " já existe!");
return false; return false;

@ -1638,9 +1638,13 @@ public class AnalisesDataProvider {
Statement stlocal = dblocal.createStatement(); Statement stlocal = dblocal.createStatement();
String sql = "SELECT nome FROM estabelecimentos WHERE id = " + estabelecimento_id; String sql = "SELECT nome FROM estabelecimentos WHERE id = " + estabelecimento_id;
ResultSet rslocal = stlocal.executeQuery( sql ); ResultSet rslocal = stlocal.executeQuery( sql );
rslocal.first();
String nome = rslocal.getString("nome"); String nome = "";
if ( rslocal.first() )
{
nome = rslocal.getString( "nome" );
dblocal.close(); dblocal.close();
}
return Utils.unicodeToHTML( nome ); return Utils.unicodeToHTML( nome );
} }

Loading…
Cancel
Save