hg merge release-1.0c (merge release1 into release2)

This commit is contained in:
Carlos Ruiz 2013-11-27 10:44:06 -05:00
commit 887f4cb57d
7 changed files with 180 additions and 40 deletions

View File

@ -0,0 +1,47 @@
SET SQLBLANKLINES ON
SET DEFINE OFF
-- Nov 26, 2013 7:43:01 PM COT
-- IDEMPIERE-594 Improve positioning on windows / Fix Relation Type window layout
UPDATE AD_Field SET SeqNo=20, IsDisplayed='Y', XPosition=4,Updated=TO_DATE('2013-11-26 19:43:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=58069
;
-- Nov 26, 2013 7:43:01 PM COT
UPDATE AD_Field SET SeqNo=40,Updated=TO_DATE('2013-11-26 19:43:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=58066
;
-- Nov 26, 2013 7:43:02 PM COT
UPDATE AD_Field SET SeqNo=50,Updated=TO_DATE('2013-11-26 19:43:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=58067
;
-- Nov 26, 2013 7:43:02 PM COT
UPDATE AD_Field SET SeqNo=60,Updated=TO_DATE('2013-11-26 19:43:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=58075
;
-- Nov 26, 2013 7:43:02 PM COT
UPDATE AD_Field SET SeqNo=70,Updated=TO_DATE('2013-11-26 19:43:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=58071
;
-- Nov 26, 2013 7:43:02 PM COT
UPDATE AD_Field SET SeqNo=80, IsDisplayed='Y', XPosition=4, ColumnSpan=2,Updated=TO_DATE('2013-11-26 19:43:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=58072
;
-- Nov 26, 2013 7:43:02 PM COT
UPDATE AD_Field SET SeqNo=90, IsDisplayed='Y', XPosition=1,Updated=TO_DATE('2013-11-26 19:43:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=58073
;
-- Nov 26, 2013 7:43:02 PM COT
UPDATE AD_Field SET SeqNo=100, IsDisplayed='Y', XPosition=4, ColumnSpan=2,Updated=TO_DATE('2013-11-26 19:43:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=58074
;
-- Nov 26, 2013 7:43:02 PM COT
UPDATE AD_Field SET SeqNo=110, IsDisplayed='Y', XPosition=2,Updated=TO_DATE('2013-11-26 19:43:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=58064
;
-- Nov 26, 2013 7:43:02 PM COT
UPDATE AD_Field SET SeqNo=0,Updated=TO_DATE('2013-11-26 19:43:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=58070
;
SELECT register_migration_script('201311261943_IDEMPIERE-594.sql') FROM dual
;

View File

@ -0,0 +1,44 @@
-- Nov 26, 2013 7:43:01 PM COT
-- IDEMPIERE-594 Improve positioning on windows / Fix Relation Type window layout
UPDATE AD_Field SET SeqNo=20, IsDisplayed='Y', XPosition=4,Updated=TO_TIMESTAMP('2013-11-26 19:43:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=58069
;
-- Nov 26, 2013 7:43:01 PM COT
UPDATE AD_Field SET SeqNo=40,Updated=TO_TIMESTAMP('2013-11-26 19:43:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=58066
;
-- Nov 26, 2013 7:43:02 PM COT
UPDATE AD_Field SET SeqNo=50,Updated=TO_TIMESTAMP('2013-11-26 19:43:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=58067
;
-- Nov 26, 2013 7:43:02 PM COT
UPDATE AD_Field SET SeqNo=60,Updated=TO_TIMESTAMP('2013-11-26 19:43:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=58075
;
-- Nov 26, 2013 7:43:02 PM COT
UPDATE AD_Field SET SeqNo=70,Updated=TO_TIMESTAMP('2013-11-26 19:43:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=58071
;
-- Nov 26, 2013 7:43:02 PM COT
UPDATE AD_Field SET SeqNo=80, IsDisplayed='Y', XPosition=4, ColumnSpan=2,Updated=TO_TIMESTAMP('2013-11-26 19:43:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=58072
;
-- Nov 26, 2013 7:43:02 PM COT
UPDATE AD_Field SET SeqNo=90, IsDisplayed='Y', XPosition=1,Updated=TO_TIMESTAMP('2013-11-26 19:43:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=58073
;
-- Nov 26, 2013 7:43:02 PM COT
UPDATE AD_Field SET SeqNo=100, IsDisplayed='Y', XPosition=4, ColumnSpan=2,Updated=TO_TIMESTAMP('2013-11-26 19:43:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=58074
;
-- Nov 26, 2013 7:43:02 PM COT
UPDATE AD_Field SET SeqNo=110, IsDisplayed='Y', XPosition=2,Updated=TO_TIMESTAMP('2013-11-26 19:43:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=58064
;
-- Nov 26, 2013 7:43:02 PM COT
UPDATE AD_Field SET SeqNo=0,Updated=TO_TIMESTAMP('2013-11-26 19:43:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=58070
;
SELECT register_migration_script('201311261943_IDEMPIERE-594.sql') FROM dual
;

View File

@ -16,9 +16,11 @@ package org.adempiere.impexp;
import static org.compiere.model.SystemIDs.REFERENCE_PAYMENTRULE;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Collections;
@ -47,6 +49,7 @@ import org.compiere.util.DB;
import org.compiere.util.DisplayType;
import org.compiere.util.Env;
import org.compiere.util.Evaluator;
import org.compiere.util.Ini;
import org.compiere.util.Msg;
import org.compiere.util.Util;
import org.supercsv.cellprocessor.FmtBool;
@ -76,7 +79,10 @@ public class GridTabCSVExporter implements IGridTabExporter
MTable table= null;
MTable tableDetail = null;
try {
mapWriter = new CsvMapWriter(new FileWriter(file), CsvPreference.STANDARD_PREFERENCE);
FileOutputStream fileOut = new FileOutputStream (file);
OutputStreamWriter oStrW = new OutputStreamWriter(fileOut, Ini.getCharset());
BufferedWriter bw = new BufferedWriter(oStrW);
mapWriter = new CsvMapWriter(bw, CsvPreference.STANDARD_PREFERENCE);
String isValidTab = isValidTabToExport(gridTab);
if(isValidTab!=null){
throw new AdempiereException(isValidTab);

View File

@ -302,7 +302,7 @@ Import-Package: com.lowagie.text,
groovyjarjarasm.asm.signature,
groovyjarjarasm.asm.tree,
groovyjarjarcommonscli,
org.apache.batik;version="17.0.0",
org.apache.batik;version="1.7.0",
org.apache.batik.anim;version="1.7.0",
org.apache.batik.anim.timing;version="1.7.0",
org.apache.batik.anim.values;version="1.7.0",

View File

@ -401,79 +401,122 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
if (field.getColumnName().equalsIgnoreCase(query.getZoomColumnName()))
{
gridWindow.initTab(tabIndex);
int parentId = DB.getSQLValue(null, "SELECT " + gTab.getLinkColumnName() + " FROM " + gTab.getTableName() + " WHERE " + query.getWhereClause());
if (parentId > 0)
int[] parentIds = DB.getIDsEx(null, "SELECT " + gTab.getLinkColumnName() + " FROM " + gTab.getTableName() + " WHERE " + query.getWhereClause());
if (parentIds.length > 0)
{
Map<Integer, Object[]>parentMap = new TreeMap<Integer, Object[]>();
int index = tabIndex;
int oldpid = parentId;
GridTab currentTab = gTab;
while (index > 0)
GridTab parentTab = null;
Map<Integer, MQuery>queryMap = new TreeMap<Integer, MQuery>();
for (int parentId : parentIds)
{
index--;
GridTab pTab = gridWindow.getTab(index);
if (pTab.getTabLevel() < currentTab.getTabLevel())
Map<Integer, Object[]>parentMap = new TreeMap<Integer, Object[]>();
int index = tabIndex;
int oldpid = parentId;
GridTab currentTab = gTab;
while (index > 0)
{
gridWindow.initTab(index);
if (index > 0)
index--;
GridTab pTab = gridWindow.getTab(index);
if (pTab.getTabLevel() < currentTab.getTabLevel())
{
if (pTab.getLinkColumnName() != null && pTab.getLinkColumnName().trim().length() > 0)
if (parentTab == null)
parentTab = pTab;
gridWindow.initTab(index);
if (index > 0)
{
int pid = DB.getSQLValue(null, "SELECT " + pTab.getLinkColumnName() + " FROM " + pTab.getTableName() + " WHERE " + currentTab.getLinkColumnName() + " = ?", oldpid);
if (pid > 0)
if (pTab.getLinkColumnName() != null && pTab.getLinkColumnName().trim().length() > 0)
{
parentMap.put(index, new Object[]{currentTab.getLinkColumnName(), oldpid});
oldpid = pid;
currentTab = pTab;
}
else
{
parentMap.clear();
break;
int pid = DB.getSQLValue(null, "SELECT " + pTab.getLinkColumnName() + " FROM " + pTab.getTableName() + " WHERE " + currentTab.getLinkColumnName() + " = ?", oldpid);
if (pid > 0)
{
parentMap.put(index, new Object[]{currentTab.getLinkColumnName(), oldpid});
oldpid = pid;
currentTab = pTab;
}
else
{
parentMap.clear();
break;
}
}
}
else
{
parentMap.put(index, new Object[]{currentTab.getLinkColumnName(), oldpid});
}
}
}
for(Map.Entry<Integer, Object[]> entry : parentMap.entrySet())
{
GridTab pTab = gridWindow.getTab(entry.getKey());
Object[] value = entry.getValue();
MQuery pquery = queryMap.get(entry.getKey());
if (pquery == null)
{
pquery = new MQuery(pTab.getAD_Table_ID());
queryMap.put(entry.getKey(), pquery);
pquery.addRestriction((String)value[0], "=", value[1]);
}
else
{
parentMap.put(index, new Object[]{currentTab.getLinkColumnName(), oldpid});
pquery.addRestriction((String)value[0], "=", value[1], null, null, false, 0);
}
}
}
for(Map.Entry<Integer, Object[]> entry : parentMap.entrySet())
for (Map.Entry<Integer, MQuery> entry : queryMap.entrySet())
{
GridTab pTab = gridWindow.getTab(entry.getKey());
Object[] value = entry.getValue();
MQuery pquery = new MQuery(pTab.getAD_Table_ID());
pquery.addRestriction((String)value[0], "=", value[1]);
IADTabpanel tp = adTabbox.findADTabpanel(pTab);
tp.createUI();
if (tp.getTabLevel() == 0)
{
pTab.setQuery(pquery);
pTab.setQuery(entry.getValue());
tp.query();
}
else
{
tp.query();
pTab.setQuery(pquery);
pTab.setQuery(entry.getValue());
tp.query();
}
}
}
MQuery targetQuery = new MQuery(gTab.getAD_Table_ID());
targetQuery.addRestriction(gTab.getLinkColumnName(), "=", parentId);
targetQuery.addRestriction(gTab.getLinkColumnName(), "=", parentTab.getRecord_ID());
gTab.setQuery(targetQuery);
IADTabpanel gc = null;
gc = adTabbox.findADTabpanel(gTab);
gc.createUI();
gc.query(false, 0, 0);
int zoomColumnIndex = -1;
GridTable table = gTab.getTableModel();
for (int i = 0; i < table.getColumnCount(); i++)
{
if (table.getColumnName(i).equalsIgnoreCase(query.getZoomColumnName()))
{
zoomColumnIndex = i;
break;
}
}
int count = table.getRowCount();
for(int i = 0; i < count; i++)
{
int id = table.getKeyID(i);
int id = -1;
if (zoomColumnIndex >= 0)
{
Object zoomValue = table.getValueAt(i, zoomColumnIndex);
if (zoomValue != null && zoomValue instanceof Number)
{
id = ((Number)zoomValue).intValue();
}
}
else
{
id = table.getKeyID(i);
}
if (id == ((Integer)query.getZoomValue()).intValue())
{
setActiveTab(gridWindow.getTabIndex(gTab), null);

View File

@ -37,6 +37,7 @@ import org.adempiere.webui.session.SessionManager;
import org.adempiere.webui.theme.ThemeManager;
import org.compiere.model.MSysConfig;
import org.compiere.model.X_R_RequestType;
import org.compiere.util.DisplayType;
import org.compiere.util.Env;
import org.compiere.util.Msg;
import org.compiere.util.Util;
@ -52,7 +53,6 @@ import org.zkoss.calendar.event.CalendarsEvent;
import org.zkoss.calendar.impl.SimpleCalendarEvent;
import org.zkoss.calendar.impl.SimpleCalendarModel;
import org.zkoss.image.AImage;
import org.zkoss.util.Locales;
import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.Executions;
import org.zkoss.zk.ui.event.Event;
@ -410,7 +410,7 @@ public class CalendarWindow extends Window implements EventListener<Event>, ITab
private void updateDateLabel() {
Date b = calendars.getBeginDate();
Date e = calendars.getEndDate();
SimpleDateFormat sdfV = new SimpleDateFormat("yyyy/MMM/dd", Locales.getCurrent());
SimpleDateFormat sdfV = DisplayType.getDateFormat();
sdfV.setTimeZone(calendars.getDefaultTimeZone());
lblDate.setValue(sdfV.format(b) + " - " + sdfV.format(e));
}

View File

@ -38,6 +38,7 @@ import org.compiere.model.PO;
import org.compiere.model.X_R_RequestType;
import org.compiere.util.CLogger;
import org.compiere.util.DB;
import org.compiere.util.DisplayType;
import org.compiere.util.Env;
import org.compiere.util.Trx;
import org.compiere.util.TrxEventListener;
@ -49,7 +50,6 @@ import org.zkoss.calendar.Calendars;
import org.zkoss.calendar.api.CalendarEvent;
import org.zkoss.calendar.event.CalendarsEvent;
import org.zkoss.calendar.impl.SimpleCalendarModel;
import org.zkoss.util.Locales;
import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.Desktop;
import org.zkoss.zk.ui.Executions;
@ -397,7 +397,7 @@ public class DPCalendar extends DashboardPanel implements EventListener<Event>,
private void updateDateLabel() {
Date b = calendars.getBeginDate();
Date e = calendars.getEndDate();
SimpleDateFormat sdfV = new SimpleDateFormat("yyyy/MMM/dd", Locales.getCurrent());
SimpleDateFormat sdfV = DisplayType.getDateFormat();
sdfV.setTimeZone(calendars.getDefaultTimeZone());
lblDate.setValue(sdfV.format(b) + " - " + sdfV.format(e));
}