details: /erp/stable/2.50/rev/0d3830c948a7
changeset: 9087:0d3830c948a7
user: Adrián Romero <adrianromero <at> openbravo.com>
date: Wed Dec 15 14:28:01 2010 +0100
summary: Fixes issue 0015430: The unique constraint c_doctype_name on
c_doctype table should include ad_org_id column
It has been added the required constraint
details: /erp/stable/2.50/rev/447b7ee3068b
changeset: 9088:447b7ee3068b
user: Adrián Romero <adrianromero <at> openbravo.com>
date: Wed Dec 15 16:13:30 2010 +0100
summary: merging
diffstat:
src-db/database/model/tables/C_DOCTYPE.xml | 1 +
src-db/database/sourcedata/AD_COLUMN.xml | 2 +-
src-db/database/sourcedata/AD_MESSAGE.xml | 11 ++
src-db/database/sourcedata/AD_VAL_RULE.xml | 4 +-
src-wad/src/org/openbravo/wad/controls/WADDate.java | 6 +-
src-wad/src/org/openbravo/wad/controls/WADDateTime.java | 6 +-
src/org/openbravo/erpCommon/ad_actionButton/ExportReferenceData.java | 2 +-
src/org/openbravo/erpCommon/ad_forms/DocFINFinAccTransaction.java | 7 +-
src/org/openbravo/erpCommon/ad_forms/DocFINPayment.java | 5 +-
src/org/openbravo/erpCommon/ad_forms/DocFINReconciliation.java | 11 +-
src/org/openbravo/erpCommon/modules/UninstallModule.java | 39
++++++++-
src/org/openbravo/erpCommon/modules/UninstallModule_data.xsql | 4 +-
src/org/openbravo/erpCommon/utility/MessageBD_data.xsql | 39
+++------
src/org/openbravo/erpCommon/utility/TableSQLData.java | 33
++++++-
src/org/openbravo/erpCommon/utility/Utility.java | 15 +--
web/js/jscalendar/lang/calendar-lang.js | 25
++++++
16 files changed, 133 insertions(+), 77 deletions(-)
diffs (truncated from 498 to 300 lines):
diff -r f885981148aa -r 447b7ee3068b src-db/database/model/tables/C_DOCTYPE.xml
--- a/src-db/database/model/tables/C_DOCTYPE.xml Mon Dec 13 13:06:41
2010 +0100
+++ b/src-db/database/model/tables/C_DOCTYPE.xml Wed Dec 15 16:13:30
2010 +0100
@@ -131,6 +131,7 @@
</foreign-key>
<unique name="C_DOCTYPE_NAME">
<unique-column name="AD_CLIENT_ID"/>
+ <unique-column name="AD_ORG_ID"/>
<unique-column name="NAME"/>
</unique>
<check name="C_DOCTYPE_ISACTIVE_CHECK"><![CDATA[ISACTIVE IN ('Y',
'N')]]></check>
diff -r f885981148aa -r 447b7ee3068b src-db/database/sourcedata/AD_COLUMN.xml
--- a/src-db/database/sourcedata/AD_COLUMN.xml Mon Dec 13 13:06:41 2010 +0100
+++ b/src-db/database/sourcedata/AD_COLUMN.xml Wed Dec 15 16:13:30 2010 +0100
@@ -278686,7 +278686,7 @@
<!--59C4D0498A3471B8E040007F010133FD-->
<AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
<!--59C4D0498A3471B8E040007F010133FD--> <POSITION><![CDATA[13]]></POSITION>
<!--59C4D0498A3471B8E040007F010133FD-->
<ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
-<!--59C4D0498A3471B8E040007F010133FD--> <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--59C4D0498A3471B8E040007F010133FD--> <ISAUTOSAVE><![CDATA[N]]></ISAUTOSAVE>
<!--59C4D0498A3471B8E040007F010133FD-->
<VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
<!--59C4D0498A3471B8E040007F010133FD--></AD_COLUMN>
diff -r f885981148aa -r 447b7ee3068b src-db/database/sourcedata/AD_MESSAGE.xml
--- a/src-db/database/sourcedata/AD_MESSAGE.xml Mon Dec 13 13:06:41 2010 +0100
+++ b/src-db/database/sourcedata/AD_MESSAGE.xml Wed Dec 15 16:13:30 2010 +0100
@@ -33913,6 +33913,17 @@
<!--EF6ECE31E8474A289803BC07D3774F17-->
<AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
<!--EF6ECE31E8474A289803BC07D3774F17--></AD_MESSAGE>
+<!--F17014A0E42A487A9D9AEDBA41A87620--><AD_MESSAGE>
+<!--F17014A0E42A487A9D9AEDBA41A87620-->
<AD_MESSAGE_ID><![CDATA[F17014A0E42A487A9D9AEDBA41A87620]]></AD_MESSAGE_ID>
+<!--F17014A0E42A487A9D9AEDBA41A87620-->
<AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--F17014A0E42A487A9D9AEDBA41A87620--> <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--F17014A0E42A487A9D9AEDBA41A87620--> <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--F17014A0E42A487A9D9AEDBA41A87620-->
<VALUE><![CDATA[ModuleWillNotBeUninstalled]]></VALUE>
+<!--F17014A0E42A487A9D9AEDBA41A87620--> <MSGTEXT><![CDATA[This module will
not be uninstalled, the rest of them will be though.]]></MSGTEXT>
+<!--F17014A0E42A487A9D9AEDBA41A87620--> <MSGTYPE><![CDATA[W]]></MSGTYPE>
+<!--F17014A0E42A487A9D9AEDBA41A87620-->
<AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--F17014A0E42A487A9D9AEDBA41A87620--></AD_MESSAGE>
+
<!--F2275928624C4B3EA173DA274358BFF9--><AD_MESSAGE>
<!--F2275928624C4B3EA173DA274358BFF9-->
<AD_MESSAGE_ID><![CDATA[F2275928624C4B3EA173DA274358BFF9]]></AD_MESSAGE_ID>
<!--F2275928624C4B3EA173DA274358BFF9-->
<AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
diff -r f885981148aa -r 447b7ee3068b src-db/database/sourcedata/AD_VAL_RULE.xml
--- a/src-db/database/sourcedata/AD_VAL_RULE.xml Mon Dec 13 13:06:41
2010 +0100
+++ b/src-db/database/sourcedata/AD_VAL_RULE.xml Wed Dec 15 16:13:30
2010 +0100
@@ -1497,8 +1497,10 @@
<!--8286A51A2C2C494798EABA6D27CA534D--> <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
<!--8286A51A2C2C494798EABA6D27CA534D--> <ISACTIVE><![CDATA[Y]]></ISACTIVE>
<!--8286A51A2C2C494798EABA6D27CA534D--> <NAME><![CDATA[AD_DataSet_Table
access level]]></NAME>
+<!--8286A51A2C2C494798EABA6D27CA534D--> <DESCRIPTION><![CDATA[Filters tables
removing views and taking into account access level]]></DESCRIPTION>
<!--8286A51A2C2C494798EABA6D27CA534D--> <TYPE><![CDATA[S]]></TYPE>
-<!--8286A51A2C2C494798EABA6D27CA534D--> <CODE><![CDATA[((ad_table.accesslevel
in ('3','1','7') and exists(select 1 from ad_dataset
+<!--8286A51A2C2C494798EABA6D27CA534D--> <CODE><![CDATA[ad_table.isView='N'
+and ((ad_table.accesslevel in ('3','1','7') and exists(select 1 from ad_dataset
where ad_dataset_id =
@AD_DATASET_ID@
and ad_dataset.accesslevel = '1'))
OR
(ad_table.accesslevel in ('4','6','7') and exists(select 1 from
ad_dataset
diff -r f885981148aa -r 447b7ee3068b
src-wad/src/org/openbravo/wad/controls/WADDate.java
--- a/src-wad/src/org/openbravo/wad/controls/WADDate.java Mon Dec 13
13:06:41 2010 +0100
+++ b/src-wad/src/org/openbravo/wad/controls/WADDate.java Wed Dec 15
16:13:30 2010 +0100
@@ -46,11 +46,7 @@
private void generateJSCode() {
addImport("DateTextBox", "../../../../../web/js/default/DateTextBox.js");
addImport("calendar", "../../../../../web/js/jscalendar/calendar.js");
- if (!getData("AD_Language").equals(""))
- addImport("calendarLang",
"../../../../../web/js/jscalendar/lang/calendar-"
- + getData("AD_Language").substring(0, 2) + ".js");
- else
- addImport("calendarLang",
"../../../../../web/js/jscalendar/lang/calendar-en.js");
+ addImport("calendarLang",
"../../../../../web/js/jscalendar/lang/calendar-lang.js");
generateValidation();
setCalloutJS();
}
diff -r f885981148aa -r 447b7ee3068b
src-wad/src/org/openbravo/wad/controls/WADDateTime.java
--- a/src-wad/src/org/openbravo/wad/controls/WADDateTime.java Mon Dec 13
13:06:41 2010 +0100
+++ b/src-wad/src/org/openbravo/wad/controls/WADDateTime.java Wed Dec 15
16:13:30 2010 +0100
@@ -46,11 +46,7 @@
private void generateJSCode() {
addImport("DateTextBox", "../../../../../web/js/default/DateTextBox.js");
addImport("calendar", "../../../../../web/js/jscalendar/calendar.js");
- if (!getData("AD_Language").equals(""))
- addImport("calendarLang",
"../../../../../web/js/jscalendar/lang/calendar-"
- + getData("AD_Language").substring(0, 2) + ".js");
- else
- addImport("calendarLang",
"../../../../../web/js/jscalendar/lang/calendar-en.js");
+ addImport("calendarLang",
"../../../../../web/js/jscalendar/lang/calendar-lang.js");
generateValidation();
setCalloutJS();
}
diff -r f885981148aa -r 447b7ee3068b
src/org/openbravo/erpCommon/ad_actionButton/ExportReferenceData.java
--- a/src/org/openbravo/erpCommon/ad_actionButton/ExportReferenceData.java
Mon Dec 13 13:06:41 2010 +0100
+++ b/src/org/openbravo/erpCommon/ad_actionButton/ExportReferenceData.java
Wed Dec 15 16:13:30 2010 +0100
@@ -86,7 +86,7 @@
if (!myDataset.getModule().isInDevelopment()) {
myError = new OBError();
myError.setType("Error");
- myError.setTitle(Utility.messageBD(this, "20532", vars.getLanguage()));
+ myError.setTitle(Utility.messageBD(this, "Error", vars.getLanguage()));
myError.setMessage(Utility.messageBD(this, "20532",
vars.getLanguage()));
return myError;
}
diff -r f885981148aa -r 447b7ee3068b
src/org/openbravo/erpCommon/ad_forms/DocFINFinAccTransaction.java
--- a/src/org/openbravo/erpCommon/ad_forms/DocFINFinAccTransaction.java Mon Dec
13 13:06:41 2010 +0100
+++ b/src/org/openbravo/erpCommon/ad_forms/DocFINFinAccTransaction.java Wed Dec
15 16:13:30 2010 +0100
@@ -23,7 +23,6 @@
import java.sql.Connection;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
-import java.util.HashMap;
import java.util.List;
import javax.servlet.ServletException;
@@ -115,7 +114,7 @@
// used
if (paymentDetails.get(i).isRefund() &&
paymentDetails.get(i).isPrepayment())
continue;
- data[i] = new FieldProviderFactory(new HashMap());
+ data[i] = new FieldProviderFactory(null);
FieldProviderFactory.setField(data[i], "FIN_Finacc_Transaction_ID",
transaction.getId());
FieldProviderFactory.setField(data[i], "AD_Client_ID",
paymentDetails.get(i).getClient()
.getId());
@@ -165,7 +164,7 @@
FieldProviderFactory[] data = new FieldProviderFactory[1];
OBContext.setAdminMode();
try {
- data[0] = new FieldProviderFactory(new HashMap());
+ data[0] = new FieldProviderFactory(null);
FieldProviderFactory.setField(data[0], "FIN_Finacc_Transaction_ID",
transaction.getId());
FieldProviderFactory.setField(data[0], "AD_Client_ID",
transaction.getClient().getId());
FieldProviderFactory.setField(data[0], "adOrgId",
transaction.getOrganization().getId());
@@ -671,7 +670,7 @@
FieldProviderFactory[] data = new FieldProviderFactory[1];
OBContext.setAdminMode();
try {
- data[0] = new FieldProviderFactory(new HashMap());
+ data[0] = new FieldProviderFactory(null);
FieldProviderFactory.setField(data[0], "AD_Client_ID",
transaction.getClient().getId());
FieldProviderFactory.setField(data[0], "AD_Org_ID",
transaction.getOrganization().getId());
FieldProviderFactory.setField(data[0], "FIN_Finacc_Transaction_ID",
transaction.getId());
diff -r f885981148aa -r 447b7ee3068b
src/org/openbravo/erpCommon/ad_forms/DocFINPayment.java
--- a/src/org/openbravo/erpCommon/ad_forms/DocFINPayment.java Mon Dec 13
13:06:41 2010 +0100
+++ b/src/org/openbravo/erpCommon/ad_forms/DocFINPayment.java Wed Dec 15
16:13:30 2010 +0100
@@ -22,7 +22,6 @@
import java.sql.Connection;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
-import java.util.HashMap;
import java.util.List;
import javax.servlet.ServletException;
@@ -90,7 +89,7 @@
// used
if (paymentDetails.get(i).isRefund() &&
paymentDetails.get(i).isPrepayment())
continue;
- data[i] = new FieldProviderFactory(new HashMap());
+ data[i] = new FieldProviderFactory(null);
FieldProviderFactory.setField(data[i], "AD_Client_ID",
paymentDetails.get(i).getClient()
.getId());
FieldProviderFactory.setField(data[i], "AD_Org_ID",
paymentDetails.get(i).getOrganization()
@@ -336,7 +335,7 @@
throws ServletException {
FIN_Payment payment = OBDal.getInstance().get(FIN_Payment.class, Id);
FieldProviderFactory[] data = new FieldProviderFactory[1];
- data[0] = new FieldProviderFactory(new HashMap());
+ data[0] = new FieldProviderFactory(null);
FieldProviderFactory.setField(data[0], "AD_Client_ID",
payment.getClient().getId());
FieldProviderFactory.setField(data[0], "AD_Org_ID",
payment.getOrganization().getId());
FieldProviderFactory.setField(data[0], "C_BPartner_ID",
diff -r f885981148aa -r 447b7ee3068b
src/org/openbravo/erpCommon/ad_forms/DocFINReconciliation.java
--- a/src/org/openbravo/erpCommon/ad_forms/DocFINReconciliation.java Mon Dec
13 13:06:41 2010 +0100
+++ b/src/org/openbravo/erpCommon/ad_forms/DocFINReconciliation.java Wed Dec
15 16:13:30 2010 +0100
@@ -23,7 +23,6 @@
import java.sql.Connection;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
-import java.util.HashMap;
import java.util.List;
import javax.servlet.ServletException;
@@ -160,7 +159,7 @@
// used
if (paymentDetails.get(i).isRefund() &&
paymentDetails.get(i).isPrepayment())
continue;
- data[i] = new FieldProviderFactory(new HashMap());
+ data[i] = new FieldProviderFactory(null);
FieldProviderFactory.setField(data[i], "FIN_Reconciliation_ID",
transaction
.getReconciliation().getId());
FieldProviderFactory.setField(data[i], "FIN_Finacc_Transaction_ID",
transaction.getId());
@@ -215,7 +214,7 @@
OBContext.setAdminMode();
try {
for (int i = 0; i < data.length; i++) {
- data[i] = new FieldProviderFactory(new HashMap());
+ data[i] = new FieldProviderFactory(null);
FieldProviderFactory.setField(data[i], "FIN_Reconciliation_ID",
transaction
.getReconciliation().getId());
FieldProviderFactory.setField(data[i], "FIN_Finacc_Transaction_ID",
transaction.getId());
@@ -255,7 +254,7 @@
FieldProviderFactory[] data = new FieldProviderFactory[1];
OBContext.setAdminMode();
try {
- data[0] = new FieldProviderFactory(new HashMap());
+ data[0] = new FieldProviderFactory(null);
FieldProviderFactory.setField(data[0], "FIN_Reconciliation_ID",
transaction
.getReconciliation().getId());
FieldProviderFactory.setField(data[0], "FIN_Finacc_Transaction_ID",
transaction.getId());
@@ -290,7 +289,7 @@
FieldProviderFactory[] data = new FieldProviderFactory[1];
OBContext.setAdminMode();
try {
- data[0] = new FieldProviderFactory(new HashMap());
+ data[0] = new FieldProviderFactory(null);
FieldProviderFactory.setField(data[0], "FIN_Reconciliation_ID",
transaction
.getReconciliation().getId());
FieldProviderFactory.setField(data[0], "FIN_Finacc_Transaction_ID",
transaction.getId());
@@ -796,7 +795,7 @@
FieldProviderFactory[] data = new FieldProviderFactory[1];
OBContext.setAdminMode();
try {
- data[0] = new FieldProviderFactory(new HashMap());
+ data[0] = new FieldProviderFactory(null);
FieldProviderFactory.setField(data[0], "AD_Client_ID",
reconciliation.getClient().getId());
FieldProviderFactory.setField(data[0], "AD_Org_ID",
reconciliation.getOrganization().getId());
FieldProviderFactory.setField(data[0], "FIN_Finacc_Transaction_ID",
reconciliation.getId());
diff -r f885981148aa -r 447b7ee3068b
src/org/openbravo/erpCommon/modules/UninstallModule.java
--- a/src/org/openbravo/erpCommon/modules/UninstallModule.java Mon Dec 13
13:06:41 2010 +0100
+++ b/src/org/openbravo/erpCommon/modules/UninstallModule.java Wed Dec 15
16:13:30 2010 +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 Openbravo SLU
+ * All portions are Copyright (C) 2008-2010 Openbravo SLU
* All Rights Reserved.
* Contributor(s): ______________________________________.
************************************************************************
@@ -19,6 +19,8 @@
package org.openbravo.erpCommon.modules;
import java.io.File;
+import java.util.ArrayList;
+import java.util.Arrays;
import java.util.StringTokenizer;
import javax.servlet.ServletException;
@@ -121,13 +123,36 @@
final StringTokenizer st = new StringTokenizer(moduleIdList, ",", false);
while (st.hasMoreTokens()) {
final String module = st.nextToken().trim();
- final String contents = getContentList(module.replace("'", ""));
+
final String status = UninstallModuleData.selectStatus(pool, module);
if (status != null && "U".equals(status)) {
continue;
}
- final UninstallModuleData data[] =
UninstallModuleData.selectDirectories(pool, contents); // delete
+ // obtain all the modules to uninstall: selected modules + inclussions
of them
+ String modsToUninstall = getContentList(module.replace("'", ""));
+
+ ArrayList<String> uninstallList = new
ArrayList<String>(Arrays.asList(modsToUninstall
+ .replace(" ", "").replace("'", "").split(",")));
+ for (UninstallModuleData dep : UninstallModuleData
+ .selectDependencies(pool, modsToUninstall)) {
+ // Do not uninstall inclussions that are dependencies for other
modules
+ uninstallList.remove(dep.adDependentModuleId);
+ addLog(dep.origname + " @IsDependencyOf@ " + dep.name + ".
@ModuleWillNotBeUninstalled@",
+ MSG_WARN);
+ }
+
+ modsToUninstall = "";
+ for (String mod : uninstallList) {
+ modsToUninstall += "'" + mod + "',";
+ }
+ if (modsToUninstall.isEmpty()) {
+ return;
+ }
+ modsToUninstall = modsToUninstall.substring(0,
modsToUninstall.length() - 1);
+
+ final UninstallModuleData data[] =
UninstallModuleData.selectDirectories(pool,
+ modsToUninstall); // delete
// directories
if (data != null && data.length > 0) {
for (int i = 0; i < data.length; i++) {
@@ -156,12 +181,12 @@
if (status.equals("I")) {
// the module has not been already installed, delete it from
temporary installation tables
- UninstallModuleData.deleteTmpModule(pool, contents);
- UninstallModuleData.deleteTmpDependency(pool, contents);
- UninstallModuleData.deleteTmpDBPrefix(pool, contents);
+ UninstallModuleData.deleteTmpModule(pool, modsToUninstall);
+ UninstallModuleData.deleteTmpDependency(pool, modsToUninstall);
+ UninstallModuleData.deleteTmpDBPrefix(pool, modsToUninstall);
} else {
// set as uninstalled in DB
- UninstallModuleData.updateUninstall(pool, contents);
+ UninstallModuleData.updateUninstall(pool, modsToUninstall);
------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits