IDEMPIERE-379 Reporting wizard for end users / Peer review and tests

This commit is contained in:
Carlos Ruiz 2012-10-30 22:42:43 -05:00
parent 66c3d210df
commit 3a8d5ce4fe
14 changed files with 129 additions and 285 deletions

View File

@ -0,0 +1 @@
-- Just a placeholder

View File

@ -96,7 +96,7 @@ INSERT INTO AD_ToolBarButton (Name,ComponentName,IsCustomization,KeyStroke_KeyCo
-- Oct 30, 2012 10:00:40 AM COT -- Oct 30, 2012 10:00:40 AM COT
-- IDEMPIERE-379 Reporting wizard for end users -- IDEMPIERE-379 Reporting wizard for end users
UPDATE AD_ToolBarButton SET Name='ReportWizard', ComponentName='Wizard',Updated=TO_DATE('2012-10-30 10:00:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ToolBarButton_ID=200066 UPDATE AD_ToolBarButton SET Name='Report - Wizard', ComponentName='Wizard',Updated=TO_DATE('2012-10-30 10:00:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ToolBarButton_ID=200066
; ;
-- Oct 30, 2012 10:08:19 AM COT -- Oct 30, 2012 10:08:19 AM COT
@ -139,7 +139,6 @@ INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,V
INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200100 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID) INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200100 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID)
; ;
SELECT register_migration_script('923_IDEMPIERE_379.sql') FROM dual SELECT register_migration_script('923_IDEMPIERE_379.sql') FROM dual
; ;

View File

@ -0,0 +1 @@
-- Just a placeholder

View File

@ -94,10 +94,9 @@ INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTransla
INSERT INTO AD_ToolBarButton (Name,ComponentName,IsCustomization,KeyStroke_KeyCode,KeyStroke_Modifiers,AD_Client_ID,AD_Org_ID,Created,CreatedBy,AD_ToolBarButton_ID,Updated,UpdatedBy,IsActive,AD_ToolBarButton_UU,"action") VALUES ('Zk-ReportWizard','org.idempiere.ui.report','N',0,0,0,0,TO_TIMESTAMP('2012-10-29 11:56:09','YYYY-MM-DD HH24:MI:SS'),100,200066,TO_TIMESTAMP('2012-10-29 11:56:09','YYYY-MM-DD HH24:MI:SS'),100,'Y','6009b32b-e28e-4c13-87fc-4df00c5730c9','R') INSERT INTO AD_ToolBarButton (Name,ComponentName,IsCustomization,KeyStroke_KeyCode,KeyStroke_Modifiers,AD_Client_ID,AD_Org_ID,Created,CreatedBy,AD_ToolBarButton_ID,Updated,UpdatedBy,IsActive,AD_ToolBarButton_UU,"action") VALUES ('Zk-ReportWizard','org.idempiere.ui.report','N',0,0,0,0,TO_TIMESTAMP('2012-10-29 11:56:09','YYYY-MM-DD HH24:MI:SS'),100,200066,TO_TIMESTAMP('2012-10-29 11:56:09','YYYY-MM-DD HH24:MI:SS'),100,'Y','6009b32b-e28e-4c13-87fc-4df00c5730c9','R')
; ;
-- Oct 30, 2012 10:00:40 AM COT -- Oct 30, 2012 10:00:40 AM COT
-- IDEMPIERE-379 Reporting wizard for end users -- IDEMPIERE-379 Reporting wizard for end users
UPDATE AD_ToolBarButton SET Name='ReportWizard', ComponentName='Wizard',Updated=TO_TIMESTAMP('2012-10-30 10:00:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ToolBarButton_ID=200066 UPDATE AD_ToolBarButton SET Name='Report - Wizard', ComponentName='Wizard',Updated=TO_TIMESTAMP('2012-10-30 10:00:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ToolBarButton_ID=200066
; ;
-- Oct 30, 2012 10:08:19 AM COT -- Oct 30, 2012 10:08:19 AM COT
@ -130,7 +129,6 @@ UPDATE AD_Message SET MsgText='Fields Displayed',Updated=TO_TIMESTAMP('2012-10-3
UPDATE AD_Message_Trl SET IsTranslated='N' WHERE AD_Message_ID=200091 UPDATE AD_Message_Trl SET IsTranslated='N' WHERE AD_Message_ID=200091
; ;
-- Oct 30, 2012 5:34:18 PM COT -- Oct 30, 2012 5:34:18 PM COT
-- IDEMPIERE-379 Reporting wizard for end users -- IDEMPIERE-379 Reporting wizard for end users
INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('I','Run Report',200100,'D','5638ff96-ff60-49f0-9871-004f7fa2420e','Run','Y',TO_TIMESTAMP('2012-10-30 17:34:15','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_TIMESTAMP('2012-10-30 17:34:15','YYYY-MM-DD HH24:MI:SS')) INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('I','Run Report',200100,'D','5638ff96-ff60-49f0-9871-004f7fa2420e','Run','Y',TO_TIMESTAMP('2012-10-30 17:34:15','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_TIMESTAMP('2012-10-30 17:34:15','YYYY-MM-DD HH24:MI:SS'))

View File

@ -48,6 +48,7 @@ public class SystemIDs
public final static int FORM_PAYMENT_PRINT_EXPORT = 106; public final static int FORM_PAYMENT_PRINT_EXPORT = 106;
public final static int FORM_ARCHIVEVIEWER = 118; public final static int FORM_ARCHIVEVIEWER = 118;
public final static int FORM_REPORT_WIZARD = 200002;
public final static int MENU_NOTICE = 233; public final static int MENU_NOTICE = 233;
@ -154,6 +155,4 @@ public class SystemIDs
public final static int SCHEDULE_10_MINUTES = 200002; public final static int SCHEDULE_10_MINUTES = 200002;
public final static int SCHEDULE_15_MINUTES = 200003; public final static int SCHEDULE_15_MINUTES = 200003;
public final static int WIZARD_REPORT_FORM=200002;
} }

View File

@ -59,7 +59,7 @@ public class MPrintFormat extends X_AD_PrintFormat
/** /**
* *
*/ */
private static final long serialVersionUID = 1246145881920021984L; private static final long serialVersionUID = -8307496567084341384L;
/** /**
* Public Constructor. * Public Constructor.
@ -83,6 +83,10 @@ public class MPrintFormat extends X_AD_PrintFormat
m_items = getItems(); m_items = getItems();
} // MPrintFormat } // MPrintFormat
public void reloadItems() {
m_items = getItems();
}
/** /**
* Load Constructor * Load Constructor
* @param ctx context * @param ctx context

View File

@ -191,6 +191,7 @@ public class ReportEngine implements PrintServiceAttributeListener
public void setPrintFormat (MPrintFormat pf) public void setPrintFormat (MPrintFormat pf)
{ {
m_printFormat = pf; m_printFormat = pf;
pf.reloadItems();
if (m_layout != null) if (m_layout != null)
{ {
setPrintData(); setPrintData();

View File

@ -704,7 +704,7 @@ public class ADSortTab extends Panel implements IADTabpanel
* List Item * List Item
* @author Teo Sarca * @author Teo Sarca
*/ */
public class ListElement extends NamePair { private class ListElement extends NamePair {
/** /**
* *
*/ */

View File

@ -20,7 +20,6 @@ import java.util.Properties;
import java.util.logging.Level; import java.util.logging.Level;
import org.adempiere.webui.apps.AEnv; import org.adempiere.webui.apps.AEnv;
import org.adempiere.webui.apps.WReport;
import org.adempiere.webui.component.Button; import org.adempiere.webui.component.Button;
import org.adempiere.webui.component.ConfirmPanel; import org.adempiere.webui.component.ConfirmPanel;
import org.adempiere.webui.component.Grid; import org.adempiere.webui.component.Grid;
@ -47,7 +46,6 @@ import org.adempiere.webui.window.FDialog;
import org.adempiere.webui.window.ZkReportViewer; import org.adempiere.webui.window.ZkReportViewer;
import org.adempiere.webui.window.ZkReportViewerProvider; import org.adempiere.webui.window.ZkReportViewerProvider;
import org.compiere.model.MRole; import org.compiere.model.MRole;
import org.compiere.model.SystemIDs;
import org.compiere.print.MPrintFormat; import org.compiere.print.MPrintFormat;
import org.compiere.print.MPrintFormatItem; import org.compiere.print.MPrintFormatItem;
import org.compiere.print.ReportEngine; import org.compiere.print.ReportEngine;
@ -66,9 +64,7 @@ import org.zkoss.zul.Filedownload;
import org.zkoss.zul.Foot; import org.zkoss.zul.Foot;
import org.zkoss.zul.Footer; import org.zkoss.zul.Footer;
import org.zkoss.zul.Hbox; import org.zkoss.zul.Hbox;
import org.zkoss.zul.Iframe;
import org.zkoss.zul.Separator; import org.zkoss.zul.Separator;
import org.zkoss.zul.Toolbarbutton;
import org.zkoss.zul.Vbox; import org.zkoss.zul.Vbox;
@ -106,7 +102,7 @@ public class WReportCustomization implements IFormController,EventListener<Even
private Window winExportFile = null; private Window winExportFile = null;
private Listbox cboType = new Listbox(); private Listbox cboType = new Listbox();
private ConfirmPanel confirmPanel = new ConfirmPanel(true); private ConfirmPanel confirmPanel = new ConfirmPanel(true);
public static boolean IsChange=false; public boolean isChange=false;
public ZkReportViewer viewer; public ZkReportViewer viewer;
MPrintFormat fm; MPrintFormat fm;
@ -123,8 +119,6 @@ public class WReportCustomization implements IFormController,EventListener<Even
WRC4GroupingCriteriaPanel tpgc4=new WRC4GroupingCriteriaPanel(); WRC4GroupingCriteriaPanel tpgc4=new WRC4GroupingCriteriaPanel();
WRC5SummaryFieldsPanel tpsf5=new WRC5SummaryFieldsPanel(); WRC5SummaryFieldsPanel tpsf5=new WRC5SummaryFieldsPanel();
private Iframe iframe = new Iframe();
private int oldtabidx = 0; private int oldtabidx = 0;
/** Logger */ /** Logger */
@ -138,12 +132,8 @@ public class WReportCustomization implements IFormController,EventListener<Even
super(); super();
m_WindowNo = SessionManager.getAppDesktop().registerWindow(this); m_WindowNo = SessionManager.getAppDesktop().registerWindow(this);
//dynInit();
} }
/** /**
* Static Layout * Static Layout
* @throws Exception * @throws Exception
@ -157,7 +147,6 @@ public class WReportCustomization implements IFormController,EventListener<Even
{ {
m_ctx = m_reportEngine.getCtx(); m_ctx = m_reportEngine.getCtx();
init(); init();
//dynInit();
} }
catch(Exception e) catch(Exception e)
{ {
@ -166,10 +155,6 @@ public class WReportCustomization implements IFormController,EventListener<Even
} }
} }
public void setViewer(ZkReportViewer parent){
viewer=parent;
}
private void init() private void init()
{ {
@ -237,7 +222,6 @@ public class WReportCustomization implements IFormController,EventListener<Even
tpdf1.init(); tpdf1.init();
tabpanels.appendChild(tpdf1); tabpanels.appendChild(tpdf1);
tpfo2.setReportEngine(m_reportEngine);
tpfo2.setMPrintFormat(fm); tpfo2.setMPrintFormat(fm);
tpfo2.setPrintFormatItems(pfi); tpfo2.setPrintFormatItems(pfi);
tpfo2.setListColumns(); tpfo2.setListColumns();
@ -279,10 +263,11 @@ public class WReportCustomization implements IFormController,EventListener<Even
Grid grid=new Grid(); Grid grid=new Grid();
btnSave = new ToolBarButton(); btnSave = new ToolBarButton();
btnSave.setAttribute("name","btnSave"); btnSave.setAttribute("name","btnSave");
btnSave.setTooltiptext(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "Save")));
btnSave.setImage("/images/Save24.png"); btnSave.setImage("/images/Save24.png");
if(fm.getAD_Client_ID()== 0 || !IsChange) if(fm.getAD_Client_ID()== 0 || !isChange)
{ {
btnSave.setVisible(false); btnSave.setDisabled(true);
} }
btnSave.addEventListener(Events.ON_CLICK, this); btnSave.addEventListener(Events.ON_CLICK, this);
@ -298,65 +283,34 @@ public class WReportCustomization implements IFormController,EventListener<Even
foot.appendChild(bExport); foot.appendChild(bExport);
foot.appendChild(new Separator("vertical")); foot.appendChild(new Separator("vertical"));
} }
bRun=new Button(); bRun=new Button();
bRun.setLabel(Msg.getMsg(Env.getCtx(), "Run")); bRun.setLabel(Msg.getMsg(Env.getCtx(), "Run"));
bRun.setName("bRun"); bRun.setName("bRun");
bRun.addEventListener(Events.ON_CLICK, this); bRun.addEventListener(Events.ON_CLICK, this);
foot.appendChild(bRun); foot.appendChild(bRun);
Separator se =new Separator("vertical"); Separator se =new Separator("vertical");
se.setSpacing("800px"); se.setSpacing("500px");
foot.appendChild(se); foot.appendChild(se);
bnext=new Button(); bnext=new Button();
bnext.setLabel(Msg.getMsg(Env.getCtx(), "NextPage")); bnext.setLabel(Msg.getMsg(Env.getCtx(), "NextPage"));
bnext.setName("Next"); bnext.setName("Next");
bnext.addEventListener(Events.ON_CLICK, this); bnext.addEventListener(Events.ON_CLICK, this);
foot.appendChild(bnext); foot.appendChild(bnext);
foot.appendChild(new Separator("vertical")); foot.appendChild(new Separator("vertical"));
bcancel=new Button(); bcancel=new Button();
bcancel.setName("Cancel"); bcancel.setName("Cancel");
bcancel.addEventListener(Events.ON_CLICK, this); bcancel.addEventListener(Events.ON_CLICK, this);
bcancel.setLabel("Cancel"); bcancel.setLabel("Cancel");
foot.appendChild(bcancel); foot.appendChild(bcancel);
f.appendChild(foot); f.appendChild(foot);
grid.appendChild(f); grid.appendChild(f);
form.appendChild(grid); form.appendChild(grid);
form.setBorder("normal"); form.setBorder("normal");
//renderStep();
}
/*private void renderStep(){
switch (curStep){
case 0:
renderSelectStep();
}
}
private void renderSelectStep()
{
if(stepPanels[0]==null){
stepPanels[0] = new SelectColumnpanel(m_reportEngine.getPrintFormat());
centerPanel.appendChild(stepPanels[0]);
}else{
stepPanels[0].setVisible(true);
}
}*/
private void cleanUp() {
if (m_WindowNo >= 0)
{
SessionManager.getAppDesktop().unregisterWindow(m_WindowNo);
m_ctx = null;
m_WindowNo = -1;
}
} }
@Override @Override
@ -568,13 +522,11 @@ public class WReportCustomization implements IFormController,EventListener<Even
} }
} }
public void close() public void close()
{ {
SessionManager.getAppDesktop().closeActiveWindow(); SessionManager.getAppDesktop().closeActiveWindow();
} }
public void copyFormat(){ public void copyFormat(){
MPrintFormat newpf=MPrintFormat.copyToClient(m_ctx, m_reportEngine.getPrintFormat().get_ID() ,Env.getAD_Client_ID(m_ctx)); MPrintFormat newpf=MPrintFormat.copyToClient(m_ctx, m_reportEngine.getPrintFormat().get_ID() ,Env.getAD_Client_ID(m_ctx));
pfi = newpf.getAllItems("IsPrinted DESC, NULLIF(SeqNo,0), Name"); pfi = newpf.getAllItems("IsPrinted DESC, NULLIF(SeqNo,0), Name");
@ -583,7 +535,6 @@ public class WReportCustomization implements IFormController,EventListener<Even
tpdf1.setPrintFormatItems(pfi); tpdf1.setPrintFormatItems(pfi);
tpdf1.refresh(); tpdf1.refresh();
//tpfo2.setReportEngine(m_reportEngine);
tpfo2.setMPrintFormat(newpf); tpfo2.setMPrintFormat(newpf);
tpfo2.setPrintFormatItems(pfi); tpfo2.setPrintFormatItems(pfi);
tpfo2.setListColumns(); tpfo2.setListColumns();
@ -593,11 +544,9 @@ public class WReportCustomization implements IFormController,EventListener<Even
tpsc3.setPrintFormatItems(pfi); tpsc3.setPrintFormatItems(pfi);
tpsc3.refresh(); tpsc3.refresh();
tpgc4.setMPrintFormat(newpf); tpgc4.setMPrintFormat(newpf);
tpgc4.setPrintFormatItems(pfi); tpgc4.setPrintFormatItems(pfi);
tpsf5.setMPrintFormat(newpf); tpsf5.setMPrintFormat(newpf);
tpsf5.setPrintFormatItems(pfi); tpsf5.setPrintFormatItems(pfi);
tpsf5.refresh(); tpsf5.refresh();
@ -609,23 +558,16 @@ public class WReportCustomization implements IFormController,EventListener<Even
} }
public void setIsChanged(boolean change){ public void setIsChanged(boolean change){
IsChange=change; isChange=change;
if(IsChange){ btnSave.setDisabled(!isChange);
btnSave.setVisible(true); bExport.setDisabled(isChange);
bExport.setVisible(false); bRun.setDisabled(isChange);
bRun.setVisible(false); newPrintFormat.setDisabled(isChange);
newPrintFormat.setVisible(false);
}
else{
btnSave.setVisible(false);
bExport.setVisible(true);
bRun.setVisible(true);
newPrintFormat.setVisible(true);
}
} }
public void runReport(){ public void runReport(){
m_reportEngine.setPrintFormat(m_reportEngine.getPrintFormat()); // reload
new ZkReportViewerProvider().openViewer(m_reportEngine); new ZkReportViewerProvider().openViewer(m_reportEngine);
} }
} }

