From: Jorg J. <jj...@us...> - 2004-05-09 18:54:37
|
Update of /cvsroot/compiere/client/Src/org/compiere/apps In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10481/Src/org/compiere/apps Modified Files: AEnv.java AMenu.java APanel.java Attachment.java Log Message: . Index: AEnv.java =================================================================== RCS file: /cvsroot/compiere/client/Src/org/compiere/apps/AEnv.java,v retrieving revision 1.54 retrieving revision 1.55 diff -C2 -d -r1.54 -r1.55 *** AEnv.java 9 May 2004 04:47:30 -0000 1.54 --- AEnv.java 9 May 2004 18:54:17 -0000 1.55 *************** *** 338,342 **** // Go Menu ------------------------ ! else if (actionCommand.equals("Workflow")) { startWorkflowProcess(0,0); --- 338,342 ---- // Go Menu ------------------------ ! else if (actionCommand.equals("WorkFlow")) { startWorkflowProcess(0,0); *************** *** 485,489 **** --- 485,523 ---- } // exit + /** + * Is Workflow Process enabled. + * @return true if enabled + */ + public static boolean isWorkflowProcess () + { + if (s_workflow == null) + { + s_workflow = Boolean.FALSE; + int AD_Table_ID = 645; // AD_WF_Process + if (MRole.getDefault().isTableAccess (AD_Table_ID, true)) // RO + s_workflow = Boolean.TRUE; + else + { + AD_Table_ID = 644; // AD_WF_Activity + if (MRole.getDefault().isTableAccess (AD_Table_ID, true)) // RO + s_workflow = Boolean.TRUE; + else + Log.trace(Log.l2_Sub, "AEnv.isWorkflowProcess - " + s_workflow); + } + // Get Window + if (s_workflow.booleanValue()) + { + s_workflow_Window_ID = DB.getSQLValue ( + "SELECT AD_Window_ID FROM AD_Table WHERE AD_Table_ID=?", AD_Table_ID); + if (s_workflow_Window_ID == 0) + s_workflow_Window_ID = 297; // fallback HARDCODED + // s_workflow = Boolean.FALSE; + Log.trace(Log.l2_Sub, "AEnv.isWorkflowProcess - " + s_workflow + ",Window=" + s_workflow_Window_ID); + } + } + return s_workflow.booleanValue(); + } // isWorkflowProcess + /** * Start Workflow Process *************** *** 493,502 **** public static void startWorkflowProcess (int AD_Table_ID, int Record_ID) { - // AD_Table_ID for AD_WF_Process = 645 HARDCODED if (s_workflow_Window_ID == 0) ! s_workflow_Window_ID = DB.getSQLValue ( ! "SELECT AD_Window_ID FROM AD_Table WHERE AD_Table_ID=?", 645); ! if (s_workflow_Window_ID == 0) ! s_workflow_Window_ID = 297; // fallback HARDCODED // MQuery query = null; --- 527,532 ---- public static void startWorkflowProcess (int AD_Table_ID, int Record_ID) { if (s_workflow_Window_ID == 0) ! return; // MQuery query = null; *************** *** 519,522 **** --- 549,554 ---- /** Workflow Menu */ + private static Boolean s_workflow = null; + /** Workflow Menu */ private static int s_workflow_Window_ID = 0; Index: AMenu.java =================================================================== RCS file: /cvsroot/compiere/client/Src/org/compiere/apps/AMenu.java,v retrieving revision 1.75 retrieving revision 1.76 diff -C2 -d -r1.75 -r1.76 *** AMenu.java 9 May 2004 04:47:30 -0000 1.75 --- AMenu.java 9 May 2004 18:54:17 -0000 1.76 *************** *** 297,301 **** AEnv.addMenuItem("Editor", null, null, mTools, this); AEnv.addMenuItem("Script", null, null, mTools, this); ! AEnv.addMenuItem("Workflow", null, null, mTools, this); mTools.addSeparator(); AEnv.addMenuItem("Preference", null, null, mTools, this); --- 297,302 ---- AEnv.addMenuItem("Editor", null, null, mTools, this); AEnv.addMenuItem("Script", null, null, mTools, this); ! if (AEnv.isWorkflowProcess()) ! AEnv.addMenuItem("WorkFlow", null, null, mTools, this); mTools.addSeparator(); AEnv.addMenuItem("Preference", null, null, mTools, this); *************** *** 523,527 **** /************************************************************************* ! * Start Workflow * @param AD_Workflow_ID id */ --- 524,528 ---- /************************************************************************* ! * Start Workflow Activity * @param AD_Workflow_ID id */ Index: APanel.java =================================================================== RCS file: /cvsroot/compiere/client/Src/org/compiere/apps/APanel.java,v retrieving revision 1.104 retrieving revision 1.105 diff -C2 -d -r1.104 -r1.105 *** APanel.java 9 May 2004 04:47:31 -0000 1.104 --- APanel.java 9 May 2004 18:54:18 -0000 1.105 *************** *** 220,224 **** aEditor = addAction("Editor", mTools, null, false); aScript = addAction("Script", mTools, null, false); ! aWorkflow = addAction("Workflow", mTools, null, false); mTools.addSeparator(); aPreference = addAction("Preference", mTools, null, false); --- 220,225 ---- aEditor = addAction("Editor", mTools, null, false); aScript = addAction("Script", mTools, null, false); ! if (AEnv.isWorkflowProcess()) ! aWorkflow = addAction("WorkFlow", mTools, null, false); mTools.addSeparator(); aPreference = addAction("Preference", mTools, null, false); *************** *** 298,302 **** if (m_isPersonalLock) toolBar.add(aLock.getButton()); ! toolBar.add(aWorkflow.getButton()); toolBar.add(aProduct.getButton()); toolBar.addSeparator(); --- 299,304 ---- if (m_isPersonalLock) toolBar.add(aLock.getButton()); ! if (aWorkflow != null) ! toolBar.add(aWorkflow.getButton()); toolBar.add(aProduct.getButton()); toolBar.addSeparator(); *************** *** 1064,1068 **** cmd_detail(); // Tools ! else if (cmd.equals(aWorkflow.getName())) { if (m_curTab.getTabNo() == 0 && m_mWorkbench.getMWindow(getWindowIndex()).isTransaction()) --- 1066,1070 ---- cmd_detail(); // Tools ! else if (aWorkflow != null && cmd.equals(aWorkflow.getName())) { if (m_curTab.getTabNo() == 0 && m_mWorkbench.getMWindow(getWindowIndex()).isTransaction()) Index: Attachment.java =================================================================== RCS file: /cvsroot/compiere/client/Src/org/compiere/apps/Attachment.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** Attachment.java 5 May 2004 16:54:46 -0000 1.21 --- Attachment.java 9 May 2004 18:54:18 -0000 1.22 *************** *** 163,166 **** --- 163,167 ---- // cbContent.setToolTipText(text); cbContent.addActionListener(this); + cbContent.setLightWeightPopupEnabled(false); // Acrobat Panel is heavy // text.setBackground(CompierePLAF.getInfoBackground()); |