mirror of
https://codeberg.org/artfulrobot/contactcats.git
synced 2025-06-26 01:38:04 +02:00
114 lines
3.4 KiB
PHP
114 lines
3.4 KiB
PHP
<?php
|
|
use CRM_Contactcats_ExtensionUtil as E;
|
|
|
|
return [
|
|
[
|
|
'name' => 'SavedSearch_SavedSearch_Contact_Category_Counts',
|
|
'entity' => 'SavedSearch',
|
|
'cleanup' => 'unused',
|
|
'update' => 'unmodified',
|
|
'params' => [
|
|
'version' => 4,
|
|
'values' => [
|
|
'name' => 'SavedSearch_Contact_Category_Counts',
|
|
'label' => E::ts('Category Counts query'),
|
|
'api_entity' => 'ContactCategoryDefinition',
|
|
'api_params' => [
|
|
'version' => 4,
|
|
'select' => [
|
|
'id',
|
|
'label',
|
|
'color',
|
|
'icon',
|
|
'COUNT(ContactCategoryDefinition_ContactCategory_category_definition_id_01.id) AS COUNT_ContactCategoryDefinition_ContactCategory_category_definition_id_01_id',
|
|
],
|
|
'orderBy' => [],
|
|
'where' => [],
|
|
'groupBy' => ['id'],
|
|
'join' => [
|
|
[
|
|
'ContactCategory AS ContactCategoryDefinition_ContactCategory_category_definition_id_01',
|
|
'LEFT',
|
|
[
|
|
'id',
|
|
'=',
|
|
'ContactCategoryDefinition_ContactCategory_category_definition_id_01.category_definition_id',
|
|
],
|
|
],
|
|
],
|
|
'having' => [],
|
|
],
|
|
],
|
|
'match' => ['name'],
|
|
],
|
|
],
|
|
[
|
|
'name' => 'SavedSearch_SavedSearch_Contact_Category_Counts_SearchDisplay_Category_counts',
|
|
'entity' => 'SearchDisplay',
|
|
'cleanup' => 'unused',
|
|
'update' => 'unmodified',
|
|
'params' => [
|
|
'version' => 4,
|
|
'values' => [
|
|
'name' => 'Category_counts',
|
|
'label' => E::ts('Category counts'),
|
|
'saved_search_id.name' => 'SavedSearch_Contact_Category_Counts',
|
|
'type' => 'table',
|
|
'settings' => [
|
|
'description' => E::ts('Shows a list of all categories and how many contacts are in each one.'),
|
|
'sort' => [
|
|
[
|
|
'presentation_order',
|
|
'ASC',
|
|
],
|
|
['color', 'ASC'],
|
|
],
|
|
'limit' => 50,
|
|
'pager' => FALSE,
|
|
'placeholder' => 0,
|
|
'columns' => [
|
|
[
|
|
'type' => 'field',
|
|
'key' => 'label',
|
|
'dataType' => 'String',
|
|
'label' => E::ts('Category'),
|
|
'sortable' => TRUE,
|
|
'rewrite' => '',
|
|
'icons' => [
|
|
[
|
|
'field' => 'icon',
|
|
'side' => 'left',
|
|
],
|
|
[
|
|
'field' => 'icon',
|
|
'side' => 'left',
|
|
],
|
|
],
|
|
'cssRules' => [],
|
|
'link' => [
|
|
'path' => 'civicrm/search/contacts-by-category#?Contact_ContactCategory_id_01.category_definition_id=[id]',
|
|
'entity' => '',
|
|
'action' => '',
|
|
'join' => '',
|
|
'target' => '',
|
|
],
|
|
],
|
|
[
|
|
'type' => 'field',
|
|
'key' => 'COUNT_ContactCategoryDefinition_ContactCategory_category_definition_id_01_id',
|
|
'dataType' => 'Integer',
|
|
'label' => E::ts('Count'),
|
|
'sortable' => TRUE,
|
|
'alignment' => 'text-right',
|
|
],
|
|
],
|
|
'actions' => FALSE,
|
|
'classes' => ['table', 'table-striped'],
|
|
],
|
|
],
|
|
'match' => [
|
|
'name',
|
|
],
|
|
],
|
|
],
|
|
];
|