View File

@ -26,8 +26,6 @@ import org.adempiere.webui.component.Listbox;
import org.adempiere.webui.component.SimpleListModel; import org.adempiere.webui.component.SimpleListModel;
import org.adempiere.webui.component.Window; import org.adempiere.webui.component.Window;
import org.compiere.print.MPrintFormatItem; import org.compiere.print.MPrintFormatItem;
import org.compiere.print.ReportEngine;
import org.compiere.util.CLogger;
import org.compiere.util.KeyNamePair; import org.compiere.util.KeyNamePair;
import org.compiere.util.NamePair; import org.compiere.util.NamePair;
import org.zkoss.zk.au.out.AuFocus; import org.zkoss.zk.au.out.AuFocus;
@ -54,34 +52,10 @@ public class WRC2FieldOrderPanel extends WRCTabPanel implements EventListener<Ev
private Button bDown = new Button(); private Button bDown = new Button();
private ArrayList<MPrintFormatItem> listColumns=new ArrayList<MPrintFormatItem>(); private ArrayList<MPrintFormatItem> listColumns=new ArrayList<MPrintFormatItem>();
Window wind=new Window();
SimpleListModel sortModel; SimpleListModel sortModel;
private ReportEngine m_reportEngine=null;
private static CLogger log = CLogger.getCLogger(WRC2FieldOrderPanel.class);
public WRC2FieldOrderPanel() { public WRC2FieldOrderPanel() {
super(); super();
}
public Window getWind() {
return wind;
}
public void setWind(Window wind) {
this.wind = wind;
}
/**
* Static Layout
* @throws Exception
*/
public void setReportEngine(ReportEngine re) {
m_reportEngine = re;
} }
public void setListColumns() { public void setListColumns() {
@ -93,7 +67,6 @@ public class WRC2FieldOrderPanel extends WRCTabPanel implements EventListener<Ev
} }
} }
} }
} }
public void init() public void init()
@ -174,7 +147,6 @@ public class WRC2FieldOrderPanel extends WRCTabPanel implements EventListener<Ev
ListHeader header=new ListHeader(); ListHeader header=new ListHeader();
header.setParent(listHead); header.setParent(listHead);
hlayout.appendChild(sortList); hlayout.appendChild(sortList);
EventListener actionListener = new EventListener() EventListener actionListener = new EventListener()
@ -200,11 +172,9 @@ public class WRC2FieldOrderPanel extends WRCTabPanel implements EventListener<Ev
} }
@Override @Override
public void onEvent(Event event) throws Exception { public void onEvent(Event event) throws Exception {
} }
@Override @Override
@ -247,13 +217,6 @@ public class WRC2FieldOrderPanel extends WRCTabPanel implements EventListener<Ev
@Override @Override
public void updatePFI() { public void updatePFI() {
// TODO Auto-generated method stub
}
public void updateSortModel(){
sortList.removeAllItems();
// SortList=SortModel;
} }

