details:   https://code.openbravo.com/erp/devel/pi/rev/3d42091c9154
changeset: 18163:3d42091c9154
user:      Shankar Balachandran <shankar.balachandran <at> openbravo.com>
date:      Wed Oct 03 17:38:50 2012 +0200
summary:   Fixes Issue 13576 : Needed Version not shown if it is same as Module 
Version.

The Minimum Needed Version is not shown if it is the same as the Module Version.
This fix will work only if the fix for Issue 14497 is present (related fix).

diffstat:

 src/org/openbravo/erpCommon/ad_forms/ModuleManagement.java |  22 ++++++++++++-
 1 files changed, 20 insertions(+), 2 deletions(-)

diffs (39 lines):

diff -r c7d6d5cabd78 -r 3d42091c9154 
src/org/openbravo/erpCommon/ad_forms/ModuleManagement.java
--- a/src/org/openbravo/erpCommon/ad_forms/ModuleManagement.java        Mon Oct 
08 18:03:20 2012 +0200
+++ b/src/org/openbravo/erpCommon/ad_forms/ModuleManagement.java        Wed Oct 
03 17:38:50 2012 +0200
@@ -1404,8 +1404,17 @@
       if (installed) {
         if (minVersions != null && minVersions.get(module.getModuleID()) != 
null
             && !minVersions.get(module.getModuleID()).equals("")) {
-          mod.put("versionNoMin", Utility.messageBD(this, "UpdateModuleNeed", 
lang) + " "
-              + minVersions.get(module.getModuleID()));
+          /*
+           * Checking whether the module version is the same as the minimum 
version number. Refer
+           * issue https://issues.openbravo.com/view.php?id=13576
+           */
+          String versionNumber = 
this.removeVersionLabel(module.getVersionNo());
+          Boolean moduleVersionSameAsMinimumVersion = 
versionNumber.equals(minVersions.get(module
+              .getModuleID()));
+          if (!moduleVersionSameAsMinimumVersion) {
+            mod.put("versionNoMin", Utility.messageBD(this, 
"UpdateModuleNeed", lang) + " "
+                + minVersions.get(module.getModuleID()));
+          }
         }
         mod.put("versionNoCurr", 
currentInstalledVersion(module.getModuleID()));
       } else {
@@ -1429,6 +1438,15 @@
     return FieldProviderFactory.getFieldProviderArray(rt);
   }
 
+  /*
+   * The version number of module returned by web service has the MP tag 
attached to it. To compare
+   * with the minimum version, we are removing the tag. eg., Openbravo 3.0 
3.0.17885 (MP15) to
+   * Openbravo 3.0 3.0.17885. Related to Issue 
https://issues.openbravo.com/view.php?id=13576
+   */
+  private String removeVersionLabel(String versionWithLabel) {
+    return versionWithLabel.split("\\(")[0].trim();
+  }
+
   private String currentInstalledVersion(String moduleId) {
     String currentVersion = "";
     org.openbravo.model.ad.module.Module mod = OBDal.getInstance().get(

------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to