Search in sources :

Example 1 with InfoSchedule

use of org.adempiere.webui.window.InfoSchedule in project adempiere by adempiere.

the class DPViews method onEvent.

public void onEvent(Event event) {
    Component comp = event.getTarget();
    String eventName = event.getName();
    if (eventName.equals(Events.ON_CLICK)) {
        if (comp instanceof Button) {
            Button btn = (Button) comp;
            String actionCommand = btn.getName();
            int WindowNo = 0;
            if (actionCommand.equals("InfoProduct") && AEnv.canAccessInfo("PRODUCT")) {
                InfoPanel.showProduct(WindowNo);
            } else if (actionCommand.equals("InfoBPartner") && AEnv.canAccessInfo("BPARTNER")) {
                InfoPanel.showBPartner(WindowNo);
            } else if (actionCommand.equals("InfoAsset") && AEnv.canAccessInfo("ASSET")) {
                InfoPanel.showAsset(WindowNo);
            } else if (actionCommand.equals("InfoAccount") && MRole.getDefault().isShowAcct() && AEnv.canAccessInfo("ACCOUNT")) {
                new org.adempiere.webui.acct.WAcctViewer();
            } else if (actionCommand.equals("InfoSchedule") && AEnv.canAccessInfo("SCHEDULE")) {
                new InfoSchedule(null, false);
            } else if (actionCommand.equals("InfoOrder") && AEnv.canAccessInfo("ORDER")) {
                InfoPanel.showOrder(WindowNo, "");
            } else if (actionCommand.equals("InfoInvoice") && AEnv.canAccessInfo("INVOICE")) {
                InfoPanel.showInvoice(WindowNo, "");
            } else if (actionCommand.equals("InfoInOut") && AEnv.canAccessInfo("INOUT")) {
                InfoPanel.showInOut(WindowNo, "");
            } else if (actionCommand.equals("InfoPayment") && AEnv.canAccessInfo("PAYMENT")) {
                InfoPanel.showPayment(WindowNo, "");
            } else if (actionCommand.equals("InfoCashLine") && AEnv.canAccessInfo("CASHJOURNAL")) {
                InfoPanel.showCashLine(WindowNo, "");
            } else if (actionCommand.equals("InfoAssignment") && AEnv.canAccessInfo("RESOURCE")) {
                InfoPanel.showAssignment(WindowNo, "");
            }
        }
    }
}
Also used : Button(org.adempiere.webui.component.Button) InfoSchedule(org.adempiere.webui.window.InfoSchedule) Component(org.zkoss.zk.ui.Component)

Example 2 with InfoSchedule

use of org.adempiere.webui.window.InfoSchedule in project adempiere by adempiere.

the class WAssignmentEditor method onEvent.

public void onEvent(Event event) throws Exception {
    //
    if (Events.ON_CLICK.equalsIgnoreCase(event.getName())) {
        Integer oldValue = (Integer) getValue();
        int S_ResourceAssignment_ID = oldValue == null ? 0 : oldValue.intValue();
        MResourceAssignment ma = new MResourceAssignment(Env.getCtx(), S_ResourceAssignment_ID, null);
        if (S_ResourceAssignment_ID == 0) {
            if (gridField != null && gridField.getGridTab() != null) {
                // assign the resource of the document if any
                Object org = gridField.getGridTab().getValue("AD_Org_ID");
                if (org != null && org instanceof Integer)
                    ma.setAD_Org_ID((Integer) org);
            }
        }
        //	Start VAssignment Dialog
        if (S_ResourceAssignment_ID != 0) {
            WAssignmentDialog vad = new WAssignmentDialog(ma, true, true);
            ma = vad.getMResourceAssignment();
        } else //	Start InfoSchedule directly
        {
            InfoSchedule is = new InfoSchedule(ma, true);
            ma = is.getMResourceAssignment();
        }
        //	Set Value
        if (ma != null && ma.getS_ResourceAssignment_ID() != 0) {
            setValue(new Integer(ma.getS_ResourceAssignment_ID()));
            ValueChangeEvent vce = new ValueChangeEvent(this, gridField.getColumnName(), oldValue, getValue());
            fireValueChange(vce);
        }
    }
}
Also used : MResourceAssignment(org.compiere.model.MResourceAssignment) ValueChangeEvent(org.adempiere.exceptions.ValueChangeEvent) WAssignmentDialog(org.adempiere.webui.window.WAssignmentDialog) InfoSchedule(org.adempiere.webui.window.InfoSchedule)

Aggregations

InfoSchedule (org.adempiere.webui.window.InfoSchedule)2 ValueChangeEvent (org.adempiere.exceptions.ValueChangeEvent)1 Button (org.adempiere.webui.component.Button)1 WAssignmentDialog (org.adempiere.webui.window.WAssignmentDialog)1 MResourceAssignment (org.compiere.model.MResourceAssignment)1 Component (org.zkoss.zk.ui.Component)1