Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-9501

Add booking report that displays all price set data PLUS add functions to Report/Form/php to make it more 'modular'



      I have started on a report to expose better contribution data regarding price sets. I'm posting code in it's current state as a patch so I can share / discuss but is still under review.

      As part of this I would like to look at moving the approach I have been using to customise reports into Form.php. I have been creating small 'building block' functions & adding them to the reports as appropriate.

      Thus the entire class for my report that

      • reports on contributions &
      • allows them to be totalled with the option of grouping by line-item values and contribution types
        looks like this.

      $this->addToLineItemFromContribution(); is a complicated join taking into account the 3 ways the tables can be connected but the function would sit in Form.php & be available to any report functions as appropriate & can be changed in one place when CiviAccounts is implemented

      class CRM_Report_Form_Price_Contributionbased extends CRM_Report_Form {

      protected $_baseTable = 'civicrm_contribution' ;

      function __construct( )

      { $this->_columns = $this->getContactColumns() + $this->getLineItemColumns() + $this->getContributionColumns() ; parent::__construct(); }

      function fromClauses( )

      { return array( 'lineItem_from_contribution', 'contact_from_contribution', ); }


      ***NOTE that avaliable from clauses now defined on extended class in function getAvailableJoins()

      I wanted the from function to be able to build the joins so that the human error of remembering the ACL clause would be removed as it was inconsistent


          Issue Links



              • Assignee:
                eileen Eileen McNaughton
                eileen Eileen McNaughton
              • Votes:
                1 Vote for this issue
                5 Start watching this issue


                • Created: