details: /erp/devel/pi/rev/71efbe7821e3
changeset: 7099:71efbe7821e3
user: Iván Perdomo <ivan.perdomo <at> openbravo.com>
date: Mon Apr 19 16:44:25 2010 +0200
summary: Fixes issue 13032: Hide UI back button when hideMenu is true
details: /erp/devel/pi/rev/a16a91d616c6
changeset: 7100:a16a91d616c6
user: Iván Perdomo <ivan.perdomo <at> openbravo.com>
date: Wed Apr 21 12:50:15 2010 +0200
summary: Merge changes from PI
diffstat:
src-db/database/model/triggers/AD_PROPERTY_CONF_MOD_TRG.xml
| 29 +--
src-db/database/sourcedata/AD_TAB.xml
| 4 +-
src-util/modulescript/build/classes/org/openbravo/modulescript/CreateDoctypeTemplate.class
| 0
src-util/modulescript/build/classes/org/openbravo/modulescript/CreateDoctypeTemplateData.class
| 0
src-util/modulescript/src/org/openbravo/modulescript/CreateDoctypeTemplate.java
| 58 ++++++++
src-util/modulescript/src/org/openbravo/modulescript/CreateDoctypeTemplate_Data.xsql
| 68 ++++++++++
src-wad/src/org/openbravo/wad/javasource.javaxml
| 6 +-
src/org/openbravo/erpCommon/ad_actionButton/InvoicePaymentMonitor.java
| 9 +-
src/org/openbravo/erpCommon/ad_forms/DocFINPaymentTemplate.java
| 24 ++-
src/org/openbravo/erpCommon/ad_process/PaymentMonitor.java
| 15 +-
src/org/openbravo/erpCommon/ad_process/PaymentMonitorProcess.java
| 24 ++-
src/org/openbravo/erpCommon/ad_process/RestartingContext.html
| 17 +-
src/org/openbravo/erpCommon/security/Menu.java
| 3 +
src/org/openbravo/erpCommon/utility/PropertyException.java
| 46 ++++++
src/org/openbravo/erpCommon/utility/Utility.java
| 24 ++-
15 files changed, 262 insertions(+), 65 deletions(-)
diffs (truncated from 517 to 300 lines):
diff -r df1dfe427bc7 -r a16a91d616c6
src-db/database/model/triggers/AD_PROPERTY_CONF_MOD_TRG.xml
--- a/src-db/database/model/triggers/AD_PROPERTY_CONF_MOD_TRG.xml Mon Apr
19 14:03:58 2010 +0200
+++ b/src-db/database/model/triggers/AD_PROPERTY_CONF_MOD_TRG.xml Wed Apr
21 12:50:15 2010 +0200
@@ -63,16 +63,10 @@
WHERE M.AD_MODULE_ID = cuerrentModuleID;
IF (UPDATING AND devTemplate=0 AND devModule='N') THEN
- IF (COALESCE(:NEW.AD_PROPERTY_CONFIGURATION_ID, '.') !=
COALESCE(:NEW.AD_PROPERTY_CONFIGURATION_ID, '.') OR
- COALESCE(:NEW.AD_CLIENT_ID , '.') !=
COALESCE(:NEW.AD_CLIENT_ID , '.') OR
- COALESCE(:NEW.AD_ORG_ID , '.') !=
COALESCE(:NEW.AD_ORG_ID , '.') OR
- COALESCE(:NEW.ISACTIVE , '.') !=
COALESCE(:NEW.ISACTIVE , '.') OR
- COALESCE(:NEW.CREATED , '.') !=
COALESCE(:NEW.CREATED , '.') OR
- COALESCE(:NEW.CREATEDBY , '.') !=
COALESCE(:NEW.CREATEDBY , '.') OR
- COALESCE(:NEW.UPDATED , '.') !=
COALESCE(:NEW.UPDATED , '.') OR
- COALESCE(:NEW.UPDATEDBY , '.') !=
COALESCE(:NEW.UPDATEDBY , '.') OR
- COALESCE(:NEW.PROPERTY , '.') !=
COALESCE(:NEW.PROPERTY , '.') OR
- COALESCE(:NEW.VALUE , '.') !=
COALESCE(:NEW.VALUE , '.') OR
+ IF (COALESCE(:NEW.AD_CLIENT_ID , '.') !=
COALESCE(:NEW.AD_CLIENT_ID , '.') OR
+ COALESCE(:NEW.AD_ORG_ID , '.') !=
COALESCE(:NEW.AD_ORG_ID , '.') OR
+ COALESCE(:NEW.ISACTIVE , '.') !=
COALESCE(:NEW.ISACTIVE , '.') OR
+ COALESCE(:NEW.PROPERTY , '.') !=
COALESCE(:NEW.PROPERTY , '.') OR
COALESCE(:NEW.AD_MODULE_ID , '.') !=
COALESCE(:NEW.AD_MODULE_ID , '.')) THEN
RAISE_APPLICATION_ERROR(-20532, '@20532@');
END IF;
@@ -85,16 +79,11 @@
--Check the only updated column is "selected". In this case maitin updated
--column as it was to prevent changes detection when trying to update
database
IF (UPDATING) THEN
- IF (COALESCE(:NEW.AD_PROPERTY_CONFIGURATION_ID, '.') =
COALESCE(:NEW.AD_PROPERTY_CONFIGURATION_ID, '.') AND
- COALESCE(:NEW.AD_CLIENT_ID , '.') =
COALESCE(:NEW.AD_CLIENT_ID , '.') AND
- COALESCE(:NEW.AD_ORG_ID , '.') =
COALESCE(:NEW.AD_ORG_ID , '.') AND
- COALESCE(:NEW.ISACTIVE , '.') =
COALESCE(:NEW.ISACTIVE , '.') AND
- COALESCE(:NEW.CREATED , '.') =
COALESCE(:NEW.CREATED , '.') AND
- COALESCE(:NEW.CREATEDBY , '.') =
COALESCE(:NEW.CREATEDBY , '.') AND
- COALESCE(:NEW.UPDATED , '.') =
COALESCE(:NEW.UPDATED , '.') AND
- COALESCE(:NEW.UPDATEDBY , '.') =
COALESCE(:NEW.UPDATEDBY , '.') AND
- COALESCE(:NEW.PROPERTY , '.') =
COALESCE(:NEW.PROPERTY , '.') AND
- COALESCE(:NEW.VALUE , '.') = COALESCE(:NEW.VALUE
, '.') AND
+ IF (COALESCE(:NEW.AD_CLIENT_ID , '.') =
COALESCE(:NEW.AD_CLIENT_ID , '.') AND
+ COALESCE(:NEW.AD_ORG_ID , '.') =
COALESCE(:NEW.AD_ORG_ID , '.') AND
+ COALESCE(:NEW.ISACTIVE , '.') =
COALESCE(:NEW.ISACTIVE , '.') AND
+ COALESCE(:NEW.PROPERTY , '.') =
COALESCE(:NEW.PROPERTY , '.') AND
+ COALESCE(:NEW.VALUE , '.') = COALESCE(:NEW.VALUE
, '.') AND
COALESCE(:NEW.AD_MODULE_ID , '.') =
COALESCE(:NEW.AD_MODULE_ID , '.') AND
:NEW.SELECTED != :OLD.SELECTED) THEN
:NEW.UPDATED := :OLD.UPDATED;
diff -r df1dfe427bc7 -r a16a91d616c6 src-db/database/sourcedata/AD_TAB.xml
--- a/src-db/database/sourcedata/AD_TAB.xml Mon Apr 19 14:03:58 2010 +0200
+++ b/src-db/database/sourcedata/AD_TAB.xml Wed Apr 21 12:50:15 2010 +0200
@@ -13081,7 +13081,7 @@
<!--7F5E8E4C55914138A358F5087B532B59--> <NAME><![CDATA[Bank Statement
Lines]]></NAME>
<!--7F5E8E4C55914138A358F5087B532B59-->
<AD_TABLE_ID><![CDATA[84203CBEBDA349C38319C0E549751546]]></AD_TABLE_ID>
<!--7F5E8E4C55914138A358F5087B532B59-->
<AD_WINDOW_ID><![CDATA[94EAA455D2644E04AB25D93BE5157B6D]]></AD_WINDOW_ID>
-<!--7F5E8E4C55914138A358F5087B532B59--> <SEQNO><![CDATA[30]]></SEQNO>
+<!--7F5E8E4C55914138A358F5087B532B59--> <SEQNO><![CDATA[40]]></SEQNO>
<!--7F5E8E4C55914138A358F5087B532B59--> <TABLEVEL><![CDATA[2]]></TABLEVEL>
<!--7F5E8E4C55914138A358F5087B532B59-->
<ISSINGLEROW><![CDATA[N]]></ISSINGLEROW>
<!--7F5E8E4C55914138A358F5087B532B59--> <ISINFOTAB><![CDATA[N]]></ISINFOTAB>
@@ -13461,7 +13461,7 @@
<!--C56E698100314ABBBBD3A89626CA551C--> <NAME><![CDATA[Imported bank
statements]]></NAME>
<!--C56E698100314ABBBBD3A89626CA551C-->
<AD_TABLE_ID><![CDATA[D4C23A17190649E7B78F55A05AF3438C]]></AD_TABLE_ID>
<!--C56E698100314ABBBBD3A89626CA551C-->
<AD_WINDOW_ID><![CDATA[94EAA455D2644E04AB25D93BE5157B6D]]></AD_WINDOW_ID>
-<!--C56E698100314ABBBBD3A89626CA551C--> <SEQNO><![CDATA[40]]></SEQNO>
+<!--C56E698100314ABBBBD3A89626CA551C--> <SEQNO><![CDATA[30]]></SEQNO>
<!--C56E698100314ABBBBD3A89626CA551C--> <TABLEVEL><![CDATA[1]]></TABLEVEL>
<!--C56E698100314ABBBBD3A89626CA551C-->
<ISSINGLEROW><![CDATA[N]]></ISSINGLEROW>
<!--C56E698100314ABBBBD3A89626CA551C--> <ISINFOTAB><![CDATA[N]]></ISINFOTAB>
diff -r df1dfe427bc7 -r a16a91d616c6
src-util/modulescript/build/classes/org/openbravo/modulescript/CreateDoctypeTemplate.class
Binary file
src-util/modulescript/build/classes/org/openbravo/modulescript/CreateDoctypeTemplate.class
has changed
diff -r df1dfe427bc7 -r a16a91d616c6
src-util/modulescript/build/classes/org/openbravo/modulescript/CreateDoctypeTemplateData.class
Binary file
src-util/modulescript/build/classes/org/openbravo/modulescript/CreateDoctypeTemplateData.class
has changed
diff -r df1dfe427bc7 -r a16a91d616c6
src-util/modulescript/src/org/openbravo/modulescript/CreateDoctypeTemplate.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++
b/src-util/modulescript/src/org/openbravo/modulescript/CreateDoctypeTemplate.java
Wed Apr 21 12:50:15 2010 +0200
@@ -0,0 +1,58 @@
+/*
+ *************************************************************************
+ * The contents of this file are subject to the Openbravo Public License
+ * Version 1.0 (the "License"), being the Mozilla Public License
+ * Version 1.1 with a permitted attribution clause; you may not use this
+ * file except in compliance with the License. You may obtain a copy of
+ * the License at http://www.openbravo.com/legal/license.html
+ * Software distributed under the License is distributed on an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+ * License for the specific language governing rights and limitations
+ * under the License.
+ * The Original Code is Openbravo ERP.
+ * The Initial Developer of the Original Code is Openbravo SLU
+ * All portions are Copyright (C) 2010 Openbravo SLU
+ * All Rights Reserved.
+ * Contributor(s): ______________________________________.
+ ************************************************************************
+ */
+package org.openbravo.modulescript;
+
+import java.sql.Connection;
+import java.sql.SQLException;
+import java.util.UUID;
+import org.apache.log4j.Logger;
+
+import javax.servlet.ServletException;
+
+import org.openbravo.database.ConnectionProvider;
+
+public class CreateDoctypeTemplate extends ModuleScript{
+
+ @Override
+ //Inserting Doctype template for shipment and receipt.Related to the
issue https://issues.openbravo.com/view.php?id=11996
+ public void execute() {
+ try {
+ ConnectionProvider cp = getConnectionProvider();
+ CreateDoctypeTemplateData[] data =
CreateDoctypeTemplateData.select(cp);
+ for (int i = 0; i < data.length; i++) {
+
+ if(data[i].vCount.equals("0")){
+ String strReportFileName="Goods
shipme...@our_ref@";
+ if(data[i].docbasetype.equals("MMR")){
+ strReportFileName="Goods
recei...@our_ref@";
+ }
+ String
strDoctypeTemplate_id=UUID.randomUUID().toString().replace("-",
"").toUpperCase();
+
CreateDoctypeTemplateData.insertDoctypeTemplate(cp.getConnection(), cp,
strDoctypeTemplate_id, data[i].adClientId, data[i].cDoctypeId, data[i].name+"
Report Template", "@basedesign@/org/openbravo/erpReports", strReportFileName,
"RptM_InOut.jrxml");
+
CreateDoctypeTemplateData.insertEmailDefinition(cp.getConnection(), cp,
data[i].adClientId, strDoctypeTemplate_id);
+ }
+ }
+ } catch (Exception e) {
+ handleError(e);
+ }
+
+ }
+
+
+
+}
\ No newline at end of file
diff -r df1dfe427bc7 -r a16a91d616c6
src-util/modulescript/src/org/openbravo/modulescript/CreateDoctypeTemplate_Data.xsql
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++
b/src-util/modulescript/src/org/openbravo/modulescript/CreateDoctypeTemplate_Data.xsql
Wed Apr 21 12:50:15 2010 +0200
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ *************************************************************************
+ * The contents of this file are subject to the Openbravo Public License
+ * Version 1.0 (the "License"), being the Mozilla Public License
+ * Version 1.1 with a permitted attribution clause; you may not use this
+ * file except in compliance with the License. You may obtain a copy of
+ * the License at http://www.openbravo.com/legal/license.html
+ * Software distributed under the License is distributed on an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+ * License for the specific language governing rights and limitations
+ * under the License.
+ * The Original Code is Openbravo ERP.
+ * The Initial Developer of the Original Code is Openbravo SLU
+ * All portions are Copyright (C) 2010 Openbravo SLU
+ * All Rights Reserved.
+ * Contributor(s): ______________________________________.
+ ************************************************************************
+-->
+<SqlClass name="CreateDoctypeTemplateData"
package="org.openbravo.modulescript">
+ <SqlClassComment></SqlClassComment>
+ <SqlMethod name="select" type="preparedStatement" return="multiple">
+ <SqlMethodComment></SqlMethodComment>
+ <Sql>
+ <![CDATA[
+ select c_doctype_id, ad_client_id, name,(select count(*) from
c_poc_doctype_template ct where ct.c_doctype_id = c_doctype.c_doctype_id) AS
v_count, docBaseType
+ from c_doctype where docbasetype in ('MMR','MMS')
+ ]]>
+ </Sql>
+ </SqlMethod>
+<SqlMethod name="insertDoctypeTemplate" type="preparedStatement"
connection="true" return="rowCount">
+ <SqlMethodComment></SqlMethodComment>
+ <Sql>
+ <![CDATA[
+ INSERT INTO c_poc_doctype_template(
+ c_poc_doctype_template_id, ad_client_id, ad_org_id, isactive,
+ created, createdby, updated, updatedby, c_doctype_id, name,
+ templatelocation, reportfilename, templatefilename)
+ VALUES (?, ?, '0', 'Y',
+ now(), '0', now(), '0', ?, ?,
+ ?, ?, ?)
+ ]]>
+ </Sql>
+ <Parameter name="doctypetemplateId"/>
+ <Parameter name="clientId"/>
+ <Parameter name="doctypeId"/>
+ <Parameter name="name"/>
+ <Parameter name="templatelocation"/>
+ <Parameter name="reportfilename"/>
+ <Parameter name="templatefilename"/>
+ </SqlMethod>
+ <SqlMethod name="insertEmailDefinition" type="preparedStatement"
connection="true" return="rowCount">
+ <SqlMethodComment></SqlMethodComment>
+ <Sql>
+ <![CDATA[
+ INSERT INTO c_poc_emaildefinition(
+ c_poc_emaildefinition_id, ad_client_id, ad_org_id, isactive,
+ created, createdby, updated, updatedby, c_poc_doctype_template_id,
+ subject, body, isdefault, ad_language)
+ VALUES (GET_UUID(), ?, '0', 'Y',
+ now(), '0', now(), '0', ?,
+ '', '', 'Y', 'en_US')
+ ]]>
+ </Sql>
+ <Parameter name="clientId"/>
+ <Parameter name="doctypetemplateId"/>
+ </SqlMethod>
+</SqlClass>
\ No newline at end of file
diff -r df1dfe427bc7 -r a16a91d616c6
src-wad/src/org/openbravo/wad/javasource.javaxml
--- a/src-wad/src/org/openbravo/wad/javasource.javaxml Mon Apr 19 14:03:58
2010 +0200
+++ b/src-wad/src/org/openbravo/wad/javasource.javaxml Wed Apr 21 12:50:15
2010 +0200
@@ -867,7 +867,8 @@
xmlDocument.setParameter("parentTabContainer", tabs.parentTabs());
xmlDocument.setParameter("mainTabContainer", tabs.mainTabs());
xmlDocument.setParameter("childTabContainer", tabs.childTabs());
- NavigationBar nav = new NavigationBar(this, vars.getLanguage(),
"<PARAMETER_TMP id="class">Almacen</PARAMETER_TMP>_Relation.html",
"<PARAMETER_TMP id="windowName">Window</PARAMETER_TMP>", "W", strReplaceWith,
tabs.breadcrumb());
+ String hideBackButton = vars.getGlobalVariable("hideMenu",
"#Hide_BackButton", "");
+ NavigationBar nav = new NavigationBar(this, vars.getLanguage(),
"<PARAMETER_TMP id="class">Almacen</PARAMETER_TMP>_Relation.html",
"<PARAMETER_TMP id="windowName">Window</PARAMETER_TMP>", "W", strReplaceWith,
tabs.breadcrumb(), hideBackButton.equals("true"));
xmlDocument.setParameter("navigationBar", nav.toString());
LeftTabsBar lBar = new LeftTabsBar(this, vars.getLanguage(),
"<PARAMETER_TMP id="class">Almacen</PARAMETER_TMP>_Relation.html",
strReplaceWith);
xmlDocument.setParameter("leftTabs", lBar.relationTemplate());
@@ -1033,7 +1034,8 @@
// if (!str<KEY_TMP id="key">PosicionAlmacen</KEY_TMP>.equals(""))
xmlDocument.setParameter("childTabContainer", tabs.childTabs(false));
// else xmlDocument.setParameter("childTabContainer",
tabs.childTabs(true));
xmlDocument.setParameter("childTabContainer", tabs.childTabs(false));
- NavigationBar nav = new NavigationBar(this, vars.getLanguage(),
"<PARAMETER_TMP id="class">Almacen</PARAMETER_TMP>_Relation.html",
"<PARAMETER_TMP id="windowName">Window</PARAMETER_TMP>", "W", strReplaceWith,
tabs.breadcrumb(), false, !concurrentSave);
+ String hideBackButton = vars.getGlobalVariable("hideMenu",
"#Hide_BackButton", "");
+ NavigationBar nav = new NavigationBar(this, vars.getLanguage(),
"<PARAMETER_TMP id="class">Almacen</PARAMETER_TMP>_Relation.html",
"<PARAMETER_TMP id="windowName">Window</PARAMETER_TMP>", "W", strReplaceWith,
tabs.breadcrumb(), hideBackButton.equals("true"), !concurrentSave);
xmlDocument.setParameter("navigationBar", nav.toString());
LeftTabsBar lBar = new LeftTabsBar(this, vars.getLanguage(),
"<PARAMETER_TMP id="class">Almacen</PARAMETER_TMP>_Relation.html",
strReplaceWith);
xmlDocument.setParameter("leftTabs",
lBar.editionTemplate(strCommand.equals("NEW")));
diff -r df1dfe427bc7 -r a16a91d616c6
src/org/openbravo/erpCommon/ad_actionButton/InvoicePaymentMonitor.java
--- a/src/org/openbravo/erpCommon/ad_actionButton/InvoicePaymentMonitor.java
Mon Apr 19 14:03:58 2010 +0200
+++ b/src/org/openbravo/erpCommon/ad_actionButton/InvoicePaymentMonitor.java
Wed Apr 21 12:50:15 2010 +0200
@@ -31,6 +31,7 @@
import org.openbravo.dal.service.OBDal;
import org.openbravo.erpCommon.ad_process.PaymentMonitor;
import org.openbravo.erpCommon.utility.OBError;
+import org.openbravo.erpCommon.utility.PropertyException;
import org.openbravo.erpCommon.utility.Utility;
import org.openbravo.model.common.invoice.Invoice;
import org.openbravo.xmlEngine.XmlDocument;
@@ -83,13 +84,17 @@
OBError myError = null;
try {
Invoice invoice = OBDal.getInstance().get(Invoice.class, strKey);
- if (invoice.isProcessed()) {
+ // Extra check for PaymentMonitor-disabling switch, to build correct
message for users
+ if (Utility.getPropertyValue("PaymentMonitor", vars.getClient(),
invoice.getOrganization()
+ .getId()) == null
+ && invoice.isProcessed())
PaymentMonitor.updateInvoice(invoice);
- }
myError = new OBError();
myError.setType("Success");
myError.setTitle(Utility.messageBD(this, "Success", vars.getLanguage()));
+ } catch (PropertyException e) {
+ myError = Utility.translateError(this, vars, vars.getLanguage(),
e.getMessage());
} catch (Exception e) {
log4j.error("Rollback in transaction", e);
myError = Utility.translateError(this, vars, vars.getLanguage(),
e.getMessage());
diff -r df1dfe427bc7 -r a16a91d616c6
src/org/openbravo/erpCommon/ad_forms/DocFINPaymentTemplate.java
--- a/src/org/openbravo/erpCommon/ad_forms/DocFINPaymentTemplate.java Mon Apr
19 14:03:58 2010 +0200
+++ b/src/org/openbravo/erpCommon/ad_forms/DocFINPaymentTemplate.java Wed Apr
21 12:50:15 2010 +0200
@@ -1,12 +1,20 @@
/*
-
************************************************************************************
- * Copyright (C) 2010 Openbravo S.L.U.
-
- * Licensed under the Openbravo Commercial License version 1.0
- * You may obtain a copy of the License at
- http://www.openbravo.com/legal/obcl.html
- <http://www.openbravo.com/legal/obcl.html>
-
************************************************************************************
+ *************************************************************************
+ * The contents of this file are subject to the Openbravo Public License
+ * Version 1.0 (the "License"), being the Mozilla Public License
+ * Version 1.1 with a permitted attribution clause; you may not use this
+ * file except in compliance with the License. You may obtain a copy of
+ * the License at http://www.openbravo.com/legal/license.html
+ * Software distributed under the License is distributed on an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+ * License for the specific language governing rights and limitations
+ * under the License.
+ * The Original Code is Openbravo ERP.
+ * The Initial Developer of the Original Code is Openbravo SLU
+ * All portions are Copyright (C) 2010 Openbravo SLU
+ * All Rights Reserved.
+ * Contributor(s): ______________________________________.
+ ************************************************************************
*/
package org.openbravo.erpCommon.ad_forms;
diff -r df1dfe427bc7 -r a16a91d616c6
src/org/openbravo/erpCommon/ad_process/PaymentMonitor.java
--- a/src/org/openbravo/erpCommon/ad_process/PaymentMonitor.java Mon Apr
19 14:03:58 2010 +0200
+++ b/src/org/openbravo/erpCommon/ad_process/PaymentMonitor.java Wed Apr
21 12:50:15 2010 +0200
@@ -17,6 +17,7 @@
import org.openbravo.dal.service.OBDal;
import org.openbravo.dal.service.OBQuery;
import org.openbravo.erpCommon.ad_forms.AcctServer;
------------------------------------------------------------------------------
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits