compucorp / uk.co.compucorp.civicrm.pivotreport

CiviCRM Pivot table reporting solution
Other
8 stars 13 forks source link

(WIP) PCHR-3499: Reports Migration Milestone 2 #112

Closed tunbola closed 3 years ago

tunbola commented 6 years ago

Overview

Sequel to #107, A couple more changes have been made to the Pivot Report Extension. This includes:

  $ApIentityName . ' Pivot Report'

A new method getTitle was introduced in the Group Entity report class that allows each report class to return the report title.

For the leave Report:

 public function getTitle($entityName) {
    return ts('Leave Reports');
  }
This flexibility in the naming of the  Data and Group file allows the files to be named in any way the extension deems fit.
```php
     if (!empty($reportEntityData['hookable']['data_class'])) {
      $className = $reportEntityData['hookable']['data_class'];
    }

    if (!empty($reportEntityData['hookable']['group_class'])) {
     $className = $reportEntityData['hookable']['group_class'];
    }

The template file is included in this way:

    if ($hookableData) {
      if(!empty($hookableData['template_path'])) {
        $this->assign('templatePath', $hookableData['template_path']);
      }
    }

Leave Reports Migration

The Leave Reports was added to the Pivot Report extension. The getData method of the Leave report entity returns data via chained API calls. All the columns available in the original report were added. Field handlers present in the original report was also added to the Leave pivot report.

leave reports _ staging17 2018-04-10 17-15-16

tunbola commented 6 years ago

@davialexandre, regarding making the date filter work for People reports based on the contract dates, after investigation on the Pivot JS library, it does not seem to have in-built functionality for this kind of filtering. I decided to pass this task over to a FE dev perhaps they will be able to come up with something that'll do what we need. Here's the ticket: https://compucorp.atlassian.net/browse/PCHR-3504

tunbola commented 3 years ago

Not needed anymore.