package SK + FB

This commit is contained in:
Rich Lott / Artful Robot 2024-02-28 17:30:43 +00:00
parent c6c1840073
commit ca1360f8bf
7 changed files with 355 additions and 0 deletions

View file

@ -0,0 +1,3 @@
<div af-fieldset="">
<crm-search-display-list search-name="Category_for_contact" display-name="Category_for_contact_List_1" filters="{'contact_id': options.contact_id}"></crm-search-display-list>
</div>

View file

@ -0,0 +1,13 @@
{
"type": "search",
"title": "Category",
"placement": [
"contact_summary_block"
],
"icon": "fa-list-alt",
"server_route": "",
"permission": [
"access CiviCRM"
],
"permission_operator": "AND"
}

View file

@ -0,0 +1,5 @@
<div af-fieldset="" af-title="Contacts by Category">
<af-field name="Contact_ContactCategory_contact_id_01.category" defn="{input_attrs: {multiple: true}}" />
<af-field name="contact_sub_type" defn="{input_attrs: {multiple: true}}" />
<crm-search-display-table search-name="Contacts_by_category" display-name="Contacts_by_category_Table_1"></crm-search-display-table>
</div>

View file

@ -0,0 +1,31 @@
{
"type": "search",
"title": "Contacts by category",
"description": "Individuals only",
"placement": [],
"icon": "fa-tags",
"server_route": "civicrm/contact/search/category",
"permission": [
"access CiviCRM"
],
"permission_operator": "AND",
"navigation": {
"parent": "Search",
"label": "Contacts by category",
"weight": 0
},
"modified_date": "2024-02-28 16:59:26",
"requires": null,
"entity_type": null,
"join_entity": null,
"summary_contact_type": null,
"summary_weight": null,
"is_public": false,
"redirect": null,
"submit_enabled": true,
"submit_limit": null,
"create_submission": null,
"manual_processing": null,
"allow_verification_by_email": null,
"email_confirmation_template_id": null
}

View file

@ -0,0 +1,83 @@
<?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',
],
],
],
];

View file

@ -0,0 +1,67 @@
<?php
use CRM_Contactcats_ExtensionUtil as E;
return [
[
'name' => 'SavedSearch_Category_for_contact',
'entity' => 'SavedSearch',
'cleanup' => 'always',
'update' => 'unmodified',
'params' => [
'version' => 4,
'values' => [
'name' => 'Category_for_contact',
'label' => E::ts('Category for contact'),
'api_entity' => 'ContactCategory',
'api_params' => [
'version' => 4,
'select' => [
'id',
'category:label',
'contact_id',
],
'orderBy' => [],
'where' => [],
'groupBy' => [],
'join' => [],
'having' => [],
],
],
'match' => [
'name',
],
],
],
[
'name' => 'SavedSearch_Category_for_contact_SearchDisplay_Category_for_contact_List_1',
'entity' => 'SearchDisplay',
'cleanup' => 'always',
'update' => 'unmodified',
'params' => [
'version' => 4,
'values' => [
'name' => 'Category_for_contact_List_1',
'label' => E::ts('Category for contact List 1'),
'saved_search_id.name' => 'Category_for_contact',
'type' => 'list',
'settings' => [
'style' => 'ul',
'limit' => 0,
'sort' => [],
'pager' => FALSE,
'columns' => [
[
'type' => 'field',
'key' => 'category:label',
'dataType' => 'Integer',
],
],
'placeholder' => 0,
],
],
'match' => [
'name',
],
],
],
];

View file

@ -0,0 +1,153 @@
<?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',
],
],
],
];