IDEMPIERE-5593 - Drill Rule: Do not render Drill Rules for the same Report (#1692)
* IDEMPIERE-5593 - Drill Rule: Do not render Drill Rules for the same Report * IDEMPIERE-5593 - fixes
This commit is contained in:
parent
36613c467e
commit
8ede4bd048
|
@ -453,17 +453,27 @@ public final class AEnv
|
||||||
/**
|
/**
|
||||||
* Opens the Drill Assistant
|
* Opens the Drill Assistant
|
||||||
* @param data query
|
* @param data query
|
||||||
* @param component
|
* @param windowNo
|
||||||
*/
|
*/
|
||||||
public static void actionDrill(DrillData data, int windowNo) {
|
public static void actionDrill(DrillData data, int windowNo) {
|
||||||
int AD_Table_ID = MTable.getTable_ID(data.getQuery().getTableName());
|
actionDrill(data, windowNo, 0);
|
||||||
if (!MRole.getDefault().isCanReport(AD_Table_ID))
|
}
|
||||||
{
|
|
||||||
Dialog.error(windowNo, "AccessCannotReport", data.getQuery().getTableName());
|
/**
|
||||||
return;
|
* Opens the Drill Assistant
|
||||||
}
|
* @param data query
|
||||||
|
* @param windowNo
|
||||||
|
* @param processID Source Report
|
||||||
|
*/
|
||||||
|
public static void actionDrill(DrillData data, int windowNo, int processID) {
|
||||||
|
int AD_Table_ID = MTable.getTable_ID(data.getQuery().getTableName());
|
||||||
if (AD_Table_ID > 0) {
|
if (AD_Table_ID > 0) {
|
||||||
WDrillReport drillReport = new WDrillReport(data, windowNo);
|
if (!MRole.getDefault().isCanReport(AD_Table_ID))
|
||||||
|
{
|
||||||
|
Dialog.error(windowNo, "AccessCannotReport", data.getQuery().getTableName());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
WDrillReport drillReport = new WDrillReport(data, windowNo, processID);
|
||||||
|
|
||||||
Object window = SessionManager.getAppDesktop().findWindow(windowNo);
|
Object window = SessionManager.getAppDesktop().findWindow(windowNo);
|
||||||
if (window != null && window instanceof Component && window instanceof ISupportMask){
|
if (window != null && window instanceof Component && window instanceof ISupportMask){
|
||||||
|
|
|
@ -105,10 +105,20 @@ public class WDrillReport extends Window implements EventListener<Event> {
|
||||||
* @param data
|
* @param data
|
||||||
* @param WindowNo
|
* @param WindowNo
|
||||||
*/
|
*/
|
||||||
public WDrillReport(DrillData data, int WindowNo) {
|
public WDrillReport(DrillData data, int windowNo) {
|
||||||
|
this(data, windowNo, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param data
|
||||||
|
* @param WindowNo
|
||||||
|
* @param processID
|
||||||
|
*/
|
||||||
|
public WDrillReport(DrillData data, int windowNo, int processID) {
|
||||||
super();
|
super();
|
||||||
this.windowNo = WindowNo;
|
this.windowNo = windowNo;
|
||||||
drillReportCtl = new DrillReportCtl(data.getQuery().getTableName(), data.getQuery(), data.getColumnName(), data.getValue(), data.getDisplayValue(), WindowNo);
|
drillReportCtl = new DrillReportCtl(data.getQuery().getTableName(), data.getQuery(), data.getColumnName(), data.getValue(), data.getDisplayValue(), windowNo, processID);
|
||||||
|
|
||||||
this.setTitle(Msg.getMsg(Env.getCtx(), "DrillAssistant"));
|
this.setTitle(Msg.getMsg(Env.getCtx(), "DrillAssistant"));
|
||||||
this.setClosable(true);
|
this.setClosable(true);
|
||||||
|
|
|
@ -175,6 +175,8 @@ public class ZkReportViewer extends Window implements EventListener<Event>, ITab
|
||||||
/** Table ID */
|
/** Table ID */
|
||||||
private int m_AD_Table_ID = 0;
|
private int m_AD_Table_ID = 0;
|
||||||
private boolean m_isCanExport;
|
private boolean m_isCanExport;
|
||||||
|
/** Process ID */
|
||||||
|
private int m_AD_Process_ID = 0;
|
||||||
|
|
||||||
private MQuery m_ddQ = null;
|
private MQuery m_ddQ = null;
|
||||||
private MQuery m_daQ = null;
|
private MQuery m_daQ = null;
|
||||||
|
@ -787,8 +789,8 @@ public class ZkReportViewer extends Window implements EventListener<Event>, ITab
|
||||||
int AD_Window_ID = Env.getContextAsInt(Env.getCtx(), m_reportEngine.getWindowNo(), "_WinInfo_AD_Window_ID", true);
|
int AD_Window_ID = Env.getContextAsInt(Env.getCtx(), m_reportEngine.getWindowNo(), "_WinInfo_AD_Window_ID", true);
|
||||||
if (AD_Window_ID == 0)
|
if (AD_Window_ID == 0)
|
||||||
AD_Window_ID = Env.getZoomWindowID(m_reportEngine.getQuery());
|
AD_Window_ID = Env.getZoomWindowID(m_reportEngine.getQuery());
|
||||||
int AD_Process_ID = m_reportEngine.getPrintInfo() != null ? m_reportEngine.getPrintInfo().getAD_Process_ID() : 0;
|
m_AD_Process_ID = m_reportEngine.getPrintInfo() != null ? m_reportEngine.getPrintInfo().getAD_Process_ID() : 0;
|
||||||
updateToolbarAccess(AD_Window_ID, AD_Process_ID);
|
updateToolbarAccess(AD_Window_ID, m_AD_Process_ID);
|
||||||
|
|
||||||
this.setBorder("normal");
|
this.setBorder("normal");
|
||||||
|
|
||||||
|
@ -814,7 +816,7 @@ public class ZkReportViewer extends Window implements EventListener<Event>, ITab
|
||||||
DrillEvent de = (DrillEvent) event;
|
DrillEvent de = (DrillEvent) event;
|
||||||
if (de.getData() != null && de.getData() instanceof DrillData) {
|
if (de.getData() != null && de.getData() instanceof DrillData) {
|
||||||
DrillData data = (DrillData) de.getData();
|
DrillData data = (DrillData) de.getData();
|
||||||
AEnv.actionDrill(data, m_WindowNo);
|
AEnv.actionDrill(data, m_WindowNo, m_AD_Process_ID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -81,6 +81,9 @@ public class DrillReportCtl {
|
||||||
|
|
||||||
private String m_DisplayValue;
|
private String m_DisplayValue;
|
||||||
|
|
||||||
|
/** Process ID of the source Report */
|
||||||
|
private int m_AD_Process_ID;
|
||||||
|
|
||||||
/** Drill Tables Map */
|
/** Drill Tables Map */
|
||||||
private KeyNamePair[] drillTables;
|
private KeyNamePair[] drillTables;
|
||||||
|
|
||||||
|
@ -95,20 +98,21 @@ public class DrillReportCtl {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param ctx
|
|
||||||
* @param TableName
|
* @param TableName
|
||||||
* @param query
|
* @param query
|
||||||
* @param ColumnName
|
* @param ColumnName
|
||||||
* @param Value
|
* @param Value
|
||||||
* @param displayValue
|
* @param displayValue
|
||||||
* @param WindowNo
|
* @param WindowNo
|
||||||
|
* @param processID
|
||||||
*/
|
*/
|
||||||
public DrillReportCtl(String TableName, MQuery query, String ColumnName, Object Value, String displayValue, int WindowNo) {
|
public DrillReportCtl(String TableName, MQuery query, String ColumnName, Object Value, String displayValue, int WindowNo, int processID) {
|
||||||
this.m_TableName = TableName;
|
this.m_TableName = TableName;
|
||||||
this.m_ColumnName = ColumnName;
|
this.m_ColumnName = ColumnName;
|
||||||
this.m_Value = Value;
|
this.m_Value = Value;
|
||||||
this.m_WindowNo = WindowNo;
|
this.m_WindowNo = WindowNo;
|
||||||
this.m_DisplayValue = displayValue;
|
this.m_DisplayValue = displayValue;
|
||||||
|
this.m_AD_Process_ID = processID;
|
||||||
|
|
||||||
m_Query = query;
|
m_Query = query;
|
||||||
|
|
||||||
|
@ -179,9 +183,9 @@ public class DrillReportCtl {
|
||||||
if(!Util.isEmpty(m_ColumnName)) {
|
if(!Util.isEmpty(m_ColumnName)) {
|
||||||
MProcessDrillRule[] processDrillRules = MProcessDrillRule.getByColumnName(Env.getCtx(), m_ColumnName, null);
|
MProcessDrillRule[] processDrillRules = MProcessDrillRule.getByColumnName(Env.getCtx(), m_ColumnName, null);
|
||||||
for( MProcessDrillRule drillProcesRule: processDrillRules) {
|
for( MProcessDrillRule drillProcesRule: processDrillRules) {
|
||||||
MProcess process = MProcess.get(drillProcesRule.getAD_Process_ID());
|
if (drillProcesRule.getAD_Process_ID() == 0 || drillProcesRule.getAD_Process_ID() == m_AD_Process_ID)
|
||||||
if(process == null)
|
|
||||||
continue;
|
continue;
|
||||||
|
MProcess process = MProcess.get(drillProcesRule.getAD_Process_ID());
|
||||||
|
|
||||||
drillProcessMap.put(drillProcesRule.getAD_Process_ID(), process.get_Translation(MProcess.COLUMNNAME_Name));
|
drillProcessMap.put(drillProcesRule.getAD_Process_ID(), process.get_Translation(MProcess.COLUMNNAME_Name));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue