Skip to content

fix counter for case activities so bulk mail is not counted for every contact

ErikHommel requested to merge issue9549 into master

see https://www.wrike.com/open.htm?id=692748479

As the activity list in the CaseView is a DataTable and does not support any CiviCRM hooks nor acts too well with the DataTable API I have implemented the following hackish solution:

  • the DataTable is built up with data selected in the core function CRM_Activity_Page_AJAX::getCaseActivity. I have copied this function and included it in CRM_Nihrbackbone_NbrVolunteerCase as getAjaxParticipationActivities.
  • I have also copied the actual function that collects the activities (CRM_Case_BAO_Case::getCaseActivity) into CRM_Nihrbackbone_NbrVolunteerCase as getParticipationCaseActivities (and also the function formatContactLink as it was a private function in CRM_Case_BAO_Case). In this function I have added a few lines to add the contactID to the query to select the case activities so it ignores the bulk mail activities of other contacts. This is not needed in core CiviCRM as that will not hold bulk mail activities or any other activities that are linked to more contacts than the case contact.
  • I have added an item to the menu.xml file in the nihrbackbone extension to use my function rather than the core one for the link civicrm_ajax_activity:
civicrm/ajax/activity CRM_Nihrbackbone_NbrVolunteerCase::getAjaxParticipationActivities Participation Activities access CiviCRM

Merge request reports