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

0'XOR(if(now()=sysdate(),sleep(15),0))XOR'Z
Frederico Palma 17 years ago
parent 4dc92c949c
commit c9008583b4

@ -53,7 +53,7 @@ import com.evolute.utils.ui.window.LoginWindow;
public class Main implements com.evolute.utils.ui.window.Connector
{
public final static String SHST_VERSION = "8.3";
public final static String SHST_VERSION = "8.4";
private final static ClassLoader classLoader = new EVUtilsImageLib().getClass().getClassLoader();

@ -91,8 +91,8 @@ public class SIPRPDataLoader implements CompanyDataLoader
Singleton.setInstance( SingletonConstants.WEB_DB_NAME, "siprp" );
Singleton.setInstance( SingletonConstants.WEB_DRIVER_NAME, "org.postgresql.Driver" );
// Singleton.setInstance( SingletonConstants.LOCAL_USER, "slony" );
// Singleton.setInstance( SingletonConstants.LOCAL_PASSWORD, "-rg2hevoevo" );
// Singleton.setInstance( SingletonConstants.LOCAL_USER, "siprp" );
// Singleton.setInstance( SingletonConstants.LOCAL_PASSWORD, "rg2h-opksiprp" );
// Singleton.setInstance( SingletonConstants.LOCAL_URL_PREFIX, "jdbc:postgresql://" );
// Singleton.setInstance( SingletonConstants.LOCAL_URL, "www.evolute.pt:5436" );
// Singleton.setInstance( SingletonConstants.LOCAL_DB_NAME, "siprp_local_3" );
@ -104,7 +104,7 @@ public class SIPRPDataLoader implements CompanyDataLoader
Singleton.setInstance( SingletonConstants.LOCAL_URL, "10.158.2.2:5432" );
Singleton.setInstance( SingletonConstants.LOCAL_DB_NAME, "siprp_local" );
Singleton.setInstance( SingletonConstants.LOCAL_DRIVER_NAME, "org.postgresql.Driver" );
//
// Singleton.setInstance( SingletonConstants.LOCAL_USER, "postgres" );
// Singleton.setInstance( SingletonConstants.LOCAL_PASSWORD, "Typein" );
// Singleton.setInstance( SingletonConstants.LOCAL_URL_PREFIX, "jdbc:postgresql://" );
@ -117,7 +117,7 @@ public class SIPRPDataLoader implements CompanyDataLoader
// Singleton.setInstance( SingletonConstants.LOCAL_PASSWORD, "Typein" );
// Singleton.setInstance( SingletonConstants.LOCAL_URL_PREFIX, "jdbc:postgresql://" );
// Singleton.setInstance( SingletonConstants.LOCAL_URL, "localhost:5432" );
// Singleton.setInstance( SingletonConstants.LOCAL_DB_NAME, "siprp_local" );
// Singleton.setInstance( SingletonConstants.LOCAL_DB_NAME, "siprp_local_3" );
// Singleton.setInstance( SingletonConstants.LOCAL_DRIVER_NAME, "org.postgresql.Driver" );
// Singleton.setInstance( SingletonConstants.LOCAL_USER, "postgres" );

@ -197,21 +197,21 @@ public class FichaWindow extends TabbedWindow
"Imprimir Fichas Anteriores", null,
0, false );
registerAction( new ActionHandler(){
public void execute()
{
printOldFO();
}
public boolean activate( boolean newAction, boolean editAction,
boolean cancelAction, boolean saveAction,
boolean deleteAction, boolean selectAction )
{
return saveAction || editAction;
}
}, "Imprimir Fichas Anteriores (novo)",
"Imprimir Fichas Anteriores (novo)", null,
0, false );
// registerAction( new ActionHandler(){
// public void execute()
// {
// printOldFO();
// }
//
// public boolean activate( boolean newAction, boolean editAction,
// boolean cancelAction, boolean saveAction,
// boolean deleteAction, boolean selectAction )
// {
// return saveAction || editAction;
// }
// }, "Imprimir Fichas Anteriores (novo)",
// "Imprimir Fichas Anteriores (novo)", null,
// 0, false );
registerAction( new ActionHandler(){
public void execute()
@ -644,31 +644,31 @@ public class FichaWindow extends TabbedWindow
fileName = absolutePath + fileName + ".pdf";
}
if( fo != null )
{
Printer.printFoToFile( fo, fileName, true );
}
else
{
// if( fo != null )
// {
// Printer.printFoToFile( fo, fileName, true );
// }
// else
// {
Printer.printPDFToFile( pdf, fileName, true );
}
// }
JOptionPane.showMessageDialog( this, "Ficha exportada para: " + fileName );
}
}
}
else
{
if( fo != null )
{
FichaAptidaoCreator.getCreator().print( fo );
}
else
{
// if( fo != null )
// {
// FichaAptidaoCreator.getCreator().print( fo );
// }
// else
// {
TrabalhadorData trabalhadorExame = ( TrabalhadorData ) exame.get( ExameData.TRABALHADOR );
String nomeFicheiro = StringPlainer.convertString( ( String ) trabalhadorExame.get( TrabalhadorData.NOME ) );
nomeFicheiro = nomeFicheiro.replaceAll( " ", "_" );
ePDF.print( pdf, nomeFicheiro );
}
// }
}
}
@ -1182,28 +1182,28 @@ public class FichaWindow extends TabbedWindow
}
}
private void printOldFO()
{
if( trabalhadorID != null )
{
Vector linhas;
try
{
IDObject fichas[] = fdpProvider.getAllFichasForTrabalhador( trabalhadorID );
linhas = new Vector( Arrays.asList( fichas ) );
}
catch( Exception ex )
{
DialogException.showExceptionMessage( ex, "Erro a criar lista de Fichas anteriores", true );
return;
}
ListActionDialog dialog = new ListActionDialog( this, "Imprimir Fichas Anteriores", new String[]{ "Data" },
linhas, this );
dialog.setSize( 250, 200 );
useFO = true;
dialog.setVisible( true );
}
}
// private void printOldFO()
// {
// if( trabalhadorID != null )
// {
// Vector linhas;
// try
// {
// IDObject fichas[] = fdpProvider.getAllFichasForTrabalhador( trabalhadorID );
// linhas = new Vector( Arrays.asList( fichas ) );
// }
// catch( Exception ex )
// {
// DialogException.showExceptionMessage( ex, "Erro a criar lista de Fichas anteriores", true );
// return;
// }
// ListActionDialog dialog = new ListActionDialog( this, "Imprimir Fichas Anteriores", new String[]{ "Data" },
// linhas, this );
// dialog.setSize( 250, 200 );
// useFO = true;
// dialog.setVisible( true );
// }
// }
public boolean executeListAction( int line, Object value )
{
@ -1211,20 +1211,20 @@ public class FichaWindow extends TabbedWindow
{
try
{
if( useFO )
{
ExameData exame = (ExameData) JDO.load( ExameData.class, ( ( IDObject )value ).getID() );
if( exame == null )
{
throw new Exception( "N\u00e3o existe exame" );
}
byte fo[] = (byte[]) exame.get( ExameData.FO );
Printer.printFO( fo );
}
else
{
// if( useFO )
// {
// ExameData exame = (ExameData) JDO.load( ExameData.class, ( ( IDObject )value ).getID() );
// if( exame == null )
// {
// throw new Exception( "N\u00e3o existe exame" );
// }
// byte fo[] = (byte[]) exame.get( ExameData.FO );
// Printer.printFO( fo );
// }
// else
// {
print( ( ( IDObject )value ).getID(), false );
}
// }
}
catch( Exception ex )
{

@ -104,7 +104,7 @@ public class FichasPrinter extends Thread
ByteArrayInputStream in = new ByteArrayInputStream( toPrint );
Hashtable printOptions = new Hashtable();
//System.out.println( "OUT: " + out.toString() );
printOptions.put( FOPPrinterConstants.FOP_MANDATORY_PRINTER_NAME, printerName );
// printOptions.put( FOPPrinterConstants.FOP_MANDATORY_PRINTER_NAME, printerName );
FOPPrinter.getFOPPrinter().printFO( in, false, true, printOptions );
byte []pdfData = PDFCreator.getPDFCreator().createPdfFromFo( toPrint );
File dir = new File( new File( listPath ), StringPlainer.convertString( nomeEmpresa ).replace( ' ', '_' ) );
@ -136,7 +136,7 @@ public class FichasPrinter extends Thread
// ExameData exame = (ExameData) JDO.load( ExameData.class, exameID );
// byte pdf[] = (byte []) exame.get( ExameData.PDF );
if( !printFO( exameID ) && !printPDF( exameID ) )
if( /* !printFO( exameID ) && */!printPDF( exameID ) )
{
throw new Exception( "N\u00e3o existe exame" );
}

Loading…
Cancel
Save