[php8-compact] Fix Dashboard Tests by adding in if guards into smarty templates
authorSeamus Lee <seamuslee001@gmail.com>
Mon, 7 Jun 2021 22:21:45 +0000 (22:21 +0000)
committerSeamus Lee <seamuslee001@gmail.com>
Fri, 11 Jun 2021 02:45:46 +0000 (02:45 +0000)
templates/CRM/Case/Form/Search/Common.tpl
templates/CRM/Contact/Form/GroupContact.tpl
templates/CRM/Contact/Page/View/RelationshipSelector.tpl
templates/CRM/Contact/Page/View/UserDashBoard/GroupContact.tpl
templates/CRM/Contribute/Page/PcpUserDashboard.tpl
templates/CRM/Core/DatePickerRangeWrapper.tpl
templates/CRM/Form/validate.tpl
templates/CRM/Pledge/Page/UserDashboard.tpl
templates/CRM/common/contactFooter.tpl

index a6eb66cbc0dede1d32f4b56bc23f4eeaef9c8ea2..6b5edd73cecf51b9807790bb8a7c277a25b9afd9 100644 (file)
@@ -48,7 +48,7 @@
       {/if}
     </td>
     <td class="crm-case-common-form-block-case_tags">
-      {if $form.case_tags.html}
+      {if !empty($form.case_tags.html)}
         {$form.case_tags.label}<br />
         {$form.case_tags.html}
       {/if}
@@ -59,7 +59,7 @@
     <td colspan="3">{include file="CRM/common/Tagset.tpl" tagsetType='case'}</td>
   </tr>
 
-  {if $caseGroupTree}
+  {if !empty($caseGroupTree)}
     <tr>
       <td colspan="3">
         {include file="CRM/Custom/Form/Search.tpl" groupTree=$caseGroupTree showHideLinks=false}
index 8997a1875b3f013530cd962b36b3e2dc6e011182..39b9db30f43ac56a2d2fd1524c2f1f0b9e57cfb3 100644 (file)
@@ -10,6 +10,6 @@
 {* this template is used for adding a contact to a group (from view context) *}
 
 <div class="form-item">
-    {$form.group_id.html} {$form.buttons.html}
+    {if !empty($form.group_id)}{$form.group_id.html}{/if} {if !empty($form.buttons)}{$form.buttons.html}{/if}
     {include file="CRM/Form/validate.tpl"}
 </div>
index 04d5b11e44acad0a17d313b49a29f1391a48ebf1..663b4aa7e0bf724d68857e8479bb4d5e56ff674e 100644 (file)
@@ -10,6 +10,9 @@
 {* entity selector *}
 {crmRegion name="crm-contact-relationshipselector-pre"}
 {/crmRegion}
+{if !isset($entityInClassFormat)}
+   {assign var="entityInClassFormat" value="relationship"}
+{/if}
 <div class="crm-contact-{$entityInClassFormat}-{$context}">
   <table
     class="crm-contact-{$entityInClassFormat}-selector-{$context} crm-ajax-table"
index 7306c342a0b63f3123693cec32e2147b58153663..ab39980a660001daecb6d87cebea10dcf5811bcb 100644 (file)
@@ -7,7 +7,7 @@
  | and copyright information, see https://civicrm.org/licensing       |
  +--------------------------------------------------------------------+
 *}
-{if $userChecksum}
+{if !empty($userChecksum)}
   {assign var=edit value='0'}
 {/if}
 {crmRegion name="crm-contact-userdashboard-groupcontact-pre"}
index 43e62b4ebf042bf8d855259f950241e4de7a4291..60c47528467ddb85b6660791e07e174fd79ada99 100644 (file)
@@ -21,7 +21,7 @@
     <th>{ts}In Support of{/ts}</th>
     <th>{ts}Campaign Ends{/ts}</th>
     <th>{ts}Status{/ts}</th>
-    {if !$userChecksum} <th></th> {/if}
+    {if empty($userChecksum)} <th></th> {/if}
   </tr>
 
   {foreach from=$pcpInfo item=row}
@@ -30,7 +30,7 @@
         <td>{$row.pageTitle}</td>
         <td>{if $row.end_date}{$row.end_date|truncate:10:''|crmDate}{else}({ts}ongoing{/ts}){/if}</td>
         <td>{$row.pcpStatus}</td>
-        {if !$userChecksum}
+        {if empty($userChecksum)}
           <td>{$row.action|replace:'xx':$row.pcpId}</td>
         {/if}
   </tr>
index 2e6fcb54adc9bad8969fede9a6ec8ed386ac799b..f43499bd1308570de952e04f4ee7397c69000f51 100644 (file)
@@ -8,7 +8,7 @@
  +--------------------------------------------------------------------+
 *}
 {* Wrapper around DatePickerRange TPL file *}
-<td {if $colspan} colspan="{$colspan}" {else} colspan="2" {/if} {if $class} class="{$class}" {/if}>
+<td {if !empty($colspan)} colspan="{$colspan}" {else} colspan="2" {/if} {if !empty($class)} class="{$class}" {/if}>
   {assign var='hideRelativeLabel' value=$hideRelativeLabel|default:0}
   {assign var='from' value=$from|default:'_low'}
   {assign var='to' value=$to|default:'_high'}
index 6212a41bd818da312a7810db86da6f912190e3af..9134e9f761b9e5aa42121bcedfc7366113d7e450 100644 (file)
@@ -9,7 +9,7 @@
 *}
 {* Initialize jQuery validate on a form *}
 {* Extra params and functions may be added to the CRM.validate object before this template is loaded *}
-{if empty($crm_form_validate_included) and !empty($smarty.get.snippet) and $smarty.get.snippet neq 'json' and !empty($form) and !empty($form.formClass)}
+{if empty($crm_form_validate_included) and isset($smarty.get.snippet) and $smarty.get.snippet neq 'json' and !empty($form) and !empty($form.formClass)}
   {assign var=crm_form_validate_included value=1}
   {literal}
   <script type="text/javascript">
index 97ff8596d2d9f2f463a23d81fc3af3788db4e99d..eb15421b4961ba03e78bef7a3b86f0edb4233da4 100644 (file)
@@ -30,7 +30,7 @@
     <td class="crm-pledge-pledge_next_pay_date">{$row.pledge_next_pay_date|truncate:10:''|crmDate}</td>
     <td class="crm-pledge-pledge_next_pay_amount">{$row.pledge_next_pay_amount|crmMoney:$row.pledge_currency}</td>
     <td class="crm-pledge-pledge_status crm-pledge-pledge_status_{$row.pledge_status}">{$row.pledge_status}</td>
-    {if !$userChecksum}
+    {if empty($userChecksum)}
       <td>
         {if $row.pledge_contribution_page_id and ($row.pledge_status_name neq 'Completed') and ( $row.contact_id eq $loggedUserID ) }
           <a href="{crmURL p='civicrm/contribute/transact' q="reset=1&id=`$row.pledge_contribution_page_id`&pledgeId=`$row.pledge_id`"}">{ts}Make Payment{/ts}</a><br/>
index 76eaaae07ddb65ef06840053334e3ddc99c54737..76cc62b511e308d4af3fed120c9d4f00177bcbac 100644 (file)
@@ -12,7 +12,7 @@
 <div class="crm-footer" id="crm-record-log">
   <span class="col1">
     {if !empty($external_identifier)}{ts}External ID{/ts}:&nbsp;{$external_identifier}{/if}
-    {if $action NEQ 2}&nbsp; &nbsp;{ts}Contact ID{/ts}:&nbsp;{$contactId}{/if}
+    {if !isset($action) || (isset($action) && $action NEQ 2)}&nbsp; &nbsp;{ts}Contact ID{/ts}:&nbsp;{$contactId}{/if}
   </span>
   {if !empty($lastModified)}
     {ts}Last Change by{/ts}: <a href="{crmURL p='civicrm/contact/view' q="action=view&reset=1&cid=`$lastModified.id`"}">{$lastModified.name}</a> ({$lastModified.date|crmDate}) &nbsp;