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

Add state name to export fields #22318

Merged
merged 1 commit into from
Jan 3, 2022
Merged

Conversation

jitendrapurohit
Copy link
Contributor

Overview

Add state name to export fields

Before

Export Contact only has a State field which render as state abbreviation. There is no way to export the name of the state in core.

To replicate:

  • Search contacts.
  • Export them and select Choose fields to export.
  • On selecting the fields, you only have a single State field, which by default render as the abbreviation.

image

After

New field added to export state name.

image

Comments

Related GitLab - https://lab.civicrm.org/dev/core/-/issues/724. Probably we should also add state_province_name to the default return properties so its also available on the primary field export?

@civibot
Copy link

civibot bot commented Dec 24, 2021

(Standard links)

@civibot civibot bot added the master label Dec 24, 2021
if (!empty($fields[$contactType]['state_province']) && empty($fields[$contactType]['state_province_name'])) {
$fields[$contactType]['state_province_name'] = $fields[$contactType]['state_province'];
$fields[$contactType]['state_province_name']['title'] = 'State Name';
$fields[$contactType]['state_province']['title'] = 'State Abbreviation';
Copy link
Member

@mlutfy mlutfy Dec 24, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should'ts' be used on the titles?

Also if possible can you use 'State/Province' instead of just 'State'? I know it was previously like that, but it would be more consistent with the rest of CiviCRM.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yashodha
Copy link
Contributor

@jitendrapurohit ready to merge after incorporating @mlutfy 's feedback for translated strings.

@colemanw
Copy link
Member

@jitendrapurohit ^

@mlutfy
Copy link
Member

mlutfy commented Jan 1, 2022

Test fails seem unrelated: c.f. #22352

    CRM_Contribute_Form_Contribution_ConfirmTest.testPayNowPayment
    CRM_Member_Form_MembershipRenewalTest.testSubmit
    CRM_Member_Form_MembershipRenewalTest.testSubmitWithTax
    CRM_Member_Form_MembershipRenewalTest.testSubmitWithTaxOfZero
    CRM_Member_Form_MembershipRenewalTest.testSubmitChangeType
    CRM_Member_Form_MembershipRenewalTest.testSubmitRecur
    CRM_Member_Form_MembershipRenewalTest.testSubmitRecurCompleteInstant
    CRM_Member_Form_MembershipRenewalTest.testSubmitRecurCompleteInstantWithMail with data set #0
    CRM_Member_Form_MembershipRenewalTest.testSubmitRecurCompleteInstantWithMail with data set #1`

@mlutfy
Copy link
Member

mlutfy commented Jan 1, 2022

jenkins, test this please

1 similar comment
@seamuslee001
Copy link
Contributor

jenkins, test this please

@yashodha
Copy link
Contributor

yashodha commented Jan 3, 2022

@jitendrapurohit looks good, merging this. You might want to make sure the column name is displayed as State/Province Name instead of state_province_name.
export

@yashodha yashodha merged commit 7437be6 into civicrm:master Jan 3, 2022
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.

5 participants