contactcats/managed/SavedSearch_Contacts_by_category.mgd.php
2025-04-02 10:57:44 +01:00

128 lines
3.8 KiB
PHP

<?php
use CRM_Contactcats_ExtensionUtil as E;
return [
[
'name' => 'SavedSearch_Contacts_by_category',
'entity' => 'SavedSearch',
'cleanup' => 'unused',
'update' => 'unmodified',
'params' => [
'version' => 4,
'values' => [
'name' => 'Contacts_by_category',
'label' => E::ts('Contacts by category'),
'api_entity' => 'Contact',
'api_params' => [
'version' => 4,
'select' => [
'id',
'sort_name',
'contact_type:label',
'Contact_ContactCategory_id_01_ContactCategory_ContactCategoryDefinition_category_definition_id_01.label',
'email_primary.email',
],
'orderBy' => [],
'where' => [],
'groupBy' => [],
'join' => [
[
'ContactCategory AS Contact_ContactCategory_id_01',
'INNER',
[
'id',
'=',
'Contact_ContactCategory_id_01.id',
],
],
[
'ContactCategoryDefinition AS Contact_ContactCategory_id_01_ContactCategory_ContactCategoryDefinition_category_definition_id_01',
'INNER',
[
'Contact_ContactCategory_id_01.category_definition_id',
'=',
'Contact_ContactCategory_id_01_ContactCategory_ContactCategoryDefinition_category_definition_id_01.id',
],
],
],
'having' => [],
],
],
'match' => ['name'],
],
],
[
'name' => 'SavedSearch_Contacts_by_category_SearchDisplay_Contacts_by_category',
'entity' => 'SearchDisplay',
'cleanup' => 'unused',
'update' => 'unmodified',
'params' => [
'version' => 4,
'values' => [
'name' => 'Contacts_by_category',
'label' => E::ts('Contacts by category'),
'saved_search_id.name' => 'Contacts_by_category',
'type' => 'table',
'settings' => [
'description' => E::ts(NULL),
'sort' => [
['sort_name', 'ASC'],
],
'limit' => 50,
'pager' => [],
'placeholder' => 5,
'columns' => [
[
'type' => 'field',
'key' => 'sort_name',
'dataType' => 'String',
'label' => E::ts('Name'),
'sortable' => TRUE,
'link' => [
'path' => '',
'entity' => 'Contact',
'action' => 'view',
'join' => '',
'target' => '',
],
'title' => E::ts('View Contact'),
],
[
'type' => 'field',
'key' => 'contact_type:label',
'dataType' => 'String',
'label' => E::ts('Contact Type'),
'sortable' => TRUE,
],
[
'type' => 'field',
'key' => 'Contact_ContactCategory_id_01_ContactCategory_ContactCategoryDefinition_category_definition_id_01.label',
'dataType' => 'String',
'label' => E::ts('Category'),
'sortable' => TRUE,
'icons' => [
[
'field' => 'Contact_ContactCategory_id_01_ContactCategory_ContactCategoryDefinition_category_definition_id_01.icon',
'side' => 'left',
],
],
],
[
'type' => 'field',
'key' => 'email_primary.email',
'dataType' => 'String',
'label' => E::ts('Email'),
'sortable' => TRUE,
],
],
'actions' => TRUE,
'classes' => ['table', 'table-striped'],
'actions_display_mode' => 'menu',
],
],
'match' => [
'name',
],
],
],
];