<#-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <#macro updateOrderContactMech orderHeader contactMechTypeId contactMechList contactMechPurposeTypeId contactMechAddress> <#if (!orderHeader.statusId.equals("ORDER_COMPLETED")) && !(orderHeader.statusId.equals("ORDER_REJECTED")) && !(orderHeader.statusId.equals("ORDER_CANCELLED"))>
<#if displayParty?has_content || orderContactMechValueMaps?has_content>

<#list orderContactMechValueMaps as orderContactMechValueMap> <#assign contactMech = orderContactMechValueMap.contactMech> <#assign contactMechPurpose = orderContactMechValueMap.contactMechPurposeType>
 ${uiLabelMap.CommonName}  
<#if displayParty?has_content> <#assign displayPartyNameResult = dispatcher.runSync("getPartyNameForDate", Static["org.apache.ofbiz.base.util.UtilMisc"].toMap("partyId", displayParty.partyId, "compareDate", orderHeader.orderDate, "userLogin", userLogin))/> ${displayPartyNameResult.fullName?default("[${uiLabelMap.OrderPartyNameNotFound}]")} <#if partyId??>  (${partyId})
<#if (orderHeader.salesChannelEnumId)?? && orderHeader.salesChannelEnumId != "POS_SALES_CHANNEL">

 ${contactMechPurpose.get("description",locale)}   <#if contactMech.contactMechTypeId == "POSTAL_ADDRESS"> <#assign postalAddress = orderContactMechValueMap.postalAddress> <#if postalAddress?has_content>
${setContextField("postalAddress", postalAddress)} ${screens.render("component://party/widget/partymgr/PartyScreens.xml#postalAddressHtmlFormatter")}
<@updateOrderContactMech orderHeader=orderHeader! contactMechTypeId=contactMech.contactMechTypeId contactMechList=postalContactMechList! contactMechPurposeTypeId=contactMechPurpose.contactMechPurposeTypeId! contactMechAddress=postalAddress! /> <#elseif contactMech.contactMechTypeId == "TELECOM_NUMBER"> <#assign telecomNumber = orderContactMechValueMap.telecomNumber>
${telecomNumber.countryCode!} <#if telecomNumber.areaCode??>${telecomNumber.areaCode}-${telecomNumber.contactNumber} <#if !telecomNumber.countryCode?? || telecomNumber.countryCode == "011" || telecomNumber.countryCode == "1"> ${uiLabelMap.CommonLookupAnywho} ${uiLabelMap.CommonLookupWhitepages}
<@updateOrderContactMech orderHeader=orderHeader! contactMechTypeId=contactMech.contactMechTypeId contactMechList=telecomContactMechList! contactMechPurposeTypeId=contactMechPurpose.contactMechPurposeTypeId! contactMechAddress=telecomNumber! /> <#elseif contactMech.contactMechTypeId == "EMAIL_ADDRESS">
${contactMech.infoString} <#if security.hasEntityPermission("ORDERMGR", "_SEND_CONFIRMATION", session)> (${uiLabelMap.OrderSendConfirmationEmail}) <#else> (${uiLabelMap.OrderSendEmail})
<@updateOrderContactMech orderHeader=orderHeader! contactMechTypeId=contactMech.contactMechTypeId contactMechList=emailContactMechList! contactMechPurposeTypeId=contactMechPurpose.contactMechPurposeTypeId! contactMechAddress=contactMech! /> <#elseif contactMech.contactMechTypeId == "WEB_ADDRESS">
${contactMech.infoString} <#assign openString = contactMech.infoString> <#if !openString?starts_with("http") && !openString?starts_with("HTTP")> <#assign openString = "http://" + openString> (open page in new window)
<#else>
${contactMech.infoString!}