Skip to content

Commit

Permalink
CRM-21677 - keep the naming consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
yashodha committed Feb 20, 2018
1 parent ec4ca21 commit 8514a55
Show file tree
Hide file tree
Showing 28 changed files with 73 additions and 80 deletions.
8 changes: 4 additions & 4 deletions CRM/Report/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -4312,7 +4312,7 @@ public function fiscalYearOffset($fieldName) {
* @param array $extra Additional options.
* Not currently used in core but may be used in override extensions.
*/
public function addAddressFromClause($prefix = '', $extra = array()) {
public function joinAddressFromContact($prefix = '', $extra = array()) {
// include address field if address column is to be included
if ((isset($this->_addressField) && $this->_addressField) || $this->isTableSelected($prefix . 'civicrm_address')) {
$this->_from .= "
Expand All @@ -4333,7 +4333,7 @@ public function addAddressFromClause($prefix = '', $extra = array()) {
* @param array $extra Additional options.
* Not currently used in core but may be used in override extensions.
*/
public function addCountryFromClause($prefix = '', $extra = array()) {
public function joinCountryFromClause($prefix = '', $extra = array()) {
// include country field if country column is to be included
if ($this->isTableSelected($prefix . 'civicrm_country')) {
$this->_from .= "
Expand All @@ -4353,7 +4353,7 @@ public function addCountryFromClause($prefix = '', $extra = array()) {
* @param array $extra Additional options.
* Not currently used in core but may be used in override extensions.
*/
public function addPhoneFromClause($prefix = '', $extra = array()) {
public function joinPhoneFromClause($prefix = '', $extra = array()) {
// include phone field if phone column is to be included
if ($this->isTableSelected($prefix . 'civicrm_phone')) {
$this->_from .= "
Expand All @@ -4373,7 +4373,7 @@ public function addPhoneFromClause($prefix = '', $extra = array()) {
* @param array $extra Additional options.
* Not currently used in core but may be used in override extensions.
*/
public function addEmailFromClause($prefix = '', $extra = array()) {
public function joinEmailFromClause($prefix = '', $extra = array()) {
// include email field if email column is to be included
if ($this->isTableSelected($prefix . 'civicrm_email')) {
$this->_from .= "
Expand Down
2 changes: 1 addition & 1 deletion CRM/Report/Form/Activity.php
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ public function from($recordType) {
$this->_aliases['civicrm_contact'] = 'civicrm_contact_source';
}

$this->addAddressFromClause();
$this->joinAddressFromClause();
}

/**
Expand Down
4 changes: 2 additions & 2 deletions CRM/Report/Form/ActivitySummary.php
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ public function from($durationMode = FALSE) {
LEFT JOIN civicrm_case_contact
ON civicrm_case_contact.case_id = civicrm_case.id ";

$this->addPhoneFromClause();
$this->joinPhoneFromClause();
}
else {
$this->_from = "
Expand All @@ -350,7 +350,7 @@ public function from($durationMode = FALSE) {
{$this->_aclFrom}";
}

$this->addEmailFromClause();
$this->joinEmailFromClause();
}

/**
Expand Down
6 changes: 3 additions & 3 deletions CRM/Report/Form/Campaign/SurveyDetails.php
Original file line number Diff line number Diff line change
Expand Up @@ -291,9 +291,9 @@ public function from() {
$this->_from .= " INNER JOIN civicrm_activity_contact activity_contact_civireport ON
( {$this->_aliases['civicrm_activity']}.id = activity_contact_civireport.activity_id AND activity_contact_civireport.record_type_id = {$assigneeID} )\n";

$this->addAddressFromClause();
$this->addPhoneFromClause();
$this->addEmailFromClause();
$this->joinAddressFromClause();
$this->joinPhoneFromClause();
$this->joinEmailFromClause();

if ($this->_locationBasedPhoneField) {
foreach ($this->_surveyResponseFields as $key => $value) {
Expand Down
4 changes: 2 additions & 2 deletions CRM/Report/Form/Case/Demographics.php
Original file line number Diff line number Diff line change
Expand Up @@ -313,8 +313,8 @@ public function from() {
}
}

$this->addPhoneFromClause();
$this->addEmailFromClause();
$this->joinPhoneFromClause();
$this->joinEmailFromClause();

}

Expand Down
6 changes: 3 additions & 3 deletions CRM/Report/Form/Case/Detail.php
Original file line number Diff line number Diff line change
Expand Up @@ -414,9 +414,9 @@ public function from() {
";
}

$this->addAddressFromClause();
$this->addPhoneFromClause();
$this->addEmailFromClause();
$this->joinAddressFromClause();
$this->joinPhoneFromClause();
$this->joinEmailFromClause();

if ($this->_worldRegionField) {
$this->_from .= "
Expand Down
6 changes: 3 additions & 3 deletions CRM/Report/Form/Contact/CurrentEmployer.php
Original file line number Diff line number Diff line change
Expand Up @@ -254,9 +254,9 @@ public function from() {
AND {$this->_aliases['civicrm_relationship']}.contact_id_b={$this->_aliases['civicrm_contact']}.employer_id
AND {$this->_aliases['civicrm_relationship']}.relationship_type_id={$relType}) ";

$this->addAddressFromClause();
$this->addPhoneFromClause();
$this->addEmailFromClause();
$this->joinAddressFromClause();
$this->joinPhoneFromClause();
$this->joinEmailFromClause();
}

public function where() {
Expand Down
8 changes: 4 additions & 4 deletions CRM/Report/Form/Contact/Detail.php
Original file line number Diff line number Diff line change
Expand Up @@ -463,10 +463,10 @@ public function from() {
$this->_from = "
FROM civicrm_contact {$this->_aliases['civicrm_contact']} {$this->_aclFrom}";

$this->addAddressFromClause();
$this->addCountryFromClause();
$this->addPhoneFromClause();
$this->addEmailFromClause();
$this->joinAddressFromClause();
$this->joinCountryFromClause();
$this->joinPhoneFromClause();
$this->joinEmailFromClause();

$this->_from .= "{$group}";

Expand Down
8 changes: 4 additions & 4 deletions CRM/Report/Form/Contact/Summary.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,10 @@ public function 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 ) ";

$this->addPhoneFromClause();
$this->addEmailFromClause();
$this->addCountryFromClause();
$this->joinPhoneFromClause();
$this->joinEmailFromClause();
$this->joinCountryFromClause();
}

public function postProcess() {
Expand Down
12 changes: 3 additions & 9 deletions CRM/Report/Form/Contribute/Detail.php
Original file line number Diff line number Diff line change
Expand Up @@ -941,16 +941,10 @@ public function appendAdditionalFromJoins() {
INNER JOIN (SELECT c.id, IF(COUNT(oc.id) = 0, 0, 1) AS ordinality FROM civicrm_contribution c LEFT JOIN civicrm_contribution oc ON c.contact_id = oc.contact_id AND oc.receive_date < c.receive_date GROUP BY c.id) {$this->_aliases['civicrm_contribution_ordinality']}
ON {$this->_aliases['civicrm_contribution_ordinality']}.id = {$this->_aliases['civicrm_contribution']}.id";
}
$this->addPhoneFromClause();
$this->joinPhoneFromClause();
$this->joinAddressFromClause();
$this->joinEmailFromClause();

$this->addAddressFromClause();

if ($this->_emailField) {
$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\n";
}
// include contribution note
if (!empty($this->_params['fields']['contribution_note']) ||
!empty($this->_params['note_value'])
Expand Down
6 changes: 3 additions & 3 deletions CRM/Report/Form/Contribute/History.php
Original file line number Diff line number Diff line change
Expand Up @@ -402,9 +402,9 @@ public function from() {
$this->_relationshipFrom = " INNER JOIN civicrm_relationship {$this->_aliases['civicrm_relationship']}
ON (({$this->_aliases['civicrm_relationship']}.contact_id_a = {$relContacAlias}.id OR {$this->_aliases['civicrm_relationship']}.contact_id_b = {$relContacAlias}.id ) AND {$this->_aliases['civicrm_relationship']}.is_active = 1) ";

$this->addAddressFromClause();
$this->addPhoneFromClause();
$this->addEmailFromClause();
$this->joinAddressFromClause();
$this->joinPhoneFromClause();
$this->joinEmailFromClause();

// for credit card type
$this->addFinancialTrxnFromClause();
Expand Down
6 changes: 3 additions & 3 deletions CRM/Report/Form/Contribute/Lybunt.php
Original file line number Diff line number Diff line change
Expand Up @@ -346,9 +346,9 @@ public function from() {
INNER JOIN civicrm_contact {$this->_aliases['civicrm_contact']}
ON restricted_contacts.cid = {$this->_aliases['civicrm_contact']}.id";

$this->addAddressFromClause();
$this->addPhoneFromClause();
$this->addEmailFromClause();
$this->joinAddressFromClause();
$this->joinPhoneFromClause();
$this->joinEmailFromClause();
}
else {
$this->setFromBase('civicrm_contact');
Expand Down
4 changes: 2 additions & 2 deletions CRM/Report/Form/Contribute/Recur.php
Original file line number Diff line number Diff line change
Expand Up @@ -274,8 +274,8 @@ public function from() {
LEFT JOIN civicrm_contribution {$this->_aliases['civicrm_contribution']}
ON {$this->_aliases['civicrm_contribution_recur']}.id = {$this->_aliases['civicrm_contribution']}.contribution_recur_id";

$this->addPhoneFromClause();
$this->addEmailFromClause();
$this->joinPhoneFromClause();
$this->joinEmailFromClause();

// for credit card type
$this->addFinancialTrxnFromClause();
Expand Down
6 changes: 3 additions & 3 deletions CRM/Report/Form/Contribute/Summary.php
Original file line number Diff line number Diff line change
Expand Up @@ -517,9 +517,9 @@ public function from($entity = NULL) {
ON {$this->_aliases['civicrm_contribution']}.financial_type_id ={$this->_aliases['civicrm_financial_type']}.id
";

$this->addAddressFromClause();
$this->addPhoneFromClause();
$this->addEmailFromClause();
$this->joinAddressFromClause();
$this->joinPhoneFromClause();
$this->joinEmailFromClause();

//for contribution batches
if ($this->isTableSelected('civicrm_batch')) {
Expand Down
6 changes: 3 additions & 3 deletions CRM/Report/Form/Contribute/Sybunt.php
Original file line number Diff line number Diff line change
Expand Up @@ -352,13 +352,13 @@ public function from() {
ON {$this->_aliases['civicrm_contact']}.id = {$this->_aliases['civicrm_contribution']}.contact_id
{$this->_aclFrom}";

$this->addPhoneFromClause();
$this->addEmailFromClause();
$this->joinPhoneFromClause();
$this->joinEmailFromClause();

// for credit card type
$this->addFinancialTrxnFromClause();

$this->addAddressFromClause();
$this->joinAddressFromClause();
}

public function where() {
Expand Down
6 changes: 3 additions & 3 deletions CRM/Report/Form/Contribute/TopDonor.php
Original file line number Diff line number Diff line change
Expand Up @@ -258,9 +258,9 @@ public function from() {
// for credit card type
$this->addFinancialTrxnFromClause();

$this->addAddressFromClause();
$this->addPhoneFromClause();
$this->addEmailFromClause();
$this->joinAddressFromClause();
$this->joinPhoneFromClause();
$this->joinEmailFromClause();
}

public function where() {
Expand Down
6 changes: 3 additions & 3 deletions CRM/Report/Form/Event/ParticipantListCount.php
Original file line number Diff line number Diff line change
Expand Up @@ -465,9 +465,9 @@ public function from() {
LEFT JOIN civicrm_line_item {$this->_aliases['civicrm_line_item']}
ON {$this->_aliases['civicrm_line_item']}.entity_table = 'civicrm_participant' AND {$this->_aliases['civicrm_participant']}.id ={$this->_aliases['civicrm_line_item']}.entity_id";

$this->addAddressFromClause();
$this->addPhoneFromClause();
$this->addEmailFromClause();
$this->joinAddressFromClause();
$this->joinPhoneFromClause();
$this->joinEmailFromClause();
}

public function storeWhereHavingClauseArray() {
Expand Down
6 changes: 3 additions & 3 deletions CRM/Report/Form/Event/ParticipantListing.php
Original file line number Diff line number Diff line change
Expand Up @@ -515,9 +515,9 @@ public function from() {
{$this->_aclFrom}
";

$this->addAddressFromClause();
$this->addPhoneFromClause();
$this->addEmailFromClause();
$this->joinAddressFromClause();
$this->joinPhoneFromClause();
$this->joinEmailFromClause();

if ($this->_contribField) {
$this->_from .= "
Expand Down
4 changes: 2 additions & 2 deletions CRM/Report/Form/Grant/Statistics.php
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,8 @@ public function from() {
LEFT JOIN civicrm_contact {$this->_aliases['civicrm_contact']}
ON ({$this->_aliases['civicrm_grant']}.contact_id = {$this->_aliases['civicrm_contact']}.id ) ";

$this->addAddressFromClause();
$this->addCountryFromClause();
$this->joinAddressFromClause();
$this->joinCountryFromClause();
if ($this->_addressField) {
$this->_from .= "
LEFT JOIN civicrm_worldregion {$this->_aliases['civicrm_world_region']}
Expand Down
3 changes: 1 addition & 2 deletions CRM/Report/Form/Mailing/Bounce.php
Original file line number Diff line number Diff line change
Expand Up @@ -337,8 +337,7 @@ public function from() {
INNER JOIN civicrm_mailing {$this->_aliases['civicrm_mailing']}
ON civicrm_mailing_job.mailing_id = {$this->_aliases['civicrm_mailing']}.id
";

$this->addPhoneFromClause();
$this->joinPhoneFromClause();
}

public function where() {
Expand Down
2 changes: 1 addition & 1 deletion CRM/Report/Form/Mailing/Clicks.php
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ public function from() {
ON civicrm_mailing_job.mailing_id = {$this->_aliases['civicrm_mailing']}.id
AND civicrm_mailing_job.is_test = 0
";
$this->addPhoneFromClause();
$this->joinPhoneFromClause();
}

public function where() {
Expand Down
2 changes: 1 addition & 1 deletion CRM/Report/Form/Mailing/Detail.php
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ public function from() {
ON civicrm_mailing_job.mailing_id = {$this->_aliases['civicrm_mailing']}.id
AND civicrm_mailing_job.is_test = 0";

$this->addPhoneFromClause();
$this->joinPhoneFromClause();
}

public function where() {
Expand Down
2 changes: 1 addition & 1 deletion CRM/Report/Form/Mailing/Opened.php
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ public function from() {
ON civicrm_mailing_job.mailing_id = {$this->_aliases['civicrm_mailing']}.id
AND civicrm_mailing_job.is_test = 0
";
$this->addPhoneFromClause();
$this->joinPhoneFromClause();
}

public function where() {
Expand Down
6 changes: 3 additions & 3 deletions CRM/Report/Form/Member/ContributionDetail.php
Original file line number Diff line number Diff line change
Expand Up @@ -522,9 +522,9 @@ public function from() {
AND {$this->_aliases['civicrm_batch']}.entity_table = 'civicrm_financial_trxn')";
}

$this->addAddressFromClause();
$this->addPhoneFromClause();
$this->addEmailFromClause();
$this->joinAddressFromClause();
$this->joinPhoneFromClause();
$this->joinEmailFromClause();
}

/**
Expand Down
6 changes: 3 additions & 3 deletions CRM/Report/Form/Member/Detail.php
Original file line number Diff line number Diff line change
Expand Up @@ -284,9 +284,9 @@ public function from() {
ON {$this->_aliases['civicrm_membership_status']}.id =
{$this->_aliases['civicrm_membership']}.status_id ";

$this->addAddressFromClause();
$this->addPhoneFromClause();
$this->addEmailFromClause();
$this->joinAddressFromClause();
$this->joinPhoneFromClause();
$this->joinEmailFromClause();

//used when contribution field is selected.
if ($this->isTableSelected('civicrm_contribution')) {
Expand Down
6 changes: 3 additions & 3 deletions CRM/Report/Form/Member/Lapse.php
Original file line number Diff line number Diff line change
Expand Up @@ -260,9 +260,9 @@ public function from() {
ON {$this->_aliases['civicrm_membership']}.membership_type_id =
{$this->_aliases['civicrm_membership_type']}.id";

$this->addAddressFromClause();
$this->addPhoneFromClause();
$this->addEmailFromClause();
$this->joinAddressFromClause();
$this->joinPhoneFromClause();
$this->joinEmailFromClause();
}

public function where() {
Expand Down
6 changes: 3 additions & 3 deletions CRM/Report/Form/Pledge/Detail.php
Original file line number Diff line number Diff line change
Expand Up @@ -286,9 +286,9 @@ public function from() {
";
}

$this->addPhoneFromClause();
$this->addAddressFromClause();
$this->addEmailFromClause();
$this->joinPhoneFromClause();
$this->joinAddressFromClause();
$this->joinEmailFromClause();
}

/**
Expand Down
6 changes: 3 additions & 3 deletions CRM/Report/Form/Walklist/Walklist.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,9 @@ public function from() {
FROM civicrm_contact {$this->_aliases['civicrm_contact']} {$this->_aclFrom}
";

$this->addAddressFromClause();
$this->addPhoneFromClause();
$this->addEmailFromClause();
$this->joinAddressFromClause();
$this->joinPhoneFromClause();
$this->joinEmailFromClause();
}

public function where() {
Expand Down

0 comments on commit 8514a55

Please sign in to comment.