Skip to content

Commit

Permalink
Merge pull request #20781 from colemanw/tplFixes
Browse files Browse the repository at this point in the history
Fix undefined indexes in tpls
  • Loading branch information
demeritcowboy authored Jul 6, 2021
2 parents 724e5be + 39b97f9 commit 9718821
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 16 deletions.
2 changes: 1 addition & 1 deletion templates/CRM/Activity/Form/ActivityLinks.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*}
{* Links for scheduling/logging meetings and calls and Sending Email *}

{if $contact_id }
{if !empty($contact_id) }
{assign var = "contactId" value= $contact_id }
{/if}

Expand Down
2 changes: 1 addition & 1 deletion templates/CRM/Contact/Page/Inline/Demographics.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
{/if}
<div class="crm-summary-row">
<div class="crm-label">{ts}Gender{/ts}</div>
<div class="crm-content crm-contact-gender_display">{$gender_display}</div>
<div class="crm-content crm-contact-gender_display">{if !empty($gender_display)}{$gender_display}{/if}</div>
</div>

<div class="crm-summary-row">
Expand Down
8 changes: 4 additions & 4 deletions templates/CRM/Contact/Page/Inline/Email.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
{/if}
{foreach from=$email key="blockId" item=item}
{if $item.email}
<div class="crm-summary-row {if $item.is_primary eq 1}primary{/if}">
<div class="crm-summary-row {if !empty($item.is_primary)}{ts}primary{/ts}{/if}">
<div class="crm-label">
{$item.location_type} {ts}Email{/ts}
{privacyFlag field=do_not_email condition=$privacy.do_not_email}{privacyFlag field=on_hold condition=$item.on_hold}
Expand All @@ -46,14 +46,14 @@
{$item.email}
{/if}
{if $item.on_hold == 2}&nbsp;({ts}On Hold - Opt Out{/ts})&nbsp;{ts}{$item.hold_date|truncate:10:''|crmDate}{/ts}{elseif $item.on_hold}&nbsp;({ts}On Hold{/ts})&nbsp;{ts}{$item.hold_date|truncate:10:''|crmDate}{/ts}{/if}{if $item.is_bulkmail}&nbsp;({ts}Bulk{/ts}){/if}
{if $item.signature_text OR $item.signature_html}
{if !empty($item.signature_text) OR !empty($item.signature_html)}
<span class="signature-link description">
<a href="#" title="{ts}Signature{/ts}" onClick="showHideSignature( '{$blockId}' ); return false;">{ts}(signature){/ts}</a>
</span>
{/if}
<div id="Email_Block_{$blockId}_signature" class="hiddenElement">
<strong>{ts}Signature HTML{/ts}</strong><br />{$item.signature_html}<br /><br />
<strong>{ts}Signature Text{/ts}</strong><br />{$item.signature_text|nl2br}</div>
<strong>{ts}Signature HTML{/ts}</strong><br />{if !empty($item.signature_html)}{$item.signature_html}{/if}<br /><br />
<strong>{ts}Signature Text{/ts}</strong><br />{if !empty($item.signature_text)}{$item.signature_text|nl2br}{/if}</div>
</div>
</div>
{/if}
Expand Down
17 changes: 8 additions & 9 deletions templates/CRM/Custom/Form/Preview.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,18 @@
{foreach from=$groupTree item=cd_edit key=group_id}
<p></p>
<fieldset>{if $preview_type eq 'group'}<legend>{$smarty.capture.legend}</legend>{/if}
{if $cd_edit.help_pre}<div class="messages help">{$cd_edit.help_pre}</div><br />{/if}
{if !empty($cd_edit.help_pre)}<div class="messages help">{$cd_edit.help_pre}</div><br />{/if}
<table class="form-layout-compressed">
{foreach from=$cd_edit.fields item=element key=field_id}
{if $element.is_view eq 0}{* fix for CRM-2699 *}
{if $element.help_pre}
{if !empty($element.help_pre)}
<tr><td class="label"></td><td class="description">{$element.help_pre}</td></tr>
{/if}
{if $element.options_per_line }
{if !empty($element.options_per_line)}
{*assign var="element_name" value=$element.custom_group_id|cat:_|cat:$field_id|cat:_|cat:$element.name*}
{assign var="element_name" value=$element.element_name}
<tr>
<td class="label">{$form.$element_name.label}{if $element.help_post}{help id=$element.id file="CRM/Custom/Form/CustomField.hlp" title=$form.$element_name.label}{/if}</td>
<td class="label">{$form.$element_name.label}{if !empty($element.help_post)}{help id=$element.id file="CRM/Custom/Form/CustomField.hlp" title=$form.$element_name.label}{/if}</td>
<td>
{assign var="count" value="1"}
<table class="form-layout-compressed">
Expand All @@ -62,11 +62,10 @@
</td>
</tr>
{else}
{assign var="name" value=`$element.name`}
{*assign var="element_name" value=$group_id|cat:_|cat:$field_id|cat:_|cat:$element.name*}
{assign var="element_name" value=$element.element_name}
{capture assign="name"}{if !empty($element.name)}{$element.name}{/if}{/capture}
{capture assign="element_name"}{if !empty($element.element_name)}{$element.element_name}{/if}{/capture}
<tr>
<td class="label">{$form.$element_name.label}{if $element.help_post}{help id=$element.id file="CRM/Custom/Form/CustomField.hlp" title=$form.$element_name.label}{/if}</td>
<td class="label">{$form.$element_name.label}{if !empty($element.help_post)}{help id=$element.id file="CRM/Custom/Form/CustomField.hlp" title=$form.$element_name.label}{/if}</td>
<td>
{$form.$element_name.html}&nbsp;
{if $element.html_type eq 'Autocomplete-Select'}
Expand All @@ -79,7 +78,7 @@
{/if}
{/foreach}
</table>
{if $cd_edit.help_post}<br /><div class="messages help">{$cd_edit.help_post}</div>{/if}
{if !empty($cd_edit.help_post)}<br /><div class="messages help">{$cd_edit.help_post}</div>{/if}
</fieldset>
{/foreach}
{/strip}
Expand Down
2 changes: 1 addition & 1 deletion templates/CRM/Custom/Page/Group.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<td class="crmf-title crm-editable">{$row.title}</td>
<td id="row_{$row.id}_status">{if $row.is_active eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}</td>
<td>{if $row.extends eq 'Contact'}{ts}All Contact Types{/ts}{else}{$row.extends_display}{/if}</td>
<td>{$row.extends_entity_column_value}</td>
<td>{if !empty($row.extends_entity_column_value)}{$row.extends_entity_column_value}{/if}</td>
<td class="nowrap">{$row.weight}</td>
<td>{$row.style_display}</td>
<td>{$row.action|replace:'xx':$row.id}</td>
Expand Down

0 comments on commit 9718821

Please sign in to comment.