From 8da50e3567b4a7b987ddff964a7b889c37fe3d24 Mon Sep 17 00:00:00 2001 From: croo Date: Wed, 21 Mar 2007 14:40:42 +0000 Subject: [PATCH] [ 1684142 ] Form and Viewer windows shows Info windows over role --- client/src/org/compiere/apps/APanel.java | 62 +++++++++++++++---- .../src/org/compiere/apps/form/FormFrame.java | 57 ++++++++++++++--- client/src/org/compiere/print/Viewer.java | 56 ++++++++++++++--- 3 files changed, 145 insertions(+), 30 deletions(-) diff --git a/client/src/org/compiere/apps/APanel.java b/client/src/org/compiere/apps/APanel.java index 444b8e253e..96d96f3cd5 100644 --- a/client/src/org/compiere/apps/APanel.java +++ b/client/src/org/compiere/apps/APanel.java @@ -45,6 +45,8 @@ import org.compiere.util.*; * * @author Jorg Janke * @version $Id: APanel.java,v 1.4 2006/07/30 00:51:27 jjanke Exp $ + * + * Colin Rooney 2007/03/20 RFE#1670185 & related BUG#1684142 - Extend Sec to Info Queries */ public final class APanel extends CPanel implements DataStatusListener, ChangeListener, ActionListener, ASyncProcess @@ -208,19 +210,52 @@ public final class APanel extends CPanel // View JMenu mView = AEnv.getMenu("View"); menuBar.add(mView); - aProduct = addAction("InfoProduct", mView, KeyStroke.getKeyStroke(KeyEvent.VK_I, Event.ALT_MASK), false); - aBPartner = addAction("InfoBPartner", mView, KeyStroke.getKeyStroke(KeyEvent.VK_I, Event.SHIFT_MASK+Event.ALT_MASK), false); - if (MRole.getDefault().isShowAcct()) + if (MRole.getDefault().isAllow_Info_Product()) + { + aProduct = addAction("InfoProduct", mView, KeyStroke.getKeyStroke(KeyEvent.VK_I, Event.ALT_MASK), false); + } + if (MRole.getDefault().isAllow_Info_BPartner()) + { + aBPartner = addAction("InfoBPartner", mView, KeyStroke.getKeyStroke(KeyEvent.VK_I, Event.SHIFT_MASK+Event.ALT_MASK), false); + } + if (MRole.getDefault().isShowAcct() && MRole.getDefault().isAllow_Info_Account()) + { aAccount = addAction("InfoAccount",mView, KeyStroke.getKeyStroke(KeyEvent.VK_I, Event.ALT_MASK+Event.CTRL_MASK), false); - AEnv.addMenuItem("InfoSchedule", null, null, mView, this); + } + if (MRole.getDefault().isAllow_Info_Schedule()) + { + AEnv.addMenuItem("InfoSchedule", null, null, mView, this); + } mView.addSeparator(); - AEnv.addMenuItem("InfoOrder", "Info", null, mView, this); - AEnv.addMenuItem("InfoInvoice", "Info", null, mView, this); - AEnv.addMenuItem("InfoInOut", "Info", null, mView, this); - AEnv.addMenuItem("InfoPayment", "Info", null, mView, this); - AEnv.addMenuItem("InfoCashLine", "Info", null, mView, this); - AEnv.addMenuItem("InfoAssignment", "Info", null, mView, this); - AEnv.addMenuItem("InfoAsset", "Info", null, mView, this); + if (MRole.getDefault().isAllow_Info_Order()) + { + AEnv.addMenuItem("InfoOrder", "Info", null, mView, this); + } + if (MRole.getDefault().isAllow_Info_Invoice()) + { + AEnv.addMenuItem("InfoInvoice", "Info", null, mView, this); + } + if (MRole.getDefault().isAllow_Info_InOut()) + { + AEnv.addMenuItem("InfoInOut", "Info", null, mView, this); + } + if (MRole.getDefault().isAllow_Info_Payment()) + { + AEnv.addMenuItem("InfoPayment", "Info", null, mView, this); + } + if (MRole.getDefault().isAllow_Info_CashJournal()) + { + AEnv.addMenuItem("InfoCashLine", "Info", null, mView, this); + } + if (MRole.getDefault().isAllow_Info_Resource()) + { + AEnv.addMenuItem("InfoAssignment", "Info", null, mView, this); + } + if (MRole.getDefault().isAllow_Info_Asset()) + { + AEnv.addMenuItem("InfoAsset", "Info", null, mView, this); + } + mView.addSeparator(); aAttachment = addAction("Attachment", mView, KeyStroke.getKeyStroke(KeyEvent.VK_F7, 0), true); // toggle aChat = addAction("Chat", mView, null, true); // toggle @@ -309,7 +344,10 @@ public final class APanel extends CPanel if (aWorkflow != null) toolBar.add(aWorkflow.getButton()); toolBar.add(aRequest.getButton()); - toolBar.add(aProduct.getButton()); + if (MRole.getDefault().isAllow_Info_Product()) + { + toolBar.add(aProduct.getButton()); + } toolBar.addSeparator(); toolBar.add(aEnd.getButton()); // diff --git a/client/src/org/compiere/apps/form/FormFrame.java b/client/src/org/compiere/apps/form/FormFrame.java index 434eaa9733..90d2e17672 100644 --- a/client/src/org/compiere/apps/form/FormFrame.java +++ b/client/src/org/compiere/apps/form/FormFrame.java @@ -33,6 +33,9 @@ import org.compiere.util.*; * * @author Jorg Janke * @version $Id: FormFrame.java,v 1.2 2006/07/30 00:51:28 jjanke Exp $ + * + * Colin Rooney 2007/03/20 RFE#1670185 & BUG#1684142 + * Extend security to Info Queries */ public class FormFrame extends CFrame implements ActionListener @@ -114,16 +117,52 @@ public class FormFrame extends CFrame // View JMenu mView = AEnv.getMenu("View"); menuBar.add(mView); - AEnv.addMenuItem("InfoProduct", null, KeyStroke.getKeyStroke(KeyEvent.VK_I, Event.CTRL_MASK), mView, this); - AEnv.addMenuItem("InfoBPartner", null, KeyStroke.getKeyStroke(KeyEvent.VK_I, Event.SHIFT_MASK+Event.CTRL_MASK), mView, this); - AEnv.addMenuItem("InfoAccount", null, KeyStroke.getKeyStroke(KeyEvent.VK_I, Event.ALT_MASK+Event.CTRL_MASK), mView, this); - mView.addSeparator(); - AEnv.addMenuItem("InfoOrder", "Info", null, mView, this); - AEnv.addMenuItem("InfoInvoice", "Info", null, mView, this); - AEnv.addMenuItem("InfoInOut", "Info", null, mView, this); - AEnv.addMenuItem("InfoPayment", "Info", null, mView, this); - AEnv.addMenuItem("InfoSchedule", "Info", null, mView, this); + if (MRole.getDefault().isAllow_Info_Product()) + { + AEnv.addMenuItem("InfoProduct", null, KeyStroke.getKeyStroke(KeyEvent.VK_I, Event.ALT_MASK), mView, this); + } + if (MRole.getDefault().isAllow_Info_BPartner()) + { + AEnv.addMenuItem("InfoBPartner", null, KeyStroke.getKeyStroke(KeyEvent.VK_I, Event.ALT_MASK+Event.CTRL_MASK), mView, this); + } + if (MRole.getDefault().isShowAcct() && MRole.getDefault().isAllow_Info_Account()) + { + AEnv.addMenuItem("InfoAccount", null, KeyStroke.getKeyStroke(KeyEvent.VK_I, Event.ALT_MASK+Event.CTRL_MASK), mView, this); + } + if (MRole.getDefault().isAllow_Info_Schedule()) + { + AEnv.addMenuItem("InfoSchedule", null, null, mView, this); + } + mView.addSeparator(); + if (MRole.getDefault().isAllow_Info_Order()) + { + AEnv.addMenuItem("InfoOrder", "Info", null, mView, this); + } + if (MRole.getDefault().isAllow_Info_Invoice()) + { + AEnv.addMenuItem("InfoInvoice", "Info", null, mView, this); + } + if (MRole.getDefault().isAllow_Info_InOut()) + { + AEnv.addMenuItem("InfoInOut", "Info", null, mView, this); + } + if (MRole.getDefault().isAllow_Info_Payment()) + { + AEnv.addMenuItem("InfoPayment", "Info", null, mView, this); + } + if (MRole.getDefault().isAllow_Info_CashJournal()) + { + AEnv.addMenuItem("InfoCashLine", "Info", null, mView, this); + } + if (MRole.getDefault().isAllow_Info_Resource()) + { + AEnv.addMenuItem("InfoAssignment", "Info", null, mView, this); + } + if (MRole.getDefault().isAllow_Info_Asset()) + { + AEnv.addMenuItem("InfoAsset", "Info", null, mView, this); + } // Tools JMenu mTools = AEnv.getMenu("Tools"); menuBar.add(mTools); diff --git a/client/src/org/compiere/print/Viewer.java b/client/src/org/compiere/print/Viewer.java index d3a20f94ab..b63ce70bd4 100644 --- a/client/src/org/compiere/print/Viewer.java +++ b/client/src/org/compiere/print/Viewer.java @@ -41,6 +41,8 @@ import org.adempiere.pdf.*; * globalqss: integrate phib contribution from * http://sourceforge.net/tracker/index.php?func=detail&aid=1566335&group_id=176962&atid=879334 * globalqss: integrate Teo Sarca bug fixing + * Colin Rooney 2007/03/20 RFE#1670185 & BUG#1684142 + * Extend security to Info queries * */ public class Viewer extends CFrame @@ -389,16 +391,52 @@ public class Viewer extends CFrame // View JMenu mView = AEnv.getMenu("View"); menuBar.add(mView); - AEnv.addMenuItem("InfoProduct", null, KeyStroke.getKeyStroke(KeyEvent.VK_I, Event.CTRL_MASK), mView, this); - AEnv.addMenuItem("InfoBPartner", null, KeyStroke.getKeyStroke(KeyEvent.VK_I, Event.SHIFT_MASK+Event.CTRL_MASK), mView, this); - AEnv.addMenuItem("InfoAccount", null, KeyStroke.getKeyStroke(KeyEvent.VK_I, Event.ALT_MASK+Event.CTRL_MASK), mView, this); - AEnv.addMenuItem("InfoSchedule", null, null, mView, this); - mView.addSeparator(); - AEnv.addMenuItem("InfoOrder", "Info", null, mView, this); - AEnv.addMenuItem("InfoInvoice", "Info", null, mView, this); - AEnv.addMenuItem("InfoInOut", "Info", null, mView, this); - AEnv.addMenuItem("InfoPayment", "Info", null, mView, this); + if (MRole.getDefault().isAllow_Info_Product()) + { + AEnv.addMenuItem("InfoProduct", null, KeyStroke.getKeyStroke(KeyEvent.VK_I, Event.ALT_MASK), mView, this); + } + if (MRole.getDefault().isAllow_Info_BPartner()) + { + AEnv.addMenuItem("InfoBPartner", null, KeyStroke.getKeyStroke(KeyEvent.VK_I, Event.ALT_MASK+Event.CTRL_MASK), mView, this); + } + if (MRole.getDefault().isShowAcct() && MRole.getDefault().isAllow_Info_Account()) + { + AEnv.addMenuItem("InfoAccount", null, KeyStroke.getKeyStroke(KeyEvent.VK_I, Event.ALT_MASK+Event.CTRL_MASK), mView, this); + } + if (MRole.getDefault().isAllow_Info_Schedule()) + { + AEnv.addMenuItem("InfoSchedule", null, null, mView, this); + } + mView.addSeparator(); + if (MRole.getDefault().isAllow_Info_Order()) + { + AEnv.addMenuItem("InfoOrder", "Info", null, mView, this); + } + if (MRole.getDefault().isAllow_Info_Invoice()) + { + AEnv.addMenuItem("InfoInvoice", "Info", null, mView, this); + } + if (MRole.getDefault().isAllow_Info_InOut()) + { + AEnv.addMenuItem("InfoInOut", "Info", null, mView, this); + } + if (MRole.getDefault().isAllow_Info_Payment()) + { + AEnv.addMenuItem("InfoPayment", "Info", null, mView, this); + } + if (MRole.getDefault().isAllow_Info_CashJournal()) + { + AEnv.addMenuItem("InfoCashLine", "Info", null, mView, this); + } + if (MRole.getDefault().isAllow_Info_Resource()) + { + AEnv.addMenuItem("InfoAssignment", "Info", null, mView, this); + } + if (MRole.getDefault().isAllow_Info_Asset()) + { + AEnv.addMenuItem("InfoAsset", "Info", null, mView, this); + } // Go JMenu mGo = AEnv.getMenu("Go"); menuBar.add(mGo);