diff --git a/base/src/org/compiere/model/CalloutRequest.java b/base/src/org/compiere/model/CalloutRequest.java index 7e1def0398..63a62c7977 100644 --- a/base/src/org/compiere/model/CalloutRequest.java +++ b/base/src/org/compiere/model/CalloutRequest.java @@ -51,26 +51,19 @@ public class CalloutRequest extends CalloutEngine return ""; Integer R_MailText_ID = (Integer)value; - String sql = "SELECT MailHeader, MailText FROM R_MailText " - + "WHERE R_MailText_ID=?"; - try - { - PreparedStatement pstmt = DB.prepareStatement(sql, null); - pstmt.setInt(1, R_MailText_ID.intValue()); - ResultSet rs = pstmt.executeQuery(); - if (rs.next()) - { - String txt = rs.getString(2); - txt = Env.parseContext(ctx, WindowNo, txt, false, true); - mTab.setValue("Result", txt); - } - rs.close(); - pstmt.close(); - } - catch (SQLException e) - { - log.log(Level.SEVERE, sql, e); - } + MMailText mailtext = new MMailText(ctx, R_MailText_ID.intValue(), null); + + Integer userID = (Integer) mTab.getValue("AD_User_ID"); + if (userID != null) + mailtext.setUser(userID.intValue()); + Integer bpID = (Integer) mTab.getValue("C_BPartner_ID"); + if (bpID != null) + mailtext.setBPartner(bpID.intValue()); + + String txt = mailtext.getMailText(); + txt = Env.parseContext(ctx, WindowNo, txt, false, true); + mTab.setValue("Result", txt); + return ""; } // copyText diff --git a/base/src/org/compiere/model/MRequest.java b/base/src/org/compiere/model/MRequest.java index 80260fd4a8..3e8ecce403 100644 --- a/base/src/org/compiere/model/MRequest.java +++ b/base/src/org/compiere/model/MRequest.java @@ -1,5 +1,5 @@ /****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * + * Product: Adempiere ERP & CRM Smart Business Solution * * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * * This program is free software; you can redistribute it and/or modify it * * under the terms version 2 of the GNU General Public License as published * @@ -877,6 +877,10 @@ public class MRequest extends X_R_Request m_emailTo = new StringBuffer(); if (update != null || sendInfo.size() > 0) { + // Note that calling the notifications from beforeSave is causing the + // new interested are not notified if the RV_RequestUpdates view changes + // this is, when changed the sales rep (solved in sendNotices) + // or when changed the request category or group or contact (unsolved - the old ones are notified) sendNotices(sendInfo); // Update @@ -1117,7 +1121,7 @@ public class MRequest extends X_R_Request ArrayList userList = new ArrayList(); final String sql = "SELECT u.AD_User_ID, u.NotificationType, u.EMail, u.Name, MAX(r.AD_Role_ID) " + "FROM RV_RequestUpdates_Only ru" - + " INNER JOIN AD_User u ON (ru.AD_User_ID=u.AD_User_ID)" + + " INNER JOIN AD_User u ON (ru.AD_User_ID=u.AD_User_ID OR u.AD_User_ID=?)" + " LEFT OUTER JOIN AD_User_Roles r ON (u.AD_User_ID=r.AD_User_ID) " + "WHERE ru.R_Request_ID=? " + "GROUP BY u.AD_User_ID, u.NotificationType, u.EMail, u.Name"; @@ -1125,8 +1129,9 @@ public class MRequest extends X_R_Request ResultSet rs = null; try { - pstmt = DB.prepareStatement (sql, null); - pstmt.setInt (1, getR_Request_ID()); + pstmt = DB.prepareStatement (sql, get_TrxName()); + pstmt.setInt (1, getSalesRep_ID()); + pstmt.setInt (2, getR_Request_ID()); rs = pstmt.executeQuery (); while (rs.next ()) { diff --git a/db/ddlutils/oracle/functions/NextIDByYear.sql b/db/ddlutils/oracle/functions/NextIDByYear.sql deleted file mode 100644 index bdffb90681..0000000000 --- a/db/ddlutils/oracle/functions/NextIDByYear.sql +++ /dev/null @@ -1,24 +0,0 @@ -CREATE or REPLACE PROCEDURE NextIDByYear -( - p_AD_Sequence_ID IN NUMBER, - p_IncrementNo IN NUMBER, - p_CalendarYear IN CHAR, - o_NextID OUT NUMBER -) -AS -BEGIN - SELECT CurrentNext - INTO o_NextID - FROM AD_Sequence_No - WHERE AD_Sequence_ID=p_AD_Sequence_ID - AND CalendarYear = p_CalendarYear - FOR UPDATE OF CurrentNext; - -- - UPDATE AD_Sequence_No - SET CurrentNext = CurrentNext + p_IncrementNo - WHERE AD_Sequence_ID=p_AD_Sequence_ID - AND CalendarYear = p_CalendarYear; -EXCEPTION - WHEN OTHERS THEN - DBMS_OUTPUT.PUT_LINE(SQLERRM); -END NextIDByYear; diff --git a/db/ddlutils/oracle/functions/documentNo.sql b/db/ddlutils/oracle/functions/documentNo.sql index 5de146499a..de98d7daf1 100755 --- a/db/ddlutils/oracle/functions/documentNo.sql +++ b/db/ddlutils/oracle/functions/documentNo.sql @@ -42,3 +42,4 @@ BEGIN RETURN v_DocumentNo; END documentNo; +/ diff --git a/db/ddlutils/oracle/procedures/NextIDByYear.sql b/db/ddlutils/oracle/procedures/NextIDByYear.sql index dbb2d73a46..99a26e1acd 100644 --- a/db/ddlutils/oracle/procedures/NextIDByYear.sql +++ b/db/ddlutils/oracle/procedures/NextIDByYear.sql @@ -23,5 +23,3 @@ EXCEPTION DBMS_OUTPUT.PUT_LINE(SQLERRM); END NextIDByYear; / - - diff --git a/zkwebui/WEB-INF/src/org/adempiere/webui/window/WLocatorDialog.java b/zkwebui/WEB-INF/src/org/adempiere/webui/window/WLocatorDialog.java index 7750717193..15c71606de 100644 --- a/zkwebui/WEB-INF/src/org/adempiere/webui/window/WLocatorDialog.java +++ b/zkwebui/WEB-INF/src/org/adempiere/webui/window/WLocatorDialog.java @@ -147,6 +147,7 @@ public class WLocatorDialog extends Window implements EventListener boxLocator.setWidth("100%"); boxLocator.setWidths("30%, 70%"); + lstLocator.setWidth("150px"); // Elaine 2009/02/02 - fixed the locator width lstLocator.setMold("select"); lstLocator.setRows(0); @@ -238,6 +239,7 @@ public class WLocatorDialog extends Window implements EventListener this.setBorder("normal"); this.setWidth("260Px"); this.setAttribute("mode","modal"); + this.setSizable(true); // Elaine 2009/02/02 - window set to resizable } private void initLocator()