details: /erp/devel/pi/rev/9fdd5f36644c
changeset: 13094:9fdd5f36644c
user: Asier Lostalé <asier.lostale <at> openbravo.com>
date: Mon Jul 04 12:16:17 2011 +0200
summary: related to issue 17741: Do not set pref for Openrbavo user
details: /erp/devel/pi/rev/c9813b2648fe
changeset: 13095:c9813b2648fe
user: Asier Lostalé <asier.lostale <at> openbravo.com>
date: Mon Jul 04 12:16:43 2011 +0200
summary: related to issue 17741: Set pref when activating/deactivating
instance
diffstat:
src-db/database/sourcedata/AD_PREFERENCE.xml | 1 -
src/org/openbravo/erpCommon/ad_forms/InstanceManagement.java | 2 ++
src/org/openbravo/erpCommon/obps/ActiveInstanceProcess.java | 10 ++++++++++
3 files changed, 12 insertions(+), 1 deletions(-)
diffs (57 lines):
diff -r c3dd7be39178 -r c9813b2648fe
src-db/database/sourcedata/AD_PREFERENCE.xml
--- a/src-db/database/sourcedata/AD_PREFERENCE.xml Mon Jul 04 10:28:33
2011 +0200
+++ b/src-db/database/sourcedata/AD_PREFERENCE.xml Mon Jul 04 12:16:43
2011 +0200
@@ -1732,7 +1732,6 @@
<!--FF80818130E5777B0130E57AFC890006-->
<AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
<!--FF80818130E5777B0130E57AFC890006--> <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
<!--FF80818130E5777B0130E57AFC890006--> <ISACTIVE><![CDATA[Y]]></ISACTIVE>
-<!--FF80818130E5777B0130E57AFC890006-->
<AD_USER_ID><![CDATA[100]]></AD_USER_ID>
<!--FF80818130E5777B0130E57AFC890006--> <VALUE><![CDATA[N]]></VALUE>
<!--FF80818130E5777B0130E57AFC890006-->
<PROPERTY><![CDATA[showMRPandProductionFields]]></PROPERTY>
<!--FF80818130E5777B0130E57AFC890006-->
<ISPROPERTYLIST><![CDATA[Y]]></ISPROPERTYLIST>
diff -r c3dd7be39178 -r c9813b2648fe
src/org/openbravo/erpCommon/ad_forms/InstanceManagement.java
--- a/src/org/openbravo/erpCommon/ad_forms/InstanceManagement.java Mon Jul
04 10:28:33 2011 +0200
+++ b/src/org/openbravo/erpCommon/ad_forms/InstanceManagement.java Mon Jul
04 12:16:43 2011 +0200
@@ -145,6 +145,8 @@
msg.setType("Success");
msg.setMessage(Utility.messageBD(this, "Success", vars.getLanguage()));
+ ActiveInstanceProcess.updateShowProductionFields("N");
+
// When deactivating a cloned instance insert a dummy heartbeat log so
it is not detected as
// a cloned instance anymore.
if (HeartbeatProcess.isClonedInstance()) {
diff -r c3dd7be39178 -r c9813b2648fe
src/org/openbravo/erpCommon/obps/ActiveInstanceProcess.java
--- a/src/org/openbravo/erpCommon/obps/ActiveInstanceProcess.java Mon Jul
04 10:28:33 2011 +0200
+++ b/src/org/openbravo/erpCommon/obps/ActiveInstanceProcess.java Mon Jul
04 12:16:43 2011 +0200
@@ -23,6 +23,7 @@
import java.net.URLEncoder;
import org.apache.log4j.Logger;
+import org.hibernate.Query;
import org.openbravo.dal.core.OBContext;
import org.openbravo.dal.service.OBDal;
import org.openbravo.erpCommon.ad_forms.MaturityLevel;
@@ -82,6 +83,8 @@
sysInfo.setMaturitySearch(Integer.toString(MaturityLevel.CS_MATURITY));
sysInfo.setMaturityUpdate(Integer.toString(MaturityLevel.CS_MATURITY));
+
+ updateShowProductionFields("Y");
} else {
msg.setType("Error");
msg.setMessage(ak.getErrorMessage());
@@ -96,6 +99,13 @@
}
+ public static void updateShowProductionFields(String value) {
+ String hql = "update ADPreference set searchKey = :value where property =
'showMRPandProductionFields'";
+ Query q = OBDal.getInstance().getSession().createQuery(hql);
+ q.setParameter("value", value);
+ q.executeUpdate();
+ }
+
/**
* Sends the request for the activation key.
*
------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits