From 41e1f8a315e9d3b2f446e56322a5bdeda7db0bdb Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Fri, 8 Jul 2022 10:10:22 -0400 Subject: [PATCH] Afform - Allow groups and tags and age to be filters --- Civi/Api4/Service/Spec/Provider/ContactGetSpecProvider.php | 2 ++ Civi/Api4/Service/Spec/Provider/EntityTagFilterSpecProvider.php | 1 + 2 files changed, 3 insertions(+) diff --git a/Civi/Api4/Service/Spec/Provider/ContactGetSpecProvider.php b/Civi/Api4/Service/Spec/Provider/ContactGetSpecProvider.php index 75de36c5ff..5c24e90b02 100644 --- a/Civi/Api4/Service/Spec/Provider/ContactGetSpecProvider.php +++ b/Civi/Api4/Service/Spec/Provider/ContactGetSpecProvider.php @@ -29,6 +29,7 @@ class ContactGetSpecProvider implements Generic\SpecProviderInterface { ->setColumnName('id') ->setDescription(ts('Groups (or sub-groups of groups) to which this contact belongs')) ->setType('Filter') + ->setInputType('Select') ->setOperators(['IN', 'NOT IN']) ->addSqlFilter([__CLASS__, 'getContactGroupSql']) ->setSuffixes(['name', 'label']) @@ -41,6 +42,7 @@ class ContactGetSpecProvider implements Generic\SpecProviderInterface { $field->setLabel(ts('Age (years)')) ->setTitle(ts('Age (years)')) ->setColumnName('birth_date') + ->setInputType('Number') ->setDescription(ts('Age of individual (in years)')) ->setType('Extra') ->setReadonly(TRUE) diff --git a/Civi/Api4/Service/Spec/Provider/EntityTagFilterSpecProvider.php b/Civi/Api4/Service/Spec/Provider/EntityTagFilterSpecProvider.php index df3f51f4ac..607da6ba1b 100644 --- a/Civi/Api4/Service/Spec/Provider/EntityTagFilterSpecProvider.php +++ b/Civi/Api4/Service/Spec/Provider/EntityTagFilterSpecProvider.php @@ -31,6 +31,7 @@ class EntityTagFilterSpecProvider implements Generic\SpecProviderInterface { ->setColumnName('id') ->setDescription(ts('Filter by tags (including child tags)')) ->setType('Filter') + ->setInputType('Select') ->setOperators(['IN', 'NOT IN']) ->addSqlFilter([__CLASS__, 'getTagFilterSql']) ->setSuffixes(['name', 'label', 'description', 'color']) -- 2.25.1