From e93563f12c8e115c00e874944ec1b450aa7a9a21 Mon Sep 17 00:00:00 2001 From: yashodha Date: Mon, 19 Oct 2015 12:11:36 +0530 Subject: [PATCH] CRM-17414: fix comments ---------------------------------------- * CRM-17414: Add to and from dates to the Relationship Report filter https://issues.civicrm.org/jira/browse/CRM-17414 --- CRM/Report/Form/Contact/Relationship.php | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/CRM/Report/Form/Contact/Relationship.php b/CRM/Report/Form/Contact/Relationship.php index 9a7229012d..2824d1d9ab 100644 --- a/CRM/Report/Form/Contact/Relationship.php +++ b/CRM/Report/Form/Contact/Relationship.php @@ -219,10 +219,6 @@ class CRM_Report_Form_Contact_Relationship extends CRM_Report_Form { ), 'type' => CRM_Utils_Type::T_INT, ), - /* - * This is a pseudo field to allow search for relationships - * that are expired or not yet started as well. - */ 'is_valid' => array( 'title' => ts('Relationship Dates Validity'), 'operatorType' => CRM_Report_Form::OP_SELECT, @@ -442,8 +438,7 @@ class CRM_Report_Form_Contact_Relationship extends CRM_Report_Form { } } else { - if ($fieldName == "is_valid") { - //We have a pseudofilter which we shall translate + if ($fieldName == 'is_valid') { $clause = $this->buildValidityQuery(CRM_Utils_Array::value("{$fieldName}_value", $this->_params)); } else { @@ -664,11 +659,11 @@ class CRM_Report_Form_Contact_Relationship extends CRM_Report_Form { public function buildValidityQuery($valid) { $clause = NULL; if ($valid == '1') { - // We are asking that the dates are in the valid range + // relationships dates are not expired $clause = "((start_date <= CURDATE() OR start_date is null) AND (end_date >= CURDATE() OR end_date is null))"; } elseif ($valid == '0') { - // We are asking that the dates are outside the valid range. + // relationships dates are expired or has not started yet $clause = "(start_date >= CURDATE() OR end_date < CURDATE())"; } return $clause; -- 2.25.1