Commit 6e114317 by Naung1

complete fixbug report

parent 7fec0600
...@@ -249,15 +249,7 @@ public class ReportResultSet implements MyReport { ...@@ -249,15 +249,7 @@ public class ReportResultSet implements MyReport {
if(pre>-1 || pos>-1){ if(pre>-1 || pos>-1){
fixpFilter=this.swapFormat(fixpFilter); fixpFilter=this.swapFormat(fixpFilter);
} }
if(fixpFilter.indexOf("%25")>-1){ fixpFilter = this.replaceURLEscape(fixpFilter);
fixpFilter=fixpFilter.replace("%25", "%");
}
if(fixpFilter.indexOf("%3C")>-1){
fixpFilter=fixpFilter.replace("%3C", "<");
}
if(fixpFilter.indexOf("%3E")>-1){
fixpFilter=fixpFilter.replace("%3E", ">");
}
rFilter += fixpFilter; rFilter += fixpFilter;
if (filter.get(tableName) != null if (filter.get(tableName) != null
...@@ -287,6 +279,19 @@ public class ReportResultSet implements MyReport { ...@@ -287,6 +279,19 @@ public class ReportResultSet implements MyReport {
} }
} }
} }
private String replaceURLEscape(String param){
if(param.indexOf("%25")>-1){
param=param.replace("%25", "%");
}
if(param.indexOf("%3C")>-1){
param=param.replace("%3C", "<");
}
if(param.indexOf("%3E")>-1){
param=param.replace("%3E", ">");
}
return param;
}
private void setChildFilter(Hashtable h, Properties filter,DbInquiry inqParent) { private void setChildFilter(Hashtable h, Properties filter,DbInquiry inqParent) {
try { try {
...@@ -315,20 +320,22 @@ public class ReportResultSet implements MyReport { ...@@ -315,20 +320,22 @@ public class ReportResultSet implements MyReport {
if (filter.get(tableName) != null && if (filter.get(tableName) != null &&
!filter.get(tableName).equals("")) !filter.get(tableName).equals(""))
rFilter += " AND " + (String) filter.get(tableName); rFilter += " AND " + (String) filter.get(tableName);
} else } else{
rFilter = (String) filter.get(tableName); rFilter = (String) filter.get(tableName);
inq.setFilter(rFilter);
if(di.getRelation(inq.getActualName())!=null){
if(inq instanceof DbRecord){
mainkey=((DbRecord)inq).getMainkey().toLowerCase();
}else{
mainkey=((DbInquiry)inq).getCurrentDbRecord().getMainkey().toLowerCase();
} }
if(!di.getCurrentDbRecord().getArrayFieldList().contains(mainkey)){ rFilter = this.replaceURLEscape(rFilter);
mainkey=di.getCurrentDbRecord().getMainkey().toLowerCase(); inq.setFilter(rFilter);
if(di.getRelation(inq.getActualName())!=null){
if(inq instanceof DbRecord){
mainkey=((DbRecord)inq).getMainkey().toLowerCase();
}else{
mainkey=((DbInquiry)inq).getCurrentDbRecord().getMainkey().toLowerCase();
}
if(!di.getCurrentDbRecord().getArrayFieldList().contains(mainkey)){
mainkey=di.getCurrentDbRecord().getMainkey().toLowerCase();
}
reqFilter.add(mainkey+" in (select "+mainkey+" from "+inq.getTableName()+" where "+rFilter+")");
} }
reqFilter.add(mainkey+" in (select "+mainkey+" from "+inq.getTableName()+" where "+rFilter+")");
}
// reform filter for any object // reform filter for any object
if (this.di.getType().equals("inqreport")) { if (this.di.getType().equals("inqreport")) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment