contactcats/managed/searchkit-category-counts.mgd.php
Rich Lott / Artful Robot ca1360f8bf package SK + FB
2024-02-28 17:30:43 +00:00

83 lines
2 KiB
PHP

<?php
use CRM_Contactcats_ExtensionUtil as E;
return [
[
'name' => 'SavedSearch_Contact_Category_Summary',
'entity' => 'SavedSearch',
'cleanup' => 'always',
'update' => 'unmodified',
'params' => [
'version' => 4,
'values' => [
'name' => 'Contact_Category_Summary',
'label' => E::ts('Contact Category Summary'),
'api_entity' => 'ContactCategory',
'api_params' => [
'version' => 4,
'select' => [
'category:label',
'COUNT(contact_id) AS COUNT_contact_id',
],
'orderBy' => [],
'where' => [],
'groupBy' => [
'category',
],
'join' => [],
'having' => [],
],
],
'match' => [
'name',
],
],
],
[
'name' => 'SavedSearch_Contact_Category_Summary_SearchDisplay_Contact_Category_Summary',
'entity' => 'SearchDisplay',
'cleanup' => 'always',
'update' => 'unmodified',
'params' => [
'version' => 4,
'values' => [
'name' => 'Contact_Category_Summary',
'label' => E::ts('Contact Category Summary'),
'saved_search_id.name' => 'Contact_Category_Summary',
'type' => 'table',
'settings' => [
'description' => NULL,
'sort' => [],
'limit' => 0,
'pager' => FALSE,
'placeholder' => 5,
'columns' => [
[
'type' => 'field',
'key' => 'category:label',
'dataType' => 'Integer',
'label' => E::ts('Category'),
'sortable' => TRUE,
],
[
'type' => 'field',
'key' => 'COUNT_contact_id',
'dataType' => 'Integer',
'label' => E::ts('Count'),
'sortable' => TRUE,
],
],
'actions' => TRUE,
'classes' => [
'table',
'table-striped',
],
],
],
'match' => [
'saved_search_id',
'name',
],
],
],
];