svn commit: r928760 - /ofbiz/trunk/applications/party/webapp/partymgr/party/findparty.ftl

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

svn commit: r928760 - /ofbiz/trunk/applications/party/webapp/partymgr/party/findparty.ftl

jleroux@apache.org
Author: jleroux
Date: Mon Mar 29 12:43:42 2010
New Revision: 928760

URL: http://svn.apache.org/viewvc?rev=928760&view=rev
Log:
Fix a bug: partyType may not exist in some cases, and partyType.partyTypeId may be empty

Modified:
    ofbiz/trunk/applications/party/webapp/partymgr/party/findparty.ftl

Modified: ofbiz/trunk/applications/party/webapp/partymgr/party/findparty.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/webapp/partymgr/party/findparty.ftl?rev=928760&r1=928759&r2=928760&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/webapp/partymgr/party/findparty.ftl (original)
+++ ofbiz/trunk/applications/party/webapp/partymgr/party/findparty.ftl Mon Mar 29 12:43:42 2010
@@ -303,20 +303,24 @@ under the License.
             <#if softIdentifier?default("") != "">
               <td>${partyRow.softIdentifier?if_exists}</td>
             </#if>
-            <td>
-                <#if partyType.partyTypeId=="PERSON">
-                     <#assign partyRelateCom = delegator.findByAnd("PartyRelationship", {"partyIdTo", partyRow.partyId,"roleTypeIdFrom","ACCOUNT","roleTypeIdTo","CONTACT"})>
-                     <#if partyRelateCom?has_content>
-                        <#list partyRelateCom as partyRelationship>
-                            <#if partyRelationship.partyIdFrom?has_content>
-                                <#assign companyName=Static["org.ofbiz.party.party.PartyHelper"].getPartyName(delegator, partyRelationship.partyIdFrom, true)>
-                                ${companyName?if_exists}
-                            </#if>
-                        </#list>
-                     </#if>
-                </#if>
-            </td>
-            <td><#if partyType.description?exists>${partyType.get("description", locale)}<#else>???</#if></td>
+            <#if partyType?exists>  
+              <td>
+                  <#if partyType.partyTypeId?has_content && partyType.partyTypeId=="PERSON">
+                       <#assign partyRelateCom = delegator.findByAnd("PartyRelationship", {"partyIdTo", partyRow.partyId,"roleTypeIdFrom","ACCOUNT","roleTypeIdTo","CONTACT"})>
+                       <#if partyRelateCom?has_content>
+                          <#list partyRelateCom as partyRelationship>
+                              <#if partyRelationship.partyIdFrom?has_content>
+                                  <#assign companyName=Static["org.ofbiz.party.party.PartyHelper"].getPartyName(delegator, partyRelationship.partyIdFrom, true)>
+                                  ${companyName?if_exists}
+                              </#if>
+                          </#list>
+                       </#if>
+                  </#if>
+              </td>
+              <td><#if partyType.description?exists>${partyType.get("description", locale)}<#else>???</#if></td>
+           <#else>
+            <td></td><td></td>
+           </#if>
             <td>
               <#assign mainRole = dispatcher.runSync("getPartyMainRole", Static["org.ofbiz.base.util.UtilMisc"].toMap("partyId", partyRow.partyId, "userLogin", userLogin))/>
               ${mainRole.description?if_exists}