diff --git a/applications/accounting/ofbiz-component.xml b/applications/accounting/ofbiz-component.xml index 39da7c209b..0022c21c3a 100644 --- a/applications/accounting/ofbiz-component.xml +++ b/applications/accounting/ofbiz-component.xml @@ -74,6 +74,7 @@ under the License. - - diff --git a/applications/workeffort/ofbiz-component.xml b/applications/workeffort/ofbiz-component.xml index a0ce377806..f269849b4d 100644 --- a/applications/workeffort/ofbiz-component.xml +++ b/applications/workeffort/ofbiz-component.xml @@ -40,6 +40,7 @@ under the License. + + + + + + + + + + diff --git a/framework/base/src/base/org/ofbiz/base/component/ComponentConfig.java b/framework/base/src/base/org/ofbiz/base/component/ComponentConfig.java index 6d1d85b087..9edc710607 100644 --- a/framework/base/src/base/org/ofbiz/base/component/ComponentConfig.java +++ b/framework/base/src/base/org/ofbiz/base/component/ComponentConfig.java @@ -253,11 +253,15 @@ public class ComponentConfig { } public static List getAppBarWebInfos(String serverName) { - return ComponentConfig.getAppBarWebInfos(serverName, null); + return ComponentConfig.getAppBarWebInfos(serverName, null, null); } - - public static List getAppBarWebInfos(String serverName, Comparator comp) { - List webInfos = serverWebApps.get(serverName); + + public static List getAppBarWebInfos(String serverName, String menuName) { + return ComponentConfig.getAppBarWebInfos(serverName, null, menuName); + } + + public static List getAppBarWebInfos(String serverName, Comparator comp, String menuName) { + List webInfos = serverWebApps.get(serverName + menuName); if (webInfos == null) { synchronized (ComponentConfig.class) { if (webInfos == null) { @@ -272,14 +276,21 @@ public class ComponentConfig { for (ComponentConfig cc: getAllComponents()) { for (WebappInfo wInfo: cc.getWebappInfos()) { + String key = UtilValidate.isNotEmpty(wInfo.position)? wInfo.position: wInfo.title; if (serverName.equals(wInfo.server) && wInfo.appBarDisplay) { - tm.put(wInfo.title, wInfo); + if (UtilValidate.isNotEmpty(menuName)) { + if (menuName.equals(wInfo.menuName)) { + tm.put(key, wInfo); + } + } else { + tm.put(key, wInfo); + } } } } List webInfoList = FastList.newInstance(); webInfoList.addAll(tm.values()); - serverWebApps.put(serverName, webInfoList); + serverWebApps.put(serverName + menuName, webInfoList); return webInfoList; } } @@ -660,10 +671,13 @@ public class ComponentConfig { public Map initParameters; public String name; public String title; + public String description; + public String menuName; public String server; public String mountPoint; public String location; public String[] basePermission; + public String position; public boolean appBarDisplay; public WebappInfo(ComponentConfig componentConfig, Element element) { @@ -672,6 +686,7 @@ public class ComponentConfig { this.componentConfig = componentConfig; this.name = element.getAttribute("name"); this.title = element.getAttribute("title"); + this.description = element.getAttribute("description"); this.server = element.getAttribute("server"); this.mountPoint = element.getAttribute("mount-point"); this.location = element.getAttribute("location"); @@ -696,7 +711,20 @@ public class ComponentConfig { if (UtilValidate.isEmpty(this.title)) { this.title = Character.toUpperCase(name.charAt(0)) + name.substring(1).toLowerCase(); } - + + if (UtilValidate.isEmpty(this.description)) { + this.description = this.title; + } + + String menuNameStr = element.getAttribute("menu-name"); + if (UtilValidate.isNotEmpty(menuNameStr)) { + this.menuName = menuNameStr; + } else { + this.menuName = "main"; + } + + this.position = element.getAttribute("position"); + // default mount point is name if none specified if (UtilValidate.isEmpty(this.mountPoint)) { this.mountPoint = this.name; @@ -754,6 +782,10 @@ public class ComponentConfig { public String getTitle() { return title; } + + public String getDescription() { + return description; + } public List getVirtualHosts() { return virtualHosts; diff --git a/framework/common/config/CommonUiLabels.xml b/framework/common/config/CommonUiLabels.xml index 5b03296232..178716410b 100644 --- a/framework/common/config/CommonUiLabels.xml +++ b/framework/common/config/CommonUiLabels.xml @@ -6951,6 +6951,9 @@ Risorse Umane ฝ่ายบุคคล + + Human Resource Application + Handheld Facility Gestione Stabilimenti su Handheld diff --git a/framework/common/webcommon/includes/appbar.ftl b/framework/common/webcommon/includes/appbar.ftl index ebc0b7c5aa..0320387555 100644 --- a/framework/common/webcommon/includes/appbar.ftl +++ b/framework/common/webcommon/includes/appbar.ftl @@ -21,7 +21,7 @@ under the License. <#if (externalLoginKey)?exists><#assign externalKeyParam = "?externalLoginKey=" + requestAttributes.externalLoginKey?if_exists> <#assign ofbizServerName = application.getAttribute("_serverId")?default("default-server")> <#assign contextPath = request.getContextPath()> -<#assign displayApps = Static["org.ofbiz.base.component.ComponentConfig"].getAppBarWebInfos(ofbizServerName)> +<#assign displayApps = Static["org.ofbiz.base.component.ComponentConfig"].getAppBarWebInfos(ofbizServerName, "main")> <#if userLogin?has_content>