From 1482b1b38b6c155d36fb74c862ba78440e51092c Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Fri, 2 Jul 2021 19:29:24 -0400 Subject: [PATCH] Fix undefined tpl vars on contact summary page --- .../CRM/Contact/Page/Inline/Demographics.tpl | 15 ++++++++------- templates/CRM/Contact/Page/Inline/Phone.tpl | 6 +++--- .../CRM/Contact/Page/View/CustomDataView.tpl | 4 ++-- templates/CRM/Custom/Page/CustomDataView.tpl | 2 +- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/templates/CRM/Contact/Page/Inline/Demographics.tpl b/templates/CRM/Contact/Page/Inline/Demographics.tpl index f2995abbc6..a0c2be1de5 100644 --- a/templates/CRM/Contact/Page/Inline/Demographics.tpl +++ b/templates/CRM/Contact/Page/Inline/Demographics.tpl @@ -22,19 +22,20 @@
{ts}Date of Birth{/ts}
- {assign var="date_format" value = $fields.birth_date.smarty_view_format} - {$birth_date|crmDate:$date_format} -   + {assign var="date_format" value=$fields.birth_date.smarty_view_format} + {if !empty($birth_date)} + {$birth_date|crmDate:$date_format} + {/if}
- {if $is_deceased eq 1} - {if $deceased_date} + {if !empty($is_deceased)} + {if !empty($deceased_date)}
{ts}Date Deceased{/ts}
{assign var="date_format" value = $fields.birth_date.smarty_view_format} {$deceased_date|crmDate:$date_format} - {if $birth_date}({ts}Age{/ts} {if $age.y}{ts count=$age.y plural='%count years'}%count year{/ts}{elseif $age.m}{ts count=$age.m plural='%count months'}%count month{/ts}{/if}){/if} + {if !empty($birth_date)}({ts}Age{/ts} {if !empty($age.y)}{ts count=$age.y plural='%count years'}%count year{/ts}{elseif !empty($age.m)}{ts count=$age.m plural='%count months'}%count month{/ts}{/if}){/if}
{else} @@ -46,7 +47,7 @@ {else}
{ts}Age{/ts}
-
{if $age.y}{ts count=$age.y plural='%count years'}%count year{/ts}{elseif $age.m}{ts count=$age.m plural='%count months'}%count month{/ts}{/if}
+
{if !empty($age.y)}{ts count=$age.y plural='%count years'}%count year{/ts}{elseif !empty($age.m)}{ts count=$age.m plural='%count months'}%count month{/ts}{/if}
{/if} diff --git a/templates/CRM/Contact/Page/Inline/Phone.tpl b/templates/CRM/Contact/Page/Inline/Phone.tpl index 953fa202e4..2ddfcb7349 100644 --- a/templates/CRM/Contact/Page/Inline/Phone.tpl +++ b/templates/CRM/Contact/Page/Inline/Phone.tpl @@ -26,15 +26,15 @@ {/if} {foreach from=$phone item=item} - {if $item.phone || $item.phone_ext} -
+ {if !empty($item.phone) || !empty($item.phone_ext)} +
{privacyFlag field=do_not_sms condition=$privacy.do_not_sms} {privacyFlag field=do_not_phone condition=$privacy.do_not_phone} {$item.location_type} {$item.phone_type}
- {$item.phone}{if $item.phone_ext}  {ts}ext.{/ts} {$item.phone_ext}{/if} + {$item.phone}{if !empty($item.phone_ext)}  {ts}ext.{/ts} {$item.phone_ext}{/if}
{/if} diff --git a/templates/CRM/Contact/Page/View/CustomDataView.tpl b/templates/CRM/Contact/Page/View/CustomDataView.tpl index 68b9eb992b..4cfd3cd8cc 100644 --- a/templates/CRM/Contact/Page/View/CustomDataView.tpl +++ b/templates/CRM/Contact/Page/View/CustomDataView.tpl @@ -12,9 +12,9 @@ {foreach from=$viewCustomData item=customValues key=customGroupId} {assign var="cgcount" value=1} {assign var="count" value=$customGroupCount%2} - {if ($count eq $side) or $skipTitle } + {if ($count eq $side) or !empty($skipTitle)} {foreach from=$customValues item=cd_edit key=cvID} -
+
{$cd_edit.title}
diff --git a/templates/CRM/Custom/Page/CustomDataView.tpl b/templates/CRM/Custom/Page/CustomDataView.tpl index f7f3f87003..df241801a4 100644 --- a/templates/CRM/Custom/Page/CustomDataView.tpl +++ b/templates/CRM/Custom/Page/CustomDataView.tpl @@ -31,7 +31,7 @@ {assign var="showEdit" value=0} -
+
{if !$skipTitle}
{$cd_edit.title} -- 2.25.1