- $this->add('textarea', 'honor_block_text', ts('Honoree Introductory Message'), $attributes['honor_block_text']);
+ $entities = array(
+ array('entity_name' => 'contact_1',
+ 'entity_type' => 'IndividualModel'
+ ),
+ array('entity_name' => 'organization_1',
+ 'entity_type' => 'OrganizationModel'
+ ),
+ array('entity_name' => 'household_1',
+ 'entity_type' => 'HouseholdModel'
+ ),
+ );
+ $allowCoreTypes = array_merge(array('Contact', 'Individual', 'Organization', 'Household'), CRM_Contact_BAO_ContactType::subTypes('Individual'));
+ $allowSubTypes = array();
+
+ $this->addProfileSelector('honoree_profile', ts('Honoree Profile'), $allowCoreTypes, $allowSubTypes, $entities);
+
+ if (!empty($this->_submitValues['honor_block_is_active'])) {
+ $this->addRule('soft_credit_types', ts('At least one value must be selected if Honor Section is active'), 'required');
+ $this->addRule('honoree_profile', ts('Please select a profile used for honoree'), 'required');
+ }