diff --git a/migration/360lts-release/oracle/870_IDEMPIERE-357_MenuPortlet.sql b/migration/360lts-release/oracle/870_IDEMPIERE-357_MenuPortlet.sql new file mode 100644 index 0000000000..1922347248 --- /dev/null +++ b/migration/360lts-release/oracle/870_IDEMPIERE-357_MenuPortlet.sql @@ -0,0 +1,20 @@ +-- Aug 8, 2012 6:41:15 PM SGT +-- Move the Menu to be a Portlet +UPDATE PA_DashboardContent SET IsActive='N',Updated=TO_DATE('2012-08-08 18:41:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE PA_DashboardContent_ID=1000006 +; + +-- Aug 8, 2012 6:41:47 PM SGT +-- Move the Menu to be a Portlet +UPDATE PA_DashboardContent SET IsShowInDashboard='N',Updated=TO_DATE('2012-08-08 18:41:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE PA_DashboardContent_ID=50001 +; + +-- Aug 8, 2012 6:42:03 PM SGT +-- Move the Menu to be a Portlet +UPDATE PA_DashboardContent SET Line=2.000000000000, ColumnNo=0, IsShowInDashboard='N',Updated=TO_DATE('2012-08-08 18:42:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE PA_DashboardContent_ID=200000 +; + +UPDATE AD_System + SET LastMigrationScriptApplied='870_IDEMPIERE-357_MenuPortlet.sql' +WHERE LastMigrationScriptApplied<'870_IDEMPIERE-357_MenuPortlet.sql' + OR LastMigrationScriptApplied IS NULL +; \ No newline at end of file diff --git a/migration/360lts-release/postgresql/870_IDEMPIERE-357_MenuPortlet.sql b/migration/360lts-release/postgresql/870_IDEMPIERE-357_MenuPortlet.sql new file mode 100644 index 0000000000..62a725652a --- /dev/null +++ b/migration/360lts-release/postgresql/870_IDEMPIERE-357_MenuPortlet.sql @@ -0,0 +1,20 @@ +-- Aug 8, 2012 6:41:15 PM SGT +-- Move the Menu to be a Portlet +UPDATE PA_DashboardContent SET IsActive='N',Updated=TO_TIMESTAMP('2012-08-08 18:41:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE PA_DashboardContent_ID=1000006 +; + +-- Aug 8, 2012 6:41:47 PM SGT +-- Move the Menu to be a Portlet +UPDATE PA_DashboardContent SET IsShowInDashboard='N',Updated=TO_TIMESTAMP('2012-08-08 18:41:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE PA_DashboardContent_ID=50001 +; + +-- Aug 8, 2012 6:42:03 PM SGT +-- Move the Menu to be a Portlet +UPDATE PA_DashboardContent SET Line=2.000000000000, ColumnNo=0, IsShowInDashboard='N',Updated=TO_TIMESTAMP('2012-08-08 18:42:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE PA_DashboardContent_ID=200000 +; + +UPDATE AD_System + SET LastMigrationScriptApplied='870_IDEMPIERE-357_MenuPortlet.sql' +WHERE LastMigrationScriptApplied<'870_IDEMPIERE-357_MenuPortlet.sql' + OR LastMigrationScriptApplied IS NULL +; \ No newline at end of file diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/HeaderPanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/HeaderPanel.java index 6522e2c6a1..93aeaed176 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/HeaderPanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/HeaderPanel.java @@ -19,8 +19,12 @@ package org.adempiere.webui.panel; import org.adempiere.webui.LayoutUtils; import org.adempiere.webui.component.Panel; +import org.adempiere.webui.component.ToolBarButton; import org.adempiere.webui.theme.ThemeManager; import org.adempiere.webui.window.AboutWindow; +import org.compiere.util.Env; +import org.compiere.util.Msg; +import org.compiere.util.Util; import org.zkoss.zk.ui.event.Event; import org.zkoss.zk.ui.event.EventListener; import org.zkoss.zk.ui.event.Events; @@ -28,6 +32,7 @@ import org.zkoss.zul.Borderlayout; import org.zkoss.zul.Center; import org.zkoss.zul.Hbox; import org.zkoss.zul.Image; +import org.zkoss.zul.Popup; import org.zkoss.zul.West; /** @@ -44,6 +49,8 @@ public class HeaderPanel extends Panel implements EventListener private static final long serialVersionUID = -2351317624519209484L; private Image image; + private ToolBarButton btnMenu; + private Popup popMenu; public HeaderPanel() { @@ -75,8 +82,23 @@ public class HeaderPanel extends Panel implements EventListener hbox.setAlign("left"); image.setParent(hbox); + new MenuSearchPanel(this).setParent(hbox); + popMenu = new Popup(); + popMenu.setId("menuTreePopup"); + popMenu.appendChild(new MenuTreePanel(popMenu)); + popMenu.setWidth("600px"); + popMenu.setHeight("500px"); + popMenu.setParent(hbox); + + btnMenu = new ToolBarButton(); + btnMenu.setLabel(Util.cleanAmp(Msg.getMsg(Env.getCtx(),"Menu"))); + LayoutUtils.addSclass("desktop-header-font", btnMenu); + btnMenu.setParent(hbox); + btnMenu.setPopup("menuTreePopup"); + btnMenu.addEventListener(Events.ON_CLICK, this); + LayoutUtils.addSclass("desktop-header-left", west); //the following doesn't work when declare as part of the header-left style west.setStyle("background-color: transparent; border: none;"); @@ -102,7 +124,10 @@ public class HeaderPanel extends Panel implements EventListener w.setPage(this.getPage()); w.doHighlighted(); } + else if(event.getTarget() == btnMenu) + { + popMenu.open(btnMenu, "end_before"); + } } - } }