<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.7 |
+ | CiviCRM version 5 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2017 |
+ | Copyright CiviCRM LLC (c) 2004-2018 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2017
+ * @copyright CiviCRM LLC (c) 2004-2018
*/
class CRM_Report_Form_Contact_Detail extends CRM_Report_Form {
const ROW_COUNT_LIMIT = 10;
$this->_from = "
FROM civicrm_contact {$this->_aliases['civicrm_contact']} {$this->_aclFrom}";
- if ($this->isTableSelected('civicrm_country') ||
- $this->isTableSelected('civicrm_address')
- ) {
- $this->_from .= "
- 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->isTableSelected('civicrm_phone')) {
- $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->joinAddressFromContact();
+ $this->joinCountryFromAddress();
+ $this->joinPhoneFromContact();
+ $this->joinEmailFromContact();
$this->_from .= "{$group}";