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

modified shared address note under contact dashboard #15666

Merged
merged 4 commits into from
Nov 8, 2019

Conversation

revati90
Copy link

Overview

While creating the share address for any contact , if we select contact who don't have address there is no way to jump on the selected contact and edit the address so that we can use that contact in for sharing the address.

Before

While creating a new contact and using shared address feature if selected contact don't have any address it will show the note like Selected contact does not have an address..... There is no such way to update selected contact address under Address tab.

before_shared_address

After

Given patch gives us a link under shared address note itself to jump on selected contact to update contact address.

after_shared_address

Comments

https://lab.civicrm.org/dev/core/issues/1351

@civicrm-builder
Copy link

Can one of the admins verify this patch?

@civibot
Copy link

civibot bot commented Oct 30, 2019

(Standard links)

@civibot civibot bot added the master label Oct 30, 2019
@eileenmcnaughton
Copy link
Contributor

add to whitelist

@eileenmcnaughton
Copy link
Contributor

This looks good but I think we still need the word 'that'

@revati90
Copy link
Author

This looks good but I think we still need the word 'that'

Please check updated PR.

@eileenmcnaughton
Copy link
Contributor

I hate to say this but I think I've spotted another issue! 'That contact' is not translated

Ideally the link html should be paramterised - see
https://docs.civicrm.org/dev/en/latest/translation/

Also it looks like we usually use cmURL eg

<a href="{crmURL p='civicrm/contact/view' q="reset=1&cid=`$row.created_id`"}">{ts}{$row.created_by}{/ts}</a>

It's probably less at risk of breaking on different CMS

@revati90
Copy link
Author

revati90 commented Nov 1, 2019

I hate to say this but I think I've spotted another issue! 'That contact' is not translated

Ideally the link html should be paramterised - see
https://docs.civicrm.org/dev/en/latest/translation/

Also it looks like we usually use cmURL eg

<a href="{crmURL p='civicrm/contact/view' q="reset=1&cid=`$row.created_id`"}">{ts}{$row.created_by}{/ts}</a>

It's probably less at risk of breaking on different CMS

Thanks @eileenmcnaughton ! I have updated PR with required changes. Can you please check once.

@eileenmcnaughton
Copy link
Contributor

Looking good - I think you still need to close the first ts earlier & open a new one at the end - ie

{ts escape='js'}Selected contact does not have an address. Please edit{/ts} & then open another one in a bit

@mlutfy
Copy link
Member

mlutfy commented Nov 2, 2019

hmm, the mix of smarty and javascript from the original code makes this way more complicated to fix/improve than it should.

I'm not sure what's the right way to do this, without rewriting more of the original code to clean it up.

For example, it might be best to move this javascript into a real javascript file, and then we could use the ts javascript-based function.

The current PR mixes smarty and javascript to create URLs, and breaks translation. Sentences should not be split in different 'ts' calls, otherwise they will be impossible to translate accurately.

@mlutfy
Copy link
Member

mlutfy commented Nov 2, 2019

Suggestion from @demeritcowboy on the translation channel chat:

             addressHTML = {/literal}"{ts escape='js'}Selected contact does not have an address. Please click the following link to edit that contact to add an address, or select a different contact.{/ts}"{literal} + ' <a target="_blank" href="' + CRM.url('civicrm/contact/add', 'reset=1&action=update&cid=' + sharedContactId) + '">{/literal}{ts}Edit link{/ts}{literal}</a>';

"Edit Contact Details" might be better than "Edit link" (and already exists as a string in CiviCRM)

@eileenmcnaughton
Copy link
Contributor

OH wow this good drawn out huh? @mlutfy is the final version good

@revati90
Copy link
Author

revati90 commented Nov 7, 2019

OH wow this good drawn out huh? @mlutfy is the final version good

yeah. I agreed. Thanks @mlutfy and @eileenmcnaughton !

@eileenmcnaughton
Copy link
Contributor

test fail not related but I'll run again to get a green tick since I'm hoping to get a last eyeball on this by @mlutfy

@eileenmcnaughton
Copy link
Contributor

test this please

@mlutfy
Copy link
Member

mlutfy commented Nov 8, 2019

I tested this on a demo site and it looks good.

Only nitpick: could you please use "Edit Contact Details" instead of "Edit link"?

Current patch:

Capture d’écran de 2019-11-07 23-38-27

Proposed change would look like this:

Capture d’écran de 2019-11-07 23-39-48

I feel like "Edit link" would mean "Edit the link", which is misleading.

@seamuslee001
Copy link
Contributor

Test fail is un related i'm going to merge this and then do a follow up PR for @mlutfy's improvement

@eileenmcnaughton
Copy link
Contributor

Phew - thanks @revati90 @mlutfy @seamuslee001

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