- $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;'));
+ }