mirror of
https://codeberg.org/artfulrobot/contactcats.git
synced 2025-06-25 13:08:04 +02:00
Import cat counts SK
This commit is contained in:
parent
a4c9251f5e
commit
8e2964bb86
1 changed files with 99 additions and 0 deletions
99
managed/SavedSearch_Contact_Category_Counts.mgd.php
Normal file
99
managed/SavedSearch_Contact_Category_Counts.mgd.php
Normal file
|
@ -0,0 +1,99 @@
|
|||
<?php
|
||||
use CRM_Contactcats_ExtensionUtil as E;
|
||||
|
||||
return [
|
||||
[
|
||||
'name' => '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.contact_id) AS COUNT_ContactCategoryDefinition_ContactCategory_category_definition_id_01_contact_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_Contact_Category_Counts_table',
|
||||
'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' => [
|
||||
['label', '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',
|
||||
],
|
||||
],
|
||||
'cssRules' => [],
|
||||
],
|
||||
[
|
||||
'type' => 'field',
|
||||
'key' => 'COUNT_ContactCategoryDefinition_ContactCategory_category_definition_id_01_contact_id',
|
||||
'dataType' => 'Integer',
|
||||
'label' => E::ts('Count'),
|
||||
'sortable' => TRUE,
|
||||
],
|
||||
],
|
||||
'actions' => FALSE,
|
||||
'classes' => ['table', 'table-striped'],
|
||||
],
|
||||
],
|
||||
'match' => [
|
||||
'saved_search_id',
|
||||
'name',
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
Loading…
Add table
Add a link
Reference in a new issue