hg merge release-1.0c (forward-porting)

This commit is contained in:
Carlos Ruiz 2013-08-28 08:37:02 -05:00
commit 3e99d30d61
8 changed files with 107 additions and 30 deletions

View File

@ -0,0 +1,27 @@
SET SQLBLANKLINES ON
SET DEFINE OFF
-- Aug 27, 2013 4:17:41 PM COT
-- IDEMPIERE-1160 Hide potentially dangerous stuff from non-admin users / Web Service Security Window
UPDATE AD_Tab SET IsAdvancedTab='Y',Updated=TO_DATE('2013-08-27 16:17:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=53187
;
-- Aug 27, 2013 4:17:45 PM COT
UPDATE AD_Tab SET IsAdvancedTab='Y',Updated=TO_DATE('2013-08-27 16:17:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=53188
;
-- Aug 27, 2013 4:17:48 PM COT
UPDATE AD_Tab SET IsAdvancedTab='Y',Updated=TO_DATE('2013-08-27 16:17:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=53189
;
-- Aug 27, 2013 4:17:52 PM COT
UPDATE AD_Tab SET IsAdvancedTab='Y',Updated=TO_DATE('2013-08-27 16:17:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=53190
;
-- Aug 27, 2013 4:17:57 PM COT
UPDATE AD_Tab SET IsAdvancedTab='Y',Updated=TO_DATE('2013-08-27 16:17:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=53191
;
SELECT register_migration_script('201308271618_IDEMPIERE-1160.sql') FROM dual
;

View File

@ -0,0 +1,24 @@
-- Aug 27, 2013 4:17:41 PM COT
-- IDEMPIERE-1160 Hide potentially dangerous stuff from non-admin users / Web Service Security Window
UPDATE AD_Tab SET IsAdvancedTab='Y',Updated=TO_TIMESTAMP('2013-08-27 16:17:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=53187
;
-- Aug 27, 2013 4:17:45 PM COT
UPDATE AD_Tab SET IsAdvancedTab='Y',Updated=TO_TIMESTAMP('2013-08-27 16:17:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=53188
;
-- Aug 27, 2013 4:17:48 PM COT
UPDATE AD_Tab SET IsAdvancedTab='Y',Updated=TO_TIMESTAMP('2013-08-27 16:17:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=53189
;
-- Aug 27, 2013 4:17:52 PM COT
UPDATE AD_Tab SET IsAdvancedTab='Y',Updated=TO_TIMESTAMP('2013-08-27 16:17:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=53190
;
-- Aug 27, 2013 4:17:57 PM COT
UPDATE AD_Tab SET IsAdvancedTab='Y',Updated=TO_TIMESTAMP('2013-08-27 16:17:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=53191
;
SELECT register_migration_script('201308271618_IDEMPIERE-1160.sql') FROM dual
;

View File

@ -1474,18 +1474,29 @@ public final class Env
} else if (po != null) { } else if (po != null) {
//take from po //take from po
Object v = po.get_Value(token); Object v = po.get_Value(token);
MColumn colToken = MColumn.get(ctx, po.get_TableName(), token);
String foreignTable = colToken.getReferenceTableName();
if (v != null) { if (v != null) {
if (format != null && format.length() > 0) { if (format != null && format.length() > 0) {
if (v instanceof Integer && token.endsWith("_ID")) { if (v instanceof Integer && (Integer) v > 0 && token.endsWith("_ID")) {
int tblIndex = format.indexOf("."); int tblIndex = format.indexOf(".");
String table = tblIndex > 0 ? format.substring(0, tblIndex) : token.substring(0, token.length() - 3); String tableName = null;
String column = tblIndex > 0 ? format.substring(tblIndex + 1) : format; if (tblIndex > 0)
MColumn col = MColumn.get(ctx, table, column); tableName = format.substring(0, tblIndex);
if (col != null && col.isSecure()) { else
tableName = foreignTable;
MTable table = MTable.get(ctx, tableName);
if (table != null && tableName.equalsIgnoreCase(foreignTable)) {
String columnName = tblIndex > 0 ? format.substring(tblIndex + 1) : format;
MColumn column = table.getColumn(columnName);
if (column != null) {
if (column.isSecure()) {
outStr.append("********"); outStr.append("********");
} else { } else {
outStr.append(DB.getSQLValueString(trxName, outStr.append(DB.getSQLValueString(trxName,
"SELECT " + column + " FROM " + table + " WHERE " + table + "_ID = ?", (Integer)v)); "SELECT " + columnName + " FROM " + tableName + " WHERE " + tableName + "_ID = ?", (Integer)v));
}
}
} }
} else if (v instanceof Date) { } else if (v instanceof Date) {
SimpleDateFormat df = new SimpleDateFormat(format); SimpleDateFormat df = new SimpleDateFormat(format);

View File

@ -376,6 +376,12 @@ public class ReportStarter implements ProcessCall, ClientProcess
reportResult(AD_PInstance_ID, "Can not find report", trxName); reportResult(AD_PInstance_ID, "Can not find report", trxName);
return false; return false;
} }
if (reportPath.startsWith("@#LocalHttpAddr@")) {
String localaddr = Env.getContext(Env.getCtx(), "#LocalHttpAddr");
if (!Util.isEmpty(localaddr)) {
reportPath = reportPath.replace("@#LocalHttpAddr@", localaddr);
}
}
JasperData data = null; JasperData data = null;
File reportFile = null; File reportFile = null;
@ -421,7 +427,13 @@ public class ReportStarter implements ProcessCall, ClientProcess
resourcePath = resourcePath + "/"; resourcePath = resourcePath + "/";
} }
params.put("SUBREPORT_DIR", resourcePath); params.put("SUBREPORT_DIR", resourcePath);
if (reportPath.startsWith("http://") || reportPath.startsWith("https://")) {
int i = reportPath.lastIndexOf("/");
String httpPath = reportPath.substring(0, i+1);
params.put("RESOURCE_DIR", httpPath);
} else {
params.put("RESOURCE_DIR", resourcePath); params.put("RESOURCE_DIR", resourcePath);
}
if (jasperReport != null && pi.getTable_ID() > 0 && Record_ID <= 0 && pi.getRecord_IDs() != null && pi.getRecord_IDs().length > 0) if (jasperReport != null && pi.getTable_ID() > 0 && Record_ID <= 0 && pi.getRecord_IDs() != null && pi.getRecord_IDs().length > 0)
{ {
@ -826,19 +838,17 @@ public class ReportStarter implements ProcessCall, ClientProcess
MAttachmentEntry[] entries = attachment.getEntries(); MAttachmentEntry[] entries = attachment.getEntries();
for(int i = 0; i < entries.length; i++) { for(int i = 0; i < entries.length; i++) {
// @Trifon // @Trifon
if (!entries[i].getName().equals(name) if (!entries[i].getName().equals(name))
&& (entries[i].getName().toLowerCase().endsWith(".jrxml")
|| entries[i].getName().toLowerCase().endsWith(".jasper")
|| entries[i].getName().toLowerCase().endsWith(".jpg")
|| entries[i].getName().toLowerCase().endsWith(".png")
)
)
{ {
File reportFile = getAttachmentEntryFile(entries[i]); File reportFile = getAttachmentEntryFile(entries[i]);
if (reportFile != null) if (reportFile != null) {
if (entries[i].getName().toLowerCase().endsWith(".jrxml")
|| entries[i].getName().toLowerCase().endsWith(".jasper")) {
subreports.add(reportFile); subreports.add(reportFile);
} }
} }
}
}
File[] subreportsTemp = new File[0]; File[] subreportsTemp = new File[0];
subreportsTemp = subreports.toArray(subreportsTemp); subreportsTemp = subreports.toArray(subreportsTemp);
return subreportsTemp; return subreportsTemp;
@ -929,11 +939,6 @@ public class ReportStarter implements ProcessCall, ClientProcess
reportFile = new File(REPORT_HOME, reportPath); reportFile = new File(REPORT_HOME, reportPath);
} }
// Set org.compiere.report.path because it is used in reports which refer to subreports
if (reportFile != null)
{
System.setProperty("org.compiere.report.path", reportFile.getParentFile().getAbsolutePath());
}
return reportFile; return reportFile;
} }

View File

@ -359,7 +359,13 @@ public class AdempiereWebUI extends Window implements EventListener<Event>, IWeb
} }
Env.setContext(ctx, "#UIClient", "zk"); Env.setContext(ctx, "#UIClient", "zk");
StringBuilder localHttpAddr = new StringBuilder(Executions.getCurrent().getScheme());
localHttpAddr.append("://").append(Executions.getCurrent().getLocalAddr());
int port = Executions.getCurrent().getLocalPort();
if (port > 0 && port != 80) {
localHttpAddr.append(":").append(port);
}
Env.setContext(ctx, "#LocalHttpAddr", localHttpAddr.toString());
Clients.response(new AuScript("zAu.cmd0.clearBusy()")); Clients.response(new AuScript("zAu.cmd0.clearBusy()"));
} }

View File

@ -83,7 +83,7 @@ public class WebUIServlet extends DHtmlLayoutServlet
logger = CLogger.getCLogger(WebUIServlet.class); logger = CLogger.getCLogger(WebUIServlet.class);
logger.log(Level.OFF, "iDempiere web ui service started successfully"); logger.log(Level.OFF, "iDempiere Web Client started successfully");
/** /**
* End iDempiere Start * End iDempiere Start
*/ */

View File

@ -95,4 +95,9 @@
<name>org.zkoss.zul.borderlayout.animation.disabed</name> <name>org.zkoss.zul.borderlayout.animation.disabed</name>
<value>true</value> <value>true</value>
</library-property> </library-property>
<preference>
<name>org.zkoss.zk.ui.WebApp.name</name>
<value>iDempiere</value>
</preference>
</zk> </zk>

View File

@ -99,7 +99,6 @@ Import-Package: bsh,
org.codehaus.groovy.vmplugin.v5, org.codehaus.groovy.vmplugin.v5,
org.osgi.framework;version="1.3.0", org.osgi.framework;version="1.3.0",
org.osgi.service.component;version="1.1.0" org.osgi.service.component;version="1.1.0"
DynamicImport-Package: metainfo.zk
Bundle-ClassPath: ., Bundle-ClassPath: .,
lib/asm.jar, lib/asm.jar,
lib/cglib.jar, lib/cglib.jar,