Minor variable consolidation
authorEileen McNaughton <emcnaughton@wikimedia.org>
Mon, 23 Oct 2023 21:42:18 +0000 (10:42 +1300)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Mon, 23 Oct 2023 21:42:18 +0000 (10:42 +1300)
lifetime & pricelifetime both have one function - to trigger the message in the touched tpl.

If either are set then effectively both are set. This consolidates them to 1, reducing notices

CRM/Contribute/Form/Contribution/Main.php
templates/CRM/Contribute/Form/Contribution/Main.tpl

index be8cbc7bb87e6162ea1c6ca348e588b4cbdea7e0..9a94d17b895fe4b1a8d3cd832b9872ee5ba69047 100644 (file)
@@ -542,7 +542,7 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu
         }
       }
     }
-    $form->assign('ispricelifetime', $checklifetime);
+    $form->assign('hasExistingLifetimeMembership', $checklifetime);
   }
 
   /**
@@ -688,7 +688,7 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu
                 if ($membership["membership_type_id.duration_unit:name"] === 'lifetime') {
                   unset($radio[$memType['id']]);
                   unset($radioOptAttrs[$memType['id']]);
-                  $this->assign('islifetime', TRUE);
+                  $this->assign('hasExistingLifetimeMembership', TRUE);
                   continue;
                 }
                 $this->assign('renewal_mode', TRUE);
index 520c85da1d5e4e0748b1910c53971f3ee808f048..33ff5ce7f32c73ba597a6f4314eab3abce9c88f2 100644 (file)
@@ -66,7 +66,7 @@
     </div>
     {include file="CRM/common/cidzero.tpl"}
 
-    {if $isShowMembershipBlock && ($islifetime or $ispricelifetime)}
+    {if $isShowMembershipBlock && $hasExistingLifetimeMembership}
       <div class="help">{ts}You have a current Lifetime Membership which does not need to be renewed.{/ts}</div>
     {/if}