mirror of
https://codeberg.org/artfulrobot/contactcats.git
synced 2025-06-25 15:28:06 +02:00
153 lines
4.4 KiB
PHP
153 lines
4.4 KiB
PHP
<?php
|
|
use CRM_Contactcats_ExtensionUtil as E;
|
|
|
|
return [
|
|
[
|
|
'name' => 'SavedSearch_Contacts_by_category',
|
|
'entity' => 'SavedSearch',
|
|
'cleanup' => 'always',
|
|
'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',
|
|
'contact_sub_type:label',
|
|
'display_name',
|
|
'Contact_ContactCategory_contact_id_01.category:label',
|
|
'Synopsis_Fields.Amount_of_last_contribution',
|
|
'Synopsis_Fields.Date_of_Last_Contribution',
|
|
'Synopsis_Fields.Total_Lifetime_Contributions',
|
|
'Synopsis_Fields.Total_count_of_contributions',
|
|
],
|
|
'orderBy' => [],
|
|
'where' => [
|
|
[
|
|
'contact_type:name',
|
|
'=',
|
|
'Individual',
|
|
],
|
|
],
|
|
'groupBy' => [],
|
|
'join' => [
|
|
[
|
|
'ContactCategory AS Contact_ContactCategory_contact_id_01',
|
|
'INNER',
|
|
[
|
|
'id',
|
|
'=',
|
|
'Contact_ContactCategory_contact_id_01.contact_id',
|
|
],
|
|
],
|
|
],
|
|
'having' => [],
|
|
],
|
|
],
|
|
'match' => [
|
|
'name',
|
|
],
|
|
],
|
|
],
|
|
[
|
|
'name' => 'SavedSearch_Contacts_by_category_SearchDisplay_Contacts_by_category_Table_1',
|
|
'entity' => 'SearchDisplay',
|
|
'cleanup' => 'always',
|
|
'update' => 'unmodified',
|
|
'params' => [
|
|
'version' => 4,
|
|
'values' => [
|
|
'name' => 'Contacts_by_category_Table_1',
|
|
'label' => E::ts('Contacts by category'),
|
|
'saved_search_id.name' => 'Contacts_by_category',
|
|
'type' => 'table',
|
|
'settings' => [
|
|
'description' => NULL,
|
|
'sort' => [
|
|
[
|
|
'sort_name',
|
|
'ASC',
|
|
],
|
|
],
|
|
'limit' => 50,
|
|
'pager' => [],
|
|
'placeholder' => 5,
|
|
'columns' => [
|
|
[
|
|
'type' => 'field',
|
|
'key' => 'Contact_ContactCategory_contact_id_01.category:label',
|
|
'dataType' => 'Integer',
|
|
'label' => E::ts('Category'),
|
|
'sortable' => TRUE,
|
|
],
|
|
[
|
|
'type' => 'field',
|
|
'key' => 'display_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_sub_type:label',
|
|
'dataType' => 'String',
|
|
'label' => E::ts('Contact Subtype'),
|
|
'sortable' => TRUE,
|
|
],
|
|
[
|
|
'type' => 'field',
|
|
'key' => 'Synopsis_Fields.Total_Lifetime_Contributions',
|
|
'dataType' => 'Money',
|
|
'label' => E::ts('£ total'),
|
|
'sortable' => TRUE,
|
|
'alignment' => 'text-right',
|
|
],
|
|
[
|
|
'type' => 'field',
|
|
'key' => 'Synopsis_Fields.Total_count_of_contributions',
|
|
'dataType' => 'Integer',
|
|
'label' => E::ts('Count donations'),
|
|
'sortable' => TRUE,
|
|
'alignment' => 'text-right',
|
|
],
|
|
[
|
|
'type' => 'field',
|
|
'key' => 'Synopsis_Fields.Date_of_Last_Contribution',
|
|
'dataType' => 'Timestamp',
|
|
'label' => E::ts('Latest donation'),
|
|
'sortable' => TRUE,
|
|
],
|
|
[
|
|
'type' => 'field',
|
|
'key' => 'Synopsis_Fields.Amount_of_last_contribution',
|
|
'dataType' => 'Money',
|
|
'label' => E::ts('£ latest'),
|
|
'sortable' => TRUE,
|
|
'alignment' => 'text-right',
|
|
],
|
|
],
|
|
'actions' => TRUE,
|
|
'classes' => [
|
|
'table-striped',
|
|
],
|
|
'headerCount' => TRUE,
|
|
],
|
|
],
|
|
'match' => [
|
|
'name',
|
|
],
|
|
],
|
|
],
|
|
];
|