From 030df257d476a8a581a4f04a359b8274e5895f03 Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Tue, 8 Jun 2021 00:55:50 +0000 Subject: [PATCH] [php8-compact] Add in guards into various templates to fix hook tests in php8 --- .../CRM/Admin/Form/ParticipantStatusType.tpl | 3 ++- templates/CRM/Admin/Page/ContactType.tpl | 2 +- templates/CRM/Admin/Page/Job.tpl | 6 +++--- templates/CRM/Admin/Page/JobLog.tpl | 10 +++++----- templates/CRM/Admin/Page/LocationType.tpl | 4 ++-- templates/CRM/Admin/Page/MailSettings.tpl | 20 +++++++++---------- 6 files changed, 23 insertions(+), 22 deletions(-) diff --git a/templates/CRM/Admin/Form/ParticipantStatusType.tpl b/templates/CRM/Admin/Form/ParticipantStatusType.tpl index 6b159db7b2..b7afd0d559 100644 --- a/templates/CRM/Admin/Form/ParticipantStatusType.tpl +++ b/templates/CRM/Admin/Form/ParticipantStatusType.tpl @@ -39,11 +39,12 @@ {$form.class.html}
{ts}The general class of this status. Participant counts are grouped by class on the CiviEvent Dashboard. Participants with a 'Pending' class status will be moved to 'Expired' status if Pending Participant Hours has elapsed (when the ParticipantProcessor.php background processing script is run).{/ts} - + {if !empty($form.is_reserved)} {$form.is_reserved.label} {$form.is_reserved.html} + {/if} {$form.is_active.label} {$form.is_active.html} diff --git a/templates/CRM/Admin/Page/ContactType.tpl b/templates/CRM/Admin/Page/ContactType.tpl index 17158358b4..a8b122919f 100644 --- a/templates/CRM/Admin/Page/ContactType.tpl +++ b/templates/CRM/Admin/Page/ContactType.tpl @@ -32,7 +32,7 @@ {foreach from=$rows item=row} - + {ts}{$row.label}{/ts} {if $row.parent}{ts}{$row.parent_label}{/ts}{else}{ts}(built-in){/ts}{/if} {$row.description} diff --git a/templates/CRM/Admin/Page/Job.tpl b/templates/CRM/Admin/Page/Job.tpl index 2738a86b94..3a999252cb 100644 --- a/templates/CRM/Admin/Page/Job.tpl +++ b/templates/CRM/Admin/Page/Job.tpl @@ -39,14 +39,14 @@ {foreach from=$rows item=row} - + {$row.name} ({$row.run_frequency})
{$row.description}
{ts}API Entity:{/ts} {$row.api_entity}
{ts}API Action:{/ts} {$row.api_action}
- {if $row.parameters eq null}{ts}no parameters{/ts}{else}
{$row.parameters}
{/if} - {if $row.last_run eq null}never{else}{$row.last_run|crmDate:$config->dateformatDatetime}{/if} + {if isset($row.parameters)}{if $row.parameters eq null}{ts}no parameters{/ts}{else}
{$row.parameters}
{/if}{/if} + {if isset($row.last_run)}{if $row.last_run eq null}never{else}{$row.last_run|crmDate:$config->dateformatDatetime}{/if}{/if} {if $row.is_active eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if} {$row.action|replace:'xx':$row.id} diff --git a/templates/CRM/Admin/Page/JobLog.tpl b/templates/CRM/Admin/Page/JobLog.tpl index ca3bac9e55..5e93685a6a 100644 --- a/templates/CRM/Admin/Page/JobLog.tpl +++ b/templates/CRM/Admin/Page/JobLog.tpl @@ -8,23 +8,23 @@ +--------------------------------------------------------------------+ *}
- {ts}This screen presents the list of most recent 1,000 scheduled jobs log entries.{/ts} {$docLink} + {ts}This screen presents the list of most recent 1,000 scheduled jobs log entries.{/ts} {if !empty($docLink)}{$docLink}{/if}
-{if $jobId} +{if !empty($jobId)}

{ts}List of log entries for:{/ts} {$jobName}

{/if} -{if $rows} +{if !empty($rows)}
{strip} {* handle enable/disable actions*} @@ -63,7 +63,7 @@ diff --git a/templates/CRM/Admin/Page/LocationType.tpl b/templates/CRM/Admin/Page/LocationType.tpl index 1eb9600caa..9802054b33 100644 --- a/templates/CRM/Admin/Page/LocationType.tpl +++ b/templates/CRM/Admin/Page/LocationType.tpl @@ -37,10 +37,10 @@ {$row.name} {$row.display_name} - {$row.vcard_name} + {if !empty($row.vcard_name)}{$row.vcard_name}{/if} {$row.description} {if $row.is_active eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if} - {icon condition=$row.is_default}{ts}Default{/ts}{/icon}  + {if isset($row.is_default)}{icon condition=$row.is_default}{ts}Default{/ts}{/icon} {/if} {$row.action|replace:'xx':$row.id} {/foreach} diff --git a/templates/CRM/Admin/Page/MailSettings.tpl b/templates/CRM/Admin/Page/MailSettings.tpl index 18f1d67148..c2ef4b9983 100644 --- a/templates/CRM/Admin/Page/MailSettings.tpl +++ b/templates/CRM/Admin/Page/MailSettings.tpl @@ -34,15 +34,15 @@ {foreach from=$rows item=row} {$row.name} - {$row.server} - {$row.username} - {$row.localpart} - {$row.domain} - {$row.return_path} - {$row.protocol} - {$row.source} - - {if $row.is_ssl eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if} + {if !empty($row.server)}{$row.server}{/if} + {if !empty($row.username)}{$row.username}{/if} + {if !empty($row.localpart)}{$row.localpart}{/if} + {if !empty($row.domain)}{$row.domain}{/if} + {if !empty($row.return_path)}{$row.return_path}{/if} + {if !empty($row.protocol)}{$row.protocol}{/if} + {if !empty($row.source)}{$row.source}{/if} + + {if isset($row.is_ssl) and $row.is_ssl eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if} {if $row.is_default eq 1}{ts}Bounce Processing (Default){/ts}{else}{ts}Email-to-Activity{/ts}{/if}  {$row.action|replace:'xx':$row.id} @@ -58,7 +58,7 @@ {ts}None found.{/ts}
{/if} - {if $setupActions} + {if !empty($setupActions)}