Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enotice fixes, consolidation on Import datasource forms #25141

Merged
merged 1 commit into from
Dec 9, 2022

Conversation

eileenmcnaughton
Copy link
Contributor

Overview

Enotice fixes, consolidation on Import datasource forms

Before

E-notices on dataSource form in some cases, inconsistent across the 2 templates

After

Standardised

Technical Details

The goal is to consolidate the 2 forms of DataSource.tpl such that the
logic to select csv or sql is in shared code used by Contact import (as is currently the case) and all the other imports (including csvimporter)

This PR simply wraps all fields that might not be in one or both tpls with {if array_key_exists('contactType', $form)} so we can more easily merge them into one.

Note that in addition to the tpl layer stuff the php layer requires these lines that are only in the Contact import at the moment to be accessed by all imports

    $this->buildDataSourceFields();
    $this->assign('urlPath', 'civicrm/import/datasource');
    $this->assign('urlPathVar', 'snippet=4&user_job_id=' . $this->get('user_job_id'));

    $this->add('select', 'dataSource', ts('Data Source'), $this->getDataSources(), TRUE,
      ['onchange' => 'buildDataSourceFormBlock(this.value);']
    );

Comments

@mattwire once this is done we won't need to add to csvimporter per your PR. However, I hit a couple of gotchas consolidating the tpl - the first 2 I expect just take more fiddling around

  1. I couldn't quite seem to get the help text working for the onDuplicate field
  2. For some reason I didn't get the buildDataSourceFormBlock(); to work & hence I backed out for now, scaling this down to consolidation so the tpls can be more easily merged
  3. the text around contactType doesn't quite work for contacts if we use what is in the shared tpl
         <span class="description">
              {ts 1=$importEntities}Select 'Individual' if you are importing %1 made by individual persons.{/ts}
              {ts 1=$importEntities}Select 'Organization' or 'Household' if you are importing %1 to contacts of that type.{/ts}
            </span>

Perhaps

         <span class="description">
              {ts 1=$importEntities}Select 'Individual' if you are importing to individual persons.{/ts}
              {ts 1=$importEntities}Select 'Organization' or 'Household' to contacts of that type.{/ts}
            </span>

would get us past it?

Maybe we could even drop it?

@civibot
Copy link

civibot bot commented Dec 9, 2022

(Standard links)

@civibot civibot bot added the master label Dec 9, 2022
@mattwire mattwire merged commit 116fe3b into civicrm:master Dec 9, 2022
@eileenmcnaughton eileenmcnaughton deleted the import_source branch December 11, 2022 22:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants