fix setup

This commit is contained in:
Rich Lott / Artful Robot 2025-04-02 10:57:23 +01:00
parent 3b42e99a96
commit 63b930101e
2 changed files with 17 additions and 18 deletions

View file

@ -26,7 +26,7 @@ class Setup extends AbstractAction {
// TODO: could offer this as a hook. // TODO: could offer this as a hook.
// For now, it's hard-coded. // For now, it's hard-coded.
if ($this->scheme === 'ForumZFDFundraising1') { if ($this->scheme === 'ForumZFDFundraising1') {
$this->implementForumZFDFundraising1($result); return $this->implementForumZFDFundraising1($result);
} }
throw new CRM_Core_Exception("Unknown scheme " . $this->scheme); throw new CRM_Core_Exception("Unknown scheme " . $this->scheme);
} }
@ -123,12 +123,12 @@ class Setup extends AbstractAction {
'label' => '1.4', 'label' => '1.4',
'description' => E::ts('Occasional donor: new'), 'description' => E::ts('Occasional donor: new'),
'color' => '#7d008c', 'color' => '#7d008c',
'icon' => 'fa-card-plus', 'icon' => 'fa-circle-plus',
], ],
[ [
'_search_name' => 'ContactCategories_Locus_1_3', '_search_name' => 'ContactCategories_Locus_1_3',
'label' => '1.3', 'label' => '1.3',
'description' => E::ts('Occasional donor: one-time'), // FIXME: 'description' => E::ts('Occasional donor: one-time'),
'color' => '#6d0079', 'color' => '#6d0079',
'icon' => 'fa-money-bill-1', 'icon' => 'fa-money-bill-1',
], ],
@ -143,7 +143,7 @@ class Setup extends AbstractAction {
'_search_name' => 'ContactCategories_Locus_1_1', '_search_name' => 'ContactCategories_Locus_1_1',
'label' => '1.1', 'label' => '1.1',
'description' => E::ts('Occasional donor: expired'), 'description' => E::ts('Occasional donor: expired'),
'color' => '#fff', 'color' => '#58325c',
'icon' => 'fa-road-circle-xmark', 'icon' => 'fa-road-circle-xmark',
], ],
[ [
@ -151,7 +151,7 @@ class Setup extends AbstractAction {
'label' => '0.2', 'label' => '0.2',
'description' => E::ts('Interested'), 'description' => E::ts('Interested'),
'color' => '#613b05', 'color' => '#613b05',
'icon' => '', 'icon' => 'fa-eye',
], ],
]; ];
@ -166,11 +166,11 @@ class Setup extends AbstractAction {
} }
$saveApi = ContactCategoryDefinition::save(FALSE) $saveApi = ContactCategoryDefinition::save(FALSE)
->setDefaults([ 'search_type' => 'search' ]); ->setDefaults(['search_type:name' => 'search']);
$order = 1; $order = 1;
foreach ($src as $rec) { foreach ($src as $rec) {
$src['search_data'] = ['saved_search_id' => $nameToIdMatch[$rec['_search_name']]]; $rec['search_data'] = ['saved_search_id' => $nameToIdMatch[$rec['_search_name']]];
$src['execution_order'] = $src['presentation_order'] = $order++; $rec['execution_order'] = $rec['presentation_order'] = $order++;
unset($rec['_search_name']); unset($rec['_search_name']);
$saveApi->addRecord($rec); $saveApi->addRecord($rec);
} }
@ -179,7 +179,7 @@ class Setup extends AbstractAction {
'description' => E::ts('Uninterested'), 'description' => E::ts('Uninterested'),
'color' => '#555', 'color' => '#555',
'icon' => 'fa-ban', 'icon' => 'fa-ban',
'search_type' => 'default', 'search_type:name' => 'default',
'presentation_order' => $order, 'presentation_order' => $order,
'execution_order' => $order, 'execution_order' => $order,
]); ]);
@ -202,4 +202,3 @@ class Setup extends AbstractAction {
} }
} }

View file

@ -10,7 +10,7 @@ return [
'params' => [ 'params' => [
'version' => 4, 'version' => 4,
'values' => [ 'values' => [
'name' => 'ContactCategories_0_2_Locus', 'name' => 'ContactCategories_Locus_0_2',
'label' => E::ts('ContactCategories 0.2 Locus'), 'label' => E::ts('ContactCategories 0.2 Locus'),
'api_entity' => 'Contact', 'api_entity' => 'Contact',
'api_params' => [ 'api_params' => [