}
elseif ($fieldName != 'id') {
if ($fieldName == 'prefix_id') {
- $this->_pseudoConstantsSelect['individual_prefix'] = array('pseudoField' => 'prefix_id', 'idCol' => "prefix_id", 'bao' => 'CRM_Contact_BAO_Contact');
+ // Hack - profile views use different field name than normal views!
+ $this->_pseudoConstantsSelect['prefix_id'] =
+ $this->_pseudoConstantsSelect['individual_prefix'] = array(
+ 'pseudoField' => 'prefix_id',
+ 'idCol' => "prefix_id",
+ 'bao' => 'CRM_Contact_BAO_Contact'
+ );
}
if ($fieldName == 'suffix_id') {
- $this->_pseudoConstantsSelect['individual_suffix'] = array('pseudoField' => 'suffix_id', 'idCol' => "suffix_id", 'bao' => 'CRM_Contact_BAO_Contact');
+ // Hack - profile views use different field name than normal views!
+ $this->_pseudoConstantsSelect['suffix_id'] =
+ $this->_pseudoConstantsSelect['individual_suffix'] = array(
+ 'pseudoField' => 'suffix_id',
+ 'idCol' => "suffix_id",
+ 'bao' => 'CRM_Contact_BAO_Contact'
+ );
}
if ($fieldName == 'gender_id') {
- $this->_pseudoConstantsSelect['gender'] = array('pseudoField' => 'gender_id', 'idCol' => "gender_id", 'bao' => 'CRM_Contact_BAO_Contact');
+ // Hack - profile views use different field name than normal views!
+ $this->_pseudoConstantsSelect['gender_id'] =
+ $this->_pseudoConstantsSelect['gender'] = array(
+ 'pseudoField' => 'gender_id',
+ 'idCol' => "gender_id",
+ 'bao' => 'CRM_Contact_BAO_Contact'
+ );
}
+ if ($name == 'communication_style_id') {
+ $this->_pseudoConstantsSelect['communication_style'] = array('pseudoField' => 'communication_style_id', 'idCol' => "communication_style_id", 'bao' => 'CRM_Contact_BAO_Contact');
+ }
$this->_select[$name] = "contact_a.{$fieldName} as `$name`";
}
}
}
$this->assign('onBehalfRequired', $this->_onBehalfRequired);
- CRM_Contact_Form_ProfileContact::preprocess($this);
- }
+ if (CRM_Utils_Array::value('honor_block_is_active', $this->_values)) {
++ CRM_Contact_Form_ProfileContact::preprocess($this);
++ }
++
+ if ($this->_snippet) {
+ $this->assign('isOnBehalfCallback', CRM_Utils_Array::value('onbehalf', $_GET, FALSE));
+ return;
+ }
if (!empty($this->_pcpInfo['id']) && !empty($this->_pcpInfo['intro_text'])) {
$this->assign('intro_text', $this->_pcpInfo['intro_text']);
}
$def = $fields[$field];
- if (array_key_exists('required', $def) && CRM_Utils_System::isNull($value)) {
+ // Disallow empty values except for the number zero.
+ // TODO: create a utility for this since it's needed in many places
++ // if (array_key_exists('required', $def) && CRM_Utils_System::isNull($value)) {
+ if (array_key_exists('required', $def) && empty($value) && $value !== '0' && $value !== 0) {
return civicrm_api3_create_error(ts("This can't be empty, please provide a value"), array("error_code" => "required", "field" => $field));
}
}
function showOnBehalf(onBehalfRequired) {
- if ( cj( "#is_for_organization" ).prop('checked' ) || onBehalfRequired ) {
- var urlPath = {/literal}"{crmURL p=$urlPath h=0 q='snippet=4&onbehalf=1'}";
- urlPath += "{$urlParams}";
- if ( cj( "#is_for_organization" ).attr( 'checked' ) || onBehalfRequired ) {
++ if ( cj( "#is_for_organization" ).prop( 'checked' ) || onBehalfRequired ) {
+ var urlPath = {/literal}"{crmURL p=$urlPath h=0 q="snippet=4&onbehalf=1&id=$contributionPageID&qfKey=$qfKey"}";
{if $mode eq 'test'}
urlPath += '&action=preview';
{/if}