checkin (broken)

This commit is contained in:
Rich Lott / Artful Robot 2025-02-18 17:33:27 +00:00
parent a01abba787
commit 06fec5daf7
21 changed files with 2025 additions and 376 deletions

View file

@ -0,0 +1,67 @@
<?php
use CRM_Contactcats_ExtensionUtil as E;
return [
'name' => 'ContactCategory',
'table' => 'civicrm_contact_category',
'class' => 'CRM_Contactcats_DAO_ContactCategory',
'getInfo' => fn() => [
'title' => E::ts('Contact Category'),
'title_plural' => E::ts('Contact Categories'),
'description' => E::ts('Stores a category for each contact'),
'log' => FALSE,
],
'getIndices' => fn() => [
'index_category' => [
'fields' => [
'category' => TRUE,
],
],
],
'getFields' => fn() => [
'id' => [
'title' => E::ts('ID'),
'sql_type' => 'int unsigned',
'input_type' => 'Number',
'required' => TRUE,
'description' => E::ts('Unique ID, corresponds to contact id'),
'primary_key' => TRUE,
'auto_increment' => TRUE,
],
'contact_id' => [
'title' => E::ts('Contact ID'),
'sql_type' => 'int unsigned',
'input_type' => 'EntityRef',
'required' => TRUE,
'description' => E::ts('Same as id but for FormBuilder'),
'input_attrs' => [
'label' => E::ts('Contact'),
],
'entity_reference' => [
'entity' => 'Contact',
'key' => 'id',
'on_delete' => 'CASCADE',
],
],
'category' => [
'title' => E::ts('Category'),
'sql_type' => 'int unsigned',
'input_type' => 'Select',
'required' => TRUE,
'default' => 0,
'pseudoconstant' => [
'option_group_name' => 'contact_categories',
],
],
'next_category' => [
'title' => E::ts('Next Category'),
'sql_type' => 'int unsigned',
'input_type' => 'Select',
'required' => TRUE,
'default' => 0,
'pseudoconstant' => [
'option_group_name' => 'contact_categories',
],
],
],
];

View file

@ -0,0 +1,85 @@
<?php
use CRM_Contactcats_ExtensionUtil as E;
return [
'name' => 'ContactCategoryDescription',
'table' => 'civicrm_contact_category_description',
'class' => 'CRM_Contactcats_DAO_ContactCategoryDescription',
'getInfo' => fn() => [
'title' => E::ts('Contact Category Description'),
'title_plural' => E::ts('Contact Category Descriptions'),
'description' => E::ts('Holds definition of a "Contact category"'),
'log' => FALSE,
],
'getIndices' => fn() => [
'index_category' => [
'fields' => [
'category' => TRUE,
],
],
],
'getFields' => fn() => [
'id' => [
'title' => E::ts('ID'),
'sql_type' => 'int unsigned',
'input_type' => 'Number',
'required' => TRUE,
'description' => E::ts('Unique Contact Category Description ID'),
'primary_key' => TRUE,
'auto_increment' => TRUE,
],
'label' => [
'title' => E::ts('Category name'),
'sql_type' => 'varchar(255)',
'input_type' => 'Text',
'required' => TRUE,
'description' => E::ts('Same as id but for FormBuilder'),
'input_attrs' => [
'text_length' => 255,
'label' => E::ts('Category name'),
],
],
'search_type' => [
'title' => E::ts('What defines this search?'),
'sql_type' => 'varchar(12)',
'input_type' => 'Select',
'required' => TRUE,
'default' => 'search',
'pseudoconstant' => [
'callback' => fn() => [
// 'name' => 'title',
'search' => E::ts('Search Kit search'),
'group' => E::ts('Group'),
// Future:
// 'sql' => E::ts('SQL template'),
],
],
],
'search_data' => [
'title' => E::ts('JSON blob specifies particulars to for the search_type'),
'description' => E::ts('Holds data specific to the search specification (e.g. a group ID when Group is selected).'),
'sql_type' => 'text',
'serialize' => 'JSON',
],
'color' => [
'title' => E::ts('Colour for category label'),
'sql_type' => 'varchar(7)',
'default' => '',
'required' => TRUE,
],
'icon' => [
'title' => E::ts('Icon'),
'sql_type' => 'varchar(64)',
'default' => '',
'required' => TRUE,
'description' => E::ts('The name of a Font Awesome icon to use to represent this, e.g. fa-trophy'),
],
'execution_order' => [
'title' => E::ts('Execution order'),
'description' => E::ts('The first category to match is assigned. Lower numbers are tested first.'),
'sql_type' => 'tinyint unsigned',
'default' => '10',
'required' => TRUE,
],
],
];