From 1a08b036081a0ca52cb25ceca64a040fdf438d9d Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Mon, 3 Jan 2022 14:58:18 -0500 Subject: [PATCH] Cleanup multi-record custom import tpl and warn user if no multi-custom groups exist. --- CRM/Custom/Import/Form/DataSource.php | 1 + .../CRM/Custom/Import/Form/DataSource.tpl | 21 +++++++------------ 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/CRM/Custom/Import/Form/DataSource.php b/CRM/Custom/Import/Form/DataSource.php index 751969385c..d36cb68fd5 100644 --- a/CRM/Custom/Import/Form/DataSource.php +++ b/CRM/Custom/Import/Form/DataSource.php @@ -52,6 +52,7 @@ class CRM_Custom_Import_Form_DataSource extends CRM_Import_Form_DataSource { parent::buildQuickForm(); $multipleCustomData = CRM_Core_BAO_CustomGroup::getMultipleFieldGroup(); + $this->assign('fieldGroups', $multipleCustomData); $this->add('select', 'multipleCustomData', ts('Multi-value Custom Data'), ['' => ts('- select -')] + $multipleCustomData, TRUE); $this->addContactTypeSelector(); diff --git a/templates/CRM/Custom/Import/Form/DataSource.tpl b/templates/CRM/Custom/Import/Form/DataSource.tpl index 56e3659531..abbde10980 100644 --- a/templates/CRM/Custom/Import/Form/DataSource.tpl +++ b/templates/CRM/Custom/Import/Form/DataSource.tpl @@ -14,7 +14,11 @@
{* WizardHeader.tpl provides visual display of steps thru the wizard as well as title for current step *} {include file="CRM/common/WizardHeader.tpl"} - + {if !$fieldGroups} +
+ {ts}This import screen cannot be used because there are no Multi-value custom data groups.{/ts} +
+ {/if}
{ts}The Multi-value Custom Data Import Wizard allows you to easily upload data to populate multi-value custom data records (such as employment or education history) for existing contacts.{/ts} {ts}Files to be imported must be in the 'comma-separated-values' format (CSV) and must contain data needed to match the incoming data to an existing contact record in your CiviCRM database.{/ts} {help id='upload'} @@ -22,10 +26,6 @@
{include file="CRM/common/formButtons.tpl" location="top"}
- - - - - - + @@ -69,7 +64,7 @@ {if $savedMapping} - -- 2.25.1
{$form.entity.label}{$form.entity.html}
{$form.uploadFile.label} {$form.uploadFile.html}
@@ -47,17 +47,12 @@
{$form.multipleCustomData.label} + {$form.multipleCustomData.label} {$form.multipleCustomData.html}
{$form.contactType.label}{$form.contactType.html}
- - {ts}Select 'Individual' if you are importing custom data for individual persons.{/ts} - {ts}Select 'Organization' or 'Household' if you are importing custom data . (NOTE: Some built-in contact types may not be enabled for your site.){/ts} - -
{$form.contactType.html}
{if $loadedMapping}{ts}Select a Different Field Mapping{/ts}{else}{ts}Load Saved Field Mapping{/ts}{/if} + {if $loadedMapping}{ts}Select a Different Field Mapping{/ts}{else}{ts}Load Saved Field Mapping{/ts}{/if} {$form.savedMapping.html}