View File

@ -28,8 +28,6 @@ import org.adempiere.webui.component.ListItem;
import org.adempiere.webui.component.Listbox; import org.adempiere.webui.component.Listbox;
import org.adempiere.webui.component.SimpleListModel; import org.adempiere.webui.component.SimpleListModel;
import org.compiere.print.MPrintFormatItem; import org.compiere.print.MPrintFormatItem;
import org.compiere.print.ReportEngine;
import org.compiere.util.CLogger;
import org.compiere.util.KeyNamePair; import org.compiere.util.KeyNamePair;
import org.compiere.util.NamePair; import org.compiere.util.NamePair;
import org.zkoss.zk.au.out.AuFocus; import org.zkoss.zk.au.out.AuFocus;
@ -48,10 +46,6 @@ public class WRC3SortCriteriaPanel extends WRCTabPanel implements EventListener
*/ */
private static final long serialVersionUID = -2798618953887598651L; private static final long serialVersionUID = -2798618953887598651L;
private ReportEngine m_reportEngine;
private static CLogger log = CLogger.getCLogger(WRC3SortCriteriaPanel.class);
// UI variables // UI variables
private Label noLabel = new Label(); private Label noLabel = new Label();
private Label yesLabel = new Label(); private Label yesLabel = new Label();
@ -59,7 +53,6 @@ public class WRC3SortCriteriaPanel extends WRCTabPanel implements EventListener
private Button bRemove = new Button(); private Button bRemove = new Button();
private Button bUp = new Button(); private Button bUp = new Button();
private Button bDown = new Button(); private Button bDown = new Button();
//private AbstractADWindowContent adWindowPanel = null;
public ArrayList<MPrintFormatItem> yesItems=new ArrayList<MPrintFormatItem>(); public ArrayList<MPrintFormatItem> yesItems=new ArrayList<MPrintFormatItem>();
public ArrayList<MPrintFormatItem> noItems=new ArrayList<MPrintFormatItem>(); public ArrayList<MPrintFormatItem> noItems=new ArrayList<MPrintFormatItem>();
@ -72,16 +65,6 @@ public class WRC3SortCriteriaPanel extends WRCTabPanel implements EventListener
public WRC3SortCriteriaPanel() { public WRC3SortCriteriaPanel() {
super(); super();
//m_WindowNo = SessionManager.getAppDesktop().registerWindow(this);
}
/**
* Static Layout
* @throws Exception
*/
public void setReportEngine(ReportEngine re) {
m_reportEngine = re;
} }
public void init() public void init()
@ -128,7 +111,6 @@ public class WRC3SortCriteriaPanel extends WRCTabPanel implements EventListener
yesList.setItemDraggable(true); yesList.setItemDraggable(true);
noList.setItemDraggable(true); noList.setItemDraggable(true);
EventListener yesListMouseMotionListener = new EventListener() EventListener yesListMouseMotionListener = new EventListener()
{ {
public void onEvent(Event event) throws Exception { public void onEvent(Event event) throws Exception {
@ -193,8 +175,6 @@ public class WRC3SortCriteriaPanel extends WRCTabPanel implements EventListener
listHeader.appendChild(noLabel); listHeader.appendChild(noLabel);
listHeader.setParent(listHead); listHeader.setParent(listHead);
Hlayout hlayout = new Hlayout(); Hlayout hlayout = new Hlayout();
hlayout.setVflex("true"); hlayout.setVflex("true");
hlayout.setHflex("true"); hlayout.setHflex("true");
@ -235,12 +215,8 @@ public class WRC3SortCriteriaPanel extends WRCTabPanel implements EventListener
this.appendChild(hlayout); this.appendChild(hlayout);
} }
@Override @Override
public void onEvent(Event event) throws Exception { public void onEvent(Event event) throws Exception {
// TODO Auto-generated method stub
} }
@ -310,12 +286,9 @@ public class WRC3SortCriteriaPanel extends WRCTabPanel implements EventListener
} }
} }
@Override @Override
public void updatePFI() { public void updatePFI() {
// pfi is being updated on every refresh // pfi is being updated on every refresh
} }
/** /**
@ -373,7 +346,7 @@ public class WRC3SortCriteriaPanel extends WRCTabPanel implements EventListener
* Move within Yes List * Move within Yes List
* @param event event * @param event event
*/ */
void migrateValueWithinYesList (Event event) private void migrateValueWithinYesList (Event event)
{ {
Object[] selObjects = yesList.getSelectedItems().toArray(); Object[] selObjects = yesList.getSelectedItems().toArray();
if (selObjects == null) if (selObjects == null)
@ -432,7 +405,6 @@ public class WRC3SortCriteriaPanel extends WRCTabPanel implements EventListener
} }
} // migrateValueWithinYesList } // migrateValueWithinYesList
public void updateYesList(){ public void updateYesList(){
yesList.removeAllItems(); yesList.removeAllItems();
wc.setIsChanged(true); wc.setIsChanged(true);
@ -449,10 +421,9 @@ public class WRC3SortCriteriaPanel extends WRCTabPanel implements EventListener
sortNo=sortNo+10; sortNo=sortNo+10;
} }
} }
}
} }
}
/** /**
* List Item * List Item
*/ */
@ -501,8 +472,6 @@ public class WRC3SortCriteriaPanel extends WRCTabPanel implements EventListener
return m_AD_Org_ID; return m_AD_Org_ID;
} }
@Override @Override
public String getID() { public String getID() {
return m_key != -1 ? String.valueOf(m_key) : null; return m_key != -1 ? String.valueOf(m_key) : null;

View File

@ -23,7 +23,6 @@ import org.adempiere.webui.component.Grid;
import org.adempiere.webui.component.Row; import org.adempiere.webui.component.Row;
import org.adempiere.webui.component.Rows; import org.adempiere.webui.component.Rows;
import org.adempiere.webui.component.Window; import org.adempiere.webui.component.Window;
import org.compiere.print.MPrintFormat;
import org.compiere.print.MPrintFormatItem; import org.compiere.print.MPrintFormatItem;
import org.zkoss.zk.ui.event.Event; import org.zkoss.zk.ui.event.Event;
import org.zkoss.zk.ui.event.EventListener; import org.zkoss.zk.ui.event.EventListener;
@ -37,7 +36,6 @@ public class WRC4GroupingCriteriaPanel extends WRCTabPanel implements EventListe
private static final long serialVersionUID = -3142169077710161360L; private static final long serialVersionUID = -3142169077710161360L;
private static final int RENDER_IN_COLUMNS=2; private static final int RENDER_IN_COLUMNS=2;
private MPrintFormat m_printFormat;
Checkbox m_chkboxes[]=null; Checkbox m_chkboxes[]=null;
String m_oldLabel[]=null; String m_oldLabel[]=null;
ArrayList<MPrintFormatItem> orderfield=new ArrayList<MPrintFormatItem>(); ArrayList<MPrintFormatItem> orderfield=new ArrayList<MPrintFormatItem>();
@ -47,7 +45,6 @@ public class WRC4GroupingCriteriaPanel extends WRCTabPanel implements EventListe
super(); super();
} }
@Override @Override
public void refresh() { public void refresh() {
orderfield = new ArrayList<MPrintFormatItem>(); orderfield = new ArrayList<MPrintFormatItem>();
@ -61,7 +58,6 @@ public class WRC4GroupingCriteriaPanel extends WRCTabPanel implements EventListe
@Override @Override
public void updatePFI() { public void updatePFI() {
for(int i=0 ; i<orderfield.size() ; i++){ for(int i=0 ; i<orderfield.size() ; i++){
for(int j=0 ;j<m_pfi.length ; j++){ for(int j=0 ;j<m_pfi.length ; j++){
if(orderfield.get(i).get_ID() == m_pfi[j].get_ID()){ if(orderfield.get(i).get_ID() == m_pfi[j].get_ID()){
@ -69,14 +65,13 @@ public class WRC4GroupingCriteriaPanel extends WRCTabPanel implements EventListe
} }
} }
} }
} }
@Override @Override
public void onEvent(Event event) throws Exception { public void onEvent(Event event) throws Exception {
if (Events.ON_CHECK.equals(event.getName())) { if (Events.ON_CHECK.equals(event.getName())) {
wc.setIsChanged(true); wc.setIsChanged(true);
} }
} }
public void init(){ public void init(){
@ -86,7 +81,6 @@ public class WRC4GroupingCriteriaPanel extends WRCTabPanel implements EventListe
wind.setHeight("100%"); wind.setHeight("100%");
wind.setHflex("1"); wind.setHflex("1");
grid.setHflex("1"); grid.setHflex("1");
grid.setHeight("90%"); grid.setHeight("90%");
grid.setVflex(true); grid.setVflex(true);
@ -109,22 +103,16 @@ public class WRC4GroupingCriteriaPanel extends WRCTabPanel implements EventListe
} }
grid.appendChild(columns); grid.appendChild(columns);
this.appendChild(wind); this.appendChild(wind);
wind.appendChild(grid); wind.appendChild(grid);
} }
public void dynamicInit() public void dynamicInit()
{ {
if (grid.getRows() != null) if (grid.getRows() != null)
grid.removeChild(grid.getRows()); grid.removeChild(grid.getRows());
m_chkboxes = new Checkbox[orderfield.size()]; m_chkboxes = new Checkbox[orderfield.size()];
m_oldLabel = new String[orderfield.size()]; m_oldLabel = new String[orderfield.size()];
int curCol=0; int curCol=0;
@ -150,7 +138,6 @@ public class WRC4GroupingCriteriaPanel extends WRCTabPanel implements EventListe
} }
grid.appendChild(rows); grid.appendChild(rows);
} }
} }

