forked from Coded/SIPRP
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1772 lines
38 KiB
1772 lines
38 KiB
/*
|
|
* FormDirSiprp.java
|
|
*
|
|
* Created on November 21, 2007, 1:25 PM
|
|
* Copyright lluis2
|
|
*/
|
|
package analiseacidentestrabalho;
|
|
|
|
import beans.Utilizador;
|
|
import beans.AnaliseAcidente;
|
|
import com.evolute.utils.error.ErrorLogger;
|
|
import com.sun.data.provider.RowKey;
|
|
import com.sun.rave.web.ui.appbase.AbstractPageBean;
|
|
import com.sun.rave.web.ui.component.Body;
|
|
import com.sun.rave.web.ui.component.Button;
|
|
import com.sun.rave.web.ui.component.DropDown;
|
|
import com.sun.rave.web.ui.component.Form;
|
|
import com.sun.rave.web.ui.component.Head;
|
|
import com.sun.rave.web.ui.component.Html;
|
|
import com.sun.rave.web.ui.component.Hyperlink;
|
|
import com.sun.rave.web.ui.component.ImageComponent;
|
|
import com.sun.rave.web.ui.component.Link;
|
|
import com.sun.rave.web.ui.component.Page;
|
|
import com.sun.rave.web.ui.component.PanelGroup;
|
|
import com.sun.rave.web.ui.component.StaticText;
|
|
import com.sun.rave.web.ui.component.Table;
|
|
import com.sun.rave.web.ui.component.TableColumn;
|
|
import com.sun.rave.web.ui.component.TableRowGroup;
|
|
import com.sun.rave.web.ui.component.TextField;
|
|
import com.sun.rave.web.ui.model.Option;
|
|
import db.providers.AnalisesConcluidasDataProvider;
|
|
import db.providers.AnalisesDataProvider;
|
|
import db.providers.AnalisesSeguimentoDataProvider;
|
|
import global.Global;
|
|
import java.text.DateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
import java.util.ArrayList;
|
|
import java.util.Calendar;
|
|
import java.util.Date;
|
|
import java.util.GregorianCalendar;
|
|
import java.util.ListIterator;
|
|
import javax.faces.FacesException;
|
|
import javax.faces.component.html.HtmlPanelGrid;
|
|
import javax.faces.context.FacesContext;
|
|
import javax.faces.event.ValueChangeEvent;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import utils.Utils;
|
|
|
|
/**
|
|
* <p>Page bean that corresponds to a similarly named JSP page. This
|
|
* class contains component definitions (and initialization code) for
|
|
* all components that you have defined on this page, as well as
|
|
* lifecycle methods and event handlers where you may add behavior
|
|
* to respond to incoming events.</p>
|
|
*/
|
|
public class FormDirSiprp extends AbstractPageBean
|
|
{
|
|
// <editor-fold defaultstate="collapsed" desc="Managed Component Definition">
|
|
|
|
private int __placeholder;
|
|
|
|
/**
|
|
* <p>Automatically managed component initialization. <strong>WARNING:</strong>
|
|
* This method is automatically generated, so any user-specified code inserted
|
|
* here is subject to being replaced.</p>
|
|
*/
|
|
private void _init() throws Exception
|
|
{
|
|
}
|
|
private Page page1 = new Page();
|
|
|
|
public Page getPage1()
|
|
{
|
|
return page1;
|
|
}
|
|
|
|
public void setPage1( Page p )
|
|
{
|
|
this.page1 = p;
|
|
}
|
|
private Html html1 = new Html();
|
|
|
|
public Html getHtml1()
|
|
{
|
|
return html1;
|
|
}
|
|
|
|
public void setHtml1( Html h )
|
|
{
|
|
this.html1 = h;
|
|
}
|
|
private Head head1 = new Head();
|
|
|
|
public Head getHead1()
|
|
{
|
|
return head1;
|
|
}
|
|
|
|
public void setHead1( Head h )
|
|
{
|
|
this.head1 = h;
|
|
}
|
|
private Link link1 = new Link();
|
|
|
|
public Link getLink1()
|
|
{
|
|
return link1;
|
|
}
|
|
|
|
public void setLink1( Link l )
|
|
{
|
|
this.link1 = l;
|
|
}
|
|
private Body body1 = new Body();
|
|
|
|
public Body getBody1()
|
|
{
|
|
return body1;
|
|
}
|
|
|
|
public void setBody1( Body b )
|
|
{
|
|
this.body1 = b;
|
|
}
|
|
private Form form1 = new Form();
|
|
|
|
public Form getForm1()
|
|
{
|
|
return form1;
|
|
}
|
|
|
|
public void setForm1( Form f )
|
|
{
|
|
this.form1 = f;
|
|
}
|
|
private HtmlPanelGrid gridBase1 = new HtmlPanelGrid();
|
|
|
|
public HtmlPanelGrid getGridBase1()
|
|
{
|
|
return gridBase1;
|
|
}
|
|
|
|
public void setGridBase1( HtmlPanelGrid hpg )
|
|
{
|
|
this.gridBase1 = hpg;
|
|
}
|
|
private HtmlPanelGrid gridLayout1 = new HtmlPanelGrid();
|
|
|
|
public HtmlPanelGrid getGridLayout1()
|
|
{
|
|
return gridLayout1;
|
|
}
|
|
|
|
public void setGridLayout1( HtmlPanelGrid hpg )
|
|
{
|
|
this.gridLayout1 = hpg;
|
|
}
|
|
private HtmlPanelGrid gridPanel1 = new HtmlPanelGrid();
|
|
|
|
public HtmlPanelGrid getGridPanel1()
|
|
{
|
|
return gridPanel1;
|
|
}
|
|
|
|
public void setGridPanel1( HtmlPanelGrid hpg )
|
|
{
|
|
this.gridPanel1 = hpg;
|
|
}
|
|
private PanelGroup groupPanel1 = new PanelGroup();
|
|
|
|
public PanelGroup getGroupPanel1()
|
|
{
|
|
return groupPanel1;
|
|
}
|
|
|
|
public void setGroupPanel1( PanelGroup pg )
|
|
{
|
|
this.groupPanel1 = pg;
|
|
}
|
|
private ImageComponent image1 = new ImageComponent();
|
|
|
|
public ImageComponent getImage1()
|
|
{
|
|
return image1;
|
|
}
|
|
|
|
public void setImage1( ImageComponent ic )
|
|
{
|
|
this.image1 = ic;
|
|
}
|
|
private ImageComponent image2 = new ImageComponent();
|
|
|
|
public ImageComponent getImage2()
|
|
{
|
|
return image2;
|
|
}
|
|
|
|
public void setImage2( ImageComponent ic )
|
|
{
|
|
this.image2 = ic;
|
|
}
|
|
private HtmlPanelGrid gridLayoutTop1 = new HtmlPanelGrid();
|
|
|
|
public HtmlPanelGrid getGridLayoutTop1()
|
|
{
|
|
return gridLayoutTop1;
|
|
}
|
|
|
|
public void setGridLayoutTop1( HtmlPanelGrid hpg )
|
|
{
|
|
this.gridLayoutTop1 = hpg;
|
|
}
|
|
private HtmlPanelGrid gridSeguimento1 = new HtmlPanelGrid();
|
|
|
|
public HtmlPanelGrid getGridSeguimento1()
|
|
{
|
|
return gridSeguimento1;
|
|
}
|
|
|
|
public void setGridSeguimento1( HtmlPanelGrid hpg )
|
|
{
|
|
this.gridSeguimento1 = hpg;
|
|
}
|
|
private HtmlPanelGrid gridPanel4 = new HtmlPanelGrid();
|
|
|
|
public HtmlPanelGrid getGridPanel4()
|
|
{
|
|
return gridPanel4;
|
|
}
|
|
|
|
public void setGridPanel4( HtmlPanelGrid hpg )
|
|
{
|
|
this.gridPanel4 = hpg;
|
|
}
|
|
private StaticText staticText4 = new StaticText();
|
|
|
|
public StaticText getStaticText4()
|
|
{
|
|
return staticText4;
|
|
}
|
|
|
|
public void setStaticText4( StaticText st )
|
|
{
|
|
this.staticText4 = st;
|
|
}
|
|
private HtmlPanelGrid gridPanel5 = new HtmlPanelGrid();
|
|
|
|
public HtmlPanelGrid getGridPanel5()
|
|
{
|
|
return gridPanel5;
|
|
}
|
|
|
|
public void setGridPanel5( HtmlPanelGrid hpg )
|
|
{
|
|
this.gridPanel5 = hpg;
|
|
}
|
|
private Table table2 = new Table();
|
|
|
|
public Table getTable2()
|
|
{
|
|
return table2;
|
|
}
|
|
|
|
public void setTable2( Table t )
|
|
{
|
|
this.table2 = t;
|
|
}
|
|
private TableRowGroup tableRowGroup2 = new TableRowGroup();
|
|
|
|
public TableRowGroup getTableRowGroup2()
|
|
{
|
|
return tableRowGroup2;
|
|
}
|
|
|
|
public void setTableRowGroup2( TableRowGroup trg )
|
|
{
|
|
this.tableRowGroup2 = trg;
|
|
}
|
|
private TableColumn tableColumn6 = new TableColumn();
|
|
|
|
public TableColumn getTableColumn6()
|
|
{
|
|
return tableColumn6;
|
|
}
|
|
|
|
public void setTableColumn6( TableColumn tc )
|
|
{
|
|
this.tableColumn6 = tc;
|
|
}
|
|
private Hyperlink lnkDataAcidenteSeg = new Hyperlink();
|
|
|
|
public Hyperlink getLnkDataAcidenteSeg()
|
|
{
|
|
return lnkDataAcidenteSeg;
|
|
}
|
|
|
|
public void setLnkDataAcidenteSeg( Hyperlink h )
|
|
{
|
|
this.lnkDataAcidenteSeg = h;
|
|
}
|
|
private TableColumn tableColumn7 = new TableColumn();
|
|
|
|
public TableColumn getTableColumn7()
|
|
{
|
|
return tableColumn7;
|
|
}
|
|
|
|
public void setTableColumn7( TableColumn tc )
|
|
{
|
|
this.tableColumn7 = tc;
|
|
}
|
|
private Hyperlink lnkNrSeg = new Hyperlink();
|
|
|
|
public Hyperlink getLnkNrSeg()
|
|
{
|
|
return lnkNrSeg;
|
|
}
|
|
|
|
public void setLnkNrSeg( Hyperlink h )
|
|
{
|
|
this.lnkNrSeg = h;
|
|
}
|
|
private TableColumn tableColumn8 = new TableColumn();
|
|
|
|
public TableColumn getTableColumn8()
|
|
{
|
|
return tableColumn8;
|
|
}
|
|
|
|
public void setTableColumn8( TableColumn tc )
|
|
{
|
|
this.tableColumn8 = tc;
|
|
}
|
|
private Hyperlink lnkPorSeg = new Hyperlink();
|
|
|
|
public Hyperlink getLnkPorSeg()
|
|
{
|
|
return lnkPorSeg;
|
|
}
|
|
|
|
public void setLnkPorSeg( Hyperlink h )
|
|
{
|
|
this.lnkPorSeg = h;
|
|
}
|
|
private TableColumn tableColumn9 = new TableColumn();
|
|
|
|
public TableColumn getTableColumn9()
|
|
{
|
|
return tableColumn9;
|
|
}
|
|
|
|
public void setTableColumn9( TableColumn tc )
|
|
{
|
|
this.tableColumn9 = tc;
|
|
}
|
|
private Hyperlink lnkNomeAcidentadoSeg = new Hyperlink();
|
|
|
|
public Hyperlink getLnkNomeAcidentadoSeg()
|
|
{
|
|
return lnkNomeAcidentadoSeg;
|
|
}
|
|
|
|
public void setLnkNomeAcidentadoSeg( Hyperlink h )
|
|
{
|
|
this.lnkNomeAcidentadoSeg = h;
|
|
}
|
|
private TableColumn tableColumn10 = new TableColumn();
|
|
|
|
public TableColumn getTableColumn10()
|
|
{
|
|
return tableColumn10;
|
|
}
|
|
|
|
public void setTableColumn10( TableColumn tc )
|
|
{
|
|
this.tableColumn10 = tc;
|
|
}
|
|
private Hyperlink lnkFaseSeg = new Hyperlink();
|
|
|
|
public Hyperlink getLnkFaseSeg()
|
|
{
|
|
return lnkFaseSeg;
|
|
}
|
|
|
|
public void setLnkFaseSeg( Hyperlink h )
|
|
{
|
|
this.lnkFaseSeg = h;
|
|
}
|
|
private HtmlPanelGrid gridConcluidos1 = new HtmlPanelGrid();
|
|
|
|
public HtmlPanelGrid getGridConcluidos1()
|
|
{
|
|
return gridConcluidos1;
|
|
}
|
|
|
|
public void setGridConcluidos1( HtmlPanelGrid hpg )
|
|
{
|
|
this.gridConcluidos1 = hpg;
|
|
}
|
|
private HtmlPanelGrid gridPanel6 = new HtmlPanelGrid();
|
|
|
|
public HtmlPanelGrid getGridPanel6()
|
|
{
|
|
return gridPanel6;
|
|
}
|
|
|
|
public void setGridPanel6( HtmlPanelGrid hpg )
|
|
{
|
|
this.gridPanel6 = hpg;
|
|
}
|
|
private StaticText staticText5 = new StaticText();
|
|
|
|
public StaticText getStaticText5()
|
|
{
|
|
return staticText5;
|
|
}
|
|
|
|
public void setStaticText5( StaticText st )
|
|
{
|
|
this.staticText5 = st;
|
|
}
|
|
private HtmlPanelGrid gridPanel7 = new HtmlPanelGrid();
|
|
|
|
public HtmlPanelGrid getGridPanel7()
|
|
{
|
|
return gridPanel7;
|
|
}
|
|
|
|
public void setGridPanel7( HtmlPanelGrid hpg )
|
|
{
|
|
this.gridPanel7 = hpg;
|
|
}
|
|
private PanelGroup groupPanel3 = new PanelGroup();
|
|
|
|
public PanelGroup getGroupPanel3()
|
|
{
|
|
return groupPanel3;
|
|
}
|
|
|
|
public void setGroupPanel3( PanelGroup pg )
|
|
{
|
|
this.groupPanel3 = pg;
|
|
}
|
|
private StaticText staticText6 = new StaticText();
|
|
|
|
public StaticText getStaticText6()
|
|
{
|
|
return staticText6;
|
|
}
|
|
|
|
public void setStaticText6( StaticText st )
|
|
{
|
|
this.staticText6 = st;
|
|
}
|
|
private DropDown drpAno = new DropDown();
|
|
|
|
public DropDown getDrpAno()
|
|
{
|
|
return drpAno;
|
|
}
|
|
|
|
public void setDrpAno( DropDown dd )
|
|
{
|
|
this.drpAno = dd;
|
|
}
|
|
private PanelGroup groupPanel4 = new PanelGroup();
|
|
|
|
public PanelGroup getGroupPanel4()
|
|
{
|
|
return groupPanel4;
|
|
}
|
|
|
|
public void setGroupPanel4( PanelGroup pg )
|
|
{
|
|
this.groupPanel4 = pg;
|
|
}
|
|
private StaticText lblMes = new StaticText();
|
|
|
|
public StaticText getLblMes()
|
|
{
|
|
return lblMes;
|
|
}
|
|
|
|
public void setLblMes( StaticText st )
|
|
{
|
|
this.lblMes = st;
|
|
}
|
|
private DropDown drpMes = new DropDown();
|
|
|
|
public DropDown getDrpMes()
|
|
{
|
|
return drpMes;
|
|
}
|
|
|
|
public void setDrpMes( DropDown dd )
|
|
{
|
|
this.drpMes = dd;
|
|
}
|
|
private PanelGroup groupPanel5 = new PanelGroup();
|
|
|
|
public PanelGroup getGroupPanel5()
|
|
{
|
|
return groupPanel5;
|
|
}
|
|
|
|
public void setGroupPanel5( PanelGroup pg )
|
|
{
|
|
this.groupPanel5 = pg;
|
|
}
|
|
private StaticText lblDia = new StaticText();
|
|
|
|
public StaticText getLblDia()
|
|
{
|
|
return lblDia;
|
|
}
|
|
|
|
public void setLblDia( StaticText st )
|
|
{
|
|
this.lblDia = st;
|
|
}
|
|
private DropDown drpDia = new DropDown();
|
|
|
|
public DropDown getDrpDia()
|
|
{
|
|
return drpDia;
|
|
}
|
|
|
|
public void setDrpDia( DropDown dd )
|
|
{
|
|
this.drpDia = dd;
|
|
}
|
|
private PanelGroup groupPanel6 = new PanelGroup();
|
|
|
|
public PanelGroup getGroupPanel6()
|
|
{
|
|
return groupPanel6;
|
|
}
|
|
|
|
public void setGroupPanel6( PanelGroup pg )
|
|
{
|
|
this.groupPanel6 = pg;
|
|
}
|
|
private StaticText staticText7 = new StaticText();
|
|
|
|
public StaticText getStaticText7()
|
|
{
|
|
return staticText7;
|
|
}
|
|
|
|
public void setStaticText7( StaticText st )
|
|
{
|
|
this.staticText7 = st;
|
|
}
|
|
private TextField txtPor = new TextField();
|
|
|
|
public TextField getTxtPor()
|
|
{
|
|
return txtPor;
|
|
}
|
|
|
|
public void setTxtPor( TextField tf )
|
|
{
|
|
this.txtPor = tf;
|
|
}
|
|
private PanelGroup groupPanel7 = new PanelGroup();
|
|
|
|
public PanelGroup getGroupPanel7()
|
|
{
|
|
return groupPanel7;
|
|
}
|
|
|
|
public void setGroupPanel7( PanelGroup pg )
|
|
{
|
|
this.groupPanel7 = pg;
|
|
}
|
|
private StaticText staticText8 = new StaticText();
|
|
|
|
public StaticText getStaticText8()
|
|
{
|
|
return staticText8;
|
|
}
|
|
|
|
public void setStaticText8( StaticText st )
|
|
{
|
|
this.staticText8 = st;
|
|
}
|
|
private TextField txtNome = new TextField();
|
|
|
|
public TextField getTxtNome()
|
|
{
|
|
return txtNome;
|
|
}
|
|
|
|
public void setTxtNome( TextField tf )
|
|
{
|
|
this.txtNome = tf;
|
|
}
|
|
private Button butPesquisar = new Button();
|
|
|
|
public Button getButPesquisar()
|
|
{
|
|
return butPesquisar;
|
|
}
|
|
|
|
public void setButPesquisar( Button b )
|
|
{
|
|
this.butPesquisar = b;
|
|
}
|
|
private HtmlPanelGrid gridPanel8 = new HtmlPanelGrid();
|
|
|
|
public HtmlPanelGrid getGridPanel8()
|
|
{
|
|
return gridPanel8;
|
|
}
|
|
|
|
public void setGridPanel8( HtmlPanelGrid hpg )
|
|
{
|
|
this.gridPanel8 = hpg;
|
|
}
|
|
private Table table3 = new Table();
|
|
|
|
public Table getTable3()
|
|
{
|
|
return table3;
|
|
}
|
|
|
|
public void setTable3( Table t )
|
|
{
|
|
this.table3 = t;
|
|
}
|
|
private TableRowGroup tableRowGroup3 = new TableRowGroup();
|
|
|
|
public TableRowGroup getTableRowGroup3()
|
|
{
|
|
return tableRowGroup3;
|
|
}
|
|
|
|
public void setTableRowGroup3( TableRowGroup trg )
|
|
{
|
|
this.tableRowGroup3 = trg;
|
|
}
|
|
private TableColumn tableColumn11 = new TableColumn();
|
|
|
|
public TableColumn getTableColumn11()
|
|
{
|
|
return tableColumn11;
|
|
}
|
|
|
|
public void setTableColumn11( TableColumn tc )
|
|
{
|
|
this.tableColumn11 = tc;
|
|
}
|
|
private Hyperlink lnkDataConcluida = new Hyperlink();
|
|
|
|
public Hyperlink getLnkDataConcluida()
|
|
{
|
|
return lnkDataConcluida;
|
|
}
|
|
|
|
public void setLnkDataConcluida( Hyperlink h )
|
|
{
|
|
this.lnkDataConcluida = h;
|
|
}
|
|
private TableColumn tableColumn12 = new TableColumn();
|
|
|
|
public TableColumn getTableColumn12()
|
|
{
|
|
return tableColumn12;
|
|
}
|
|
|
|
public void setTableColumn12( TableColumn tc )
|
|
{
|
|
this.tableColumn12 = tc;
|
|
}
|
|
private Hyperlink lnkNrConcluida = new Hyperlink();
|
|
|
|
public Hyperlink getLnkNrConcluida()
|
|
{
|
|
return lnkNrConcluida;
|
|
}
|
|
|
|
public void setLnkNrConcluida( Hyperlink h )
|
|
{
|
|
this.lnkNrConcluida = h;
|
|
}
|
|
private TableColumn tableColumn13 = new TableColumn();
|
|
|
|
public TableColumn getTableColumn13()
|
|
{
|
|
return tableColumn13;
|
|
}
|
|
|
|
public void setTableColumn13( TableColumn tc )
|
|
{
|
|
this.tableColumn13 = tc;
|
|
}
|
|
private Hyperlink lnkPorConcluida = new Hyperlink();
|
|
|
|
public Hyperlink getLnkPorConcluida()
|
|
{
|
|
return lnkPorConcluida;
|
|
}
|
|
|
|
public void setLnkPorConcluida( Hyperlink h )
|
|
{
|
|
this.lnkPorConcluida = h;
|
|
}
|
|
private TableColumn tableColumn14 = new TableColumn();
|
|
|
|
public TableColumn getTableColumn14()
|
|
{
|
|
return tableColumn14;
|
|
}
|
|
|
|
public void setTableColumn14( TableColumn tc )
|
|
{
|
|
this.tableColumn14 = tc;
|
|
}
|
|
private Hyperlink lnkNomeConcluida = new Hyperlink();
|
|
|
|
public Hyperlink getLnkNomeConcluida()
|
|
{
|
|
return lnkNomeConcluida;
|
|
}
|
|
|
|
public void setLnkNomeConcluida( Hyperlink h )
|
|
{
|
|
this.lnkNomeConcluida = h;
|
|
}
|
|
private TableColumn tableColumn15 = new TableColumn();
|
|
|
|
public TableColumn getTableColumn15()
|
|
{
|
|
return tableColumn15;
|
|
}
|
|
|
|
public void setTableColumn15( TableColumn tc )
|
|
{
|
|
this.tableColumn15 = tc;
|
|
}
|
|
private Hyperlink lnkEstabConcluida = new Hyperlink();
|
|
|
|
public Hyperlink getLnkEstabConcluida()
|
|
{
|
|
return lnkEstabConcluida;
|
|
}
|
|
|
|
public void setLnkEstabConcluida( Hyperlink h )
|
|
{
|
|
this.lnkEstabConcluida = h;
|
|
}
|
|
private StaticText txtSearchMsg = new StaticText();
|
|
|
|
public StaticText getTxtSearchMsg()
|
|
{
|
|
return txtSearchMsg;
|
|
}
|
|
|
|
public void setTxtSearchMsg( StaticText st )
|
|
{
|
|
this.txtSearchMsg = st;
|
|
}
|
|
private HtmlPanelGrid gridPanel9 = new HtmlPanelGrid();
|
|
|
|
public HtmlPanelGrid getGridPanel9()
|
|
{
|
|
return gridPanel9;
|
|
}
|
|
|
|
public void setGridPanel9( HtmlPanelGrid hpg )
|
|
{
|
|
this.gridPanel9 = hpg;
|
|
}
|
|
private PanelGroup groupPanel8 = new PanelGroup();
|
|
|
|
public PanelGroup getGroupPanel8()
|
|
{
|
|
return groupPanel8;
|
|
}
|
|
|
|
public void setGroupPanel8( PanelGroup pg )
|
|
{
|
|
this.groupPanel8 = pg;
|
|
}
|
|
private StaticText staticText9 = new StaticText();
|
|
|
|
public StaticText getStaticText9()
|
|
{
|
|
return staticText9;
|
|
}
|
|
|
|
public void setStaticText9( StaticText st )
|
|
{
|
|
this.staticText9 = st;
|
|
}
|
|
private ImageComponent image3 = new ImageComponent();
|
|
|
|
public ImageComponent getImage3()
|
|
{
|
|
return image3;
|
|
}
|
|
|
|
public void setImage3( ImageComponent ic )
|
|
{
|
|
this.image3 = ic;
|
|
}
|
|
private StaticText staticText10 = new StaticText();
|
|
|
|
public StaticText getStaticText10()
|
|
{
|
|
return staticText10;
|
|
}
|
|
|
|
public void setStaticText10( StaticText st )
|
|
{
|
|
this.staticText10 = st;
|
|
}
|
|
private HtmlPanelGrid gridPanel2 = new HtmlPanelGrid();
|
|
|
|
public HtmlPanelGrid getGridPanel2()
|
|
{
|
|
return gridPanel2;
|
|
}
|
|
|
|
public void setGridPanel2( HtmlPanelGrid hpg )
|
|
{
|
|
this.gridPanel2 = hpg;
|
|
}
|
|
private StaticText txtMsg1 = new StaticText();
|
|
|
|
public StaticText getTxtMsg1()
|
|
{
|
|
return txtMsg1;
|
|
}
|
|
|
|
public void setTxtMsg1( StaticText st )
|
|
{
|
|
this.txtMsg1 = st;
|
|
}
|
|
private TableColumn tableColumn1 = new TableColumn();
|
|
|
|
public TableColumn getTableColumn1()
|
|
{
|
|
return tableColumn1;
|
|
}
|
|
|
|
public void setTableColumn1( TableColumn tc )
|
|
{
|
|
this.tableColumn1 = tc;
|
|
}
|
|
private Hyperlink lnkDataAberturaSeg1 = new Hyperlink();
|
|
|
|
public Hyperlink getLnkDataAberturaSeg1()
|
|
{
|
|
return lnkDataAberturaSeg1;
|
|
}
|
|
|
|
public void setLnkDataAberturaSeg1( Hyperlink h )
|
|
{
|
|
this.lnkDataAberturaSeg1 = h;
|
|
}
|
|
private TableColumn tableColumn2 = new TableColumn();
|
|
|
|
public TableColumn getTableColumn2()
|
|
{
|
|
return tableColumn2;
|
|
}
|
|
|
|
public void setTableColumn2( TableColumn tc )
|
|
{
|
|
this.tableColumn2 = tc;
|
|
}
|
|
private Hyperlink lnkDataAberturaConcluida1 = new Hyperlink();
|
|
|
|
public Hyperlink getLnkDataAberturaConcluida1()
|
|
{
|
|
return lnkDataAberturaConcluida1;
|
|
}
|
|
|
|
public void setLnkDataAberturaConcluida1( Hyperlink h )
|
|
{
|
|
this.lnkDataAberturaConcluida1 = h;
|
|
}
|
|
private TableColumn tableColumn3 = new TableColumn();
|
|
|
|
public TableColumn getTableColumn3()
|
|
{
|
|
return tableColumn3;
|
|
}
|
|
|
|
public void setTableColumn3( TableColumn tc )
|
|
{
|
|
this.tableColumn3 = tc;
|
|
}
|
|
private Hyperlink lnkEstabelecimentoSeg1 = new Hyperlink();
|
|
|
|
public Hyperlink getLnkEstabelecimentoSeg1()
|
|
{
|
|
return lnkEstabelecimentoSeg1;
|
|
}
|
|
|
|
public void setLnkEstabelecimentoSeg1( Hyperlink h )
|
|
{
|
|
this.lnkEstabelecimentoSeg1 = h;
|
|
}
|
|
private Hyperlink lnkPlanosActuacao = new Hyperlink();
|
|
|
|
public Hyperlink getLnkPlanosActuacao()
|
|
{
|
|
return lnkPlanosActuacao;
|
|
}
|
|
|
|
public void setLnkPlanosActuacao( Hyperlink h )
|
|
{
|
|
this.lnkPlanosActuacao = h;
|
|
}
|
|
private StaticText lblUser = new StaticText();
|
|
|
|
public StaticText getLblUser()
|
|
{
|
|
return lblUser;
|
|
}
|
|
|
|
public void setLblUser( StaticText st )
|
|
{
|
|
this.lblUser = st;
|
|
}
|
|
|
|
|
|
public TableColumn tableColumnDesactivarAnalise = new TableColumn();
|
|
|
|
public TableColumn getTableColumnDesactivarAnalise()
|
|
{
|
|
return tableColumnDesactivarAnalise;
|
|
}
|
|
|
|
public void setTableColumnDesactivarAnalise( TableColumn tableColumnDesactivarAnalise )
|
|
{
|
|
this.tableColumnDesactivarAnalise = tableColumnDesactivarAnalise;
|
|
}
|
|
public Button buttonDesactivarAnalise = new Button();
|
|
|
|
public Button getButtonDesactivarAnalise()
|
|
{
|
|
return buttonDesactivarAnalise;
|
|
}
|
|
|
|
public void setButtonDesactivarAnalise( Button buttonDesactivarAnalise )
|
|
{
|
|
this.buttonDesactivarAnalise = buttonDesactivarAnalise;
|
|
}
|
|
|
|
|
|
public TableColumn tableColumnDesactivarAnaliseConcluidos = new TableColumn();
|
|
|
|
public TableColumn getTableColumnDesactivarAnaliseConcluidos()
|
|
{
|
|
return tableColumnDesactivarAnaliseConcluidos;
|
|
}
|
|
|
|
public void setTableColumnDesactivarAnaliseConcluidos( TableColumn tableColumnDesactivarAnaliseConcluidos )
|
|
{
|
|
this.tableColumnDesactivarAnaliseConcluidos = tableColumnDesactivarAnaliseConcluidos;
|
|
}
|
|
public Button buttonDesactivarAnaliseConcluidos = new Button();
|
|
|
|
public Button getButtonDesactivarAnaliseConcluidos()
|
|
{
|
|
return buttonDesactivarAnaliseConcluidos;
|
|
}
|
|
|
|
public void setButtonDesactivarAnaliseConcluidos( Button buttonDesactivarAnaliseConcluidos )
|
|
{
|
|
this.buttonDesactivarAnaliseConcluidos = buttonDesactivarAnaliseConcluidos;
|
|
}
|
|
|
|
|
|
|
|
// </editor-fold>
|
|
private HtmlPanelGrid gridPanelFilterSeg = new HtmlPanelGrid();
|
|
|
|
public HtmlPanelGrid getGridPanelFilterSeg()
|
|
{
|
|
return this.gridPanelFilterSeg;
|
|
}
|
|
|
|
public void setGridPanelFilterSeg( HtmlPanelGrid pg )
|
|
{
|
|
this.gridPanelFilterSeg = pg;
|
|
}
|
|
private PanelGroup groupPanelFilterSeg = new PanelGroup();
|
|
|
|
public PanelGroup getGroupPanelFilterSeg()
|
|
{
|
|
return this.groupPanelFilterSeg;
|
|
}
|
|
|
|
public void setGroupPanelFilterSeg( PanelGroup pg )
|
|
{
|
|
this.groupPanelFilterSeg = pg;
|
|
}
|
|
private StaticText labelFilterNameSeg = new StaticText();
|
|
|
|
public StaticText getLabelFilterNameSeg()
|
|
{
|
|
return this.labelFilterNameSeg;
|
|
}
|
|
|
|
public void setLabelFilterNameSeg( StaticText st )
|
|
{
|
|
this.labelFilterNameSeg = st;
|
|
}
|
|
private TextField textFilterNameSeg = new TextField();
|
|
|
|
public TextField getTextFilterNameSeg()
|
|
{
|
|
return this.textFilterNameSeg;
|
|
}
|
|
|
|
public void setTextFilterNameSeg( TextField tf )
|
|
{
|
|
this.textFilterNameSeg = tf;
|
|
}
|
|
private StaticText labelFilterEstabelecimentoSeg = new StaticText();
|
|
|
|
public StaticText getLabelFilterEstabelecimentoSeg()
|
|
{
|
|
return labelFilterEstabelecimentoSeg;
|
|
}
|
|
|
|
public void setLabelFilterEstabelecimentoSeg( StaticText labelFilterEstabelecimentoSeg )
|
|
{
|
|
this.labelFilterEstabelecimentoSeg = labelFilterEstabelecimentoSeg;
|
|
}
|
|
|
|
|
|
private DropDown dropEstabelecimentosSeguimento = new DropDown();
|
|
public DropDown getDropEstabelecimentosSeguimento()
|
|
{
|
|
return dropEstabelecimentosSeguimento;
|
|
}
|
|
public void setDropEstabelecimentosSeguimento( DropDown dropEstabelecimentos )
|
|
{
|
|
this.dropEstabelecimentosSeguimento = dropEstabelecimentos;
|
|
}
|
|
|
|
|
|
// private com.sun.rave.web.ui.component.Calendar calFilterDateSeg = new com.sun.rave.web.ui.component.Calendar();
|
|
//
|
|
// public com.sun.rave.web.ui.component.Calendar getCalFilterDateSeg()
|
|
// {
|
|
// return this.calFilterDateSeg;
|
|
// }
|
|
//
|
|
// public void setCalFilterDateSeg( com.sun.rave.web.ui.component.Calendar c )
|
|
// {
|
|
// this.calFilterDateSeg = c;
|
|
// }
|
|
|
|
private Date calFilterDateSeguimento = null;
|
|
public Date getCalFilterDateSeguimento()
|
|
{
|
|
return calFilterDateSeguimento;
|
|
}
|
|
public void setCalFilterDateSeguimento( Date calFilterDateSeguimento )
|
|
{
|
|
this.calFilterDateSeguimento = calFilterDateSeguimento;
|
|
}
|
|
|
|
|
|
|
|
|
|
private TextField textFilterPORSeg = new TextField();
|
|
|
|
public TextField getTextFilterPORSeg()
|
|
{
|
|
return textFilterPORSeg;
|
|
}
|
|
|
|
public void setTextFilterPORSeg( TextField textFilterPORSeg )
|
|
{
|
|
this.textFilterPORSeg = textFilterPORSeg;
|
|
}
|
|
private Button buttonFilterSeg = new Button();
|
|
|
|
public Button getButtonFilterSeg()
|
|
{
|
|
return this.buttonFilterSeg;
|
|
}
|
|
|
|
public void setButtonFilterSeg( Button b )
|
|
{
|
|
this.buttonFilterSeg = b;
|
|
}
|
|
|
|
|
|
private DropDown dropEstabelecimentosConcluidos = new DropDown();
|
|
public DropDown getDropEstabelecimentosConcluidos()
|
|
{
|
|
return dropEstabelecimentosConcluidos;
|
|
}
|
|
public void setDropEstabelecimentosConcluidos( DropDown dropEstabelecimentos )
|
|
{
|
|
this.dropEstabelecimentosConcluidos = dropEstabelecimentos;
|
|
}
|
|
|
|
// private TextField textFilterEstabelecimentoConc = new TextField();
|
|
// public TextField getTextFilterEstabelecimentoConc()
|
|
// {
|
|
// return textFilterEstabelecimentoConc;
|
|
// }
|
|
// public void setTextFilterEstabelecimentoConc( TextField textFilterEstabelecimentoConc )
|
|
// {
|
|
// this.textFilterEstabelecimentoConc = textFilterEstabelecimentoConc;
|
|
// }
|
|
|
|
|
|
private DropDown dropCurrentYear = new DropDown();
|
|
|
|
public DropDown getDropCurrentYear()
|
|
{
|
|
return dropCurrentYear;
|
|
}
|
|
|
|
public void setDropCurrentYear( DropDown dropCurrentYear )
|
|
{
|
|
this.dropCurrentYear = dropCurrentYear;
|
|
}
|
|
private static final DateFormat D_F = new SimpleDateFormat( "yyyy-MM-dd" );
|
|
|
|
public FormDirSiprp()
|
|
{
|
|
}
|
|
|
|
@Override
|
|
public void init()
|
|
{
|
|
super.init();
|
|
|
|
try
|
|
{
|
|
_init();
|
|
}
|
|
catch ( Exception e )
|
|
{
|
|
log( "FormDirSiprp Initialization Failure", e );
|
|
throw e instanceof FacesException ? ( FacesException ) e : new FacesException( e );
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void preprocess()
|
|
{
|
|
txtMsg1.setText( getSessionBean1().getMsg() );
|
|
getSessionBean1().setMsg( "" );
|
|
}
|
|
|
|
private void fillInitialForm()
|
|
{
|
|
Integer fromYear = getSelectedYear();
|
|
|
|
try
|
|
{
|
|
AnalisesDataProvider adp = AnalisesDataProvider.getInstance();
|
|
table2.setRendered( true );
|
|
|
|
ArrayList seguimentoList = adp.getAnalisesSeguimentoDirSiprpList( fromYear );
|
|
getSessionBean1().getAnalisesSeguimentoDataProvider().setList( seguimentoList );
|
|
}
|
|
catch ( Exception ex )
|
|
{
|
|
table2.setRendered( false );
|
|
ErrorLogger.logException( ex );
|
|
}
|
|
|
|
try
|
|
{
|
|
AnalisesDataProvider adp = AnalisesDataProvider.getInstance();
|
|
table3.setRendered( true );
|
|
|
|
ArrayList concluidasList = adp.getAnalisesConcluidasList( null, fromYear );
|
|
getSessionBean1().getAnalisesConcluidasDataProvider().setList( concluidasList );
|
|
}
|
|
catch ( Exception ex )
|
|
{
|
|
table3.setRendered( false );
|
|
ErrorLogger.logException( ex );
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void prerender()
|
|
{
|
|
System.out.println( "=== FORM_DIR_SIPRP ===" );
|
|
|
|
Utilizador currentUser = getSessionBean1().getCurrentUser();
|
|
lblUser.setText( currentUser == null ? "" : currentUser.getLogin() );
|
|
|
|
HttpServletRequest request = ( HttpServletRequest ) getExternalContext().getRequest();
|
|
String referer = request.getRequestURI();
|
|
String pageFrom = Utils.getPageFrom( referer );
|
|
|
|
if ( (!pageFrom.matches( "FormDirSiprp.jsp" )) || getSessionBean1().isFromAnaliseDeletion()
|
|
|| dropCurrentYear.getItems() == null )
|
|
{
|
|
fillCurrentYearDrop();
|
|
Utils.fillEstabelecimentos( dropEstabelecimentosSeguimento, dropEstabelecimentosConcluidos );
|
|
fillInitialForm();
|
|
|
|
fillAnoDropDown();
|
|
}
|
|
//Column para desactivar plano - mostra se o utilizador for DIRECTOR SIPRP
|
|
int uType = currentUser == null ? -1 : currentUser.getTipo().intValue();
|
|
boolean renderOrNot = uType == Global.TIPO_UTILIZADOR_DIRECTOR_SIPRP;
|
|
|
|
tableColumnDesactivarAnalise.setRendered( renderOrNot );
|
|
buttonDesactivarAnalise.setRendered( renderOrNot );
|
|
tableColumnDesactivarAnaliseConcluidos.setRendered( renderOrNot );
|
|
// buttonDesactivarAnaliseConcluidos.setRendered( renderOrNot );
|
|
}
|
|
|
|
@Override
|
|
public void destroy()
|
|
{
|
|
}
|
|
|
|
/**
|
|
* <p>Return a reference to the scoped data bean.</p>
|
|
*/
|
|
protected ApplicationBean1 getApplicationBean1()
|
|
{
|
|
return ( ApplicationBean1 ) getBean( "ApplicationBean1" );
|
|
}
|
|
|
|
/**
|
|
* <p>Return a reference to the scoped data bean.</p>
|
|
*/
|
|
protected RequestBean1 getRequestBean1()
|
|
{
|
|
return ( RequestBean1 ) getBean( "RequestBean1" );
|
|
}
|
|
|
|
/**
|
|
* <p>Return a reference to the scoped data bean.</p>
|
|
*/
|
|
protected SessionBean1 getSessionBean1()
|
|
{
|
|
return ( SessionBean1 ) getBean( "SessionBean1" );
|
|
}
|
|
|
|
public String lnkEditUser_action()
|
|
{
|
|
getSessionBean1().setNavFrom( "FormDirSiprp" );
|
|
getSessionBean1().setModoEdicaoUtilizador( "edit" );
|
|
return "user";
|
|
}
|
|
|
|
public String lnkLogout_action()
|
|
{
|
|
Utils.doLogout( getExternalContext(), true );
|
|
return null;
|
|
}
|
|
|
|
public String lnkDataAcidente_action()
|
|
{
|
|
return null;
|
|
}
|
|
|
|
public String lnkNr_action()
|
|
{
|
|
return null;
|
|
}
|
|
|
|
public String lnkPor_action()
|
|
{
|
|
return null;
|
|
}
|
|
|
|
public String lnkNomeAcidentado_action()
|
|
{
|
|
return null;
|
|
}
|
|
|
|
public String lnkFase_action()
|
|
{
|
|
return null;
|
|
}
|
|
|
|
public String lnkDataAcidenteSeg_action()
|
|
{
|
|
AnaliseAcidente a = getTableSeguimentoRowData();
|
|
getSessionBean1().setCurrentAnalise( a );
|
|
getSessionBean1().setNavFrom( "FormDirSiprp" );
|
|
return "view_analise";
|
|
}
|
|
|
|
public String lnkDataAberturaSeg_action()
|
|
{
|
|
AnaliseAcidente a = getTableSeguimentoRowData();
|
|
getSessionBean1().setCurrentAnalise( a );
|
|
getSessionBean1().setNavFrom( "FormDirSiprp" );
|
|
return "view_analise";
|
|
}
|
|
|
|
public String lnkNrSeg_action()
|
|
{
|
|
AnaliseAcidente a = getTableSeguimentoRowData();
|
|
getSessionBean1().setCurrentAnalise( a );
|
|
getSessionBean1().setNavFrom( "FormDirSiprp" );
|
|
return "view_analise";
|
|
}
|
|
|
|
public String lnkPorSeg_action()
|
|
{
|
|
AnaliseAcidente a = getTableSeguimentoRowData();
|
|
getSessionBean1().setCurrentAnalise( a );
|
|
getSessionBean1().setNavFrom( "FormDirSiprp" );
|
|
return "view_analise";
|
|
}
|
|
|
|
public String lnkNomeAcidentadoSeg_action()
|
|
{
|
|
AnaliseAcidente a = getTableSeguimentoRowData();
|
|
getSessionBean1().setCurrentAnalise( a );
|
|
getSessionBean1().setNavFrom( "FormDirSiprp" );
|
|
return "view_analise";
|
|
}
|
|
|
|
public String lnkFaseSeg_action()
|
|
{
|
|
AnaliseAcidente a = getTableSeguimentoRowData();
|
|
getSessionBean1().setCurrentAnalise( a );
|
|
getSessionBean1().setNavFrom( "FormDirSiprp" );
|
|
return "view_analise";
|
|
}
|
|
|
|
public String lnkEstabelecimentoSeg_action()
|
|
{
|
|
AnaliseAcidente a = getTableSeguimentoRowData();
|
|
getSessionBean1().setCurrentAnalise( a );
|
|
getSessionBean1().setNavFrom( "FormDirSiprp" );
|
|
return "view_analise";
|
|
}
|
|
|
|
private AnaliseAcidente getTableSeguimentoRowData()
|
|
{
|
|
RowKey rk = tableRowGroup2.getRowKey();
|
|
int k = Integer.parseInt( rk.getRowId() );
|
|
AnalisesSeguimentoDataProvider provider = ( AnalisesSeguimentoDataProvider ) tableRowGroup2.getSourceData();
|
|
ArrayList list = ( ArrayList ) provider.getList();
|
|
AnaliseAcidente a = ( AnaliseAcidente ) list.get( k );
|
|
return a;
|
|
}
|
|
|
|
public void drpAno_processValueChange( ValueChangeEvent event )
|
|
{
|
|
Object ano = event.getNewValue();
|
|
if ( ano == null )
|
|
{
|
|
lblMes.setVisible( false );
|
|
drpMes.setVisible( false );
|
|
lblDia.setVisible( false );
|
|
drpDia.setVisible( false );
|
|
}
|
|
else
|
|
{
|
|
lblMes.setVisible( true );
|
|
drpMes.setVisible( true );
|
|
fillMesDropDown();
|
|
}
|
|
}
|
|
|
|
public void drpMes_processValueChange( ValueChangeEvent event )
|
|
{
|
|
Object mes = event.getNewValue();
|
|
if ( mes == null )
|
|
{
|
|
lblDia.setVisible( false );
|
|
drpDia.setVisible( false );
|
|
}
|
|
else
|
|
{
|
|
lblDia.setVisible( true );
|
|
drpDia.setVisible( true );
|
|
//fillDiaDropDown();
|
|
}
|
|
}
|
|
|
|
public void drpDia_processValueChange( ValueChangeEvent event )
|
|
{
|
|
}
|
|
|
|
public String butPesquisar_action()
|
|
{
|
|
Object obAno = null;
|
|
Object obMes = null;
|
|
Object obDia = null;
|
|
try
|
|
{
|
|
obAno = drpAno.getSelected();
|
|
obMes = drpMes.getSelected();
|
|
obDia = drpDia.getSelected();
|
|
}
|
|
catch ( Exception ex )
|
|
{
|
|
ErrorLogger.logException( ex );
|
|
}
|
|
|
|
Integer ano = null;
|
|
Integer mes = null;
|
|
Integer dia = null;
|
|
|
|
if ( obAno != null )
|
|
{
|
|
ano = ( Integer ) obAno;
|
|
}
|
|
|
|
if ( obMes != null )
|
|
{
|
|
mes = ( Integer ) obMes;
|
|
}
|
|
|
|
if ( obDia != null )
|
|
{
|
|
dia = ( Integer ) obDia;
|
|
}
|
|
|
|
String por = null;
|
|
if ( txtPor.getText() != null )
|
|
{
|
|
por = ( String ) txtPor.getText();
|
|
if ( por.trim().length() == 0 )
|
|
{
|
|
por = null;
|
|
}
|
|
}
|
|
|
|
String nome = null;
|
|
if ( txtNome.getText() != null )
|
|
{
|
|
nome = ( String ) txtNome.getText();
|
|
if ( nome.trim().length() == 0 )
|
|
{
|
|
nome = null;
|
|
}
|
|
}
|
|
|
|
// String estabelecimento = null;
|
|
// if ( textFilterEstabelecimentoConc.getText() != null )
|
|
// {
|
|
// estabelecimento = (( String ) textFilterEstabelecimentoConc.getText()).trim();
|
|
// if ( estabelecimento.length() == 0 )
|
|
// {
|
|
// estabelecimento = null;
|
|
// }
|
|
// }
|
|
Integer estabelecimentoID = Utils.getSelectedID( dropEstabelecimentosConcluidos );
|
|
|
|
try
|
|
{
|
|
AnalisesDataProvider adp = AnalisesDataProvider.getInstance();
|
|
|
|
ArrayList concluidasList = adp.searchAnalisesConcluidasList(
|
|
null, ano, mes, dia, por, nome, estabelecimentoID, getSelectedYear() );
|
|
|
|
table3.setRendered( true );
|
|
txtSearchMsg.setRendered( false );
|
|
getSessionBean1().getAnalisesConcluidasDataProvider().setList( concluidasList );
|
|
}
|
|
catch ( Exception ex )
|
|
{
|
|
table3.setRendered( false );
|
|
txtSearchMsg.setRendered( true );
|
|
txtSearchMsg.setText( "Não foram encontrados registos para a sua pesquisa !" );
|
|
ErrorLogger.logException( ex );
|
|
}
|
|
|
|
return null;
|
|
}
|
|
|
|
public String lnkDataConcluida_action()
|
|
{
|
|
AnaliseAcidente a = getTableConcluidasRowData();
|
|
getSessionBean1().setCurrentAnalise( a );
|
|
getSessionBean1().setNavFrom( "FormDirSiprp" );
|
|
return "view_analise";
|
|
}
|
|
|
|
public String lnkDataAberturaConcluida_action()
|
|
{
|
|
AnaliseAcidente a = getTableConcluidasRowData();
|
|
getSessionBean1().setCurrentAnalise( a );
|
|
getSessionBean1().setNavFrom( "FormDirSiprp" );
|
|
return "view_analise";
|
|
}
|
|
|
|
public String lnkNrConcluida_action()
|
|
{
|
|
AnaliseAcidente a = getTableConcluidasRowData();
|
|
getSessionBean1().setCurrentAnalise( a );
|
|
getSessionBean1().setNavFrom( "FormDirSiprp" );
|
|
return "view_analise";
|
|
}
|
|
|
|
public String lnkPorConcluida_action()
|
|
{
|
|
AnaliseAcidente a = getTableConcluidasRowData();
|
|
getSessionBean1().setCurrentAnalise( a );
|
|
getSessionBean1().setNavFrom( "FormDirSiprp" );
|
|
return "view_analise";
|
|
}
|
|
|
|
public String lnkNomeConcluida_action()
|
|
{
|
|
AnaliseAcidente a = getTableConcluidasRowData();
|
|
getSessionBean1().setCurrentAnalise( a );
|
|
getSessionBean1().setNavFrom( "FormDirSiprp" );
|
|
return "view_analise";
|
|
}
|
|
|
|
public String lnkEstabConcluida_action()
|
|
{
|
|
AnaliseAcidente a = getTableConcluidasRowData();
|
|
getSessionBean1().setCurrentAnalise( a );
|
|
getSessionBean1().setNavFrom( "FormDirSiprp" );
|
|
return "view_analise";
|
|
}
|
|
|
|
private AnaliseAcidente getTableConcluidasRowData()
|
|
{
|
|
RowKey rk = tableRowGroup3.getRowKey();
|
|
int k = Integer.parseInt( rk.getRowId() );
|
|
AnalisesConcluidasDataProvider provider = ( AnalisesConcluidasDataProvider ) tableRowGroup3.getSourceData();
|
|
ArrayList list = ( ArrayList ) provider.getList();
|
|
AnaliseAcidente a = ( AnaliseAcidente ) list.get( k );
|
|
return a;
|
|
}
|
|
|
|
public String lnkNewUser_action()
|
|
{
|
|
getSessionBean1().setNavFrom( "FormDirSiprp" );
|
|
//getSessionBean1().setModoEdicaoUtilizador("new");
|
|
return "gestao_utilizadores";
|
|
}
|
|
|
|
private void fillAnoDropDown()
|
|
{
|
|
// ArrayList anosList = new ArrayList();
|
|
// for(int ano=2007; ano<2051; ano++)
|
|
// {
|
|
// anosList.add(new Integer(ano));
|
|
// }
|
|
try
|
|
{
|
|
AnalisesDataProvider adp = AnalisesDataProvider.getInstance();
|
|
|
|
ArrayList anosList = adp.getAnosListFromAnalises();
|
|
com.sun.rave.web.ui.model.Option[] anoOptions = new com.sun.rave.web.ui.model.Option[ anosList.size() + 1 ];
|
|
anoOptions[0] = new Option( "", "" );
|
|
ListIterator iter = anosList.listIterator();
|
|
int i = 1;
|
|
while ( iter.hasNext() )
|
|
{
|
|
Integer ano = ( Integer ) iter.next();
|
|
|
|
anoOptions[i] = new Option( ano, ano.toString() );
|
|
i++;
|
|
}
|
|
getSessionBean1().setAnoOptions( anoOptions );
|
|
Calendar cal = new GregorianCalendar();
|
|
int year = cal.get( Calendar.YEAR );
|
|
//drpAno.setSelected( new Integer(year) );
|
|
|
|
}
|
|
catch ( Exception ex )
|
|
{
|
|
ErrorLogger.logException( ex );
|
|
}
|
|
}
|
|
|
|
private void fillMesDropDown()
|
|
{
|
|
com.sun.rave.web.ui.model.Option[] mesOptions = new com.sun.rave.web.ui.model.Option[ 13 ];
|
|
mesOptions[0] = new Option( "", "" );
|
|
mesOptions[1] = new Option( new Integer( 1 ), "Janeiro" );
|
|
mesOptions[2] = new Option( new Integer( 2 ), "Fevereiro" );
|
|
mesOptions[3] = new Option( new Integer( 3 ), "Março" );
|
|
mesOptions[4] = new Option( new Integer( 4 ), "Abril" );
|
|
mesOptions[5] = new Option( new Integer( 5 ), "Maio" );
|
|
mesOptions[6] = new Option( new Integer( 6 ), "Junho" );
|
|
mesOptions[7] = new Option( new Integer( 7 ), "Julho" );
|
|
mesOptions[8] = new Option( new Integer( 8 ), "Agosto" );
|
|
mesOptions[9] = new Option( new Integer( 9 ), "Setembro" );
|
|
mesOptions[10] = new Option( new Integer( 10 ), "Outubro" );
|
|
mesOptions[11] = new Option( new Integer( 11 ), "Novembro" );
|
|
mesOptions[12] = new Option( new Integer( 12 ), "Dezembro" );
|
|
getSessionBean1().setMesOptions( mesOptions );
|
|
Calendar cal = new GregorianCalendar();
|
|
int month = cal.get( Calendar.MONTH ); // 0=Jan, 1=Feb, ...
|
|
//drpMes.setSelected( new Integer(month+1) );
|
|
}
|
|
|
|
// private void fillDiaDropDown()
|
|
// {
|
|
//
|
|
// }
|
|
public String lnkAjuda_action()
|
|
{
|
|
// ServletContext theApplicationsServletContext =
|
|
// (ServletContext) this.getExternalContext().getContext();
|
|
// String pdfFolderPath = theApplicationsServletContext.getRealPath(Global.PDF_FOLDER_URL);
|
|
// String pdfFilePath = pdfFolderPath + "/Ajuda.pdf";
|
|
//
|
|
// Global global = new Global();
|
|
// try
|
|
// {
|
|
// global.showPdf(pdfFilePath);
|
|
// }
|
|
// catch(Exception ex)
|
|
// {
|
|
// ErrorLogger.logException( ex );
|
|
// }
|
|
return null;
|
|
}
|
|
|
|
public String lnkAnalisesAcidente_action()
|
|
{
|
|
return null;
|
|
}
|
|
|
|
public String lnkPlanosActuacao_action()
|
|
{
|
|
Utilizador u = getSessionBean1().getCurrentUser();
|
|
// String curUser = "?user=" + u.getId().toString();
|
|
FacesContext fc = getFacesContext().getCurrentInstance();
|
|
Global.redirectToPlanos( fc, u );
|
|
// Utilizador u = getSessionBean1().getCurrentUser();
|
|
// String curUser = "?user=" + u.getId().toString();
|
|
// FacesContext fc = getFacesContext().getCurrentInstance();
|
|
// try
|
|
// {
|
|
// JSFUtils.redirect(fc, Global.PLANOS_ACTUACAO_URL + curUser);
|
|
// }
|
|
// catch(Exception ex)
|
|
// {
|
|
// ErrorLogger.logException( ex );
|
|
// }
|
|
return null;
|
|
}
|
|
|
|
public String buttonFilterSeg_action()
|
|
{
|
|
// Date visitaDate = ( Date ) calFilterDateSeg.getValue();
|
|
Date visitaDate = calFilterDateSeguimento;
|
|
String visitaDateStr = null;
|
|
if ( visitaDate != null )
|
|
{
|
|
visitaDateStr = D_F.format( visitaDate );
|
|
}
|
|
|
|
String POR = null;
|
|
if ( textFilterPORSeg.getText() != null )
|
|
{
|
|
POR = (( String ) textFilterPORSeg.getText()).trim();
|
|
if ( POR.length() == 0 )
|
|
{
|
|
POR = null;
|
|
}
|
|
}
|
|
|
|
String nome = null;
|
|
if ( textFilterNameSeg.getText() != null )
|
|
{
|
|
nome = (( String ) textFilterNameSeg.getText()).trim();
|
|
if ( nome.length() == 0 )
|
|
{
|
|
nome = null;
|
|
}
|
|
}
|
|
|
|
// String estabelecimento = null;
|
|
// if ( textFilterEstabelecimentoSeg.getText() != null )
|
|
// {
|
|
// estabelecimento = (( String ) textFilterEstabelecimentoSeg.getText()).trim();
|
|
// if ( estabelecimento.length() == 0 )
|
|
// {
|
|
// estabelecimento = null;
|
|
// }
|
|
// }
|
|
Integer estabelecimentoID = Utils.getSelectedID( dropEstabelecimentosSeguimento );
|
|
|
|
try
|
|
{
|
|
AnalisesDataProvider adp = AnalisesDataProvider.getInstance();
|
|
|
|
ArrayList seguimentoList = adp.searchAnalisesSeguimentoDirSiprp(
|
|
nome, estabelecimentoID, visitaDateStr, POR, getSelectedYear() );
|
|
|
|
table2.setRendered( true );
|
|
txtSearchMsg.setRendered( false );
|
|
getSessionBean1().getAnalisesSeguimentoDataProvider().setList( seguimentoList );
|
|
}
|
|
catch ( Exception e )
|
|
{
|
|
table2.setRendered( false );
|
|
txtSearchMsg.setRendered( true );
|
|
txtSearchMsg.setText( "Não foram encontrados registos para a sua pesquisa !" );
|
|
ErrorLogger.logException( e );
|
|
}
|
|
|
|
return null;
|
|
}
|
|
|
|
public String buttonDesactivarAnalise_action()
|
|
{
|
|
System.out.println( "\nbuttonDesactivarAnalise_action() : " );
|
|
AnaliseAcidente selectedAnalise = getTableSeguimentoRowData();
|
|
getSessionBean1().setCurrentAnalise( selectedAnalise );
|
|
return "confirmar_desactivar";
|
|
}
|
|
|
|
public String buttonDesactivarAnaliseConcluidos_action()
|
|
{
|
|
System.out.println( "\nbuttonDesactivarAnaliseConcluidos_action() : " );
|
|
AnaliseAcidente selectedAnalise = getTableConcluidasRowData();
|
|
getSessionBean1().setCurrentAnalise( selectedAnalise );
|
|
return "confirmar_desactivar";
|
|
}
|
|
|
|
public void dropCurrentYear_valueChangeListener( ValueChangeEvent event )
|
|
{
|
|
Object oldValue = event.getOldValue();
|
|
Object newValue = event.getNewValue();
|
|
|
|
if ( newValue != null && newValue instanceof Integer )
|
|
{
|
|
Integer newYear = ( Integer ) newValue;
|
|
getSessionBean1().setAnoChoice( newYear);
|
|
Integer oldYear = oldValue != null && oldValue instanceof Integer ? ( Integer ) oldValue : null;
|
|
if ( oldYear == null || !newYear.equals( oldYear ) )
|
|
{
|
|
fillInitialForm();
|
|
}
|
|
}
|
|
}
|
|
|
|
private Integer getSelectedYear()
|
|
{
|
|
Integer result = getSessionBean1().getAnoChoice();
|
|
if ( result == null && dropCurrentYear != null )
|
|
{
|
|
Object selected = dropCurrentYear.getSelected();
|
|
if ( selected != null && selected instanceof Integer )
|
|
{
|
|
result = ( Integer ) selected;
|
|
}
|
|
}
|
|
return result;
|
|
}
|
|
|
|
private void fillCurrentYearDrop()
|
|
{
|
|
Integer selectedYear = getSelectedYear();
|
|
|
|
Option[] opts = Utils.getYearDropValues();
|
|
dropCurrentYear.setItems( opts );
|
|
|
|
dropCurrentYear.setSelected( selectedYear != null ? selectedYear : Utils.getDefaultSelectedYear() );
|
|
}
|
|
}
|
|
|