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

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

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

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

Loading…
Cancel
Save