|
|
|
@ -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 {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
|