View File

@ -24,7 +24,6 @@ import org.adempiere.webui.component.Grid;
import org.adempiere.webui.component.Label; import org.adempiere.webui.component.Label;
import org.adempiere.webui.component.Rows; import org.adempiere.webui.component.Rows;
import org.adempiere.webui.component.Window; import org.adempiere.webui.component.Window;
import org.compiere.print.MPrintFormat;
import org.compiere.print.MPrintFormatItem; import org.compiere.print.MPrintFormatItem;
import org.compiere.util.Env; import org.compiere.util.Env;
import org.compiere.util.Msg; import org.compiere.util.Msg;
@ -34,8 +33,6 @@ import org.zkoss.zk.ui.event.Events;
import org.zkoss.zul.Div; import org.zkoss.zul.Div;
import org.zkoss.zul.Row; import org.zkoss.zul.Row;
public class WRC5SummaryFieldsPanel extends WRCTabPanel implements EventListener<Event> { public class WRC5SummaryFieldsPanel extends WRCTabPanel implements EventListener<Event> {
/** /**
* *
@ -43,7 +40,6 @@ public class WRC5SummaryFieldsPanel extends WRCTabPanel implements EventListener
private static final long serialVersionUID = -2231369601903381581L; private static final long serialVersionUID = -2231369601903381581L;
private static final int RENDER_IN_COLUMNS=10; private static final int RENDER_IN_COLUMNS=10;
private MPrintFormat m_printFormat;
Checkbox m_chkSum[]=null; Checkbox m_chkSum[]=null;
Checkbox m_chkCount[]=null; Checkbox m_chkCount[]=null;
Checkbox m_chkMin[]=null; Checkbox m_chkMin[]=null;
@ -58,14 +54,12 @@ public class WRC5SummaryFieldsPanel extends WRCTabPanel implements EventListener
super(); super();
} }
public void init(){ public void init(){
Window wind=new Window(); Window wind=new Window();
wind.setWidth("90%"); wind.setWidth("90%");
wind.setHeight("100%"); wind.setHeight("100%");
wind.setHflex("1"); wind.setHflex("1");
grid.setHflex("1"); grid.setHflex("1");
grid.setHeight("90%"); grid.setHeight("90%");
grid.setVflex(true); grid.setVflex(true);
@ -78,7 +72,6 @@ public class WRC5SummaryFieldsPanel extends WRCTabPanel implements EventListener
wind.appendChild(div); wind.appendChild(div);
this.appendChild(wind); this.appendChild(wind);
if (AEnv.isTablet()) if (AEnv.isTablet())
{ {
LayoutUtils.addSclass("tablet-scrolling", div); LayoutUtils.addSclass("tablet-scrolling", div);
@ -88,14 +81,11 @@ public class WRC5SummaryFieldsPanel extends WRCTabPanel implements EventListener
grid.appendChild(columns); grid.appendChild(columns);
Column cols[] = new Column[RENDER_IN_COLUMNS]; Column cols[] = new Column[RENDER_IN_COLUMNS];
int width = 100/RENDER_IN_COLUMNS; int width = 100/RENDER_IN_COLUMNS;
int widthChk = width/5;
for(int i=0;i<RENDER_IN_COLUMNS;i++){ for(int i=0;i<RENDER_IN_COLUMNS;i++){
cols[i] = new Column(); cols[i] = new Column();
cols[i].setWidth(width+"%"); cols[i].setWidth(width+"%");
columns.appendChild(cols[i]); columns.appendChild(cols[i]);
} }
} }
@Override @Override
@ -123,9 +113,7 @@ public class WRC5SummaryFieldsPanel extends WRCTabPanel implements EventListener
m_pfi[j].setIsDeviationCalc(m_chkDesviation[i].isChecked()); m_pfi[j].setIsDeviationCalc(m_chkDesviation[i].isChecked());
} }
} }
} }
} }
@Override @Override
@ -133,7 +121,6 @@ public class WRC5SummaryFieldsPanel extends WRCTabPanel implements EventListener
if (Events.ON_CHECK.equals(event.getName())) { if (Events.ON_CHECK.equals(event.getName())) {
wc.setIsChanged(true); wc.setIsChanged(true);
} }
} }
public void dynamicInit(){ public void dynamicInit(){
@ -170,7 +157,6 @@ public class WRC5SummaryFieldsPanel extends WRCTabPanel implements EventListener
m_chkVariance=new Checkbox[DisplayItems.size()]; m_chkVariance=new Checkbox[DisplayItems.size()];
m_chkDesviation=new Checkbox[DisplayItems.size()]; m_chkDesviation=new Checkbox[DisplayItems.size()];
for(int i=0 ;i<DisplayItems.size(); i++){ for(int i=0 ;i<DisplayItems.size(); i++){
row=new Row(); row=new Row();
String strValue = DisplayItems.get(i).getPrintName(); String strValue = DisplayItems.get(i).getPrintName();

View File

@ -124,7 +124,7 @@ public class ZkReportViewer extends Window implements EventListener<Event>, ITab
/** /**
* *
*/ */
private static final long serialVersionUID = 2079827289589862794L; private static final long serialVersionUID = 344552813342946104L;
/** Window No */ /** Window No */
private int m_WindowNo = -1; private int m_WindowNo = -1;
@ -314,7 +314,6 @@ public class ZkReportViewer extends Window implements EventListener<Event>, ITab
toolBar.appendChild(bWizard); toolBar.appendChild(bWizard);
bWizard.addEventListener(Events.ON_CLICK, this); bWizard.addEventListener(Events.ON_CLICK, this);
North north = new North(); North north = new North();
layout.appendChild(north); layout.appendChild(north);
north.appendChild(toolBar); north.appendChild(toolBar);
@ -923,7 +922,7 @@ public class ZkReportViewer extends Window implements EventListener<Event>, ITab
/** /**
* Report Combo - Start other Report or create new one * Report Combo - Start other Report or create new one
*/ */
public void cmd_report() private void cmd_report()
{ {
ListItem li = comboReport.getSelectedItem(); ListItem li = comboReport.getSelectedItem();
if(li == null || li.getValue() == null) return; if(li == null || li.getValue() == null) return;
@ -1104,23 +1103,18 @@ public class ZkReportViewer extends Window implements EventListener<Event>, ITab
/*IDEMPIERE -379*/ /*IDEMPIERE -379*/
private void cmd_Wizard() private void cmd_Wizard()
{ {
int AD_Window_ID = WINDOW_PRINTFORMAT; // hardcoded
int AD_PrintFormat_ID = m_reportEngine.getPrintFormat().get_ID(); int AD_PrintFormat_ID = m_reportEngine.getPrintFormat().get_ID();
Env.setContext(m_ctx, "AD_PrintFormat_ID", AD_PrintFormat_ID); Env.setContext(m_ctx, "AD_PrintFormat_ID", AD_PrintFormat_ID);
ADForm form = ADForm.openForm(SystemIDs.WIZARD_REPORT_FORM); ADForm form = ADForm.openForm(SystemIDs.FORM_REPORT_WIZARD);
WReportCustomization av = (WReportCustomization) form.getICustomForm(); WReportCustomization av = (WReportCustomization) form.getICustomForm();
av.setReportEngine(m_reportEngine); av.setReportEngine(m_reportEngine);
form.setAttribute(Window.MODE_KEY, Window.MODE_EMBEDDED); form.setAttribute(Window.MODE_KEY, Window.MODE_EMBEDDED);
SessionManager.getAppDesktop().showWindow(form); SessionManager.getAppDesktop().showWindow(form);
} // cmd_Wizard
//ZkReportCustomization zkCustomization = new ZkReportCustomization(m_reportEngine);
//zkCustomization.setAttribute(Window.MODE_KEY, Window.MODE_EMBEDDED);
//zkCustomization.setAttribute(Window.INSERT_POSITION_KEY, Window.INSERT_NEXT);
//SessionManager.getAppDesktop().showWindow(zkCustomization);
} // cmd_customize
//-- ComponentCtrl --// //-- ComponentCtrl --//
public Object getExtraCtrl() { public Object getExtraCtrl() {
return new ExtraCtrl(); return new ExtraCtrl();