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

lxbfYeaa
Carlos Roque 11 years ago
parent 01fa7a5e37
commit 40fcb1e852

@ -1306,11 +1306,21 @@ public class FormDirGerRh extends AbstractPageBean
fillCurrentYearDrop(); fillCurrentYearDrop();
Utils.fillEmpresas( dropEmpresaConc, dropEmpresaSeg ); Utils.fillEmpresas( dropEmpresaConc, dropEmpresaSeg );
Utils.fillEstabelecimentos( getSessionBean1().getCurrentUser().getEmpresa_id(),
dropEstabelecimentosConcluidos, dropEstabelecimentosSeguimento );
dropEmpresaConc.setSelected( getSessionBean1().getCurrentUser().getEmpresa_id() ); if( !siprp )
{
dropEmpresaSeg.setSelected( getSessionBean1().getCurrentUser().getEmpresa_id() ); 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(); fillInitialForm();

@ -1231,11 +1231,21 @@ public class FormDirSiprp extends AbstractPageBean
fillCurrentYearDrop(); fillCurrentYearDrop();
Utils.fillEmpresas( dropEmpresaConc, dropEmpresaSeg ); Utils.fillEmpresas( dropEmpresaConc, dropEmpresaSeg );
Utils.fillEstabelecimentos( getSessionBean1().getCurrentUser().getEmpresa_id(),
dropEstabelecimentosConcluidos, dropEstabelecimentosSeguimento );
dropEmpresaConc.setSelected( getSessionBean1().getCurrentUser().getEmpresa_id() ); if( !siprp )
{
dropEmpresaSeg.setSelected( getSessionBean1().getCurrentUser().getEmpresa_id() ); 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(); fillInitialForm();

@ -1259,11 +1259,21 @@ public class FormGestor extends AbstractPageBean
fillCurrentYearDrop(); fillCurrentYearDrop();
Utils.fillEmpresas( dropEmpresaConc, dropEmpresaSeg ); Utils.fillEmpresas( dropEmpresaConc, dropEmpresaSeg );
Utils.fillEstabelecimentos( getSessionBean1().getCurrentUser().getEmpresa_id(),
dropEstabelecimentosConcluidos, dropEstabelecimentosSeguimento );
dropEmpresaConc.setSelected( getSessionBean1().getCurrentUser().getEmpresa_id() ); if( !siprp )
{
dropEmpresaSeg.setSelected( getSessionBean1().getCurrentUser().getEmpresa_id() ); 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(); fillInitialForm();
fillAnoDropDown(); fillAnoDropDown();

@ -1524,12 +1524,23 @@ public class FormHS extends AbstractPageBean
fillCurrentYearDrop(); fillCurrentYearDrop();
Utils.fillEmpresas( dropEmpresaConc, dropEmpresasActuais, dropEmpresaSeg ); Utils.fillEmpresas( dropEmpresaConc, dropEmpresasActuais, dropEmpresaSeg );
Utils.fillEstabelecimentos( getSessionBean1().getCurrentUser().getEmpresa_id(),
dropEstabelecimentosConcluidos, dropEstabelecimentosActuais, dropEstabelecimentosSeguimento );
dropEmpresaConc.setSelected( getSessionBean1().getCurrentUser().getEmpresa_id() ); if( !siprp )
{
dropEmpresasActuais.setSelected( getSessionBean1().getCurrentUser().getEmpresa_id() ); dropEmpresasActuais.setSelected( getSessionBean1().getCurrentUser().getEmpresa_id() );
dropEmpresaSeg.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(); fillInitialForm();
fillAnoDropDown(); fillAnoDropDown();

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

@ -60,7 +60,6 @@ public class Global
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 = "acidentes.auchan@siprp.pt";
//public final static String ENDERECO_ENVIO = "lluis@evolute.pt"; //testes //public final static String ENDERECO_ENVIO = "lluis@evolute.pt"; //testes

@ -565,25 +565,6 @@ public class Utils {
return opts; 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 ) public static void fillEstabelecimentos( Integer empresaId, DropDown ... drops )
{ {
try try

Loading…
Cancel
Save