details:   /erp/devel/pi/rev/e2051a70d36f
changeset: 8763:e2051a70d36f
user:      Stefan Hühner <stefan.huehner <at> openbravo.com>
date:      Wed Oct 27 15:37:03 2010 +0200
summary:   Issue 15048: Fix display of purpose when upgrading activated 
instance to MP23
If instance purpose is not set, but the instance is activated read the purpose
from the license and display this (more correct purpose).

diffstat:

 src/org/openbravo/erpCommon/utility/Home.java |  17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)

diffs (35 lines):

diff -r 75738e794fde -r e2051a70d36f 
src/org/openbravo/erpCommon/utility/Home.java
--- a/src/org/openbravo/erpCommon/utility/Home.java     Wed Oct 27 14:44:39 
2010 +0200
+++ b/src/org/openbravo/erpCommon/utility/Home.java     Wed Oct 27 15:37:03 
2010 +0200
@@ -89,21 +89,24 @@
   }
 
   private static String getPurpose() {
-    String strPurpose = "";
     OBContext.setAdminMode();
     try {
       String strPurposeCode = OBDal.getInstance().get(
           org.openbravo.model.ad.system.SystemInformation.class, 
"0").getInstancePurpose();
-      if (strPurpose == null || "".equals(strPurposeCode)) {
-        return null;
-      } else {
-        strPurpose = Utility.getListValueName("InstancePurpose", 
strPurposeCode, OBContext
-            .getOBContext().getLanguage().getLanguage());
+      if (strPurposeCode == null || "".equals(strPurposeCode)) {
+        if (ActivationKey.isActiveInstance()) {
+          // use value from license if possible
+          strPurposeCode = ActivationKey.getInstance().getProperty("purpose");
+        } else {
+          // community instance without purpose configured
+          return null;
+        }
       }
+      return Utility.getListValueName("InstancePurpose", strPurposeCode, 
OBContext.getOBContext()
+          .getLanguage().getLanguage());
     } finally {
       OBContext.restorePreviousMode();
     }
-    return strPurpose;
   }
 
   private static String getVersion() {

------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to