details:   /erp/stable/2.50/rev/f5ae74ff0489
changeset: 9084:f5ae74ff0489
user:      Asier Lostalé <asier.lostale <at> openbravo.com>
date:      Tue Dec 14 13:27:24 2010 +0100
summary:   fixed bug 15421: Calendar always appear in english

details:   /erp/stable/2.50/rev/2fbe2449d3ac
changeset: 9085:2fbe2449d3ac
user:      Asier Lostalé <asier.lostale <at> openbravo.com>
date:      Tue Dec 14 16:03:46 2010 +0100
summary:   fixed bug 15424: Moving forward / back arrows not working in 
Reconciliation tab

diffstat:

 src-wad/src/org/openbravo/wad/controls/WADDate.java     |   6 +--
 src-wad/src/org/openbravo/wad/controls/WADDateTime.java |   6 +--
 src/org/openbravo/erpCommon/utility/TableSQLData.java   |  33 +++++++++++++---
 web/js/jscalendar/lang/calendar-lang.js                 |  25 ++++++++++++
 4 files changed, 53 insertions(+), 17 deletions(-)

diffs (105 lines):

diff -r 05985d41095b -r 2fbe2449d3ac 
src-wad/src/org/openbravo/wad/controls/WADDate.java
--- a/src-wad/src/org/openbravo/wad/controls/WADDate.java       Tue Dec 14 
16:03:17 2010 +0100
+++ b/src-wad/src/org/openbravo/wad/controls/WADDate.java       Tue Dec 14 
16:03:46 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 05985d41095b -r 2fbe2449d3ac 
src-wad/src/org/openbravo/wad/controls/WADDateTime.java
--- a/src-wad/src/org/openbravo/wad/controls/WADDateTime.java   Tue Dec 14 
16:03:17 2010 +0100
+++ b/src-wad/src/org/openbravo/wad/controls/WADDateTime.java   Tue Dec 14 
16:03:46 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 05985d41095b -r 2fbe2449d3ac 
src/org/openbravo/erpCommon/utility/TableSQLData.java
--- a/src/org/openbravo/erpCommon/utility/TableSQLData.java     Tue Dec 14 
16:03:17 2010 +0100
+++ b/src/org/openbravo/erpCommon/utility/TableSQLData.java     Tue Dec 14 
16:03:46 2010 +0100
@@ -2145,13 +2145,32 @@
        * executable sql statement and uses this instead of the bigger one.
        */
       if (onlyId) {
-        txtAuxWhere.deleteCharAt(txtAuxWhere.length() - 1);
-        txtAuxWhere.deleteCharAt(txtAuxWhere.length() - 1);
-        int pos = txtAuxWhere.indexOf("SELECT");
-        txtAuxWhere.delete(0, pos);
-        // replace the previously built sql-text with our version
-        // completely
-        text = txtAuxWhere;
+        if (getPool().getRDBMS().equalsIgnoreCase("ORACLE")) {
+          txtAuxWhere.deleteCharAt(txtAuxWhere.length() - 1);
+          txtAuxWhere.deleteCharAt(txtAuxWhere.length() - 1);
+          int pos = txtAuxWhere.indexOf("FROM");
+          txtAuxWhere.delete(0, pos);
+          // replace the previously built sql-text with our version
+          // completely
+
+          text = txtAuxWhere;
+
+          if (hasRange) {
+            // don't add alias as it is already done in the subquery
+            text.insert(0, "SELECT " + keyColumns + " \n");
+          } else {
+            // add alias
+            text.insert(0, "SELECT " + keyColumnsTable + " \n");
+          }
+        } else {
+          txtAuxWhere.deleteCharAt(txtAuxWhere.length() - 1);
+          txtAuxWhere.deleteCharAt(txtAuxWhere.length() - 1);
+          int pos = txtAuxWhere.indexOf("SELECT");
+          txtAuxWhere.delete(0, pos);
+          // replace the previously built sql-text with our version
+          // completely
+          text = txtAuxWhere;
+        }
       } else {
         // old behavior for !onlyId case
         text.append("WHERE ").append(txtAuxWhere.toString());
diff -r 05985d41095b -r 2fbe2449d3ac web/js/jscalendar/lang/calendar-lang.js
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/web/js/jscalendar/lang/calendar-lang.js   Tue Dec 14 16:03:46 2010 +0100
@@ -0,0 +1,25 @@
+/*
+ *************************************************************************
+ * The contents of this file are subject to the Openbravo  Public  License
+ * Version  1.1  (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):  ______________________________________.
+ ************************************************************************
+*/
+
+
+// Import calendar based on the language in use.
+// Note this works only for the calendars included within jscalendar/lang 
directory
+
+var lang = defaultLang.substring(0,2);
+document.write('<s'+'cript 
src="../../web/js/jscalendar/lang/calendar-'+lang+'.js" 
type="text/javascript"><\/scrip'+'t>');
\ No newline at end of file

------------------------------------------------------------------------------
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

Reply via email to