$this->add('text', 'premiums_nothankyou_label', ts('No Thank-you Label'), $attributes['premiums_nothankyou_label']);
$positions = [1 => ts('Before Premiums'), 2 => ts('After Premiums')];
$this->add('select', 'premiums_nothankyou_position', ts('No Thank-you Option'), $positions);
- $showForm = TRUE;
-
- if ($this->_single) {
- if ($this->_id) {
- $daoPremium = new CRM_Contribute_DAO_Premium();
- $daoPremium->entity_id = $this->_id;
- $daoPremium->entity_table = 'civicrm_contribution_page';
- $daoPremium->premiums_active = 1;
- if ($daoPremium->find(TRUE)) {
- $showForm = FALSE;
- }
- }
- }
- $this->assign('showForm', $showForm);
parent::buildQuickForm();
$this->addFormRule(['CRM_Contribute_Form_ContributionPage_Premium', 'formRule'], $this);
{/if}
</div>
{else}
- {if $showForm eq false}
- <div class="messages status no-popup">
- {if $products ne null}
- {icon icon="fa-info-circle"}{/icon}
- {capture assign=crmURL}{crmURL p='civicrm/admin/contribute/addProductToPage' q="reset=1&action=update&id=$id"}{/capture}
- {ts 1=$crmURL}There are no premiums offered on this contribution page yet. You can <a href='%1'>add one</a>.{/ts}
- {else}
- {icon icon="fa-info-circle"}{/icon}
- {ts 1=$managePremiumsURL}There are no active premiums for your site. You can <a href='%1'>create and/or enable premiums here</a>.{/ts}
- {/if}
- </div>
- {/if}
+ <div class="messages status no-popup">
+ {if $products ne null}
+ {icon icon="fa-info-circle"}{/icon}
+ {capture assign=crmURL}{crmURL p='civicrm/admin/contribute/addProductToPage' q="reset=1&action=update&id=$id"}{/capture}
+ {ts 1=$crmURL}There are no premiums offered on this contribution page yet. You can <a href='%1'>add one</a>.{/ts}
+ {else}
+ {icon icon="fa-info-circle"}{/icon}
+ {ts 1=$managePremiumsURL}There are no active premiums for your site. You can <a href='%1'>create and/or enable premiums here</a>.{/ts}
+ {/if}
+ </div>
{/if}