X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FContribute%2FForm%2FContribution%2FMain.php;h=1485677afc4bb502a141f5e658bb56c4ecf23ebb;hb=31ed28061f95c8cd6c0dd2687ad8f511ccc66847;hp=f7eb14cfec34ec2ec548b248b0089dfa5061c78a;hpb=e2741dbe32c97d6b7451190e1a9c81488e2c709d;p=civicrm-core.git diff --git a/CRM/Contribute/Form/Contribution/Main.php b/CRM/Contribute/Form/Contribution/Main.php index f7eb14cfec..1485677afc 100644 --- a/CRM/Contribute/Form/Contribution/Main.php +++ b/CRM/Contribute/Form/Contribution/Main.php @@ -508,21 +508,31 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu } 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 %1, 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 %1, 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, - array('onclick' => "showHideByValue('pcp_display_in_roll','','nameID|nickID|personalNoteID','block','radio',false); pcpAnonymous( );") - ); - $extraOption = array('onclick' => "return pcpAnonymous( );"); - $elements = array(); - $elements[] = &$this->createElement('radio', NULL, '', ts('Include my name and message'), 0, $extraOption); - $elements[] = &$this->createElement('radio', NULL, '', ts('List my contribution anonymously'), 1, $extraOption); - $this->addGroup($elements, 'pcp_is_anonymous', NULL, '   '); - $this->_defaults['pcp_is_anonymous'] = 0; - - $this->add('text', 'pcp_roll_nickname', ts('Name'), array('maxlength' => 30)); - $this->add('textarea', 'pcp_personal_note', ts('Personal Note'), array('style' => 'height: 3em; width: 40em;')); + $prms = array('id' => $this->_pcpId); + CRM_Core_DAO::commonRetrieve('CRM_PCP_DAO_PCP', $prms, $pcpInfo); + if ($pcpInfo['is_honor_roll']) { + $this->add('checkbox', 'pcp_display_in_roll', ts('Show my contribution in the public honor roll'), NULL, NULL, + array('onclick' => "showHideByValue('pcp_display_in_roll','','nameID|nickID|personalNoteID','block','radio',false); pcpAnonymous( );") + ); + $extraOption = array('onclick' => "return pcpAnonymous( );"); + $elements = array(); + $elements[] = &$this->createElement('radio', NULL, '', ts('Include my name and message'), 0, $extraOption); + $elements[] = &$this->createElement('radio', NULL, '', ts('List my contribution anonymously'), 1, $extraOption); + $this->addGroup($elements, 'pcp_is_anonymous', NULL, '   '); + $this->_defaults['pcp_is_anonymous'] = 0; + + $this->add('text', 'pcp_roll_nickname', ts('Name'), array('maxlength' => 30)); + $this->add('textarea', 'pcp_personal_note', ts('Personal Note'), array('style' => 'height: 3em; width: 40em;')); + } } //we have to load confirm contribution button in template