Fixed issue 16406: Adding modules, modules without URL, 'Visit site' disappears
authorMiguel de Juana <miguel.dejuana@openbravo.com>
Tue, 28 Feb 2012 12:43:57 +0100
changeset 15633 0c00996cda5f
parent 15632 4e0bf9b7c68e
child 15634 5e2e3880c5ef
Fixed issue 16406: Adding modules, modules without URL, 'Visit site' disappears
src/org/openbravo/erpCommon/ad_forms/ModuleManagement.java
src/org/openbravo/erpCommon/modules/ModuleBox.srpt
src/org/openbravo/erpCommon/modules/ModuleBox.xml
--- a/src/org/openbravo/erpCommon/ad_forms/ModuleManagement.java	Tue Feb 28 12:26:47 2012 +0100
+++ b/src/org/openbravo/erpCommon/ad_forms/ModuleManagement.java	Tue Feb 28 12:43:57 2012 +0100
@@ -11,7 +11,7 @@
  * under the License. 
  * The Original Code is Openbravo ERP. 
  * The Initial Developer of the Original Code is Openbravo SLU 
- * All portions are Copyright (C) 2008-2011 Openbravo SLU 
+ * All portions are Copyright (C) 2008-2012 Openbravo SLU 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -1801,15 +1801,17 @@
         icon = (icon == null ? "M" : icon).equals("M") ? "Module" : icon.equals("T") ? "Template"
             : "Pack";
 
-        // If there is no url, we need to hide the 'Visit Site' link and separator.
-        String url = mod.getUrl();
-        url = (url == null || url.equals("") ? "HIDDEN" : url);
-
         moduleBox.put("name", mod.getName());
         moduleBox.put("description", mod.getDescription());
         moduleBox.put("type", icon);
         moduleBox.put("help", mod.getHelp());
-        moduleBox.put("url", getLink(url));
+        // If there is no url, we need to hide the 'Visit Site' link and separator.
+        if (mod.getUrl() == null || mod.getUrl().equals("")) {
+          moduleBox.put("urlStyle", "none");
+        } else {
+          moduleBox.put("url", getLink(mod.getUrl()));
+          moduleBox.put("urlStyle", "true");
+        }
         moduleBox.put("moduleVersionID", mod.getModuleVersionID());
         moduleBox.put("commercialStyle", (mod.isIsCommercial() ? "true" : "none"));
 
--- a/src/org/openbravo/erpCommon/modules/ModuleBox.srpt	Tue Feb 28 12:26:47 2012 +0100
+++ b/src/org/openbravo/erpCommon/modules/ModuleBox.srpt	Tue Feb 28 12:43:57 2012 +0100
@@ -12,7 +12,7 @@
  * under the License. 
  * The Original Code is Openbravo ERP. 
  * The Initial Developer of the Original Code is Openbravo SLU 
- * All portions are Copyright (C) 2008-2011 Openbravo SLU 
+ * All portions are Copyright (C) 2008-2012 Openbravo SLU 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -61,7 +61,7 @@
       <div class="AddModule_Text_Help" id="help">xxhelp</div>
       <div class="AddModule_Options">
         <div class="AddModule_Text_Option"><a class="LabelLink_noicon" id="details" href="#" onclick="viewDetails('xx');return false;">View Details</a></div>
-        <div id="url" class="AddModule_Url_Linkxx">
+        <div id="url" class="AddModule_Url_Linkxx" style="display:xx;">
           <div class="AddModule_Text_Option_Separator">|</div>
           <div class="AddModule_Text_Option"><a class="LabelLink_noicon" id="url" href="#" onclick="openLink('xx', '_blank');return false;">Visit Site</a></div>
         </div>
--- a/src/org/openbravo/erpCommon/modules/ModuleBox.xml	Tue Feb 28 12:26:47 2012 +0100
+++ b/src/org/openbravo/erpCommon/modules/ModuleBox.xml	Tue Feb 28 12:43:57 2012 +0100
@@ -12,7 +12,7 @@
  * under the License. 
  * The Original Code is Openbravo ERP. 
  * The Initial Developer of the Original Code is Openbravo SLU 
- * All portions are Copyright (C) 2008-2010 Openbravo SLU 
+ * All portions are Copyright (C) 2008-2012 Openbravo SLU 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -25,6 +25,7 @@
     <FIELD id="icon" replace="xx" attribute="class">type</FIELD>
     <FIELD id="help">help</FIELD>
     <FIELD id="url" attribute="onclick" replace="xx">url</FIELD>
+    <FIELD id="url" attribute="style" replace="xx">urlStyle</FIELD>
     <FIELD id="details" attribute="onclick" replace="xx">moduleVersionID</FIELD>
     <FIELD id="buttonInstall" attribute="onclick" replace="xx">moduleVersionID</FIELD>
     <FIELD id="commercial" attribute="style" replace="xx" default="none">commercialStyle</FIELD>