IDEMPIERE-970 Role with the can Export option deselected would actually be able to export

This commit is contained in:
Carlos Augusto Sanchez 2013-05-28 12:41:00 -05:00
parent abd6335c97
commit 56b2edf731
2 changed files with 33 additions and 16 deletions

View File

@ -88,6 +88,7 @@ public class ReportAction implements EventListener<Event>
public void show() public void show()
{ {
final boolean isCanExport=MRole.getDefault().isCanExport();
if(winReport == null) if(winReport == null)
{ {
winReport = new Window(); winReport = new Window();
@ -119,10 +120,13 @@ public class ReportAction implements EventListener<Event>
chkCurrentRowOnly.setLabel(Msg.getMsg(Env.getCtx(), "CurrentRowOnly")); chkCurrentRowOnly.setLabel(Msg.getMsg(Env.getCtx(), "CurrentRowOnly"));
chkCurrentRowOnly.setSelected(false); chkCurrentRowOnly.setSelected(false);
chkExport.setLabel(Msg.getMsg(Env.getCtx(), "Export")); if( isCanExport )
chkExport.setSelected(false); {
chkExport.setLabel(Msg.getMsg(Env.getCtx(), "Export"));
chkExport.setSelected(false);
}
chkAllColumns.setLabel(Msg.getMsg(Env.getCtx(), "AllColumns")); chkAllColumns.setLabel(Msg.getMsg(Env.getCtx(), "AllColumns"));
chkAllColumns.setSelected(false); chkAllColumns.setSelected(false);
li = cboPrintFormat.getSelectedItem(); li = cboPrintFormat.getSelectedItem();
@ -151,13 +155,21 @@ public class ReportAction implements EventListener<Event>
vb.appendChild(chkCurrentRowOnly); vb.appendChild(chkCurrentRowOnly);
hb = new Hbox();
hb.setAlign("center");
hb.appendChild(chkExport); if ( isCanExport )
chkExport.addEventListener(Events.ON_CHECK, this); {
hb.appendChild(cboExportType); hb = new Hbox();
cboExportType.setWidth("100%"); hb.setAlign("center");
vb.appendChild(hb); hb.appendChild(chkExport);
chkExport.addEventListener(Events.ON_CHECK, this);
hb.appendChild(cboExportType);
cboExportType.setWidth("100%");
vb.appendChild(hb);
}
vb.appendChild(chkAllColumns); vb.appendChild(chkAllColumns);

View File

@ -234,9 +234,14 @@ public class ZkReportViewer extends Window implements EventListener<Event>, ITab
toolBar.setWidth("100%"); toolBar.setWidth("100%");
previewType.setMold("select"); previewType.setMold("select");
previewType.appendItem("PDF", "PDF");
previewType.appendItem("HTML", "HTML"); previewType.appendItem("HTML", "HTML");
previewType.appendItem("Excel", "XLS");
if ( m_isCanExport )
{
previewType.appendItem("PDF", "PDF");
previewType.appendItem("Excel", "XLS");
}
toolBar.appendChild(previewType); toolBar.appendChild(previewType);
previewType.addEventListener(Events.ON_SELECT, this); previewType.addEventListener(Events.ON_SELECT, this);
toolBar.appendChild(new Separator("vertical")); toolBar.appendChild(new Separator("vertical"));
@ -247,9 +252,9 @@ public class ZkReportViewer extends Window implements EventListener<Event>, ITab
? MSysConfig.getValue(MSysConfig.ZK_REPORT_FORM_OUTPUT_TYPE,"PDF",Env.getAD_Client_ID(m_ctx),Env.getAD_Org_ID(m_ctx)) ? MSysConfig.getValue(MSysConfig.ZK_REPORT_FORM_OUTPUT_TYPE,"PDF",Env.getAD_Client_ID(m_ctx),Env.getAD_Org_ID(m_ctx))
: MSysConfig.getValue(MSysConfig.ZK_REPORT_TABLE_OUTPUT_TYPE,"PDF",Env.getAD_Client_ID(m_ctx),Env.getAD_Org_ID(m_ctx)); : MSysConfig.getValue(MSysConfig.ZK_REPORT_TABLE_OUTPUT_TYPE,"PDF",Env.getAD_Client_ID(m_ctx),Env.getAD_Org_ID(m_ctx));
if ("PDF".equals(type)) if ("HTML".equals(type))
previewType.setSelectedIndex(0); previewType.setSelectedIndex(0);
else if ("HTML".equals(type)) else if ("PDF".equals(type))
previewType.setSelectedIndex(1); previewType.setSelectedIndex(1);
else if ("XLS".equals(type)) else if ("XLS".equals(type))
previewType.setSelectedIndex(2); previewType.setSelectedIndex(2);
@ -306,7 +311,7 @@ public class ZkReportViewer extends Window implements EventListener<Event>, ITab
toolBar.appendChild(bArchive); toolBar.appendChild(bArchive);
bArchive.addEventListener(Events.ON_CLICK, this); bArchive.addEventListener(Events.ON_CLICK, this);
if (m_isCanExport) if ( m_isCanExport )
{ {
bExport.setName("Export"); bExport.setName("Export");
bExport.setImage(ThemeManager.getThemeResource("images/Export24.png")); bExport.setImage(ThemeManager.getThemeResource("images/Export24.png"));