Merge pull request #5097 from PalanteJon/CRM-15917
[civicrm-core.git] / CRM / Report / Form / Extended.php
index f6f2227f54ee925e22ef618a12fe8abd3f94199c..7effc2e17249e7223c8bd61797c7a2cb160625aa 100644 (file)
@@ -23,7 +23,7 @@
  | GNU Affero General Public License or the licensing of CiviCRM,     |
  | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
  +--------------------------------------------------------------------+
-*/
+ */
 
 /**
  *
@@ -128,7 +128,13 @@ class CRM_Report_Form_Extended extends CRM_Report_Form {
   }
 
   /**
+   * Alter display of rows.
+   *
+   * Iterate through the rows retrieved via SQL and make changes for display purposes,
+   * such as rendering contacts as links.
+   *
    * @param array $rows
+   *   Rows generated by SQL, with an array for each row.
    */
   public function alterDisplay(&$rows) {
     parent::alterDisplay($rows);
@@ -250,12 +256,12 @@ class CRM_Report_Form_Extended extends CRM_Report_Form {
         // are grouped together across price sets but there may be a separate need to group
         // by id so that entries in one price set are distinct from others. Not quite sure what
         // to call the distinction for end users benefit
-          array(
-            'price_field_value_label' => array(
-              'title' => ts('Price Field Value Label'),
-              'name' => 'label',
-            ),
+        array(
+          'price_field_value_label' => array(
+            'title' => ts('Price Field Value Label'),
+            'name' => 'label',
           ),
+        ),
       ),
     );
   }
@@ -596,8 +602,7 @@ class CRM_Report_Form_Extended extends CRM_Report_Form {
         'filters' => array(
           'id' => array(
             'title' => ts('Contact ID'),
-          )
-        ,
+          ),
           'sort_name' => array(
             'title' => ts('Contact Name'),
           ),
@@ -699,7 +704,7 @@ class CRM_Report_Form_Extended extends CRM_Report_Form {
   }
 
   /**
-   * Get address columns to add to array
+   * Get address columns to add to array.
    *
    * @param array $options
    *   Options for the report.
@@ -910,7 +915,7 @@ class CRM_Report_Form_Extended extends CRM_Report_Form {
   }
 
   /**
-   * Get Information about advertised Joins
+   * Get Information about advertised Joins.
    *
    * @return array
    */
@@ -1026,7 +1031,7 @@ class CRM_Report_Form_Extended extends CRM_Report_Form {
   }
 
   /**
-   * Define join from line item table to participant table
+   * Define join from line item table to participant table.
    */
   public function joinParticipantFromLineItem() {
     $this->_from .= " LEFT JOIN civicrm_participant {$this->_aliases['civicrm_participant']}
@@ -1051,7 +1056,7 @@ class CRM_Report_Form_Extended extends CRM_Report_Form {
   }
 
   /**
-   * Define join from Participant to Contribution table
+   * Define join from Participant to Contribution table.
    */
   public function joinContributionFromParticipant() {
     $this->_from .= " LEFT JOIN civicrm_participant_payment pp
@@ -1062,7 +1067,7 @@ class CRM_Report_Form_Extended extends CRM_Report_Form {
   }
 
   /**
-   * Define join from Membership to Contribution table
+   * Define join from Membership to Contribution table.
    */
   public function joinContributionFromMembership() {
     $this->_from .= " LEFT JOIN civicrm_membership_payment pp
@@ -1213,7 +1218,7 @@ WHERE   line_item_civireport.id IS NOT NULL
   }
 
   /**
-   * Retrieve text for financial type from pseudoconstant
+   * Retrieve text for financial type from pseudoconstant.
    *
    * @param $value
    * @param array $row
@@ -1222,7 +1227,7 @@ WHERE   line_item_civireport.id IS NOT NULL
    */
   public function alterNickName($value, &$row) {
     if (empty($row['civicrm_contact_id'])) {
-      return;
+      return NULL;
     }
     $contactID = $row['civicrm_contact_id'];
     return "<div id=contact-{$contactID} class='crm-entity'>
@@ -1231,7 +1236,7 @@ WHERE   line_item_civireport.id IS NOT NULL
   }
 
   /**
-   * Retrieve text for contribution type from pseudoconstant
+   * Retrieve text for contribution type from pseudoconstant.
    *
    * @param $value
    * @param array $row
@@ -1243,7 +1248,7 @@ WHERE   line_item_civireport.id IS NOT NULL
   }
 
   /**
-   * Retrieve text for contribution status from pseudoconstant
+   * Retrieve text for contribution status from pseudoconstant.
    *
    * @param $value
    * @param array $row
@@ -1255,7 +1260,7 @@ WHERE   line_item_civireport.id IS NOT NULL
   }
 
   /**
-   * Retrieve text for payment instrument from pseudoconstant
+   * Retrieve text for payment instrument from pseudoconstant.
    *
    * @param $value
    * @param array $row
@@ -1374,7 +1379,7 @@ WHERE   line_item_civireport.id IS NOT NULL
    */
   public function alterParticipantStatus($value) {
     if (empty($value)) {
-      return;
+      return NULL;
     }
     return CRM_Event_PseudoConstant::participantStatus($value, FALSE, 'label');
   }
@@ -1386,7 +1391,7 @@ WHERE   line_item_civireport.id IS NOT NULL
    */
   public function alterParticipantRole($value) {
     if (empty($value)) {
-      return;
+      return NULL;
     }
     $roles = explode(CRM_Core_DAO::VALUE_SEPARATOR, $value);
     $value = array();
@@ -1405,4 +1410,5 @@ WHERE   line_item_civireport.id IS NOT NULL
     $paymentInstruments = CRM_Contribute_PseudoConstant::paymentInstrument();
     return $paymentInstruments[$value];
   }
+
 }