Integrate bug fixing from Compiere 260b

This commit is contained in:
Carlos Ruiz 2007-02-26 05:49:54 +00:00
parent fcb4aa7057
commit 14afc561fd
18 changed files with 76 additions and 46 deletions

View File

@ -84,6 +84,7 @@ public class AdvertisementServlet extends HttpServlet
throws ServletException, IOException throws ServletException, IOException
{ {
log.info("Get from " + request.getRemoteHost() + " - " + request.getRemoteAddr() + " - forward to request.jsp"); log.info("Get from " + request.getRemoteHost() + " - " + request.getRemoteAddr() + " - forward to request.jsp");
if (!response.isCommitted ())
response.sendRedirect("advertisements.jsp"); response.sendRedirect("advertisements.jsp");
} // doGet } // doGet
@ -110,6 +111,7 @@ public class AdvertisementServlet extends HttpServlet
if (wu == null) if (wu == null)
{ {
log.warning("No web user"); log.warning("No web user");
if (!response.isCommitted ())
response.sendRedirect("loginServlet?ForwardTo=advertisement.jsp"); // entry response.sendRedirect("loginServlet?ForwardTo=advertisement.jsp"); // entry
return; return;
} }

View File

@ -95,6 +95,7 @@ public class Click extends HttpServlet
request.getSession(true); // force create session for ctx request.getSession(true); // force create session for ctx
// //
String url = getTargetURL(request); String url = getTargetURL(request);
if (!response.isCommitted ())
response.sendRedirect(url); response.sendRedirect(url);
response.flushBuffer(); response.flushBuffer();
log.fine("redirect - " + url); log.fine("redirect - " + url);

View File

@ -20,7 +20,6 @@ import java.io.*;
import java.util.*; import java.util.*;
import javax.servlet.*; import javax.servlet.*;
import javax.servlet.http.*; import javax.servlet.http.*;
import org.compiere.model.*;
import org.compiere.util.*; import org.compiere.util.*;
/** /**
@ -105,7 +104,10 @@ public class EMailServlet extends HttpServlet
WebLogin thisLogin = new WebLogin(request, response, ctx); WebLogin thisLogin = new WebLogin(request, response, ctx);
thisLogin.init (); thisLogin.init ();
if (!thisLogin.action ()) { thisLogin.setMode("EMailVerify");
if (!thisLogin.action ())
{
if (!response.isCommitted ())
response.sendRedirect("loginServlet?ForwardTo=" + url); response.sendRedirect("loginServlet?ForwardTo=" + url);
return; return;
} }

View File

@ -85,7 +85,8 @@ public class ExpenseServlet extends HttpServlet
throws ServletException, IOException throws ServletException, IOException
{ {
log.info("Get from " + request.getRemoteHost() + " - " + request.getRemoteAddr() + " - forward to request.jsp"); log.info("Get from " + request.getRemoteHost() + " - " + request.getRemoteAddr() + " - forward to request.jsp");
response.sendRedirect("expenses.jsp"); if (!response.isCommitted ())
response.sendRedirect("expenses.jsp");
} // doGet } // doGet

View File

@ -16,30 +16,13 @@
*****************************************************************************/ *****************************************************************************/
package org.compiere.wstore; package org.compiere.wstore;
import org.compiere.util.CLogger; import java.io.*;
import org.compiere.util.WebEnv; import java.util.*;
import org.compiere.util.WebSessionCtx; import javax.servlet.*;
import org.compiere.util.Util; import javax.servlet.http.*;
import org.compiere.model.MLocation; import org.compiere.model.*;
import org.compiere.model.MCountry; import org.compiere.util.*;
import org.compiere.model.MRegion;
import org.apache.taglibs.standard.tag.el.core.ExpressionUtil;
import org.apache.ecs.xhtml.option;
import org.apache.log4j.lf5.LogLevel;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.RequestDispatcher;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Properties;
import java.util.logging.Level;
import sun.rmi.runtime.Log;
/** /**
* Location Servlet * Location Servlet

View File

@ -22,7 +22,6 @@ import javax.servlet.http.*;
import javax.servlet.jsp.*; import javax.servlet.jsp.*;
import javax.servlet.jsp.tagext.*; import javax.servlet.jsp.tagext.*;
import org.apache.ecs.*;
import org.apache.ecs.xhtml.*; import org.apache.ecs.xhtml.*;
import org.apache.taglibs.standard.tag.el.core.*; import org.apache.taglibs.standard.tag.el.core.*;
import org.compiere.model.*; import org.compiere.model.*;

View File

@ -22,8 +22,6 @@ import java.util.*;
import javax.servlet.*; import javax.servlet.*;
import javax.servlet.http.*; import javax.servlet.http.*;
import org.compiere.model.*;
import java.util.logging.*;
import org.compiere.util.*; import org.compiere.util.*;
/** /**
@ -97,7 +95,14 @@ public class LoginServlet extends HttpServlet
org.compiere.util.WebLogin thisLogin = new org.compiere.util.WebLogin(request, response, ctx); org.compiere.util.WebLogin thisLogin = new org.compiere.util.WebLogin(request, response, ctx);
thisLogin.init (); thisLogin.init ();
// JJ: cause needs to be fixed
if (WebUtil.getParameter(request, "Mode") == null)
if (WebUtil.getParameter(request, "mode") != null)
thisLogin.setP_Action("mode");
thisLogin.action (); thisLogin.action ();
if ("logout".equals(thisLogin.getMode()))
return; // already forwarded
String url = thisLogin.getLogin_RelURL (); String url = thisLogin.getLogin_RelURL ();
if (!url.startsWith("/")) if (!url.startsWith("/"))
@ -165,8 +170,8 @@ public class LoginServlet extends HttpServlet
if (salesRep != null) if (salesRep != null)
url += "?SalesRep_ID=" + salesRep; url += "?SalesRep_ID=" + salesRep;
// //
String mode = WebUtil.getParameter (request, "Mode"); //String mode = WebUtil.getParameter (request, "Mode");
log.fine("- targeting url=" + url + " - mode=" + mode); log.fine("- targeting url=" + url); // + " - mode=" + mode);
// Web User // Web User
WebUser wu = WebUser.get(request); WebUser wu = WebUser.get(request);
@ -176,6 +181,10 @@ public class LoginServlet extends HttpServlet
thisLogin.setForward (url); thisLogin.setForward (url);
// Also handover adressConfirm // Also handover adressConfirm
thisLogin.setAddressConfirm (addressConfirm); thisLogin.setAddressConfirm (addressConfirm);
// Since Mode Usage is not consequent we will try to figure it out.
if (WebUtil.getParameter(request, "Mode")==null)
if (WebUtil.getParameter(request, "mode")!=null)
thisLogin.setP_Action("mode");
// Start the process // Start the process
thisLogin.action (); thisLogin.action ();
// getback the URL // getback the URL
@ -190,4 +199,5 @@ public class LoginServlet extends HttpServlet
RequestDispatcher dispatcher = getServletContext().getRequestDispatcher(url); RequestDispatcher dispatcher = getServletContext().getRequestDispatcher(url);
dispatcher.forward(request, response); dispatcher.forward(request, response);
} // doPost } // doPost
} // LoginServlet } // LoginServlet

View File

@ -188,7 +188,8 @@ public class NoteServlet extends HttpServlet
if (wu == null) if (wu == null)
{ {
log.warning("No web user"); log.warning("No web user");
response.sendRedirect("loginServlet?ForwardTo=notes.jsp"); // entry if (!response.isCommitted ())
response.sendRedirect("loginServlet?ForwardTo=notes.jsp"); // entry
return; return;
} }
WebEnv.dump(request); WebEnv.dump(request);

View File

@ -118,7 +118,7 @@ public class OrderServlet extends HttpServlet
url = "/login.jsp"; url = "/login.jsp";
done = true; done = true;
} }
else else // Order parameter
order = getOrder(request, ctx); order = getOrder(request, ctx);
// We have an Order // We have an Order

View File

@ -94,7 +94,8 @@ public class RegistrationServlet extends HttpServlet
if (!processSystemRegistration(request, response)) if (!processSystemRegistration(request, response))
{ {
log.info("Forward to registration.jsp"); log.info("Forward to registration.jsp");
response.sendRedirect("registration.jsp"); if (!response.isCommitted ())
response.sendRedirect("registration.jsp");
} }
} // doGet } // doGet

View File

@ -209,7 +209,8 @@ public class RequestServlet extends HttpServlet
if (wu == null) if (wu == null)
{ {
log.warning("No web user"); log.warning("No web user");
response.sendRedirect("loginServlet?ForwardTo=request.jsp"); // entry if (!response.isCommitted ())
response.sendRedirect("loginServlet?ForwardTo=request.jsp"); // entry
return; return;
} }
if (contentType != null && contentType.indexOf("multipart/form-data") != -1) if (contentType != null && contentType.indexOf("multipart/form-data") != -1)

View File

@ -204,7 +204,8 @@ public class RfQServlet extends HttpServlet
if (wu == null) if (wu == null)
{ {
log.warning("doPost - no web user"); log.warning("doPost - no web user");
response.sendRedirect("loginServlet?ForwardTo=note.jsp"); // entry if (!response.isCommitted ())
response.sendRedirect("loginServlet?ForwardTo=note.jsp"); // entry
return; return;
} }
int C_RfQResponse_ID = WebUtil.getParameterAsInt(request, P_RfQResponse_ID); int C_RfQResponse_ID = WebUtil.getParameterAsInt(request, P_RfQResponse_ID);

View File

@ -17,13 +17,11 @@
package org.compiere.wstore; package org.compiere.wstore;
import org.compiere.util.*; import org.compiere.util.*;
import org.compiere.model.*;
import javax.servlet.http.*; import javax.servlet.http.*;
import javax.servlet.*; import javax.servlet.*;
import java.io.*; import java.io.*;
import java.util.*; import java.util.*;
import java.util.logging.*;
/** /**
* Web User Update. * Web User Update.
@ -134,7 +132,9 @@ public class UpdateServlet
WebUtil.reload(thisLogin.getMessage(), thisLogin.getUpdate_page (), session, request, response, getServletContext()); WebUtil.reload(thisLogin.getMessage(), thisLogin.getUpdate_page (), session, request, response, getServletContext());
return; return;
} }
String url = thisLogin.getLogin_RelURL (); String url = thisLogin.getForward();
if (url == null || url.length() == 0)
url = "/";
session.setAttribute (WebUser.NAME, wu); session.setAttribute (WebUser.NAME, wu);
@ -143,5 +143,7 @@ public class UpdateServlet
url = "/" + url; url = "/" + url;
log.info("Forward to " + url); log.info("Forward to " + url);
RequestDispatcher dispatcher = getServletContext().getRequestDispatcher(url);
dispatcher.forward(request, response);
} // doPost } // doPost
} }

View File

@ -57,7 +57,7 @@ public class WorkflowServlet extends HttpServlet
*/ */
public String getServletInfo() public String getServletInfo()
{ {
return "adempiere Web Workflow Servlet"; return "Adempiere Web Workflow Servlet";
} // getServletInfo } // getServletInfo
/** /**
@ -195,7 +195,8 @@ public class WorkflowServlet extends HttpServlet
if (wu == null) if (wu == null)
{ {
log.warning("doPost - no web user"); log.warning("doPost - no web user");
response.sendRedirect("loginServlet?ForwardTo=note.jsp"); // entry if (!response.isCommitted ())
response.sendRedirect("loginServlet?ForwardTo=note.jsp"); // entry
return; return;
} }
// Get Feedback // Get Feedback

View File

@ -661,7 +661,8 @@ public class ServerBean implements SessionBean
m_no = ++s_no; m_no = ++s_no;
try try
{ {
Adempiere.startup(false); if (!Adempiere.startup(false))
throw new CreateException("Compiere could not start");
} }
catch (Exception ex) catch (Exception ex)
{ {

View File

@ -231,7 +231,8 @@ public class StatusBean implements SessionBean
m_no = ++s_no; m_no = ++s_no;
try try
{ {
org.compiere.Adempiere.startup(false); if (!Adempiere.startup(false))
throw new CreateException("Compiere could not start");
} }
catch (Exception ex) catch (Exception ex)
{ {

View File

@ -871,8 +871,19 @@ public class Doc_Invoice extends Doc
+ "(SELECT currencyConvert(il.PriceActual,i.C_Currency_ID,po.C_Currency_ID,i.DateInvoiced,i.C_ConversionType_ID,i.AD_Client_ID,i.AD_Org_ID) " + "(SELECT currencyConvert(il.PriceActual,i.C_Currency_ID,po.C_Currency_ID,i.DateInvoiced,i.C_ConversionType_ID,i.AD_Client_ID,i.AD_Org_ID) "
+ "FROM C_Invoice i, C_InvoiceLine il " + "FROM C_Invoice i, C_InvoiceLine il "
+ "WHERE i.C_Invoice_ID=il.C_Invoice_ID" + "WHERE i.C_Invoice_ID=il.C_Invoice_ID"
+ " AND po.M_Product_ID=il.M_Product_ID AND po.C_BPartner_ID=i.C_BPartner_ID" + " AND po.M_Product_ID=il.M_Product_ID AND po.C_BPartner_ID=i.C_BPartner_ID");
+ " AND ROWNUM=1 AND i.C_Invoice_ID=").append(get_ID()).append(") ") //jz + " AND ROWNUM=1 AND i.C_Invoice_ID=").append(get_ID()).append(") ")
if (DB.isOracle()) //jz
{
sql.append(" AND ROWNUM=1) ");
}
else
sql.append(" AND i.UPDATED IN (SELECT MAX(i1.UPDATED) "
+ "FROM C_Invoice i1, C_InvoiceLine il1 "
+ "WHERE i1.C_Invoice_ID=il1.C_Invoice_ID"
+ " AND po.M_Product_ID=il1.M_Product_ID AND po.C_BPartner_ID=i1.C_BPartner_ID")
.append(" AND i1.C_Invoice_ID=").append(get_ID()).append(") ");
sql.append(" AND i.C_Invoice_ID=").append(get_ID()).append(") ")
// update // update
.append("WHERE EXISTS (SELECT * " .append("WHERE EXISTS (SELECT * "
+ "FROM C_Invoice i, C_InvoiceLine il " + "FROM C_Invoice i, C_InvoiceLine il "

View File

@ -422,7 +422,19 @@ public class Doc_Order extends Doc
+ "FROM C_Order o, C_OrderLine ol " + "FROM C_Order o, C_OrderLine ol "
+ "WHERE o.C_Order_ID=ol.C_Order_ID" + "WHERE o.C_Order_ID=ol.C_Order_ID"
+ " AND po.M_Product_ID=ol.M_Product_ID AND po.C_BPartner_ID=o.C_BPartner_ID" + " AND po.M_Product_ID=ol.M_Product_ID AND po.C_BPartner_ID=o.C_BPartner_ID"
+ " AND ROWNUM=1 AND o.C_Order_ID=").append(get_ID()).append(") ") + " AND ROWNUM=1 AND o.C_Order_ID=").append(get_ID()).append(") ");
//jz + " AND ROWNUM=1 AND o.C_Order_ID=").append(get_ID()).append(") ")
if (DB.isOracle()) //jz
{
sql.append(" AND ROWNUM=1) ");
}
else
sql.append(" AND o.UPDATED IN (SELECT MAX(o1.UPDATED) "
+ "FROM C_Order o1, C_OrderLine ol1 "
+ "WHERE o1.C_Order_ID=ol1.C_Order_ID"
+ " AND po.M_Product_ID=ol1.M_Product_ID AND po.C_BPartner_ID=o1.C_BPartner_ID")
.append(" AND o1.C_Order_ID=").append(get_ID()).append(") ");
sql.append(" AND o.C_Order_ID=").append(get_ID()).append(") ")
.append("WHERE EXISTS (SELECT * " .append("WHERE EXISTS (SELECT * "
+ "FROM C_Order o, C_OrderLine ol " + "FROM C_Order o, C_OrderLine ol "
+ "WHERE o.C_Order_ID=ol.C_Order_ID" + "WHERE o.C_Order_ID=ol.C_Order_ID"