diff --git a/ftoverride.php b/ftoverride.php index 6f3e127..09fbf38 100644 --- a/ftoverride.php +++ b/ftoverride.php @@ -197,6 +197,14 @@ function ftoverride_civicrm_entityTypes(&$entityTypes) { */ function ftoverride_civicrm_buildForm($formName, &$form) { if ('CRM_Contribute_Form_ContributionPage_Settings' == $formName) { + $showElement = TRUE; + if ($form->getVar('_id')) { + $snippet = CRM_Utils_Array::value('snippet', $_GET); + if (empty($snippet)) { + $showElement = FALSE; + } + } + $form->assign('showElement', $showElement); $financialTypes = []; CRM_Financial_BAO_FinancialType::getAvailableFinancialTypes($financialTypes, $form->getVar('_action')); $form->add( @@ -266,7 +274,7 @@ function ftoverride_civicrm_buildForm($formName, &$form) { function ftoverride_civicrm_pre($op, $objectName, $id, &$params) { if (in_array($op, ['create', 'edit']) && $objectName == 'ContributionPage' - && !empty($params['designation']) + && isset($params['designation']) ) { if ($id) { $params['id'] = $id; diff --git a/templates/CRM/Contribute/Form/ContributionMain/common.tpl b/templates/CRM/Contribute/Form/ContributionMain/common.tpl index b0bb9ab..ca064c8 100644 --- a/templates/CRM/Contribute/Form/ContributionMain/common.tpl +++ b/templates/CRM/Contribute/Form/ContributionMain/common.tpl @@ -6,7 +6,7 @@ {literal} {/literal} diff --git a/templates/CRM/Contribute/Form/ContributionPage/common.tpl b/templates/CRM/Contribute/Form/ContributionPage/common.tpl index 2c446ad..23df5d1 100644 --- a/templates/CRM/Contribute/Form/ContributionPage/common.tpl +++ b/templates/CRM/Contribute/Form/ContributionPage/common.tpl @@ -1,3 +1,4 @@ +{if $showElement} @@ -11,3 +12,4 @@ }); {/literal} +{/if}
{$form.designation.label}