From: Jorg J. <jj...@us...> - 2005-07-25 18:31:46
|
Update of /cvsroot/compiere/client/Src/org/compiere/apps In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29391/Src/org/compiere/apps Modified Files: APanel.java ScriptEditor.java Log Message: Index: APanel.java =================================================================== RCS file: /cvsroot/compiere/client/Src/org/compiere/apps/APanel.java,v retrieving revision 1.138 retrieving revision 1.139 diff -C2 -d -r1.138 -r1.139 *** APanel.java 24 Jul 2005 19:37:03 -0000 1.138 --- APanel.java 25 Jul 2005 18:31:36 -0000 1.139 *************** *** 1054,1060 **** // File if (cmd.equals(aReport.getName())) ! cmd_report(e.getSource()); else if (cmd.equals(aPrint.getName())) ! cmd_print(e.getSource()); else if (cmd.equals(aEnd.getName())) cmd_end(false); --- 1054,1060 ---- // File if (cmd.equals(aReport.getName())) ! cmd_report(); else if (cmd.equals(aPrint.getName())) ! cmd_print(); else if (cmd.equals(aEnd.getName())) cmd_end(false); *************** *** 1241,1247 **** /** * Print standard Report - * @param source event source */ ! private void cmd_report (Object source) { log.info(""); --- 1241,1246 ---- /** * Print standard Report */ ! private void cmd_report () { log.info(""); *************** *** 1287,1291 **** } ! new AReport (m_curTab.getAD_Table_ID(), (JComponent)source, query); } // cmd_report --- 1286,1290 ---- } ! new AReport (m_curTab.getAD_Table_ID(), aReport.getButton(), query); } // cmd_report *************** *** 1355,1361 **** /** * Print specific Report - or start default Report - * @param source event source */ ! private void cmd_print(Object source) { // Get process defined for this tab --- 1354,1359 ---- /** * Print specific Report - or start default Report */ ! private void cmd_print() { // Get process defined for this tab *************** *** 1366,1370 **** if (AD_Process_ID == 0) { ! cmd_report(source); return; } --- 1364,1368 ---- if (AD_Process_ID == 0) { ! cmd_report(); return; } Index: ScriptEditor.java =================================================================== RCS file: /cvsroot/compiere/client/Src/org/compiere/apps/ScriptEditor.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** ScriptEditor.java 11 Mar 2005 20:28:21 -0000 1.9 --- ScriptEditor.java 25 Jul 2005 18:31:37 -0000 1.10 *************** *** 21,24 **** --- 21,25 ---- import javax.swing.*; import javax.swing.border.*; + import org.compiere.model.*; import org.compiere.swing.*; *************** *** 267,270 **** --- 268,289 ---- private void actionProcess() { + /** Example: + import org.compiere.util.DB; + import java.sql.*; + PreparedStatement pstmt =DB.prepareStatement("select Name, Password from AD_User where Name like 'Super%'"); + ResultSet rs = pstmt.executeQuery(); + if (rs.next()) + { + result = rs.getString("Name") + "; password= " + rs.getString("Password"); + } + **/ + + MUser user = MUser.get(Env.getCtx()); + if (!user.isAdministrator()) + { + fResult.setText("Not Administrator"); + return; + } + // m_script.setScript(editor.getText()); Exception e = m_script.execute(); |