mirror of
https://codeberg.org/artfulrobot/contactcats.git
synced 2025-06-25 14:48:04 +02:00
clean up sk/fb
This commit is contained in:
parent
a967d9a538
commit
131ebcc684
7 changed files with 59 additions and 379 deletions
|
@ -1,7 +1,4 @@
|
|||
<div af-fieldset="">
|
||||
<div class="af-container af-layout-inline af-container-style-pane" af-title="Filters">
|
||||
<af-field name="Contact_ContactCategory_contact_id_01.category_definition_id" defn="{search_operator: 'IN', input_attrs: {autoOpen: true, multiple: true}, security: 'FBAC', label: 'Category'}" />
|
||||
<af-field name="display_name" defn="{search_operator: 'CONTAINS', input_attrs: {}, label: 'Name'}" />
|
||||
</div>
|
||||
<crm-search-display-table search-name="Contacts_by_category" display-name="Contacts_by_category_Table_1"></crm-search-display-table>
|
||||
<af-field name="Contact_ContactCategory_id_01.category_definition_id" defn="{input_attrs: {multiple: true}, label: 'Category'}" />
|
||||
<crm-search-display-table search-name="Contacts_by_category_uxxr" display-name="Contacts_by_category"></crm-search-display-table>
|
||||
</div>
|
||||
|
|
|
@ -1,31 +1,31 @@
|
|||
{
|
||||
"type": "search",
|
||||
"requires": null,
|
||||
"entity_type": null,
|
||||
"join_entity": null,
|
||||
"title": "Contacts by category",
|
||||
"description": "Individuals only",
|
||||
"title": "Contacts by Category",
|
||||
"placement": [],
|
||||
"summary_contact_type": null,
|
||||
"summary_weight": null,
|
||||
"icon": "fa-tags",
|
||||
"server_route": "civicrm/contact/search/category",
|
||||
"is_public": false,
|
||||
"server_route": "civicrm/search/contacts-by-category",
|
||||
"permission": [
|
||||
"access CiviCRM"
|
||||
],
|
||||
"permission_operator": "AND",
|
||||
"navigation": {
|
||||
"parent": "Search",
|
||||
"label": "Contacts by Category",
|
||||
"weight": 0
|
||||
},
|
||||
"modified_date": "2025-02-27 18:24:17",
|
||||
"requires": null,
|
||||
"entity_type": null,
|
||||
"join_entity": null,
|
||||
"description": null,
|
||||
"summary_contact_type": null,
|
||||
"summary_weight": null,
|
||||
"is_public": false,
|
||||
"redirect": null,
|
||||
"submit_enabled": true,
|
||||
"submit_limit": null,
|
||||
"create_submission": false,
|
||||
"manual_processing": false,
|
||||
"allow_verification_by_email": false,
|
||||
"email_confirmation_template_id": null,
|
||||
"navigation": {
|
||||
"parent": "Search",
|
||||
"label": "Contacts by category",
|
||||
"weight": 0
|
||||
},
|
||||
"modified_date": "2025-02-25 14:51:17"
|
||||
"create_submission": null,
|
||||
"manual_processing": null,
|
||||
"allow_verification_by_email": null,
|
||||
"email_confirmation_template_id": null
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ use CRM_Contactcats_ExtensionUtil as E;
|
|||
|
||||
return [
|
||||
[
|
||||
'name' => 'SavedSearch_Contact_Category_Counts',
|
||||
'name' => 'SavedSearch_SavedSearch_Contact_Category_Counts',
|
||||
'entity' => 'SavedSearch',
|
||||
'cleanup' => 'unused',
|
||||
'update' => 'unmodified',
|
||||
|
@ -20,7 +20,7 @@ return [
|
|||
'label',
|
||||
'color',
|
||||
'icon',
|
||||
'COUNT(ContactCategoryDefinition_ContactCategory_category_definition_id_01.contact_id) AS COUNT_ContactCategoryDefinition_ContactCategory_category_definition_id_01_contact_id',
|
||||
'COUNT(ContactCategoryDefinition_ContactCategory_category_definition_id_01.id) AS COUNT_ContactCategoryDefinition_ContactCategory_category_definition_id_01_id',
|
||||
],
|
||||
'orderBy' => [],
|
||||
'where' => [],
|
||||
|
@ -43,7 +43,7 @@ return [
|
|||
],
|
||||
],
|
||||
[
|
||||
'name' => 'SavedSearch_Contact_Category_Counts_table',
|
||||
'name' => 'SavedSearch_SavedSearch_Contact_Category_Counts_SearchDisplay_Category_counts',
|
||||
'entity' => 'SearchDisplay',
|
||||
'cleanup' => 'unused',
|
||||
'update' => 'unmodified',
|
||||
|
@ -75,15 +75,20 @@ return [
|
|||
'field' => 'icon',
|
||||
'side' => 'left',
|
||||
],
|
||||
[
|
||||
'field' => 'icon',
|
||||
'side' => 'left',
|
||||
],
|
||||
],
|
||||
'cssRules' => [],
|
||||
],
|
||||
[
|
||||
'type' => 'field',
|
||||
'key' => 'COUNT_ContactCategoryDefinition_ContactCategory_category_definition_id_01_contact_id',
|
||||
'key' => 'COUNT_ContactCategoryDefinition_ContactCategory_category_definition_id_01_id',
|
||||
'dataType' => 'Integer',
|
||||
'label' => E::ts('Count'),
|
||||
'sortable' => TRUE,
|
||||
'alignment' => 'text-right',
|
||||
],
|
||||
],
|
||||
'actions' => FALSE,
|
||||
|
|
|
@ -3,60 +3,45 @@ use CRM_Contactcats_ExtensionUtil as E;
|
|||
|
||||
return [
|
||||
[
|
||||
'name' => 'SavedSearch_Contacts_by_category',
|
||||
'name' => 'SavedSearch_Contacts_by_category_uxxr',
|
||||
'entity' => 'SavedSearch',
|
||||
'cleanup' => 'unused',
|
||||
'update' => 'unmodified',
|
||||
'params' => [
|
||||
'version' => 4,
|
||||
'values' => [
|
||||
'name' => 'Contacts_by_category',
|
||||
'name' => 'Contacts_by_category_uxxr',
|
||||
'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_ContactCategory_ContactCategoryDefinition_category_definition_id_01.label',
|
||||
'sort_name',
|
||||
'contact_type:label',
|
||||
'Contact_ContactCategory_id_01_ContactCategory_ContactCategoryDefinition_category_definition_id_01.label',
|
||||
'email_primary.email',
|
||||
],
|
||||
'orderBy' => [],
|
||||
'where' => [
|
||||
[
|
||||
'contact_type:name',
|
||||
'=',
|
||||
'Individual',
|
||||
],
|
||||
],
|
||||
'where' => [],
|
||||
'groupBy' => [],
|
||||
'join' => [
|
||||
[
|
||||
'ContactCategory AS Contact_ContactCategory_contact_id_01',
|
||||
'ContactCategory AS Contact_ContactCategory_id_01',
|
||||
'INNER',
|
||||
[
|
||||
'id',
|
||||
'=',
|
||||
'Contact_ContactCategory_contact_id_01.contact_id',
|
||||
],
|
||||
[
|
||||
'Contact_ContactCategory_contact_id_01.id',
|
||||
'=',
|
||||
'id',
|
||||
'Contact_ContactCategory_id_01.id',
|
||||
],
|
||||
],
|
||||
[
|
||||
'ContactCategoryDefinition AS Contact_ContactCategory_contact_id_01_ContactCategory_ContactCategoryDefinition_category_definition_id_01',
|
||||
'ContactCategoryDefinition AS Contact_ContactCategory_id_01_ContactCategory_ContactCategoryDefinition_category_definition_id_01',
|
||||
'INNER',
|
||||
[
|
||||
'Contact_ContactCategory_contact_id_01.category_definition_id',
|
||||
'Contact_ContactCategory_id_01.category_definition_id',
|
||||
'=',
|
||||
'Contact_ContactCategory_contact_id_01_ContactCategory_ContactCategoryDefinition_category_definition_id_01.id',
|
||||
],
|
||||
[
|
||||
'Contact_ContactCategory_contact_id_01_ContactCategory_ContactCategoryDefinition_category_definition_id_01.id',
|
||||
'=',
|
||||
'Contact_ContactCategory_contact_id_01.category_definition_id',
|
||||
'Contact_ContactCategory_id_01_ContactCategory_ContactCategoryDefinition_category_definition_id_01.id',
|
||||
],
|
||||
],
|
||||
],
|
||||
|
@ -67,24 +52,21 @@ return [
|
|||
],
|
||||
],
|
||||
[
|
||||
'name' => 'SavedSearch_Contacts_by_category_SearchDisplay_Contacts_by_category_Table_1',
|
||||
'name' => 'SavedSearch_Contacts_by_category_uxxr_SearchDisplay_Contacts_by_category',
|
||||
'entity' => 'SearchDisplay',
|
||||
'cleanup' => 'unused',
|
||||
'update' => 'unmodified',
|
||||
'params' => [
|
||||
'version' => 4,
|
||||
'values' => [
|
||||
'name' => 'Contacts_by_category_Table_1',
|
||||
'name' => 'Contacts_by_category',
|
||||
'label' => E::ts('Contacts by category'),
|
||||
'saved_search_id.name' => 'Contacts_by_category',
|
||||
'saved_search_id.name' => 'Contacts_by_category_uxxr',
|
||||
'type' => 'table',
|
||||
'settings' => [
|
||||
'description' => E::ts(NULL),
|
||||
'sort' => [
|
||||
[
|
||||
'Contact_ContactCategory_contact_id_01_ContactCategory_ContactCategoryDefinition_category_definition_id_01.label',
|
||||
'ASC',
|
||||
],
|
||||
['sort_name', 'ASC'],
|
||||
],
|
||||
'limit' => 50,
|
||||
'pager' => [],
|
||||
|
@ -92,7 +74,7 @@ return [
|
|||
'columns' => [
|
||||
[
|
||||
'type' => 'field',
|
||||
'key' => 'display_name',
|
||||
'key' => 'sort_name',
|
||||
'dataType' => 'String',
|
||||
'label' => E::ts('Name'),
|
||||
'sortable' => TRUE,
|
||||
|
@ -107,28 +89,34 @@ return [
|
|||
],
|
||||
[
|
||||
'type' => 'field',
|
||||
'key' => 'contact_sub_type:label',
|
||||
'key' => 'contact_type:label',
|
||||
'dataType' => 'String',
|
||||
'label' => E::ts('Contact Subtype'),
|
||||
'label' => E::ts('Contact Type'),
|
||||
'sortable' => TRUE,
|
||||
],
|
||||
[
|
||||
'type' => 'field',
|
||||
'key' => 'Contact_ContactCategory_contact_id_01_ContactCategory_ContactCategoryDefinition_category_definition_id_01.label',
|
||||
'key' => 'Contact_ContactCategory_id_01_ContactCategory_ContactCategoryDefinition_category_definition_id_01.label',
|
||||
'dataType' => 'String',
|
||||
'label' => E::ts('Category'),
|
||||
'sortable' => TRUE,
|
||||
'icons' => [
|
||||
[
|
||||
'field' => 'Contact_ContactCategory_contact_id_01_ContactCategory_ContactCategoryDefinition_category_definition_id_01.icon',
|
||||
'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-striped'],
|
||||
'headerCount' => TRUE,
|
||||
'classes' => ['table', 'table-striped'],
|
||||
'actions_display_mode' => 'menu',
|
||||
],
|
||||
],
|
|
@ -1,104 +0,0 @@
|
|||
<?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' => [
|
||||
['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',
|
||||
],
|
||||
[
|
||||
'field' => 'icon',
|
||||
'side' => 'left',
|
||||
],
|
||||
],
|
||||
'cssRules' => [],
|
||||
],
|
||||
[
|
||||
'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' => [
|
||||
'saved_search_id',
|
||||
'name',
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
|
@ -1,67 +0,0 @@
|
|||
<?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',
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
|
@ -1,139 +0,0 @@
|
|||
<?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_ContactCategory_ContactCategoryDefinition_category_definition_id_01.label',
|
||||
],
|
||||
'orderBy' => [],
|
||||
'where' => [
|
||||
[
|
||||
'contact_type:name',
|
||||
'=',
|
||||
'Individual',
|
||||
],
|
||||
],
|
||||
'groupBy' => [],
|
||||
'join' => [
|
||||
[
|
||||
'ContactCategory AS Contact_ContactCategory_contact_id_01',
|
||||
'INNER',
|
||||
[
|
||||
'id',
|
||||
'=',
|
||||
'Contact_ContactCategory_contact_id_01.contact_id',
|
||||
],
|
||||
[
|
||||
'Contact_ContactCategory_contact_id_01.id',
|
||||
'=',
|
||||
'id',
|
||||
],
|
||||
],
|
||||
[
|
||||
'ContactCategoryDefinition AS Contact_ContactCategory_contact_id_01_ContactCategory_ContactCategoryDefinition_category_definition_id_01',
|
||||
'INNER',
|
||||
[
|
||||
'Contact_ContactCategory_contact_id_01.category_definition_id',
|
||||
'=',
|
||||
'Contact_ContactCategory_contact_id_01_ContactCategory_ContactCategoryDefinition_category_definition_id_01.id',
|
||||
],
|
||||
[
|
||||
'Contact_ContactCategory_contact_id_01_ContactCategory_ContactCategoryDefinition_category_definition_id_01.id',
|
||||
'=',
|
||||
'Contact_ContactCategory_contact_id_01.category_definition_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' => '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' => 'Contact_ContactCategory_contact_id_01_ContactCategory_ContactCategoryDefinition_category_definition_id_01.label',
|
||||
'dataType' => 'String',
|
||||
'label' => E::ts('Category'),
|
||||
'sortable' => TRUE,
|
||||
],
|
||||
],
|
||||
'actions' => TRUE,
|
||||
'classes' => [
|
||||
'table-striped',
|
||||
],
|
||||
'headerCount' => TRUE,
|
||||
'actions_display_mode' => 'menu',
|
||||
],
|
||||
],
|
||||
'match' => [
|
||||
'saved_search_id',
|
||||
'name',
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
Loading…
Add table
Add a link
Reference in a new issue