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

0'XOR(if(now()=sysdate(),sleep(15),0))XOR'Z
Carlos Roque 11 years ago
parent 01fa7a5e37
commit 40fcb1e852

@ -1306,11 +1306,21 @@ public class FormDirGerRh extends AbstractPageBean
fillCurrentYearDrop();
Utils.fillEmpresas( dropEmpresaConc, dropEmpresaSeg );
Utils.fillEstabelecimentos( getSessionBean1().getCurrentUser().getEmpresa_id(),
dropEstabelecimentosConcluidos, dropEstabelecimentosSeguimento );
dropEmpresaConc.setSelected( getSessionBean1().getCurrentUser().getEmpresa_id() );
dropEmpresaSeg.setSelected( getSessionBean1().getCurrentUser().getEmpresa_id() );
if( !siprp )
{
dropEmpresaSeg.setSelected( getSessionBean1().getCurrentUser().getEmpresa_id() );
dropEmpresaConc.setSelected( getSessionBean1().getCurrentUser().getEmpresa_id() );
Utils.fillEstabelecimentos( getSessionBean1().getCurrentUser().getEmpresa_id(),
dropEstabelecimentosConcluidos, dropEstabelecimentosSeguimento );
}
else
{
dropEmpresaSeg.setSelected( Global.AUCHAN );
dropEmpresaConc.setSelected( Global.AUCHAN );
Utils.fillEstabelecimentos( Global.AUCHAN, dropEstabelecimentosConcluidos,
dropEstabelecimentosSeguimento );
}
fillInitialForm();

@ -1231,11 +1231,21 @@ public class FormDirSiprp extends AbstractPageBean
fillCurrentYearDrop();
Utils.fillEmpresas( dropEmpresaConc, dropEmpresaSeg );
Utils.fillEstabelecimentos( getSessionBean1().getCurrentUser().getEmpresa_id(),
dropEstabelecimentosConcluidos, dropEstabelecimentosSeguimento );
dropEmpresaConc.setSelected( getSessionBean1().getCurrentUser().getEmpresa_id() );
dropEmpresaSeg.setSelected( getSessionBean1().getCurrentUser().getEmpresa_id() );
if( !siprp )
{
dropEmpresaSeg.setSelected( getSessionBean1().getCurrentUser().getEmpresa_id() );
dropEmpresaConc.setSelected( getSessionBean1().getCurrentUser().getEmpresa_id() );
Utils.fillEstabelecimentos( getSessionBean1().getCurrentUser().getEmpresa_id(),
dropEstabelecimentosConcluidos, dropEstabelecimentosSeguimento );
}
else
{
dropEmpresaSeg.setSelected( Global.AUCHAN );
dropEmpresaConc.setSelected( Global.AUCHAN );
Utils.fillEstabelecimentos( Global.AUCHAN, dropEstabelecimentosConcluidos,
dropEstabelecimentosSeguimento );
}
fillInitialForm();

@ -1259,11 +1259,21 @@ public class FormGestor extends AbstractPageBean
fillCurrentYearDrop();
Utils.fillEmpresas( dropEmpresaConc, dropEmpresaSeg );
Utils.fillEstabelecimentos( getSessionBean1().getCurrentUser().getEmpresa_id(),
dropEstabelecimentosConcluidos, dropEstabelecimentosSeguimento );
dropEmpresaConc.setSelected( getSessionBean1().getCurrentUser().getEmpresa_id() );
dropEmpresaSeg.setSelected( getSessionBean1().getCurrentUser().getEmpresa_id() );
if( !siprp )
{
dropEmpresaSeg.setSelected( getSessionBean1().getCurrentUser().getEmpresa_id() );
dropEmpresaConc.setSelected( getSessionBean1().getCurrentUser().getEmpresa_id() );
Utils.fillEstabelecimentos( getSessionBean1().getCurrentUser().getEmpresa_id(),
dropEstabelecimentosConcluidos, dropEstabelecimentosSeguimento );
}
else
{
dropEmpresaSeg.setSelected( Global.AUCHAN );
dropEmpresaConc.setSelected( Global.AUCHAN );
Utils.fillEstabelecimentos( Global.AUCHAN, dropEstabelecimentosConcluidos,
dropEstabelecimentosSeguimento );
}
fillInitialForm();
fillAnoDropDown();

@ -1524,12 +1524,23 @@ public class FormHS extends AbstractPageBean
fillCurrentYearDrop();
Utils.fillEmpresas( dropEmpresaConc, dropEmpresasActuais, dropEmpresaSeg );
Utils.fillEstabelecimentos( getSessionBean1().getCurrentUser().getEmpresa_id(),
dropEstabelecimentosConcluidos, dropEstabelecimentosActuais, dropEstabelecimentosSeguimento );
dropEmpresaConc.setSelected( getSessionBean1().getCurrentUser().getEmpresa_id() );
dropEmpresasActuais.setSelected( getSessionBean1().getCurrentUser().getEmpresa_id() );
dropEmpresaSeg.setSelected( getSessionBean1().getCurrentUser().getEmpresa_id() );
if( !siprp )
{
dropEmpresasActuais.setSelected( getSessionBean1().getCurrentUser().getEmpresa_id() );
dropEmpresaSeg.setSelected( getSessionBean1().getCurrentUser().getEmpresa_id() );
dropEmpresaConc.setSelected( getSessionBean1().getCurrentUser().getEmpresa_id() );
Utils.fillEstabelecimentos( getSessionBean1().getCurrentUser().getEmpresa_id(),
dropEstabelecimentosConcluidos, dropEstabelecimentosActuais, dropEstabelecimentosSeguimento );
}
else
{
dropEmpresasActuais.setSelected( Global.AUCHAN );
dropEmpresaSeg.setSelected( Global.AUCHAN );
dropEmpresaConc.setSelected( Global.AUCHAN );
Utils.fillEstabelecimentos( Global.AUCHAN,
dropEstabelecimentosConcluidos, dropEstabelecimentosActuais, dropEstabelecimentosSeguimento );
}
fillInitialForm();
fillAnoDropDown();

@ -329,13 +329,12 @@ public class EstatisticasDataProvider extends GenericDataProvider
Virtual2DArray array = getLocalExecuter().executeQuery( query );
if ( array != null )
{
options = new Option[ array.rowCount() + 1 ];
options[ 0 ] = new Option( "", "" );
options = new Option[ array.rowCount() ];
for ( int i = 0; i < array.rowCount(); i++ )
{
Integer empresaID = array.get( i, 0 );
String empresaNome = array.get( i, 1 );
options[ ( i + 1 ) ] = new Option( empresaID, empresaNome );
options[i] = new Option( empresaID, empresaNome );
}
}
return options;

@ -58,8 +58,7 @@ public class Global
public final static int TIPO_UTILIZADOR_DIRECTOR_LOJA = 9;
public final static int TIPO_UTILIZADOR_DIRECTOR_NACIONAL_SEGURANCA = 10;
public final static int AUCHAN = 32;
public final static int AUCHAN = 32;
public final static String ENDERECO_ENVIO = "acidentes.auchan@siprp.pt";
//public final static String ENDERECO_ENVIO = "lluis@evolute.pt"; //testes

@ -565,25 +565,6 @@ public class Utils {
return opts;
}
public static void fillEstabelecimentos( DropDown ... drops )
{
try
{
Option[] estabelecimentos = EstatisticasDataProvider.getInstance().getEstabelecimentos( null );
if ( estabelecimentos != null )
{
for ( DropDown drop : drops )
{
drop.setItems( estabelecimentos );
}
}
}
catch ( Exception e )
{
ErrorLogger.logException( e );
}
}
public static void fillEstabelecimentos( Integer empresaId, DropDown ... drops )
{
try

Loading…
Cancel
Save