svn commit: r1626688 [20/46] - in /ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23: ./ applications/accounting/config/ applications/accounting/data/ applications/accounting/src/org/ofbiz/accounting/invoice/ applications/accounting/src/org/ofbi...

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

svn commit: r1626688 [20/46] - in /ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23: ./ applications/accounting/config/ applications/accounting/data/ applications/accounting/src/org/ofbiz/accounting/invoice/ applications/accounting/src/org/ofbi...

jleroux@apache.org
Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/script/org/ofbiz/party/test/PartyTests.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/script/org/ofbiz/party/test/PartyTests.xml?rev=1626688&r1=1626687&r2=1626688&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/script/org/ofbiz/party/test/PartyTests.xml (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/script/org/ofbiz/party/test/PartyTests.xml Mon Sep 22 08:09:27 2014
@@ -81,7 +81,7 @@ under the License.
         <clear-field field="oldPaymentMethodId"/>
 
         <!-- try now with few changes (cardType, cardNumber in this case), a new record will be created in PaymentMethod, CreditCard entity -->
-        <set field="serviceCtx.cardType" value="MasterCard"/>
+        <set field="serviceCtx.cardType" value="CCT_MASTERCARD"/>
         <set field="serviceCtx.cardNumber" value="5500000000000004"/>
         <call-service service-name="updateCreditCard" in-map-name="serviceCtx">
             <result-to-field result-name="paymentMethodId"/>

Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/servicedef/services.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/servicedef/services.xml?rev=1626688&r1=1626687&r2=1626688&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/servicedef/services.xml (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/servicedef/services.xml Mon Sep 22 08:09:27 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/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/src/org/ofbiz/party/contact/ContactMechServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/src/org/ofbiz/party/contact/ContactMechServices.java?rev=1626688&r1=1626687&r2=1626688&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/src/org/ofbiz/party/contact/ContactMechServices.java (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/src/org/ofbiz/party/contact/ContactMechServices.java Mon Sep 22 08:09:27 2014
@@ -803,20 +803,25 @@ 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 {
             Map<String, String> pcmpFindMap = UtilMisc.toMap("partyId", partyId, "contactMechId", contactMechId, "contactMechPurposeTypeId", contactMechPurposeTypeId);
             //Debug.logInfo("pcmpFindMap = " + pcmpFindMap, module);
-            List<GenericValue> allPCMPs = EntityUtil.filterByDate(delegator.findByAnd("PartyContactMechPurpose", pcmpFindMap, null, false), true);
+            List<GenericValue> allPCWPs = delegator.findByAnd("PartyContactWithPurpose", pcmpFindMap, null, false);
+            allPCWPs = EntityUtil.filterByDate(allPCWPs, null, "contactFromDate", "contactThruDate", true);
+            allPCWPs = EntityUtil.filterByDate(allPCWPs, null, "purposeFromDate", "purposeThruDate", true);
 
-            tempVal = EntityUtil.getFirst(allPCMPs);
+            tempVal = EntityUtil.getFirst(allPCWPs);
         } catch (GenericEntityException e) {
             Debug.logWarning(e.getMessage(), module);
             tempVal = null;
         }
 
-        Timestamp fromDate = UtilDateTime.nowTimestamp();
+        if (UtilValidate.isEmpty(fromDate)) {
+            fromDate = UtilDateTime.nowTimestamp();
+        }
 
         if (tempVal != null) {
             // exists already with valid date, show warning
@@ -867,9 +872,11 @@ public class ContactMechServices {
         try {
             Map<String, String> pcmpFindMap = UtilMisc.toMap("partyId", partyId, "contactMechId", contactMechId, "contactMechPurposeTypeId", contactMechPurposeTypeId);
             //Debug.logInfo("pcmpFindMap = " + pcmpFindMap, module);
-            List<GenericValue> allPCMPs = EntityUtil.filterByDate(delegator.findByAnd("PartyContactMechPurpose", pcmpFindMap, null, false), true);
+            List<GenericValue> allPCWPs = delegator.findByAnd("PartyContactWithPurpose", pcmpFindMap, null, false);
+            allPCWPs = EntityUtil.filterByDate(allPCWPs, null, "contactFromDate", "contactThruDate", true);
+            allPCWPs = EntityUtil.filterByDate(allPCWPs, null, "purposeFromDate", "purposeThruDate", true);
 
-            tempVal = EntityUtil.getFirst(allPCMPs);
+            tempVal = EntityUtil.getFirst(allPCWPs);
         } catch (GenericEntityException e) {
             Debug.logWarning(e.getMessage(), module);
             tempVal = null;

Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/src/org/ofbiz/party/party/PartyServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/src/org/ofbiz/party/party/PartyServices.java?rev=1626688&r1=1626687&r2=1626688&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/src/org/ofbiz/party/party/PartyServices.java (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/src/org/ofbiz/party/party/PartyServices.java Mon Sep 22 08:09:27 2014
@@ -223,12 +223,13 @@ public class PartyServices {
         try {
             GenericValue party = delegator.findOne("Party", UtilMisc.toMap("partyId", partyId), false);
 
-            if (party.get("statusId") == null) { // old records
-                party.set("statusId", "PARTY_ENABLED");
-            }
-
             String oldStatusId = party.getString("statusId");
-            if (!party.getString("statusId").equals(statusId)) {
+            if (!statusId.equals(oldStatusId)) {
+
+                if (oldStatusId == null) { // old records
+                    party.set("statusId", "PARTY_ENABLED");
+                    oldStatusId = party.getString("statusId");
+                } else {
 
                 // check that status is defined as a valid change
                 GenericValue statusValidChange = delegator.findOne("StatusValidChange", UtilMisc.toMap("statusId", party.getString("statusId"), "statusIdTo", statusId), false);
@@ -242,6 +243,7 @@ public class PartyServices {
                 }
 
                 party.set("statusId", statusId);
+                }
                 party.store();
 
                 // record this status change in PartyStatus table

Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/testdef/PartyTests.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/testdef/PartyTests.xml?rev=1626688&r1=1626687&r2=1626688&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/testdef/PartyTests.xml (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/testdef/PartyTests.xml Mon Sep 22 08:09:27 2014
@@ -24,5 +24,11 @@
     <test-case case-name="party-tests">
         <simple-method-test location="component://party/script/org/ofbiz/party/test/PartyTests.xml"/>
     </test-case>
-
+    <test-case case-name="partystatuschangetestdata">
+        <entity-xml action="load" entity-xml-url="component://party/testdef/data/PartyStatusChangeTestData.xml"/>
+    </test-case>
+    <test-case case-name="partystatuschangetest">
+        <simple-method-test location="component://party/script/org/ofbiz/party/test/PartyStatusChangeTests.xml"/>
+    </test-case>
+    
 </test-suite>

Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/webapp/partymgr/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/webapp/partymgr/WEB-INF/controller.xml?rev=1626688&r1=1626687&r2=1626688&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/webapp/partymgr/WEB-INF/controller.xml (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/webapp/partymgr/WEB-INF/controller.xml Mon Sep 22 08:09:27 2014
@@ -565,7 +565,7 @@ under the License.
     <request-map uri="createPartyRelationship">
         <security https="true" auth="true"/>
         <event type="service" path="" invoke="createPartyRelationship"/>
-        <response name="success" type="view-last" value="EditPartyRelationships"/>
+        <response name="success" type="view" value="EditPartyRelationships"/>
         <response name="error" type="view" value="EditPartyRelationships"/>
     </request-map>
     <request-map uri="createPartyRelationshipAndRole">