Author: jleroux
Date: Sat Oct 24 22:40:22 2009
New Revision: 829460

URL: http://svn.apache.org/viewvc?rev=829460&view=rev
Log:
Fix "Create a Vcard from a contact in SFA" 
(https://issues.apache.org/jira/browse/OFBIZ-3059) - OFBIZ-3059
2 issues : 
* URL was not secured in FTL
* StateProvinceGeo is not mandatory (maybe there are others, too late too 
check..)

Modified:
    ofbiz/trunk/applications/marketing/src/org/ofbiz/sfa/vcard/VCard.java
    ofbiz/trunk/applications/marketing/webapp/sfa/contact/ListContacts.ftl

Modified: ofbiz/trunk/applications/marketing/src/org/ofbiz/sfa/vcard/VCard.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/src/org/ofbiz/sfa/vcard/VCard.java?rev=829460&r1=829459&r2=829460&view=diff
==============================================================================
--- ofbiz/trunk/applications/marketing/src/org/ofbiz/sfa/vcard/VCard.java 
(original)
+++ ofbiz/trunk/applications/marketing/src/org/ofbiz/sfa/vcard/VCard.java Sat 
Oct 24 22:40:22 2009
@@ -202,10 +202,11 @@
             address.setStreet(postalAddress.getString("address1"));
             address.setCity(postalAddress.getString("city"));
 
-            address.setPostalCode(postalAddress.getString("postalCode"));
-            String state = 
postalAddress.getRelatedOne("StateProvinceGeo").getString("geoName");
-            address.setRegion(state);
-
+            address.setPostalCode(postalAddress.getString("postalCode"));      
      
+            GenericValue state = 
postalAddress.getRelatedOne("StateProvinceGeo");
+            if (UtilValidate.isNotEmpty(state)) {
+                address.setRegion(state.getString("geoName"));
+            }
             String country = 
postalAddress.getRelatedOne("CountryGeo").getString("geoName");
             address.setCountry(country);
             address.setWork(true); // this can be better set by checking 
contactMechPurposeTypeId

Modified: ofbiz/trunk/applications/marketing/webapp/sfa/contact/ListContacts.ftl
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/webapp/sfa/contact/ListContacts.ftl?rev=829460&r1=829459&r2=829460&view=diff
==============================================================================
--- ofbiz/trunk/applications/marketing/webapp/sfa/contact/ListContacts.ftl 
(original)
+++ ofbiz/trunk/applications/marketing/webapp/sfa/contact/ListContacts.ftl Sat 
Oct 24 22:40:22 2009
@@ -61,8 +61,12 @@
                   </#if>
                 </#if>
               </td>
-              <td><a 
href="<@ofbizUrl>createVCardFromContact?partyId=${partyRow.partyId}</@ofbizUrl>">${uiLabelMap.SfaVCard}<a></td>
+              <td><a 
href="javascript:document.createVCardFromContact.submit();" 
class="buttontext">${uiLabelMap.SfaVCard}</a></td>
+              </td>
             </tr>
+            <form name="createVCardFromContact" method="post" 
action="<@ofbizUrl>createVCardFromContact</@ofbizUrl>">
+              <input type="hidden" name="partyId" value="${partyRow.partyId}"/>
+            </form>
             <#-- toggle the row color -->
             <#assign alt_row = !alt_row>
           </#list>


Reply via email to