diff --git a/org.adempiere.ui.swing/src/org/compiere/print/Viewer.java b/org.adempiere.ui.swing/src/org/compiere/print/Viewer.java index a60941ad4f..7de0ead2ed 100644 --- a/org.adempiere.ui.swing/src/org/compiere/print/Viewer.java +++ b/org.adempiere.ui.swing/src/org/compiere/print/Viewer.java @@ -130,7 +130,7 @@ public class Viewer extends CFrame /** * */ - private static final long serialVersionUID = 7306392362119021781L; + private static final long serialVersionUID = 3453340777183200393L; /** * @deprecated @@ -451,9 +451,14 @@ public class Viewer extends CFrame { log.log(Level.SEVERE, sql, e); } - StringBuffer sb = new StringBuffer("** ").append(Msg.getMsg(m_ctx, "NewReport")).append(" **"); - KeyNamePair pp = new KeyNamePair(-1, sb.toString()); - comboReport.addItem(pp); + // IDEMPIERE-297 - Check for Table Access and Window Access for New Report + if ( MRole.getDefault().isTableAccess(MPrintFormat.Table_ID, false) + && MRole.getDefault().getWindowAccess(WINDOW_PRINTFORMAT)) + { + StringBuffer sb = new StringBuffer("** ").append(Msg.getMsg(m_ctx, "NewReport")).append(" **"); + KeyNamePair pp = new KeyNamePair(-1, sb.toString()); + comboReport.addItem(pp); + } if (selectValue != null) comboReport.setSelectedItem(selectValue); comboReport.addActionListener(this); diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/ZkReportViewer.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/ZkReportViewer.java index 700c7c38ea..09f9729d9f 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/ZkReportViewer.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/ZkReportViewer.java @@ -77,13 +77,13 @@ import org.zkoss.zk.ui.ext.render.DynamicMedia; import org.zkoss.zul.A; import org.zkoss.zul.Borderlayout; import org.zkoss.zul.Center; -import org.zkoss.zul.North; import org.zkoss.zul.Div; import org.zkoss.zul.Filedownload; import org.zkoss.zul.Hbox; import org.zkoss.zul.Iframe; import org.zkoss.zul.Listitem; import org.zkoss.zul.Menuitem; +import org.zkoss.zul.North; import org.zkoss.zul.Separator; import org.zkoss.zul.South; import org.zkoss.zul.Tab; @@ -115,7 +115,7 @@ public class ZkReportViewer extends Window implements EventListener, ITab /** * */ - private static final long serialVersionUID = -7554542090648903080L; + private static final long serialVersionUID = 2079827289589862794L; /** Window No */ private int m_WindowNo = -1; @@ -547,9 +547,14 @@ public class ZkReportViewer extends Window implements EventListener, ITab { log.log(Level.SEVERE, sql, e); } - StringBuffer sb = new StringBuffer("** ").append(Msg.getMsg(Env.getCtx(), "NewReport")).append(" **"); - KeyNamePair pp = new KeyNamePair(-1, sb.toString()); - comboReport.appendItem(pp.getName(), pp.getKey()); + // IDEMPIERE-297 - Check for Table Access and Window Access for New Report + if ( MRole.getDefault().isTableAccess(MPrintFormat.Table_ID, false) + && MRole.getDefault().getWindowAccess(WINDOW_PRINTFORMAT)) + { + StringBuffer sb = new StringBuffer("** ").append(Msg.getMsg(Env.getCtx(), "NewReport")).append(" **"); + KeyNamePair pp = new KeyNamePair(-1, sb.toString()); + comboReport.appendItem(pp.getName(), pp.getKey()); + } comboReport.addEventListener(Events.ON_SELECT, this); } // fillComboReport