svn commit: r1626414 - in /ofbiz/trunk/applications/party: servicedef/services.xml src/org/ofbiz/party/contact/ContactMechServices.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1626414 - in /ofbiz/trunk/applications/party: servicedef/services.xml src/org/ofbiz/party/contact/ContactMechServices.java

apatel-2
Author: apatel
Date: Sat Sep 20 10:30:22 2014
New Revision: 1626414

URL: http://svn.apache.org/r1626414
Log:
[OFBIZ-2942] Thanks Adam Heath for reporting the issue. The patch by Deepak Dixit on Jira ticket fixes the issue. Now fromDate is also an IN parameter, if found null, then default to now timestamp.

Modified:
    ofbiz/trunk/applications/party/servicedef/services.xml
    ofbiz/trunk/applications/party/src/org/ofbiz/party/contact/ContactMechServices.java

Modified: ofbiz/trunk/applications/party/servicedef/services.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/servicedef/services.xml?rev=1626414&r1=1626413&r2=1626414&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/servicedef/services.xml (original)
+++ ofbiz/trunk/applications/party/servicedef/services.xml Sat Sep 20 10:30:22 2014
@@ -589,7 +589,7 @@ under the License.
         <attribute name="partyId" type="String" mode="IN" optional="true"/>
         <attribute name="contactMechId" type="String" mode="IN" optional="false"/>
         <attribute name="contactMechPurposeTypeId" type="String" mode="IN" optional="false"/>
-        <attribute name="fromDate" type="Timestamp" mode="OUT" optional="true"/>
+        <attribute name="fromDate" type="Timestamp" mode="INOUT" optional="true"/>
     </service>
     <service name="deletePartyContactMechPurpose" engine="java"
             location="org.ofbiz.party.contact.ContactMechServices" invoke="deletePartyContactMechPurpose" auth="true">

Modified: ofbiz/trunk/applications/party/src/org/ofbiz/party/contact/ContactMechServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/src/org/ofbiz/party/contact/ContactMechServices.java?rev=1626414&r1=1626413&r2=1626414&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/src/org/ofbiz/party/contact/ContactMechServices.java (original)
+++ ofbiz/trunk/applications/party/src/org/ofbiz/party/contact/ContactMechServices.java Sat Sep 20 10:30:22 2014
@@ -803,6 +803,7 @@ public class ContactMechServices {
         // required parameters
         String contactMechId = (String) context.get("contactMechId");
         String contactMechPurposeTypeId = (String) context.get("contactMechPurposeTypeId");
+        Timestamp fromDate = (Timestamp) context.get("fromDate");
 
         GenericValue tempVal = null;
         try {
@@ -816,7 +817,9 @@ public class ContactMechServices {
             tempVal = null;
         }
 
-        Timestamp fromDate = UtilDateTime.nowTimestamp();
+        if (UtilValidate.isEmpty(fromDate)) {
+            fromDate = UtilDateTime.nowTimestamp();
+        }
 
         if (tempVal != null) {
             // exists already with valid date, show warning