}
if ($this->_pcpId) {
if ($pcpSupporter = CRM_PCP_BAO_PCP::displayName($this->_pcpId)) {
- $this->assign('pcpSupporterText', ts('This contribution is being made thanks to effort of <strong>%1</strong>, who supports our campaign. You can support it as well - once you complete the donation, you will be able to create your own Personal Campaign Page!', array(1 => $pcpSupporter)));
+ $pcp_supporter_text = ts('This contribution is being made thanks to effort of <strong>%1</strong>, who supports our campaign. ', array(1 => $pcpSupporter));
+ // Only tell people that can also create a PCP if the contribution page has a non-empty value in the "Create Personal Campaign Page link" field.
+ $text = CRM_PCP_BAO_PCP::getPcpBlockStatus($this->_id, 'contribute');
+ if(!empty($text)) {
+ $pcp_supporter_text .= "You can support it as well - once you complete the donation, you will be able to create your own Personal Campaign Page!";
+ }
+ $this->assign('pcpSupporterText', $pcp_supporter_text);
}
$this->assign('pcp', TRUE);
$this->add('checkbox', 'pcp_display_in_roll', ts('Show my contribution in the public honor roll'), NULL, NULL,
$this->assign('bltID', $this->_bltID);
$isShowLocation = CRM_Utils_Array::value('is_show_location', $this->_values['event']);
$this->assign('isShowLocation', $isShowLocation);
- if ($pcpId && $pcpSupporter = CRM_PCP_BAO_PCP::displayName($pcpId)) {
- $this->assign('pcpSupporterText', ts('This event registration is being made thanks to effort of <strong>%1</strong>, who supports our campaign. You can support it as well - once you complete the registration, you will be able to create your own Personal Campaign Page!', array(1 => $pcpSupporter)));
- }
//CRM-6907
$config->defaultCurrency = CRM_Utils_Array::value('currency', $this->_values['event'],
$config->defaultCurrency
$prms = array('id' => $pcpId);
CRM_Core_DAO::commonRetrieve('CRM_PCP_DAO_PCP', $prms, $pcpInfo);
-
if ($pcpSupporter = CRM_PCP_BAO_PCP::displayName($pcpId)) {
if ($pcpInfo['page_type'] == 'event') {
- $page->assign('pcpSupporterText', ts('This event registration is being made thanks to effort of <strong>%1</strong>, who supports our campaign. You can support it as well - once you complete the registration, you will be able to create your own Personal Campaign Page!', array(1 => $pcpSupporter)));
+ $pcp_supporter_text = ts('This event registration is being made thanks to effort of <strong>%1</strong>, who supports our campaign. ', array(1 => $pcpSupporter));
+ $text = CRM_PCP_BAO_PCP::getPcpBlockStatus($pcpInfo['page_id'], 'event');
+ if(!empty($text)) {
+ $pcp_supporter_text .= "You can support it as well - once you complete the registration, you will be able to create your own Personal Campaign Page!";
+ }
}
else {
- $page->assign('pcpSupporterText', ts('This contribution is being made thanks to effort of <strong>%1</strong>, who supports our campaign. You can support it as well - once you complete the donation, you will be able to create your own Personal Campaign Page!', array(1 => $pcpSupporter)));
+ $pcp_supporter_text = ts('This contribution is being made thanks to effort of <strong>%1</strong>, who supports our campaign. ', array(1 => $pcpSupporter));
+ $text = CRM_PCP_BAO_PCP::getPcpBlockStatus($pcpInfo['page_id'], 'contribute');
+ if(!empty($text)) {
+ $pcp_supporter_text .= "You can support it as well - once you complete the donation, you will be able to create your own Personal Campaign Page!";
+ }
}
+
+ $page->assign('pcpSupporterText', $pcp_supporter_text);
}
$page->assign('pcp', TRUE);
static function getPcpBlockStatus($pageId, $component) {
$query = "
SELECT pb.link_text as linkText
- FROM civicrm_contribution_page cp
- LEFT JOIN civicrm_pcp_block pb ON ( cp.id = pb.entity_id AND pb.entity_table = %2 )
- WHERE pb.is_active = 1 AND cp.id = %1";
+ FROM civicrm_pcp_block pb
+ WHERE pb.is_active = 1 AND
+ pb.entity_id = %1 AND
+ pb.entity_table = %2";
$entity_table = self::getPcpEntityTable($component);
{ts}Personal Contribution Link{/ts}
{/htxt}
{htxt id="id-link_text"}
-{ts}Text for the link inviting constituents to create a Personal Contribution Page. This link will appear on the Contribution Thank-you page as well as on each Personal Campaign Page.{/ts}
+{ts}Text for the link inviting constituents to create a Personal Contribution Page. This link will appear on the Contribution Thank-you page as well as on each Personal Campaign Page. Leave blank if you do not want constituents to be prompted to create their own Personal Campaign Pages.{/ts}
{/htxt}
{ts}Personal Contribution Link{/ts}
{/htxt}
{htxt id="id-link_text"}
-{ts}Text for the link inviting constituents to create a Personal Contribution Page. This link will appear on the Contribution Thank-you page as well as on each Personal Campaign Page.{/ts}
+{ts}Text for the link inviting constituents to create a Personal Contribution Page. This link will appear on the Contribution Thank-you page as well as on each Personal Campaign Page. Leave blank if you do not want constituents to be prompted to create their own Personal Campaign Pages.{/ts}
{/htxt}
{ts}Link Text{/ts}
{/htxt}
{htxt id="id-link_text"}
-{ts}Text for the link inviting constituents to create a Personal Campaign Page. This link will appear on the Event registration Thank-you page as well as on each Personal Campaign Page.{/ts}
+{ts}Text for the link inviting constituents to create a Personal Campaign Page. This link will appear on the Event registration Thank-you page as well as on each Personal Campaign Page. Leave blank if you do not want constituents to be prompted to create their own Personal Campaign Pages.{/ts}
{/htxt}
{htxt id="id-target_entity_type-title"}