+--------------------------------------------------------------------+
| CiviCRM version 4.7 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2016 |
+ | Copyright CiviCRM LLC (c) 2004-2018 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2016
+ * @copyright CiviCRM LLC (c) 2004-2018
*/
class CRM_Report_Form_Contact_Summary extends CRM_Report_Form {
if (!empty($field['required']) ||
!empty($this->_params['fields'][$fieldName])
) {
- if ($tableName == 'civicrm_email') {
- $this->_emailField = TRUE;
- }
- elseif ($tableName == 'civicrm_phone') {
- $this->_phoneField = TRUE;
- }
- elseif ($tableName == 'civicrm_country') {
- $this->_countryField = TRUE;
- }
$alias = "{$tableName}_{$fieldName}";
$select[] = "{$field['dbAlias']} as {$alias}";
LEFT JOIN civicrm_address {$this->_aliases['civicrm_address']}
ON ({$this->_aliases['civicrm_contact']}.id = {$this->_aliases['civicrm_address']}.contact_id AND
{$this->_aliases['civicrm_address']}.is_primary = 1 ) ";
-
- if ($this->isTableSelected('civicrm_email')) {
- $this->_from .= "
- LEFT JOIN civicrm_email {$this->_aliases['civicrm_email']}
- ON ({$this->_aliases['civicrm_contact']}.id = {$this->_aliases['civicrm_email']}.contact_id AND
- {$this->_aliases['civicrm_email']}.is_primary = 1) ";
- }
-
- if ($this->_phoneField) {
- $this->_from .= "
- LEFT JOIN civicrm_phone {$this->_aliases['civicrm_phone']}
- ON {$this->_aliases['civicrm_contact']}.id = {$this->_aliases['civicrm_phone']}.contact_id AND
- {$this->_aliases['civicrm_phone']}.is_primary = 1 ";
- }
-
- if ($this->isTableSelected('civicrm_country')) {
- $this->_from .= "
- LEFT JOIN civicrm_country {$this->_aliases['civicrm_country']}
- ON {$this->_aliases['civicrm_address']}.country_id = {$this->_aliases['civicrm_country']}.id AND
- {$this->_aliases['civicrm_address']}.is_primary = 1 ";
- }
+ $this->joinPhoneFromContact();
+ $this->joinEmailFromContact();
+ $this->joinCountryFromAddress();
}
public function postProcess() {
$this->_absoluteUrl, $this->_id, $this->_drilldownReport
);
$rows[$rowNum]['civicrm_contact_sort_name_link'] = $url;
- $rows[$rowNum]['civicrm_contact_sort_name_hover'] = ts("View Constituent Detail Report for this contact.");
+ $rows[$rowNum]['civicrm_contact_sort_name_hover'] = ts('View Contact Detail Report for this contact');
$entryFound = TRUE;
}